diff --git a/assets/index-D45ElX74.js b/assets/index-D7wfrfqz.js similarity index 76% rename from assets/index-D45ElX74.js rename to assets/index-D7wfrfqz.js index 24821fc..1a205cf 100644 --- a/assets/index-D45ElX74.js +++ b/assets/index-D7wfrfqz.js @@ -1,4 +1,4 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function XP(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function sj(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var Zz={exports:{}},nA={},Qz={exports:{}},an={};/** +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function $P(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function cj(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var t4={exports:{}},nA={},n4={exports:{}},an={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var z0=Symbol.for("react.element"),oj=Symbol.for("react.portal"),aj=Symbol.for("react.fragment"),lj=Symbol.for("react.strict_mode"),cj=Symbol.for("react.profiler"),uj=Symbol.for("react.provider"),hj=Symbol.for("react.context"),dj=Symbol.for("react.forward_ref"),fj=Symbol.for("react.suspense"),pj=Symbol.for("react.memo"),mj=Symbol.for("react.lazy"),o3=Symbol.iterator;function gj(n){return n===null||typeof n!="object"?null:(n=o3&&n[o3]||n["@@iterator"],typeof n=="function"?n:null)}var e4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},t4=Object.assign,n4={};function Zp(n,e,t){this.props=n,this.context=e,this.refs=n4,this.updater=t||e4}Zp.prototype.isReactComponent={};Zp.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};Zp.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function i4(){}i4.prototype=Zp.prototype;function jP(n,e,t){this.props=n,this.context=e,this.refs=n4,this.updater=t||e4}var YP=jP.prototype=new i4;YP.constructor=jP;t4(YP,Zp.prototype);YP.isPureReactComponent=!0;var a3=Array.isArray,r4=Object.prototype.hasOwnProperty,JP={current:null},s4={key:!0,ref:!0,__self:!0,__source:!0};function o4(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)r4.call(e,i)&&!s4.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,we=O[le];if(0>>1;ler(fe,te))Ter(Se,fe)?(O[le]=Se,O[Te]=te,le=Te):(O[le]=fe,O[q]=te,le=q);else if(Ter(Se,te))O[le]=Se,O[Te]=te,le=Te;else break e}}return Q}function r(O,Q){var te=O.sortIndex-Q.sortIndex;return te!==0?te:O.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,d=3,f=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var Q=t(c);Q!==null;){if(Q.callback===null)i(c);else if(Q.startTime<=O)i(c),Q.sortIndex=Q.expirationTime,e(l,Q);else break;Q=t(c)}}function M(O){if(_=!1,x(O),!v)if(t(l)!==null)v=!0,X(R);else{var Q=t(c);Q!==null&&re(M,Q.startTime-O)}}function R(O,Q){v=!1,_&&(_=!1,m(I),I=-1),f=!0;var te=d;try{for(x(Q),h=t(l);h!==null&&(!(h.expirationTime>Q)||O&&!N());){var le=h.callback;if(typeof le=="function"){h.callback=null,d=h.priorityLevel;var we=le(h.expirationTime<=Q);Q=n.unstable_now(),typeof we=="function"?h.callback=we:h===t(l)&&i(l),x(Q)}else i(l);h=t(l)}if(h!==null)var Ne=!0;else{var q=t(c);q!==null&&re(M,q.startTime-Q),Ne=!1}return Ne}finally{h=null,d=te,f=!1}}var T=!1,P=null,I=-1,b=5,w=-1;function N(){return!(n.unstable_now()-wO||125le?(O.sortIndex=te,e(c,O),t(l)===null&&O===t(c)&&(_?(m(I),I=-1):_=!0,re(M,te-le))):(O.sortIndex=we,e(l,O),v||f||(v=!0,X(R))),O},n.unstable_shouldYield=N,n.unstable_wrapCallback=function(O){var Q=d;return function(){var te=d;d=Q;try{return O.apply(this,arguments)}finally{d=te}}}})(h4);u4.exports=h4;var bj=u4.exports;/** + */(function(n){function e(O,Q){var te=O.length;O.push(Q);e:for(;0>>1,we=O[le];if(0>>1;ler(fe,te))Ter(Se,fe)?(O[le]=Se,O[Te]=te,le=Te):(O[le]=fe,O[q]=te,le=q);else if(Ter(Se,te))O[le]=Se,O[Te]=te,le=Te;else break e}}return Q}function r(O,Q){var te=O.sortIndex-Q.sortIndex;return te!==0?te:O.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,d=3,f=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var Q=t(c);Q!==null;){if(Q.callback===null)i(c);else if(Q.startTime<=O)i(c),Q.sortIndex=Q.expirationTime,e(l,Q);else break;Q=t(c)}}function M(O){if(_=!1,x(O),!v)if(t(l)!==null)v=!0,X(R);else{var Q=t(c);Q!==null&&re(M,Q.startTime-O)}}function R(O,Q){v=!1,_&&(_=!1,m(I),I=-1),f=!0;var te=d;try{for(x(Q),h=t(l);h!==null&&(!(h.expirationTime>Q)||O&&!N());){var le=h.callback;if(typeof le=="function"){h.callback=null,d=h.priorityLevel;var we=le(h.expirationTime<=Q);Q=n.unstable_now(),typeof we=="function"?h.callback=we:h===t(l)&&i(l),x(Q)}else i(l);h=t(l)}if(h!==null)var Ne=!0;else{var q=t(c);q!==null&&re(M,q.startTime-Q),Ne=!1}return Ne}finally{h=null,d=te,f=!1}}var T=!1,P=null,I=-1,b=5,w=-1;function N(){return!(n.unstable_now()-wO||125le?(O.sortIndex=te,e(c,O),t(l)===null&&O===t(c)&&(_?(m(I),I=-1):_=!0,re(M,te-le))):(O.sortIndex=we,e(l,O),v||f||(v=!0,X(R))),O},n.unstable_shouldYield=N,n.unstable_wrapCallback=function(O){var Q=d;return function(){var te=d;d=Q;try{return O.apply(this,arguments)}finally{d=te}}}})(p4);f4.exports=p4;var Ij=f4.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Cj=se,ks=bj;function it(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),RC=Object.prototype.hasOwnProperty,Rj=/^[: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]*$/,c3={},u3={};function Pj(n){return RC.call(u3,n)?!0:RC.call(c3,n)?!1:Rj.test(n)?u3[n]=!0:(c3[n]=!0,!1)}function Ij(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function Lj(n,e,t,i){if(e===null||typeof e>"u"||Ij(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ts(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var or={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){or[n]=new ts(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];or[e]=new ts(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){or[n]=new ts(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){or[n]=new ts(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){or[n]=new ts(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){or[n]=new ts(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){or[n]=new ts(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){or[n]=new ts(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){or[n]=new ts(n,5,!1,n.toLowerCase(),null,!1,!1)});var qP=/[\-:]([a-z])/g;function ZP(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(qP,ZP);or[e]=new ts(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(qP,ZP);or[e]=new ts(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(qP,ZP);or[e]=new ts(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){or[n]=new ts(n,1,!1,n.toLowerCase(),null,!1,!1)});or.xlinkHref=new ts("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){or[n]=new ts(n,1,!1,n.toLowerCase(),null,!0,!0)});function QP(n,e,t,i){var r=or.hasOwnProperty(e)?or[e]:null;(r!==null?r.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bC=Object.prototype.hasOwnProperty,Dj=/^[: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]*$/,d3={},f3={};function Bj(n){return bC.call(f3,n)?!0:bC.call(d3,n)?!1:Dj.test(n)?f3[n]=!0:(d3[n]=!0,!1)}function Nj(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function Uj(n,e,t,i){if(e===null||typeof e>"u"||Nj(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ts(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var or={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){or[n]=new ts(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];or[e]=new ts(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){or[n]=new ts(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){or[n]=new ts(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){or[n]=new ts(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){or[n]=new ts(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){or[n]=new ts(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){or[n]=new ts(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){or[n]=new ts(n,5,!1,n.toLowerCase(),null,!1,!1)});var KP=/[\-:]([a-z])/g;function qP(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(KP,qP);or[e]=new ts(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(KP,qP);or[e]=new ts(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(KP,qP);or[e]=new ts(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){or[n]=new ts(n,1,!1,n.toLowerCase(),null,!1,!1)});or.xlinkHref=new ts("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){or[n]=new ts(n,1,!1,n.toLowerCase(),null,!0,!0)});function ZP(n,e,t,i){var r=or.hasOwnProperty(e)?or[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var l=` -`+r[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{YE=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Rg(n):""}function Dj(n){switch(n.tag){case 5:return Rg(n.type);case 16:return Rg("Lazy");case 13:return Rg("Suspense");case 19:return Rg("SuspenseList");case 0:case 2:case 15:return n=JE(n.type,!1),n;case 11:return n=JE(n.type.render,!1),n;case 1:return n=JE(n.type,!0),n;default:return""}}function DC(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Of:return"Fragment";case Ff:return"Portal";case PC:return"Profiler";case e2:return"StrictMode";case IC:return"Suspense";case LC:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case p4:return(n.displayName||"Context")+".Consumer";case f4:return(n._context.displayName||"Context")+".Provider";case t2:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case n2:return e=n.displayName||null,e!==null?e:DC(n.type)||"Memo";case wc:e=n._payload,n=n._init;try{return DC(n(e))}catch{}}return null}function Bj(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return DC(e);case 8:return e===e2?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Wc(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function g4(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Nj(n){var e=g4(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function g_(n){n._valueTracker||(n._valueTracker=Nj(n))}function v4(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=g4(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function tS(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function BC(n,e){var t=e.checked;return ai({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function d3(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Wc(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function y4(n,e){e=e.checked,e!=null&&QP(n,"checked",e,!1)}function NC(n,e){y4(n,e);var t=Wc(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?UC(n,e.type,t):e.hasOwnProperty("defaultValue")&&UC(n,e.type,Wc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function f3(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function UC(n,e,t){(e!=="number"||tS(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Pg=Array.isArray;function fp(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=v_.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function xv(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Gg={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},Uj=["Webkit","ms","Moz","O"];Object.keys(Gg).forEach(function(n){Uj.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Gg[e]=Gg[n]})});function M4(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Gg.hasOwnProperty(n)&&Gg[n]?(""+e).trim():e+"px"}function A4(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=M4(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var Fj=ai({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 kC(n,e){if(e){if(Fj[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(it(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(it(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(it(61))}if(e.style!=null&&typeof e.style!="object")throw Error(it(62))}}function zC(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var GC=null;function i2(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var HC=null,pp=null,mp=null;function g3(n){if(n=V0(n)){if(typeof HC!="function")throw Error(it(280));var e=n.stateNode;e&&(e=aA(e),HC(n.stateNode,n.type,e))}}function w4(n){pp?mp?mp.push(n):mp=[n]:pp=n}function E4(){if(pp){var n=pp,e=mp;if(mp=pp=null,g3(n),e)for(n=0;n>>=0,n===0?32:31-(Yj(n)/Jj|0)|0}var y_=64,__=4194304;function Ig(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function sS(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=Ig(a):(s&=o,s!==0&&(i=Ig(s)))}else o=t&~r,o!==0?i=Ig(o):s!==0&&(i=Ig(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function G0(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Vo(e),n[e]=t}function Qj(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=Vg),E3=" ",T3=!1;function $4(n,e){switch(n){case"keyup":return bY.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function X4(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var kf=!1;function RY(n,e){switch(n){case"compositionend":return X4(e);case"keypress":return e.which!==32?null:(T3=!0,E3);case"textInput":return n=e.data,n===E3&&T3?null:n;default:return null}}function PY(n,e){if(kf)return n==="compositionend"||!h2&&$4(n,e)?(n=V4(),L1=l2=Lc=null,kf=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=P3(t)}}function K4(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?K4(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function q4(){for(var n=window,e=tS();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=tS(n.document)}return e}function d2(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function kY(n){var e=q4(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&K4(t.ownerDocument.documentElement,t)){if(i!==null&&d2(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=I3(t,s);var o=I3(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,zf=null,YC=null,$g=null,JC=!1;function L3(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;JC||zf==null||zf!==tS(i)||(i=zf,"selectionStart"in i&&d2(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),$g&&Tv($g,i)||($g=i,i=lS(YC,"onSelect"),0Vf||(n.current=tR[Vf],tR[Vf]=null,Vf--)}function Hn(n,e){Vf++,tR[Vf]=n.current,n.current=e}var $c={},Pr=su($c),hs=su(!1),Zh=$c;function bp(n,e){var t=n.type.contextTypes;if(!t)return $c;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function ds(n){return n=n.childContextTypes,n!=null}function uS(){jn(hs),jn(Pr)}function k3(n,e,t){if(Pr.current!==$c)throw Error(it(168));Hn(Pr,e),Hn(hs,t)}function oG(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(it(108,Bj(n)||"Unknown",r));return ai({},t,i)}function hS(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||$c,Zh=Pr.current,Hn(Pr,n),Hn(hs,hs.current),!0}function z3(n,e,t){var i=n.stateNode;if(!i)throw Error(it(169));t?(n=oG(n,e,Zh),i.__reactInternalMemoizedMergedChildContext=n,jn(hs),jn(Pr),Hn(Pr,n)):jn(hs),Hn(hs,t)}var hl=null,lA=!1,cT=!1;function aG(n){hl===null?hl=[n]:hl.push(n)}function qY(n){lA=!0,aG(n)}function ou(){if(!cT&&hl!==null){cT=!0;var n=0,e=In;try{var t=hl;for(In=1;n>=o,r-=o,gl=1<<32-Vo(e)+r|t<I?(b=P,P=null):b=P.sibling;var w=d(m,P,x[I],M);if(w===null){P===null&&(P=b);break}n&&P&&w.alternate===null&&e(m,P),S=s(w,S,I),T===null?R=w:T.sibling=w,T=w,P=b}if(I===x.length)return t(m,P),qn&&oh(m,I),R;if(P===null){for(;II?(b=P,P=null):b=P.sibling;var N=d(m,P,w.value,M);if(N===null){P===null&&(P=b);break}n&&P&&N.alternate===null&&e(m,P),S=s(N,S,I),T===null?R=N:T.sibling=N,T=N,P=b}if(w.done)return t(m,P),qn&&oh(m,I),R;if(P===null){for(;!w.done;I++,w=x.next())w=h(m,w.value,M),w!==null&&(S=s(w,S,I),T===null?R=w:T.sibling=w,T=w);return qn&&oh(m,I),R}for(P=i(m,P);!w.done;I++,w=x.next())w=f(P,m,I,w.value,M),w!==null&&(n&&w.alternate!==null&&P.delete(w.key===null?I:w.key),S=s(w,S,I),T===null?R=w:T.sibling=w,T=w);return n&&P.forEach(function(G){return e(m,G)}),qn&&oh(m,I),R}function y(m,S,x,M){if(typeof x=="object"&&x!==null&&x.type===Of&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case m_:e:{for(var R=x.key,T=S;T!==null;){if(T.key===R){if(R=x.type,R===Of){if(T.tag===7){t(m,T.sibling),S=r(T,x.props.children),S.return=m,m=S;break e}}else if(T.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===wc&&V3(R)===T.type){t(m,T.sibling),S=r(T,x.props),S.ref=Vm(m,T,x),S.return=m,m=S;break e}t(m,T);break}else e(m,T);T=T.sibling}x.type===Of?(S=Fh(x.props.children,m.mode,M,x.key),S.return=m,m=S):(M=z1(x.type,x.key,x.props,null,m.mode,M),M.ref=Vm(m,S,x),M.return=m,m=M)}return o(m);case Ff:e:{for(T=x.key;S!==null;){if(S.key===T)if(S.tag===4&&S.stateNode.containerInfo===x.containerInfo&&S.stateNode.implementation===x.implementation){t(m,S.sibling),S=r(S,x.children||[]),S.return=m,m=S;break e}else{t(m,S);break}else e(m,S);S=S.sibling}S=vT(x,m.mode,M),S.return=m,m=S}return o(m);case wc:return T=x._init,y(m,S,T(x._payload),M)}if(Pg(x))return v(m,S,x,M);if(Om(x))return _(m,S,x,M);T_(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,S!==null&&S.tag===6?(t(m,S.sibling),S=r(S,x),S.return=m,m=S):(t(m,S),S=gT(x,m.mode,M),S.return=m,m=S),o(m)):t(m,S)}return y}var Rp=hG(!0),dG=hG(!1),pS=su(null),mS=null,Xf=null,g2=null;function v2(){g2=Xf=mS=null}function y2(n){var e=pS.current;jn(pS),n._currentValue=e}function rR(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function vp(n,e){mS=n,g2=Xf=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(cs=!0),n.firstContext=null)}function yo(n){var e=n._currentValue;if(g2!==n)if(n={context:n,memoizedValue:e,next:null},Xf===null){if(mS===null)throw Error(it(308));Xf=n,mS.dependencies={lanes:0,firstContext:n}}else Xf=Xf.next=n;return e}var _h=null;function _2(n){_h===null?_h=[n]:_h.push(n)}function fG(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,_2(e)):(t.next=r.next,r.next=t),e.interleaved=t,Dl(n,i)}function Dl(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Ec=!1;function x2(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pG(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Ml(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Oc(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,gn&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Dl(n,t)}return r=i.interleaved,r===null?(e.next=e,_2(i)):(e.next=r.next,r.next=e),i.interleaved=e,Dl(n,t)}function B1(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,s2(n,t)}}function W3(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function gS(n,e,t,i){var r=n.updateQueue;Ec=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=n.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var h=r.baseState;o=0,u=c=l=null,a=s;do{var d=a.lane,f=a.eventTime;if((i&d)===d){u!==null&&(u=u.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=n,_=a;switch(d=e,f=t,_.tag){case 1:if(v=_.payload,typeof v=="function"){h=v.call(f,h,d);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=_.payload,d=typeof v=="function"?v.call(f,h,d):v,d==null)break e;h=ai({},h,d);break e;case 2:Ec=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,d=r.effects,d===null?r.effects=[a]:d.push(a))}else f={eventTime:f,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=f,l=h):u=u.next=f,o|=d;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;d=a,a=d.next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}while(!0);if(u===null&&(l=h),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);td|=o,n.lanes=o,n.memoizedState=h}}function $3(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=hT.transition;hT.transition={};try{n(!1),e()}finally{In=t,hT.transition=i}}function IG(){return _o().memoizedState}function tJ(n,e,t){var i=zc(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},LG(n))DG(e,t);else if(t=fG(n,e,t,i),t!==null){var r=Kr();Wo(t,n,i,r),BG(t,e,i)}}function nJ(n,e,t){var i=zc(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(LG(n))DG(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,jo(a,o)){var l=e.interleaved;l===null?(r.next=r,_2(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=fG(n,e,r,i),t!==null&&(r=Kr(),Wo(t,n,i,r),BG(t,e,i))}}function LG(n){var e=n.alternate;return n===oi||e!==null&&e===oi}function DG(n,e){Xg=yS=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function BG(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,s2(n,t)}}var _S={readContext:yo,useCallback:hr,useContext:hr,useEffect:hr,useImperativeHandle:hr,useInsertionEffect:hr,useLayoutEffect:hr,useMemo:hr,useReducer:hr,useRef:hr,useState:hr,useDebugValue:hr,useDeferredValue:hr,useTransition:hr,useMutableSource:hr,useSyncExternalStore:hr,useId:hr,unstable_isNewReconciler:!1},iJ={readContext:yo,useCallback:function(n,e){return ya().memoizedState=[n,e===void 0?null:e],n},useContext:yo,useEffect:j3,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,U1(4194308,4,TG.bind(null,e,n),t)},useLayoutEffect:function(n,e){return U1(4194308,4,n,e)},useInsertionEffect:function(n,e){return U1(4,2,n,e)},useMemo:function(n,e){var t=ya();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=ya();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=tJ.bind(null,oi,n),[i.memoizedState,n]},useRef:function(n){var e=ya();return n={current:n},e.memoizedState=n},useState:X3,useDebugValue:C2,useDeferredValue:function(n){return ya().memoizedState=n},useTransition:function(){var n=X3(!1),e=n[0];return n=eJ.bind(null,n[1]),ya().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=oi,r=ya();if(qn){if(t===void 0)throw Error(it(407));t=t()}else{if(t=e(),Ki===null)throw Error(it(349));ed&30||yG(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,j3(xG.bind(null,i,s,n),[n]),i.flags|=2048,Bv(9,_G.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=ya(),e=Ki.identifierPrefix;if(qn){var t=vl,i=gl;t=(i&~(1<<32-Vo(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Lv++,0")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{XE=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Pg(n):""}function Fj(n){switch(n.tag){case 5:return Pg(n.type);case 16:return Pg("Lazy");case 13:return Pg("Suspense");case 19:return Pg("SuspenseList");case 0:case 2:case 15:return n=jE(n.type,!1),n;case 11:return n=jE(n.type.render,!1),n;case 1:return n=jE(n.type,!0),n;default:return""}}function IC(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Of:return"Fragment";case Ff:return"Portal";case CC:return"Profiler";case QP:return"StrictMode";case RC:return"Suspense";case PC:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case v4:return(n.displayName||"Context")+".Consumer";case g4:return(n._context.displayName||"Context")+".Provider";case e2:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case t2:return e=n.displayName||null,e!==null?e:IC(n.type)||"Memo";case Ac:e=n._payload,n=n._init;try{return IC(n(e))}catch{}}return null}function Oj(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return IC(e);case 8:return e===QP?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Vc(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function _4(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function kj(n){var e=_4(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function m_(n){n._valueTracker||(n._valueTracker=kj(n))}function x4(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=_4(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function eS(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function LC(n,e){var t=e.checked;return ai({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function m3(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Vc(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function S4(n,e){e=e.checked,e!=null&&ZP(n,"checked",e,!1)}function DC(n,e){S4(n,e);var t=Vc(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?BC(n,e.type,t):e.hasOwnProperty("defaultValue")&&BC(n,e.type,Vc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function g3(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function BC(n,e,t){(e!=="number"||eS(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Ig=Array.isArray;function fp(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=g_.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function xv(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Hg={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},zj=["Webkit","ms","Moz","O"];Object.keys(Hg).forEach(function(n){zj.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Hg[e]=Hg[n]})});function E4(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Hg.hasOwnProperty(n)&&Hg[n]?(""+e).trim():e+"px"}function T4(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=E4(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var Gj=ai({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 FC(n,e){if(e){if(Gj[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(it(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(it(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(it(61))}if(e.style!=null&&typeof e.style!="object")throw Error(it(62))}}function OC(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kC=null;function n2(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var zC=null,pp=null,mp=null;function _3(n){if(n=V0(n)){if(typeof zC!="function")throw Error(it(280));var e=n.stateNode;e&&(e=aA(e),zC(n.stateNode,n.type,e))}}function b4(n){pp?mp?mp.push(n):mp=[n]:pp=n}function C4(){if(pp){var n=pp,e=mp;if(mp=pp=null,_3(n),e)for(n=0;n>>=0,n===0?32:31-(Zj(n)/Qj|0)|0}var v_=64,y_=4194304;function Lg(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function rS(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=Lg(a):(s&=o,s!==0&&(i=Lg(s)))}else o=t&~r,o!==0?i=Lg(o):s!==0&&(i=Lg(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function G0(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Vo(e),n[e]=t}function iY(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=Wg),C3=" ",R3=!1;function Y4(n,e){switch(n){case"keyup":return IY.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J4(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var kf=!1;function DY(n,e){switch(n){case"compositionend":return J4(e);case"keypress":return e.which!==32?null:(R3=!0,C3);case"textInput":return n=e.data,n===C3&&R3?null:n;default:return null}}function BY(n,e){if(kf)return n==="compositionend"||!u2&&Y4(n,e)?(n=X4(),I1=a2=Ic=null,kf=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=D3(t)}}function Q4(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Q4(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function eG(){for(var n=window,e=eS();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=eS(n.document)}return e}function h2(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function VY(n){var e=eG(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Q4(t.ownerDocument.documentElement,t)){if(i!==null&&h2(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=B3(t,s);var o=B3(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,zf=null,XC=null,Xg=null,jC=!1;function N3(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;jC||zf==null||zf!==eS(i)||(i=zf,"selectionStart"in i&&h2(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Xg&&Tv(Xg,i)||(Xg=i,i=aS(XC,"onSelect"),0Vf||(n.current=QC[Vf],QC[Vf]=null,Vf--)}function Hn(n,e){Vf++,QC[Vf]=n.current,n.current=e}var Wc={},Pr=su(Wc),hs=su(!1),Zh=Wc;function bp(n,e){var t=n.type.contextTypes;if(!t)return Wc;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function ds(n){return n=n.childContextTypes,n!=null}function cS(){jn(hs),jn(Pr)}function H3(n,e,t){if(Pr.current!==Wc)throw Error(it(168));Hn(Pr,e),Hn(hs,t)}function cG(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(it(108,Oj(n)||"Unknown",r));return ai({},t,i)}function uS(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Wc,Zh=Pr.current,Hn(Pr,n),Hn(hs,hs.current),!0}function V3(n,e,t){var i=n.stateNode;if(!i)throw Error(it(169));t?(n=cG(n,e,Zh),i.__reactInternalMemoizedMergedChildContext=n,jn(hs),jn(Pr),Hn(Pr,n)):jn(hs),Hn(hs,t)}var hl=null,lA=!1,aT=!1;function uG(n){hl===null?hl=[n]:hl.push(n)}function tJ(n){lA=!0,uG(n)}function ou(){if(!aT&&hl!==null){aT=!0;var n=0,e=Pn;try{var t=hl;for(Pn=1;n>=o,r-=o,gl=1<<32-Vo(e)+r|t<I?(b=P,P=null):b=P.sibling;var w=d(m,P,x[I],M);if(w===null){P===null&&(P=b);break}n&&P&&w.alternate===null&&e(m,P),S=s(w,S,I),T===null?R=w:T.sibling=w,T=w,P=b}if(I===x.length)return t(m,P),qn&&oh(m,I),R;if(P===null){for(;II?(b=P,P=null):b=P.sibling;var N=d(m,P,w.value,M);if(N===null){P===null&&(P=b);break}n&&P&&N.alternate===null&&e(m,P),S=s(N,S,I),T===null?R=N:T.sibling=N,T=N,P=b}if(w.done)return t(m,P),qn&&oh(m,I),R;if(P===null){for(;!w.done;I++,w=x.next())w=h(m,w.value,M),w!==null&&(S=s(w,S,I),T===null?R=w:T.sibling=w,T=w);return qn&&oh(m,I),R}for(P=i(m,P);!w.done;I++,w=x.next())w=f(P,m,I,w.value,M),w!==null&&(n&&w.alternate!==null&&P.delete(w.key===null?I:w.key),S=s(w,S,I),T===null?R=w:T.sibling=w,T=w);return n&&P.forEach(function(G){return e(m,G)}),qn&&oh(m,I),R}function y(m,S,x,M){if(typeof x=="object"&&x!==null&&x.type===Of&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case p_:e:{for(var R=x.key,T=S;T!==null;){if(T.key===R){if(R=x.type,R===Of){if(T.tag===7){t(m,T.sibling),S=r(T,x.props.children),S.return=m,m=S;break e}}else if(T.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Ac&&X3(R)===T.type){t(m,T.sibling),S=r(T,x.props),S.ref=Wm(m,T,x),S.return=m,m=S;break e}t(m,T);break}else e(m,T);T=T.sibling}x.type===Of?(S=Fh(x.props.children,m.mode,M,x.key),S.return=m,m=S):(M=k1(x.type,x.key,x.props,null,m.mode,M),M.ref=Wm(m,S,x),M.return=m,m=M)}return o(m);case Ff:e:{for(T=x.key;S!==null;){if(S.key===T)if(S.tag===4&&S.stateNode.containerInfo===x.containerInfo&&S.stateNode.implementation===x.implementation){t(m,S.sibling),S=r(S,x.children||[]),S.return=m,m=S;break e}else{t(m,S);break}else e(m,S);S=S.sibling}S=mT(x,m.mode,M),S.return=m,m=S}return o(m);case Ac:return T=x._init,y(m,S,T(x._payload),M)}if(Ig(x))return v(m,S,x,M);if(km(x))return _(m,S,x,M);E_(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,S!==null&&S.tag===6?(t(m,S.sibling),S=r(S,x),S.return=m,m=S):(t(m,S),S=pT(x,m.mode,M),S.return=m,m=S),o(m)):t(m,S)}return y}var Rp=pG(!0),mG=pG(!1),fS=su(null),pS=null,Xf=null,m2=null;function g2(){m2=Xf=pS=null}function v2(n){var e=fS.current;jn(fS),n._currentValue=e}function nR(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function vp(n,e){pS=n,m2=Xf=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(cs=!0),n.firstContext=null)}function yo(n){var e=n._currentValue;if(m2!==n)if(n={context:n,memoizedValue:e,next:null},Xf===null){if(pS===null)throw Error(it(308));Xf=n,pS.dependencies={lanes:0,firstContext:n}}else Xf=Xf.next=n;return e}var _h=null;function y2(n){_h===null?_h=[n]:_h.push(n)}function gG(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,y2(e)):(t.next=r.next,r.next=t),e.interleaved=t,Dl(n,i)}function Dl(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var wc=!1;function _2(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vG(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Ml(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Fc(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,gn&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Dl(n,t)}return r=i.interleaved,r===null?(e.next=e,y2(i)):(e.next=r.next,r.next=e),i.interleaved=e,Dl(n,t)}function D1(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,r2(n,t)}}function j3(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function mS(n,e,t,i){var r=n.updateQueue;wc=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=n.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var h=r.baseState;o=0,u=c=l=null,a=s;do{var d=a.lane,f=a.eventTime;if((i&d)===d){u!==null&&(u=u.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=n,_=a;switch(d=e,f=t,_.tag){case 1:if(v=_.payload,typeof v=="function"){h=v.call(f,h,d);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=_.payload,d=typeof v=="function"?v.call(f,h,d):v,d==null)break e;h=ai({},h,d);break e;case 2:wc=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,d=r.effects,d===null?r.effects=[a]:d.push(a))}else f={eventTime:f,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=f,l=h):u=u.next=f,o|=d;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;d=a,a=d.next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}while(!0);if(u===null&&(l=h),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);td|=o,n.lanes=o,n.memoizedState=h}}function Y3(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=cT.transition;cT.transition={};try{n(!1),e()}finally{Pn=t,cT.transition=i}}function BG(){return _o().memoizedState}function sJ(n,e,t){var i=kc(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},NG(n))UG(e,t);else if(t=gG(n,e,t,i),t!==null){var r=Kr();Wo(t,n,i,r),FG(t,e,i)}}function oJ(n,e,t){var i=kc(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(NG(n))UG(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,jo(a,o)){var l=e.interleaved;l===null?(r.next=r,y2(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=gG(n,e,r,i),t!==null&&(r=Kr(),Wo(t,n,i,r),FG(t,e,i))}}function NG(n){var e=n.alternate;return n===oi||e!==null&&e===oi}function UG(n,e){jg=vS=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function FG(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,r2(n,t)}}var yS={readContext:yo,useCallback:hr,useContext:hr,useEffect:hr,useImperativeHandle:hr,useInsertionEffect:hr,useLayoutEffect:hr,useMemo:hr,useReducer:hr,useRef:hr,useState:hr,useDebugValue:hr,useDeferredValue:hr,useTransition:hr,useMutableSource:hr,useSyncExternalStore:hr,useId:hr,unstable_isNewReconciler:!1},aJ={readContext:yo,useCallback:function(n,e){return ya().memoizedState=[n,e===void 0?null:e],n},useContext:yo,useEffect:K3,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,N1(4194308,4,RG.bind(null,e,n),t)},useLayoutEffect:function(n,e){return N1(4194308,4,n,e)},useInsertionEffect:function(n,e){return N1(4,2,n,e)},useMemo:function(n,e){var t=ya();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=ya();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=sJ.bind(null,oi,n),[i.memoizedState,n]},useRef:function(n){var e=ya();return n={current:n},e.memoizedState=n},useState:J3,useDebugValue:b2,useDeferredValue:function(n){return ya().memoizedState=n},useTransition:function(){var n=J3(!1),e=n[0];return n=rJ.bind(null,n[1]),ya().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=oi,r=ya();if(qn){if(t===void 0)throw Error(it(407));t=t()}else{if(t=e(),Ki===null)throw Error(it(349));ed&30||SG(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,K3(AG.bind(null,i,s,n),[n]),i.flags|=2048,Bv(9,MG.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=ya(),e=Ki.identifierPrefix;if(qn){var t=vl,i=gl;t=(i&~(1<<32-Vo(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=Lv++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Sa]=e,n[Rv]=i,WG(n,e,!1,!1),e.stateNode=n;e:{switch(o=zC(t,i),t){case"dialog":Xn("cancel",n),Xn("close",n),r=i;break;case"iframe":case"object":case"embed":Xn("load",n),r=i;break;case"video":case"audio":for(r=0;rLp&&(e.flags|=128,i=!0,Wm(s,!1),e.lanes=4194304)}else{if(!i)if(n=vS(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Wm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!qn)return dr(e),null}else 2*Ai()-s.renderingStartTime>Lp&&t!==1073741824&&(e.flags|=128,i=!0,Wm(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ai(),e.sibling=null,t=ei.current,Hn(ei,i?t&1|2:t&1),e):(dr(e),null);case 22:case 23:return B2(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Cs&1073741824&&(dr(e),e.subtreeFlags&6&&(e.flags|=8192)):dr(e),null;case 24:return null;case 25:return null}throw Error(it(156,e.tag))}function hJ(n,e){switch(p2(e),e.tag){case 1:return ds(e.type)&&uS(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Pp(),jn(hs),jn(Pr),A2(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return M2(e),null;case 13:if(jn(ei),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(it(340));Cp()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return jn(ei),null;case 4:return Pp(),null;case 10:return y2(e.type._context),null;case 22:case 23:return B2(),null;case 24:return null;default:return null}}var C_=!1,xr=!1,dJ=typeof WeakSet=="function"?WeakSet:Set,xt=null;function jf(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){di(n,e,i)}else t.current=null}function fR(n,e,t){try{t()}catch(i){di(n,e,i)}}var rN=!1;function fJ(n,e){if(KC=oS,n=q4(),d2(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,c=0,u=0,h=n,d=null;t:for(;;){for(var f;h!==t||r!==0&&h.nodeType!==3||(a=o+r),h!==s||i!==0&&h.nodeType!==3||(l=o+i),h.nodeType===3&&(o+=h.nodeValue.length),(f=h.firstChild)!==null;)d=h,h=f;for(;;){if(h===n)break t;if(d===t&&++c===r&&(a=o),d===s&&++u===i&&(l=o),(f=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(qC={focusedElem:n,selectionRange:t},oS=!1,xt=e;xt!==null;)if(e=xt,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,xt=n;else for(;xt!==null;){e=xt;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var _=v.memoizedProps,y=v.memoizedState,m=e.stateNode,S=m.getSnapshotBeforeUpdate(e.elementType===e.type?_:Bo(e.type,_),y);m.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(it(163))}}catch(M){di(e,e.return,M)}if(n=e.sibling,n!==null){n.return=e.return,xt=n;break}xt=e.return}return v=rN,rN=!1,v}function jg(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&fR(e,t,s)}r=r.next}while(r!==i)}}function hA(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function pR(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function jG(n){var e=n.alternate;e!==null&&(n.alternate=null,jG(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Sa],delete e[Rv],delete e[eR],delete e[JY],delete e[KY])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function YG(n){return n.tag===5||n.tag===3||n.tag===4}function sN(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||YG(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function mR(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=cS));else if(i!==4&&(n=n.child,n!==null))for(mR(n,e,t),n=n.sibling;n!==null;)mR(n,e,t),n=n.sibling}function gR(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(gR(n,e,t),n=n.sibling;n!==null;)gR(n,e,t),n=n.sibling}var tr=null,Uo=!1;function ec(n,e,t){for(t=t.child;t!==null;)JG(n,e,t),t=t.sibling}function JG(n,e,t){if(ba&&typeof ba.onCommitFiberUnmount=="function")try{ba.onCommitFiberUnmount(iA,t)}catch{}switch(t.tag){case 5:xr||jf(t,e);case 6:var i=tr,r=Uo;tr=null,ec(n,e,t),tr=i,Uo=r,tr!==null&&(Uo?(n=tr,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):tr.removeChild(t.stateNode));break;case 18:tr!==null&&(Uo?(n=tr,t=t.stateNode,n.nodeType===8?lT(n.parentNode,t):n.nodeType===1&&lT(n,t),wv(n)):lT(tr,t.stateNode));break;case 4:i=tr,r=Uo,tr=t.stateNode.containerInfo,Uo=!0,ec(n,e,t),tr=i,Uo=r;break;case 0:case 11:case 14:case 15:if(!xr&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&fR(t,e,o),r=r.next}while(r!==i)}ec(n,e,t);break;case 1:if(!xr&&(jf(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){di(t,e,a)}ec(n,e,t);break;case 21:ec(n,e,t);break;case 22:t.mode&1?(xr=(i=xr)||t.memoizedState!==null,ec(n,e,t),xr=i):ec(n,e,t);break;default:ec(n,e,t)}}function oN(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new dJ),e.forEach(function(i){var r=MJ.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function To(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=Ai()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*mJ(i/1960))-i,10n?16:n,Dc===null)var i=!1;else{if(n=Dc,Dc=null,MS=0,gn&6)throw Error(it(331));var r=gn;for(gn|=4,xt=n.current;xt!==null;){var s=xt,o=s.child;if(xt.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lAi()-L2?Uh(n,0):I2|=t),fs(n,e)}function iH(n,e){e===0&&(n.mode&1?(e=__,__<<=1,!(__&130023424)&&(__=4194304)):e=1);var t=Kr();n=Dl(n,e),n!==null&&(G0(n,e,t),fs(n,t))}function SJ(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),iH(n,t)}function MJ(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(it(314))}i!==null&&i.delete(e),iH(n,t)}var rH;rH=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||hs.current)cs=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return cs=!1,cJ(n,e,t);cs=!!(n.flags&131072)}else cs=!1,qn&&e.flags&1048576&&lG(e,fS,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;F1(n,e),n=e.pendingProps;var r=bp(e,Pr.current);vp(e,t),r=E2(null,e,i,n,r,t);var s=T2();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ds(i)?(s=!0,hS(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,x2(e),r.updater=uA,e.stateNode=r,r._reactInternals=e,oR(e,i,n,t),e=cR(null,e,i,!0,s,t)):(e.tag=0,qn&&s&&f2(e),Vr(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(F1(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=wJ(i),n=Bo(i,n),r){case 0:e=lR(null,e,i,n,t);break e;case 1:e=tN(null,e,i,n,t);break e;case 11:e=Q3(null,e,i,n,t);break e;case 14:e=eN(null,e,i,Bo(i.type,n),t);break e}throw Error(it(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bo(i,r),lR(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bo(i,r),tN(n,e,i,r,t);case 3:e:{if(GG(e),n===null)throw Error(it(387));i=e.pendingProps,s=e.memoizedState,r=s.element,pG(n,e),gS(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Ip(Error(it(423)),e),e=nN(n,e,i,t,r);break e}else if(i!==r){r=Ip(Error(it(424)),e),e=nN(n,e,i,t,r);break e}else for(Ps=Fc(e.stateNode.containerInfo.firstChild),Bs=e,qn=!0,Fo=null,t=dG(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Cp(),i===r){e=Bl(n,e,t);break e}Vr(n,e,i,t)}e=e.child}return e;case 5:return mG(e),n===null&&iR(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,ZC(i,r)?o=null:s!==null&&ZC(i,s)&&(e.flags|=32),zG(n,e),Vr(n,e,o,t),e.child;case 6:return n===null&&iR(e),null;case 13:return HG(n,e,t);case 4:return S2(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Rp(e,null,i,t):Vr(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bo(i,r),Q3(n,e,i,r,t);case 7:return Vr(n,e,e.pendingProps,t),e.child;case 8:return Vr(n,e,e.pendingProps.children,t),e.child;case 12:return Vr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,Hn(pS,i._currentValue),i._currentValue=o,s!==null)if(jo(s.value,o)){if(s.children===r.children&&!hs.current){e=Bl(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Ml(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),rR(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(it(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),rR(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Vr(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,vp(e,t),r=yo(r),i=i(r),e.flags|=1,Vr(n,e,i,t),e.child;case 14:return i=e.type,r=Bo(i,e.pendingProps),r=Bo(i.type,r),eN(n,e,i,r,t);case 15:return OG(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bo(i,r),F1(n,e),e.tag=1,ds(i)?(n=!0,hS(e)):n=!1,vp(e,t),NG(e,i,r),oR(e,i,r,t),cR(null,e,i,!0,n,t);case 19:return VG(n,e,t);case 22:return kG(n,e,t)}throw Error(it(156,e.tag))};function sH(n,e){return L4(n,e)}function AJ(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ho(n,e,t,i){return new AJ(n,e,t,i)}function U2(n){return n=n.prototype,!(!n||!n.isReactComponent)}function wJ(n){if(typeof n=="function")return U2(n)?1:0;if(n!=null){if(n=n.$$typeof,n===t2)return 11;if(n===n2)return 14}return 2}function Gc(n,e){var t=n.alternate;return t===null?(t=ho(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function z1(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")U2(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Of:return Fh(t.children,r,s,e);case e2:o=8,r|=8;break;case PC:return n=ho(12,t,e,r|2),n.elementType=PC,n.lanes=s,n;case IC:return n=ho(13,t,e,r),n.elementType=IC,n.lanes=s,n;case LC:return n=ho(19,t,e,r),n.elementType=LC,n.lanes=s,n;case m4:return fA(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case f4:o=10;break e;case p4:o=9;break e;case t2:o=11;break e;case n2:o=14;break e;case wc:o=16,i=null;break e}throw Error(it(130,n==null?n:typeof n,""))}return e=ho(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Fh(n,e,t,i){return n=ho(7,n,i,e),n.lanes=t,n}function fA(n,e,t,i){return n=ho(22,n,i,e),n.elementType=m4,n.lanes=t,n.stateNode={isHidden:!1},n}function gT(n,e,t){return n=ho(6,n,null,e),n.lanes=t,n}function vT(n,e,t){return e=ho(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function EJ(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qE(0),this.expirationTimes=qE(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qE(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function F2(n,e,t,i,r,s,o,a,l){return n=new EJ(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ho(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},x2(s),n}function TJ(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cH)}catch(n){console.error(n)}}cH(),c4.exports=Ws;var IJ=c4.exports,uH,pN=IJ;uH=CC.createRoot=pN.createRoot,CC.hydrateRoot=pN.hydrateRoot;var hH={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},mN=Qt.createContext&&Qt.createContext(hH),LJ=["attr","size","title"];function DJ(n,e){if(n==null)return{};var t=BJ(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function BJ(n,e){if(n==null)return{};var t={};for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){if(e.indexOf(i)>=0)continue;t[i]=n[i]}return t}function ES(){return ES=Object.assign?Object.assign.bind():function(n){for(var e=1;eQt.createElement(e.tag,TS({key:t},e.attr),dH(e.child)))}function au(n){return e=>Qt.createElement(OJ,ES({attr:TS({},n.attr)},e),dH(n.child))}function OJ(n){var e=t=>{var{attr:i,size:r,title:s}=n,o=DJ(n,LJ),a=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),Qt.createElement("svg",ES({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,o,{className:l,style:TS(TS({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&Qt.createElement("title",null,s),n.children)};return mN!==void 0?Qt.createElement(mN.Consumer,null,t=>e(t)):e(hH)}function kJ(n){return au({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951"},child:[]}]})(n)}function zJ(n){return au({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8"},child:[]}]})(n)}function GJ(n){return au({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.9 3.9 0 0 0-1.417.923A3.9 3.9 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.9 3.9 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.9 3.9 0 0 0-.923-1.417A3.9 3.9 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599s.453.546.598.92c.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.5 2.5 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.5 2.5 0 0 1-.92-.598 2.5 2.5 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233s.008-2.388.046-3.231c.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92s.546-.453.92-.598c.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92m-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217m0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334"},child:[]}]})(n)}function HJ(n){return au({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z"},child:[]}]})(n)}const G2=[{name:"Github",url:"https://github.com/NivSv",icon:zJ},{name:"Linkedin",url:"https://www.linkedin.com/in/niv-shtibel/",icon:HJ},{name:"Facebook",url:"https://www.facebook.com/NivSvv/",icon:kJ},{name:"Instagram",url:"https://www.instagram.com/niv_sv/",icon:GJ}],VJ=()=>{const n=e=>{window.open(e,"_blank")};return pe.jsxs("div",{className:"fixed bottom-0 left-[4%] hidden flex-col-reverse items-center md:flex z-20",children:[pe.jsx("div",{className:"bg-primary w-[2px] h-[80px]"}),pe.jsx("div",{className:"mb-4 flex flex-col gap-4",children:G2.map((e,t)=>pe.jsx("div",{onClick:()=>n(e.url),onKeyDown:()=>n(e.url),role:"button",tabIndex:t,title:e.name,className:"group hover:translate-y-[-4px] transition-all duration-400",children:pe.jsx(e.icon,{size:20,className:"fill-primary group-hover:fill-callToAction"})},t))})]})},vN="NivSvb@gmail.com",WJ=()=>pe.jsxs("div",{className:"fixed bottom-0 right-[4%] hidden flex-col-reverse items-center md:flex z-20",children:[pe.jsx("div",{className:" bg-primary w-[2px] h-[80px]"}),pe.jsx("div",{className:"w-0",children:pe.jsx("div",{dir:"rtl",className:"text-primary tracking-wider rotate-90 whitespace-nowrap hover:translate-y-[-4px] transition-all duration-400 hover:text-callToAction",children:pe.jsx("a",{href:`mailto:${vN}`,children:vN})})})]});function fH(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(e=0;en&&(e=0,i=t,t=new Map)}return{get:function(o){var a=t.get(o);if(a!==void 0)return a;if((a=i.get(o))!==void 0)return r(o,a),a},set:function(o,a){t.has(o)?t.set(o,a):r(o,a)}}}var gH="!";function ZJ(n){var e=n.separator||":",t=e.length===1,i=e[0],r=e.length;return function(o){for(var a=[],l=0,c=0,u,h=0;hc?u-c:void 0;return{modifiers:a,hasImportantModifier:v,baseClassName:_,maybePostfixModifierPosition:y}}}function QJ(n){if(n.length<=1)return n;var e=[],t=[];return n.forEach(function(i){var r=i[0]==="[";r?(e.push.apply(e,t.sort().concat([i])),t=[]):t.push(i)}),e.push.apply(e,t.sort()),e}function eK(n){return{cache:qJ(n.cacheSize),splitModifiers:ZJ(n),...XJ(n)}}var tK=/\s+/;function nK(n,e){var t=e.splitModifiers,i=e.getClassGroupId,r=e.getConflictingClassGroupIds,s=new Set;return n.trim().split(tK).map(function(o){var a=t(o),l=a.modifiers,c=a.hasImportantModifier,u=a.baseClassName,h=a.maybePostfixModifierPosition,d=i(h?u.substring(0,h):u),f=!!h;if(!d){if(!h)return{isTailwindClass:!1,originalClassName:o};if(d=i(u),!d)return{isTailwindClass:!1,originalClassName:o};f=!1}var v=QJ(l).join(":"),_=c?v+gH:v;return{isTailwindClass:!0,modifierId:_,classGroupId:d,originalClassName:o,hasPostfixModifier:f}}).reverse().filter(function(o){if(!o.isTailwindClass)return!0;var a=o.modifierId,l=o.classGroupId,c=o.hasPostfixModifier,u=a+l;return s.has(u)?!1:(s.add(u),r(l,c).forEach(function(h){return s.add(a+h)}),!0)}).reverse().map(function(o){return o.originalClassName}).join(" ")}function iK(){for(var n=arguments.length,e=new Array(n),t=0;tn.reduce((t,i,r)=>t.concat(i||[],e[r]||[]),[]),MK=(n,e="")=>{let t=n.join(" ").trim().replace(/\n/g," ").replace(/\s{2,}/g," ").split(" ").filter(r=>r!==","),i=e?e.split(" "):[];return yK(...t.concat(i).filter(r=>r!==" "))},AK=([n])=>n.charAt(0)!=="$",yT=n=>n[_H]===!0,xH=n=>(e,...t)=>{let i=(r=[])=>{let s=Qt.forwardRef((o,a)=>{let{$as:l=n,style:c={},...u}=o,h=yT(n)?n:l,d=r?r.reduce((v,_)=>Object.assign(v,typeof _=="function"?_(o):_),{}):{},f=yT(h)?u:Object.fromEntries(Object.entries(u).filter(AK));return Qt.createElement(h,{...f,style:{...d,...c},ref:a,className:MK(SK(e,t.map(v=>v({...u,$as:l}))),u.className),...yT(n)?{$as:l}:{}})});return s[_H]=!0,typeof n!="string"?s.displayName=n.displayName||n.name||"tw.Component":s.displayName="tw."+n,s.withStyle=o=>i(r.concat(o)),s};return i()},wK=xK.reduce((n,e)=>({...n,[e]:xH(e)}),{}),EK=Object.assign(xH,wK),SH=EK;const TK=SH.div` +`+s.stack}return{value:n,source:e,stack:r,digest:null}}function dT(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function sR(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var uJ=typeof WeakMap=="function"?WeakMap:Map;function kG(n,e,t){t=Ml(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){xS||(xS=!0,mR=i),sR(n,e)},t}function zG(n,e,t){t=Ml(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;t.payload=function(){return i(r)},t.callback=function(){sR(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){sR(n,e),typeof i!="function"&&(Oc===null?Oc=new Set([this]):Oc.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function Q3(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new uJ;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(t)||(r.add(t),n=wJ.bind(null,n,e,t),e.then(n,n))}function eN(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function tN(n,e,t,i,r){return n.mode&1?(n.flags|=65536,n.lanes=r,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=Ml(-1,1),e.tag=2,Fc(t,e,1))),t.lanes|=1),n)}var hJ=Hl.ReactCurrentOwner,cs=!1;function Vr(n,e,t,i){e.child=n===null?mG(e,null,t,i):Rp(e,n.child,t,i)}function nN(n,e,t,i,r){t=t.render;var s=e.ref;return vp(e,r),i=w2(n,e,t,i,s,r),t=E2(),n!==null&&!cs?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,Bl(n,e,r)):(qn&&t&&d2(e),e.flags|=1,Vr(n,e,i,r),e.child)}function iN(n,e,t,i,r){if(n===null){var s=t.type;return typeof s=="function"&&!N2(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,GG(n,e,s,i,r)):(n=k1(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&r)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:Tv,t(o,i)&&n.ref===e.ref)return Bl(n,e,r)}return e.flags|=1,n=zc(s,i),n.ref=e.ref,n.return=e,e.child=n}function GG(n,e,t,i,r){if(n!==null){var s=n.memoizedProps;if(Tv(s,i)&&n.ref===e.ref)if(cs=!1,e.pendingProps=i=s,(n.lanes&r)!==0)n.flags&131072&&(cs=!0);else return e.lanes=n.lanes,Bl(n,e,r)}return oR(n,e,t,i,r)}function HG(n,e,t){var i=e.pendingProps,r=i.children,s=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Hn(Yf,Cs),Cs|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Hn(Yf,Cs),Cs|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:t,Hn(Yf,Cs),Cs|=i}else s!==null?(i=s.baseLanes|t,e.memoizedState=null):i=t,Hn(Yf,Cs),Cs|=i;return Vr(n,e,r,t),e.child}function VG(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function oR(n,e,t,i,r){var s=ds(t)?Zh:Pr.current;return s=bp(e,s),vp(e,r),t=w2(n,e,t,i,s,r),i=E2(),n!==null&&!cs?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,Bl(n,e,r)):(qn&&i&&d2(e),e.flags|=1,Vr(n,e,t,r),e.child)}function rN(n,e,t,i,r){if(ds(t)){var s=!0;uS(e)}else s=!1;if(vp(e,r),e.stateNode===null)U1(n,e),OG(e,t,i),rR(e,t,i,r),i=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=t.contextType;typeof c=="object"&&c!==null?c=yo(c):(c=ds(t)?Zh:Pr.current,c=bp(e,c));var u=t.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==c)&&Z3(e,o,i,c),wc=!1;var d=e.memoizedState;o.state=d,mS(e,i,o,r),l=e.memoizedState,a!==i||d!==l||hs.current||wc?(typeof u=="function"&&(iR(e,t,u,i),l=e.memoizedState),(a=wc||q3(e,t,a,i,d,l,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),o.props=i,o.state=l,o.context=c,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,vG(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:Bo(e.type,a),o.props=c,h=e.pendingProps,d=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=yo(l):(l=ds(t)?Zh:Pr.current,l=bp(e,l));var f=t.getDerivedStateFromProps;(u=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||d!==l)&&Z3(e,o,i,l),wc=!1,d=e.memoizedState,o.state=d,mS(e,i,o,r);var v=e.memoizedState;a!==h||d!==v||hs.current||wc?(typeof f=="function"&&(iR(e,t,f,i),v=e.memoizedState),(c=wc||q3(e,t,c,i,d,v,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,v,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&d===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&d===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=v),o.props=i,o.state=v,o.context=l,i=c):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&d===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&d===n.memoizedState||(e.flags|=1024),i=!1)}return aR(n,e,t,i,s,r)}function aR(n,e,t,i,r,s){VG(n,e);var o=(e.flags&128)!==0;if(!i&&!o)return r&&V3(e,t,!1),Bl(n,e,s);i=e.stateNode,hJ.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&o?(e.child=Rp(e,n.child,null,s),e.child=Rp(e,null,a,s)):Vr(n,e,a,s),e.memoizedState=i.state,r&&V3(e,t,!0),e.child}function WG(n){var e=n.stateNode;e.pendingContext?H3(n,e.pendingContext,e.pendingContext!==e.context):e.context&&H3(n,e.context,!1),x2(n,e.containerInfo)}function sN(n,e,t,i,r){return Cp(),p2(r),e.flags|=256,Vr(n,e,t,i),e.child}var lR={dehydrated:null,treeContext:null,retryLane:0};function cR(n){return{baseLanes:n,cachePool:null,transitions:null}}function $G(n,e,t){var i=e.pendingProps,r=ei.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(r&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(r|=1),Hn(ei,r&1),n===null)return tR(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=i.children,n=i.fallback,s?(i=e.mode,s=e.child,o={mode:"hidden",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=fA(o,i,0,null),n=Fh(n,i,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=cR(t),e.memoizedState=lR,n):C2(e,o));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return dJ(n,e,o,i,a,r,t);if(s){s=i.fallback,o=e.mode,r=n.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=zc(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=zc(a,s):(s=Fh(s,o,t,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,o=n.child.memoizedState,o=o===null?cR(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=lR,i}return s=n.child,n=s.sibling,i=zc(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function C2(n,e){return e=fA({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function T_(n,e,t,i){return i!==null&&p2(i),Rp(e,n.child,null,t),n=C2(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function dJ(n,e,t,i,r,s,o){if(t)return e.flags&256?(e.flags&=-257,i=dT(Error(it(422))),T_(n,e,o,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=fA({mode:"visible",children:i.children},r,0,null),s=Fh(s,r,o,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&Rp(e,n.child,null,o),e.child.memoizedState=cR(o),e.memoizedState=lR,s);if(!(e.mode&1))return T_(n,e,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(it(419)),i=dT(s,i,void 0),T_(n,e,o,i)}if(a=(o&n.childLanes)!==0,cs||a){if(i=Ki,i!==null){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|o)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,Dl(n,r),Wo(i,n,r,-1))}return B2(),i=dT(Error(it(421))),T_(n,e,o,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=EJ.bind(null,n),r._reactRetry=e,null):(n=s.treeContext,Ps=Uc(r.nextSibling),Bs=e,qn=!0,Fo=null,n!==null&&(co[uo++]=gl,co[uo++]=vl,co[uo++]=Qh,gl=n.id,vl=n.overflow,Qh=e),e=C2(e,i.children),e.flags|=4096,e)}function oN(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),nR(n.return,e,t)}function fT(n,e,t,i,r){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=t,s.tailMode=r)}function XG(n,e,t){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(Vr(n,e,i.children,t),i=ei.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&oN(n,t,e);else if(n.tag===19)oN(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(Hn(ei,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&gS(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),fT(e,!1,r,t,s);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&gS(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}fT(e,!0,t,null,s);break;case"together":fT(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function U1(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function Bl(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),td|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(it(153));if(e.child!==null){for(n=e.child,t=zc(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=zc(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function fJ(n,e,t){switch(e.tag){case 3:WG(e),Cp();break;case 5:yG(e);break;case 1:ds(e.type)&&uS(e);break;case 4:x2(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;Hn(fS,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(Hn(ei,ei.current&1),e.flags|=128,null):t&e.child.childLanes?$G(n,e,t):(Hn(ei,ei.current&1),n=Bl(n,e,t),n!==null?n.sibling:null);Hn(ei,ei.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return XG(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Hn(ei,ei.current),i)break;return null;case 22:case 23:return e.lanes=0,HG(n,e,t)}return Bl(n,e,t)}var jG,uR,YG,JG;jG=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};uR=function(){};YG=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,xh(Ca.current);var s=null;switch(t){case"input":r=LC(n,r),i=LC(n,i),s=[];break;case"select":r=ai({},r,{value:void 0}),i=ai({},i,{value:void 0}),s=[];break;case"textarea":r=NC(n,r),i=NC(n,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=lS)}FC(t,i);var o;t=null;for(c in r)if(!i.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(_v.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in i){var l=i[c];if(a=r!=null?r[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(_v.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Xn("scroll",n),s||a===l||(s=[])):(s=s||[]).push(c,l))}t&&(s=s||[]).push("style",t);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};JG=function(n,e,t,i){t!==i&&(e.flags|=4)};function $m(n,e){if(!qn)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function dr(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=n,r=r.sibling;else for(r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=n,r=r.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function pJ(n,e,t){var i=e.pendingProps;switch(f2(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dr(e),null;case 1:return ds(e.type)&&cS(),dr(e),null;case 3:return i=e.stateNode,Pp(),jn(hs),jn(Pr),M2(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(w_(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Fo!==null&&(yR(Fo),Fo=null))),uR(n,e),dr(e),null;case 5:S2(e);var r=xh(Iv.current);if(t=e.type,n!==null&&e.stateNode!=null)YG(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(it(166));return dr(e),null}if(n=xh(Ca.current),w_(e)){i=e.stateNode,t=e.type;var s=e.memoizedProps;switch(i[Sa]=e,i[Rv]=s,n=(e.mode&1)!==0,t){case"dialog":Xn("cancel",i),Xn("close",i);break;case"iframe":case"object":case"embed":Xn("load",i);break;case"video":case"audio":for(r=0;r<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Sa]=e,n[Rv]=i,jG(n,e,!1,!1),e.stateNode=n;e:{switch(o=OC(t,i),t){case"dialog":Xn("cancel",n),Xn("close",n),r=i;break;case"iframe":case"object":case"embed":Xn("load",n),r=i;break;case"video":case"audio":for(r=0;rLp&&(e.flags|=128,i=!0,$m(s,!1),e.lanes=4194304)}else{if(!i)if(n=gS(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),$m(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!qn)return dr(e),null}else 2*Ai()-s.renderingStartTime>Lp&&t!==1073741824&&(e.flags|=128,i=!0,$m(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ai(),e.sibling=null,t=ei.current,Hn(ei,i?t&1|2:t&1),e):(dr(e),null);case 22:case 23:return D2(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Cs&1073741824&&(dr(e),e.subtreeFlags&6&&(e.flags|=8192)):dr(e),null;case 24:return null;case 25:return null}throw Error(it(156,e.tag))}function mJ(n,e){switch(f2(e),e.tag){case 1:return ds(e.type)&&cS(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Pp(),jn(hs),jn(Pr),M2(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return S2(e),null;case 13:if(jn(ei),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(it(340));Cp()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return jn(ei),null;case 4:return Pp(),null;case 10:return v2(e.type._context),null;case 22:case 23:return D2(),null;case 24:return null;default:return null}}var b_=!1,xr=!1,gJ=typeof WeakSet=="function"?WeakSet:Set,xt=null;function jf(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){di(n,e,i)}else t.current=null}function hR(n,e,t){try{t()}catch(i){di(n,e,i)}}var aN=!1;function vJ(n,e){if(YC=sS,n=eG(),h2(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,c=0,u=0,h=n,d=null;t:for(;;){for(var f;h!==t||r!==0&&h.nodeType!==3||(a=o+r),h!==s||i!==0&&h.nodeType!==3||(l=o+i),h.nodeType===3&&(o+=h.nodeValue.length),(f=h.firstChild)!==null;)d=h,h=f;for(;;){if(h===n)break t;if(d===t&&++c===r&&(a=o),d===s&&++u===i&&(l=o),(f=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(JC={focusedElem:n,selectionRange:t},sS=!1,xt=e;xt!==null;)if(e=xt,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,xt=n;else for(;xt!==null;){e=xt;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var _=v.memoizedProps,y=v.memoizedState,m=e.stateNode,S=m.getSnapshotBeforeUpdate(e.elementType===e.type?_:Bo(e.type,_),y);m.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(it(163))}}catch(M){di(e,e.return,M)}if(n=e.sibling,n!==null){n.return=e.return,xt=n;break}xt=e.return}return v=aN,aN=!1,v}function Yg(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&hR(e,t,s)}r=r.next}while(r!==i)}}function hA(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function dR(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function KG(n){var e=n.alternate;e!==null&&(n.alternate=null,KG(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Sa],delete e[Rv],delete e[ZC],delete e[QY],delete e[eJ])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function qG(n){return n.tag===5||n.tag===3||n.tag===4}function lN(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||qG(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function fR(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=lS));else if(i!==4&&(n=n.child,n!==null))for(fR(n,e,t),n=n.sibling;n!==null;)fR(n,e,t),n=n.sibling}function pR(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(pR(n,e,t),n=n.sibling;n!==null;)pR(n,e,t),n=n.sibling}var tr=null,Uo=!1;function Ql(n,e,t){for(t=t.child;t!==null;)ZG(n,e,t),t=t.sibling}function ZG(n,e,t){if(ba&&typeof ba.onCommitFiberUnmount=="function")try{ba.onCommitFiberUnmount(iA,t)}catch{}switch(t.tag){case 5:xr||jf(t,e);case 6:var i=tr,r=Uo;tr=null,Ql(n,e,t),tr=i,Uo=r,tr!==null&&(Uo?(n=tr,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):tr.removeChild(t.stateNode));break;case 18:tr!==null&&(Uo?(n=tr,t=t.stateNode,n.nodeType===8?oT(n.parentNode,t):n.nodeType===1&&oT(n,t),wv(n)):oT(tr,t.stateNode));break;case 4:i=tr,r=Uo,tr=t.stateNode.containerInfo,Uo=!0,Ql(n,e,t),tr=i,Uo=r;break;case 0:case 11:case 14:case 15:if(!xr&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&hR(t,e,o),r=r.next}while(r!==i)}Ql(n,e,t);break;case 1:if(!xr&&(jf(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){di(t,e,a)}Ql(n,e,t);break;case 21:Ql(n,e,t);break;case 22:t.mode&1?(xr=(i=xr)||t.memoizedState!==null,Ql(n,e,t),xr=i):Ql(n,e,t);break;default:Ql(n,e,t)}}function cN(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new gJ),e.forEach(function(i){var r=TJ.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function To(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=Ai()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*_J(i/1960))-i,10n?16:n,Lc===null)var i=!1;else{if(n=Lc,Lc=null,SS=0,gn&6)throw Error(it(331));var r=gn;for(gn|=4,xt=n.current;xt!==null;){var s=xt,o=s.child;if(xt.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lAi()-I2?Uh(n,0):P2|=t),fs(n,e)}function oH(n,e){e===0&&(n.mode&1?(e=y_,y_<<=1,!(y_&130023424)&&(y_=4194304)):e=1);var t=Kr();n=Dl(n,e),n!==null&&(G0(n,e,t),fs(n,t))}function EJ(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),oH(n,t)}function TJ(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(it(314))}i!==null&&i.delete(e),oH(n,t)}var aH;aH=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||hs.current)cs=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return cs=!1,fJ(n,e,t);cs=!!(n.flags&131072)}else cs=!1,qn&&e.flags&1048576&&hG(e,dS,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;U1(n,e),n=e.pendingProps;var r=bp(e,Pr.current);vp(e,t),r=w2(null,e,i,n,r,t);var s=E2();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ds(i)?(s=!0,uS(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,_2(e),r.updater=uA,e.stateNode=r,r._reactInternals=e,rR(e,i,n,t),e=aR(null,e,i,!0,s,t)):(e.tag=0,qn&&s&&d2(e),Vr(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(U1(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=CJ(i),n=Bo(i,n),r){case 0:e=oR(null,e,i,n,t);break e;case 1:e=rN(null,e,i,n,t);break e;case 11:e=nN(null,e,i,n,t);break e;case 14:e=iN(null,e,i,Bo(i.type,n),t);break e}throw Error(it(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bo(i,r),oR(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bo(i,r),rN(n,e,i,r,t);case 3:e:{if(WG(e),n===null)throw Error(it(387));i=e.pendingProps,s=e.memoizedState,r=s.element,vG(n,e),mS(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Ip(Error(it(423)),e),e=sN(n,e,i,t,r);break e}else if(i!==r){r=Ip(Error(it(424)),e),e=sN(n,e,i,t,r);break e}else for(Ps=Uc(e.stateNode.containerInfo.firstChild),Bs=e,qn=!0,Fo=null,t=mG(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Cp(),i===r){e=Bl(n,e,t);break e}Vr(n,e,i,t)}e=e.child}return e;case 5:return yG(e),n===null&&tR(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,KC(i,r)?o=null:s!==null&&KC(i,s)&&(e.flags|=32),VG(n,e),Vr(n,e,o,t),e.child;case 6:return n===null&&tR(e),null;case 13:return $G(n,e,t);case 4:return x2(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Rp(e,null,i,t):Vr(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bo(i,r),nN(n,e,i,r,t);case 7:return Vr(n,e,e.pendingProps,t),e.child;case 8:return Vr(n,e,e.pendingProps.children,t),e.child;case 12:return Vr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,Hn(fS,i._currentValue),i._currentValue=o,s!==null)if(jo(s.value,o)){if(s.children===r.children&&!hs.current){e=Bl(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Ml(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),nR(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(it(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),nR(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Vr(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,vp(e,t),r=yo(r),i=i(r),e.flags|=1,Vr(n,e,i,t),e.child;case 14:return i=e.type,r=Bo(i,e.pendingProps),r=Bo(i.type,r),iN(n,e,i,r,t);case 15:return GG(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bo(i,r),U1(n,e),e.tag=1,ds(i)?(n=!0,uS(e)):n=!1,vp(e,t),OG(e,i,r),rR(e,i,r,t),aR(null,e,i,!0,n,t);case 19:return XG(n,e,t);case 22:return HG(n,e,t)}throw Error(it(156,e.tag))};function lH(n,e){return N4(n,e)}function bJ(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ho(n,e,t,i){return new bJ(n,e,t,i)}function N2(n){return n=n.prototype,!(!n||!n.isReactComponent)}function CJ(n){if(typeof n=="function")return N2(n)?1:0;if(n!=null){if(n=n.$$typeof,n===e2)return 11;if(n===t2)return 14}return 2}function zc(n,e){var t=n.alternate;return t===null?(t=ho(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function k1(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")N2(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Of:return Fh(t.children,r,s,e);case QP:o=8,r|=8;break;case CC:return n=ho(12,t,e,r|2),n.elementType=CC,n.lanes=s,n;case RC:return n=ho(13,t,e,r),n.elementType=RC,n.lanes=s,n;case PC:return n=ho(19,t,e,r),n.elementType=PC,n.lanes=s,n;case y4:return fA(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case g4:o=10;break e;case v4:o=9;break e;case e2:o=11;break e;case t2:o=14;break e;case Ac:o=16,i=null;break e}throw Error(it(130,n==null?n:typeof n,""))}return e=ho(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Fh(n,e,t,i){return n=ho(7,n,i,e),n.lanes=t,n}function fA(n,e,t,i){return n=ho(22,n,i,e),n.elementType=y4,n.lanes=t,n.stateNode={isHidden:!1},n}function pT(n,e,t){return n=ho(6,n,null,e),n.lanes=t,n}function mT(n,e,t){return e=ho(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function RJ(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=JE(0),this.expirationTimes=JE(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=JE(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function U2(n,e,t,i,r,s,o,a,l){return n=new RJ(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=ho(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},_2(s),n}function PJ(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dH)}catch(n){console.error(n)}}dH(),d4.exports=Ws;var NJ=d4.exports,fH,vN=NJ;fH=TC.createRoot=vN.createRoot,TC.hydrateRoot=vN.hydrateRoot;var pH={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},yN=Qt.createContext&&Qt.createContext(pH),UJ=["attr","size","title"];function FJ(n,e){if(n==null)return{};var t=OJ(n,e),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function OJ(n,e){if(n==null)return{};var t={};for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){if(e.indexOf(i)>=0)continue;t[i]=n[i]}return t}function wS(){return wS=Object.assign?Object.assign.bind():function(n){for(var e=1;eQt.createElement(e.tag,ES({key:t},e.attr),mH(e.child)))}function au(n){return e=>Qt.createElement(HJ,wS({attr:ES({},n.attr)},e),mH(n.child))}function HJ(n){var e=t=>{var{attr:i,size:r,title:s}=n,o=FJ(n,UJ),a=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),Qt.createElement("svg",wS({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,o,{className:l,style:ES(ES({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&Qt.createElement("title",null,s),n.children)};return yN!==void 0?Qt.createElement(yN.Consumer,null,t=>e(t)):e(pH)}function VJ(n){return au({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951"},child:[]}]})(n)}function WJ(n){return au({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8"},child:[]}]})(n)}function $J(n){return au({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.9 3.9 0 0 0-1.417.923A3.9 3.9 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.9 3.9 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.9 3.9 0 0 0-.923-1.417A3.9 3.9 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599s.453.546.598.92c.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.5 2.5 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.5 2.5 0 0 1-.92-.598 2.5 2.5 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233s.008-2.388.046-3.231c.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92s.546-.453.92-.598c.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92m-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217m0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334"},child:[]}]})(n)}function XJ(n){return au({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z"},child:[]}]})(n)}const z2=[{name:"Github",url:"https://github.com/NivSv",icon:WJ},{name:"Linkedin",url:"https://www.linkedin.com/in/niv-shtibel/",icon:XJ},{name:"Facebook",url:"https://www.facebook.com/NivSvv/",icon:VJ},{name:"Instagram",url:"https://www.instagram.com/niv_sv/",icon:$J}],jJ=()=>{const n=e=>{window.open(e,"_blank")};return pe.jsxs("div",{className:"fixed bottom-0 left-[4%] hidden flex-col-reverse items-center md:flex z-20",children:[pe.jsx("div",{className:"bg-primary w-[2px] h-[80px]"}),pe.jsx("div",{className:"mb-4 flex flex-col gap-4",children:z2.map((e,t)=>pe.jsx("div",{onClick:()=>n(e.url),onKeyDown:()=>n(e.url),role:"button",tabIndex:t,title:e.name,className:"group hover:translate-y-[-4px] transition-all duration-400",children:pe.jsx(e.icon,{size:20,className:"fill-primary group-hover:fill-callToAction"})},t))})]})},xN="NivSvb@gmail.com",YJ=()=>pe.jsxs("div",{className:"fixed bottom-0 right-[4%] hidden flex-col-reverse items-center md:flex z-20",children:[pe.jsx("div",{className:" bg-primary w-[2px] h-[80px]"}),pe.jsx("div",{className:"w-0",children:pe.jsx("div",{dir:"rtl",className:"text-primary tracking-wider rotate-90 whitespace-nowrap hover:translate-y-[-4px] transition-all duration-400 hover:text-callToAction",children:pe.jsx("a",{href:`mailto:${xN}`,children:xN})})})]});function gH(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(e=0;en&&(e=0,i=t,t=new Map)}return{get:function(o){var a=t.get(o);if(a!==void 0)return a;if((a=i.get(o))!==void 0)return r(o,a),a},set:function(o,a){t.has(o)?t.set(o,a):r(o,a)}}}var _H="!";function nK(n){var e=n.separator||":",t=e.length===1,i=e[0],r=e.length;return function(o){for(var a=[],l=0,c=0,u,h=0;hc?u-c:void 0;return{modifiers:a,hasImportantModifier:v,baseClassName:_,maybePostfixModifierPosition:y}}}function iK(n){if(n.length<=1)return n;var e=[],t=[];return n.forEach(function(i){var r=i[0]==="[";r?(e.push.apply(e,t.sort().concat([i])),t=[]):t.push(i)}),e.push.apply(e,t.sort()),e}function rK(n){return{cache:tK(n.cacheSize),splitModifiers:nK(n),...KJ(n)}}var sK=/\s+/;function oK(n,e){var t=e.splitModifiers,i=e.getClassGroupId,r=e.getConflictingClassGroupIds,s=new Set;return n.trim().split(sK).map(function(o){var a=t(o),l=a.modifiers,c=a.hasImportantModifier,u=a.baseClassName,h=a.maybePostfixModifierPosition,d=i(h?u.substring(0,h):u),f=!!h;if(!d){if(!h)return{isTailwindClass:!1,originalClassName:o};if(d=i(u),!d)return{isTailwindClass:!1,originalClassName:o};f=!1}var v=iK(l).join(":"),_=c?v+_H:v;return{isTailwindClass:!0,modifierId:_,classGroupId:d,originalClassName:o,hasPostfixModifier:f}}).reverse().filter(function(o){if(!o.isTailwindClass)return!0;var a=o.modifierId,l=o.classGroupId,c=o.hasPostfixModifier,u=a+l;return s.has(u)?!1:(s.add(u),r(l,c).forEach(function(h){return s.add(a+h)}),!0)}).reverse().map(function(o){return o.originalClassName}).join(" ")}function aK(){for(var n=arguments.length,e=new Array(n),t=0;tn.reduce((t,i,r)=>t.concat(i||[],e[r]||[]),[]),TK=(n,e="")=>{let t=n.join(" ").trim().replace(/\n/g," ").replace(/\s{2,}/g," ").split(" ").filter(r=>r!==","),i=e?e.split(" "):[];return MK(...t.concat(i).filter(r=>r!==" "))},bK=([n])=>n.charAt(0)!=="$",gT=n=>n[MH]===!0,AH=n=>(e,...t)=>{let i=(r=[])=>{let s=Qt.forwardRef((o,a)=>{let{$as:l=n,style:c={},...u}=o,h=gT(n)?n:l,d=r?r.reduce((v,_)=>Object.assign(v,typeof _=="function"?_(o):_),{}):{},f=gT(h)?u:Object.fromEntries(Object.entries(u).filter(bK));return Qt.createElement(h,{...f,style:{...d,...c},ref:a,className:TK(EK(e,t.map(v=>v({...u,$as:l}))),u.className),...gT(n)?{$as:l}:{}})});return s[MH]=!0,typeof n!="string"?s.displayName=n.displayName||n.name||"tw.Component":s.displayName="tw."+n,s.withStyle=o=>i(r.concat(o)),s};return i()},CK=wK.reduce((n,e)=>({...n,[e]:AH(e)}),{}),RK=Object.assign(AH,CK),wH=RK;const PK=wH.div` flex border-2 rounded-md @@ -60,15 +60,15 @@ Error generating stack: `+s.message+` ${n=>n.size==="large"?"text-lg":""} ${n=>n.disabled?"opacity-50":""} ${n=>n.disabled?"cursor-not-allowed":""} -`,AR=n=>pe.jsx(TK,{size:n.size,disabled:n.disabled,onClick:n.onClick,role:"button",tabIndex:0,onKeyDown:n.onClick,children:n.children}),SN=[{label:"About",path:"#about"},{label:"Work",path:"#work"},{label:"Projects",path:"#projects"},{label:"Contact",path:"#contact"}];function bK(n){if(typeof Proxy>"u")return n;const e=new Map,t=(...i)=>n(...i);return new Proxy(t,{get:(i,r)=>r==="create"?n:(e.has(r)||e.set(r,n(r)),e.get(r))})}function Uv(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const wR=n=>Array.isArray(n);function MH(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;i{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function V2(n,e,t,i){if(typeof e=="function"){const[r,s]=MN(i);e=e(t!==void 0?t:n.custom,r,s)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,s]=MN(i);e=e(t!==void 0?t:n.custom,r,s)}return e}function yA(n,e,t){const i=n.getProps();return V2(i,e,t!==void 0?t:i.custom,n)}const W2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$2=["initial",...W2],$0=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],lu=new Set($0),Al=n=>n*1e3,wl=n=>n/1e3,CK={type:"spring",stiffness:500,damping:25,restSpeed:10},RK=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),PK={type:"keyframes",duration:.8},IK={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LK=(n,{keyframes:e})=>e.length>2?PK:lu.has(n)?n.startsWith("scale")?RK(e[1]):CK:IK;function DK({when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}function X2(n,e){return n[e]||n.default||n}const BK={skipAnimations:!1,useManualTiming:!1},NK=n=>n!==null;function _A(n,{repeat:e,repeatType:t="loop"},i){const r=n.filter(NK),s=e&&t!=="loop"&&e%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const Tr=n=>n;function UK(n){let e=new Set,t=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),n()),c(o)}const l={schedule:(c,u=!1,h=!1)=>{const f=h&&i?e:t;return u&&s.add(c),f.has(c)||f.add(c),c},cancel:c=>{t.delete(c),s.delete(c)},process:c=>{if(o=c,i){r=!0;return}i=!0,[e,t]=[t,e],t.clear(),e.forEach(a),i=!1,r&&(r=!1,l.process(c))}};return l}const L_=["read","resolveKeyframes","update","preRender","render","postRender"],FK=40;function AH(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>t=!0,o=L_.reduce((m,S)=>(m[S]=UK(s),m),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:h,postRender:d}=o,f=()=>{const m=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(m-r.timestamp,FK),1),r.timestamp=m,r.isProcessing=!0,a.process(r),l.process(r),c.process(r),u.process(r),h.process(r),d.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(f))},v=()=>{t=!0,i=!0,r.isProcessing||n(f)};return{schedule:L_.reduce((m,S)=>{const x=o[S];return m[S]=(M,R=!1,T=!1)=>(t||v(),x.schedule(M,R,T)),m},{}),cancel:m=>{for(let S=0;S/^0[^.\s]+$/u.test(n);function OK(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||wH(n):!0}let ER=Tr;const EH=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),TH=n=>e=>typeof e=="string"&&e.startsWith(n),bH=TH("--"),kK=TH("var(--"),j2=n=>kK(n)?zK.test(n.split("/*")[0].trim()):!1,zK=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,GK=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function HK(n){const e=GK.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t??i}`,r]}function CH(n,e,t=1){const[i,r]=HK(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return EH(o)?parseFloat(o):o}return j2(r)?CH(r,e,t+1):r}const Xc=(n,e,t)=>t>e?e:ttypeof n=="number",parse:parseFloat,transform:n=>n},Kg={...tm,transform:n=>Xc(0,1,n)},D_={...tm,default:1},qg=n=>Math.round(n*1e5)/1e5,Y2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,VK=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,WK=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function X0(n){return typeof n=="string"}function $K(n){return n==null}const j0=n=>({test:e=>X0(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Ac=j0("deg"),Ra=j0("%"),Lt=j0("px"),XK=j0("vh"),jK=j0("vw"),AN={...Ra,parse:n=>Ra.parse(n)/100,transform:n=>Ra.transform(n*100)},YK=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),wN=n=>n===tm||n===Lt,EN=(n,e)=>parseFloat(n.split(", ")[e]),TN=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return EN(r[1],e);{const s=i.match(/^matrix\((.+)\)$/u);return s?EN(s[1],n):0}},JK=new Set(["x","y","z"]),KK=$0.filter(n=>!JK.has(n));function qK(n){const e=[];return KK.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const Dp={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:TN(4,13),y:TN(5,14)};Dp.translateX=Dp.x;Dp.translateY=Dp.y;const RH=n=>e=>e.test(n),ZK={test:n=>n==="auto",parse:n=>n},PH=[tm,Lt,Ra,Ac,jK,XK,ZK],bN=n=>PH.find(RH(n)),Oh=new Set;let TR=!1,bR=!1;function IH(){if(bR){const n=Array.from(Oh).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=qK(i);r.length&&(t.set(i,r),i.render())}),n.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=t.get(i);r&&r.forEach(([s,o])=>{var a;(a=i.getValue(s))===null||a===void 0||a.set(o)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}bR=!1,TR=!1,Oh.forEach(n=>n.complete()),Oh.clear()}function LH(){Oh.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(bR=!0)})}function QK(){LH(),IH()}class J2{constructor(e,t,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Oh.add(this),TR||(TR=!0,Pn.read(LH),Pn.resolveKeyframes(IH))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;for(let s=0;st=>!!(X0(t)&&WK.test(t)&&t.startsWith(n)||e&&!$K(t)&&Object.prototype.hasOwnProperty.call(t,e)),DH=(n,e,t)=>i=>{if(!X0(i))return i;const[r,s,o,a]=i.match(Y2);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eq=n=>Xc(0,255,n),xT={...tm,transform:n=>Math.round(eq(n))},Mh={test:K2("rgb","red"),parse:DH("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+xT.transform(n)+", "+xT.transform(e)+", "+xT.transform(t)+", "+qg(Kg.transform(i))+")"};function tq(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const CR={test:K2("#"),parse:tq,transform:Mh.transform},Jf={test:K2("hsl","hue"),parse:DH("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Ra.transform(qg(e))+", "+Ra.transform(qg(t))+", "+qg(Kg.transform(i))+")"},_r={test:n=>Mh.test(n)||CR.test(n)||Jf.test(n),parse:n=>Mh.test(n)?Mh.parse(n):Jf.test(n)?Jf.parse(n):CR.parse(n),transform:n=>X0(n)?n:n.hasOwnProperty("red")?Mh.transform(n):Jf.transform(n)};function nq(n){var e,t;return isNaN(n)&&X0(n)&&(((e=n.match(Y2))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(VK))===null||t===void 0?void 0:t.length)||0)>0}const BH="number",NH="color",iq="var",rq="var(",CN="${}",sq=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ov(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let s=0;const a=e.replace(sq,l=>(_r.test(l)?(i.color.push(s),r.push(NH),t.push(_r.parse(l))):l.startsWith(rq)?(i.var.push(s),r.push(iq),t.push(l)):(i.number.push(s),r.push(BH),t.push(parseFloat(l))),++s,CN)).split(CN);return{values:t,split:a,indexes:i,types:r}}function UH(n){return Ov(n).values}function FH(n){const{split:e,types:t}=Ov(n),i=e.length;return r=>{let s="";for(let o=0;otypeof n=="number"?0:n;function aq(n){const e=UH(n);return FH(n)(e.map(oq))}const jc={test:nq,parse:UH,createTransformer:FH,getAnimatableNone:aq},lq=new Set(["brightness","contrast","saturate","opacity"]);function cq(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(Y2)||[];if(!i)return n;const r=t.replace(i,"");let s=lq.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const uq=/\b([a-z-]*)\(.*?\)/gu,RR={...jc,getAnimatableNone:n=>{const e=n.match(uq);return e?e.map(cq).join(" "):n}},RN={...tm,transform:Math.round},q2={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,size:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,rotate:Ac,rotateX:Ac,rotateY:Ac,rotateZ:Ac,scale:D_,scaleX:D_,scaleY:D_,scaleZ:D_,skew:Ac,skewX:Ac,skewY:Ac,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Kg,originX:AN,originY:AN,originZ:Lt,zIndex:RN,backgroundPositionX:Lt,backgroundPositionY:Lt,fillOpacity:Kg,strokeOpacity:Kg,numOctaves:RN},hq={...q2,color:_r,backgroundColor:_r,outlineColor:_r,fill:_r,stroke:_r,borderColor:_r,borderTopColor:_r,borderRightColor:_r,borderBottomColor:_r,borderLeftColor:_r,filter:RR,WebkitFilter:RR},Z2=n=>hq[n];function OH(n,e){let t=Z2(n);return t!==RR&&(t=jc),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const dq=new Set(["auto","none","0"]);function fq(n,e,t){let i=0,r;for(;i{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function zH(n){let e;return()=>(e===void 0&&(e=n()),e)}let G1;function pq(){G1=void 0}const Pa={now:()=>(G1===void 0&&Pa.set(nr.isProcessing||BK.useManualTiming?nr.timestamp:performance.now()),G1),set:n=>{G1=n,queueMicrotask(pq)}},PN=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(jc.test(n)||n==="0")&&!n.startsWith("url("));function mq(n){const e=n[0];if(n.length===1)return!0;for(let t=0;tvq?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&QK(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Pa.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!gq(e,i,r,s))if(o)this.options.duration=0;else{l==null||l(_A(e,this.options,t)),a==null||a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,t);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:t,...u},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function HH(n,e){return e?n*(1e3/e):0}const yq=5;function VH(n,e,t){const i=Math.max(e-yq,0);return HH(t-n(i),e-i)}const ST=.001,_q=.01,xq=10,Sq=.05,Mq=1;function Aq({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s,o=1-e;o=Xc(Sq,Mq,o),n=Xc(_q,xq,wl(n)),o<1?(r=c=>{const u=c*o,h=u*n,d=u-t,f=PR(c,o),v=Math.exp(-h);return ST-d/f*v},s=c=>{const h=c*o*n,d=h*t+t,f=Math.pow(o,2)*Math.pow(c,2)*n,v=Math.exp(-h),_=PR(Math.pow(c,2),o);return(-r(c)+ST>0?-1:1)*((d-f)*v)/_}):(r=c=>{const u=Math.exp(-c*n),h=(c-t)*n+1;return-ST+u*h},s=c=>{const u=Math.exp(-c*n),h=(t-c)*(n*n);return u*h});const a=5/n,l=Eq(r,s,a);if(n=Al(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const wq=12;function Eq(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function Cq(n){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...n};if(!IN(n,bq)&&IN(n,Tq)){const t=Aq(n);e={...e,...t,mass:1},e.isResolvedFromDuration=!0}return e}function WH({keyframes:n,restDelta:e,restSpeed:t,...i}){const r=n[0],s=n[n.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:c,duration:u,velocity:h,isResolvedFromDuration:d}=Cq({...i,velocity:-wl(i.velocity||0)}),f=h||0,v=l/(2*Math.sqrt(a*c)),_=s-r,y=wl(Math.sqrt(a/c)),m=Math.abs(_)<5;t||(t=m?.01:2),e||(e=m?.005:.5);let S;if(v<1){const x=PR(y,v);S=M=>{const R=Math.exp(-v*y*M);return s-R*((f+v*y*_)/x*Math.sin(x*M)+_*Math.cos(x*M))}}else if(v===1)S=x=>s-Math.exp(-y*x)*(_+(f+y*_)*x);else{const x=y*Math.sqrt(v*v-1);S=M=>{const R=Math.exp(-v*y*M),T=Math.min(x*M,300);return s-R*((f+v*y*_)*Math.sinh(T)+x*_*Math.cosh(T))/x}}return{calculatedDuration:d&&u||null,next:x=>{const M=S(x);if(d)o.done=x>=u;else{let R=0;v<1&&(R=x===0?Al(f):VH(S,x,M));const T=Math.abs(R)<=t,P=Math.abs(s-M)<=e;o.done=T&&P}return o.value=o.done?s:M,o}}}function LN({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=n[0],d={done:!1,value:h},f=I=>a!==void 0&&Il,v=I=>a===void 0?l:l===void 0||Math.abs(a-I)-_*Math.exp(-I/i),x=I=>m+S(I),M=I=>{const b=S(I),w=x(I);d.done=Math.abs(b)<=c,d.value=d.done?m:w};let R,T;const P=I=>{f(d.value)&&(R=I,T=WH({keyframes:[d.value,v(d.value)],velocity:VH(x,I,d.value),damping:r,stiffness:s,restDelta:c,restSpeed:u}))};return P(0),{calculatedDuration:null,next:I=>{let b=!1;return!T&&R===void 0&&(b=!0,M(I),P(I)),R!==void 0&&I>=R?T.next(I-R):(!b&&M(I),d)}}}const $H=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,Rq=1e-7,Pq=12;function Iq(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=$H(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>Rq&&++aIq(s,0,1,n,t);return s=>s===0||s===1?s:$H(r(s),e,i)}const Lq=Y0(.42,0,1,1),Dq=Y0(0,0,.58,1),XH=Y0(.42,0,.58,1),Bq=n=>Array.isArray(n)&&typeof n[0]!="number",jH=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,YH=n=>e=>1-n(1-e),Q2=n=>1-Math.sin(Math.acos(n)),JH=YH(Q2),Nq=jH(Q2),KH=Y0(.33,1.53,.69,.99),eI=YH(KH),Uq=jH(eI),Fq=n=>(n*=2)<1?.5*eI(n):.5*(2-Math.pow(2,-10*(n-1))),DN={linear:Tr,easeIn:Lq,easeInOut:XH,easeOut:Dq,circIn:Q2,circInOut:Nq,circOut:JH,backIn:eI,backInOut:Uq,backOut:KH,anticipate:Fq},BN=n=>{if(Array.isArray(n)){ER(n.length===4);const[e,t,i,r]=n;return Y0(e,t,i,r)}else if(typeof n=="string")return ER(DN[n]!==void 0),DN[n];return n},Oq=(n,e)=>t=>e(n(t)),El=(...n)=>n.reduce(Oq),kv=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},ti=(n,e,t)=>n+(e-n)*t;function MT(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function kq({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=MT(l,a,n+1/3),s=MT(l,a,n),o=MT(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function bS(n,e){return t=>t>0?e:n}const AT=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},zq=[CR,Mh,Jf],Gq=n=>zq.find(e=>e.test(n));function NN(n){const e=Gq(n);if(!e)return!1;let t=e.parse(n);return e===Jf&&(t=kq(t)),t}const UN=(n,e)=>{const t=NN(n),i=NN(e);if(!t||!i)return bS(n,e);const r={...t};return s=>(r.red=AT(t.red,i.red,s),r.green=AT(t.green,i.green,s),r.blue=AT(t.blue,i.blue,s),r.alpha=ti(t.alpha,i.alpha,s),Mh.transform(r))},IR=new Set(["none","hidden"]);function Hq(n,e){return IR.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function Vq(n,e){return t=>ti(n,e,t)}function tI(n){return typeof n=="number"?Vq:typeof n=="string"?j2(n)?bS:_r.test(n)?UN:Xq:Array.isArray(n)?qH:typeof n=="object"?_r.test(n)?UN:Wq:bS}function qH(n,e){const t=[...n],i=t.length,r=n.map((s,o)=>tI(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in i)t[s]=i[s](r);return t}}function $q(n,e){var t;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const t=jc.createTransformer(e),i=Ov(n),r=Ov(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?IR.has(n)&&!r.values.length||IR.has(e)&&!i.values.length?Hq(n,e):El(qH($q(i,r),r.values),t):bS(n,e)};function ZH(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?ti(n,e,t):tI(n)(n,e)}function jq(n,e,t){const i=[],r=t||ZH,s=n.length-1;for(let o=0;oe[0];if(s===2&&n[0]===n[1])return()=>e[1];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=jq(e,i,r),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Xc(n[0],n[s-1],c)):l}function Jq(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=kv(0,e,i);n.push(ti(t,1,r))}}function Kq(n){const e=[0];return Jq(e,n.length-1),e}function qq(n,e){return n.map(t=>t*e)}function Zq(n,e){return n.map(()=>e||XH).splice(0,n.length-1)}function CS({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=Bq(i)?i.map(BN):BN(i),s={done:!1,value:e[0]},o=qq(t&&t.length===e.length?t:Kq(e),n),a=Yq(o,e,{ease:Array.isArray(r)?r:Zq(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}const FN=2e4;function Qq(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=FN?1/0:e}const eZ=n=>{const e=({timestamp:t})=>n(t);return{start:()=>Pn.update(e,!0),stop:()=>Nl(e),now:()=>nr.isProcessing?nr.timestamp:Pa.now()}},tZ={decay:LN,inertia:LN,tween:CS,keyframes:CS,spring:WH},nZ=n=>n/100;class nI extends GH{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:t,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||J2,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,t,i,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,a=tZ[t]||CS;let l,c;a!==CS&&typeof e[0]!="number"&&(l=El(nZ,ZH(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});s==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Qq(u));const{calculatedDuration:h}=u,d=h+r,f=d*(i+1)-r;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,t=!1){const{resolved:i}=this;if(!i){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:h}=i;if(this.startTime===null)return s.next(0);const{delay:d,repeat:f,repeatType:v,repeatDelay:_,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),t?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const m=this.currentTime-d*(this.speed>=0?1:-1),S=this.speed>=0?m<0:m>u;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let x=this.currentTime,M=s;if(f){const I=Math.min(this.currentTime,u)/h;let b=Math.floor(I),w=I%1;!w&&I>=1&&(w=1),w===1&&b--,b=Math.min(b,f+1),!!(b%2)&&(v==="reverse"?(w=1-w,_&&(w-=_/h)):v==="mirror"&&(M=o)),x=Xc(0,1,w)*h}const R=S?{done:!1,value:l[0]}:M.next(x);a&&(R.value=a(R.value));let{done:T}=R;!S&&c!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return P&&r!==void 0&&(R.value=_A(l,this.options,r)),y&&y(R.value),P&&this.finish(),R}get duration(){const{resolved:e}=this;return e?wl(e.calculatedDuration):0}get time(){return wl(this.currentTime)}set time(e){e=Al(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=wl(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=eZ,onPlay:t,startTime:i}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),t&&t();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const QH=new Set(["opacity","clipPath","filter","transform"]),eV=n=>Array.isArray(n)&&typeof n[0]=="number";function tV(n){return!!(!n||typeof n=="string"&&n in iI||eV(n)||Array.isArray(n)&&n.every(tV))}const Dg=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,iI={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Dg([0,.65,.55,1]),circOut:Dg([.55,0,1,.45]),backIn:Dg([.31,.01,.66,-.59]),backOut:Dg([.33,1.53,.69,.99])};function iZ(n){return nV(n)||iI.easeOut}function nV(n){if(n)return eV(n)?Dg(n):Array.isArray(n)?n.map(iZ):iI[n]}function rZ(n,e,t,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const c={[e]:t};l&&(c.offset=l);const u=nV(a);return Array.isArray(u)&&(c.easing=u),n.animate(c,{delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const sZ=zH(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),RS=10,oZ=2e4;function aZ(n){return n.type==="spring"||!tV(n.ease)}function lZ(n,e){const t=new nI({...e,keyframes:n,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:n[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,a),t,i,r),this.resolver.scheduleResolve()}initPlayback(e,t){var i;let{duration:r=300,times:s,ease:o,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!(!((i=l.owner)===null||i===void 0)&&i.current))return!1;if(aZ(this.options)){const{onComplete:d,onUpdate:f,motionValue:v,element:_,...y}=this.options,m=lZ(e,y);e=m.keyframes,e.length===1&&(e[1]=e[0]),r=m.duration,s=m.times,o=m.ease,a="keyframes"}const h=rZ(l.owner.current,c,e,{...this.options,duration:r,times:s,ease:o});return h.startTime=u??this.calcStartTime(),this.pendingTimeline?(h.timeline=this.pendingTimeline,this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:d}=this.options;l.set(_A(e,this.options,t)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:r,times:s,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return wl(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return wl(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.currentTime=Al(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:t}=this;if(!t)return Tr;const{animation:i}=t;i.timeline=e,i.onfinish=null}return Tr}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.playState==="finished"&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:i,duration:r,type:s,ease:o,times:a}=e;if(t.playState==="idle"||t.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:h,element:d,...f}=this.options,v=new nI({...f,keyframes:i,duration:r,type:s,ease:o,times:a,isGenerator:!0}),_=Al(this.time);c.setWithVelocity(v.sample(_-RS).value,v.sample(_).value,RS)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:i,repeatDelay:r,repeatType:s,damping:o,type:a}=e;return sZ()&&i&&QH.has(i)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&s!=="mirror"&&o!==0&&a!=="inertia"}}function cZ(n,e){let t;const i=()=>{const{currentTime:r}=e,o=(r===null?0:r.value)/100;t!==o&&n(o),t=o};return Pn.update(i,!0),()=>Nl(i)}const uZ=zH(()=>window.ScrollTimeline!==void 0);class hZ{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i{if(uZ()&&i.attachTimeline)i.attachTimeline(e);else return i.pause(),cZ(r=>{i.time=i.duration*r},e)});return()=>{t.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const rI=(n,e,t,i={},r,s,o)=>a=>{const l=X2(i,n)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Al(c);let h={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:f=>{e.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),o&&o()},onStop:o,name:n,motionValue:e,element:s?void 0:r};DK(l)||(h={...h,...LK(n,h)}),h.duration&&(h.duration=Al(h.duration)),h.repeatDelay&&(h.repeatDelay=Al(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let d=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(d=!0)),d&&!s&&e.get()!==void 0){const f=_A(h.keyframes,l);if(f!==void 0)return Pn.update(()=>{h.onUpdate(f),h.onComplete()}),new hZ([])}return!s&&ON.supports(h)?new ON(h):new nI(h)},dZ=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),fZ=n=>wR(n)?n[n.length-1]||0:n;function xA(n,e){n.indexOf(e)===-1&&n.push(e)}function SA(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class sI{constructor(){this.subscriptions=[]}add(e){return xA(this.subscriptions,e),()=>SA(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s!isNaN(parseFloat(n));class iV{constructor(e,t={}){this.version="11.5.6",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=Pa.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Pa.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=pZ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new sI);const i=this.events[e].add(t);return e==="change"?()=>{i(),Pn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Pa.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>kN)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,kN);return HH(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zv(n,e){return new iV(n,e)}function mZ(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,zv(t))}function gZ(n,e){const t=yA(n,e);let{transitionEnd:i={},transition:r={},...s}=t||{};s={...s,...i};for(const o in s){const a=fZ(s[o]);mZ(n,o,a)}}const MA=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vZ="framerAppearId",rV="data-"+MA(vZ);function sV(n){return n.props[rV]}function oV(n){if(lu.has(n))return"transform";if(QH.has(n))return MA(n)}class yZ extends iV{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=oV(e);if(!t)return;const i=this.counts.get(t)||0;this.counts.set(t,i+1),i===0&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const s=this.counts.get(t)-1;this.counts.set(t,s),s===0&&(SA(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Mr=n=>!!(n&&n.getVelocity);function _Z(n){return!!(Mr(n)&&n.add)}function LR(n,e){var t;if(!n.applyWillChange)return;let i=n.getValue("willChange");if(!i&&!(!((t=n.props.style)===null||t===void 0)&&t.willChange)&&(i=new yZ("auto"),n.addValue("willChange",i)),_Z(i))return i.add(e)}function xZ({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function aV(n,e,{delay:t=0,transitionOverride:i,type:r}={}){var s;let{transition:o=n.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(o=i);const c=[],u=r&&n.animationState&&n.animationState.getState()[r];for(const h in l){const d=n.getValue(h,(s=n.latestValues[h])!==null&&s!==void 0?s:null),f=l[h];if(f===void 0||u&&xZ(u,h))continue;const v={delay:t,...X2(o||{},h)};let _=!1;if(window.MotionHandoffAnimation){const m=sV(n);if(m){const S=window.MotionHandoffAnimation(m,h,Pn);S!==null&&(v.startTime=S,_=!0)}}d.start(rI(h,d,f,n.shouldReduceMotion&&lu.has(h)?{type:!1}:v,n,_,LR(n,h)));const y=d.animation;y&&c.push(y)}return a&&Promise.all(c).then(()=>{Pn.update(()=>{a&&gZ(n,a)})}),c}function DR(n,e,t={}){var i;const r=yA(n,e,t.type==="exit"?(i=n.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=n.getDefaultTransition()||{}}=r||{};t.transitionOverride&&(s=t.transitionOverride);const o=r?()=>Promise.all(aV(n,r,t)):()=>Promise.resolve(),a=n.variantChildren&&n.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:d}=s;return SZ(n,e,u+c,h,d,t)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(t.delay)])}function SZ(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(n.variantChildren).sort(MZ).forEach((c,u)=>{c.notify("AnimationStart",e),o.push(DR(c,e,{...s,delay:t+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function MZ(n,e){return n.sortNodePosition(e)}function AZ(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>DR(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=DR(n,e,t);else{const r=typeof e=="function"?yA(n,e,t.custom):e;i=Promise.all(aV(n,r,t))}return i.then(()=>{n.notify("AnimationComplete",e)})}const wZ=$2.length;function lV(n){if(!n)return;if(!n.isControllingVariants){const t=n.parent?lV(n.parent)||{}:{};return n.props.initial!==void 0&&(t.initial=n.props.initial),t}const e={};for(let t=0;tPromise.all(e.map(({animation:t,options:i})=>AZ(n,t,i)))}function CZ(n){let e=bZ(n),t=zN(),i=!0;const r=l=>(c,u)=>{var h;const d=yA(n,u,l==="exit"?(h=n.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(d){const{transition:f,transitionEnd:v,..._}=d;c={...c,..._,...v}}return c};function s(l){e=l(n)}function o(l){const{props:c}=n,u=lV(n.parent)||{},h=[],d=new Set;let f={},v=1/0;for(let y=0;yv&&M,b=!1;const w=Array.isArray(x)?x:[x];let N=w.reduce(r(m),{});R===!1&&(N={});const{prevResolvedValues:G={}}=S,V={...G,...N},$=re=>{I=!0,d.has(re)&&(b=!0,d.delete(re)),S.needsAnimating[re]=!0;const O=n.getValue(re);O&&(O.liveStyle=!1)};for(const re in V){const O=N[re],Q=G[re];if(f.hasOwnProperty(re))continue;let te=!1;wR(O)&&wR(Q)?te=!MH(O,Q):te=O!==Q,te?O!=null?$(re):d.add(re):O!==void 0&&d.has(re)?$(re):S.protectedKeys[re]=!0}S.prevProp=x,S.prevResolvedValues=N,S.isActive&&(f={...f,...N}),i&&n.blockInitialAnimation&&(I=!1),I&&(!(T&&P)||b)&&h.push(...w.map(re=>({animation:re,options:{type:m}})))}if(d.size){const y={};d.forEach(m=>{const S=n.getBaseTarget(m),x=n.getValue(m);x&&(x.liveStyle=!0),y[m]=S??null}),h.push({animation:y})}let _=!!h.length;return i&&(c.initial===!1||c.initial===c.animate)&&!n.manuallyAnimateOnMount&&(_=!1),i=!1,_?e(h):Promise.resolve()}function a(l,c){var u;if(t[l].isActive===c)return Promise.resolve();(u=n.variantChildren)===null||u===void 0||u.forEach(d=>{var f;return(f=d.animationState)===null||f===void 0?void 0:f.setActive(l,c)}),t[l].isActive=c;const h=o(l);for(const d in t)t[d].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t,reset:()=>{t=zN(),i=!0}}}function RZ(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!MH(e,n):!1}function Du(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function zN(){return{animate:Du(!0),whileInView:Du(),whileHover:Du(),whileTap:Du(),whileDrag:Du(),whileFocus:Du(),exit:Du()}}class cu{constructor(e){this.isMounted=!1,this.node=e}update(){}}class PZ extends cu{constructor(e){super(e),e.animationState||(e.animationState=CZ(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Uv(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let IZ=0;class LZ extends cu{constructor(){super(...arguments),this.id=IZ++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const DZ={animation:{Feature:PZ},exit:{Feature:LZ}},cV=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function AA(n,e="page"){return{point:{x:n[`${e}X`],y:n[`${e}Y`]}}}const BZ=n=>e=>cV(e)&&n(e,AA(e));function yl(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}function Tl(n,e,t,i){return yl(n,e,BZ(t),i)}const GN=(n,e)=>Math.abs(n-e);function NZ(n,e){const t=GN(n.x,e.x),i=GN(n.y,e.y);return Math.sqrt(t**2+i**2)}class uV{constructor(e,t,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=ET(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=NZ(h.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:v}=h,{timestamp:_}=nr;this.history.push({...v,timestamp:_});const{onStart:y,onMove:m}=this.handlers;d||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,h)},this.handlePointerMove=(h,d)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=wT(d,this.transformPagePoint),Pn.update(this.updatePoint,!0)},this.handlePointerUp=(h,d)=>{this.end();const{onEnd:f,onSessionEnd:v,resumeAnimation:_}=this.handlers;if(this.dragSnapToOrigin&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ET(h.type==="pointercancel"?this.lastMoveEventInfo:wT(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(h,y),v&&v(h,y)},!cV(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const o=AA(e),a=wT(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=nr;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=t;u&&u(e,ET(a,this.history)),this.removeListeners=El(Tl(this.contextWindow,"pointermove",this.handlePointerMove),Tl(this.contextWindow,"pointerup",this.handlePointerUp),Tl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Nl(this.updatePoint)}}function wT(n,e){return e?{point:e(n.point)}:n}function HN(n,e){return{x:n.x-e.x,y:n.y-e.y}}function ET({point:n},e){return{point:n,delta:HN(n,hV(e)),offset:HN(n,UZ(e)),velocity:FZ(e,.1)}}function UZ(n){return n[0]}function hV(n){return n[n.length-1]}function FZ(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=hV(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>Al(e)));)t--;if(!i)return{x:0,y:0};const s=wl(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function dV(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const VN=dV("dragHorizontal"),WN=dV("dragVertical");function fV(n){let e=!1;if(n==="y")e=WN();else if(n==="x")e=VN();else{const t=VN(),i=WN();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function pV(){const n=fV(!0);return n?(n(),!1):!0}function Kf(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}const mV=1e-4,OZ=1-mV,kZ=1+mV,gV=.01,zZ=0-gV,GZ=0+gV;function zs(n){return n.max-n.min}function HZ(n,e,t){return Math.abs(n-e)<=t}function $N(n,e,t,i=.5){n.origin=i,n.originPoint=ti(e.min,e.max,n.origin),n.scale=zs(t)/zs(e),n.translate=ti(t.min,t.max,n.origin)-n.originPoint,(n.scale>=OZ&&n.scale<=kZ||isNaN(n.scale))&&(n.scale=1),(n.translate>=zZ&&n.translate<=GZ||isNaN(n.translate))&&(n.translate=0)}function Zg(n,e,t,i){$N(n.x,e.x,t.x,i?i.originX:void 0),$N(n.y,e.y,t.y,i?i.originY:void 0)}function XN(n,e,t){n.min=t.min+e.min,n.max=n.min+zs(e)}function VZ(n,e,t){XN(n.x,e.x,t.x),XN(n.y,e.y,t.y)}function jN(n,e,t){n.min=e.min-t.min,n.max=n.min+zs(e)}function Qg(n,e,t){jN(n.x,e.x,t.x),jN(n.y,e.y,t.y)}function WZ(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?ti(t,n,i.max):Math.min(n,t)),n}function YN(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function $Z(n,{top:e,left:t,bottom:i,right:r}){return{x:YN(n.x,t,r),y:YN(n.y,e,i)}}function JN(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=kv(e.min,e.max-i,n.min):i>r&&(t=kv(n.min,n.max-r,e.min)),Xc(0,1,t)}function YZ(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const BR=.35;function JZ(n=BR){return n===!1?n=0:n===!0&&(n=BR),{x:KN(n,"left","right"),y:KN(n,"top","bottom")}}function KN(n,e,t){return{min:qN(n,e),max:qN(n,t)}}function qN(n,e){return typeof n=="number"?n:n[e]||0}const ZN=()=>({translate:0,scale:1,origin:0,originPoint:0}),qf=()=>({x:ZN(),y:ZN()}),QN=()=>({min:0,max:0}),Si=()=>({x:QN(),y:QN()});function oo(n){return[n("x"),n("y")]}function vV({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function KZ({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function qZ(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function TT(n){return n===void 0||n===1}function NR({scale:n,scaleX:e,scaleY:t}){return!TT(n)||!TT(e)||!TT(t)}function lh(n){return NR(n)||yV(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function yV(n){return eU(n.x)||eU(n.y)}function eU(n){return n&&n!=="0%"}function PS(n,e,t){const i=n-t,r=e*i;return t+r}function tU(n,e,t,i,r){return r!==void 0&&(n=PS(n,r,i)),PS(n,t,i)+e}function UR(n,e=0,t=1,i,r){n.min=tU(n.min,e,t,i,r),n.max=tU(n.max,e,t,i,r)}function _V(n,{x:e,y:t}){UR(n.x,e.translate,e.scale,e.originPoint),UR(n.y,t.translate,t.scale,t.originPoint)}const nU=.999999999999,iU=1.0000000000001;function ZZ(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;anU&&(e.x=1),e.ynU&&(e.y=1)}function Zf(n,e){n.min=n.min+e,n.max=n.max+e}function rU(n,e,t,i,r=.5){const s=ti(n.min,n.max,r);UR(n,e,t,s,i)}function Qf(n,e){rU(n.x,e.x,e.scaleX,e.scale,e.originX),rU(n.y,e.y,e.scaleY,e.scale,e.originY)}function xV(n,e){return vV(qZ(n.getBoundingClientRect(),e))}function QZ(n,e,t){const i=xV(n,t),{scroll:r}=e;return r&&(Zf(i.x,r.offset.x),Zf(i.y,r.offset.y)),i}const SV=({current:n})=>n?n.ownerDocument.defaultView:null,eQ=new WeakMap;class tQ{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Si(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=u=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(AA(u,"page").point)},s=(u,h)=>{var d;const{drag:f,dragPropagation:v,onDragStart:_}=this.getProps();if(f&&!v&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=fV(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),oo(m=>{let S=this.getAxisMotionValue(m).get()||0;if(Ra.test(S)){const{projection:x}=this.visualElement;if(x&&x.layout){const M=x.layout.layoutBox[m];M&&(S=zs(M)*(parseFloat(S)/100))}}this.originPoint[m]=S}),_&&Pn.postRender(()=>_(u,h)),(d=this.removeWillChange)===null||d===void 0||d.call(this),this.removeWillChange=LR(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,h)=>{const{dragPropagation:d,dragDirectionLock:f,onDirectionLock:v,onDrag:_}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:y}=h;if(f&&this.currentDirection===null){this.currentDirection=nQ(y),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),_&&_(u,h)},a=(u,h)=>this.stop(u,h),l=()=>oo(u=>{var h;return this.getAnimationState(u)==="paused"&&((h=this.getAxisMotionValue(u).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new uV(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:SV(this.visualElement)})}stop(e,t){var i;(i=this.removeWillChange)===null||i===void 0||i.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=t;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&Pn.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!B_(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=WZ(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;t&&Kf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=$Z(r.layoutBox,t):this.constraints=!1,this.elastic=JZ(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&oo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=YZ(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Kf(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=QZ(i,r.root,this.visualElement.getTransformPagePoint());let o=XZ(r.layout.layoutBox,s);if(t){const a=t(KZ(o));this.hasMutatedConstraints=!!a,a&&(o=vV(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=oo(u=>{if(!B_(u,t,this.currentDirection))return;let h=l&&l[u]||{};o&&(h={min:0,max:0});const d=r?200:1e6,f=r?40:1e7,v={type:"inertia",velocity:i?e[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(u,v)});return Promise.all(c).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(rI(e,i,0,t,this.visualElement,!1,LR(this.visualElement,e)))}stopAnimation(){oo(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){oo(e=>{var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){oo(t=>{const{drag:i}=this.getProps();if(!B_(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-ti(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!Kf(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};oo(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();r[o]=jZ({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),oo(o=>{if(!B_(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ti(l,c,r[o]))})}addListeners(){if(!this.visualElement.current)return;eQ.set(this.visualElement,this);const e=this.visualElement.current,t=Tl(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Kf(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Pn.read(i);const o=yl(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(oo(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=BR,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function B_(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function nQ(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class iQ extends cu{constructor(e){super(e),this.removeGroupControls=Tr,this.removeListeners=Tr,this.controls=new tQ(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Tr}unmount(){this.removeGroupControls(),this.removeListeners()}}const sU=n=>(e,t)=>{n&&Pn.postRender(()=>n(e,t))};class rQ extends cu{constructor(){super(...arguments),this.removePointerDownListener=Tr}onPointerDown(e){this.session=new uV(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:SV(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:sU(e),onStart:sU(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Pn.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=Tl(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oI=se.createContext(null);function sQ(){const n=se.useContext(oI);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=se.useId();se.useEffect(()=>i(r),[]);const s=se.useCallback(()=>t&&t(r),[r,t]);return!e&&t?[!1,s]:[!0]}const MV=se.createContext({}),AV=se.createContext({}),H1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function oU(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const Ym={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Lt.test(n))n=parseFloat(n);else return n;const t=oU(n,e.target.x),i=oU(n,e.target.y);return`${t}% ${i}%`}},oQ={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=jc.parse(n);if(r.length>5)return i;const s=jc.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const c=ti(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=c),typeof r[3+o]=="number"&&(r[3+o]/=c),s(r)}},IS={};function aQ(n){Object.assign(IS,n)}const{schedule:aI,cancel:_Ae}=AH(queueMicrotask,!1);class lQ extends se.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;aQ(cQ),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),H1.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Pn.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),aI.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function wV(n){const[e,t]=sQ(),i=se.useContext(MV);return pe.jsx(lQ,{...n,layoutGroup:i,switchLayoutGroup:se.useContext(AV),isPresent:e,safeToRemove:t})}const cQ={borderRadius:{...Ym,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ym,borderTopRightRadius:Ym,borderBottomLeftRadius:Ym,borderBottomRightRadius:Ym,boxShadow:oQ},EV=["TopLeft","TopRight","BottomLeft","BottomRight"],uQ=EV.length,aU=n=>typeof n=="string"?parseFloat(n):n,lU=n=>typeof n=="number"||Lt.test(n);function hQ(n,e,t,i,r,s){r?(n.opacity=ti(0,t.opacity!==void 0?t.opacity:1,dQ(i)),n.opacityExit=ti(e.opacity!==void 0?e.opacity:1,0,fQ(i))):s&&(n.opacity=ti(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;oie?1:t(kv(n,e,i))}function uU(n,e){n.min=e.min,n.max=e.max}function no(n,e){uU(n.x,e.x),uU(n.y,e.y)}function hU(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}function dU(n,e,t,i,r){return n-=e,n=PS(n,1/t,i),r!==void 0&&(n=PS(n,1/r,i)),n}function pQ(n,e=0,t=1,i=.5,r,s=n,o=n){if(Ra.test(e)&&(e=parseFloat(e),e=ti(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=ti(s.min,s.max,i);n===s&&(a-=e),n.min=dU(n.min,e,t,a,r),n.max=dU(n.max,e,t,a,r)}function fU(n,e,[t,i,r],s,o){pQ(n,e[t],e[i],e[r],e.scale,s,o)}const mQ=["x","scaleX","originX"],gQ=["y","scaleY","originY"];function pU(n,e,t,i){fU(n.x,e,mQ,t?t.x:void 0,i?i.x:void 0),fU(n.y,e,gQ,t?t.y:void 0,i?i.y:void 0)}function mU(n){return n.translate===0&&n.scale===1}function bV(n){return mU(n.x)&&mU(n.y)}function gU(n,e){return n.min===e.min&&n.max===e.max}function vQ(n,e){return gU(n.x,e.x)&&gU(n.y,e.y)}function vU(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function CV(n,e){return vU(n.x,e.x)&&vU(n.y,e.y)}function yU(n){return zs(n.x)/zs(n.y)}function _U(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}class yQ{constructor(){this.members=[]}add(e){xA(this.members,e),e.scheduleRender()}remove(e){if(SA(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function _Q(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y,o=(t==null?void 0:t.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:d,skewX:f,skewY:v}=t;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),d&&(i+=`rotateY(${d}deg) `),f&&(i+=`skewX(${f}deg) `),v&&(i+=`skewY(${v}deg) `)}const a=n.x.scale*e.x,l=n.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const xQ=(n,e)=>n.depth-e.depth;class SQ{constructor(){this.children=[],this.isDirty=!1}add(e){xA(this.children,e),this.isDirty=!0}remove(e){SA(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(xQ),this.isDirty=!1,this.children.forEach(e)}}function V1(n){const e=Mr(n)?n.get():n;return dZ(e)?e.toValue():e}function MQ(n,e){const t=Pa.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(Nl(i),n(s-e))};return Pn.read(i,!0),()=>Nl(i)}function AQ(n){return n instanceof SVGElement&&n.tagName!=="svg"}function wQ(n,e,t){const i=Mr(n)?n:zv(n);return i.start(rI("",i,e,t)),i.animation}const ch={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Bg=typeof window<"u"&&window.MotionDebug!==void 0,bT=["","X","Y","Z"],EQ={visibility:"hidden"},xU=1e3;let TQ=0;function CT(n,e,t,i){const{latestValues:r}=e;r[n]&&(t[n]=r[n],e.setStaticValue(n,0),i&&(i[n]=0))}function RV(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=sV(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:s}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",Pn,!(r||s))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&RV(i)}function PV({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=TQ++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Bg&&(ch.totalNodes=ch.resolvedTargetDeltas=ch.recalculatedProjection=0),this.nodes.forEach(RQ),this.nodes.forEach(BQ),this.nodes.forEach(NQ),this.nodes.forEach(PQ),Bg&&window.MotionDebug.record(ch)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=MQ(d,250),H1.hasAnimatedSinceResize&&(H1.hasAnimatedSinceResize=!1,this.nodes.forEach(MU))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeTargetChanged:f,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||u.getDefaultTransition()||zQ,{onLayoutAnimationStart:y,onLayoutAnimationComplete:m}=u.getProps(),S=!this.targetLayout||!CV(this.targetLayout,v)||f,x=!d&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||d&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,x);const M={...X2(_,"layout"),onPlay:y,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else d||MU(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Nl(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(UQ),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&RV(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const R=M/1e3;AU(h.x,o.x,R),AU(h.y,o.y,R),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qg(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),OQ(this.relativeTarget,this.relativeTargetOrigin,d,R),x&&vQ(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Si()),no(x,this.relativeTarget)),_&&(this.animationValues=u,hQ(u,c,this.latestValues,R,S,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Nl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pn.update(()=>{H1.hasAnimatedSinceResize=!0,this.currentAnimation=wQ(0,xU,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(xU),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&IV(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Si();const h=zs(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=zs(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}no(a,l),Qf(a,u),Zg(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new yQ),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&CT("z",o,c,this.animationValues);for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(SU),this.root.sharedNodes.clear()}}}function bQ(n){n.updateLayout()}function CQ(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?oo(h=>{const d=o?t.measuredBox[h]:t.layoutBox[h],f=zs(d);d.min=i[h].min,d.max=d.min+f}):IV(s,t.layoutBox,i)&&oo(h=>{const d=o?t.measuredBox[h]:t.layoutBox[h],f=zs(i[h]);d.max=d.min+f,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[h].max=n.relativeTarget[h].min+f)});const a=qf();Zg(a,i,t.layoutBox);const l=qf();o?Zg(l,n.applyTransform(r,!0),t.measuredBox):Zg(l,i,t.layoutBox);const c=!bV(a);let u=!1;if(!n.resumeFrom){const h=n.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const v=Si();Qg(v,t.layoutBox,d.layoutBox);const _=Si();Qg(_,i,f.layoutBox),CV(v,_)||(u=!0),h.options.layoutRoot&&(n.relativeTarget=_,n.relativeTargetOrigin=v,n.relativeParent=h)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function RQ(n){Bg&&ch.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function PQ(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function IQ(n){n.clearSnapshot()}function SU(n){n.clearMeasurements()}function LQ(n){n.isLayoutDirty=!1}function DQ(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function MU(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function BQ(n){n.resolveTargetDelta()}function NQ(n){n.calcProjection()}function UQ(n){n.resetSkewAndRotation()}function FQ(n){n.removeLeadSnapshot()}function AU(n,e,t){n.translate=ti(e.translate,0,t),n.scale=ti(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function wU(n,e,t,i){n.min=ti(e.min,t.min,i),n.max=ti(e.max,t.max,i)}function OQ(n,e,t,i){wU(n.x,e.x,t.x,i),wU(n.y,e.y,t.y,i)}function kQ(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const zQ={duration:.45,ease:[.4,0,.1,1]},EU=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),TU=EU("applewebkit/")&&!EU("chrome/")?Math.round:Tr;function bU(n){n.min=TU(n.min),n.max=TU(n.max)}function GQ(n){bU(n.x),bU(n.y)}function IV(n,e,t){return n==="position"||n==="preserve-aspect"&&!HZ(yU(e),yU(t),.2)}function HQ(n){var e;return n!==n.root&&((e=n.scroll)===null||e===void 0?void 0:e.wasRoot)}const VQ=PV({attachResizeListener:(n,e)=>yl(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),RT={current:void 0},LV=PV({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!RT.current){const n=new VQ({});n.mount(window),n.setOptions({layoutScroll:!0}),RT.current=n}return RT.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),WQ={pan:{Feature:rQ},drag:{Feature:iQ,ProjectionNode:LV,MeasureLayout:wV}};function CU(n,e){const t=e?"pointerenter":"pointerleave",i=e?"onHoverStart":"onHoverEnd",r=(s,o)=>{if(s.pointerType==="touch"||pV())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e);const l=a[i];l&&Pn.postRender(()=>l(s,o))};return Tl(n.current,t,r,{passive:!n.getProps()[i]})}class $Q extends cu{mount(){this.unmount=El(CU(this.node,!0),CU(this.node,!1))}unmount(){}}class XQ extends cu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=El(yl(this.node.current,"focus",()=>this.onFocus()),yl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const DV=(n,e)=>e?n===e?!0:DV(n,e.parentElement):!1;function PT(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,AA(t))}class jQ extends cu{constructor(){super(...arguments),this.removeStartListeners=Tr,this.removeEndListeners=Tr,this.removeAccessibleListeners=Tr,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),s=Tl(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:h}=this.node.getProps(),d=!h&&!DV(this.node.current,a.target)?u:c;d&&Pn.update(()=>d(a,l))},{passive:!(i.onTap||i.onPointerUp)}),o=Tl(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=El(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||PT("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&Pn.postRender(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=yl(this.node.current,"keyup",o),PT("down",(a,l)=>{this.startPress(a,l)})},t=yl(this.node.current,"keydown",e),i=()=>{this.isPressing&&PT("cancel",(s,o)=>this.cancelPress(s,o))},r=yl(this.node.current,"blur",i);this.removeAccessibleListeners=El(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&Pn.postRender(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!pV()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&Pn.postRender(()=>i(e,t))}mount(){const e=this.node.getProps(),t=Tl(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=yl(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=El(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const FR=new WeakMap,IT=new WeakMap,YQ=n=>{const e=FR.get(n.target);e&&e(n)},JQ=n=>{n.forEach(YQ)};function KQ({root:n,...e}){const t=n||document;IT.has(t)||IT.set(t,{});const i=IT.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(JQ,{root:n,...e})),i[r]}function qQ(n,e,t){const i=KQ(e);return FR.set(n,t),i.observe(n),()=>{FR.delete(n),i.unobserve(n)}}const ZQ={some:0,all:1};class QQ extends cu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:ZQ[r]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),d=c?u:h;d&&d(l)};return qQ(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(eee(e,t))&&this.startObserver()}unmount(){}}function eee({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const tee={inView:{Feature:QQ},tap:{Feature:jQ},focus:{Feature:XQ},hover:{Feature:$Q}},nee={layout:{ProjectionNode:LV,MeasureLayout:wV}},BV=se.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),wA=se.createContext({}),lI=typeof window<"u",iee=lI?se.useLayoutEffect:se.useEffect,NV=se.createContext({strict:!1});let RU=!1;function ree(n,e,t,i,r){var s;const{visualElement:o}=se.useContext(wA),a=se.useContext(NV),l=se.useContext(oI),c=se.useContext(BV).reducedMotion,u=se.useRef();i=i||a.renderer,!u.current&&i&&(u.current=i(n,{visualState:e,parent:o,props:t,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const h=u.current,d=se.useContext(AV);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&oee(u.current,t,r,d),se.useInsertionEffect(()=>{h&&h.update(t,l)});const f=t[rV],v=se.useRef(!!f&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,f)));return iee(()=>{h&&(h.updateFeatures(),aI.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),se.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current=!1,RU||(RU=!0,queueMicrotask(see)))}),h}function see(){window.MotionHandoffIsComplete=!0}function oee(n,e,t,i){const{layoutId:r,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:UV(n.parent)),n.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||a&&Kf(a),visualElement:n,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:c})}function UV(n){if(n)return n.options.allowProjection!==!1?n.projection:UV(n.parent)}function aee(n,e,t){return se.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):Kf(t)&&(t.current=i))},[e])}function EA(n){return Uv(n.animate)||$2.some(e=>Fv(n[e]))}function FV(n){return!!(EA(n)||n.variants)}function lee(n,e){if(EA(n)){const{initial:t,animate:i}=n;return{initial:t===!1||Fv(t)?t:void 0,animate:Fv(i)?i:void 0}}return n.inherit!==!1?e:{}}function cee(n){const{initial:e,animate:t}=lee(n,se.useContext(wA));return se.useMemo(()=>({initial:e,animate:t}),[PU(e),PU(t)])}function PU(n){return Array.isArray(n)?n.join(" "):n}const IU={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Bp={};for(const n in IU)Bp[n]={isEnabled:e=>IU[n].some(t=>!!e[t])};function uee(n){for(const e in n)Bp[e]={...Bp[e],...n[e]}}const hee=Symbol.for("motionComponentSymbol");function dee({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&uee(n);function s(a,l){let c;const u={...se.useContext(BV),...a,layoutId:fee(a)},{isStatic:h}=u,d=cee(a),f=i(a,h);if(!h&&lI){pee();const v=mee(u);c=v.MeasureLayout,d.visualElement=ree(r,f,u,e,v.ProjectionNode)}return pe.jsxs(wA.Provider,{value:d,children:[c&&d.visualElement?pe.jsx(c,{visualElement:d.visualElement,...u}):null,t(r,a,aee(f,d.visualElement,l),f,h,d.visualElement)]})}const o=se.forwardRef(s);return o[hee]=r,o}function fee({layoutId:n}){const e=se.useContext(MV).id;return e&&n!==void 0?e+"-"+n:n}function pee(n,e){se.useContext(NV).strict}function mee(n){const{drag:e,layout:t}=Bp;if(!e&&!t)return{};const i={...e,...t};return{MeasureLayout:e!=null&&e.isEnabled(n)||t!=null&&t.isEnabled(n)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const gee=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function cI(n){return typeof n!="string"||n.includes("-")?!1:!!(gee.indexOf(n)>-1||/[A-Z]/u.test(n))}function OV(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const kV=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function zV(n,e,t,i){OV(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(kV.has(r)?r:MA(r),e.attrs[r])}function GV(n,{layout:e,layoutId:t}){return lu.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!IS[n]||n==="opacity")}function uI(n,e,t){var i;const{style:r}=n,s={};for(const o in r)(Mr(r[o])||e.style&&Mr(e.style[o])||GV(o,n)||((i=t==null?void 0:t.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return t&&r&&typeof r.willChange=="string"&&(t.applyWillChange=!1),s}function HV(n,e,t){const i=uI(n,e,t);for(const r in n)if(Mr(n[r])||Mr(e[r])){const s=$0.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=n[r]}return i}function vee(n){const e=se.useRef(null);return e.current===null&&(e.current=n()),e.current}function yee({applyWillChange:n=!1,scrapeMotionValuesFromProps:e,createRenderState:t,onMount:i},r,s,o,a){const l={latestValues:xee(r,s,o,a?!1:n,e),renderState:t()};return i&&(l.mount=c=>i(r,c,l)),l}const VV=n=>(e,t)=>{const i=se.useContext(wA),r=se.useContext(oI),s=()=>yee(n,e,i,r,t);return t?s():vee(s)};function _ee(n,e){const t=oV(e);t&&xA(n,t)}function LU(n,e,t){const i=Array.isArray(e)?e:[e];for(let r=0;r{for(const S in y){let x=y[S];if(Array.isArray(x)){const M=v?x.length-1:0;x=x[M]}x!==null&&(o[S]=x)}for(const S in m)o[S]=m[S]}),l&&(h&&u!==!1&&!Uv(h)&&LU(n,h,y=>{for(const m in y)_ee(a,m)}),a.length&&(o.willChange=a.join(","))),o}const hI=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),WV=()=>({...hI(),attrs:{}}),$V=(n,e)=>e&&typeof n=="number"?e.transform(n):n,See={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Mee=$0.length;function Aee(n,e,t){let i="",r=!0;for(let s=0;stypeof n=="string"&&n.toLowerCase()==="svg",Cee={useVisualState:VV({scrapeMotionValuesFromProps:HV,createRenderState:WV,onMount:(n,e,{renderState:t,latestValues:i})=>{Pn.read(()=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}),Pn.render(()=>{fI(t,i,pI(e.tagName),n.transformTemplate),zV(e,t)})}})},Ree={useVisualState:VV({applyWillChange:!0,scrapeMotionValuesFromProps:uI,createRenderState:hI})};function XV(n,e,t){for(const i in e)!Mr(e[i])&&!GV(i,t)&&(n[i]=e[i])}function Pee({transformTemplate:n},e){return se.useMemo(()=>{const t=hI();return dI(t,e,n),Object.assign({},t.vars,t.style)},[e])}function Iee(n,e){const t=n.style||{},i={};return XV(i,t,n),Object.assign(i,Pee(n,e)),i}function Lee(n,e){const t={},i=Iee(n,e);return n.drag&&n.dragListener!==!1&&(t.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(t.tabIndex=0),t.style=i,t}const Dee=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function LS(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Dee.has(n)}let jV=n=>!LS(n);function Bee(n){n&&(jV=e=>e.startsWith("on")?!LS(e):n(e))}try{Bee(require("@emotion/is-prop-valid").default)}catch{}function Nee(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(jV(r)||t===!0&&LS(r)||!e&&!LS(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function Uee(n,e,t,i){const r=se.useMemo(()=>{const s=WV();return fI(s,e,pI(i),n.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};XV(s,n.style,n),r.style={...s,...r.style}}return r}function Fee(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(cI(t)?Uee:Lee)(i,s,o,t),c=Nee(i,typeof t=="string",n),u=t!==se.Fragment?{...c,...l,ref:r}:{},{children:h}=i,d=se.useMemo(()=>Mr(h)?h.get():h,[h]);return se.createElement(t,{...u,children:d})}}function Oee(n,e){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...cI(i)?Cee:Ree,preloadedFeatures:n,useRender:Fee(r),createVisualElement:e,Component:i};return dee(o)}}const OR={current:null},YV={current:!1};function kee(){if(YV.current=!0,!!lI)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>OR.current=n.matches;n.addListener(e),e()}else OR.current=!1}function zee(n,e,t){for(const i in e){const r=e[i],s=t[i];if(Mr(r))n.addValue(i,r);else if(Mr(s))n.addValue(i,zv(r,{owner:n}));else if(s!==r)if(n.hasValue(i)){const o=n.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=n.getStaticValue(i);n.addValue(i,zv(o!==void 0?o:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const BU=new WeakMap,Gee=[...PH,_r,jc],Hee=n=>Gee.find(RH(n)),NU=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Vee{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=J2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=Pa.now();this.renderScheduledAtthis.bindToMotionValue(i,t)),YV.current||kee(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:OR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){BU.delete(this.current),this.projection&&this.projection.unmount(),Nl(this.notifyUpdate),Nl(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=lu.has(e),r=t.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Pn.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),s(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Bp){const t=Bp[e];if(!t)continue;const{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Si()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;it.variantChildren.delete(e)}addValue(e,t){const i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=zv(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){var i;let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(i=this.getBaseTargetFromProps(this.props,e))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(EH(r)||wH(r))?r=parseFloat(r):!Hee(r)&&jc.test(t)&&(r=OH(e,t)),this.setBaseTarget(e,Mr(r)?r.get():r)),Mr(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=V2(this.props,i,(t=this.presenceContext)===null||t===void 0?void 0:t.custom);o&&(r=o[e])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Mr(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new sI),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class JV extends Vee{constructor(){super(...arguments),this.KeyframeResolver=kH}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}}function Wee(n){return window.getComputedStyle(n)}class $ee extends JV{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=OV}readValueFromInstance(e,t){if(lu.has(t)){const i=Z2(t);return i&&i.default||0}else{const i=Wee(e),r=(bH(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return xV(e,t)}build(e,t,i){dI(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return uI(e,t,i)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Mr(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Xee extends JV{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Si}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(lu.has(t)){const i=Z2(t);return i&&i.default||0}return t=kV.has(t)?t:MA(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return HV(e,t,i)}build(e,t,i){fI(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,r){zV(e,t,i,r)}mount(e){this.isSVGTag=pI(e.tagName),super.mount(e)}}const jee=(n,e)=>cI(n)?new Xee(e):new $ee(e,{allowProjection:n!==se.Fragment}),Yee=Oee({...DZ,...tee,...WQ,...nee},jee),vo=bK(Yee),TA=n=>({hidden:{y:-50,opacity:0},show:{y:0,opacity:1,transition:{type:"spring",duration:1.25,delay:n??0}}}),mI=({direction:n,type:e,delay:t,duration:i})=>({hidden:{x:n==="left"?100:n==="right"?-100:0,y:n==="up"?"100%":n==="down"?"-100%":0,opacity:0},show:{x:0,y:0,opacity:1,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),Jee=({delay:n,duration:e})=>({hidden:{scale:0,opacity:0},show:{scale:1,opacity:1,transition:{type:"tween",delay:n,duration:e,ease:"easeOut"}}}),kR=({direction:n,type:e,delay:t,duration:i})=>({hidden:{x:n==="left"?"-100%":n==="right"?"100%":0,y:n==="up"?"100%":n==="down"?"-100%":0},show:{x:0,y:0,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),Kee=""+new URL("logo-DJlf-uNS.png",import.meta.url).href,qee=()=>{const[n,e]=se.useState(!1),t=()=>e(!n),[i,r]=se.useState(!1),s=()=>{window.scrollY!=0?r(!0):r(!1)};return se.useEffect(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),pe.jsxs("div",{className:Go("flex justify-between px-8 py-6 sticky top-0 transition-all duration-300 z-50",i&&"nav-start-scrolling"),children:[pe.jsx("div",{className:"text-callToAction self-center relative w-[100px] h-[20px]",children:pe.jsx("img",{src:Kee,alt:"logo",className:"w-[100px] absolute top-[-23px] right-0"})}),pe.jsxs("div",{className:"flex items-center gap-8 max",children:[SN.map((o,a)=>pe.jsxs(vo.a,{initial:"hidden",whileInView:"show",variants:mI({direction:"down",type:"spring",delay:(a-1)*.2,duration:.6}),href:o.path,className:"text-primaryLight tracking-wider hidden md:block hover:text-callToAction transition-all duration-300",children:[pe.jsxs("p",{className:"inline text-callToAction mr-2",children:[("0"+a.toString()).slice(-2),"."]}),o.label]},a)),pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:Jee({delay:0,duration:1}),children:pe.jsx("div",{className:"hidden md:block",children:pe.jsx(AR,{size:"medium",children:pe.jsx("a",{href:"https://niv-shtibel.me/NivShtibelCV.pdf",children:"Resume"})})})}),pe.jsxs("div",{className:Go("flex flex-col gap-[7px] md:hidden z-50",n&&"hamburger-active fixed right-8"),dir:"rtl",role:"button",onClick:t,tabIndex:0,onKeyDown:t,children:[pe.jsx("div",{className:"bg-callToAction w-[44px] h-[2px] rounded-md transition-all"}),pe.jsx("div",{className:"bg-callToAction w-[36px] h-[2px] rounded-md transition-all"}),pe.jsx("div",{className:"bg-callToAction w-[27px] h-[2px] rounded-md transition-all"})]})]}),pe.jsxs("div",{className:Go("hidden transition-all duration-500 w-0 items-center gap-10 justify-center md:hidden",n&&"sidebar-active"),children:[SN.map((o,a)=>pe.jsxs("a",{href:o.path,className:"text-primaryLight text-xl hover:text-callToAction transition-all duration-300 flex flex-col",children:[pe.jsxs("p",{className:" text-callToAction self-center",children:[("0"+a.toString()).slice(-2),"."]}),o.label]},a)),pe.jsx(AR,{size:"large",children:pe.jsx("a",{href:"https://niv-shtibel.me/NivShtibelCV.pdf",children:"Resume"})})]})]})},Zee=""+new URL("2-2H0btqWY.png",import.meta.url).href,Qee=()=>pe.jsxs("section",{id:"about",className:"mt-44 container mx-auto",children:[pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:TA(null),className:"flex flex-col gap-2 items-center",children:pe.jsx("h1",{className:"text-secondary text-4xl sm:text-7xl inline font-bold",children:"About Me."})}),pe.jsxs("div",{className:"flex flex-col items-center md:justify-center md:flex-row gap-24 mt-10 overflow-hidden",children:[pe.jsxs(vo.div,{initial:"hidden",whileInView:"show",variants:mI({direction:"left",type:"spring",delay:0,duration:.5}),className:"mx-3 md:w-[40%]",children:[pe.jsx("p",{className:"text-primary break-words text-lg md:text-2xl",children:"I am an autodidact, and I believe that staying current with the latest technologies is essential to success in this field. In my free time, I enjoy engaging in online gaming, traveling, and spending time with loved ones. I bring a unique perspective and a drive for innovation to every project, and I am always eager to learn and grow as a developer."}),pe.jsxs("p",{className:"text-primary break-words text-lg md:text-2xl pt-4",children:["My main focus these days is building accessible, inclusive shopify applications and web services at"," ",pe.jsx("a",{href:"https://oversight.co.il/",target:"_blank",rel:"noreferrer",className:"text-callToAction inline-block underline-link",children:"oversight"})," ","."]})]}),pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:kR({direction:"right",type:"spring",delay:0,duration:.5}),className:"mb-4",children:pe.jsx("div",{className:"w-[200px] md:w-[300px]",children:pe.jsx("img",{src:Zee,alt:"as"})})})]})]});/** +`,SR=n=>pe.jsx(PK,{size:n.size,disabled:n.disabled,onClick:n.onClick,role:"button",tabIndex:0,onKeyDown:n.onClick,children:n.children}),wN=[{label:"About",path:"#about"},{label:"Work",path:"#work"},{label:"Projects",path:"#projects"},{label:"Contact",path:"#contact"}];function IK(n){if(typeof Proxy>"u")return n;const e=new Map,t=(...i)=>n(...i);return new Proxy(t,{get:(i,r)=>r==="create"?n:(e.has(r)||e.set(r,n(r)),e.get(r))})}function Uv(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const MR=n=>Array.isArray(n);function EH(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;i{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function H2(n,e,t,i){if(typeof e=="function"){const[r,s]=EN(i);e=e(t!==void 0?t:n.custom,r,s)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,s]=EN(i);e=e(t!==void 0?t:n.custom,r,s)}return e}function yA(n,e,t){const i=n.getProps();return H2(i,e,t!==void 0?t:i.custom,n)}const V2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],W2=["initial",...V2],$0=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],lu=new Set($0),Al=n=>n*1e3,wl=n=>n/1e3,LK={type:"spring",stiffness:500,damping:25,restSpeed:10},DK=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),BK={type:"keyframes",duration:.8},NK={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},UK=(n,{keyframes:e})=>e.length>2?BK:lu.has(n)?n.startsWith("scale")?DK(e[1]):LK:NK;function $2(n,e){return n?n[e]||n.default||n:void 0}const FK={skipAnimations:!1,useManualTiming:!1},OK=n=>n!==null;function _A(n,{repeat:e,repeatType:t="loop"},i){const r=n.filter(OK),s=e&&t!=="loop"&&e%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const Tr=n=>n;function kK(n){let e=new Set,t=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),n()),c(o)}const l={schedule:(c,u=!1,h=!1)=>{const f=h&&i?e:t;return u&&s.add(c),f.has(c)||f.add(c),c},cancel:c=>{t.delete(c),s.delete(c)},process:c=>{if(o=c,i){r=!0;return}i=!0,[e,t]=[t,e],t.clear(),e.forEach(a),i=!1,r&&(r=!1,l.process(c))}};return l}const I_=["read","resolveKeyframes","update","preRender","render","postRender"],zK=40;function TH(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>t=!0,o=I_.reduce((m,S)=>(m[S]=kK(s),m),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:h,postRender:d}=o,f=()=>{const m=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(m-r.timestamp,zK),1),r.timestamp=m,r.isProcessing=!0,a.process(r),l.process(r),c.process(r),u.process(r),h.process(r),d.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(f))},v=()=>{t=!0,i=!0,r.isProcessing||n(f)};return{schedule:I_.reduce((m,S)=>{const x=o[S];return m[S]=(M,R=!1,T=!1)=>(t||v(),x.schedule(M,R,T)),m},{}),cancel:m=>{for(let S=0;S(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,GK=1e-7,HK=12;function VK(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=bH(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>GK&&++aVK(s,0,1,n,t);return s=>s===0||s===1?s:bH(r(s),e,i)}const CH=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,RH=n=>e=>1-n(1-e),PH=X0(.33,1.53,.69,.99),X2=RH(PH),IH=CH(X2),LH=n=>(n*=2)<1?.5*X2(n):.5*(2-Math.pow(2,-10*(n-1))),j2=n=>1-Math.sin(Math.acos(n)),DH=RH(j2),BH=CH(j2),NH=n=>/^0[^.\s]+$/u.test(n);function WK(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||NH(n):!0}let AR=Tr;const UH=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),FH=n=>e=>typeof e=="string"&&e.startsWith(n),OH=FH("--"),$K=FH("var(--"),Y2=n=>$K(n)?XK.test(n.split("/*")[0].trim()):!1,XK=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,jK=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function YK(n){const e=jK.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t??i}`,r]}function kH(n,e,t=1){const[i,r]=YK(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return UH(o)?parseFloat(o):o}return Y2(r)?kH(r,e,t+1):r}const Xc=(n,e,t)=>t>e?e:ttypeof n=="number",parse:parseFloat,transform:n=>n},Ov={...nm,transform:n=>Xc(0,1,n)},L_={...nm,default:1},j0=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Mc=j0("deg"),Ra=j0("%"),Lt=j0("px"),JK=j0("vh"),KK=j0("vw"),TN={...Ra,parse:n=>Ra.parse(n)/100,transform:n=>Ra.transform(n*100)},qK=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),bN=n=>n===nm||n===Lt,CN=(n,e)=>parseFloat(n.split(", ")[e]),RN=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return CN(r[1],e);{const s=i.match(/^matrix\((.+)\)$/u);return s?CN(s[1],n):0}},ZK=new Set(["x","y","z"]),QK=$0.filter(n=>!ZK.has(n));function eq(n){const e=[];return QK.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const Dp={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:RN(4,13),y:RN(5,14)};Dp.translateX=Dp.x;Dp.translateY=Dp.y;const zH=n=>e=>e.test(n),tq={test:n=>n==="auto",parse:n=>n},GH=[nm,Lt,Ra,Mc,KK,JK,tq],PN=n=>GH.find(zH(n)),Oh=new Set;let wR=!1,ER=!1;function HH(){if(ER){const n=Array.from(Oh).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=eq(i);r.length&&(t.set(i,r),i.render())}),n.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=t.get(i);r&&r.forEach(([s,o])=>{var a;(a=i.getValue(s))===null||a===void 0||a.set(o)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}ER=!1,wR=!1,Oh.forEach(n=>n.complete()),Oh.clear()}function VH(){Oh.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(ER=!0)})}function nq(){VH(),HH()}class J2{constructor(e,t,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Oh.add(this),wR||(wR=!0,Bn.read(VH),Bn.resolveKeyframes(HH))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;for(let s=0;sMath.round(n*1e5)/1e5,K2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function iq(n){return n==null}const rq=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,q2=(n,e)=>t=>!!(typeof t=="string"&&rq.test(t)&&t.startsWith(n)||e&&!iq(t)&&Object.prototype.hasOwnProperty.call(t,e)),WH=(n,e,t)=>i=>{if(typeof i!="string")return i;const[r,s,o,a]=i.match(K2);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},sq=n=>Xc(0,255,n),yT={...nm,transform:n=>Math.round(sq(n))},Mh={test:q2("rgb","red"),parse:WH("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+yT.transform(n)+", "+yT.transform(e)+", "+yT.transform(t)+", "+qg(Ov.transform(i))+")"};function oq(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const TR={test:q2("#"),parse:oq,transform:Mh.transform},Jf={test:q2("hsl","hue"),parse:WH("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Ra.transform(qg(e))+", "+Ra.transform(qg(t))+", "+qg(Ov.transform(i))+")"},_r={test:n=>Mh.test(n)||TR.test(n)||Jf.test(n),parse:n=>Mh.test(n)?Mh.parse(n):Jf.test(n)?Jf.parse(n):TR.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Mh.transform(n):Jf.transform(n)},aq=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function lq(n){var e,t;return isNaN(n)&&typeof n=="string"&&(((e=n.match(K2))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(aq))===null||t===void 0?void 0:t.length)||0)>0}const $H="number",XH="color",cq="var",uq="var(",IN="${}",hq=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function kv(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let s=0;const a=e.replace(hq,l=>(_r.test(l)?(i.color.push(s),r.push(XH),t.push(_r.parse(l))):l.startsWith(uq)?(i.var.push(s),r.push(cq),t.push(l)):(i.number.push(s),r.push($H),t.push(parseFloat(l))),++s,IN)).split(IN);return{values:t,split:a,indexes:i,types:r}}function jH(n){return kv(n).values}function YH(n){const{split:e,types:t}=kv(n),i=e.length;return r=>{let s="";for(let o=0;otypeof n=="number"?0:n;function fq(n){const e=jH(n);return YH(n)(e.map(dq))}const jc={test:lq,parse:jH,createTransformer:YH,getAnimatableNone:fq},pq=new Set(["brightness","contrast","saturate","opacity"]);function mq(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(K2)||[];if(!i)return n;const r=t.replace(i,"");let s=pq.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const gq=/\b([a-z-]*)\(.*?\)/gu,bR={...jc,getAnimatableNone:n=>{const e=n.match(gq);return e?e.map(mq).join(" "):n}},vq={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt},yq={rotate:Mc,rotateX:Mc,rotateY:Mc,rotateZ:Mc,scale:L_,scaleX:L_,scaleY:L_,scaleZ:L_,skew:Mc,skewX:Mc,skewY:Mc,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Ov,originX:TN,originY:TN,originZ:Lt},LN={...nm,transform:Math.round},Z2={...vq,...yq,zIndex:LN,size:Lt,fillOpacity:Ov,strokeOpacity:Ov,numOctaves:LN},_q={...Z2,color:_r,backgroundColor:_r,outlineColor:_r,fill:_r,stroke:_r,borderColor:_r,borderTopColor:_r,borderRightColor:_r,borderBottomColor:_r,borderLeftColor:_r,filter:bR,WebkitFilter:bR},Q2=n=>_q[n];function JH(n,e){let t=Q2(n);return t!==bR&&(t=jc),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const xq=new Set(["auto","none","0"]);function Sq(n,e,t){let i=0,r;for(;i{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function eI(n){return typeof n=="function"}let z1;function Mq(){z1=void 0}const Pa={now:()=>(z1===void 0&&Pa.set(nr.isProcessing||FK.useManualTiming?nr.timestamp:performance.now()),z1),set:n=>{z1=n,queueMicrotask(Mq)}},DN=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(jc.test(n)||n==="0")&&!n.startsWith("url("));function Aq(n){const e=n[0];if(n.length===1)return!0;for(let t=0;tEq?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&nq(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Pa.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!wq(e,i,r,s))if(o)this.options.duration=0;else{l==null||l(_A(e,this.options,t)),a==null||a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,t);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:t,...u},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function ZH(n,e){return e?n*(1e3/e):0}const Tq=5;function QH(n,e,t){const i=Math.max(e-Tq,0);return ZH(t-n(i),e-i)}const _T=.001,bq=.01,Cq=10,Rq=.05,Pq=1;function Iq({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s,o=1-e;o=Xc(Rq,Pq,o),n=Xc(bq,Cq,wl(n)),o<1?(r=c=>{const u=c*o,h=u*n,d=u-t,f=CR(c,o),v=Math.exp(-h);return _T-d/f*v},s=c=>{const h=c*o*n,d=h*t+t,f=Math.pow(o,2)*Math.pow(c,2)*n,v=Math.exp(-h),_=CR(Math.pow(c,2),o);return(-r(c)+_T>0?-1:1)*((d-f)*v)/_}):(r=c=>{const u=Math.exp(-c*n),h=(c-t)*n+1;return-_T+u*h},s=c=>{const u=Math.exp(-c*n),h=(t-c)*(n*n);return u*h});const a=5/n,l=Dq(r,s,a);if(n=Al(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const Lq=12;function Dq(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function Uq(n){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...n};if(!BN(n,Nq)&&BN(n,Bq)){const t=Iq(n);e={...e,...t,mass:1},e.isResolvedFromDuration=!0}return e}function eV({keyframes:n,restDelta:e,restSpeed:t,...i}){const r=n[0],s=n[n.length-1],o={done:!1,value:r},{stiffness:a,damping:l,mass:c,duration:u,velocity:h,isResolvedFromDuration:d}=Uq({...i,velocity:-wl(i.velocity||0)}),f=h||0,v=l/(2*Math.sqrt(a*c)),_=s-r,y=wl(Math.sqrt(a/c)),m=Math.abs(_)<5;t||(t=m?.01:2),e||(e=m?.005:.5);let S;if(v<1){const x=CR(y,v);S=M=>{const R=Math.exp(-v*y*M);return s-R*((f+v*y*_)/x*Math.sin(x*M)+_*Math.cos(x*M))}}else if(v===1)S=x=>s-Math.exp(-y*x)*(_+(f+y*_)*x);else{const x=y*Math.sqrt(v*v-1);S=M=>{const R=Math.exp(-v*y*M),T=Math.min(x*M,300);return s-R*((f+v*y*_)*Math.sinh(T)+x*_*Math.cosh(T))/x}}return{calculatedDuration:d&&u||null,next:x=>{const M=S(x);if(d)o.done=x>=u;else{let R=0;v<1&&(R=x===0?Al(f):QH(S,x,M));const T=Math.abs(R)<=t,P=Math.abs(s-M)<=e;o.done=T&&P}return o.value=o.done?s:M,o}}}function NN({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=n[0],d={done:!1,value:h},f=I=>a!==void 0&&Il,v=I=>a===void 0?l:l===void 0||Math.abs(a-I)-_*Math.exp(-I/i),x=I=>m+S(I),M=I=>{const b=S(I),w=x(I);d.done=Math.abs(b)<=c,d.value=d.done?m:w};let R,T;const P=I=>{f(d.value)&&(R=I,T=eV({keyframes:[d.value,v(d.value)],velocity:QH(x,I,d.value),damping:r,stiffness:s,restDelta:c,restSpeed:u}))};return P(0),{calculatedDuration:null,next:I=>{let b=!1;return!T&&R===void 0&&(b=!0,M(I),P(I)),R!==void 0&&I>=R?T.next(I-R):(!b&&M(I),d)}}}const Fq=X0(.42,0,1,1),Oq=X0(0,0,.58,1),tV=X0(.42,0,.58,1),kq=n=>Array.isArray(n)&&typeof n[0]!="number",tI=n=>Array.isArray(n)&&typeof n[0]=="number",UN={linear:Tr,easeIn:Fq,easeInOut:tV,easeOut:Oq,circIn:j2,circInOut:BH,circOut:DH,backIn:X2,backInOut:IH,backOut:PH,anticipate:LH},FN=n=>{if(tI(n)){AR(n.length===4);const[e,t,i,r]=n;return X0(e,t,i,r)}else if(typeof n=="string")return AR(UN[n]!==void 0),UN[n];return n},zq=(n,e)=>t=>e(n(t)),El=(...n)=>n.reduce(zq),Bp=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},ti=(n,e,t)=>n+(e-n)*t;function xT(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function Gq({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=xT(l,a,n+1/3),s=xT(l,a,n),o=xT(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function TS(n,e){return t=>t>0?e:n}const ST=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},Hq=[TR,Mh,Jf],Vq=n=>Hq.find(e=>e.test(n));function ON(n){const e=Vq(n);if(!e)return!1;let t=e.parse(n);return e===Jf&&(t=Gq(t)),t}const kN=(n,e)=>{const t=ON(n),i=ON(e);if(!t||!i)return TS(n,e);const r={...t};return s=>(r.red=ST(t.red,i.red,s),r.green=ST(t.green,i.green,s),r.blue=ST(t.blue,i.blue,s),r.alpha=ti(t.alpha,i.alpha,s),Mh.transform(r))},RR=new Set(["none","hidden"]);function Wq(n,e){return RR.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function $q(n,e){return t=>ti(n,e,t)}function nI(n){return typeof n=="number"?$q:typeof n=="string"?Y2(n)?TS:_r.test(n)?kN:Yq:Array.isArray(n)?nV:typeof n=="object"?_r.test(n)?kN:Xq:TS}function nV(n,e){const t=[...n],i=t.length,r=n.map((s,o)=>nI(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in i)t[s]=i[s](r);return t}}function jq(n,e){var t;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const t=jc.createTransformer(e),i=kv(n),r=kv(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?RR.has(n)&&!r.values.length||RR.has(e)&&!i.values.length?Wq(n,e):El(nV(jq(i,r),r.values),t):TS(n,e)};function iV(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?ti(n,e,t):nI(n)(n,e)}function Jq(n,e,t){const i=[],r=t||iV,s=n.length-1;for(let o=0;oe[0];if(s===2&&n[0]===n[1])return()=>e[1];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=Jq(e,i,r),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Xc(n[0],n[s-1],c)):l}function qq(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=Bp(0,e,i);n.push(ti(t,1,r))}}function Zq(n){const e=[0];return qq(e,n.length-1),e}function Qq(n,e){return n.map(t=>t*e)}function eZ(n,e){return n.map(()=>e||tV).splice(0,n.length-1)}function bS({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=kq(i)?i.map(FN):FN(i),s={done:!1,value:e[0]},o=Qq(t&&t.length===e.length?t:Zq(e),n),a=Kq(o,e,{ease:Array.isArray(r)?r:eZ(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}const zN=2e4;function tZ(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=zN?1/0:e}const nZ=n=>{const e=({timestamp:t})=>n(t);return{start:()=>Bn.update(e,!0),stop:()=>$c(e),now:()=>nr.isProcessing?nr.timestamp:Pa.now()}},iZ={decay:NN,inertia:NN,tween:bS,keyframes:bS,spring:eV},rZ=n=>n/100;class iI extends qH{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:t,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||J2,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,t,i,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,a=eI(t)?t:iZ[t]||bS;let l,c;a!==bS&&typeof e[0]!="number"&&(l=El(rZ,iV(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});s==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=tZ(u));const{calculatedDuration:h}=u,d=h+r,f=d*(i+1)-r;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,t=!1){const{resolved:i}=this;if(!i){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:h}=i;if(this.startTime===null)return s.next(0);const{delay:d,repeat:f,repeatType:v,repeatDelay:_,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),t?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const m=this.currentTime-d*(this.speed>=0?1:-1),S=this.speed>=0?m<0:m>u;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let x=this.currentTime,M=s;if(f){const I=Math.min(this.currentTime,u)/h;let b=Math.floor(I),w=I%1;!w&&I>=1&&(w=1),w===1&&b--,b=Math.min(b,f+1),!!(b%2)&&(v==="reverse"?(w=1-w,_&&(w-=_/h)):v==="mirror"&&(M=o)),x=Xc(0,1,w)*h}const R=S?{done:!1,value:l[0]}:M.next(x);a&&(R.value=a(R.value));let{done:T}=R;!S&&c!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return P&&r!==void 0&&(R.value=_A(l,this.options,r)),y&&y(R.value),P&&this.finish(),R}get duration(){const{resolved:e}=this;return e?wl(e.calculatedDuration):0}get time(){return wl(this.currentTime)}set time(e){e=Al(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=wl(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=nZ,onPlay:t,startTime:i}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),t&&t();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const rV=new Set(["opacity","clipPath","filter","transform"]),sZ=10,oZ=(n,e)=>{let t="";const i=Math.max(Math.round(e/sZ),2);for(let r=0;r(e===void 0&&(e=n()),e)}const aZ={linearEasing:void 0};function lZ(n,e){const t=rI(n);return()=>{var i;return(i=aZ[e])!==null&&i!==void 0?i:t()}}const CS=lZ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function sV(n){return!!(typeof n=="function"&&CS()||!n||typeof n=="string"&&(n in PR||CS())||tI(n)||Array.isArray(n)&&n.every(sV))}const Bg=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,PR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bg([0,.65,.55,1]),circOut:Bg([.55,0,1,.45]),backIn:Bg([.31,.01,.66,-.59]),backOut:Bg([.33,1.53,.69,.99])};function oV(n,e){if(n)return typeof n=="function"&&CS()?oZ(n,e):tI(n)?Bg(n):Array.isArray(n)?n.map(t=>oV(t,e)||PR.easeOut):PR[n]}function cZ(n,e,t,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const c={[e]:t};l&&(c.offset=l);const u=oV(a,r);return Array.isArray(u)&&(c.easing=u),n.animate(c,{delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function GN(n,e){n.timeline=e,n.onfinish=null}const uZ=rI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),RS=10,hZ=2e4;function dZ(n){return eI(n.type)||n.type==="spring"||!sV(n.ease)}function fZ(n,e){const t=new iI({...e,keyframes:n,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:n[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,a),t,i,r),this.resolver.scheduleResolve()}initPlayback(e,t){var i;let{duration:r=300,times:s,ease:o,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!(!((i=l.owner)===null||i===void 0)&&i.current))return!1;if(typeof o=="string"&&CS()&&pZ(o)&&(o=aV[o]),dZ(this.options)){const{onComplete:d,onUpdate:f,motionValue:v,element:_,...y}=this.options,m=fZ(e,y);e=m.keyframes,e.length===1&&(e[1]=e[0]),r=m.duration,s=m.times,o=m.ease,a="keyframes"}const h=cZ(l.owner.current,c,e,{...this.options,duration:r,times:s,ease:o});return h.startTime=u??this.calcStartTime(),this.pendingTimeline?(GN(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:d}=this.options;l.set(_A(e,this.options,t)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:r,times:s,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return wl(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return wl(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.currentTime=Al(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:t}=this;if(!t)return Tr;const{animation:i}=t;GN(i,e)}return Tr}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.playState==="finished"&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:i,duration:r,type:s,ease:o,times:a}=e;if(t.playState==="idle"||t.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:h,element:d,...f}=this.options,v=new iI({...f,keyframes:i,duration:r,type:s,ease:o,times:a,isGenerator:!0}),_=Al(this.time);c.setWithVelocity(v.sample(_-RS).value,v.sample(_).value,RS)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:i,repeatDelay:r,repeatType:s,damping:o,type:a}=e;return uZ()&&i&&rV.has(i)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&s!=="mirror"&&o!==0&&a!=="inertia"}}const mZ=rI(()=>window.ScrollTimeline!==void 0);class gZ{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;imZ()&&r.attachTimeline?r.attachTimeline(e):t(r));return()=>{i.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function vZ({when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const sI=(n,e,t,i={},r,s)=>o=>{const a=$2(i,n)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-Al(l);let u={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:n,motionValue:e,element:s?void 0:r};vZ(a)||(u={...u,...UK(n,u)}),u.duration&&(u.duration=Al(u.duration)),u.repeatDelay&&(u.repeatDelay=Al(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),h&&!s&&e.get()!==void 0){const d=_A(u.keyframes,a);if(d!==void 0)return Bn.update(()=>{u.onUpdate(d),u.onComplete()}),new gZ([])}return!s&&HN.supports(u)?new HN(u):new iI(u)},yZ=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),_Z=n=>MR(n)?n[n.length-1]||0:n;function oI(n,e){n.indexOf(e)===-1&&n.push(e)}function aI(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class lI{constructor(){this.subscriptions=[]}add(e){return oI(this.subscriptions,e),()=>aI(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s!isNaN(parseFloat(n));class SZ{constructor(e,t={}){this.version="11.11.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=Pa.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Pa.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=xZ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new lI);const i=this.events[e].add(t);return e==="change"?()=>{i(),Bn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Pa.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>VN)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,VN);return ZH(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zv(n,e){return new SZ(n,e)}function MZ(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,zv(t))}function AZ(n,e){const t=yA(n,e);let{transitionEnd:i={},transition:r={},...s}=t||{};s={...s,...i};for(const o in s){const a=_Z(s[o]);MZ(n,o,a)}}const xA=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),wZ="framerAppearId",lV="data-"+xA(wZ);function cV(n){return n.props[lV]}const Mr=n=>!!(n&&n.getVelocity);function EZ(n){return!!(Mr(n)&&n.add)}function uV(n){if(lu.has(n))return"transform";if(rV.has(n))return xA(n)}function IR(n,e){var t;if(!n.applyWillChange)return;const i=n.getValue("willChange");if(EZ(i))return i.add(e);!(!((t=n.props.style)===null||t===void 0)&&t.willChange)&&uV(e)&&n.setStaticValue("willChange","transform")}function TZ({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function hV(n,e,{delay:t=0,transitionOverride:i,type:r}={}){var s;let{transition:o=n.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(o=i);const c=[],u=r&&n.animationState&&n.animationState.getState()[r];for(const h in l){const d=n.getValue(h,(s=n.latestValues[h])!==null&&s!==void 0?s:null),f=l[h];if(f===void 0||u&&TZ(u,h))continue;const v={delay:t,...$2(o||{},h)};let _=!1;if(window.MotionHandoffAnimation){const m=cV(n);if(m){const S=window.MotionHandoffAnimation(m,h,Bn);S!==null&&(v.startTime=S,_=!0)}}IR(n,h),d.start(sI(h,d,f,n.shouldReduceMotion&&lu.has(h)?{type:!1}:v,n,_));const y=d.animation;y&&c.push(y)}return a&&Promise.all(c).then(()=>{Bn.update(()=>{a&&AZ(n,a)})}),c}function LR(n,e,t={}){var i;const r=yA(n,e,t.type==="exit"?(i=n.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=n.getDefaultTransition()||{}}=r||{};t.transitionOverride&&(s=t.transitionOverride);const o=r?()=>Promise.all(hV(n,r,t)):()=>Promise.resolve(),a=n.variantChildren&&n.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:d}=s;return bZ(n,e,u+c,h,d,t)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(t.delay)])}function bZ(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(n.variantChildren).sort(CZ).forEach((c,u)=>{c.notify("AnimationStart",e),o.push(LR(c,e,{...s,delay:t+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function CZ(n,e){return n.sortNodePosition(e)}function RZ(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>LR(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=LR(n,e,t);else{const r=typeof e=="function"?yA(n,e,t.custom):e;i=Promise.all(hV(n,r,t))}return i.then(()=>{n.notify("AnimationComplete",e)})}const PZ=W2.length;function dV(n){if(!n)return;if(!n.isControllingVariants){const t=n.parent?dV(n.parent)||{}:{};return n.props.initial!==void 0&&(t.initial=n.props.initial),t}const e={};for(let t=0;tPromise.all(e.map(({animation:t,options:i})=>RZ(n,t,i)))}function BZ(n){let e=DZ(n),t=WN(),i=!0;const r=l=>(c,u)=>{var h;const d=yA(n,u,l==="exit"?(h=n.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(d){const{transition:f,transitionEnd:v,..._}=d;c={...c,..._,...v}}return c};function s(l){e=l(n)}function o(l){const{props:c}=n,u=dV(n.parent)||{},h=[],d=new Set;let f={},v=1/0;for(let y=0;yv&&M,b=!1;const w=Array.isArray(x)?x:[x];let N=w.reduce(r(m),{});R===!1&&(N={});const{prevResolvedValues:G={}}=S,V={...G,...N},$=re=>{I=!0,d.has(re)&&(b=!0,d.delete(re)),S.needsAnimating[re]=!0;const O=n.getValue(re);O&&(O.liveStyle=!1)};for(const re in V){const O=N[re],Q=G[re];if(f.hasOwnProperty(re))continue;let te=!1;MR(O)&&MR(Q)?te=!EH(O,Q):te=O!==Q,te?O!=null?$(re):d.add(re):O!==void 0&&d.has(re)?$(re):S.protectedKeys[re]=!0}S.prevProp=x,S.prevResolvedValues=N,S.isActive&&(f={...f,...N}),i&&n.blockInitialAnimation&&(I=!1),I&&(!(T&&P)||b)&&h.push(...w.map(re=>({animation:re,options:{type:m}})))}if(d.size){const y={};d.forEach(m=>{const S=n.getBaseTarget(m),x=n.getValue(m);x&&(x.liveStyle=!0),y[m]=S??null}),h.push({animation:y})}let _=!!h.length;return i&&(c.initial===!1||c.initial===c.animate)&&!n.manuallyAnimateOnMount&&(_=!1),i=!1,_?e(h):Promise.resolve()}function a(l,c){var u;if(t[l].isActive===c)return Promise.resolve();(u=n.variantChildren)===null||u===void 0||u.forEach(d=>{var f;return(f=d.animationState)===null||f===void 0?void 0:f.setActive(l,c)}),t[l].isActive=c;const h=o(l);for(const d in t)t[d].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t,reset:()=>{t=WN(),i=!0}}}function NZ(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!EH(e,n):!1}function Du(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function WN(){return{animate:Du(!0),whileInView:Du(),whileHover:Du(),whileTap:Du(),whileDrag:Du(),whileFocus:Du(),exit:Du()}}class cu{constructor(e){this.isMounted=!1,this.node=e}update(){}}class UZ extends cu{constructor(e){super(e),e.animationState||(e.animationState=BZ(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Uv(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let FZ=0;class OZ extends cu{constructor(){super(...arguments),this.id=FZ++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const kZ={animation:{Feature:UZ},exit:{Feature:OZ}},fV=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function SA(n,e="page"){return{point:{x:n[`${e}X`],y:n[`${e}Y`]}}}const zZ=n=>e=>fV(e)&&n(e,SA(e));function yl(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}function Tl(n,e,t,i){return yl(n,e,zZ(t),i)}const $N=(n,e)=>Math.abs(n-e);function GZ(n,e){const t=$N(n.x,e.x),i=$N(n.y,e.y);return Math.sqrt(t**2+i**2)}class pV{constructor(e,t,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=AT(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=GZ(h.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:v}=h,{timestamp:_}=nr;this.history.push({...v,timestamp:_});const{onStart:y,onMove:m}=this.handlers;d||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,h)},this.handlePointerMove=(h,d)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=MT(d,this.transformPagePoint),Bn.update(this.updatePoint,!0)},this.handlePointerUp=(h,d)=>{this.end();const{onEnd:f,onSessionEnd:v,resumeAnimation:_}=this.handlers;if(this.dragSnapToOrigin&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=AT(h.type==="pointercancel"?this.lastMoveEventInfo:MT(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(h,y),v&&v(h,y)},!fV(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const o=SA(e),a=MT(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=nr;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=t;u&&u(e,AT(a,this.history)),this.removeListeners=El(Tl(this.contextWindow,"pointermove",this.handlePointerMove),Tl(this.contextWindow,"pointerup",this.handlePointerUp),Tl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),$c(this.updatePoint)}}function MT(n,e){return e?{point:e(n.point)}:n}function XN(n,e){return{x:n.x-e.x,y:n.y-e.y}}function AT({point:n},e){return{point:n,delta:XN(n,mV(e)),offset:XN(n,HZ(e)),velocity:VZ(e,.1)}}function HZ(n){return n[0]}function mV(n){return n[n.length-1]}function VZ(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=mV(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>Al(e)));)t--;if(!i)return{x:0,y:0};const s=wl(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function gV(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const jN=gV("dragHorizontal"),YN=gV("dragVertical");function vV(n){let e=!1;if(n==="y")e=YN();else if(n==="x")e=jN();else{const t=jN(),i=YN();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function yV(){const n=vV(!0);return n?(n(),!1):!0}function Kf(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}const _V=1e-4,WZ=1-_V,$Z=1+_V,xV=.01,XZ=0-xV,jZ=0+xV;function zs(n){return n.max-n.min}function YZ(n,e,t){return Math.abs(n-e)<=t}function JN(n,e,t,i=.5){n.origin=i,n.originPoint=ti(e.min,e.max,n.origin),n.scale=zs(t)/zs(e),n.translate=ti(t.min,t.max,n.origin)-n.originPoint,(n.scale>=WZ&&n.scale<=$Z||isNaN(n.scale))&&(n.scale=1),(n.translate>=XZ&&n.translate<=jZ||isNaN(n.translate))&&(n.translate=0)}function Zg(n,e,t,i){JN(n.x,e.x,t.x,i?i.originX:void 0),JN(n.y,e.y,t.y,i?i.originY:void 0)}function KN(n,e,t){n.min=t.min+e.min,n.max=n.min+zs(e)}function JZ(n,e,t){KN(n.x,e.x,t.x),KN(n.y,e.y,t.y)}function qN(n,e,t){n.min=e.min-t.min,n.max=n.min+zs(e)}function Qg(n,e,t){qN(n.x,e.x,t.x),qN(n.y,e.y,t.y)}function KZ(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?ti(t,n,i.max):Math.min(n,t)),n}function ZN(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function qZ(n,{top:e,left:t,bottom:i,right:r}){return{x:ZN(n.x,t,r),y:ZN(n.y,e,i)}}function QN(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=Bp(e.min,e.max-i,n.min):i>r&&(t=Bp(n.min,n.max-r,e.min)),Xc(0,1,t)}function eQ(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const DR=.35;function tQ(n=DR){return n===!1?n=0:n===!0&&(n=DR),{x:eU(n,"left","right"),y:eU(n,"top","bottom")}}function eU(n,e,t){return{min:tU(n,e),max:tU(n,t)}}function tU(n,e){return typeof n=="number"?n:n[e]||0}const nU=()=>({translate:0,scale:1,origin:0,originPoint:0}),qf=()=>({x:nU(),y:nU()}),iU=()=>({min:0,max:0}),Si=()=>({x:iU(),y:iU()});function oo(n){return[n("x"),n("y")]}function SV({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function nQ({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function iQ(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function wT(n){return n===void 0||n===1}function BR({scale:n,scaleX:e,scaleY:t}){return!wT(n)||!wT(e)||!wT(t)}function lh(n){return BR(n)||MV(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function MV(n){return rU(n.x)||rU(n.y)}function rU(n){return n&&n!=="0%"}function PS(n,e,t){const i=n-t,r=e*i;return t+r}function sU(n,e,t,i,r){return r!==void 0&&(n=PS(n,r,i)),PS(n,t,i)+e}function NR(n,e=0,t=1,i,r){n.min=sU(n.min,e,t,i,r),n.max=sU(n.max,e,t,i,r)}function AV(n,{x:e,y:t}){NR(n.x,e.translate,e.scale,e.originPoint),NR(n.y,t.translate,t.scale,t.originPoint)}const oU=.999999999999,aU=1.0000000000001;function rQ(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;aoU&&(e.x=1),e.yoU&&(e.y=1)}function Zf(n,e){n.min=n.min+e,n.max=n.max+e}function lU(n,e,t,i,r=.5){const s=ti(n.min,n.max,r);NR(n,e,t,s,i)}function Qf(n,e){lU(n.x,e.x,e.scaleX,e.scale,e.originX),lU(n.y,e.y,e.scaleY,e.scale,e.originY)}function wV(n,e){return SV(iQ(n.getBoundingClientRect(),e))}function sQ(n,e,t){const i=wV(n,t),{scroll:r}=e;return r&&(Zf(i.x,r.offset.x),Zf(i.y,r.offset.y)),i}const EV=({current:n})=>n?n.ownerDocument.defaultView:null,oQ=new WeakMap;class aQ{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Si(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=u=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(SA(u,"page").point)},s=(u,h)=>{const{drag:d,dragPropagation:f,onDragStart:v}=this.getProps();if(d&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=vV(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),oo(y=>{let m=this.getAxisMotionValue(y).get()||0;if(Ra.test(m)){const{projection:S}=this.visualElement;if(S&&S.layout){const x=S.layout.layoutBox[y];x&&(m=zs(x)*(parseFloat(m)/100))}}this.originPoint[y]=m}),v&&Bn.postRender(()=>v(u,h)),IR(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},o=(u,h)=>{const{dragPropagation:d,dragDirectionLock:f,onDirectionLock:v,onDrag:_}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:y}=h;if(f&&this.currentDirection===null){this.currentDirection=lQ(y),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),_&&_(u,h)},a=(u,h)=>this.stop(u,h),l=()=>oo(u=>{var h;return this.getAnimationState(u)==="paused"&&((h=this.getAxisMotionValue(u).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new pV(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:EV(this.visualElement)})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:s}=this.getProps();s&&Bn.postRender(()=>s(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!D_(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=KZ(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;t&&Kf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=qZ(r.layoutBox,t):this.constraints=!1,this.elastic=tQ(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&oo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=eQ(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Kf(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=sQ(i,r.root,this.visualElement.getTransformPagePoint());let o=ZZ(r.layout.layoutBox,s);if(t){const a=t(nQ(o));this.hasMutatedConstraints=!!a,a&&(o=SV(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=oo(u=>{if(!D_(u,t,this.currentDirection))return;let h=l&&l[u]||{};o&&(h={min:0,max:0});const d=r?200:1e6,f=r?40:1e7,v={type:"inertia",velocity:i?e[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(u,v)});return Promise.all(c).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return IR(this.visualElement,e),i.start(sI(e,i,0,t,this.visualElement,!1))}stopAnimation(){oo(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){oo(e=>{var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){oo(t=>{const{drag:i}=this.getProps();if(!D_(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-ti(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!Kf(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};oo(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();r[o]=QZ({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),oo(o=>{if(!D_(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ti(l,c,r[o]))})}addListeners(){if(!this.visualElement.current)return;oQ.set(this.visualElement,this);const e=this.visualElement.current,t=Tl(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Kf(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Bn.read(i);const o=yl(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(oo(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=DR,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function D_(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function lQ(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class cQ extends cu{constructor(e){super(e),this.removeGroupControls=Tr,this.removeListeners=Tr,this.controls=new aQ(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Tr}unmount(){this.removeGroupControls(),this.removeListeners()}}const cU=n=>(e,t)=>{n&&Bn.postRender(()=>n(e,t))};class uQ extends cu{constructor(){super(...arguments),this.removePointerDownListener=Tr}onPointerDown(e){this.session=new pV(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:EV(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:cU(e),onStart:cU(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Bn.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=Tl(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const cI=se.createContext(null);function hQ(){const n=se.useContext(cI);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=se.useId();se.useEffect(()=>i(r),[]);const s=se.useCallback(()=>t&&t(r),[r,t]);return!e&&t?[!1,s]:[!0]}const TV=se.createContext({}),bV=se.createContext({}),G1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uU(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const Jm={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Lt.test(n))n=parseFloat(n);else return n;const t=uU(n,e.target.x),i=uU(n,e.target.y);return`${t}% ${i}%`}},dQ={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=jc.parse(n);if(r.length>5)return i;const s=jc.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const c=ti(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=c),typeof r[3+o]=="number"&&(r[3+o]/=c),s(r)}},IS={};function fQ(n){Object.assign(IS,n)}const{schedule:uI,cancel:AAe}=TH(queueMicrotask,!1);class pQ extends se.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;fQ(mQ),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),G1.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Bn.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),uI.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function CV(n){const[e,t]=hQ(),i=se.useContext(TV);return pe.jsx(pQ,{...n,layoutGroup:i,switchLayoutGroup:se.useContext(bV),isPresent:e,safeToRemove:t})}const mQ={borderRadius:{...Jm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Jm,borderTopRightRadius:Jm,borderBottomLeftRadius:Jm,borderBottomRightRadius:Jm,boxShadow:dQ},RV=["TopLeft","TopRight","BottomLeft","BottomRight"],gQ=RV.length,hU=n=>typeof n=="string"?parseFloat(n):n,dU=n=>typeof n=="number"||Lt.test(n);function vQ(n,e,t,i,r,s){r?(n.opacity=ti(0,t.opacity!==void 0?t.opacity:1,yQ(i)),n.opacityExit=ti(e.opacity!==void 0?e.opacity:1,0,_Q(i))):s&&(n.opacity=ti(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;oie?1:t(Bp(n,e,i))}function pU(n,e){n.min=e.min,n.max=e.max}function no(n,e){pU(n.x,e.x),pU(n.y,e.y)}function mU(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}function gU(n,e,t,i,r){return n-=e,n=PS(n,1/t,i),r!==void 0&&(n=PS(n,1/r,i)),n}function xQ(n,e=0,t=1,i=.5,r,s=n,o=n){if(Ra.test(e)&&(e=parseFloat(e),e=ti(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=ti(s.min,s.max,i);n===s&&(a-=e),n.min=gU(n.min,e,t,a,r),n.max=gU(n.max,e,t,a,r)}function vU(n,e,[t,i,r],s,o){xQ(n,e[t],e[i],e[r],e.scale,s,o)}const SQ=["x","scaleX","originX"],MQ=["y","scaleY","originY"];function yU(n,e,t,i){vU(n.x,e,SQ,t?t.x:void 0,i?i.x:void 0),vU(n.y,e,MQ,t?t.y:void 0,i?i.y:void 0)}function _U(n){return n.translate===0&&n.scale===1}function IV(n){return _U(n.x)&&_U(n.y)}function xU(n,e){return n.min===e.min&&n.max===e.max}function AQ(n,e){return xU(n.x,e.x)&&xU(n.y,e.y)}function SU(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function LV(n,e){return SU(n.x,e.x)&&SU(n.y,e.y)}function MU(n){return zs(n.x)/zs(n.y)}function AU(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}class wQ{constructor(){this.members=[]}add(e){oI(this.members,e),e.scheduleRender()}remove(e){if(aI(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function EQ(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y,o=(t==null?void 0:t.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:d,skewX:f,skewY:v}=t;c&&(i=`perspective(${c}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),d&&(i+=`rotateY(${d}deg) `),f&&(i+=`skewX(${f}deg) `),v&&(i+=`skewY(${v}deg) `)}const a=n.x.scale*e.x,l=n.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const TQ=(n,e)=>n.depth-e.depth;class bQ{constructor(){this.children=[],this.isDirty=!1}add(e){oI(this.children,e),this.isDirty=!0}remove(e){aI(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(TQ),this.isDirty=!1,this.children.forEach(e)}}function H1(n){const e=Mr(n)?n.get():n;return yZ(e)?e.toValue():e}function CQ(n,e){const t=Pa.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&($c(i),n(s-e))};return Bn.read(i,!0),()=>$c(i)}function RQ(n){return n instanceof SVGElement&&n.tagName!=="svg"}function PQ(n,e,t){const i=Mr(n)?n:zv(n);return i.start(sI("",i,e,t)),i.animation}const ch={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ng=typeof window<"u"&&window.MotionDebug!==void 0,ET=["","X","Y","Z"],IQ={visibility:"hidden"},wU=1e3;let LQ=0;function TT(n,e,t,i){const{latestValues:r}=e;r[n]&&(t[n]=r[n],e.setStaticValue(n,0),i&&(i[n]=0))}function DV(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=cV(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:s}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",Bn,!(r||s))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&DV(i)}function BV({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=LQ++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ng&&(ch.totalNodes=ch.resolvedTargetDeltas=ch.recalculatedProjection=0),this.nodes.forEach(NQ),this.nodes.forEach(zQ),this.nodes.forEach(GQ),this.nodes.forEach(UQ),Ng&&window.MotionDebug.record(ch)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=CQ(d,250),G1.hasAnimatedSinceResize&&(G1.hasAnimatedSinceResize=!1,this.nodes.forEach(TU))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeTargetChanged:f,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||u.getDefaultTransition()||XQ,{onLayoutAnimationStart:y,onLayoutAnimationComplete:m}=u.getProps(),S=!this.targetLayout||!LV(this.targetLayout,v)||f,x=!d&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||d&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,x);const M={...$2(_,"layout"),onPlay:y,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else d||TU(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$c(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(HQ),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&DV(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const R=M/1e3;bU(h.x,o.x,R),bU(h.y,o.y,R),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qg(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),WQ(this.relativeTarget,this.relativeTargetOrigin,d,R),x&&AQ(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Si()),no(x,this.relativeTarget)),_&&(this.animationValues=u,vQ(u,c,this.latestValues,R,S,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&($c(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Bn.update(()=>{G1.hasAnimatedSinceResize=!0,this.currentAnimation=PQ(0,wU,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(wU),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&NV(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Si();const h=zs(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=zs(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}no(a,l),Qf(a,u),Zg(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new wQ),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&TT("z",o,c,this.animationValues);for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(EU),this.root.sharedNodes.clear()}}}function DQ(n){n.updateLayout()}function BQ(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?oo(h=>{const d=o?t.measuredBox[h]:t.layoutBox[h],f=zs(d);d.min=i[h].min,d.max=d.min+f}):NV(s,t.layoutBox,i)&&oo(h=>{const d=o?t.measuredBox[h]:t.layoutBox[h],f=zs(i[h]);d.max=d.min+f,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[h].max=n.relativeTarget[h].min+f)});const a=qf();Zg(a,i,t.layoutBox);const l=qf();o?Zg(l,n.applyTransform(r,!0),t.measuredBox):Zg(l,i,t.layoutBox);const c=!IV(a);let u=!1;if(!n.resumeFrom){const h=n.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const v=Si();Qg(v,t.layoutBox,d.layoutBox);const _=Si();Qg(_,i,f.layoutBox),LV(v,_)||(u=!0),h.options.layoutRoot&&(n.relativeTarget=_,n.relativeTargetOrigin=v,n.relativeParent=h)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function NQ(n){Ng&&ch.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function UQ(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function FQ(n){n.clearSnapshot()}function EU(n){n.clearMeasurements()}function OQ(n){n.isLayoutDirty=!1}function kQ(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function TU(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function zQ(n){n.resolveTargetDelta()}function GQ(n){n.calcProjection()}function HQ(n){n.resetSkewAndRotation()}function VQ(n){n.removeLeadSnapshot()}function bU(n,e,t){n.translate=ti(e.translate,0,t),n.scale=ti(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function CU(n,e,t,i){n.min=ti(e.min,t.min,i),n.max=ti(e.max,t.max,i)}function WQ(n,e,t,i){CU(n.x,e.x,t.x,i),CU(n.y,e.y,t.y,i)}function $Q(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const XQ={duration:.45,ease:[.4,0,.1,1]},RU=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),PU=RU("applewebkit/")&&!RU("chrome/")?Math.round:Tr;function IU(n){n.min=PU(n.min),n.max=PU(n.max)}function jQ(n){IU(n.x),IU(n.y)}function NV(n,e,t){return n==="position"||n==="preserve-aspect"&&!YZ(MU(e),MU(t),.2)}function YQ(n){var e;return n!==n.root&&((e=n.scroll)===null||e===void 0?void 0:e.wasRoot)}const JQ=BV({attachResizeListener:(n,e)=>yl(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),bT={current:void 0},UV=BV({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!bT.current){const n=new JQ({});n.mount(window),n.setOptions({layoutScroll:!0}),bT.current=n}return bT.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),KQ={pan:{Feature:uQ},drag:{Feature:cQ,ProjectionNode:UV,MeasureLayout:CV}};function LU(n,e){const t=e?"pointerenter":"pointerleave",i=e?"onHoverStart":"onHoverEnd",r=(s,o)=>{if(s.pointerType==="touch"||yV())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e);const l=a[i];l&&Bn.postRender(()=>l(s,o))};return Tl(n.current,t,r,{passive:!n.getProps()[i]})}class qQ extends cu{mount(){this.unmount=El(LU(this.node,!0),LU(this.node,!1))}unmount(){}}class ZQ extends cu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=El(yl(this.node.current,"focus",()=>this.onFocus()),yl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const FV=(n,e)=>e?n===e?!0:FV(n,e.parentElement):!1;function CT(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,SA(t))}class QQ extends cu{constructor(){super(...arguments),this.removeStartListeners=Tr,this.removeEndListeners=Tr,this.removeAccessibleListeners=Tr,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),s=Tl(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:h}=this.node.getProps(),d=!h&&!FV(this.node.current,a.target)?u:c;d&&Bn.update(()=>d(a,l))},{passive:!(i.onTap||i.onPointerUp)}),o=Tl(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=El(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||CT("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&Bn.postRender(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=yl(this.node.current,"keyup",o),CT("down",(a,l)=>{this.startPress(a,l)})},t=yl(this.node.current,"keydown",e),i=()=>{this.isPressing&&CT("cancel",(s,o)=>this.cancelPress(s,o))},r=yl(this.node.current,"blur",i);this.removeAccessibleListeners=El(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&Bn.postRender(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!yV()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&Bn.postRender(()=>i(e,t))}mount(){const e=this.node.getProps(),t=Tl(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=yl(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=El(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const UR=new WeakMap,RT=new WeakMap,eee=n=>{const e=UR.get(n.target);e&&e(n)},tee=n=>{n.forEach(eee)};function nee({root:n,...e}){const t=n||document;RT.has(t)||RT.set(t,{});const i=RT.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(tee,{root:n,...e})),i[r]}function iee(n,e,t){const i=nee(e);return UR.set(n,t),i.observe(n),()=>{UR.delete(n),i.unobserve(n)}}const ree={some:0,all:1};class see extends cu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:ree[r]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),d=c?u:h;d&&d(l)};return iee(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(oee(e,t))&&this.startObserver()}unmount(){}}function oee({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const aee={inView:{Feature:see},tap:{Feature:QQ},focus:{Feature:ZQ},hover:{Feature:qQ}},lee={layout:{ProjectionNode:UV,MeasureLayout:CV}},OV=se.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),MA=se.createContext({}),hI=typeof window<"u",cee=hI?se.useLayoutEffect:se.useEffect,kV=se.createContext({strict:!1});function uee(n,e,t,i,r){var s,o;const{visualElement:a}=se.useContext(MA),l=se.useContext(kV),c=se.useContext(cI),u=se.useContext(OV).reducedMotion,h=se.useRef();i=i||l.renderer,!h.current&&i&&(h.current=i(n,{visualState:e,parent:a,props:t,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const d=h.current,f=se.useContext(bV);d&&!d.projection&&r&&(d.type==="html"||d.type==="svg")&&hee(h.current,t,r,f),se.useInsertionEffect(()=>{d&&d.update(t,c)});const v=t[lV],_=se.useRef(!!v&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,v))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,v)));return cee(()=>{d&&(window.MotionIsMounted=!0,d.updateFeatures(),uI.render(d.render),_.current&&d.animationState&&d.animationState.animateChanges())}),se.useEffect(()=>{d&&(!_.current&&d.animationState&&d.animationState.animateChanges(),_.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,v)}),_.current=!1))}),d}function hee(n,e,t,i){const{layoutId:r,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:zV(n.parent)),n.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||a&&Kf(a),visualElement:n,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:c})}function zV(n){if(n)return n.options.allowProjection!==!1?n.projection:zV(n.parent)}function dee(n,e,t){return se.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):Kf(t)&&(t.current=i))},[e])}function AA(n){return Uv(n.animate)||W2.some(e=>Fv(n[e]))}function GV(n){return!!(AA(n)||n.variants)}function fee(n,e){if(AA(n)){const{initial:t,animate:i}=n;return{initial:t===!1||Fv(t)?t:void 0,animate:Fv(i)?i:void 0}}return n.inherit!==!1?e:{}}function pee(n){const{initial:e,animate:t}=fee(n,se.useContext(MA));return se.useMemo(()=>({initial:e,animate:t}),[DU(e),DU(t)])}function DU(n){return Array.isArray(n)?n.join(" "):n}const BU={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Np={};for(const n in BU)Np[n]={isEnabled:e=>BU[n].some(t=>!!e[t])};function mee(n){for(const e in n)Np[e]={...Np[e],...n[e]}}const gee=Symbol.for("motionComponentSymbol");function vee({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&mee(n);function s(a,l){let c;const u={...se.useContext(OV),...a,layoutId:yee(a)},{isStatic:h}=u,d=pee(a),f=i(a,h);if(!h&&hI){_ee();const v=xee(u);c=v.MeasureLayout,d.visualElement=uee(r,f,u,e,v.ProjectionNode)}return pe.jsxs(MA.Provider,{value:d,children:[c&&d.visualElement?pe.jsx(c,{visualElement:d.visualElement,...u}):null,t(r,a,dee(f,d.visualElement,l),f,h,d.visualElement)]})}const o=se.forwardRef(s);return o[gee]=r,o}function yee({layoutId:n}){const e=se.useContext(TV).id;return e&&n!==void 0?e+"-"+n:n}function _ee(n,e){se.useContext(kV).strict}function xee(n){const{drag:e,layout:t}=Np;if(!e&&!t)return{};const i={...e,...t};return{MeasureLayout:e!=null&&e.isEnabled(n)||t!=null&&t.isEnabled(n)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const See=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function dI(n){return typeof n!="string"||n.includes("-")?!1:!!(See.indexOf(n)>-1||/[A-Z]/u.test(n))}function HV(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const VV=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function WV(n,e,t,i){HV(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(VV.has(r)?r:xA(r),e.attrs[r])}function $V(n,{layout:e,layoutId:t}){return lu.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!IS[n]||n==="opacity")}function fI(n,e,t){var i;const{style:r}=n,s={};for(const o in r)(Mr(r[o])||e.style&&Mr(e.style[o])||$V(o,n)||((i=t==null?void 0:t.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return t&&r&&typeof r.willChange=="string"&&(t.applyWillChange=!1),s}function XV(n,e,t){const i=fI(n,e,t);for(const r in n)if(Mr(n[r])||Mr(e[r])){const s=$0.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=n[r]}return i}function Mee(n){const e=se.useRef(null);return e.current===null&&(e.current=n()),e.current}function Aee({applyWillChange:n=!1,scrapeMotionValuesFromProps:e,createRenderState:t,onMount:i},r,s,o,a){const l={latestValues:wee(r,s,o,a?!1:n,e),renderState:t()};return i&&(l.mount=c=>i(r,c,l)),l}const jV=n=>(e,t)=>{const i=se.useContext(MA),r=se.useContext(cI),s=()=>Aee(n,e,i,r,t);return t?s():Mee(s)};function NU(n,e,t){const i=Array.isArray(e)?e:[e];for(let r=0;r{for(const m in _){let S=_[m];if(Array.isArray(S)){const x=f?S.length-1:0;S=S[x]}S!==null&&(o[m]=S)}for(const m in y)o[m]=y[m]}),a&&u&&c!==!1&&!Uv(u)&&NU(n,u,_=>{for(const y in _)if(uV(y)){o.willChange="transform";return}}),o}const pI=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),YV=()=>({...pI(),attrs:{}}),JV=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Eee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Tee=$0.length;function bee(n,e,t){let i="",r=!0;for(let s=0;stypeof n=="string"&&n.toLowerCase()==="svg",Lee={useVisualState:jV({scrapeMotionValuesFromProps:XV,createRenderState:YV,onMount:(n,e,{renderState:t,latestValues:i})=>{Bn.read(()=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}),Bn.render(()=>{gI(t,i,vI(e.tagName),n.transformTemplate),WV(e,t)})}})},Dee={useVisualState:jV({applyWillChange:!0,scrapeMotionValuesFromProps:fI,createRenderState:pI})};function KV(n,e,t){for(const i in e)!Mr(e[i])&&!$V(i,t)&&(n[i]=e[i])}function Bee({transformTemplate:n},e){return se.useMemo(()=>{const t=pI();return mI(t,e,n),Object.assign({},t.vars,t.style)},[e])}function Nee(n,e){const t=n.style||{},i={};return KV(i,t,n),Object.assign(i,Bee(n,e)),i}function Uee(n,e){const t={},i=Nee(n,e);return n.drag&&n.dragListener!==!1&&(t.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(t.tabIndex=0),t.style=i,t}const Fee=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function LS(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Fee.has(n)}let qV=n=>!LS(n);function Oee(n){n&&(qV=e=>e.startsWith("on")?!LS(e):n(e))}try{Oee(require("@emotion/is-prop-valid").default)}catch{}function kee(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(qV(r)||t===!0&&LS(r)||!e&&!LS(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function zee(n,e,t,i){const r=se.useMemo(()=>{const s=YV();return gI(s,e,vI(i),n.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(n.style){const s={};KV(s,n.style,n),r.style={...s,...r.style}}return r}function Gee(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(dI(t)?zee:Uee)(i,s,o,t),c=kee(i,typeof t=="string",n),u=t!==se.Fragment?{...c,...l,ref:r}:{},{children:h}=i,d=se.useMemo(()=>Mr(h)?h.get():h,[h]);return se.createElement(t,{...u,children:d})}}function Hee(n,e){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const o={...dI(i)?Lee:Dee,preloadedFeatures:n,useRender:Gee(r),createVisualElement:e,Component:i};return vee(o)}}const FR={current:null},ZV={current:!1};function Vee(){if(ZV.current=!0,!!hI)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>FR.current=n.matches;n.addListener(e),e()}else FR.current=!1}function Wee(n,e,t){for(const i in e){const r=e[i],s=t[i];if(Mr(r))n.addValue(i,r);else if(Mr(s))n.addValue(i,zv(r,{owner:n}));else if(s!==r)if(n.hasValue(i)){const o=n.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=n.getStaticValue(i);n.addValue(i,zv(o!==void 0?o:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const FU=new WeakMap,$ee=[...GH,_r,jc],Xee=n=>$ee.find(zH(n)),OU=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class jee{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=J2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=Pa.now();this.renderScheduledAtthis.bindToMotionValue(i,t)),ZV.current||Vee(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:FR.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){FU.delete(this.current),this.projection&&this.projection.unmount(),$c(this.notifyUpdate),$c(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=lu.has(e),r=t.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Bn.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),s(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Np){const t=Np[e];if(!t)continue;const{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Si()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;it.variantChildren.delete(e)}addValue(e,t){const i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=zv(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){var i;let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(i=this.getBaseTargetFromProps(this.props,e))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(UH(r)||NH(r))?r=parseFloat(r):!Xee(r)&&jc.test(t)&&(r=JH(e,t)),this.setBaseTarget(e,Mr(r)?r.get():r)),Mr(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=H2(this.props,i,(t=this.presenceContext)===null||t===void 0?void 0:t.custom);o&&(r=o[e])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Mr(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new lI),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class QV extends jee{constructor(){super(...arguments),this.KeyframeResolver=KH}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}}function Yee(n){return window.getComputedStyle(n)}class Jee extends QV{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=HV}readValueFromInstance(e,t){if(lu.has(t)){const i=Q2(t);return i&&i.default||0}else{const i=Yee(e),r=(OH(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return wV(e,t)}build(e,t,i){mI(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return fI(e,t,i)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Mr(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Kee extends QV{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Si}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(lu.has(t)){const i=Q2(t);return i&&i.default||0}return t=VV.has(t)?t:xA(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return XV(e,t,i)}build(e,t,i){gI(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,r){WV(e,t,i,r)}mount(e){this.isSVGTag=vI(e.tagName),super.mount(e)}}const qee=(n,e)=>dI(n)?new Kee(e):new Jee(e,{allowProjection:n!==se.Fragment}),Zee=Hee({...kZ,...aee,...KQ,...lee},qee),vo=IK(Zee),wA=n=>({hidden:{y:-50,opacity:0},show:{y:0,opacity:1,transition:{type:"spring",duration:1.25,delay:n??0}}}),yI=({direction:n,type:e,delay:t,duration:i})=>({hidden:{x:n==="left"?100:n==="right"?-100:0,y:n==="up"?"100%":n==="down"?"-100%":0,opacity:0},show:{x:0,y:0,opacity:1,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),Qee=({delay:n,duration:e})=>({hidden:{scale:0,opacity:0},show:{scale:1,opacity:1,transition:{type:"tween",delay:n,duration:e,ease:"easeOut"}}}),OR=({direction:n,type:e,delay:t,duration:i})=>({hidden:{x:n==="left"?"-100%":n==="right"?"100%":0,y:n==="up"?"100%":n==="down"?"-100%":0},show:{x:0,y:0,transition:{type:e,delay:t,duration:i,ease:"easeOut"}}}),ete=""+new URL("logo-DJlf-uNS.png",import.meta.url).href,tte=()=>{const[n,e]=se.useState(!1),t=()=>e(!n),[i,r]=se.useState(!1),s=()=>{window.scrollY!=0?r(!0):r(!1)};return se.useEffect(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),pe.jsxs("div",{className:Go("flex justify-between px-8 py-6 sticky top-0 transition-all duration-300 z-50",i&&"nav-start-scrolling"),children:[pe.jsx("div",{className:"text-callToAction self-center relative w-[100px] h-[20px]",children:pe.jsx("img",{src:ete,alt:"logo",className:"w-[100px] absolute top-[-23px] right-0"})}),pe.jsxs("div",{className:"flex items-center gap-8 max",children:[wN.map((o,a)=>pe.jsxs(vo.a,{initial:"hidden",whileInView:"show",variants:yI({direction:"down",type:"spring",delay:(a-1)*.2,duration:.6}),href:o.path,className:"text-primaryLight tracking-wider hidden md:block hover:text-callToAction transition-all duration-300",children:[pe.jsxs("p",{className:"inline text-callToAction mr-2",children:[("0"+a.toString()).slice(-2),"."]}),o.label]},a)),pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:Qee({delay:0,duration:1}),children:pe.jsx("div",{className:"hidden md:block",children:pe.jsx(SR,{size:"medium",children:pe.jsx("a",{href:"https://niv-shtibel.me/NivShtibelCV.pdf",children:"Resume"})})})}),pe.jsxs("div",{className:Go("flex flex-col gap-[7px] md:hidden z-50",n&&"hamburger-active fixed right-8"),dir:"rtl",role:"button",onClick:t,tabIndex:0,onKeyDown:t,children:[pe.jsx("div",{className:"bg-callToAction w-[44px] h-[2px] rounded-md transition-all"}),pe.jsx("div",{className:"bg-callToAction w-[36px] h-[2px] rounded-md transition-all"}),pe.jsx("div",{className:"bg-callToAction w-[27px] h-[2px] rounded-md transition-all"})]})]}),pe.jsxs("div",{className:Go("hidden transition-all duration-500 w-0 items-center gap-10 justify-center md:hidden",n&&"sidebar-active"),children:[wN.map((o,a)=>pe.jsxs("a",{href:o.path,className:"text-primaryLight text-xl hover:text-callToAction transition-all duration-300 flex flex-col",children:[pe.jsxs("p",{className:" text-callToAction self-center",children:[("0"+a.toString()).slice(-2),"."]}),o.label]},a)),pe.jsx(SR,{size:"large",children:pe.jsx("a",{href:"https://niv-shtibel.me/NivShtibelCV.pdf",children:"Resume"})})]})]})},nte=""+new URL("2-2H0btqWY.png",import.meta.url).href,ite=()=>pe.jsxs("section",{id:"about",className:"mt-44 container mx-auto",children:[pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:wA(null),className:"flex flex-col gap-2 items-center",children:pe.jsx("h1",{className:"text-secondary text-4xl sm:text-7xl inline font-bold",children:"About Me."})}),pe.jsxs("div",{className:"flex flex-col items-center md:justify-center md:flex-row gap-24 mt-10 overflow-hidden",children:[pe.jsxs(vo.div,{initial:"hidden",whileInView:"show",variants:yI({direction:"left",type:"spring",delay:0,duration:.5}),className:"mx-3 md:w-[40%]",children:[pe.jsx("p",{className:"text-primary break-words text-lg md:text-2xl",children:"I am an autodidact, and I believe that staying current with the latest technologies is essential to success in this field. In my free time, I enjoy engaging in online gaming, traveling, and spending time with loved ones. I bring a unique perspective and a drive for innovation to every project, and I am always eager to learn and grow as a developer."}),pe.jsxs("p",{className:"text-primary break-words text-lg md:text-2xl pt-4",children:["My main focus these days is building accessible, inclusive shopify applications and web services at"," ",pe.jsx("a",{href:"https://oversight.co.il/",target:"_blank",rel:"noreferrer",className:"text-callToAction inline-block underline-link",children:"oversight"})," ","."]})]}),pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:OR({direction:"right",type:"spring",delay:0,duration:.5}),className:"mb-4",children:pe.jsx("div",{className:"w-[200px] md:w-[300px]",children:pe.jsx("img",{src:nte,alt:"as"})})})]})]});/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */const uu="168",uh={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},hh={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},KV=0,zR=1,qV=2,ete=3,ZV=0,bA=1,ev=2,No=3,Yo=0,Fi=1,Sr=2,br=0,kh=1,GR=2,HR=3,VR=4,QV=5,Rc=100,e5=101,t5=102,n5=103,i5=104,r5=200,s5=201,o5=202,a5=203,DS=204,BS=205,l5=206,c5=207,u5=208,h5=209,d5=210,f5=211,p5=212,m5=213,g5=214,v5=0,y5=1,_5=2,Gv=3,x5=4,S5=5,M5=6,A5=7,J0=0,w5=1,E5=2,$o=0,T5=1,b5=2,C5=3,gI=4,R5=5,P5=6,I5=7,WR="attached",L5="detached",CA=300,Ul=301,Yc=302,Hv=303,Vv=304,nm=306,Jc=1e3,Is=1001,Np=1002,ri=1003,RA=1004,tte=1004,Ah=1005,nte=1005,Vn=1006,_p=1007,ite=1007,fo=1008,rte=1008,Zi=1009,vI=1010,yI=1011,Up=1012,PA=1013,Na=1014,Yr=1015,yd=1016,IA=1017,LA=1018,Kc=1020,_I=35902,xI=1021,SI=1022,Ar=1023,MI=1024,AI=1025,zh=1026,qc=1027,DA=1028,K0=1029,wI=1030,BA=1031,ste=1032,NA=1033,tv=33776,nv=33777,iv=33778,rv=33779,NS=35840,US=35841,FS=35842,OS=35843,kS=36196,zS=37492,GS=37496,HS=37808,VS=37809,WS=37810,$S=37811,XS=37812,jS=37813,YS=37814,JS=37815,KS=37816,qS=37817,ZS=37818,QS=37819,eM=37820,tM=37821,sv=36492,nM=36494,iM=36495,EI=36283,rM=36284,sM=36285,oM=36286,D5=2200,B5=2201,N5=2202,Fp=2300,Op=2301,W1=2302,wh=2400,Eh=2401,Wv=2402,UA=2500,TI=2501,U5=0,bI=1,aM=2,hu=3200,F5=3201,ote=3202,ate=3203,du=0,O5=1,zo="",Bn="srgb",Zo="srgb-linear",FA="display-p3",q0="display-p3-linear",$v="linear",On="srgb",Xv="rec709",jv="p3",lte=0,dh=7680,cte=7681,ute=7682,hte=7683,dte=34055,fte=34056,pte=5386,mte=512,gte=513,vte=514,yte=515,_te=516,xte=517,Ste=518,$R=519,k5=512,z5=513,G5=514,CI=515,H5=516,V5=517,W5=518,$5=519,Yv=35044,Gh=35048,Mte=35040,Ate=35045,wte=35049,Ete=35041,Tte=35046,bte=35050,Cte=35042,Rte="100",XR="300 es",Aa=2e3,Jv=2001;let vs=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+fr[n>>16&255]+fr[n>>24&255]+"-"+fr[e&255]+fr[e>>8&255]+"-"+fr[e>>16&15|64]+fr[e>>24&255]+"-"+fr[t&63|128]+fr[t>>8&255]+"-"+fr[t>>16&255]+fr[t>>24&255]+fr[i&255]+fr[i>>8&255]+fr[i>>16&255]+fr[i>>24&255]).toLowerCase()}function fi(n,e,t){return Math.max(e,Math.min(t,n))}function RI(n,e){return(n%e+e)%e}function Pte(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function Ite(n,e,t){return n!==e?(t-n)/(e-n):0}function ov(n,e,t){return(1-t)*n+t*e}function Lte(n,e,t,i){return ov(n,e,1-Math.exp(-t*i))}function Dte(n,e=1){return e-Math.abs(RI(n,e*2)-e)}function Bte(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Nte(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Ute(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Fte(n,e){return n+Math.random()*(e-n)}function Ote(n){return n*(.5-Math.random())}function kte(n){n!==void 0&&(UU=n);let e=UU+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function zte(n){return n*Hh}function Gte(n){return n*kp}function Hte(n){return(n&n-1)===0&&n!==0}function Vte(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Wte(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function $te(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),h=s((e-i)/2),d=o((e-i)/2),f=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*h,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*h,a*c);break;case"ZXZ":n.set(l*h,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*v,l*f,a*c);break;case"YXY":n.set(l*f,a*u,l*v,a*c);break;case"ZYZ":n.set(l*v,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function $r(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function $t(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const PI={DEG2RAD:Hh,RAD2DEG:kp,generateUUID:Ns,clamp:fi,euclideanModulo:RI,mapLinear:Pte,inverseLerp:Ite,lerp:ov,damp:Lte,pingpong:Dte,smoothstep:Bte,smootherstep:Nte,randInt:Ute,randFloat:Fte,randFloatSpread:Ote,seededRandom:kte,degToRad:zte,radToDeg:Gte,isPowerOfTwo:Hte,ceilPowerOfTwo:Vte,floorPowerOfTwo:Wte,setQuaternionFromProperEuler:$te,normalize:$t,denormalize:$r};let Fe=class X5{constructor(e=0,t=0){X5.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(fi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Zt=class j5{constructor(e,t,i,r,s,o,a,l,c){j5.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],f=i[5],v=i[8],_=r[0],y=r[3],m=r[6],S=r[1],x=r[4],M=r[7],R=r[2],T=r[5],P=r[8];return s[0]=o*_+a*S+l*R,s[3]=o*y+a*x+l*T,s[6]=o*m+a*M+l*P,s[1]=c*_+u*S+h*R,s[4]=c*y+u*x+h*T,s[7]=c*m+u*M+h*P,s[2]=d*_+f*S+v*R,s[5]=d*y+f*x+v*T,s[8]=d*m+f*M+v*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,v=t*h+i*d+r*f;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/v;return e[0]=h*_,e[1]=(r*c-u*i)*_,e[2]=(a*i-r*o)*_,e[3]=d*_,e[4]=(u*t-r*l)*_,e[5]=(r*s-a*t)*_,e[6]=f*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(LT.makeScale(e,t)),this}rotate(e){return this.premultiply(LT.makeRotation(-e)),this}translate(e,t){return this.premultiply(LT.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};const LT=new Zt;function Y5(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const Xte={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ep(n,e){return new Xte[n](e)}function Kv(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function J5(){const n=Kv("canvas");return n.style.display="block",n}const FU={};function xp(n){n in FU||(FU[n]=!0,console.warn(n))}function jte(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const OU=new Zt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),kU=new Zt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Jm={[Zo]:{transfer:$v,primaries:Xv,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[Bn]:{transfer:On,primaries:Xv,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[q0]:{transfer:$v,primaries:jv,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(kU),fromReference:n=>n.applyMatrix3(OU)},[FA]:{transfer:On,primaries:jv,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(kU),fromReference:n=>n.applyMatrix3(OU).convertLinearToSRGB()}},Yte=new Set([Zo,q0]),Sn={enabled:!0,_workingColorSpace:Zo,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!Yte.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Jm[e].toReference,r=Jm[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Jm[n].primaries},getTransfer:function(n){return n===zo?$v:Jm[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(Jm[e].luminanceCoefficients)}};function Sp(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function DT(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Gd,K5=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Gd===void 0&&(Gd=Kv("canvas")),Gd.width=e.width,Gd.height=e.height;const i=Gd.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Gd}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Kv("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==CA)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Jc:e.x=e.x-Math.floor(e.x);break;case Is:e.x=e.x<0?0:1;break;case Np:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Jc:e.y=e.y-Math.floor(e.y);break;case Is:e.y=e.y<0?0:1;break;case Np:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};Yn.DEFAULT_IMAGE=null;Yn.DEFAULT_MAPPING=CA;Yn.DEFAULT_ANISOTROPY=1;let bn=class q5{constructor(e=0,t=0,i=0,r=1){q5.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],v=l[9],_=l[2],y=l[6],m=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-_)<.01&&Math.abs(v-y)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+_)<.1&&Math.abs(v+y)<.1&&Math.abs(c+f+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,M=(f+1)/2,R=(m+1)/2,T=(u+d)/4,P=(h+_)/4,I=(v+y)/4;return x>M&&x>R?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=T/i,s=P/i):M>R?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=T/r,s=I/r):R<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(R),i=P/s,r=I/s),this.set(i,r,s,t),this}let S=Math.sqrt((y-v)*(y-v)+(h-_)*(h-_)+(d-u)*(d-u));return Math.abs(S)<.001&&(S=1),this.x=(y-v)/S,this.y=(h-_)/S,this.z=(d-u)/S,this.w=Math.acos((c+f+m-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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Z5=class extends vs{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new bn(0,0,e,t),this.scissorTest=!1,this.viewport=new bn(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Vn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Yn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const R=Math.sqrt(x),T=Math.atan2(R,m*S);y=Math.sin(y*T)/R,a=Math.sin(a*T)/R}const M=a*S;if(l=l*y+d*M,c=c*y+f*M,u=u*y+v*M,h=h*y+_*M,y===1-a){const R=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=R,c*=R,u*=R,h*=R}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[o],d=s[o+1],f=s[o+2],v=s[o+3];return e[t]=a*v+u*h+l*f-c*d,e[t+1]=l*v+u*d+c*h-a*f,e[t+2]=c*v+u*f+a*d-l*h,e[t+3]=u*v-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),h=a(s/2),d=l(i/2),f=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h-d*f*v;break;case"YXZ":this._x=d*u*h+c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h+d*f*v;break;case"ZXY":this._x=d*u*h-c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h-d*f*v;break;case"ZYX":this._x=d*u*h-c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h+d*f*v;break;case"YZX":this._x=d*u*h+c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h-d*f*v;break;case"XZY":this._x=d*u*h-c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h+d*f*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=i+a+h;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-r)*f}else if(i>a&&i>h){const f=2*Math.sqrt(1+i-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+c)/f}else if(a>h){const f=2*Math.sqrt(1+a-i-h);this._w=(s-c)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+h-i-a);this._w=(o-r)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(fi(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-t;return this._w=f*o+t*this._w,this._x=f*i+t*this._x,this._y=f*r+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=r*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},j=class Q5{constructor(e=0,t=0,i=0){Q5.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(zU.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(zU.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*c+o*h-a*u,this.y=i+l*u+a*c-s*h,this.z=r+l*h+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return NT.copy(this).projectOnVector(e),this.sub(NT)}reflect(e){return this.sub(NT.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(fi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const NT=new j,zU=new qi;let Cr=class{constructor(e=new j(1/0,1/0,1/0),t=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=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,Co),Co.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Km),U_.subVectors(this.max,Km),Hd.subVectors(e.a,Km),Vd.subVectors(e.b,Km),Wd.subVectors(e.c,Km),nc.subVectors(Vd,Hd),ic.subVectors(Wd,Vd),Bu.subVectors(Hd,Wd);let t=[0,-nc.z,nc.y,0,-ic.z,ic.y,0,-Bu.z,Bu.y,nc.z,0,-nc.x,ic.z,0,-ic.x,Bu.z,0,-Bu.x,-nc.y,nc.x,0,-ic.y,ic.x,0,-Bu.y,Bu.x,0];return!UT(t,Hd,Vd,Wd,U_)||(t=[1,0,0,0,1,0,0,0,1],!UT(t,Hd,Vd,Wd,U_))?!1:(F_.crossVectors(nc,ic),t=[F_.x,F_.y,F_.z],UT(t,Hd,Vd,Wd,U_))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Co).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Co).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ka[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ka[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ka[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ka[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ka[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ka[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ka[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ka[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ka),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 Ka=[new j,new j,new j,new j,new j,new j,new j,new j],Co=new j,N_=new Cr,Hd=new j,Vd=new j,Wd=new j,nc=new j,ic=new j,Bu=new j,Km=new j,U_=new j,F_=new j,Nu=new j;function UT(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Nu.fromArray(n,s);const a=r.x*Math.abs(Nu.x)+r.y*Math.abs(Nu.y)+r.z*Math.abs(Nu.z),l=e.dot(Nu),c=t.dot(Nu),u=i.dot(Nu);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const Qte=new Cr,qm=new j,FT=new j;let sr=class{constructor(e=new j,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):Qte.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.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;qm.subVectors(e,this.center);const t=qm.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(qm,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(FT.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(qm.copy(e.center).add(FT)),this.expandByPoint(qm.copy(e.center).sub(FT))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const qa=new j,OT=new j,O_=new j,rc=new j,kT=new j,k_=new j,zT=new j;let _d=class{constructor(e=new j,t=new j(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,qa)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=qa.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(qa.copy(this.origin).addScaledVector(this.direction,t),qa.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){OT.copy(e).add(t).multiplyScalar(.5),O_.copy(t).sub(e).normalize(),rc.copy(this.origin).sub(OT);const s=e.distanceTo(t)*.5,o=-this.direction.dot(O_),a=rc.dot(this.direction),l=-rc.dot(O_),c=rc.lengthSq(),u=Math.abs(1-o*o);let h,d,f,v;if(u>0)if(h=o*l-a,d=o*a-l,v=s*u,h>=0)if(d>=-v)if(d<=v){const _=1/u;h*=_,d*=_,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-v?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=v?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(OT).addScaledVector(O_,d),f}intersectSphere(e,t){qa.subVectors(e.center,this.origin);const i=qa.dot(this.direction),r=qa.dot(qa)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,qa)!==null}intersectTriangle(e,t,i,r,s){kT.subVectors(t,e),k_.subVectors(i,e),zT.crossVectors(kT,k_);let o=this.direction.dot(zT),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;rc.subVectors(this.origin,e);const l=a*this.direction.dot(k_.crossVectors(rc,k_));if(l<0)return null;const c=a*this.direction.dot(kT.cross(rc));if(c<0||l+c>o)return null;const u=-a*rc.dot(zT);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Rt=class jR{constructor(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y){jR.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y)}set(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=d,m[3]=f,m[7]=v,m[11]=_,m[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new jR().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/$d.setFromMatrixColumn(e,0).length(),s=1/$d.setFromMatrixColumn(e,1).length(),o=1/$d.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const d=o*u,f=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+v*c,t[5]=d-_*c,t[9]=-a*l,t[2]=_-d*c,t[6]=v+f*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,f=l*h,v=c*u,_=c*h;t[0]=d+_*a,t[4]=v*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-v,t[6]=_+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,f=l*h,v=c*u,_=c*h;t[0]=d-_*a,t[4]=-o*h,t[8]=v+f*a,t[1]=f+v*a,t[5]=o*u,t[9]=_-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,f=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=v*c-f,t[8]=d*c+_,t[1]=l*h,t[5]=_*c+d,t[9]=f*c-v,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,f=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=_-d*h,t[8]=v*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+v,t[10]=d-_*h}else if(e.order==="XZY"){const d=o*l,f=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+_,t[5]=o*u,t[9]=f*h-v,t[2]=v*h-f,t[6]=a*u,t[10]=_*h+d}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(ene,e,tne)}lookAt(e,t,i){const r=this.elements;return ws.subVectors(e,t),ws.lengthSq()===0&&(ws.z=1),ws.normalize(),sc.crossVectors(i,ws),sc.lengthSq()===0&&(Math.abs(i.z)===1?ws.x+=1e-4:ws.z+=1e-4,ws.normalize(),sc.crossVectors(i,ws)),sc.normalize(),z_.crossVectors(ws,sc),r[0]=sc.x,r[4]=z_.x,r[8]=ws.x,r[1]=sc.y,r[5]=z_.y,r[9]=ws.y,r[2]=sc.z,r[6]=z_.z,r[10]=ws.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],d=i[9],f=i[13],v=i[2],_=i[6],y=i[10],m=i[14],S=i[3],x=i[7],M=i[11],R=i[15],T=r[0],P=r[4],I=r[8],b=r[12],w=r[1],N=r[5],G=r[9],V=r[13],$=r[2],Z=r[6],X=r[10],re=r[14],O=r[3],Q=r[7],te=r[11],le=r[15];return s[0]=o*T+a*w+l*$+c*O,s[4]=o*P+a*N+l*Z+c*Q,s[8]=o*I+a*G+l*X+c*te,s[12]=o*b+a*V+l*re+c*le,s[1]=u*T+h*w+d*$+f*O,s[5]=u*P+h*N+d*Z+f*Q,s[9]=u*I+h*G+d*X+f*te,s[13]=u*b+h*V+d*re+f*le,s[2]=v*T+_*w+y*$+m*O,s[6]=v*P+_*N+y*Z+m*Q,s[10]=v*I+_*G+y*X+m*te,s[14]=v*b+_*V+y*re+m*le,s[3]=S*T+x*w+M*$+R*O,s[7]=S*P+x*N+M*Z+R*Q,s[11]=S*I+x*G+M*X+R*te,s[15]=S*b+x*V+M*re+R*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],v=e[3],_=e[7],y=e[11],m=e[15];return v*(+s*l*h-r*c*h-s*a*d+i*c*d+r*a*f-i*l*f)+_*(+t*l*f-t*c*d+s*o*d-r*o*f+r*c*u-s*l*u)+y*(+t*c*h-t*a*f-s*o*h+i*o*f+s*a*u-i*c*u)+m*(-r*a*u-t*l*h+t*a*d+r*o*h-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],v=e[12],_=e[13],y=e[14],m=e[15],S=h*y*c-_*d*c+_*l*f-a*y*f-h*l*m+a*d*m,x=v*d*c-u*y*c-v*l*f+o*y*f+u*l*m-o*d*m,M=u*_*c-v*h*c+v*a*f-o*_*f-u*a*m+o*h*m,R=v*h*l-u*_*l-v*a*d+o*_*d+u*a*y-o*h*y,T=t*S+i*x+r*M+s*R;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/T;return e[0]=S*P,e[1]=(_*d*s-h*y*s-_*r*f+i*y*f+h*r*m-i*d*m)*P,e[2]=(a*y*s-_*l*s+_*r*c-i*y*c-a*r*m+i*l*m)*P,e[3]=(h*l*s-a*d*s-h*r*c+i*d*c+a*r*f-i*l*f)*P,e[4]=x*P,e[5]=(u*y*s-v*d*s+v*r*f-t*y*f-u*r*m+t*d*m)*P,e[6]=(v*l*s-o*y*s-v*r*c+t*y*c+o*r*m-t*l*m)*P,e[7]=(o*d*s-u*l*s+u*r*c-t*d*c-o*r*f+t*l*f)*P,e[8]=M*P,e[9]=(v*h*s-u*_*s-v*i*f+t*_*f+u*i*m-t*h*m)*P,e[10]=(o*_*s-v*a*s+v*i*c-t*_*c-o*i*m+t*a*m)*P,e[11]=(u*a*s-o*h*s-u*i*c+t*h*c+o*i*f-t*a*f)*P,e[12]=R*P,e[13]=(u*_*r-v*h*r+v*i*d-t*_*d-u*i*y+t*h*y)*P,e[14]=(v*a*r-o*_*r-v*i*l+t*_*l+o*i*y-t*a*y)*P,e[15]=(o*h*r-u*a*r+u*i*l-t*h*l-o*i*d+t*a*d)*P,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,v=s*h,_=o*u,y=o*h,m=a*h,S=l*c,x=l*u,M=l*h,R=i.x,T=i.y,P=i.z;return r[0]=(1-(_+m))*R,r[1]=(f+M)*R,r[2]=(v-x)*R,r[3]=0,r[4]=(f-M)*T,r[5]=(1-(d+m))*T,r[6]=(y+S)*T,r[7]=0,r[8]=(v+x)*P,r[9]=(y-S)*P,r[10]=(1-(d+_))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=$d.set(r[0],r[1],r[2]).length();const o=$d.set(r[4],r[5],r[6]).length(),a=$d.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Ro.copy(this);const c=1/s,u=1/o,h=1/a;return Ro.elements[0]*=c,Ro.elements[1]*=c,Ro.elements[2]*=c,Ro.elements[4]*=u,Ro.elements[5]*=u,Ro.elements[6]*=u,Ro.elements[8]*=h,Ro.elements[9]*=h,Ro.elements[10]*=h,t.setFromRotationMatrix(Ro),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Aa){const l=this.elements,c=2*s/(t-e),u=2*s/(i-r),h=(t+e)/(t-e),d=(i+r)/(i-r);let f,v;if(a===Aa)f=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Jv)f=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Aa){const l=this.elements,c=1/(t-e),u=1/(i-r),h=1/(o-s),d=(t+e)*c,f=(i+r)*u;let v,_;if(a===Aa)v=(o+s)*h,_=-2*h;else if(a===Jv)v=s*h,_=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};const $d=new j,Ro=new Rt,ene=new j(0,0,0),tne=new j(1,1,1),sc=new j,z_=new j,ws=new j,GU=new Rt,HU=new qi;let Gs=class e8{constructor(e=0,t=0,i=0,r=e8.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],h=r[2],d=r[6],f=r[10];switch(t){case"XYZ":this._y=Math.asin(fi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-fi(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(fi(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-fi(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(fi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-fi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return GU.makeRotationFromQuaternion(e),this.setFromRotationMatrix(GU,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return HU.setFromEuler(this),this.setFromQuaternion(HU,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Gs.DEFAULT_ORDER="XYZ";let Vh=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),f.length>0&&(i.animations=f),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Po.subVectors(r,t),Qa.subVectors(i,t),HT.subVectors(e,t);const o=Po.dot(Po),a=Po.dot(Qa),l=Po.dot(HT),c=Qa.dot(Qa),u=Qa.dot(HT),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;const d=1/h,f=(c*l-a*u)*d,v=(o*u-a*l)*d;return s.set(1-f-v,v,f)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,el)===null?!1:el.x>=0&&el.y>=0&&el.x+el.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,el)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,el.x),l.addScaledVector(o,el.y),l.addScaledVector(a,el.z),l)}static isFrontFacing(e,t,i,r){return Po.subVectors(i,t),Qa.subVectors(e,t),Po.cross(Qa).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Po.subVectors(this.c,this.b),Qa.subVectors(this.a,this.b),Po.cross(Qa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return If.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return If.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return If.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return If.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return If.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Yd.subVectors(r,i),Jd.subVectors(s,i),VT.subVectors(e,i);const l=Yd.dot(VT),c=Jd.dot(VT);if(l<=0&&c<=0)return t.copy(i);WT.subVectors(e,r);const u=Yd.dot(WT),h=Jd.dot(WT);if(u>=0&&h<=u)return t.copy(r);const d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Yd,o);$T.subVectors(e,s);const f=Yd.dot($T),v=Jd.dot($T);if(v>=0&&f<=v)return t.copy(s);const _=f*c-l*v;if(_<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(i).addScaledVector(Jd,a);const y=u*v-f*h;if(y<=0&&h-u>=0&&f-v>=0)return YU.subVectors(s,r),a=(h-u)/(h-u+(f-v)),t.copy(r).addScaledVector(YU,a);const m=1/(y+_+d);return o=_*m,a=d*m,t.copy(i).addScaledVector(Yd,o).addScaledVector(Jd,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};const t8={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},oc={h:0,s:0,l:0},H_={h:0,s:0,l:0};function XT(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}let ct=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Bn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Sn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Sn.workingColorSpace){return this.r=e,this.g=t,this.b=i,Sn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Sn.workingColorSpace){if(e=RI(e,1),t=fi(t,0,1),i=fi(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=XT(o,s,e+1/3),this.g=XT(o,s,e),this.b=XT(o,s,e-1/3)}return Sn.toWorkingColorSpace(this,r),this}setStyle(e,t=Bn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Bn){const i=t8[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Sp(e.r),this.g=Sp(e.g),this.b=Sp(e.b),this}copyLinearToSRGB(e){return this.r=DT(e.r),this.g=DT(e.g),this.b=DT(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Bn){return Sn.fromWorkingColorSpace(pr.copy(this),e),Math.round(fi(pr.r*255,0,255))*65536+Math.round(fi(pr.g*255,0,255))*256+Math.round(fi(pr.b*255,0,255))}getHexString(e=Bn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Sn.workingColorSpace){Sn.fromWorkingColorSpace(pr.copy(this),t);const i=pr.r,r=pr.g,s=pr.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==kh&&(i.blending=this.blending),this.side!==Yo&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==DS&&(i.blendSrc=this.blendSrc),this.blendDst!==BS&&(i.blendDst=this.blendDst),this.blendEquation!==Rc&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Gv&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==$R&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==dh&&(i.stencilFail=this.stencilFail),this.stencilZFail!==dh&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==dh&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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 i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}},Ls=class extends mi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ct(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 Gs,this.combine=J0,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 fl=ane();function ane(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function os(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=fi(n,-65504,65504),fl.floatView[0]=n;const e=fl.uint32View[0],t=e>>23&511;return fl.baseTable[t]+((e&8388607)>>fl.shiftTable[t])}function Ng(n){const e=n>>10;return fl.uint32View[0]=fl.mantissaTable[fl.offsetTable[e]+(n&1023)]+fl.exponentTable[e],fl.floatView[0]}const lne={toHalfFloat:os,fromHalfFloat:Ng},Ci=new j,V_=new Fe;let un=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Yv,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Yr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return xp("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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let d=0,f=h.length;d0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(JU.copy(s).invert(),Uu.copy(e.ray).applyMatrix4(JU),!(i.boundingBox!==null&&Uu.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Uu)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,d=s.groups,f=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,_=d.length;v<_;v++){const y=d[v],m=o[y.materialIndex],S=Math.max(y.start,f.start),x=Math.min(a.count,Math.min(y.start+y.count,f.start+f.count));for(let M=S,R=x;Mt.far?null:{distance:c,point:K_.clone(),object:n}}function q_(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,qd),n.getVertexPosition(l,Zd),n.getVertexPosition(c,Qd);const u=gne(n,e,t,i,qd,Zd,Qd,J_);if(u){r&&(X_.fromBufferAttribute(r,a),j_.fromBufferAttribute(r,l),Y_.fromBufferAttribute(r,c),u.uv=bh.getInterpolation(J_,qd,Zd,Qd,X_,j_,Y_,new Fe)),s&&(X_.fromBufferAttribute(s,a),j_.fromBufferAttribute(s,l),Y_.fromBufferAttribute(s,c),u.uv1=bh.getInterpolation(J_,qd,Zd,Qd,X_,j_,Y_,new Fe)),o&&(qU.fromBufferAttribute(o,a),ZU.fromBufferAttribute(o,l),QU.fromBufferAttribute(o,c),u.normal=bh.getInterpolation(J_,qd,Zd,Qd,qU,ZU,QU,new j),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new j,materialIndex:0};bh.getNormal(qd,Zd,Qd,h.normal),u.face=h}return u}let Z0=class i8 extends Vt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],h=[];let d=0,f=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Mt(c,3)),this.setAttribute("normal",new Mt(u,3)),this.setAttribute("uv",new Mt(h,2));function v(_,y,m,S,x,M,R,T,P,I,b){const w=M/P,N=R/I,G=M/2,V=R/2,$=T/2,Z=P+1,X=I+1;let re=0,O=0;const Q=new j;for(let te=0;te0?1:-1,u.push(Q.x,Q.y,Q.z),h.push(we/P),h.push(1-te/I),re+=1}}for(let te=0;te>8&255]+fr[n>>16&255]+fr[n>>24&255]+"-"+fr[e&255]+fr[e>>8&255]+"-"+fr[e>>16&15|64]+fr[e>>24&255]+"-"+fr[t&63|128]+fr[t>>8&255]+"-"+fr[t>>16&255]+fr[t>>24&255]+fr[i&255]+fr[i>>8&255]+fr[i>>16&255]+fr[i>>24&255]).toLowerCase()}function fi(n,e,t){return Math.max(e,Math.min(t,n))}function LI(n,e){return(n%e+e)%e}function Bte(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function Nte(n,e,t){return n!==e?(t-n)/(e-n):0}function ov(n,e,t){return(1-t)*n+t*e}function Ute(n,e,t,i){return ov(n,e,1-Math.exp(-t*i))}function Fte(n,e=1){return e-Math.abs(LI(n,e*2)-e)}function Ote(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function kte(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function zte(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Gte(n,e){return n+Math.random()*(e-n)}function Hte(n){return n*(.5-Math.random())}function Vte(n){n!==void 0&&(kU=n);let e=kU+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Wte(n){return n*Hh}function $te(n){return n*zp}function Xte(n){return(n&n-1)===0&&n!==0}function jte(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Yte(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Jte(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),h=s((e-i)/2),d=o((e-i)/2),f=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*h,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*h,a*c);break;case"ZXZ":n.set(l*h,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*v,l*f,a*c);break;case"YXY":n.set(l*f,a*u,l*v,a*c);break;case"ZYZ":n.set(l*v,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function $r(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function $t(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const DI={DEG2RAD:Hh,RAD2DEG:zp,generateUUID:Ns,clamp:fi,euclideanModulo:LI,mapLinear:Bte,inverseLerp:Nte,lerp:ov,damp:Ute,pingpong:Fte,smoothstep:Ote,smootherstep:kte,randInt:zte,randFloat:Gte,randFloatSpread:Hte,seededRandom:Vte,degToRad:Wte,radToDeg:$te,isPowerOfTwo:Xte,ceilPowerOfTwo:jte,floorPowerOfTwo:Yte,setQuaternionFromProperEuler:Jte,normalize:$t,denormalize:$r};let Fe=class K5{constructor(e=0,t=0){K5.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(fi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Zt=class q5{constructor(e,t,i,r,s,o,a,l,c){q5.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],f=i[5],v=i[8],_=r[0],y=r[3],m=r[6],S=r[1],x=r[4],M=r[7],R=r[2],T=r[5],P=r[8];return s[0]=o*_+a*S+l*R,s[3]=o*y+a*x+l*T,s[6]=o*m+a*M+l*P,s[1]=c*_+u*S+h*R,s[4]=c*y+u*x+h*T,s[7]=c*m+u*M+h*P,s[2]=d*_+f*S+v*R,s[5]=d*y+f*x+v*T,s[8]=d*m+f*M+v*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,v=t*h+i*d+r*f;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/v;return e[0]=h*_,e[1]=(r*c-u*i)*_,e[2]=(a*i-r*o)*_,e[3]=d*_,e[4]=(u*t-r*l)*_,e[5]=(r*s-a*t)*_,e[6]=f*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(PT.makeScale(e,t)),this}rotate(e){return this.premultiply(PT.makeRotation(-e)),this}translate(e,t){return this.premultiply(PT.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};const PT=new Zt;function Z5(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const Kte={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ep(n,e){return new Kte[n](e)}function Kv(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Q5(){const n=Kv("canvas");return n.style.display="block",n}const zU={};function xp(n){n in zU||(zU[n]=!0,console.warn(n))}function qte(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const GU=new Zt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),HU=new Zt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Km={[Zo]:{transfer:$v,primaries:Xv,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[Dn]:{transfer:On,primaries:Xv,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[K0]:{transfer:$v,primaries:jv,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(HU),fromReference:n=>n.applyMatrix3(GU)},[NA]:{transfer:On,primaries:jv,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(HU),fromReference:n=>n.applyMatrix3(GU).convertLinearToSRGB()}},Zte=new Set([Zo,K0]),Sn={enabled:!0,_workingColorSpace:Zo,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!Zte.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Km[e].toReference,r=Km[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Km[n].primaries},getTransfer:function(n){return n===zo?$v:Km[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(Km[e].luminanceCoefficients)}};function Sp(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function IT(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Gd,e8=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Gd===void 0&&(Gd=Kv("canvas")),Gd.width=e.width,Gd.height=e.height;const i=Gd.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Gd}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Kv("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==TA)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Jc:e.x=e.x-Math.floor(e.x);break;case Is:e.x=e.x<0?0:1;break;case Up:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Jc:e.y=e.y-Math.floor(e.y);break;case Is:e.y=e.y<0?0:1;break;case Up:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};Yn.DEFAULT_IMAGE=null;Yn.DEFAULT_MAPPING=TA;Yn.DEFAULT_ANISOTROPY=1;let bn=class t8{constructor(e=0,t=0,i=0,r=1){t8.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],v=l[9],_=l[2],y=l[6],m=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-_)<.01&&Math.abs(v-y)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+_)<.1&&Math.abs(v+y)<.1&&Math.abs(c+f+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,M=(f+1)/2,R=(m+1)/2,T=(u+d)/4,P=(h+_)/4,I=(v+y)/4;return x>M&&x>R?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=T/i,s=P/i):M>R?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=T/r,s=I/r):R<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(R),i=P/s,r=I/s),this.set(i,r,s,t),this}let S=Math.sqrt((y-v)*(y-v)+(h-_)*(h-_)+(d-u)*(d-u));return Math.abs(S)<.001&&(S=1),this.x=(y-v)/S,this.y=(h-_)/S,this.z=(d-u)/S,this.w=Math.acos((c+f+m-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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},n8=class extends vs{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new bn(0,0,e,t),this.scissorTest=!1,this.viewport=new bn(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Vn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Yn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const R=Math.sqrt(x),T=Math.atan2(R,m*S);y=Math.sin(y*T)/R,a=Math.sin(a*T)/R}const M=a*S;if(l=l*y+d*M,c=c*y+f*M,u=u*y+v*M,h=h*y+_*M,y===1-a){const R=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=R,c*=R,u*=R,h*=R}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[o],d=s[o+1],f=s[o+2],v=s[o+3];return e[t]=a*v+u*h+l*f-c*d,e[t+1]=l*v+u*d+c*h-a*f,e[t+2]=c*v+u*f+a*d-l*h,e[t+3]=u*v-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),h=a(s/2),d=l(i/2),f=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h-d*f*v;break;case"YXZ":this._x=d*u*h+c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h+d*f*v;break;case"ZXY":this._x=d*u*h-c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h-d*f*v;break;case"ZYX":this._x=d*u*h-c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h+d*f*v;break;case"YZX":this._x=d*u*h+c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h-d*f*v;break;case"XZY":this._x=d*u*h-c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h+d*f*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=i+a+h;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-r)*f}else if(i>a&&i>h){const f=2*Math.sqrt(1+i-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+c)/f}else if(a>h){const f=2*Math.sqrt(1+a-i-h);this._w=(s-c)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+h-i-a);this._w=(o-r)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(fi(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-t;return this._w=f*o+t*this._w,this._x=f*i+t*this._x,this._y=f*r+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=r*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},j=class i8{constructor(e=0,t=0,i=0){i8.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(VU.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(VU.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*c+o*h-a*u,this.y=i+l*u+a*c-s*h,this.z=r+l*h+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return DT.copy(this).projectOnVector(e),this.sub(DT)}reflect(e){return this.sub(DT.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(fi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const DT=new j,VU=new qi;let Cr=class{constructor(e=new j(1/0,1/0,1/0),t=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=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,Co),Co.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(qm),N_.subVectors(this.max,qm),Hd.subVectors(e.a,qm),Vd.subVectors(e.b,qm),Wd.subVectors(e.c,qm),tc.subVectors(Vd,Hd),nc.subVectors(Wd,Vd),Bu.subVectors(Hd,Wd);let t=[0,-tc.z,tc.y,0,-nc.z,nc.y,0,-Bu.z,Bu.y,tc.z,0,-tc.x,nc.z,0,-nc.x,Bu.z,0,-Bu.x,-tc.y,tc.x,0,-nc.y,nc.x,0,-Bu.y,Bu.x,0];return!BT(t,Hd,Vd,Wd,N_)||(t=[1,0,0,0,1,0,0,0,1],!BT(t,Hd,Vd,Wd,N_))?!1:(U_.crossVectors(tc,nc),t=[U_.x,U_.y,U_.z],BT(t,Hd,Vd,Wd,N_))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Co).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Co).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ka[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ka[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ka[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ka[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ka[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ka[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ka[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ka[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ka),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 Ka=[new j,new j,new j,new j,new j,new j,new j,new j],Co=new j,B_=new Cr,Hd=new j,Vd=new j,Wd=new j,tc=new j,nc=new j,Bu=new j,qm=new j,N_=new j,U_=new j,Nu=new j;function BT(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Nu.fromArray(n,s);const a=r.x*Math.abs(Nu.x)+r.y*Math.abs(Nu.y)+r.z*Math.abs(Nu.z),l=e.dot(Nu),c=t.dot(Nu),u=i.dot(Nu);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const ine=new Cr,Zm=new j,NT=new j;let sr=class{constructor(e=new j,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):ine.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.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;Zm.subVectors(e,this.center);const t=Zm.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Zm,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(NT.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Zm.copy(e.center).add(NT)),this.expandByPoint(Zm.copy(e.center).sub(NT))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const qa=new j,UT=new j,F_=new j,ic=new j,FT=new j,O_=new j,OT=new j;let _d=class{constructor(e=new j,t=new j(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,qa)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=qa.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(qa.copy(this.origin).addScaledVector(this.direction,t),qa.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){UT.copy(e).add(t).multiplyScalar(.5),F_.copy(t).sub(e).normalize(),ic.copy(this.origin).sub(UT);const s=e.distanceTo(t)*.5,o=-this.direction.dot(F_),a=ic.dot(this.direction),l=-ic.dot(F_),c=ic.lengthSq(),u=Math.abs(1-o*o);let h,d,f,v;if(u>0)if(h=o*l-a,d=o*a-l,v=s*u,h>=0)if(d>=-v)if(d<=v){const _=1/u;h*=_,d*=_,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-v?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=v?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(UT).addScaledVector(F_,d),f}intersectSphere(e,t){qa.subVectors(e.center,this.origin);const i=qa.dot(this.direction),r=qa.dot(qa)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,qa)!==null}intersectTriangle(e,t,i,r,s){FT.subVectors(t,e),O_.subVectors(i,e),OT.crossVectors(FT,O_);let o=this.direction.dot(OT),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ic.subVectors(this.origin,e);const l=a*this.direction.dot(O_.crossVectors(ic,O_));if(l<0)return null;const c=a*this.direction.dot(FT.cross(ic));if(c<0||l+c>o)return null;const u=-a*ic.dot(OT);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Rt=class XR{constructor(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y){XR.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y)}set(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=d,m[3]=f,m[7]=v,m[11]=_,m[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new XR().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/$d.setFromMatrixColumn(e,0).length(),s=1/$d.setFromMatrixColumn(e,1).length(),o=1/$d.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const d=o*u,f=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+v*c,t[5]=d-_*c,t[9]=-a*l,t[2]=_-d*c,t[6]=v+f*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,f=l*h,v=c*u,_=c*h;t[0]=d+_*a,t[4]=v*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-v,t[6]=_+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,f=l*h,v=c*u,_=c*h;t[0]=d-_*a,t[4]=-o*h,t[8]=v+f*a,t[1]=f+v*a,t[5]=o*u,t[9]=_-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,f=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=v*c-f,t[8]=d*c+_,t[1]=l*h,t[5]=_*c+d,t[9]=f*c-v,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,f=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=_-d*h,t[8]=v*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+v,t[10]=d-_*h}else if(e.order==="XZY"){const d=o*l,f=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+_,t[5]=o*u,t[9]=f*h-v,t[2]=v*h-f,t[6]=a*u,t[10]=_*h+d}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(rne,e,sne)}lookAt(e,t,i){const r=this.elements;return ws.subVectors(e,t),ws.lengthSq()===0&&(ws.z=1),ws.normalize(),rc.crossVectors(i,ws),rc.lengthSq()===0&&(Math.abs(i.z)===1?ws.x+=1e-4:ws.z+=1e-4,ws.normalize(),rc.crossVectors(i,ws)),rc.normalize(),k_.crossVectors(ws,rc),r[0]=rc.x,r[4]=k_.x,r[8]=ws.x,r[1]=rc.y,r[5]=k_.y,r[9]=ws.y,r[2]=rc.z,r[6]=k_.z,r[10]=ws.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],d=i[9],f=i[13],v=i[2],_=i[6],y=i[10],m=i[14],S=i[3],x=i[7],M=i[11],R=i[15],T=r[0],P=r[4],I=r[8],b=r[12],w=r[1],N=r[5],G=r[9],V=r[13],$=r[2],Z=r[6],X=r[10],re=r[14],O=r[3],Q=r[7],te=r[11],le=r[15];return s[0]=o*T+a*w+l*$+c*O,s[4]=o*P+a*N+l*Z+c*Q,s[8]=o*I+a*G+l*X+c*te,s[12]=o*b+a*V+l*re+c*le,s[1]=u*T+h*w+d*$+f*O,s[5]=u*P+h*N+d*Z+f*Q,s[9]=u*I+h*G+d*X+f*te,s[13]=u*b+h*V+d*re+f*le,s[2]=v*T+_*w+y*$+m*O,s[6]=v*P+_*N+y*Z+m*Q,s[10]=v*I+_*G+y*X+m*te,s[14]=v*b+_*V+y*re+m*le,s[3]=S*T+x*w+M*$+R*O,s[7]=S*P+x*N+M*Z+R*Q,s[11]=S*I+x*G+M*X+R*te,s[15]=S*b+x*V+M*re+R*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],v=e[3],_=e[7],y=e[11],m=e[15];return v*(+s*l*h-r*c*h-s*a*d+i*c*d+r*a*f-i*l*f)+_*(+t*l*f-t*c*d+s*o*d-r*o*f+r*c*u-s*l*u)+y*(+t*c*h-t*a*f-s*o*h+i*o*f+s*a*u-i*c*u)+m*(-r*a*u-t*l*h+t*a*d+r*o*h-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],v=e[12],_=e[13],y=e[14],m=e[15],S=h*y*c-_*d*c+_*l*f-a*y*f-h*l*m+a*d*m,x=v*d*c-u*y*c-v*l*f+o*y*f+u*l*m-o*d*m,M=u*_*c-v*h*c+v*a*f-o*_*f-u*a*m+o*h*m,R=v*h*l-u*_*l-v*a*d+o*_*d+u*a*y-o*h*y,T=t*S+i*x+r*M+s*R;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/T;return e[0]=S*P,e[1]=(_*d*s-h*y*s-_*r*f+i*y*f+h*r*m-i*d*m)*P,e[2]=(a*y*s-_*l*s+_*r*c-i*y*c-a*r*m+i*l*m)*P,e[3]=(h*l*s-a*d*s-h*r*c+i*d*c+a*r*f-i*l*f)*P,e[4]=x*P,e[5]=(u*y*s-v*d*s+v*r*f-t*y*f-u*r*m+t*d*m)*P,e[6]=(v*l*s-o*y*s-v*r*c+t*y*c+o*r*m-t*l*m)*P,e[7]=(o*d*s-u*l*s+u*r*c-t*d*c-o*r*f+t*l*f)*P,e[8]=M*P,e[9]=(v*h*s-u*_*s-v*i*f+t*_*f+u*i*m-t*h*m)*P,e[10]=(o*_*s-v*a*s+v*i*c-t*_*c-o*i*m+t*a*m)*P,e[11]=(u*a*s-o*h*s-u*i*c+t*h*c+o*i*f-t*a*f)*P,e[12]=R*P,e[13]=(u*_*r-v*h*r+v*i*d-t*_*d-u*i*y+t*h*y)*P,e[14]=(v*a*r-o*_*r-v*i*l+t*_*l+o*i*y-t*a*y)*P,e[15]=(o*h*r-u*a*r+u*i*l-t*h*l-o*i*d+t*a*d)*P,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,v=s*h,_=o*u,y=o*h,m=a*h,S=l*c,x=l*u,M=l*h,R=i.x,T=i.y,P=i.z;return r[0]=(1-(_+m))*R,r[1]=(f+M)*R,r[2]=(v-x)*R,r[3]=0,r[4]=(f-M)*T,r[5]=(1-(d+m))*T,r[6]=(y+S)*T,r[7]=0,r[8]=(v+x)*P,r[9]=(y-S)*P,r[10]=(1-(d+_))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=$d.set(r[0],r[1],r[2]).length();const o=$d.set(r[4],r[5],r[6]).length(),a=$d.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Ro.copy(this);const c=1/s,u=1/o,h=1/a;return Ro.elements[0]*=c,Ro.elements[1]*=c,Ro.elements[2]*=c,Ro.elements[4]*=u,Ro.elements[5]*=u,Ro.elements[6]*=u,Ro.elements[8]*=h,Ro.elements[9]*=h,Ro.elements[10]*=h,t.setFromRotationMatrix(Ro),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Aa){const l=this.elements,c=2*s/(t-e),u=2*s/(i-r),h=(t+e)/(t-e),d=(i+r)/(i-r);let f,v;if(a===Aa)f=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Jv)f=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Aa){const l=this.elements,c=1/(t-e),u=1/(i-r),h=1/(o-s),d=(t+e)*c,f=(i+r)*u;let v,_;if(a===Aa)v=(o+s)*h,_=-2*h;else if(a===Jv)v=s*h,_=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};const $d=new j,Ro=new Rt,rne=new j(0,0,0),sne=new j(1,1,1),rc=new j,k_=new j,ws=new j,WU=new Rt,$U=new qi;let Gs=class r8{constructor(e=0,t=0,i=0,r=r8.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],h=r[2],d=r[6],f=r[10];switch(t){case"XYZ":this._y=Math.asin(fi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-fi(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(fi(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-fi(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(fi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-fi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return WU.makeRotationFromQuaternion(e),this.setFromRotationMatrix(WU,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return $U.setFromEuler(this),this.setFromQuaternion($U,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Gs.DEFAULT_ORDER="XYZ";let Vh=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),f.length>0&&(i.animations=f),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Po.subVectors(r,t),Qa.subVectors(i,t),zT.subVectors(e,t);const o=Po.dot(Po),a=Po.dot(Qa),l=Po.dot(zT),c=Qa.dot(Qa),u=Qa.dot(zT),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;const d=1/h,f=(c*l-a*u)*d,v=(o*u-a*l)*d;return s.set(1-f-v,v,f)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,el)===null?!1:el.x>=0&&el.y>=0&&el.x+el.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,el)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,el.x),l.addScaledVector(o,el.y),l.addScaledVector(a,el.z),l)}static isFrontFacing(e,t,i,r){return Po.subVectors(i,t),Qa.subVectors(e,t),Po.cross(Qa).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Po.subVectors(this.c,this.b),Qa.subVectors(this.a,this.b),Po.cross(Qa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return If.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return If.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return If.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return If.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return If.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Yd.subVectors(r,i),Jd.subVectors(s,i),GT.subVectors(e,i);const l=Yd.dot(GT),c=Jd.dot(GT);if(l<=0&&c<=0)return t.copy(i);HT.subVectors(e,r);const u=Yd.dot(HT),h=Jd.dot(HT);if(u>=0&&h<=u)return t.copy(r);const d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Yd,o);VT.subVectors(e,s);const f=Yd.dot(VT),v=Jd.dot(VT);if(v>=0&&f<=v)return t.copy(s);const _=f*c-l*v;if(_<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(i).addScaledVector(Jd,a);const y=u*v-f*h;if(y<=0&&h-u>=0&&f-v>=0)return qU.subVectors(s,r),a=(h-u)/(h-u+(f-v)),t.copy(r).addScaledVector(qU,a);const m=1/(y+_+d);return o=_*m,a=d*m,t.copy(i).addScaledVector(Yd,o).addScaledVector(Jd,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};const s8={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},sc={h:0,s:0,l:0},G_={h:0,s:0,l:0};function WT(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}let ct=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Dn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Sn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Sn.workingColorSpace){return this.r=e,this.g=t,this.b=i,Sn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Sn.workingColorSpace){if(e=LI(e,1),t=fi(t,0,1),i=fi(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=WT(o,s,e+1/3),this.g=WT(o,s,e),this.b=WT(o,s,e-1/3)}return Sn.toWorkingColorSpace(this,r),this}setStyle(e,t=Dn){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Dn){const i=s8[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Sp(e.r),this.g=Sp(e.g),this.b=Sp(e.b),this}copyLinearToSRGB(e){return this.r=IT(e.r),this.g=IT(e.g),this.b=IT(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Dn){return Sn.fromWorkingColorSpace(pr.copy(this),e),Math.round(fi(pr.r*255,0,255))*65536+Math.round(fi(pr.g*255,0,255))*256+Math.round(fi(pr.b*255,0,255))}getHexString(e=Dn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Sn.workingColorSpace){Sn.fromWorkingColorSpace(pr.copy(this),t);const i=pr.r,r=pr.g,s=pr.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==kh&&(i.blending=this.blending),this.side!==Yo&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==DS&&(i.blendSrc=this.blendSrc),this.blendDst!==BS&&(i.blendDst=this.blendDst),this.blendEquation!==Cc&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Gv&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==WR&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==dh&&(i.stencilFail=this.stencilFail),this.stencilZFail!==dh&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==dh&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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 i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}},Ls=class extends mi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ct(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 Gs,this.combine=Y0,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 fl=hne();function hne(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function os(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=fi(n,-65504,65504),fl.floatView[0]=n;const e=fl.uint32View[0],t=e>>23&511;return fl.baseTable[t]+((e&8388607)>>fl.shiftTable[t])}function Ug(n){const e=n>>10;return fl.uint32View[0]=fl.mantissaTable[fl.offsetTable[e]+(n&1023)]+fl.exponentTable[e],fl.floatView[0]}const dne={toHalfFloat:os,fromHalfFloat:Ug},Ci=new j,H_=new Fe;let un=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Yv,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Yr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return xp("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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let d=0,f=h.length;d0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(ZU.copy(s).invert(),Uu.copy(e.ray).applyMatrix4(ZU),!(i.boundingBox!==null&&Uu.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Uu)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,d=s.groups,f=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,_=d.length;v<_;v++){const y=d[v],m=o[y.materialIndex],S=Math.max(y.start,f.start),x=Math.min(a.count,Math.min(y.start+y.count,f.start+f.count));for(let M=S,R=x;Mt.far?null:{distance:c,point:J_.clone(),object:n}}function K_(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,qd),n.getVertexPosition(l,Zd),n.getVertexPosition(c,Qd);const u=xne(n,e,t,i,qd,Zd,Qd,Y_);if(u){r&&($_.fromBufferAttribute(r,a),X_.fromBufferAttribute(r,l),j_.fromBufferAttribute(r,c),u.uv=bh.getInterpolation(Y_,qd,Zd,Qd,$_,X_,j_,new Fe)),s&&($_.fromBufferAttribute(s,a),X_.fromBufferAttribute(s,l),j_.fromBufferAttribute(s,c),u.uv1=bh.getInterpolation(Y_,qd,Zd,Qd,$_,X_,j_,new Fe)),o&&(eF.fromBufferAttribute(o,a),tF.fromBufferAttribute(o,l),nF.fromBufferAttribute(o,c),u.normal=bh.getInterpolation(Y_,qd,Zd,Qd,eF,tF,nF,new j),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new j,materialIndex:0};bh.getNormal(qd,Zd,Qd,h.normal),u.face=h}return u}let q0=class a8 extends Vt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],h=[];let d=0,f=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new Mt(c,3)),this.setAttribute("normal",new Mt(u,3)),this.setAttribute("uv",new Mt(h,2));function v(_,y,m,S,x,M,R,T,P,I,b){const w=M/P,N=R/I,G=M/2,V=R/2,$=T/2,Z=P+1,X=I+1;let re=0,O=0;const Q=new j;for(let te=0;te0?1:-1,u.push(Q.x,Q.y,Q.z),h.push(we/P),h.push(1-te/I),re+=1}}for(let te=0;te0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},im=class extends wn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Rt,this.projectionMatrix=new Rt,this.projectionMatrixInverse=new Rt,this.coordinateSystem=Aa}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 ac=new j,eF=new Fe,tF=new Fe;let Gn=class extends im{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=kp*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Hh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return kp*2*Math.atan(Math.tan(Hh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){ac.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ac.x,ac.y).multiplyScalar(-e/ac.z),ac.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ac.x,ac.y).multiplyScalar(-e/ac.z)}getViewSize(e,t){return this.getViewBounds(e,eF,tF),t.subVectors(tF,eF)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Hh*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const ef=-90,tf=1;let BI=class extends wn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Gn(ef,tf,e,t);r.layers=this.layers,this.add(r);const s=new Gn(ef,tf,e,t);s.layers=this.layers,this.add(s);const o=new Gn(ef,tf,e,t);o.layers=this.layers,this.add(o);const a=new Gn(ef,tf,e,t);a.layers=this.layers,this.add(a);const l=new Gn(ef,tf,e,t);l.layers=this.layers,this.add(l);const c=new Gn(ef,tf,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Aa)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Jv)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(h,d,f),e.xr.enabled=v,i.texture.needsPMREMUpdate=!0}},Q0=class extends Yn{constructor(e,t,i,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:Ul,super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},NI=class extends wi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Q0(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Vn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;let Oi=class extends mi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Mne,this.fragmentShader=Ane,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Gp(e.uniforms),this.uniformsGroups=Sne(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},rm=class extends wn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Rt,this.projectionMatrix=new Rt,this.projectionMatrixInverse=new Rt,this.coordinateSystem=Aa}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 oc=new j,iF=new Fe,rF=new Fe;let Gn=class extends rm{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=zp*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Hh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return zp*2*Math.atan(Math.tan(Hh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){oc.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(oc.x,oc.y).multiplyScalar(-e/oc.z),oc.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(oc.x,oc.y).multiplyScalar(-e/oc.z)}getViewSize(e,t){return this.getViewBounds(e,iF,rF),t.subVectors(rF,iF)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Hh*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const ef=-90,tf=1;let FI=class extends wn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Gn(ef,tf,e,t);r.layers=this.layers,this.add(r);const s=new Gn(ef,tf,e,t);s.layers=this.layers,this.add(s);const o=new Gn(ef,tf,e,t);o.layers=this.layers,this.add(o);const a=new Gn(ef,tf,e,t);a.layers=this.layers,this.add(a);const l=new Gn(ef,tf,e,t);l.layers=this.layers,this.add(l);const c=new Gn(ef,tf,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Aa)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Jv)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(h,d,f),e.xr.enabled=v,i.texture.needsPMREMUpdate=!0}},Z0=class extends Yn{constructor(e,t,i,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:Nl,super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},OI=class extends wi{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Z0(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Vn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -103,9 +103,9 @@ Error generating stack: `+s.message+` gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new Z0(5,5,5),s=new Oi({name:"CubemapFromEquirect",uniforms:zp(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Fi,blending:br});s.uniforms.tEquirect.value=t;const o=new si(r,s),a=t.minFilter;return t.minFilter===fo&&(t.minFilter=Vn),new BI(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}};const JT=new j,xne=new j,Sne=new Zt;let dl=class{constructor(e=new j(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=JT.subVectors(i,t).cross(xne.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(JT),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Sne.getNormalMatrix(e),r=this.coplanarPoint(JT).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const Fu=new sr,Z_=new j;let ey=class{constructor(e=new dl,t=new dl,i=new dl,r=new dl,s=new dl,o=new dl){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Aa){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],h=r[6],d=r[7],f=r[8],v=r[9],_=r[10],y=r[11],m=r[12],S=r[13],x=r[14],M=r[15];if(i[0].setComponents(l-s,d-c,y-f,M-m).normalize(),i[1].setComponents(l+s,d+c,y+f,M+m).normalize(),i[2].setComponents(l+o,d+u,y+v,M+S).normalize(),i[3].setComponents(l-o,d-u,y-v,M-S).normalize(),i[4].setComponents(l-a,d-h,y-_,M-x).normalize(),t===Aa)i[5].setComponents(l+a,d+h,y+_,M+x).normalize();else if(t===Jv)i[5].setComponents(a,h,_,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Fu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Fu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Fu)}intersectsSprite(e){return Fu.center.set(0,0,0),Fu.radius=.7071067811865476,Fu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Fu)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Z_.y=r.normal.y>0?e.max.y:e.min.y,Z_.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Z_)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function o8(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function Mne(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,h=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let f;if(c instanceof Float32Array)f=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?f=n.HALF_FLOAT:f=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=n.SHORT;else if(c instanceof Uint32Array)f=n.UNSIGNED_INT;else if(c instanceof Int32Array)f=n.INT;else if(c instanceof Int8Array)f=n.BYTE;else if(c instanceof Uint8Array)f=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,c){const u=l.array,h=l._updateRange,d=l.updateRanges;if(n.bindBuffer(c,a),h.count===-1&&d.length===0&&n.bufferSubData(c,0,u),d.length!==0){for(let f=0,v=d.length;f1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Ene.getNormalMatrix(e),r=this.coplanarPoint(jT).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const Fu=new sr,q_=new j;let Q0=class{constructor(e=new dl,t=new dl,i=new dl,r=new dl,s=new dl,o=new dl){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Aa){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],h=r[6],d=r[7],f=r[8],v=r[9],_=r[10],y=r[11],m=r[12],S=r[13],x=r[14],M=r[15];if(i[0].setComponents(l-s,d-c,y-f,M-m).normalize(),i[1].setComponents(l+s,d+c,y+f,M+m).normalize(),i[2].setComponents(l+o,d+u,y+v,M+S).normalize(),i[3].setComponents(l-o,d-u,y-v,M-S).normalize(),i[4].setComponents(l-a,d-h,y-_,M-x).normalize(),t===Aa)i[5].setComponents(l+a,d+h,y+_,M+x).normalize();else if(t===Jv)i[5].setComponents(a,h,_,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Fu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Fu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Fu)}intersectsSprite(e){return Fu.center.set(0,0,0),Fu.radius=.7071067811865476,Fu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Fu)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,q_.y=r.normal.y>0?e.max.y:e.min.y,q_.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(q_)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function u8(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function Tne(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,h=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let f;if(c instanceof Float32Array)f=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?f=n.HALF_FLOAT:f=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=n.SHORT;else if(c instanceof Uint32Array)f=n.UNSIGNED_INT;else if(c instanceof Int32Array)f=n.INT;else if(c instanceof Int8Array)f=n.BYTE;else if(c instanceof Uint8Array)f=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,c){const u=l.array,h=l._updateRange,d=l.updateRanges;if(n.bindBuffer(c,a),h.count===-1&&d.length===0&&n.bufferSubData(c,0,u),d.length!==0){for(let f=0,v=d.length;f 0 +#endif`,Hne=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -355,26 +355,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,kne=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Vne=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,zne=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Wne=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,Gne=`#if NUM_CLIPPING_PLANES > 0 +#endif`,$ne=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,Hne=`#if defined( USE_COLOR_ALPHA ) +#endif`,Xne=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,Vne=`#if defined( USE_COLOR_ALPHA ) +#endif`,jne=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,Wne=`#if defined( USE_COLOR_ALPHA ) +#endif`,Yne=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; -#endif`,$ne=`#if defined( USE_COLOR_ALPHA ) +#endif`,Jne=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); @@ -388,7 +388,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; -#endif`,Xne=`#define PI 3.141592653589793 +#endif`,Kne=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -462,7 +462,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,jne=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,qne=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -555,7 +555,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,Yne=`vec3 transformedNormal = objectNormal; +#endif`,Zne=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -584,18 +584,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,Jne=`#ifdef USE_DISPLACEMENTMAP +#endif`,Qne=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,Kne=`#ifdef USE_DISPLACEMENTMAP +#endif`,eie=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,qne=`#ifdef USE_EMISSIVEMAP +#endif`,tie=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Zne=`#ifdef USE_EMISSIVEMAP +#endif`,nie=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,Qne="gl_FragColor = linearToOutputTexel( gl_FragColor );",eie=` +#endif`,iie="gl_FragColor = linearToOutputTexel( gl_FragColor );",rie=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -617,7 +617,7 @@ vec4 LinearTransferOETF( in vec4 value ) { } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,tie=`#ifdef USE_ENVMAP +}`,sie=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -646,7 +646,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,nie=`#ifdef USE_ENVMAP +#endif`,oie=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -656,7 +656,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,iie=`#ifdef USE_ENVMAP +#endif`,aie=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -667,7 +667,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,rie=`#ifdef USE_ENVMAP +#endif`,lie=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -678,7 +678,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,sie=`#ifdef USE_ENVMAP +#endif`,cie=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -695,18 +695,18 @@ vec4 sRGBTransferOETF( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,oie=`#ifdef USE_FOG +#endif`,uie=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,aie=`#ifdef USE_FOG +#endif`,hie=`#ifdef USE_FOG varying float vFogDepth; -#endif`,lie=`#ifdef USE_FOG +#endif`,die=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,cie=`#ifdef USE_FOG +#endif`,fie=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -715,7 +715,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,uie=`#ifdef USE_GRADIENTMAP +#endif`,pie=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -727,12 +727,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,hie=`#ifdef USE_LIGHTMAP +}`,mie=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,die=`LambertMaterial material; +#endif`,gie=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,fie=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,vie=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -746,7 +746,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,pie=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,yie=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -862,7 +862,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,mie=`#ifdef USE_ENVMAP +#endif`,_ie=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -895,8 +895,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,gie=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,vie=`varying vec3 vViewPosition; +#endif`,xie=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Sie=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -908,11 +908,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,yie=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Mie=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,_ie=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Aie=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -929,7 +929,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,xie=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,wie=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -1015,7 +1015,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,Sie=`struct PhysicalMaterial { +#endif`,Eie=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1316,7 +1316,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,Mie=` +}`,Tie=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1431,7 +1431,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,Aie=`#if defined( RE_IndirectDiffuse ) +#endif`,bie=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1450,33 +1450,33 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,wie=`#if defined( RE_IndirectDiffuse ) +#endif`,Cie=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,Eie=`#if defined( USE_LOGDEPTHBUF ) +#endif`,Rie=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,Tie=`#if defined( USE_LOGDEPTHBUF ) +#endif`,Pie=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,bie=`#ifdef USE_LOGDEPTHBUF +#endif`,Iie=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; -#endif`,Cie=`#ifdef USE_LOGDEPTHBUF +#endif`,Lie=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,Rie=`#ifdef USE_MAP +#endif`,Die=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,Pie=`#ifdef USE_MAP +#endif`,Bie=`#ifdef USE_MAP uniform sampler2D map; -#endif`,Iie=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,Nie=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1488,7 +1488,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,Lie=`#if defined( USE_POINTS_UV ) +#endif`,Uie=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1500,19 +1500,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,Die=`float metalnessFactor = metalness; +#endif`,Fie=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,Bie=`#ifdef USE_METALNESSMAP +#endif`,Oie=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,Nie=`#ifdef USE_INSTANCING_MORPH +#endif`,kie=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,Uie=`#if defined( USE_MORPHCOLORS ) +#endif`,zie=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1521,12 +1521,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,Fie=`#ifdef USE_MORPHNORMALS +#endif`,Gie=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } -#endif`,Oie=`#ifdef USE_MORPHTARGETS +#endif`,Hie=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1540,12 +1540,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,kie=`#ifdef USE_MORPHTARGETS +#endif`,Vie=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } -#endif`,zie=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,Wie=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1586,7 +1586,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,Gie=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,$ie=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1601,25 +1601,25 @@ vec3 nonPerturbedNormal = normal;`,Gie=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,Hie=`#ifndef FLAT_SHADED +#endif`,Xie=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Vie=`#ifndef FLAT_SHADED +#endif`,jie=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Wie=`#ifndef FLAT_SHADED +#endif`,Yie=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,$ie=`#ifdef USE_NORMALMAP +#endif`,Jie=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1641,13 +1641,13 @@ vec3 nonPerturbedNormal = normal;`,Gie=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,Xie=`#ifdef USE_CLEARCOAT +#endif`,Kie=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,jie=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,qie=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Yie=`#ifdef USE_CLEARCOATMAP +#endif`,Zie=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1656,18 +1656,18 @@ vec3 nonPerturbedNormal = normal;`,Gie=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,Jie=`#ifdef USE_IRIDESCENCEMAP +#endif`,Qie=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,Kie=`#ifdef OPAQUE +#endif`,ere=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,qie=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,tre=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1736,9 +1736,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,Zie=`#ifdef PREMULTIPLIED_ALPHA +}`,nre=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,Qie=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,ire=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1746,22 +1746,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,ere=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,rre=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,tre=`#ifdef DITHERING +#endif`,sre=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,nre=`float roughnessFactor = roughness; +#endif`,ore=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,ire=`#ifdef USE_ROUGHNESSMAP +#endif`,are=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,rre=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,lre=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1947,7 +1947,7 @@ gl_Position = projectionMatrix * mvPosition;`,ere=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,sre=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,cre=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -1988,7 +1988,7 @@ gl_Position = projectionMatrix * mvPosition;`,ere=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,ore=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,ure=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -2020,7 +2020,7 @@ gl_Position = projectionMatrix * mvPosition;`,ere=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,are=`float getShadowMask() { +#endif`,hre=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2052,12 +2052,12 @@ gl_Position = projectionMatrix * mvPosition;`,ere=`#ifdef DITHERING #endif #endif return shadow; -}`,lre=`#ifdef USE_SKINNING +}`,dre=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,cre=`#ifdef USE_SKINNING +#endif`,fre=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2072,7 +2072,7 @@ gl_Position = projectionMatrix * mvPosition;`,ere=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,ure=`#ifdef USE_SKINNING +#endif`,pre=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2080,7 +2080,7 @@ gl_Position = projectionMatrix * mvPosition;`,ere=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,hre=`#ifdef USE_SKINNING +#endif`,mre=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2091,17 +2091,17 @@ gl_Position = projectionMatrix * mvPosition;`,ere=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,dre=`float specularStrength; +#endif`,gre=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,fre=`#ifdef USE_SPECULARMAP +#endif`,vre=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,pre=`#if defined( TONE_MAPPING ) +#endif`,yre=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,mre=`#ifndef saturate +#endif`,_re=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2198,7 +2198,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,gre=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,xre=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2219,7 +2219,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gre=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,vre=`#ifdef USE_TRANSMISSION +#endif`,Sre=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2350,7 +2350,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gre=`#ifdef USE_TRANSMIS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,yre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Mre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2420,7 +2420,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gre=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,_re=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Are=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2514,7 +2514,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gre=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,xre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,wre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2585,7 +2585,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gre=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,Sre=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Ere=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2594,12 +2594,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,gre=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const Mre=`varying vec2 vUv; +#endif`;const Tre=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,Are=`uniform sampler2D t2D; +}`,bre=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2611,14 +2611,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,wre=`varying vec3 vWorldDirection; +}`,Cre=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,Ere=`#ifdef ENVMAP_TYPE_CUBE +}`,Rre=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2641,14 +2641,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,Tre=`varying vec3 vWorldDirection; +}`,Pre=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,bre=`uniform samplerCube tCube; +}`,Ire=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2658,7 +2658,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,Cre=`#include +}`,Lre=`#include #include #include #include @@ -2685,7 +2685,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,Rre=`#if DEPTH_PACKING == 3200 +}`,Dre=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2719,7 +2719,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,Pre=`#define DISTANCE +}`,Bre=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2746,7 +2746,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,Ire=`#define DISTANCE +}`,Nre=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2770,13 +2770,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,Lre=`varying vec3 vWorldDirection; +}`,Ure=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,Dre=`uniform sampler2D tEquirect; +}`,Fre=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2785,7 +2785,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,Bre=`uniform float scale; +}`,Ore=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2807,7 +2807,7 @@ void main() { #include #include #include -}`,Nre=`uniform vec3 diffuse; +}`,kre=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2835,7 +2835,7 @@ void main() { #include #include #include -}`,Ure=`#include +}`,zre=`#include #include #include #include @@ -2867,7 +2867,7 @@ void main() { #include #include #include -}`,Fre=`uniform vec3 diffuse; +}`,Gre=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2915,7 +2915,7 @@ void main() { #include #include #include -}`,Ore=`#define LAMBERT +}`,Hre=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2954,7 +2954,7 @@ void main() { #include #include #include -}`,kre=`#define LAMBERT +}`,Vre=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3011,7 +3011,7 @@ void main() { #include #include #include -}`,zre=`#define MATCAP +}`,Wre=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3045,7 +3045,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,Gre=`#define MATCAP +}`,$re=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3091,7 +3091,7 @@ void main() { #include #include #include -}`,Hre=`#define NORMAL +}`,Xre=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3124,7 +3124,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,Vre=`#define NORMAL +}`,jre=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3146,7 +3146,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,Wre=`#define PHONG +}`,Yre=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3185,7 +3185,7 @@ void main() { #include #include #include -}`,$re=`#define PHONG +}`,Jre=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3244,7 +3244,7 @@ void main() { #include #include #include -}`,Xre=`#define STANDARD +}`,Kre=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3287,7 +3287,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,jre=`#define STANDARD +}`,qre=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3412,7 +3412,7 @@ void main() { #include #include #include -}`,Yre=`#define TOON +}`,Zre=`#define TOON varying vec3 vViewPosition; #include #include @@ -3449,7 +3449,7 @@ void main() { #include #include #include -}`,Jre=`#define TOON +}`,Qre=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3502,7 +3502,7 @@ void main() { #include #include #include -}`,Kre=`uniform float size; +}`,ese=`uniform float size; uniform float scale; #include #include @@ -3533,7 +3533,7 @@ void main() { #include #include #include -}`,qre=`uniform vec3 diffuse; +}`,tse=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3558,7 +3558,7 @@ void main() { #include #include #include -}`,Zre=`#include +}`,nse=`#include #include #include #include @@ -3581,7 +3581,7 @@ void main() { #include #include #include -}`,Qre=`uniform vec3 color; +}`,ise=`uniform vec3 color; uniform float opacity; #include #include @@ -3597,7 +3597,7 @@ void main() { #include #include #include -}`,ese=`uniform float rotation; +}`,rse=`uniform float rotation; uniform vec2 center; #include #include @@ -3623,7 +3623,7 @@ void main() { #include #include #include -}`,tse=`uniform vec3 diffuse; +}`,sse=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3648,7 +3648,7 @@ void main() { #include #include #include -}`,Jt={alphahash_fragment:Ane,alphahash_pars_fragment:wne,alphamap_fragment:Ene,alphamap_pars_fragment:Tne,alphatest_fragment:bne,alphatest_pars_fragment:Cne,aomap_fragment:Rne,aomap_pars_fragment:Pne,batching_pars_vertex:Ine,batching_vertex:Lne,begin_vertex:Dne,beginnormal_vertex:Bne,bsdfs:Nne,iridescence_fragment:Une,bumpmap_pars_fragment:Fne,clipping_planes_fragment:One,clipping_planes_pars_fragment:kne,clipping_planes_pars_vertex:zne,clipping_planes_vertex:Gne,color_fragment:Hne,color_pars_fragment:Vne,color_pars_vertex:Wne,color_vertex:$ne,common:Xne,cube_uv_reflection_fragment:jne,defaultnormal_vertex:Yne,displacementmap_pars_vertex:Jne,displacementmap_vertex:Kne,emissivemap_fragment:qne,emissivemap_pars_fragment:Zne,colorspace_fragment:Qne,colorspace_pars_fragment:eie,envmap_fragment:tie,envmap_common_pars_fragment:nie,envmap_pars_fragment:iie,envmap_pars_vertex:rie,envmap_physical_pars_fragment:mie,envmap_vertex:sie,fog_vertex:oie,fog_pars_vertex:aie,fog_fragment:lie,fog_pars_fragment:cie,gradientmap_pars_fragment:uie,lightmap_pars_fragment:hie,lights_lambert_fragment:die,lights_lambert_pars_fragment:fie,lights_pars_begin:pie,lights_toon_fragment:gie,lights_toon_pars_fragment:vie,lights_phong_fragment:yie,lights_phong_pars_fragment:_ie,lights_physical_fragment:xie,lights_physical_pars_fragment:Sie,lights_fragment_begin:Mie,lights_fragment_maps:Aie,lights_fragment_end:wie,logdepthbuf_fragment:Eie,logdepthbuf_pars_fragment:Tie,logdepthbuf_pars_vertex:bie,logdepthbuf_vertex:Cie,map_fragment:Rie,map_pars_fragment:Pie,map_particle_fragment:Iie,map_particle_pars_fragment:Lie,metalnessmap_fragment:Die,metalnessmap_pars_fragment:Bie,morphinstance_vertex:Nie,morphcolor_vertex:Uie,morphnormal_vertex:Fie,morphtarget_pars_vertex:Oie,morphtarget_vertex:kie,normal_fragment_begin:zie,normal_fragment_maps:Gie,normal_pars_fragment:Hie,normal_pars_vertex:Vie,normal_vertex:Wie,normalmap_pars_fragment:$ie,clearcoat_normal_fragment_begin:Xie,clearcoat_normal_fragment_maps:jie,clearcoat_pars_fragment:Yie,iridescence_pars_fragment:Jie,opaque_fragment:Kie,packing:qie,premultiplied_alpha_fragment:Zie,project_vertex:Qie,dithering_fragment:ere,dithering_pars_fragment:tre,roughnessmap_fragment:nre,roughnessmap_pars_fragment:ire,shadowmap_pars_fragment:rre,shadowmap_pars_vertex:sre,shadowmap_vertex:ore,shadowmask_pars_fragment:are,skinbase_vertex:lre,skinning_pars_vertex:cre,skinning_vertex:ure,skinnormal_vertex:hre,specularmap_fragment:dre,specularmap_pars_fragment:fre,tonemapping_fragment:pre,tonemapping_pars_fragment:mre,transmission_fragment:gre,transmission_pars_fragment:vre,uv_pars_fragment:yre,uv_pars_vertex:_re,uv_vertex:xre,worldpos_vertex:Sre,background_vert:Mre,background_frag:Are,backgroundCube_vert:wre,backgroundCube_frag:Ere,cube_vert:Tre,cube_frag:bre,depth_vert:Cre,depth_frag:Rre,distanceRGBA_vert:Pre,distanceRGBA_frag:Ire,equirect_vert:Lre,equirect_frag:Dre,linedashed_vert:Bre,linedashed_frag:Nre,meshbasic_vert:Ure,meshbasic_frag:Fre,meshlambert_vert:Ore,meshlambert_frag:kre,meshmatcap_vert:zre,meshmatcap_frag:Gre,meshnormal_vert:Hre,meshnormal_frag:Vre,meshphong_vert:Wre,meshphong_frag:$re,meshphysical_vert:Xre,meshphysical_frag:jre,meshtoon_vert:Yre,meshtoon_frag:Jre,points_vert:Kre,points_frag:qre,shadow_vert:Zre,shadow_frag:Qre,sprite_vert:ese,sprite_frag:tse},ht={common:{diffuse:{value:new ct(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Zt},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Zt}},envmap:{envMap:{value:null},envMapRotation:{value:new Zt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Zt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Zt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Zt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Zt},normalScale:{value:new Fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Zt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Zt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Zt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Zt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ct(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 ct(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0},uvTransform:{value:new Zt}},sprite:{diffuse:{value:new ct(16777215)},opacity:{value:1},center:{value:new Fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Zt},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0}}},Oo={basic:{uniforms:zr([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.fog]),vertexShader:Jt.meshbasic_vert,fragmentShader:Jt.meshbasic_frag},lambert:{uniforms:zr([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new ct(0)}}]),vertexShader:Jt.meshlambert_vert,fragmentShader:Jt.meshlambert_frag},phong:{uniforms:zr([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new ct(0)},specular:{value:new ct(1118481)},shininess:{value:30}}]),vertexShader:Jt.meshphong_vert,fragmentShader:Jt.meshphong_frag},standard:{uniforms:zr([ht.common,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.roughnessmap,ht.metalnessmap,ht.fog,ht.lights,{emissive:{value:new ct(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag},toon:{uniforms:zr([ht.common,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.gradientmap,ht.fog,ht.lights,{emissive:{value:new ct(0)}}]),vertexShader:Jt.meshtoon_vert,fragmentShader:Jt.meshtoon_frag},matcap:{uniforms:zr([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,{matcap:{value:null}}]),vertexShader:Jt.meshmatcap_vert,fragmentShader:Jt.meshmatcap_frag},points:{uniforms:zr([ht.points,ht.fog]),vertexShader:Jt.points_vert,fragmentShader:Jt.points_frag},dashed:{uniforms:zr([ht.common,ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Jt.linedashed_vert,fragmentShader:Jt.linedashed_frag},depth:{uniforms:zr([ht.common,ht.displacementmap]),vertexShader:Jt.depth_vert,fragmentShader:Jt.depth_frag},normal:{uniforms:zr([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,{opacity:{value:1}}]),vertexShader:Jt.meshnormal_vert,fragmentShader:Jt.meshnormal_frag},sprite:{uniforms:zr([ht.sprite,ht.fog]),vertexShader:Jt.sprite_vert,fragmentShader:Jt.sprite_frag},background:{uniforms:{uvTransform:{value:new Zt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Jt.background_vert,fragmentShader:Jt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Zt}},vertexShader:Jt.backgroundCube_vert,fragmentShader:Jt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Jt.cube_vert,fragmentShader:Jt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Jt.equirect_vert,fragmentShader:Jt.equirect_frag},distanceRGBA:{uniforms:zr([ht.common,ht.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Jt.distanceRGBA_vert,fragmentShader:Jt.distanceRGBA_frag},shadow:{uniforms:zr([ht.lights,ht.fog,{color:{value:new ct(0)},opacity:{value:1}}]),vertexShader:Jt.shadow_vert,fragmentShader:Jt.shadow_frag}};Oo.physical={uniforms:zr([Oo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Zt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Zt},clearcoatNormalScale:{value:new Fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Zt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Zt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Zt},sheen:{value:0},sheenColor:{value:new ct(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Zt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Zt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Zt},transmissionSamplerSize:{value:new Fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Zt},attenuationDistance:{value:0},attenuationColor:{value:new ct(0)},specularColor:{value:new ct(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Zt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Zt},anisotropyVector:{value:new Fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Zt}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag};const Q_={r:0,b:0,g:0},Ou=new Gs,nse=new Rt;function ise(n,e,t,i,r,s,o){const a=new ct(0);let l=s===!0?0:1,c,u,h=null,d=0,f=null;function v(S){let x=S.isScene===!0?S.background:null;return x&&x.isTexture&&(x=(S.backgroundBlurriness>0?t:e).get(x)),x}function _(S){let x=!1;const M=v(S);M===null?m(a,l):M&&M.isColor&&(m(M,1),x=!0);const R=n.xr.getEnvironmentBlendMode();R==="additive"?i.buffers.color.setClear(0,0,0,1,o):R==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||x)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(S,x){const M=v(x);M&&(M.isCubeTexture||M.mapping===nm)?(u===void 0&&(u=new si(new Z0(1,1,1),new Oi({name:"BackgroundCubeMaterial",uniforms:zp(Oo.backgroundCube.uniforms),vertexShader:Oo.backgroundCube.vertexShader,fragmentShader:Oo.backgroundCube.fragmentShader,side:Fi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(R,T,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Ou.copy(x.backgroundRotation),Ou.x*=-1,Ou.y*=-1,Ou.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Ou.y*=-1,Ou.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(nse.makeRotationFromEuler(Ou)),u.material.toneMapped=Sn.getTransfer(M.colorSpace)!==On,(h!==M||d!==M.version||f!==n.toneMapping)&&(u.material.needsUpdate=!0,h=M,d=M.version,f=n.toneMapping),u.layers.enableAll(),S.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new si(new kA(2,2),new Oi({name:"BackgroundMaterial",uniforms:zp(Oo.background.uniforms),vertexShader:Oo.background.vertexShader,fragmentShader:Oo.background.fragmentShader,side:Yo,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=Sn.getTransfer(M.colorSpace)!==On,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(h!==M||d!==M.version||f!==n.toneMapping)&&(c.material.needsUpdate=!0,h=M,d=M.version,f=n.toneMapping),c.layers.enableAll(),S.unshift(c,c.geometry,c.material,0,0,null))}function m(S,x){S.getRGB(Q_,r8(n)),i.buffers.color.setClear(Q_.r,Q_.g,Q_.b,x,o)}return{getClearColor:function(){return a},setClearColor:function(S,x=1){a.set(S),l=x,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(S){l=S,m(a,l)},render:_,addToRenderList:y}}function rse(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=d(null);let s=r,o=!1;function a(w,N,G,V,$){let Z=!1;const X=h(V,G,N);s!==X&&(s=X,c(s.object)),Z=f(w,V,G,$),Z&&v(w,V,G,$),$!==null&&e.update($,n.ELEMENT_ARRAY_BUFFER),(Z||o)&&(o=!1,M(w,N,G,V),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return n.createVertexArray()}function c(w){return n.bindVertexArray(w)}function u(w){return n.deleteVertexArray(w)}function h(w,N,G){const V=G.wireframe===!0;let $=i[w.id];$===void 0&&($={},i[w.id]=$);let Z=$[N.id];Z===void 0&&(Z={},$[N.id]=Z);let X=Z[V];return X===void 0&&(X=d(l()),Z[V]=X),X}function d(w){const N=[],G=[],V=[];for(let $=0;$=0){const te=$[O];let le=Z[O];if(le===void 0&&(O==="instanceMatrix"&&w.instanceMatrix&&(le=w.instanceMatrix),O==="instanceColor"&&w.instanceColor&&(le=w.instanceColor)),te===void 0||te.attribute!==le||le&&te.data!==le.data)return!0;X++}return s.attributesNum!==X||s.index!==V}function v(w,N,G,V){const $={},Z=N.attributes;let X=0;const re=G.getAttributes();for(const O in re)if(re[O].location>=0){let te=Z[O];te===void 0&&(O==="instanceMatrix"&&w.instanceMatrix&&(te=w.instanceMatrix),O==="instanceColor"&&w.instanceColor&&(te=w.instanceColor));const le={};le.attribute=te,te&&te.data&&(le.data=te.data),$[O]=le,X++}s.attributes=$,s.attributesNum=X,s.index=V}function _(){const w=s.newAttributes;for(let N=0,G=w.length;N=0){let Q=$[re];if(Q===void 0&&(re==="instanceMatrix"&&w.instanceMatrix&&(Q=w.instanceMatrix),re==="instanceColor"&&w.instanceColor&&(Q=w.instanceColor)),Q!==void 0){const te=Q.normalized,le=Q.itemSize,we=e.get(Q);if(we===void 0)continue;const Ne=we.buffer,q=we.type,fe=we.bytesPerElement,Te=q===n.INT||q===n.UNSIGNED_INT||Q.gpuType===PA;if(Q.isInterleavedBufferAttribute){const Se=Q.data,$e=Se.stride,Qe=Q.offset;if(Se.isInstancedInterleavedBuffer){for(let je=0;je0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),m=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),S=n.getParameter(n.MAX_VARYING_VECTORS),x=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),M=f>0,R=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:f,maxTextureSize:v,maxCubemapSize:_,maxAttributes:y,maxVertexUniforms:m,maxVaryings:S,maxFragmentUniforms:x,vertexTextures:M,maxSamples:R}}function ase(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new dl,a=new Zt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d){const f=h.length!==0||d||i!==0||r;return r=d,i=h.length,f},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,d){t=u(h,d,0)},this.setState=function(h,d,f){const v=h.clippingPlanes,_=h.clipIntersection,y=h.clipShadows,m=n.get(h);if(!r||v===null||v.length===0||s&&!y)s?u(null):c();else{const S=s?0:i,x=S*4;let M=m.clippingState||null;l.value=M,M=u(v,d,x,f);for(let R=0;R!==x;++R)M[R]=t[R];m.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,d,f,v){const _=h!==null?h.length:0;let y=null;if(_!==0){if(y=l.value,v!==!0||y===null){const m=f+_*4,S=d.matrixWorldInverse;a.getNormalMatrix(S),(y===null||y.length0){const c=new NI(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}let po=class extends im{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};const tp=4,nF=[.125,.215,.35,.446,.526,.582],gh=20,KT=new po,iF=new ct;let qT=null,ZT=0,QT=0,eb=!1;const fh=(1+Math.sqrt(5))/2,nf=1/fh,rF=[new j(-fh,nf,0),new j(fh,nf,0),new j(-nf,0,fh),new j(nf,0,fh),new j(0,fh,-nf),new j(0,fh,nf),new j(-1,1,-1),new j(1,1,-1),new j(-1,1,1),new j(1,1,1)];let YR=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){qT=this._renderer.getRenderTarget(),ZT=this._renderer.getActiveCubeFace(),QT=this._renderer.getActiveMipmapLevel(),eb=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=aF(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=oF(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(r),_&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=d,u.autoClear=h,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Ul||e.mapping===Yc;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=aF()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=oF());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new si(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;ex(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,KT)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sgh&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${gh}`);const m=[];let S=0;for(let P=0;Px-tp?r-x+tp:0),T=4*(this._cubeSize-M);ex(t,R,T,3*M,2*M),l.setRenderTarget(t),l.render(h,KT)}};function cse(n){const e=[],t=[],i=[];let r=n;const s=n-tp+1+nF.length;for(let o=0;on-tp?l=nF[o-n+tp-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],f=6,v=6,_=3,y=2,m=1,S=new Float32Array(_*v*f),x=new Float32Array(y*v*f),M=new Float32Array(m*v*f);for(let T=0;T2?0:-1,b=[P,I,0,P+2/3,I,0,P+2/3,I+1,0,P,I,0,P+2/3,I+1,0,P,I+1,0];S.set(b,_*v*T),x.set(d,y*v*T);const w=[T,T,T,T,T,T];M.set(w,m*v*T)}const R=new Vt;R.setAttribute("position",new un(S,_)),R.setAttribute("uv",new un(x,y)),R.setAttribute("faceIndex",new un(M,m)),e.push(R),r>tp&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function sF(n,e,t){const i=new wi(n,e,t);return i.texture.mapping=nm,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function ex(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function use(n,e,t){const i=new Float32Array(gh),r=new j(0,1,0);return new Oi({name:"SphericalGaussianBlur",defines:{n:gh,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:UI(),fragmentShader:` +}`,Jt={alphahash_fragment:bne,alphahash_pars_fragment:Cne,alphamap_fragment:Rne,alphamap_pars_fragment:Pne,alphatest_fragment:Ine,alphatest_pars_fragment:Lne,aomap_fragment:Dne,aomap_pars_fragment:Bne,batching_pars_vertex:Nne,batching_vertex:Une,begin_vertex:Fne,beginnormal_vertex:One,bsdfs:kne,iridescence_fragment:zne,bumpmap_pars_fragment:Gne,clipping_planes_fragment:Hne,clipping_planes_pars_fragment:Vne,clipping_planes_pars_vertex:Wne,clipping_planes_vertex:$ne,color_fragment:Xne,color_pars_fragment:jne,color_pars_vertex:Yne,color_vertex:Jne,common:Kne,cube_uv_reflection_fragment:qne,defaultnormal_vertex:Zne,displacementmap_pars_vertex:Qne,displacementmap_vertex:eie,emissivemap_fragment:tie,emissivemap_pars_fragment:nie,colorspace_fragment:iie,colorspace_pars_fragment:rie,envmap_fragment:sie,envmap_common_pars_fragment:oie,envmap_pars_fragment:aie,envmap_pars_vertex:lie,envmap_physical_pars_fragment:_ie,envmap_vertex:cie,fog_vertex:uie,fog_pars_vertex:hie,fog_fragment:die,fog_pars_fragment:fie,gradientmap_pars_fragment:pie,lightmap_pars_fragment:mie,lights_lambert_fragment:gie,lights_lambert_pars_fragment:vie,lights_pars_begin:yie,lights_toon_fragment:xie,lights_toon_pars_fragment:Sie,lights_phong_fragment:Mie,lights_phong_pars_fragment:Aie,lights_physical_fragment:wie,lights_physical_pars_fragment:Eie,lights_fragment_begin:Tie,lights_fragment_maps:bie,lights_fragment_end:Cie,logdepthbuf_fragment:Rie,logdepthbuf_pars_fragment:Pie,logdepthbuf_pars_vertex:Iie,logdepthbuf_vertex:Lie,map_fragment:Die,map_pars_fragment:Bie,map_particle_fragment:Nie,map_particle_pars_fragment:Uie,metalnessmap_fragment:Fie,metalnessmap_pars_fragment:Oie,morphinstance_vertex:kie,morphcolor_vertex:zie,morphnormal_vertex:Gie,morphtarget_pars_vertex:Hie,morphtarget_vertex:Vie,normal_fragment_begin:Wie,normal_fragment_maps:$ie,normal_pars_fragment:Xie,normal_pars_vertex:jie,normal_vertex:Yie,normalmap_pars_fragment:Jie,clearcoat_normal_fragment_begin:Kie,clearcoat_normal_fragment_maps:qie,clearcoat_pars_fragment:Zie,iridescence_pars_fragment:Qie,opaque_fragment:ere,packing:tre,premultiplied_alpha_fragment:nre,project_vertex:ire,dithering_fragment:rre,dithering_pars_fragment:sre,roughnessmap_fragment:ore,roughnessmap_pars_fragment:are,shadowmap_pars_fragment:lre,shadowmap_pars_vertex:cre,shadowmap_vertex:ure,shadowmask_pars_fragment:hre,skinbase_vertex:dre,skinning_pars_vertex:fre,skinning_vertex:pre,skinnormal_vertex:mre,specularmap_fragment:gre,specularmap_pars_fragment:vre,tonemapping_fragment:yre,tonemapping_pars_fragment:_re,transmission_fragment:xre,transmission_pars_fragment:Sre,uv_pars_fragment:Mre,uv_pars_vertex:Are,uv_vertex:wre,worldpos_vertex:Ere,background_vert:Tre,background_frag:bre,backgroundCube_vert:Cre,backgroundCube_frag:Rre,cube_vert:Pre,cube_frag:Ire,depth_vert:Lre,depth_frag:Dre,distanceRGBA_vert:Bre,distanceRGBA_frag:Nre,equirect_vert:Ure,equirect_frag:Fre,linedashed_vert:Ore,linedashed_frag:kre,meshbasic_vert:zre,meshbasic_frag:Gre,meshlambert_vert:Hre,meshlambert_frag:Vre,meshmatcap_vert:Wre,meshmatcap_frag:$re,meshnormal_vert:Xre,meshnormal_frag:jre,meshphong_vert:Yre,meshphong_frag:Jre,meshphysical_vert:Kre,meshphysical_frag:qre,meshtoon_vert:Zre,meshtoon_frag:Qre,points_vert:ese,points_frag:tse,shadow_vert:nse,shadow_frag:ise,sprite_vert:rse,sprite_frag:sse},ht={common:{diffuse:{value:new ct(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Zt},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Zt}},envmap:{envMap:{value:null},envMapRotation:{value:new Zt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Zt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Zt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Zt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Zt},normalScale:{value:new Fe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Zt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Zt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Zt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Zt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ct(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 ct(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0},uvTransform:{value:new Zt}},sprite:{diffuse:{value:new ct(16777215)},opacity:{value:1},center:{value:new Fe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Zt},alphaMap:{value:null},alphaMapTransform:{value:new Zt},alphaTest:{value:0}}},Oo={basic:{uniforms:zr([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.fog]),vertexShader:Jt.meshbasic_vert,fragmentShader:Jt.meshbasic_frag},lambert:{uniforms:zr([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new ct(0)}}]),vertexShader:Jt.meshlambert_vert,fragmentShader:Jt.meshlambert_frag},phong:{uniforms:zr([ht.common,ht.specularmap,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,ht.lights,{emissive:{value:new ct(0)},specular:{value:new ct(1118481)},shininess:{value:30}}]),vertexShader:Jt.meshphong_vert,fragmentShader:Jt.meshphong_frag},standard:{uniforms:zr([ht.common,ht.envmap,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.roughnessmap,ht.metalnessmap,ht.fog,ht.lights,{emissive:{value:new ct(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag},toon:{uniforms:zr([ht.common,ht.aomap,ht.lightmap,ht.emissivemap,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.gradientmap,ht.fog,ht.lights,{emissive:{value:new ct(0)}}]),vertexShader:Jt.meshtoon_vert,fragmentShader:Jt.meshtoon_frag},matcap:{uniforms:zr([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,ht.fog,{matcap:{value:null}}]),vertexShader:Jt.meshmatcap_vert,fragmentShader:Jt.meshmatcap_frag},points:{uniforms:zr([ht.points,ht.fog]),vertexShader:Jt.points_vert,fragmentShader:Jt.points_frag},dashed:{uniforms:zr([ht.common,ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Jt.linedashed_vert,fragmentShader:Jt.linedashed_frag},depth:{uniforms:zr([ht.common,ht.displacementmap]),vertexShader:Jt.depth_vert,fragmentShader:Jt.depth_frag},normal:{uniforms:zr([ht.common,ht.bumpmap,ht.normalmap,ht.displacementmap,{opacity:{value:1}}]),vertexShader:Jt.meshnormal_vert,fragmentShader:Jt.meshnormal_frag},sprite:{uniforms:zr([ht.sprite,ht.fog]),vertexShader:Jt.sprite_vert,fragmentShader:Jt.sprite_frag},background:{uniforms:{uvTransform:{value:new Zt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Jt.background_vert,fragmentShader:Jt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Zt}},vertexShader:Jt.backgroundCube_vert,fragmentShader:Jt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Jt.cube_vert,fragmentShader:Jt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Jt.equirect_vert,fragmentShader:Jt.equirect_frag},distanceRGBA:{uniforms:zr([ht.common,ht.displacementmap,{referencePosition:{value:new j},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Jt.distanceRGBA_vert,fragmentShader:Jt.distanceRGBA_frag},shadow:{uniforms:zr([ht.lights,ht.fog,{color:{value:new ct(0)},opacity:{value:1}}]),vertexShader:Jt.shadow_vert,fragmentShader:Jt.shadow_frag}};Oo.physical={uniforms:zr([Oo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Zt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Zt},clearcoatNormalScale:{value:new Fe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Zt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Zt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Zt},sheen:{value:0},sheenColor:{value:new ct(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Zt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Zt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Zt},transmissionSamplerSize:{value:new Fe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Zt},attenuationDistance:{value:0},attenuationColor:{value:new ct(0)},specularColor:{value:new ct(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Zt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Zt},anisotropyVector:{value:new Fe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Zt}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag};const Z_={r:0,b:0,g:0},Ou=new Gs,ose=new Rt;function ase(n,e,t,i,r,s,o){const a=new ct(0);let l=s===!0?0:1,c,u,h=null,d=0,f=null;function v(S){let x=S.isScene===!0?S.background:null;return x&&x.isTexture&&(x=(S.backgroundBlurriness>0?t:e).get(x)),x}function _(S){let x=!1;const M=v(S);M===null?m(a,l):M&&M.isColor&&(m(M,1),x=!0);const R=n.xr.getEnvironmentBlendMode();R==="additive"?i.buffers.color.setClear(0,0,0,1,o):R==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||x)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(S,x){const M=v(x);M&&(M.isCubeTexture||M.mapping===im)?(u===void 0&&(u=new si(new q0(1,1,1),new Oi({name:"BackgroundCubeMaterial",uniforms:Gp(Oo.backgroundCube.uniforms),vertexShader:Oo.backgroundCube.vertexShader,fragmentShader:Oo.backgroundCube.fragmentShader,side:Fi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(R,T,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Ou.copy(x.backgroundRotation),Ou.x*=-1,Ou.y*=-1,Ou.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Ou.y*=-1,Ou.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(ose.makeRotationFromEuler(Ou)),u.material.toneMapped=Sn.getTransfer(M.colorSpace)!==On,(h!==M||d!==M.version||f!==n.toneMapping)&&(u.material.needsUpdate=!0,h=M,d=M.version,f=n.toneMapping),u.layers.enableAll(),S.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new si(new FA(2,2),new Oi({name:"BackgroundMaterial",uniforms:Gp(Oo.background.uniforms),vertexShader:Oo.background.vertexShader,fragmentShader:Oo.background.fragmentShader,side:Yo,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=Sn.getTransfer(M.colorSpace)!==On,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(h!==M||d!==M.version||f!==n.toneMapping)&&(c.material.needsUpdate=!0,h=M,d=M.version,f=n.toneMapping),c.layers.enableAll(),S.unshift(c,c.geometry,c.material,0,0,null))}function m(S,x){S.getRGB(Z_,l8(n)),i.buffers.color.setClear(Z_.r,Z_.g,Z_.b,x,o)}return{getClearColor:function(){return a},setClearColor:function(S,x=1){a.set(S),l=x,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(S){l=S,m(a,l)},render:_,addToRenderList:y}}function lse(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=d(null);let s=r,o=!1;function a(w,N,G,V,$){let Z=!1;const X=h(V,G,N);s!==X&&(s=X,c(s.object)),Z=f(w,V,G,$),Z&&v(w,V,G,$),$!==null&&e.update($,n.ELEMENT_ARRAY_BUFFER),(Z||o)&&(o=!1,M(w,N,G,V),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return n.createVertexArray()}function c(w){return n.bindVertexArray(w)}function u(w){return n.deleteVertexArray(w)}function h(w,N,G){const V=G.wireframe===!0;let $=i[w.id];$===void 0&&($={},i[w.id]=$);let Z=$[N.id];Z===void 0&&(Z={},$[N.id]=Z);let X=Z[V];return X===void 0&&(X=d(l()),Z[V]=X),X}function d(w){const N=[],G=[],V=[];for(let $=0;$=0){const te=$[O];let le=Z[O];if(le===void 0&&(O==="instanceMatrix"&&w.instanceMatrix&&(le=w.instanceMatrix),O==="instanceColor"&&w.instanceColor&&(le=w.instanceColor)),te===void 0||te.attribute!==le||le&&te.data!==le.data)return!0;X++}return s.attributesNum!==X||s.index!==V}function v(w,N,G,V){const $={},Z=N.attributes;let X=0;const re=G.getAttributes();for(const O in re)if(re[O].location>=0){let te=Z[O];te===void 0&&(O==="instanceMatrix"&&w.instanceMatrix&&(te=w.instanceMatrix),O==="instanceColor"&&w.instanceColor&&(te=w.instanceColor));const le={};le.attribute=te,te&&te.data&&(le.data=te.data),$[O]=le,X++}s.attributes=$,s.attributesNum=X,s.index=V}function _(){const w=s.newAttributes;for(let N=0,G=w.length;N=0){let Q=$[re];if(Q===void 0&&(re==="instanceMatrix"&&w.instanceMatrix&&(Q=w.instanceMatrix),re==="instanceColor"&&w.instanceColor&&(Q=w.instanceColor)),Q!==void 0){const te=Q.normalized,le=Q.itemSize,we=e.get(Q);if(we===void 0)continue;const Ne=we.buffer,q=we.type,fe=we.bytesPerElement,Te=q===n.INT||q===n.UNSIGNED_INT||Q.gpuType===CA;if(Q.isInterleavedBufferAttribute){const Se=Q.data,$e=Se.stride,Qe=Q.offset;if(Se.isInstancedInterleavedBuffer){for(let je=0;je0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),m=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),S=n.getParameter(n.MAX_VARYING_VECTORS),x=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),M=f>0,R=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:f,maxTextureSize:v,maxCubemapSize:_,maxAttributes:y,maxVertexUniforms:m,maxVaryings:S,maxFragmentUniforms:x,vertexTextures:M,maxSamples:R}}function hse(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new dl,a=new Zt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d){const f=h.length!==0||d||i!==0||r;return r=d,i=h.length,f},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,d){t=u(h,d,0)},this.setState=function(h,d,f){const v=h.clippingPlanes,_=h.clipIntersection,y=h.clipShadows,m=n.get(h);if(!r||v===null||v.length===0||s&&!y)s?u(null):c();else{const S=s?0:i,x=S*4;let M=m.clippingState||null;l.value=M,M=u(v,d,x,f);for(let R=0;R!==x;++R)M[R]=t[R];m.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,d,f,v){const _=h!==null?h.length:0;let y=null;if(_!==0){if(y=l.value,v!==!0||y===null){const m=f+_*4,S=d.matrixWorldInverse;a.getNormalMatrix(S),(y===null||y.length0){const c=new OI(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}let po=class extends rm{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};const tp=4,sF=[.125,.215,.35,.446,.526,.582],gh=20,YT=new po,oF=new ct;let JT=null,KT=0,qT=0,ZT=!1;const fh=(1+Math.sqrt(5))/2,nf=1/fh,aF=[new j(-fh,nf,0),new j(fh,nf,0),new j(-nf,0,fh),new j(nf,0,fh),new j(0,fh,-nf),new j(0,fh,nf),new j(-1,1,-1),new j(1,1,-1),new j(-1,1,1),new j(1,1,1)];let jR=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){JT=this._renderer.getRenderTarget(),KT=this._renderer.getActiveCubeFace(),qT=this._renderer.getActiveMipmapLevel(),ZT=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=uF(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=cF(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(r),_&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=d,u.autoClear=h,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Nl||e.mapping===Yc;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=uF()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=cF());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new si(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Q_(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,YT)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sgh&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${gh}`);const m=[];let S=0;for(let P=0;Px-tp?r-x+tp:0),T=4*(this._cubeSize-M);Q_(t,R,T,3*M,2*M),l.setRenderTarget(t),l.render(h,YT)}};function fse(n){const e=[],t=[],i=[];let r=n;const s=n-tp+1+sF.length;for(let o=0;on-tp?l=sF[o-n+tp-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],f=6,v=6,_=3,y=2,m=1,S=new Float32Array(_*v*f),x=new Float32Array(y*v*f),M=new Float32Array(m*v*f);for(let T=0;T2?0:-1,b=[P,I,0,P+2/3,I,0,P+2/3,I+1,0,P,I,0,P+2/3,I+1,0,P,I+1,0];S.set(b,_*v*T),x.set(d,y*v*T);const w=[T,T,T,T,T,T];M.set(w,m*v*T)}const R=new Vt;R.setAttribute("position",new un(S,_)),R.setAttribute("uv",new un(x,y)),R.setAttribute("faceIndex",new un(M,m)),e.push(R),r>tp&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function lF(n,e,t){const i=new wi(n,e,t);return i.texture.mapping=im,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Q_(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function pse(n,e,t){const i=new Float32Array(gh),r=new j(0,1,0);return new Oi({name:"SphericalGaussianBlur",defines:{n:gh,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:kI(),fragmentShader:` precision mediump float; precision mediump int; @@ -3708,7 +3708,7 @@ void main() { } } - `,blending:br,depthTest:!1,depthWrite:!1})}function oF(){return new Oi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:UI(),fragmentShader:` + `,blending:br,depthTest:!1,depthWrite:!1})}function cF(){return new Oi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:kI(),fragmentShader:` precision mediump float; precision mediump int; @@ -3727,7 +3727,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:br,depthTest:!1,depthWrite:!1})}function aF(){return new Oi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:UI(),fragmentShader:` + `,blending:br,depthTest:!1,depthWrite:!1})}function uF(){return new Oi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:kI(),fragmentShader:` precision mediump float; precision mediump int; @@ -3743,7 +3743,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:br,depthTest:!1,depthWrite:!1})}function UI(){return` + `,blending:br,depthTest:!1,depthWrite:!1})}function kI(){return` precision mediump float; precision mediump int; @@ -3798,16 +3798,16 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function hse(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Hv||l===Vv,u=l===Ul||l===Yc;if(c||u){let h=e.get(a);const d=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return t===null&&(t=new YR(n)),h=c?t.fromEquirectangular(a,h):t.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),h.texture;if(h!==void 0)return h.texture;{const f=a.image;return c&&f&&f.height>0||u&&f&&r(f)?(t===null&&(t=new YR(n)),h=c?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(R=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const T=new Float32Array(M*R*4*h),P=new OA(T,M,R,h);P.type=Yr,P.needsUpdate=!0;const I=x*4;for(let w=0;w0)return n;const r=e*t;let s=cF[r];if(s===void 0&&(s=new Float32Array(r),cF[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function ki(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||u&&f&&r(f)?(t===null&&(t=new jR(n)),h=c?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(R=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const T=new Float32Array(M*R*4*h),P=new UA(T,M,R,h);P.type=Yr,P.needsUpdate=!0;const I=x*4;for(let w=0;w0)return n;const r=e*t;let s=dF[r];if(s===void 0&&(s=new Float32Array(r),dF[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function ki(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}function hoe(n){const e=Sn.getPrimaries(Sn.workingColorSpace),t=Sn.getPrimaries(n);let i;switch(e===t?i="":e===jv&&t===Xv?i="LinearDisplayP3ToLinearSRGB":e===Xv&&t===jv&&(i="LinearSRGBToLinearDisplayP3"),n){case Zo:case q0:return[i,"LinearTransferOETF"];case Bn:case FA:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function gF(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` +`)}function moe(n){const e=Sn.getPrimaries(Sn.workingColorSpace),t=Sn.getPrimaries(n);let i;switch(e===t?i="":e===jv&&t===Xv?i="LinearDisplayP3ToLinearSRGB":e===Xv&&t===jv&&(i="LinearSRGBToLinearDisplayP3"),n){case Zo:case K0:return[i,"LinearTransferOETF"];case Dn:case NA:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function _F(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+r+` -`+uoe(n.getShaderSource(e),o)}else return r}function doe(n,e){const t=hoe(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function foe(n,e){let t;switch(e){case T5:t="Linear";break;case b5:t="Reinhard";break;case C5:t="Cineon";break;case gI:t="ACESFilmic";break;case P5:t="AgX";break;case I5:t="Neutral";break;case R5:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const tx=new j;function poe(){Sn.getLuminanceCoefficients(tx);const n=tx.x.toFixed(4),e=tx.y.toFixed(4),t=tx.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` -`)}function moe(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ug).join(` -`)}function goe(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function voe(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function JR(n){return n.replace(yoe,xoe)}const _oe=new Map;function xoe(n,e){let t=Jt[e];if(t===void 0){const i=_oe.get(e);if(i!==void 0)t=Jt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return JR(t)}const Soe=/#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 _F(n){return n.replace(Soe,Moe)}function Moe(n,e,t,i){let r="";for(let s=parseInt(e);s/gm;function YR(n){return n.replace(Moe,woe)}const Aoe=new Map;function woe(n,e){let t=Jt[e];if(t===void 0){const i=Aoe.get(e);if(i!==void 0)t=Jt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return YR(t)}const Eoe=/#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 MF(n){return n.replace(Eoe,Toe)}function Toe(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(y+=` -`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Ug).join(` +`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Fg).join(` `),m.length>0&&(m+=` -`)):(y=[xF(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.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"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(Ug).join(` -`),m=[xF(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==$o?"#define TONE_MAPPING":"",t.toneMapping!==$o?Jt.tonemapping_pars_fragment:"",t.toneMapping!==$o?foe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Jt.colorspace_pars_fragment,doe("linearToOutputTexel",t.outputColorSpace),poe(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(Ug).join(` -`)),o=JR(o),o=vF(o,t),o=yF(o,t),a=JR(a),a=vF(a,t),a=yF(a,t),o=_F(o),a=_F(a),t.isRawShaderMaterial!==!0&&(S=`#version 300 es +`)):(y=[AF(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.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"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Fg).join(` +`),m=[AF(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==$o?"#define TONE_MAPPING":"",t.toneMapping!==$o?Jt.tonemapping_pars_fragment:"",t.toneMapping!==$o?voe("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Jt.colorspace_pars_fragment,goe("linearToOutputTexel",t.outputColorSpace),yoe(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Fg).join(` +`)),o=YR(o),o=xF(o,t),o=SF(o,t),a=YR(a),a=xF(a,t),a=SF(a,t),o=MF(o),a=MF(a),t.isRawShaderMaterial!==!0&&(S=`#version 300 es `,y=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+y,m=["#define varying in",t.glslVersion===XR?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===XR?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+y,m=["#define varying in",t.glslVersion===$R?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===$R?"":"#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(` `)+` -`+m);const x=S+y+o,M=S+m+a,R=mF(r,r.VERTEX_SHADER,x),T=mF(r,r.FRAGMENT_SHADER,M);r.attachShader(_,R),r.attachShader(_,T),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function P(N){if(n.debug.checkShaderErrors){const G=r.getProgramInfoLog(_).trim(),V=r.getShaderInfoLog(R).trim(),$=r.getShaderInfoLog(T).trim();let Z=!0,X=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(Z=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,R,T);else{const re=gF(r,R,"vertex"),O=gF(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` +`+m);const x=S+y+o,M=S+m+a,R=yF(r,r.VERTEX_SHADER,x),T=yF(r,r.FRAGMENT_SHADER,M);r.attachShader(_,R),r.attachShader(_,T),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function P(N){if(n.debug.checkShaderErrors){const G=r.getProgramInfoLog(_).trim(),V=r.getShaderInfoLog(R).trim(),$=r.getShaderInfoLog(T).trim();let Z=!0,X=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(Z=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,R,T);else{const re=_F(r,R,"vertex"),O=_F(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` Material Name: `+N.name+` Material Type: `+N.type+` Program Info Log: `+G+` `+re+` -`+O)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(V===""||$==="")&&(X=!1);X&&(N.diagnostics={runnable:Z,programLog:G,vertexShader:{log:V,prefix:y},fragmentShader:{log:$,prefix:m}})}r.deleteShader(R),r.deleteShader(T),I=new j1(r,_),b=voe(r,_)}let I;this.getUniforms=function(){return I===void 0&&P(this),I};let b;this.getAttributes=function(){return b===void 0&&P(this),b};let w=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=r.getProgramParameter(_,loe)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=coe++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=R,this.fragmentShader=T,this}let Roe=0,Poe=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Ioe(e),t.set(e,i)),i}},Ioe=class{constructor(e){this.id=Roe++,this.code=e,this.usedTimes=0}};function Loe(n,e,t,i,r,s,o){const a=new Vh,l=new Poe,c=new Set,u=[],h=r.logarithmicDepthBuffer,d=r.vertexTextures;let f=r.precision;const v={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 _(b){return c.add(b),b===0?"uv":`uv${b}`}function y(b,w,N,G,V){const $=G.fog,Z=V.geometry,X=b.isMeshStandardMaterial?G.environment:null,re=(b.isMeshStandardMaterial?t:e).get(b.envMap||X),O=re&&re.mapping===nm?re.image.height:null,Q=v[b.type];b.precision!==null&&(f=r.getMaxPrecision(b.precision),f!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const te=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,le=te!==void 0?te.length:0;let we=0;Z.morphAttributes.position!==void 0&&(we=1),Z.morphAttributes.normal!==void 0&&(we=2),Z.morphAttributes.color!==void 0&&(we=3);let Ne,q,fe,Te;if(Q){const vt=Oo[Q];Ne=vt.vertexShader,q=vt.fragmentShader}else Ne=b.vertexShader,q=b.fragmentShader,l.update(b),fe=l.getVertexShaderID(b),Te=l.getFragmentShaderID(b);const Se=n.getRenderTarget(),$e=V.isInstancedMesh===!0,Qe=V.isBatchedMesh===!0,je=!!b.map,Ke=!!b.matcap,B=!!re,me=!!b.aoMap,ge=!!b.lightMap,Re=!!b.bumpMap,ae=!!b.normalMap,Xe=!!b.displacementMap,Ce=!!b.emissiveMap,De=!!b.metalnessMap,U=!!b.roughnessMap,C=b.anisotropy>0,Y=b.clearcoat>0,ue=b.dispersion>0,ce=b.iridescence>0,de=b.sheen>0,Ye=b.transmission>0,Ae=C&&!!b.anisotropyMap,Ue=Y&&!!b.clearcoatMap,st=Y&&!!b.clearcoatNormalMap,_e=Y&&!!b.clearcoatRoughnessMap,Ie=ce&&!!b.iridescenceMap,pt=ce&&!!b.iridescenceThicknessMap,nt=de&&!!b.sheenColorMap,ke=de&&!!b.sheenRoughnessMap,ie=!!b.specularMap,be=!!b.specularColorMap,et=!!b.specularIntensityMap,z=Ye&&!!b.transmissionMap,ve=Ye&&!!b.thicknessMap,oe=!!b.gradientMap,he=!!b.alphaMap,Ee=b.alphaTest>0,Ze=!!b.alphaHash,lt=!!b.extensions;let Ct=$o;b.toneMapped&&(Se===null||Se.isXRRenderTarget===!0)&&(Ct=n.toneMapping);const zt={shaderID:Q,shaderType:b.type,shaderName:b.name,vertexShader:Ne,fragmentShader:q,defines:b.defines,customVertexShaderID:fe,customFragmentShaderID:Te,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:Qe,batchingColor:Qe&&V._colorsTexture!==null,instancing:$e,instancingColor:$e&&V.instanceColor!==null,instancingMorph:$e&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:Se===null?n.outputColorSpace:Se.isXRRenderTarget===!0?Se.texture.colorSpace:Zo,alphaToCoverage:!!b.alphaToCoverage,map:je,matcap:Ke,envMap:B,envMapMode:B&&re.mapping,envMapCubeUVHeight:O,aoMap:me,lightMap:ge,bumpMap:Re,normalMap:ae,displacementMap:d&&Xe,emissiveMap:Ce,normalMapObjectSpace:ae&&b.normalMapType===O5,normalMapTangentSpace:ae&&b.normalMapType===du,metalnessMap:De,roughnessMap:U,anisotropy:C,anisotropyMap:Ae,clearcoat:Y,clearcoatMap:Ue,clearcoatNormalMap:st,clearcoatRoughnessMap:_e,dispersion:ue,iridescence:ce,iridescenceMap:Ie,iridescenceThicknessMap:pt,sheen:de,sheenColorMap:nt,sheenRoughnessMap:ke,specularMap:ie,specularColorMap:be,specularIntensityMap:et,transmission:Ye,transmissionMap:z,thicknessMap:ve,gradientMap:oe,opaque:b.transparent===!1&&b.blending===kh&&b.alphaToCoverage===!1,alphaMap:he,alphaTest:Ee,alphaHash:Ze,combine:b.combine,mapUv:je&&_(b.map.channel),aoMapUv:me&&_(b.aoMap.channel),lightMapUv:ge&&_(b.lightMap.channel),bumpMapUv:Re&&_(b.bumpMap.channel),normalMapUv:ae&&_(b.normalMap.channel),displacementMapUv:Xe&&_(b.displacementMap.channel),emissiveMapUv:Ce&&_(b.emissiveMap.channel),metalnessMapUv:De&&_(b.metalnessMap.channel),roughnessMapUv:U&&_(b.roughnessMap.channel),anisotropyMapUv:Ae&&_(b.anisotropyMap.channel),clearcoatMapUv:Ue&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:st&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_e&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ie&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:pt&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:ke&&_(b.sheenRoughnessMap.channel),specularMapUv:ie&&_(b.specularMap.channel),specularColorMapUv:be&&_(b.specularColorMap.channel),specularIntensityMapUv:et&&_(b.specularIntensityMap.channel),transmissionMapUv:z&&_(b.transmissionMap.channel),thicknessMapUv:ve&&_(b.thicknessMap.channel),alphaMapUv:he&&_(b.alphaMap.channel),vertexTangents:!!Z.attributes.tangent&&(ae||C),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!Z.attributes.uv&&(je||he),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:V.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:we,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&N.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ct,decodeVideoTexture:je&&b.map.isVideoTexture===!0&&Sn.getTransfer(b.map.colorSpace)===On,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Sr,flipSided:b.side===Fi,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:lt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(lt&&b.extensions.multiDraw===!0||Qe)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return zt.vertexUv1s=c.has(1),zt.vertexUv2s=c.has(2),zt.vertexUv3s=c.has(3),c.clear(),zt}function m(b){const w=[];if(b.shaderID?w.push(b.shaderID):(w.push(b.customVertexShaderID),w.push(b.customFragmentShaderID)),b.defines!==void 0)for(const N in b.defines)w.push(N),w.push(b.defines[N]);return b.isRawShaderMaterial===!1&&(S(w,b),x(w,b),w.push(n.outputColorSpace)),w.push(b.customProgramCacheKey),w.join()}function S(b,w){b.push(w.precision),b.push(w.outputColorSpace),b.push(w.envMapMode),b.push(w.envMapCubeUVHeight),b.push(w.mapUv),b.push(w.alphaMapUv),b.push(w.lightMapUv),b.push(w.aoMapUv),b.push(w.bumpMapUv),b.push(w.normalMapUv),b.push(w.displacementMapUv),b.push(w.emissiveMapUv),b.push(w.metalnessMapUv),b.push(w.roughnessMapUv),b.push(w.anisotropyMapUv),b.push(w.clearcoatMapUv),b.push(w.clearcoatNormalMapUv),b.push(w.clearcoatRoughnessMapUv),b.push(w.iridescenceMapUv),b.push(w.iridescenceThicknessMapUv),b.push(w.sheenColorMapUv),b.push(w.sheenRoughnessMapUv),b.push(w.specularMapUv),b.push(w.specularColorMapUv),b.push(w.specularIntensityMapUv),b.push(w.transmissionMapUv),b.push(w.thicknessMapUv),b.push(w.combine),b.push(w.fogExp2),b.push(w.sizeAttenuation),b.push(w.morphTargetsCount),b.push(w.morphAttributeCount),b.push(w.numDirLights),b.push(w.numPointLights),b.push(w.numSpotLights),b.push(w.numSpotLightMaps),b.push(w.numHemiLights),b.push(w.numRectAreaLights),b.push(w.numDirLightShadows),b.push(w.numPointLightShadows),b.push(w.numSpotLightShadows),b.push(w.numSpotLightShadowsWithMaps),b.push(w.numLightProbes),b.push(w.shadowMapType),b.push(w.toneMapping),b.push(w.numClippingPlanes),b.push(w.numClipIntersection),b.push(w.depthPacking)}function x(b,w){a.disableAll(),w.supportsVertexTextures&&a.enable(0),w.instancing&&a.enable(1),w.instancingColor&&a.enable(2),w.instancingMorph&&a.enable(3),w.matcap&&a.enable(4),w.envMap&&a.enable(5),w.normalMapObjectSpace&&a.enable(6),w.normalMapTangentSpace&&a.enable(7),w.clearcoat&&a.enable(8),w.iridescence&&a.enable(9),w.alphaTest&&a.enable(10),w.vertexColors&&a.enable(11),w.vertexAlphas&&a.enable(12),w.vertexUv1s&&a.enable(13),w.vertexUv2s&&a.enable(14),w.vertexUv3s&&a.enable(15),w.vertexTangents&&a.enable(16),w.anisotropy&&a.enable(17),w.alphaHash&&a.enable(18),w.batching&&a.enable(19),w.dispersion&&a.enable(20),w.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.skinning&&a.enable(4),w.morphTargets&&a.enable(5),w.morphNormals&&a.enable(6),w.morphColors&&a.enable(7),w.premultipliedAlpha&&a.enable(8),w.shadowMapEnabled&&a.enable(9),w.doubleSided&&a.enable(10),w.flipSided&&a.enable(11),w.useDepthPacking&&a.enable(12),w.dithering&&a.enable(13),w.transmission&&a.enable(14),w.sheen&&a.enable(15),w.opaque&&a.enable(16),w.pointsUvs&&a.enable(17),w.decodeVideoTexture&&a.enable(18),w.alphaToCoverage&&a.enable(19),b.push(a.mask)}function M(b){const w=v[b.type];let N;if(w){const G=Oo[w];N=s8.clone(G.uniforms)}else N=b.uniforms;return N}function R(b,w){let N;for(let G=0,V=u.length;G0?i.push(m):f.transparent===!0?r.push(m):t.push(m)}function l(h,d,f,v,_,y){const m=o(h,d,f,v,_,y);f.transmission>0?i.unshift(m):f.transparent===!0?r.unshift(m):t.unshift(m)}function c(h,d){t.length>1&&t.sort(h||Boe),i.length>1&&i.sort(d||SF),r.length>1&&r.sort(d||SF)}function u(){for(let h=e,d=n.length;h=s.length?(o=new MF,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Uoe(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new j,color:new ct};break;case"SpotLight":t={position:new j,direction:new j,color:new ct,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new j,color:new ct,distance:0,decay:0};break;case"HemisphereLight":t={direction:new j,skyColor:new ct,groundColor:new ct};break;case"RectAreaLight":t={color:new ct,position:new j,halfWidth:new j,halfHeight:new j};break}return n[e.id]=t,t}}}function Foe(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Ooe=0;function koe(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function zoe(n){const e=new Uoe,t=Foe(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new j);const r=new j,s=new Rt,o=new Rt;function a(c){let u=0,h=0,d=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let f=0,v=0,_=0,y=0,m=0,S=0,x=0,M=0,R=0,T=0,P=0;c.sort(koe);for(let b=0,w=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=ht.LTC_FLOAT_1,i.rectAreaLTC2=ht.LTC_FLOAT_2):(i.rectAreaLTC1=ht.LTC_HALF_1,i.rectAreaLTC2=ht.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=d;const I=i.hash;(I.directionalLength!==f||I.pointLength!==v||I.spotLength!==_||I.rectAreaLength!==y||I.hemiLength!==m||I.numDirectionalShadows!==S||I.numPointShadows!==x||I.numSpotShadows!==M||I.numSpotMaps!==R||I.numLightProbes!==P)&&(i.directional.length=f,i.spot.length=_,i.rectArea.length=y,i.point.length=v,i.hemi.length=m,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=M+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=P,I.directionalLength=f,I.pointLength=v,I.spotLength=_,I.rectAreaLength=y,I.hemiLength=m,I.numDirectionalShadows=S,I.numPointShadows=x,I.numSpotShadows=M,I.numSpotMaps=R,I.numLightProbes=P,i.version=Ooe++)}function l(c,u){let h=0,d=0,f=0,v=0,_=0;const y=u.matrixWorldInverse;for(let m=0,S=c.length;m=o.length?(a=new AF(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}let FI=class extends mi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=hu,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}},OI=class extends mi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};const Hoe=`void main() { +`+O)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(V===""||$==="")&&(X=!1);X&&(N.diagnostics={runnable:Z,programLog:G,vertexShader:{log:V,prefix:y},fragmentShader:{log:$,prefix:m}})}r.deleteShader(R),r.deleteShader(T),I=new X1(r,_),b=Soe(r,_)}let I;this.getUniforms=function(){return I===void 0&&P(this),I};let b;this.getAttributes=function(){return b===void 0&&P(this),b};let w=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=r.getProgramParameter(_,doe)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=foe++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=R,this.fragmentShader=T,this}let Doe=0,Boe=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Noe(e),t.set(e,i)),i}},Noe=class{constructor(e){this.id=Doe++,this.code=e,this.usedTimes=0}};function Uoe(n,e,t,i,r,s,o){const a=new Vh,l=new Boe,c=new Set,u=[],h=r.logarithmicDepthBuffer,d=r.vertexTextures;let f=r.precision;const v={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 _(b){return c.add(b),b===0?"uv":`uv${b}`}function y(b,w,N,G,V){const $=G.fog,Z=V.geometry,X=b.isMeshStandardMaterial?G.environment:null,re=(b.isMeshStandardMaterial?t:e).get(b.envMap||X),O=re&&re.mapping===im?re.image.height:null,Q=v[b.type];b.precision!==null&&(f=r.getMaxPrecision(b.precision),f!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const te=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,le=te!==void 0?te.length:0;let we=0;Z.morphAttributes.position!==void 0&&(we=1),Z.morphAttributes.normal!==void 0&&(we=2),Z.morphAttributes.color!==void 0&&(we=3);let Ne,q,fe,Te;if(Q){const vt=Oo[Q];Ne=vt.vertexShader,q=vt.fragmentShader}else Ne=b.vertexShader,q=b.fragmentShader,l.update(b),fe=l.getVertexShaderID(b),Te=l.getFragmentShaderID(b);const Se=n.getRenderTarget(),$e=V.isInstancedMesh===!0,Qe=V.isBatchedMesh===!0,je=!!b.map,Ke=!!b.matcap,B=!!re,me=!!b.aoMap,ge=!!b.lightMap,Re=!!b.bumpMap,ae=!!b.normalMap,Xe=!!b.displacementMap,Ce=!!b.emissiveMap,De=!!b.metalnessMap,U=!!b.roughnessMap,C=b.anisotropy>0,Y=b.clearcoat>0,ue=b.dispersion>0,ce=b.iridescence>0,de=b.sheen>0,Ye=b.transmission>0,Ae=C&&!!b.anisotropyMap,Ue=Y&&!!b.clearcoatMap,st=Y&&!!b.clearcoatNormalMap,_e=Y&&!!b.clearcoatRoughnessMap,Ie=ce&&!!b.iridescenceMap,pt=ce&&!!b.iridescenceThicknessMap,nt=de&&!!b.sheenColorMap,ke=de&&!!b.sheenRoughnessMap,ie=!!b.specularMap,be=!!b.specularColorMap,et=!!b.specularIntensityMap,z=Ye&&!!b.transmissionMap,ve=Ye&&!!b.thicknessMap,oe=!!b.gradientMap,he=!!b.alphaMap,Ee=b.alphaTest>0,Ze=!!b.alphaHash,lt=!!b.extensions;let Ct=$o;b.toneMapped&&(Se===null||Se.isXRRenderTarget===!0)&&(Ct=n.toneMapping);const zt={shaderID:Q,shaderType:b.type,shaderName:b.name,vertexShader:Ne,fragmentShader:q,defines:b.defines,customVertexShaderID:fe,customFragmentShaderID:Te,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:Qe,batchingColor:Qe&&V._colorsTexture!==null,instancing:$e,instancingColor:$e&&V.instanceColor!==null,instancingMorph:$e&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:Se===null?n.outputColorSpace:Se.isXRRenderTarget===!0?Se.texture.colorSpace:Zo,alphaToCoverage:!!b.alphaToCoverage,map:je,matcap:Ke,envMap:B,envMapMode:B&&re.mapping,envMapCubeUVHeight:O,aoMap:me,lightMap:ge,bumpMap:Re,normalMap:ae,displacementMap:d&&Xe,emissiveMap:Ce,normalMapObjectSpace:ae&&b.normalMapType===H5,normalMapTangentSpace:ae&&b.normalMapType===du,metalnessMap:De,roughnessMap:U,anisotropy:C,anisotropyMap:Ae,clearcoat:Y,clearcoatMap:Ue,clearcoatNormalMap:st,clearcoatRoughnessMap:_e,dispersion:ue,iridescence:ce,iridescenceMap:Ie,iridescenceThicknessMap:pt,sheen:de,sheenColorMap:nt,sheenRoughnessMap:ke,specularMap:ie,specularColorMap:be,specularIntensityMap:et,transmission:Ye,transmissionMap:z,thicknessMap:ve,gradientMap:oe,opaque:b.transparent===!1&&b.blending===kh&&b.alphaToCoverage===!1,alphaMap:he,alphaTest:Ee,alphaHash:Ze,combine:b.combine,mapUv:je&&_(b.map.channel),aoMapUv:me&&_(b.aoMap.channel),lightMapUv:ge&&_(b.lightMap.channel),bumpMapUv:Re&&_(b.bumpMap.channel),normalMapUv:ae&&_(b.normalMap.channel),displacementMapUv:Xe&&_(b.displacementMap.channel),emissiveMapUv:Ce&&_(b.emissiveMap.channel),metalnessMapUv:De&&_(b.metalnessMap.channel),roughnessMapUv:U&&_(b.roughnessMap.channel),anisotropyMapUv:Ae&&_(b.anisotropyMap.channel),clearcoatMapUv:Ue&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:st&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_e&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ie&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:pt&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:ke&&_(b.sheenRoughnessMap.channel),specularMapUv:ie&&_(b.specularMap.channel),specularColorMapUv:be&&_(b.specularColorMap.channel),specularIntensityMapUv:et&&_(b.specularIntensityMap.channel),transmissionMapUv:z&&_(b.transmissionMap.channel),thicknessMapUv:ve&&_(b.thicknessMap.channel),alphaMapUv:he&&_(b.alphaMap.channel),vertexTangents:!!Z.attributes.tangent&&(ae||C),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!Z.attributes.uv&&(je||he),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:V.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:we,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&N.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ct,decodeVideoTexture:je&&b.map.isVideoTexture===!0&&Sn.getTransfer(b.map.colorSpace)===On,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Sr,flipSided:b.side===Fi,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:lt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(lt&&b.extensions.multiDraw===!0||Qe)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return zt.vertexUv1s=c.has(1),zt.vertexUv2s=c.has(2),zt.vertexUv3s=c.has(3),c.clear(),zt}function m(b){const w=[];if(b.shaderID?w.push(b.shaderID):(w.push(b.customVertexShaderID),w.push(b.customFragmentShaderID)),b.defines!==void 0)for(const N in b.defines)w.push(N),w.push(b.defines[N]);return b.isRawShaderMaterial===!1&&(S(w,b),x(w,b),w.push(n.outputColorSpace)),w.push(b.customProgramCacheKey),w.join()}function S(b,w){b.push(w.precision),b.push(w.outputColorSpace),b.push(w.envMapMode),b.push(w.envMapCubeUVHeight),b.push(w.mapUv),b.push(w.alphaMapUv),b.push(w.lightMapUv),b.push(w.aoMapUv),b.push(w.bumpMapUv),b.push(w.normalMapUv),b.push(w.displacementMapUv),b.push(w.emissiveMapUv),b.push(w.metalnessMapUv),b.push(w.roughnessMapUv),b.push(w.anisotropyMapUv),b.push(w.clearcoatMapUv),b.push(w.clearcoatNormalMapUv),b.push(w.clearcoatRoughnessMapUv),b.push(w.iridescenceMapUv),b.push(w.iridescenceThicknessMapUv),b.push(w.sheenColorMapUv),b.push(w.sheenRoughnessMapUv),b.push(w.specularMapUv),b.push(w.specularColorMapUv),b.push(w.specularIntensityMapUv),b.push(w.transmissionMapUv),b.push(w.thicknessMapUv),b.push(w.combine),b.push(w.fogExp2),b.push(w.sizeAttenuation),b.push(w.morphTargetsCount),b.push(w.morphAttributeCount),b.push(w.numDirLights),b.push(w.numPointLights),b.push(w.numSpotLights),b.push(w.numSpotLightMaps),b.push(w.numHemiLights),b.push(w.numRectAreaLights),b.push(w.numDirLightShadows),b.push(w.numPointLightShadows),b.push(w.numSpotLightShadows),b.push(w.numSpotLightShadowsWithMaps),b.push(w.numLightProbes),b.push(w.shadowMapType),b.push(w.toneMapping),b.push(w.numClippingPlanes),b.push(w.numClipIntersection),b.push(w.depthPacking)}function x(b,w){a.disableAll(),w.supportsVertexTextures&&a.enable(0),w.instancing&&a.enable(1),w.instancingColor&&a.enable(2),w.instancingMorph&&a.enable(3),w.matcap&&a.enable(4),w.envMap&&a.enable(5),w.normalMapObjectSpace&&a.enable(6),w.normalMapTangentSpace&&a.enable(7),w.clearcoat&&a.enable(8),w.iridescence&&a.enable(9),w.alphaTest&&a.enable(10),w.vertexColors&&a.enable(11),w.vertexAlphas&&a.enable(12),w.vertexUv1s&&a.enable(13),w.vertexUv2s&&a.enable(14),w.vertexUv3s&&a.enable(15),w.vertexTangents&&a.enable(16),w.anisotropy&&a.enable(17),w.alphaHash&&a.enable(18),w.batching&&a.enable(19),w.dispersion&&a.enable(20),w.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.skinning&&a.enable(4),w.morphTargets&&a.enable(5),w.morphNormals&&a.enable(6),w.morphColors&&a.enable(7),w.premultipliedAlpha&&a.enable(8),w.shadowMapEnabled&&a.enable(9),w.doubleSided&&a.enable(10),w.flipSided&&a.enable(11),w.useDepthPacking&&a.enable(12),w.dithering&&a.enable(13),w.transmission&&a.enable(14),w.sheen&&a.enable(15),w.opaque&&a.enable(16),w.pointsUvs&&a.enable(17),w.decodeVideoTexture&&a.enable(18),w.alphaToCoverage&&a.enable(19),b.push(a.mask)}function M(b){const w=v[b.type];let N;if(w){const G=Oo[w];N=c8.clone(G.uniforms)}else N=b.uniforms;return N}function R(b,w){let N;for(let G=0,V=u.length;G0?i.push(m):f.transparent===!0?r.push(m):t.push(m)}function l(h,d,f,v,_,y){const m=o(h,d,f,v,_,y);f.transmission>0?i.unshift(m):f.transparent===!0?r.unshift(m):t.unshift(m)}function c(h,d){t.length>1&&t.sort(h||Ooe),i.length>1&&i.sort(d||wF),r.length>1&&r.sort(d||wF)}function u(){for(let h=e,d=n.length;h=s.length?(o=new EF,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function zoe(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new j,color:new ct};break;case"SpotLight":t={position:new j,direction:new j,color:new ct,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new j,color:new ct,distance:0,decay:0};break;case"HemisphereLight":t={direction:new j,skyColor:new ct,groundColor:new ct};break;case"RectAreaLight":t={color:new ct,position:new j,halfWidth:new j,halfHeight:new j};break}return n[e.id]=t,t}}}function Goe(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fe,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Hoe=0;function Voe(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function Woe(n){const e=new zoe,t=Goe(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new j);const r=new j,s=new Rt,o=new Rt;function a(c){let u=0,h=0,d=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let f=0,v=0,_=0,y=0,m=0,S=0,x=0,M=0,R=0,T=0,P=0;c.sort(Voe);for(let b=0,w=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=ht.LTC_FLOAT_1,i.rectAreaLTC2=ht.LTC_FLOAT_2):(i.rectAreaLTC1=ht.LTC_HALF_1,i.rectAreaLTC2=ht.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=d;const I=i.hash;(I.directionalLength!==f||I.pointLength!==v||I.spotLength!==_||I.rectAreaLength!==y||I.hemiLength!==m||I.numDirectionalShadows!==S||I.numPointShadows!==x||I.numSpotShadows!==M||I.numSpotMaps!==R||I.numLightProbes!==P)&&(i.directional.length=f,i.spot.length=_,i.rectArea.length=y,i.point.length=v,i.hemi.length=m,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=M+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=P,I.directionalLength=f,I.pointLength=v,I.spotLength=_,I.rectAreaLength=y,I.hemiLength=m,I.numDirectionalShadows=S,I.numPointShadows=x,I.numSpotShadows=M,I.numSpotMaps=R,I.numLightProbes=P,i.version=Hoe++)}function l(c,u){let h=0,d=0,f=0,v=0,_=0;const y=u.matrixWorldInverse;for(let m=0,S=c.length;m=o.length?(a=new TF(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}let zI=class extends mi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=hu,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}},GI=class extends mi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};const Xoe=`void main() { gl_Position = vec4( position, 1.0 ); -}`,Voe=`uniform sampler2D shadow_pass; +}`,joe=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3876,12 +3876,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Woe(n,e,t){let i=new ey;const r=new Fe,s=new Fe,o=new bn,a=new FI({depthPacking:F5}),l=new OI,c={},u=t.maxTextureSize,h={[Yo]:Fi,[Fi]:Yo,[Sr]:Sr},d=new Oi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Fe},radius:{value:4}},vertexShader:Hoe,fragmentShader:Voe}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const v=new Vt;v.setAttribute("position",new un(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new si(v,d),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=bA;let m=this.type;this.render=function(T,P,I){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||T.length===0)return;const b=n.getRenderTarget(),w=n.getActiveCubeFace(),N=n.getActiveMipmapLevel(),G=n.state;G.setBlending(br),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=m!==No&&this.type===No,$=m===No&&this.type!==No;for(let Z=0,X=T.length;Zu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/Q.x),r.x=s.x*Q.x,O.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/Q.y),r.y=s.y*Q.y,O.mapSize.y=s.y)),O.map===null||V===!0||$===!0){const le=this.type!==No?{minFilter:ri,magFilter:ri}:{};O.map!==null&&O.map.dispose(),O.map=new wi(r.x,r.y,le),O.map.texture.name=re.name+".shadowMap",O.camera.updateProjectionMatrix()}n.setRenderTarget(O.map),n.clear();const te=O.getViewportCount();for(let le=0;le0||P.map&&P.alphaTest>0){const G=w.uuid,V=P.uuid;let $=c[G];$===void 0&&($={},c[G]=$);let Z=$[V];Z===void 0&&(Z=w.clone(),$[V]=Z,P.addEventListener("dispose",R)),w=Z}if(w.visible=P.visible,w.wireframe=P.wireframe,b===No?w.side=P.shadowSide!==null?P.shadowSide:P.side:w.side=P.shadowSide!==null?P.shadowSide:h[P.side],w.alphaMap=P.alphaMap,w.alphaTest=P.alphaTest,w.map=P.map,w.clipShadows=P.clipShadows,w.clippingPlanes=P.clippingPlanes,w.clipIntersection=P.clipIntersection,w.displacementMap=P.displacementMap,w.displacementScale=P.displacementScale,w.displacementBias=P.displacementBias,w.wireframeLinewidth=P.wireframeLinewidth,w.linewidth=P.linewidth,I.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const G=n.properties.get(w);G.light=I}return w}function M(T,P,I,b,w){if(T.visible===!1)return;if(T.layers.test(P.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&w===No)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,T.matrixWorld);const V=e.update(T),$=T.material;if(Array.isArray($)){const Z=V.groups;for(let X=0,re=Z.length;X=1):re.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(re)[1]),Z=X>=2);let O=null,Q={};const te=n.getParameter(n.SCISSOR_BOX),le=n.getParameter(n.VIEWPORT),we=new bn().fromArray(te),Ne=new bn().fromArray(le);function q(z,ve,oe,he){const Ee=new Uint8Array(4),Ze=n.createTexture();n.bindTexture(z,Ze),n.texParameteri(z,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(z,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let lt=0;lte?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function joe(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function Yoe(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function KR(n,e,t,i){const r=Joe(i);switch(t){case xI:return n*e;case MI:return n*e;case AI:return n*e*2;case DA:return n*e/r.components*r.byteLength;case K0:return n*e/r.components*r.byteLength;case wI:return n*e*2/r.components*r.byteLength;case BA:return n*e*2/r.components*r.byteLength;case SI:return n*e*3/r.components*r.byteLength;case Ar:return n*e*4/r.components*r.byteLength;case NA:return n*e*4/r.components*r.byteLength;case tv:case nv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case iv:case rv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case US:case OS:return Math.max(n,16)*Math.max(e,8)/4;case NS:case FS:return Math.max(n,8)*Math.max(e,8)/2;case kS:case zS:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case GS:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case HS:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case VS:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case WS:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case $S:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case XS:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case jS:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case YS:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case JS:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case KS:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case qS:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case ZS:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case QS:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case eM:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case tM:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case sv:case nM:case iM:return Math.ceil(n/4)*Math.ceil(e/4)*16;case EI:case rM:return Math.ceil(n/4)*Math.ceil(e/4)*8;case sM:case oM:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Joe(n){switch(n){case Zi:case vI:return{byteLength:1,components:1};case Up:case yI:case yd:return{byteLength:2,components:1};case IA:case LA:return{byteLength:2,components:4};case Na:case PA:case Yr:return{byteLength:4,components:1};case _I:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const Koe={contain:Xoe,cover:joe,fill:Yoe,getByteLength:KR};function qoe(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Fe,u=new WeakMap;let h;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(U,C){return f?new OffscreenCanvas(U,C):Kv("canvas")}function _(U,C,Y){let ue=1;const ce=De(U);if((ce.width>Y||ce.height>Y)&&(ue=Y/Math.max(ce.width,ce.height)),ue<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const de=Math.floor(ue*ce.width),Ye=Math.floor(ue*ce.height);h===void 0&&(h=v(de,Ye));const Ae=C?v(de,Ye):h;return Ae.width=de,Ae.height=Ye,Ae.getContext("2d").drawImage(U,0,0,de,Ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ce.width+"x"+ce.height+") to ("+de+"x"+Ye+")."),Ae}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ce.width+"x"+ce.height+")."),U;return U}function y(U){return U.generateMipmaps&&U.minFilter!==ri&&U.minFilter!==Vn}function m(U){n.generateMipmap(U)}function S(U,C,Y,ue,ce=!1){if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let de=C;if(C===n.RED&&(Y===n.FLOAT&&(de=n.R32F),Y===n.HALF_FLOAT&&(de=n.R16F),Y===n.UNSIGNED_BYTE&&(de=n.R8)),C===n.RED_INTEGER&&(Y===n.UNSIGNED_BYTE&&(de=n.R8UI),Y===n.UNSIGNED_SHORT&&(de=n.R16UI),Y===n.UNSIGNED_INT&&(de=n.R32UI),Y===n.BYTE&&(de=n.R8I),Y===n.SHORT&&(de=n.R16I),Y===n.INT&&(de=n.R32I)),C===n.RG&&(Y===n.FLOAT&&(de=n.RG32F),Y===n.HALF_FLOAT&&(de=n.RG16F),Y===n.UNSIGNED_BYTE&&(de=n.RG8)),C===n.RG_INTEGER&&(Y===n.UNSIGNED_BYTE&&(de=n.RG8UI),Y===n.UNSIGNED_SHORT&&(de=n.RG16UI),Y===n.UNSIGNED_INT&&(de=n.RG32UI),Y===n.BYTE&&(de=n.RG8I),Y===n.SHORT&&(de=n.RG16I),Y===n.INT&&(de=n.RG32I)),C===n.RGB&&Y===n.UNSIGNED_INT_5_9_9_9_REV&&(de=n.RGB9_E5),C===n.RGBA){const Ye=ce?$v:Sn.getTransfer(ue);Y===n.FLOAT&&(de=n.RGBA32F),Y===n.HALF_FLOAT&&(de=n.RGBA16F),Y===n.UNSIGNED_BYTE&&(de=Ye===On?n.SRGB8_ALPHA8:n.RGBA8),Y===n.UNSIGNED_SHORT_4_4_4_4&&(de=n.RGBA4),Y===n.UNSIGNED_SHORT_5_5_5_1&&(de=n.RGB5_A1)}return(de===n.R16F||de===n.R32F||de===n.RG16F||de===n.RG32F||de===n.RGBA16F||de===n.RGBA32F)&&e.get("EXT_color_buffer_float"),de}function x(U,C){let Y;return U?C===null||C===Na||C===Kc?Y=n.DEPTH24_STENCIL8:C===Yr?Y=n.DEPTH32F_STENCIL8:C===Up&&(Y=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===Na||C===Kc?Y=n.DEPTH_COMPONENT24:C===Yr?Y=n.DEPTH_COMPONENT32F:C===Up&&(Y=n.DEPTH_COMPONENT16),Y}function M(U,C){return y(U)===!0||U.isFramebufferTexture&&U.minFilter!==ri&&U.minFilter!==Vn?Math.log2(Math.max(C.width,C.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?C.mipmaps.length:1}function R(U){const C=U.target;C.removeEventListener("dispose",R),P(C),C.isVideoTexture&&u.delete(C)}function T(U){const C=U.target;C.removeEventListener("dispose",T),b(C)}function P(U){const C=i.get(U);if(C.__webglInit===void 0)return;const Y=U.source,ue=d.get(Y);if(ue){const ce=ue[C.__cacheKey];ce.usedTimes--,ce.usedTimes===0&&I(U),Object.keys(ue).length===0&&d.delete(Y)}i.remove(U)}function I(U){const C=i.get(U);n.deleteTexture(C.__webglTexture);const Y=U.source,ue=d.get(Y);delete ue[C.__cacheKey],o.memory.textures--}function b(U){const C=i.get(U);if(U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ue=0;ue<6;ue++){if(Array.isArray(C.__webglFramebuffer[ue]))for(let ce=0;ce=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+r.maxTextures),w+=1,U}function V(U){const C=[];return C.push(U.wrapS),C.push(U.wrapT),C.push(U.wrapR||0),C.push(U.magFilter),C.push(U.minFilter),C.push(U.anisotropy),C.push(U.internalFormat),C.push(U.format),C.push(U.type),C.push(U.generateMipmaps),C.push(U.premultiplyAlpha),C.push(U.flipY),C.push(U.unpackAlignment),C.push(U.colorSpace),C.join()}function $(U,C){const Y=i.get(U);if(U.isVideoTexture&&Xe(U),U.isRenderTargetTexture===!1&&U.version>0&&Y.__version!==U.version){const ue=U.image;if(ue===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ue.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ne(Y,U,C);return}}t.bindTexture(n.TEXTURE_2D,Y.__webglTexture,n.TEXTURE0+C)}function Z(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){Ne(Y,U,C);return}t.bindTexture(n.TEXTURE_2D_ARRAY,Y.__webglTexture,n.TEXTURE0+C)}function X(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){Ne(Y,U,C);return}t.bindTexture(n.TEXTURE_3D,Y.__webglTexture,n.TEXTURE0+C)}function re(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){q(Y,U,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,Y.__webglTexture,n.TEXTURE0+C)}const O={[Jc]:n.REPEAT,[Is]:n.CLAMP_TO_EDGE,[Np]:n.MIRRORED_REPEAT},Q={[ri]:n.NEAREST,[RA]:n.NEAREST_MIPMAP_NEAREST,[Ah]:n.NEAREST_MIPMAP_LINEAR,[Vn]:n.LINEAR,[_p]:n.LINEAR_MIPMAP_NEAREST,[fo]:n.LINEAR_MIPMAP_LINEAR},te={[k5]:n.NEVER,[$5]:n.ALWAYS,[z5]:n.LESS,[CI]:n.LEQUAL,[G5]:n.EQUAL,[W5]:n.GEQUAL,[H5]:n.GREATER,[V5]:n.NOTEQUAL};function le(U,C){if(C.type===Yr&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===Vn||C.magFilter===_p||C.magFilter===Ah||C.magFilter===fo||C.minFilter===Vn||C.minFilter===_p||C.minFilter===Ah||C.minFilter===fo)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(U,n.TEXTURE_WRAP_S,O[C.wrapS]),n.texParameteri(U,n.TEXTURE_WRAP_T,O[C.wrapT]),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,O[C.wrapR]),n.texParameteri(U,n.TEXTURE_MAG_FILTER,Q[C.magFilter]),n.texParameteri(U,n.TEXTURE_MIN_FILTER,Q[C.minFilter]),C.compareFunction&&(n.texParameteri(U,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(U,n.TEXTURE_COMPARE_FUNC,te[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===ri||C.minFilter!==Ah&&C.minFilter!==fo||C.type===Yr&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const Y=e.get("EXT_texture_filter_anisotropic");n.texParameterf(U,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,r.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function we(U,C){let Y=!1;U.__webglInit===void 0&&(U.__webglInit=!0,C.addEventListener("dispose",R));const ue=C.source;let ce=d.get(ue);ce===void 0&&(ce={},d.set(ue,ce));const de=V(C);if(de!==U.__cacheKey){ce[de]===void 0&&(ce[de]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,Y=!0),ce[de].usedTimes++;const Ye=ce[U.__cacheKey];Ye!==void 0&&(ce[U.__cacheKey].usedTimes--,Ye.usedTimes===0&&I(C)),U.__cacheKey=de,U.__webglTexture=ce[de].texture}return Y}function Ne(U,C,Y){let ue=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ue=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ue=n.TEXTURE_3D);const ce=we(U,C),de=C.source;t.bindTexture(ue,U.__webglTexture,n.TEXTURE0+Y);const Ye=i.get(de);if(de.version!==Ye.__version||ce===!0){t.activeTexture(n.TEXTURE0+Y);const Ae=Sn.getPrimaries(Sn.workingColorSpace),Ue=C.colorSpace===zo?null:Sn.getPrimaries(C.colorSpace),st=C.colorSpace===zo||Ae===Ue?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);let _e=_(C.image,!1,r.maxTextureSize);_e=Ce(C,_e);const Ie=s.convert(C.format,C.colorSpace),pt=s.convert(C.type);let nt=S(C.internalFormat,Ie,pt,C.colorSpace,C.isVideoTexture);le(ue,C);let ke;const ie=C.mipmaps,be=C.isVideoTexture!==!0,et=Ye.__version===void 0||ce===!0,z=de.dataReady,ve=M(C,_e);if(C.isDepthTexture)nt=x(C.format===qc,C.type),et&&(be?t.texStorage2D(n.TEXTURE_2D,1,nt,_e.width,_e.height):t.texImage2D(n.TEXTURE_2D,0,nt,_e.width,_e.height,0,Ie,pt,null));else if(C.isDataTexture)if(ie.length>0){be&&et&&t.texStorage2D(n.TEXTURE_2D,ve,nt,ie[0].width,ie[0].height);for(let oe=0,he=ie.length;oe0){const Ee=KR(ke.width,ke.height,C.format,C.type);for(const Ze of C.layerUpdates){const lt=ke.data.subarray(Ze*Ee/ke.data.BYTES_PER_ELEMENT,(Ze+1)*Ee/ke.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Ze,ke.width,ke.height,1,Ie,lt,0,0)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,ke.width,ke.height,_e.depth,Ie,ke.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,nt,ke.width,ke.height,_e.depth,0,ke.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else be?z&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,ke.width,ke.height,_e.depth,Ie,pt,ke.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,nt,ke.width,ke.height,_e.depth,0,Ie,pt,ke.data)}else{be&&et&&t.texStorage2D(n.TEXTURE_2D,ve,nt,ie[0].width,ie[0].height);for(let oe=0,he=ie.length;oe0){const oe=KR(_e.width,_e.height,C.format,C.type);for(const he of C.layerUpdates){const Ee=_e.data.subarray(he*oe/_e.data.BYTES_PER_ELEMENT,(he+1)*oe/_e.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,he,_e.width,_e.height,1,Ie,pt,Ee)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,_e.width,_e.height,_e.depth,Ie,pt,_e.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,nt,_e.width,_e.height,_e.depth,0,Ie,pt,_e.data);else if(C.isData3DTexture)be?(et&&t.texStorage3D(n.TEXTURE_3D,ve,nt,_e.width,_e.height,_e.depth),z&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,_e.width,_e.height,_e.depth,Ie,pt,_e.data)):t.texImage3D(n.TEXTURE_3D,0,nt,_e.width,_e.height,_e.depth,0,Ie,pt,_e.data);else if(C.isFramebufferTexture){if(et)if(be)t.texStorage2D(n.TEXTURE_2D,ve,nt,_e.width,_e.height);else{let oe=_e.width,he=_e.height;for(let Ee=0;Ee>=1,he>>=1}}else if(ie.length>0){if(be&&et){const oe=De(ie[0]);t.texStorage2D(n.TEXTURE_2D,ve,nt,oe.width,oe.height)}for(let oe=0,he=ie.length;oe0&&ve++;const he=De(Ie[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,ve,ie,he.width,he.height)}for(let he=0;he<6;he++)if(_e){be?z&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Ie[he].width,Ie[he].height,nt,ke,Ie[he].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,ie,Ie[he].width,Ie[he].height,0,nt,ke,Ie[he].data);for(let Ee=0;Ee>de),Ie=Math.max(1,C.height>>de);ce===n.TEXTURE_3D||ce===n.TEXTURE_2D_ARRAY?t.texImage3D(ce,de,Ue,_e,Ie,C.depth,0,Ye,Ae,null):t.texImage2D(ce,de,Ue,_e,Ie,0,Ye,Ae,null)}t.bindFramebuffer(n.FRAMEBUFFER,U),ae(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ue,ce,i.get(Y).__webglTexture,0,Re(C)):(ce===n.TEXTURE_2D||ce>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ce<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ue,ce,i.get(Y).__webglTexture,de),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Te(U,C,Y){if(n.bindRenderbuffer(n.RENDERBUFFER,U),C.depthBuffer){const ue=C.depthTexture,ce=ue&&ue.isDepthTexture?ue.type:null,de=x(C.stencilBuffer,ce),Ye=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ae=Re(C);ae(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ae,de,C.width,C.height):Y?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ae,de,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,de,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ye,n.RENDERBUFFER,U)}else{const ue=C.textures;for(let ce=0;ce{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,ue.removeEventListener("dispose",ce)};ue.addEventListener("dispose",ce),C.__depthDisposeCallback=ce}C.__boundDepthTexture=ue}if(U.depthTexture&&!C.__autoAllocateDepthBuffer){if(Y)throw new Error("target.depthTexture not supported in Cube render targets");Se(C.__webglFramebuffer,U)}else if(Y){C.__webglDepthbuffer=[];for(let ue=0;ue<6;ue++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[ue]),C.__webglDepthbuffer[ue]===void 0)C.__webglDepthbuffer[ue]=n.createRenderbuffer(),Te(C.__webglDepthbuffer[ue],U,!1);else{const ce=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,de=C.__webglDepthbuffer[ue];n.bindRenderbuffer(n.RENDERBUFFER,de),n.framebufferRenderbuffer(n.FRAMEBUFFER,ce,n.RENDERBUFFER,de)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),Te(C.__webglDepthbuffer,U,!1);else{const ue=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ce=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ce),n.framebufferRenderbuffer(n.FRAMEBUFFER,ue,n.RENDERBUFFER,ce)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function Qe(U,C,Y){const ue=i.get(U);C!==void 0&&fe(ue.__webglFramebuffer,U,U.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),Y!==void 0&&$e(U)}function je(U){const C=U.texture,Y=i.get(U),ue=i.get(C);U.addEventListener("dispose",T);const ce=U.textures,de=U.isWebGLCubeRenderTarget===!0,Ye=ce.length>1;if(Ye||(ue.__webglTexture===void 0&&(ue.__webglTexture=n.createTexture()),ue.__version=C.version,o.memory.textures++),de){Y.__webglFramebuffer=[];for(let Ae=0;Ae<6;Ae++)if(C.mipmaps&&C.mipmaps.length>0){Y.__webglFramebuffer[Ae]=[];for(let Ue=0;Ue0){Y.__webglFramebuffer=[];for(let Ae=0;Ae0&&ae(U)===!1){Y.__webglMultisampledFramebuffer=n.createFramebuffer(),Y.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,Y.__webglMultisampledFramebuffer);for(let Ae=0;Ae0)for(let Ue=0;Ue0)for(let Ue=0;Ue0){if(ae(U)===!1){const C=U.textures,Y=U.width,ue=U.height;let ce=n.COLOR_BUFFER_BIT;const de=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ye=i.get(U),Ae=C.length>1;if(Ae)for(let Ue=0;Ue0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function Xe(U){const C=o.render.frame;u.get(U)!==C&&(u.set(U,C),U.update())}function Ce(U,C){const Y=U.colorSpace,ue=U.format,ce=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||Y!==Zo&&Y!==zo&&(Sn.getTransfer(Y)===On?(ue!==Ar||ce!==Zi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Y)),C}function De(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(c.width=U.naturalWidth||U.width,c.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(c.width=U.displayWidth,c.height=U.displayHeight):(c.width=U.width,c.height=U.height),c}this.allocateTextureUnit=G,this.resetTextureUnits=N,this.setTexture2D=$,this.setTexture2DArray=Z,this.setTexture3D=X,this.setTextureCube=re,this.rebindTextures=Qe,this.setupRenderTarget=je,this.updateRenderTargetMipmap=Ke,this.updateMultisampleRenderTarget=ge,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=fe,this.useMultisampledRTT=ae}function d8(n,e){function t(i,r=zo){let s;const o=Sn.getTransfer(r);if(i===Zi)return n.UNSIGNED_BYTE;if(i===IA)return n.UNSIGNED_SHORT_4_4_4_4;if(i===LA)return n.UNSIGNED_SHORT_5_5_5_1;if(i===_I)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===vI)return n.BYTE;if(i===yI)return n.SHORT;if(i===Up)return n.UNSIGNED_SHORT;if(i===PA)return n.INT;if(i===Na)return n.UNSIGNED_INT;if(i===Yr)return n.FLOAT;if(i===yd)return n.HALF_FLOAT;if(i===xI)return n.ALPHA;if(i===SI)return n.RGB;if(i===Ar)return n.RGBA;if(i===MI)return n.LUMINANCE;if(i===AI)return n.LUMINANCE_ALPHA;if(i===zh)return n.DEPTH_COMPONENT;if(i===qc)return n.DEPTH_STENCIL;if(i===DA)return n.RED;if(i===K0)return n.RED_INTEGER;if(i===wI)return n.RG;if(i===BA)return n.RG_INTEGER;if(i===NA)return n.RGBA_INTEGER;if(i===tv||i===nv||i===iv||i===rv)if(o===On)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===tv)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===nv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===iv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===rv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===tv)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===nv)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===iv)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===rv)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===NS||i===US||i===FS||i===OS)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===NS)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===US)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===FS)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===OS)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===kS||i===zS||i===GS)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===kS||i===zS)return o===On?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===GS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===HS||i===VS||i===WS||i===$S||i===XS||i===jS||i===YS||i===JS||i===KS||i===qS||i===ZS||i===QS||i===eM||i===tM)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===HS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===VS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===WS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===$S)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===XS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===jS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===YS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===JS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===KS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===qS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===ZS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===QS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===eM)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===tM)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===sv||i===nM||i===iM)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===sv)return o===On?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===nM)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===iM)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===EI||i===rM||i===sM||i===oM)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===sv)return s.COMPRESSED_RED_RGTC1_EXT;if(i===rM)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===sM)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===oM)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Kc?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}let f8=class extends Gn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},_l=class extends wn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Zoe={type:"move"};let nb=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new _l,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new _l,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new _l,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,i),m=this._getHandJoint(c,_);y!==null&&(m.matrix.fromArray(y.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=y.radius),m.visible=y!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=u.position.distanceTo(h.position),f=.02,v=.005;c.inputState.pinching&&d>f+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Zoe)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new _l;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}};const Qoe=` +}`;function Yoe(n,e,t){let i=new Q0;const r=new Fe,s=new Fe,o=new bn,a=new zI({depthPacking:G5}),l=new GI,c={},u=t.maxTextureSize,h={[Yo]:Fi,[Fi]:Yo,[Sr]:Sr},d=new Oi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Fe},radius:{value:4}},vertexShader:Xoe,fragmentShader:joe}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const v=new Vt;v.setAttribute("position",new un(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new si(v,d),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=EA;let m=this.type;this.render=function(T,P,I){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||T.length===0)return;const b=n.getRenderTarget(),w=n.getActiveCubeFace(),N=n.getActiveMipmapLevel(),G=n.state;G.setBlending(br),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=m!==No&&this.type===No,$=m===No&&this.type!==No;for(let Z=0,X=T.length;Zu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/Q.x),r.x=s.x*Q.x,O.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/Q.y),r.y=s.y*Q.y,O.mapSize.y=s.y)),O.map===null||V===!0||$===!0){const le=this.type!==No?{minFilter:ri,magFilter:ri}:{};O.map!==null&&O.map.dispose(),O.map=new wi(r.x,r.y,le),O.map.texture.name=re.name+".shadowMap",O.camera.updateProjectionMatrix()}n.setRenderTarget(O.map),n.clear();const te=O.getViewportCount();for(let le=0;le0||P.map&&P.alphaTest>0){const G=w.uuid,V=P.uuid;let $=c[G];$===void 0&&($={},c[G]=$);let Z=$[V];Z===void 0&&(Z=w.clone(),$[V]=Z,P.addEventListener("dispose",R)),w=Z}if(w.visible=P.visible,w.wireframe=P.wireframe,b===No?w.side=P.shadowSide!==null?P.shadowSide:P.side:w.side=P.shadowSide!==null?P.shadowSide:h[P.side],w.alphaMap=P.alphaMap,w.alphaTest=P.alphaTest,w.map=P.map,w.clipShadows=P.clipShadows,w.clippingPlanes=P.clippingPlanes,w.clipIntersection=P.clipIntersection,w.displacementMap=P.displacementMap,w.displacementScale=P.displacementScale,w.displacementBias=P.displacementBias,w.wireframeLinewidth=P.wireframeLinewidth,w.linewidth=P.linewidth,I.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const G=n.properties.get(w);G.light=I}return w}function M(T,P,I,b,w){if(T.visible===!1)return;if(T.layers.test(P.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&w===No)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,T.matrixWorld);const V=e.update(T),$=T.material;if(Array.isArray($)){const Z=V.groups;for(let X=0,re=Z.length;X=1):re.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(re)[1]),Z=X>=2);let O=null,Q={};const te=n.getParameter(n.SCISSOR_BOX),le=n.getParameter(n.VIEWPORT),we=new bn().fromArray(te),Ne=new bn().fromArray(le);function q(z,ve,oe,he){const Ee=new Uint8Array(4),Ze=n.createTexture();n.bindTexture(z,Ze),n.texParameteri(z,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(z,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let lt=0;lte?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function qoe(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function Zoe(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function JR(n,e,t,i){const r=Qoe(i);switch(t){case AI:return n*e;case EI:return n*e;case TI:return n*e*2;case IA:return n*e/r.components*r.byteLength;case J0:return n*e/r.components*r.byteLength;case bI:return n*e*2/r.components*r.byteLength;case LA:return n*e*2/r.components*r.byteLength;case wI:return n*e*3/r.components*r.byteLength;case Ar:return n*e*4/r.components*r.byteLength;case DA:return n*e*4/r.components*r.byteLength;case tv:case nv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case iv:case rv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case US:case OS:return Math.max(n,16)*Math.max(e,8)/4;case NS:case FS:return Math.max(n,8)*Math.max(e,8)/2;case kS:case zS:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case GS:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case HS:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case VS:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case WS:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case $S:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case XS:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case jS:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case YS:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case JS:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case KS:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case qS:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case ZS:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case QS:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case eM:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case tM:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case sv:case nM:case iM:return Math.ceil(n/4)*Math.ceil(e/4)*16;case CI:case rM:return Math.ceil(n/4)*Math.ceil(e/4)*8;case sM:case oM:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Qoe(n){switch(n){case Zi:case xI:return{byteLength:1,components:1};case Fp:case SI:case yd:return{byteLength:2,components:1};case RA:case PA:return{byteLength:2,components:4};case Na:case CA:case Yr:return{byteLength:4,components:1};case MI:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const eae={contain:Koe,cover:qoe,fill:Zoe,getByteLength:JR};function tae(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Fe,u=new WeakMap;let h;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(U,C){return f?new OffscreenCanvas(U,C):Kv("canvas")}function _(U,C,Y){let ue=1;const ce=De(U);if((ce.width>Y||ce.height>Y)&&(ue=Y/Math.max(ce.width,ce.height)),ue<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const de=Math.floor(ue*ce.width),Ye=Math.floor(ue*ce.height);h===void 0&&(h=v(de,Ye));const Ae=C?v(de,Ye):h;return Ae.width=de,Ae.height=Ye,Ae.getContext("2d").drawImage(U,0,0,de,Ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ce.width+"x"+ce.height+") to ("+de+"x"+Ye+")."),Ae}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ce.width+"x"+ce.height+")."),U;return U}function y(U){return U.generateMipmaps&&U.minFilter!==ri&&U.minFilter!==Vn}function m(U){n.generateMipmap(U)}function S(U,C,Y,ue,ce=!1){if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let de=C;if(C===n.RED&&(Y===n.FLOAT&&(de=n.R32F),Y===n.HALF_FLOAT&&(de=n.R16F),Y===n.UNSIGNED_BYTE&&(de=n.R8)),C===n.RED_INTEGER&&(Y===n.UNSIGNED_BYTE&&(de=n.R8UI),Y===n.UNSIGNED_SHORT&&(de=n.R16UI),Y===n.UNSIGNED_INT&&(de=n.R32UI),Y===n.BYTE&&(de=n.R8I),Y===n.SHORT&&(de=n.R16I),Y===n.INT&&(de=n.R32I)),C===n.RG&&(Y===n.FLOAT&&(de=n.RG32F),Y===n.HALF_FLOAT&&(de=n.RG16F),Y===n.UNSIGNED_BYTE&&(de=n.RG8)),C===n.RG_INTEGER&&(Y===n.UNSIGNED_BYTE&&(de=n.RG8UI),Y===n.UNSIGNED_SHORT&&(de=n.RG16UI),Y===n.UNSIGNED_INT&&(de=n.RG32UI),Y===n.BYTE&&(de=n.RG8I),Y===n.SHORT&&(de=n.RG16I),Y===n.INT&&(de=n.RG32I)),C===n.RGB&&Y===n.UNSIGNED_INT_5_9_9_9_REV&&(de=n.RGB9_E5),C===n.RGBA){const Ye=ce?$v:Sn.getTransfer(ue);Y===n.FLOAT&&(de=n.RGBA32F),Y===n.HALF_FLOAT&&(de=n.RGBA16F),Y===n.UNSIGNED_BYTE&&(de=Ye===On?n.SRGB8_ALPHA8:n.RGBA8),Y===n.UNSIGNED_SHORT_4_4_4_4&&(de=n.RGBA4),Y===n.UNSIGNED_SHORT_5_5_5_1&&(de=n.RGB5_A1)}return(de===n.R16F||de===n.R32F||de===n.RG16F||de===n.RG32F||de===n.RGBA16F||de===n.RGBA32F)&&e.get("EXT_color_buffer_float"),de}function x(U,C){let Y;return U?C===null||C===Na||C===Kc?Y=n.DEPTH24_STENCIL8:C===Yr?Y=n.DEPTH32F_STENCIL8:C===Fp&&(Y=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===Na||C===Kc?Y=n.DEPTH_COMPONENT24:C===Yr?Y=n.DEPTH_COMPONENT32F:C===Fp&&(Y=n.DEPTH_COMPONENT16),Y}function M(U,C){return y(U)===!0||U.isFramebufferTexture&&U.minFilter!==ri&&U.minFilter!==Vn?Math.log2(Math.max(C.width,C.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?C.mipmaps.length:1}function R(U){const C=U.target;C.removeEventListener("dispose",R),P(C),C.isVideoTexture&&u.delete(C)}function T(U){const C=U.target;C.removeEventListener("dispose",T),b(C)}function P(U){const C=i.get(U);if(C.__webglInit===void 0)return;const Y=U.source,ue=d.get(Y);if(ue){const ce=ue[C.__cacheKey];ce.usedTimes--,ce.usedTimes===0&&I(U),Object.keys(ue).length===0&&d.delete(Y)}i.remove(U)}function I(U){const C=i.get(U);n.deleteTexture(C.__webglTexture);const Y=U.source,ue=d.get(Y);delete ue[C.__cacheKey],o.memory.textures--}function b(U){const C=i.get(U);if(U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ue=0;ue<6;ue++){if(Array.isArray(C.__webglFramebuffer[ue]))for(let ce=0;ce=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+r.maxTextures),w+=1,U}function V(U){const C=[];return C.push(U.wrapS),C.push(U.wrapT),C.push(U.wrapR||0),C.push(U.magFilter),C.push(U.minFilter),C.push(U.anisotropy),C.push(U.internalFormat),C.push(U.format),C.push(U.type),C.push(U.generateMipmaps),C.push(U.premultiplyAlpha),C.push(U.flipY),C.push(U.unpackAlignment),C.push(U.colorSpace),C.join()}function $(U,C){const Y=i.get(U);if(U.isVideoTexture&&Xe(U),U.isRenderTargetTexture===!1&&U.version>0&&Y.__version!==U.version){const ue=U.image;if(ue===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ue.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ne(Y,U,C);return}}t.bindTexture(n.TEXTURE_2D,Y.__webglTexture,n.TEXTURE0+C)}function Z(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){Ne(Y,U,C);return}t.bindTexture(n.TEXTURE_2D_ARRAY,Y.__webglTexture,n.TEXTURE0+C)}function X(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){Ne(Y,U,C);return}t.bindTexture(n.TEXTURE_3D,Y.__webglTexture,n.TEXTURE0+C)}function re(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){q(Y,U,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,Y.__webglTexture,n.TEXTURE0+C)}const O={[Jc]:n.REPEAT,[Is]:n.CLAMP_TO_EDGE,[Up]:n.MIRRORED_REPEAT},Q={[ri]:n.NEAREST,[bA]:n.NEAREST_MIPMAP_NEAREST,[Ah]:n.NEAREST_MIPMAP_LINEAR,[Vn]:n.LINEAR,[_p]:n.LINEAR_MIPMAP_NEAREST,[fo]:n.LINEAR_MIPMAP_LINEAR},te={[V5]:n.NEVER,[J5]:n.ALWAYS,[W5]:n.LESS,[II]:n.LEQUAL,[$5]:n.EQUAL,[Y5]:n.GEQUAL,[X5]:n.GREATER,[j5]:n.NOTEQUAL};function le(U,C){if(C.type===Yr&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===Vn||C.magFilter===_p||C.magFilter===Ah||C.magFilter===fo||C.minFilter===Vn||C.minFilter===_p||C.minFilter===Ah||C.minFilter===fo)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(U,n.TEXTURE_WRAP_S,O[C.wrapS]),n.texParameteri(U,n.TEXTURE_WRAP_T,O[C.wrapT]),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,O[C.wrapR]),n.texParameteri(U,n.TEXTURE_MAG_FILTER,Q[C.magFilter]),n.texParameteri(U,n.TEXTURE_MIN_FILTER,Q[C.minFilter]),C.compareFunction&&(n.texParameteri(U,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(U,n.TEXTURE_COMPARE_FUNC,te[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===ri||C.minFilter!==Ah&&C.minFilter!==fo||C.type===Yr&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const Y=e.get("EXT_texture_filter_anisotropic");n.texParameterf(U,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,r.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function we(U,C){let Y=!1;U.__webglInit===void 0&&(U.__webglInit=!0,C.addEventListener("dispose",R));const ue=C.source;let ce=d.get(ue);ce===void 0&&(ce={},d.set(ue,ce));const de=V(C);if(de!==U.__cacheKey){ce[de]===void 0&&(ce[de]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,Y=!0),ce[de].usedTimes++;const Ye=ce[U.__cacheKey];Ye!==void 0&&(ce[U.__cacheKey].usedTimes--,Ye.usedTimes===0&&I(C)),U.__cacheKey=de,U.__webglTexture=ce[de].texture}return Y}function Ne(U,C,Y){let ue=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ue=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ue=n.TEXTURE_3D);const ce=we(U,C),de=C.source;t.bindTexture(ue,U.__webglTexture,n.TEXTURE0+Y);const Ye=i.get(de);if(de.version!==Ye.__version||ce===!0){t.activeTexture(n.TEXTURE0+Y);const Ae=Sn.getPrimaries(Sn.workingColorSpace),Ue=C.colorSpace===zo?null:Sn.getPrimaries(C.colorSpace),st=C.colorSpace===zo||Ae===Ue?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);let _e=_(C.image,!1,r.maxTextureSize);_e=Ce(C,_e);const Ie=s.convert(C.format,C.colorSpace),pt=s.convert(C.type);let nt=S(C.internalFormat,Ie,pt,C.colorSpace,C.isVideoTexture);le(ue,C);let ke;const ie=C.mipmaps,be=C.isVideoTexture!==!0,et=Ye.__version===void 0||ce===!0,z=de.dataReady,ve=M(C,_e);if(C.isDepthTexture)nt=x(C.format===qc,C.type),et&&(be?t.texStorage2D(n.TEXTURE_2D,1,nt,_e.width,_e.height):t.texImage2D(n.TEXTURE_2D,0,nt,_e.width,_e.height,0,Ie,pt,null));else if(C.isDataTexture)if(ie.length>0){be&&et&&t.texStorage2D(n.TEXTURE_2D,ve,nt,ie[0].width,ie[0].height);for(let oe=0,he=ie.length;oe0){const Ee=JR(ke.width,ke.height,C.format,C.type);for(const Ze of C.layerUpdates){const lt=ke.data.subarray(Ze*Ee/ke.data.BYTES_PER_ELEMENT,(Ze+1)*Ee/ke.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Ze,ke.width,ke.height,1,Ie,lt,0,0)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,ke.width,ke.height,_e.depth,Ie,ke.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,nt,ke.width,ke.height,_e.depth,0,ke.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else be?z&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,ke.width,ke.height,_e.depth,Ie,pt,ke.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,nt,ke.width,ke.height,_e.depth,0,Ie,pt,ke.data)}else{be&&et&&t.texStorage2D(n.TEXTURE_2D,ve,nt,ie[0].width,ie[0].height);for(let oe=0,he=ie.length;oe0){const oe=JR(_e.width,_e.height,C.format,C.type);for(const he of C.layerUpdates){const Ee=_e.data.subarray(he*oe/_e.data.BYTES_PER_ELEMENT,(he+1)*oe/_e.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,he,_e.width,_e.height,1,Ie,pt,Ee)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,_e.width,_e.height,_e.depth,Ie,pt,_e.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,nt,_e.width,_e.height,_e.depth,0,Ie,pt,_e.data);else if(C.isData3DTexture)be?(et&&t.texStorage3D(n.TEXTURE_3D,ve,nt,_e.width,_e.height,_e.depth),z&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,_e.width,_e.height,_e.depth,Ie,pt,_e.data)):t.texImage3D(n.TEXTURE_3D,0,nt,_e.width,_e.height,_e.depth,0,Ie,pt,_e.data);else if(C.isFramebufferTexture){if(et)if(be)t.texStorage2D(n.TEXTURE_2D,ve,nt,_e.width,_e.height);else{let oe=_e.width,he=_e.height;for(let Ee=0;Ee>=1,he>>=1}}else if(ie.length>0){if(be&&et){const oe=De(ie[0]);t.texStorage2D(n.TEXTURE_2D,ve,nt,oe.width,oe.height)}for(let oe=0,he=ie.length;oe0&&ve++;const he=De(Ie[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,ve,ie,he.width,he.height)}for(let he=0;he<6;he++)if(_e){be?z&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Ie[he].width,Ie[he].height,nt,ke,Ie[he].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,ie,Ie[he].width,Ie[he].height,0,nt,ke,Ie[he].data);for(let Ee=0;Ee>de),Ie=Math.max(1,C.height>>de);ce===n.TEXTURE_3D||ce===n.TEXTURE_2D_ARRAY?t.texImage3D(ce,de,Ue,_e,Ie,C.depth,0,Ye,Ae,null):t.texImage2D(ce,de,Ue,_e,Ie,0,Ye,Ae,null)}t.bindFramebuffer(n.FRAMEBUFFER,U),ae(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ue,ce,i.get(Y).__webglTexture,0,Re(C)):(ce===n.TEXTURE_2D||ce>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ce<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ue,ce,i.get(Y).__webglTexture,de),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Te(U,C,Y){if(n.bindRenderbuffer(n.RENDERBUFFER,U),C.depthBuffer){const ue=C.depthTexture,ce=ue&&ue.isDepthTexture?ue.type:null,de=x(C.stencilBuffer,ce),Ye=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ae=Re(C);ae(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ae,de,C.width,C.height):Y?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ae,de,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,de,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ye,n.RENDERBUFFER,U)}else{const ue=C.textures;for(let ce=0;ce{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,ue.removeEventListener("dispose",ce)};ue.addEventListener("dispose",ce),C.__depthDisposeCallback=ce}C.__boundDepthTexture=ue}if(U.depthTexture&&!C.__autoAllocateDepthBuffer){if(Y)throw new Error("target.depthTexture not supported in Cube render targets");Se(C.__webglFramebuffer,U)}else if(Y){C.__webglDepthbuffer=[];for(let ue=0;ue<6;ue++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[ue]),C.__webglDepthbuffer[ue]===void 0)C.__webglDepthbuffer[ue]=n.createRenderbuffer(),Te(C.__webglDepthbuffer[ue],U,!1);else{const ce=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,de=C.__webglDepthbuffer[ue];n.bindRenderbuffer(n.RENDERBUFFER,de),n.framebufferRenderbuffer(n.FRAMEBUFFER,ce,n.RENDERBUFFER,de)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),Te(C.__webglDepthbuffer,U,!1);else{const ue=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ce=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ce),n.framebufferRenderbuffer(n.FRAMEBUFFER,ue,n.RENDERBUFFER,ce)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function Qe(U,C,Y){const ue=i.get(U);C!==void 0&&fe(ue.__webglFramebuffer,U,U.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),Y!==void 0&&$e(U)}function je(U){const C=U.texture,Y=i.get(U),ue=i.get(C);U.addEventListener("dispose",T);const ce=U.textures,de=U.isWebGLCubeRenderTarget===!0,Ye=ce.length>1;if(Ye||(ue.__webglTexture===void 0&&(ue.__webglTexture=n.createTexture()),ue.__version=C.version,o.memory.textures++),de){Y.__webglFramebuffer=[];for(let Ae=0;Ae<6;Ae++)if(C.mipmaps&&C.mipmaps.length>0){Y.__webglFramebuffer[Ae]=[];for(let Ue=0;Ue0){Y.__webglFramebuffer=[];for(let Ae=0;Ae0&&ae(U)===!1){Y.__webglMultisampledFramebuffer=n.createFramebuffer(),Y.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,Y.__webglMultisampledFramebuffer);for(let Ae=0;Ae0)for(let Ue=0;Ue0)for(let Ue=0;Ue0){if(ae(U)===!1){const C=U.textures,Y=U.width,ue=U.height;let ce=n.COLOR_BUFFER_BIT;const de=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ye=i.get(U),Ae=C.length>1;if(Ae)for(let Ue=0;Ue0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function Xe(U){const C=o.render.frame;u.get(U)!==C&&(u.set(U,C),U.update())}function Ce(U,C){const Y=U.colorSpace,ue=U.format,ce=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||Y!==Zo&&Y!==zo&&(Sn.getTransfer(Y)===On?(ue!==Ar||ce!==Zi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Y)),C}function De(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(c.width=U.naturalWidth||U.width,c.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(c.width=U.displayWidth,c.height=U.displayHeight):(c.width=U.width,c.height=U.height),c}this.allocateTextureUnit=G,this.resetTextureUnits=N,this.setTexture2D=$,this.setTexture2DArray=Z,this.setTexture3D=X,this.setTextureCube=re,this.rebindTextures=Qe,this.setupRenderTarget=je,this.updateRenderTargetMipmap=Ke,this.updateMultisampleRenderTarget=ge,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=fe,this.useMultisampledRTT=ae}function g8(n,e){function t(i,r=zo){let s;const o=Sn.getTransfer(r);if(i===Zi)return n.UNSIGNED_BYTE;if(i===RA)return n.UNSIGNED_SHORT_4_4_4_4;if(i===PA)return n.UNSIGNED_SHORT_5_5_5_1;if(i===MI)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===xI)return n.BYTE;if(i===SI)return n.SHORT;if(i===Fp)return n.UNSIGNED_SHORT;if(i===CA)return n.INT;if(i===Na)return n.UNSIGNED_INT;if(i===Yr)return n.FLOAT;if(i===yd)return n.HALF_FLOAT;if(i===AI)return n.ALPHA;if(i===wI)return n.RGB;if(i===Ar)return n.RGBA;if(i===EI)return n.LUMINANCE;if(i===TI)return n.LUMINANCE_ALPHA;if(i===zh)return n.DEPTH_COMPONENT;if(i===qc)return n.DEPTH_STENCIL;if(i===IA)return n.RED;if(i===J0)return n.RED_INTEGER;if(i===bI)return n.RG;if(i===LA)return n.RG_INTEGER;if(i===DA)return n.RGBA_INTEGER;if(i===tv||i===nv||i===iv||i===rv)if(o===On)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===tv)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===nv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===iv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===rv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===tv)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===nv)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===iv)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===rv)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===NS||i===US||i===FS||i===OS)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===NS)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===US)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===FS)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===OS)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===kS||i===zS||i===GS)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===kS||i===zS)return o===On?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===GS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===HS||i===VS||i===WS||i===$S||i===XS||i===jS||i===YS||i===JS||i===KS||i===qS||i===ZS||i===QS||i===eM||i===tM)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===HS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===VS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===WS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===$S)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===XS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===jS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===YS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===JS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===KS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===qS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===ZS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===QS)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===eM)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===tM)return o===On?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===sv||i===nM||i===iM)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===sv)return o===On?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===nM)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===iM)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===CI||i===rM||i===sM||i===oM)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===sv)return s.COMPRESSED_RED_RGTC1_EXT;if(i===rM)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===sM)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===oM)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Kc?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}let v8=class extends Gn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},_l=class extends wn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const nae={type:"move"};let eb=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new _l,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new _l,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new _l,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,i),m=this._getHandJoint(c,_);y!==null&&(m.matrix.fromArray(y.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=y.radius),m.visible=y!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=u.position.distanceTo(h.position),f=.02,v=.005;c.inputState.pinching&&d>f+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(nae)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new _l;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}};const iae=` void main() { gl_Position = vec4( position, 1.0 ); -}`,eae=` +}`,rae=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -3900,7 +3900,7 @@ void main() { } -}`;let tae=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Yn,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Oi({vertexShader:Qoe,fragmentShader:eae,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new si(new kA(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},nae=class extends vs{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,d=null,f=null,v=null;const _=new tae,y=t.getContextAttributes();let m=null,S=null;const x=[],M=[],R=new Fe;let T=null;const P=new Gn;P.layers.enable(1),P.viewport=new bn;const I=new Gn;I.layers.enable(2),I.viewport=new bn;const b=[P,I],w=new f8;w.layers.enable(1),w.layers.enable(2);let N=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let fe=x[q];return fe===void 0&&(fe=new nb,x[q]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(q){let fe=x[q];return fe===void 0&&(fe=new nb,x[q]=fe),fe.getGripSpace()},this.getHand=function(q){let fe=x[q];return fe===void 0&&(fe=new nb,x[q]=fe),fe.getHandSpace()};function V(q){const fe=M.indexOf(q.inputSource);if(fe===-1)return;const Te=x[fe];Te!==void 0&&(Te.update(q.inputSource,q.frame,c||o),Te.dispatchEvent({type:q.type,data:q.inputSource}))}function $(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",$),r.removeEventListener("inputsourceschange",Z);for(let q=0;q=0&&(M[Se]=null,x[Se].disconnect(Te))}for(let fe=0;fe=M.length){M.push(Te),Se=Qe;break}else if(M[Qe]===null){M[Qe]=Te,Se=Qe;break}if(Se===-1)break}const $e=x[Se];$e&&$e.connect(Te)}}const X=new j,re=new j;function O(q,fe,Te){X.setFromMatrixPosition(fe.matrixWorld),re.setFromMatrixPosition(Te.matrixWorld);const Se=X.distanceTo(re),$e=fe.projectionMatrix.elements,Qe=Te.projectionMatrix.elements,je=$e[14]/($e[10]-1),Ke=$e[14]/($e[10]+1),B=($e[9]+1)/$e[5],me=($e[9]-1)/$e[5],ge=($e[8]-1)/$e[0],Re=(Qe[8]+1)/Qe[0],ae=je*ge,Xe=je*Re,Ce=Se/(-ge+Re),De=Ce*-ge;if(fe.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(De),q.translateZ(Ce),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),$e[10]===-1)q.projectionMatrix.copy(fe.projectionMatrix),q.projectionMatrixInverse.copy(fe.projectionMatrixInverse);else{const U=je+Ce,C=Ke+Ce,Y=ae-De,ue=Xe+(Se-De),ce=B*Ke/C*U,de=me*Ke/C*U;q.projectionMatrix.makePerspective(Y,ue,ce,de,U,C),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function Q(q,fe){fe===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(fe.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(r===null)return;let fe=q.near,Te=q.far;_.texture!==null&&(_.depthNear>0&&(fe=_.depthNear),_.depthFar>0&&(Te=_.depthFar)),w.near=I.near=P.near=fe,w.far=I.far=P.far=Te,(N!==w.near||G!==w.far)&&(r.updateRenderState({depthNear:w.near,depthFar:w.far}),N=w.near,G=w.far);const Se=q.parent,$e=w.cameras;Q(w,Se);for(let Qe=0;Qe<$e.length;Qe++)Q($e[Qe],Se);$e.length===2?O(w,P,I):w.projectionMatrix.copy(P.projectionMatrix),te(q,w,Se)};function te(q,fe,Te){Te===null?q.matrix.copy(fe.matrixWorld):(q.matrix.copy(Te.matrixWorld),q.matrix.invert(),q.matrix.multiply(fe.matrixWorld)),q.matrix.decompose(q.position,q.quaternion,q.scale),q.updateMatrixWorld(!0),q.projectionMatrix.copy(fe.projectionMatrix),q.projectionMatrixInverse.copy(fe.projectionMatrixInverse),q.isPerspectiveCamera&&(q.fov=kp*2*Math.atan(1/q.projectionMatrix.elements[5]),q.zoom=1)}this.getCamera=function(){return w},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(q){l=q,d!==null&&(d.fixedFoveation=q),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=q)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(w)};let le=null;function we(q,fe){if(u=fe.getViewerPose(c||o),v=fe,u!==null){const Te=u.views;f!==null&&(e.setRenderTargetFramebuffer(S,f.framebuffer),e.setRenderTarget(S));let Se=!1;Te.length!==w.cameras.length&&(w.cameras.length=0,Se=!0);for(let Qe=0;Qe0&&(y.alphaTest.value=m.alphaTest);const S=e.get(m),x=S.envMap,M=S.envMapRotation;x&&(y.envMap.value=x,ku.copy(M),ku.x*=-1,ku.y*=-1,ku.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(ku.y*=-1,ku.z*=-1),y.envMapRotation.value.setFromMatrix4(iae.makeRotationFromEuler(ku)),y.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=m.reflectivity,y.ior.value=m.ior,y.refractionRatio.value=m.refractionRatio),m.lightMap&&(y.lightMap.value=m.lightMap,y.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,y.lightMapTransform)),m.aoMap&&(y.aoMap.value=m.aoMap,y.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,y.aoMapTransform))}function o(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform))}function a(y,m){y.dashSize.value=m.dashSize,y.totalSize.value=m.dashSize+m.gapSize,y.scale.value=m.scale}function l(y,m,S,x){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.size.value=m.size*S,y.scale.value=x*.5,m.map&&(y.map.value=m.map,t(m.map,y.uvTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function c(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.rotation.value=m.rotation,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function u(y,m){y.specular.value.copy(m.specular),y.shininess.value=Math.max(m.shininess,1e-4)}function h(y,m){m.gradientMap&&(y.gradientMap.value=m.gradientMap)}function d(y,m){y.metalness.value=m.metalness,m.metalnessMap&&(y.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,y.metalnessMapTransform)),y.roughness.value=m.roughness,m.roughnessMap&&(y.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,y.roughnessMapTransform)),m.envMap&&(y.envMapIntensity.value=m.envMapIntensity)}function f(y,m,S){y.ior.value=m.ior,m.sheen>0&&(y.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),y.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(y.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,y.sheenColorMapTransform)),m.sheenRoughnessMap&&(y.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,y.sheenRoughnessMapTransform))),m.clearcoat>0&&(y.clearcoat.value=m.clearcoat,y.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(y.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,y.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(y.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Fi&&y.clearcoatNormalScale.value.negate())),m.dispersion>0&&(y.dispersion.value=m.dispersion),m.iridescence>0&&(y.iridescence.value=m.iridescence,y.iridescenceIOR.value=m.iridescenceIOR,y.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(y.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,y.iridescenceMapTransform)),m.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),m.transmission>0&&(y.transmission.value=m.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),m.transmissionMap&&(y.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,y.transmissionMapTransform)),y.thickness.value=m.thickness,m.thicknessMap&&(y.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=m.attenuationDistance,y.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(y.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(y.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=m.specularIntensity,y.specularColor.value.copy(m.specularColor),m.specularColorMap&&(y.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,y.specularColorMapTransform)),m.specularIntensityMap&&(y.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,m){m.matcap&&(y.matcap.value=m.matcap)}function _(y,m){const S=e.get(m).light;y.referencePosition.value.setFromMatrixPosition(S.matrixWorld),y.nearDistance.value=S.shadow.camera.near,y.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function sae(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,x){const M=x.program;i.uniformBlockBinding(S,M)}function c(S,x){let M=r[S.id];M===void 0&&(v(S),M=u(S),r[S.id]=M,S.addEventListener("dispose",y));const R=x.program;i.updateUBOMapping(S,R);const T=e.render.frame;s[S.id]!==T&&(d(S),s[S.id]=T)}function u(S){const x=h();S.__bindingPointIndex=x;const M=n.createBuffer(),R=S.__size,T=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,R,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,M),M}function h(){for(let S=0;S0&&(M+=R-T),S.__size=M,S.__cache={},this}function _(S){const x={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(x.boundary=4,x.storage=4):S.isVector2?(x.boundary=8,x.storage=8):S.isVector3||S.isColor?(x.boundary=16,x.storage=12):S.isVector4?(x.boundary=16,x.storage=16):S.isMatrix3?(x.boundary=48,x.storage=48):S.isMatrix4?(x.boundary=64,x.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),x}function y(S){const x=S.target;x.removeEventListener("dispose",y);const M=o.indexOf(x.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function m(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:c,dispose:m}}let p8=class{constructor(e={}){const{canvas:t=J5(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=o;const f=new Uint32Array(4),v=new Int32Array(4);let _=null,y=null;const m=[],S=[];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=Bn,this.toneMapping=$o,this.toneMappingExposure=1;const x=this;let M=!1,R=0,T=0,P=null,I=-1,b=null;const w=new bn,N=new bn;let G=null;const V=new ct(0);let $=0,Z=t.width,X=t.height,re=1,O=null,Q=null;const te=new bn(0,0,Z,X),le=new bn(0,0,Z,X);let we=!1;const Ne=new ey;let q=!1,fe=!1;const Te=new Rt,Se=new j,$e=new bn,Qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let je=!1;function Ke(){return P===null?re:1}let B=i;function me(L,H){return t.getContext(L,H)}try{const L={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${uu}`),t.addEventListener("webglcontextlost",oe,!1),t.addEventListener("webglcontextrestored",he,!1),t.addEventListener("webglcontextcreationerror",Ee,!1),B===null){const H="webgl2";if(B=me(H,L),B===null)throw me(H)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}let ge,Re,ae,Xe,Ce,De,U,C,Y,ue,ce,de,Ye,Ae,Ue,st,_e,Ie,pt,nt,ke,ie,be,et;function z(){ge=new dse(B),ge.init(),ie=new d8(B,ge),Re=new ose(B,ge,e,ie),ae=new $oe(B),Xe=new mse(B),Ce=new Doe,De=new qoe(B,ge,ae,Ce,Re,ie,Xe),U=new lse(x),C=new hse(x),Y=new Mne(B),be=new rse(B,Y),ue=new fse(B,Y,Xe,be),ce=new vse(B,ue,Y,Xe),pt=new gse(B,Re,De),st=new ase(Ce),de=new Loe(x,U,C,ge,Re,be,st),Ye=new rae(x,Ce),Ae=new Noe,Ue=new Goe(ge),Ie=new ise(x,U,C,ae,ce,d,l),_e=new Woe(x,ce,Re),et=new sae(B,Xe,Re,ae),nt=new sse(B,ge,Xe),ke=new pse(B,ge,Xe),Xe.programs=de.programs,x.capabilities=Re,x.extensions=ge,x.properties=Ce,x.renderLists=Ae,x.shadowMap=_e,x.state=ae,x.info=Xe}z();const ve=new nae(x,B);this.xr=ve,this.getContext=function(){return B},this.getContextAttributes=function(){return B.getContextAttributes()},this.forceContextLoss=function(){const L=ge.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=ge.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return re},this.setPixelRatio=function(L){L!==void 0&&(re=L,this.setSize(Z,X,!1))},this.getSize=function(L){return L.set(Z,X)},this.setSize=function(L,H,J=!0){if(ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Z=L,X=H,t.width=Math.floor(L*re),t.height=Math.floor(H*re),J===!0&&(t.style.width=L+"px",t.style.height=H+"px"),this.setViewport(0,0,L,H)},this.getDrawingBufferSize=function(L){return L.set(Z*re,X*re).floor()},this.setDrawingBufferSize=function(L,H,J){Z=L,X=H,re=J,t.width=Math.floor(L*J),t.height=Math.floor(H*J),this.setViewport(0,0,L,H)},this.getCurrentViewport=function(L){return L.copy(w)},this.getViewport=function(L){return L.copy(te)},this.setViewport=function(L,H,J,K){L.isVector4?te.set(L.x,L.y,L.z,L.w):te.set(L,H,J,K),ae.viewport(w.copy(te).multiplyScalar(re).round())},this.getScissor=function(L){return L.copy(le)},this.setScissor=function(L,H,J,K){L.isVector4?le.set(L.x,L.y,L.z,L.w):le.set(L,H,J,K),ae.scissor(N.copy(le).multiplyScalar(re).round())},this.getScissorTest=function(){return we},this.setScissorTest=function(L){ae.setScissorTest(we=L)},this.setOpaqueSort=function(L){O=L},this.setTransparentSort=function(L){Q=L},this.getClearColor=function(L){return L.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor.apply(Ie,arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha.apply(Ie,arguments)},this.clear=function(L=!0,H=!0,J=!0){let K=0;if(L){let W=!1;if(P!==null){const Me=P.texture.format;W=Me===NA||Me===BA||Me===K0}if(W){const Me=P.texture.type,Le=Me===Zi||Me===Na||Me===Up||Me===Kc||Me===IA||Me===LA,Ve=Ie.getClearColor(),He=Ie.getClearAlpha(),qe=Ve.r,tt=Ve.g,We=Ve.b;Le?(f[0]=qe,f[1]=tt,f[2]=We,f[3]=He,B.clearBufferuiv(B.COLOR,0,f)):(v[0]=qe,v[1]=tt,v[2]=We,v[3]=He,B.clearBufferiv(B.COLOR,0,v))}else K|=B.COLOR_BUFFER_BIT}H&&(K|=B.DEPTH_BUFFER_BIT),J&&(K|=B.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),B.clear(K)},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",oe,!1),t.removeEventListener("webglcontextrestored",he,!1),t.removeEventListener("webglcontextcreationerror",Ee,!1),Ae.dispose(),Ue.dispose(),Ce.dispose(),U.dispose(),C.dispose(),ce.dispose(),be.dispose(),et.dispose(),de.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Rn),ve.removeEventListener("sessionend",xu),Qi.stop()};function oe(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function he(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const L=Xe.autoReset,H=_e.enabled,J=_e.autoUpdate,K=_e.needsUpdate,W=_e.type;z(),Xe.autoReset=L,_e.enabled=H,_e.autoUpdate=J,_e.needsUpdate=K,_e.type=W}function Ee(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Ze(L){const H=L.target;H.removeEventListener("dispose",Ze),lt(H)}function lt(L){Ct(L),Ce.remove(L)}function Ct(L){const H=Ce.get(L).programs;H!==void 0&&(H.forEach(function(J){de.releaseProgram(J)}),L.isShaderMaterial&&de.releaseShaderCache(L))}this.renderBufferDirect=function(L,H,J,K,W,Me){H===null&&(H=Qe);const Le=W.isMesh&&W.matrixWorld.determinant()<0,Ve=gm(L,H,J,K,W);ae.setMaterial(K,Le);let He=J.index,qe=1;if(K.wireframe===!0){if(He=ue.getWireframeAttribute(J),He===void 0)return;qe=2}const tt=J.drawRange,We=J.attributes.position;let At=tt.start*qe,Bt=(tt.start+tt.count)*qe;Me!==null&&(At=Math.max(At,Me.start*qe),Bt=Math.min(Bt,(Me.start+Me.count)*qe)),He!==null?(At=Math.max(At,0),Bt=Math.min(Bt,He.count)):We!=null&&(At=Math.max(At,0),Bt=Math.min(Bt,We.count));const Pt=Bt-At;if(Pt<0||Pt===1/0)return;be.setup(W,K,Ve,J,He);let ln,at=nt;if(He!==null&&(ln=Y.get(He),at=ke,at.setIndex(ln)),W.isMesh)K.wireframe===!0?(ae.setLineWidth(K.wireframeLinewidth*Ke()),at.setMode(B.LINES)):at.setMode(B.TRIANGLES);else if(W.isLine){let Be=K.linewidth;Be===void 0&&(Be=1),ae.setLineWidth(Be*Ke()),W.isLineSegments?at.setMode(B.LINES):W.isLineLoop?at.setMode(B.LINE_LOOP):at.setMode(B.LINE_STRIP)}else W.isPoints?at.setMode(B.POINTS):W.isSprite&&at.setMode(B.TRIANGLES);if(W.isBatchedMesh)if(W._multiDrawInstances!==null)at.renderMultiDrawInstances(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount,W._multiDrawInstances);else if(ge.get("WEBGL_multi_draw"))at.renderMultiDraw(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount);else{const Be=W._multiDrawStarts,kt=W._multiDrawCounts,ut=W._multiDrawCount,rn=He?Y.get(He).bytesPerElement:1,vi=Ce.get(K).currentProgram.getUniforms();for(let hn=0;hn{function Me(){if(K.forEach(function(Le){Ce.get(Le).currentProgram.isReady()&&K.delete(Le)}),K.size===0){W(L);return}setTimeout(Me,10)}ge.get("KHR_parallel_shader_compile")!==null?Me():setTimeout(Me,10)})};let vt=null;function Ln(L){vt&&vt(L)}function Rn(){Qi.stop()}function xu(){Qi.start()}const Qi=new o8;Qi.setAnimationLoop(Ln),typeof self<"u"&&Qi.setContext(self),this.setAnimationLoop=function(L){vt=L,ve.setAnimationLoop(L),L===null?Qi.stop():Qi.start()},ve.addEventListener("sessionstart",Rn),ve.addEventListener("sessionend",xu),this.render=function(L,H){if(H!==void 0&&H.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),H.parent===null&&H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),ve.enabled===!0&&ve.isPresenting===!0&&(ve.cameraAutoUpdate===!0&&ve.updateCamera(H),H=ve.getCamera()),L.isScene===!0&&L.onBeforeRender(x,L,H,P),y=Ue.get(L,S.length),y.init(H),S.push(y),Te.multiplyMatrices(H.projectionMatrix,H.matrixWorldInverse),Ne.setFromProjectionMatrix(Te),fe=this.localClippingEnabled,q=st.init(this.clippingPlanes,fe),_=Ae.get(L,m.length),_.init(),m.push(_),ve.enabled===!0&&ve.isPresenting===!0){const Me=x.xr.getDepthSensingMesh();Me!==null&&Ha(Me,H,-1/0,x.sortObjects)}Ha(L,H,0,x.sortObjects),_.finish(),x.sortObjects===!0&&_.sort(O,Q),je=ve.enabled===!1||ve.isPresenting===!1||ve.hasDepthSensing()===!1,je&&Ie.addToRenderList(_,L),this.info.render.frame++,q===!0&&st.beginShadows();const J=y.state.shadowsArray;_e.render(J,L,H),q===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset();const K=_.opaque,W=_.transmissive;if(y.setupLights(),H.isArrayCamera){const Me=H.cameras;if(W.length>0)for(let Le=0,Ve=Me.length;Le0&&Va(K,W,L,H),je&&Ie.render(L),$l(_,L,H);P!==null&&(De.updateMultisampleRenderTarget(P),De.updateRenderTargetMipmap(P)),L.isScene===!0&&L.onAfterRender(x,L,H),be.resetDefaultState(),I=-1,b=null,S.pop(),S.length>0?(y=S[S.length-1],q===!0&&st.setGlobalState(x.clippingPlanes,y.state.camera)):y=null,m.pop(),m.length>0?_=m[m.length-1]:_=null};function Ha(L,H,J,K){if(L.visible===!1)return;if(L.layers.test(H.layers)){if(L.isGroup)J=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(H);else if(L.isLight)y.pushLight(L),L.castShadow&&y.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||Ne.intersectsSprite(L)){K&&$e.setFromMatrixPosition(L.matrixWorld).applyMatrix4(Te);const Le=ce.update(L),Ve=L.material;Ve.visible&&_.push(L,Le,Ve,J,$e.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||Ne.intersectsObject(L))){const Le=ce.update(L),Ve=L.material;if(K&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),$e.copy(L.boundingSphere.center)):(Le.boundingSphere===null&&Le.computeBoundingSphere(),$e.copy(Le.boundingSphere.center)),$e.applyMatrix4(L.matrixWorld).applyMatrix4(Te)),Array.isArray(Ve)){const He=Le.groups;for(let qe=0,tt=He.length;qe0&&So(W,H,J),Me.length>0&&So(Me,H,J),Le.length>0&&So(Le,H,J),ae.buffers.depth.setTest(!0),ae.buffers.depth.setMask(!0),ae.buffers.color.setMask(!0),ae.setPolygonOffset(!1)}function Va(L,H,J,K){if((J.isScene===!0?J.overrideMaterial:null)!==null)return;y.state.transmissionRenderTarget[K.id]===void 0&&(y.state.transmissionRenderTarget[K.id]=new wi(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")||ge.has("EXT_color_buffer_float")?yd:Zi,minFilter:fo,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Sn.workingColorSpace}));const Me=y.state.transmissionRenderTarget[K.id],Le=K.viewport||w;Me.setSize(Le.z,Le.w);const Ve=x.getRenderTarget();x.setRenderTarget(Me),x.getClearColor(V),$=x.getClearAlpha(),$<1&&x.setClearColor(16777215,.5),x.clear(),je&&Ie.render(J);const He=x.toneMapping;x.toneMapping=$o;const qe=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),y.setupLightsView(K),q===!0&&st.setGlobalState(x.clippingPlanes,K),So(L,J,K),De.updateMultisampleRenderTarget(Me),De.updateRenderTargetMipmap(Me),ge.has("WEBGL_multisampled_render_to_texture")===!1){let tt=!1;for(let We=0,At=H.length;We0),We=!!J.morphAttributes.position,At=!!J.morphAttributes.normal,Bt=!!J.morphAttributes.color;let Pt=$o;K.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Pt=x.toneMapping);const ln=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,at=ln!==void 0?ln.length:0,Be=Ce.get(K),kt=y.state.lights;if(q===!0&&(fe===!0||L!==b)){const Tn=L===b&&K.id===I;st.setState(K,L,Tn)}let ut=!1;K.version===Be.__version?(Be.needsLights&&Be.lightsStateVersion!==kt.state.version||Be.outputColorSpace!==Ve||W.isBatchedMesh&&Be.batching===!1||!W.isBatchedMesh&&Be.batching===!0||W.isBatchedMesh&&Be.batchingColor===!0&&W.colorTexture===null||W.isBatchedMesh&&Be.batchingColor===!1&&W.colorTexture!==null||W.isInstancedMesh&&Be.instancing===!1||!W.isInstancedMesh&&Be.instancing===!0||W.isSkinnedMesh&&Be.skinning===!1||!W.isSkinnedMesh&&Be.skinning===!0||W.isInstancedMesh&&Be.instancingColor===!0&&W.instanceColor===null||W.isInstancedMesh&&Be.instancingColor===!1&&W.instanceColor!==null||W.isInstancedMesh&&Be.instancingMorph===!0&&W.morphTexture===null||W.isInstancedMesh&&Be.instancingMorph===!1&&W.morphTexture!==null||Be.envMap!==He||K.fog===!0&&Be.fog!==Me||Be.numClippingPlanes!==void 0&&(Be.numClippingPlanes!==st.numPlanes||Be.numIntersection!==st.numIntersection)||Be.vertexAlphas!==qe||Be.vertexTangents!==tt||Be.morphTargets!==We||Be.morphNormals!==At||Be.morphColors!==Bt||Be.toneMapping!==Pt||Be.morphTargetsCount!==at)&&(ut=!0):(ut=!0,Be.__version=K.version);let rn=Be.currentProgram;ut===!0&&(rn=Ao(K,H,W));let vi=!1,hn=!1,li=!1;const Ot=rn.getUniforms(),Ei=Be.uniforms;if(ae.useProgram(rn.program)&&(vi=!0,hn=!0,li=!0),K.id!==I&&(I=K.id,hn=!0),vi||b!==L){Ot.setValue(B,"projectionMatrix",L.projectionMatrix),Ot.setValue(B,"viewMatrix",L.matrixWorldInverse);const Tn=Ot.map.cameraPosition;Tn!==void 0&&Tn.setValue(B,Se.setFromMatrixPosition(L.matrixWorld)),Re.logarithmicDepthBuffer&&Ot.setValue(B,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&Ot.setValue(B,"isOrthographic",L.isOrthographicCamera===!0),b!==L&&(b=L,hn=!0,li=!0)}if(W.isSkinnedMesh){Ot.setOptional(B,W,"bindMatrix"),Ot.setOptional(B,W,"bindMatrixInverse");const Tn=W.skeleton;Tn&&(Tn.boneTexture===null&&Tn.computeBoneTexture(),Ot.setValue(B,"boneTexture",Tn.boneTexture,De))}W.isBatchedMesh&&(Ot.setOptional(B,W,"batchingTexture"),Ot.setValue(B,"batchingTexture",W._matricesTexture,De),Ot.setOptional(B,W,"batchingIdTexture"),Ot.setValue(B,"batchingIdTexture",W._indirectTexture,De),Ot.setOptional(B,W,"batchingColorTexture"),W._colorsTexture!==null&&Ot.setValue(B,"batchingColorTexture",W._colorsTexture,De));const aa=J.morphAttributes;if((aa.position!==void 0||aa.normal!==void 0||aa.color!==void 0)&&pt.update(W,J,rn),(hn||Be.receiveShadow!==W.receiveShadow)&&(Be.receiveShadow=W.receiveShadow,Ot.setValue(B,"receiveShadow",W.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(Ei.envMap.value=He,Ei.flipEnvMap.value=He.isCubeTexture&&He.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&H.environment!==null&&(Ei.envMapIntensity.value=H.environmentIntensity),hn&&(Ot.setValue(B,"toneMappingExposure",x.toneMappingExposure),Be.needsLights&&vm(Ei,li),Me&&K.fog===!0&&Ye.refreshFogUniforms(Ei,Me),Ye.refreshMaterialUniforms(Ei,K,re,X,y.state.transmissionRenderTarget[L.id]),j1.upload(B,Su(Be),Ei,De)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(j1.upload(B,Su(Be),Ei,De),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&Ot.setValue(B,"center",W.center),Ot.setValue(B,"modelViewMatrix",W.modelViewMatrix),Ot.setValue(B,"normalMatrix",W.normalMatrix),Ot.setValue(B,"modelMatrix",W.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){const Tn=K.uniformsGroups;for(let la=0,Nr=Tn.length;la0&&De.useMultisampledRTT(L)===!1?W=Ce.get(L).__webglMultisampledFramebuffer:Array.isArray(tt)?W=tt[J]:W=tt,w.copy(L.viewport),N.copy(L.scissor),G=L.scissorTest}else w.copy(te).multiplyScalar(re).floor(),N.copy(le).multiplyScalar(re).floor(),G=we;if(ae.bindFramebuffer(B.FRAMEBUFFER,W)&&K&&ae.drawBuffers(L,W),ae.viewport(w),ae.scissor(N),ae.setScissorTest(G),Me){const He=Ce.get(L.texture);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+H,He.__webglTexture,J)}else if(Le){const He=Ce.get(L.texture),qe=H||0;B.framebufferTextureLayer(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,He.__webglTexture,J||0,qe)}I=-1},this.readRenderTargetPixels=function(L,H,J,K,W,Me,Le){if(!(L&&L.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ve=Ce.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ve=Ve[Le]),Ve){ae.bindFramebuffer(B.FRAMEBUFFER,Ve);try{const He=L.texture,qe=He.format,tt=He.type;if(!Re.textureFormatReadable(qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Re.textureTypeReadable(tt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}H>=0&&H<=L.width-K&&J>=0&&J<=L.height-W&&B.readPixels(H,J,K,W,ie.convert(qe),ie.convert(tt),Me)}finally{const He=P!==null?Ce.get(P).__webglFramebuffer:null;ae.bindFramebuffer(B.FRAMEBUFFER,He)}}},this.readRenderTargetPixelsAsync=async function(L,H,J,K,W,Me,Le){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ve=Ce.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ve=Ve[Le]),Ve){ae.bindFramebuffer(B.FRAMEBUFFER,Ve);try{const He=L.texture,qe=He.format,tt=He.type;if(!Re.textureFormatReadable(qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Re.textureTypeReadable(tt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(H>=0&&H<=L.width-K&&J>=0&&J<=L.height-W){const We=B.createBuffer();B.bindBuffer(B.PIXEL_PACK_BUFFER,We),B.bufferData(B.PIXEL_PACK_BUFFER,Me.byteLength,B.STREAM_READ),B.readPixels(H,J,K,W,ie.convert(qe),ie.convert(tt),0),B.flush();const At=B.fenceSync(B.SYNC_GPU_COMMANDS_COMPLETE,0);await jte(B,At,4);try{B.bindBuffer(B.PIXEL_PACK_BUFFER,We),B.getBufferSubData(B.PIXEL_PACK_BUFFER,0,Me)}finally{B.deleteBuffer(We),B.deleteSync(At)}return Me}}finally{const He=P!==null?Ce.get(P).__webglFramebuffer:null;ae.bindFramebuffer(B.FRAMEBUFFER,He)}}},this.copyFramebufferToTexture=function(L,H=null,J=0){L.isTexture!==!0&&(xp("WebGLRenderer: copyFramebufferToTexture function signature has changed."),H=arguments[0]||null,L=arguments[1]);const K=Math.pow(2,-J),W=Math.floor(L.image.width*K),Me=Math.floor(L.image.height*K),Le=H!==null?H.x:0,Ve=H!==null?H.y:0;De.setTexture2D(L,0),B.copyTexSubImage2D(B.TEXTURE_2D,J,0,0,Le,Ve,W,Me),ae.unbindTexture()},this.copyTextureToTexture=function(L,H,J=null,K=null,W=0){L.isTexture!==!0&&(xp("WebGLRenderer: copyTextureToTexture function signature has changed."),K=arguments[0]||null,L=arguments[1],H=arguments[2],W=arguments[3]||0,J=null);let Me,Le,Ve,He,qe,tt;J!==null?(Me=J.max.x-J.min.x,Le=J.max.y-J.min.y,Ve=J.min.x,He=J.min.y):(Me=L.image.width,Le=L.image.height,Ve=0,He=0),K!==null?(qe=K.x,tt=K.y):(qe=0,tt=0);const We=ie.convert(H.format),At=ie.convert(H.type);De.setTexture2D(H,0),B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,H.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,H.unpackAlignment);const Bt=B.getParameter(B.UNPACK_ROW_LENGTH),Pt=B.getParameter(B.UNPACK_IMAGE_HEIGHT),ln=B.getParameter(B.UNPACK_SKIP_PIXELS),at=B.getParameter(B.UNPACK_SKIP_ROWS),Be=B.getParameter(B.UNPACK_SKIP_IMAGES),kt=L.isCompressedTexture?L.mipmaps[W]:L.image;B.pixelStorei(B.UNPACK_ROW_LENGTH,kt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,kt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,Ve),B.pixelStorei(B.UNPACK_SKIP_ROWS,He),L.isDataTexture?B.texSubImage2D(B.TEXTURE_2D,W,qe,tt,Me,Le,We,At,kt.data):L.isCompressedTexture?B.compressedTexSubImage2D(B.TEXTURE_2D,W,qe,tt,kt.width,kt.height,We,kt.data):B.texSubImage2D(B.TEXTURE_2D,W,qe,tt,Me,Le,We,At,kt),B.pixelStorei(B.UNPACK_ROW_LENGTH,Bt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt),B.pixelStorei(B.UNPACK_SKIP_PIXELS,ln),B.pixelStorei(B.UNPACK_SKIP_ROWS,at),B.pixelStorei(B.UNPACK_SKIP_IMAGES,Be),W===0&&H.generateMipmaps&&B.generateMipmap(B.TEXTURE_2D),ae.unbindTexture()},this.copyTextureToTexture3D=function(L,H,J=null,K=null,W=0){L.isTexture!==!0&&(xp("WebGLRenderer: copyTextureToTexture3D function signature has changed."),J=arguments[0]||null,K=arguments[1]||null,L=arguments[2],H=arguments[3],W=arguments[4]||0);let Me,Le,Ve,He,qe,tt,We,At,Bt;const Pt=L.isCompressedTexture?L.mipmaps[W]:L.image;J!==null?(Me=J.max.x-J.min.x,Le=J.max.y-J.min.y,Ve=J.max.z-J.min.z,He=J.min.x,qe=J.min.y,tt=J.min.z):(Me=Pt.width,Le=Pt.height,Ve=Pt.depth,He=0,qe=0,tt=0),K!==null?(We=K.x,At=K.y,Bt=K.z):(We=0,At=0,Bt=0);const ln=ie.convert(H.format),at=ie.convert(H.type);let Be;if(H.isData3DTexture)De.setTexture3D(H,0),Be=B.TEXTURE_3D;else if(H.isDataArrayTexture||H.isCompressedArrayTexture)De.setTexture2DArray(H,0),Be=B.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,H.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,H.unpackAlignment);const kt=B.getParameter(B.UNPACK_ROW_LENGTH),ut=B.getParameter(B.UNPACK_IMAGE_HEIGHT),rn=B.getParameter(B.UNPACK_SKIP_PIXELS),vi=B.getParameter(B.UNPACK_SKIP_ROWS),hn=B.getParameter(B.UNPACK_SKIP_IMAGES);B.pixelStorei(B.UNPACK_ROW_LENGTH,Pt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,He),B.pixelStorei(B.UNPACK_SKIP_ROWS,qe),B.pixelStorei(B.UNPACK_SKIP_IMAGES,tt),L.isDataTexture||L.isData3DTexture?B.texSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,at,Pt.data):H.isCompressedArrayTexture?B.compressedTexSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,Pt.data):B.texSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,at,Pt),B.pixelStorei(B.UNPACK_ROW_LENGTH,kt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,ut),B.pixelStorei(B.UNPACK_SKIP_PIXELS,rn),B.pixelStorei(B.UNPACK_SKIP_ROWS,vi),B.pixelStorei(B.UNPACK_SKIP_IMAGES,hn),W===0&&H.generateMipmaps&&B.generateMipmap(Be),ae.unbindTexture()},this.initRenderTarget=function(L){Ce.get(L).__webglFramebuffer===void 0&&De.setupRenderTarget(L)},this.initTexture=function(L){L.isCubeTexture?De.setTextureCube(L,0):L.isData3DTexture?De.setTexture3D(L,0):L.isDataArrayTexture||L.isCompressedArrayTexture?De.setTexture2DArray(L,0):De.setTexture2D(L,0),ae.unbindTexture()},this.resetState=function(){R=0,T=0,P=null,ae.reset(),be.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Aa}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===FA?"display-p3":"srgb",t.unpackColorSpace=Sn.workingColorSpace===q0?"display-p3":"srgb"}},m8=class g8{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ct(e),this.density=t}clone(){return new g8(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}},v8=class y8{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new ct(e),this.near=t,this.far=i}clone(){return new y8(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},Gp=class extends wn{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 Gs,this.environmentIntensity=1,this.environmentRotation=new Gs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},ty=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Yv,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ns()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return xp("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,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:eg.clone(),uv:bh.getInterpolation(eg,nx,ng,ix,wF,ib,EF,new Fe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function rx(n,e,t,i,r,s){af.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(tg.x=s*af.x-r*af.y,tg.y=r*af.x+s*af.y):tg.copy(af),n.copy(e),n.x+=tg.x,n.y+=tg.y,n.applyMatrix4(x8)}const sx=new j,TF=new j;let M8=class extends wn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){sx.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(sx);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){sx.setFromMatrixPosition(e.matrixWorld),TF.setFromMatrixPosition(this.matrixWorld);const i=sx.distanceTo(TF)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}};const lc=new Rt,ob=new Rt,dae=new Rt,fae=new ct(1,1,1),NF=new Rt,ab=new ey,lx=new Cr,zu=new sr,sg=new j,UF=new j,pae=new j,lb=new hae,mr=new si,cx=[];function mae(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new un(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Cr);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let i=0,r=t.length;i=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,i=this._matricesTexture,r=i.image.data;dae.toArray(r,t*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(fae.toArray(s.image.data,t*4),s.needsUpdate=!0),t}addGeometry(e,t=-1,i=-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 s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=e.getIndex(),u=c!==null;if(u&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&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 h=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:u?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Cr,sphereInitialized:!1,sphere:new sr}),this.setGeometryAt(h,e),h}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const f in i.attributes){const v=t.getAttribute(f),_=i.getAttribute(f);mae(v,_,l);const y=v.itemSize;for(let m=v.count,S=c;m=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let c=l.start,u=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,lx),lx.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let c=0;for(let u=l.start,h=l.start+l.count;u=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;mr.material=this.material,mr.geometry.index=o.index,mr.geometry.attributes=o.attributes,mr.geometry.boundingBox===null&&(mr.geometry.boundingBox=new Cr),mr.geometry.boundingSphere===null&&(mr.geometry.boundingSphere=new sr);for(let a=0,l=i.length;a({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._drawInfo=e._drawInfo.map(t=>({...t})),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,h=this._drawRanges,d=this.perObjectFrustumCulled,f=this._indirectTexture,v=f.image.data;d&&(NF.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),ab.setFromProjectionMatrix(NF,e.coordinateSystem));let _=0;if(this.sortObjects){ob.copy(this.matrixWorld).invert(),sg.setFromMatrixPosition(i.matrixWorld).applyMatrix4(ob),UF.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(ob);for(let S=0,x=l.length;S0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;cb.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(cb);if(!(le.far))return{distance:l,point:OF.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const kF=new j,zF=new j;let Qo=class extends Fl{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}let gae=class extends Yn{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:Vn,this.magFilter=s!==void 0?s:Vn,this.generateMipmaps=!1;const u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},vae=class extends Yn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=ri,this.minFilter=ri,this.generateMipmaps=!1,this.needsUpdate=!0}},VA=class extends Yn{constructor(e,t,i,r,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,r,s,h,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},yae=class extends VA{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Is,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},_ae=class extends VA{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Ul),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},xae=class extends Yn{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},ea=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],d=i[r+1]-u,f=(o-u)/d;return(r+f)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Fe:new j);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new j,r=[],s=[],o=[],a=new j,l=new Rt;for(let f=0;f<=e;f++){const v=f/e;r[f]=this.getTangentAt(v,new j)}s[0]=new j,o[0]=new j;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),d=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(fi(r[f-1].dot(r[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,v))}o[f].crossVectors(r[f],s[f])}if(t===!0){let f=Math.acos(fi(s[0].dot(s[e]),-1,1));f/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],f*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},WA=class extends ea{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Fe){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(px.subVectors(r[0],r[1]).add(r[0]),c=px);const h=r[a%s],d=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(VF(a,l.x,c.x,u.x,h.x),VF(a,l.y,c.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},qI=class P8 extends Vt{constructor(e=[new Fe(0,-.5),new Fe(.5,0),new Fe(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=fi(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,h=new j,d=new Fe,f=new j,v=new j,_=new j;let y=0,m=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:y=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,f.x=m*1,f.y=-y,f.z=m*0,_.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:y=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,f.x=m*1,f.y=-y,f.z=m*0,v.copy(f),f.x+=_.x,f.y+=_.y,f.z+=_.z,f.normalize(),l.push(f.x,f.y,f.z),_.copy(v)}for(let S=0;S<=t;S++){const x=i+S*u*r,M=Math.sin(x),R=Math.cos(x);for(let T=0;T<=e.length-1;T++){h.x=e[T].x*M,h.y=e[T].y,h.z=e[T].x*R,o.push(h.x,h.y,h.z),d.x=S/t,d.y=T/(e.length-1),a.push(d.x,d.y);const P=l[3*T+0]*M,I=l[3*T+1],b=l[3*T+0]*R;c.push(P,I,b)}}for(let S=0;S0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new Mt(h,3)),this.setAttribute("normal",new Mt(d,3)),this.setAttribute("uv",new Mt(f,2));function S(){const M=new j,R=new j;let T=0;const P=(t-e)/i;for(let I=0;I<=s;I++){const b=[],w=I/s,N=w*(t-e)+e;for(let G=0;G<=r;G++){const V=G/r,$=V*l+a,Z=Math.sin($),X=Math.cos($);R.x=N*Z,R.y=-w*i+y,R.z=N*X,h.push(R.x,R.y,R.z),M.set(Z,P,X).normalize(),d.push(M.x,M.y,M.z),f.push(V,1-w),b.push(v++)}_.push(b)}for(let I=0;I.9&&P<.1&&(x<.2&&(o[S+0]+=1),M<.2&&(o[S+2]+=1),R<.2&&(o[S+4]+=1))}}function d(S){s.push(S.x,S.y,S.z)}function f(S,x){const M=S*3;x.x=e[M+0],x.y=e[M+1],x.z=e[M+2]}function v(){const S=new j,x=new j,M=new j,R=new j,T=new Fe,P=new Fe,I=new Fe;for(let b=0,w=0;b80*t){a=c=n[0],l=u=n[1];for(let v=t;vc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?32767/f:0}return Zv(s,o,t,a,l,f,0),o}};function H8(n,e,t,i,r){let s,o;if(r===Wae(n,e,t,i)>0)for(s=e;s=e;s-=i)o=WF(s,n[s],n[s+1],o);return o&&XA(o,o.next)&&(e0(o),o=o.next),o}function rd(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(XA(t,t.next)||ni(t.prev,t,t.next)===0)){if(e0(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Zv(n,e,t,i,r,s,o){if(!n)return;!o&&s&&Oae(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?Pae(n,i,r,s):Rae(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),e0(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=Iae(rd(n),e,t),Zv(n,e,t,i,r,s,2)):o===2&&Lae(n,e,t,i,r,s):Zv(rd(n),e,t,i,r,s,1);break}}}function Rae(n){const e=n.prev,t=n,i=n.next;if(ni(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=rs?r>o?r:o:s>o?s:o,f=a>l?a>c?a:c:l>c?l:c;let v=i.next;for(;v!==e;){if(v.x>=u&&v.x<=d&&v.y>=h&&v.y<=f&&np(r,a,s,l,o,c,v.x,v.y)&&ni(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function Pae(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ni(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,h=s.y,d=o.y,f=al?a>c?a:c:l>c?l:c,y=u>h?u>d?u:d:h>d?h:d,m=ZR(f,v,e,t,i),S=ZR(_,y,e,t,i);let x=n.prevZ,M=n.nextZ;for(;x&&x.z>=m&&M&&M.z<=S;){if(x.x>=f&&x.x<=_&&x.y>=v&&x.y<=y&&x!==r&&x!==o&&np(a,u,l,h,c,d,x.x,x.y)&&ni(x.prev,x,x.next)>=0||(x=x.prevZ,M.x>=f&&M.x<=_&&M.y>=v&&M.y<=y&&M!==r&&M!==o&&np(a,u,l,h,c,d,M.x,M.y)&&ni(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;x&&x.z>=m;){if(x.x>=f&&x.x<=_&&x.y>=v&&x.y<=y&&x!==r&&x!==o&&np(a,u,l,h,c,d,x.x,x.y)&&ni(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;M&&M.z<=S;){if(M.x>=f&&M.x<=_&&M.y>=v&&M.y<=y&&M!==r&&M!==o&&np(a,u,l,h,c,d,M.x,M.y)&&ni(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function Iae(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!XA(r,s)&&V8(r,i,i.next,s)&&Qv(r,s)&&Qv(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),e0(i),e0(i.next),i=n=s),i=i.next}while(i!==n);return rd(i)}function Lae(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Gae(o,a)){let l=W8(o,a);o=rd(o,o.next),l=rd(l,l.next),Zv(o,e,t,i,r,s,0),Zv(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function Dae(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const d=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=s&&d>i&&(i=d,r=t.x=t.x&&t.x>=l&&s!==t.x&&np(or.x||t.x===r.x&&Fae(r,t)))&&(r=t,u=h)),t=t.next;while(t!==a);return r}function Fae(n,e){return ni(n.prev,n,e.prev)<0&&ni(e.next,n,n.next)<0}function Oae(n,e,t,i){let r=n;do r.z===0&&(r.z=ZR(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,kae(r)}function kae(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function ZR(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function zae(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function Gae(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!Hae(n,e)&&(Qv(n,e)&&Qv(e,n)&&Vae(n,e)&&(ni(n.prev,n,e.prev)||ni(n,e.prev,e))||XA(n,e)&&ni(n.prev,n,n.next)>0&&ni(e.prev,e,e.next)>0)}function ni(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function XA(n,e){return n.x===e.x&&n.y===e.y}function V8(n,e,t,i){const r=_x(ni(n,e,t)),s=_x(ni(n,e,i)),o=_x(ni(t,i,n)),a=_x(ni(t,i,e));return!!(r!==s&&o!==a||r===0&&yx(n,t,e)||s===0&&yx(n,i,e)||o===0&&yx(t,n,i)||a===0&&yx(t,e,i))}function yx(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function _x(n){return n>0?1:n<0?-1:0}function Hae(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&V8(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Qv(n,e){return ni(n.prev,n,n.next)<0?ni(n,e,n.next)>=0&&ni(n,n.prev,e)>=0:ni(n,e,n.prev)<0||ni(n,n.next,e)<0}function Vae(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function W8(n,e){const t=new QR(n.i,n.x,n.y),i=new QR(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function WF(n,e,t,i){const r=new QR(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function e0(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function QR(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Wae(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function XF(n,e){for(let t=0;tNumber.EPSILON){const ce=Math.sqrt(Y),de=Math.sqrt(U*U+C*C),Ye=me.x-De/ce,Ae=me.y+Ce/ce,Ue=ge.x-C/de,st=ge.y+U/de,_e=((Ue-Ye)*C-(st-Ae)*U)/(Ce*C-De*U);Re=Ye+Ce*_e-B.x,ae=Ae+De*_e-B.y;const Ie=Re*Re+ae*ae;if(Ie<=2)return new Fe(Re,ae);Xe=Math.sqrt(Ie/2)}else{let ce=!1;Ce>Number.EPSILON?U>Number.EPSILON&&(ce=!0):Ce<-Number.EPSILON?U<-Number.EPSILON&&(ce=!0):Math.sign(De)===Math.sign(C)&&(ce=!0),ce?(Re=-De,ae=Ce,Xe=Math.sqrt(Y)):(Re=Ce,ae=De,Xe=Math.sqrt(Y/2))}return new Fe(Re/Xe,ae/Xe)}const Q=[];for(let B=0,me=$.length,ge=me-1,Re=B+1;B=0;B--){const me=B/y,ge=f*Math.cos(me*Math.PI/2),Re=v*Math.sin(me*Math.PI/2)+_;for(let ae=0,Xe=$.length;ae=0;){const Re=ge;let ae=ge-1;ae<0&&(ae=B.length-1);for(let Xe=0,Ce=u+y*2;Xe0)&&f.push(x,M,T),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},f9=class extends mi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ct(16777215),this.specular=new ct(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gs,this.combine=J0,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}},p9=class extends mi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ct(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(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}},eL=class extends mi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(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}},m9=class extends mi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ct(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gs,this.combine=J0,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}},g9=class extends mi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ct(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(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}},v9=class extends Lr{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 Ch(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function y9(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function _9(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function eP(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function tL(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function Yae(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){h.push(c.times[f]);for(let _=0;_s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const m=v*h+u,S=m+h-u;_=a.values.slice(m,S)}else{const m=a.createInterpolant(),S=u,x=h-u;m.evaluate(s),_=m.resultBuffer.slice(S,x)}l==="quaternion"&&new qi().fromArray(_).normalize().conjugate().toArray(_);const y=c.times.length;for(let m=0;m=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&y9(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===W1,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};ta.prototype.TimeBufferType=Float32Array;ta.prototype.ValueBufferType=Float32Array;ta.prototype.DefaultInterpolation=Op;let xd=class extends ta{constructor(e,t,i){super(e,t,i)}};xd.prototype.ValueTypeName="bool";xd.prototype.ValueBufferType=Array;xd.prototype.DefaultInterpolation=Fp;xd.prototype.InterpolantFactoryMethodLinear=void 0;xd.prototype.InterpolantFactoryMethodSmooth=void 0;let iL=class extends ta{};iL.prototype.ValueTypeName="color";let sd=class extends ta{};sd.prototype.ValueTypeName="number";let M9=class extends om{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)qi.slerpFlat(s,0,o,c-a,o,c,l);return s}},od=class extends ta{InterpolantFactoryMethodLinear(e){return new M9(this.times,this.values,this.getValueSize(),e)}};od.prototype.ValueTypeName="quaternion";od.prototype.InterpolantFactoryMethodSmooth=void 0;let Sd=class extends ta{constructor(e,t,i){super(e,t,i)}};Sd.prototype.ValueTypeName="string";Sd.prototype.ValueBufferType=Array;Sd.prototype.DefaultInterpolation=Fp;Sd.prototype.InterpolantFactoryMethodLinear=void 0;Sd.prototype.InterpolantFactoryMethodSmooth=void 0;let ad=class extends ta{};ad.prototype.ValueTypeName="vector";let Vp=class{constructor(e="",t=-1,i=[],r=UA){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Ns(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(Zae(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(ta.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const h=u[1];let d=r[h];d||(r[h]=d=[]),d.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,d,f,v,_){if(f.length!==0){const y=[],m=[];tL(f,y,m,v),y.length!==0&&_.push(new h(d,y,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(tl[e]!==void 0){tl[e].push({onLoad:t,onProgress:i,onError:r});return}tl[e]=[],tl[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=tl[e],h=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,v=f!==0;let _=0;const y=new ReadableStream({start(m){S();function S(){h.read().then(({done:x,value:M})=>{if(x)m.close();else{_+=M.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:_,total:f});for(let T=0,P=u.length;T{m.error(x)})}}});return new Response(y)}else throw new Qae(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(v=>f.decode(v))}}}).then(c=>{xl.add(e,c);const u=tl[e];delete tl[e];for(let h=0,d=u.length;h{const u=tl[e];if(u===void 0)throw this.manager.itemError(e),c;delete tl[e];for(let h=0,d=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},ele=class extends Dr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Hs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new ct().setHex(o.value);break;case"v2":r.uniforms[s].value=new Fe().fromArray(o.value);break;case"v3":r.uniforms[s].value=new j().fromArray(o.value);break;case"v4":r.uniforms[s].value=new bn().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Zt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Rt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Fe().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Fe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:h9,SpriteMaterial:kI,RawShaderMaterial:d9,ShaderMaterial:Oi,PointsMaterial:ny,MeshPhysicalMaterial:xo,MeshStandardMaterial:iy,MeshPhongMaterial:f9,MeshToonMaterial:p9,MeshNormalMaterial:eL,MeshLambertMaterial:m9,MeshDepthMaterial:FI,MeshDistanceMaterial:OI,MeshBasicMaterial:Ls,MeshMatcapMaterial:g9,LineDashedMaterial:v9,LineBasicMaterial:Lr,Material:mi};return new t[e]}},Vc=class{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new rL(t);s=new t0(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){r=new t0(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const y=new Cr;y.min.fromArray(_.boxMin),y.max.fromArray(_.boxMax);const m=new sr;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:y,sphereInitialized:_.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new M8;break;case"Line":o=new Fl(a(e.geometry),l(e.material));break;case"LineLoop":o=new VI(a(e.geometry),l(e.material));break;case"LineSegments":o=new Qo(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new WI(a(e.geometry),l(e.material));break;case"Sprite":o=new S8(l(e.material));break;case"Group":o=new _l;break;case"Bone":o=new HA;break;default:o=new wn}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let f=0;f"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=xl.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return xl.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),xl.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});xl.add(e,l),s.manager.itemStart(e)}},xx,cL=class{static getContext(){return xx===void 0&&(xx=new(window.AudioContext||window.webkitAudioContext)),xx}static setContext(e){xx=e}},cle=class extends Dr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Hs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);cL.getContext().decodeAudioData(c,function(h){t(h)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}};const eO=new Rt,tO=new Rt,Gu=new Rt;let ule=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Gn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Gn,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,Gu.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Hh*t.fov*.5)/t.zoom;let a,l;tO.elements[12]=-r,eO.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Gu.elements[0]=2*t.near/(l-a),Gu.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Gu),a=-o*t.aspect-s,l=o*t.aspect-s,Gu.elements[0]=2*t.near/(l-a),Gu.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Gu)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(tO),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(eO)}},uL=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=nO(),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=nO();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function nO(){return(typeof performance>"u"?Date:performance).now()}const Hu=new j,iO=new qi,hle=new j,Vu=new j;let dle=class extends wn{constructor(){super(),this.type="AudioListener",this.context=cL.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new uL}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Hu,iO,hle),Vu.set(0,0,-1).applyQuaternion(iO),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Hu.x,r),t.positionY.linearRampToValueAtTime(Hu.y,r),t.positionZ.linearRampToValueAtTime(Hu.z,r),t.forwardX.linearRampToValueAtTime(Vu.x,r),t.forwardY.linearRampToValueAtTime(Vu.y,r),t.forwardZ.linearRampToValueAtTime(Vu.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Hu.x,Hu.y,Hu.z),t.setOrientation(Vu.x,Vu.y,Vu.z,i.x,i.y,i.z)}},D9=class extends wn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){qi.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;qi.multiplyQuaternionsFlat(e,o,e,t,e,i),qi.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}};const hL="\\[\\]\\.:\\/",gle=new RegExp("["+hL+"]","g"),dL="[^"+hL+"]",vle="[^"+hL.replace("\\.","")+"]",yle=/((?:WC+[\/:])*)/.source.replace("WC",dL),_le=/(WCOD+)?/.source.replace("WCOD",vle),xle=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",dL),Sle=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",dL),Mle=new RegExp("^"+yle+_le+xle+Sle+"$"),Ale=["material","materials","bones","map"];let wle=class{constructor(e,t,i){const r=i||Dn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},Dn=class Lf{constructor(e,t,i){this.path=t,this.parsedPath=i||Lf.parseTrackName(t),this.node=Lf.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Lf.Composite(e,t,i):new Lf(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(gle,"")}static parseTrackName(e){const t=Mle.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);Ale.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,v=r;f!==v;++f){const _=i[f],y=_[h],m=_[u];_[u]=y,_[h]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let v=0,_=r;v!==_;++v){const y=i[v];y[h]=y[d],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){const v=l[d];h[d]=new Dn(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}},N9=class{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:wh,endingEnd:wh};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=B5,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case TI:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case UA:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===N5;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===D5){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Eh,r.endingEnd=Eh):(e?r.endingStart=this.zeroSlopeAtStart?Eh:wh:r.endingStart=Wv,t?r.endingEnd=this.zeroSlopeAtEnd?Eh:wh:r.endingEnd=Wv)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}};const Tle=new Float32Array(1);let ble=class extends vs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){const d=r[h],f=d.name;let v=u[f];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,f));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;v=new B9(Dn.create(i,f,_),d.ValueTypeName,d.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,f),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=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,aO).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 lO=new j,Sx=new j;let Nle=class{constructor(e=new j,t=new j){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){lO.subVectors(e,this.start),Sx.subVectors(this.end,this.start);const i=Sx.dot(Sx);let s=Sx.dot(lO)/i;return t&&(s=fi(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}};const cO=new j;let Ule=class extends wn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Vt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{pO.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(pO,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},Jle=class extends Qo{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Vt;r.setAttribute("position",new Mt(t,3)),r.setAttribute("color",new Mt(i,3));const s=new Lr({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new ct,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Kle=class{constructor(){this.type="ShapePath",this.color=new ct,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new qv,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const S=[];for(let x=0,M=m.length;xNumber.EPSILON){if(w<0&&(P=S[T],b=-b,I=S[R],w=-w),m.yI.y)continue;if(m.y===P.y){if(m.x===P.x)return!0}else{const N=w*(m.x-P.x)-b*(m.y-P.y);if(N===0)return!0;if(N<0)continue;M=!M}}else{if(m.y!==P.y)continue;if(I.x<=m.x&&m.x<=P.x||P.x<=m.x&&m.x<=I.x)return!0}}return M}const r=Hc.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Wh,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const h=[],d=[];let f=[],v=0,_;d[v]=void 0,f[v]=[];for(let m=0,S=s.length;m1){let m=!1,S=0;for(let x=0,M=d.length;x0&&m===!1&&(f=h)}let y;for(let m=0,S=d.length;m=0&&(M[Se]=null,x[Se].disconnect(Te))}for(let fe=0;fe=M.length){M.push(Te),Se=Qe;break}else if(M[Qe]===null){M[Qe]=Te,Se=Qe;break}if(Se===-1)break}const $e=x[Se];$e&&$e.connect(Te)}}const X=new j,re=new j;function O(q,fe,Te){X.setFromMatrixPosition(fe.matrixWorld),re.setFromMatrixPosition(Te.matrixWorld);const Se=X.distanceTo(re),$e=fe.projectionMatrix.elements,Qe=Te.projectionMatrix.elements,je=$e[14]/($e[10]-1),Ke=$e[14]/($e[10]+1),B=($e[9]+1)/$e[5],me=($e[9]-1)/$e[5],ge=($e[8]-1)/$e[0],Re=(Qe[8]+1)/Qe[0],ae=je*ge,Xe=je*Re,Ce=Se/(-ge+Re),De=Ce*-ge;if(fe.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(De),q.translateZ(Ce),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),$e[10]===-1)q.projectionMatrix.copy(fe.projectionMatrix),q.projectionMatrixInverse.copy(fe.projectionMatrixInverse);else{const U=je+Ce,C=Ke+Ce,Y=ae-De,ue=Xe+(Se-De),ce=B*Ke/C*U,de=me*Ke/C*U;q.projectionMatrix.makePerspective(Y,ue,ce,de,U,C),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function Q(q,fe){fe===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(fe.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(r===null)return;let fe=q.near,Te=q.far;_.texture!==null&&(_.depthNear>0&&(fe=_.depthNear),_.depthFar>0&&(Te=_.depthFar)),w.near=I.near=P.near=fe,w.far=I.far=P.far=Te,(N!==w.near||G!==w.far)&&(r.updateRenderState({depthNear:w.near,depthFar:w.far}),N=w.near,G=w.far);const Se=q.parent,$e=w.cameras;Q(w,Se);for(let Qe=0;Qe<$e.length;Qe++)Q($e[Qe],Se);$e.length===2?O(w,P,I):w.projectionMatrix.copy(P.projectionMatrix),te(q,w,Se)};function te(q,fe,Te){Te===null?q.matrix.copy(fe.matrixWorld):(q.matrix.copy(Te.matrixWorld),q.matrix.invert(),q.matrix.multiply(fe.matrixWorld)),q.matrix.decompose(q.position,q.quaternion,q.scale),q.updateMatrixWorld(!0),q.projectionMatrix.copy(fe.projectionMatrix),q.projectionMatrixInverse.copy(fe.projectionMatrixInverse),q.isPerspectiveCamera&&(q.fov=zp*2*Math.atan(1/q.projectionMatrix.elements[5]),q.zoom=1)}this.getCamera=function(){return w},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(q){l=q,d!==null&&(d.fixedFoveation=q),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=q)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(w)};let le=null;function we(q,fe){if(u=fe.getViewerPose(c||o),v=fe,u!==null){const Te=u.views;f!==null&&(e.setRenderTargetFramebuffer(S,f.framebuffer),e.setRenderTarget(S));let Se=!1;Te.length!==w.cameras.length&&(w.cameras.length=0,Se=!0);for(let Qe=0;Qe0&&(y.alphaTest.value=m.alphaTest);const S=e.get(m),x=S.envMap,M=S.envMapRotation;x&&(y.envMap.value=x,ku.copy(M),ku.x*=-1,ku.y*=-1,ku.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(ku.y*=-1,ku.z*=-1),y.envMapRotation.value.setFromMatrix4(aae.makeRotationFromEuler(ku)),y.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=m.reflectivity,y.ior.value=m.ior,y.refractionRatio.value=m.refractionRatio),m.lightMap&&(y.lightMap.value=m.lightMap,y.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,y.lightMapTransform)),m.aoMap&&(y.aoMap.value=m.aoMap,y.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,y.aoMapTransform))}function o(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform))}function a(y,m){y.dashSize.value=m.dashSize,y.totalSize.value=m.dashSize+m.gapSize,y.scale.value=m.scale}function l(y,m,S,x){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.size.value=m.size*S,y.scale.value=x*.5,m.map&&(y.map.value=m.map,t(m.map,y.uvTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function c(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.rotation.value=m.rotation,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function u(y,m){y.specular.value.copy(m.specular),y.shininess.value=Math.max(m.shininess,1e-4)}function h(y,m){m.gradientMap&&(y.gradientMap.value=m.gradientMap)}function d(y,m){y.metalness.value=m.metalness,m.metalnessMap&&(y.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,y.metalnessMapTransform)),y.roughness.value=m.roughness,m.roughnessMap&&(y.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,y.roughnessMapTransform)),m.envMap&&(y.envMapIntensity.value=m.envMapIntensity)}function f(y,m,S){y.ior.value=m.ior,m.sheen>0&&(y.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),y.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(y.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,y.sheenColorMapTransform)),m.sheenRoughnessMap&&(y.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,y.sheenRoughnessMapTransform))),m.clearcoat>0&&(y.clearcoat.value=m.clearcoat,y.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(y.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,y.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(y.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Fi&&y.clearcoatNormalScale.value.negate())),m.dispersion>0&&(y.dispersion.value=m.dispersion),m.iridescence>0&&(y.iridescence.value=m.iridescence,y.iridescenceIOR.value=m.iridescenceIOR,y.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(y.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,y.iridescenceMapTransform)),m.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),m.transmission>0&&(y.transmission.value=m.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),m.transmissionMap&&(y.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,y.transmissionMapTransform)),y.thickness.value=m.thickness,m.thicknessMap&&(y.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=m.attenuationDistance,y.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(y.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(y.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=m.specularIntensity,y.specularColor.value.copy(m.specularColor),m.specularColorMap&&(y.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,y.specularColorMapTransform)),m.specularIntensityMap&&(y.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,m){m.matcap&&(y.matcap.value=m.matcap)}function _(y,m){const S=e.get(m).light;y.referencePosition.value.setFromMatrixPosition(S.matrixWorld),y.nearDistance.value=S.shadow.camera.near,y.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function cae(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,x){const M=x.program;i.uniformBlockBinding(S,M)}function c(S,x){let M=r[S.id];M===void 0&&(v(S),M=u(S),r[S.id]=M,S.addEventListener("dispose",y));const R=x.program;i.updateUBOMapping(S,R);const T=e.render.frame;s[S.id]!==T&&(d(S),s[S.id]=T)}function u(S){const x=h();S.__bindingPointIndex=x;const M=n.createBuffer(),R=S.__size,T=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,R,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,M),M}function h(){for(let S=0;S0&&(M+=R-T),S.__size=M,S.__cache={},this}function _(S){const x={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(x.boundary=4,x.storage=4):S.isVector2?(x.boundary=8,x.storage=8):S.isVector3||S.isColor?(x.boundary=16,x.storage=12):S.isVector4?(x.boundary=16,x.storage=16):S.isMatrix3?(x.boundary=48,x.storage=48):S.isMatrix4?(x.boundary=64,x.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),x}function y(S){const x=S.target;x.removeEventListener("dispose",y);const M=o.indexOf(x.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function m(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:c,dispose:m}}let y8=class{constructor(e={}){const{canvas:t=Q5(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=o;const f=new Uint32Array(4),v=new Int32Array(4);let _=null,y=null;const m=[],S=[];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=Dn,this.toneMapping=$o,this.toneMappingExposure=1;const x=this;let M=!1,R=0,T=0,P=null,I=-1,b=null;const w=new bn,N=new bn;let G=null;const V=new ct(0);let $=0,Z=t.width,X=t.height,re=1,O=null,Q=null;const te=new bn(0,0,Z,X),le=new bn(0,0,Z,X);let we=!1;const Ne=new Q0;let q=!1,fe=!1;const Te=new Rt,Se=new j,$e=new bn,Qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let je=!1;function Ke(){return P===null?re:1}let B=i;function me(L,H){return t.getContext(L,H)}try{const L={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${uu}`),t.addEventListener("webglcontextlost",oe,!1),t.addEventListener("webglcontextrestored",he,!1),t.addEventListener("webglcontextcreationerror",Ee,!1),B===null){const H="webgl2";if(B=me(H,L),B===null)throw me(H)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}let ge,Re,ae,Xe,Ce,De,U,C,Y,ue,ce,de,Ye,Ae,Ue,st,_e,Ie,pt,nt,ke,ie,be,et;function z(){ge=new gse(B),ge.init(),ie=new g8(B,ge),Re=new use(B,ge,e,ie),ae=new Joe(B),Xe=new _se(B),Ce=new Foe,De=new tae(B,ge,ae,Ce,Re,ie,Xe),U=new dse(x),C=new mse(x),Y=new Tne(B),be=new lse(B,Y),ue=new vse(B,Y,Xe,be),ce=new Sse(B,ue,Y,Xe),pt=new xse(B,Re,De),st=new hse(Ce),de=new Uoe(x,U,C,ge,Re,be,st),Ye=new lae(x,Ce),Ae=new koe,Ue=new $oe(ge),Ie=new ase(x,U,C,ae,ce,d,l),_e=new Yoe(x,ce,Re),et=new cae(B,Xe,Re,ae),nt=new cse(B,ge,Xe),ke=new yse(B,ge,Xe),Xe.programs=de.programs,x.capabilities=Re,x.extensions=ge,x.properties=Ce,x.renderLists=Ae,x.shadowMap=_e,x.state=ae,x.info=Xe}z();const ve=new oae(x,B);this.xr=ve,this.getContext=function(){return B},this.getContextAttributes=function(){return B.getContextAttributes()},this.forceContextLoss=function(){const L=ge.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=ge.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return re},this.setPixelRatio=function(L){L!==void 0&&(re=L,this.setSize(Z,X,!1))},this.getSize=function(L){return L.set(Z,X)},this.setSize=function(L,H,J=!0){if(ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Z=L,X=H,t.width=Math.floor(L*re),t.height=Math.floor(H*re),J===!0&&(t.style.width=L+"px",t.style.height=H+"px"),this.setViewport(0,0,L,H)},this.getDrawingBufferSize=function(L){return L.set(Z*re,X*re).floor()},this.setDrawingBufferSize=function(L,H,J){Z=L,X=H,re=J,t.width=Math.floor(L*J),t.height=Math.floor(H*J),this.setViewport(0,0,L,H)},this.getCurrentViewport=function(L){return L.copy(w)},this.getViewport=function(L){return L.copy(te)},this.setViewport=function(L,H,J,K){L.isVector4?te.set(L.x,L.y,L.z,L.w):te.set(L,H,J,K),ae.viewport(w.copy(te).multiplyScalar(re).round())},this.getScissor=function(L){return L.copy(le)},this.setScissor=function(L,H,J,K){L.isVector4?le.set(L.x,L.y,L.z,L.w):le.set(L,H,J,K),ae.scissor(N.copy(le).multiplyScalar(re).round())},this.getScissorTest=function(){return we},this.setScissorTest=function(L){ae.setScissorTest(we=L)},this.setOpaqueSort=function(L){O=L},this.setTransparentSort=function(L){Q=L},this.getClearColor=function(L){return L.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor.apply(Ie,arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha.apply(Ie,arguments)},this.clear=function(L=!0,H=!0,J=!0){let K=0;if(L){let W=!1;if(P!==null){const Me=P.texture.format;W=Me===DA||Me===LA||Me===J0}if(W){const Me=P.texture.type,Le=Me===Zi||Me===Na||Me===Fp||Me===Kc||Me===RA||Me===PA,Ve=Ie.getClearColor(),He=Ie.getClearAlpha(),qe=Ve.r,tt=Ve.g,We=Ve.b;Le?(f[0]=qe,f[1]=tt,f[2]=We,f[3]=He,B.clearBufferuiv(B.COLOR,0,f)):(v[0]=qe,v[1]=tt,v[2]=We,v[3]=He,B.clearBufferiv(B.COLOR,0,v))}else K|=B.COLOR_BUFFER_BIT}H&&(K|=B.DEPTH_BUFFER_BIT),J&&(K|=B.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),B.clear(K)},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",oe,!1),t.removeEventListener("webglcontextrestored",he,!1),t.removeEventListener("webglcontextcreationerror",Ee,!1),Ae.dispose(),Ue.dispose(),Ce.dispose(),U.dispose(),C.dispose(),ce.dispose(),be.dispose(),et.dispose(),de.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Rn),ve.removeEventListener("sessionend",xu),Qi.stop()};function oe(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function he(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const L=Xe.autoReset,H=_e.enabled,J=_e.autoUpdate,K=_e.needsUpdate,W=_e.type;z(),Xe.autoReset=L,_e.enabled=H,_e.autoUpdate=J,_e.needsUpdate=K,_e.type=W}function Ee(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Ze(L){const H=L.target;H.removeEventListener("dispose",Ze),lt(H)}function lt(L){Ct(L),Ce.remove(L)}function Ct(L){const H=Ce.get(L).programs;H!==void 0&&(H.forEach(function(J){de.releaseProgram(J)}),L.isShaderMaterial&&de.releaseShaderCache(L))}this.renderBufferDirect=function(L,H,J,K,W,Me){H===null&&(H=Qe);const Le=W.isMesh&&W.matrixWorld.determinant()<0,Ve=vm(L,H,J,K,W);ae.setMaterial(K,Le);let He=J.index,qe=1;if(K.wireframe===!0){if(He=ue.getWireframeAttribute(J),He===void 0)return;qe=2}const tt=J.drawRange,We=J.attributes.position;let At=tt.start*qe,Bt=(tt.start+tt.count)*qe;Me!==null&&(At=Math.max(At,Me.start*qe),Bt=Math.min(Bt,(Me.start+Me.count)*qe)),He!==null?(At=Math.max(At,0),Bt=Math.min(Bt,He.count)):We!=null&&(At=Math.max(At,0),Bt=Math.min(Bt,We.count));const Pt=Bt-At;if(Pt<0||Pt===1/0)return;be.setup(W,K,Ve,J,He);let ln,at=nt;if(He!==null&&(ln=Y.get(He),at=ke,at.setIndex(ln)),W.isMesh)K.wireframe===!0?(ae.setLineWidth(K.wireframeLinewidth*Ke()),at.setMode(B.LINES)):at.setMode(B.TRIANGLES);else if(W.isLine){let Be=K.linewidth;Be===void 0&&(Be=1),ae.setLineWidth(Be*Ke()),W.isLineSegments?at.setMode(B.LINES):W.isLineLoop?at.setMode(B.LINE_LOOP):at.setMode(B.LINE_STRIP)}else W.isPoints?at.setMode(B.POINTS):W.isSprite&&at.setMode(B.TRIANGLES);if(W.isBatchedMesh)if(W._multiDrawInstances!==null)at.renderMultiDrawInstances(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount,W._multiDrawInstances);else if(ge.get("WEBGL_multi_draw"))at.renderMultiDraw(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount);else{const Be=W._multiDrawStarts,kt=W._multiDrawCounts,ut=W._multiDrawCount,rn=He?Y.get(He).bytesPerElement:1,vi=Ce.get(K).currentProgram.getUniforms();for(let hn=0;hn{function Me(){if(K.forEach(function(Le){Ce.get(Le).currentProgram.isReady()&&K.delete(Le)}),K.size===0){W(L);return}setTimeout(Me,10)}ge.get("KHR_parallel_shader_compile")!==null?Me():setTimeout(Me,10)})};let vt=null;function In(L){vt&&vt(L)}function Rn(){Qi.stop()}function xu(){Qi.start()}const Qi=new u8;Qi.setAnimationLoop(In),typeof self<"u"&&Qi.setContext(self),this.setAnimationLoop=function(L){vt=L,ve.setAnimationLoop(L),L===null?Qi.stop():Qi.start()},ve.addEventListener("sessionstart",Rn),ve.addEventListener("sessionend",xu),this.render=function(L,H){if(H!==void 0&&H.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),H.parent===null&&H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),ve.enabled===!0&&ve.isPresenting===!0&&(ve.cameraAutoUpdate===!0&&ve.updateCamera(H),H=ve.getCamera()),L.isScene===!0&&L.onBeforeRender(x,L,H,P),y=Ue.get(L,S.length),y.init(H),S.push(y),Te.multiplyMatrices(H.projectionMatrix,H.matrixWorldInverse),Ne.setFromProjectionMatrix(Te),fe=this.localClippingEnabled,q=st.init(this.clippingPlanes,fe),_=Ae.get(L,m.length),_.init(),m.push(_),ve.enabled===!0&&ve.isPresenting===!0){const Me=x.xr.getDepthSensingMesh();Me!==null&&Ha(Me,H,-1/0,x.sortObjects)}Ha(L,H,0,x.sortObjects),_.finish(),x.sortObjects===!0&&_.sort(O,Q),je=ve.enabled===!1||ve.isPresenting===!1||ve.hasDepthSensing()===!1,je&&Ie.addToRenderList(_,L),this.info.render.frame++,q===!0&&st.beginShadows();const J=y.state.shadowsArray;_e.render(J,L,H),q===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset();const K=_.opaque,W=_.transmissive;if(y.setupLights(),H.isArrayCamera){const Me=H.cameras;if(W.length>0)for(let Le=0,Ve=Me.length;Le0&&Va(K,W,L,H),je&&Ie.render(L),Wl(_,L,H);P!==null&&(De.updateMultisampleRenderTarget(P),De.updateRenderTargetMipmap(P)),L.isScene===!0&&L.onAfterRender(x,L,H),be.resetDefaultState(),I=-1,b=null,S.pop(),S.length>0?(y=S[S.length-1],q===!0&&st.setGlobalState(x.clippingPlanes,y.state.camera)):y=null,m.pop(),m.length>0?_=m[m.length-1]:_=null};function Ha(L,H,J,K){if(L.visible===!1)return;if(L.layers.test(H.layers)){if(L.isGroup)J=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(H);else if(L.isLight)y.pushLight(L),L.castShadow&&y.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||Ne.intersectsSprite(L)){K&&$e.setFromMatrixPosition(L.matrixWorld).applyMatrix4(Te);const Le=ce.update(L),Ve=L.material;Ve.visible&&_.push(L,Le,Ve,J,$e.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||Ne.intersectsObject(L))){const Le=ce.update(L),Ve=L.material;if(K&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),$e.copy(L.boundingSphere.center)):(Le.boundingSphere===null&&Le.computeBoundingSphere(),$e.copy(Le.boundingSphere.center)),$e.applyMatrix4(L.matrixWorld).applyMatrix4(Te)),Array.isArray(Ve)){const He=Le.groups;for(let qe=0,tt=He.length;qe0&&So(W,H,J),Me.length>0&&So(Me,H,J),Le.length>0&&So(Le,H,J),ae.buffers.depth.setTest(!0),ae.buffers.depth.setMask(!0),ae.buffers.color.setMask(!0),ae.setPolygonOffset(!1)}function Va(L,H,J,K){if((J.isScene===!0?J.overrideMaterial:null)!==null)return;y.state.transmissionRenderTarget[K.id]===void 0&&(y.state.transmissionRenderTarget[K.id]=new wi(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")||ge.has("EXT_color_buffer_float")?yd:Zi,minFilter:fo,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Sn.workingColorSpace}));const Me=y.state.transmissionRenderTarget[K.id],Le=K.viewport||w;Me.setSize(Le.z,Le.w);const Ve=x.getRenderTarget();x.setRenderTarget(Me),x.getClearColor(V),$=x.getClearAlpha(),$<1&&x.setClearColor(16777215,.5),x.clear(),je&&Ie.render(J);const He=x.toneMapping;x.toneMapping=$o;const qe=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),y.setupLightsView(K),q===!0&&st.setGlobalState(x.clippingPlanes,K),So(L,J,K),De.updateMultisampleRenderTarget(Me),De.updateRenderTargetMipmap(Me),ge.has("WEBGL_multisampled_render_to_texture")===!1){let tt=!1;for(let We=0,At=H.length;We0),We=!!J.morphAttributes.position,At=!!J.morphAttributes.normal,Bt=!!J.morphAttributes.color;let Pt=$o;K.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Pt=x.toneMapping);const ln=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,at=ln!==void 0?ln.length:0,Be=Ce.get(K),kt=y.state.lights;if(q===!0&&(fe===!0||L!==b)){const Tn=L===b&&K.id===I;st.setState(K,L,Tn)}let ut=!1;K.version===Be.__version?(Be.needsLights&&Be.lightsStateVersion!==kt.state.version||Be.outputColorSpace!==Ve||W.isBatchedMesh&&Be.batching===!1||!W.isBatchedMesh&&Be.batching===!0||W.isBatchedMesh&&Be.batchingColor===!0&&W.colorTexture===null||W.isBatchedMesh&&Be.batchingColor===!1&&W.colorTexture!==null||W.isInstancedMesh&&Be.instancing===!1||!W.isInstancedMesh&&Be.instancing===!0||W.isSkinnedMesh&&Be.skinning===!1||!W.isSkinnedMesh&&Be.skinning===!0||W.isInstancedMesh&&Be.instancingColor===!0&&W.instanceColor===null||W.isInstancedMesh&&Be.instancingColor===!1&&W.instanceColor!==null||W.isInstancedMesh&&Be.instancingMorph===!0&&W.morphTexture===null||W.isInstancedMesh&&Be.instancingMorph===!1&&W.morphTexture!==null||Be.envMap!==He||K.fog===!0&&Be.fog!==Me||Be.numClippingPlanes!==void 0&&(Be.numClippingPlanes!==st.numPlanes||Be.numIntersection!==st.numIntersection)||Be.vertexAlphas!==qe||Be.vertexTangents!==tt||Be.morphTargets!==We||Be.morphNormals!==At||Be.morphColors!==Bt||Be.toneMapping!==Pt||Be.morphTargetsCount!==at)&&(ut=!0):(ut=!0,Be.__version=K.version);let rn=Be.currentProgram;ut===!0&&(rn=Ao(K,H,W));let vi=!1,hn=!1,li=!1;const Ot=rn.getUniforms(),Ei=Be.uniforms;if(ae.useProgram(rn.program)&&(vi=!0,hn=!0,li=!0),K.id!==I&&(I=K.id,hn=!0),vi||b!==L){Ot.setValue(B,"projectionMatrix",L.projectionMatrix),Ot.setValue(B,"viewMatrix",L.matrixWorldInverse);const Tn=Ot.map.cameraPosition;Tn!==void 0&&Tn.setValue(B,Se.setFromMatrixPosition(L.matrixWorld)),Re.logarithmicDepthBuffer&&Ot.setValue(B,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&Ot.setValue(B,"isOrthographic",L.isOrthographicCamera===!0),b!==L&&(b=L,hn=!0,li=!0)}if(W.isSkinnedMesh){Ot.setOptional(B,W,"bindMatrix"),Ot.setOptional(B,W,"bindMatrixInverse");const Tn=W.skeleton;Tn&&(Tn.boneTexture===null&&Tn.computeBoneTexture(),Ot.setValue(B,"boneTexture",Tn.boneTexture,De))}W.isBatchedMesh&&(Ot.setOptional(B,W,"batchingTexture"),Ot.setValue(B,"batchingTexture",W._matricesTexture,De),Ot.setOptional(B,W,"batchingIdTexture"),Ot.setValue(B,"batchingIdTexture",W._indirectTexture,De),Ot.setOptional(B,W,"batchingColorTexture"),W._colorsTexture!==null&&Ot.setValue(B,"batchingColorTexture",W._colorsTexture,De));const aa=J.morphAttributes;if((aa.position!==void 0||aa.normal!==void 0||aa.color!==void 0)&&pt.update(W,J,rn),(hn||Be.receiveShadow!==W.receiveShadow)&&(Be.receiveShadow=W.receiveShadow,Ot.setValue(B,"receiveShadow",W.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(Ei.envMap.value=He,Ei.flipEnvMap.value=He.isCubeTexture&&He.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&H.environment!==null&&(Ei.envMapIntensity.value=H.environmentIntensity),hn&&(Ot.setValue(B,"toneMappingExposure",x.toneMappingExposure),Be.needsLights&&ym(Ei,li),Me&&K.fog===!0&&Ye.refreshFogUniforms(Ei,Me),Ye.refreshMaterialUniforms(Ei,K,re,X,y.state.transmissionRenderTarget[L.id]),X1.upload(B,Su(Be),Ei,De)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(X1.upload(B,Su(Be),Ei,De),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&Ot.setValue(B,"center",W.center),Ot.setValue(B,"modelViewMatrix",W.modelViewMatrix),Ot.setValue(B,"normalMatrix",W.normalMatrix),Ot.setValue(B,"modelMatrix",W.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){const Tn=K.uniformsGroups;for(let la=0,Nr=Tn.length;la0&&De.useMultisampledRTT(L)===!1?W=Ce.get(L).__webglMultisampledFramebuffer:Array.isArray(tt)?W=tt[J]:W=tt,w.copy(L.viewport),N.copy(L.scissor),G=L.scissorTest}else w.copy(te).multiplyScalar(re).floor(),N.copy(le).multiplyScalar(re).floor(),G=we;if(ae.bindFramebuffer(B.FRAMEBUFFER,W)&&K&&ae.drawBuffers(L,W),ae.viewport(w),ae.scissor(N),ae.setScissorTest(G),Me){const He=Ce.get(L.texture);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+H,He.__webglTexture,J)}else if(Le){const He=Ce.get(L.texture),qe=H||0;B.framebufferTextureLayer(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,He.__webglTexture,J||0,qe)}I=-1},this.readRenderTargetPixels=function(L,H,J,K,W,Me,Le){if(!(L&&L.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ve=Ce.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ve=Ve[Le]),Ve){ae.bindFramebuffer(B.FRAMEBUFFER,Ve);try{const He=L.texture,qe=He.format,tt=He.type;if(!Re.textureFormatReadable(qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Re.textureTypeReadable(tt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}H>=0&&H<=L.width-K&&J>=0&&J<=L.height-W&&B.readPixels(H,J,K,W,ie.convert(qe),ie.convert(tt),Me)}finally{const He=P!==null?Ce.get(P).__webglFramebuffer:null;ae.bindFramebuffer(B.FRAMEBUFFER,He)}}},this.readRenderTargetPixelsAsync=async function(L,H,J,K,W,Me,Le){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ve=Ce.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ve=Ve[Le]),Ve){ae.bindFramebuffer(B.FRAMEBUFFER,Ve);try{const He=L.texture,qe=He.format,tt=He.type;if(!Re.textureFormatReadable(qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Re.textureTypeReadable(tt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(H>=0&&H<=L.width-K&&J>=0&&J<=L.height-W){const We=B.createBuffer();B.bindBuffer(B.PIXEL_PACK_BUFFER,We),B.bufferData(B.PIXEL_PACK_BUFFER,Me.byteLength,B.STREAM_READ),B.readPixels(H,J,K,W,ie.convert(qe),ie.convert(tt),0),B.flush();const At=B.fenceSync(B.SYNC_GPU_COMMANDS_COMPLETE,0);await qte(B,At,4);try{B.bindBuffer(B.PIXEL_PACK_BUFFER,We),B.getBufferSubData(B.PIXEL_PACK_BUFFER,0,Me)}finally{B.deleteBuffer(We),B.deleteSync(At)}return Me}}finally{const He=P!==null?Ce.get(P).__webglFramebuffer:null;ae.bindFramebuffer(B.FRAMEBUFFER,He)}}},this.copyFramebufferToTexture=function(L,H=null,J=0){L.isTexture!==!0&&(xp("WebGLRenderer: copyFramebufferToTexture function signature has changed."),H=arguments[0]||null,L=arguments[1]);const K=Math.pow(2,-J),W=Math.floor(L.image.width*K),Me=Math.floor(L.image.height*K),Le=H!==null?H.x:0,Ve=H!==null?H.y:0;De.setTexture2D(L,0),B.copyTexSubImage2D(B.TEXTURE_2D,J,0,0,Le,Ve,W,Me),ae.unbindTexture()},this.copyTextureToTexture=function(L,H,J=null,K=null,W=0){L.isTexture!==!0&&(xp("WebGLRenderer: copyTextureToTexture function signature has changed."),K=arguments[0]||null,L=arguments[1],H=arguments[2],W=arguments[3]||0,J=null);let Me,Le,Ve,He,qe,tt;J!==null?(Me=J.max.x-J.min.x,Le=J.max.y-J.min.y,Ve=J.min.x,He=J.min.y):(Me=L.image.width,Le=L.image.height,Ve=0,He=0),K!==null?(qe=K.x,tt=K.y):(qe=0,tt=0);const We=ie.convert(H.format),At=ie.convert(H.type);De.setTexture2D(H,0),B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,H.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,H.unpackAlignment);const Bt=B.getParameter(B.UNPACK_ROW_LENGTH),Pt=B.getParameter(B.UNPACK_IMAGE_HEIGHT),ln=B.getParameter(B.UNPACK_SKIP_PIXELS),at=B.getParameter(B.UNPACK_SKIP_ROWS),Be=B.getParameter(B.UNPACK_SKIP_IMAGES),kt=L.isCompressedTexture?L.mipmaps[W]:L.image;B.pixelStorei(B.UNPACK_ROW_LENGTH,kt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,kt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,Ve),B.pixelStorei(B.UNPACK_SKIP_ROWS,He),L.isDataTexture?B.texSubImage2D(B.TEXTURE_2D,W,qe,tt,Me,Le,We,At,kt.data):L.isCompressedTexture?B.compressedTexSubImage2D(B.TEXTURE_2D,W,qe,tt,kt.width,kt.height,We,kt.data):B.texSubImage2D(B.TEXTURE_2D,W,qe,tt,Me,Le,We,At,kt),B.pixelStorei(B.UNPACK_ROW_LENGTH,Bt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt),B.pixelStorei(B.UNPACK_SKIP_PIXELS,ln),B.pixelStorei(B.UNPACK_SKIP_ROWS,at),B.pixelStorei(B.UNPACK_SKIP_IMAGES,Be),W===0&&H.generateMipmaps&&B.generateMipmap(B.TEXTURE_2D),ae.unbindTexture()},this.copyTextureToTexture3D=function(L,H,J=null,K=null,W=0){L.isTexture!==!0&&(xp("WebGLRenderer: copyTextureToTexture3D function signature has changed."),J=arguments[0]||null,K=arguments[1]||null,L=arguments[2],H=arguments[3],W=arguments[4]||0);let Me,Le,Ve,He,qe,tt,We,At,Bt;const Pt=L.isCompressedTexture?L.mipmaps[W]:L.image;J!==null?(Me=J.max.x-J.min.x,Le=J.max.y-J.min.y,Ve=J.max.z-J.min.z,He=J.min.x,qe=J.min.y,tt=J.min.z):(Me=Pt.width,Le=Pt.height,Ve=Pt.depth,He=0,qe=0,tt=0),K!==null?(We=K.x,At=K.y,Bt=K.z):(We=0,At=0,Bt=0);const ln=ie.convert(H.format),at=ie.convert(H.type);let Be;if(H.isData3DTexture)De.setTexture3D(H,0),Be=B.TEXTURE_3D;else if(H.isDataArrayTexture||H.isCompressedArrayTexture)De.setTexture2DArray(H,0),Be=B.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,H.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,H.unpackAlignment);const kt=B.getParameter(B.UNPACK_ROW_LENGTH),ut=B.getParameter(B.UNPACK_IMAGE_HEIGHT),rn=B.getParameter(B.UNPACK_SKIP_PIXELS),vi=B.getParameter(B.UNPACK_SKIP_ROWS),hn=B.getParameter(B.UNPACK_SKIP_IMAGES);B.pixelStorei(B.UNPACK_ROW_LENGTH,Pt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,He),B.pixelStorei(B.UNPACK_SKIP_ROWS,qe),B.pixelStorei(B.UNPACK_SKIP_IMAGES,tt),L.isDataTexture||L.isData3DTexture?B.texSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,at,Pt.data):H.isCompressedArrayTexture?B.compressedTexSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,Pt.data):B.texSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,at,Pt),B.pixelStorei(B.UNPACK_ROW_LENGTH,kt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,ut),B.pixelStorei(B.UNPACK_SKIP_PIXELS,rn),B.pixelStorei(B.UNPACK_SKIP_ROWS,vi),B.pixelStorei(B.UNPACK_SKIP_IMAGES,hn),W===0&&H.generateMipmaps&&B.generateMipmap(Be),ae.unbindTexture()},this.initRenderTarget=function(L){Ce.get(L).__webglFramebuffer===void 0&&De.setupRenderTarget(L)},this.initTexture=function(L){L.isCubeTexture?De.setTextureCube(L,0):L.isData3DTexture?De.setTexture3D(L,0):L.isDataArrayTexture||L.isCompressedArrayTexture?De.setTexture2DArray(L,0):De.setTexture2D(L,0),ae.unbindTexture()},this.resetState=function(){R=0,T=0,P=null,ae.reset(),be.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Aa}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===NA?"display-p3":"srgb",t.unpackColorSpace=Sn.workingColorSpace===K0?"display-p3":"srgb"}},_8=class x8{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ct(e),this.density=t}clone(){return new x8(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}},S8=class M8{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new ct(e),this.near=t,this.far=i}clone(){return new M8(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},Hp=class extends wn{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 Gs,this.environmentIntensity=1,this.environmentRotation=new Gs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},ey=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Yv,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ns()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return xp("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,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:tg.clone(),uv:bh.getInterpolation(tg,tx,ig,nx,bF,tb,CF,new Fe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function ix(n,e,t,i,r,s){af.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(ng.x=s*af.x-r*af.y,ng.y=r*af.x+s*af.y):ng.copy(af),n.copy(e),n.x+=ng.x,n.y+=ng.y,n.applyMatrix4(w8)}const rx=new j,RF=new j;let T8=class extends wn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){rx.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(rx);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){rx.setFromMatrixPosition(e.matrixWorld),RF.setFromMatrixPosition(this.matrixWorld);const i=rx.distanceTo(RF)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}};const ac=new Rt,rb=new Rt,gae=new Rt,vae=new ct(1,1,1),OF=new Rt,sb=new Q0,ax=new Cr,zu=new sr,og=new j,kF=new j,yae=new j,ob=new mae,mr=new si,lx=[];function _ae(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new un(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Cr);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let i=0,r=t.length;i=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,i=this._matricesTexture,r=i.image.data;gae.toArray(r,t*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(vae.toArray(s.image.data,t*4),s.needsUpdate=!0),t}addGeometry(e,t=-1,i=-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 s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=e.getIndex(),u=c!==null;if(u&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&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 h=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:u?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Cr,sphereInitialized:!1,sphere:new sr}),this.setGeometryAt(h,e),h}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const f in i.attributes){const v=t.getAttribute(f),_=i.getAttribute(f);_ae(v,_,l);const y=v.itemSize;for(let m=v.count,S=c;m=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let c=l.start,u=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,ax),ax.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let c=0;for(let u=l.start,h=l.start+l.count;u=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;mr.material=this.material,mr.geometry.index=o.index,mr.geometry.attributes=o.attributes,mr.geometry.boundingBox===null&&(mr.geometry.boundingBox=new Cr),mr.geometry.boundingSphere===null&&(mr.geometry.boundingSphere=new sr);for(let a=0,l=i.length;a({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._drawInfo=e._drawInfo.map(t=>({...t})),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,h=this._drawRanges,d=this.perObjectFrustumCulled,f=this._indirectTexture,v=f.image.data;d&&(OF.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),sb.setFromProjectionMatrix(OF,e.coordinateSystem));let _=0;if(this.sortObjects){rb.copy(this.matrixWorld).invert(),og.setFromMatrixPosition(i.matrixWorld).applyMatrix4(rb),kF.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(rb);for(let S=0,x=l.length;S0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;ab.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(ab);if(!(le.far))return{distance:l,point:GF.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const HF=new j,VF=new j;let Qo=class extends Ul{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}let xae=class extends Yn{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:Vn,this.magFilter=s!==void 0?s:Vn,this.generateMipmaps=!1;const u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},Sae=class extends Yn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=ri,this.minFilter=ri,this.generateMipmaps=!1,this.needsUpdate=!0}},GA=class extends Yn{constructor(e,t,i,r,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,r,s,h,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},Mae=class extends GA{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Is,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Aae=class extends GA{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Nl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},wae=class extends Yn{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},ea=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],d=i[r+1]-u,f=(o-u)/d;return(r+f)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Fe:new j);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new j,r=[],s=[],o=[],a=new j,l=new Rt;for(let f=0;f<=e;f++){const v=f/e;r[f]=this.getTangentAt(v,new j)}s[0]=new j,o[0]=new j;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),d=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(fi(r[f-1].dot(r[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,v))}o[f].crossVectors(r[f],s[f])}if(t===!0){let f=Math.acos(fi(s[0].dot(s[e]),-1,1));f/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],f*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},HA=class extends ea{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Fe){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(fx.subVectors(r[0],r[1]).add(r[0]),c=fx);const h=r[a%s],d=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(XF(a,l.x,c.x,u.x,h.x),XF(a,l.y,c.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},eL=class B8 extends Vt{constructor(e=[new Fe(0,-.5),new Fe(.5,0),new Fe(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=fi(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,h=new j,d=new Fe,f=new j,v=new j,_=new j;let y=0,m=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:y=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,f.x=m*1,f.y=-y,f.z=m*0,_.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:y=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,f.x=m*1,f.y=-y,f.z=m*0,v.copy(f),f.x+=_.x,f.y+=_.y,f.z+=_.z,f.normalize(),l.push(f.x,f.y,f.z),_.copy(v)}for(let S=0;S<=t;S++){const x=i+S*u*r,M=Math.sin(x),R=Math.cos(x);for(let T=0;T<=e.length-1;T++){h.x=e[T].x*M,h.y=e[T].y,h.z=e[T].x*R,o.push(h.x,h.y,h.z),d.x=S/t,d.y=T/(e.length-1),a.push(d.x,d.y);const P=l[3*T+0]*M,I=l[3*T+1],b=l[3*T+0]*R;c.push(P,I,b)}}for(let S=0;S0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new Mt(h,3)),this.setAttribute("normal",new Mt(d,3)),this.setAttribute("uv",new Mt(f,2));function S(){const M=new j,R=new j;let T=0;const P=(t-e)/i;for(let I=0;I<=s;I++){const b=[],w=I/s,N=w*(t-e)+e;for(let G=0;G<=r;G++){const V=G/r,$=V*l+a,Z=Math.sin($),X=Math.cos($);R.x=N*Z,R.y=-w*i+y,R.z=N*X,h.push(R.x,R.y,R.z),M.set(Z,P,X).normalize(),d.push(M.x,M.y,M.z),f.push(V,1-w),b.push(v++)}_.push(b)}for(let I=0;I.9&&P<.1&&(x<.2&&(o[S+0]+=1),M<.2&&(o[S+2]+=1),R<.2&&(o[S+4]+=1))}}function d(S){s.push(S.x,S.y,S.z)}function f(S,x){const M=S*3;x.x=e[M+0],x.y=e[M+1],x.z=e[M+2]}function v(){const S=new j,x=new j,M=new j,R=new j,T=new Fe,P=new Fe,I=new Fe;for(let b=0,w=0;b80*t){a=c=n[0],l=u=n[1];for(let v=t;vc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?32767/f:0}return Zv(s,o,t,a,l,f,0),o}};function X8(n,e,t,i,r){let s,o;if(r===Yae(n,e,t,i)>0)for(s=e;s=e;s-=i)o=jF(s,n[s],n[s+1],o);return o&&WA(o,o.next)&&(e0(o),o=o.next),o}function rd(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(WA(t,t.next)||ni(t.prev,t,t.next)===0)){if(e0(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Zv(n,e,t,i,r,s,o){if(!n)return;!o&&s&&Hae(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?Bae(n,i,r,s):Dae(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),e0(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=Nae(rd(n),e,t),Zv(n,e,t,i,r,s,2)):o===2&&Uae(n,e,t,i,r,s):Zv(rd(n),e,t,i,r,s,1);break}}}function Dae(n){const e=n.prev,t=n,i=n.next;if(ni(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=rs?r>o?r:o:s>o?s:o,f=a>l?a>c?a:c:l>c?l:c;let v=i.next;for(;v!==e;){if(v.x>=u&&v.x<=d&&v.y>=h&&v.y<=f&&np(r,a,s,l,o,c,v.x,v.y)&&ni(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function Bae(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ni(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,h=s.y,d=o.y,f=al?a>c?a:c:l>c?l:c,y=u>h?u>d?u:d:h>d?h:d,m=qR(f,v,e,t,i),S=qR(_,y,e,t,i);let x=n.prevZ,M=n.nextZ;for(;x&&x.z>=m&&M&&M.z<=S;){if(x.x>=f&&x.x<=_&&x.y>=v&&x.y<=y&&x!==r&&x!==o&&np(a,u,l,h,c,d,x.x,x.y)&&ni(x.prev,x,x.next)>=0||(x=x.prevZ,M.x>=f&&M.x<=_&&M.y>=v&&M.y<=y&&M!==r&&M!==o&&np(a,u,l,h,c,d,M.x,M.y)&&ni(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;x&&x.z>=m;){if(x.x>=f&&x.x<=_&&x.y>=v&&x.y<=y&&x!==r&&x!==o&&np(a,u,l,h,c,d,x.x,x.y)&&ni(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;M&&M.z<=S;){if(M.x>=f&&M.x<=_&&M.y>=v&&M.y<=y&&M!==r&&M!==o&&np(a,u,l,h,c,d,M.x,M.y)&&ni(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function Nae(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!WA(r,s)&&j8(r,i,i.next,s)&&Qv(r,s)&&Qv(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),e0(i),e0(i.next),i=n=s),i=i.next}while(i!==n);return rd(i)}function Uae(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&$ae(o,a)){let l=Y8(o,a);o=rd(o,o.next),l=rd(l,l.next),Zv(o,e,t,i,r,s,0),Zv(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function Fae(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const d=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=s&&d>i&&(i=d,r=t.x=t.x&&t.x>=l&&s!==t.x&&np(or.x||t.x===r.x&&Gae(r,t)))&&(r=t,u=h)),t=t.next;while(t!==a);return r}function Gae(n,e){return ni(n.prev,n,e.prev)<0&&ni(e.next,n,n.next)<0}function Hae(n,e,t,i){let r=n;do r.z===0&&(r.z=qR(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,Vae(r)}function Vae(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function qR(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Wae(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function $ae(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!Xae(n,e)&&(Qv(n,e)&&Qv(e,n)&&jae(n,e)&&(ni(n.prev,n,e.prev)||ni(n,e.prev,e))||WA(n,e)&&ni(n.prev,n,n.next)>0&&ni(e.prev,e,e.next)>0)}function ni(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function WA(n,e){return n.x===e.x&&n.y===e.y}function j8(n,e,t,i){const r=yx(ni(n,e,t)),s=yx(ni(n,e,i)),o=yx(ni(t,i,n)),a=yx(ni(t,i,e));return!!(r!==s&&o!==a||r===0&&vx(n,t,e)||s===0&&vx(n,i,e)||o===0&&vx(t,n,i)||a===0&&vx(t,e,i))}function vx(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function yx(n){return n>0?1:n<0?-1:0}function Xae(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&j8(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Qv(n,e){return ni(n.prev,n,n.next)<0?ni(n,e,n.next)>=0&&ni(n,n.prev,e)>=0:ni(n,e,n.prev)<0||ni(n,n.next,e)<0}function jae(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Y8(n,e){const t=new ZR(n.i,n.x,n.y),i=new ZR(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function jF(n,e,t,i){const r=new ZR(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function e0(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function ZR(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Yae(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function JF(n,e){for(let t=0;tNumber.EPSILON){const ce=Math.sqrt(Y),de=Math.sqrt(U*U+C*C),Ye=me.x-De/ce,Ae=me.y+Ce/ce,Ue=ge.x-C/de,st=ge.y+U/de,_e=((Ue-Ye)*C-(st-Ae)*U)/(Ce*C-De*U);Re=Ye+Ce*_e-B.x,ae=Ae+De*_e-B.y;const Ie=Re*Re+ae*ae;if(Ie<=2)return new Fe(Re,ae);Xe=Math.sqrt(Ie/2)}else{let ce=!1;Ce>Number.EPSILON?U>Number.EPSILON&&(ce=!0):Ce<-Number.EPSILON?U<-Number.EPSILON&&(ce=!0):Math.sign(De)===Math.sign(C)&&(ce=!0),ce?(Re=-De,ae=Ce,Xe=Math.sqrt(Y)):(Re=Ce,ae=De,Xe=Math.sqrt(Y/2))}return new Fe(Re/Xe,ae/Xe)}const Q=[];for(let B=0,me=$.length,ge=me-1,Re=B+1;B=0;B--){const me=B/y,ge=f*Math.cos(me*Math.PI/2),Re=v*Math.sin(me*Math.PI/2)+_;for(let ae=0,Xe=$.length;ae=0;){const Re=ge;let ae=ge-1;ae<0&&(ae=B.length-1);for(let Xe=0,Ce=u+y*2;Xe0)&&f.push(x,M,T),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},v9=class extends mi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ct(16777215),this.specular=new ct(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gs,this.combine=Y0,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}},y9=class extends mi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ct(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(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}},iL=class extends mi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(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}},_9=class extends mi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ct(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ct(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gs,this.combine=Y0,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}},x9=class extends mi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ct(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=du,this.normalScale=new Fe(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}},S9=class extends Lr{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 Ch(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function M9(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function A9(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function QR(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function rL(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function Zae(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){h.push(c.times[f]);for(let _=0;_s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const m=v*h+u,S=m+h-u;_=a.values.slice(m,S)}else{const m=a.createInterpolant(),S=u,x=h-u;m.evaluate(s),_=m.resultBuffer.slice(S,x)}l==="quaternion"&&new qi().fromArray(_).normalize().conjugate().toArray(_);const y=c.times.length;for(let m=0;m=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&M9(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===V1,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};ta.prototype.TimeBufferType=Float32Array;ta.prototype.ValueBufferType=Float32Array;ta.prototype.DefaultInterpolation=kp;let xd=class extends ta{constructor(e,t,i){super(e,t,i)}};xd.prototype.ValueTypeName="bool";xd.prototype.ValueBufferType=Array;xd.prototype.DefaultInterpolation=Op;xd.prototype.InterpolantFactoryMethodLinear=void 0;xd.prototype.InterpolantFactoryMethodSmooth=void 0;let oL=class extends ta{};oL.prototype.ValueTypeName="color";let sd=class extends ta{};sd.prototype.ValueTypeName="number";let T9=class extends am{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)qi.slerpFlat(s,0,o,c-a,o,c,l);return s}},od=class extends ta{InterpolantFactoryMethodLinear(e){return new T9(this.times,this.values,this.getValueSize(),e)}};od.prototype.ValueTypeName="quaternion";od.prototype.InterpolantFactoryMethodSmooth=void 0;let Sd=class extends ta{constructor(e,t,i){super(e,t,i)}};Sd.prototype.ValueTypeName="string";Sd.prototype.ValueBufferType=Array;Sd.prototype.DefaultInterpolation=Op;Sd.prototype.InterpolantFactoryMethodLinear=void 0;Sd.prototype.InterpolantFactoryMethodSmooth=void 0;let ad=class extends ta{};ad.prototype.ValueTypeName="vector";let Wp=class{constructor(e="",t=-1,i=[],r=BA){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Ns(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(nle(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(ta.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const h=u[1];let d=r[h];d||(r[h]=d=[]),d.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,d,f,v,_){if(f.length!==0){const y=[],m=[];rL(f,y,m,v),y.length!==0&&_.push(new h(d,y,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(tl[e]!==void 0){tl[e].push({onLoad:t,onProgress:i,onError:r});return}tl[e]=[],tl[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=tl[e],h=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,v=f!==0;let _=0;const y=new ReadableStream({start(m){S();function S(){h.read().then(({done:x,value:M})=>{if(x)m.close();else{_+=M.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:_,total:f});for(let T=0,P=u.length;T{m.error(x)})}}});return new Response(y)}else throw new ile(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(v=>f.decode(v))}}}).then(c=>{xl.add(e,c);const u=tl[e];delete tl[e];for(let h=0,d=u.length;h{const u=tl[e];if(u===void 0)throw this.manager.itemError(e),c;delete tl[e];for(let h=0,d=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},rle=class extends Dr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Hs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new ct().setHex(o.value);break;case"v2":r.uniforms[s].value=new Fe().fromArray(o.value);break;case"v3":r.uniforms[s].value=new j().fromArray(o.value);break;case"v4":r.uniforms[s].value=new bn().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Zt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Rt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Fe().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Fe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:m9,SpriteMaterial:HI,RawShaderMaterial:g9,ShaderMaterial:Oi,PointsMaterial:ty,MeshPhysicalMaterial:xo,MeshStandardMaterial:ny,MeshPhongMaterial:v9,MeshToonMaterial:y9,MeshNormalMaterial:iL,MeshLambertMaterial:_9,MeshDepthMaterial:zI,MeshDistanceMaterial:GI,MeshBasicMaterial:Ls,MeshMatcapMaterial:x9,LineDashedMaterial:S9,LineBasicMaterial:Lr,Material:mi};return new t[e]}},Hc=class{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new aL(t);s=new t0(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){r=new t0(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const y=new Cr;y.min.fromArray(_.boxMin),y.max.fromArray(_.boxMax);const m=new sr;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:y,sphereInitialized:_.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new T8;break;case"Line":o=new Ul(a(e.geometry),l(e.material));break;case"LineLoop":o=new XI(a(e.geometry),l(e.material));break;case"LineSegments":o=new Qo(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new jI(a(e.geometry),l(e.material));break;case"Sprite":o=new E8(l(e.material));break;case"Group":o=new _l;break;case"Bone":o=new zA;break;default:o=new wn}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let f=0;f"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=xl.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return xl.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),xl.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});xl.add(e,l),s.manager.itemStart(e)}},_x,dL=class{static getContext(){return _x===void 0&&(_x=new(window.AudioContext||window.webkitAudioContext)),_x}static setContext(e){_x=e}},fle=class extends Dr{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Hs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);dL.getContext().decodeAudioData(c,function(h){t(h)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}};const iO=new Rt,rO=new Rt,Gu=new Rt;let ple=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Gn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Gn,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,Gu.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Hh*t.fov*.5)/t.zoom;let a,l;rO.elements[12]=-r,iO.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Gu.elements[0]=2*t.near/(l-a),Gu.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Gu),a=-o*t.aspect-s,l=o*t.aspect-s,Gu.elements[0]=2*t.near/(l-a),Gu.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Gu)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(rO),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(iO)}},fL=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=sO(),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=sO();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function sO(){return(typeof performance>"u"?Date:performance).now()}const Hu=new j,oO=new qi,mle=new j,Vu=new j;let gle=class extends wn{constructor(){super(),this.type="AudioListener",this.context=dL.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new fL}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Hu,oO,mle),Vu.set(0,0,-1).applyQuaternion(oO),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Hu.x,r),t.positionY.linearRampToValueAtTime(Hu.y,r),t.positionZ.linearRampToValueAtTime(Hu.z,r),t.forwardX.linearRampToValueAtTime(Vu.x,r),t.forwardY.linearRampToValueAtTime(Vu.y,r),t.forwardZ.linearRampToValueAtTime(Vu.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Hu.x,Hu.y,Hu.z),t.setOrientation(Vu.x,Vu.y,Vu.z,i.x,i.y,i.z)}},F9=class extends wn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){qi.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;qi.multiplyQuaternionsFlat(e,o,e,t,e,i),qi.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}};const pL="\\[\\]\\.:\\/",xle=new RegExp("["+pL+"]","g"),mL="[^"+pL+"]",Sle="[^"+pL.replace("\\.","")+"]",Mle=/((?:WC+[\/:])*)/.source.replace("WC",mL),Ale=/(WCOD+)?/.source.replace("WCOD",Sle),wle=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",mL),Ele=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",mL),Tle=new RegExp("^"+Mle+Ale+wle+Ele+"$"),ble=["material","materials","bones","map"];let Cle=class{constructor(e,t,i){const r=i||Ln.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},Ln=class Lf{constructor(e,t,i){this.path=t,this.parsedPath=i||Lf.parseTrackName(t),this.node=Lf.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Lf.Composite(e,t,i):new Lf(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(xle,"")}static parseTrackName(e){const t=Tle.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);ble.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,v=r;f!==v;++f){const _=i[f],y=_[h],m=_[u];_[u]=y,_[h]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let v=0,_=r;v!==_;++v){const y=i[v];y[h]=y[d],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){const v=l[d];h[d]=new Ln(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}},k9=class{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:wh,endingEnd:wh};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=O5,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case RI:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case BA:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===k5;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===F5){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Eh,r.endingEnd=Eh):(e?r.endingStart=this.zeroSlopeAtStart?Eh:wh:r.endingStart=Wv,t?r.endingEnd=this.zeroSlopeAtEnd?Eh:wh:r.endingEnd=Wv)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}};const Ple=new Float32Array(1);let Ile=class extends vs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){const d=r[h],f=d.name;let v=u[f];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,f));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;v=new O9(Ln.create(i,f,_),d.ValueTypeName,d.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,f),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=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,uO).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 hO=new j,xx=new j;let kle=class{constructor(e=new j,t=new j){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){hO.subVectors(e,this.start),xx.subVectors(this.end,this.start);const i=xx.dot(xx);let s=xx.dot(hO)/i;return t&&(s=fi(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}};const dO=new j;let zle=class extends wn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Vt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{vO.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(vO,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},Qle=class extends Qo{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Vt;r.setAttribute("position",new Mt(t,3)),r.setAttribute("color",new Mt(i,3));const s=new Lr({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new ct,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},ece=class{constructor(){this.type="ShapePath",this.color=new ct,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new qv,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const S=[];for(let x=0,M=m.length;xNumber.EPSILON){if(w<0&&(P=S[T],b=-b,I=S[R],w=-w),m.yI.y)continue;if(m.y===P.y){if(m.x===P.x)return!0}else{const N=w*(m.x-P.x)-b*(m.y-P.y);if(N===0)return!0;if(N<0)continue;M=!M}}else{if(m.y!==P.y)continue;if(I.x<=m.x&&m.x<=P.x||P.x<=m.x&&m.x<=I.x)return!0}}return M}const r=Gc.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Wh,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const h=[],d=[];let f=[],v=0,_;d[v]=void 0,f[v]=[];for(let m=0,S=s.length;m1){let m=!1,S=0;for(let x=0,M=d.length;x0&&m===!1&&(f=h)}let y;for(let m=0,S=d.length;m{const h=typeof c=="function"?c(e):c;if(h!==e){const d=e;e=u?h:Object.assign({},e,h),t.forEach(f=>f(e,d))}},r=()=>e,s=(c,u=r,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(e);function f(){const v=u(e);if(!h(d,v)){const _=d;c(d=v,_)}}return t.add(f),()=>t.delete(f)},l={setState:i,getState:r,subscribe:(c,u,h)=>u||h?s(c,u,h):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return e=n(i,r,l),l}const tce=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),mO=tce?se.useEffect:se.useLayoutEffect;function G9(n){const e=typeof n=="function"?ece(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=se.useReducer(y=>y+1,0),o=e.getState(),a=se.useRef(o),l=se.useRef(i),c=se.useRef(r),u=se.useRef(!1),h=se.useRef();h.current===void 0&&(h.current=i(o));let d,f=!1;(a.current!==o||l.current!==i||c.current!==r||u.current)&&(d=i(o),f=!r(h.current,d)),mO(()=>{f&&(h.current=d),a.current=o,l.current=i,c.current=r,u.current=!1});const v=se.useRef(o);mO(()=>{const y=()=>{try{const S=e.getState(),x=l.current(S);c.current(h.current,x)||(a.current=S,h.current=x,s())}catch{u.current=!0,s()}},m=e.subscribe(y);return e.getState()!==v.current&&y(),m},[]);const _=f?d:h.current;return se.useDebugValue(_),_};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}const nce=n=>typeof n=="object"&&typeof n.then=="function",Rh=[];function H9(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=Rh.indexOf(r);s!==-1&&Rh.splice(s,1)},promise:(nce(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(Rh.push(r),!t)throw r.promise}const ice=(n,e,t)=>V9(n,e,!1,t),rce=(n,e,t)=>void V9(n,e,!0,t),sce=n=>{if(n===void 0||n.length===0)Rh.splice(0,Rh.length);else{const e=Rh.find(t=>H9(n,t.keys,t.equal));e&&e.remove()}};var W9={exports:{}},$9={exports:{}},X9={};/** + */Md.ConcurrentRoot=1;Md.ContinuousEventPriority=4;Md.DefaultEventPriority=16;Md.DiscreteEventPriority=1;Md.IdleEventPriority=536870912;Md.LegacyRoot=0;W9.exports=Md;var rp=W9.exports;function rce(n){let e;const t=new Set,i=(c,u)=>{const h=typeof c=="function"?c(e):c;if(h!==e){const d=e;e=u?h:Object.assign({},e,h),t.forEach(f=>f(e,d))}},r=()=>e,s=(c,u=r,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(e);function f(){const v=u(e);if(!h(d,v)){const _=d;c(d=v,_)}}return t.add(f),()=>t.delete(f)},l={setState:i,getState:r,subscribe:(c,u,h)=>u||h?s(c,u,h):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return e=n(i,r,l),l}const sce=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),yO=sce?se.useEffect:se.useLayoutEffect;function $9(n){const e=typeof n=="function"?rce(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=se.useReducer(y=>y+1,0),o=e.getState(),a=se.useRef(o),l=se.useRef(i),c=se.useRef(r),u=se.useRef(!1),h=se.useRef();h.current===void 0&&(h.current=i(o));let d,f=!1;(a.current!==o||l.current!==i||c.current!==r||u.current)&&(d=i(o),f=!r(h.current,d)),yO(()=>{f&&(h.current=d),a.current=o,l.current=i,c.current=r,u.current=!1});const v=se.useRef(o);yO(()=>{const y=()=>{try{const S=e.getState(),x=l.current(S);c.current(h.current,x)||(a.current=S,h.current=x,s())}catch{u.current=!0,s()}},m=e.subscribe(y);return e.getState()!==v.current&&y(),m},[]);const _=f?d:h.current;return se.useDebugValue(_),_};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}const oce=n=>typeof n=="object"&&typeof n.then=="function",Rh=[];function X9(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=Rh.indexOf(r);s!==-1&&Rh.splice(s,1)},promise:(oce(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(Rh.push(r),!t)throw r.promise}const ace=(n,e,t)=>j9(n,e,!1,t),lce=(n,e,t)=>void j9(n,e,!0,t),cce=n=>{if(n===void 0||n.length===0)Rh.splice(0,Rh.length);else{const e=Rh.find(t=>X9(n,t.keys,t.equal));e&&e.remove()}};var Y9={exports:{}},J9={exports:{}},K9={};/** * @license React * scheduler.production.min.js * @@ -3916,7 +3916,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function e(O,Q){var te=O.length;O.push(Q);e:for(;0>>1,we=O[le];if(0>>1;ler(fe,te))Ter(Se,fe)?(O[le]=Se,O[Te]=te,le=Te):(O[le]=fe,O[q]=te,le=q);else if(Ter(Se,te))O[le]=Se,O[Te]=te,le=Te;else break e}}return Q}function r(O,Q){var te=O.sortIndex-Q.sortIndex;return te!==0?te:O.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,d=3,f=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var Q=t(c);Q!==null;){if(Q.callback===null)i(c);else if(Q.startTime<=O)i(c),Q.sortIndex=Q.expirationTime,e(l,Q);else break;Q=t(c)}}function M(O){if(_=!1,x(O),!v)if(t(l)!==null)v=!0,X(R);else{var Q=t(c);Q!==null&&re(M,Q.startTime-O)}}function R(O,Q){v=!1,_&&(_=!1,m(I),I=-1),f=!0;var te=d;try{for(x(Q),h=t(l);h!==null&&(!(h.expirationTime>Q)||O&&!N());){var le=h.callback;if(typeof le=="function"){h.callback=null,d=h.priorityLevel;var we=le(h.expirationTime<=Q);Q=n.unstable_now(),typeof we=="function"?h.callback=we:h===t(l)&&i(l),x(Q)}else i(l);h=t(l)}if(h!==null)var Ne=!0;else{var q=t(c);q!==null&&re(M,q.startTime-Q),Ne=!1}return Ne}finally{h=null,d=te,f=!1}}var T=!1,P=null,I=-1,b=5,w=-1;function N(){return!(n.unstable_now()-wO||125le?(O.sortIndex=te,e(c,O),t(l)===null&&O===t(c)&&(_?(m(I),I=-1):_=!0,re(M,te-le))):(O.sortIndex=we,e(l,O),v||f||(v=!0,X(R))),O},n.unstable_shouldYield=N,n.unstable_wrapCallback=function(O){var Q=d;return function(){var te=d;d=Q;try{return O.apply(this,arguments)}finally{d=te}}}})(X9);$9.exports=X9;var iP=$9.exports;/** + */(function(n){function e(O,Q){var te=O.length;O.push(Q);e:for(;0>>1,we=O[le];if(0>>1;ler(fe,te))Ter(Se,fe)?(O[le]=Se,O[Te]=te,le=Te):(O[le]=fe,O[q]=te,le=q);else if(Ter(Se,te))O[le]=Se,O[Te]=te,le=Te;else break e}}return Q}function r(O,Q){var te=O.sortIndex-Q.sortIndex;return te!==0?te:O.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,d=3,f=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var Q=t(c);Q!==null;){if(Q.callback===null)i(c);else if(Q.startTime<=O)i(c),Q.sortIndex=Q.expirationTime,e(l,Q);else break;Q=t(c)}}function M(O){if(_=!1,x(O),!v)if(t(l)!==null)v=!0,X(R);else{var Q=t(c);Q!==null&&re(M,Q.startTime-O)}}function R(O,Q){v=!1,_&&(_=!1,m(I),I=-1),f=!0;var te=d;try{for(x(Q),h=t(l);h!==null&&(!(h.expirationTime>Q)||O&&!N());){var le=h.callback;if(typeof le=="function"){h.callback=null,d=h.priorityLevel;var we=le(h.expirationTime<=Q);Q=n.unstable_now(),typeof we=="function"?h.callback=we:h===t(l)&&i(l),x(Q)}else i(l);h=t(l)}if(h!==null)var Ne=!0;else{var q=t(c);q!==null&&re(M,q.startTime-Q),Ne=!1}return Ne}finally{h=null,d=te,f=!1}}var T=!1,P=null,I=-1,b=5,w=-1;function N(){return!(n.unstable_now()-wO||125le?(O.sortIndex=te,e(c,O),t(l)===null&&O===t(c)&&(_?(m(I),I=-1):_=!0,re(M,te-le))):(O.sortIndex=we,e(l,O),v||f||(v=!0,X(R))),O},n.unstable_shouldYield=N,n.unstable_wrapCallback=function(O){var Q=d;return function(){var te=d;d=Q;try{return O.apply(this,arguments)}finally{d=te}}}})(K9);J9.exports=K9;var nP=J9.exports;/** * @license React * react-reconciler.production.min.js * @@ -3924,17 +3924,17 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oce=function(e){var t={},i=se,r=iP,s=Object.assign;function o(p){for(var g="https://reactjs.org/docs/error-decoder.html?invariant="+p,A=1;Aye||D[ne]!==F[ye]){var Ge=` -`+D[ne].replace(" at new "," at ");return p.displayName&&Ge.includes("")&&(Ge=Ge.replace("",p.displayName)),Ge}while(1<=ne&&0<=ye);break}}}finally{tt=!1,Error.prepareStackTrace=A}return(p=p?p.displayName||p.name:"")?qe(p):""}var At=Object.prototype.hasOwnProperty,Bt=[],Pt=-1;function ln(p){return{current:p}}function at(p){0>Pt||(p.current=Bt[Pt],Bt[Pt]=null,Pt--)}function Be(p,g){Pt++,Bt[Pt]=p.current,p.current=g}var kt={},ut=ln(kt),rn=ln(!1),vi=kt;function hn(p,g){var A=p.type.contextTypes;if(!A)return kt;var E=p.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===g)return E.__reactInternalMemoizedMaskedChildContext;var D={},F;for(F in A)D[F]=g[F];return E&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=g,p.__reactInternalMemoizedMaskedChildContext=D),D}function li(p){return p=p.childContextTypes,p!=null}function Ot(){at(rn),at(ut)}function Ei(p,g,A){if(ut.current!==kt)throw Error(o(168));Be(ut,g),Be(rn,A)}function aa(p,g,A){var E=p.stateNode;if(g=g.childContextTypes,typeof E.getChildContext!="function")return A;E=E.getChildContext();for(var D in E)if(!(D in g))throw Error(o(108,I(p)||"Unknown",D));return s({},A,E)}function Tn(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||kt,vi=ut.current,Be(ut,p),Be(rn,rn.current),!0}function la(p,g,A){var E=p.stateNode;if(!E)throw Error(o(169));A?(p=aa(p,g,vi),E.__reactInternalMemoizedMergedChildContext=p,at(rn),at(ut),Be(ut,p)):at(rn),Be(rn,A)}var Nr=Math.clz32?Math.clz32:g7,Au=Math.log,m7=Math.LN2;function g7(p){return p>>>=0,p===0?32:31-(Au(p)/m7|0)|0}var My=64,Ay=4194304;function _m(p){switch(p&-p){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 p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function wy(p,g){var A=p.pendingLanes;if(A===0)return 0;var E=0,D=p.suspendedLanes,F=p.pingedLanes,ne=A&268435455;if(ne!==0){var ye=ne&~D;ye!==0?E=_m(ye):(F&=ne,F!==0&&(E=_m(F)))}else ne=A&~D,ne!==0?E=_m(ne):F!==0&&(E=_m(F));if(E===0)return 0;if(g!==0&&g!==E&&!(g&D)&&(D=E&-E,F=g&-g,D>=F||D===16&&(F&4194240)!==0))return g;if(E&4&&(E|=A&16),g=p.entangledLanes,g!==0)for(p=p.entanglements,g&=E;0A;A++)g.push(p);return g}function xm(p,g,A){p.pendingLanes|=g,g!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,g=31-Nr(g),p[g]=A}function _7(p,g){var A=p.pendingLanes&~g;p.pendingLanes=g,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=g,p.mutableReadLanes&=g,p.entangledLanes&=g,g=p.entanglements;var E=p.eventTimes;for(p=p.expirationTimes;0>=ne,D-=ne,Xa=1<<32-Nr(g)+D|A<_n?($i=Ht,Ht=null):$i=Ht.sibling;var xn=It(Pe,Ht,Oe[_n],mt);if(xn===null){Ht===null&&(Ht=$i);break}p&&Ht&&xn.alternate===null&&g(Pe,Ht),xe=F(xn,xe,_n),qt===null?Et=xn:qt.sibling=xn,qt=xn,Ht=$i}if(_n===Oe.length)return A(Pe,Ht),Jn&&Eu(Pe,_n),Et;if(Ht===null){for(;_n_n?($i=Ht,Ht=null):$i=Ht.sibling;var Ql=It(Pe,Ht,xn.value,mt);if(Ql===null){Ht===null&&(Ht=$i);break}p&&Ht&&Ql.alternate===null&&g(Pe,Ht),xe=F(Ql,xe,_n),qt===null?Et=Ql:qt.sibling=Ql,qt=Ql,Ht=$i}if(xn.done)return A(Pe,Ht),Jn&&Eu(Pe,_n),Et;if(Ht===null){for(;!xn.done;_n++,xn=Oe.next())xn=Gt(Pe,xn.value,mt),xn!==null&&(xe=F(xn,xe,_n),qt===null?Et=xn:qt.sibling=xn,qt=xn);return Jn&&Eu(Pe,_n),Et}for(Ht=E(Pe,Ht);!xn.done;_n++,xn=Oe.next())xn=Un(Ht,Pe,_n,xn.value,mt),xn!==null&&(p&&xn.alternate!==null&&Ht.delete(xn.key===null?_n:xn.key),xe=F(xn,xe,_n),qt===null?Et=xn:qt.sibling=xn,qt=xn);return p&&Ht.forEach(function(rj){return g(Pe,rj)}),Jn&&Eu(Pe,_n),Et}function to(Pe,xe,Oe,mt){if(typeof Oe=="object"&&Oe!==null&&Oe.type===u&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case l:e:{for(var Et=Oe.key,qt=xe;qt!==null;){if(qt.key===Et){if(Et=Oe.type,Et===u){if(qt.tag===7){A(Pe,qt.sibling),xe=D(qt,Oe.props.children),xe.return=Pe,Pe=xe;break e}}else if(qt.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===x&&WD(Et)===qt.type){A(Pe,qt.sibling),xe=D(qt,Oe.props),xe.ref=Am(Pe,qt,Oe),xe.return=Pe,Pe=xe;break e}A(Pe,qt);break}else g(Pe,qt);qt=qt.sibling}Oe.type===u?(xe=Lu(Oe.props.children,Pe.mode,mt,Oe.key),xe.return=Pe,Pe=xe):(mt=d_(Oe.type,Oe.key,Oe.props,null,Pe.mode,mt),mt.ref=Am(Pe,xe,Oe),mt.return=Pe,Pe=mt)}return ne(Pe);case c:e:{for(qt=Oe.key;xe!==null;){if(xe.key===qt)if(xe.tag===4&&xe.stateNode.containerInfo===Oe.containerInfo&&xe.stateNode.implementation===Oe.implementation){A(Pe,xe.sibling),xe=D(xe,Oe.children||[]),xe.return=Pe,Pe=xe;break e}else{A(Pe,xe);break}else g(Pe,xe);xe=xe.sibling}xe=WE(Oe,Pe.mode,mt),xe.return=Pe,Pe=xe}return ne(Pe);case x:return qt=Oe._init,to(Pe,xe,qt(Oe._payload),mt)}if(Z(Oe))return Tt(Pe,xe,Oe,mt);if(T(Oe))return ur(Pe,xe,Oe,mt);Ny(Pe,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"?(Oe=""+Oe,xe!==null&&xe.tag===6?(A(Pe,xe.sibling),xe=D(xe,Oe),xe.return=Pe,Pe=xe):(A(Pe,xe),xe=VE(Oe,Pe.mode,mt),xe.return=Pe,Pe=xe),ne(Pe)):A(Pe,xe)}return to}var Dd=$D(!0),XD=$D(!1),wm={},qs=ln(wm),Em=ln(wm),Bd=ln(wm);function fa(p){if(p===wm)throw Error(o(174));return p}function aE(p,g){Be(Bd,g),Be(Em,p),Be(qs,wm),p=re(g),at(qs),Be(qs,p)}function Nd(){at(qs),at(Em),at(Bd)}function jD(p){var g=fa(Bd.current),A=fa(qs.current);g=O(A,p.type,g),A!==g&&(Be(Em,p),Be(qs,g))}function lE(p){Em.current===p&&(at(qs),at(Em))}var Zn=ln(0);function Uy(p){for(var g=p;g!==null;){if(g.tag===13){var A=g.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||$l(A)||Va(A)))return g}else if(g.tag===19&&g.memoizedProps.revealOrder!==void 0){if(g.flags&128)return g}else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===p)break;for(;g.sibling===null;){if(g.return===null||g.return===p)return null;g=g.return}g.sibling.return=g.return,g=g.sibling}return null}var cE=[];function uE(){for(var p=0;pA?A:4,p(!0);var E=Zs.transition;Zs.transition={};try{p(!1),g()}finally{yn=A,Zs.transition=E}}function aB(){return pa().memoizedState}function I7(p,g,A){var E=Kl(p);A={lane:E,action:A,hasEagerState:!1,eagerState:null,next:null},lB(p)?cB(g,A):(uB(p,g,A),A=Fr(),p=Qs(p,E,A),p!==null&&hB(p,g,E))}function L7(p,g,A){var E=Kl(p),D={lane:E,action:A,hasEagerState:!1,eagerState:null,next:null};if(lB(p))cB(g,D);else{uB(p,g,D);var F=p.alternate;if(p.lanes===0&&(F===null||F.lanes===0)&&(F=g.lastRenderedReducer,F!==null))try{var ne=g.lastRenderedState,ye=F(ne,A);if(D.hasEagerState=!0,D.eagerState=ye,ua(ye,ne))return}catch{}finally{}A=Fr(),p=Qs(p,E,A),p!==null&&hB(p,g,E)}}function lB(p){var g=p.alternate;return p===ci||g!==null&&g===ci}function cB(p,g){Tm=Oy=!0;var A=p.pending;A===null?g.next=g:(g.next=A.next,A.next=g),p.pending=g}function uB(p,g,A){Ti!==null&&p.mode&1&&!(nn&2)?(p=g.interleaved,p===null?(A.next=A,da===null?da=[g]:da.push(g)):(A.next=p.next,p.next=A),g.interleaved=A):(p=g.pending,p===null?A.next=A:(A.next=p.next,p.next=A),g.pending=A)}function hB(p,g,A){if(A&4194240){var E=g.lanes;E&=p.pendingLanes,A|=E,g.lanes=A,Ww(p,A)}}var Vy={readContext:Ys,useCallback:lr,useContext:lr,useEffect:lr,useImperativeHandle:lr,useInsertionEffect:lr,useLayoutEffect:lr,useMemo:lr,useReducer:lr,useRef:lr,useState:lr,useDebugValue:lr,useDeferredValue:lr,useTransition:lr,useMutableSource:lr,useSyncExternalStore:lr,useId:lr,unstable_isNewReconciler:!1},D7={readContext:Ys,useCallback:function(p,g){return Ya().memoizedState=[p,g===void 0?null:g],p},useContext:Ys,useEffect:mE,useImperativeHandle:function(p,g,A){return A=A!=null?A.concat([p]):null,Gy(4194308,4,iB.bind(null,g,p),A)},useLayoutEffect:function(p,g){return Gy(4194308,4,p,g)},useInsertionEffect:function(p,g){return Gy(4,2,p,g)},useMemo:function(p,g){var A=Ya();return g=g===void 0?null:g,p=p(),A.memoizedState=[p,g],p},useReducer:function(p,g,A){var E=Ya();return g=A!==void 0?A(g):g,E.memoizedState=E.baseState=g,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:g},E.queue=p,p=p.dispatch=I7.bind(null,ci,p),[E.memoizedState,p]},useRef:function(p){var g=Ya();return p={current:p},g.memoizedState=p},useState:pE,useDebugValue:gE,useDeferredValue:function(p){var g=pE(p),A=g[0],E=g[1];return mE(function(){var D=Zs.transition;Zs.transition={};try{E(p)}finally{Zs.transition=D}},[p]),A},useTransition:function(){var p=pE(!1),g=p[0];return p=P7.bind(null,p[1]),Ya().memoizedState=p,[g,p]},useMutableSource:function(){},useSyncExternalStore:function(p,g,A){var E=ci,D=Ya();if(Jn){if(A===void 0)throw Error(o(407));A=A()}else{if(A=g(),Ti===null)throw Error(o(349));Ud&30||KD(E,g,A)}D.memoizedState=A;var F={value:A,getSnapshot:g};return D.queue=F,mE(ZD.bind(null,E,F,p),[p]),E.flags|=2048,Cm(9,qD.bind(null,E,F,A,g),void 0,null),A},useId:function(){var p=Ya(),g=Ti.identifierPrefix;if(Jn){var A=ja,E=Xa;A=(E&~(1<<32-Nr(E)-1)).toString(32)+A,g=":"+g+"R"+A,A=bm++,0")&&(Ge=Ge.replace("",p.displayName)),Ge}while(1<=ne&&0<=ye);break}}}finally{tt=!1,Error.prepareStackTrace=A}return(p=p?p.displayName||p.name:"")?qe(p):""}var At=Object.prototype.hasOwnProperty,Bt=[],Pt=-1;function ln(p){return{current:p}}function at(p){0>Pt||(p.current=Bt[Pt],Bt[Pt]=null,Pt--)}function Be(p,g){Pt++,Bt[Pt]=p.current,p.current=g}var kt={},ut=ln(kt),rn=ln(!1),vi=kt;function hn(p,g){var A=p.type.contextTypes;if(!A)return kt;var E=p.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===g)return E.__reactInternalMemoizedMaskedChildContext;var D={},F;for(F in A)D[F]=g[F];return E&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=g,p.__reactInternalMemoizedMaskedChildContext=D),D}function li(p){return p=p.childContextTypes,p!=null}function Ot(){at(rn),at(ut)}function Ei(p,g,A){if(ut.current!==kt)throw Error(o(168));Be(ut,g),Be(rn,A)}function aa(p,g,A){var E=p.stateNode;if(g=g.childContextTypes,typeof E.getChildContext!="function")return A;E=E.getChildContext();for(var D in E)if(!(D in g))throw Error(o(108,I(p)||"Unknown",D));return s({},A,E)}function Tn(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||kt,vi=ut.current,Be(ut,p),Be(rn,rn.current),!0}function la(p,g,A){var E=p.stateNode;if(!E)throw Error(o(169));A?(p=aa(p,g,vi),E.__reactInternalMemoizedMergedChildContext=p,at(rn),at(ut),Be(ut,p)):at(rn),Be(rn,A)}var Nr=Math.clz32?Math.clz32:x7,Au=Math.log,_7=Math.LN2;function x7(p){return p>>>=0,p===0?32:31-(Au(p)/_7|0)|0}var Sy=64,My=4194304;function xm(p){switch(p&-p){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 p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function Ay(p,g){var A=p.pendingLanes;if(A===0)return 0;var E=0,D=p.suspendedLanes,F=p.pingedLanes,ne=A&268435455;if(ne!==0){var ye=ne&~D;ye!==0?E=xm(ye):(F&=ne,F!==0&&(E=xm(F)))}else ne=A&~D,ne!==0?E=xm(ne):F!==0&&(E=xm(F));if(E===0)return 0;if(g!==0&&g!==E&&!(g&D)&&(D=E&-E,F=g&-g,D>=F||D===16&&(F&4194240)!==0))return g;if(E&4&&(E|=A&16),g=p.entangledLanes,g!==0)for(p=p.entanglements,g&=E;0A;A++)g.push(p);return g}function Sm(p,g,A){p.pendingLanes|=g,g!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,g=31-Nr(g),p[g]=A}function A7(p,g){var A=p.pendingLanes&~g;p.pendingLanes=g,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=g,p.mutableReadLanes&=g,p.entangledLanes&=g,g=p.entanglements;var E=p.eventTimes;for(p=p.expirationTimes;0>=ne,D-=ne,Xa=1<<32-Nr(g)+D|A<_n?($i=Ht,Ht=null):$i=Ht.sibling;var xn=It(Pe,Ht,Oe[_n],mt);if(xn===null){Ht===null&&(Ht=$i);break}p&&Ht&&xn.alternate===null&&g(Pe,Ht),xe=F(xn,xe,_n),qt===null?Et=xn:qt.sibling=xn,qt=xn,Ht=$i}if(_n===Oe.length)return A(Pe,Ht),Jn&&Eu(Pe,_n),Et;if(Ht===null){for(;_n_n?($i=Ht,Ht=null):$i=Ht.sibling;var Zl=It(Pe,Ht,xn.value,mt);if(Zl===null){Ht===null&&(Ht=$i);break}p&&Ht&&Zl.alternate===null&&g(Pe,Ht),xe=F(Zl,xe,_n),qt===null?Et=Zl:qt.sibling=Zl,qt=Zl,Ht=$i}if(xn.done)return A(Pe,Ht),Jn&&Eu(Pe,_n),Et;if(Ht===null){for(;!xn.done;_n++,xn=Oe.next())xn=Gt(Pe,xn.value,mt),xn!==null&&(xe=F(xn,xe,_n),qt===null?Et=xn:qt.sibling=xn,qt=xn);return Jn&&Eu(Pe,_n),Et}for(Ht=E(Pe,Ht);!xn.done;_n++,xn=Oe.next())xn=Un(Ht,Pe,_n,xn.value,mt),xn!==null&&(p&&xn.alternate!==null&&Ht.delete(xn.key===null?_n:xn.key),xe=F(xn,xe,_n),qt===null?Et=xn:qt.sibling=xn,qt=xn);return p&&Ht.forEach(function(lj){return g(Pe,lj)}),Jn&&Eu(Pe,_n),Et}function to(Pe,xe,Oe,mt){if(typeof Oe=="object"&&Oe!==null&&Oe.type===u&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case l:e:{for(var Et=Oe.key,qt=xe;qt!==null;){if(qt.key===Et){if(Et=Oe.type,Et===u){if(qt.tag===7){A(Pe,qt.sibling),xe=D(qt,Oe.props.children),xe.return=Pe,Pe=xe;break e}}else if(qt.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===x&&jD(Et)===qt.type){A(Pe,qt.sibling),xe=D(qt,Oe.props),xe.ref=wm(Pe,qt,Oe),xe.return=Pe,Pe=xe;break e}A(Pe,qt);break}else g(Pe,qt);qt=qt.sibling}Oe.type===u?(xe=Lu(Oe.props.children,Pe.mode,mt,Oe.key),xe.return=Pe,Pe=xe):(mt=h_(Oe.type,Oe.key,Oe.props,null,Pe.mode,mt),mt.ref=wm(Pe,xe,Oe),mt.return=Pe,Pe=mt)}return ne(Pe);case c:e:{for(qt=Oe.key;xe!==null;){if(xe.key===qt)if(xe.tag===4&&xe.stateNode.containerInfo===Oe.containerInfo&&xe.stateNode.implementation===Oe.implementation){A(Pe,xe.sibling),xe=D(xe,Oe.children||[]),xe.return=Pe,Pe=xe;break e}else{A(Pe,xe);break}else g(Pe,xe);xe=xe.sibling}xe=HE(Oe,Pe.mode,mt),xe.return=Pe,Pe=xe}return ne(Pe);case x:return qt=Oe._init,to(Pe,xe,qt(Oe._payload),mt)}if(Z(Oe))return Tt(Pe,xe,Oe,mt);if(T(Oe))return ur(Pe,xe,Oe,mt);By(Pe,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"?(Oe=""+Oe,xe!==null&&xe.tag===6?(A(Pe,xe.sibling),xe=D(xe,Oe),xe.return=Pe,Pe=xe):(A(Pe,xe),xe=GE(Oe,Pe.mode,mt),xe.return=Pe,Pe=xe),ne(Pe)):A(Pe,xe)}return to}var Dd=YD(!0),JD=YD(!1),Em={},qs=ln(Em),Tm=ln(Em),Bd=ln(Em);function fa(p){if(p===Em)throw Error(o(174));return p}function sE(p,g){Be(Bd,g),Be(Tm,p),Be(qs,Em),p=re(g),at(qs),Be(qs,p)}function Nd(){at(qs),at(Tm),at(Bd)}function KD(p){var g=fa(Bd.current),A=fa(qs.current);g=O(A,p.type,g),A!==g&&(Be(Tm,p),Be(qs,g))}function oE(p){Tm.current===p&&(at(qs),at(Tm))}var Zn=ln(0);function Ny(p){for(var g=p;g!==null;){if(g.tag===13){var A=g.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||Wl(A)||Va(A)))return g}else if(g.tag===19&&g.memoizedProps.revealOrder!==void 0){if(g.flags&128)return g}else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===p)break;for(;g.sibling===null;){if(g.return===null||g.return===p)return null;g=g.return}g.sibling.return=g.return,g=g.sibling}return null}var aE=[];function lE(){for(var p=0;pA?A:4,p(!0);var E=Zs.transition;Zs.transition={};try{p(!1),g()}finally{yn=A,Zs.transition=E}}function uB(){return pa().memoizedState}function N7(p,g,A){var E=Jl(p);A={lane:E,action:A,hasEagerState:!1,eagerState:null,next:null},hB(p)?dB(g,A):(fB(p,g,A),A=Fr(),p=Qs(p,E,A),p!==null&&pB(p,g,E))}function U7(p,g,A){var E=Jl(p),D={lane:E,action:A,hasEagerState:!1,eagerState:null,next:null};if(hB(p))dB(g,D);else{fB(p,g,D);var F=p.alternate;if(p.lanes===0&&(F===null||F.lanes===0)&&(F=g.lastRenderedReducer,F!==null))try{var ne=g.lastRenderedState,ye=F(ne,A);if(D.hasEagerState=!0,D.eagerState=ye,ua(ye,ne))return}catch{}finally{}A=Fr(),p=Qs(p,E,A),p!==null&&pB(p,g,E)}}function hB(p){var g=p.alternate;return p===ci||g!==null&&g===ci}function dB(p,g){bm=Fy=!0;var A=p.pending;A===null?g.next=g:(g.next=A.next,A.next=g),p.pending=g}function fB(p,g,A){Ti!==null&&p.mode&1&&!(nn&2)?(p=g.interleaved,p===null?(A.next=A,da===null?da=[g]:da.push(g)):(A.next=p.next,p.next=A),g.interleaved=A):(p=g.pending,p===null?A.next=A:(A.next=p.next,p.next=A),g.pending=A)}function pB(p,g,A){if(A&4194240){var E=g.lanes;E&=p.pendingLanes,A|=E,g.lanes=A,Hw(p,A)}}var Hy={readContext:Ys,useCallback:lr,useContext:lr,useEffect:lr,useImperativeHandle:lr,useInsertionEffect:lr,useLayoutEffect:lr,useMemo:lr,useReducer:lr,useRef:lr,useState:lr,useDebugValue:lr,useDeferredValue:lr,useTransition:lr,useMutableSource:lr,useSyncExternalStore:lr,useId:lr,unstable_isNewReconciler:!1},F7={readContext:Ys,useCallback:function(p,g){return Ya().memoizedState=[p,g===void 0?null:g],p},useContext:Ys,useEffect:fE,useImperativeHandle:function(p,g,A){return A=A!=null?A.concat([p]):null,zy(4194308,4,oB.bind(null,g,p),A)},useLayoutEffect:function(p,g){return zy(4194308,4,p,g)},useInsertionEffect:function(p,g){return zy(4,2,p,g)},useMemo:function(p,g){var A=Ya();return g=g===void 0?null:g,p=p(),A.memoizedState=[p,g],p},useReducer:function(p,g,A){var E=Ya();return g=A!==void 0?A(g):g,E.memoizedState=E.baseState=g,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:g},E.queue=p,p=p.dispatch=N7.bind(null,ci,p),[E.memoizedState,p]},useRef:function(p){var g=Ya();return p={current:p},g.memoizedState=p},useState:dE,useDebugValue:pE,useDeferredValue:function(p){var g=dE(p),A=g[0],E=g[1];return fE(function(){var D=Zs.transition;Zs.transition={};try{E(p)}finally{Zs.transition=D}},[p]),A},useTransition:function(){var p=dE(!1),g=p[0];return p=B7.bind(null,p[1]),Ya().memoizedState=p,[g,p]},useMutableSource:function(){},useSyncExternalStore:function(p,g,A){var E=ci,D=Ya();if(Jn){if(A===void 0)throw Error(o(407));A=A()}else{if(A=g(),Ti===null)throw Error(o(349));Ud&30||QD(E,g,A)}D.memoizedState=A;var F={value:A,getSnapshot:g};return D.queue=F,fE(tB.bind(null,E,F,p),[p]),E.flags|=2048,Rm(9,eB.bind(null,E,F,A,g),void 0,null),A},useId:function(){var p=Ya(),g=Ti.identifierPrefix;if(Jn){var A=ja,E=Xa;A=(E&~(1<<32-Nr(E)-1)).toString(32)+A,g=":"+g+"R"+A,A=Cm++,0NE&&(g.flags|=128,E=!0,Lm(D,!1),g.lanes=4194304)}else{if(!E)if(p=Uy(F),p!==null){if(g.flags|=128,E=!0,p=p.updateQueue,p!==null&&(g.updateQueue=p,g.flags|=4),Lm(D,!0),D.tail===null&&D.tailMode==="hidden"&&!F.alternate&&!Jn)return cr(g),null}else 2*Vi()-D.renderingStartTime>NE&&A!==1073741824&&(g.flags|=128,E=!0,Lm(D,!1),g.lanes=4194304);D.isBackwards?(F.sibling=g.child,g.child=F):(p=D.last,p!==null?p.sibling=F:g.child=F,D.last=F)}return D.tail!==null?(g=D.tail,D.rendering=g,D.tail=g.sibling,D.renderingStartTime=Vi(),g.sibling=null,p=Zn.current,Be(Zn,E?p&1|2:p&1),g):(cr(g),null);case 22:case 23:return zE(),E=g.memoizedState!==null,p!==null&&p.memoizedState!==null!==E&&(g.flags|=8192),E&&g.mode&1?As&1073741824&&(cr(g),Ke&&g.subtreeFlags&6&&(g.flags|=8192)):cr(g),null;case 24:return null;case 25:return null}throw Error(o(156,g.tag))}var O7=a.ReactCurrentOwner,Ms=!1;function Ur(p,g,A,E){g.child=p===null?XD(g,null,A,E):Dd(g,p.child,A,E)}function _B(p,g,A,E,D){A=A.render;var F=g.ref;return Rd(g,D),E=dE(p,g,A,E,F,D),A=fE(),p!==null&&!Ms?(g.updateQueue=p.updateQueue,g.flags&=-2053,p.lanes&=~D,Ja(p,g,D)):(Jn&&A&&nE(g),g.flags|=1,Ur(p,g,E,D),g.child)}function xB(p,g,A,E,D){if(p===null){var F=A.type;return typeof F=="function"&&!HE(F)&&F.defaultProps===void 0&&A.compare===null&&A.defaultProps===void 0?(g.tag=15,g.type=F,SB(p,g,F,E,D)):(p=d_(A.type,null,E,g,g.mode,D),p.ref=g.ref,p.return=g,g.child=p)}if(F=p.child,!(p.lanes&D)){var ne=F.memoizedProps;if(A=A.compare,A=A!==null?A:by,A(ne,E)&&p.ref===g.ref)return Ja(p,g,D)}return g.flags|=1,p=Zl(F,E),p.ref=g.ref,p.return=g,g.child=p}function SB(p,g,A,E,D){if(p!==null&&by(p.memoizedProps,E)&&p.ref===g.ref)if(Ms=!1,(p.lanes&D)!==0)p.flags&131072&&(Ms=!0);else return g.lanes=p.lanes,Ja(p,g,D);return _E(p,g,A,E,D)}function MB(p,g,A){var E=g.pendingProps,D=E.children,F=p!==null?p.memoizedState:null;if(E.mode==="hidden")if(!(g.mode&1))g.memoizedState={baseLanes:0,cachePool:null},Be(Fd,As),As|=A;else if(A&1073741824)g.memoizedState={baseLanes:0,cachePool:null},E=F!==null?F.baseLanes:A,Be(Fd,As),As|=E;else return p=F!==null?F.baseLanes|A:A,g.lanes=g.childLanes=1073741824,g.memoizedState={baseLanes:p,cachePool:null},g.updateQueue=null,Be(Fd,As),As|=p,null;else F!==null?(E=F.baseLanes|A,g.memoizedState=null):E=A,Be(Fd,As),As|=E;return Ur(p,g,D,A),g.child}function AB(p,g){var A=g.ref;(p===null&&A!==null||p!==null&&p.ref!==A)&&(g.flags|=512,g.flags|=2097152)}function _E(p,g,A,E,D){var F=li(A)?vi:ut.current;return F=hn(g,F),Rd(g,D),A=dE(p,g,A,E,F,D),E=fE(),p!==null&&!Ms?(g.updateQueue=p.updateQueue,g.flags&=-2053,p.lanes&=~D,Ja(p,g,D)):(Jn&&E&&nE(g),g.flags|=1,Ur(p,g,A,D),g.child)}function wB(p,g,A,E,D){if(li(A)){var F=!0;Tn(g)}else F=!1;if(Rd(g,D),g.stateNode===null)p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2),OD(g,A,E),tE(g,A,E,D),E=!0;else if(p===null){var ne=g.stateNode,ye=g.memoizedProps;ne.props=ye;var Ge=ne.context,ot=A.contextType;typeof ot=="object"&&ot!==null?ot=Ys(ot):(ot=li(A)?vi:ut.current,ot=hn(g,ot));var St=A.getDerivedStateFromProps,Gt=typeof St=="function"||typeof ne.getSnapshotBeforeUpdate=="function";Gt||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(ye!==E||Ge!==ot)&&kD(g,ne,E,ot),Xl=!1;var It=g.memoizedState;ne.state=It,Iy(g,E,ne,D),Ge=g.memoizedState,ye!==E||It!==Ge||rn.current||Xl?(typeof St=="function"&&(eE(g,A,St,E),Ge=g.memoizedState),(ye=Xl||FD(g,A,ye,E,It,Ge,ot))?(Gt||typeof ne.UNSAFE_componentWillMount!="function"&&typeof ne.componentWillMount!="function"||(typeof ne.componentWillMount=="function"&&ne.componentWillMount(),typeof ne.UNSAFE_componentWillMount=="function"&&ne.UNSAFE_componentWillMount()),typeof ne.componentDidMount=="function"&&(g.flags|=4194308)):(typeof ne.componentDidMount=="function"&&(g.flags|=4194308),g.memoizedProps=E,g.memoizedState=Ge),ne.props=E,ne.state=Ge,ne.context=ot,E=ye):(typeof ne.componentDidMount=="function"&&(g.flags|=4194308),E=!1)}else{ne=g.stateNode,DD(p,g),ye=g.memoizedProps,ot=g.type===g.elementType?ye:wo(g.type,ye),ne.props=ot,Gt=g.pendingProps,It=ne.context,Ge=A.contextType,typeof Ge=="object"&&Ge!==null?Ge=Ys(Ge):(Ge=li(A)?vi:ut.current,Ge=hn(g,Ge));var Un=A.getDerivedStateFromProps;(St=typeof Un=="function"||typeof ne.getSnapshotBeforeUpdate=="function")||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(ye!==Gt||It!==Ge)&&kD(g,ne,E,Ge),Xl=!1,It=g.memoizedState,ne.state=It,Iy(g,E,ne,D);var Tt=g.memoizedState;ye!==Gt||It!==Tt||rn.current||Xl?(typeof Un=="function"&&(eE(g,A,Un,E),Tt=g.memoizedState),(ot=Xl||FD(g,A,ot,E,It,Tt,Ge)||!1)?(St||typeof ne.UNSAFE_componentWillUpdate!="function"&&typeof ne.componentWillUpdate!="function"||(typeof ne.componentWillUpdate=="function"&&ne.componentWillUpdate(E,Tt,Ge),typeof ne.UNSAFE_componentWillUpdate=="function"&&ne.UNSAFE_componentWillUpdate(E,Tt,Ge)),typeof ne.componentDidUpdate=="function"&&(g.flags|=4),typeof ne.getSnapshotBeforeUpdate=="function"&&(g.flags|=1024)):(typeof ne.componentDidUpdate!="function"||ye===p.memoizedProps&&It===p.memoizedState||(g.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||ye===p.memoizedProps&&It===p.memoizedState||(g.flags|=1024),g.memoizedProps=E,g.memoizedState=Tt),ne.props=E,ne.state=Tt,ne.context=Ge,E=ot):(typeof ne.componentDidUpdate!="function"||ye===p.memoizedProps&&It===p.memoizedState||(g.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||ye===p.memoizedProps&&It===p.memoizedState||(g.flags|=1024),E=!1)}return xE(p,g,A,E,F,D)}function xE(p,g,A,E,D,F){AB(p,g);var ne=(g.flags&128)!==0;if(!E&&!ne)return D&&la(g,A,!1),Ja(p,g,F);E=g.stateNode,O7.current=g;var ye=ne&&typeof A.getDerivedStateFromError!="function"?null:E.render();return g.flags|=1,p!==null&&ne?(g.child=Dd(g,p.child,null,F),g.child=Dd(g,null,ye,F)):Ur(p,g,ye,F),g.memoizedState=E.state,D&&la(g,A,!0),g.child}function EB(p){var g=p.stateNode;g.pendingContext?Ei(p,g.pendingContext,g.pendingContext!==g.context):g.context&&Ei(p,g.context,!1),aE(p,g.containerInfo)}function TB(p,g,A,E,D){return Ld(),oE(D),g.flags|=256,Ur(p,g,A,E),g.child}var Xy={dehydrated:null,treeContext:null,retryLane:0};function jy(p){return{baseLanes:p,cachePool:null}}function bB(p,g,A){var E=g.pendingProps,D=Zn.current,F=!1,ne=(g.flags&128)!==0,ye;if((ye=ne)||(ye=p!==null&&p.memoizedState===null?!1:(D&2)!==0),ye?(F=!0,g.flags&=-129):(p===null||p.memoizedState!==null)&&(D|=1),Be(Zn,D&1),p===null)return sE(g),p=g.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?(g.mode&1?Va(p)?g.lanes=8:g.lanes=1073741824:g.lanes=1,null):(D=E.children,p=E.fallback,F?(E=g.mode,F=g.child,D={mode:"hidden",children:D},!(E&1)&&F!==null?(F.childLanes=0,F.pendingProps=D):F=f_(D,E,0,null),p=Lu(p,E,A,null),F.return=g,p.return=g,F.sibling=p,g.child=F,g.child.memoizedState=jy(A),g.memoizedState=Xy,p):SE(g,D));if(D=p.memoizedState,D!==null){if(ye=D.dehydrated,ye!==null){if(ne)return g.flags&256?(g.flags&=-257,Yy(p,g,A,Error(o(422)))):g.memoizedState!==null?(g.child=p.child,g.flags|=128,null):(F=E.fallback,D=g.mode,E=f_({mode:"visible",children:E.children},D,0,null),F=Lu(F,D,A,null),F.flags|=2,E.return=g,F.return=g,E.sibling=F,g.child=E,g.mode&1&&Dd(g,p.child,null,A),g.child.memoizedState=jy(A),g.memoizedState=Xy,F);if(!(g.mode&1))g=Yy(p,g,A,null);else if(Va(ye))g=Yy(p,g,A,Error(o(419)));else if(E=(A&p.childLanes)!==0,Ms||E){if(E=Ti,E!==null){switch(A&-A){case 4:F=2;break;case 16:F=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:F=32;break;case 536870912:F=268435456;break;default:F=0}E=F&(E.suspendedLanes|A)?0:F,E!==0&&E!==D.retryLane&&(D.retryLane=E,Qs(p,E,-1))}GE(),g=Yy(p,g,A,Error(o(421)))}else $l(ye)?(g.flags|=128,g.child=p.child,g=q7.bind(null,p),So(ye,g),g=null):(A=D.treeContext,me&&(Ss=Mu(ye),xs=g,Jn=!0,Eo=null,Sm=!1,A!==null&&(Js[Ks++]=Xa,Js[Ks++]=ja,Js[Ks++]=wu,Xa=A.id,ja=A.overflow,wu=g)),g=SE(g,g.pendingProps.children),g.flags|=4096);return g}return F?(E=RB(p,g,E.children,E.fallback,A),F=g.child,D=p.child.memoizedState,F.memoizedState=D===null?jy(A):{baseLanes:D.baseLanes|A,cachePool:null},F.childLanes=p.childLanes&~A,g.memoizedState=Xy,E):(A=CB(p,g,E.children,A),g.memoizedState=null,A)}return F?(E=RB(p,g,E.children,E.fallback,A),F=g.child,D=p.child.memoizedState,F.memoizedState=D===null?jy(A):{baseLanes:D.baseLanes|A,cachePool:null},F.childLanes=p.childLanes&~A,g.memoizedState=Xy,E):(A=CB(p,g,E.children,A),g.memoizedState=null,A)}function SE(p,g){return g=f_({mode:"visible",children:g},p.mode,0,null),g.return=p,p.child=g}function CB(p,g,A,E){var D=p.child;return p=D.sibling,A=Zl(D,{mode:"visible",children:A}),!(g.mode&1)&&(A.lanes=E),A.return=g,A.sibling=null,p!==null&&(E=g.deletions,E===null?(g.deletions=[p],g.flags|=16):E.push(p)),g.child=A}function RB(p,g,A,E,D){var F=g.mode;p=p.child;var ne=p.sibling,ye={mode:"hidden",children:A};return!(F&1)&&g.child!==p?(A=g.child,A.childLanes=0,A.pendingProps=ye,g.deletions=null):(A=Zl(p,ye),A.subtreeFlags=p.subtreeFlags&14680064),ne!==null?E=Zl(ne,E):(E=Lu(E,F,D,null),E.flags|=2),E.return=g,A.return=g,A.sibling=E,g.child=A,E}function Yy(p,g,A,E){return E!==null&&oE(E),Dd(g,p.child,null,A),p=SE(g,g.pendingProps.children),p.flags|=2,g.memoizedState=null,p}function PB(p,g,A){p.lanes|=g;var E=p.alternate;E!==null&&(E.lanes|=g),Zw(p.return,g,A)}function ME(p,g,A,E,D){var F=p.memoizedState;F===null?p.memoizedState={isBackwards:g,rendering:null,renderingStartTime:0,last:E,tail:A,tailMode:D}:(F.isBackwards=g,F.rendering=null,F.renderingStartTime=0,F.last=E,F.tail=A,F.tailMode=D)}function IB(p,g,A){var E=g.pendingProps,D=E.revealOrder,F=E.tail;if(Ur(p,g,E.children,A),E=Zn.current,E&2)E=E&1|2,g.flags|=128;else{if(p!==null&&p.flags&128)e:for(p=g.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&PB(p,A,g);else if(p.tag===19)PB(p,A,g);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===g)break e;for(;p.sibling===null;){if(p.return===null||p.return===g)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}E&=1}if(Be(Zn,E),!(g.mode&1))g.memoizedState=null;else switch(D){case"forwards":for(A=g.child,D=null;A!==null;)p=A.alternate,p!==null&&Uy(p)===null&&(D=A),A=A.sibling;A=D,A===null?(D=g.child,g.child=null):(D=A.sibling,A.sibling=null),ME(g,!1,D,A,F);break;case"backwards":for(A=null,D=g.child,g.child=null;D!==null;){if(p=D.alternate,p!==null&&Uy(p)===null){g.child=D;break}p=D.sibling,D.sibling=A,A=D,D=p}ME(g,!0,A,null,F);break;case"together":ME(g,!1,null,null,void 0);break;default:g.memoizedState=null}return g.child}function Ja(p,g,A){if(p!==null&&(g.dependencies=p.dependencies),Od|=g.lanes,!(A&g.childLanes))return null;if(p!==null&&g.child!==p.child)throw Error(o(153));if(g.child!==null){for(p=g.child,A=Zl(p,p.pendingProps),g.child=A,A.return=g;p.sibling!==null;)p=p.sibling,A=A.sibling=Zl(p,p.pendingProps),A.return=g;A.sibling=null}return g.child}function k7(p,g,A){switch(g.tag){case 3:EB(g),Ld();break;case 5:jD(g);break;case 1:li(g.type)&&Tn(g);break;case 4:aE(g,g.stateNode.containerInfo);break;case 10:LD(g,g.type._context,g.memoizedProps.value);break;case 13:var E=g.memoizedState;if(E!==null)return E.dehydrated!==null?(Be(Zn,Zn.current&1),g.flags|=128,null):A&g.child.childLanes?bB(p,g,A):(Be(Zn,Zn.current&1),p=Ja(p,g,A),p!==null?p.sibling:null);Be(Zn,Zn.current&1);break;case 19:if(E=(A&g.childLanes)!==0,p.flags&128){if(E)return IB(p,g,A);g.flags|=128}var D=g.memoizedState;if(D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),Be(Zn,Zn.current),E)break;return null;case 22:case 23:return g.lanes=0,MB(p,g,A)}return Ja(p,g,A)}function z7(p,g){switch(iE(g),g.tag){case 1:return li(g.type)&&Ot(),p=g.flags,p&65536?(g.flags=p&-65537|128,g):null;case 3:return Nd(),at(rn),at(ut),uE(),p=g.flags,p&65536&&!(p&128)?(g.flags=p&-65537|128,g):null;case 5:return lE(g),null;case 13:if(at(Zn),p=g.memoizedState,p!==null&&p.dehydrated!==null){if(g.alternate===null)throw Error(o(340));Ld()}return p=g.flags,p&65536?(g.flags=p&-65537|128,g):null;case 19:return at(Zn),null;case 4:return Nd(),null;case 10:return qw(g.type._context),null;case 22:case 23:return zE(),null;case 24:return null;default:return null}}var Jy=!1,bu=!1,G7=typeof WeakSet=="function"?WeakSet:Set,ft=null;function Ky(p,g){var A=p.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(E){ss(p,g,E)}else A.current=null}function AE(p,g,A){try{A()}catch(E){ss(p,g,E)}}var LB=!1;function H7(p,g){for(Q(p.containerInfo),ft=g;ft!==null;)if(p=ft,g=p.child,(p.subtreeFlags&1028)!==0&&g!==null)g.return=p,ft=g;else for(;ft!==null;){p=ft;try{var A=p.alternate;if(p.flags&1024)switch(p.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var E=A.memoizedProps,D=A.memoizedState,F=p.stateNode,ne=F.getSnapshotBeforeUpdate(p.elementType===p.type?E:wo(p.type,E),D);F.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:Ke&&Ee(p.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ye){ss(p,p.return,ye)}if(g=p.sibling,g!==null){g.return=p.return,ft=g;break}ft=p.return}return A=LB,LB=!1,A}function Cu(p,g,A){var E=g.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var D=E=E.next;do{if((D.tag&p)===p){var F=D.destroy;D.destroy=void 0,F!==void 0&&AE(g,A,F)}D=D.next}while(D!==E)}}function Dm(p,g){if(g=g.updateQueue,g=g!==null?g.lastEffect:null,g!==null){var A=g=g.next;do{if((A.tag&p)===p){var E=A.create;A.destroy=E()}A=A.next}while(A!==g)}}function wE(p){var g=p.ref;if(g!==null){var A=p.stateNode;switch(p.tag){case 5:p=X(A);break;default:p=A}typeof g=="function"?g(p):g.current=p}}function DB(p,g,A){if(ca&&typeof ca.onCommitFiberUnmount=="function")try{ca.onCommitFiberUnmount(Ey,g)}catch{}switch(g.tag){case 0:case 11:case 14:case 15:if(p=g.updateQueue,p!==null&&(p=p.lastEffect,p!==null)){var E=p=p.next;do{var D=E,F=D.destroy;D=D.tag,F!==void 0&&(D&2||D&4)&&AE(g,A,F),E=E.next}while(E!==p)}break;case 1:if(Ky(g,A),p=g.stateNode,typeof p.componentWillUnmount=="function")try{p.props=g.memoizedProps,p.state=g.memoizedState,p.componentWillUnmount()}catch(ne){ss(g,A,ne)}break;case 5:Ky(g,A);break;case 4:Ke?kB(p,g,A):B&&B&&(g=g.stateNode.containerInfo,A=lt(g),vt(g,A))}}function BB(p,g,A){for(var E=g;;)if(DB(p,E,A),E.child===null||Ke&&E.tag===4){if(E===g)break;for(;E.sibling===null;){if(E.return===null||E.return===g)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function NB(p){var g=p.alternate;g!==null&&(p.alternate=null,NB(g)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(g=p.stateNode,g!==null&&Xe(g)),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function UB(p){return p.tag===5||p.tag===3||p.tag===4}function FB(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||UB(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function OB(p){if(Ke){e:{for(var g=p.return;g!==null;){if(UB(g))break e;g=g.return}throw Error(o(160))}var A=g;switch(A.tag){case 5:g=A.stateNode,A.flags&32&&(et(g),A.flags&=-33),A=FB(p),TE(p,A,g);break;case 3:case 4:g=A.stateNode.containerInfo,A=FB(p),EE(p,A,g);break;default:throw Error(o(161))}}}function EE(p,g,A){var E=p.tag;if(E===5||E===6)p=p.stateNode,g?ke(A,p,g):st(A,p);else if(E!==4&&(p=p.child,p!==null))for(EE(p,g,A),p=p.sibling;p!==null;)EE(p,g,A),p=p.sibling}function TE(p,g,A){var E=p.tag;if(E===5||E===6)p=p.stateNode,g?nt(A,p,g):Ue(A,p);else if(E!==4&&(p=p.child,p!==null))for(TE(p,g,A),p=p.sibling;p!==null;)TE(p,g,A),p=p.sibling}function kB(p,g,A){for(var E=g,D=!1,F,ne;;){if(!D){D=E.return;e:for(;;){if(D===null)throw Error(o(160));switch(F=D.stateNode,D.tag){case 5:ne=!1;break e;case 3:F=F.containerInfo,ne=!0;break e;case 4:F=F.containerInfo,ne=!0;break e}D=D.return}D=!0}if(E.tag===5||E.tag===6)BB(p,E,A),ne?be(F,E.stateNode):ie(F,E.stateNode);else if(E.tag===18)ne?W(F,E.stateNode):K(F,E.stateNode);else if(E.tag===4){if(E.child!==null){F=E.stateNode.containerInfo,ne=!0,E.child.return=E,E=E.child;continue}}else if(DB(p,E,A),E.child!==null){E.child.return=E,E=E.child;continue}if(E===g)break;for(;E.sibling===null;){if(E.return===null||E.return===g)return;E=E.return,E.tag===4&&(D=!1)}E.sibling.return=E.return,E=E.sibling}}function bE(p,g){if(Ke){switch(g.tag){case 0:case 11:case 14:case 15:Cu(3,g,g.return),Dm(3,g),Cu(5,g,g.return);return;case 1:return;case 5:var A=g.stateNode;if(A!=null){var E=g.memoizedProps;p=p!==null?p.memoizedProps:E;var D=g.type,F=g.updateQueue;g.updateQueue=null,F!==null&&pt(A,F,D,p,E,g)}return;case 6:if(g.stateNode===null)throw Error(o(162));A=g.memoizedProps,_e(g.stateNode,p!==null?p.memoizedProps:A,A);return;case 3:me&&p!==null&&p.memoizedState.isDehydrated&&H(g.stateNode.containerInfo);return;case 12:return;case 13:qy(g);return;case 19:qy(g);return;case 17:return}throw Error(o(163))}switch(g.tag){case 0:case 11:case 14:case 15:Cu(3,g,g.return),Dm(3,g),Cu(5,g,g.return);return;case 12:return;case 13:qy(g);return;case 19:qy(g);return;case 3:me&&p!==null&&p.memoizedState.isDehydrated&&H(g.stateNode.containerInfo);break;case 22:case 23:return}e:if(B){switch(g.tag){case 1:case 5:case 6:break e;case 3:case 4:g=g.stateNode,vt(g.containerInfo,g.pendingChildren);break e}throw Error(o(163))}}function qy(p){var g=p.updateQueue;if(g!==null){p.updateQueue=null;var A=p.stateNode;A===null&&(A=p.stateNode=new G7),g.forEach(function(E){var D=Z7.bind(null,p,E);A.has(E)||(A.add(E),E.then(D,D))})}}function V7(p,g){for(ft=g;ft!==null;){g=ft;var A=g.deletions;if(A!==null)for(var E=0;E";case Qy:return":has("+(PE(p)||"")+")";case e_:return'[role="'+p.value+'"]';case n_:return'"'+p.value+'"';case t_:return'[data-testname="'+p.value+'"]';default:throw Error(o(365))}}function WB(p,g){var A=[];p=[p,0];for(var E=0;ED&&(D=ne),E&=~F}if(E=D,E=Vi()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*$7(E/1960))-E,10p?16:p,Jl===null)var E=!1;else{if(p=Jl,Jl=null,a_=0,nn&6)throw Error(o(331));var D=nn;for(nn|=4,ft=p.current;ft!==null;){var F=ft,ne=F.child;if(ft.flags&16){var ye=F.deletions;if(ye!==null){for(var Ge=0;GeVi()-BE?Ru(p,0):DE|=A),rs(p,g)}function QB(p,g){g===0&&(p.mode&1?(g=Ay,Ay<<=1,!(Ay&130023424)&&(Ay=4194304)):g=1);var A=Fr();p=u_(p,g),p!==null&&(xm(p,g,A),rs(p,A))}function q7(p){var g=p.memoizedState,A=0;g!==null&&(A=g.retryLane),QB(p,A)}function Z7(p,g){var A=0;switch(p.tag){case 13:var E=p.stateNode,D=p.memoizedState;D!==null&&(A=D.retryLane);break;case 19:E=p.stateNode;break;default:throw Error(o(314))}E!==null&&E.delete(g),QB(p,A)}var e3;e3=function(p,g,A){if(p!==null)if(p.memoizedProps!==g.pendingProps||rn.current)Ms=!0;else{if(!(p.lanes&A)&&!(g.flags&128))return Ms=!1,k7(p,g,A);Ms=!!(p.flags&131072)}else Ms=!1,Jn&&g.flags&1048576&&zD(g,By,g.index);switch(g.lanes=0,g.tag){case 2:var E=g.type;p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2),p=g.pendingProps;var D=hn(g,ut.current);Rd(g,A),D=dE(null,g,E,p,D,A);var F=fE();return g.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(g.tag=1,g.memoizedState=null,g.updateQueue=null,li(E)?(F=!0,Tn(g)):F=!1,g.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,Qw(g),D.updater=Ly,g.stateNode=D,D._reactInternals=g,tE(g,E,p,A),g=xE(null,g,E,!0,F,A)):(g.tag=0,Jn&&F&&nE(g),Ur(null,g,D,A),g=g.child),g;case 16:E=g.elementType;e:{switch(p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2),p=g.pendingProps,D=E._init,E=D(E._payload),g.type=E,D=g.tag=ej(E),p=wo(E,p),D){case 0:g=_E(null,g,E,p,A);break e;case 1:g=wB(null,g,E,p,A);break e;case 11:g=_B(null,g,E,p,A);break e;case 14:g=xB(null,g,E,wo(E.type,p),A);break e}throw Error(o(306,E,""))}return g;case 0:return E=g.type,D=g.pendingProps,D=g.elementType===E?D:wo(E,D),_E(p,g,E,D,A);case 1:return E=g.type,D=g.pendingProps,D=g.elementType===E?D:wo(E,D),wB(p,g,E,D,A);case 3:e:{if(EB(g),p===null)throw Error(o(387));E=g.pendingProps,F=g.memoizedState,D=F.element,DD(p,g),Iy(g,E,null,A);var ne=g.memoizedState;if(E=ne.element,me&&F.isDehydrated)if(F={element:E,isDehydrated:!1,cache:ne.cache,transitions:ne.transitions},g.updateQueue.baseState=F,g.memoizedState=F,g.flags&256){D=Error(o(423)),g=TB(p,g,E,A,D);break e}else if(E!==D){D=Error(o(424)),g=TB(p,g,E,A,D);break e}else for(me&&(Ss=Su(g.stateNode.containerInfo),xs=g,Jn=!0,Eo=null,Sm=!1),A=XD(g,null,E,A),g.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if(Ld(),E===D){g=Ja(p,g,A);break e}Ur(p,g,E,A)}g=g.child}return g;case 5:return jD(g),p===null&&sE(g),E=g.type,D=g.pendingProps,F=p!==null?p.memoizedProps:null,ne=D.children,fe(E,D)?ne=null:F!==null&&fe(E,F)&&(g.flags|=32),AB(p,g),Ur(p,g,ne,A),g.child;case 6:return p===null&&sE(g),null;case 13:return bB(p,g,A);case 4:return aE(g,g.stateNode.containerInfo),E=g.pendingProps,p===null?g.child=Dd(g,null,E,A):Ur(p,g,E,A),g.child;case 11:return E=g.type,D=g.pendingProps,D=g.elementType===E?D:wo(E,D),_B(p,g,E,D,A);case 7:return Ur(p,g,g.pendingProps,A),g.child;case 8:return Ur(p,g,g.pendingProps.children,A),g.child;case 12:return Ur(p,g,g.pendingProps.children,A),g.child;case 10:e:{if(E=g.type._context,D=g.pendingProps,F=g.memoizedProps,ne=D.value,LD(g,E,ne),F!==null)if(ua(F.value,ne)){if(F.children===D.children&&!rn.current){g=Ja(p,g,A);break e}}else for(F=g.child,F!==null&&(F.return=g);F!==null;){var ye=F.dependencies;if(ye!==null){ne=F.child;for(var Ge=ye.firstContext;Ge!==null;){if(Ge.context===E){if(F.tag===1){Ge=$a(-1,A&-A),Ge.tag=2;var ot=F.updateQueue;if(ot!==null){ot=ot.shared;var St=ot.pending;St===null?Ge.next=Ge:(Ge.next=St.next,St.next=Ge),ot.pending=Ge}}F.lanes|=A,Ge=F.alternate,Ge!==null&&(Ge.lanes|=A),Zw(F.return,A,g),ye.lanes|=A;break}Ge=Ge.next}}else if(F.tag===10)ne=F.type===g.type?null:F.child;else if(F.tag===18){if(ne=F.return,ne===null)throw Error(o(341));ne.lanes|=A,ye=ne.alternate,ye!==null&&(ye.lanes|=A),Zw(ne,A,g),ne=F.sibling}else ne=F.child;if(ne!==null)ne.return=F;else for(ne=F;ne!==null;){if(ne===g){ne=null;break}if(F=ne.sibling,F!==null){F.return=ne.return,ne=F;break}ne=ne.return}F=ne}Ur(p,g,D.children,A),g=g.child}return g;case 9:return D=g.type,E=g.pendingProps.children,Rd(g,A),D=Ys(D),E=E(D),g.flags|=1,Ur(p,g,E,A),g.child;case 14:return E=g.type,D=wo(E,g.pendingProps),D=wo(E.type,D),xB(p,g,E,D,A);case 15:return SB(p,g,g.type,g.pendingProps,A);case 17:return E=g.type,D=g.pendingProps,D=g.elementType===E?D:wo(E,D),p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2),g.tag=1,li(E)?(p=!0,Tn(g)):p=!1,Rd(g,A),OD(g,E,D),tE(g,E,D,A),xE(null,g,E,!0,p,A);case 19:return IB(p,g,A);case 22:return MB(p,g,A)}throw Error(o(156,g.tag))};function t3(p,g){return $w(p,g)}function Q7(p,g,A,E){this.tag=p,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=g,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function eo(p,g,A,E){return new Q7(p,g,A,E)}function HE(p){return p=p.prototype,!(!p||!p.isReactComponent)}function ej(p){if(typeof p=="function")return HE(p)?1:0;if(p!=null){if(p=p.$$typeof,p===_)return 11;if(p===S)return 14}return 2}function Zl(p,g){var A=p.alternate;return A===null?(A=eo(p.tag,g,p.key,p.mode),A.elementType=p.elementType,A.type=p.type,A.stateNode=p.stateNode,A.alternate=p,p.alternate=A):(A.pendingProps=g,A.type=p.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=p.flags&14680064,A.childLanes=p.childLanes,A.lanes=p.lanes,A.child=p.child,A.memoizedProps=p.memoizedProps,A.memoizedState=p.memoizedState,A.updateQueue=p.updateQueue,g=p.dependencies,A.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext},A.sibling=p.sibling,A.index=p.index,A.ref=p.ref,A}function d_(p,g,A,E,D,F){var ne=2;if(E=p,typeof p=="function")HE(p)&&(ne=1);else if(typeof p=="string")ne=5;else e:switch(p){case u:return Lu(A.children,D,F,g);case h:ne=8,D|=8;break;case d:return p=eo(12,A,g,D|2),p.elementType=d,p.lanes=F,p;case y:return p=eo(13,A,g,D),p.elementType=y,p.lanes=F,p;case m:return p=eo(19,A,g,D),p.elementType=m,p.lanes=F,p;case M:return f_(A,D,F,g);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case f:ne=10;break e;case v:ne=9;break e;case _:ne=11;break e;case S:ne=14;break e;case x:ne=16,E=null;break e}throw Error(o(130,p==null?p:typeof p,""))}return g=eo(ne,A,g,D),g.elementType=p,g.type=E,g.lanes=F,g}function Lu(p,g,A,E){return p=eo(7,p,E,g),p.lanes=A,p}function f_(p,g,A,E){return p=eo(22,p,E,g),p.elementType=M,p.lanes=A,p.stateNode={},p}function VE(p,g,A){return p=eo(6,p,null,g),p.lanes=A,p}function WE(p,g,A){return g=eo(4,p.children!==null?p.children:[],p.key,g),g.lanes=A,g.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},g}function tj(p,g,A,E,D){this.tag=g,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Qe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vw(0),this.expirationTimes=Vw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vw(0),this.identifierPrefix=E,this.onRecoverableError=D,me&&(this.mutableSourceEagerHydrationData=null)}function n3(p,g,A,E,D,F,ne,ye,Ge){return p=new tj(p,g,A,ye,Ge),g===1?(g=1,F===!0&&(g|=8)):g=0,F=eo(3,null,null,g),p.current=F,F.stateNode=p,F.memoizedState={element:E,isDehydrated:A,cache:null,transitions:null},Qw(F),p}function i3(p){if(!p)return kt;p=p._reactInternals;e:{if(b(p)!==p||p.tag!==1)throw Error(o(170));var g=p;do{switch(g.tag){case 3:g=g.stateNode.context;break e;case 1:if(li(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break e}}g=g.return}while(g!==null);throw Error(o(171))}if(p.tag===1){var A=p.type;if(li(A))return aa(p,A,g)}return g}function r3(p){var g=p._reactInternals;if(g===void 0)throw typeof p.render=="function"?Error(o(188)):(p=Object.keys(p).join(","),Error(o(268,p)));return p=G(g),p===null?null:p.stateNode}function s3(p,g){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var A=p.retryLane;p.retryLane=A!==0&&A=ot&&F>=Gt&&D<=St&&ne<=It){p.splice(g,1);break}else if(E!==ot||A.width!==Ge.width||Itne){if(!(F!==Gt||A.height!==Ge.height||StD)){ot>E&&(Ge.width+=ot-E,Ge.x=E),StF&&(Ge.height+=Gt-F,Ge.y=F),ItA&&(A=ne)),neDE&&(g.flags|=128,E=!0,Dm(D,!1),g.lanes=4194304)}else{if(!E)if(p=Ny(F),p!==null){if(g.flags|=128,E=!0,p=p.updateQueue,p!==null&&(g.updateQueue=p,g.flags|=4),Dm(D,!0),D.tail===null&&D.tailMode==="hidden"&&!F.alternate&&!Jn)return cr(g),null}else 2*Vi()-D.renderingStartTime>DE&&A!==1073741824&&(g.flags|=128,E=!0,Dm(D,!1),g.lanes=4194304);D.isBackwards?(F.sibling=g.child,g.child=F):(p=D.last,p!==null?p.sibling=F:g.child=F,D.last=F)}return D.tail!==null?(g=D.tail,D.rendering=g,D.tail=g.sibling,D.renderingStartTime=Vi(),g.sibling=null,p=Zn.current,Be(Zn,E?p&1|2:p&1),g):(cr(g),null);case 22:case 23:return OE(),E=g.memoizedState!==null,p!==null&&p.memoizedState!==null!==E&&(g.flags|=8192),E&&g.mode&1?As&1073741824&&(cr(g),Ke&&g.subtreeFlags&6&&(g.flags|=8192)):cr(g),null;case 24:return null;case 25:return null}throw Error(o(156,g.tag))}var H7=a.ReactCurrentOwner,Ms=!1;function Ur(p,g,A,E){g.child=p===null?JD(g,null,A,E):Dd(g,p.child,A,E)}function MB(p,g,A,E,D){A=A.render;var F=g.ref;return Rd(g,D),E=uE(p,g,A,E,F,D),A=hE(),p!==null&&!Ms?(g.updateQueue=p.updateQueue,g.flags&=-2053,p.lanes&=~D,Ja(p,g,D)):(Jn&&A&&eE(g),g.flags|=1,Ur(p,g,E,D),g.child)}function AB(p,g,A,E,D){if(p===null){var F=A.type;return typeof F=="function"&&!zE(F)&&F.defaultProps===void 0&&A.compare===null&&A.defaultProps===void 0?(g.tag=15,g.type=F,wB(p,g,F,E,D)):(p=h_(A.type,null,E,g,g.mode,D),p.ref=g.ref,p.return=g,g.child=p)}if(F=p.child,!(p.lanes&D)){var ne=F.memoizedProps;if(A=A.compare,A=A!==null?A:Ty,A(ne,E)&&p.ref===g.ref)return Ja(p,g,D)}return g.flags|=1,p=ql(F,E),p.ref=g.ref,p.return=g,g.child=p}function wB(p,g,A,E,D){if(p!==null&&Ty(p.memoizedProps,E)&&p.ref===g.ref)if(Ms=!1,(p.lanes&D)!==0)p.flags&131072&&(Ms=!0);else return g.lanes=p.lanes,Ja(p,g,D);return vE(p,g,A,E,D)}function EB(p,g,A){var E=g.pendingProps,D=E.children,F=p!==null?p.memoizedState:null;if(E.mode==="hidden")if(!(g.mode&1))g.memoizedState={baseLanes:0,cachePool:null},Be(Fd,As),As|=A;else if(A&1073741824)g.memoizedState={baseLanes:0,cachePool:null},E=F!==null?F.baseLanes:A,Be(Fd,As),As|=E;else return p=F!==null?F.baseLanes|A:A,g.lanes=g.childLanes=1073741824,g.memoizedState={baseLanes:p,cachePool:null},g.updateQueue=null,Be(Fd,As),As|=p,null;else F!==null?(E=F.baseLanes|A,g.memoizedState=null):E=A,Be(Fd,As),As|=E;return Ur(p,g,D,A),g.child}function TB(p,g){var A=g.ref;(p===null&&A!==null||p!==null&&p.ref!==A)&&(g.flags|=512,g.flags|=2097152)}function vE(p,g,A,E,D){var F=li(A)?vi:ut.current;return F=hn(g,F),Rd(g,D),A=uE(p,g,A,E,F,D),E=hE(),p!==null&&!Ms?(g.updateQueue=p.updateQueue,g.flags&=-2053,p.lanes&=~D,Ja(p,g,D)):(Jn&&E&&eE(g),g.flags|=1,Ur(p,g,A,D),g.child)}function bB(p,g,A,E,D){if(li(A)){var F=!0;Tn(g)}else F=!1;if(Rd(g,D),g.stateNode===null)p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2),GD(g,A,E),Qw(g,A,E,D),E=!0;else if(p===null){var ne=g.stateNode,ye=g.memoizedProps;ne.props=ye;var Ge=ne.context,ot=A.contextType;typeof ot=="object"&&ot!==null?ot=Ys(ot):(ot=li(A)?vi:ut.current,ot=hn(g,ot));var St=A.getDerivedStateFromProps,Gt=typeof St=="function"||typeof ne.getSnapshotBeforeUpdate=="function";Gt||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(ye!==E||Ge!==ot)&&HD(g,ne,E,ot),$l=!1;var It=g.memoizedState;ne.state=It,Py(g,E,ne,D),Ge=g.memoizedState,ye!==E||It!==Ge||rn.current||$l?(typeof St=="function"&&(Zw(g,A,St,E),Ge=g.memoizedState),(ye=$l||zD(g,A,ye,E,It,Ge,ot))?(Gt||typeof ne.UNSAFE_componentWillMount!="function"&&typeof ne.componentWillMount!="function"||(typeof ne.componentWillMount=="function"&&ne.componentWillMount(),typeof ne.UNSAFE_componentWillMount=="function"&&ne.UNSAFE_componentWillMount()),typeof ne.componentDidMount=="function"&&(g.flags|=4194308)):(typeof ne.componentDidMount=="function"&&(g.flags|=4194308),g.memoizedProps=E,g.memoizedState=Ge),ne.props=E,ne.state=Ge,ne.context=ot,E=ye):(typeof ne.componentDidMount=="function"&&(g.flags|=4194308),E=!1)}else{ne=g.stateNode,UD(p,g),ye=g.memoizedProps,ot=g.type===g.elementType?ye:wo(g.type,ye),ne.props=ot,Gt=g.pendingProps,It=ne.context,Ge=A.contextType,typeof Ge=="object"&&Ge!==null?Ge=Ys(Ge):(Ge=li(A)?vi:ut.current,Ge=hn(g,Ge));var Un=A.getDerivedStateFromProps;(St=typeof Un=="function"||typeof ne.getSnapshotBeforeUpdate=="function")||typeof ne.UNSAFE_componentWillReceiveProps!="function"&&typeof ne.componentWillReceiveProps!="function"||(ye!==Gt||It!==Ge)&&HD(g,ne,E,Ge),$l=!1,It=g.memoizedState,ne.state=It,Py(g,E,ne,D);var Tt=g.memoizedState;ye!==Gt||It!==Tt||rn.current||$l?(typeof Un=="function"&&(Zw(g,A,Un,E),Tt=g.memoizedState),(ot=$l||zD(g,A,ot,E,It,Tt,Ge)||!1)?(St||typeof ne.UNSAFE_componentWillUpdate!="function"&&typeof ne.componentWillUpdate!="function"||(typeof ne.componentWillUpdate=="function"&&ne.componentWillUpdate(E,Tt,Ge),typeof ne.UNSAFE_componentWillUpdate=="function"&&ne.UNSAFE_componentWillUpdate(E,Tt,Ge)),typeof ne.componentDidUpdate=="function"&&(g.flags|=4),typeof ne.getSnapshotBeforeUpdate=="function"&&(g.flags|=1024)):(typeof ne.componentDidUpdate!="function"||ye===p.memoizedProps&&It===p.memoizedState||(g.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||ye===p.memoizedProps&&It===p.memoizedState||(g.flags|=1024),g.memoizedProps=E,g.memoizedState=Tt),ne.props=E,ne.state=Tt,ne.context=Ge,E=ot):(typeof ne.componentDidUpdate!="function"||ye===p.memoizedProps&&It===p.memoizedState||(g.flags|=4),typeof ne.getSnapshotBeforeUpdate!="function"||ye===p.memoizedProps&&It===p.memoizedState||(g.flags|=1024),E=!1)}return yE(p,g,A,E,F,D)}function yE(p,g,A,E,D,F){TB(p,g);var ne=(g.flags&128)!==0;if(!E&&!ne)return D&&la(g,A,!1),Ja(p,g,F);E=g.stateNode,H7.current=g;var ye=ne&&typeof A.getDerivedStateFromError!="function"?null:E.render();return g.flags|=1,p!==null&&ne?(g.child=Dd(g,p.child,null,F),g.child=Dd(g,null,ye,F)):Ur(p,g,ye,F),g.memoizedState=E.state,D&&la(g,A,!0),g.child}function CB(p){var g=p.stateNode;g.pendingContext?Ei(p,g.pendingContext,g.pendingContext!==g.context):g.context&&Ei(p,g.context,!1),sE(p,g.containerInfo)}function RB(p,g,A,E,D){return Ld(),rE(D),g.flags|=256,Ur(p,g,A,E),g.child}var $y={dehydrated:null,treeContext:null,retryLane:0};function Xy(p){return{baseLanes:p,cachePool:null}}function PB(p,g,A){var E=g.pendingProps,D=Zn.current,F=!1,ne=(g.flags&128)!==0,ye;if((ye=ne)||(ye=p!==null&&p.memoizedState===null?!1:(D&2)!==0),ye?(F=!0,g.flags&=-129):(p===null||p.memoizedState!==null)&&(D|=1),Be(Zn,D&1),p===null)return iE(g),p=g.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?(g.mode&1?Va(p)?g.lanes=8:g.lanes=1073741824:g.lanes=1,null):(D=E.children,p=E.fallback,F?(E=g.mode,F=g.child,D={mode:"hidden",children:D},!(E&1)&&F!==null?(F.childLanes=0,F.pendingProps=D):F=d_(D,E,0,null),p=Lu(p,E,A,null),F.return=g,p.return=g,F.sibling=p,g.child=F,g.child.memoizedState=Xy(A),g.memoizedState=$y,p):_E(g,D));if(D=p.memoizedState,D!==null){if(ye=D.dehydrated,ye!==null){if(ne)return g.flags&256?(g.flags&=-257,jy(p,g,A,Error(o(422)))):g.memoizedState!==null?(g.child=p.child,g.flags|=128,null):(F=E.fallback,D=g.mode,E=d_({mode:"visible",children:E.children},D,0,null),F=Lu(F,D,A,null),F.flags|=2,E.return=g,F.return=g,E.sibling=F,g.child=E,g.mode&1&&Dd(g,p.child,null,A),g.child.memoizedState=Xy(A),g.memoizedState=$y,F);if(!(g.mode&1))g=jy(p,g,A,null);else if(Va(ye))g=jy(p,g,A,Error(o(419)));else if(E=(A&p.childLanes)!==0,Ms||E){if(E=Ti,E!==null){switch(A&-A){case 4:F=2;break;case 16:F=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:F=32;break;case 536870912:F=268435456;break;default:F=0}E=F&(E.suspendedLanes|A)?0:F,E!==0&&E!==D.retryLane&&(D.retryLane=E,Qs(p,E,-1))}kE(),g=jy(p,g,A,Error(o(421)))}else Wl(ye)?(g.flags|=128,g.child=p.child,g=tj.bind(null,p),So(ye,g),g=null):(A=D.treeContext,me&&(Ss=Mu(ye),xs=g,Jn=!0,Eo=null,Mm=!1,A!==null&&(Js[Ks++]=Xa,Js[Ks++]=ja,Js[Ks++]=wu,Xa=A.id,ja=A.overflow,wu=g)),g=_E(g,g.pendingProps.children),g.flags|=4096);return g}return F?(E=LB(p,g,E.children,E.fallback,A),F=g.child,D=p.child.memoizedState,F.memoizedState=D===null?Xy(A):{baseLanes:D.baseLanes|A,cachePool:null},F.childLanes=p.childLanes&~A,g.memoizedState=$y,E):(A=IB(p,g,E.children,A),g.memoizedState=null,A)}return F?(E=LB(p,g,E.children,E.fallback,A),F=g.child,D=p.child.memoizedState,F.memoizedState=D===null?Xy(A):{baseLanes:D.baseLanes|A,cachePool:null},F.childLanes=p.childLanes&~A,g.memoizedState=$y,E):(A=IB(p,g,E.children,A),g.memoizedState=null,A)}function _E(p,g){return g=d_({mode:"visible",children:g},p.mode,0,null),g.return=p,p.child=g}function IB(p,g,A,E){var D=p.child;return p=D.sibling,A=ql(D,{mode:"visible",children:A}),!(g.mode&1)&&(A.lanes=E),A.return=g,A.sibling=null,p!==null&&(E=g.deletions,E===null?(g.deletions=[p],g.flags|=16):E.push(p)),g.child=A}function LB(p,g,A,E,D){var F=g.mode;p=p.child;var ne=p.sibling,ye={mode:"hidden",children:A};return!(F&1)&&g.child!==p?(A=g.child,A.childLanes=0,A.pendingProps=ye,g.deletions=null):(A=ql(p,ye),A.subtreeFlags=p.subtreeFlags&14680064),ne!==null?E=ql(ne,E):(E=Lu(E,F,D,null),E.flags|=2),E.return=g,A.return=g,A.sibling=E,g.child=A,E}function jy(p,g,A,E){return E!==null&&rE(E),Dd(g,p.child,null,A),p=_E(g,g.pendingProps.children),p.flags|=2,g.memoizedState=null,p}function DB(p,g,A){p.lanes|=g;var E=p.alternate;E!==null&&(E.lanes|=g),Kw(p.return,g,A)}function xE(p,g,A,E,D){var F=p.memoizedState;F===null?p.memoizedState={isBackwards:g,rendering:null,renderingStartTime:0,last:E,tail:A,tailMode:D}:(F.isBackwards=g,F.rendering=null,F.renderingStartTime=0,F.last=E,F.tail=A,F.tailMode=D)}function BB(p,g,A){var E=g.pendingProps,D=E.revealOrder,F=E.tail;if(Ur(p,g,E.children,A),E=Zn.current,E&2)E=E&1|2,g.flags|=128;else{if(p!==null&&p.flags&128)e:for(p=g.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&DB(p,A,g);else if(p.tag===19)DB(p,A,g);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===g)break e;for(;p.sibling===null;){if(p.return===null||p.return===g)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}E&=1}if(Be(Zn,E),!(g.mode&1))g.memoizedState=null;else switch(D){case"forwards":for(A=g.child,D=null;A!==null;)p=A.alternate,p!==null&&Ny(p)===null&&(D=A),A=A.sibling;A=D,A===null?(D=g.child,g.child=null):(D=A.sibling,A.sibling=null),xE(g,!1,D,A,F);break;case"backwards":for(A=null,D=g.child,g.child=null;D!==null;){if(p=D.alternate,p!==null&&Ny(p)===null){g.child=D;break}p=D.sibling,D.sibling=A,A=D,D=p}xE(g,!0,A,null,F);break;case"together":xE(g,!1,null,null,void 0);break;default:g.memoizedState=null}return g.child}function Ja(p,g,A){if(p!==null&&(g.dependencies=p.dependencies),Od|=g.lanes,!(A&g.childLanes))return null;if(p!==null&&g.child!==p.child)throw Error(o(153));if(g.child!==null){for(p=g.child,A=ql(p,p.pendingProps),g.child=A,A.return=g;p.sibling!==null;)p=p.sibling,A=A.sibling=ql(p,p.pendingProps),A.return=g;A.sibling=null}return g.child}function V7(p,g,A){switch(g.tag){case 3:CB(g),Ld();break;case 5:KD(g);break;case 1:li(g.type)&&Tn(g);break;case 4:sE(g,g.stateNode.containerInfo);break;case 10:ND(g,g.type._context,g.memoizedProps.value);break;case 13:var E=g.memoizedState;if(E!==null)return E.dehydrated!==null?(Be(Zn,Zn.current&1),g.flags|=128,null):A&g.child.childLanes?PB(p,g,A):(Be(Zn,Zn.current&1),p=Ja(p,g,A),p!==null?p.sibling:null);Be(Zn,Zn.current&1);break;case 19:if(E=(A&g.childLanes)!==0,p.flags&128){if(E)return BB(p,g,A);g.flags|=128}var D=g.memoizedState;if(D!==null&&(D.rendering=null,D.tail=null,D.lastEffect=null),Be(Zn,Zn.current),E)break;return null;case 22:case 23:return g.lanes=0,EB(p,g,A)}return Ja(p,g,A)}function W7(p,g){switch(tE(g),g.tag){case 1:return li(g.type)&&Ot(),p=g.flags,p&65536?(g.flags=p&-65537|128,g):null;case 3:return Nd(),at(rn),at(ut),lE(),p=g.flags,p&65536&&!(p&128)?(g.flags=p&-65537|128,g):null;case 5:return oE(g),null;case 13:if(at(Zn),p=g.memoizedState,p!==null&&p.dehydrated!==null){if(g.alternate===null)throw Error(o(340));Ld()}return p=g.flags,p&65536?(g.flags=p&-65537|128,g):null;case 19:return at(Zn),null;case 4:return Nd(),null;case 10:return Jw(g.type._context),null;case 22:case 23:return OE(),null;case 24:return null;default:return null}}var Yy=!1,bu=!1,$7=typeof WeakSet=="function"?WeakSet:Set,ft=null;function Jy(p,g){var A=p.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(E){ss(p,g,E)}else A.current=null}function SE(p,g,A){try{A()}catch(E){ss(p,g,E)}}var NB=!1;function X7(p,g){for(Q(p.containerInfo),ft=g;ft!==null;)if(p=ft,g=p.child,(p.subtreeFlags&1028)!==0&&g!==null)g.return=p,ft=g;else for(;ft!==null;){p=ft;try{var A=p.alternate;if(p.flags&1024)switch(p.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var E=A.memoizedProps,D=A.memoizedState,F=p.stateNode,ne=F.getSnapshotBeforeUpdate(p.elementType===p.type?E:wo(p.type,E),D);F.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:Ke&&Ee(p.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ye){ss(p,p.return,ye)}if(g=p.sibling,g!==null){g.return=p.return,ft=g;break}ft=p.return}return A=NB,NB=!1,A}function Cu(p,g,A){var E=g.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var D=E=E.next;do{if((D.tag&p)===p){var F=D.destroy;D.destroy=void 0,F!==void 0&&SE(g,A,F)}D=D.next}while(D!==E)}}function Bm(p,g){if(g=g.updateQueue,g=g!==null?g.lastEffect:null,g!==null){var A=g=g.next;do{if((A.tag&p)===p){var E=A.create;A.destroy=E()}A=A.next}while(A!==g)}}function ME(p){var g=p.ref;if(g!==null){var A=p.stateNode;switch(p.tag){case 5:p=X(A);break;default:p=A}typeof g=="function"?g(p):g.current=p}}function UB(p,g,A){if(ca&&typeof ca.onCommitFiberUnmount=="function")try{ca.onCommitFiberUnmount(wy,g)}catch{}switch(g.tag){case 0:case 11:case 14:case 15:if(p=g.updateQueue,p!==null&&(p=p.lastEffect,p!==null)){var E=p=p.next;do{var D=E,F=D.destroy;D=D.tag,F!==void 0&&(D&2||D&4)&&SE(g,A,F),E=E.next}while(E!==p)}break;case 1:if(Jy(g,A),p=g.stateNode,typeof p.componentWillUnmount=="function")try{p.props=g.memoizedProps,p.state=g.memoizedState,p.componentWillUnmount()}catch(ne){ss(g,A,ne)}break;case 5:Jy(g,A);break;case 4:Ke?HB(p,g,A):B&&B&&(g=g.stateNode.containerInfo,A=lt(g),vt(g,A))}}function FB(p,g,A){for(var E=g;;)if(UB(p,E,A),E.child===null||Ke&&E.tag===4){if(E===g)break;for(;E.sibling===null;){if(E.return===null||E.return===g)return;E=E.return}E.sibling.return=E.return,E=E.sibling}else E.child.return=E,E=E.child}function OB(p){var g=p.alternate;g!==null&&(p.alternate=null,OB(g)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(g=p.stateNode,g!==null&&Xe(g)),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function kB(p){return p.tag===5||p.tag===3||p.tag===4}function zB(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||kB(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function GB(p){if(Ke){e:{for(var g=p.return;g!==null;){if(kB(g))break e;g=g.return}throw Error(o(160))}var A=g;switch(A.tag){case 5:g=A.stateNode,A.flags&32&&(et(g),A.flags&=-33),A=zB(p),wE(p,A,g);break;case 3:case 4:g=A.stateNode.containerInfo,A=zB(p),AE(p,A,g);break;default:throw Error(o(161))}}}function AE(p,g,A){var E=p.tag;if(E===5||E===6)p=p.stateNode,g?ke(A,p,g):st(A,p);else if(E!==4&&(p=p.child,p!==null))for(AE(p,g,A),p=p.sibling;p!==null;)AE(p,g,A),p=p.sibling}function wE(p,g,A){var E=p.tag;if(E===5||E===6)p=p.stateNode,g?nt(A,p,g):Ue(A,p);else if(E!==4&&(p=p.child,p!==null))for(wE(p,g,A),p=p.sibling;p!==null;)wE(p,g,A),p=p.sibling}function HB(p,g,A){for(var E=g,D=!1,F,ne;;){if(!D){D=E.return;e:for(;;){if(D===null)throw Error(o(160));switch(F=D.stateNode,D.tag){case 5:ne=!1;break e;case 3:F=F.containerInfo,ne=!0;break e;case 4:F=F.containerInfo,ne=!0;break e}D=D.return}D=!0}if(E.tag===5||E.tag===6)FB(p,E,A),ne?be(F,E.stateNode):ie(F,E.stateNode);else if(E.tag===18)ne?W(F,E.stateNode):K(F,E.stateNode);else if(E.tag===4){if(E.child!==null){F=E.stateNode.containerInfo,ne=!0,E.child.return=E,E=E.child;continue}}else if(UB(p,E,A),E.child!==null){E.child.return=E,E=E.child;continue}if(E===g)break;for(;E.sibling===null;){if(E.return===null||E.return===g)return;E=E.return,E.tag===4&&(D=!1)}E.sibling.return=E.return,E=E.sibling}}function EE(p,g){if(Ke){switch(g.tag){case 0:case 11:case 14:case 15:Cu(3,g,g.return),Bm(3,g),Cu(5,g,g.return);return;case 1:return;case 5:var A=g.stateNode;if(A!=null){var E=g.memoizedProps;p=p!==null?p.memoizedProps:E;var D=g.type,F=g.updateQueue;g.updateQueue=null,F!==null&&pt(A,F,D,p,E,g)}return;case 6:if(g.stateNode===null)throw Error(o(162));A=g.memoizedProps,_e(g.stateNode,p!==null?p.memoizedProps:A,A);return;case 3:me&&p!==null&&p.memoizedState.isDehydrated&&H(g.stateNode.containerInfo);return;case 12:return;case 13:Ky(g);return;case 19:Ky(g);return;case 17:return}throw Error(o(163))}switch(g.tag){case 0:case 11:case 14:case 15:Cu(3,g,g.return),Bm(3,g),Cu(5,g,g.return);return;case 12:return;case 13:Ky(g);return;case 19:Ky(g);return;case 3:me&&p!==null&&p.memoizedState.isDehydrated&&H(g.stateNode.containerInfo);break;case 22:case 23:return}e:if(B){switch(g.tag){case 1:case 5:case 6:break e;case 3:case 4:g=g.stateNode,vt(g.containerInfo,g.pendingChildren);break e}throw Error(o(163))}}function Ky(p){var g=p.updateQueue;if(g!==null){p.updateQueue=null;var A=p.stateNode;A===null&&(A=p.stateNode=new $7),g.forEach(function(E){var D=nj.bind(null,p,E);A.has(E)||(A.add(E),E.then(D,D))})}}function j7(p,g){for(ft=g;ft!==null;){g=ft;var A=g.deletions;if(A!==null)for(var E=0;E";case Zy:return":has("+(CE(p)||"")+")";case Qy:return'[role="'+p.value+'"]';case t_:return'"'+p.value+'"';case e_:return'[data-testname="'+p.value+'"]';default:throw Error(o(365))}}function jB(p,g){var A=[];p=[p,0];for(var E=0;ED&&(D=ne),E&=~F}if(E=D,E=Vi()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*J7(E/1960))-E,10p?16:p,Yl===null)var E=!1;else{if(p=Yl,Yl=null,o_=0,nn&6)throw Error(o(331));var D=nn;for(nn|=4,ft=p.current;ft!==null;){var F=ft,ne=F.child;if(ft.flags&16){var ye=F.deletions;if(ye!==null){for(var Ge=0;GeVi()-LE?Ru(p,0):IE|=A),rs(p,g)}function n3(p,g){g===0&&(p.mode&1?(g=My,My<<=1,!(My&130023424)&&(My=4194304)):g=1);var A=Fr();p=c_(p,g),p!==null&&(Sm(p,g,A),rs(p,A))}function tj(p){var g=p.memoizedState,A=0;g!==null&&(A=g.retryLane),n3(p,A)}function nj(p,g){var A=0;switch(p.tag){case 13:var E=p.stateNode,D=p.memoizedState;D!==null&&(A=D.retryLane);break;case 19:E=p.stateNode;break;default:throw Error(o(314))}E!==null&&E.delete(g),n3(p,A)}var i3;i3=function(p,g,A){if(p!==null)if(p.memoizedProps!==g.pendingProps||rn.current)Ms=!0;else{if(!(p.lanes&A)&&!(g.flags&128))return Ms=!1,V7(p,g,A);Ms=!!(p.flags&131072)}else Ms=!1,Jn&&g.flags&1048576&&VD(g,Dy,g.index);switch(g.lanes=0,g.tag){case 2:var E=g.type;p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2),p=g.pendingProps;var D=hn(g,ut.current);Rd(g,A),D=uE(null,g,E,p,D,A);var F=hE();return g.flags|=1,typeof D=="object"&&D!==null&&typeof D.render=="function"&&D.$$typeof===void 0?(g.tag=1,g.memoizedState=null,g.updateQueue=null,li(E)?(F=!0,Tn(g)):F=!1,g.memoizedState=D.state!==null&&D.state!==void 0?D.state:null,qw(g),D.updater=Iy,g.stateNode=D,D._reactInternals=g,Qw(g,E,p,A),g=yE(null,g,E,!0,F,A)):(g.tag=0,Jn&&F&&eE(g),Ur(null,g,D,A),g=g.child),g;case 16:E=g.elementType;e:{switch(p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2),p=g.pendingProps,D=E._init,E=D(E._payload),g.type=E,D=g.tag=rj(E),p=wo(E,p),D){case 0:g=vE(null,g,E,p,A);break e;case 1:g=bB(null,g,E,p,A);break e;case 11:g=MB(null,g,E,p,A);break e;case 14:g=AB(null,g,E,wo(E.type,p),A);break e}throw Error(o(306,E,""))}return g;case 0:return E=g.type,D=g.pendingProps,D=g.elementType===E?D:wo(E,D),vE(p,g,E,D,A);case 1:return E=g.type,D=g.pendingProps,D=g.elementType===E?D:wo(E,D),bB(p,g,E,D,A);case 3:e:{if(CB(g),p===null)throw Error(o(387));E=g.pendingProps,F=g.memoizedState,D=F.element,UD(p,g),Py(g,E,null,A);var ne=g.memoizedState;if(E=ne.element,me&&F.isDehydrated)if(F={element:E,isDehydrated:!1,cache:ne.cache,transitions:ne.transitions},g.updateQueue.baseState=F,g.memoizedState=F,g.flags&256){D=Error(o(423)),g=RB(p,g,E,A,D);break e}else if(E!==D){D=Error(o(424)),g=RB(p,g,E,A,D);break e}else for(me&&(Ss=Su(g.stateNode.containerInfo),xs=g,Jn=!0,Eo=null,Mm=!1),A=JD(g,null,E,A),g.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if(Ld(),E===D){g=Ja(p,g,A);break e}Ur(p,g,E,A)}g=g.child}return g;case 5:return KD(g),p===null&&iE(g),E=g.type,D=g.pendingProps,F=p!==null?p.memoizedProps:null,ne=D.children,fe(E,D)?ne=null:F!==null&&fe(E,F)&&(g.flags|=32),TB(p,g),Ur(p,g,ne,A),g.child;case 6:return p===null&&iE(g),null;case 13:return PB(p,g,A);case 4:return sE(g,g.stateNode.containerInfo),E=g.pendingProps,p===null?g.child=Dd(g,null,E,A):Ur(p,g,E,A),g.child;case 11:return E=g.type,D=g.pendingProps,D=g.elementType===E?D:wo(E,D),MB(p,g,E,D,A);case 7:return Ur(p,g,g.pendingProps,A),g.child;case 8:return Ur(p,g,g.pendingProps.children,A),g.child;case 12:return Ur(p,g,g.pendingProps.children,A),g.child;case 10:e:{if(E=g.type._context,D=g.pendingProps,F=g.memoizedProps,ne=D.value,ND(g,E,ne),F!==null)if(ua(F.value,ne)){if(F.children===D.children&&!rn.current){g=Ja(p,g,A);break e}}else for(F=g.child,F!==null&&(F.return=g);F!==null;){var ye=F.dependencies;if(ye!==null){ne=F.child;for(var Ge=ye.firstContext;Ge!==null;){if(Ge.context===E){if(F.tag===1){Ge=$a(-1,A&-A),Ge.tag=2;var ot=F.updateQueue;if(ot!==null){ot=ot.shared;var St=ot.pending;St===null?Ge.next=Ge:(Ge.next=St.next,St.next=Ge),ot.pending=Ge}}F.lanes|=A,Ge=F.alternate,Ge!==null&&(Ge.lanes|=A),Kw(F.return,A,g),ye.lanes|=A;break}Ge=Ge.next}}else if(F.tag===10)ne=F.type===g.type?null:F.child;else if(F.tag===18){if(ne=F.return,ne===null)throw Error(o(341));ne.lanes|=A,ye=ne.alternate,ye!==null&&(ye.lanes|=A),Kw(ne,A,g),ne=F.sibling}else ne=F.child;if(ne!==null)ne.return=F;else for(ne=F;ne!==null;){if(ne===g){ne=null;break}if(F=ne.sibling,F!==null){F.return=ne.return,ne=F;break}ne=ne.return}F=ne}Ur(p,g,D.children,A),g=g.child}return g;case 9:return D=g.type,E=g.pendingProps.children,Rd(g,A),D=Ys(D),E=E(D),g.flags|=1,Ur(p,g,E,A),g.child;case 14:return E=g.type,D=wo(E,g.pendingProps),D=wo(E.type,D),AB(p,g,E,D,A);case 15:return wB(p,g,g.type,g.pendingProps,A);case 17:return E=g.type,D=g.pendingProps,D=g.elementType===E?D:wo(E,D),p!==null&&(p.alternate=null,g.alternate=null,g.flags|=2),g.tag=1,li(E)?(p=!0,Tn(g)):p=!1,Rd(g,A),GD(g,E,D),Qw(g,E,D,A),yE(null,g,E,!0,p,A);case 19:return BB(p,g,A);case 22:return EB(p,g,A)}throw Error(o(156,g.tag))};function r3(p,g){return Vw(p,g)}function ij(p,g,A,E){this.tag=p,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=g,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function eo(p,g,A,E){return new ij(p,g,A,E)}function zE(p){return p=p.prototype,!(!p||!p.isReactComponent)}function rj(p){if(typeof p=="function")return zE(p)?1:0;if(p!=null){if(p=p.$$typeof,p===_)return 11;if(p===S)return 14}return 2}function ql(p,g){var A=p.alternate;return A===null?(A=eo(p.tag,g,p.key,p.mode),A.elementType=p.elementType,A.type=p.type,A.stateNode=p.stateNode,A.alternate=p,p.alternate=A):(A.pendingProps=g,A.type=p.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=p.flags&14680064,A.childLanes=p.childLanes,A.lanes=p.lanes,A.child=p.child,A.memoizedProps=p.memoizedProps,A.memoizedState=p.memoizedState,A.updateQueue=p.updateQueue,g=p.dependencies,A.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext},A.sibling=p.sibling,A.index=p.index,A.ref=p.ref,A}function h_(p,g,A,E,D,F){var ne=2;if(E=p,typeof p=="function")zE(p)&&(ne=1);else if(typeof p=="string")ne=5;else e:switch(p){case u:return Lu(A.children,D,F,g);case h:ne=8,D|=8;break;case d:return p=eo(12,A,g,D|2),p.elementType=d,p.lanes=F,p;case y:return p=eo(13,A,g,D),p.elementType=y,p.lanes=F,p;case m:return p=eo(19,A,g,D),p.elementType=m,p.lanes=F,p;case M:return d_(A,D,F,g);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case f:ne=10;break e;case v:ne=9;break e;case _:ne=11;break e;case S:ne=14;break e;case x:ne=16,E=null;break e}throw Error(o(130,p==null?p:typeof p,""))}return g=eo(ne,A,g,D),g.elementType=p,g.type=E,g.lanes=F,g}function Lu(p,g,A,E){return p=eo(7,p,E,g),p.lanes=A,p}function d_(p,g,A,E){return p=eo(22,p,E,g),p.elementType=M,p.lanes=A,p.stateNode={},p}function GE(p,g,A){return p=eo(6,p,null,g),p.lanes=A,p}function HE(p,g,A){return g=eo(4,p.children!==null?p.children:[],p.key,g),g.lanes=A,g.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},g}function sj(p,g,A,E,D){this.tag=g,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Qe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gw(0),this.expirationTimes=Gw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gw(0),this.identifierPrefix=E,this.onRecoverableError=D,me&&(this.mutableSourceEagerHydrationData=null)}function s3(p,g,A,E,D,F,ne,ye,Ge){return p=new sj(p,g,A,ye,Ge),g===1?(g=1,F===!0&&(g|=8)):g=0,F=eo(3,null,null,g),p.current=F,F.stateNode=p,F.memoizedState={element:E,isDehydrated:A,cache:null,transitions:null},qw(F),p}function o3(p){if(!p)return kt;p=p._reactInternals;e:{if(b(p)!==p||p.tag!==1)throw Error(o(170));var g=p;do{switch(g.tag){case 3:g=g.stateNode.context;break e;case 1:if(li(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break e}}g=g.return}while(g!==null);throw Error(o(171))}if(p.tag===1){var A=p.type;if(li(A))return aa(p,A,g)}return g}function a3(p){var g=p._reactInternals;if(g===void 0)throw typeof p.render=="function"?Error(o(188)):(p=Object.keys(p).join(","),Error(o(268,p)));return p=G(g),p===null?null:p.stateNode}function l3(p,g){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var A=p.retryLane;p.retryLane=A!==0&&A=ot&&F>=Gt&&D<=St&&ne<=It){p.splice(g,1);break}else if(E!==ot||A.width!==Ge.width||Itne){if(!(F!==Gt||A.height!==Ge.height||StD)){ot>E&&(Ge.width+=ot-E,Ge.x=E),StF&&(Ge.height+=Gt-F,Ge.y=F),ItA&&(A=ne)),ne ")+` No matching component was found for: - `)+p.join(" > ")}return null},t.getPublicRootInstance=function(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return X(p.child.stateNode);default:return p.child.stateNode}},t.injectIntoDevTools=function(p){if(p={bundleType:p.bundleType,version:p.version,rendererPackageName:p.rendererPackageName,rendererConfig:p.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:nj,findFiberByHostInstance:p.findFiberByHostInstance||ij,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")p=!1;else{var g=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(g.isDisabled||!g.supportsFiber)p=!0;else{try{Ey=g.inject(p),ca=g}catch{}p=!!g.checkDCE}}return p},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(p,g,A,E){if(!U)throw Error(o(363));p=IE(p,g);var D=Ae(p,A,E).disconnect;return{disconnect:function(){D()}}},t.registerMutableSourceForHydration=function(p,g){var A=g._getVersion;A=A(g._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[g,A]:p.mutableSourceEagerHydrationData.push(g,A)},t.runWithPriority=function(p,g){var A=yn;try{return yn=p,g()}finally{yn=A}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(p,g,A,E){var D=g.current,F=Fr(),ne=Kl(D);return A=i3(A),g.context===null?g.context=A:g.pendingContext=A,g=$a(F,ne),g.payload={element:p},E=E===void 0?null:E,E!==null&&(g.callback=E),jl(D,g),p=Qs(D,ne,F),p!==null&&Py(p,D,ne),ne},t};W9.exports=oce;var ace=W9.exports;const lce=XP(ace),fL={},j9=n=>void Object.assign(fL,n);function cce(n,e){function t(u,{args:h=[],attach:d,...f},v){let _=`${u[0].toUpperCase()}${u.slice(1)}`,y;if(u==="primitive"){if(f.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const m=f.object;y=Df(m,{type:u,root:v,attach:d,primitive:!0})}else{const m=fL[_];if(!m)throw new Error(`R3F: ${_} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");y=Df(new m(...h),{type:u,root:v,attach:d,memoizedProps:{args:h}})}return y.__r3f.attach===void 0&&(y instanceof Vt?y.__r3f.attach="geometry":y instanceof mi&&(y.__r3f.attach="material")),_!=="inject"&&xb(y,f),y}function i(u,h){let d=!1;if(h){var f,v;(f=h.__r3f)!=null&&f.attach?_b(u,h,h.__r3f.attach):h.isObject3D&&u.isObject3D&&(u.add(h),d=!0),d||(v=u.__r3f)==null||v.objects.push(h),h.__r3f||Df(h,{}),h.__r3f.parent=u,sP(h),Bf(h)}}function r(u,h,d){let f=!1;if(h){var v,_;if((v=h.__r3f)!=null&&v.attach)_b(u,h,h.__r3f.attach);else if(h.isObject3D&&u.isObject3D){h.parent=u,h.dispatchEvent({type:"added"}),u.dispatchEvent({type:"childadded",child:h});const y=u.children.filter(S=>S!==h),m=y.indexOf(d);u.children=[...y.slice(0,m),h,...y.slice(m)],f=!0}f||(_=u.__r3f)==null||_.objects.push(h),h.__r3f||Df(h,{}),h.__r3f.parent=u,sP(h),Bf(h)}}function s(u,h,d=!1){u&&[...u].forEach(f=>o(h,f,d))}function o(u,h,d){if(h){var f,v,_;if(h.__r3f&&(h.__r3f.parent=null),(f=u.__r3f)!=null&&f.objects&&(u.__r3f.objects=u.__r3f.objects.filter(M=>M!==h)),(v=h.__r3f)!=null&&v.attach)xO(u,h,h.__r3f.attach);else if(h.isObject3D&&u.isObject3D){var y;u.remove(h),(y=h.__r3f)!=null&&y.root&&yce(Y1(h),h)}const S=(_=h.__r3f)==null?void 0:_.primitive,x=!S&&(d===void 0?h.dispose!==null:d);if(!S){var m;s((m=h.__r3f)==null?void 0:m.objects,h,x),s(h.children,h,x)}if(delete h.__r3f,x&&h.dispose&&h.type!=="Scene"){const M=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?iP.unstable_scheduleCallback(iP.unstable_IdlePriority,M):M()}Bf(u)}}function a(u,h,d,f){var v;const _=(v=u.__r3f)==null?void 0:v.parent;if(!_)return;const y=t(h,d,u.__r3f.root);if(u.children){for(const m of u.children)m.__r3f&&i(y,m);u.children=u.children.filter(m=>!m.__r3f)}u.__r3f.objects.forEach(m=>i(y,m)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||o(_,u),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(_,y),y.raycast&&y.__r3f.eventCount&&Y1(y).getState().internal.interaction.push(y),[f,f.alternate].forEach(m=>{m!==null&&(m.stateNode=y,m.ref&&(typeof m.ref=="function"?m.ref(y):m.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:lce({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,h)=>{if(!h)return;const d=u.getState().scene;d.__r3f&&(d.__r3f.root=u,i(d,h))},removeChildFromContainer:(u,h)=>{h&&o(u.getState().scene,h)},insertInContainerBefore:(u,h,d)=>{if(!h||!d)return;const f=u.getState().scene;f.__r3f&&r(f,h,d)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var h;return!!((h=u==null?void 0:u.__r3f)!=null?h:{}).handlers},prepareUpdate(u,h,d,f){var v;if(((v=u==null?void 0:u.__r3f)!=null?v:{}).primitive&&f.object&&f.object!==u)return[!0];{const{args:y=[],children:m,...S}=f,{args:x=[],children:M,...R}=d;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((P,I)=>P!==x[I]))return[!0];const T=eW(u,S,R,!0);return T.changes.length?[!1,T]:null}},commitUpdate(u,[h,d],f,v,_,y){h?a(u,f,_,y):xb(u,d)},commitMount(u,h,d,f){var v;const _=(v=u.__r3f)!=null?v:{};u.raycast&&_.handlers&&_.eventCount&&Y1(u).getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>Df(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var h;const{attach:d,parent:f}=(h=u.__r3f)!=null?h:{};d&&f&&xO(f,u,d),u.isObject3D&&(u.visible=!1),Bf(u)},unhideInstance(u,h){var d;const{attach:f,parent:v}=(d=u.__r3f)!=null?d:{};f&&v&&_b(v,u,f),(u.isObject3D&&h.visible==null||h.visible)&&(u.visible=!0),Bf(u)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():rp.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&zn.fun(performance.now)?performance.now:zn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:zn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:zn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:xb}}var gO,vO;const yb=n=>"colorSpace"in n||"outputColorSpace"in n,Y9=()=>{var n;return(n=fL.ColorManagement)!=null?n:null},J9=n=>n&&n.isOrthographicCamera,uce=n=>n&&n.hasOwnProperty("current"),am=typeof window<"u"&&((gO=window.document)!=null&&gO.createElement||((vO=window.navigator)==null?void 0:vO.product)==="ReactNative")?se.useLayoutEffect:se.useEffect;function K9(n){const e=se.useRef(n);return am(()=>void(e.current=n),[n]),e}function hce({set:n}){return am(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class q9 extends se.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}q9.getDerivedStateFromError=()=>({error:!0});const Z9="__default",yO=new Map,dce=n=>n&&!!n.memoized&&!!n.changes;function Q9(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const lg=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Y1(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const zn={obj:n=>n===Object(n)&&!zn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(zn.str(n)||zn.num(n)||zn.boo(n))return n===e;const s=zn.obj(n);if(s&&i==="reference")return n===e;const o=zn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!zn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(zn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function fce(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function pce(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Df(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function rP(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const _O=/-\d+$/;function _b(n,e,t){if(zn.str(t)){if(_O.test(t)){const s=t.replace(_O,""),{target:o,key:a}=rP(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=rP(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function xO(n,e,t){var i,r;if(zn.str(t)){const{target:s,key:o}=rP(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function eW(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},c=!1){const u=n.__r3f,h=Object.entries(r),d=[];if(c){const v=Object.keys(l);for(let _=0;_{var y;if((y=n.__r3f)!=null&&y.primitive&&v==="object"||zn.equ(_,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return d.push([v,_,!0,[]]);let m=[];v.includes("-")&&(m=v.split("-")),d.push([v,_,!1,m]);for(const S in r){const x=r[S];S.startsWith(`${v}-`)&&d.push([S,x,!1,S.split("-")])}});const f={...r};return u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.args&&(f.args=u.memoizedProps.args),u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.attach&&(f.attach=u.memoizedProps.attach),{memoized:f,changes:d}}const mce=typeof process<"u"&&!1;function xb(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=dce(e)?e:eW(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let u=0;um[S],n),!(y&&y.set))){const[m,...S]=v.reverse();_=S.reverse().reduce((x,M)=>x[M],n),h=m}if(d===Z9+"remove")if(_.constructor){let m=yO.get(_.constructor);m||(m=new _.constructor,yO.set(_.constructor,m)),d=m[h]}else d=0;if(f&&i)d?i.handlers[h]=d:delete i.handlers[h],i.eventCount=Object.keys(i.handlers).length;else if(y&&y.set&&(y.copy||y instanceof Vh)){if(Array.isArray(d))y.fromArray?y.fromArray(d):y.set(...d);else if(y.copy&&d&&d.constructor&&(mce?y.constructor.name===d.constructor.name:y.constructor===d.constructor))y.copy(d);else if(d!==void 0){const m=y instanceof ct;!m&&y.setScalar?y.setScalar(d):y instanceof Vh&&d instanceof Vh?y.mask=d.mask:y.set(d),!Y9()&&s&&!s.linear&&m&&y.convertSRGBToLinear()}}else if(_[h]=d,_[h]instanceof Yn&&_[h].format===Ar&&_[h].type===Zi&&s){const m=_[h];yb(m)&&yb(s.gl)?m.colorSpace=s.gl.outputColorSpace:m.encoding=s.gl.outputEncoding}Bf(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const u=Y1(n).getState().internal,h=u.interaction.indexOf(n);h>-1&&u.interaction.splice(h,1),i.eventCount&&u.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&sP(n),n}function Bf(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function sP(n){n.onUpdate==null||n.onUpdate(n)}function gce(n,e){n.manual||(J9(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function bx(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function vce(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return rp.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return rp.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return rp.ContinuousEventPriority;default:return rp.DefaultEventPriority}}function tW(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function yce(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{tW(t.capturedMap,e,i,r)})}function _ce(n){function e(l){const{internal:c}=n.getState(),u=l.offsetX-c.initialClick[0],h=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+h*h))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var h;return(h=c.__r3f)==null?void 0:h.handlers["onPointer"+u]}))}function i(l,c){const u=n.getState(),h=new Set,d=[],f=c?c(u.internal.interaction):u.internal.interaction;for(let m=0;m{const x=lg(m.object),M=lg(S.object);return!x||!M?m.distance-S.distance:M.events.priority-x.events.priority||m.distance-S.distance}).filter(m=>{const S=bx(m);return h.has(S)?!1:(h.add(S),!0)});u.events.filter&&(_=u.events.filter(_,u));for(const m of _){let S=m.object;for(;S;){var y;(y=S.__r3f)!=null&&y.eventCount&&d.push({...m,eventObject:S}),S=S.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let m of u.internal.capturedMap.get(l.pointerId).values())h.has(bx(m.intersection))||d.push(m.intersection);return d}function r(l,c,u,h){const d=n.getState();if(l.length){const f={stopped:!1};for(const v of l){const _=lg(v.object)||d,{raycaster:y,pointer:m,camera:S,internal:x}=_,M=new j(m.x,m.y,0).unproject(S),R=w=>{var N,G;return(N=(G=x.capturedMap.get(w))==null?void 0:G.has(v.eventObject))!=null?N:!1},T=w=>{const N={intersection:v,target:c.target};x.capturedMap.has(w)?x.capturedMap.get(w).set(v.eventObject,N):x.capturedMap.set(w,new Map([[v.eventObject,N]])),c.target.setPointerCapture(w)},P=w=>{const N=x.capturedMap.get(w);N&&tW(x.capturedMap,v.eventObject,N,w)};let I={};for(let w in c){let N=c[w];typeof N!="function"&&(I[w]=N)}let b={...v,...I,pointer:m,intersections:l,stopped:f.stopped,delta:u,unprojectedPoint:M,ray:y.ray,camera:S,stopPropagation(){const w="pointerId"in c&&x.capturedMap.get(c.pointerId);if((!w||w.has(v.eventObject))&&(b.stopped=f.stopped=!0,x.hovered.size&&Array.from(x.hovered.values()).find(N=>N.eventObject===v.eventObject))){const N=l.slice(0,l.indexOf(v));s([...N,v])}},target:{hasPointerCapture:R,setPointerCapture:T,releasePointerCapture:P},currentTarget:{hasPointerCapture:R,setPointerCapture:T,releasePointerCapture:P},nativeEvent:c};if(h(b),f.stopped===!0)break}}return l}function s(l){const{internal:c}=n.getState();for(const u of c.hovered.values())if(!l.length||!l.find(h=>h.object===u.object&&h.index===u.index&&h.instanceId===u.instanceId)){const d=u.eventObject.__r3f,f=d==null?void 0:d.handlers;if(c.hovered.delete(bx(u)),d!=null&&d.eventCount){const v={...u,intersections:l};f.onPointerOut==null||f.onPointerOut(v),f.onPointerLeave==null||f.onPointerLeave(v)}}}function o(l,c){for(let u=0;us([]);case"onLostPointerCapture":return c=>{const{internal:u}=n.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),s([]))})}}return function(u){const{onPointerMissed:h,internal:d}=n.getState();d.lastEvent.current=u;const f=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(u,f?t:void 0),m=v?e(u):0;l==="onPointerDown"&&(d.initialClick=[u.offsetX,u.offsetY],d.initialHits=y.map(x=>x.eventObject)),v&&!y.length&&m<=2&&(o(u,d.interaction),h&&h(u)),f&&s(y);function S(x){const M=x.eventObject,R=M.__r3f,T=R==null?void 0:R.handlers;if(R!=null&&R.eventCount)if(f){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const P=bx(x),I=d.hovered.get(P);I?I.stopped&&x.stopPropagation():(d.hovered.set(P,x),T.onPointerOver==null||T.onPointerOver(x),T.onPointerEnter==null||T.onPointerEnter(x))}T.onPointerMove==null||T.onPointerMove(x)}else{const P=T[l];P?(!v||d.initialHits.includes(M))&&(o(u,d.interaction.filter(I=>!d.initialHits.includes(I))),P(x)):v&&d.initialHits.includes(M)&&o(u,d.interaction.filter(I=>!d.initialHits.includes(I)))}}r(y,u,m,S)}}return{handlePointer:a}}const nW=n=>!!(n!=null&&n.render),iW=se.createContext(null),xce=(n,e)=>{const t=G9((a,l)=>{const c=new j,u=new j,h=new j;function d(m=l().camera,S=u,x=l().size){const{width:M,height:R,top:T,left:P}=x,I=M/R;S instanceof j?h.copy(S):h.set(...S);const b=m.getWorldPosition(c).distanceTo(h);if(J9(m))return{width:M/m.zoom,height:R/m.zoom,top:T,left:P,factor:1,distance:b,aspect:I};{const w=m.fov*Math.PI/180,N=2*Math.tan(w/2)*b,G=N*(M/R);return{width:G,height:N,top:T,left:P,factor:M/G,distance:b,aspect:I}}}let f;const v=m=>a(S=>({performance:{...S.performance,current:m}})),_=new Fe;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>n(l(),m),advance:(m,S)=>e(m,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new uL,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();f&&clearTimeout(f),m.performance.current!==m.performance.min&&v(m.performance.min),f=setTimeout(()=>v(l().performance.max),m.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:d},setEvents:m=>a(S=>({...S,events:{...S.events,...m}})),setSize:(m,S,x,M,R)=>{const T=l().camera,P={width:m,height:S,top:M||0,left:R||0,updateStyle:x};a(I=>({size:P,viewport:{...I.viewport,...d(T,u,P)}}))},setDpr:m=>a(S=>{const x=Q9(m);return{viewport:{...S.viewport,dpr:x,initialDpr:S.viewport.initialDpr||x}}}),setFrameloop:(m="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,m!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:se.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,S,x)=>{const M=l().internal;return M.priority=M.priority+(S>0?1:0),M.subscribers.push({ref:m,priority:S,store:x}),M.subscribers=M.subscribers.sort((R,T)=>R.priority-T.priority),()=>{const R=l().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(S>0?1:0),R.subscribers=R.subscribers.filter(T=>T.ref!==m))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:u,set:h}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){var d;r=l,s=c.dpr,gce(a,l),u.setPixelRatio(c.dpr);const f=(d=l.updateStyle)!=null?d:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,f)}a!==o&&(o=a,h(f=>({viewport:{...f.viewport,...f.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Cx,Sce=new Set,Mce=new Set,Ace=new Set;function Sb(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function cg(n,e){switch(n){case"before":return Sb(Sce,e);case"after":return Sb(Mce,e);case"tail":return Sb(Ace,e)}}let Mb,Ab;function wb(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Mb=e.internal.subscribers,Cx=0;Cx0)&&!((u=s.gl.xr)!=null&&u.isPresenting)&&(i+=wb(c,s))}if(t=!1,cg("after",c),i===0)return cg("tail",c),e=!1,cancelAnimationFrame(r)}function a(c,u=1){var h;if(!c)return n.forEach(d=>a(d.store.getState(),u));(h=c.gl.xr)!=null&&h.isPresenting||!c.internal.active||c.frameloop==="never"||(u>1?c.internal.frames=Math.min(60,c.internal.frames+u):t?c.internal.frames=2:c.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(c,u=!0,h,d){if(u&&cg("before",c),h)wb(c,h,d);else for(const f of n.values())wb(c,f.store.getState());u&&cg("after",c)}return{loop:o,invalidate:a,advance:l}}function Ece(n){const e=se.useRef(null);return am(()=>void(e.current=n.current.__r3f),[n]),e}function rW(){const n=se.useContext(iW);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Wr(n=t=>t,e){return rW()(n,e)}function Ad(n,e=0){const t=rW(),i=t.getState().internal.subscribe,r=K9(n);return am(()=>i(r,e,t),[e,i,t]),null}const SO=new WeakMap;function sW(n,e){return function(t,...i){let r=SO.get(t);return r||(r=new t,SO.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,fce(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function pu(n,e,t,i){const r=Array.isArray(e)?e:[e],s=ice(sW(t,i),[n,...r],{equal:zn.equ});return Array.isArray(e)?s:s[0]}pu.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return rce(sW(t),[n,...i])};pu.clear=function(n,e){const t=Array.isArray(e)?e:[e];return sce([n,...t])};const Wp=new Map,{invalidate:MO,advance:AO}=wce(Wp),{reconciler:hM,applyProps:xa}=cce(Wp,vce),cf={objects:"shallow",strict:!1},Tce=(n,e)=>{const t=typeof n=="function"?n(e):n;return nW(t)?t:new p8({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function bce(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function Cce(n){const e=Wp.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||xce(MO,AO),o=t||hM.createContainer(s,rp.ConcurrentRoot,null,!1,null,"",r,null);e||Wp.set(n,{fiber:o,store:s});let a,l=!1,c;return{configure(u={}){let{gl:h,size:d,scene:f,events:v,onCreated:_,shadows:y=!1,linear:m=!1,flat:S=!1,legacy:x=!1,orthographic:M=!1,frameloop:R="always",dpr:T=[1,2],performance:P,raycaster:I,camera:b,onPointerMissed:w}=u,N=s.getState(),G=N.gl;N.gl||N.set({gl:G=Tce(h,n)});let V=N.raycaster;V||N.set({raycaster:V=new F9});const{params:$,...Z}=I||{};if(zn.equ(Z,V,cf)||xa(V,{...Z}),zn.equ($,V.params,cf)||xa(V,{params:{...V.params,...$}}),!N.camera||N.camera===c&&!zn.equ(c,b,cf)){c=b;const te=b instanceof im,le=te?b:M?new po(0,0,0,0,.1,1e3):new Gn(75,0,.1,1e3);te||(le.position.z=5,b&&(xa(le,b),("aspect"in b||"left"in b||"right"in b||"bottom"in b||"top"in b)&&(le.manual=!0,le.updateProjectionMatrix())),!N.camera&&!(b!=null&&b.rotation)&&le.lookAt(0,0,0)),N.set({camera:le}),V.camera=le}if(!N.scene){let te;f instanceof Gp?te=f:(te=new Gp,f&&xa(te,f)),N.set({scene:Df(te)})}if(!N.xr){var X;const te=(Ne,q)=>{const fe=s.getState();fe.frameloop!=="never"&&AO(Ne,!0,fe,q)},le=()=>{const Ne=s.getState();Ne.gl.xr.enabled=Ne.gl.xr.isPresenting,Ne.gl.xr.setAnimationLoop(Ne.gl.xr.isPresenting?te:null),Ne.gl.xr.isPresenting||MO(Ne)},we={connect(){const Ne=s.getState().gl;Ne.xr.addEventListener("sessionstart",le),Ne.xr.addEventListener("sessionend",le)},disconnect(){const Ne=s.getState().gl;Ne.xr.removeEventListener("sessionstart",le),Ne.xr.removeEventListener("sessionend",le)}};typeof((X=G.xr)==null?void 0:X.addEventListener)=="function"&&we.connect(),N.set({xr:we})}if(G.shadowMap){const te=G.shadowMap.enabled,le=G.shadowMap.type;if(G.shadowMap.enabled=!!y,zn.boo(y))G.shadowMap.type=ev;else if(zn.str(y)){var re;const we={basic:ZV,percentage:bA,soft:ev,variance:No};G.shadowMap.type=(re=we[y])!=null?re:ev}else zn.obj(y)&&Object.assign(G.shadowMap,y);(te!==G.shadowMap.enabled||le!==G.shadowMap.type)&&(G.shadowMap.needsUpdate=!0)}const O=Y9();O&&("enabled"in O?O.enabled=!x:"legacyMode"in O&&(O.legacyMode=x)),l||xa(G,{outputEncoding:m?3e3:3001,toneMapping:S?$o:gI}),N.legacy!==x&&N.set(()=>({legacy:x})),N.linear!==m&&N.set(()=>({linear:m})),N.flat!==S&&N.set(()=>({flat:S})),h&&!zn.fun(h)&&!nW(h)&&!zn.equ(h,G,cf)&&xa(G,h),v&&!N.events.handlers&&N.set({events:v(s)});const Q=bce(n,d);return zn.equ(Q,N.size,cf)||N.setSize(Q.width,Q.height,Q.updateStyle,Q.top,Q.left),T&&N.viewport.dpr!==Q9(T)&&N.setDpr(T),N.frameloop!==R&&N.setFrameloop(R),N.onPointerMissed||N.set({onPointerMissed:w}),P&&!zn.equ(P,N.performance,cf)&&N.set(te=>({performance:{...te.performance,...P}})),a=_,l=!0,this},render(u){return l||this.configure(),hM.updateContainer(pe.jsx(Rce,{store:s,children:u,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){oW(n)}}}function Rce({store:n,children:e,onCreated:t,rootElement:i}){return am(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),pe.jsx(iW.Provider,{value:n,children:e})}function oW(n,e){const t=Wp.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),hM.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),pce(r),Wp.delete(n)}catch{}},500)})}}hM.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:se.version});const Eb={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 Pce(n){const{handlePointer:e}=_ce(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(Eb).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,c]=Eb[o];t.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=Eb[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function oP(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var u=Date.now()-o;u=0?i=setTimeout(l,e-u):(i=null,t||(a=n.apply(s,r),s=r=null))}var c=function(){s=this,r=arguments,o=Date.now();var u=t&&!i;return i||(i=setTimeout(l,e)),u&&(a=n.apply(s,r),s=r=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},c}oP.debounce=oP;var Ice=oP;const wO=XP(Ice);var Lce=Object.defineProperty,Dce=Object.defineProperties,Bce=Object.getOwnPropertyDescriptors,EO=Object.getOwnPropertySymbols,Nce=Object.prototype.hasOwnProperty,Uce=Object.prototype.propertyIsEnumerable,TO=(n,e,t)=>e in n?Lce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,bO=(n,e)=>{for(var t in e||(e={}))Nce.call(e,t)&&TO(n,t,e[t]);if(EO)for(var t of EO(e))Uce.call(e,t)&&TO(n,t,e[t]);return n},Fce=(n,e)=>Dce(n,Bce(e)),CO,RO;typeof window<"u"&&((CO=window.document)!=null&&CO.createElement||((RO=window.navigator)==null?void 0:RO.product)==="ReactNative")?se.useLayoutEffect:se.useEffect;function aW(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=aW(i,e,t);if(r)return r;i=i.sibling}}function lW(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const PO=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=PO;return}return PO.apply(this,arguments)};const pL=lW(se.createContext(null));class cW extends se.Component{render(){return se.createElement(pL.Provider,{value:this._reactInternals},this.props.children)}}function Oce(){const n=se.useContext(pL);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=se.useId();return se.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=aW(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function kce(){const n=Oce(),[e]=se.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==pL&&!e.has(r)&&e.set(r,se.useContext(lW(r)))}t=t.return}return e}function zce(){const n=kce();return se.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>se.createElement(e,null,se.createElement(t.Provider,Fce(bO({},i),{value:n.get(t)}))),e=>se.createElement(cW,bO({},e))),[n])}function Gce({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||typeof window<"u"&&window.ResizeObserver,[s,o]=se.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const a=se.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,u=se.useRef(!1);se.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[h,d,f]=se.useMemo(()=>{const m=()=>{if(!a.current.element)return;const{left:S,top:x,width:M,height:R,bottom:T,right:P,x:I,y:b}=a.current.element.getBoundingClientRect(),w={left:S,top:x,width:M,height:R,bottom:T,right:P,x:I,y:b};a.current.element instanceof HTMLElement&&i&&(w.height=a.current.element.offsetHeight,w.width=a.current.element.offsetWidth),Object.freeze(w),u.current&&!$ce(a.current.lastBounds,w)&&o(a.current.lastBounds=w)};return[m,c?wO(m,c):m,l?wO(m,l):m]},[o,i,l,c]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(m=>m.removeEventListener("scroll",f,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null)}function _(){a.current.element&&(a.current.resizeObserver=new r(f),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(m=>m.addEventListener("scroll",f,{capture:!0,passive:!0})))}const y=m=>{!m||m===a.current.element||(v(),a.current.element=m,a.current.scrollContainers=uW(m),_())};return Vce(f,!!e),Hce(d),se.useEffect(()=>{v(),_()},[e,f,d]),se.useEffect(()=>v,[]),[y,s,h]}function Hce(n){se.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function Vce(n,e){se.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function uW(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...uW(n.parentElement)]}const Wce=["x","y","top","bottom","left","right","width","height"],$ce=(n,e)=>Wce.every(t=>n[t]===e[t]),Xce=se.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=Pce,eventSource:a,eventPrefix:l,shadows:c,linear:u,flat:h,legacy:d,orthographic:f,frameloop:v,dpr:_,performance:y,raycaster:m,camera:S,scene:x,onPointerMissed:M,onCreated:R,...T},P){se.useMemo(()=>j9(Qle),[]);const I=zce(),[b,w]=Gce({scroll:!0,debounce:{scroll:50,resize:0},...i}),N=se.useRef(null),G=se.useRef(null);se.useImperativeHandle(P,()=>N.current);const V=K9(M),[$,Z]=se.useState(!1),[X,re]=se.useState(!1);if($)throw $;if(X)throw X;const O=se.useRef(null);am(()=>{const te=N.current;w.width>0&&w.height>0&&te&&(O.current||(O.current=Cce(te)),O.current.configure({gl:s,events:o,shadows:c,linear:u,flat:h,legacy:d,orthographic:f,frameloop:v,dpr:_,performance:y,raycaster:m,camera:S,scene:x,size:w,onPointerMissed:(...le)=>V.current==null?void 0:V.current(...le),onCreated:le=>{le.events.connect==null||le.events.connect(a?uce(a)?a.current:a:G.current),l&&le.setEvents({compute:(we,Ne)=>{const q=we[l+"X"],fe=we[l+"Y"];Ne.pointer.set(q/Ne.size.width*2-1,-(fe/Ne.size.height)*2+1),Ne.raycaster.setFromCamera(Ne.pointer,Ne.camera)}}),R==null||R(le)}}),O.current.render(pe.jsx(I,{children:pe.jsx(q9,{set:re,children:pe.jsx(se.Suspense,{fallback:pe.jsx(hce,{set:Z}),children:e})})})))}),se.useEffect(()=>{const te=N.current;if(te)return()=>oW(te)},[]);const Q=a?"none":"auto";return pe.jsx("div",{ref:G,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Q,...r},...T,children:pe.jsx("div",{ref:b,style:{width:"100%",height:"100%"},children:pe.jsx("canvas",{ref:N,style:{display:"block"},children:t})})})}),jA=se.forwardRef(function(e,t){return pe.jsx(cW,{children:pe.jsx(Xce,{...e,ref:t})})});function Ua(){return Ua=Object.assign?Object.assign.bind():function(n){for(var e=1;eMath.PI/2}function Kce(n,e,t,i){const r=sy.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),IO.set(s.x,s.y),t.setFromCamera(IO,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function hW(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=aP(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const Qce=(n=>e=>hW(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),eue=(n=>(e,t)=>hW(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function tue(n){return n&&typeof n=="object"&&"current"in n}const nue=se.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:c=!1,transform:u=!1,occlude:h,onOcclude:d,castShadow:f,receiveShadow:v,material:_,geometry:y,zIndexRange:m=[16777271,0],calculatePosition:S=Yce,as:x="div",wrapperClass:M,pointerEvents:R="auto",...T},P)=>{const{gl:I,camera:b,scene:w,size:N,raycaster:G,events:V,viewport:$}=Wr(),[Z]=se.useState(()=>document.createElement(x)),X=se.useRef(),re=se.useRef(null),O=se.useRef(0),Q=se.useRef([0,0]),te=se.useRef(null),le=se.useRef(null),we=(a==null?void 0:a.current)||V.connected||I.domElement.parentNode,Ne=se.useRef(null),q=se.useRef(!1),fe=se.useMemo(()=>h&&h!=="blending"||Array.isArray(h)&&h.length&&tue(h[0]),[h]);se.useLayoutEffect(()=>{const je=I.domElement;h&&h==="blending"?(je.style.zIndex=`${Math.floor(m[0]/2)}`,je.style.position="absolute",je.style.pointerEvents="none"):(je.style.zIndex=null,je.style.position=null,je.style.pointerEvents=null)},[h]),se.useLayoutEffect(()=>{if(re.current){const je=X.current=uH(Z);if(w.updateMatrixWorld(),u)Z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Ke=S(re.current,b,N);Z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Ke[0]}px,${Ke[1]}px,0);transform-origin:0 0;`}return we&&(r?we.prepend(Z):we.appendChild(Z)),()=>{we&&we.removeChild(Z),je.unmount()}}},[we,u]),se.useLayoutEffect(()=>{M&&(Z.className=M)},[M]);const Te=se.useMemo(()=>u?{position:"absolute",top:0,left:0,width:N.width,height:N.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-N.height/2,left:-N.width/2,width:N.width,height:N.height},...t},[t,s,o,N,u]),Se=se.useMemo(()=>({position:"absolute",pointerEvents:R}),[R]);se.useLayoutEffect(()=>{if(q.current=!1,u){var je;(je=X.current)==null||je.render(se.createElement("div",{ref:te,style:Te},se.createElement("div",{ref:le,style:Se},se.createElement("div",{ref:P,className:i,style:t,children:n}))))}else{var Ke;(Ke=X.current)==null||Ke.render(se.createElement("div",{ref:P,style:Te,className:i,children:n}))}});const $e=se.useRef(!0);Ad(je=>{if(re.current){b.updateMatrixWorld(),re.current.updateWorldMatrix(!0,!1);const Ke=u?Q.current:S(re.current,b,N);if(u||Math.abs(O.current-b.zoom)>e||Math.abs(Q.current[0]-Ke[0])>e||Math.abs(Q.current[1]-Ke[1])>e){const B=Jce(re.current,b);let me=!1;fe&&(Array.isArray(h)?me=h.map(Xe=>Xe.current):h!=="blending"&&(me=[w]));const ge=$e.current;if(me){const Xe=Kce(re.current,b,G,me);$e.current=Xe&&!B}else $e.current=!B;ge!==$e.current&&(d?d(!$e.current):Z.style.display=$e.current?"block":"none");const Re=Math.floor(m[0]/2),ae=h?fe?[m[0],Re]:[Re-1,0]:m;if(Z.style.zIndex=`${Zce(re.current,b,ae)}`,u){const[Xe,Ce]=[N.width/2,N.height/2],De=b.projectionMatrix.elements[5]*Ce,{isOrthographicCamera:U,top:C,left:Y,bottom:ue,right:ce}=b,de=Qce(b.matrixWorldInverse),Ye=U?`scale(${De})translate(${aP(-(ce+Y)/2)}px,${aP((C+ue)/2)}px)`:`translateZ(${De}px)`;let Ae=re.current.matrixWorld;c&&(Ae=b.matrixWorldInverse.clone().transpose().copyPosition(Ae).scale(re.current.scale),Ae.elements[3]=Ae.elements[7]=Ae.elements[11]=0,Ae.elements[15]=1),Z.style.width=N.width+"px",Z.style.height=N.height+"px",Z.style.perspective=U?"":`${De}px`,te.current&&le.current&&(te.current.style.transform=`${Ye}${de}translate(${Xe}px,${Ce}px)`,le.current.style.transform=eue(Ae,1/((l||10)/400)))}else{const Xe=l===void 0?1:qce(re.current,b)*l;Z.style.transform=`translate3d(${Ke[0]}px,${Ke[1]}px,0) scale(${Xe})`}Q.current=Ke,O.current=b.zoom}}if(!fe&&Ne.current&&!q.current)if(u){if(te.current){const Ke=te.current.children[0];if(Ke!=null&&Ke.clientWidth&&Ke!=null&&Ke.clientHeight){const{isOrthographicCamera:B}=b;if(B||y)T.scale&&(Array.isArray(T.scale)?T.scale instanceof j?Ne.current.scale.copy(T.scale.clone().divideScalar(1)):Ne.current.scale.set(1/T.scale[0],1/T.scale[1],1/T.scale[2]):Ne.current.scale.setScalar(1/T.scale));else{const me=(l||10)/400,ge=Ke.clientWidth*me,Re=Ke.clientHeight*me;Ne.current.scale.set(ge,Re,1)}q.current=!0}}}else{const Ke=Z.children[0];if(Ke!=null&&Ke.clientWidth&&Ke!=null&&Ke.clientHeight){const B=1/$.factor,me=Ke.clientWidth*B,ge=Ke.clientHeight*B;Ne.current.scale.set(me,ge,1),q.current=!0}Ne.current.lookAt(je.camera.position)}});const Qe=se.useMemo(()=>({vertexShader:u?void 0:` + `)+p.join(" > ")}return null},t.getPublicRootInstance=function(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return X(p.child.stateNode);default:return p.child.stateNode}},t.injectIntoDevTools=function(p){if(p={bundleType:p.bundleType,version:p.version,rendererPackageName:p.rendererPackageName,rendererConfig:p.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:oj,findFiberByHostInstance:p.findFiberByHostInstance||aj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")p=!1;else{var g=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(g.isDisabled||!g.supportsFiber)p=!0;else{try{wy=g.inject(p),ca=g}catch{}p=!!g.checkDCE}}return p},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(p,g,A,E){if(!U)throw Error(o(363));p=RE(p,g);var D=Ae(p,A,E).disconnect;return{disconnect:function(){D()}}},t.registerMutableSourceForHydration=function(p,g){var A=g._getVersion;A=A(g._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[g,A]:p.mutableSourceEagerHydrationData.push(g,A)},t.runWithPriority=function(p,g){var A=yn;try{return yn=p,g()}finally{yn=A}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(p,g,A,E){var D=g.current,F=Fr(),ne=Jl(D);return A=o3(A),g.context===null?g.context=A:g.pendingContext=A,g=$a(F,ne),g.payload={element:p},E=E===void 0?null:E,E!==null&&(g.callback=E),Xl(D,g),p=Qs(D,ne,F),p!==null&&Ry(p,D,ne),ne},t};Y9.exports=uce;var hce=Y9.exports;const dce=$P(hce),gL={},q9=n=>void Object.assign(gL,n);function fce(n,e){function t(u,{args:h=[],attach:d,...f},v){let _=`${u[0].toUpperCase()}${u.slice(1)}`,y;if(u==="primitive"){if(f.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const m=f.object;y=Df(m,{type:u,root:v,attach:d,primitive:!0})}else{const m=gL[_];if(!m)throw new Error(`R3F: ${_} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");y=Df(new m(...h),{type:u,root:v,attach:d,memoizedProps:{args:h}})}return y.__r3f.attach===void 0&&(y instanceof Vt?y.__r3f.attach="geometry":y instanceof mi&&(y.__r3f.attach="material")),_!=="inject"&&yb(y,f),y}function i(u,h){let d=!1;if(h){var f,v;(f=h.__r3f)!=null&&f.attach?vb(u,h,h.__r3f.attach):h.isObject3D&&u.isObject3D&&(u.add(h),d=!0),d||(v=u.__r3f)==null||v.objects.push(h),h.__r3f||Df(h,{}),h.__r3f.parent=u,rP(h),Bf(h)}}function r(u,h,d){let f=!1;if(h){var v,_;if((v=h.__r3f)!=null&&v.attach)vb(u,h,h.__r3f.attach);else if(h.isObject3D&&u.isObject3D){h.parent=u,h.dispatchEvent({type:"added"}),u.dispatchEvent({type:"childadded",child:h});const y=u.children.filter(S=>S!==h),m=y.indexOf(d);u.children=[...y.slice(0,m),h,...y.slice(m)],f=!0}f||(_=u.__r3f)==null||_.objects.push(h),h.__r3f||Df(h,{}),h.__r3f.parent=u,rP(h),Bf(h)}}function s(u,h,d=!1){u&&[...u].forEach(f=>o(h,f,d))}function o(u,h,d){if(h){var f,v,_;if(h.__r3f&&(h.__r3f.parent=null),(f=u.__r3f)!=null&&f.objects&&(u.__r3f.objects=u.__r3f.objects.filter(M=>M!==h)),(v=h.__r3f)!=null&&v.attach)AO(u,h,h.__r3f.attach);else if(h.isObject3D&&u.isObject3D){var y;u.remove(h),(y=h.__r3f)!=null&&y.root&&Mce(j1(h),h)}const S=(_=h.__r3f)==null?void 0:_.primitive,x=!S&&(d===void 0?h.dispose!==null:d);if(!S){var m;s((m=h.__r3f)==null?void 0:m.objects,h,x),s(h.children,h,x)}if(delete h.__r3f,x&&h.dispose&&h.type!=="Scene"){const M=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?nP.unstable_scheduleCallback(nP.unstable_IdlePriority,M):M()}Bf(u)}}function a(u,h,d,f){var v;const _=(v=u.__r3f)==null?void 0:v.parent;if(!_)return;const y=t(h,d,u.__r3f.root);if(u.children){for(const m of u.children)m.__r3f&&i(y,m);u.children=u.children.filter(m=>!m.__r3f)}u.__r3f.objects.forEach(m=>i(y,m)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||o(_,u),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(_,y),y.raycast&&y.__r3f.eventCount&&j1(y).getState().internal.interaction.push(y),[f,f.alternate].forEach(m=>{m!==null&&(m.stateNode=y,m.ref&&(typeof m.ref=="function"?m.ref(y):m.ref.current=y))})}const l=()=>{};return{reconciler:dce({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,h)=>{if(!h)return;const d=u.getState().scene;d.__r3f&&(d.__r3f.root=u,i(d,h))},removeChildFromContainer:(u,h)=>{h&&o(u.getState().scene,h)},insertInContainerBefore:(u,h,d)=>{if(!h||!d)return;const f=u.getState().scene;f.__r3f&&r(f,h,d)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var h;return!!((h=u==null?void 0:u.__r3f)!=null?h:{}).handlers},prepareUpdate(u,h,d,f){var v;if(((v=u==null?void 0:u.__r3f)!=null?v:{}).primitive&&f.object&&f.object!==u)return[!0];{const{args:y=[],children:m,...S}=f,{args:x=[],children:M,...R}=d;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((P,I)=>P!==x[I]))return[!0];const T=rW(u,S,R,!0);return T.changes.length?[!1,T]:null}},commitUpdate(u,[h,d],f,v,_,y){h?a(u,f,_,y):yb(u,d)},commitMount(u,h,d,f){var v;const _=(v=u.__r3f)!=null?v:{};u.raycast&&_.handlers&&_.eventCount&&j1(u).getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>Df(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var h;const{attach:d,parent:f}=(h=u.__r3f)!=null?h:{};d&&f&&AO(f,u,d),u.isObject3D&&(u.visible=!1),Bf(u)},unhideInstance(u,h){var d;const{attach:f,parent:v}=(d=u.__r3f)!=null?d:{};f&&v&&vb(v,u,f),(u.isObject3D&&h.visible==null||h.visible)&&(u.visible=!0),Bf(u)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():rp.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&zn.fun(performance.now)?performance.now:zn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:zn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:zn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:yb}}var _O,xO;const gb=n=>"colorSpace"in n||"outputColorSpace"in n,Z9=()=>{var n;return(n=gL.ColorManagement)!=null?n:null},Q9=n=>n&&n.isOrthographicCamera,pce=n=>n&&n.hasOwnProperty("current"),lm=typeof window<"u"&&((_O=window.document)!=null&&_O.createElement||((xO=window.navigator)==null?void 0:xO.product)==="ReactNative")?se.useLayoutEffect:se.useEffect;function eW(n){const e=se.useRef(n);return lm(()=>void(e.current=n),[n]),e}function mce({set:n}){return lm(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class tW extends se.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}tW.getDerivedStateFromError=()=>({error:!0});const nW="__default",SO=new Map,gce=n=>n&&!!n.memoized&&!!n.changes;function iW(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const cg=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function j1(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const zn={obj:n=>n===Object(n)&&!zn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(zn.str(n)||zn.num(n)||zn.boo(n))return n===e;const s=zn.obj(n);if(s&&i==="reference")return n===e;const o=zn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!zn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(zn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function vce(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function yce(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Df(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function iP(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const MO=/-\d+$/;function vb(n,e,t){if(zn.str(t)){if(MO.test(t)){const s=t.replace(MO,""),{target:o,key:a}=iP(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=iP(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function AO(n,e,t){var i,r;if(zn.str(t)){const{target:s,key:o}=iP(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function rW(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},c=!1){const u=n.__r3f,h=Object.entries(r),d=[];if(c){const v=Object.keys(l);for(let _=0;_{var y;if((y=n.__r3f)!=null&&y.primitive&&v==="object"||zn.equ(_,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return d.push([v,_,!0,[]]);let m=[];v.includes("-")&&(m=v.split("-")),d.push([v,_,!1,m]);for(const S in r){const x=r[S];S.startsWith(`${v}-`)&&d.push([S,x,!1,S.split("-")])}});const f={...r};return u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.args&&(f.args=u.memoizedProps.args),u!=null&&u.memoizedProps&&u!=null&&u.memoizedProps.attach&&(f.attach=u.memoizedProps.attach),{memoized:f,changes:d}}const _ce=typeof process<"u"&&!1;function yb(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=gce(e)?e:rW(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let u=0;um[S],n),!(y&&y.set))){const[m,...S]=v.reverse();_=S.reverse().reduce((x,M)=>x[M],n),h=m}if(d===nW+"remove")if(_.constructor){let m=SO.get(_.constructor);m||(m=new _.constructor,SO.set(_.constructor,m)),d=m[h]}else d=0;if(f&&i)d?i.handlers[h]=d:delete i.handlers[h],i.eventCount=Object.keys(i.handlers).length;else if(y&&y.set&&(y.copy||y instanceof Vh)){if(Array.isArray(d))y.fromArray?y.fromArray(d):y.set(...d);else if(y.copy&&d&&d.constructor&&(_ce?y.constructor.name===d.constructor.name:y.constructor===d.constructor))y.copy(d);else if(d!==void 0){const m=y instanceof ct;!m&&y.setScalar?y.setScalar(d):y instanceof Vh&&d instanceof Vh?y.mask=d.mask:y.set(d),!Z9()&&s&&!s.linear&&m&&y.convertSRGBToLinear()}}else if(_[h]=d,_[h]instanceof Yn&&_[h].format===Ar&&_[h].type===Zi&&s){const m=_[h];gb(m)&&gb(s.gl)?m.colorSpace=s.gl.outputColorSpace:m.encoding=s.gl.outputEncoding}Bf(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const u=j1(n).getState().internal,h=u.interaction.indexOf(n);h>-1&&u.interaction.splice(h,1),i.eventCount&&u.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&rP(n),n}function Bf(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function rP(n){n.onUpdate==null||n.onUpdate(n)}function xce(n,e){n.manual||(Q9(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Tx(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function Sce(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return rp.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return rp.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return rp.ContinuousEventPriority;default:return rp.DefaultEventPriority}}function sW(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function Mce(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{sW(t.capturedMap,e,i,r)})}function Ace(n){function e(l){const{internal:c}=n.getState(),u=l.offsetX-c.initialClick[0],h=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+h*h))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var h;return(h=c.__r3f)==null?void 0:h.handlers["onPointer"+u]}))}function i(l,c){const u=n.getState(),h=new Set,d=[],f=c?c(u.internal.interaction):u.internal.interaction;for(let m=0;m{const x=cg(m.object),M=cg(S.object);return!x||!M?m.distance-S.distance:M.events.priority-x.events.priority||m.distance-S.distance}).filter(m=>{const S=Tx(m);return h.has(S)?!1:(h.add(S),!0)});u.events.filter&&(_=u.events.filter(_,u));for(const m of _){let S=m.object;for(;S;){var y;(y=S.__r3f)!=null&&y.eventCount&&d.push({...m,eventObject:S}),S=S.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let m of u.internal.capturedMap.get(l.pointerId).values())h.has(Tx(m.intersection))||d.push(m.intersection);return d}function r(l,c,u,h){const d=n.getState();if(l.length){const f={stopped:!1};for(const v of l){const _=cg(v.object)||d,{raycaster:y,pointer:m,camera:S,internal:x}=_,M=new j(m.x,m.y,0).unproject(S),R=w=>{var N,G;return(N=(G=x.capturedMap.get(w))==null?void 0:G.has(v.eventObject))!=null?N:!1},T=w=>{const N={intersection:v,target:c.target};x.capturedMap.has(w)?x.capturedMap.get(w).set(v.eventObject,N):x.capturedMap.set(w,new Map([[v.eventObject,N]])),c.target.setPointerCapture(w)},P=w=>{const N=x.capturedMap.get(w);N&&sW(x.capturedMap,v.eventObject,N,w)};let I={};for(let w in c){let N=c[w];typeof N!="function"&&(I[w]=N)}let b={...v,...I,pointer:m,intersections:l,stopped:f.stopped,delta:u,unprojectedPoint:M,ray:y.ray,camera:S,stopPropagation(){const w="pointerId"in c&&x.capturedMap.get(c.pointerId);if((!w||w.has(v.eventObject))&&(b.stopped=f.stopped=!0,x.hovered.size&&Array.from(x.hovered.values()).find(N=>N.eventObject===v.eventObject))){const N=l.slice(0,l.indexOf(v));s([...N,v])}},target:{hasPointerCapture:R,setPointerCapture:T,releasePointerCapture:P},currentTarget:{hasPointerCapture:R,setPointerCapture:T,releasePointerCapture:P},nativeEvent:c};if(h(b),f.stopped===!0)break}}return l}function s(l){const{internal:c}=n.getState();for(const u of c.hovered.values())if(!l.length||!l.find(h=>h.object===u.object&&h.index===u.index&&h.instanceId===u.instanceId)){const d=u.eventObject.__r3f,f=d==null?void 0:d.handlers;if(c.hovered.delete(Tx(u)),d!=null&&d.eventCount){const v={...u,intersections:l};f.onPointerOut==null||f.onPointerOut(v),f.onPointerLeave==null||f.onPointerLeave(v)}}}function o(l,c){for(let u=0;us([]);case"onLostPointerCapture":return c=>{const{internal:u}=n.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),s([]))})}}return function(u){const{onPointerMissed:h,internal:d}=n.getState();d.lastEvent.current=u;const f=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(u,f?t:void 0),m=v?e(u):0;l==="onPointerDown"&&(d.initialClick=[u.offsetX,u.offsetY],d.initialHits=y.map(x=>x.eventObject)),v&&!y.length&&m<=2&&(o(u,d.interaction),h&&h(u)),f&&s(y);function S(x){const M=x.eventObject,R=M.__r3f,T=R==null?void 0:R.handlers;if(R!=null&&R.eventCount)if(f){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const P=Tx(x),I=d.hovered.get(P);I?I.stopped&&x.stopPropagation():(d.hovered.set(P,x),T.onPointerOver==null||T.onPointerOver(x),T.onPointerEnter==null||T.onPointerEnter(x))}T.onPointerMove==null||T.onPointerMove(x)}else{const P=T[l];P?(!v||d.initialHits.includes(M))&&(o(u,d.interaction.filter(I=>!d.initialHits.includes(I))),P(x)):v&&d.initialHits.includes(M)&&o(u,d.interaction.filter(I=>!d.initialHits.includes(I)))}}r(y,u,m,S)}}return{handlePointer:a}}const oW=n=>!!(n!=null&&n.render),aW=se.createContext(null),wce=(n,e)=>{const t=$9((a,l)=>{const c=new j,u=new j,h=new j;function d(m=l().camera,S=u,x=l().size){const{width:M,height:R,top:T,left:P}=x,I=M/R;S instanceof j?h.copy(S):h.set(...S);const b=m.getWorldPosition(c).distanceTo(h);if(Q9(m))return{width:M/m.zoom,height:R/m.zoom,top:T,left:P,factor:1,distance:b,aspect:I};{const w=m.fov*Math.PI/180,N=2*Math.tan(w/2)*b,G=N*(M/R);return{width:G,height:N,top:T,left:P,factor:M/G,distance:b,aspect:I}}}let f;const v=m=>a(S=>({performance:{...S.performance,current:m}})),_=new Fe;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>n(l(),m),advance:(m,S)=>e(m,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new fL,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();f&&clearTimeout(f),m.performance.current!==m.performance.min&&v(m.performance.min),f=setTimeout(()=>v(l().performance.max),m.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:d},setEvents:m=>a(S=>({...S,events:{...S.events,...m}})),setSize:(m,S,x,M,R)=>{const T=l().camera,P={width:m,height:S,top:M||0,left:R||0,updateStyle:x};a(I=>({size:P,viewport:{...I.viewport,...d(T,u,P)}}))},setDpr:m=>a(S=>{const x=iW(m);return{viewport:{...S.viewport,dpr:x,initialDpr:S.viewport.initialDpr||x}}}),setFrameloop:(m="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,m!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:se.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,S,x)=>{const M=l().internal;return M.priority=M.priority+(S>0?1:0),M.subscribers.push({ref:m,priority:S,store:x}),M.subscribers=M.subscribers.sort((R,T)=>R.priority-T.priority),()=>{const R=l().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(S>0?1:0),R.subscribers=R.subscribers.filter(T=>T.ref!==m))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:u,set:h}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){var d;r=l,s=c.dpr,xce(a,l),u.setPixelRatio(c.dpr);const f=(d=l.updateStyle)!=null?d:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,f)}a!==o&&(o=a,h(f=>({viewport:{...f.viewport,...f.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let bx,Ece=new Set,Tce=new Set,bce=new Set;function _b(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function ug(n,e){switch(n){case"before":return _b(Ece,e);case"after":return _b(Tce,e);case"tail":return _b(bce,e)}}let xb,Sb;function Mb(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),xb=e.internal.subscribers,bx=0;bx0)&&!((u=s.gl.xr)!=null&&u.isPresenting)&&(i+=Mb(c,s))}if(t=!1,ug("after",c),i===0)return ug("tail",c),e=!1,cancelAnimationFrame(r)}function a(c,u=1){var h;if(!c)return n.forEach(d=>a(d.store.getState(),u));(h=c.gl.xr)!=null&&h.isPresenting||!c.internal.active||c.frameloop==="never"||(u>1?c.internal.frames=Math.min(60,c.internal.frames+u):t?c.internal.frames=2:c.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(c,u=!0,h,d){if(u&&ug("before",c),h)Mb(c,h,d);else for(const f of n.values())Mb(c,f.store.getState());u&&ug("after",c)}return{loop:o,invalidate:a,advance:l}}function Rce(n){const e=se.useRef(null);return lm(()=>void(e.current=n.current.__r3f),[n]),e}function lW(){const n=se.useContext(aW);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function Wr(n=t=>t,e){return lW()(n,e)}function Ad(n,e=0){const t=lW(),i=t.getState().internal.subscribe,r=eW(n);return lm(()=>i(r,e,t),[e,i,t]),null}const wO=new WeakMap;function cW(n,e){return function(t,...i){let r=wO.get(t);return r||(r=new t,wO.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,vce(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function pu(n,e,t,i){const r=Array.isArray(e)?e:[e],s=ace(cW(t,i),[n,...r],{equal:zn.equ});return Array.isArray(e)?s:s[0]}pu.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return lce(cW(t),[n,...i])};pu.clear=function(n,e){const t=Array.isArray(e)?e:[e];return cce([n,...t])};const $p=new Map,{invalidate:EO,advance:TO}=Cce($p),{reconciler:hM,applyProps:xa}=fce($p,Sce),cf={objects:"shallow",strict:!1},Pce=(n,e)=>{const t=typeof n=="function"?n(e):n;return oW(t)?t:new y8({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function Ice(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function Lce(n){const e=$p.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||wce(EO,TO),o=t||hM.createContainer(s,rp.ConcurrentRoot,null,!1,null,"",r,null);e||$p.set(n,{fiber:o,store:s});let a,l=!1,c;return{configure(u={}){let{gl:h,size:d,scene:f,events:v,onCreated:_,shadows:y=!1,linear:m=!1,flat:S=!1,legacy:x=!1,orthographic:M=!1,frameloop:R="always",dpr:T=[1,2],performance:P,raycaster:I,camera:b,onPointerMissed:w}=u,N=s.getState(),G=N.gl;N.gl||N.set({gl:G=Pce(h,n)});let V=N.raycaster;V||N.set({raycaster:V=new G9});const{params:$,...Z}=I||{};if(zn.equ(Z,V,cf)||xa(V,{...Z}),zn.equ($,V.params,cf)||xa(V,{params:{...V.params,...$}}),!N.camera||N.camera===c&&!zn.equ(c,b,cf)){c=b;const te=b instanceof rm,le=te?b:M?new po(0,0,0,0,.1,1e3):new Gn(75,0,.1,1e3);te||(le.position.z=5,b&&(xa(le,b),("aspect"in b||"left"in b||"right"in b||"bottom"in b||"top"in b)&&(le.manual=!0,le.updateProjectionMatrix())),!N.camera&&!(b!=null&&b.rotation)&&le.lookAt(0,0,0)),N.set({camera:le}),V.camera=le}if(!N.scene){let te;f instanceof Hp?te=f:(te=new Hp,f&&xa(te,f)),N.set({scene:Df(te)})}if(!N.xr){var X;const te=(Ne,q)=>{const fe=s.getState();fe.frameloop!=="never"&&TO(Ne,!0,fe,q)},le=()=>{const Ne=s.getState();Ne.gl.xr.enabled=Ne.gl.xr.isPresenting,Ne.gl.xr.setAnimationLoop(Ne.gl.xr.isPresenting?te:null),Ne.gl.xr.isPresenting||EO(Ne)},we={connect(){const Ne=s.getState().gl;Ne.xr.addEventListener("sessionstart",le),Ne.xr.addEventListener("sessionend",le)},disconnect(){const Ne=s.getState().gl;Ne.xr.removeEventListener("sessionstart",le),Ne.xr.removeEventListener("sessionend",le)}};typeof((X=G.xr)==null?void 0:X.addEventListener)=="function"&&we.connect(),N.set({xr:we})}if(G.shadowMap){const te=G.shadowMap.enabled,le=G.shadowMap.type;if(G.shadowMap.enabled=!!y,zn.boo(y))G.shadowMap.type=ev;else if(zn.str(y)){var re;const we={basic:n5,percentage:EA,soft:ev,variance:No};G.shadowMap.type=(re=we[y])!=null?re:ev}else zn.obj(y)&&Object.assign(G.shadowMap,y);(te!==G.shadowMap.enabled||le!==G.shadowMap.type)&&(G.shadowMap.needsUpdate=!0)}const O=Z9();O&&("enabled"in O?O.enabled=!x:"legacyMode"in O&&(O.legacyMode=x)),l||xa(G,{outputEncoding:m?3e3:3001,toneMapping:S?$o:_I}),N.legacy!==x&&N.set(()=>({legacy:x})),N.linear!==m&&N.set(()=>({linear:m})),N.flat!==S&&N.set(()=>({flat:S})),h&&!zn.fun(h)&&!oW(h)&&!zn.equ(h,G,cf)&&xa(G,h),v&&!N.events.handlers&&N.set({events:v(s)});const Q=Ice(n,d);return zn.equ(Q,N.size,cf)||N.setSize(Q.width,Q.height,Q.updateStyle,Q.top,Q.left),T&&N.viewport.dpr!==iW(T)&&N.setDpr(T),N.frameloop!==R&&N.setFrameloop(R),N.onPointerMissed||N.set({onPointerMissed:w}),P&&!zn.equ(P,N.performance,cf)&&N.set(te=>({performance:{...te.performance,...P}})),a=_,l=!0,this},render(u){return l||this.configure(),hM.updateContainer(pe.jsx(Dce,{store:s,children:u,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){uW(n)}}}function Dce({store:n,children:e,onCreated:t,rootElement:i}){return lm(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),pe.jsx(aW.Provider,{value:n,children:e})}function uW(n,e){const t=$p.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),hM.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),yce(r),$p.delete(n)}catch{}},500)})}}hM.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:se.version});const Ab={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 Bce(n){const{handlePointer:e}=Ace(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(Ab).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,c]=Ab[o];t.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=Ab[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function sP(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var u=Date.now()-o;u=0?i=setTimeout(l,e-u):(i=null,t||(a=n.apply(s,r),s=r=null))}var c=function(){s=this,r=arguments,o=Date.now();var u=t&&!i;return i||(i=setTimeout(l,e)),u&&(a=n.apply(s,r),s=r=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},c}sP.debounce=sP;var Nce=sP;const bO=$P(Nce);var Uce=Object.defineProperty,Fce=Object.defineProperties,Oce=Object.getOwnPropertyDescriptors,CO=Object.getOwnPropertySymbols,kce=Object.prototype.hasOwnProperty,zce=Object.prototype.propertyIsEnumerable,RO=(n,e,t)=>e in n?Uce(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,PO=(n,e)=>{for(var t in e||(e={}))kce.call(e,t)&&RO(n,t,e[t]);if(CO)for(var t of CO(e))zce.call(e,t)&&RO(n,t,e[t]);return n},Gce=(n,e)=>Fce(n,Oce(e)),IO,LO;typeof window<"u"&&((IO=window.document)!=null&&IO.createElement||((LO=window.navigator)==null?void 0:LO.product)==="ReactNative")?se.useLayoutEffect:se.useEffect;function hW(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=hW(i,e,t);if(r)return r;i=i.sibling}}function dW(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const DO=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=DO;return}return DO.apply(this,arguments)};const vL=dW(se.createContext(null));class fW extends se.Component{render(){return se.createElement(vL.Provider,{value:this._reactInternals},this.props.children)}}function Hce(){const n=se.useContext(vL);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=se.useId();return se.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=hW(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function Vce(){const n=Hce(),[e]=se.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==vL&&!e.has(r)&&e.set(r,se.useContext(dW(r)))}t=t.return}return e}function Wce(){const n=Vce();return se.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>se.createElement(e,null,se.createElement(t.Provider,Gce(PO({},i),{value:n.get(t)}))),e=>se.createElement(fW,PO({},e))),[n])}function $ce({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||typeof window<"u"&&window.ResizeObserver,[s,o]=se.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const a=se.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,u=se.useRef(!1);se.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[h,d,f]=se.useMemo(()=>{const m=()=>{if(!a.current.element)return;const{left:S,top:x,width:M,height:R,bottom:T,right:P,x:I,y:b}=a.current.element.getBoundingClientRect(),w={left:S,top:x,width:M,height:R,bottom:T,right:P,x:I,y:b};a.current.element instanceof HTMLElement&&i&&(w.height=a.current.element.offsetHeight,w.width=a.current.element.offsetWidth),Object.freeze(w),u.current&&!Jce(a.current.lastBounds,w)&&o(a.current.lastBounds=w)};return[m,c?bO(m,c):m,l?bO(m,l):m]},[o,i,l,c]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(m=>m.removeEventListener("scroll",f,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&screen.orientation.removeEventListener("orientationchange",a.current.orientationHandler)}function _(){a.current.element&&(a.current.resizeObserver=new r(f),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(m=>m.addEventListener("scroll",f,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{f()})}const y=m=>{!m||m===a.current.element||(v(),a.current.element=m,a.current.scrollContainers=pW(m),_())};return jce(f,!!e),Xce(d),se.useEffect(()=>{v(),_()},[e,f,d]),se.useEffect(()=>v,[]),[y,s,h]}function Xce(n){se.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function jce(n,e){se.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function pW(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...pW(n.parentElement)]}const Yce=["x","y","top","bottom","left","right","width","height"],Jce=(n,e)=>Yce.every(t=>n[t]===e[t]),Kce=se.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=Bce,eventSource:a,eventPrefix:l,shadows:c,linear:u,flat:h,legacy:d,orthographic:f,frameloop:v,dpr:_,performance:y,raycaster:m,camera:S,scene:x,onPointerMissed:M,onCreated:R,...T},P){se.useMemo(()=>q9(ice),[]);const I=Wce(),[b,w]=$ce({scroll:!0,debounce:{scroll:50,resize:0},...i}),N=se.useRef(null),G=se.useRef(null);se.useImperativeHandle(P,()=>N.current);const V=eW(M),[$,Z]=se.useState(!1),[X,re]=se.useState(!1);if($)throw $;if(X)throw X;const O=se.useRef(null);lm(()=>{const te=N.current;w.width>0&&w.height>0&&te&&(O.current||(O.current=Lce(te)),O.current.configure({gl:s,events:o,shadows:c,linear:u,flat:h,legacy:d,orthographic:f,frameloop:v,dpr:_,performance:y,raycaster:m,camera:S,scene:x,size:w,onPointerMissed:(...le)=>V.current==null?void 0:V.current(...le),onCreated:le=>{le.events.connect==null||le.events.connect(a?pce(a)?a.current:a:G.current),l&&le.setEvents({compute:(we,Ne)=>{const q=we[l+"X"],fe=we[l+"Y"];Ne.pointer.set(q/Ne.size.width*2-1,-(fe/Ne.size.height)*2+1),Ne.raycaster.setFromCamera(Ne.pointer,Ne.camera)}}),R==null||R(le)}}),O.current.render(pe.jsx(I,{children:pe.jsx(tW,{set:re,children:pe.jsx(se.Suspense,{fallback:pe.jsx(mce,{set:Z}),children:e})})})))}),se.useEffect(()=>{const te=N.current;if(te)return()=>uW(te)},[]);const Q=a?"none":"auto";return pe.jsx("div",{ref:G,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:Q,...r},...T,children:pe.jsx("div",{ref:b,style:{width:"100%",height:"100%"},children:pe.jsx("canvas",{ref:N,style:{display:"block"},children:t})})})}),$A=se.forwardRef(function(e,t){return pe.jsx(fW,{children:pe.jsx(Kce,{...e,ref:t})})});function Ua(){return Ua=Object.assign?Object.assign.bind():function(n){for(var e=1;eMath.PI/2}function eue(n,e,t,i){const r=ry.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),BO.set(s.x,s.y),t.setFromCamera(BO,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function mW(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=oP(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const iue=(n=>e=>mW(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),rue=(n=>(e,t)=>mW(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function sue(n){return n&&typeof n=="object"&&"current"in n}const oue=se.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:c=!1,transform:u=!1,occlude:h,onOcclude:d,castShadow:f,receiveShadow:v,material:_,geometry:y,zIndexRange:m=[16777271,0],calculatePosition:S=Zce,as:x="div",wrapperClass:M,pointerEvents:R="auto",...T},P)=>{const{gl:I,camera:b,scene:w,size:N,raycaster:G,events:V,viewport:$}=Wr(),[Z]=se.useState(()=>document.createElement(x)),X=se.useRef(),re=se.useRef(null),O=se.useRef(0),Q=se.useRef([0,0]),te=se.useRef(null),le=se.useRef(null),we=(a==null?void 0:a.current)||V.connected||I.domElement.parentNode,Ne=se.useRef(null),q=se.useRef(!1),fe=se.useMemo(()=>h&&h!=="blending"||Array.isArray(h)&&h.length&&sue(h[0]),[h]);se.useLayoutEffect(()=>{const je=I.domElement;h&&h==="blending"?(je.style.zIndex=`${Math.floor(m[0]/2)}`,je.style.position="absolute",je.style.pointerEvents="none"):(je.style.zIndex=null,je.style.position=null,je.style.pointerEvents=null)},[h]),se.useLayoutEffect(()=>{if(re.current){const je=X.current=fH(Z);if(w.updateMatrixWorld(),u)Z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Ke=S(re.current,b,N);Z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Ke[0]}px,${Ke[1]}px,0);transform-origin:0 0;`}return we&&(r?we.prepend(Z):we.appendChild(Z)),()=>{we&&we.removeChild(Z),je.unmount()}}},[we,u]),se.useLayoutEffect(()=>{M&&(Z.className=M)},[M]);const Te=se.useMemo(()=>u?{position:"absolute",top:0,left:0,width:N.width,height:N.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-N.height/2,left:-N.width/2,width:N.width,height:N.height},...t},[t,s,o,N,u]),Se=se.useMemo(()=>({position:"absolute",pointerEvents:R}),[R]);se.useLayoutEffect(()=>{if(q.current=!1,u){var je;(je=X.current)==null||je.render(se.createElement("div",{ref:te,style:Te},se.createElement("div",{ref:le,style:Se},se.createElement("div",{ref:P,className:i,style:t,children:n}))))}else{var Ke;(Ke=X.current)==null||Ke.render(se.createElement("div",{ref:P,style:Te,className:i,children:n}))}});const $e=se.useRef(!0);Ad(je=>{if(re.current){b.updateMatrixWorld(),re.current.updateWorldMatrix(!0,!1);const Ke=u?Q.current:S(re.current,b,N);if(u||Math.abs(O.current-b.zoom)>e||Math.abs(Q.current[0]-Ke[0])>e||Math.abs(Q.current[1]-Ke[1])>e){const B=Qce(re.current,b);let me=!1;fe&&(Array.isArray(h)?me=h.map(Xe=>Xe.current):h!=="blending"&&(me=[w]));const ge=$e.current;if(me){const Xe=eue(re.current,b,G,me);$e.current=Xe&&!B}else $e.current=!B;ge!==$e.current&&(d?d(!$e.current):Z.style.display=$e.current?"block":"none");const Re=Math.floor(m[0]/2),ae=h?fe?[m[0],Re]:[Re-1,0]:m;if(Z.style.zIndex=`${nue(re.current,b,ae)}`,u){const[Xe,Ce]=[N.width/2,N.height/2],De=b.projectionMatrix.elements[5]*Ce,{isOrthographicCamera:U,top:C,left:Y,bottom:ue,right:ce}=b,de=iue(b.matrixWorldInverse),Ye=U?`scale(${De})translate(${oP(-(ce+Y)/2)}px,${oP((C+ue)/2)}px)`:`translateZ(${De}px)`;let Ae=re.current.matrixWorld;c&&(Ae=b.matrixWorldInverse.clone().transpose().copyPosition(Ae).scale(re.current.scale),Ae.elements[3]=Ae.elements[7]=Ae.elements[11]=0,Ae.elements[15]=1),Z.style.width=N.width+"px",Z.style.height=N.height+"px",Z.style.perspective=U?"":`${De}px`,te.current&&le.current&&(te.current.style.transform=`${Ye}${de}translate(${Xe}px,${Ce}px)`,le.current.style.transform=rue(Ae,1/((l||10)/400)))}else{const Xe=l===void 0?1:tue(re.current,b)*l;Z.style.transform=`translate3d(${Ke[0]}px,${Ke[1]}px,0) scale(${Xe})`}Q.current=Ke,O.current=b.zoom}}if(!fe&&Ne.current&&!q.current)if(u){if(te.current){const Ke=te.current.children[0];if(Ke!=null&&Ke.clientWidth&&Ke!=null&&Ke.clientHeight){const{isOrthographicCamera:B}=b;if(B||y)T.scale&&(Array.isArray(T.scale)?T.scale instanceof j?Ne.current.scale.copy(T.scale.clone().divideScalar(1)):Ne.current.scale.set(1/T.scale[0],1/T.scale[1],1/T.scale[2]):Ne.current.scale.setScalar(1/T.scale));else{const me=(l||10)/400,ge=Ke.clientWidth*me,Re=Ke.clientHeight*me;Ne.current.scale.set(ge,Re,1)}q.current=!0}}}else{const Ke=Z.children[0];if(Ke!=null&&Ke.clientWidth&&Ke!=null&&Ke.clientHeight){const B=1/$.factor,me=Ke.clientWidth*B,ge=Ke.clientHeight*B;Ne.current.scale.set(me,ge,1),q.current=!0}Ne.current.lookAt(je.camera.position)}});const Qe=se.useMemo(()=>({vertexShader:u?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite @@ -3971,15 +3971,15 @@ No matching component was found for: void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } - `}),[u]);return se.createElement("group",Ua({},T,{ref:re}),h&&!fe&&se.createElement("mesh",{castShadow:f,receiveShadow:v,ref:Ne},y||se.createElement("planeGeometry",null),_||se.createElement("shaderMaterial",{side:Sr,vertexShader:Qe.vertexShader,fragmentShader:Qe.fragmentShader})))});let ug=0;const iue=G9(n=>(ip.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-ug)/(i-ug)*100})},ip.onLoad=()=>{n({active:!1})},ip.onError=e=>n(t=>({errors:[...t.errors,e]})),ip.onProgress=(e,t,i)=>{t===i&&(ug=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-ug)/(i-ug)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));var k={};/** + `}),[u]);return se.createElement("group",Ua({},T,{ref:re}),h&&!fe&&se.createElement("mesh",{castShadow:f,receiveShadow:v,ref:Ne},y||se.createElement("planeGeometry",null),_||se.createElement("shaderMaterial",{side:Sr,vertexShader:Qe.vertexShader,fragmentShader:Qe.fragmentShader})))});let hg=0;const aue=$9(n=>(ip.onStart=(e,t,i)=>{n({active:!0,item:e,loaded:t,total:i,progress:(t-hg)/(i-hg)*100})},ip.onLoad=()=>{n({active:!1})},ip.onError=e=>n(t=>({errors:[...t.errors,e]})),ip.onProgress=(e,t,i)=>{t===i&&(hg=i),n({active:!0,item:e,loaded:t,total:i,progress:(t-hg)/(i-hg)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0}));var k={};/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT - */const YA="168",rue={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},sue={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},dW=0,lP=1,fW=2,oue=3,aue=0,gL=1,pW=2,_a=3,Ol=0,qr=1,Ma=2,bl=0,$h=1,cP=2,uP=3,hP=4,mW=5,Pc=100,gW=101,vW=102,yW=103,_W=104,xW=200,SW=201,MW=202,AW=203,dM=204,fM=205,wW=206,EW=207,TW=208,bW=209,CW=210,RW=211,PW=212,IW=213,LW=214,DW=0,BW=1,NW=2,n0=3,UW=4,FW=5,OW=6,kW=7,oy=0,zW=1,GW=2,Cl=0,HW=1,VW=2,WW=3,$W=4,XW=5,jW=6,YW=7,dP="attached",JW="detached",JA=300,kl=301,Zc=302,i0=303,r0=304,lm=306,s0=1e3,mo=1001,o0=1002,Ji=1003,vL=1004,lue=1004,sp=1005,cue=1005,Ii=1006,cv=1007,uue=1007,wa=1008,hue=1008,Fa=1009,yL=1010,_L=1011,$p=1012,KA=1013,zl=1014,us=1015,cm=1016,qA=1017,ZA=1018,ld=1020,xL=35902,SL=1021,ML=1022,Jr=1023,AL=1024,wL=1025,Xh=1026,cd=1027,QA=1028,ay=1029,EL=1030,ew=1031,due=1032,tw=1033,uv=33776,hv=33777,dv=33778,fv=33779,pM=35840,mM=35841,gM=35842,vM=35843,yM=36196,_M=37492,xM=37496,SM=37808,MM=37809,AM=37810,wM=37811,EM=37812,TM=37813,bM=37814,CM=37815,RM=37816,PM=37817,IM=37818,LM=37819,DM=37820,BM=37821,pv=36492,NM=36494,UM=36495,TL=36283,FM=36284,OM=36285,kM=36286,KW=2200,qW=2201,ZW=2202,a0=2300,zM=2301,J1=2302,Ph=2400,Ih=2401,l0=2402,nw=2500,bL=2501,fue=0,pue=1,mue=2,QW=3200,e6=3201,gue=3202,vue=3203,mu=0,t6=1,pl="",lo="srgb",Wl="srgb-linear",iw="display-p3",ly="display-p3-linear",c0="linear",kn="srgb",u0="rec709",h0="p3",yue=0,ph=7680,_ue=7681,xue=7682,Sue=7683,Mue=34055,Aue=34056,wue=5386,Eue=512,Tue=513,bue=514,Cue=515,Rue=516,Pue=517,Iue=518,fP=519,n6=512,i6=513,r6=514,CL=515,s6=516,o6=517,a6=518,l6=519,d0=35044,Lue=35048,Due=35040,Bue=35045,Nue=35049,Uue=35041,Fue=35046,Oue=35050,kue=35042,zue="100",pP="300 es",Ea=2e3,f0=2001;class za{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+gr[n>>16&255]+gr[n>>24&255]+"-"+gr[e&255]+gr[e>>8&255]+"-"+gr[e>>16&15|64]+gr[e>>24&255]+"-"+gr[t&63|128]+gr[t>>8&255]+"-"+gr[t>>16&255]+gr[t>>24&255]+gr[i&255]+gr[i>>8&255]+gr[i>>16&255]+gr[i>>24&255]).toLowerCase()}function pi(n,e,t){return Math.max(e,Math.min(t,n))}function RL(n,e){return(n%e+e)%e}function Gue(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function Hue(n,e,t){return n!==e?(t-n)/(e-n):0}function mv(n,e,t){return(1-t)*n+t*e}function Vue(n,e,t,i){return mv(n,e,1-Math.exp(-t*i))}function Wue(n,e=1){return e-Math.abs(RL(n,e*2)-e)}function $ue(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Xue(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function jue(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Yue(n,e){return n+Math.random()*(e-n)}function Jue(n){return n*(.5-Math.random())}function Kue(n){n!==void 0&&(LO=n);let e=LO+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function que(n){return n*jh}function Zue(n){return n*Xp}function Que(n){return(n&n-1)===0&&n!==0}function ehe(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function the(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function nhe(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),h=s((e-i)/2),d=o((e-i)/2),f=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*h,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*h,a*c);break;case"ZXZ":n.set(l*h,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*v,l*f,a*c);break;case"YXY":n.set(l*f,a*u,l*v,a*c);break;case"ZYZ":n.set(l*v,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Xr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Xt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const ihe={DEG2RAD:jh,RAD2DEG:Xp,generateUUID:Us,clamp:pi,euclideanModulo:RL,mapLinear:Gue,inverseLerp:Hue,lerp:mv,damp:Vue,pingpong:Wue,smoothstep:$ue,smootherstep:Xue,randInt:jue,randFloat:Yue,randFloatSpread:Jue,seededRandom:Kue,degToRad:que,radToDeg:Zue,isPowerOfTwo:Que,ceilPowerOfTwo:ehe,floorPowerOfTwo:the,setQuaternionFromProperEuler:nhe,normalize:Xt,denormalize:Xr};class Je{constructor(e=0,t=0){Je.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(pi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Wt{constructor(e,t,i,r,s,o,a,l,c){Wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],f=i[5],v=i[8],_=r[0],y=r[3],m=r[6],S=r[1],x=r[4],M=r[7],R=r[2],T=r[5],P=r[8];return s[0]=o*_+a*S+l*R,s[3]=o*y+a*x+l*T,s[6]=o*m+a*M+l*P,s[1]=c*_+u*S+h*R,s[4]=c*y+u*x+h*T,s[7]=c*m+u*M+h*P,s[2]=d*_+f*S+v*R,s[5]=d*y+f*x+v*T,s[8]=d*m+f*M+v*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,v=t*h+i*d+r*f;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/v;return e[0]=h*_,e[1]=(r*c-u*i)*_,e[2]=(a*i-r*o)*_,e[3]=d*_,e[4]=(u*t-r*l)*_,e[5]=(r*s-a*t)*_,e[6]=f*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Tb.makeScale(e,t)),this}rotate(e){return this.premultiply(Tb.makeRotation(-e)),this}translate(e,t){return this.premultiply(Tb.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Tb=new Wt;function c6(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const rhe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function op(n,e){return new rhe[n](e)}function p0(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function u6(){const n=p0("canvas");return n.style.display="block",n}const DO={};function Mp(n){n in DO||(DO[n]=!0,console.warn(n))}function she(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const BO=new Wt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),NO=new Wt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),hg={[Wl]:{transfer:c0,primaries:u0,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[lo]:{transfer:kn,primaries:u0,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[ly]:{transfer:c0,primaries:h0,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(NO),fromReference:n=>n.applyMatrix3(BO)},[iw]:{transfer:kn,primaries:h0,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(NO),fromReference:n=>n.applyMatrix3(BO).convertLinearToSRGB()}},ohe=new Set([Wl,ly]),Mn={enabled:!0,_workingColorSpace:Wl,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!ohe.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=hg[e].toReference,r=hg[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return hg[n].primaries},getTransfer:function(n){return n===pl?c0:hg[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(hg[e].luminanceCoefficients)}};function Ap(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function bb(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let uf;class h6{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{uf===void 0&&(uf=p0("canvas")),uf.width=e.width,uf.height=e.height;const i=uf.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=uf}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=p0("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==JA)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case s0:e.x=e.x-Math.floor(e.x);break;case mo:e.x=e.x<0?0:1;break;case o0:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case s0:e.y=e.y-Math.floor(e.y);break;case mo:e.y=e.y<0?0:1;break;case o0:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}gi.DEFAULT_IMAGE=null;gi.DEFAULT_MAPPING=JA;gi.DEFAULT_ANISOTROPY=1;class Cn{constructor(e=0,t=0,i=0,r=1){Cn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],v=l[9],_=l[2],y=l[6],m=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-_)<.01&&Math.abs(v-y)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+_)<.1&&Math.abs(v+y)<.1&&Math.abs(c+f+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,M=(f+1)/2,R=(m+1)/2,T=(u+d)/4,P=(h+_)/4,I=(v+y)/4;return x>M&&x>R?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=T/i,s=P/i):M>R?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=T/r,s=I/r):R<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(R),i=P/s,r=I/s),this.set(i,r,s,t),this}let S=Math.sqrt((y-v)*(y-v)+(h-_)*(h-_)+(d-u)*(d-u));return Math.abs(S)<.001&&(S=1),this.x=(y-v)/S,this.y=(h-_)/S,this.z=(d-u)/S,this.w=Math.acos((c+f+m-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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class d6 extends za{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Cn(0,0,e,t),this.scissorTest=!1,this.viewport=new Cn(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ii,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new gi(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const R=Math.sqrt(x),T=Math.atan2(R,m*S);y=Math.sin(y*T)/R,a=Math.sin(a*T)/R}const M=a*S;if(l=l*y+d*M,c=c*y+f*M,u=u*y+v*M,h=h*y+_*M,y===1-a){const R=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=R,c*=R,u*=R,h*=R}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[o],d=s[o+1],f=s[o+2],v=s[o+3];return e[t]=a*v+u*h+l*f-c*d,e[t+1]=l*v+u*d+c*h-a*f,e[t+2]=c*v+u*f+a*d-l*h,e[t+3]=u*v-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),h=a(s/2),d=l(i/2),f=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h-d*f*v;break;case"YXZ":this._x=d*u*h+c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h+d*f*v;break;case"ZXY":this._x=d*u*h-c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h-d*f*v;break;case"ZYX":this._x=d*u*h-c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h+d*f*v;break;case"YZX":this._x=d*u*h+c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h-d*f*v;break;case"XZY":this._x=d*u*h-c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h+d*f*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=i+a+h;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-r)*f}else if(i>a&&i>h){const f=2*Math.sqrt(1+i-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+c)/f}else if(a>h){const f=2*Math.sqrt(1+a-i-h);this._w=(s-c)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+h-i-a);this._w=(o-r)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(pi(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-t;return this._w=f*o+t*this._w,this._x=f*i+t*this._x,this._y=f*r+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=r*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ee{constructor(e=0,t=0,i=0){ee.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(UO.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(UO.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*c+o*h-a*u,this.y=i+l*u+a*c-s*h,this.z=r+l*h+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Rb.copy(this).projectOnVector(e),this.sub(Rb)}reflect(e){return this.sub(Rb.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(pi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Rb=new ee,UO=new ps;class Zr{constructor(e=new ee(1/0,1/0,1/0),t=new ee(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=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,Io),Io.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(dg),Px.subVectors(this.max,dg),hf.subVectors(e.a,dg),df.subVectors(e.b,dg),ff.subVectors(e.c,dg),uc.subVectors(df,hf),hc.subVectors(ff,df),Xu.subVectors(hf,ff);let t=[0,-uc.z,uc.y,0,-hc.z,hc.y,0,-Xu.z,Xu.y,uc.z,0,-uc.x,hc.z,0,-hc.x,Xu.z,0,-Xu.x,-uc.y,uc.x,0,-hc.y,hc.x,0,-Xu.y,Xu.x,0];return!Pb(t,hf,df,ff,Px)||(t=[1,0,0,0,1,0,0,0,1],!Pb(t,hf,df,ff,Px))?!1:(Ix.crossVectors(uc,hc),t=[Ix.x,Ix.y,Ix.z],Pb(t,hf,df,ff,Px))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Io).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Io).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(nl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),nl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),nl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),nl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),nl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),nl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),nl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),nl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(nl),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 nl=[new ee,new ee,new ee,new ee,new ee,new ee,new ee,new ee],Io=new ee,Rx=new Zr,hf=new ee,df=new ee,ff=new ee,uc=new ee,hc=new ee,Xu=new ee,dg=new ee,Px=new ee,Ix=new ee,ju=new ee;function Pb(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){ju.fromArray(n,s);const a=r.x*Math.abs(ju.x)+r.y*Math.abs(ju.y)+r.z*Math.abs(ju.z),l=e.dot(ju),c=t.dot(ju),u=i.dot(ju);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const hhe=new Zr,fg=new ee,Ib=new ee;class Rr{constructor(e=new ee,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):hhe.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.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;fg.subVectors(e,this.center);const t=fg.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(fg,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Ib.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(fg.copy(e.center).add(Ib)),this.expandByPoint(fg.copy(e.center).sub(Ib))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const il=new ee,Lb=new ee,Lx=new ee,dc=new ee,Db=new ee,Dx=new ee,Bb=new ee;class um{constructor(e=new ee,t=new ee(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,il)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=il.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(il.copy(this.origin).addScaledVector(this.direction,t),il.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Lb.copy(e).add(t).multiplyScalar(.5),Lx.copy(t).sub(e).normalize(),dc.copy(this.origin).sub(Lb);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Lx),a=dc.dot(this.direction),l=-dc.dot(Lx),c=dc.lengthSq(),u=Math.abs(1-o*o);let h,d,f,v;if(u>0)if(h=o*l-a,d=o*a-l,v=s*u,h>=0)if(d>=-v)if(d<=v){const _=1/u;h*=_,d*=_,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-v?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=v?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(Lb).addScaledVector(Lx,d),f}intersectSphere(e,t){il.subVectors(e.center,this.origin);const i=il.dot(this.direction),r=il.dot(il)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,il)!==null}intersectTriangle(e,t,i,r,s){Db.subVectors(t,e),Dx.subVectors(i,e),Bb.crossVectors(Db,Dx);let o=this.direction.dot(Bb),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;dc.subVectors(this.origin,e);const l=a*this.direction.dot(Dx.crossVectors(dc,Dx));if(l<0)return null;const c=a*this.direction.dot(Db.cross(dc));if(c<0||l+c>o)return null;const u=-a*dc.dot(Bb);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Dt{constructor(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y){Dt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y)}set(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=d,m[3]=f,m[7]=v,m[11]=_,m[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Dt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/pf.setFromMatrixColumn(e,0).length(),s=1/pf.setFromMatrixColumn(e,1).length(),o=1/pf.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const d=o*u,f=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+v*c,t[5]=d-_*c,t[9]=-a*l,t[2]=_-d*c,t[6]=v+f*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,f=l*h,v=c*u,_=c*h;t[0]=d+_*a,t[4]=v*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-v,t[6]=_+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,f=l*h,v=c*u,_=c*h;t[0]=d-_*a,t[4]=-o*h,t[8]=v+f*a,t[1]=f+v*a,t[5]=o*u,t[9]=_-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,f=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=v*c-f,t[8]=d*c+_,t[1]=l*h,t[5]=_*c+d,t[9]=f*c-v,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,f=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=_-d*h,t[8]=v*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+v,t[10]=d-_*h}else if(e.order==="XZY"){const d=o*l,f=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+_,t[5]=o*u,t[9]=f*h-v,t[2]=v*h-f,t[6]=a*u,t[10]=_*h+d}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(dhe,e,fhe)}lookAt(e,t,i){const r=this.elements;return Ts.subVectors(e,t),Ts.lengthSq()===0&&(Ts.z=1),Ts.normalize(),fc.crossVectors(i,Ts),fc.lengthSq()===0&&(Math.abs(i.z)===1?Ts.x+=1e-4:Ts.z+=1e-4,Ts.normalize(),fc.crossVectors(i,Ts)),fc.normalize(),Bx.crossVectors(Ts,fc),r[0]=fc.x,r[4]=Bx.x,r[8]=Ts.x,r[1]=fc.y,r[5]=Bx.y,r[9]=Ts.y,r[2]=fc.z,r[6]=Bx.z,r[10]=Ts.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],d=i[9],f=i[13],v=i[2],_=i[6],y=i[10],m=i[14],S=i[3],x=i[7],M=i[11],R=i[15],T=r[0],P=r[4],I=r[8],b=r[12],w=r[1],N=r[5],G=r[9],V=r[13],$=r[2],Z=r[6],X=r[10],re=r[14],O=r[3],Q=r[7],te=r[11],le=r[15];return s[0]=o*T+a*w+l*$+c*O,s[4]=o*P+a*N+l*Z+c*Q,s[8]=o*I+a*G+l*X+c*te,s[12]=o*b+a*V+l*re+c*le,s[1]=u*T+h*w+d*$+f*O,s[5]=u*P+h*N+d*Z+f*Q,s[9]=u*I+h*G+d*X+f*te,s[13]=u*b+h*V+d*re+f*le,s[2]=v*T+_*w+y*$+m*O,s[6]=v*P+_*N+y*Z+m*Q,s[10]=v*I+_*G+y*X+m*te,s[14]=v*b+_*V+y*re+m*le,s[3]=S*T+x*w+M*$+R*O,s[7]=S*P+x*N+M*Z+R*Q,s[11]=S*I+x*G+M*X+R*te,s[15]=S*b+x*V+M*re+R*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],v=e[3],_=e[7],y=e[11],m=e[15];return v*(+s*l*h-r*c*h-s*a*d+i*c*d+r*a*f-i*l*f)+_*(+t*l*f-t*c*d+s*o*d-r*o*f+r*c*u-s*l*u)+y*(+t*c*h-t*a*f-s*o*h+i*o*f+s*a*u-i*c*u)+m*(-r*a*u-t*l*h+t*a*d+r*o*h-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],v=e[12],_=e[13],y=e[14],m=e[15],S=h*y*c-_*d*c+_*l*f-a*y*f-h*l*m+a*d*m,x=v*d*c-u*y*c-v*l*f+o*y*f+u*l*m-o*d*m,M=u*_*c-v*h*c+v*a*f-o*_*f-u*a*m+o*h*m,R=v*h*l-u*_*l-v*a*d+o*_*d+u*a*y-o*h*y,T=t*S+i*x+r*M+s*R;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/T;return e[0]=S*P,e[1]=(_*d*s-h*y*s-_*r*f+i*y*f+h*r*m-i*d*m)*P,e[2]=(a*y*s-_*l*s+_*r*c-i*y*c-a*r*m+i*l*m)*P,e[3]=(h*l*s-a*d*s-h*r*c+i*d*c+a*r*f-i*l*f)*P,e[4]=x*P,e[5]=(u*y*s-v*d*s+v*r*f-t*y*f-u*r*m+t*d*m)*P,e[6]=(v*l*s-o*y*s-v*r*c+t*y*c+o*r*m-t*l*m)*P,e[7]=(o*d*s-u*l*s+u*r*c-t*d*c-o*r*f+t*l*f)*P,e[8]=M*P,e[9]=(v*h*s-u*_*s-v*i*f+t*_*f+u*i*m-t*h*m)*P,e[10]=(o*_*s-v*a*s+v*i*c-t*_*c-o*i*m+t*a*m)*P,e[11]=(u*a*s-o*h*s-u*i*c+t*h*c+o*i*f-t*a*f)*P,e[12]=R*P,e[13]=(u*_*r-v*h*r+v*i*d-t*_*d-u*i*y+t*h*y)*P,e[14]=(v*a*r-o*_*r-v*i*l+t*_*l+o*i*y-t*a*y)*P,e[15]=(o*h*r-u*a*r+u*i*l-t*h*l-o*i*d+t*a*d)*P,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,v=s*h,_=o*u,y=o*h,m=a*h,S=l*c,x=l*u,M=l*h,R=i.x,T=i.y,P=i.z;return r[0]=(1-(_+m))*R,r[1]=(f+M)*R,r[2]=(v-x)*R,r[3]=0,r[4]=(f-M)*T,r[5]=(1-(d+m))*T,r[6]=(y+S)*T,r[7]=0,r[8]=(v+x)*P,r[9]=(y-S)*P,r[10]=(1-(d+_))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=pf.set(r[0],r[1],r[2]).length();const o=pf.set(r[4],r[5],r[6]).length(),a=pf.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Lo.copy(this);const c=1/s,u=1/o,h=1/a;return Lo.elements[0]*=c,Lo.elements[1]*=c,Lo.elements[2]*=c,Lo.elements[4]*=u,Lo.elements[5]*=u,Lo.elements[6]*=u,Lo.elements[8]*=h,Lo.elements[9]*=h,Lo.elements[10]*=h,t.setFromRotationMatrix(Lo),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Ea){const l=this.elements,c=2*s/(t-e),u=2*s/(i-r),h=(t+e)/(t-e),d=(i+r)/(i-r);let f,v;if(a===Ea)f=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===f0)f=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Ea){const l=this.elements,c=1/(t-e),u=1/(i-r),h=1/(o-s),d=(t+e)*c,f=(i+r)*u;let v,_;if(a===Ea)v=(o+s)*h,_=-2*h;else if(a===f0)v=s*h,_=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const pf=new ee,Lo=new Dt,dhe=new ee(0,0,0),fhe=new ee(1,1,1),fc=new ee,Bx=new ee,Ts=new ee,FO=new Dt,OO=new ps;class Vs{constructor(e=0,t=0,i=0,r=Vs.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],h=r[2],d=r[6],f=r[10];switch(t){case"XYZ":this._y=Math.asin(pi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-pi(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(pi(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-pi(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(pi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-pi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return FO.makeRotationFromQuaternion(e),this.setFromRotationMatrix(FO,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return OO.setFromEuler(this),this.setFromQuaternion(OO,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Vs.DEFAULT_ORDER="XYZ";class sw{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),f.length>0&&(i.animations=f),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Do.subVectors(r,t),sl.subVectors(i,t),Ub.subVectors(e,t);const o=Do.dot(Do),a=Do.dot(sl),l=Do.dot(Ub),c=sl.dot(sl),u=sl.dot(Ub),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;const d=1/h,f=(c*l-a*u)*d,v=(o*u-a*l)*d;return s.set(1-f-v,v,f)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,ol)===null?!1:ol.x>=0&&ol.y>=0&&ol.x+ol.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,ol)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ol.x),l.addScaledVector(o,ol.y),l.addScaledVector(a,ol.z),l)}static isFrontFacing(e,t,i,r){return Do.subVectors(i,t),sl.subVectors(e,t),Do.cross(sl).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Do.subVectors(this.c,this.b),sl.subVectors(this.a,this.b),Do.cross(sl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Rs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Rs.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Rs.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Rs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Rs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;vf.subVectors(r,i),yf.subVectors(s,i),Fb.subVectors(e,i);const l=vf.dot(Fb),c=yf.dot(Fb);if(l<=0&&c<=0)return t.copy(i);Ob.subVectors(e,r);const u=vf.dot(Ob),h=yf.dot(Ob);if(u>=0&&h<=u)return t.copy(r);const d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(vf,o);kb.subVectors(e,s);const f=vf.dot(kb),v=yf.dot(kb);if(v>=0&&f<=v)return t.copy(s);const _=f*c-l*v;if(_<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(i).addScaledVector(yf,a);const y=u*v-f*h;if(y<=0&&h-u>=0&&f-v>=0)return WO.subVectors(s,r),a=(h-u)/(h-u+(f-v)),t.copy(r).addScaledVector(WO,a);const m=1/(y+_+d);return o=_*m,a=d*m,t.copy(i).addScaledVector(vf,o).addScaledVector(yf,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const f6={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},pc={h:0,s:0,l:0},Ux={h:0,s:0,l:0};function zb(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class _t{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=lo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Mn.workingColorSpace){return this.r=e,this.g=t,this.b=i,Mn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Mn.workingColorSpace){if(e=RL(e,1),t=pi(t,0,1),i=pi(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=zb(o,s,e+1/3),this.g=zb(o,s,e),this.b=zb(o,s,e-1/3)}return Mn.toWorkingColorSpace(this,r),this}setStyle(e,t=lo){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=lo){const i=f6[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ap(e.r),this.g=Ap(e.g),this.b=Ap(e.b),this}copyLinearToSRGB(e){return this.r=bb(e.r),this.g=bb(e.g),this.b=bb(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=lo){return Mn.fromWorkingColorSpace(vr.copy(this),e),Math.round(pi(vr.r*255,0,255))*65536+Math.round(pi(vr.g*255,0,255))*256+Math.round(pi(vr.b*255,0,255))}getHexString(e=lo){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mn.workingColorSpace){Mn.fromWorkingColorSpace(vr.copy(this),t);const i=vr.r,r=vr.g,s=vr.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==$h&&(i.blending=this.blending),this.side!==Ol&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==dM&&(i.blendSrc=this.blendSrc),this.blendDst!==fM&&(i.blendDst=this.blendDst),this.blendEquation!==Pc&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==n0&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==fP&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ph&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ph&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ph&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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 i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class gu extends Br{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new _t(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Vs,this.combine=oy,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 ml=_he();function _he(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function as(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=pi(n,-65504,65504),ml.floatView[0]=n;const e=ml.uint32View[0],t=e>>23&511;return ml.baseTable[t]+((e&8388607)>>ml.shiftTable[t])}function Fg(n){const e=n>>10;return ml.uint32View[0]=ml.mantissaTable[ml.offsetTable[e]+(n&1023)]+ml.exponentTable[e],ml.floatView[0]}const xhe={toHalfFloat:as,fromHalfFloat:Fg},Ri=new ee,Fx=new Je;class Nn{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=d0,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=us,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Mp("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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let d=0,f=h.length;d0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&($O.copy(s).invert(),Yu.copy(e.ray).applyMatrix4($O),!(i.boundingBox!==null&&Yu.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Yu)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,d=s.groups,f=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,_=d.length;v<_;v++){const y=d[v],m=o[y.materialIndex],S=Math.max(y.start,f.start),x=Math.min(a.count,Math.min(y.start+y.count,f.start+f.count));for(let M=S,R=x;Mt.far?null:{distance:c,point:Wx.clone(),object:n}}function $x(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,xf),n.getVertexPosition(l,Sf),n.getVertexPosition(c,Mf);const u=Che(n,e,t,i,xf,Sf,Mf,Vx);if(u){r&&(zx.fromBufferAttribute(r,a),Gx.fromBufferAttribute(r,l),Hx.fromBufferAttribute(r,c),u.uv=Rs.getInterpolation(Vx,xf,Sf,Mf,zx,Gx,Hx,new Je)),s&&(zx.fromBufferAttribute(s,a),Gx.fromBufferAttribute(s,l),Hx.fromBufferAttribute(s,c),u.uv1=Rs.getInterpolation(Vx,xf,Sf,Mf,zx,Gx,Hx,new Je)),o&&(jO.fromBufferAttribute(o,a),YO.fromBufferAttribute(o,l),JO.fromBufferAttribute(o,c),u.normal=Rs.getInterpolation(Vx,xf,Sf,Mf,jO,YO,JO,new ee),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new ee,materialIndex:0};Rs.getNormal(xf,Sf,Mf,h.normal),u.face=h}return u}class wd extends tn{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],h=[];let d=0,f=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new wt(c,3)),this.setAttribute("normal",new wt(u,3)),this.setAttribute("uv",new wt(h,2));function v(_,y,m,S,x,M,R,T,P,I,b){const w=M/P,N=R/I,G=M/2,V=R/2,$=T/2,Z=P+1,X=I+1;let re=0,O=0;const Q=new ee;for(let te=0;te0?1:-1,u.push(Q.x,Q.y,Q.z),h.push(we/P),h.push(1-te/I),re+=1}}for(let te=0;te>8&255]+gr[n>>16&255]+gr[n>>24&255]+"-"+gr[e&255]+gr[e>>8&255]+"-"+gr[e>>16&15|64]+gr[e>>24&255]+"-"+gr[t&63|128]+gr[t>>8&255]+"-"+gr[t>>16&255]+gr[t>>24&255]+gr[i&255]+gr[i>>8&255]+gr[i>>16&255]+gr[i>>24&255]).toLowerCase()}function pi(n,e,t){return Math.max(e,Math.min(t,n))}function LL(n,e){return(n%e+e)%e}function $ue(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function Xue(n,e,t){return n!==e?(t-n)/(e-n):0}function mv(n,e,t){return(1-t)*n+t*e}function jue(n,e,t,i){return mv(n,e,1-Math.exp(-t*i))}function Yue(n,e=1){return e-Math.abs(LL(n,e*2)-e)}function Jue(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Kue(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function que(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Zue(n,e){return n+Math.random()*(e-n)}function Que(n){return n*(.5-Math.random())}function ehe(n){n!==void 0&&(NO=n);let e=NO+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function the(n){return n*jh}function nhe(n){return n*jp}function ihe(n){return(n&n-1)===0&&n!==0}function rhe(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function she(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function ohe(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),u=o((e+i)/2),h=s((e-i)/2),d=o((e-i)/2),f=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*u,l*h,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*h,a*c);break;case"ZXZ":n.set(l*h,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*v,l*f,a*c);break;case"YXY":n.set(l*f,a*u,l*v,a*c);break;case"ZYZ":n.set(l*v,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Xr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Xt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const ahe={DEG2RAD:jh,RAD2DEG:jp,generateUUID:Us,clamp:pi,euclideanModulo:LL,mapLinear:$ue,inverseLerp:Xue,lerp:mv,damp:jue,pingpong:Yue,smoothstep:Jue,smootherstep:Kue,randInt:que,randFloat:Zue,randFloatSpread:Que,seededRandom:ehe,degToRad:the,radToDeg:nhe,isPowerOfTwo:ihe,ceilPowerOfTwo:rhe,floorPowerOfTwo:she,setQuaternionFromProperEuler:ohe,normalize:Xt,denormalize:Xr};class Je{constructor(e=0,t=0){Je.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(pi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Wt{constructor(e,t,i,r,s,o,a,l,c){Wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],f=i[5],v=i[8],_=r[0],y=r[3],m=r[6],S=r[1],x=r[4],M=r[7],R=r[2],T=r[5],P=r[8];return s[0]=o*_+a*S+l*R,s[3]=o*y+a*x+l*T,s[6]=o*m+a*M+l*P,s[1]=c*_+u*S+h*R,s[4]=c*y+u*x+h*T,s[7]=c*m+u*M+h*P,s[2]=d*_+f*S+v*R,s[5]=d*y+f*x+v*T,s[8]=d*m+f*M+v*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,f=c*s-o*l,v=t*h+i*d+r*f;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/v;return e[0]=h*_,e[1]=(r*c-u*i)*_,e[2]=(a*i-r*o)*_,e[3]=d*_,e[4]=(u*t-r*l)*_,e[5]=(r*s-a*t)*_,e[6]=f*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(wb.makeScale(e,t)),this}rotate(e){return this.premultiply(wb.makeRotation(-e)),this}translate(e,t){return this.premultiply(wb.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const wb=new Wt;function f6(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const lhe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function op(n,e){return new lhe[n](e)}function p0(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function p6(){const n=p0("canvas");return n.style.display="block",n}const UO={};function Mp(n){n in UO||(UO[n]=!0,console.warn(n))}function che(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const FO=new Wt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),OO=new Wt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),dg={[Vl]:{transfer:c0,primaries:u0,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[lo]:{transfer:kn,primaries:u0,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[ay]:{transfer:c0,primaries:h0,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(OO),fromReference:n=>n.applyMatrix3(FO)},[tw]:{transfer:kn,primaries:h0,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(OO),fromReference:n=>n.applyMatrix3(FO).convertLinearToSRGB()}},uhe=new Set([Vl,ay]),Mn={enabled:!0,_workingColorSpace:Vl,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!uhe.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=dg[e].toReference,r=dg[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return dg[n].primaries},getTransfer:function(n){return n===pl?c0:dg[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(dg[e].luminanceCoefficients)}};function Ap(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Eb(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let uf;class m6{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{uf===void 0&&(uf=p0("canvas")),uf.width=e.width,uf.height=e.height;const i=uf.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=uf}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=p0("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==jA)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case s0:e.x=e.x-Math.floor(e.x);break;case mo:e.x=e.x<0?0:1;break;case o0:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case s0:e.y=e.y-Math.floor(e.y);break;case mo:e.y=e.y<0?0:1;break;case o0:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}gi.DEFAULT_IMAGE=null;gi.DEFAULT_MAPPING=jA;gi.DEFAULT_ANISOTROPY=1;class Cn{constructor(e=0,t=0,i=0,r=1){Cn.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],v=l[9],_=l[2],y=l[6],m=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-_)<.01&&Math.abs(v-y)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+_)<.1&&Math.abs(v+y)<.1&&Math.abs(c+f+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const x=(c+1)/2,M=(f+1)/2,R=(m+1)/2,T=(u+d)/4,P=(h+_)/4,I=(v+y)/4;return x>M&&x>R?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=T/i,s=P/i):M>R?M<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(M),i=T/r,s=I/r):R<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(R),i=P/s,r=I/s),this.set(i,r,s,t),this}let S=Math.sqrt((y-v)*(y-v)+(h-_)*(h-_)+(d-u)*(d-u));return Math.abs(S)<.001&&(S=1),this.x=(y-v)/S,this.y=(h-_)/S,this.z=(d-u)/S,this.w=Math.acos((c+f+m-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 i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class g6 extends za{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Cn(0,0,e,t),this.scissorTest=!1,this.viewport=new Cn(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ii,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new gi(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const R=Math.sqrt(x),T=Math.atan2(R,m*S);y=Math.sin(y*T)/R,a=Math.sin(a*T)/R}const M=a*S;if(l=l*y+d*M,c=c*y+f*M,u=u*y+v*M,h=h*y+_*M,y===1-a){const R=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=R,c*=R,u*=R,h*=R}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[o],d=s[o+1],f=s[o+2],v=s[o+3];return e[t]=a*v+u*h+l*f-c*d,e[t+1]=l*v+u*d+c*h-a*f,e[t+2]=c*v+u*f+a*d-l*h,e[t+3]=u*v-a*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),h=a(s/2),d=l(i/2),f=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h-d*f*v;break;case"YXZ":this._x=d*u*h+c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h+d*f*v;break;case"ZXY":this._x=d*u*h-c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h-d*f*v;break;case"ZYX":this._x=d*u*h-c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h+d*f*v;break;case"YZX":this._x=d*u*h+c*f*v,this._y=c*f*h+d*u*v,this._z=c*u*v-d*f*h,this._w=c*u*h-d*f*v;break;case"XZY":this._x=d*u*h-c*f*v,this._y=c*f*h-d*u*v,this._z=c*u*v+d*f*h,this._w=c*u*h+d*f*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=i+a+h;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(o-r)*f}else if(i>a&&i>h){const f=2*Math.sqrt(1+i-a-h);this._w=(u-l)/f,this._x=.25*f,this._y=(r+o)/f,this._z=(s+c)/f}else if(a>h){const f=2*Math.sqrt(1+a-i-h);this._w=(s-c)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+h-i-a);this._w=(o-r)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(pi(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-t;return this._w=f*o+t*this._w,this._x=f*i+t*this._x,this._y=f*r+t*this._y,this._z=f*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=r*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ee{constructor(e=0,t=0,i=0){ee.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(kO.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(kO.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*c+o*h-a*u,this.y=i+l*u+a*c-s*h,this.z=r+l*h+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return bb.copy(this).projectOnVector(e),this.sub(bb)}reflect(e){return this.sub(bb.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(pi(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bb=new ee,kO=new ps;class Zr{constructor(e=new ee(1/0,1/0,1/0),t=new ee(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=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,Io),Io.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fg),Rx.subVectors(this.max,fg),hf.subVectors(e.a,fg),df.subVectors(e.b,fg),ff.subVectors(e.c,fg),cc.subVectors(df,hf),uc.subVectors(ff,df),Xu.subVectors(hf,ff);let t=[0,-cc.z,cc.y,0,-uc.z,uc.y,0,-Xu.z,Xu.y,cc.z,0,-cc.x,uc.z,0,-uc.x,Xu.z,0,-Xu.x,-cc.y,cc.x,0,-uc.y,uc.x,0,-Xu.y,Xu.x,0];return!Cb(t,hf,df,ff,Rx)||(t=[1,0,0,0,1,0,0,0,1],!Cb(t,hf,df,ff,Rx))?!1:(Px.crossVectors(cc,uc),t=[Px.x,Px.y,Px.z],Cb(t,hf,df,ff,Rx))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Io).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Io).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(nl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),nl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),nl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),nl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),nl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),nl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),nl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),nl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(nl),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 nl=[new ee,new ee,new ee,new ee,new ee,new ee,new ee,new ee],Io=new ee,Cx=new Zr,hf=new ee,df=new ee,ff=new ee,cc=new ee,uc=new ee,Xu=new ee,fg=new ee,Rx=new ee,Px=new ee,ju=new ee;function Cb(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){ju.fromArray(n,s);const a=r.x*Math.abs(ju.x)+r.y*Math.abs(ju.y)+r.z*Math.abs(ju.z),l=e.dot(ju),c=t.dot(ju),u=i.dot(ju);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const mhe=new Zr,pg=new ee,Rb=new ee;class Rr{constructor(e=new ee,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):mhe.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.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;pg.subVectors(e,this.center);const t=pg.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(pg,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Rb.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(pg.copy(e.center).add(Rb)),this.expandByPoint(pg.copy(e.center).sub(Rb))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const il=new ee,Pb=new ee,Ix=new ee,hc=new ee,Ib=new ee,Lx=new ee,Lb=new ee;class hm{constructor(e=new ee,t=new ee(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,il)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=il.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(il.copy(this.origin).addScaledVector(this.direction,t),il.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Pb.copy(e).add(t).multiplyScalar(.5),Ix.copy(t).sub(e).normalize(),hc.copy(this.origin).sub(Pb);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Ix),a=hc.dot(this.direction),l=-hc.dot(Ix),c=hc.lengthSq(),u=Math.abs(1-o*o);let h,d,f,v;if(u>0)if(h=o*l-a,d=o*a-l,v=s*u,h>=0)if(d>=-v)if(d<=v){const _=1/u;h*=_,d*=_,f=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;else d<=-v?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=v?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),f=-h*h+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(Pb).addScaledVector(Ix,d),f}intersectSphere(e,t){il.subVectors(e.center,this.origin);const i=il.dot(this.direction),r=il.dot(il)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,il)!==null}intersectTriangle(e,t,i,r,s){Ib.subVectors(t,e),Lx.subVectors(i,e),Lb.crossVectors(Ib,Lx);let o=this.direction.dot(Lb),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;hc.subVectors(this.origin,e);const l=a*this.direction.dot(Lx.crossVectors(hc,Lx));if(l<0)return null;const c=a*this.direction.dot(Ib.cross(hc));if(c<0||l+c>o)return null;const u=-a*hc.dot(Lb);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Dt{constructor(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y){Dt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y)}set(e,t,i,r,s,o,a,l,c,u,h,d,f,v,_,y){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=d,m[3]=f,m[7]=v,m[11]=_,m[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Dt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/pf.setFromMatrixColumn(e,0).length(),s=1/pf.setFromMatrixColumn(e,1).length(),o=1/pf.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const d=o*u,f=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+v*c,t[5]=d-_*c,t[9]=-a*l,t[2]=_-d*c,t[6]=v+f*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,f=l*h,v=c*u,_=c*h;t[0]=d+_*a,t[4]=v*a-f,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=f*a-v,t[6]=_+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,f=l*h,v=c*u,_=c*h;t[0]=d-_*a,t[4]=-o*h,t[8]=v+f*a,t[1]=f+v*a,t[5]=o*u,t[9]=_-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,f=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=v*c-f,t[8]=d*c+_,t[1]=l*h,t[5]=_*c+d,t[9]=f*c-v,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,f=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=_-d*h,t[8]=v*h+f,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=f*h+v,t[10]=d-_*h}else if(e.order==="XZY"){const d=o*l,f=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+_,t[5]=o*u,t[9]=f*h-v,t[2]=v*h-f,t[6]=a*u,t[10]=_*h+d}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(ghe,e,vhe)}lookAt(e,t,i){const r=this.elements;return Ts.subVectors(e,t),Ts.lengthSq()===0&&(Ts.z=1),Ts.normalize(),dc.crossVectors(i,Ts),dc.lengthSq()===0&&(Math.abs(i.z)===1?Ts.x+=1e-4:Ts.z+=1e-4,Ts.normalize(),dc.crossVectors(i,Ts)),dc.normalize(),Dx.crossVectors(Ts,dc),r[0]=dc.x,r[4]=Dx.x,r[8]=Ts.x,r[1]=dc.y,r[5]=Dx.y,r[9]=Ts.y,r[2]=dc.z,r[6]=Dx.z,r[10]=Ts.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],d=i[9],f=i[13],v=i[2],_=i[6],y=i[10],m=i[14],S=i[3],x=i[7],M=i[11],R=i[15],T=r[0],P=r[4],I=r[8],b=r[12],w=r[1],N=r[5],G=r[9],V=r[13],$=r[2],Z=r[6],X=r[10],re=r[14],O=r[3],Q=r[7],te=r[11],le=r[15];return s[0]=o*T+a*w+l*$+c*O,s[4]=o*P+a*N+l*Z+c*Q,s[8]=o*I+a*G+l*X+c*te,s[12]=o*b+a*V+l*re+c*le,s[1]=u*T+h*w+d*$+f*O,s[5]=u*P+h*N+d*Z+f*Q,s[9]=u*I+h*G+d*X+f*te,s[13]=u*b+h*V+d*re+f*le,s[2]=v*T+_*w+y*$+m*O,s[6]=v*P+_*N+y*Z+m*Q,s[10]=v*I+_*G+y*X+m*te,s[14]=v*b+_*V+y*re+m*le,s[3]=S*T+x*w+M*$+R*O,s[7]=S*P+x*N+M*Z+R*Q,s[11]=S*I+x*G+M*X+R*te,s[15]=S*b+x*V+M*re+R*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],v=e[3],_=e[7],y=e[11],m=e[15];return v*(+s*l*h-r*c*h-s*a*d+i*c*d+r*a*f-i*l*f)+_*(+t*l*f-t*c*d+s*o*d-r*o*f+r*c*u-s*l*u)+y*(+t*c*h-t*a*f-s*o*h+i*o*f+s*a*u-i*c*u)+m*(-r*a*u-t*l*h+t*a*d+r*o*h-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],v=e[12],_=e[13],y=e[14],m=e[15],S=h*y*c-_*d*c+_*l*f-a*y*f-h*l*m+a*d*m,x=v*d*c-u*y*c-v*l*f+o*y*f+u*l*m-o*d*m,M=u*_*c-v*h*c+v*a*f-o*_*f-u*a*m+o*h*m,R=v*h*l-u*_*l-v*a*d+o*_*d+u*a*y-o*h*y,T=t*S+i*x+r*M+s*R;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/T;return e[0]=S*P,e[1]=(_*d*s-h*y*s-_*r*f+i*y*f+h*r*m-i*d*m)*P,e[2]=(a*y*s-_*l*s+_*r*c-i*y*c-a*r*m+i*l*m)*P,e[3]=(h*l*s-a*d*s-h*r*c+i*d*c+a*r*f-i*l*f)*P,e[4]=x*P,e[5]=(u*y*s-v*d*s+v*r*f-t*y*f-u*r*m+t*d*m)*P,e[6]=(v*l*s-o*y*s-v*r*c+t*y*c+o*r*m-t*l*m)*P,e[7]=(o*d*s-u*l*s+u*r*c-t*d*c-o*r*f+t*l*f)*P,e[8]=M*P,e[9]=(v*h*s-u*_*s-v*i*f+t*_*f+u*i*m-t*h*m)*P,e[10]=(o*_*s-v*a*s+v*i*c-t*_*c-o*i*m+t*a*m)*P,e[11]=(u*a*s-o*h*s-u*i*c+t*h*c+o*i*f-t*a*f)*P,e[12]=R*P,e[13]=(u*_*r-v*h*r+v*i*d-t*_*d-u*i*y+t*h*y)*P,e[14]=(v*a*r-o*_*r-v*i*l+t*_*l+o*i*y-t*a*y)*P,e[15]=(o*h*r-u*a*r+u*i*l-t*h*l-o*i*d+t*a*d)*P,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,f=s*u,v=s*h,_=o*u,y=o*h,m=a*h,S=l*c,x=l*u,M=l*h,R=i.x,T=i.y,P=i.z;return r[0]=(1-(_+m))*R,r[1]=(f+M)*R,r[2]=(v-x)*R,r[3]=0,r[4]=(f-M)*T,r[5]=(1-(d+m))*T,r[6]=(y+S)*T,r[7]=0,r[8]=(v+x)*P,r[9]=(y-S)*P,r[10]=(1-(d+_))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=pf.set(r[0],r[1],r[2]).length();const o=pf.set(r[4],r[5],r[6]).length(),a=pf.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Lo.copy(this);const c=1/s,u=1/o,h=1/a;return Lo.elements[0]*=c,Lo.elements[1]*=c,Lo.elements[2]*=c,Lo.elements[4]*=u,Lo.elements[5]*=u,Lo.elements[6]*=u,Lo.elements[8]*=h,Lo.elements[9]*=h,Lo.elements[10]*=h,t.setFromRotationMatrix(Lo),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Ea){const l=this.elements,c=2*s/(t-e),u=2*s/(i-r),h=(t+e)/(t-e),d=(i+r)/(i-r);let f,v;if(a===Ea)f=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===f0)f=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Ea){const l=this.elements,c=1/(t-e),u=1/(i-r),h=1/(o-s),d=(t+e)*c,f=(i+r)*u;let v,_;if(a===Ea)v=(o+s)*h,_=-2*h;else if(a===f0)v=s*h,_=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const pf=new ee,Lo=new Dt,ghe=new ee(0,0,0),vhe=new ee(1,1,1),dc=new ee,Dx=new ee,Ts=new ee,zO=new Dt,GO=new ps;class Vs{constructor(e=0,t=0,i=0,r=Vs.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],h=r[2],d=r[6],f=r[10];switch(t){case"XYZ":this._y=Math.asin(pi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-pi(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(pi(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-pi(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(pi(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-pi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return zO.makeRotationFromQuaternion(e),this.setFromRotationMatrix(zO,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return GO.setFromEuler(this),this.setFromQuaternion(GO,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Vs.DEFAULT_ORDER="XYZ";class iw{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),f.length>0&&(i.animations=f),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Do.subVectors(r,t),sl.subVectors(i,t),Bb.subVectors(e,t);const o=Do.dot(Do),a=Do.dot(sl),l=Do.dot(Bb),c=sl.dot(sl),u=sl.dot(Bb),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;const d=1/h,f=(c*l-a*u)*d,v=(o*u-a*l)*d;return s.set(1-f-v,v,f)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,ol)===null?!1:ol.x>=0&&ol.y>=0&&ol.x+ol.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,ol)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ol.x),l.addScaledVector(o,ol.y),l.addScaledVector(a,ol.z),l)}static isFrontFacing(e,t,i,r){return Do.subVectors(i,t),sl.subVectors(e,t),Do.cross(sl).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Do.subVectors(this.c,this.b),sl.subVectors(this.a,this.b),Do.cross(sl).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Rs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Rs.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Rs.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Rs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Rs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;vf.subVectors(r,i),yf.subVectors(s,i),Nb.subVectors(e,i);const l=vf.dot(Nb),c=yf.dot(Nb);if(l<=0&&c<=0)return t.copy(i);Ub.subVectors(e,r);const u=vf.dot(Ub),h=yf.dot(Ub);if(u>=0&&h<=u)return t.copy(r);const d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(vf,o);Fb.subVectors(e,s);const f=vf.dot(Fb),v=yf.dot(Fb);if(v>=0&&f<=v)return t.copy(s);const _=f*c-l*v;if(_<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(i).addScaledVector(yf,a);const y=u*v-f*h;if(y<=0&&h-u>=0&&f-v>=0)return jO.subVectors(s,r),a=(h-u)/(h-u+(f-v)),t.copy(r).addScaledVector(jO,a);const m=1/(y+_+d);return o=_*m,a=d*m,t.copy(i).addScaledVector(vf,o).addScaledVector(yf,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const v6={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},fc={h:0,s:0,l:0},Nx={h:0,s:0,l:0};function Ob(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class _t{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=lo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=Mn.workingColorSpace){return this.r=e,this.g=t,this.b=i,Mn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=Mn.workingColorSpace){if(e=LL(e,1),t=pi(t,0,1),i=pi(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=Ob(o,s,e+1/3),this.g=Ob(o,s,e),this.b=Ob(o,s,e-1/3)}return Mn.toWorkingColorSpace(this,r),this}setStyle(e,t=lo){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=lo){const i=v6[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ap(e.r),this.g=Ap(e.g),this.b=Ap(e.b),this}copyLinearToSRGB(e){return this.r=Eb(e.r),this.g=Eb(e.g),this.b=Eb(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=lo){return Mn.fromWorkingColorSpace(vr.copy(this),e),Math.round(pi(vr.r*255,0,255))*65536+Math.round(pi(vr.g*255,0,255))*256+Math.round(pi(vr.b*255,0,255))}getHexString(e=lo){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mn.workingColorSpace){Mn.fromWorkingColorSpace(vr.copy(this),t);const i=vr.r,r=vr.g,s=vr.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==$h&&(i.blending=this.blending),this.side!==Fl&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==dM&&(i.blendSrc=this.blendSrc),this.blendDst!==fM&&(i.blendDst=this.blendDst),this.blendEquation!==Rc&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==n0&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==dP&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ph&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ph&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ph&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.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 i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class gu extends Br{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new _t(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Vs,this.combine=sy,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 ml=Ahe();function Ahe(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function as(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=pi(n,-65504,65504),ml.floatView[0]=n;const e=ml.uint32View[0],t=e>>23&511;return ml.baseTable[t]+((e&8388607)>>ml.shiftTable[t])}function Og(n){const e=n>>10;return ml.uint32View[0]=ml.mantissaTable[ml.offsetTable[e]+(n&1023)]+ml.exponentTable[e],ml.floatView[0]}const whe={toHalfFloat:as,fromHalfFloat:Og},Ri=new ee,Ux=new Je;class Nn{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=d0,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=us,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Mp("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,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let d=0,f=h.length;d0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(YO.copy(s).invert(),Yu.copy(e.ray).applyMatrix4(YO),!(i.boundingBox!==null&&Yu.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Yu)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,d=s.groups,f=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,_=d.length;v<_;v++){const y=d[v],m=o[y.materialIndex],S=Math.max(y.start,f.start),x=Math.min(a.count,Math.min(y.start+y.count,f.start+f.count));for(let M=S,R=x;Mt.far?null:{distance:c,point:Vx.clone(),object:n}}function Wx(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,xf),n.getVertexPosition(l,Sf),n.getVertexPosition(c,Mf);const u=Lhe(n,e,t,i,xf,Sf,Mf,Hx);if(u){r&&(kx.fromBufferAttribute(r,a),zx.fromBufferAttribute(r,l),Gx.fromBufferAttribute(r,c),u.uv=Rs.getInterpolation(Hx,xf,Sf,Mf,kx,zx,Gx,new Je)),s&&(kx.fromBufferAttribute(s,a),zx.fromBufferAttribute(s,l),Gx.fromBufferAttribute(s,c),u.uv1=Rs.getInterpolation(Hx,xf,Sf,Mf,kx,zx,Gx,new Je)),o&&(KO.fromBufferAttribute(o,a),qO.fromBufferAttribute(o,l),ZO.fromBufferAttribute(o,c),u.normal=Rs.getInterpolation(Hx,xf,Sf,Mf,KO,qO,ZO,new ee),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new ee,materialIndex:0};Rs.getNormal(xf,Sf,Mf,h.normal),u.face=h}return u}class wd extends tn{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],h=[];let d=0,f=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new wt(c,3)),this.setAttribute("normal",new wt(u,3)),this.setAttribute("uv",new wt(h,2));function v(_,y,m,S,x,M,R,T,P,I,b){const w=M/P,N=R/I,G=M/2,V=R/2,$=T/2,Z=P+1,X=I+1;let re=0,O=0;const Q=new ee;for(let te=0;te0?1:-1,u.push(Q.x,Q.y,Q.z),h.push(we/P),h.push(1-te/I),re+=1}}for(let te=0;te0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class ow extends vn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Dt,this.projectionMatrix=new Dt,this.projectionMatrixInverse=new Dt,this.coordinateSystem=Ea}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 mc=new ee,KO=new Je,qO=new Je;class ir extends ow{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Xp*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(jh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Xp*2*Math.atan(Math.tan(jh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){mc.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(mc.x,mc.y).multiplyScalar(-e/mc.z),mc.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(mc.x,mc.y).multiplyScalar(-e/mc.z)}getViewSize(e,t){return this.getViewBounds(e,KO,qO),t.subVectors(qO,KO)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(jh*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Af=-90,wf=1;class g6 extends vn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new ir(Af,wf,e,t);r.layers=this.layers,this.add(r);const s=new ir(Af,wf,e,t);s.layers=this.layers,this.add(s);const o=new ir(Af,wf,e,t);o.layers=this.layers,this.add(o);const a=new ir(Af,wf,e,t);a.layers=this.layers,this.add(a);const l=new ir(Af,wf,e,t);l.layers=this.layers,this.add(l);const c=new ir(Af,wf,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Ea)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===f0)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(h,d,f),e.xr.enabled=v,i.texture.needsPMREMUpdate=!0}}class cy extends gi{constructor(e,t,i,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:kl,super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class v6 extends Jo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new cy(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Ii}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Ko extends Br{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Bhe,this.fragmentShader=Nhe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Yp(e.uniforms),this.uniformsGroups=Dhe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class rw extends vn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Dt,this.projectionMatrix=new Dt,this.projectionMatrixInverse=new Dt,this.coordinateSystem=Ea}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 pc=new ee,QO=new Je,ek=new Je;class ir extends rw{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=jp*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(jh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return jp*2*Math.atan(Math.tan(jh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){pc.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(pc.x,pc.y).multiplyScalar(-e/pc.z),pc.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(pc.x,pc.y).multiplyScalar(-e/pc.z)}getViewSize(e,t){return this.getViewBounds(e,QO,ek),t.subVectors(ek,QO)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(jh*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Af=-90,wf=1;class x6 extends vn{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new ir(Af,wf,e,t);r.layers=this.layers,this.add(r);const s=new ir(Af,wf,e,t);s.layers=this.layers,this.add(s);const o=new ir(Af,wf,e,t);o.layers=this.layers,this.add(o);const a=new ir(Af,wf,e,t);a.layers=this.layers,this.add(a);const l=new ir(Af,wf,e,t);l.layers=this.layers,this.add(l);const c=new ir(Af,wf,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Ea)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===f0)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,r),e.render(t,u),e.setRenderTarget(h,d,f),e.xr.enabled=v,i.texture.needsPMREMUpdate=!0}}class ly extends gi{constructor(e,t,i,r,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:Ol,super(e,t,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class S6 extends Jo{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new ly(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Ii}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -4014,9 +4014,9 @@ No matching component was found for: gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new wd(5,5,5),s=new Ko({name:"CubemapFromEquirect",uniforms:jp(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:qr,blending:bl});s.uniforms.tEquirect.value=t;const o=new Li(r,s),a=t.minFilter;return t.minFilter===wa&&(t.minFilter=Ii),new g6(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const Vb=new ee,Lhe=new ee,Dhe=new Wt;class Tc{constructor(e=new ee(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Vb.subVectors(i,t).cross(Lhe.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Vb),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Dhe.getNormalMatrix(e),r=this.coplanarPoint(Vb).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ju=new Rr,Xx=new ee;class uy{constructor(e=new Tc,t=new Tc,i=new Tc,r=new Tc,s=new Tc,o=new Tc){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ea){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],h=r[6],d=r[7],f=r[8],v=r[9],_=r[10],y=r[11],m=r[12],S=r[13],x=r[14],M=r[15];if(i[0].setComponents(l-s,d-c,y-f,M-m).normalize(),i[1].setComponents(l+s,d+c,y+f,M+m).normalize(),i[2].setComponents(l+o,d+u,y+v,M+S).normalize(),i[3].setComponents(l-o,d-u,y-v,M-S).normalize(),i[4].setComponents(l-a,d-h,y-_,M-x).normalize(),t===Ea)i[5].setComponents(l+a,d+h,y+_,M+x).normalize();else if(t===f0)i[5].setComponents(a,h,_,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ju.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ju.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ju)}intersectsSprite(e){return Ju.center.set(0,0,0),Ju.radius=.7071067811865476,Ju.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ju)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Xx.y=r.normal.y>0?e.max.y:e.min.y,Xx.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Xx)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function y6(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function Bhe(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,h=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let f;if(c instanceof Float32Array)f=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?f=n.HALF_FLOAT:f=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=n.SHORT;else if(c instanceof Uint32Array)f=n.UNSIGNED_INT;else if(c instanceof Int32Array)f=n.INT;else if(c instanceof Int8Array)f=n.BYTE;else if(c instanceof Uint8Array)f=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,c){const u=l.array,h=l._updateRange,d=l.updateRanges;if(n.bindBuffer(c,a),h.count===-1&&d.length===0&&n.bufferSubData(c,0,u),d.length!==0){for(let f=0,v=d.length;f1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Fhe.getNormalMatrix(e),r=this.coplanarPoint(Gb).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ju=new Rr,$x=new ee;class cy{constructor(e=new Ec,t=new Ec,i=new Ec,r=new Ec,s=new Ec,o=new Ec){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ea){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],u=r[5],h=r[6],d=r[7],f=r[8],v=r[9],_=r[10],y=r[11],m=r[12],S=r[13],x=r[14],M=r[15];if(i[0].setComponents(l-s,d-c,y-f,M-m).normalize(),i[1].setComponents(l+s,d+c,y+f,M+m).normalize(),i[2].setComponents(l+o,d+u,y+v,M+S).normalize(),i[3].setComponents(l-o,d-u,y-v,M-S).normalize(),i[4].setComponents(l-a,d-h,y-_,M-x).normalize(),t===Ea)i[5].setComponents(l+a,d+h,y+_,M+x).normalize();else if(t===f0)i[5].setComponents(a,h,_,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ju.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ju.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ju)}intersectsSprite(e){return Ju.center.set(0,0,0),Ju.radius=.7071067811865476,Ju.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ju)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,$x.y=r.normal.y>0?e.max.y:e.min.y,$x.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint($x)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function M6(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function Ohe(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,h=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let f;if(c instanceof Float32Array)f=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?f=n.HALF_FLOAT:f=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=n.SHORT;else if(c instanceof Uint32Array)f=n.UNSIGNED_INT;else if(c instanceof Int32Array)f=n.INT;else if(c instanceof Int8Array)f=n.BYTE;else if(c instanceof Uint8Array)f=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,c){const u=l.array,h=l._updateRange,d=l.updateRanges;if(n.bindBuffer(c,a),h.count===-1&&d.length===0&&n.bufferSubData(c,0,u),d.length!==0){for(let f=0,v=d.length;f 0 +#endif`,ede=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -4266,26 +4266,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,qhe=`#if NUM_CLIPPING_PLANES > 0 +#endif`,tde=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,Zhe=`#if NUM_CLIPPING_PLANES > 0 +#endif`,nde=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,Qhe=`#if NUM_CLIPPING_PLANES > 0 +#endif`,ide=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,ede=`#if defined( USE_COLOR_ALPHA ) +#endif`,rde=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,tde=`#if defined( USE_COLOR_ALPHA ) +#endif`,sde=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,nde=`#if defined( USE_COLOR_ALPHA ) +#endif`,ode=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; -#endif`,ide=`#if defined( USE_COLOR_ALPHA ) +#endif`,ade=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); @@ -4299,7 +4299,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; -#endif`,rde=`#define PI 3.141592653589793 +#endif`,lde=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -4373,7 +4373,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,sde=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,cde=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -4466,7 +4466,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,ode=`vec3 transformedNormal = objectNormal; +#endif`,ude=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -4495,18 +4495,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,ade=`#ifdef USE_DISPLACEMENTMAP +#endif`,hde=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,lde=`#ifdef USE_DISPLACEMENTMAP +#endif`,dde=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,cde=`#ifdef USE_EMISSIVEMAP +#endif`,fde=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,ude=`#ifdef USE_EMISSIVEMAP +#endif`,pde=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,hde="gl_FragColor = linearToOutputTexel( gl_FragColor );",dde=` +#endif`,mde="gl_FragColor = linearToOutputTexel( gl_FragColor );",gde=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -4528,7 +4528,7 @@ vec4 LinearTransferOETF( in vec4 value ) { } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,fde=`#ifdef USE_ENVMAP +}`,vde=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -4557,7 +4557,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,pde=`#ifdef USE_ENVMAP +#endif`,yde=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -4567,7 +4567,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,mde=`#ifdef USE_ENVMAP +#endif`,_de=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -4578,7 +4578,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,gde=`#ifdef USE_ENVMAP +#endif`,xde=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -4589,7 +4589,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,vde=`#ifdef USE_ENVMAP +#endif`,Sde=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -4606,18 +4606,18 @@ vec4 sRGBTransferOETF( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,yde=`#ifdef USE_FOG +#endif`,Mde=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,_de=`#ifdef USE_FOG +#endif`,Ade=`#ifdef USE_FOG varying float vFogDepth; -#endif`,xde=`#ifdef USE_FOG +#endif`,wde=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Sde=`#ifdef USE_FOG +#endif`,Ede=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -4626,7 +4626,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,Mde=`#ifdef USE_GRADIENTMAP +#endif`,Tde=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -4638,12 +4638,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,Ade=`#ifdef USE_LIGHTMAP +}`,bde=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,wde=`LambertMaterial material; +#endif`,Cde=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,Ede=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Rde=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -4657,7 +4657,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Tde=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Pde=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -4773,7 +4773,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,bde=`#ifdef USE_ENVMAP +#endif`,Ide=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -4806,8 +4806,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,Cde=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,Rde=`varying vec3 vViewPosition; +#endif`,Lde=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,Dde=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -4819,11 +4819,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Pde=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Bde=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,Ide=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Nde=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -4840,7 +4840,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Lde=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Ude=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -4926,7 +4926,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,Dde=`struct PhysicalMaterial { +#endif`,Fde=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -5227,7 +5227,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,Bde=` +}`,Ode=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -5342,7 +5342,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,Nde=`#if defined( RE_IndirectDiffuse ) +#endif`,kde=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -5361,33 +5361,33 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,Ude=`#if defined( RE_IndirectDiffuse ) +#endif`,zde=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,Fde=`#if defined( USE_LOGDEPTHBUF ) +#endif`,Gde=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,Ode=`#if defined( USE_LOGDEPTHBUF ) +#endif`,Hde=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,kde=`#ifdef USE_LOGDEPTHBUF +#endif`,Vde=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; -#endif`,zde=`#ifdef USE_LOGDEPTHBUF +#endif`,Wde=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,Gde=`#ifdef USE_MAP +#endif`,$de=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,Hde=`#ifdef USE_MAP +#endif`,Xde=`#ifdef USE_MAP uniform sampler2D map; -#endif`,Vde=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,jde=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -5399,7 +5399,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,Wde=`#if defined( USE_POINTS_UV ) +#endif`,Yde=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -5411,19 +5411,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,$de=`float metalnessFactor = metalness; +#endif`,Jde=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,Xde=`#ifdef USE_METALNESSMAP +#endif`,Kde=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,jde=`#ifdef USE_INSTANCING_MORPH +#endif`,qde=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,Yde=`#if defined( USE_MORPHCOLORS ) +#endif`,Zde=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -5432,12 +5432,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,Jde=`#ifdef USE_MORPHNORMALS +#endif`,Qde=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } -#endif`,Kde=`#ifdef USE_MORPHTARGETS +#endif`,efe=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -5451,12 +5451,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,qde=`#ifdef USE_MORPHTARGETS +#endif`,tfe=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } -#endif`,Zde=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,nfe=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -5497,7 +5497,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,Qde=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,ife=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -5512,25 +5512,25 @@ vec3 nonPerturbedNormal = normal;`,Qde=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,efe=`#ifndef FLAT_SHADED +#endif`,rfe=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,tfe=`#ifndef FLAT_SHADED +#endif`,sfe=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,nfe=`#ifndef FLAT_SHADED +#endif`,ofe=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,ife=`#ifdef USE_NORMALMAP +#endif`,afe=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -5552,13 +5552,13 @@ vec3 nonPerturbedNormal = normal;`,Qde=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,rfe=`#ifdef USE_CLEARCOAT +#endif`,lfe=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,sfe=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,cfe=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,ofe=`#ifdef USE_CLEARCOATMAP +#endif`,ufe=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -5567,18 +5567,18 @@ vec3 nonPerturbedNormal = normal;`,Qde=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,afe=`#ifdef USE_IRIDESCENCEMAP +#endif`,hfe=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,lfe=`#ifdef OPAQUE +#endif`,dfe=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,cfe=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,ffe=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -5647,9 +5647,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,ufe=`#ifdef PREMULTIPLIED_ALPHA +}`,pfe=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,hfe=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,mfe=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -5657,22 +5657,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,dfe=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,gfe=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,ffe=`#ifdef DITHERING +#endif`,vfe=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,pfe=`float roughnessFactor = roughness; +#endif`,yfe=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,mfe=`#ifdef USE_ROUGHNESSMAP +#endif`,_fe=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,gfe=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,xfe=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -5858,7 +5858,7 @@ gl_Position = projectionMatrix * mvPosition;`,dfe=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,vfe=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Sfe=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -5899,7 +5899,7 @@ gl_Position = projectionMatrix * mvPosition;`,dfe=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,yfe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,Mfe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -5931,7 +5931,7 @@ gl_Position = projectionMatrix * mvPosition;`,dfe=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,_fe=`float getShadowMask() { +#endif`,Afe=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -5963,12 +5963,12 @@ gl_Position = projectionMatrix * mvPosition;`,dfe=`#ifdef DITHERING #endif #endif return shadow; -}`,xfe=`#ifdef USE_SKINNING +}`,wfe=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,Sfe=`#ifdef USE_SKINNING +#endif`,Efe=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -5983,7 +5983,7 @@ gl_Position = projectionMatrix * mvPosition;`,dfe=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,Mfe=`#ifdef USE_SKINNING +#endif`,Tfe=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -5991,7 +5991,7 @@ gl_Position = projectionMatrix * mvPosition;`,dfe=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,Afe=`#ifdef USE_SKINNING +#endif`,bfe=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -6002,17 +6002,17 @@ gl_Position = projectionMatrix * mvPosition;`,dfe=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,wfe=`float specularStrength; +#endif`,Cfe=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,Efe=`#ifdef USE_SPECULARMAP +#endif`,Rfe=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,Tfe=`#if defined( TONE_MAPPING ) +#endif`,Pfe=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,bfe=`#ifndef saturate +#endif`,Ife=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -6109,7 +6109,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,Cfe=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,Lfe=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -6130,7 +6130,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Cfe=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,Rfe=`#ifdef USE_TRANSMISSION +#endif`,Dfe=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -6261,7 +6261,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Cfe=`#ifdef USE_TRANSMIS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,Pfe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Bfe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -6331,7 +6331,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Cfe=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,Ife=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Nfe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -6425,7 +6425,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Cfe=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,Lfe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Ufe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -6496,7 +6496,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Cfe=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,Dfe=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Ffe=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -6505,12 +6505,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Cfe=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const Bfe=`varying vec2 vUv; +#endif`;const Ofe=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,Nfe=`uniform sampler2D t2D; +}`,kfe=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -6522,14 +6522,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,Ufe=`varying vec3 vWorldDirection; +}`,zfe=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,Ffe=`#ifdef ENVMAP_TYPE_CUBE +}`,Gfe=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -6552,14 +6552,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,Ofe=`varying vec3 vWorldDirection; +}`,Hfe=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,kfe=`uniform samplerCube tCube; +}`,Vfe=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -6569,7 +6569,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,zfe=`#include +}`,Wfe=`#include #include #include #include @@ -6596,7 +6596,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,Gfe=`#if DEPTH_PACKING == 3200 +}`,$fe=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -6630,7 +6630,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,Hfe=`#define DISTANCE +}`,Xfe=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -6657,7 +6657,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,Vfe=`#define DISTANCE +}`,jfe=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -6681,13 +6681,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,Wfe=`varying vec3 vWorldDirection; +}`,Yfe=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,$fe=`uniform sampler2D tEquirect; +}`,Jfe=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -6696,7 +6696,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,Xfe=`uniform float scale; +}`,Kfe=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -6718,7 +6718,7 @@ void main() { #include #include #include -}`,jfe=`uniform vec3 diffuse; +}`,qfe=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -6746,7 +6746,7 @@ void main() { #include #include #include -}`,Yfe=`#include +}`,Zfe=`#include #include #include #include @@ -6778,7 +6778,7 @@ void main() { #include #include #include -}`,Jfe=`uniform vec3 diffuse; +}`,Qfe=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -6826,7 +6826,7 @@ void main() { #include #include #include -}`,Kfe=`#define LAMBERT +}`,epe=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -6865,7 +6865,7 @@ void main() { #include #include #include -}`,qfe=`#define LAMBERT +}`,tpe=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -6922,7 +6922,7 @@ void main() { #include #include #include -}`,Zfe=`#define MATCAP +}`,npe=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -6956,7 +6956,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,Qfe=`#define MATCAP +}`,ipe=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -7002,7 +7002,7 @@ void main() { #include #include #include -}`,epe=`#define NORMAL +}`,rpe=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -7035,7 +7035,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,tpe=`#define NORMAL +}`,spe=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -7057,7 +7057,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,npe=`#define PHONG +}`,ope=`#define PHONG varying vec3 vViewPosition; #include #include @@ -7096,7 +7096,7 @@ void main() { #include #include #include -}`,ipe=`#define PHONG +}`,ape=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -7155,7 +7155,7 @@ void main() { #include #include #include -}`,rpe=`#define STANDARD +}`,lpe=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -7198,7 +7198,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,spe=`#define STANDARD +}`,cpe=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -7323,7 +7323,7 @@ void main() { #include #include #include -}`,ope=`#define TOON +}`,upe=`#define TOON varying vec3 vViewPosition; #include #include @@ -7360,7 +7360,7 @@ void main() { #include #include #include -}`,ape=`#define TOON +}`,hpe=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -7413,7 +7413,7 @@ void main() { #include #include #include -}`,lpe=`uniform float size; +}`,dpe=`uniform float size; uniform float scale; #include #include @@ -7444,7 +7444,7 @@ void main() { #include #include #include -}`,cpe=`uniform vec3 diffuse; +}`,fpe=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -7469,7 +7469,7 @@ void main() { #include #include #include -}`,upe=`#include +}`,ppe=`#include #include #include #include @@ -7492,7 +7492,7 @@ void main() { #include #include #include -}`,hpe=`uniform vec3 color; +}`,mpe=`uniform vec3 color; uniform float opacity; #include #include @@ -7508,7 +7508,7 @@ void main() { #include #include #include -}`,dpe=`uniform float rotation; +}`,gpe=`uniform float rotation; uniform vec2 center; #include #include @@ -7534,7 +7534,7 @@ void main() { #include #include #include -}`,fpe=`uniform vec3 diffuse; +}`,vpe=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -7559,7 +7559,7 @@ void main() { #include #include #include -}`,Kt={alphahash_fragment:Nhe,alphahash_pars_fragment:Uhe,alphamap_fragment:Fhe,alphamap_pars_fragment:Ohe,alphatest_fragment:khe,alphatest_pars_fragment:zhe,aomap_fragment:Ghe,aomap_pars_fragment:Hhe,batching_pars_vertex:Vhe,batching_vertex:Whe,begin_vertex:$he,beginnormal_vertex:Xhe,bsdfs:jhe,iridescence_fragment:Yhe,bumpmap_pars_fragment:Jhe,clipping_planes_fragment:Khe,clipping_planes_pars_fragment:qhe,clipping_planes_pars_vertex:Zhe,clipping_planes_vertex:Qhe,color_fragment:ede,color_pars_fragment:tde,color_pars_vertex:nde,color_vertex:ide,common:rde,cube_uv_reflection_fragment:sde,defaultnormal_vertex:ode,displacementmap_pars_vertex:ade,displacementmap_vertex:lde,emissivemap_fragment:cde,emissivemap_pars_fragment:ude,colorspace_fragment:hde,colorspace_pars_fragment:dde,envmap_fragment:fde,envmap_common_pars_fragment:pde,envmap_pars_fragment:mde,envmap_pars_vertex:gde,envmap_physical_pars_fragment:bde,envmap_vertex:vde,fog_vertex:yde,fog_pars_vertex:_de,fog_fragment:xde,fog_pars_fragment:Sde,gradientmap_pars_fragment:Mde,lightmap_pars_fragment:Ade,lights_lambert_fragment:wde,lights_lambert_pars_fragment:Ede,lights_pars_begin:Tde,lights_toon_fragment:Cde,lights_toon_pars_fragment:Rde,lights_phong_fragment:Pde,lights_phong_pars_fragment:Ide,lights_physical_fragment:Lde,lights_physical_pars_fragment:Dde,lights_fragment_begin:Bde,lights_fragment_maps:Nde,lights_fragment_end:Ude,logdepthbuf_fragment:Fde,logdepthbuf_pars_fragment:Ode,logdepthbuf_pars_vertex:kde,logdepthbuf_vertex:zde,map_fragment:Gde,map_pars_fragment:Hde,map_particle_fragment:Vde,map_particle_pars_fragment:Wde,metalnessmap_fragment:$de,metalnessmap_pars_fragment:Xde,morphinstance_vertex:jde,morphcolor_vertex:Yde,morphnormal_vertex:Jde,morphtarget_pars_vertex:Kde,morphtarget_vertex:qde,normal_fragment_begin:Zde,normal_fragment_maps:Qde,normal_pars_fragment:efe,normal_pars_vertex:tfe,normal_vertex:nfe,normalmap_pars_fragment:ife,clearcoat_normal_fragment_begin:rfe,clearcoat_normal_fragment_maps:sfe,clearcoat_pars_fragment:ofe,iridescence_pars_fragment:afe,opaque_fragment:lfe,packing:cfe,premultiplied_alpha_fragment:ufe,project_vertex:hfe,dithering_fragment:dfe,dithering_pars_fragment:ffe,roughnessmap_fragment:pfe,roughnessmap_pars_fragment:mfe,shadowmap_pars_fragment:gfe,shadowmap_pars_vertex:vfe,shadowmap_vertex:yfe,shadowmask_pars_fragment:_fe,skinbase_vertex:xfe,skinning_pars_vertex:Sfe,skinning_vertex:Mfe,skinnormal_vertex:Afe,specularmap_fragment:wfe,specularmap_pars_fragment:Efe,tonemapping_fragment:Tfe,tonemapping_pars_fragment:bfe,transmission_fragment:Cfe,transmission_pars_fragment:Rfe,uv_pars_fragment:Pfe,uv_pars_vertex:Ife,uv_vertex:Lfe,worldpos_vertex:Dfe,background_vert:Bfe,background_frag:Nfe,backgroundCube_vert:Ufe,backgroundCube_frag:Ffe,cube_vert:Ofe,cube_frag:kfe,depth_vert:zfe,depth_frag:Gfe,distanceRGBA_vert:Hfe,distanceRGBA_frag:Vfe,equirect_vert:Wfe,equirect_frag:$fe,linedashed_vert:Xfe,linedashed_frag:jfe,meshbasic_vert:Yfe,meshbasic_frag:Jfe,meshlambert_vert:Kfe,meshlambert_frag:qfe,meshmatcap_vert:Zfe,meshmatcap_frag:Qfe,meshnormal_vert:epe,meshnormal_frag:tpe,meshphong_vert:npe,meshphong_frag:ipe,meshphysical_vert:rpe,meshphysical_frag:spe,meshtoon_vert:ope,meshtoon_frag:ape,points_vert:lpe,points_frag:cpe,shadow_vert:upe,shadow_frag:hpe,sprite_vert:dpe,sprite_frag:fpe},dt={common:{diffuse:{value:new _t(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Wt}},envmap:{envMap:{value:null},envMapRotation:{value:new Wt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Wt},normalScale:{value:new Je(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _t(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{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 _t(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0},uvTransform:{value:new Wt}},sprite:{diffuse:{value:new _t(16777215)},opacity:{value:1},center:{value:new Je(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}}},ko={basic:{uniforms:Gr([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.fog]),vertexShader:Kt.meshbasic_vert,fragmentShader:Kt.meshbasic_frag},lambert:{uniforms:Gr([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new _t(0)}}]),vertexShader:Kt.meshlambert_vert,fragmentShader:Kt.meshlambert_frag},phong:{uniforms:Gr([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new _t(0)},specular:{value:new _t(1118481)},shininess:{value:30}}]),vertexShader:Kt.meshphong_vert,fragmentShader:Kt.meshphong_frag},standard:{uniforms:Gr([dt.common,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.roughnessmap,dt.metalnessmap,dt.fog,dt.lights,{emissive:{value:new _t(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Kt.meshphysical_vert,fragmentShader:Kt.meshphysical_frag},toon:{uniforms:Gr([dt.common,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.gradientmap,dt.fog,dt.lights,{emissive:{value:new _t(0)}}]),vertexShader:Kt.meshtoon_vert,fragmentShader:Kt.meshtoon_frag},matcap:{uniforms:Gr([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,{matcap:{value:null}}]),vertexShader:Kt.meshmatcap_vert,fragmentShader:Kt.meshmatcap_frag},points:{uniforms:Gr([dt.points,dt.fog]),vertexShader:Kt.points_vert,fragmentShader:Kt.points_frag},dashed:{uniforms:Gr([dt.common,dt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Kt.linedashed_vert,fragmentShader:Kt.linedashed_frag},depth:{uniforms:Gr([dt.common,dt.displacementmap]),vertexShader:Kt.depth_vert,fragmentShader:Kt.depth_frag},normal:{uniforms:Gr([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,{opacity:{value:1}}]),vertexShader:Kt.meshnormal_vert,fragmentShader:Kt.meshnormal_frag},sprite:{uniforms:Gr([dt.sprite,dt.fog]),vertexShader:Kt.sprite_vert,fragmentShader:Kt.sprite_frag},background:{uniforms:{uvTransform:{value:new Wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Kt.background_vert,fragmentShader:Kt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Wt}},vertexShader:Kt.backgroundCube_vert,fragmentShader:Kt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Kt.cube_vert,fragmentShader:Kt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Kt.equirect_vert,fragmentShader:Kt.equirect_frag},distanceRGBA:{uniforms:Gr([dt.common,dt.displacementmap,{referencePosition:{value:new ee},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Kt.distanceRGBA_vert,fragmentShader:Kt.distanceRGBA_frag},shadow:{uniforms:Gr([dt.lights,dt.fog,{color:{value:new _t(0)},opacity:{value:1}}]),vertexShader:Kt.shadow_vert,fragmentShader:Kt.shadow_frag}};ko.physical={uniforms:Gr([ko.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Wt},clearcoatNormalScale:{value:new Je(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Wt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Wt},sheen:{value:0},sheenColor:{value:new _t(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Wt},transmissionSamplerSize:{value:new Je},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Wt},attenuationDistance:{value:0},attenuationColor:{value:new _t(0)},specularColor:{value:new _t(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Wt},anisotropyVector:{value:new Je},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Wt}}]),vertexShader:Kt.meshphysical_vert,fragmentShader:Kt.meshphysical_frag};const jx={r:0,b:0,g:0},Ku=new Vs,ppe=new Dt;function mpe(n,e,t,i,r,s,o){const a=new _t(0);let l=s===!0?0:1,c,u,h=null,d=0,f=null;function v(S){let x=S.isScene===!0?S.background:null;return x&&x.isTexture&&(x=(S.backgroundBlurriness>0?t:e).get(x)),x}function _(S){let x=!1;const M=v(S);M===null?m(a,l):M&&M.isColor&&(m(M,1),x=!0);const R=n.xr.getEnvironmentBlendMode();R==="additive"?i.buffers.color.setClear(0,0,0,1,o):R==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||x)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(S,x){const M=v(x);M&&(M.isCubeTexture||M.mapping===lm)?(u===void 0&&(u=new Li(new wd(1,1,1),new Ko({name:"BackgroundCubeMaterial",uniforms:jp(ko.backgroundCube.uniforms),vertexShader:ko.backgroundCube.vertexShader,fragmentShader:ko.backgroundCube.fragmentShader,side:qr,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(R,T,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Ku.copy(x.backgroundRotation),Ku.x*=-1,Ku.y*=-1,Ku.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Ku.y*=-1,Ku.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(ppe.makeRotationFromEuler(Ku)),u.material.toneMapped=Mn.getTransfer(M.colorSpace)!==kn,(h!==M||d!==M.version||f!==n.toneMapping)&&(u.material.needsUpdate=!0,h=M,d=M.version,f=n.toneMapping),u.layers.enableAll(),S.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new Li(new hm(2,2),new Ko({name:"BackgroundMaterial",uniforms:jp(ko.background.uniforms),vertexShader:ko.background.vertexShader,fragmentShader:ko.background.fragmentShader,side:Ol,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=Mn.getTransfer(M.colorSpace)!==kn,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(h!==M||d!==M.version||f!==n.toneMapping)&&(c.material.needsUpdate=!0,h=M,d=M.version,f=n.toneMapping),c.layers.enableAll(),S.unshift(c,c.geometry,c.material,0,0,null))}function m(S,x){S.getRGB(jx,p6(n)),i.buffers.color.setClear(jx.r,jx.g,jx.b,x,o)}return{getClearColor:function(){return a},setClearColor:function(S,x=1){a.set(S),l=x,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(S){l=S,m(a,l)},render:_,addToRenderList:y}}function gpe(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=d(null);let s=r,o=!1;function a(w,N,G,V,$){let Z=!1;const X=h(V,G,N);s!==X&&(s=X,c(s.object)),Z=f(w,V,G,$),Z&&v(w,V,G,$),$!==null&&e.update($,n.ELEMENT_ARRAY_BUFFER),(Z||o)&&(o=!1,M(w,N,G,V),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return n.createVertexArray()}function c(w){return n.bindVertexArray(w)}function u(w){return n.deleteVertexArray(w)}function h(w,N,G){const V=G.wireframe===!0;let $=i[w.id];$===void 0&&($={},i[w.id]=$);let Z=$[N.id];Z===void 0&&(Z={},$[N.id]=Z);let X=Z[V];return X===void 0&&(X=d(l()),Z[V]=X),X}function d(w){const N=[],G=[],V=[];for(let $=0;$=0){const te=$[O];let le=Z[O];if(le===void 0&&(O==="instanceMatrix"&&w.instanceMatrix&&(le=w.instanceMatrix),O==="instanceColor"&&w.instanceColor&&(le=w.instanceColor)),te===void 0||te.attribute!==le||le&&te.data!==le.data)return!0;X++}return s.attributesNum!==X||s.index!==V}function v(w,N,G,V){const $={},Z=N.attributes;let X=0;const re=G.getAttributes();for(const O in re)if(re[O].location>=0){let te=Z[O];te===void 0&&(O==="instanceMatrix"&&w.instanceMatrix&&(te=w.instanceMatrix),O==="instanceColor"&&w.instanceColor&&(te=w.instanceColor));const le={};le.attribute=te,te&&te.data&&(le.data=te.data),$[O]=le,X++}s.attributes=$,s.attributesNum=X,s.index=V}function _(){const w=s.newAttributes;for(let N=0,G=w.length;N=0){let Q=$[re];if(Q===void 0&&(re==="instanceMatrix"&&w.instanceMatrix&&(Q=w.instanceMatrix),re==="instanceColor"&&w.instanceColor&&(Q=w.instanceColor)),Q!==void 0){const te=Q.normalized,le=Q.itemSize,we=e.get(Q);if(we===void 0)continue;const Ne=we.buffer,q=we.type,fe=we.bytesPerElement,Te=q===n.INT||q===n.UNSIGNED_INT||Q.gpuType===KA;if(Q.isInterleavedBufferAttribute){const Se=Q.data,$e=Se.stride,Qe=Q.offset;if(Se.isInstancedInterleavedBuffer){for(let je=0;je0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),m=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),S=n.getParameter(n.MAX_VARYING_VECTORS),x=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),M=f>0,R=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:f,maxTextureSize:v,maxCubemapSize:_,maxAttributes:y,maxVertexUniforms:m,maxVaryings:S,maxFragmentUniforms:x,vertexTextures:M,maxSamples:R}}function _pe(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Tc,a=new Wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d){const f=h.length!==0||d||i!==0||r;return r=d,i=h.length,f},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,d){t=u(h,d,0)},this.setState=function(h,d,f){const v=h.clippingPlanes,_=h.clipIntersection,y=h.clipShadows,m=n.get(h);if(!r||v===null||v.length===0||s&&!y)s?u(null):c();else{const S=s?0:i,x=S*4;let M=m.clippingState||null;l.value=M,M=u(v,d,x,f);for(let R=0;R!==x;++R)M[R]=t[R];m.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,d,f,v){const _=h!==null?h.length:0;let y=null;if(_!==0){if(y=l.value,v!==!0||y===null){const m=f+_*4,S=d.matrixWorldInverse;a.getNormalMatrix(S),(y===null||y.length0){const c=new v6(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class aw extends ow{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const ap=4,ZO=[.125,.215,.35,.446,.526,.582],vh=20,Wb=new aw,QO=new _t;let $b=null,Xb=0,jb=0,Yb=!1;const mh=(1+Math.sqrt(5))/2,Ef=1/mh,ek=[new ee(-mh,Ef,0),new ee(mh,Ef,0),new ee(-Ef,0,mh),new ee(Ef,0,mh),new ee(0,mh,-Ef),new ee(0,mh,Ef),new ee(-1,1,-1),new ee(1,1,-1),new ee(-1,1,1),new ee(1,1,1)];class mP{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){$b=this._renderer.getRenderTarget(),Xb=this._renderer.getActiveCubeFace(),jb=this._renderer.getActiveMipmapLevel(),Yb=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=ik(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=nk(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(r),_&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=d,u.autoClear=h,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===kl||e.mapping===Zc;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=ik()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=nk());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Li(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Yx(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Wb)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;svh&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${vh}`);const m=[];let S=0;for(let P=0;Px-ap?r-x+ap:0),T=4*(this._cubeSize-M);Yx(t,R,T,3*M,2*M),l.setRenderTarget(t),l.render(h,Wb)}}function Spe(n){const e=[],t=[],i=[];let r=n;const s=n-ap+1+ZO.length;for(let o=0;on-ap?l=ZO[o-n+ap-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],f=6,v=6,_=3,y=2,m=1,S=new Float32Array(_*v*f),x=new Float32Array(y*v*f),M=new Float32Array(m*v*f);for(let T=0;T2?0:-1,b=[P,I,0,P+2/3,I,0,P+2/3,I+1,0,P,I,0,P+2/3,I+1,0,P,I+1,0];S.set(b,_*v*T),x.set(d,y*v*T);const w=[T,T,T,T,T,T];M.set(w,m*v*T)}const R=new tn;R.setAttribute("position",new Nn(S,_)),R.setAttribute("uv",new Nn(x,y)),R.setAttribute("faceIndex",new Nn(M,m)),e.push(R),r>ap&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function tk(n,e,t){const i=new Jo(n,e,t);return i.texture.mapping=lm,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Yx(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function Mpe(n,e,t){const i=new Float32Array(vh),r=new ee(0,1,0);return new Ko({name:"SphericalGaussianBlur",defines:{n:vh,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:DL(),fragmentShader:` +}`,Kt={alphahash_fragment:khe,alphahash_pars_fragment:zhe,alphamap_fragment:Ghe,alphamap_pars_fragment:Hhe,alphatest_fragment:Vhe,alphatest_pars_fragment:Whe,aomap_fragment:$he,aomap_pars_fragment:Xhe,batching_pars_vertex:jhe,batching_vertex:Yhe,begin_vertex:Jhe,beginnormal_vertex:Khe,bsdfs:qhe,iridescence_fragment:Zhe,bumpmap_pars_fragment:Qhe,clipping_planes_fragment:ede,clipping_planes_pars_fragment:tde,clipping_planes_pars_vertex:nde,clipping_planes_vertex:ide,color_fragment:rde,color_pars_fragment:sde,color_pars_vertex:ode,color_vertex:ade,common:lde,cube_uv_reflection_fragment:cde,defaultnormal_vertex:ude,displacementmap_pars_vertex:hde,displacementmap_vertex:dde,emissivemap_fragment:fde,emissivemap_pars_fragment:pde,colorspace_fragment:mde,colorspace_pars_fragment:gde,envmap_fragment:vde,envmap_common_pars_fragment:yde,envmap_pars_fragment:_de,envmap_pars_vertex:xde,envmap_physical_pars_fragment:Ide,envmap_vertex:Sde,fog_vertex:Mde,fog_pars_vertex:Ade,fog_fragment:wde,fog_pars_fragment:Ede,gradientmap_pars_fragment:Tde,lightmap_pars_fragment:bde,lights_lambert_fragment:Cde,lights_lambert_pars_fragment:Rde,lights_pars_begin:Pde,lights_toon_fragment:Lde,lights_toon_pars_fragment:Dde,lights_phong_fragment:Bde,lights_phong_pars_fragment:Nde,lights_physical_fragment:Ude,lights_physical_pars_fragment:Fde,lights_fragment_begin:Ode,lights_fragment_maps:kde,lights_fragment_end:zde,logdepthbuf_fragment:Gde,logdepthbuf_pars_fragment:Hde,logdepthbuf_pars_vertex:Vde,logdepthbuf_vertex:Wde,map_fragment:$de,map_pars_fragment:Xde,map_particle_fragment:jde,map_particle_pars_fragment:Yde,metalnessmap_fragment:Jde,metalnessmap_pars_fragment:Kde,morphinstance_vertex:qde,morphcolor_vertex:Zde,morphnormal_vertex:Qde,morphtarget_pars_vertex:efe,morphtarget_vertex:tfe,normal_fragment_begin:nfe,normal_fragment_maps:ife,normal_pars_fragment:rfe,normal_pars_vertex:sfe,normal_vertex:ofe,normalmap_pars_fragment:afe,clearcoat_normal_fragment_begin:lfe,clearcoat_normal_fragment_maps:cfe,clearcoat_pars_fragment:ufe,iridescence_pars_fragment:hfe,opaque_fragment:dfe,packing:ffe,premultiplied_alpha_fragment:pfe,project_vertex:mfe,dithering_fragment:gfe,dithering_pars_fragment:vfe,roughnessmap_fragment:yfe,roughnessmap_pars_fragment:_fe,shadowmap_pars_fragment:xfe,shadowmap_pars_vertex:Sfe,shadowmap_vertex:Mfe,shadowmask_pars_fragment:Afe,skinbase_vertex:wfe,skinning_pars_vertex:Efe,skinning_vertex:Tfe,skinnormal_vertex:bfe,specularmap_fragment:Cfe,specularmap_pars_fragment:Rfe,tonemapping_fragment:Pfe,tonemapping_pars_fragment:Ife,transmission_fragment:Lfe,transmission_pars_fragment:Dfe,uv_pars_fragment:Bfe,uv_pars_vertex:Nfe,uv_vertex:Ufe,worldpos_vertex:Ffe,background_vert:Ofe,background_frag:kfe,backgroundCube_vert:zfe,backgroundCube_frag:Gfe,cube_vert:Hfe,cube_frag:Vfe,depth_vert:Wfe,depth_frag:$fe,distanceRGBA_vert:Xfe,distanceRGBA_frag:jfe,equirect_vert:Yfe,equirect_frag:Jfe,linedashed_vert:Kfe,linedashed_frag:qfe,meshbasic_vert:Zfe,meshbasic_frag:Qfe,meshlambert_vert:epe,meshlambert_frag:tpe,meshmatcap_vert:npe,meshmatcap_frag:ipe,meshnormal_vert:rpe,meshnormal_frag:spe,meshphong_vert:ope,meshphong_frag:ape,meshphysical_vert:lpe,meshphysical_frag:cpe,meshtoon_vert:upe,meshtoon_frag:hpe,points_vert:dpe,points_frag:fpe,shadow_vert:ppe,shadow_frag:mpe,sprite_vert:gpe,sprite_frag:vpe},dt={common:{diffuse:{value:new _t(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Wt}},envmap:{envMap:{value:null},envMapRotation:{value:new Wt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Wt},normalScale:{value:new Je(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _t(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{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 _t(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0},uvTransform:{value:new Wt}},sprite:{diffuse:{value:new _t(16777215)},opacity:{value:1},center:{value:new Je(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}}},ko={basic:{uniforms:Gr([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.fog]),vertexShader:Kt.meshbasic_vert,fragmentShader:Kt.meshbasic_frag},lambert:{uniforms:Gr([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new _t(0)}}]),vertexShader:Kt.meshlambert_vert,fragmentShader:Kt.meshlambert_frag},phong:{uniforms:Gr([dt.common,dt.specularmap,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,dt.lights,{emissive:{value:new _t(0)},specular:{value:new _t(1118481)},shininess:{value:30}}]),vertexShader:Kt.meshphong_vert,fragmentShader:Kt.meshphong_frag},standard:{uniforms:Gr([dt.common,dt.envmap,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.roughnessmap,dt.metalnessmap,dt.fog,dt.lights,{emissive:{value:new _t(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Kt.meshphysical_vert,fragmentShader:Kt.meshphysical_frag},toon:{uniforms:Gr([dt.common,dt.aomap,dt.lightmap,dt.emissivemap,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.gradientmap,dt.fog,dt.lights,{emissive:{value:new _t(0)}}]),vertexShader:Kt.meshtoon_vert,fragmentShader:Kt.meshtoon_frag},matcap:{uniforms:Gr([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,dt.fog,{matcap:{value:null}}]),vertexShader:Kt.meshmatcap_vert,fragmentShader:Kt.meshmatcap_frag},points:{uniforms:Gr([dt.points,dt.fog]),vertexShader:Kt.points_vert,fragmentShader:Kt.points_frag},dashed:{uniforms:Gr([dt.common,dt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Kt.linedashed_vert,fragmentShader:Kt.linedashed_frag},depth:{uniforms:Gr([dt.common,dt.displacementmap]),vertexShader:Kt.depth_vert,fragmentShader:Kt.depth_frag},normal:{uniforms:Gr([dt.common,dt.bumpmap,dt.normalmap,dt.displacementmap,{opacity:{value:1}}]),vertexShader:Kt.meshnormal_vert,fragmentShader:Kt.meshnormal_frag},sprite:{uniforms:Gr([dt.sprite,dt.fog]),vertexShader:Kt.sprite_vert,fragmentShader:Kt.sprite_frag},background:{uniforms:{uvTransform:{value:new Wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Kt.background_vert,fragmentShader:Kt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Wt}},vertexShader:Kt.backgroundCube_vert,fragmentShader:Kt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Kt.cube_vert,fragmentShader:Kt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Kt.equirect_vert,fragmentShader:Kt.equirect_frag},distanceRGBA:{uniforms:Gr([dt.common,dt.displacementmap,{referencePosition:{value:new ee},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Kt.distanceRGBA_vert,fragmentShader:Kt.distanceRGBA_frag},shadow:{uniforms:Gr([dt.lights,dt.fog,{color:{value:new _t(0)},opacity:{value:1}}]),vertexShader:Kt.shadow_vert,fragmentShader:Kt.shadow_frag}};ko.physical={uniforms:Gr([ko.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Wt},clearcoatNormalScale:{value:new Je(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Wt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Wt},sheen:{value:0},sheenColor:{value:new _t(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Wt},transmissionSamplerSize:{value:new Je},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Wt},attenuationDistance:{value:0},attenuationColor:{value:new _t(0)},specularColor:{value:new _t(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Wt},anisotropyVector:{value:new Je},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Wt}}]),vertexShader:Kt.meshphysical_vert,fragmentShader:Kt.meshphysical_frag};const Xx={r:0,b:0,g:0},Ku=new Vs,ype=new Dt;function _pe(n,e,t,i,r,s,o){const a=new _t(0);let l=s===!0?0:1,c,u,h=null,d=0,f=null;function v(S){let x=S.isScene===!0?S.background:null;return x&&x.isTexture&&(x=(S.backgroundBlurriness>0?t:e).get(x)),x}function _(S){let x=!1;const M=v(S);M===null?m(a,l):M&&M.isColor&&(m(M,1),x=!0);const R=n.xr.getEnvironmentBlendMode();R==="additive"?i.buffers.color.setClear(0,0,0,1,o):R==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||x)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function y(S,x){const M=v(x);M&&(M.isCubeTexture||M.mapping===cm)?(u===void 0&&(u=new Li(new wd(1,1,1),new Ko({name:"BackgroundCubeMaterial",uniforms:Yp(ko.backgroundCube.uniforms),vertexShader:ko.backgroundCube.vertexShader,fragmentShader:ko.backgroundCube.fragmentShader,side:qr,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(R,T,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Ku.copy(x.backgroundRotation),Ku.x*=-1,Ku.y*=-1,Ku.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Ku.y*=-1,Ku.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=x.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(ype.makeRotationFromEuler(Ku)),u.material.toneMapped=Mn.getTransfer(M.colorSpace)!==kn,(h!==M||d!==M.version||f!==n.toneMapping)&&(u.material.needsUpdate=!0,h=M,d=M.version,f=n.toneMapping),u.layers.enableAll(),S.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new Li(new dm(2,2),new Ko({name:"BackgroundMaterial",uniforms:Yp(ko.background.uniforms),vertexShader:ko.background.vertexShader,fragmentShader:ko.background.fragmentShader,side:Fl,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=x.backgroundIntensity,c.material.toneMapped=Mn.getTransfer(M.colorSpace)!==kn,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(h!==M||d!==M.version||f!==n.toneMapping)&&(c.material.needsUpdate=!0,h=M,d=M.version,f=n.toneMapping),c.layers.enableAll(),S.unshift(c,c.geometry,c.material,0,0,null))}function m(S,x){S.getRGB(Xx,y6(n)),i.buffers.color.setClear(Xx.r,Xx.g,Xx.b,x,o)}return{getClearColor:function(){return a},setClearColor:function(S,x=1){a.set(S),l=x,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(S){l=S,m(a,l)},render:_,addToRenderList:y}}function xpe(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=d(null);let s=r,o=!1;function a(w,N,G,V,$){let Z=!1;const X=h(V,G,N);s!==X&&(s=X,c(s.object)),Z=f(w,V,G,$),Z&&v(w,V,G,$),$!==null&&e.update($,n.ELEMENT_ARRAY_BUFFER),(Z||o)&&(o=!1,M(w,N,G,V),$!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get($).buffer))}function l(){return n.createVertexArray()}function c(w){return n.bindVertexArray(w)}function u(w){return n.deleteVertexArray(w)}function h(w,N,G){const V=G.wireframe===!0;let $=i[w.id];$===void 0&&($={},i[w.id]=$);let Z=$[N.id];Z===void 0&&(Z={},$[N.id]=Z);let X=Z[V];return X===void 0&&(X=d(l()),Z[V]=X),X}function d(w){const N=[],G=[],V=[];for(let $=0;$=0){const te=$[O];let le=Z[O];if(le===void 0&&(O==="instanceMatrix"&&w.instanceMatrix&&(le=w.instanceMatrix),O==="instanceColor"&&w.instanceColor&&(le=w.instanceColor)),te===void 0||te.attribute!==le||le&&te.data!==le.data)return!0;X++}return s.attributesNum!==X||s.index!==V}function v(w,N,G,V){const $={},Z=N.attributes;let X=0;const re=G.getAttributes();for(const O in re)if(re[O].location>=0){let te=Z[O];te===void 0&&(O==="instanceMatrix"&&w.instanceMatrix&&(te=w.instanceMatrix),O==="instanceColor"&&w.instanceColor&&(te=w.instanceColor));const le={};le.attribute=te,te&&te.data&&(le.data=te.data),$[O]=le,X++}s.attributes=$,s.attributesNum=X,s.index=V}function _(){const w=s.newAttributes;for(let N=0,G=w.length;N=0){let Q=$[re];if(Q===void 0&&(re==="instanceMatrix"&&w.instanceMatrix&&(Q=w.instanceMatrix),re==="instanceColor"&&w.instanceColor&&(Q=w.instanceColor)),Q!==void 0){const te=Q.normalized,le=Q.itemSize,we=e.get(Q);if(we===void 0)continue;const Ne=we.buffer,q=we.type,fe=we.bytesPerElement,Te=q===n.INT||q===n.UNSIGNED_INT||Q.gpuType===YA;if(Q.isInterleavedBufferAttribute){const Se=Q.data,$e=Se.stride,Qe=Q.offset;if(Se.isInstancedInterleavedBuffer){for(let je=0;je0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),f=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),_=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),y=n.getParameter(n.MAX_VERTEX_ATTRIBS),m=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),S=n.getParameter(n.MAX_VARYING_VECTORS),x=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),M=f>0,R=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:f,maxTextureSize:v,maxCubemapSize:_,maxAttributes:y,maxVertexUniforms:m,maxVaryings:S,maxFragmentUniforms:x,vertexTextures:M,maxSamples:R}}function Ape(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Ec,a=new Wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d){const f=h.length!==0||d||i!==0||r;return r=d,i=h.length,f},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,d){t=u(h,d,0)},this.setState=function(h,d,f){const v=h.clippingPlanes,_=h.clipIntersection,y=h.clipShadows,m=n.get(h);if(!r||v===null||v.length===0||s&&!y)s?u(null):c();else{const S=s?0:i,x=S*4;let M=m.clippingState||null;l.value=M,M=u(v,d,x,f);for(let R=0;R!==x;++R)M[R]=t[R];m.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,d,f,v){const _=h!==null?h.length:0;let y=null;if(_!==0){if(y=l.value,v!==!0||y===null){const m=f+_*4,S=d.matrixWorldInverse;a.getNormalMatrix(S),(y===null||y.length0){const c=new S6(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class sw extends rw{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const ap=4,tk=[.125,.215,.35,.446,.526,.582],vh=20,Hb=new sw,nk=new _t;let Vb=null,Wb=0,$b=0,Xb=!1;const mh=(1+Math.sqrt(5))/2,Ef=1/mh,ik=[new ee(-mh,Ef,0),new ee(mh,Ef,0),new ee(-Ef,0,mh),new ee(Ef,0,mh),new ee(0,mh,-Ef),new ee(0,mh,Ef),new ee(-1,1,-1),new ee(1,1,-1),new ee(-1,1,1),new ee(1,1,1)];class pP{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Vb=this._renderer.getRenderTarget(),Wb=this._renderer.getActiveCubeFace(),$b=this._renderer.getActiveMipmapLevel(),Xb=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=ok(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=sk(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(r),_&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=d,u.autoClear=h,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Ol||e.mapping===Zc;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=ok()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=sk());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new Li(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;jx(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Hb)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;svh&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${vh}`);const m=[];let S=0;for(let P=0;Px-ap?r-x+ap:0),T=4*(this._cubeSize-M);jx(t,R,T,3*M,2*M),l.setRenderTarget(t),l.render(h,Hb)}}function Epe(n){const e=[],t=[],i=[];let r=n;const s=n-ap+1+tk.length;for(let o=0;on-ap?l=tk[o-n+ap-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],f=6,v=6,_=3,y=2,m=1,S=new Float32Array(_*v*f),x=new Float32Array(y*v*f),M=new Float32Array(m*v*f);for(let T=0;T2?0:-1,b=[P,I,0,P+2/3,I,0,P+2/3,I+1,0,P,I,0,P+2/3,I+1,0,P,I+1,0];S.set(b,_*v*T),x.set(d,y*v*T);const w=[T,T,T,T,T,T];M.set(w,m*v*T)}const R=new tn;R.setAttribute("position",new Nn(S,_)),R.setAttribute("uv",new Nn(x,y)),R.setAttribute("faceIndex",new Nn(M,m)),e.push(R),r>ap&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function rk(n,e,t){const i=new Jo(n,e,t);return i.texture.mapping=cm,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function jx(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function Tpe(n,e,t){const i=new Float32Array(vh),r=new ee(0,1,0);return new Ko({name:"SphericalGaussianBlur",defines:{n:vh,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:UL(),fragmentShader:` precision mediump float; precision mediump int; @@ -7619,7 +7619,7 @@ void main() { } } - `,blending:bl,depthTest:!1,depthWrite:!1})}function nk(){return new Ko({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:DL(),fragmentShader:` + `,blending:bl,depthTest:!1,depthWrite:!1})}function sk(){return new Ko({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:UL(),fragmentShader:` precision mediump float; precision mediump int; @@ -7638,7 +7638,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:bl,depthTest:!1,depthWrite:!1})}function ik(){return new Ko({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:DL(),fragmentShader:` + `,blending:bl,depthTest:!1,depthWrite:!1})}function ok(){return new Ko({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:UL(),fragmentShader:` precision mediump float; precision mediump int; @@ -7654,7 +7654,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:bl,depthTest:!1,depthWrite:!1})}function DL(){return` + `,blending:bl,depthTest:!1,depthWrite:!1})}function UL(){return` precision mediump float; precision mediump int; @@ -7709,16 +7709,16 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function Ape(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===i0||l===r0,u=l===kl||l===Zc;if(c||u){let h=e.get(a);const d=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return t===null&&(t=new mP(n)),h=c?t.fromEquirectangular(a,h):t.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),h.texture;if(h!==void 0)return h.texture;{const f=a.image;return c&&f&&f.height>0||u&&f&&r(f)?(t===null&&(t=new mP(n)),h=c?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(R=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const T=new Float32Array(M*R*4*h),P=new rw(T,M,R,h);P.type=us,P.needsUpdate=!0;const I=x*4;for(let w=0;w0)return n;const r=e*t;let s=sk[r];if(s===void 0&&(s=new Float32Array(r),sk[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Gi(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||u&&f&&r(f)?(t===null&&(t=new pP(n)),h=c?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(R=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const T=new Float32Array(M*R*4*h),P=new nw(T,M,R,h);P.type=us,P.needsUpdate=!0;const I=x*4;for(let w=0;w0)return n;const r=e*t;let s=lk[r];if(s===void 0&&(s=new Float32Array(r),lk[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Gi(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}function Ame(n){const e=Mn.getPrimaries(Mn.workingColorSpace),t=Mn.getPrimaries(n);let i;switch(e===t?i="":e===h0&&t===u0?i="LinearDisplayP3ToLinearSRGB":e===u0&&t===h0&&(i="LinearSRGBToLinearDisplayP3"),n){case Wl:case ly:return[i,"LinearTransferOETF"];case lo:case iw:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function dk(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` +`)}function bme(n){const e=Mn.getPrimaries(Mn.workingColorSpace),t=Mn.getPrimaries(n);let i;switch(e===t?i="":e===h0&&t===u0?i="LinearDisplayP3ToLinearSRGB":e===u0&&t===h0&&(i="LinearSRGBToLinearDisplayP3"),n){case Vl:case ay:return[i,"LinearTransferOETF"];case lo:case tw:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function mk(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+r+` -`+Mme(n.getShaderSource(e),o)}else return r}function wme(n,e){const t=Ame(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function Eme(n,e){let t;switch(e){case HW:t="Linear";break;case VW:t="Reinhard";break;case WW:t="Cineon";break;case $W:t="ACESFilmic";break;case jW:t="AgX";break;case YW:t="Neutral";break;case XW:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Jx=new ee;function Tme(){Mn.getLuminanceCoefficients(Jx);const n=Jx.x.toFixed(4),e=Jx.y.toFixed(4),t=Jx.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` -`)}function bme(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Og).join(` -`)}function Cme(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function Rme(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function gP(n){return n.replace(Pme,Lme)}const Ime=new Map;function Lme(n,e){let t=Kt[e];if(t===void 0){const i=Ime.get(e);if(i!==void 0)t=Kt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return gP(t)}const Dme=/#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 mk(n){return n.replace(Dme,Bme)}function Bme(n,e,t,i){let r="";for(let s=parseInt(e);s/gm;function mP(n){return n.replace(Bme,Ume)}const Nme=new Map;function Ume(n,e){let t=Kt[e];if(t===void 0){const i=Nme.get(e);if(i!==void 0)t=Kt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return mP(t)}const Fme=/#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 yk(n){return n.replace(Fme,Ome)}function Ome(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(y+=` -`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Og).join(` +`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(kg).join(` `),m.length>0&&(m+=` -`)):(y=[gk(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.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"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(Og).join(` -`),m=[gk(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Cl?"#define TONE_MAPPING":"",t.toneMapping!==Cl?Kt.tonemapping_pars_fragment:"",t.toneMapping!==Cl?Eme("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Kt.colorspace_pars_fragment,wme("linearToOutputTexel",t.outputColorSpace),Tme(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(Og).join(` -`)),o=gP(o),o=fk(o,t),o=pk(o,t),a=gP(a),a=fk(a,t),a=pk(a,t),o=mk(o),a=mk(a),t.isRawShaderMaterial!==!0&&(S=`#version 300 es +`)):(y=[_k(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.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"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(kg).join(` +`),m=[_k(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Cl?"#define TONE_MAPPING":"",t.toneMapping!==Cl?Kt.tonemapping_pars_fragment:"",t.toneMapping!==Cl?Rme("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Kt.colorspace_pars_fragment,Cme("linearToOutputTexel",t.outputColorSpace),Pme(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(kg).join(` +`)),o=mP(o),o=gk(o,t),o=vk(o,t),a=mP(a),a=gk(a,t),a=vk(a,t),o=yk(o),a=yk(a),t.isRawShaderMaterial!==!0&&(S=`#version 300 es `,y=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+y,m=["#define varying in",t.glslVersion===pP?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===pP?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+y,m=["#define varying in",t.glslVersion===fP?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===fP?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+m);const x=S+y+o,M=S+m+a,R=hk(r,r.VERTEX_SHADER,x),T=hk(r,r.FRAGMENT_SHADER,M);r.attachShader(_,R),r.attachShader(_,T),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function P(N){if(n.debug.checkShaderErrors){const G=r.getProgramInfoLog(_).trim(),V=r.getShaderInfoLog(R).trim(),$=r.getShaderInfoLog(T).trim();let Z=!0,X=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(Z=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,R,T);else{const re=dk(r,R,"vertex"),O=dk(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` +`+m);const x=S+y+o,M=S+m+a,R=pk(r,r.VERTEX_SHADER,x),T=pk(r,r.FRAGMENT_SHADER,M);r.attachShader(_,R),r.attachShader(_,T),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function P(N){if(n.debug.checkShaderErrors){const G=r.getProgramInfoLog(_).trim(),V=r.getShaderInfoLog(R).trim(),$=r.getShaderInfoLog(T).trim();let Z=!0,X=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(Z=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,_,R,T);else{const re=mk(r,R,"vertex"),O=mk(r,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` Material Name: `+N.name+` Material Type: `+N.type+` Program Info Log: `+G+` `+re+` -`+O)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(V===""||$==="")&&(X=!1);X&&(N.diagnostics={runnable:Z,programLog:G,vertexShader:{log:V,prefix:y},fragmentShader:{log:$,prefix:m}})}r.deleteShader(R),r.deleteShader(T),I=new K1(r,_),b=Rme(r,_)}let I;this.getUniforms=function(){return I===void 0&&P(this),I};let b;this.getAttributes=function(){return b===void 0&&P(this),b};let w=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=r.getProgramParameter(_,xme)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Sme++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=R,this.fragmentShader=T,this}let Gme=0;class Hme{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new Vme(e),t.set(e,i)),i}}class Vme{constructor(e){this.id=Gme++,this.code=e,this.usedTimes=0}}function Wme(n,e,t,i,r,s,o){const a=new sw,l=new Hme,c=new Set,u=[],h=r.logarithmicDepthBuffer,d=r.vertexTextures;let f=r.precision;const v={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 _(b){return c.add(b),b===0?"uv":`uv${b}`}function y(b,w,N,G,V){const $=G.fog,Z=V.geometry,X=b.isMeshStandardMaterial?G.environment:null,re=(b.isMeshStandardMaterial?t:e).get(b.envMap||X),O=re&&re.mapping===lm?re.image.height:null,Q=v[b.type];b.precision!==null&&(f=r.getMaxPrecision(b.precision),f!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const te=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,le=te!==void 0?te.length:0;let we=0;Z.morphAttributes.position!==void 0&&(we=1),Z.morphAttributes.normal!==void 0&&(we=2),Z.morphAttributes.color!==void 0&&(we=3);let Ne,q,fe,Te;if(Q){const vt=ko[Q];Ne=vt.vertexShader,q=vt.fragmentShader}else Ne=b.vertexShader,q=b.fragmentShader,l.update(b),fe=l.getVertexShaderID(b),Te=l.getFragmentShaderID(b);const Se=n.getRenderTarget(),$e=V.isInstancedMesh===!0,Qe=V.isBatchedMesh===!0,je=!!b.map,Ke=!!b.matcap,B=!!re,me=!!b.aoMap,ge=!!b.lightMap,Re=!!b.bumpMap,ae=!!b.normalMap,Xe=!!b.displacementMap,Ce=!!b.emissiveMap,De=!!b.metalnessMap,U=!!b.roughnessMap,C=b.anisotropy>0,Y=b.clearcoat>0,ue=b.dispersion>0,ce=b.iridescence>0,de=b.sheen>0,Ye=b.transmission>0,Ae=C&&!!b.anisotropyMap,Ue=Y&&!!b.clearcoatMap,st=Y&&!!b.clearcoatNormalMap,_e=Y&&!!b.clearcoatRoughnessMap,Ie=ce&&!!b.iridescenceMap,pt=ce&&!!b.iridescenceThicknessMap,nt=de&&!!b.sheenColorMap,ke=de&&!!b.sheenRoughnessMap,ie=!!b.specularMap,be=!!b.specularColorMap,et=!!b.specularIntensityMap,z=Ye&&!!b.transmissionMap,ve=Ye&&!!b.thicknessMap,oe=!!b.gradientMap,he=!!b.alphaMap,Ee=b.alphaTest>0,Ze=!!b.alphaHash,lt=!!b.extensions;let Ct=Cl;b.toneMapped&&(Se===null||Se.isXRRenderTarget===!0)&&(Ct=n.toneMapping);const zt={shaderID:Q,shaderType:b.type,shaderName:b.name,vertexShader:Ne,fragmentShader:q,defines:b.defines,customVertexShaderID:fe,customFragmentShaderID:Te,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:Qe,batchingColor:Qe&&V._colorsTexture!==null,instancing:$e,instancingColor:$e&&V.instanceColor!==null,instancingMorph:$e&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:Se===null?n.outputColorSpace:Se.isXRRenderTarget===!0?Se.texture.colorSpace:Wl,alphaToCoverage:!!b.alphaToCoverage,map:je,matcap:Ke,envMap:B,envMapMode:B&&re.mapping,envMapCubeUVHeight:O,aoMap:me,lightMap:ge,bumpMap:Re,normalMap:ae,displacementMap:d&&Xe,emissiveMap:Ce,normalMapObjectSpace:ae&&b.normalMapType===t6,normalMapTangentSpace:ae&&b.normalMapType===mu,metalnessMap:De,roughnessMap:U,anisotropy:C,anisotropyMap:Ae,clearcoat:Y,clearcoatMap:Ue,clearcoatNormalMap:st,clearcoatRoughnessMap:_e,dispersion:ue,iridescence:ce,iridescenceMap:Ie,iridescenceThicknessMap:pt,sheen:de,sheenColorMap:nt,sheenRoughnessMap:ke,specularMap:ie,specularColorMap:be,specularIntensityMap:et,transmission:Ye,transmissionMap:z,thicknessMap:ve,gradientMap:oe,opaque:b.transparent===!1&&b.blending===$h&&b.alphaToCoverage===!1,alphaMap:he,alphaTest:Ee,alphaHash:Ze,combine:b.combine,mapUv:je&&_(b.map.channel),aoMapUv:me&&_(b.aoMap.channel),lightMapUv:ge&&_(b.lightMap.channel),bumpMapUv:Re&&_(b.bumpMap.channel),normalMapUv:ae&&_(b.normalMap.channel),displacementMapUv:Xe&&_(b.displacementMap.channel),emissiveMapUv:Ce&&_(b.emissiveMap.channel),metalnessMapUv:De&&_(b.metalnessMap.channel),roughnessMapUv:U&&_(b.roughnessMap.channel),anisotropyMapUv:Ae&&_(b.anisotropyMap.channel),clearcoatMapUv:Ue&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:st&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_e&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ie&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:pt&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:ke&&_(b.sheenRoughnessMap.channel),specularMapUv:ie&&_(b.specularMap.channel),specularColorMapUv:be&&_(b.specularColorMap.channel),specularIntensityMapUv:et&&_(b.specularIntensityMap.channel),transmissionMapUv:z&&_(b.transmissionMap.channel),thicknessMapUv:ve&&_(b.thicknessMap.channel),alphaMapUv:he&&_(b.alphaMap.channel),vertexTangents:!!Z.attributes.tangent&&(ae||C),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!Z.attributes.uv&&(je||he),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:V.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:we,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&N.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ct,decodeVideoTexture:je&&b.map.isVideoTexture===!0&&Mn.getTransfer(b.map.colorSpace)===kn,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Ma,flipSided:b.side===qr,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:lt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(lt&&b.extensions.multiDraw===!0||Qe)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return zt.vertexUv1s=c.has(1),zt.vertexUv2s=c.has(2),zt.vertexUv3s=c.has(3),c.clear(),zt}function m(b){const w=[];if(b.shaderID?w.push(b.shaderID):(w.push(b.customVertexShaderID),w.push(b.customFragmentShaderID)),b.defines!==void 0)for(const N in b.defines)w.push(N),w.push(b.defines[N]);return b.isRawShaderMaterial===!1&&(S(w,b),x(w,b),w.push(n.outputColorSpace)),w.push(b.customProgramCacheKey),w.join()}function S(b,w){b.push(w.precision),b.push(w.outputColorSpace),b.push(w.envMapMode),b.push(w.envMapCubeUVHeight),b.push(w.mapUv),b.push(w.alphaMapUv),b.push(w.lightMapUv),b.push(w.aoMapUv),b.push(w.bumpMapUv),b.push(w.normalMapUv),b.push(w.displacementMapUv),b.push(w.emissiveMapUv),b.push(w.metalnessMapUv),b.push(w.roughnessMapUv),b.push(w.anisotropyMapUv),b.push(w.clearcoatMapUv),b.push(w.clearcoatNormalMapUv),b.push(w.clearcoatRoughnessMapUv),b.push(w.iridescenceMapUv),b.push(w.iridescenceThicknessMapUv),b.push(w.sheenColorMapUv),b.push(w.sheenRoughnessMapUv),b.push(w.specularMapUv),b.push(w.specularColorMapUv),b.push(w.specularIntensityMapUv),b.push(w.transmissionMapUv),b.push(w.thicknessMapUv),b.push(w.combine),b.push(w.fogExp2),b.push(w.sizeAttenuation),b.push(w.morphTargetsCount),b.push(w.morphAttributeCount),b.push(w.numDirLights),b.push(w.numPointLights),b.push(w.numSpotLights),b.push(w.numSpotLightMaps),b.push(w.numHemiLights),b.push(w.numRectAreaLights),b.push(w.numDirLightShadows),b.push(w.numPointLightShadows),b.push(w.numSpotLightShadows),b.push(w.numSpotLightShadowsWithMaps),b.push(w.numLightProbes),b.push(w.shadowMapType),b.push(w.toneMapping),b.push(w.numClippingPlanes),b.push(w.numClipIntersection),b.push(w.depthPacking)}function x(b,w){a.disableAll(),w.supportsVertexTextures&&a.enable(0),w.instancing&&a.enable(1),w.instancingColor&&a.enable(2),w.instancingMorph&&a.enable(3),w.matcap&&a.enable(4),w.envMap&&a.enable(5),w.normalMapObjectSpace&&a.enable(6),w.normalMapTangentSpace&&a.enable(7),w.clearcoat&&a.enable(8),w.iridescence&&a.enable(9),w.alphaTest&&a.enable(10),w.vertexColors&&a.enable(11),w.vertexAlphas&&a.enable(12),w.vertexUv1s&&a.enable(13),w.vertexUv2s&&a.enable(14),w.vertexUv3s&&a.enable(15),w.vertexTangents&&a.enable(16),w.anisotropy&&a.enable(17),w.alphaHash&&a.enable(18),w.batching&&a.enable(19),w.dispersion&&a.enable(20),w.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.skinning&&a.enable(4),w.morphTargets&&a.enable(5),w.morphNormals&&a.enable(6),w.morphColors&&a.enable(7),w.premultipliedAlpha&&a.enable(8),w.shadowMapEnabled&&a.enable(9),w.doubleSided&&a.enable(10),w.flipSided&&a.enable(11),w.useDepthPacking&&a.enable(12),w.dithering&&a.enable(13),w.transmission&&a.enable(14),w.sheen&&a.enable(15),w.opaque&&a.enable(16),w.pointsUvs&&a.enable(17),w.decodeVideoTexture&&a.enable(18),w.alphaToCoverage&&a.enable(19),b.push(a.mask)}function M(b){const w=v[b.type];let N;if(w){const G=ko[w];N=m6.clone(G.uniforms)}else N=b.uniforms;return N}function R(b,w){let N;for(let G=0,V=u.length;G0?i.push(m):f.transparent===!0?r.push(m):t.push(m)}function l(h,d,f,v,_,y){const m=o(h,d,f,v,_,y);f.transmission>0?i.unshift(m):f.transparent===!0?r.unshift(m):t.unshift(m)}function c(h,d){t.length>1&&t.sort(h||Xme),i.length>1&&i.sort(d||vk),r.length>1&&r.sort(d||vk)}function u(){for(let h=e,d=n.length;h=s.length?(o=new yk,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Yme(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ee,color:new _t};break;case"SpotLight":t={position:new ee,direction:new ee,color:new _t,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ee,color:new _t,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ee,skyColor:new _t,groundColor:new _t};break;case"RectAreaLight":t={color:new _t,position:new ee,halfWidth:new ee,halfHeight:new ee};break}return n[e.id]=t,t}}}function Jme(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let Kme=0;function qme(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function Zme(n){const e=new Yme,t=Jme(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new ee);const r=new ee,s=new Dt,o=new Dt;function a(c){let u=0,h=0,d=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let f=0,v=0,_=0,y=0,m=0,S=0,x=0,M=0,R=0,T=0,P=0;c.sort(qme);for(let b=0,w=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=dt.LTC_FLOAT_1,i.rectAreaLTC2=dt.LTC_FLOAT_2):(i.rectAreaLTC1=dt.LTC_HALF_1,i.rectAreaLTC2=dt.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=d;const I=i.hash;(I.directionalLength!==f||I.pointLength!==v||I.spotLength!==_||I.rectAreaLength!==y||I.hemiLength!==m||I.numDirectionalShadows!==S||I.numPointShadows!==x||I.numSpotShadows!==M||I.numSpotMaps!==R||I.numLightProbes!==P)&&(i.directional.length=f,i.spot.length=_,i.rectArea.length=y,i.point.length=v,i.hemi.length=m,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=M+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=P,I.directionalLength=f,I.pointLength=v,I.spotLength=_,I.rectAreaLength=y,I.hemiLength=m,I.numDirectionalShadows=S,I.numPointShadows=x,I.numSpotShadows=M,I.numSpotMaps=R,I.numLightProbes=P,i.version=Kme++)}function l(c,u){let h=0,d=0,f=0,v=0,_=0;const y=u.matrixWorldInverse;for(let m=0,S=c.length;m=o.length?(a=new _k(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}class NL extends Br{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=QW,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 UL extends Br{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const ege=`void main() { +`+O)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(V===""||$==="")&&(X=!1);X&&(N.diagnostics={runnable:Z,programLog:G,vertexShader:{log:V,prefix:y},fragmentShader:{log:$,prefix:m}})}r.deleteShader(R),r.deleteShader(T),I=new J1(r,_),b=Dme(r,_)}let I;this.getUniforms=function(){return I===void 0&&P(this),I};let b;this.getAttributes=function(){return b===void 0&&P(this),b};let w=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=r.getProgramParameter(_,wme)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=Eme++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=R,this.fragmentShader=T,this}let $me=0;class Xme{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new jme(e),t.set(e,i)),i}}class jme{constructor(e){this.id=$me++,this.code=e,this.usedTimes=0}}function Yme(n,e,t,i,r,s,o){const a=new iw,l=new Xme,c=new Set,u=[],h=r.logarithmicDepthBuffer,d=r.vertexTextures;let f=r.precision;const v={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 _(b){return c.add(b),b===0?"uv":`uv${b}`}function y(b,w,N,G,V){const $=G.fog,Z=V.geometry,X=b.isMeshStandardMaterial?G.environment:null,re=(b.isMeshStandardMaterial?t:e).get(b.envMap||X),O=re&&re.mapping===cm?re.image.height:null,Q=v[b.type];b.precision!==null&&(f=r.getMaxPrecision(b.precision),f!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",f,"instead."));const te=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,le=te!==void 0?te.length:0;let we=0;Z.morphAttributes.position!==void 0&&(we=1),Z.morphAttributes.normal!==void 0&&(we=2),Z.morphAttributes.color!==void 0&&(we=3);let Ne,q,fe,Te;if(Q){const vt=ko[Q];Ne=vt.vertexShader,q=vt.fragmentShader}else Ne=b.vertexShader,q=b.fragmentShader,l.update(b),fe=l.getVertexShaderID(b),Te=l.getFragmentShaderID(b);const Se=n.getRenderTarget(),$e=V.isInstancedMesh===!0,Qe=V.isBatchedMesh===!0,je=!!b.map,Ke=!!b.matcap,B=!!re,me=!!b.aoMap,ge=!!b.lightMap,Re=!!b.bumpMap,ae=!!b.normalMap,Xe=!!b.displacementMap,Ce=!!b.emissiveMap,De=!!b.metalnessMap,U=!!b.roughnessMap,C=b.anisotropy>0,Y=b.clearcoat>0,ue=b.dispersion>0,ce=b.iridescence>0,de=b.sheen>0,Ye=b.transmission>0,Ae=C&&!!b.anisotropyMap,Ue=Y&&!!b.clearcoatMap,st=Y&&!!b.clearcoatNormalMap,_e=Y&&!!b.clearcoatRoughnessMap,Ie=ce&&!!b.iridescenceMap,pt=ce&&!!b.iridescenceThicknessMap,nt=de&&!!b.sheenColorMap,ke=de&&!!b.sheenRoughnessMap,ie=!!b.specularMap,be=!!b.specularColorMap,et=!!b.specularIntensityMap,z=Ye&&!!b.transmissionMap,ve=Ye&&!!b.thicknessMap,oe=!!b.gradientMap,he=!!b.alphaMap,Ee=b.alphaTest>0,Ze=!!b.alphaHash,lt=!!b.extensions;let Ct=Cl;b.toneMapped&&(Se===null||Se.isXRRenderTarget===!0)&&(Ct=n.toneMapping);const zt={shaderID:Q,shaderType:b.type,shaderName:b.name,vertexShader:Ne,fragmentShader:q,defines:b.defines,customVertexShaderID:fe,customFragmentShaderID:Te,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:f,batching:Qe,batchingColor:Qe&&V._colorsTexture!==null,instancing:$e,instancingColor:$e&&V.instanceColor!==null,instancingMorph:$e&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:Se===null?n.outputColorSpace:Se.isXRRenderTarget===!0?Se.texture.colorSpace:Vl,alphaToCoverage:!!b.alphaToCoverage,map:je,matcap:Ke,envMap:B,envMapMode:B&&re.mapping,envMapCubeUVHeight:O,aoMap:me,lightMap:ge,bumpMap:Re,normalMap:ae,displacementMap:d&&Xe,emissiveMap:Ce,normalMapObjectSpace:ae&&b.normalMapType===s6,normalMapTangentSpace:ae&&b.normalMapType===mu,metalnessMap:De,roughnessMap:U,anisotropy:C,anisotropyMap:Ae,clearcoat:Y,clearcoatMap:Ue,clearcoatNormalMap:st,clearcoatRoughnessMap:_e,dispersion:ue,iridescence:ce,iridescenceMap:Ie,iridescenceThicknessMap:pt,sheen:de,sheenColorMap:nt,sheenRoughnessMap:ke,specularMap:ie,specularColorMap:be,specularIntensityMap:et,transmission:Ye,transmissionMap:z,thicknessMap:ve,gradientMap:oe,opaque:b.transparent===!1&&b.blending===$h&&b.alphaToCoverage===!1,alphaMap:he,alphaTest:Ee,alphaHash:Ze,combine:b.combine,mapUv:je&&_(b.map.channel),aoMapUv:me&&_(b.aoMap.channel),lightMapUv:ge&&_(b.lightMap.channel),bumpMapUv:Re&&_(b.bumpMap.channel),normalMapUv:ae&&_(b.normalMap.channel),displacementMapUv:Xe&&_(b.displacementMap.channel),emissiveMapUv:Ce&&_(b.emissiveMap.channel),metalnessMapUv:De&&_(b.metalnessMap.channel),roughnessMapUv:U&&_(b.roughnessMap.channel),anisotropyMapUv:Ae&&_(b.anisotropyMap.channel),clearcoatMapUv:Ue&&_(b.clearcoatMap.channel),clearcoatNormalMapUv:st&&_(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_e&&_(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ie&&_(b.iridescenceMap.channel),iridescenceThicknessMapUv:pt&&_(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&_(b.sheenColorMap.channel),sheenRoughnessMapUv:ke&&_(b.sheenRoughnessMap.channel),specularMapUv:ie&&_(b.specularMap.channel),specularColorMapUv:be&&_(b.specularColorMap.channel),specularIntensityMapUv:et&&_(b.specularIntensityMap.channel),transmissionMapUv:z&&_(b.transmissionMap.channel),thicknessMapUv:ve&&_(b.thicknessMap.channel),alphaMapUv:he&&_(b.alphaMap.channel),vertexTangents:!!Z.attributes.tangent&&(ae||C),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!Z.attributes.uv&&(je||he),fog:!!$,useFog:b.fog===!0,fogExp2:!!$&&$.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:V.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:le,morphTextureStride:we,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&N.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ct,decodeVideoTexture:je&&b.map.isVideoTexture===!0&&Mn.getTransfer(b.map.colorSpace)===kn,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Ma,flipSided:b.side===qr,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:lt&&b.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(lt&&b.extensions.multiDraw===!0||Qe)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return zt.vertexUv1s=c.has(1),zt.vertexUv2s=c.has(2),zt.vertexUv3s=c.has(3),c.clear(),zt}function m(b){const w=[];if(b.shaderID?w.push(b.shaderID):(w.push(b.customVertexShaderID),w.push(b.customFragmentShaderID)),b.defines!==void 0)for(const N in b.defines)w.push(N),w.push(b.defines[N]);return b.isRawShaderMaterial===!1&&(S(w,b),x(w,b),w.push(n.outputColorSpace)),w.push(b.customProgramCacheKey),w.join()}function S(b,w){b.push(w.precision),b.push(w.outputColorSpace),b.push(w.envMapMode),b.push(w.envMapCubeUVHeight),b.push(w.mapUv),b.push(w.alphaMapUv),b.push(w.lightMapUv),b.push(w.aoMapUv),b.push(w.bumpMapUv),b.push(w.normalMapUv),b.push(w.displacementMapUv),b.push(w.emissiveMapUv),b.push(w.metalnessMapUv),b.push(w.roughnessMapUv),b.push(w.anisotropyMapUv),b.push(w.clearcoatMapUv),b.push(w.clearcoatNormalMapUv),b.push(w.clearcoatRoughnessMapUv),b.push(w.iridescenceMapUv),b.push(w.iridescenceThicknessMapUv),b.push(w.sheenColorMapUv),b.push(w.sheenRoughnessMapUv),b.push(w.specularMapUv),b.push(w.specularColorMapUv),b.push(w.specularIntensityMapUv),b.push(w.transmissionMapUv),b.push(w.thicknessMapUv),b.push(w.combine),b.push(w.fogExp2),b.push(w.sizeAttenuation),b.push(w.morphTargetsCount),b.push(w.morphAttributeCount),b.push(w.numDirLights),b.push(w.numPointLights),b.push(w.numSpotLights),b.push(w.numSpotLightMaps),b.push(w.numHemiLights),b.push(w.numRectAreaLights),b.push(w.numDirLightShadows),b.push(w.numPointLightShadows),b.push(w.numSpotLightShadows),b.push(w.numSpotLightShadowsWithMaps),b.push(w.numLightProbes),b.push(w.shadowMapType),b.push(w.toneMapping),b.push(w.numClippingPlanes),b.push(w.numClipIntersection),b.push(w.depthPacking)}function x(b,w){a.disableAll(),w.supportsVertexTextures&&a.enable(0),w.instancing&&a.enable(1),w.instancingColor&&a.enable(2),w.instancingMorph&&a.enable(3),w.matcap&&a.enable(4),w.envMap&&a.enable(5),w.normalMapObjectSpace&&a.enable(6),w.normalMapTangentSpace&&a.enable(7),w.clearcoat&&a.enable(8),w.iridescence&&a.enable(9),w.alphaTest&&a.enable(10),w.vertexColors&&a.enable(11),w.vertexAlphas&&a.enable(12),w.vertexUv1s&&a.enable(13),w.vertexUv2s&&a.enable(14),w.vertexUv3s&&a.enable(15),w.vertexTangents&&a.enable(16),w.anisotropy&&a.enable(17),w.alphaHash&&a.enable(18),w.batching&&a.enable(19),w.dispersion&&a.enable(20),w.batchingColor&&a.enable(21),b.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.skinning&&a.enable(4),w.morphTargets&&a.enable(5),w.morphNormals&&a.enable(6),w.morphColors&&a.enable(7),w.premultipliedAlpha&&a.enable(8),w.shadowMapEnabled&&a.enable(9),w.doubleSided&&a.enable(10),w.flipSided&&a.enable(11),w.useDepthPacking&&a.enable(12),w.dithering&&a.enable(13),w.transmission&&a.enable(14),w.sheen&&a.enable(15),w.opaque&&a.enable(16),w.pointsUvs&&a.enable(17),w.decodeVideoTexture&&a.enable(18),w.alphaToCoverage&&a.enable(19),b.push(a.mask)}function M(b){const w=v[b.type];let N;if(w){const G=ko[w];N=_6.clone(G.uniforms)}else N=b.uniforms;return N}function R(b,w){let N;for(let G=0,V=u.length;G0?i.push(m):f.transparent===!0?r.push(m):t.push(m)}function l(h,d,f,v,_,y){const m=o(h,d,f,v,_,y);f.transmission>0?i.unshift(m):f.transparent===!0?r.unshift(m):t.unshift(m)}function c(h,d){t.length>1&&t.sort(h||Kme),i.length>1&&i.sort(d||xk),r.length>1&&r.sort(d||xk)}function u(){for(let h=e,d=n.length;h=s.length?(o=new Sk,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Zme(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new ee,color:new _t};break;case"SpotLight":t={position:new ee,direction:new ee,color:new _t,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new ee,color:new _t,distance:0,decay:0};break;case"HemisphereLight":t={direction:new ee,skyColor:new _t,groundColor:new _t};break;case"RectAreaLight":t={color:new _t,position:new ee,halfWidth:new ee,halfHeight:new ee};break}return n[e.id]=t,t}}}function Qme(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Je,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let ege=0;function tge(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function nge(n){const e=new Zme,t=Qme(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new ee);const r=new ee,s=new Dt,o=new Dt;function a(c){let u=0,h=0,d=0;for(let b=0;b<9;b++)i.probe[b].set(0,0,0);let f=0,v=0,_=0,y=0,m=0,S=0,x=0,M=0,R=0,T=0,P=0;c.sort(tge);for(let b=0,w=c.length;b0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=dt.LTC_FLOAT_1,i.rectAreaLTC2=dt.LTC_FLOAT_2):(i.rectAreaLTC1=dt.LTC_HALF_1,i.rectAreaLTC2=dt.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=h,i.ambient[2]=d;const I=i.hash;(I.directionalLength!==f||I.pointLength!==v||I.spotLength!==_||I.rectAreaLength!==y||I.hemiLength!==m||I.numDirectionalShadows!==S||I.numPointShadows!==x||I.numSpotShadows!==M||I.numSpotMaps!==R||I.numLightProbes!==P)&&(i.directional.length=f,i.spot.length=_,i.rectArea.length=y,i.point.length=v,i.hemi.length=m,i.directionalShadow.length=S,i.directionalShadowMap.length=S,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=S,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=M+R-T,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=P,I.directionalLength=f,I.pointLength=v,I.spotLength=_,I.rectAreaLength=y,I.hemiLength=m,I.numDirectionalShadows=S,I.numPointShadows=x,I.numSpotShadows=M,I.numSpotMaps=R,I.numLightProbes=P,i.version=ege++)}function l(c,u){let h=0,d=0,f=0,v=0,_=0;const y=u.matrixWorldInverse;for(let m=0,S=c.length;m=o.length?(a=new Mk(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}class OL extends Br{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=i6,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 kL extends Br{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const rge=`void main() { gl_Position = vec4( position, 1.0 ); -}`,tge=`uniform sampler2D shadow_pass; +}`,sge=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -7787,12 +7787,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function nge(n,e,t){let i=new uy;const r=new Je,s=new Je,o=new Cn,a=new NL({depthPacking:e6}),l=new UL,c={},u=t.maxTextureSize,h={[Ol]:qr,[qr]:Ol,[Ma]:Ma},d=new Ko({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Je},radius:{value:4}},vertexShader:ege,fragmentShader:tge}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const v=new tn;v.setAttribute("position",new Nn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Li(v,d),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=gL;let m=this.type;this.render=function(T,P,I){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||T.length===0)return;const b=n.getRenderTarget(),w=n.getActiveCubeFace(),N=n.getActiveMipmapLevel(),G=n.state;G.setBlending(bl),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=m!==_a&&this.type===_a,$=m===_a&&this.type!==_a;for(let Z=0,X=T.length;Zu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/Q.x),r.x=s.x*Q.x,O.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/Q.y),r.y=s.y*Q.y,O.mapSize.y=s.y)),O.map===null||V===!0||$===!0){const le=this.type!==_a?{minFilter:Ji,magFilter:Ji}:{};O.map!==null&&O.map.dispose(),O.map=new Jo(r.x,r.y,le),O.map.texture.name=re.name+".shadowMap",O.camera.updateProjectionMatrix()}n.setRenderTarget(O.map),n.clear();const te=O.getViewportCount();for(let le=0;le0||P.map&&P.alphaTest>0){const G=w.uuid,V=P.uuid;let $=c[G];$===void 0&&($={},c[G]=$);let Z=$[V];Z===void 0&&(Z=w.clone(),$[V]=Z,P.addEventListener("dispose",R)),w=Z}if(w.visible=P.visible,w.wireframe=P.wireframe,b===_a?w.side=P.shadowSide!==null?P.shadowSide:P.side:w.side=P.shadowSide!==null?P.shadowSide:h[P.side],w.alphaMap=P.alphaMap,w.alphaTest=P.alphaTest,w.map=P.map,w.clipShadows=P.clipShadows,w.clippingPlanes=P.clippingPlanes,w.clipIntersection=P.clipIntersection,w.displacementMap=P.displacementMap,w.displacementScale=P.displacementScale,w.displacementBias=P.displacementBias,w.wireframeLinewidth=P.wireframeLinewidth,w.linewidth=P.linewidth,I.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const G=n.properties.get(w);G.light=I}return w}function M(T,P,I,b,w){if(T.visible===!1)return;if(T.layers.test(P.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&w===_a)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,T.matrixWorld);const V=e.update(T),$=T.material;if(Array.isArray($)){const Z=V.groups;for(let X=0,re=Z.length;X=1):re.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(re)[1]),Z=X>=2);let O=null,Q={};const te=n.getParameter(n.SCISSOR_BOX),le=n.getParameter(n.VIEWPORT),we=new Cn().fromArray(te),Ne=new Cn().fromArray(le);function q(z,ve,oe,he){const Ee=new Uint8Array(4),Ze=n.createTexture();n.bindTexture(z,Ze),n.texParameteri(z,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(z,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let lt=0;lte?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function sge(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function oge(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function vP(n,e,t,i){const r=age(i);switch(t){case SL:return n*e;case AL:return n*e;case wL:return n*e*2;case QA:return n*e/r.components*r.byteLength;case ay:return n*e/r.components*r.byteLength;case EL:return n*e*2/r.components*r.byteLength;case ew:return n*e*2/r.components*r.byteLength;case ML:return n*e*3/r.components*r.byteLength;case Jr:return n*e*4/r.components*r.byteLength;case tw:return n*e*4/r.components*r.byteLength;case uv:case hv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case dv:case fv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case mM:case vM:return Math.max(n,16)*Math.max(e,8)/4;case pM:case gM:return Math.max(n,8)*Math.max(e,8)/2;case yM:case _M:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case xM:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case SM:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case MM:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case AM:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case wM:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case EM:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case TM:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case bM:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case CM:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case RM:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case PM:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case IM:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case LM:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case DM:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case BM:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case pv:case NM:case UM:return Math.ceil(n/4)*Math.ceil(e/4)*16;case TL:case FM:return Math.ceil(n/4)*Math.ceil(e/4)*8;case OM:case kM:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function age(n){switch(n){case Fa:case yL:return{byteLength:1,components:1};case $p:case _L:case cm:return{byteLength:2,components:1};case qA:case ZA:return{byteLength:2,components:4};case zl:case KA:case us:return{byteLength:4,components:1};case xL:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const lge={contain:rge,cover:sge,fill:oge,getByteLength:vP};function cge(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Je,u=new WeakMap;let h;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(U,C){return f?new OffscreenCanvas(U,C):p0("canvas")}function _(U,C,Y){let ue=1;const ce=De(U);if((ce.width>Y||ce.height>Y)&&(ue=Y/Math.max(ce.width,ce.height)),ue<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const de=Math.floor(ue*ce.width),Ye=Math.floor(ue*ce.height);h===void 0&&(h=v(de,Ye));const Ae=C?v(de,Ye):h;return Ae.width=de,Ae.height=Ye,Ae.getContext("2d").drawImage(U,0,0,de,Ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ce.width+"x"+ce.height+") to ("+de+"x"+Ye+")."),Ae}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ce.width+"x"+ce.height+")."),U;return U}function y(U){return U.generateMipmaps&&U.minFilter!==Ji&&U.minFilter!==Ii}function m(U){n.generateMipmap(U)}function S(U,C,Y,ue,ce=!1){if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let de=C;if(C===n.RED&&(Y===n.FLOAT&&(de=n.R32F),Y===n.HALF_FLOAT&&(de=n.R16F),Y===n.UNSIGNED_BYTE&&(de=n.R8)),C===n.RED_INTEGER&&(Y===n.UNSIGNED_BYTE&&(de=n.R8UI),Y===n.UNSIGNED_SHORT&&(de=n.R16UI),Y===n.UNSIGNED_INT&&(de=n.R32UI),Y===n.BYTE&&(de=n.R8I),Y===n.SHORT&&(de=n.R16I),Y===n.INT&&(de=n.R32I)),C===n.RG&&(Y===n.FLOAT&&(de=n.RG32F),Y===n.HALF_FLOAT&&(de=n.RG16F),Y===n.UNSIGNED_BYTE&&(de=n.RG8)),C===n.RG_INTEGER&&(Y===n.UNSIGNED_BYTE&&(de=n.RG8UI),Y===n.UNSIGNED_SHORT&&(de=n.RG16UI),Y===n.UNSIGNED_INT&&(de=n.RG32UI),Y===n.BYTE&&(de=n.RG8I),Y===n.SHORT&&(de=n.RG16I),Y===n.INT&&(de=n.RG32I)),C===n.RGB&&Y===n.UNSIGNED_INT_5_9_9_9_REV&&(de=n.RGB9_E5),C===n.RGBA){const Ye=ce?c0:Mn.getTransfer(ue);Y===n.FLOAT&&(de=n.RGBA32F),Y===n.HALF_FLOAT&&(de=n.RGBA16F),Y===n.UNSIGNED_BYTE&&(de=Ye===kn?n.SRGB8_ALPHA8:n.RGBA8),Y===n.UNSIGNED_SHORT_4_4_4_4&&(de=n.RGBA4),Y===n.UNSIGNED_SHORT_5_5_5_1&&(de=n.RGB5_A1)}return(de===n.R16F||de===n.R32F||de===n.RG16F||de===n.RG32F||de===n.RGBA16F||de===n.RGBA32F)&&e.get("EXT_color_buffer_float"),de}function x(U,C){let Y;return U?C===null||C===zl||C===ld?Y=n.DEPTH24_STENCIL8:C===us?Y=n.DEPTH32F_STENCIL8:C===$p&&(Y=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===zl||C===ld?Y=n.DEPTH_COMPONENT24:C===us?Y=n.DEPTH_COMPONENT32F:C===$p&&(Y=n.DEPTH_COMPONENT16),Y}function M(U,C){return y(U)===!0||U.isFramebufferTexture&&U.minFilter!==Ji&&U.minFilter!==Ii?Math.log2(Math.max(C.width,C.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?C.mipmaps.length:1}function R(U){const C=U.target;C.removeEventListener("dispose",R),P(C),C.isVideoTexture&&u.delete(C)}function T(U){const C=U.target;C.removeEventListener("dispose",T),b(C)}function P(U){const C=i.get(U);if(C.__webglInit===void 0)return;const Y=U.source,ue=d.get(Y);if(ue){const ce=ue[C.__cacheKey];ce.usedTimes--,ce.usedTimes===0&&I(U),Object.keys(ue).length===0&&d.delete(Y)}i.remove(U)}function I(U){const C=i.get(U);n.deleteTexture(C.__webglTexture);const Y=U.source,ue=d.get(Y);delete ue[C.__cacheKey],o.memory.textures--}function b(U){const C=i.get(U);if(U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ue=0;ue<6;ue++){if(Array.isArray(C.__webglFramebuffer[ue]))for(let ce=0;ce=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+r.maxTextures),w+=1,U}function V(U){const C=[];return C.push(U.wrapS),C.push(U.wrapT),C.push(U.wrapR||0),C.push(U.magFilter),C.push(U.minFilter),C.push(U.anisotropy),C.push(U.internalFormat),C.push(U.format),C.push(U.type),C.push(U.generateMipmaps),C.push(U.premultiplyAlpha),C.push(U.flipY),C.push(U.unpackAlignment),C.push(U.colorSpace),C.join()}function $(U,C){const Y=i.get(U);if(U.isVideoTexture&&Xe(U),U.isRenderTargetTexture===!1&&U.version>0&&Y.__version!==U.version){const ue=U.image;if(ue===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ue.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ne(Y,U,C);return}}t.bindTexture(n.TEXTURE_2D,Y.__webglTexture,n.TEXTURE0+C)}function Z(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){Ne(Y,U,C);return}t.bindTexture(n.TEXTURE_2D_ARRAY,Y.__webglTexture,n.TEXTURE0+C)}function X(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){Ne(Y,U,C);return}t.bindTexture(n.TEXTURE_3D,Y.__webglTexture,n.TEXTURE0+C)}function re(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){q(Y,U,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,Y.__webglTexture,n.TEXTURE0+C)}const O={[s0]:n.REPEAT,[mo]:n.CLAMP_TO_EDGE,[o0]:n.MIRRORED_REPEAT},Q={[Ji]:n.NEAREST,[vL]:n.NEAREST_MIPMAP_NEAREST,[sp]:n.NEAREST_MIPMAP_LINEAR,[Ii]:n.LINEAR,[cv]:n.LINEAR_MIPMAP_NEAREST,[wa]:n.LINEAR_MIPMAP_LINEAR},te={[n6]:n.NEVER,[l6]:n.ALWAYS,[i6]:n.LESS,[CL]:n.LEQUAL,[r6]:n.EQUAL,[a6]:n.GEQUAL,[s6]:n.GREATER,[o6]:n.NOTEQUAL};function le(U,C){if(C.type===us&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===Ii||C.magFilter===cv||C.magFilter===sp||C.magFilter===wa||C.minFilter===Ii||C.minFilter===cv||C.minFilter===sp||C.minFilter===wa)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(U,n.TEXTURE_WRAP_S,O[C.wrapS]),n.texParameteri(U,n.TEXTURE_WRAP_T,O[C.wrapT]),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,O[C.wrapR]),n.texParameteri(U,n.TEXTURE_MAG_FILTER,Q[C.magFilter]),n.texParameteri(U,n.TEXTURE_MIN_FILTER,Q[C.minFilter]),C.compareFunction&&(n.texParameteri(U,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(U,n.TEXTURE_COMPARE_FUNC,te[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===Ji||C.minFilter!==sp&&C.minFilter!==wa||C.type===us&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const Y=e.get("EXT_texture_filter_anisotropic");n.texParameterf(U,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,r.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function we(U,C){let Y=!1;U.__webglInit===void 0&&(U.__webglInit=!0,C.addEventListener("dispose",R));const ue=C.source;let ce=d.get(ue);ce===void 0&&(ce={},d.set(ue,ce));const de=V(C);if(de!==U.__cacheKey){ce[de]===void 0&&(ce[de]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,Y=!0),ce[de].usedTimes++;const Ye=ce[U.__cacheKey];Ye!==void 0&&(ce[U.__cacheKey].usedTimes--,Ye.usedTimes===0&&I(C)),U.__cacheKey=de,U.__webglTexture=ce[de].texture}return Y}function Ne(U,C,Y){let ue=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ue=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ue=n.TEXTURE_3D);const ce=we(U,C),de=C.source;t.bindTexture(ue,U.__webglTexture,n.TEXTURE0+Y);const Ye=i.get(de);if(de.version!==Ye.__version||ce===!0){t.activeTexture(n.TEXTURE0+Y);const Ae=Mn.getPrimaries(Mn.workingColorSpace),Ue=C.colorSpace===pl?null:Mn.getPrimaries(C.colorSpace),st=C.colorSpace===pl||Ae===Ue?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);let _e=_(C.image,!1,r.maxTextureSize);_e=Ce(C,_e);const Ie=s.convert(C.format,C.colorSpace),pt=s.convert(C.type);let nt=S(C.internalFormat,Ie,pt,C.colorSpace,C.isVideoTexture);le(ue,C);let ke;const ie=C.mipmaps,be=C.isVideoTexture!==!0,et=Ye.__version===void 0||ce===!0,z=de.dataReady,ve=M(C,_e);if(C.isDepthTexture)nt=x(C.format===cd,C.type),et&&(be?t.texStorage2D(n.TEXTURE_2D,1,nt,_e.width,_e.height):t.texImage2D(n.TEXTURE_2D,0,nt,_e.width,_e.height,0,Ie,pt,null));else if(C.isDataTexture)if(ie.length>0){be&&et&&t.texStorage2D(n.TEXTURE_2D,ve,nt,ie[0].width,ie[0].height);for(let oe=0,he=ie.length;oe0){const Ee=vP(ke.width,ke.height,C.format,C.type);for(const Ze of C.layerUpdates){const lt=ke.data.subarray(Ze*Ee/ke.data.BYTES_PER_ELEMENT,(Ze+1)*Ee/ke.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Ze,ke.width,ke.height,1,Ie,lt,0,0)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,ke.width,ke.height,_e.depth,Ie,ke.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,nt,ke.width,ke.height,_e.depth,0,ke.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else be?z&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,ke.width,ke.height,_e.depth,Ie,pt,ke.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,nt,ke.width,ke.height,_e.depth,0,Ie,pt,ke.data)}else{be&&et&&t.texStorage2D(n.TEXTURE_2D,ve,nt,ie[0].width,ie[0].height);for(let oe=0,he=ie.length;oe0){const oe=vP(_e.width,_e.height,C.format,C.type);for(const he of C.layerUpdates){const Ee=_e.data.subarray(he*oe/_e.data.BYTES_PER_ELEMENT,(he+1)*oe/_e.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,he,_e.width,_e.height,1,Ie,pt,Ee)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,_e.width,_e.height,_e.depth,Ie,pt,_e.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,nt,_e.width,_e.height,_e.depth,0,Ie,pt,_e.data);else if(C.isData3DTexture)be?(et&&t.texStorage3D(n.TEXTURE_3D,ve,nt,_e.width,_e.height,_e.depth),z&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,_e.width,_e.height,_e.depth,Ie,pt,_e.data)):t.texImage3D(n.TEXTURE_3D,0,nt,_e.width,_e.height,_e.depth,0,Ie,pt,_e.data);else if(C.isFramebufferTexture){if(et)if(be)t.texStorage2D(n.TEXTURE_2D,ve,nt,_e.width,_e.height);else{let oe=_e.width,he=_e.height;for(let Ee=0;Ee>=1,he>>=1}}else if(ie.length>0){if(be&&et){const oe=De(ie[0]);t.texStorage2D(n.TEXTURE_2D,ve,nt,oe.width,oe.height)}for(let oe=0,he=ie.length;oe0&&ve++;const he=De(Ie[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,ve,ie,he.width,he.height)}for(let he=0;he<6;he++)if(_e){be?z&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Ie[he].width,Ie[he].height,nt,ke,Ie[he].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,ie,Ie[he].width,Ie[he].height,0,nt,ke,Ie[he].data);for(let Ee=0;Ee>de),Ie=Math.max(1,C.height>>de);ce===n.TEXTURE_3D||ce===n.TEXTURE_2D_ARRAY?t.texImage3D(ce,de,Ue,_e,Ie,C.depth,0,Ye,Ae,null):t.texImage2D(ce,de,Ue,_e,Ie,0,Ye,Ae,null)}t.bindFramebuffer(n.FRAMEBUFFER,U),ae(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ue,ce,i.get(Y).__webglTexture,0,Re(C)):(ce===n.TEXTURE_2D||ce>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ce<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ue,ce,i.get(Y).__webglTexture,de),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Te(U,C,Y){if(n.bindRenderbuffer(n.RENDERBUFFER,U),C.depthBuffer){const ue=C.depthTexture,ce=ue&&ue.isDepthTexture?ue.type:null,de=x(C.stencilBuffer,ce),Ye=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ae=Re(C);ae(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ae,de,C.width,C.height):Y?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ae,de,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,de,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ye,n.RENDERBUFFER,U)}else{const ue=C.textures;for(let ce=0;ce{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,ue.removeEventListener("dispose",ce)};ue.addEventListener("dispose",ce),C.__depthDisposeCallback=ce}C.__boundDepthTexture=ue}if(U.depthTexture&&!C.__autoAllocateDepthBuffer){if(Y)throw new Error("target.depthTexture not supported in Cube render targets");Se(C.__webglFramebuffer,U)}else if(Y){C.__webglDepthbuffer=[];for(let ue=0;ue<6;ue++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[ue]),C.__webglDepthbuffer[ue]===void 0)C.__webglDepthbuffer[ue]=n.createRenderbuffer(),Te(C.__webglDepthbuffer[ue],U,!1);else{const ce=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,de=C.__webglDepthbuffer[ue];n.bindRenderbuffer(n.RENDERBUFFER,de),n.framebufferRenderbuffer(n.FRAMEBUFFER,ce,n.RENDERBUFFER,de)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),Te(C.__webglDepthbuffer,U,!1);else{const ue=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ce=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ce),n.framebufferRenderbuffer(n.FRAMEBUFFER,ue,n.RENDERBUFFER,ce)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function Qe(U,C,Y){const ue=i.get(U);C!==void 0&&fe(ue.__webglFramebuffer,U,U.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),Y!==void 0&&$e(U)}function je(U){const C=U.texture,Y=i.get(U),ue=i.get(C);U.addEventListener("dispose",T);const ce=U.textures,de=U.isWebGLCubeRenderTarget===!0,Ye=ce.length>1;if(Ye||(ue.__webglTexture===void 0&&(ue.__webglTexture=n.createTexture()),ue.__version=C.version,o.memory.textures++),de){Y.__webglFramebuffer=[];for(let Ae=0;Ae<6;Ae++)if(C.mipmaps&&C.mipmaps.length>0){Y.__webglFramebuffer[Ae]=[];for(let Ue=0;Ue0){Y.__webglFramebuffer=[];for(let Ae=0;Ae0&&ae(U)===!1){Y.__webglMultisampledFramebuffer=n.createFramebuffer(),Y.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,Y.__webglMultisampledFramebuffer);for(let Ae=0;Ae0)for(let Ue=0;Ue0)for(let Ue=0;Ue0){if(ae(U)===!1){const C=U.textures,Y=U.width,ue=U.height;let ce=n.COLOR_BUFFER_BIT;const de=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ye=i.get(U),Ae=C.length>1;if(Ae)for(let Ue=0;Ue0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function Xe(U){const C=o.render.frame;u.get(U)!==C&&(u.set(U,C),U.update())}function Ce(U,C){const Y=U.colorSpace,ue=U.format,ce=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||Y!==Wl&&Y!==pl&&(Mn.getTransfer(Y)===kn?(ue!==Jr||ce!==Fa)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Y)),C}function De(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(c.width=U.naturalWidth||U.width,c.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(c.width=U.displayWidth,c.height=U.displayHeight):(c.width=U.width,c.height=U.height),c}this.allocateTextureUnit=G,this.resetTextureUnits=N,this.setTexture2D=$,this.setTexture2DArray=Z,this.setTexture3D=X,this.setTextureCube=re,this.rebindTextures=Qe,this.setupRenderTarget=je,this.updateRenderTargetMipmap=Ke,this.updateMultisampleRenderTarget=ge,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=fe,this.useMultisampledRTT=ae}function A6(n,e){function t(i,r=pl){let s;const o=Mn.getTransfer(r);if(i===Fa)return n.UNSIGNED_BYTE;if(i===qA)return n.UNSIGNED_SHORT_4_4_4_4;if(i===ZA)return n.UNSIGNED_SHORT_5_5_5_1;if(i===xL)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===yL)return n.BYTE;if(i===_L)return n.SHORT;if(i===$p)return n.UNSIGNED_SHORT;if(i===KA)return n.INT;if(i===zl)return n.UNSIGNED_INT;if(i===us)return n.FLOAT;if(i===cm)return n.HALF_FLOAT;if(i===SL)return n.ALPHA;if(i===ML)return n.RGB;if(i===Jr)return n.RGBA;if(i===AL)return n.LUMINANCE;if(i===wL)return n.LUMINANCE_ALPHA;if(i===Xh)return n.DEPTH_COMPONENT;if(i===cd)return n.DEPTH_STENCIL;if(i===QA)return n.RED;if(i===ay)return n.RED_INTEGER;if(i===EL)return n.RG;if(i===ew)return n.RG_INTEGER;if(i===tw)return n.RGBA_INTEGER;if(i===uv||i===hv||i===dv||i===fv)if(o===kn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===uv)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===hv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===dv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===fv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===uv)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===hv)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===dv)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===fv)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===pM||i===mM||i===gM||i===vM)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===pM)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===mM)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===gM)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===vM)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===yM||i===_M||i===xM)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===yM||i===_M)return o===kn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===xM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===SM||i===MM||i===AM||i===wM||i===EM||i===TM||i===bM||i===CM||i===RM||i===PM||i===IM||i===LM||i===DM||i===BM)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===SM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===MM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===AM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===wM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===EM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===TM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===bM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===CM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===RM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===PM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===IM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===LM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===DM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===BM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===pv||i===NM||i===UM)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===pv)return o===kn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===NM)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===UM)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===TL||i===FM||i===OM||i===kM)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===pv)return s.COMPRESSED_RED_RGTC1_EXT;if(i===FM)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===OM)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===kM)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ld?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class w6 extends ir{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class lp extends vn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const uge={type:"move"};class Kb{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new lp,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new lp,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ee,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ee),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new lp,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ee,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ee),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,i),m=this._getHandJoint(c,_);y!==null&&(m.matrix.fromArray(y.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=y.radius),m.visible=y!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=u.position.distanceTo(h.position),f=.02,v=.005;c.inputState.pinching&&d>f+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(uge)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new lp;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const hge=` +}`;function oge(n,e,t){let i=new cy;const r=new Je,s=new Je,o=new Cn,a=new OL({depthPacking:r6}),l=new kL,c={},u=t.maxTextureSize,h={[Fl]:qr,[qr]:Fl,[Ma]:Ma},d=new Ko({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Je},radius:{value:4}},vertexShader:rge,fragmentShader:sge}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const v=new tn;v.setAttribute("position",new Nn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Li(v,d),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_L;let m=this.type;this.render=function(T,P,I){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||T.length===0)return;const b=n.getRenderTarget(),w=n.getActiveCubeFace(),N=n.getActiveMipmapLevel(),G=n.state;G.setBlending(bl),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const V=m!==_a&&this.type===_a,$=m===_a&&this.type!==_a;for(let Z=0,X=T.length;Zu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/Q.x),r.x=s.x*Q.x,O.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/Q.y),r.y=s.y*Q.y,O.mapSize.y=s.y)),O.map===null||V===!0||$===!0){const le=this.type!==_a?{minFilter:Ji,magFilter:Ji}:{};O.map!==null&&O.map.dispose(),O.map=new Jo(r.x,r.y,le),O.map.texture.name=re.name+".shadowMap",O.camera.updateProjectionMatrix()}n.setRenderTarget(O.map),n.clear();const te=O.getViewportCount();for(let le=0;le0||P.map&&P.alphaTest>0){const G=w.uuid,V=P.uuid;let $=c[G];$===void 0&&($={},c[G]=$);let Z=$[V];Z===void 0&&(Z=w.clone(),$[V]=Z,P.addEventListener("dispose",R)),w=Z}if(w.visible=P.visible,w.wireframe=P.wireframe,b===_a?w.side=P.shadowSide!==null?P.shadowSide:P.side:w.side=P.shadowSide!==null?P.shadowSide:h[P.side],w.alphaMap=P.alphaMap,w.alphaTest=P.alphaTest,w.map=P.map,w.clipShadows=P.clipShadows,w.clippingPlanes=P.clippingPlanes,w.clipIntersection=P.clipIntersection,w.displacementMap=P.displacementMap,w.displacementScale=P.displacementScale,w.displacementBias=P.displacementBias,w.wireframeLinewidth=P.wireframeLinewidth,w.linewidth=P.linewidth,I.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const G=n.properties.get(w);G.light=I}return w}function M(T,P,I,b,w){if(T.visible===!1)return;if(T.layers.test(P.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&w===_a)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,T.matrixWorld);const V=e.update(T),$=T.material;if(Array.isArray($)){const Z=V.groups;for(let X=0,re=Z.length;X=1):re.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(re)[1]),Z=X>=2);let O=null,Q={};const te=n.getParameter(n.SCISSOR_BOX),le=n.getParameter(n.VIEWPORT),we=new Cn().fromArray(te),Ne=new Cn().fromArray(le);function q(z,ve,oe,he){const Ee=new Uint8Array(4),Ze=n.createTexture();n.bindTexture(z,Ze),n.texParameteri(z,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(z,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let lt=0;lte?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function cge(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function uge(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function gP(n,e,t,i){const r=hge(i);switch(t){case wL:return n*e;case TL:return n*e;case bL:return n*e*2;case qA:return n*e/r.components*r.byteLength;case oy:return n*e/r.components*r.byteLength;case CL:return n*e*2/r.components*r.byteLength;case ZA:return n*e*2/r.components*r.byteLength;case EL:return n*e*3/r.components*r.byteLength;case Jr:return n*e*4/r.components*r.byteLength;case QA:return n*e*4/r.components*r.byteLength;case uv:case hv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case dv:case fv:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case mM:case vM:return Math.max(n,16)*Math.max(e,8)/4;case pM:case gM:return Math.max(n,8)*Math.max(e,8)/2;case yM:case _M:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case xM:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case SM:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case MM:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case AM:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case wM:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case EM:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case TM:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case bM:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case CM:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case RM:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case PM:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case IM:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case LM:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case DM:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case BM:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case pv:case NM:case UM:return Math.ceil(n/4)*Math.ceil(e/4)*16;case RL:case FM:return Math.ceil(n/4)*Math.ceil(e/4)*8;case OM:case kM:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function hge(n){switch(n){case Fa:case SL:return{byteLength:1,components:1};case Xp:case ML:case um:return{byteLength:2,components:1};case JA:case KA:return{byteLength:2,components:4};case kl:case YA:case us:return{byteLength:4,components:1};case AL:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const dge={contain:lge,cover:cge,fill:uge,getByteLength:gP};function fge(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Je,u=new WeakMap;let h;const d=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(U,C){return f?new OffscreenCanvas(U,C):p0("canvas")}function _(U,C,Y){let ue=1;const ce=De(U);if((ce.width>Y||ce.height>Y)&&(ue=Y/Math.max(ce.width,ce.height)),ue<1)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap||typeof VideoFrame<"u"&&U instanceof VideoFrame){const de=Math.floor(ue*ce.width),Ye=Math.floor(ue*ce.height);h===void 0&&(h=v(de,Ye));const Ae=C?v(de,Ye):h;return Ae.width=de,Ae.height=Ye,Ae.getContext("2d").drawImage(U,0,0,de,Ye),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ce.width+"x"+ce.height+") to ("+de+"x"+Ye+")."),Ae}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ce.width+"x"+ce.height+")."),U;return U}function y(U){return U.generateMipmaps&&U.minFilter!==Ji&&U.minFilter!==Ii}function m(U){n.generateMipmap(U)}function S(U,C,Y,ue,ce=!1){if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let de=C;if(C===n.RED&&(Y===n.FLOAT&&(de=n.R32F),Y===n.HALF_FLOAT&&(de=n.R16F),Y===n.UNSIGNED_BYTE&&(de=n.R8)),C===n.RED_INTEGER&&(Y===n.UNSIGNED_BYTE&&(de=n.R8UI),Y===n.UNSIGNED_SHORT&&(de=n.R16UI),Y===n.UNSIGNED_INT&&(de=n.R32UI),Y===n.BYTE&&(de=n.R8I),Y===n.SHORT&&(de=n.R16I),Y===n.INT&&(de=n.R32I)),C===n.RG&&(Y===n.FLOAT&&(de=n.RG32F),Y===n.HALF_FLOAT&&(de=n.RG16F),Y===n.UNSIGNED_BYTE&&(de=n.RG8)),C===n.RG_INTEGER&&(Y===n.UNSIGNED_BYTE&&(de=n.RG8UI),Y===n.UNSIGNED_SHORT&&(de=n.RG16UI),Y===n.UNSIGNED_INT&&(de=n.RG32UI),Y===n.BYTE&&(de=n.RG8I),Y===n.SHORT&&(de=n.RG16I),Y===n.INT&&(de=n.RG32I)),C===n.RGB&&Y===n.UNSIGNED_INT_5_9_9_9_REV&&(de=n.RGB9_E5),C===n.RGBA){const Ye=ce?c0:Mn.getTransfer(ue);Y===n.FLOAT&&(de=n.RGBA32F),Y===n.HALF_FLOAT&&(de=n.RGBA16F),Y===n.UNSIGNED_BYTE&&(de=Ye===kn?n.SRGB8_ALPHA8:n.RGBA8),Y===n.UNSIGNED_SHORT_4_4_4_4&&(de=n.RGBA4),Y===n.UNSIGNED_SHORT_5_5_5_1&&(de=n.RGB5_A1)}return(de===n.R16F||de===n.R32F||de===n.RG16F||de===n.RG32F||de===n.RGBA16F||de===n.RGBA32F)&&e.get("EXT_color_buffer_float"),de}function x(U,C){let Y;return U?C===null||C===kl||C===ld?Y=n.DEPTH24_STENCIL8:C===us?Y=n.DEPTH32F_STENCIL8:C===Xp&&(Y=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):C===null||C===kl||C===ld?Y=n.DEPTH_COMPONENT24:C===us?Y=n.DEPTH_COMPONENT32F:C===Xp&&(Y=n.DEPTH_COMPONENT16),Y}function M(U,C){return y(U)===!0||U.isFramebufferTexture&&U.minFilter!==Ji&&U.minFilter!==Ii?Math.log2(Math.max(C.width,C.height))+1:U.mipmaps!==void 0&&U.mipmaps.length>0?U.mipmaps.length:U.isCompressedTexture&&Array.isArray(U.image)?C.mipmaps.length:1}function R(U){const C=U.target;C.removeEventListener("dispose",R),P(C),C.isVideoTexture&&u.delete(C)}function T(U){const C=U.target;C.removeEventListener("dispose",T),b(C)}function P(U){const C=i.get(U);if(C.__webglInit===void 0)return;const Y=U.source,ue=d.get(Y);if(ue){const ce=ue[C.__cacheKey];ce.usedTimes--,ce.usedTimes===0&&I(U),Object.keys(ue).length===0&&d.delete(Y)}i.remove(U)}function I(U){const C=i.get(U);n.deleteTexture(C.__webglTexture);const Y=U.source,ue=d.get(Y);delete ue[C.__cacheKey],o.memory.textures--}function b(U){const C=i.get(U);if(U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ue=0;ue<6;ue++){if(Array.isArray(C.__webglFramebuffer[ue]))for(let ce=0;ce=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+r.maxTextures),w+=1,U}function V(U){const C=[];return C.push(U.wrapS),C.push(U.wrapT),C.push(U.wrapR||0),C.push(U.magFilter),C.push(U.minFilter),C.push(U.anisotropy),C.push(U.internalFormat),C.push(U.format),C.push(U.type),C.push(U.generateMipmaps),C.push(U.premultiplyAlpha),C.push(U.flipY),C.push(U.unpackAlignment),C.push(U.colorSpace),C.join()}function $(U,C){const Y=i.get(U);if(U.isVideoTexture&&Xe(U),U.isRenderTargetTexture===!1&&U.version>0&&Y.__version!==U.version){const ue=U.image;if(ue===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ue.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ne(Y,U,C);return}}t.bindTexture(n.TEXTURE_2D,Y.__webglTexture,n.TEXTURE0+C)}function Z(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){Ne(Y,U,C);return}t.bindTexture(n.TEXTURE_2D_ARRAY,Y.__webglTexture,n.TEXTURE0+C)}function X(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){Ne(Y,U,C);return}t.bindTexture(n.TEXTURE_3D,Y.__webglTexture,n.TEXTURE0+C)}function re(U,C){const Y=i.get(U);if(U.version>0&&Y.__version!==U.version){q(Y,U,C);return}t.bindTexture(n.TEXTURE_CUBE_MAP,Y.__webglTexture,n.TEXTURE0+C)}const O={[s0]:n.REPEAT,[mo]:n.CLAMP_TO_EDGE,[o0]:n.MIRRORED_REPEAT},Q={[Ji]:n.NEAREST,[xL]:n.NEAREST_MIPMAP_NEAREST,[sp]:n.NEAREST_MIPMAP_LINEAR,[Ii]:n.LINEAR,[cv]:n.LINEAR_MIPMAP_NEAREST,[wa]:n.LINEAR_MIPMAP_LINEAR},te={[o6]:n.NEVER,[d6]:n.ALWAYS,[a6]:n.LESS,[IL]:n.LEQUAL,[l6]:n.EQUAL,[h6]:n.GEQUAL,[c6]:n.GREATER,[u6]:n.NOTEQUAL};function le(U,C){if(C.type===us&&e.has("OES_texture_float_linear")===!1&&(C.magFilter===Ii||C.magFilter===cv||C.magFilter===sp||C.magFilter===wa||C.minFilter===Ii||C.minFilter===cv||C.minFilter===sp||C.minFilter===wa)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(U,n.TEXTURE_WRAP_S,O[C.wrapS]),n.texParameteri(U,n.TEXTURE_WRAP_T,O[C.wrapT]),(U===n.TEXTURE_3D||U===n.TEXTURE_2D_ARRAY)&&n.texParameteri(U,n.TEXTURE_WRAP_R,O[C.wrapR]),n.texParameteri(U,n.TEXTURE_MAG_FILTER,Q[C.magFilter]),n.texParameteri(U,n.TEXTURE_MIN_FILTER,Q[C.minFilter]),C.compareFunction&&(n.texParameteri(U,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(U,n.TEXTURE_COMPARE_FUNC,te[C.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(C.magFilter===Ji||C.minFilter!==sp&&C.minFilter!==wa||C.type===us&&e.has("OES_texture_float_linear")===!1)return;if(C.anisotropy>1||i.get(C).__currentAnisotropy){const Y=e.get("EXT_texture_filter_anisotropic");n.texParameterf(U,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(C.anisotropy,r.getMaxAnisotropy())),i.get(C).__currentAnisotropy=C.anisotropy}}}function we(U,C){let Y=!1;U.__webglInit===void 0&&(U.__webglInit=!0,C.addEventListener("dispose",R));const ue=C.source;let ce=d.get(ue);ce===void 0&&(ce={},d.set(ue,ce));const de=V(C);if(de!==U.__cacheKey){ce[de]===void 0&&(ce[de]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,Y=!0),ce[de].usedTimes++;const Ye=ce[U.__cacheKey];Ye!==void 0&&(ce[U.__cacheKey].usedTimes--,Ye.usedTimes===0&&I(C)),U.__cacheKey=de,U.__webglTexture=ce[de].texture}return Y}function Ne(U,C,Y){let ue=n.TEXTURE_2D;(C.isDataArrayTexture||C.isCompressedArrayTexture)&&(ue=n.TEXTURE_2D_ARRAY),C.isData3DTexture&&(ue=n.TEXTURE_3D);const ce=we(U,C),de=C.source;t.bindTexture(ue,U.__webglTexture,n.TEXTURE0+Y);const Ye=i.get(de);if(de.version!==Ye.__version||ce===!0){t.activeTexture(n.TEXTURE0+Y);const Ae=Mn.getPrimaries(Mn.workingColorSpace),Ue=C.colorSpace===pl?null:Mn.getPrimaries(C.colorSpace),st=C.colorSpace===pl||Ae===Ue?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,C.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,C.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,C.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);let _e=_(C.image,!1,r.maxTextureSize);_e=Ce(C,_e);const Ie=s.convert(C.format,C.colorSpace),pt=s.convert(C.type);let nt=S(C.internalFormat,Ie,pt,C.colorSpace,C.isVideoTexture);le(ue,C);let ke;const ie=C.mipmaps,be=C.isVideoTexture!==!0,et=Ye.__version===void 0||ce===!0,z=de.dataReady,ve=M(C,_e);if(C.isDepthTexture)nt=x(C.format===cd,C.type),et&&(be?t.texStorage2D(n.TEXTURE_2D,1,nt,_e.width,_e.height):t.texImage2D(n.TEXTURE_2D,0,nt,_e.width,_e.height,0,Ie,pt,null));else if(C.isDataTexture)if(ie.length>0){be&&et&&t.texStorage2D(n.TEXTURE_2D,ve,nt,ie[0].width,ie[0].height);for(let oe=0,he=ie.length;oe0){const Ee=gP(ke.width,ke.height,C.format,C.type);for(const Ze of C.layerUpdates){const lt=ke.data.subarray(Ze*Ee/ke.data.BYTES_PER_ELEMENT,(Ze+1)*Ee/ke.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Ze,ke.width,ke.height,1,Ie,lt,0,0)}C.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,ke.width,ke.height,_e.depth,Ie,ke.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,nt,ke.width,ke.height,_e.depth,0,ke.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else be?z&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,ke.width,ke.height,_e.depth,Ie,pt,ke.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,nt,ke.width,ke.height,_e.depth,0,Ie,pt,ke.data)}else{be&&et&&t.texStorage2D(n.TEXTURE_2D,ve,nt,ie[0].width,ie[0].height);for(let oe=0,he=ie.length;oe0){const oe=gP(_e.width,_e.height,C.format,C.type);for(const he of C.layerUpdates){const Ee=_e.data.subarray(he*oe/_e.data.BYTES_PER_ELEMENT,(he+1)*oe/_e.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,he,_e.width,_e.height,1,Ie,pt,Ee)}C.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,_e.width,_e.height,_e.depth,Ie,pt,_e.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,nt,_e.width,_e.height,_e.depth,0,Ie,pt,_e.data);else if(C.isData3DTexture)be?(et&&t.texStorage3D(n.TEXTURE_3D,ve,nt,_e.width,_e.height,_e.depth),z&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,_e.width,_e.height,_e.depth,Ie,pt,_e.data)):t.texImage3D(n.TEXTURE_3D,0,nt,_e.width,_e.height,_e.depth,0,Ie,pt,_e.data);else if(C.isFramebufferTexture){if(et)if(be)t.texStorage2D(n.TEXTURE_2D,ve,nt,_e.width,_e.height);else{let oe=_e.width,he=_e.height;for(let Ee=0;Ee>=1,he>>=1}}else if(ie.length>0){if(be&&et){const oe=De(ie[0]);t.texStorage2D(n.TEXTURE_2D,ve,nt,oe.width,oe.height)}for(let oe=0,he=ie.length;oe0&&ve++;const he=De(Ie[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,ve,ie,he.width,he.height)}for(let he=0;he<6;he++)if(_e){be?z&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Ie[he].width,Ie[he].height,nt,ke,Ie[he].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,ie,Ie[he].width,Ie[he].height,0,nt,ke,Ie[he].data);for(let Ee=0;Ee>de),Ie=Math.max(1,C.height>>de);ce===n.TEXTURE_3D||ce===n.TEXTURE_2D_ARRAY?t.texImage3D(ce,de,Ue,_e,Ie,C.depth,0,Ye,Ae,null):t.texImage2D(ce,de,Ue,_e,Ie,0,Ye,Ae,null)}t.bindFramebuffer(n.FRAMEBUFFER,U),ae(C)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ue,ce,i.get(Y).__webglTexture,0,Re(C)):(ce===n.TEXTURE_2D||ce>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ce<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ue,ce,i.get(Y).__webglTexture,de),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Te(U,C,Y){if(n.bindRenderbuffer(n.RENDERBUFFER,U),C.depthBuffer){const ue=C.depthTexture,ce=ue&&ue.isDepthTexture?ue.type:null,de=x(C.stencilBuffer,ce),Ye=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ae=Re(C);ae(C)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ae,de,C.width,C.height):Y?n.renderbufferStorageMultisample(n.RENDERBUFFER,Ae,de,C.width,C.height):n.renderbufferStorage(n.RENDERBUFFER,de,C.width,C.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Ye,n.RENDERBUFFER,U)}else{const ue=C.textures;for(let ce=0;ce{delete C.__boundDepthTexture,delete C.__depthDisposeCallback,ue.removeEventListener("dispose",ce)};ue.addEventListener("dispose",ce),C.__depthDisposeCallback=ce}C.__boundDepthTexture=ue}if(U.depthTexture&&!C.__autoAllocateDepthBuffer){if(Y)throw new Error("target.depthTexture not supported in Cube render targets");Se(C.__webglFramebuffer,U)}else if(Y){C.__webglDepthbuffer=[];for(let ue=0;ue<6;ue++)if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer[ue]),C.__webglDepthbuffer[ue]===void 0)C.__webglDepthbuffer[ue]=n.createRenderbuffer(),Te(C.__webglDepthbuffer[ue],U,!1);else{const ce=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,de=C.__webglDepthbuffer[ue];n.bindRenderbuffer(n.RENDERBUFFER,de),n.framebufferRenderbuffer(n.FRAMEBUFFER,ce,n.RENDERBUFFER,de)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,C.__webglFramebuffer),C.__webglDepthbuffer===void 0)C.__webglDepthbuffer=n.createRenderbuffer(),Te(C.__webglDepthbuffer,U,!1);else{const ue=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ce=C.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ce),n.framebufferRenderbuffer(n.FRAMEBUFFER,ue,n.RENDERBUFFER,ce)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function Qe(U,C,Y){const ue=i.get(U);C!==void 0&&fe(ue.__webglFramebuffer,U,U.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),Y!==void 0&&$e(U)}function je(U){const C=U.texture,Y=i.get(U),ue=i.get(C);U.addEventListener("dispose",T);const ce=U.textures,de=U.isWebGLCubeRenderTarget===!0,Ye=ce.length>1;if(Ye||(ue.__webglTexture===void 0&&(ue.__webglTexture=n.createTexture()),ue.__version=C.version,o.memory.textures++),de){Y.__webglFramebuffer=[];for(let Ae=0;Ae<6;Ae++)if(C.mipmaps&&C.mipmaps.length>0){Y.__webglFramebuffer[Ae]=[];for(let Ue=0;Ue0){Y.__webglFramebuffer=[];for(let Ae=0;Ae0&&ae(U)===!1){Y.__webglMultisampledFramebuffer=n.createFramebuffer(),Y.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,Y.__webglMultisampledFramebuffer);for(let Ae=0;Ae0)for(let Ue=0;Ue0)for(let Ue=0;Ue0){if(ae(U)===!1){const C=U.textures,Y=U.width,ue=U.height;let ce=n.COLOR_BUFFER_BIT;const de=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ye=i.get(U),Ae=C.length>1;if(Ae)for(let Ue=0;Ue0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&C.__useRenderToTexture!==!1}function Xe(U){const C=o.render.frame;u.get(U)!==C&&(u.set(U,C),U.update())}function Ce(U,C){const Y=U.colorSpace,ue=U.format,ce=U.type;return U.isCompressedTexture===!0||U.isVideoTexture===!0||Y!==Vl&&Y!==pl&&(Mn.getTransfer(Y)===kn?(ue!==Jr||ce!==Fa)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Y)),C}function De(U){return typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement?(c.width=U.naturalWidth||U.width,c.height=U.naturalHeight||U.height):typeof VideoFrame<"u"&&U instanceof VideoFrame?(c.width=U.displayWidth,c.height=U.displayHeight):(c.width=U.width,c.height=U.height),c}this.allocateTextureUnit=G,this.resetTextureUnits=N,this.setTexture2D=$,this.setTexture2DArray=Z,this.setTexture3D=X,this.setTextureCube=re,this.rebindTextures=Qe,this.setupRenderTarget=je,this.updateRenderTargetMipmap=Ke,this.updateMultisampleRenderTarget=ge,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=fe,this.useMultisampledRTT=ae}function b6(n,e){function t(i,r=pl){let s;const o=Mn.getTransfer(r);if(i===Fa)return n.UNSIGNED_BYTE;if(i===JA)return n.UNSIGNED_SHORT_4_4_4_4;if(i===KA)return n.UNSIGNED_SHORT_5_5_5_1;if(i===AL)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===SL)return n.BYTE;if(i===ML)return n.SHORT;if(i===Xp)return n.UNSIGNED_SHORT;if(i===YA)return n.INT;if(i===kl)return n.UNSIGNED_INT;if(i===us)return n.FLOAT;if(i===um)return n.HALF_FLOAT;if(i===wL)return n.ALPHA;if(i===EL)return n.RGB;if(i===Jr)return n.RGBA;if(i===TL)return n.LUMINANCE;if(i===bL)return n.LUMINANCE_ALPHA;if(i===Xh)return n.DEPTH_COMPONENT;if(i===cd)return n.DEPTH_STENCIL;if(i===qA)return n.RED;if(i===oy)return n.RED_INTEGER;if(i===CL)return n.RG;if(i===ZA)return n.RG_INTEGER;if(i===QA)return n.RGBA_INTEGER;if(i===uv||i===hv||i===dv||i===fv)if(o===kn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===uv)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===hv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===dv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===fv)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===uv)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===hv)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===dv)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===fv)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===pM||i===mM||i===gM||i===vM)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===pM)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===mM)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===gM)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===vM)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===yM||i===_M||i===xM)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===yM||i===_M)return o===kn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===xM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===SM||i===MM||i===AM||i===wM||i===EM||i===TM||i===bM||i===CM||i===RM||i===PM||i===IM||i===LM||i===DM||i===BM)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===SM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===MM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===AM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===wM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===EM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===TM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===bM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===CM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===RM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===PM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===IM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===LM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===DM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===BM)return o===kn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===pv||i===NM||i===UM)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===pv)return o===kn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===NM)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===UM)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===RL||i===FM||i===OM||i===kM)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===pv)return s.COMPRESSED_RED_RGTC1_EXT;if(i===FM)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===OM)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===kM)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ld?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class C6 extends ir{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class lp extends vn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const pge={type:"move"};class Yb{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new lp,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new lp,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ee,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ee),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new lp,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ee,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ee),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,i),m=this._getHandJoint(c,_);y!==null&&(m.matrix.fromArray(y.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=y.radius),m.visible=y!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=u.position.distanceTo(h.position),f=.02,v=.005;c.inputState.pinching&&d>f+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(pge)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new lp;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const mge=` void main() { gl_Position = vec4( position, 1.0 ); -}`,dge=` +}`,gge=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -7811,23 +7811,23 @@ void main() { } -}`;class fge{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new gi,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Ko({vertexShader:hge,fragmentShader:dge,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Li(new hm(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class pge extends za{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,d=null,f=null,v=null;const _=new fge,y=t.getContextAttributes();let m=null,S=null;const x=[],M=[],R=new Je;let T=null;const P=new ir;P.layers.enable(1),P.viewport=new Cn;const I=new ir;I.layers.enable(2),I.viewport=new Cn;const b=[P,I],w=new w6;w.layers.enable(1),w.layers.enable(2);let N=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let fe=x[q];return fe===void 0&&(fe=new Kb,x[q]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(q){let fe=x[q];return fe===void 0&&(fe=new Kb,x[q]=fe),fe.getGripSpace()},this.getHand=function(q){let fe=x[q];return fe===void 0&&(fe=new Kb,x[q]=fe),fe.getHandSpace()};function V(q){const fe=M.indexOf(q.inputSource);if(fe===-1)return;const Te=x[fe];Te!==void 0&&(Te.update(q.inputSource,q.frame,c||o),Te.dispatchEvent({type:q.type,data:q.inputSource}))}function $(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",$),r.removeEventListener("inputsourceschange",Z);for(let q=0;q=0&&(M[Se]=null,x[Se].disconnect(Te))}for(let fe=0;fe=M.length){M.push(Te),Se=Qe;break}else if(M[Qe]===null){M[Qe]=Te,Se=Qe;break}if(Se===-1)break}const $e=x[Se];$e&&$e.connect(Te)}}const X=new ee,re=new ee;function O(q,fe,Te){X.setFromMatrixPosition(fe.matrixWorld),re.setFromMatrixPosition(Te.matrixWorld);const Se=X.distanceTo(re),$e=fe.projectionMatrix.elements,Qe=Te.projectionMatrix.elements,je=$e[14]/($e[10]-1),Ke=$e[14]/($e[10]+1),B=($e[9]+1)/$e[5],me=($e[9]-1)/$e[5],ge=($e[8]-1)/$e[0],Re=(Qe[8]+1)/Qe[0],ae=je*ge,Xe=je*Re,Ce=Se/(-ge+Re),De=Ce*-ge;if(fe.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(De),q.translateZ(Ce),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),$e[10]===-1)q.projectionMatrix.copy(fe.projectionMatrix),q.projectionMatrixInverse.copy(fe.projectionMatrixInverse);else{const U=je+Ce,C=Ke+Ce,Y=ae-De,ue=Xe+(Se-De),ce=B*Ke/C*U,de=me*Ke/C*U;q.projectionMatrix.makePerspective(Y,ue,ce,de,U,C),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function Q(q,fe){fe===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(fe.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(r===null)return;let fe=q.near,Te=q.far;_.texture!==null&&(_.depthNear>0&&(fe=_.depthNear),_.depthFar>0&&(Te=_.depthFar)),w.near=I.near=P.near=fe,w.far=I.far=P.far=Te,(N!==w.near||G!==w.far)&&(r.updateRenderState({depthNear:w.near,depthFar:w.far}),N=w.near,G=w.far);const Se=q.parent,$e=w.cameras;Q(w,Se);for(let Qe=0;Qe<$e.length;Qe++)Q($e[Qe],Se);$e.length===2?O(w,P,I):w.projectionMatrix.copy(P.projectionMatrix),te(q,w,Se)};function te(q,fe,Te){Te===null?q.matrix.copy(fe.matrixWorld):(q.matrix.copy(Te.matrixWorld),q.matrix.invert(),q.matrix.multiply(fe.matrixWorld)),q.matrix.decompose(q.position,q.quaternion,q.scale),q.updateMatrixWorld(!0),q.projectionMatrix.copy(fe.projectionMatrix),q.projectionMatrixInverse.copy(fe.projectionMatrixInverse),q.isPerspectiveCamera&&(q.fov=Xp*2*Math.atan(1/q.projectionMatrix.elements[5]),q.zoom=1)}this.getCamera=function(){return w},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(q){l=q,d!==null&&(d.fixedFoveation=q),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=q)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(w)};let le=null;function we(q,fe){if(u=fe.getViewerPose(c||o),v=fe,u!==null){const Te=u.views;f!==null&&(e.setRenderTargetFramebuffer(S,f.framebuffer),e.setRenderTarget(S));let Se=!1;Te.length!==w.cameras.length&&(w.cameras.length=0,Se=!0);for(let Qe=0;Qe0&&(y.alphaTest.value=m.alphaTest);const S=e.get(m),x=S.envMap,M=S.envMapRotation;x&&(y.envMap.value=x,qu.copy(M),qu.x*=-1,qu.y*=-1,qu.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(qu.y*=-1,qu.z*=-1),y.envMapRotation.value.setFromMatrix4(mge.makeRotationFromEuler(qu)),y.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=m.reflectivity,y.ior.value=m.ior,y.refractionRatio.value=m.refractionRatio),m.lightMap&&(y.lightMap.value=m.lightMap,y.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,y.lightMapTransform)),m.aoMap&&(y.aoMap.value=m.aoMap,y.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,y.aoMapTransform))}function o(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform))}function a(y,m){y.dashSize.value=m.dashSize,y.totalSize.value=m.dashSize+m.gapSize,y.scale.value=m.scale}function l(y,m,S,x){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.size.value=m.size*S,y.scale.value=x*.5,m.map&&(y.map.value=m.map,t(m.map,y.uvTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function c(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.rotation.value=m.rotation,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function u(y,m){y.specular.value.copy(m.specular),y.shininess.value=Math.max(m.shininess,1e-4)}function h(y,m){m.gradientMap&&(y.gradientMap.value=m.gradientMap)}function d(y,m){y.metalness.value=m.metalness,m.metalnessMap&&(y.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,y.metalnessMapTransform)),y.roughness.value=m.roughness,m.roughnessMap&&(y.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,y.roughnessMapTransform)),m.envMap&&(y.envMapIntensity.value=m.envMapIntensity)}function f(y,m,S){y.ior.value=m.ior,m.sheen>0&&(y.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),y.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(y.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,y.sheenColorMapTransform)),m.sheenRoughnessMap&&(y.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,y.sheenRoughnessMapTransform))),m.clearcoat>0&&(y.clearcoat.value=m.clearcoat,y.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(y.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,y.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(y.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===qr&&y.clearcoatNormalScale.value.negate())),m.dispersion>0&&(y.dispersion.value=m.dispersion),m.iridescence>0&&(y.iridescence.value=m.iridescence,y.iridescenceIOR.value=m.iridescenceIOR,y.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(y.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,y.iridescenceMapTransform)),m.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),m.transmission>0&&(y.transmission.value=m.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),m.transmissionMap&&(y.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,y.transmissionMapTransform)),y.thickness.value=m.thickness,m.thicknessMap&&(y.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=m.attenuationDistance,y.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(y.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(y.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=m.specularIntensity,y.specularColor.value.copy(m.specularColor),m.specularColorMap&&(y.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,y.specularColorMapTransform)),m.specularIntensityMap&&(y.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,m){m.matcap&&(y.matcap.value=m.matcap)}function _(y,m){const S=e.get(m).light;y.referencePosition.value.setFromMatrixPosition(S.matrixWorld),y.nearDistance.value=S.shadow.camera.near,y.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function vge(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,x){const M=x.program;i.uniformBlockBinding(S,M)}function c(S,x){let M=r[S.id];M===void 0&&(v(S),M=u(S),r[S.id]=M,S.addEventListener("dispose",y));const R=x.program;i.updateUBOMapping(S,R);const T=e.render.frame;s[S.id]!==T&&(d(S),s[S.id]=T)}function u(S){const x=h();S.__bindingPointIndex=x;const M=n.createBuffer(),R=S.__size,T=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,R,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,M),M}function h(){for(let S=0;S0&&(M+=R-T),S.__size=M,S.__cache={},this}function _(S){const x={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(x.boundary=4,x.storage=4):S.isVector2?(x.boundary=8,x.storage=8):S.isVector3||S.isColor?(x.boundary=16,x.storage=12):S.isVector4?(x.boundary=16,x.storage=16):S.isMatrix3?(x.boundary=48,x.storage=48):S.isMatrix4?(x.boundary=64,x.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),x}function y(S){const x=S.target;x.removeEventListener("dispose",y);const M=o.indexOf(x.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function m(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:c,dispose:m}}class yge{constructor(e={}){const{canvas:t=u6(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=o;const f=new Uint32Array(4),v=new Int32Array(4);let _=null,y=null;const m=[],S=[];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=lo,this.toneMapping=Cl,this.toneMappingExposure=1;const x=this;let M=!1,R=0,T=0,P=null,I=-1,b=null;const w=new Cn,N=new Cn;let G=null;const V=new _t(0);let $=0,Z=t.width,X=t.height,re=1,O=null,Q=null;const te=new Cn(0,0,Z,X),le=new Cn(0,0,Z,X);let we=!1;const Ne=new uy;let q=!1,fe=!1;const Te=new Dt,Se=new ee,$e=new Cn,Qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let je=!1;function Ke(){return P===null?re:1}let B=i;function me(L,H){return t.getContext(L,H)}try{const L={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${YA}`),t.addEventListener("webglcontextlost",oe,!1),t.addEventListener("webglcontextrestored",he,!1),t.addEventListener("webglcontextcreationerror",Ee,!1),B===null){const H="webgl2";if(B=me(H,L),B===null)throw me(H)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}let ge,Re,ae,Xe,Ce,De,U,C,Y,ue,ce,de,Ye,Ae,Ue,st,_e,Ie,pt,nt,ke,ie,be,et;function z(){ge=new wpe(B),ge.init(),ie=new A6(B,ge),Re=new ype(B,ge,e,ie),ae=new ige(B),Xe=new bpe(B),Ce=new $me,De=new cge(B,ge,ae,Ce,Re,ie,Xe),U=new xpe(x),C=new Ape(x),Y=new Bhe(B),be=new gpe(B,Y),ue=new Epe(B,Y,Xe,be),ce=new Rpe(B,ue,Y,Xe),pt=new Cpe(B,Re,De),st=new _pe(Ce),de=new Wme(x,U,C,ge,Re,be,st),Ye=new gge(x,Ce),Ae=new jme,Ue=new Qme(ge),Ie=new mpe(x,U,C,ae,ce,d,l),_e=new nge(x,ce,Re),et=new vge(B,Xe,Re,ae),nt=new vpe(B,ge,Xe),ke=new Tpe(B,ge,Xe),Xe.programs=de.programs,x.capabilities=Re,x.extensions=ge,x.properties=Ce,x.renderLists=Ae,x.shadowMap=_e,x.state=ae,x.info=Xe}z();const ve=new pge(x,B);this.xr=ve,this.getContext=function(){return B},this.getContextAttributes=function(){return B.getContextAttributes()},this.forceContextLoss=function(){const L=ge.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=ge.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return re},this.setPixelRatio=function(L){L!==void 0&&(re=L,this.setSize(Z,X,!1))},this.getSize=function(L){return L.set(Z,X)},this.setSize=function(L,H,J=!0){if(ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Z=L,X=H,t.width=Math.floor(L*re),t.height=Math.floor(H*re),J===!0&&(t.style.width=L+"px",t.style.height=H+"px"),this.setViewport(0,0,L,H)},this.getDrawingBufferSize=function(L){return L.set(Z*re,X*re).floor()},this.setDrawingBufferSize=function(L,H,J){Z=L,X=H,re=J,t.width=Math.floor(L*J),t.height=Math.floor(H*J),this.setViewport(0,0,L,H)},this.getCurrentViewport=function(L){return L.copy(w)},this.getViewport=function(L){return L.copy(te)},this.setViewport=function(L,H,J,K){L.isVector4?te.set(L.x,L.y,L.z,L.w):te.set(L,H,J,K),ae.viewport(w.copy(te).multiplyScalar(re).round())},this.getScissor=function(L){return L.copy(le)},this.setScissor=function(L,H,J,K){L.isVector4?le.set(L.x,L.y,L.z,L.w):le.set(L,H,J,K),ae.scissor(N.copy(le).multiplyScalar(re).round())},this.getScissorTest=function(){return we},this.setScissorTest=function(L){ae.setScissorTest(we=L)},this.setOpaqueSort=function(L){O=L},this.setTransparentSort=function(L){Q=L},this.getClearColor=function(L){return L.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor.apply(Ie,arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha.apply(Ie,arguments)},this.clear=function(L=!0,H=!0,J=!0){let K=0;if(L){let W=!1;if(P!==null){const Me=P.texture.format;W=Me===tw||Me===ew||Me===ay}if(W){const Me=P.texture.type,Le=Me===Fa||Me===zl||Me===$p||Me===ld||Me===qA||Me===ZA,Ve=Ie.getClearColor(),He=Ie.getClearAlpha(),qe=Ve.r,tt=Ve.g,We=Ve.b;Le?(f[0]=qe,f[1]=tt,f[2]=We,f[3]=He,B.clearBufferuiv(B.COLOR,0,f)):(v[0]=qe,v[1]=tt,v[2]=We,v[3]=He,B.clearBufferiv(B.COLOR,0,v))}else K|=B.COLOR_BUFFER_BIT}H&&(K|=B.DEPTH_BUFFER_BIT),J&&(K|=B.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),B.clear(K)},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",oe,!1),t.removeEventListener("webglcontextrestored",he,!1),t.removeEventListener("webglcontextcreationerror",Ee,!1),Ae.dispose(),Ue.dispose(),Ce.dispose(),U.dispose(),C.dispose(),ce.dispose(),be.dispose(),et.dispose(),de.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Rn),ve.removeEventListener("sessionend",xu),Qi.stop()};function oe(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function he(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const L=Xe.autoReset,H=_e.enabled,J=_e.autoUpdate,K=_e.needsUpdate,W=_e.type;z(),Xe.autoReset=L,_e.enabled=H,_e.autoUpdate=J,_e.needsUpdate=K,_e.type=W}function Ee(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Ze(L){const H=L.target;H.removeEventListener("dispose",Ze),lt(H)}function lt(L){Ct(L),Ce.remove(L)}function Ct(L){const H=Ce.get(L).programs;H!==void 0&&(H.forEach(function(J){de.releaseProgram(J)}),L.isShaderMaterial&&de.releaseShaderCache(L))}this.renderBufferDirect=function(L,H,J,K,W,Me){H===null&&(H=Qe);const Le=W.isMesh&&W.matrixWorld.determinant()<0,Ve=gm(L,H,J,K,W);ae.setMaterial(K,Le);let He=J.index,qe=1;if(K.wireframe===!0){if(He=ue.getWireframeAttribute(J),He===void 0)return;qe=2}const tt=J.drawRange,We=J.attributes.position;let At=tt.start*qe,Bt=(tt.start+tt.count)*qe;Me!==null&&(At=Math.max(At,Me.start*qe),Bt=Math.min(Bt,(Me.start+Me.count)*qe)),He!==null?(At=Math.max(At,0),Bt=Math.min(Bt,He.count)):We!=null&&(At=Math.max(At,0),Bt=Math.min(Bt,We.count));const Pt=Bt-At;if(Pt<0||Pt===1/0)return;be.setup(W,K,Ve,J,He);let ln,at=nt;if(He!==null&&(ln=Y.get(He),at=ke,at.setIndex(ln)),W.isMesh)K.wireframe===!0?(ae.setLineWidth(K.wireframeLinewidth*Ke()),at.setMode(B.LINES)):at.setMode(B.TRIANGLES);else if(W.isLine){let Be=K.linewidth;Be===void 0&&(Be=1),ae.setLineWidth(Be*Ke()),W.isLineSegments?at.setMode(B.LINES):W.isLineLoop?at.setMode(B.LINE_LOOP):at.setMode(B.LINE_STRIP)}else W.isPoints?at.setMode(B.POINTS):W.isSprite&&at.setMode(B.TRIANGLES);if(W.isBatchedMesh)if(W._multiDrawInstances!==null)at.renderMultiDrawInstances(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount,W._multiDrawInstances);else if(ge.get("WEBGL_multi_draw"))at.renderMultiDraw(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount);else{const Be=W._multiDrawStarts,kt=W._multiDrawCounts,ut=W._multiDrawCount,rn=He?Y.get(He).bytesPerElement:1,vi=Ce.get(K).currentProgram.getUniforms();for(let hn=0;hn{function Me(){if(K.forEach(function(Le){Ce.get(Le).currentProgram.isReady()&&K.delete(Le)}),K.size===0){W(L);return}setTimeout(Me,10)}ge.get("KHR_parallel_shader_compile")!==null?Me():setTimeout(Me,10)})};let vt=null;function Ln(L){vt&&vt(L)}function Rn(){Qi.stop()}function xu(){Qi.start()}const Qi=new y6;Qi.setAnimationLoop(Ln),typeof self<"u"&&Qi.setContext(self),this.setAnimationLoop=function(L){vt=L,ve.setAnimationLoop(L),L===null?Qi.stop():Qi.start()},ve.addEventListener("sessionstart",Rn),ve.addEventListener("sessionend",xu),this.render=function(L,H){if(H!==void 0&&H.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),H.parent===null&&H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),ve.enabled===!0&&ve.isPresenting===!0&&(ve.cameraAutoUpdate===!0&&ve.updateCamera(H),H=ve.getCamera()),L.isScene===!0&&L.onBeforeRender(x,L,H,P),y=Ue.get(L,S.length),y.init(H),S.push(y),Te.multiplyMatrices(H.projectionMatrix,H.matrixWorldInverse),Ne.setFromProjectionMatrix(Te),fe=this.localClippingEnabled,q=st.init(this.clippingPlanes,fe),_=Ae.get(L,m.length),_.init(),m.push(_),ve.enabled===!0&&ve.isPresenting===!0){const Me=x.xr.getDepthSensingMesh();Me!==null&&Ha(Me,H,-1/0,x.sortObjects)}Ha(L,H,0,x.sortObjects),_.finish(),x.sortObjects===!0&&_.sort(O,Q),je=ve.enabled===!1||ve.isPresenting===!1||ve.hasDepthSensing()===!1,je&&Ie.addToRenderList(_,L),this.info.render.frame++,q===!0&&st.beginShadows();const J=y.state.shadowsArray;_e.render(J,L,H),q===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset();const K=_.opaque,W=_.transmissive;if(y.setupLights(),H.isArrayCamera){const Me=H.cameras;if(W.length>0)for(let Le=0,Ve=Me.length;Le0&&Va(K,W,L,H),je&&Ie.render(L),$l(_,L,H);P!==null&&(De.updateMultisampleRenderTarget(P),De.updateRenderTargetMipmap(P)),L.isScene===!0&&L.onAfterRender(x,L,H),be.resetDefaultState(),I=-1,b=null,S.pop(),S.length>0?(y=S[S.length-1],q===!0&&st.setGlobalState(x.clippingPlanes,y.state.camera)):y=null,m.pop(),m.length>0?_=m[m.length-1]:_=null};function Ha(L,H,J,K){if(L.visible===!1)return;if(L.layers.test(H.layers)){if(L.isGroup)J=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(H);else if(L.isLight)y.pushLight(L),L.castShadow&&y.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||Ne.intersectsSprite(L)){K&&$e.setFromMatrixPosition(L.matrixWorld).applyMatrix4(Te);const Le=ce.update(L),Ve=L.material;Ve.visible&&_.push(L,Le,Ve,J,$e.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||Ne.intersectsObject(L))){const Le=ce.update(L),Ve=L.material;if(K&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),$e.copy(L.boundingSphere.center)):(Le.boundingSphere===null&&Le.computeBoundingSphere(),$e.copy(Le.boundingSphere.center)),$e.applyMatrix4(L.matrixWorld).applyMatrix4(Te)),Array.isArray(Ve)){const He=Le.groups;for(let qe=0,tt=He.length;qe0&&So(W,H,J),Me.length>0&&So(Me,H,J),Le.length>0&&So(Le,H,J),ae.buffers.depth.setTest(!0),ae.buffers.depth.setMask(!0),ae.buffers.color.setMask(!0),ae.setPolygonOffset(!1)}function Va(L,H,J,K){if((J.isScene===!0?J.overrideMaterial:null)!==null)return;y.state.transmissionRenderTarget[K.id]===void 0&&(y.state.transmissionRenderTarget[K.id]=new Jo(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")||ge.has("EXT_color_buffer_float")?cm:Fa,minFilter:wa,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Mn.workingColorSpace}));const Me=y.state.transmissionRenderTarget[K.id],Le=K.viewport||w;Me.setSize(Le.z,Le.w);const Ve=x.getRenderTarget();x.setRenderTarget(Me),x.getClearColor(V),$=x.getClearAlpha(),$<1&&x.setClearColor(16777215,.5),x.clear(),je&&Ie.render(J);const He=x.toneMapping;x.toneMapping=Cl;const qe=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),y.setupLightsView(K),q===!0&&st.setGlobalState(x.clippingPlanes,K),So(L,J,K),De.updateMultisampleRenderTarget(Me),De.updateRenderTargetMipmap(Me),ge.has("WEBGL_multisampled_render_to_texture")===!1){let tt=!1;for(let We=0,At=H.length;We0),We=!!J.morphAttributes.position,At=!!J.morphAttributes.normal,Bt=!!J.morphAttributes.color;let Pt=Cl;K.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Pt=x.toneMapping);const ln=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,at=ln!==void 0?ln.length:0,Be=Ce.get(K),kt=y.state.lights;if(q===!0&&(fe===!0||L!==b)){const Tn=L===b&&K.id===I;st.setState(K,L,Tn)}let ut=!1;K.version===Be.__version?(Be.needsLights&&Be.lightsStateVersion!==kt.state.version||Be.outputColorSpace!==Ve||W.isBatchedMesh&&Be.batching===!1||!W.isBatchedMesh&&Be.batching===!0||W.isBatchedMesh&&Be.batchingColor===!0&&W.colorTexture===null||W.isBatchedMesh&&Be.batchingColor===!1&&W.colorTexture!==null||W.isInstancedMesh&&Be.instancing===!1||!W.isInstancedMesh&&Be.instancing===!0||W.isSkinnedMesh&&Be.skinning===!1||!W.isSkinnedMesh&&Be.skinning===!0||W.isInstancedMesh&&Be.instancingColor===!0&&W.instanceColor===null||W.isInstancedMesh&&Be.instancingColor===!1&&W.instanceColor!==null||W.isInstancedMesh&&Be.instancingMorph===!0&&W.morphTexture===null||W.isInstancedMesh&&Be.instancingMorph===!1&&W.morphTexture!==null||Be.envMap!==He||K.fog===!0&&Be.fog!==Me||Be.numClippingPlanes!==void 0&&(Be.numClippingPlanes!==st.numPlanes||Be.numIntersection!==st.numIntersection)||Be.vertexAlphas!==qe||Be.vertexTangents!==tt||Be.morphTargets!==We||Be.morphNormals!==At||Be.morphColors!==Bt||Be.toneMapping!==Pt||Be.morphTargetsCount!==at)&&(ut=!0):(ut=!0,Be.__version=K.version);let rn=Be.currentProgram;ut===!0&&(rn=Ao(K,H,W));let vi=!1,hn=!1,li=!1;const Ot=rn.getUniforms(),Ei=Be.uniforms;if(ae.useProgram(rn.program)&&(vi=!0,hn=!0,li=!0),K.id!==I&&(I=K.id,hn=!0),vi||b!==L){Ot.setValue(B,"projectionMatrix",L.projectionMatrix),Ot.setValue(B,"viewMatrix",L.matrixWorldInverse);const Tn=Ot.map.cameraPosition;Tn!==void 0&&Tn.setValue(B,Se.setFromMatrixPosition(L.matrixWorld)),Re.logarithmicDepthBuffer&&Ot.setValue(B,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&Ot.setValue(B,"isOrthographic",L.isOrthographicCamera===!0),b!==L&&(b=L,hn=!0,li=!0)}if(W.isSkinnedMesh){Ot.setOptional(B,W,"bindMatrix"),Ot.setOptional(B,W,"bindMatrixInverse");const Tn=W.skeleton;Tn&&(Tn.boneTexture===null&&Tn.computeBoneTexture(),Ot.setValue(B,"boneTexture",Tn.boneTexture,De))}W.isBatchedMesh&&(Ot.setOptional(B,W,"batchingTexture"),Ot.setValue(B,"batchingTexture",W._matricesTexture,De),Ot.setOptional(B,W,"batchingIdTexture"),Ot.setValue(B,"batchingIdTexture",W._indirectTexture,De),Ot.setOptional(B,W,"batchingColorTexture"),W._colorsTexture!==null&&Ot.setValue(B,"batchingColorTexture",W._colorsTexture,De));const aa=J.morphAttributes;if((aa.position!==void 0||aa.normal!==void 0||aa.color!==void 0)&&pt.update(W,J,rn),(hn||Be.receiveShadow!==W.receiveShadow)&&(Be.receiveShadow=W.receiveShadow,Ot.setValue(B,"receiveShadow",W.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(Ei.envMap.value=He,Ei.flipEnvMap.value=He.isCubeTexture&&He.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&H.environment!==null&&(Ei.envMapIntensity.value=H.environmentIntensity),hn&&(Ot.setValue(B,"toneMappingExposure",x.toneMappingExposure),Be.needsLights&&vm(Ei,li),Me&&K.fog===!0&&Ye.refreshFogUniforms(Ei,Me),Ye.refreshMaterialUniforms(Ei,K,re,X,y.state.transmissionRenderTarget[L.id]),K1.upload(B,Su(Be),Ei,De)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(K1.upload(B,Su(Be),Ei,De),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&Ot.setValue(B,"center",W.center),Ot.setValue(B,"modelViewMatrix",W.modelViewMatrix),Ot.setValue(B,"normalMatrix",W.normalMatrix),Ot.setValue(B,"modelMatrix",W.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){const Tn=K.uniformsGroups;for(let la=0,Nr=Tn.length;la0&&De.useMultisampledRTT(L)===!1?W=Ce.get(L).__webglMultisampledFramebuffer:Array.isArray(tt)?W=tt[J]:W=tt,w.copy(L.viewport),N.copy(L.scissor),G=L.scissorTest}else w.copy(te).multiplyScalar(re).floor(),N.copy(le).multiplyScalar(re).floor(),G=we;if(ae.bindFramebuffer(B.FRAMEBUFFER,W)&&K&&ae.drawBuffers(L,W),ae.viewport(w),ae.scissor(N),ae.setScissorTest(G),Me){const He=Ce.get(L.texture);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+H,He.__webglTexture,J)}else if(Le){const He=Ce.get(L.texture),qe=H||0;B.framebufferTextureLayer(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,He.__webglTexture,J||0,qe)}I=-1},this.readRenderTargetPixels=function(L,H,J,K,W,Me,Le){if(!(L&&L.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ve=Ce.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ve=Ve[Le]),Ve){ae.bindFramebuffer(B.FRAMEBUFFER,Ve);try{const He=L.texture,qe=He.format,tt=He.type;if(!Re.textureFormatReadable(qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Re.textureTypeReadable(tt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}H>=0&&H<=L.width-K&&J>=0&&J<=L.height-W&&B.readPixels(H,J,K,W,ie.convert(qe),ie.convert(tt),Me)}finally{const He=P!==null?Ce.get(P).__webglFramebuffer:null;ae.bindFramebuffer(B.FRAMEBUFFER,He)}}},this.readRenderTargetPixelsAsync=async function(L,H,J,K,W,Me,Le){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ve=Ce.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ve=Ve[Le]),Ve){ae.bindFramebuffer(B.FRAMEBUFFER,Ve);try{const He=L.texture,qe=He.format,tt=He.type;if(!Re.textureFormatReadable(qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Re.textureTypeReadable(tt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(H>=0&&H<=L.width-K&&J>=0&&J<=L.height-W){const We=B.createBuffer();B.bindBuffer(B.PIXEL_PACK_BUFFER,We),B.bufferData(B.PIXEL_PACK_BUFFER,Me.byteLength,B.STREAM_READ),B.readPixels(H,J,K,W,ie.convert(qe),ie.convert(tt),0),B.flush();const At=B.fenceSync(B.SYNC_GPU_COMMANDS_COMPLETE,0);await she(B,At,4);try{B.bindBuffer(B.PIXEL_PACK_BUFFER,We),B.getBufferSubData(B.PIXEL_PACK_BUFFER,0,Me)}finally{B.deleteBuffer(We),B.deleteSync(At)}return Me}}finally{const He=P!==null?Ce.get(P).__webglFramebuffer:null;ae.bindFramebuffer(B.FRAMEBUFFER,He)}}},this.copyFramebufferToTexture=function(L,H=null,J=0){L.isTexture!==!0&&(Mp("WebGLRenderer: copyFramebufferToTexture function signature has changed."),H=arguments[0]||null,L=arguments[1]);const K=Math.pow(2,-J),W=Math.floor(L.image.width*K),Me=Math.floor(L.image.height*K),Le=H!==null?H.x:0,Ve=H!==null?H.y:0;De.setTexture2D(L,0),B.copyTexSubImage2D(B.TEXTURE_2D,J,0,0,Le,Ve,W,Me),ae.unbindTexture()},this.copyTextureToTexture=function(L,H,J=null,K=null,W=0){L.isTexture!==!0&&(Mp("WebGLRenderer: copyTextureToTexture function signature has changed."),K=arguments[0]||null,L=arguments[1],H=arguments[2],W=arguments[3]||0,J=null);let Me,Le,Ve,He,qe,tt;J!==null?(Me=J.max.x-J.min.x,Le=J.max.y-J.min.y,Ve=J.min.x,He=J.min.y):(Me=L.image.width,Le=L.image.height,Ve=0,He=0),K!==null?(qe=K.x,tt=K.y):(qe=0,tt=0);const We=ie.convert(H.format),At=ie.convert(H.type);De.setTexture2D(H,0),B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,H.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,H.unpackAlignment);const Bt=B.getParameter(B.UNPACK_ROW_LENGTH),Pt=B.getParameter(B.UNPACK_IMAGE_HEIGHT),ln=B.getParameter(B.UNPACK_SKIP_PIXELS),at=B.getParameter(B.UNPACK_SKIP_ROWS),Be=B.getParameter(B.UNPACK_SKIP_IMAGES),kt=L.isCompressedTexture?L.mipmaps[W]:L.image;B.pixelStorei(B.UNPACK_ROW_LENGTH,kt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,kt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,Ve),B.pixelStorei(B.UNPACK_SKIP_ROWS,He),L.isDataTexture?B.texSubImage2D(B.TEXTURE_2D,W,qe,tt,Me,Le,We,At,kt.data):L.isCompressedTexture?B.compressedTexSubImage2D(B.TEXTURE_2D,W,qe,tt,kt.width,kt.height,We,kt.data):B.texSubImage2D(B.TEXTURE_2D,W,qe,tt,Me,Le,We,At,kt),B.pixelStorei(B.UNPACK_ROW_LENGTH,Bt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt),B.pixelStorei(B.UNPACK_SKIP_PIXELS,ln),B.pixelStorei(B.UNPACK_SKIP_ROWS,at),B.pixelStorei(B.UNPACK_SKIP_IMAGES,Be),W===0&&H.generateMipmaps&&B.generateMipmap(B.TEXTURE_2D),ae.unbindTexture()},this.copyTextureToTexture3D=function(L,H,J=null,K=null,W=0){L.isTexture!==!0&&(Mp("WebGLRenderer: copyTextureToTexture3D function signature has changed."),J=arguments[0]||null,K=arguments[1]||null,L=arguments[2],H=arguments[3],W=arguments[4]||0);let Me,Le,Ve,He,qe,tt,We,At,Bt;const Pt=L.isCompressedTexture?L.mipmaps[W]:L.image;J!==null?(Me=J.max.x-J.min.x,Le=J.max.y-J.min.y,Ve=J.max.z-J.min.z,He=J.min.x,qe=J.min.y,tt=J.min.z):(Me=Pt.width,Le=Pt.height,Ve=Pt.depth,He=0,qe=0,tt=0),K!==null?(We=K.x,At=K.y,Bt=K.z):(We=0,At=0,Bt=0);const ln=ie.convert(H.format),at=ie.convert(H.type);let Be;if(H.isData3DTexture)De.setTexture3D(H,0),Be=B.TEXTURE_3D;else if(H.isDataArrayTexture||H.isCompressedArrayTexture)De.setTexture2DArray(H,0),Be=B.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,H.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,H.unpackAlignment);const kt=B.getParameter(B.UNPACK_ROW_LENGTH),ut=B.getParameter(B.UNPACK_IMAGE_HEIGHT),rn=B.getParameter(B.UNPACK_SKIP_PIXELS),vi=B.getParameter(B.UNPACK_SKIP_ROWS),hn=B.getParameter(B.UNPACK_SKIP_IMAGES);B.pixelStorei(B.UNPACK_ROW_LENGTH,Pt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,He),B.pixelStorei(B.UNPACK_SKIP_ROWS,qe),B.pixelStorei(B.UNPACK_SKIP_IMAGES,tt),L.isDataTexture||L.isData3DTexture?B.texSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,at,Pt.data):H.isCompressedArrayTexture?B.compressedTexSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,Pt.data):B.texSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,at,Pt),B.pixelStorei(B.UNPACK_ROW_LENGTH,kt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,ut),B.pixelStorei(B.UNPACK_SKIP_PIXELS,rn),B.pixelStorei(B.UNPACK_SKIP_ROWS,vi),B.pixelStorei(B.UNPACK_SKIP_IMAGES,hn),W===0&&H.generateMipmaps&&B.generateMipmap(Be),ae.unbindTexture()},this.initRenderTarget=function(L){Ce.get(L).__webglFramebuffer===void 0&&De.setupRenderTarget(L)},this.initTexture=function(L){L.isCubeTexture?De.setTextureCube(L,0):L.isData3DTexture?De.setTexture3D(L,0):L.isDataArrayTexture||L.isCompressedArrayTexture?De.setTexture2DArray(L,0):De.setTexture2D(L,0),ae.unbindTexture()},this.resetState=function(){R=0,T=0,P=null,ae.reset(),be.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ea}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===iw?"display-p3":"srgb",t.unpackColorSpace=Mn.workingColorSpace===ly?"display-p3":"srgb"}}class cw{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new _t(e),this.density=t}clone(){return new cw(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class uw{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new _t(e),this.near=t,this.far=i}clone(){return new uw(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class E6 extends vn{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 Vs,this.environmentIntensity=1,this.environmentRotation=new Vs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class hw{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=d0,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Us()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Mp("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,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:gg.clone(),uv:Rs.getInterpolation(gg,Kx,yg,qx,xk,qb,Sk,new Je),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Zx(n,e,t,i,r,s){Rf.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(vg.x=s*Rf.x-r*Rf.y,vg.y=r*Rf.x+s*Rf.y):vg.copy(Rf),n.copy(e),n.x+=vg.x,n.y+=vg.y,n.applyMatrix4(T6)}const Qx=new ee,Mk=new ee;class C6 extends vn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Qx.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Qx);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Qx.setFromMatrixPosition(e.matrixWorld),Mk.setFromMatrixPosition(this.matrixWorld);const i=Qx.distanceTo(Mk)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}}const gc=new Dt,eC=new Dt,Ege=new Dt,Tge=new _t(1,1,1),Ik=new Dt,tC=new uy,n1=new Zr,Zu=new Rr,Sg=new ee,Lk=new ee,bge=new ee,nC=new wge,yr=new Li,i1=[];function Cge(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Nn(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Zr);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let i=0,r=t.length;i=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,i=this._matricesTexture,r=i.image.data;Ege.toArray(r,t*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(Tge.toArray(s.image.data,t*4),s.needsUpdate=!0),t}addGeometry(e,t=-1,i=-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 s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=e.getIndex(),u=c!==null;if(u&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&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 h=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:u?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Zr,sphereInitialized:!1,sphere:new Rr}),this.setGeometryAt(h,e),h}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const f in i.attributes){const v=t.getAttribute(f),_=i.getAttribute(f);Cge(v,_,l);const y=v.itemSize;for(let m=v.count,S=c;m=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let c=l.start,u=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,n1),n1.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let c=0;for(let u=l.start,h=l.start+l.count;u=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;yr.material=this.material,yr.geometry.index=o.index,yr.geometry.attributes=o.attributes,yr.geometry.boundingBox===null&&(yr.geometry.boundingBox=new Zr),yr.geometry.boundingSphere===null&&(yr.geometry.boundingSphere=new Rr);for(let a=0,l=i.length;a({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._drawInfo=e._drawInfo.map(t=>({...t})),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,h=this._drawRanges,d=this.perObjectFrustumCulled,f=this._indirectTexture,v=f.image.data;d&&(Ik.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),tC.setFromProjectionMatrix(Ik,e.coordinateSystem));let _=0;if(this.sortObjects){eC.copy(this.matrixWorld).invert(),Sg.setFromMatrixPosition(i.matrixWorld).applyMatrix4(eC),Lk.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(eC);for(let S=0,x=l.length;S0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;iC.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(iC);if(!(le.far))return{distance:l,point:Bk.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const Nk=new ee,Uk=new ee;class Ga extends Qc{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class Rge extends gi{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:Ii,this.magFilter=s!==void 0?s:Ii,this.generateMipmaps=!1;const u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Pge extends gi{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ji,this.minFilter=Ji,this.generateMipmaps=!1,this.needsUpdate=!0}}class fw extends gi{constructor(e,t,i,r,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,r,s,h,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Ige extends fw{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=mo,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Lge extends fw{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,kl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class Dge extends gi{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class na{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],d=i[r+1]-u,f=(o-u)/d;return(r+f)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Je:new ee);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new ee,r=[],s=[],o=[],a=new ee,l=new Dt;for(let f=0;f<=e;f++){const v=f/e;r[f]=this.getTangentAt(v,new ee)}s[0]=new ee,o[0]=new ee;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),d=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(pi(r[f-1].dot(r[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,v))}o[f].crossVectors(r[f],s[f])}if(t===!0){let f=Math.acos(pi(s[0].dot(s[e]),-1,1));f/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],f*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class pw extends na{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Je){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(l1.subVectors(r[0],r[1]).add(r[0]),c=l1);const h=r[a%s],d=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(kk(a,l.x,c.x,u.x,h.x),kk(a,l.y,c.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class hy extends tn{constructor(e=[new Je(0,-.5),new Je(.5,0),new Je(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=pi(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,h=new ee,d=new Je,f=new ee,v=new ee,_=new ee;let y=0,m=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:y=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,f.x=m*1,f.y=-y,f.z=m*0,_.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:y=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,f.x=m*1,f.y=-y,f.z=m*0,v.copy(f),f.x+=_.x,f.y+=_.y,f.z+=_.z,f.normalize(),l.push(f.x,f.y,f.z),_.copy(v)}for(let S=0;S<=t;S++){const x=i+S*u*r,M=Math.sin(x),R=Math.cos(x);for(let T=0;T<=e.length-1;T++){h.x=e[T].x*M,h.y=e[T].y,h.z=e[T].x*R,o.push(h.x,h.y,h.z),d.x=S/t,d.y=T/(e.length-1),a.push(d.x,d.y);const P=l[3*T+0]*M,I=l[3*T+1],b=l[3*T+0]*R;c.push(P,I,b)}}for(let S=0;S0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new wt(h,3)),this.setAttribute("normal",new wt(d,3)),this.setAttribute("uv",new wt(f,2));function S(){const M=new ee,R=new ee;let T=0;const P=(t-e)/i;for(let I=0;I<=s;I++){const b=[],w=I/s,N=w*(t-e)+e;for(let G=0;G<=r;G++){const V=G/r,$=V*l+a,Z=Math.sin($),X=Math.cos($);R.x=N*Z,R.y=-w*i+y,R.z=N*X,h.push(R.x,R.y,R.z),M.set(Z,P,X).normalize(),d.push(M.x,M.y,M.z),f.push(V,1-w),b.push(v++)}_.push(b)}for(let I=0;I.9&&P<.1&&(x<.2&&(o[S+0]+=1),M<.2&&(o[S+2]+=1),R<.2&&(o[S+4]+=1))}}function d(S){s.push(S.x,S.y,S.z)}function f(S,x){const M=S*3;x.x=e[M+0],x.y=e[M+1],x.z=e[M+2]}function v(){const S=new ee,x=new ee,M=new ee,R=new ee,T=new Je,P=new Je,I=new Je;for(let b=0,w=0;b80*t){a=c=n[0],l=u=n[1];for(let v=t;vc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?32767/f:0}return g0(s,o,t,a,l,f,0),o}};function z6(n,e,t,i,r){let s,o;if(r===ive(n,e,t,i)>0)for(s=e;s=e;s-=i)o=zk(s,n[s],n[s+1],o);return o&&_w(o,o.next)&&(y0(o),o=o.next),o}function hd(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(_w(t,t.next)||ii(t.prev,t,t.next)===0)){if(y0(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function g0(n,e,t,i,r,s,o){if(!n)return;!o&&s&&qge(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?Vge(n,i,r,s):Hge(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),y0(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=Wge(hd(n),e,t),g0(n,e,t,i,r,s,2)):o===2&&$ge(n,e,t,i,r,s):g0(hd(n),e,t,i,r,s,1);break}}}function Hge(n){const e=n.prev,t=n,i=n.next;if(ii(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=rs?r>o?r:o:s>o?s:o,f=a>l?a>c?a:c:l>c?l:c;let v=i.next;for(;v!==e;){if(v.x>=u&&v.x<=d&&v.y>=h&&v.y<=f&&cp(r,a,s,l,o,c,v.x,v.y)&&ii(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function Vge(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ii(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,h=s.y,d=o.y,f=al?a>c?a:c:l>c?l:c,y=u>h?u>d?u:d:h>d?h:d,m=_P(f,v,e,t,i),S=_P(_,y,e,t,i);let x=n.prevZ,M=n.nextZ;for(;x&&x.z>=m&&M&&M.z<=S;){if(x.x>=f&&x.x<=_&&x.y>=v&&x.y<=y&&x!==r&&x!==o&&cp(a,u,l,h,c,d,x.x,x.y)&&ii(x.prev,x,x.next)>=0||(x=x.prevZ,M.x>=f&&M.x<=_&&M.y>=v&&M.y<=y&&M!==r&&M!==o&&cp(a,u,l,h,c,d,M.x,M.y)&&ii(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;x&&x.z>=m;){if(x.x>=f&&x.x<=_&&x.y>=v&&x.y<=y&&x!==r&&x!==o&&cp(a,u,l,h,c,d,x.x,x.y)&&ii(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;M&&M.z<=S;){if(M.x>=f&&M.x<=_&&M.y>=v&&M.y<=y&&M!==r&&M!==o&&cp(a,u,l,h,c,d,M.x,M.y)&&ii(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function Wge(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!_w(r,s)&&G6(r,i,i.next,s)&&v0(r,s)&&v0(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),y0(i),y0(i.next),i=n=s),i=i.next}while(i!==n);return hd(i)}function $ge(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&eve(o,a)){let l=H6(o,a);o=hd(o,o.next),l=hd(l,l.next),g0(o,e,t,i,r,s,0),g0(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function Xge(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const d=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=s&&d>i&&(i=d,r=t.x=t.x&&t.x>=l&&s!==t.x&&cp(or.x||t.x===r.x&&Kge(r,t)))&&(r=t,u=h)),t=t.next;while(t!==a);return r}function Kge(n,e){return ii(n.prev,n,e.prev)<0&&ii(e.next,n,n.next)<0}function qge(n,e,t,i){let r=n;do r.z===0&&(r.z=_P(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,Zge(r)}function Zge(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function _P(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Qge(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function eve(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!tve(n,e)&&(v0(n,e)&&v0(e,n)&&nve(n,e)&&(ii(n.prev,n,e.prev)||ii(n,e.prev,e))||_w(n,e)&&ii(n.prev,n,n.next)>0&&ii(e.prev,e,e.next)>0)}function ii(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function _w(n,e){return n.x===e.x&&n.y===e.y}function G6(n,e,t,i){const r=f1(ii(n,e,t)),s=f1(ii(n,e,i)),o=f1(ii(t,i,n)),a=f1(ii(t,i,e));return!!(r!==s&&o!==a||r===0&&d1(n,t,e)||s===0&&d1(n,i,e)||o===0&&d1(t,n,i)||a===0&&d1(t,e,i))}function d1(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function f1(n){return n>0?1:n<0?-1:0}function tve(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&G6(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function v0(n,e){return ii(n.prev,n,n.next)<0?ii(n,e,n.next)>=0&&ii(n,n.prev,e)>=0:ii(n,e,n.prev)<0||ii(n,n.next,e)<0}function nve(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function H6(n,e){const t=new xP(n.i,n.x,n.y),i=new xP(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function zk(n,e,t,i){const r=new xP(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function y0(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function xP(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ive(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function Hk(n,e){for(let t=0;tNumber.EPSILON){const ce=Math.sqrt(Y),de=Math.sqrt(U*U+C*C),Ye=me.x-De/ce,Ae=me.y+Ce/ce,Ue=ge.x-C/de,st=ge.y+U/de,_e=((Ue-Ye)*C-(st-Ae)*U)/(Ce*C-De*U);Re=Ye+Ce*_e-B.x,ae=Ae+De*_e-B.y;const Ie=Re*Re+ae*ae;if(Ie<=2)return new Je(Re,ae);Xe=Math.sqrt(Ie/2)}else{let ce=!1;Ce>Number.EPSILON?U>Number.EPSILON&&(ce=!0):Ce<-Number.EPSILON?U<-Number.EPSILON&&(ce=!0):Math.sign(De)===Math.sign(C)&&(ce=!0),ce?(Re=-De,ae=Ce,Xe=Math.sqrt(Y)):(Re=Ce,ae=De,Xe=Math.sqrt(Y/2))}return new Je(Re/Xe,ae/Xe)}const Q=[];for(let B=0,me=$.length,ge=me-1,Re=B+1;B=0;B--){const me=B/y,ge=f*Math.cos(me*Math.PI/2),Re=v*Math.sin(me*Math.PI/2)+_;for(let ae=0,Xe=$.length;ae=0;){const Re=ge;let ae=ge-1;ae<0&&(ae=B.length-1);for(let Xe=0,Ce=u+y*2;Xe0)&&f.push(x,M,T),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class j6 extends Br{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new _t(16777215),this.specular=new _t(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Vs,this.combine=oy,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 Y6 extends Br{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _t(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class J6 extends Br{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class K6 extends Br{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new _t(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Vs,this.combine=oy,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 q6 extends Br{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _t(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Z6 extends ns{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 Dh(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function Q6(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function e$(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function SP(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function jL(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function ave(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){h.push(c.times[f]);for(let _=0;_s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const m=v*h+u,S=m+h-u;_=a.values.slice(m,S)}else{const m=a.createInterpolant(),S=u,x=h-u;m.evaluate(s),_=m.resultBuffer.slice(S,x)}l==="quaternion"&&new ps().fromArray(_).normalize().conjugate().toArray(_);const y=c.times.length;for(let m=0;m=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&Q6(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===J1,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}ia.prototype.TimeBufferType=Float32Array;ia.prototype.ValueBufferType=Float32Array;ia.prototype.DefaultInterpolation=zM;class Ed extends ia{constructor(e,t,i){super(e,t,i)}}Ed.prototype.ValueTypeName="bool";Ed.prototype.ValueBufferType=Array;Ed.prototype.DefaultInterpolation=a0;Ed.prototype.InterpolantFactoryMethodLinear=void 0;Ed.prototype.InterpolantFactoryMethodSmooth=void 0;class JL extends ia{}JL.prototype.ValueTypeName="color";class _0 extends ia{}_0.prototype.ValueTypeName="number";class i$ extends py{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)ps.slerpFlat(s,0,o,c-a,o,c,l);return s}}class my extends ia{InterpolantFactoryMethodLinear(e){return new i$(this.times,this.values,this.getValueSize(),e)}}my.prototype.ValueTypeName="quaternion";my.prototype.InterpolantFactoryMethodSmooth=void 0;class Td extends ia{constructor(e,t,i){super(e,t,i)}}Td.prototype.ValueTypeName="string";Td.prototype.ValueBufferType=Array;Td.prototype.DefaultInterpolation=a0;Td.prototype.InterpolantFactoryMethodLinear=void 0;Td.prototype.InterpolantFactoryMethodSmooth=void 0;class x0 extends ia{}x0.prototype.ValueTypeName="vector";class S0{constructor(e="",t=-1,i=[],r=nw){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Us(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(hve(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(ia.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const h=u[1];let d=r[h];d||(r[h]=d=[]),d.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,d,f,v,_){if(f.length!==0){const y=[],m=[];jL(f,y,m,v),y.length!==0&&_.push(new h(d,y,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(al[e]!==void 0){al[e].push({onLoad:t,onProgress:i,onError:r});return}al[e]=[],al[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=al[e],h=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,v=f!==0;let _=0;const y=new ReadableStream({start(m){S();function S(){h.read().then(({done:x,value:M})=>{if(x)m.close();else{_+=M.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:_,total:f});for(let T=0,P=u.length;T{m.error(x)})}}});return new Response(y)}else throw new dve(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(v=>f.decode(v))}}}).then(c=>{Sl.add(e,c);const u=al[e];delete al[e];for(let h=0,d=u.length;h{const u=al[e];if(u===void 0)throw this.manager.itemError(e),c;delete al[e];for(let h=0,d=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class fve extends ys{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Gl(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new _t().setHex(o.value);break;case"v2":r.uniforms[s].value=new Je().fromArray(o.value);break;case"v3":r.uniforms[s].value=new ee().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Cn().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Wt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Dt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Je().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Je().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:W6,SpriteMaterial:FL,RawShaderMaterial:$6,ShaderMaterial:Ko,PointsMaterial:kL,MeshPhysicalMaterial:X6,MeshStandardMaterial:XL,MeshPhongMaterial:j6,MeshToonMaterial:Y6,MeshNormalMaterial:J6,MeshLambertMaterial:K6,MeshDepthMaterial:NL,MeshDistanceMaterial:UL,MeshBasicMaterial:gu,MeshMatcapMaterial:q6,LineDashedMaterial:Z6,LineBasicMaterial:ns,Material:Br};return new t[e]}}class MP{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new KL(t);s=new M0(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){r=new M0(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const y=new Zr;y.min.fromArray(_.boxMin),y.max.fromArray(_.boxMax);const m=new Rr;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:y,sphereInitialized:_.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new C6;break;case"Line":o=new Qc(a(e.geometry),l(e.material));break;case"LineLoop":o=new L6(a(e.geometry),l(e.material));break;case"LineSegments":o=new Ga(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new D6(a(e.geometry),l(e.material));break;case"Sprite":o=new b6(l(e.material));break;case"Group":o=new lp;break;case"Bone":o=new OL;break;default:o=new vn}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let f=0;f"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Sl.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return Sl.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Sl.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Sl.add(e,l),s.manager.itemStart(e)}}let p1;class ZL{static getContext(){return p1===void 0&&(p1=new(window.AudioContext||window.webkitAudioContext)),p1}static setContext(e){p1=e}}class wve extends ys{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Gl(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);ZL.getContext().decodeAudioData(c,function(h){t(h)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const Kk=new Dt,qk=new Dt,Qu=new Dt;class Eve{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ir,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ir,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,Qu.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(jh*t.fov*.5)/t.zoom;let a,l;qk.elements[12]=-r,Kk.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Qu.elements[0]=2*t.near/(l-a),Qu.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Qu),a=-o*t.aspect-s,l=o*t.aspect-s,Qu.elements[0]=2*t.near/(l-a),Qu.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Qu)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(qk),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Kk)}}class m${constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Zk(),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=Zk();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Zk(){return(typeof performance>"u"?Date:performance).now()}const eh=new ee,Qk=new ps,Tve=new ee,th=new ee;class bve extends vn{constructor(){super(),this.type="AudioListener",this.context=ZL.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new m$}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(eh,Qk,Tve),th.set(0,0,-1).applyQuaternion(Qk),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(eh.x,r),t.positionY.linearRampToValueAtTime(eh.y,r),t.positionZ.linearRampToValueAtTime(eh.z,r),t.forwardX.linearRampToValueAtTime(th.x,r),t.forwardY.linearRampToValueAtTime(th.y,r),t.forwardZ.linearRampToValueAtTime(th.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(eh.x,eh.y,eh.z),t.setOrientation(th.x,th.y,th.z,i.x,i.y,i.z)}}class g$ extends vn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){ps.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;ps.multiplyQuaternionsFlat(e,o,e,t,e,i),ps.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const QL="\\[\\]\\.:\\/",Ive=new RegExp("["+QL+"]","g"),eD="[^"+QL+"]",Lve="[^"+QL.replace("\\.","")+"]",Dve=/((?:WC+[\/:])*)/.source.replace("WC",eD),Bve=/(WCOD+)?/.source.replace("WCOD",Lve),Nve=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",eD),Uve=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",eD),Fve=new RegExp("^"+Dve+Bve+Nve+Uve+"$"),Ove=["material","materials","bones","map"];class kve{constructor(e,t,i){const r=i||mn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class mn{constructor(e,t,i){this.path=t,this.parsedPath=i||mn.parseTrackName(t),this.node=mn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new mn.Composite(e,t,i):new mn(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Ive,"")}static parseTrackName(e){const t=Fve.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);Ove.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,v=r;f!==v;++f){const _=i[f],y=_[h],m=_[u];_[u]=y,_[h]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let v=0,_=r;v!==_;++v){const y=i[v];y[h]=y[d],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){const v=l[d];h[d]=new mn(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class y${constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Ph,endingEnd:Ph};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=qW,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case bL:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case nw:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===ZW;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===KW){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Ih,r.endingEnd=Ih):(e?r.endingStart=this.zeroSlopeAtStart?Ih:Ph:r.endingStart=l0,t?r.endingEnd=this.zeroSlopeAtEnd?Ih:Ph:r.endingEnd=l0)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const Gve=new Float32Array(1);class Hve extends za{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){const d=r[h],f=d.name;let v=u[f];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,f));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;v=new v$(mn.create(i,f,_),d.ValueTypeName,d.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,f),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=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,iz).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 rz=new ee,m1=new ee;class qve{constructor(e=new ee,t=new ee){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){rz.subVectors(e,this.start),m1.subVectors(this.end,this.start);const i=m1.dot(m1);let s=m1.dot(rz)/i;return t&&(s=pi(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const sz=new ee;class Zve extends vn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new tn,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{uz.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(uz,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class h0e extends Ga{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new tn;r.setAttribute("position",new wt(t,3)),r.setAttribute("color",new wt(i,3));const s=new ns({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new _t,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class d0e{constructor(){this.type="ShapePath",this.color=new _t,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new m0,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const S=[];for(let x=0,M=m.length;xNumber.EPSILON){if(w<0&&(P=S[T],b=-b,I=S[R],w=-w),m.yI.y)continue;if(m.y===P.y){if(m.x===P.x)return!0}else{const N=w*(m.x-P.x)-b*(m.y-P.y);if(N===0)return!0;if(N<0)continue;M=!M}}else{if(m.y!==P.y)continue;if(I.x<=m.x&&m.x<=P.x||P.x<=m.x&&m.x<=I.x)return!0}}return M}const r=Da.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Yh,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const h=[],d=[];let f=[],v=0,_;d[v]=void 0,f[v]=[];for(let m=0,S=s.length;m1){let m=!1,S=0;for(let x=0,M=d.length;x0&&m===!1&&(f=h)}let y;for(let m=0,S=d.length;me in n?v0e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ft=(n,e,t)=>(y0e(n,typeof e!="symbol"?e+"":e,t),t);const S1=new _d,dz=new dl,_0e=Math.cos(70*(Math.PI/180)),fz=(n,e)=>(n%e+e)%e;let x0e=class extends vs{constructor(e,t){super(),Ft(this,"object"),Ft(this,"domElement"),Ft(this,"enabled",!0),Ft(this,"target",new j),Ft(this,"minDistance",0),Ft(this,"maxDistance",1/0),Ft(this,"minZoom",0),Ft(this,"maxZoom",1/0),Ft(this,"minPolarAngle",0),Ft(this,"maxPolarAngle",Math.PI),Ft(this,"minAzimuthAngle",-1/0),Ft(this,"maxAzimuthAngle",1/0),Ft(this,"enableDamping",!1),Ft(this,"dampingFactor",.05),Ft(this,"enableZoom",!0),Ft(this,"zoomSpeed",1),Ft(this,"enableRotate",!0),Ft(this,"rotateSpeed",1),Ft(this,"enablePan",!0),Ft(this,"panSpeed",1),Ft(this,"screenSpacePanning",!0),Ft(this,"keyPanSpeed",7),Ft(this,"zoomToCursor",!1),Ft(this,"autoRotate",!1),Ft(this,"autoRotateSpeed",2),Ft(this,"reverseOrbit",!1),Ft(this,"reverseHorizontalOrbit",!1),Ft(this,"reverseVerticalOrbit",!1),Ft(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ft(this,"mouseButtons",{LEFT:uh.ROTATE,MIDDLE:uh.DOLLY,RIGHT:uh.PAN}),Ft(this,"touches",{ONE:hh.ROTATE,TWO:hh.DOLLY_PAN}),Ft(this,"target0"),Ft(this,"position0"),Ft(this,"zoom0"),Ft(this,"_domElementKeyEvents",null),Ft(this,"getPolarAngle"),Ft(this,"getAzimuthalAngle"),Ft(this,"setPolarAngle"),Ft(this,"setAzimuthalAngle"),Ft(this,"getDistance"),Ft(this,"listenToKeyEvents"),Ft(this,"stopListenToKeyEvents"),Ft(this,"saveState"),Ft(this,"reset"),Ft(this,"update"),Ft(this,"connect"),Ft(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=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=ie=>{let be=fz(ie,2*Math.PI),et=u.phi;et<0&&(et+=2*Math.PI),be<0&&(be+=2*Math.PI);let z=Math.abs(be-et);2*Math.PI-z{let be=fz(ie,2*Math.PI),et=u.theta;et<0&&(et+=2*Math.PI),be<0&&(be+=2*Math.PI);let z=Math.abs(be-et);2*Math.PI-zi.object.position.distanceTo(i.target),this.listenToKeyEvents=ie=>{ie.addEventListener("keydown",Ae),this._domElementKeyEvents=ie},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ae),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const ie=new j,be=new j(0,1,0),et=new qi().setFromUnitVectors(e.up,be),z=et.clone().invert(),ve=new j,oe=new qi,he=2*Math.PI;return function(){const Ze=i.object.position;et.setFromUnitVectors(e.up,be),z.copy(et).invert(),ie.copy(Ze).sub(i.target),ie.applyQuaternion(et),u.setFromVector3(ie),i.autoRotate&&l===a.NONE&&$(G()),i.enableDamping?(u.theta+=h.theta*i.dampingFactor,u.phi+=h.phi*i.dampingFactor):(u.theta+=h.theta,u.phi+=h.phi);let lt=i.minAzimuthAngle,Ct=i.maxAzimuthAngle;isFinite(lt)&&isFinite(Ct)&&(lt<-Math.PI?lt+=he:lt>Math.PI&&(lt-=he),Ct<-Math.PI?Ct+=he:Ct>Math.PI&&(Ct-=he),lt<=Ct?u.theta=Math.max(lt,Math.min(Ct,u.theta)):u.theta=u.theta>(lt+Ct)/2?Math.max(lt,u.theta):Math.min(Ct,u.theta)),u.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,u.phi)),u.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(f,i.dampingFactor):i.target.add(f),i.zoomToCursor&&b||i.object.isOrthographicCamera?u.radius=we(u.radius):u.radius=we(u.radius*d),ie.setFromSpherical(u),ie.applyQuaternion(z),Ze.copy(i.target).add(ie),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(h.theta*=1-i.dampingFactor,h.phi*=1-i.dampingFactor,f.multiplyScalar(1-i.dampingFactor)):(h.set(0,0,0),f.set(0,0,0));let zt=!1;if(i.zoomToCursor&&b){let vt=null;if(i.object instanceof Gn&&i.object.isPerspectiveCamera){const Ln=ie.length();vt=we(Ln*d);const Rn=Ln-vt;i.object.position.addScaledVector(P,Rn),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const Ln=new j(I.x,I.y,0);Ln.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/d)),i.object.updateProjectionMatrix(),zt=!0;const Rn=new j(I.x,I.y,0);Rn.unproject(i.object),i.object.position.sub(Rn).add(Ln),i.object.updateMatrixWorld(),vt=ie.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;vt!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(vt).add(i.object.position):(S1.origin.copy(i.object.position),S1.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(S1.direction))<_0e?e.lookAt(i.target):(dz.setFromNormalAndCoplanarPoint(i.object.up,i.target),S1.intersectPlane(dz,i.target))))}else i.object instanceof po&&i.object.isOrthographicCamera&&(zt=d!==1,zt&&(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/d)),i.object.updateProjectionMatrix()));return d=1,b=!1,zt||ve.distanceToSquared(i.object.position)>c||8*(1-oe.dot(i.object.quaternion))>c?(i.dispatchEvent(r),ve.copy(i.object.position),oe.copy(i.object.quaternion),zt=!1,!0):!1}})(),this.connect=ie=>{i.domElement=ie,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",_e),i.domElement.addEventListener("pointerdown",C),i.domElement.addEventListener("pointercancel",ue),i.domElement.addEventListener("wheel",Ye)},this.dispose=()=>{var ie,be,et,z,ve,oe;i.domElement&&(i.domElement.style.touchAction="auto"),(ie=i.domElement)==null||ie.removeEventListener("contextmenu",_e),(be=i.domElement)==null||be.removeEventListener("pointerdown",C),(et=i.domElement)==null||et.removeEventListener("pointercancel",ue),(z=i.domElement)==null||z.removeEventListener("wheel",Ye),(ve=i.domElement)==null||ve.ownerDocument.removeEventListener("pointermove",Y),(oe=i.domElement)==null||oe.ownerDocument.removeEventListener("pointerup",ue),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",Ae)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const c=1e-6,u=new nP,h=new nP;let d=1;const f=new j,v=new Fe,_=new Fe,y=new Fe,m=new Fe,S=new Fe,x=new Fe,M=new Fe,R=new Fe,T=new Fe,P=new j,I=new Fe;let b=!1;const w=[],N={};function G(){return 2*Math.PI/60/60*i.autoRotateSpeed}function V(){return Math.pow(.95,i.zoomSpeed)}function $(ie){i.reverseOrbit||i.reverseHorizontalOrbit?h.theta+=ie:h.theta-=ie}function Z(ie){i.reverseOrbit||i.reverseVerticalOrbit?h.phi+=ie:h.phi-=ie}const X=(()=>{const ie=new j;return function(et,z){ie.setFromMatrixColumn(z,0),ie.multiplyScalar(-et),f.add(ie)}})(),re=(()=>{const ie=new j;return function(et,z){i.screenSpacePanning===!0?ie.setFromMatrixColumn(z,1):(ie.setFromMatrixColumn(z,0),ie.crossVectors(i.object.up,ie)),ie.multiplyScalar(et),f.add(ie)}})(),O=(()=>{const ie=new j;return function(et,z){const ve=i.domElement;if(ve&&i.object instanceof Gn&&i.object.isPerspectiveCamera){const oe=i.object.position;ie.copy(oe).sub(i.target);let he=ie.length();he*=Math.tan(i.object.fov/2*Math.PI/180),X(2*et*he/ve.clientHeight,i.object.matrix),re(2*z*he/ve.clientHeight,i.object.matrix)}else ve&&i.object instanceof po&&i.object.isOrthographicCamera?(X(et*(i.object.right-i.object.left)/i.object.zoom/ve.clientWidth,i.object.matrix),re(z*(i.object.top-i.object.bottom)/i.object.zoom/ve.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function Q(ie){i.object instanceof Gn&&i.object.isPerspectiveCamera||i.object instanceof po&&i.object.isOrthographicCamera?d/=ie:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function te(ie){i.object instanceof Gn&&i.object.isPerspectiveCamera||i.object instanceof po&&i.object.isOrthographicCamera?d*=ie:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function le(ie){if(!i.zoomToCursor||!i.domElement)return;b=!0;const be=i.domElement.getBoundingClientRect(),et=ie.clientX-be.left,z=ie.clientY-be.top,ve=be.width,oe=be.height;I.x=et/ve*2-1,I.y=-(z/oe)*2+1,P.set(I.x,I.y,1).unproject(i.object).sub(i.object.position).normalize()}function we(ie){return Math.max(i.minDistance,Math.min(i.maxDistance,ie))}function Ne(ie){v.set(ie.clientX,ie.clientY)}function q(ie){le(ie),M.set(ie.clientX,ie.clientY)}function fe(ie){m.set(ie.clientX,ie.clientY)}function Te(ie){_.set(ie.clientX,ie.clientY),y.subVectors(_,v).multiplyScalar(i.rotateSpeed);const be=i.domElement;be&&($(2*Math.PI*y.x/be.clientHeight),Z(2*Math.PI*y.y/be.clientHeight)),v.copy(_),i.update()}function Se(ie){R.set(ie.clientX,ie.clientY),T.subVectors(R,M),T.y>0?Q(V()):T.y<0&&te(V()),M.copy(R),i.update()}function $e(ie){S.set(ie.clientX,ie.clientY),x.subVectors(S,m).multiplyScalar(i.panSpeed),O(x.x,x.y),m.copy(S),i.update()}function Qe(ie){le(ie),ie.deltaY<0?te(V()):ie.deltaY>0&&Q(V()),i.update()}function je(ie){let be=!1;switch(ie.code){case i.keys.UP:O(0,i.keyPanSpeed),be=!0;break;case i.keys.BOTTOM:O(0,-i.keyPanSpeed),be=!0;break;case i.keys.LEFT:O(i.keyPanSpeed,0),be=!0;break;case i.keys.RIGHT:O(-i.keyPanSpeed,0),be=!0;break}be&&(ie.preventDefault(),i.update())}function Ke(){if(w.length==1)v.set(w[0].pageX,w[0].pageY);else{const ie=.5*(w[0].pageX+w[1].pageX),be=.5*(w[0].pageY+w[1].pageY);v.set(ie,be)}}function B(){if(w.length==1)m.set(w[0].pageX,w[0].pageY);else{const ie=.5*(w[0].pageX+w[1].pageX),be=.5*(w[0].pageY+w[1].pageY);m.set(ie,be)}}function me(){const ie=w[0].pageX-w[1].pageX,be=w[0].pageY-w[1].pageY,et=Math.sqrt(ie*ie+be*be);M.set(0,et)}function ge(){i.enableZoom&&me(),i.enablePan&&B()}function Re(){i.enableZoom&&me(),i.enableRotate&&Ke()}function ae(ie){if(w.length==1)_.set(ie.pageX,ie.pageY);else{const et=ke(ie),z=.5*(ie.pageX+et.x),ve=.5*(ie.pageY+et.y);_.set(z,ve)}y.subVectors(_,v).multiplyScalar(i.rotateSpeed);const be=i.domElement;be&&($(2*Math.PI*y.x/be.clientHeight),Z(2*Math.PI*y.y/be.clientHeight)),v.copy(_)}function Xe(ie){if(w.length==1)S.set(ie.pageX,ie.pageY);else{const be=ke(ie),et=.5*(ie.pageX+be.x),z=.5*(ie.pageY+be.y);S.set(et,z)}x.subVectors(S,m).multiplyScalar(i.panSpeed),O(x.x,x.y),m.copy(S)}function Ce(ie){const be=ke(ie),et=ie.pageX-be.x,z=ie.pageY-be.y,ve=Math.sqrt(et*et+z*z);R.set(0,ve),T.set(0,Math.pow(R.y/M.y,i.zoomSpeed)),Q(T.y),M.copy(R)}function De(ie){i.enableZoom&&Ce(ie),i.enablePan&&Xe(ie)}function U(ie){i.enableZoom&&Ce(ie),i.enableRotate&&ae(ie)}function C(ie){var be,et;i.enabled!==!1&&(w.length===0&&((be=i.domElement)==null||be.ownerDocument.addEventListener("pointermove",Y),(et=i.domElement)==null||et.ownerDocument.addEventListener("pointerup",ue)),Ie(ie),ie.pointerType==="touch"?Ue(ie):ce(ie))}function Y(ie){i.enabled!==!1&&(ie.pointerType==="touch"?st(ie):de(ie))}function ue(ie){var be,et,z;pt(ie),w.length===0&&((be=i.domElement)==null||be.releasePointerCapture(ie.pointerId),(et=i.domElement)==null||et.ownerDocument.removeEventListener("pointermove",Y),(z=i.domElement)==null||z.ownerDocument.removeEventListener("pointerup",ue)),i.dispatchEvent(o),l=a.NONE}function ce(ie){let be;switch(ie.button){case 0:be=i.mouseButtons.LEFT;break;case 1:be=i.mouseButtons.MIDDLE;break;case 2:be=i.mouseButtons.RIGHT;break;default:be=-1}switch(be){case uh.DOLLY:if(i.enableZoom===!1)return;q(ie),l=a.DOLLY;break;case uh.ROTATE:if(ie.ctrlKey||ie.metaKey||ie.shiftKey){if(i.enablePan===!1)return;fe(ie),l=a.PAN}else{if(i.enableRotate===!1)return;Ne(ie),l=a.ROTATE}break;case uh.PAN:if(ie.ctrlKey||ie.metaKey||ie.shiftKey){if(i.enableRotate===!1)return;Ne(ie),l=a.ROTATE}else{if(i.enablePan===!1)return;fe(ie),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function de(ie){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;Te(ie);break;case a.DOLLY:if(i.enableZoom===!1)return;Se(ie);break;case a.PAN:if(i.enablePan===!1)return;$e(ie);break}}function Ye(ie){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(ie.preventDefault(),i.dispatchEvent(s),Qe(ie),i.dispatchEvent(o))}function Ae(ie){i.enabled===!1||i.enablePan===!1||je(ie)}function Ue(ie){switch(nt(ie),w.length){case 1:switch(i.touches.ONE){case hh.ROTATE:if(i.enableRotate===!1)return;Ke(),l=a.TOUCH_ROTATE;break;case hh.PAN:if(i.enablePan===!1)return;B(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case hh.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ge(),l=a.TOUCH_DOLLY_PAN;break;case hh.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Re(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function st(ie){switch(nt(ie),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;ae(ie),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;Xe(ie),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;De(ie),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;U(ie),i.update();break;default:l=a.NONE}}function _e(ie){i.enabled!==!1&&ie.preventDefault()}function Ie(ie){w.push(ie)}function pt(ie){delete N[ie.pointerId];for(let be=0;be=2.0 are supported."));return}const l=new eye(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function M0e(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const on={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 A0e{constructor(e){this.parser=e,this.name=on.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class F0e{constructor(e){this.parser=e,this.name=on.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class O0e{constructor(e){this.parser=e,this.name=on.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class k0e{constructor(e){this.name=on.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,c=r.byteLength||0,u=r.count,h=r.byteStride,d=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,h,d,r.mode,r.filter).then(function(f){return f.buffer}):o.ready.then(function(){const f=new ArrayBuffer(u*h);return o.decodeGltfBuffer(new Uint8Array(f),u,h,d,r.mode,r.filter),f})})}else return null}}class z0e{constructor(e){this.name=on.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==ao.TRIANGLES&&c.mode!==ao.TRIANGLE_STRIP&&c.mode!==ao.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(u=>(l[c]=u,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const u=c.pop(),h=u.isGroup?u.children:[u],d=c[0].count,f=[];for(const v of h){const _=new Rt,y=new j,m=new qi,S=new j(1,1,1),x=new HI(v.geometry,v.material,d);for(let M=0;M=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"},yc={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},j0e={CUBICSPLINE:void 0,LINEAR:Op,STEP:Fp},fC={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Y0e(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new iy({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Yo})),n.DefaultMaterial}function rh(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function ul(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function J0e(n,e,t){let i=!1,r=!1,s=!1;for(let c=0,u=e.length;c0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const Q0e=new Rt;class eye{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new M0e,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&s<98?this.textureLoader=new ry(this.options.manager):this.textureLoader=new L9(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Hs(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return rh(s,a,r),ul(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,u]of o.children.entries())s(u,a.children[c])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&y.setY(b,T[P*l+1]),l>=3&&y.setZ(b,T[P*l+2]),l>=4&&y.setW(b,T[P*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,i).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const d=(s.samplers||{})[o.sampler]||{};return u.magFilter=gz[d.magFilter]||Vn,u.minFilter=gz[d.minFilter]||fo,u.wrapS=vz[d.wrapS]||Jc,u.wrapT=vz[d.wrapT]||Jc,r.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){c=!0;const d=new Blob([h],{type:o.mimeType});return l=a.createObjectURL(d),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(h){return new Promise(function(d,f){let v=d;t.isImageBitmapLoader===!0&&(v=function(_){const y=new Yn(_);y.needsUpdate=!0,d(y)}),t.load(Vc.resolveURL(h,s.path),v,void 0,f)})}).then(function(h){return c===!0&&a.revokeObjectURL(l),ul(h,o),h.userData.mimeType=o.mimeType||Z0e(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=u,u}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[on.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[on.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[on.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&(typeof r=="number"&&(r=r===pz?Bh:Rl),"colorSpace"in o?o.colorSpace=r:o.encoding=r===Bh?pz:S0e),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new ny,mi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new Lr,mi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return iy}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},c=[];if(l[on.KHR_MATERIALS_UNLIT]){const h=r[on.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{const h=s.pbrMetallicRoughness||{};if(a.color=new ct(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const d=h.baseColorFactor;a.color.setRGB(d[0],d[1],d[2],Rl),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture,Bh)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Sr);const u=s.alphaMode||fC.OPAQUE;if(u===fC.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===fC.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Ls&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new Fe(1,1),s.normalTexture.scale!==void 0)){const h=s.normalTexture.scale;a.normalScale.set(h,h)}if(s.occlusionTexture!==void 0&&o!==Ls&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Ls){const h=s.emissiveFactor;a.emissive=new ct().setRGB(h[0],h[1],h[2],Rl)}return s.emissiveTexture!==void 0&&o!==Ls&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,Bh)),Promise.all(c).then(function(){const h=new o(a);return s.name&&(h.name=s.name),ul(h,s),t.associations.set(h,{materials:e}),s.extensions&&rh(r,h,s),h})}createUniqueName(e){const t=Dn.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[on.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return yz(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&K0e(m,s),m.name=t.createUniqueName(s.name||"mesh_"+e),ul(m,s),y.extensions&&rh(r,m,y),t.assignFinalMaterial(m),h.push(m)}for(let f=0,v=h.length;f1?u=new _l:c.length===1?u=c[0]:u=new wn,u!==c[0])for(let h=0,d=c.length;h{const h=new Map;for(const[d,f]of r.associations)(d instanceof mi||d instanceof Yn)&&h.set(d,f);return u.traverse(d=>{const f=r.associations.get(d);f!=null&&h.set(d,f)}),h};return r.associations=c(s),s})}_createAnimationTracks(e,t,i,r,s){const o=[],a=e.name?e.name:e.uuid,l=[];yc[s.path]===yc.weights?e.traverse(function(d){d.morphTargetInfluences&&l.push(d.name?d.name:d.uuid)}):l.push(a);let c;switch(yc[s.path]){case yc.weights:c=sd;break;case yc.rotation:c=od;break;case yc.position:case yc.scale:c=ad;break;default:switch(i.itemSize){case 1:c=sd;break;case 2:case 3:default:c=ad;break}break}const u=r.interpolation!==void 0?j0e[r.interpolation]:Op,h=this._getArrayFromAccessor(i);for(let d=0,f=l.length;d0,R=V>0,T=$>0,P=(M?1:0)+(R?1:0)+(T?1:0),P){case 0:{m.push(_[x]),m.push(_[x+1]),m.push(_[x+2]);break}case 1:{if(M&&(I=_[x+1],b=_[x+2],w=v(_[x],I,y,S),N=v(_[x],b,y,S)),R){I=_[x],b=_[x+2],w=v(_[x+1],I,y,S),N=v(_[x+1],b,y,S),m.push(w),m.push(b.clone()),m.push(I.clone()),m.push(b.clone()),m.push(w.clone()),m.push(N);break}T&&(I=_[x],b=_[x+1],w=v(_[x+2],I,y,S),N=v(_[x+2],b,y,S)),m.push(I.clone()),m.push(b.clone()),m.push(w),m.push(N),m.push(w.clone()),m.push(b.clone());break}case 2:{M||(I=_[x].clone(),b=v(I,_[x+1],y,S),w=v(I,_[x+2],y,S),m.push(I),m.push(b),m.push(w)),R||(I=_[x+1].clone(),b=v(I,_[x+2],y,S),w=v(I,_[x],y,S),m.push(I),m.push(b),m.push(w)),T||(I=_[x+2].clone(),b=v(I,_[x],y,S),w=v(I,_[x+1],y,S),m.push(I),m.push(b),m.push(w));break}}}return m}function v(_,y,m,S){const x=_.position.dot(m)-S,M=y.position.dot(m)-S,R=x/(x-M);return new _z(new j(_.position.x+R*(y.position.x-_.position.x),_.position.y+R*(y.position.y-_.position.y),_.position.z+R*(y.position.z-_.position.z)),new j(_.normal.x+R*(y.normal.x-_.normal.x),_.normal.y+R*(y.normal.y-_.normal.y),_.normal.z+R*(y.normal.z-_.normal.z)))}}}class _z{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}const mC=new WeakMap;class iye extends Dr{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,r){const s=new Hs(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}const i=JSON.stringify(t);if(mC.has(e)){const l=mC.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((c,u)=>{r._callbacks[s]={resolve:c,reject:u},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),mC.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new Vt;e.index&&t.setIndex(new un(e.index.array,1));for(let i=0;i{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=rye.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{const v=t(h,d,f,c),_=v.attributes.map(y=>y.array.buffer);v.index&&_.push(v.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:v},_)}catch(v){console.error(v),self.postMessage({type:"error",id:a.id,error:v.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){const u=c.attributeIDs,h=c.attributeTypes;let d,f;const v=a.GetEncodedGeometryType(l);if(v===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(v===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const _={index:null,attributes:[]};for(const y in u){const m=self[h[y]];let S,x;if(c.useUniqueIDs)x=u[y],S=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[y]]),x===-1)continue;S=a.GetAttribute(d,x)}_.attributes.push(r(o,a,d,y,m,S))}return v===o.TRIANGULAR_MESH&&(_.index=i(o,a,d)),o.destroy(d),_}function i(o,a,l){const u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);const f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function r(o,a,l,c,u,h){const d=h.num_components(),v=l.num_points()*d,_=v*u.BYTES_PER_ELEMENT,y=s(o,u),m=o._malloc(_);a.GetAttributeDataArrayForAllPoints(l,h,y,_,m);const S=new u(o.HEAPF32.buffer,m,v).slice();return o._free(m),{name:c,array:S,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let M1;const gC=()=>{if(M1)return M1;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(h=>{s=h.instance,s.exports.__wasm_call_ctors()});function a(h){const d=new Uint8Array(h.length);for(let v=0;v96?_-71:_>64?_-65:_>47?_+4:_>46?63:62}let f=0;for(let v=0;vn===Object(n)&&!Array.isArray(n)&&typeof n!="function";function rD(n,e){const t=Wr(s=>s.gl),i=pu(ry,vC(n)?Object.values(n):n);return se.useLayoutEffect(()=>{e==null||e(i)},[e]),se.useEffect(()=>{if("initTexture"in t){let s=[];Array.isArray(i)?s=i:i instanceof Yn?s=[i]:vC(i)&&(s=Object.values(i)),s.forEach(o=>{o instanceof Yn&&t.initTexture(o)})}},[t,i]),se.useMemo(()=>{if(vC(n)){const s={};let o=0;for(const a in n)s[a]=i[o++];return s}else return i},[n,i])}rD.preload=n=>pu.preload(ry,n);rD.clear=n=>pu.clear(ry,n);const sye=()=>parseInt(uu.replace(/\D+/g,"")),M$=sye();function oye(n){return Array.isArray(n)}function yC(n=[0,0,0]){return oye(n)?n:n instanceof j||n instanceof Gs?[n.x,n.y,n.z]:[n,n,n]}const aye=se.forwardRef(function({debug:e,depthTest:t=!1,polygonOffsetFactor:i=-10,map:r,mesh:s,children:o,position:a,rotation:l,scale:c,...u},h){const d=se.useRef(null);se.useImperativeHandle(h,()=>d.current);const f=se.useRef(null);return se.useLayoutEffect(()=>{const v=(s==null?void 0:s.current)||d.current.parent,_=d.current;if(!(v instanceof si))throw new Error('Decal must have a Mesh as parent or specify its "mesh" prop');const y={position:new j,rotation:new Gs,scale:new j(1,1,1)};if(v){xa(y,{position:a,scale:c});const m=v.matrixWorld.clone();if(v.matrixWorld.identity(),!l||typeof l=="number"){const S=new wn;S.position.copy(y.position),S.lookAt(v.position),typeof l=="number"&&S.rotateZ(l),xa(y,{rotation:S.rotation})}else xa(y,{rotation:l});return _.geometry=new nye(v,y.position,y.rotation,y.scale),f.current&&(xa(f.current,y),f.current.traverse(S=>S.raycast=()=>null)),v.matrixWorld=m,()=>{_.geometry.dispose()}}},[s,...yC(a),...yC(c),...yC(l)]),se.createElement("mesh",Ua({ref:d,"material-transparent":!0,"material-polygonOffset":!0,"material-polygonOffsetFactor":i,"material-depthTest":t,"material-map":r},u),o,e&&se.createElement("mesh",{ref:f},se.createElement("boxGeometry",null),se.createElement("meshNormalMaterial",{wireframe:!0}),se.createElement("axesHelper",null)))});let A1=null,A$="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function w$(n,e,t){return i=>{t&&t(i),n&&(A1||(A1=new iye),A1.setDecoderPath(typeof n=="string"?n:A$),i.setDRACOLoader(A1)),e&&i.setMeshoptDecoder(typeof gC=="function"?gC():gC)}}function gy(n,e=!0,t=!0,i){return pu(iD,n,w$(e,t,i))}gy.preload=(n,e=!0,t=!0,i)=>pu.preload(iD,n,w$(e,t,i));gy.clear=n=>pu.clear(iD,n);gy.setDecoderPath=n=>{A$=n};const sD=se.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...c},u)=>{const h=Wr(T=>T.invalidate),d=Wr(T=>T.camera),f=Wr(T=>T.gl),v=Wr(T=>T.events),_=Wr(T=>T.setEvents),y=Wr(T=>T.set),m=Wr(T=>T.get),S=Wr(T=>T.performance),x=e||d,M=i||v.connected||f.domElement,R=se.useMemo(()=>new x0e(x),[x]);return Ad(()=>{R.enabled&&R.update()},-1),se.useEffect(()=>(s&&R.connect(s===!0?M:s),R.connect(M),()=>void R.dispose()),[s,M,t,R,h]),se.useEffect(()=>{const T=b=>{h(),t&&S.regress(),o&&o(b)},P=b=>{a&&a(b)},I=b=>{l&&l(b)};return R.addEventListener("change",T),R.addEventListener("start",P),R.addEventListener("end",I),()=>{R.removeEventListener("start",P),R.removeEventListener("end",I),R.removeEventListener("change",T)}},[o,a,l,R,h,_]),se.useEffect(()=>{if(n){const T=m().controls;return y({controls:R}),()=>y({controls:T})}},[n,R]),se.createElement("primitive",Ua({ref:u,object:R,enableDamping:r},c))});var E$={exports:{}},lye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",cye=lye,uye=cye;function T$(){}function b$(){}b$.resetWarningCache=T$;var hye=function(){function n(i,r,s,o,a,l){if(l!==uye){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:b$,resetWarningCache:T$};return t.PropTypes=t,t};E$.exports=hye();var C$=E$.exports;const _C=M$>=154?"opaque_fragment":"output_fragment";class dye extends ny{constructor(e){super(e),this.onBeforeCompile=(t,i)=>{const{isWebGL2:r}=i.capabilities;t.fragmentShader=t.fragmentShader.replace(`#include <${_C}>`,` - ${r?`#include <${_C}>`:`#extension GL_OES_standard_derivatives : enable -#include <${_C}>`} +}`;class vge{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new gi,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Ko({vertexShader:mge,fragmentShader:gge,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Li(new dm(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class yge extends za{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,d=null,f=null,v=null;const _=new vge,y=t.getContextAttributes();let m=null,S=null;const x=[],M=[],R=new Je;let T=null;const P=new ir;P.layers.enable(1),P.viewport=new Cn;const I=new ir;I.layers.enable(2),I.viewport=new Cn;const b=[P,I],w=new C6;w.layers.enable(1),w.layers.enable(2);let N=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let fe=x[q];return fe===void 0&&(fe=new Yb,x[q]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(q){let fe=x[q];return fe===void 0&&(fe=new Yb,x[q]=fe),fe.getGripSpace()},this.getHand=function(q){let fe=x[q];return fe===void 0&&(fe=new Yb,x[q]=fe),fe.getHandSpace()};function V(q){const fe=M.indexOf(q.inputSource);if(fe===-1)return;const Te=x[fe];Te!==void 0&&(Te.update(q.inputSource,q.frame,c||o),Te.dispatchEvent({type:q.type,data:q.inputSource}))}function $(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",$),r.removeEventListener("inputsourceschange",Z);for(let q=0;q=0&&(M[Se]=null,x[Se].disconnect(Te))}for(let fe=0;fe=M.length){M.push(Te),Se=Qe;break}else if(M[Qe]===null){M[Qe]=Te,Se=Qe;break}if(Se===-1)break}const $e=x[Se];$e&&$e.connect(Te)}}const X=new ee,re=new ee;function O(q,fe,Te){X.setFromMatrixPosition(fe.matrixWorld),re.setFromMatrixPosition(Te.matrixWorld);const Se=X.distanceTo(re),$e=fe.projectionMatrix.elements,Qe=Te.projectionMatrix.elements,je=$e[14]/($e[10]-1),Ke=$e[14]/($e[10]+1),B=($e[9]+1)/$e[5],me=($e[9]-1)/$e[5],ge=($e[8]-1)/$e[0],Re=(Qe[8]+1)/Qe[0],ae=je*ge,Xe=je*Re,Ce=Se/(-ge+Re),De=Ce*-ge;if(fe.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(De),q.translateZ(Ce),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),$e[10]===-1)q.projectionMatrix.copy(fe.projectionMatrix),q.projectionMatrixInverse.copy(fe.projectionMatrixInverse);else{const U=je+Ce,C=Ke+Ce,Y=ae-De,ue=Xe+(Se-De),ce=B*Ke/C*U,de=me*Ke/C*U;q.projectionMatrix.makePerspective(Y,ue,ce,de,U,C),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function Q(q,fe){fe===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(fe.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(r===null)return;let fe=q.near,Te=q.far;_.texture!==null&&(_.depthNear>0&&(fe=_.depthNear),_.depthFar>0&&(Te=_.depthFar)),w.near=I.near=P.near=fe,w.far=I.far=P.far=Te,(N!==w.near||G!==w.far)&&(r.updateRenderState({depthNear:w.near,depthFar:w.far}),N=w.near,G=w.far);const Se=q.parent,$e=w.cameras;Q(w,Se);for(let Qe=0;Qe<$e.length;Qe++)Q($e[Qe],Se);$e.length===2?O(w,P,I):w.projectionMatrix.copy(P.projectionMatrix),te(q,w,Se)};function te(q,fe,Te){Te===null?q.matrix.copy(fe.matrixWorld):(q.matrix.copy(Te.matrixWorld),q.matrix.invert(),q.matrix.multiply(fe.matrixWorld)),q.matrix.decompose(q.position,q.quaternion,q.scale),q.updateMatrixWorld(!0),q.projectionMatrix.copy(fe.projectionMatrix),q.projectionMatrixInverse.copy(fe.projectionMatrixInverse),q.isPerspectiveCamera&&(q.fov=jp*2*Math.atan(1/q.projectionMatrix.elements[5]),q.zoom=1)}this.getCamera=function(){return w},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(q){l=q,d!==null&&(d.fixedFoveation=q),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=q)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(w)};let le=null;function we(q,fe){if(u=fe.getViewerPose(c||o),v=fe,u!==null){const Te=u.views;f!==null&&(e.setRenderTargetFramebuffer(S,f.framebuffer),e.setRenderTarget(S));let Se=!1;Te.length!==w.cameras.length&&(w.cameras.length=0,Se=!0);for(let Qe=0;Qe0&&(y.alphaTest.value=m.alphaTest);const S=e.get(m),x=S.envMap,M=S.envMapRotation;x&&(y.envMap.value=x,qu.copy(M),qu.x*=-1,qu.y*=-1,qu.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(qu.y*=-1,qu.z*=-1),y.envMapRotation.value.setFromMatrix4(_ge.makeRotationFromEuler(qu)),y.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=m.reflectivity,y.ior.value=m.ior,y.refractionRatio.value=m.refractionRatio),m.lightMap&&(y.lightMap.value=m.lightMap,y.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,y.lightMapTransform)),m.aoMap&&(y.aoMap.value=m.aoMap,y.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,y.aoMapTransform))}function o(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform))}function a(y,m){y.dashSize.value=m.dashSize,y.totalSize.value=m.dashSize+m.gapSize,y.scale.value=m.scale}function l(y,m,S,x){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.size.value=m.size*S,y.scale.value=x*.5,m.map&&(y.map.value=m.map,t(m.map,y.uvTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function c(y,m){y.diffuse.value.copy(m.color),y.opacity.value=m.opacity,y.rotation.value=m.rotation,m.map&&(y.map.value=m.map,t(m.map,y.mapTransform)),m.alphaMap&&(y.alphaMap.value=m.alphaMap,t(m.alphaMap,y.alphaMapTransform)),m.alphaTest>0&&(y.alphaTest.value=m.alphaTest)}function u(y,m){y.specular.value.copy(m.specular),y.shininess.value=Math.max(m.shininess,1e-4)}function h(y,m){m.gradientMap&&(y.gradientMap.value=m.gradientMap)}function d(y,m){y.metalness.value=m.metalness,m.metalnessMap&&(y.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,y.metalnessMapTransform)),y.roughness.value=m.roughness,m.roughnessMap&&(y.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,y.roughnessMapTransform)),m.envMap&&(y.envMapIntensity.value=m.envMapIntensity)}function f(y,m,S){y.ior.value=m.ior,m.sheen>0&&(y.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),y.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(y.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,y.sheenColorMapTransform)),m.sheenRoughnessMap&&(y.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,y.sheenRoughnessMapTransform))),m.clearcoat>0&&(y.clearcoat.value=m.clearcoat,y.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(y.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,y.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(y.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===qr&&y.clearcoatNormalScale.value.negate())),m.dispersion>0&&(y.dispersion.value=m.dispersion),m.iridescence>0&&(y.iridescence.value=m.iridescence,y.iridescenceIOR.value=m.iridescenceIOR,y.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(y.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,y.iridescenceMapTransform)),m.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),m.transmission>0&&(y.transmission.value=m.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),m.transmissionMap&&(y.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,y.transmissionMapTransform)),y.thickness.value=m.thickness,m.thicknessMap&&(y.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=m.attenuationDistance,y.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(y.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(y.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=m.specularIntensity,y.specularColor.value.copy(m.specularColor),m.specularColorMap&&(y.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,y.specularColorMapTransform)),m.specularIntensityMap&&(y.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,m){m.matcap&&(y.matcap.value=m.matcap)}function _(y,m){const S=e.get(m).light;y.referencePosition.value.setFromMatrixPosition(S.matrixWorld),y.nearDistance.value=S.shadow.camera.near,y.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function Sge(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,x){const M=x.program;i.uniformBlockBinding(S,M)}function c(S,x){let M=r[S.id];M===void 0&&(v(S),M=u(S),r[S.id]=M,S.addEventListener("dispose",y));const R=x.program;i.updateUBOMapping(S,R);const T=e.render.frame;s[S.id]!==T&&(d(S),s[S.id]=T)}function u(S){const x=h();S.__bindingPointIndex=x;const M=n.createBuffer(),R=S.__size,T=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,R,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,x,M),M}function h(){for(let S=0;S0&&(M+=R-T),S.__size=M,S.__cache={},this}function _(S){const x={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(x.boundary=4,x.storage=4):S.isVector2?(x.boundary=8,x.storage=8):S.isVector3||S.isColor?(x.boundary=16,x.storage=12):S.isVector4?(x.boundary=16,x.storage=16):S.isMatrix3?(x.boundary=48,x.storage=48):S.isMatrix4?(x.boundary=64,x.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),x}function y(S){const x=S.target;x.removeEventListener("dispose",y);const M=o.indexOf(x.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function m(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:c,dispose:m}}class Mge{constructor(e={}){const{canvas:t=p6(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=o;const f=new Uint32Array(4),v=new Int32Array(4);let _=null,y=null;const m=[],S=[];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=lo,this.toneMapping=Cl,this.toneMappingExposure=1;const x=this;let M=!1,R=0,T=0,P=null,I=-1,b=null;const w=new Cn,N=new Cn;let G=null;const V=new _t(0);let $=0,Z=t.width,X=t.height,re=1,O=null,Q=null;const te=new Cn(0,0,Z,X),le=new Cn(0,0,Z,X);let we=!1;const Ne=new cy;let q=!1,fe=!1;const Te=new Dt,Se=new ee,$e=new Cn,Qe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let je=!1;function Ke(){return P===null?re:1}let B=i;function me(L,H){return t.getContext(L,H)}try{const L={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${XA}`),t.addEventListener("webglcontextlost",oe,!1),t.addEventListener("webglcontextrestored",he,!1),t.addEventListener("webglcontextcreationerror",Ee,!1),B===null){const H="webgl2";if(B=me(H,L),B===null)throw me(H)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw console.error("THREE.WebGLRenderer: "+L.message),L}let ge,Re,ae,Xe,Ce,De,U,C,Y,ue,ce,de,Ye,Ae,Ue,st,_e,Ie,pt,nt,ke,ie,be,et;function z(){ge=new Cpe(B),ge.init(),ie=new b6(B,ge),Re=new Mpe(B,ge,e,ie),ae=new age(B),Xe=new Ipe(B),Ce=new Jme,De=new fge(B,ge,ae,Ce,Re,ie,Xe),U=new wpe(x),C=new bpe(x),Y=new Ohe(B),be=new xpe(B,Y),ue=new Rpe(B,Y,Xe,be),ce=new Dpe(B,ue,Y,Xe),pt=new Lpe(B,Re,De),st=new Ape(Ce),de=new Yme(x,U,C,ge,Re,be,st),Ye=new xge(x,Ce),Ae=new qme,Ue=new ige(ge),Ie=new _pe(x,U,C,ae,ce,d,l),_e=new oge(x,ce,Re),et=new Sge(B,Xe,Re,ae),nt=new Spe(B,ge,Xe),ke=new Ppe(B,ge,Xe),Xe.programs=de.programs,x.capabilities=Re,x.extensions=ge,x.properties=Ce,x.renderLists=Ae,x.shadowMap=_e,x.state=ae,x.info=Xe}z();const ve=new yge(x,B);this.xr=ve,this.getContext=function(){return B},this.getContextAttributes=function(){return B.getContextAttributes()},this.forceContextLoss=function(){const L=ge.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=ge.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return re},this.setPixelRatio=function(L){L!==void 0&&(re=L,this.setSize(Z,X,!1))},this.getSize=function(L){return L.set(Z,X)},this.setSize=function(L,H,J=!0){if(ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Z=L,X=H,t.width=Math.floor(L*re),t.height=Math.floor(H*re),J===!0&&(t.style.width=L+"px",t.style.height=H+"px"),this.setViewport(0,0,L,H)},this.getDrawingBufferSize=function(L){return L.set(Z*re,X*re).floor()},this.setDrawingBufferSize=function(L,H,J){Z=L,X=H,re=J,t.width=Math.floor(L*J),t.height=Math.floor(H*J),this.setViewport(0,0,L,H)},this.getCurrentViewport=function(L){return L.copy(w)},this.getViewport=function(L){return L.copy(te)},this.setViewport=function(L,H,J,K){L.isVector4?te.set(L.x,L.y,L.z,L.w):te.set(L,H,J,K),ae.viewport(w.copy(te).multiplyScalar(re).round())},this.getScissor=function(L){return L.copy(le)},this.setScissor=function(L,H,J,K){L.isVector4?le.set(L.x,L.y,L.z,L.w):le.set(L,H,J,K),ae.scissor(N.copy(le).multiplyScalar(re).round())},this.getScissorTest=function(){return we},this.setScissorTest=function(L){ae.setScissorTest(we=L)},this.setOpaqueSort=function(L){O=L},this.setTransparentSort=function(L){Q=L},this.getClearColor=function(L){return L.copy(Ie.getClearColor())},this.setClearColor=function(){Ie.setClearColor.apply(Ie,arguments)},this.getClearAlpha=function(){return Ie.getClearAlpha()},this.setClearAlpha=function(){Ie.setClearAlpha.apply(Ie,arguments)},this.clear=function(L=!0,H=!0,J=!0){let K=0;if(L){let W=!1;if(P!==null){const Me=P.texture.format;W=Me===QA||Me===ZA||Me===oy}if(W){const Me=P.texture.type,Le=Me===Fa||Me===kl||Me===Xp||Me===ld||Me===JA||Me===KA,Ve=Ie.getClearColor(),He=Ie.getClearAlpha(),qe=Ve.r,tt=Ve.g,We=Ve.b;Le?(f[0]=qe,f[1]=tt,f[2]=We,f[3]=He,B.clearBufferuiv(B.COLOR,0,f)):(v[0]=qe,v[1]=tt,v[2]=We,v[3]=He,B.clearBufferiv(B.COLOR,0,v))}else K|=B.COLOR_BUFFER_BIT}H&&(K|=B.DEPTH_BUFFER_BIT),J&&(K|=B.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),B.clear(K)},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",oe,!1),t.removeEventListener("webglcontextrestored",he,!1),t.removeEventListener("webglcontextcreationerror",Ee,!1),Ae.dispose(),Ue.dispose(),Ce.dispose(),U.dispose(),C.dispose(),ce.dispose(),be.dispose(),et.dispose(),de.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Rn),ve.removeEventListener("sessionend",xu),Qi.stop()};function oe(L){L.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function he(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const L=Xe.autoReset,H=_e.enabled,J=_e.autoUpdate,K=_e.needsUpdate,W=_e.type;z(),Xe.autoReset=L,_e.enabled=H,_e.autoUpdate=J,_e.needsUpdate=K,_e.type=W}function Ee(L){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Ze(L){const H=L.target;H.removeEventListener("dispose",Ze),lt(H)}function lt(L){Ct(L),Ce.remove(L)}function Ct(L){const H=Ce.get(L).programs;H!==void 0&&(H.forEach(function(J){de.releaseProgram(J)}),L.isShaderMaterial&&de.releaseShaderCache(L))}this.renderBufferDirect=function(L,H,J,K,W,Me){H===null&&(H=Qe);const Le=W.isMesh&&W.matrixWorld.determinant()<0,Ve=vm(L,H,J,K,W);ae.setMaterial(K,Le);let He=J.index,qe=1;if(K.wireframe===!0){if(He=ue.getWireframeAttribute(J),He===void 0)return;qe=2}const tt=J.drawRange,We=J.attributes.position;let At=tt.start*qe,Bt=(tt.start+tt.count)*qe;Me!==null&&(At=Math.max(At,Me.start*qe),Bt=Math.min(Bt,(Me.start+Me.count)*qe)),He!==null?(At=Math.max(At,0),Bt=Math.min(Bt,He.count)):We!=null&&(At=Math.max(At,0),Bt=Math.min(Bt,We.count));const Pt=Bt-At;if(Pt<0||Pt===1/0)return;be.setup(W,K,Ve,J,He);let ln,at=nt;if(He!==null&&(ln=Y.get(He),at=ke,at.setIndex(ln)),W.isMesh)K.wireframe===!0?(ae.setLineWidth(K.wireframeLinewidth*Ke()),at.setMode(B.LINES)):at.setMode(B.TRIANGLES);else if(W.isLine){let Be=K.linewidth;Be===void 0&&(Be=1),ae.setLineWidth(Be*Ke()),W.isLineSegments?at.setMode(B.LINES):W.isLineLoop?at.setMode(B.LINE_LOOP):at.setMode(B.LINE_STRIP)}else W.isPoints?at.setMode(B.POINTS):W.isSprite&&at.setMode(B.TRIANGLES);if(W.isBatchedMesh)if(W._multiDrawInstances!==null)at.renderMultiDrawInstances(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount,W._multiDrawInstances);else if(ge.get("WEBGL_multi_draw"))at.renderMultiDraw(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount);else{const Be=W._multiDrawStarts,kt=W._multiDrawCounts,ut=W._multiDrawCount,rn=He?Y.get(He).bytesPerElement:1,vi=Ce.get(K).currentProgram.getUniforms();for(let hn=0;hn{function Me(){if(K.forEach(function(Le){Ce.get(Le).currentProgram.isReady()&&K.delete(Le)}),K.size===0){W(L);return}setTimeout(Me,10)}ge.get("KHR_parallel_shader_compile")!==null?Me():setTimeout(Me,10)})};let vt=null;function In(L){vt&&vt(L)}function Rn(){Qi.stop()}function xu(){Qi.start()}const Qi=new M6;Qi.setAnimationLoop(In),typeof self<"u"&&Qi.setContext(self),this.setAnimationLoop=function(L){vt=L,ve.setAnimationLoop(L),L===null?Qi.stop():Qi.start()},ve.addEventListener("sessionstart",Rn),ve.addEventListener("sessionend",xu),this.render=function(L,H){if(H!==void 0&&H.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),H.parent===null&&H.matrixWorldAutoUpdate===!0&&H.updateMatrixWorld(),ve.enabled===!0&&ve.isPresenting===!0&&(ve.cameraAutoUpdate===!0&&ve.updateCamera(H),H=ve.getCamera()),L.isScene===!0&&L.onBeforeRender(x,L,H,P),y=Ue.get(L,S.length),y.init(H),S.push(y),Te.multiplyMatrices(H.projectionMatrix,H.matrixWorldInverse),Ne.setFromProjectionMatrix(Te),fe=this.localClippingEnabled,q=st.init(this.clippingPlanes,fe),_=Ae.get(L,m.length),_.init(),m.push(_),ve.enabled===!0&&ve.isPresenting===!0){const Me=x.xr.getDepthSensingMesh();Me!==null&&Ha(Me,H,-1/0,x.sortObjects)}Ha(L,H,0,x.sortObjects),_.finish(),x.sortObjects===!0&&_.sort(O,Q),je=ve.enabled===!1||ve.isPresenting===!1||ve.hasDepthSensing()===!1,je&&Ie.addToRenderList(_,L),this.info.render.frame++,q===!0&&st.beginShadows();const J=y.state.shadowsArray;_e.render(J,L,H),q===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset();const K=_.opaque,W=_.transmissive;if(y.setupLights(),H.isArrayCamera){const Me=H.cameras;if(W.length>0)for(let Le=0,Ve=Me.length;Le0&&Va(K,W,L,H),je&&Ie.render(L),Wl(_,L,H);P!==null&&(De.updateMultisampleRenderTarget(P),De.updateRenderTargetMipmap(P)),L.isScene===!0&&L.onAfterRender(x,L,H),be.resetDefaultState(),I=-1,b=null,S.pop(),S.length>0?(y=S[S.length-1],q===!0&&st.setGlobalState(x.clippingPlanes,y.state.camera)):y=null,m.pop(),m.length>0?_=m[m.length-1]:_=null};function Ha(L,H,J,K){if(L.visible===!1)return;if(L.layers.test(H.layers)){if(L.isGroup)J=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(H);else if(L.isLight)y.pushLight(L),L.castShadow&&y.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||Ne.intersectsSprite(L)){K&&$e.setFromMatrixPosition(L.matrixWorld).applyMatrix4(Te);const Le=ce.update(L),Ve=L.material;Ve.visible&&_.push(L,Le,Ve,J,$e.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||Ne.intersectsObject(L))){const Le=ce.update(L),Ve=L.material;if(K&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),$e.copy(L.boundingSphere.center)):(Le.boundingSphere===null&&Le.computeBoundingSphere(),$e.copy(Le.boundingSphere.center)),$e.applyMatrix4(L.matrixWorld).applyMatrix4(Te)),Array.isArray(Ve)){const He=Le.groups;for(let qe=0,tt=He.length;qe0&&So(W,H,J),Me.length>0&&So(Me,H,J),Le.length>0&&So(Le,H,J),ae.buffers.depth.setTest(!0),ae.buffers.depth.setMask(!0),ae.buffers.color.setMask(!0),ae.setPolygonOffset(!1)}function Va(L,H,J,K){if((J.isScene===!0?J.overrideMaterial:null)!==null)return;y.state.transmissionRenderTarget[K.id]===void 0&&(y.state.transmissionRenderTarget[K.id]=new Jo(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")||ge.has("EXT_color_buffer_float")?um:Fa,minFilter:wa,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Mn.workingColorSpace}));const Me=y.state.transmissionRenderTarget[K.id],Le=K.viewport||w;Me.setSize(Le.z,Le.w);const Ve=x.getRenderTarget();x.setRenderTarget(Me),x.getClearColor(V),$=x.getClearAlpha(),$<1&&x.setClearColor(16777215,.5),x.clear(),je&&Ie.render(J);const He=x.toneMapping;x.toneMapping=Cl;const qe=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),y.setupLightsView(K),q===!0&&st.setGlobalState(x.clippingPlanes,K),So(L,J,K),De.updateMultisampleRenderTarget(Me),De.updateRenderTargetMipmap(Me),ge.has("WEBGL_multisampled_render_to_texture")===!1){let tt=!1;for(let We=0,At=H.length;We0),We=!!J.morphAttributes.position,At=!!J.morphAttributes.normal,Bt=!!J.morphAttributes.color;let Pt=Cl;K.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(Pt=x.toneMapping);const ln=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,at=ln!==void 0?ln.length:0,Be=Ce.get(K),kt=y.state.lights;if(q===!0&&(fe===!0||L!==b)){const Tn=L===b&&K.id===I;st.setState(K,L,Tn)}let ut=!1;K.version===Be.__version?(Be.needsLights&&Be.lightsStateVersion!==kt.state.version||Be.outputColorSpace!==Ve||W.isBatchedMesh&&Be.batching===!1||!W.isBatchedMesh&&Be.batching===!0||W.isBatchedMesh&&Be.batchingColor===!0&&W.colorTexture===null||W.isBatchedMesh&&Be.batchingColor===!1&&W.colorTexture!==null||W.isInstancedMesh&&Be.instancing===!1||!W.isInstancedMesh&&Be.instancing===!0||W.isSkinnedMesh&&Be.skinning===!1||!W.isSkinnedMesh&&Be.skinning===!0||W.isInstancedMesh&&Be.instancingColor===!0&&W.instanceColor===null||W.isInstancedMesh&&Be.instancingColor===!1&&W.instanceColor!==null||W.isInstancedMesh&&Be.instancingMorph===!0&&W.morphTexture===null||W.isInstancedMesh&&Be.instancingMorph===!1&&W.morphTexture!==null||Be.envMap!==He||K.fog===!0&&Be.fog!==Me||Be.numClippingPlanes!==void 0&&(Be.numClippingPlanes!==st.numPlanes||Be.numIntersection!==st.numIntersection)||Be.vertexAlphas!==qe||Be.vertexTangents!==tt||Be.morphTargets!==We||Be.morphNormals!==At||Be.morphColors!==Bt||Be.toneMapping!==Pt||Be.morphTargetsCount!==at)&&(ut=!0):(ut=!0,Be.__version=K.version);let rn=Be.currentProgram;ut===!0&&(rn=Ao(K,H,W));let vi=!1,hn=!1,li=!1;const Ot=rn.getUniforms(),Ei=Be.uniforms;if(ae.useProgram(rn.program)&&(vi=!0,hn=!0,li=!0),K.id!==I&&(I=K.id,hn=!0),vi||b!==L){Ot.setValue(B,"projectionMatrix",L.projectionMatrix),Ot.setValue(B,"viewMatrix",L.matrixWorldInverse);const Tn=Ot.map.cameraPosition;Tn!==void 0&&Tn.setValue(B,Se.setFromMatrixPosition(L.matrixWorld)),Re.logarithmicDepthBuffer&&Ot.setValue(B,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&Ot.setValue(B,"isOrthographic",L.isOrthographicCamera===!0),b!==L&&(b=L,hn=!0,li=!0)}if(W.isSkinnedMesh){Ot.setOptional(B,W,"bindMatrix"),Ot.setOptional(B,W,"bindMatrixInverse");const Tn=W.skeleton;Tn&&(Tn.boneTexture===null&&Tn.computeBoneTexture(),Ot.setValue(B,"boneTexture",Tn.boneTexture,De))}W.isBatchedMesh&&(Ot.setOptional(B,W,"batchingTexture"),Ot.setValue(B,"batchingTexture",W._matricesTexture,De),Ot.setOptional(B,W,"batchingIdTexture"),Ot.setValue(B,"batchingIdTexture",W._indirectTexture,De),Ot.setOptional(B,W,"batchingColorTexture"),W._colorsTexture!==null&&Ot.setValue(B,"batchingColorTexture",W._colorsTexture,De));const aa=J.morphAttributes;if((aa.position!==void 0||aa.normal!==void 0||aa.color!==void 0)&&pt.update(W,J,rn),(hn||Be.receiveShadow!==W.receiveShadow)&&(Be.receiveShadow=W.receiveShadow,Ot.setValue(B,"receiveShadow",W.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(Ei.envMap.value=He,Ei.flipEnvMap.value=He.isCubeTexture&&He.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&H.environment!==null&&(Ei.envMapIntensity.value=H.environmentIntensity),hn&&(Ot.setValue(B,"toneMappingExposure",x.toneMappingExposure),Be.needsLights&&ym(Ei,li),Me&&K.fog===!0&&Ye.refreshFogUniforms(Ei,Me),Ye.refreshMaterialUniforms(Ei,K,re,X,y.state.transmissionRenderTarget[L.id]),J1.upload(B,Su(Be),Ei,De)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(J1.upload(B,Su(Be),Ei,De),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&Ot.setValue(B,"center",W.center),Ot.setValue(B,"modelViewMatrix",W.modelViewMatrix),Ot.setValue(B,"normalMatrix",W.normalMatrix),Ot.setValue(B,"modelMatrix",W.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){const Tn=K.uniformsGroups;for(let la=0,Nr=Tn.length;la0&&De.useMultisampledRTT(L)===!1?W=Ce.get(L).__webglMultisampledFramebuffer:Array.isArray(tt)?W=tt[J]:W=tt,w.copy(L.viewport),N.copy(L.scissor),G=L.scissorTest}else w.copy(te).multiplyScalar(re).floor(),N.copy(le).multiplyScalar(re).floor(),G=we;if(ae.bindFramebuffer(B.FRAMEBUFFER,W)&&K&&ae.drawBuffers(L,W),ae.viewport(w),ae.scissor(N),ae.setScissorTest(G),Me){const He=Ce.get(L.texture);B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+H,He.__webglTexture,J)}else if(Le){const He=Ce.get(L.texture),qe=H||0;B.framebufferTextureLayer(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,He.__webglTexture,J||0,qe)}I=-1},this.readRenderTargetPixels=function(L,H,J,K,W,Me,Le){if(!(L&&L.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ve=Ce.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ve=Ve[Le]),Ve){ae.bindFramebuffer(B.FRAMEBUFFER,Ve);try{const He=L.texture,qe=He.format,tt=He.type;if(!Re.textureFormatReadable(qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Re.textureTypeReadable(tt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}H>=0&&H<=L.width-K&&J>=0&&J<=L.height-W&&B.readPixels(H,J,K,W,ie.convert(qe),ie.convert(tt),Me)}finally{const He=P!==null?Ce.get(P).__webglFramebuffer:null;ae.bindFramebuffer(B.FRAMEBUFFER,He)}}},this.readRenderTargetPixelsAsync=async function(L,H,J,K,W,Me,Le){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ve=Ce.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&Le!==void 0&&(Ve=Ve[Le]),Ve){ae.bindFramebuffer(B.FRAMEBUFFER,Ve);try{const He=L.texture,qe=He.format,tt=He.type;if(!Re.textureFormatReadable(qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Re.textureTypeReadable(tt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(H>=0&&H<=L.width-K&&J>=0&&J<=L.height-W){const We=B.createBuffer();B.bindBuffer(B.PIXEL_PACK_BUFFER,We),B.bufferData(B.PIXEL_PACK_BUFFER,Me.byteLength,B.STREAM_READ),B.readPixels(H,J,K,W,ie.convert(qe),ie.convert(tt),0),B.flush();const At=B.fenceSync(B.SYNC_GPU_COMMANDS_COMPLETE,0);await che(B,At,4);try{B.bindBuffer(B.PIXEL_PACK_BUFFER,We),B.getBufferSubData(B.PIXEL_PACK_BUFFER,0,Me)}finally{B.deleteBuffer(We),B.deleteSync(At)}return Me}}finally{const He=P!==null?Ce.get(P).__webglFramebuffer:null;ae.bindFramebuffer(B.FRAMEBUFFER,He)}}},this.copyFramebufferToTexture=function(L,H=null,J=0){L.isTexture!==!0&&(Mp("WebGLRenderer: copyFramebufferToTexture function signature has changed."),H=arguments[0]||null,L=arguments[1]);const K=Math.pow(2,-J),W=Math.floor(L.image.width*K),Me=Math.floor(L.image.height*K),Le=H!==null?H.x:0,Ve=H!==null?H.y:0;De.setTexture2D(L,0),B.copyTexSubImage2D(B.TEXTURE_2D,J,0,0,Le,Ve,W,Me),ae.unbindTexture()},this.copyTextureToTexture=function(L,H,J=null,K=null,W=0){L.isTexture!==!0&&(Mp("WebGLRenderer: copyTextureToTexture function signature has changed."),K=arguments[0]||null,L=arguments[1],H=arguments[2],W=arguments[3]||0,J=null);let Me,Le,Ve,He,qe,tt;J!==null?(Me=J.max.x-J.min.x,Le=J.max.y-J.min.y,Ve=J.min.x,He=J.min.y):(Me=L.image.width,Le=L.image.height,Ve=0,He=0),K!==null?(qe=K.x,tt=K.y):(qe=0,tt=0);const We=ie.convert(H.format),At=ie.convert(H.type);De.setTexture2D(H,0),B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,H.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,H.unpackAlignment);const Bt=B.getParameter(B.UNPACK_ROW_LENGTH),Pt=B.getParameter(B.UNPACK_IMAGE_HEIGHT),ln=B.getParameter(B.UNPACK_SKIP_PIXELS),at=B.getParameter(B.UNPACK_SKIP_ROWS),Be=B.getParameter(B.UNPACK_SKIP_IMAGES),kt=L.isCompressedTexture?L.mipmaps[W]:L.image;B.pixelStorei(B.UNPACK_ROW_LENGTH,kt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,kt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,Ve),B.pixelStorei(B.UNPACK_SKIP_ROWS,He),L.isDataTexture?B.texSubImage2D(B.TEXTURE_2D,W,qe,tt,Me,Le,We,At,kt.data):L.isCompressedTexture?B.compressedTexSubImage2D(B.TEXTURE_2D,W,qe,tt,kt.width,kt.height,We,kt.data):B.texSubImage2D(B.TEXTURE_2D,W,qe,tt,Me,Le,We,At,kt),B.pixelStorei(B.UNPACK_ROW_LENGTH,Bt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt),B.pixelStorei(B.UNPACK_SKIP_PIXELS,ln),B.pixelStorei(B.UNPACK_SKIP_ROWS,at),B.pixelStorei(B.UNPACK_SKIP_IMAGES,Be),W===0&&H.generateMipmaps&&B.generateMipmap(B.TEXTURE_2D),ae.unbindTexture()},this.copyTextureToTexture3D=function(L,H,J=null,K=null,W=0){L.isTexture!==!0&&(Mp("WebGLRenderer: copyTextureToTexture3D function signature has changed."),J=arguments[0]||null,K=arguments[1]||null,L=arguments[2],H=arguments[3],W=arguments[4]||0);let Me,Le,Ve,He,qe,tt,We,At,Bt;const Pt=L.isCompressedTexture?L.mipmaps[W]:L.image;J!==null?(Me=J.max.x-J.min.x,Le=J.max.y-J.min.y,Ve=J.max.z-J.min.z,He=J.min.x,qe=J.min.y,tt=J.min.z):(Me=Pt.width,Le=Pt.height,Ve=Pt.depth,He=0,qe=0,tt=0),K!==null?(We=K.x,At=K.y,Bt=K.z):(We=0,At=0,Bt=0);const ln=ie.convert(H.format),at=ie.convert(H.type);let Be;if(H.isData3DTexture)De.setTexture3D(H,0),Be=B.TEXTURE_3D;else if(H.isDataArrayTexture||H.isCompressedArrayTexture)De.setTexture2DArray(H,0),Be=B.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,H.flipY),B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),B.pixelStorei(B.UNPACK_ALIGNMENT,H.unpackAlignment);const kt=B.getParameter(B.UNPACK_ROW_LENGTH),ut=B.getParameter(B.UNPACK_IMAGE_HEIGHT),rn=B.getParameter(B.UNPACK_SKIP_PIXELS),vi=B.getParameter(B.UNPACK_SKIP_ROWS),hn=B.getParameter(B.UNPACK_SKIP_IMAGES);B.pixelStorei(B.UNPACK_ROW_LENGTH,Pt.width),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,Pt.height),B.pixelStorei(B.UNPACK_SKIP_PIXELS,He),B.pixelStorei(B.UNPACK_SKIP_ROWS,qe),B.pixelStorei(B.UNPACK_SKIP_IMAGES,tt),L.isDataTexture||L.isData3DTexture?B.texSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,at,Pt.data):H.isCompressedArrayTexture?B.compressedTexSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,Pt.data):B.texSubImage3D(Be,W,We,At,Bt,Me,Le,Ve,ln,at,Pt),B.pixelStorei(B.UNPACK_ROW_LENGTH,kt),B.pixelStorei(B.UNPACK_IMAGE_HEIGHT,ut),B.pixelStorei(B.UNPACK_SKIP_PIXELS,rn),B.pixelStorei(B.UNPACK_SKIP_ROWS,vi),B.pixelStorei(B.UNPACK_SKIP_IMAGES,hn),W===0&&H.generateMipmaps&&B.generateMipmap(Be),ae.unbindTexture()},this.initRenderTarget=function(L){Ce.get(L).__webglFramebuffer===void 0&&De.setupRenderTarget(L)},this.initTexture=function(L){L.isCubeTexture?De.setTextureCube(L,0):L.isData3DTexture?De.setTexture3D(L,0):L.isDataArrayTexture||L.isCompressedArrayTexture?De.setTexture2DArray(L,0):De.setTexture2D(L,0),ae.unbindTexture()},this.resetState=function(){R=0,T=0,P=null,ae.reset(),be.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ea}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===tw?"display-p3":"srgb",t.unpackColorSpace=Mn.workingColorSpace===ay?"display-p3":"srgb"}}class aw{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new _t(e),this.density=t}clone(){return new aw(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class lw{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new _t(e),this.near=t,this.far=i}clone(){return new lw(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class R6 extends vn{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 Vs,this.environmentIntensity=1,this.environmentRotation=new Vs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class cw{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=d0,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Us()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Mp("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,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:vg.clone(),uv:Rs.getInterpolation(vg,Jx,_g,Kx,Ak,Jb,wk,new Je),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function qx(n,e,t,i,r,s){Rf.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(yg.x=s*Rf.x-r*Rf.y,yg.y=r*Rf.x+s*Rf.y):yg.copy(Rf),n.copy(e),n.x+=yg.x,n.y+=yg.y,n.applyMatrix4(P6)}const Zx=new ee,Ek=new ee;class L6 extends vn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Zx.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Zx);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Zx.setFromMatrixPosition(e.matrixWorld),Ek.setFromMatrixPosition(this.matrixWorld);const i=Zx.distanceTo(Ek)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}}const mc=new Dt,Zb=new Dt,Rge=new Dt,Pge=new _t(1,1,1),Bk=new Dt,Qb=new cy,t1=new Zr,Zu=new Rr,Mg=new ee,Nk=new ee,Ige=new ee,eC=new Cge,yr=new Li,n1=[];function Lge(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Nn(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Zr);const e=this.boundingBox,t=this._drawInfo;e.makeEmpty();for(let i=0,r=t.length;i=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,i=this._matricesTexture,r=i.image.data;Rge.toArray(r,t*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(Pge.toArray(s.image.data,t*4),s.needsUpdate=!0),t}addGeometry(e,t=-1,i=-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 s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=e.getIndex(),u=c!==null;if(u&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&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 h=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:u?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Zr,sphereInitialized:!1,sphere:new Rr}),this.setGeometryAt(h,e),h}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const f in i.attributes){const v=t.getAttribute(f),_=i.getAttribute(f);Lge(v,_,l);const y=v.itemSize;for(let m=v.count,S=c;m=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let c=l.start,u=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,t1),t1.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let c=0;for(let u=l.start,h=l.start+l.count;u=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;yr.material=this.material,yr.geometry.index=o.index,yr.geometry.attributes=o.attributes,yr.geometry.boundingBox===null&&(yr.geometry.boundingBox=new Zr),yr.geometry.boundingSphere===null&&(yr.geometry.boundingSphere=new Rr);for(let a=0,l=i.length;a({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._drawInfo=e._drawInfo.map(t=>({...t})),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,h=this._drawRanges,d=this.perObjectFrustumCulled,f=this._indirectTexture,v=f.image.data;d&&(Bk.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Qb.setFromProjectionMatrix(Bk,e.coordinateSystem));let _=0;if(this.sortObjects){Zb.copy(this.matrixWorld).invert(),Mg.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Zb),Nk.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Zb);for(let S=0,x=l.length;S0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;tC.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(tC);if(!(le.far))return{distance:l,point:Fk.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const Ok=new ee,kk=new ee;class Ga extends Qc{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class Dge extends gi{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:Ii,this.magFilter=s!==void 0?s:Ii,this.generateMipmaps=!1;const u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Bge extends gi{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ji,this.minFilter=Ji,this.generateMipmaps=!1,this.needsUpdate=!0}}class hw extends gi{constructor(e,t,i,r,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,r,s,h,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Nge extends hw{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=mo,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Uge extends hw{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Ol),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class Fge extends gi{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class na{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],d=i[r+1]-u,f=(o-u)/d;return(r+f)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Je:new ee);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new ee,r=[],s=[],o=[],a=new ee,l=new Dt;for(let f=0;f<=e;f++){const v=f/e;r[f]=this.getTangentAt(v,new ee)}s[0]=new ee,o[0]=new ee;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),d=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(pi(r[f-1].dot(r[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(a,v))}o[f].crossVectors(r[f],s[f])}if(t===!0){let f=Math.acos(pi(s[0].dot(s[e]),-1,1));f/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(f=-f);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],f*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class dw extends na{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Je){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(a1.subVectors(r[0],r[1]).add(r[0]),c=a1);const h=r[a%s],d=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(Hk(a,l.x,c.x,u.x,h.x),Hk(a,l.y,c.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class uy extends tn{constructor(e=[new Je(0,-.5),new Je(.5,0),new Je(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=pi(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,h=new ee,d=new Je,f=new ee,v=new ee,_=new ee;let y=0,m=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:y=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,f.x=m*1,f.y=-y,f.z=m*0,_.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:y=e[S+1].x-e[S].x,m=e[S+1].y-e[S].y,f.x=m*1,f.y=-y,f.z=m*0,v.copy(f),f.x+=_.x,f.y+=_.y,f.z+=_.z,f.normalize(),l.push(f.x,f.y,f.z),_.copy(v)}for(let S=0;S<=t;S++){const x=i+S*u*r,M=Math.sin(x),R=Math.cos(x);for(let T=0;T<=e.length-1;T++){h.x=e[T].x*M,h.y=e[T].y,h.z=e[T].x*R,o.push(h.x,h.y,h.z),d.x=S/t,d.y=T/(e.length-1),a.push(d.x,d.y);const P=l[3*T+0]*M,I=l[3*T+1],b=l[3*T+0]*R;c.push(P,I,b)}}for(let S=0;S0&&x(!0),t>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new wt(h,3)),this.setAttribute("normal",new wt(d,3)),this.setAttribute("uv",new wt(f,2));function S(){const M=new ee,R=new ee;let T=0;const P=(t-e)/i;for(let I=0;I<=s;I++){const b=[],w=I/s,N=w*(t-e)+e;for(let G=0;G<=r;G++){const V=G/r,$=V*l+a,Z=Math.sin($),X=Math.cos($);R.x=N*Z,R.y=-w*i+y,R.z=N*X,h.push(R.x,R.y,R.z),M.set(Z,P,X).normalize(),d.push(M.x,M.y,M.z),f.push(V,1-w),b.push(v++)}_.push(b)}for(let I=0;I.9&&P<.1&&(x<.2&&(o[S+0]+=1),M<.2&&(o[S+2]+=1),R<.2&&(o[S+4]+=1))}}function d(S){s.push(S.x,S.y,S.z)}function f(S,x){const M=S*3;x.x=e[M+0],x.y=e[M+1],x.z=e[M+2]}function v(){const S=new ee,x=new ee,M=new ee,R=new ee,T=new Je,P=new Je,I=new Je;for(let b=0,w=0;b80*t){a=c=n[0],l=u=n[1];for(let v=t;vc&&(c=h),d>u&&(u=d);f=Math.max(c-a,u-l),f=f!==0?32767/f:0}return g0(s,o,t,a,l,f,0),o}};function W6(n,e,t,i,r){let s,o;if(r===ave(n,e,t,i)>0)for(s=e;s=e;s-=i)o=Vk(s,n[s],n[s+1],o);return o&&vw(o,o.next)&&(y0(o),o=o.next),o}function hd(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(vw(t,t.next)||ii(t.prev,t,t.next)===0)){if(y0(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function g0(n,e,t,i,r,s,o){if(!n)return;!o&&s&&tve(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?jge(n,i,r,s):Xge(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),y0(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=Yge(hd(n),e,t),g0(n,e,t,i,r,s,2)):o===2&&Jge(n,e,t,i,r,s):g0(hd(n),e,t,i,r,s,1);break}}}function Xge(n){const e=n.prev,t=n,i=n.next;if(ii(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=rs?r>o?r:o:s>o?s:o,f=a>l?a>c?a:c:l>c?l:c;let v=i.next;for(;v!==e;){if(v.x>=u&&v.x<=d&&v.y>=h&&v.y<=f&&cp(r,a,s,l,o,c,v.x,v.y)&&ii(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function jge(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ii(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,h=s.y,d=o.y,f=al?a>c?a:c:l>c?l:c,y=u>h?u>d?u:d:h>d?h:d,m=yP(f,v,e,t,i),S=yP(_,y,e,t,i);let x=n.prevZ,M=n.nextZ;for(;x&&x.z>=m&&M&&M.z<=S;){if(x.x>=f&&x.x<=_&&x.y>=v&&x.y<=y&&x!==r&&x!==o&&cp(a,u,l,h,c,d,x.x,x.y)&&ii(x.prev,x,x.next)>=0||(x=x.prevZ,M.x>=f&&M.x<=_&&M.y>=v&&M.y<=y&&M!==r&&M!==o&&cp(a,u,l,h,c,d,M.x,M.y)&&ii(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;x&&x.z>=m;){if(x.x>=f&&x.x<=_&&x.y>=v&&x.y<=y&&x!==r&&x!==o&&cp(a,u,l,h,c,d,x.x,x.y)&&ii(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;M&&M.z<=S;){if(M.x>=f&&M.x<=_&&M.y>=v&&M.y<=y&&M!==r&&M!==o&&cp(a,u,l,h,c,d,M.x,M.y)&&ii(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function Yge(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!vw(r,s)&&$6(r,i,i.next,s)&&v0(r,s)&&v0(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),y0(i),y0(i.next),i=n=s),i=i.next}while(i!==n);return hd(i)}function Jge(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&rve(o,a)){let l=X6(o,a);o=hd(o,o.next),l=hd(l,l.next),g0(o,e,t,i,r,s,0),g0(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function Kge(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const d=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=s&&d>i&&(i=d,r=t.x=t.x&&t.x>=l&&s!==t.x&&cp(or.x||t.x===r.x&&eve(r,t)))&&(r=t,u=h)),t=t.next;while(t!==a);return r}function eve(n,e){return ii(n.prev,n,e.prev)<0&&ii(e.next,n,n.next)<0}function tve(n,e,t,i){let r=n;do r.z===0&&(r.z=yP(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,nve(r)}function nve(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function yP(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function ive(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function rve(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!sve(n,e)&&(v0(n,e)&&v0(e,n)&&ove(n,e)&&(ii(n.prev,n,e.prev)||ii(n,e.prev,e))||vw(n,e)&&ii(n.prev,n,n.next)>0&&ii(e.prev,e,e.next)>0)}function ii(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function vw(n,e){return n.x===e.x&&n.y===e.y}function $6(n,e,t,i){const r=d1(ii(n,e,t)),s=d1(ii(n,e,i)),o=d1(ii(t,i,n)),a=d1(ii(t,i,e));return!!(r!==s&&o!==a||r===0&&h1(n,t,e)||s===0&&h1(n,i,e)||o===0&&h1(t,n,i)||a===0&&h1(t,e,i))}function h1(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function d1(n){return n>0?1:n<0?-1:0}function sve(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&$6(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function v0(n,e){return ii(n.prev,n,n.next)<0?ii(n,e,n.next)>=0&&ii(n,n.prev,e)>=0:ii(n,e,n.prev)<0||ii(n,n.next,e)<0}function ove(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function X6(n,e){const t=new _P(n.i,n.x,n.y),i=new _P(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Vk(n,e,t,i){const r=new _P(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function y0(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function _P(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ave(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function $k(n,e){for(let t=0;tNumber.EPSILON){const ce=Math.sqrt(Y),de=Math.sqrt(U*U+C*C),Ye=me.x-De/ce,Ae=me.y+Ce/ce,Ue=ge.x-C/de,st=ge.y+U/de,_e=((Ue-Ye)*C-(st-Ae)*U)/(Ce*C-De*U);Re=Ye+Ce*_e-B.x,ae=Ae+De*_e-B.y;const Ie=Re*Re+ae*ae;if(Ie<=2)return new Je(Re,ae);Xe=Math.sqrt(Ie/2)}else{let ce=!1;Ce>Number.EPSILON?U>Number.EPSILON&&(ce=!0):Ce<-Number.EPSILON?U<-Number.EPSILON&&(ce=!0):Math.sign(De)===Math.sign(C)&&(ce=!0),ce?(Re=-De,ae=Ce,Xe=Math.sqrt(Y)):(Re=Ce,ae=De,Xe=Math.sqrt(Y/2))}return new Je(Re/Xe,ae/Xe)}const Q=[];for(let B=0,me=$.length,ge=me-1,Re=B+1;B=0;B--){const me=B/y,ge=f*Math.cos(me*Math.PI/2),Re=v*Math.sin(me*Math.PI/2)+_;for(let ae=0,Xe=$.length;ae=0;){const Re=ge;let ae=ge-1;ae<0&&(ae=B.length-1);for(let Xe=0,Ce=u+y*2;Xe0)&&f.push(x,M,T),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class q6 extends Br{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new _t(16777215),this.specular=new _t(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Vs,this.combine=sy,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 Z6 extends Br{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _t(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Q6 extends Br{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class e$ extends Br{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new _t(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _t(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Vs,this.combine=sy,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 t$ extends Br{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _t(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mu,this.normalScale=new Je(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class n$ extends ns{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 Dh(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function i$(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function r$(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function xP(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function KL(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function hve(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){h.push(c.times[f]);for(let _=0;_s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const m=v*h+u,S=m+h-u;_=a.values.slice(m,S)}else{const m=a.createInterpolant(),S=u,x=h-u;m.evaluate(s),_=m.resultBuffer.slice(S,x)}l==="quaternion"&&new ps().fromArray(_).normalize().conjugate().toArray(_);const y=c.times.length;for(let m=0;m=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&i$(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Y1,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}ia.prototype.TimeBufferType=Float32Array;ia.prototype.ValueBufferType=Float32Array;ia.prototype.DefaultInterpolation=zM;class Ed extends ia{constructor(e,t,i){super(e,t,i)}}Ed.prototype.ValueTypeName="bool";Ed.prototype.ValueBufferType=Array;Ed.prototype.DefaultInterpolation=a0;Ed.prototype.InterpolantFactoryMethodLinear=void 0;Ed.prototype.InterpolantFactoryMethodSmooth=void 0;class ZL extends ia{}ZL.prototype.ValueTypeName="color";class _0 extends ia{}_0.prototype.ValueTypeName="number";class a$ extends fy{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let u=c+a;c!==u;c+=4)ps.slerpFlat(s,0,o,c-a,o,c,l);return s}}class py extends ia{InterpolantFactoryMethodLinear(e){return new a$(this.times,this.values,this.getValueSize(),e)}}py.prototype.ValueTypeName="quaternion";py.prototype.InterpolantFactoryMethodSmooth=void 0;class Td extends ia{constructor(e,t,i){super(e,t,i)}}Td.prototype.ValueTypeName="string";Td.prototype.ValueBufferType=Array;Td.prototype.DefaultInterpolation=a0;Td.prototype.InterpolantFactoryMethodLinear=void 0;Td.prototype.InterpolantFactoryMethodSmooth=void 0;class x0 extends ia{}x0.prototype.ValueTypeName="vector";class S0{constructor(e="",t=-1,i=[],r=ew){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Us(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(mve(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(ia.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const h=u[1];let d=r[h];d||(r[h]=d=[]),d.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,d,f,v,_){if(f.length!==0){const y=[],m=[];KL(f,y,m,v),y.length!==0&&_.push(new h(d,y,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(al[e]!==void 0){al[e].push({onLoad:t,onProgress:i,onError:r});return}al[e]=[],al[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=al[e],h=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,v=f!==0;let _=0;const y=new ReadableStream({start(m){S();function S(){h.read().then(({done:x,value:M})=>{if(x)m.close();else{_+=M.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:_,total:f});for(let T=0,P=u.length;T{m.error(x)})}}});return new Response(y)}else throw new gve(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(v=>f.decode(v))}}}).then(c=>{Sl.add(e,c);const u=al[e];delete al[e];for(let h=0,d=u.length;h{const u=al[e];if(u===void 0)throw this.manager.itemError(e),c;delete al[e];for(let h=0,d=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class vve extends ys{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new zl(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new _t().setHex(o.value);break;case"v2":r.uniforms[s].value=new Je().fromArray(o.value);break;case"v3":r.uniforms[s].value=new ee().fromArray(o.value);break;case"v4":r.uniforms[s].value=new Cn().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Wt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Dt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Je().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Je().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:Y6,SpriteMaterial:zL,RawShaderMaterial:J6,ShaderMaterial:Ko,PointsMaterial:HL,MeshPhysicalMaterial:K6,MeshStandardMaterial:JL,MeshPhongMaterial:q6,MeshToonMaterial:Z6,MeshNormalMaterial:Q6,MeshLambertMaterial:e$,MeshDepthMaterial:OL,MeshDistanceMaterial:kL,MeshBasicMaterial:gu,MeshMatcapMaterial:t$,LineDashedMaterial:n$,LineBasicMaterial:ns,Material:Br};return new t[e]}}class SP{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new QL(t);s=new M0(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){r=new M0(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const y=new Zr;y.min.fromArray(_.boxMin),y.max.fromArray(_.boxMax);const m=new Rr;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:y,sphereInitialized:_.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new L6;break;case"Line":o=new Qc(a(e.geometry),l(e.material));break;case"LineLoop":o=new U6(a(e.geometry),l(e.material));break;case"LineSegments":o=new Ga(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new F6(a(e.geometry),l(e.material));break;case"Sprite":o=new I6(l(e.material));break;case"Group":o=new lp;break;case"Bone":o=new GL;break;default:o=new vn}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let f=0;f"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Sl.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return Sl.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Sl.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});Sl.add(e,l),s.manager.itemStart(e)}}let f1;class tD{static getContext(){return f1===void 0&&(f1=new(window.AudioContext||window.webkitAudioContext)),f1}static setContext(e){f1=e}}class Cve extends ys{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new zl(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);tD.getContext().decodeAudioData(c,function(h){t(h)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const Qk=new Dt,ez=new Dt,Qu=new Dt;class Rve{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ir,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ir,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,Qu.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(jh*t.fov*.5)/t.zoom;let a,l;ez.elements[12]=-r,Qk.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Qu.elements[0]=2*t.near/(l-a),Qu.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Qu),a=-o*t.aspect-s,l=o*t.aspect-s,Qu.elements[0]=2*t.near/(l-a),Qu.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Qu)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(ez),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Qk)}}class _${constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=tz(),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=tz();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function tz(){return(typeof performance>"u"?Date:performance).now()}const eh=new ee,nz=new ps,Pve=new ee,th=new ee;class Ive extends vn{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 _$}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(eh,nz,Pve),th.set(0,0,-1).applyQuaternion(nz),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(eh.x,r),t.positionY.linearRampToValueAtTime(eh.y,r),t.positionZ.linearRampToValueAtTime(eh.z,r),t.forwardX.linearRampToValueAtTime(th.x,r),t.forwardY.linearRampToValueAtTime(th.y,r),t.forwardZ.linearRampToValueAtTime(th.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(eh.x,eh.y,eh.z),t.setOrientation(th.x,th.y,th.z,i.x,i.y,i.z)}}class x$ extends vn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){ps.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;ps.multiplyQuaternionsFlat(e,o,e,t,e,i),ps.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const nD="\\[\\]\\.:\\/",Nve=new RegExp("["+nD+"]","g"),iD="[^"+nD+"]",Uve="[^"+nD.replace("\\.","")+"]",Fve=/((?:WC+[\/:])*)/.source.replace("WC",iD),Ove=/(WCOD+)?/.source.replace("WCOD",Uve),kve=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",iD),zve=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",iD),Gve=new RegExp("^"+Fve+Ove+kve+zve+"$"),Hve=["material","materials","bones","map"];class Vve{constructor(e,t,i){const r=i||mn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class mn{constructor(e,t,i){this.path=t,this.parsedPath=i||mn.parseTrackName(t),this.node=mn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new mn.Composite(e,t,i):new mn(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Nve,"")}static parseTrackName(e){const t=Gve.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);Hve.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,v=r;f!==v;++f){const _=i[f],y=_[h],m=_[u];_[u]=y,_[h]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let v=0,_=r;v!==_;++v){const y=i[v];y[h]=y[d],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){const v=l[d];h[d]=new mn(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class M${constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Ph,endingEnd:Ph};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=t6,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case PL:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case ew:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===n6;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===e6){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Ih,r.endingEnd=Ih):(e?r.endingStart=this.zeroSlopeAtStart?Ih:Ph:r.endingStart=l0,t?r.endingEnd=this.zeroSlopeAtEnd?Ih:Ph:r.endingEnd=l0)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const $ve=new Float32Array(1);class Xve extends za{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){const d=r[h],f=d.name;let v=u[f];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,f));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;v=new S$(mn.create(i,f,_),d.ValueTypeName,d.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,f),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=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,oz).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 az=new ee,p1=new ee;class t0e{constructor(e=new ee,t=new ee){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){az.subVectors(e,this.start),p1.subVectors(this.end,this.start);const i=p1.dot(p1);let s=p1.dot(az)/i;return t&&(s=pi(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const lz=new ee;class n0e extends vn{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new tn,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{fz.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(fz,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class m0e extends Ga{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new tn;r.setAttribute("position",new wt(t,3)),r.setAttribute("color",new wt(i,3));const s=new ns({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new _t,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class g0e{constructor(){this.type="ShapePath",this.color=new _t,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new m0,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const S=[];for(let x=0,M=m.length;xNumber.EPSILON){if(w<0&&(P=S[T],b=-b,I=S[R],w=-w),m.yI.y)continue;if(m.y===P.y){if(m.x===P.x)return!0}else{const N=w*(m.x-P.x)-b*(m.y-P.y);if(N===0)return!0;if(N<0)continue;M=!M}}else{if(m.y!==P.y)continue;if(I.x<=m.x&&m.x<=P.x||P.x<=m.x&&m.x<=I.x)return!0}}return M}const r=Da.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Yh,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const h=[],d=[];let f=[],v=0,_;d[v]=void 0,f[v]=[];for(let m=0,S=s.length;m1){let m=!1,S=0;for(let x=0,M=d.length;x0&&m===!1&&(f=h)}let y;for(let m=0,S=d.length;me in n?S0e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ft=(n,e,t)=>(M0e(n,typeof e!="symbol"?e+"":e,t),t);const x1=new _d,mz=new dl,A0e=Math.cos(70*(Math.PI/180)),gz=(n,e)=>(n%e+e)%e;let w0e=class extends vs{constructor(e,t){super(),Ft(this,"object"),Ft(this,"domElement"),Ft(this,"enabled",!0),Ft(this,"target",new j),Ft(this,"minDistance",0),Ft(this,"maxDistance",1/0),Ft(this,"minZoom",0),Ft(this,"maxZoom",1/0),Ft(this,"minPolarAngle",0),Ft(this,"maxPolarAngle",Math.PI),Ft(this,"minAzimuthAngle",-1/0),Ft(this,"maxAzimuthAngle",1/0),Ft(this,"enableDamping",!1),Ft(this,"dampingFactor",.05),Ft(this,"enableZoom",!0),Ft(this,"zoomSpeed",1),Ft(this,"enableRotate",!0),Ft(this,"rotateSpeed",1),Ft(this,"enablePan",!0),Ft(this,"panSpeed",1),Ft(this,"screenSpacePanning",!0),Ft(this,"keyPanSpeed",7),Ft(this,"zoomToCursor",!1),Ft(this,"autoRotate",!1),Ft(this,"autoRotateSpeed",2),Ft(this,"reverseOrbit",!1),Ft(this,"reverseHorizontalOrbit",!1),Ft(this,"reverseVerticalOrbit",!1),Ft(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ft(this,"mouseButtons",{LEFT:uh.ROTATE,MIDDLE:uh.DOLLY,RIGHT:uh.PAN}),Ft(this,"touches",{ONE:hh.ROTATE,TWO:hh.DOLLY_PAN}),Ft(this,"target0"),Ft(this,"position0"),Ft(this,"zoom0"),Ft(this,"_domElementKeyEvents",null),Ft(this,"getPolarAngle"),Ft(this,"getAzimuthalAngle"),Ft(this,"setPolarAngle"),Ft(this,"setAzimuthalAngle"),Ft(this,"getDistance"),Ft(this,"listenToKeyEvents"),Ft(this,"stopListenToKeyEvents"),Ft(this,"saveState"),Ft(this,"reset"),Ft(this,"update"),Ft(this,"connect"),Ft(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=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=ie=>{let be=gz(ie,2*Math.PI),et=u.phi;et<0&&(et+=2*Math.PI),be<0&&(be+=2*Math.PI);let z=Math.abs(be-et);2*Math.PI-z{let be=gz(ie,2*Math.PI),et=u.theta;et<0&&(et+=2*Math.PI),be<0&&(be+=2*Math.PI);let z=Math.abs(be-et);2*Math.PI-zi.object.position.distanceTo(i.target),this.listenToKeyEvents=ie=>{ie.addEventListener("keydown",Ae),this._domElementKeyEvents=ie},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Ae),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const ie=new j,be=new j(0,1,0),et=new qi().setFromUnitVectors(e.up,be),z=et.clone().invert(),ve=new j,oe=new qi,he=2*Math.PI;return function(){const Ze=i.object.position;et.setFromUnitVectors(e.up,be),z.copy(et).invert(),ie.copy(Ze).sub(i.target),ie.applyQuaternion(et),u.setFromVector3(ie),i.autoRotate&&l===a.NONE&&$(G()),i.enableDamping?(u.theta+=h.theta*i.dampingFactor,u.phi+=h.phi*i.dampingFactor):(u.theta+=h.theta,u.phi+=h.phi);let lt=i.minAzimuthAngle,Ct=i.maxAzimuthAngle;isFinite(lt)&&isFinite(Ct)&&(lt<-Math.PI?lt+=he:lt>Math.PI&&(lt-=he),Ct<-Math.PI?Ct+=he:Ct>Math.PI&&(Ct-=he),lt<=Ct?u.theta=Math.max(lt,Math.min(Ct,u.theta)):u.theta=u.theta>(lt+Ct)/2?Math.max(lt,u.theta):Math.min(Ct,u.theta)),u.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,u.phi)),u.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(f,i.dampingFactor):i.target.add(f),i.zoomToCursor&&b||i.object.isOrthographicCamera?u.radius=we(u.radius):u.radius=we(u.radius*d),ie.setFromSpherical(u),ie.applyQuaternion(z),Ze.copy(i.target).add(ie),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(h.theta*=1-i.dampingFactor,h.phi*=1-i.dampingFactor,f.multiplyScalar(1-i.dampingFactor)):(h.set(0,0,0),f.set(0,0,0));let zt=!1;if(i.zoomToCursor&&b){let vt=null;if(i.object instanceof Gn&&i.object.isPerspectiveCamera){const In=ie.length();vt=we(In*d);const Rn=In-vt;i.object.position.addScaledVector(P,Rn),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const In=new j(I.x,I.y,0);In.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/d)),i.object.updateProjectionMatrix(),zt=!0;const Rn=new j(I.x,I.y,0);Rn.unproject(i.object),i.object.position.sub(Rn).add(In),i.object.updateMatrixWorld(),vt=ie.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;vt!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(vt).add(i.object.position):(x1.origin.copy(i.object.position),x1.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(x1.direction))c||8*(1-oe.dot(i.object.quaternion))>c?(i.dispatchEvent(r),ve.copy(i.object.position),oe.copy(i.object.quaternion),zt=!1,!0):!1}})(),this.connect=ie=>{i.domElement=ie,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",_e),i.domElement.addEventListener("pointerdown",C),i.domElement.addEventListener("pointercancel",ue),i.domElement.addEventListener("wheel",Ye)},this.dispose=()=>{var ie,be,et,z,ve,oe;i.domElement&&(i.domElement.style.touchAction="auto"),(ie=i.domElement)==null||ie.removeEventListener("contextmenu",_e),(be=i.domElement)==null||be.removeEventListener("pointerdown",C),(et=i.domElement)==null||et.removeEventListener("pointercancel",ue),(z=i.domElement)==null||z.removeEventListener("wheel",Ye),(ve=i.domElement)==null||ve.ownerDocument.removeEventListener("pointermove",Y),(oe=i.domElement)==null||oe.ownerDocument.removeEventListener("pointerup",ue),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",Ae)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const c=1e-6,u=new tP,h=new tP;let d=1;const f=new j,v=new Fe,_=new Fe,y=new Fe,m=new Fe,S=new Fe,x=new Fe,M=new Fe,R=new Fe,T=new Fe,P=new j,I=new Fe;let b=!1;const w=[],N={};function G(){return 2*Math.PI/60/60*i.autoRotateSpeed}function V(){return Math.pow(.95,i.zoomSpeed)}function $(ie){i.reverseOrbit||i.reverseHorizontalOrbit?h.theta+=ie:h.theta-=ie}function Z(ie){i.reverseOrbit||i.reverseVerticalOrbit?h.phi+=ie:h.phi-=ie}const X=(()=>{const ie=new j;return function(et,z){ie.setFromMatrixColumn(z,0),ie.multiplyScalar(-et),f.add(ie)}})(),re=(()=>{const ie=new j;return function(et,z){i.screenSpacePanning===!0?ie.setFromMatrixColumn(z,1):(ie.setFromMatrixColumn(z,0),ie.crossVectors(i.object.up,ie)),ie.multiplyScalar(et),f.add(ie)}})(),O=(()=>{const ie=new j;return function(et,z){const ve=i.domElement;if(ve&&i.object instanceof Gn&&i.object.isPerspectiveCamera){const oe=i.object.position;ie.copy(oe).sub(i.target);let he=ie.length();he*=Math.tan(i.object.fov/2*Math.PI/180),X(2*et*he/ve.clientHeight,i.object.matrix),re(2*z*he/ve.clientHeight,i.object.matrix)}else ve&&i.object instanceof po&&i.object.isOrthographicCamera?(X(et*(i.object.right-i.object.left)/i.object.zoom/ve.clientWidth,i.object.matrix),re(z*(i.object.top-i.object.bottom)/i.object.zoom/ve.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function Q(ie){i.object instanceof Gn&&i.object.isPerspectiveCamera||i.object instanceof po&&i.object.isOrthographicCamera?d/=ie:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function te(ie){i.object instanceof Gn&&i.object.isPerspectiveCamera||i.object instanceof po&&i.object.isOrthographicCamera?d*=ie:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function le(ie){if(!i.zoomToCursor||!i.domElement)return;b=!0;const be=i.domElement.getBoundingClientRect(),et=ie.clientX-be.left,z=ie.clientY-be.top,ve=be.width,oe=be.height;I.x=et/ve*2-1,I.y=-(z/oe)*2+1,P.set(I.x,I.y,1).unproject(i.object).sub(i.object.position).normalize()}function we(ie){return Math.max(i.minDistance,Math.min(i.maxDistance,ie))}function Ne(ie){v.set(ie.clientX,ie.clientY)}function q(ie){le(ie),M.set(ie.clientX,ie.clientY)}function fe(ie){m.set(ie.clientX,ie.clientY)}function Te(ie){_.set(ie.clientX,ie.clientY),y.subVectors(_,v).multiplyScalar(i.rotateSpeed);const be=i.domElement;be&&($(2*Math.PI*y.x/be.clientHeight),Z(2*Math.PI*y.y/be.clientHeight)),v.copy(_),i.update()}function Se(ie){R.set(ie.clientX,ie.clientY),T.subVectors(R,M),T.y>0?Q(V()):T.y<0&&te(V()),M.copy(R),i.update()}function $e(ie){S.set(ie.clientX,ie.clientY),x.subVectors(S,m).multiplyScalar(i.panSpeed),O(x.x,x.y),m.copy(S),i.update()}function Qe(ie){le(ie),ie.deltaY<0?te(V()):ie.deltaY>0&&Q(V()),i.update()}function je(ie){let be=!1;switch(ie.code){case i.keys.UP:O(0,i.keyPanSpeed),be=!0;break;case i.keys.BOTTOM:O(0,-i.keyPanSpeed),be=!0;break;case i.keys.LEFT:O(i.keyPanSpeed,0),be=!0;break;case i.keys.RIGHT:O(-i.keyPanSpeed,0),be=!0;break}be&&(ie.preventDefault(),i.update())}function Ke(){if(w.length==1)v.set(w[0].pageX,w[0].pageY);else{const ie=.5*(w[0].pageX+w[1].pageX),be=.5*(w[0].pageY+w[1].pageY);v.set(ie,be)}}function B(){if(w.length==1)m.set(w[0].pageX,w[0].pageY);else{const ie=.5*(w[0].pageX+w[1].pageX),be=.5*(w[0].pageY+w[1].pageY);m.set(ie,be)}}function me(){const ie=w[0].pageX-w[1].pageX,be=w[0].pageY-w[1].pageY,et=Math.sqrt(ie*ie+be*be);M.set(0,et)}function ge(){i.enableZoom&&me(),i.enablePan&&B()}function Re(){i.enableZoom&&me(),i.enableRotate&&Ke()}function ae(ie){if(w.length==1)_.set(ie.pageX,ie.pageY);else{const et=ke(ie),z=.5*(ie.pageX+et.x),ve=.5*(ie.pageY+et.y);_.set(z,ve)}y.subVectors(_,v).multiplyScalar(i.rotateSpeed);const be=i.domElement;be&&($(2*Math.PI*y.x/be.clientHeight),Z(2*Math.PI*y.y/be.clientHeight)),v.copy(_)}function Xe(ie){if(w.length==1)S.set(ie.pageX,ie.pageY);else{const be=ke(ie),et=.5*(ie.pageX+be.x),z=.5*(ie.pageY+be.y);S.set(et,z)}x.subVectors(S,m).multiplyScalar(i.panSpeed),O(x.x,x.y),m.copy(S)}function Ce(ie){const be=ke(ie),et=ie.pageX-be.x,z=ie.pageY-be.y,ve=Math.sqrt(et*et+z*z);R.set(0,ve),T.set(0,Math.pow(R.y/M.y,i.zoomSpeed)),Q(T.y),M.copy(R)}function De(ie){i.enableZoom&&Ce(ie),i.enablePan&&Xe(ie)}function U(ie){i.enableZoom&&Ce(ie),i.enableRotate&&ae(ie)}function C(ie){var be,et;i.enabled!==!1&&(w.length===0&&((be=i.domElement)==null||be.ownerDocument.addEventListener("pointermove",Y),(et=i.domElement)==null||et.ownerDocument.addEventListener("pointerup",ue)),Ie(ie),ie.pointerType==="touch"?Ue(ie):ce(ie))}function Y(ie){i.enabled!==!1&&(ie.pointerType==="touch"?st(ie):de(ie))}function ue(ie){var be,et,z;pt(ie),w.length===0&&((be=i.domElement)==null||be.releasePointerCapture(ie.pointerId),(et=i.domElement)==null||et.ownerDocument.removeEventListener("pointermove",Y),(z=i.domElement)==null||z.ownerDocument.removeEventListener("pointerup",ue)),i.dispatchEvent(o),l=a.NONE}function ce(ie){let be;switch(ie.button){case 0:be=i.mouseButtons.LEFT;break;case 1:be=i.mouseButtons.MIDDLE;break;case 2:be=i.mouseButtons.RIGHT;break;default:be=-1}switch(be){case uh.DOLLY:if(i.enableZoom===!1)return;q(ie),l=a.DOLLY;break;case uh.ROTATE:if(ie.ctrlKey||ie.metaKey||ie.shiftKey){if(i.enablePan===!1)return;fe(ie),l=a.PAN}else{if(i.enableRotate===!1)return;Ne(ie),l=a.ROTATE}break;case uh.PAN:if(ie.ctrlKey||ie.metaKey||ie.shiftKey){if(i.enableRotate===!1)return;Ne(ie),l=a.ROTATE}else{if(i.enablePan===!1)return;fe(ie),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function de(ie){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;Te(ie);break;case a.DOLLY:if(i.enableZoom===!1)return;Se(ie);break;case a.PAN:if(i.enablePan===!1)return;$e(ie);break}}function Ye(ie){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(ie.preventDefault(),i.dispatchEvent(s),Qe(ie),i.dispatchEvent(o))}function Ae(ie){i.enabled===!1||i.enablePan===!1||je(ie)}function Ue(ie){switch(nt(ie),w.length){case 1:switch(i.touches.ONE){case hh.ROTATE:if(i.enableRotate===!1)return;Ke(),l=a.TOUCH_ROTATE;break;case hh.PAN:if(i.enablePan===!1)return;B(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case hh.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ge(),l=a.TOUCH_DOLLY_PAN;break;case hh.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Re(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function st(ie){switch(nt(ie),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;ae(ie),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;Xe(ie),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;De(ie),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;U(ie),i.update();break;default:l=a.NONE}}function _e(ie){i.enabled!==!1&&ie.preventDefault()}function Ie(ie){w.push(ie)}function pt(ie){delete N[ie.pointerId];for(let be=0;be=2.0 are supported."));return}const l=new rye(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function T0e(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const on={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 b0e{constructor(e){this.parser=e,this.name=on.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class G0e{constructor(e){this.parser=e,this.name=on.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class H0e{constructor(e){this.parser=e,this.name=on.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class V0e{constructor(e){this.name=on.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,c=r.byteLength||0,u=r.count,h=r.byteStride,d=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,h,d,r.mode,r.filter).then(function(f){return f.buffer}):o.ready.then(function(){const f=new ArrayBuffer(u*h);return o.decodeGltfBuffer(new Uint8Array(f),u,h,d,r.mode,r.filter),f})})}else return null}}class W0e{constructor(e){this.name=on.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==ao.TRIANGLES&&c.mode!==ao.TRIANGLE_STRIP&&c.mode!==ao.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(u=>(l[c]=u,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const u=c.pop(),h=u.isGroup?u.children:[u],d=c[0].count,f=[];for(const v of h){const _=new Rt,y=new j,m=new qi,S=new j(1,1,1),x=new $I(v.geometry,v.material,d);for(let M=0;M=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"},vc={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},q0e={CUBICSPLINE:void 0,LINEAR:kp,STEP:Op},hC={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Z0e(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new ny({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Yo})),n.DefaultMaterial}function rh(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function ul(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function Q0e(n,e,t){let i=!1,r=!1,s=!1;for(let c=0,u=e.length;c0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const iye=new Rt;class rye{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new T0e,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&s<98?this.textureLoader=new iy(this.options.manager):this.textureLoader=new U9(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Hs(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return rh(s,a,r),ul(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,u]of o.children.entries())s(u,a.children[c])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&y.setY(b,T[P*l+1]),l>=3&&y.setZ(b,T[P*l+2]),l>=4&&y.setW(b,T[P*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,i).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const d=(s.samplers||{})[o.sampler]||{};return u.magFilter=_z[d.magFilter]||Vn,u.minFilter=_z[d.minFilter]||fo,u.wrapS=xz[d.wrapS]||Jc,u.wrapT=xz[d.wrapT]||Jc,r.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){c=!0;const d=new Blob([h],{type:o.mimeType});return l=a.createObjectURL(d),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(h){return new Promise(function(d,f){let v=d;t.isImageBitmapLoader===!0&&(v=function(_){const y=new Yn(_);y.needsUpdate=!0,d(y)}),t.load(Hc.resolveURL(h,s.path),v,void 0,f)})}).then(function(h){return c===!0&&a.revokeObjectURL(l),ul(h,o),h.userData.mimeType=o.mimeType||nye(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=u,u}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[on.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[on.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[on.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&(typeof r=="number"&&(r=r===vz?Bh:Rl),"colorSpace"in o?o.colorSpace=r:o.encoding=r===Bh?vz:E0e),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new ty,mi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new Lr,mi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return ny}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},c=[];if(l[on.KHR_MATERIALS_UNLIT]){const h=r[on.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{const h=s.pbrMetallicRoughness||{};if(a.color=new ct(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const d=h.baseColorFactor;a.color.setRGB(d[0],d[1],d[2],Rl),a.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture,Bh)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Sr);const u=s.alphaMode||hC.OPAQUE;if(u===hC.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===hC.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Ls&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new Fe(1,1),s.normalTexture.scale!==void 0)){const h=s.normalTexture.scale;a.normalScale.set(h,h)}if(s.occlusionTexture!==void 0&&o!==Ls&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Ls){const h=s.emissiveFactor;a.emissive=new ct().setRGB(h[0],h[1],h[2],Rl)}return s.emissiveTexture!==void 0&&o!==Ls&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,Bh)),Promise.all(c).then(function(){const h=new o(a);return s.name&&(h.name=s.name),ul(h,s),t.associations.set(h,{materials:e}),s.extensions&&rh(r,h,s),h})}createUniqueName(e){const t=Ln.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[on.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return Sz(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&eye(m,s),m.name=t.createUniqueName(s.name||"mesh_"+e),ul(m,s),y.extensions&&rh(r,m,y),t.assignFinalMaterial(m),h.push(m)}for(let f=0,v=h.length;f1?u=new _l:c.length===1?u=c[0]:u=new wn,u!==c[0])for(let h=0,d=c.length;h{const h=new Map;for(const[d,f]of r.associations)(d instanceof mi||d instanceof Yn)&&h.set(d,f);return u.traverse(d=>{const f=r.associations.get(d);f!=null&&h.set(d,f)}),h};return r.associations=c(s),s})}_createAnimationTracks(e,t,i,r,s){const o=[],a=e.name?e.name:e.uuid,l=[];vc[s.path]===vc.weights?e.traverse(function(d){d.morphTargetInfluences&&l.push(d.name?d.name:d.uuid)}):l.push(a);let c;switch(vc[s.path]){case vc.weights:c=sd;break;case vc.rotation:c=od;break;case vc.position:case vc.scale:c=ad;break;default:switch(i.itemSize){case 1:c=sd;break;case 2:case 3:default:c=ad;break}break}const u=r.interpolation!==void 0?q0e[r.interpolation]:kp,h=this._getArrayFromAccessor(i);for(let d=0,f=l.length;d0,R=V>0,T=$>0,P=(M?1:0)+(R?1:0)+(T?1:0),P){case 0:{m.push(_[x]),m.push(_[x+1]),m.push(_[x+2]);break}case 1:{if(M&&(I=_[x+1],b=_[x+2],w=v(_[x],I,y,S),N=v(_[x],b,y,S)),R){I=_[x],b=_[x+2],w=v(_[x+1],I,y,S),N=v(_[x+1],b,y,S),m.push(w),m.push(b.clone()),m.push(I.clone()),m.push(b.clone()),m.push(w.clone()),m.push(N);break}T&&(I=_[x],b=_[x+1],w=v(_[x+2],I,y,S),N=v(_[x+2],b,y,S)),m.push(I.clone()),m.push(b.clone()),m.push(w),m.push(N),m.push(w.clone()),m.push(b.clone());break}case 2:{M||(I=_[x].clone(),b=v(I,_[x+1],y,S),w=v(I,_[x+2],y,S),m.push(I),m.push(b),m.push(w)),R||(I=_[x+1].clone(),b=v(I,_[x+2],y,S),w=v(I,_[x],y,S),m.push(I),m.push(b),m.push(w)),T||(I=_[x+2].clone(),b=v(I,_[x],y,S),w=v(I,_[x+1],y,S),m.push(I),m.push(b),m.push(w));break}}}return m}function v(_,y,m,S){const x=_.position.dot(m)-S,M=y.position.dot(m)-S,R=x/(x-M);return new Mz(new j(_.position.x+R*(y.position.x-_.position.x),_.position.y+R*(y.position.y-_.position.y),_.position.z+R*(y.position.z-_.position.z)),new j(_.normal.x+R*(y.normal.x-_.normal.x),_.normal.y+R*(y.normal.y-_.normal.y),_.normal.z+R*(y.normal.z-_.normal.z)))}}}class Mz{constructor(e,t){this.position=e,this.normal=t}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}const fC=new WeakMap;class aye extends Dr{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,r){const s=new Hs(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}const i=JSON.stringify(t);if(fC.has(e)){const l=fC.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((c,u)=>{r._callbacks[s]={resolve:c,reject:u},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),fC.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new Vt;e.index&&t.setIndex(new un(e.index.array,1));for(let i=0;i{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=lye.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const h=u.draco,d=new h.Decoder,f=new h.DecoderBuffer;f.Init(new Int8Array(l),l.byteLength);try{const v=t(h,d,f,c),_=v.attributes.map(y=>y.array.buffer);v.index&&_.push(v.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:v},_)}catch(v){console.error(v),self.postMessage({type:"error",id:a.id,error:v.message})}finally{h.destroy(f),h.destroy(d)}});break}};function t(o,a,l,c){const u=c.attributeIDs,h=c.attributeTypes;let d,f;const v=a.GetEncodedGeometryType(l);if(v===o.TRIANGULAR_MESH)d=new o.Mesh,f=a.DecodeBufferToMesh(l,d);else if(v===o.POINT_CLOUD)d=new o.PointCloud,f=a.DecodeBufferToPointCloud(l,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());const _={index:null,attributes:[]};for(const y in u){const m=self[h[y]];let S,x;if(c.useUniqueIDs)x=u[y],S=a.GetAttributeByUniqueId(d,x);else{if(x=a.GetAttributeId(d,o[u[y]]),x===-1)continue;S=a.GetAttribute(d,x)}_.attributes.push(r(o,a,d,y,m,S))}return v===o.TRIANGULAR_MESH&&(_.index=i(o,a,d)),o.destroy(d),_}function i(o,a,l){const u=l.num_faces()*3,h=u*4,d=o._malloc(h);a.GetTrianglesUInt32Array(l,h,d);const f=new Uint32Array(o.HEAPF32.buffer,d,u).slice();return o._free(d),{array:f,itemSize:1}}function r(o,a,l,c,u,h){const d=h.num_components(),v=l.num_points()*d,_=v*u.BYTES_PER_ELEMENT,y=s(o,u),m=o._malloc(_);a.GetAttributeDataArrayForAllPoints(l,h,y,_,m);const S=new u(o.HEAPF32.buffer,m,v).slice();return o._free(m),{name:c,array:S,itemSize:d}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let S1;const pC=()=>{if(S1)return S1;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(h=>{s=h.instance,s.exports.__wasm_call_ctors()});function a(h){const d=new Uint8Array(h.length);for(let v=0;v96?_-71:_>64?_-65:_>47?_+4:_>46?63:62}let f=0;for(let v=0;vn===Object(n)&&!Array.isArray(n)&&typeof n!="function";function aD(n,e){const t=Wr(s=>s.gl),i=pu(iy,mC(n)?Object.values(n):n);return se.useLayoutEffect(()=>{e==null||e(i)},[e]),se.useEffect(()=>{if("initTexture"in t){let s=[];Array.isArray(i)?s=i:i instanceof Yn?s=[i]:mC(i)&&(s=Object.values(i)),s.forEach(o=>{o instanceof Yn&&t.initTexture(o)})}},[t,i]),se.useMemo(()=>{if(mC(n)){const s={};let o=0;for(const a in n)s[a]=i[o++];return s}else return i},[n,i])}aD.preload=n=>pu.preload(iy,n);aD.clear=n=>pu.clear(iy,n);const cye=()=>parseInt(uu.replace(/\D+/g,"")),T$=cye();function uye(n){return Array.isArray(n)}function gC(n=[0,0,0]){return uye(n)?n:n instanceof j||n instanceof Gs?[n.x,n.y,n.z]:[n,n,n]}const hye=se.forwardRef(function({debug:e,depthTest:t=!1,polygonOffsetFactor:i=-10,map:r,mesh:s,children:o,position:a,rotation:l,scale:c,...u},h){const d=se.useRef(null);se.useImperativeHandle(h,()=>d.current);const f=se.useRef(null);return se.useLayoutEffect(()=>{const v=(s==null?void 0:s.current)||d.current.parent,_=d.current;if(!(v instanceof si))throw new Error('Decal must have a Mesh as parent or specify its "mesh" prop');const y={position:new j,rotation:new Gs,scale:new j(1,1,1)};if(v){xa(y,{position:a,scale:c});const m=v.matrixWorld.clone();if(v.matrixWorld.identity(),!l||typeof l=="number"){const S=new wn;S.position.copy(y.position),S.lookAt(v.position),typeof l=="number"&&S.rotateZ(l),xa(y,{rotation:S.rotation})}else xa(y,{rotation:l});return _.geometry=new oye(v,y.position,y.rotation,y.scale),f.current&&(xa(f.current,y),f.current.traverse(S=>S.raycast=()=>null)),v.matrixWorld=m,()=>{_.geometry.dispose()}}},[s,...gC(a),...gC(c),...gC(l)]),se.createElement("mesh",Ua({ref:d,"material-transparent":!0,"material-polygonOffset":!0,"material-polygonOffsetFactor":i,"material-depthTest":t,"material-map":r},u),o,e&&se.createElement("mesh",{ref:f},se.createElement("boxGeometry",null),se.createElement("meshNormalMaterial",{wireframe:!0}),se.createElement("axesHelper",null)))});let M1=null,b$="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function C$(n=!0,e=!0,t){return i=>{t&&t(i),n&&(M1||(M1=new aye),M1.setDecoderPath(typeof n=="string"?n:b$),i.setDRACOLoader(M1)),e&&i.setMeshoptDecoder(typeof pC=="function"?pC():pC)}}const my=(n,e,t,i)=>pu(oD,n,C$(e,t,i));my.preload=(n,e,t,i)=>pu.preload(oD,n,C$(e,t,i));my.clear=n=>pu.clear(oD,n);my.setDecoderPath=n=>{b$=n};const lD=se.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...c},u)=>{const h=Wr(T=>T.invalidate),d=Wr(T=>T.camera),f=Wr(T=>T.gl),v=Wr(T=>T.events),_=Wr(T=>T.setEvents),y=Wr(T=>T.set),m=Wr(T=>T.get),S=Wr(T=>T.performance),x=e||d,M=i||v.connected||f.domElement,R=se.useMemo(()=>new w0e(x),[x]);return Ad(()=>{R.enabled&&R.update()},-1),se.useEffect(()=>(s&&R.connect(s===!0?M:s),R.connect(M),()=>void R.dispose()),[s,M,t,R,h]),se.useEffect(()=>{const T=b=>{h(),t&&S.regress(),o&&o(b)},P=b=>{a&&a(b)},I=b=>{l&&l(b)};return R.addEventListener("change",T),R.addEventListener("start",P),R.addEventListener("end",I),()=>{R.removeEventListener("start",P),R.removeEventListener("end",I),R.removeEventListener("change",T)}},[o,a,l,R,h,_]),se.useEffect(()=>{if(n){const T=m().controls;return y({controls:R}),()=>y({controls:T})}},[n,R]),se.createElement("primitive",Ua({ref:u,object:R,enableDamping:r},c))});var R$={exports:{}},dye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",fye=dye,pye=fye;function P$(){}function I$(){}I$.resetWarningCache=P$;var mye=function(){function n(i,r,s,o,a,l){if(l!==pye){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:I$,resetWarningCache:P$};return t.PropTypes=t,t};R$.exports=mye();var L$=R$.exports;const vC=T$>=154?"opaque_fragment":"output_fragment";class gye extends ty{constructor(e){super(e),this.onBeforeCompile=(t,i)=>{const{isWebGL2:r}=i.capabilities;t.fragmentShader=t.fragmentShader.replace(`#include <${vC}>`,` + ${r?`#include <${vC}>`:`#extension GL_OES_standard_derivatives : enable +#include <${vC}>`} vec2 cxy = 2.0 * gl_PointCoord - 1.0; float r = dot(cxy, cxy); float delta = fwidth(r); float mask = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, r); gl_FragColor = vec4(gl_FragColor.rgb, mask * gl_FragColor.a ); #include - #include <${M$>=154?"colorspace_fragment":"encodings_fragment"}> - `)}}}const fye=se.forwardRef((n,e)=>{const[t]=se.useState(()=>new dye(null));return se.createElement("primitive",Ua({},n,{object:t,ref:e,attach:"material"}))}),pye=se.forwardRef(({children:n,enabled:e=!0,speed:t=1,rotationIntensity:i=1,floatIntensity:r=1,floatingRange:s=[-.1,.1],autoInvalidate:o=!1,...a},l)=>{const c=se.useRef(null);se.useImperativeHandle(l,()=>c.current,[]);const u=se.useRef(Math.random()*1e4);return Ad(h=>{var d,f;if(!e||t===0)return;o&&h.invalidate();const v=u.current+h.clock.getElapsedTime();c.current.rotation.x=Math.cos(v/4*t)/8*i,c.current.rotation.y=Math.sin(v/4*t)/8*i,c.current.rotation.z=Math.sin(v/4*t)/20*i;let _=Math.sin(v/4*t)/10;_=PI.mapLinear(_,-.1,.1,(d=s==null?void 0:s[0])!==null&&d!==void 0?d:-.1,(f=s==null?void 0:s[1])!==null&&f!==void 0?f:.1),c.current.position.y=_*r,c.current.updateMatrix()}),se.createElement("group",a,se.createElement("group",{ref:c,matrixAutoUpdate:!1},n))});let sh,Tg;const mye=se.createContext(null),xz=new Rt,Sz=new j,gye=se.forwardRef(({children:n,range:e,limit:t=1e3,...i},r)=>{const s=se.useRef(null);se.useImperativeHandle(r,()=>s.current,[]);const[o,a]=se.useState([]),[[l,c,u]]=se.useState(()=>[new Float32Array(t*3),Float32Array.from({length:t*3},()=>1),Float32Array.from({length:t},()=>1)]);se.useEffect(()=>{s.current.geometry.attributes.position.needsUpdate=!0}),Ad(()=>{for(s.current.updateMatrix(),s.current.updateMatrixWorld(),xz.copy(s.current.matrixWorld).invert(),s.current.geometry.drawRange.count=Math.min(t,e!==void 0?e:t,o.length),sh=0;sh({getParent:()=>s,subscribe:d=>(a(f=>[...f,d]),()=>a(f=>f.filter(v=>v.current!==d.current)))}),[]);return se.createElement("points",Ua({userData:{instances:o},matrixAutoUpdate:!1,ref:s,raycast:()=>null},i),se.createElement("bufferGeometry",null,se.createElement("bufferAttribute",{attach:"attributes-position",count:l.length/3,array:l,itemSize:3,usage:Gh}),se.createElement("bufferAttribute",{attach:"attributes-color",count:c.length/3,array:c,itemSize:3,usage:Gh}),se.createElement("bufferAttribute",{attach:"attributes-size",count:u.length,array:u,itemSize:1,usage:Gh})),se.createElement(mye.Provider,{value:h},n))}),vye=se.forwardRef(({children:n,positions:e,colors:t,sizes:i,stride:r=3,...s},o)=>{const a=se.useRef(null);return se.useImperativeHandle(o,()=>a.current,[]),Ad(()=>{const l=a.current.geometry.attributes;l.position.needsUpdate=!0,t&&(l.color.needsUpdate=!0),i&&(l.size.needsUpdate=!0)}),se.createElement("points",Ua({ref:a},s),se.createElement("bufferGeometry",null,se.createElement("bufferAttribute",{attach:"attributes-position",count:e.length/r,array:e,itemSize:r,usage:Gh}),t&&se.createElement("bufferAttribute",{attach:"attributes-color",count:t.length/r,array:t,itemSize:3,usage:Gh}),i&&se.createElement("bufferAttribute",{attach:"attributes-size",count:i.length/r,array:i,itemSize:1,usage:Gh})),n)}),yye=se.forwardRef((n,e)=>n.positions instanceof Float32Array?se.createElement(vye,Ua({},n,{ref:e})):se.createElement(gye,Ua({},n,{ref:e})));function Rw({all:n,scene:e,camera:t}){const i=Wr(({gl:o})=>o),r=Wr(({camera:o})=>o),s=Wr(({scene:o})=>o);return se.useLayoutEffect(()=>{const o=[];n&&(e||s).traverse(c=>{c.visible===!1&&(o.push(c),c.visible=!0)}),i.compile(e||s,t||r);const a=new NI(128);new BI(.01,1e5,a).update(i,e||s),a.dispose(),o.forEach(c=>c.visible=!1)},[]),null}/** - * postprocessing v6.36.2 build Tue Sep 10 2024 + #include <${T$>=154?"colorspace_fragment":"encodings_fragment"}> + `)}}}const vye=se.forwardRef((n,e)=>{const[t]=se.useState(()=>new gye(null));return se.createElement("primitive",Ua({},n,{object:t,ref:e,attach:"material"}))}),yye=se.forwardRef(({children:n,enabled:e=!0,speed:t=1,rotationIntensity:i=1,floatIntensity:r=1,floatingRange:s=[-.1,.1],autoInvalidate:o=!1,...a},l)=>{const c=se.useRef(null);se.useImperativeHandle(l,()=>c.current,[]);const u=se.useRef(Math.random()*1e4);return Ad(h=>{var d,f;if(!e||t===0)return;o&&h.invalidate();const v=u.current+h.clock.getElapsedTime();c.current.rotation.x=Math.cos(v/4*t)/8*i,c.current.rotation.y=Math.sin(v/4*t)/8*i,c.current.rotation.z=Math.sin(v/4*t)/20*i;let _=Math.sin(v/4*t)/10;_=DI.mapLinear(_,-.1,.1,(d=s==null?void 0:s[0])!==null&&d!==void 0?d:-.1,(f=s==null?void 0:s[1])!==null&&f!==void 0?f:.1),c.current.position.y=_*r,c.current.updateMatrix()}),se.createElement("group",a,se.createElement("group",{ref:c,matrixAutoUpdate:!1},n))});let sh,bg;const _ye=se.createContext(null),Az=new Rt,wz=new j,xye=se.forwardRef(({children:n,range:e,limit:t=1e3,...i},r)=>{const s=se.useRef(null);se.useImperativeHandle(r,()=>s.current,[]);const[o,a]=se.useState([]),[[l,c,u]]=se.useState(()=>[new Float32Array(t*3),Float32Array.from({length:t*3},()=>1),Float32Array.from({length:t},()=>1)]);se.useEffect(()=>{s.current.geometry.attributes.position.needsUpdate=!0}),Ad(()=>{for(s.current.updateMatrix(),s.current.updateMatrixWorld(),Az.copy(s.current.matrixWorld).invert(),s.current.geometry.drawRange.count=Math.min(t,e!==void 0?e:t,o.length),sh=0;sh({getParent:()=>s,subscribe:d=>(a(f=>[...f,d]),()=>a(f=>f.filter(v=>v.current!==d.current)))}),[]);return se.createElement("points",Ua({userData:{instances:o},matrixAutoUpdate:!1,ref:s,raycast:()=>null},i),se.createElement("bufferGeometry",null,se.createElement("bufferAttribute",{attach:"attributes-position",count:l.length/3,array:l,itemSize:3,usage:Gh}),se.createElement("bufferAttribute",{attach:"attributes-color",count:c.length/3,array:c,itemSize:3,usage:Gh}),se.createElement("bufferAttribute",{attach:"attributes-size",count:u.length,array:u,itemSize:1,usage:Gh})),se.createElement(_ye.Provider,{value:h},n))}),Sye=se.forwardRef(({children:n,positions:e,colors:t,sizes:i,stride:r=3,...s},o)=>{const a=se.useRef(null);return se.useImperativeHandle(o,()=>a.current,[]),Ad(()=>{const l=a.current.geometry.attributes;l.position.needsUpdate=!0,t&&(l.color.needsUpdate=!0),i&&(l.size.needsUpdate=!0)}),se.createElement("points",Ua({ref:a},s),se.createElement("bufferGeometry",null,se.createElement("bufferAttribute",{attach:"attributes-position",count:e.length/r,array:e,itemSize:r,usage:Gh}),t&&se.createElement("bufferAttribute",{attach:"attributes-color",count:t.length/r,array:t,itemSize:3,usage:Gh}),i&&se.createElement("bufferAttribute",{attach:"attributes-size",count:i.length/r,array:i,itemSize:1,usage:Gh})),n)}),Mye=se.forwardRef((n,e)=>n.positions instanceof Float32Array?se.createElement(Sye,Ua({},n,{ref:e})):se.createElement(xye,Ua({},n,{ref:e})));function bw({all:n,scene:e,camera:t}){const i=Wr(({gl:o})=>o),r=Wr(({camera:o})=>o),s=Wr(({scene:o})=>o);return se.useLayoutEffect(()=>{const o=[];n&&(e||s).traverse(c=>{c.visible===!1&&(o.push(c),c.visible=!0)}),i.compile(e||s,t||r);const a=new OI(128);new FI(.01,1e5,a).update(i,e||s),a.dispose(),o.forEach(c=>c.visible=!1)},[]),null}/** + * postprocessing v6.36.3 build Thu Sep 26 2024 * https://github.com/pmndrs/postprocessing * Copyright 2015-2024 Raoul van Rüschen * @license Zlib - */var xC=1/1e3,_ye=1e3,xye=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*xC}get fixedDelta(){return this._fixedDelta*xC}set fixedDelta(n){this._fixedDelta=n*_ye}get elapsed(){return this._elapsed*xC}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},Sye=(()=>{const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new Vt;return t.setAttribute("position",new un(n,3)),t.setAttribute("uv",new un(e,2)),t})(),_s=class TP{static get fullscreenGeometry(){return Sye}constructor(e="Pass",t=new Gp,i=new im){this.name=e,this.renderer=null,this.scene=t,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new si(TP.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new Gp),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=hu){}render(e,t,i,r,s){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,i){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof wi||t instanceof mi||t instanceof Yn||t instanceof TP)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},Mye=class extends _s{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,i,r){const s=n.state.buffers.stencil;s.setLocked(!1),s.setTest(!1)}},Aye=`#include + */var yC=1/1e3,Aye=1e3,wye=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*yC}get fixedDelta(){return this._fixedDelta*yC}set fixedDelta(n){this._fixedDelta=n*Aye}get elapsed(){return this._elapsed*yC}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},Eye=(()=>{const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new Vt;return t.setAttribute("position",new un(n,3)),t.setAttribute("uv",new un(e,2)),t})(),_s=class EP{static get fullscreenGeometry(){return Eye}constructor(e="Pass",t=new Hp,i=new rm){this.name=e,this.renderer=null,this.scene=t,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new si(EP.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new Hp),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=hu){}render(e,t,i,r,s){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,i){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof wi||t instanceof mi||t instanceof Yn||t instanceof EP)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},Tye=class extends _s{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,i,r){const s=n.state.buffers.stencil;s.setLocked(!1),s.setTest(!1)}},bye=`#include #include #ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; @@ -7837,14 +7837,14 @@ uniform lowp sampler2D inputBuffer; uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; #include #include -}`,R$="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",P$=class extends Oi{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new En(null),opacity:new En(1)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Aye,vertexShader:R$})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},wye=class extends _s{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new P$,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new wi(1,1,{minFilter:Vn,magFilter:Vn,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,i,r){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==Zi?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n!==null&&n.outputColorSpace===Bn&&(this.renderTarget.texture.colorSpace=Bn))}},Mz=new ct,I$=class extends _s{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,i,r){const s=this.overrideClearColor,o=this.overrideClearAlpha,a=n.getClearAlpha(),l=s!==null,c=o>=0;l?(n.getClearColor(Mz),n.setClearColor(s,c?o:a)):c&&n.setClearAlpha(o),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),l?n.setClearColor(Mz,a):c&&n.setClearAlpha(a)}},Eye=class extends _s{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new I$(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,i,r){const s=n.getContext(),o=n.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverted?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?c.render(n,null):(c.render(n,e),c.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(a,l)):(n.setRenderTarget(e),n.render(a,l),n.setRenderTarget(t),n.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}},Tye=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:i=!1,multisampling:r=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,i,s,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new wye,this.depthTexture=null,this.passes=[],this.timer=new xye,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,i=this.multisampling;i>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):i!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new Fe),i=e.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===Zi&&e.outputColorSpace===Bn&&(this.inputBuffer.texture.colorSpace=Bn,this.outputBuffer.texture.colorSpace=Bn,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const s of this.passes)s.initialize(e,i,r)}}replaceRenderer(e,t=!0){const i=this.renderer,r=i.domElement.parentNode;return this.setRenderer(e),t&&r!==null&&(r.removeChild(i.domElement),r.appendChild(e.domElement)),i}createDepthTexture(){const e=this.depthTexture=new zA;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=qc,e.type=Kc):e.type=Na,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,i,r){const s=this.renderer,o=s===null?new Fe:s.getDrawingBufferSize(new Fe),a={minFilter:Vn,magFilter:Vn,stencilBuffer:t,depthBuffer:e,type:i},l=new wi(o.width,o.height,a);return r>0&&(l.ignoreDepthForMultisampleCopy=!1,l.samples=r),i===Zi&&s!==null&&s.outputColorSpace===Bn&&(l.texture.colorSpace=Bn),l.texture.name="EffectComposer.Buffer",l.texture.generateMipmaps=!1,l}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const i=this.passes,r=this.renderer,s=r.getDrawingBufferSize(new Fe),o=r.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(e.setRenderer(r),e.setSize(s.width,s.height),e.initialize(r,o,a),this.autoRenderToScreen&&(i.length>0&&(i[i.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?i.splice(t,0,e):i.push(e),this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const l=this.createDepthTexture();for(e of i)e.setDepthTexture(l)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,i=t.indexOf(e);if(i!==-1&&t.splice(i,1).length>0){if(this.depthTexture!==null){const o=(l,c)=>l||c.needsDepthTexture;t.reduce(o,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&i===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,i=this.copyPass;let r=this.inputBuffer,s=this.outputBuffer,o=!1,a,l,c;e===void 0&&(this.timer.update(),e=this.timer.getDelta());for(const u of this.passes)u.enabled&&(u.render(t,r,s,e,o),u.needsSwap&&(o&&(i.renderToScreen=u.renderToScreen,a=t.getContext(),l=t.state.buffers.stencil,l.setFunc(a.NOTEQUAL,1,4294967295),i.render(t,r,s,e,o),l.setFunc(a.EQUAL,1,4294967295)),c=r,r=s,s=c),u instanceof Eye?o=!0:u instanceof Mye&&(o=!1))}setSize(e,t,i){const r=this.renderer,s=r.getSize(new Fe);(e===void 0||t===void 0)&&(e=s.width,t=s.height),(s.width!==e||s.height!==t)&&r.setSize(e,t,i);const o=r.getDrawingBufferSize(new Fe);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const a of this.passes)a.setSize(o.width,o.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),_s.fullscreenGeometry.dispose()}},Pl={NONE:0,DEPTH:1,CONVOLUTION:2},An={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},bye=class{constructor(){this.shaderParts=new Map([[An.FRAGMENT_HEAD,null],[An.FRAGMENT_MAIN_UV,null],[An.FRAGMENT_MAIN_IMAGE,null],[An.VERTEX_HEAD,null],[An.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Pl.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Zo}},SC=!1,Az=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Sr:t=this.materialsFlatShadedDoubleSide;break;case Fi:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Sr:t=this.materialsDoubleSide;break;case Fi:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof Oi))return n.clone();const e=n.uniforms,t=new Map;for(const r in e){const s=e[r].value;s.isRenderTargetTexture&&(e[r].value=null,t.set(r,s))}const i=n.clone();for(const r of t)e[r[0]].value=r[1],i.uniforms[r[0]].value=r[1];return i}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Yo;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Fi,i}),this.materialsDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Sr,i}),this.materialsFlatShaded=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Fi,i}),this.materialsFlatShadedDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Sr,i})}}render(n,e,t){const i=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,SC){const r=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const s of r)s[0].material=s[1];this.meshCount!==r.size&&r.clear()}else{const r=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=r}n.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return SC}static set workaroundEnabled(n){SC=n}},_c=-1,wr=class extends vs{constructor(n,e=_c,t=_c,i=1){super(),this.resizable=n,this.baseSize=new Fe(1,1),this.preferredSize=new Fe(e,t),this.target=this.preferredSize,this.s=i,this.effectiveSize=new Fe,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,i=this.scale;e.width!==_c?t.width=e.width:e.height!==_c?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*i),e.height!==_c?t.height=e.height:e.width!==_c?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*i)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(_c),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return _c}},sn={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Cye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",Rye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",Pye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",Iye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",Lye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",Dye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",Bye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",Nye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",Uye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",Fye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",Oye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",kye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",zye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",Gye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",Hye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",Vye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",Wye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",$ye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",Xye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",jye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",Yye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",Jye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",Kye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",qye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",Zye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",Qye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",e_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",t_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",n_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",i_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",r_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",s_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",o_e=new Map([[sn.ADD,Cye],[sn.ALPHA,Rye],[sn.AVERAGE,Pye],[sn.COLOR,Iye],[sn.COLOR_BURN,Lye],[sn.COLOR_DODGE,Dye],[sn.DARKEN,Bye],[sn.DIFFERENCE,Nye],[sn.DIVIDE,Uye],[sn.DST,null],[sn.EXCLUSION,Fye],[sn.HARD_LIGHT,Oye],[sn.HARD_MIX,kye],[sn.HUE,zye],[sn.INVERT,Gye],[sn.INVERT_RGB,Hye],[sn.LIGHTEN,Vye],[sn.LINEAR_BURN,Wye],[sn.LINEAR_DODGE,$ye],[sn.LINEAR_LIGHT,Xye],[sn.LUMINOSITY,jye],[sn.MULTIPLY,Yye],[sn.NEGATION,Jye],[sn.NORMAL,Kye],[sn.OVERLAY,qye],[sn.PIN_LIGHT,Zye],[sn.REFLECT,Qye],[sn.SATURATION,e_e],[sn.SCREEN,t_e],[sn.SOFT_LIGHT,n_e],[sn.SRC,i_e],[sn.SUBTRACT,r_e],[sn.VIVID_LIGHT,s_e]]),a_e=class extends vs{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new En(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return o_e.get(this.blendFunction)}},oD={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},l_e=`#ifdef FRAMEBUFFER_PRECISION_HIGH +}`,D$="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",B$=class extends Oi{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new En(null),opacity:new En(1)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:bye,vertexShader:D$})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},Cye=class extends _s{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new B$,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new wi(1,1,{minFilter:Vn,magFilter:Vn,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,i,r){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==Zi?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n!==null&&n.outputColorSpace===Dn&&(this.renderTarget.texture.colorSpace=Dn))}},Ez=new ct,N$=class extends _s{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,i,r){const s=this.overrideClearColor,o=this.overrideClearAlpha,a=n.getClearAlpha(),l=s!==null,c=o>=0;l?(n.getClearColor(Ez),n.setClearColor(s,c?o:a)):c&&n.setClearAlpha(o),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),l?n.setClearColor(Ez,a):c&&n.setClearAlpha(a)}},Rye=class extends _s{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new N$(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,i,r){const s=n.getContext(),o=n.state.buffers,a=this.scene,l=this.camera,c=this.clearPass,u=this.inverted?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?c.render(n,null):(c.render(n,e),c.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(a,l)):(n.setRenderTarget(e),n.render(a,l),n.setRenderTarget(t),n.render(a,l)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}},Pye=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:i=!1,multisampling:r=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,i,s,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Cye,this.depthTexture=null,this.passes=[],this.timer=new wye,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,i=this.multisampling;i>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):i!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new Fe),i=e.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===Zi&&e.outputColorSpace===Dn&&(this.inputBuffer.texture.colorSpace=Dn,this.outputBuffer.texture.colorSpace=Dn,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const s of this.passes)s.initialize(e,i,r)}}replaceRenderer(e,t=!0){const i=this.renderer,r=i.domElement.parentNode;return this.setRenderer(e),t&&r!==null&&(r.removeChild(i.domElement),r.appendChild(e.domElement)),i}createDepthTexture(){const e=this.depthTexture=new OA;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=qc,e.type=Kc):e.type=Na,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,i,r){const s=this.renderer,o=s===null?new Fe:s.getDrawingBufferSize(new Fe),a={minFilter:Vn,magFilter:Vn,stencilBuffer:t,depthBuffer:e,type:i},l=new wi(o.width,o.height,a);return r>0&&(l.ignoreDepthForMultisampleCopy=!1,l.samples=r),i===Zi&&s!==null&&s.outputColorSpace===Dn&&(l.texture.colorSpace=Dn),l.texture.name="EffectComposer.Buffer",l.texture.generateMipmaps=!1,l}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const i=this.passes,r=this.renderer,s=r.getDrawingBufferSize(new Fe),o=r.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(e.setRenderer(r),e.setSize(s.width,s.height),e.initialize(r,o,a),this.autoRenderToScreen&&(i.length>0&&(i[i.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?i.splice(t,0,e):i.push(e),this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const l=this.createDepthTexture();for(e of i)e.setDepthTexture(l)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,i=t.indexOf(e);if(i!==-1&&t.splice(i,1).length>0){if(this.depthTexture!==null){const o=(l,c)=>l||c.needsDepthTexture;t.reduce(o,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&i===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,i=this.copyPass;let r=this.inputBuffer,s=this.outputBuffer,o=!1,a,l,c;e===void 0&&(this.timer.update(),e=this.timer.getDelta());for(const u of this.passes)u.enabled&&(u.render(t,r,s,e,o),u.needsSwap&&(o&&(i.renderToScreen=u.renderToScreen,a=t.getContext(),l=t.state.buffers.stencil,l.setFunc(a.NOTEQUAL,1,4294967295),i.render(t,r,s,e,o),l.setFunc(a.EQUAL,1,4294967295)),c=r,r=s,s=c),u instanceof Rye?o=!0:u instanceof Tye&&(o=!1))}setSize(e,t,i){const r=this.renderer,s=r.getSize(new Fe);(e===void 0||t===void 0)&&(e=s.width,t=s.height),(s.width!==e||s.height!==t)&&r.setSize(e,t,i);const o=r.getDrawingBufferSize(new Fe);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const a of this.passes)a.setSize(o.width,o.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),_s.fullscreenGeometry.dispose()}},Pl={NONE:0,DEPTH:1,CONVOLUTION:2},An={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Iye=class{constructor(){this.shaderParts=new Map([[An.FRAGMENT_HEAD,null],[An.FRAGMENT_MAIN_UV,null],[An.FRAGMENT_MAIN_IMAGE,null],[An.VERTEX_HEAD,null],[An.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Pl.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Zo}},_C=!1,Tz=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Sr:t=this.materialsFlatShadedDoubleSide;break;case Fi:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Sr:t=this.materialsDoubleSide;break;case Fi:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof Oi))return n.clone();const e=n.uniforms,t=new Map;for(const r in e){const s=e[r].value;s.isRenderTargetTexture&&(e[r].value=null,t.set(r,s))}const i=n.clone();for(const r of t)e[r[0]].value=r[1],i.uniforms[r[0]].value=r[1];return i}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Yo;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Fi,i}),this.materialsDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.side=Sr,i}),this.materialsFlatShaded=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Fi,i}),this.materialsFlatShadedDoubleSide=e.map(t=>{const i=this.cloneMaterial(t);return i.uniforms=Object.assign({},n.uniforms),i.flatShading=!0,i.side=Sr,i})}}render(n,e,t){const i=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,_C){const r=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const s of r)s[0].material=s[1];this.meshCount!==r.size&&r.clear()}else{const r=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=r}n.shadowMap.enabled=i}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return _C}static set workaroundEnabled(n){_C=n}},yc=-1,wr=class extends vs{constructor(n,e=yc,t=yc,i=1){super(),this.resizable=n,this.baseSize=new Fe(1,1),this.preferredSize=new Fe(e,t),this.target=this.preferredSize,this.s=i,this.effectiveSize=new Fe,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,i=this.scale;e.width!==yc?t.width=e.width:e.height!==yc?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*i),e.height!==yc?t.height=e.height:e.width!==yc?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*i)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(yc),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return yc}},sn={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Lye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",Dye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",Bye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",Nye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",Uye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",Fye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",Oye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",kye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",zye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",Gye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",Hye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",Vye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",Wye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",$ye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",Xye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",jye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",Yye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",Jye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",Kye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",qye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",Zye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",Qye="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",e_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",t_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",n_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",i_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",r_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",s_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",o_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",a_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",l_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",c_e="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",u_e=new Map([[sn.ADD,Lye],[sn.ALPHA,Dye],[sn.AVERAGE,Bye],[sn.COLOR,Nye],[sn.COLOR_BURN,Uye],[sn.COLOR_DODGE,Fye],[sn.DARKEN,Oye],[sn.DIFFERENCE,kye],[sn.DIVIDE,zye],[sn.DST,null],[sn.EXCLUSION,Gye],[sn.HARD_LIGHT,Hye],[sn.HARD_MIX,Vye],[sn.HUE,Wye],[sn.INVERT,$ye],[sn.INVERT_RGB,Xye],[sn.LIGHTEN,jye],[sn.LINEAR_BURN,Yye],[sn.LINEAR_DODGE,Jye],[sn.LINEAR_LIGHT,Kye],[sn.LUMINOSITY,qye],[sn.MULTIPLY,Zye],[sn.NEGATION,Qye],[sn.NORMAL,e_e],[sn.OVERLAY,t_e],[sn.PIN_LIGHT,n_e],[sn.REFLECT,i_e],[sn.SATURATION,r_e],[sn.SCREEN,s_e],[sn.SOFT_LIGHT,o_e],[sn.SRC,a_e],[sn.SUBTRACT,l_e],[sn.VIVID_LIGHT,c_e]]),h_e=class extends vs{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new En(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return u_e.get(this.blendFunction)}},cD={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},d_e=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else uniform lowp sampler2D inputBuffer; #endif varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; #include -}`,c_e="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",u_e=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],h_e=class extends Oi{constructor(n=new bn){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new En(null),texelSize:new En(new bn),scale:new En(1),kernel:new En(0)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:l_e,vertexShader:c_e}),this.setTexelSize(n.x,n.y),this.kernelSize=oD.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return u_e[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e,n*.5,e*.5)}setSize(n,e){const t=1/n,i=1/e;this.uniforms.texelSize.value.set(t,i,t*.5,i*.5)}},d_e=class extends _s{constructor({kernelSize:n=oD.MEDIUM,resolutionScale:e=.5,width:t=wr.AUTO_SIZE,height:i=wr.AUTO_SIZE,resolutionX:r=t,resolutionY:s=i}={}){super("KawaseBlurPass"),this.renderTargetA=new wi(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new wr(this,r,s,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new h_e,this._blurMaterial.kernelSize=n,this.copyMaterial=new P$}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,r){const s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.blurMaterial,u=c.kernelSequence;let h=e;this.fullscreenMaterial=c;for(let d=0,f=u.length;d +}`,f_e="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",p_e=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],m_e=class extends Oi{constructor(n=new bn){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new En(null),texelSize:new En(new bn),scale:new En(1),kernel:new En(0)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:d_e,vertexShader:f_e}),this.setTexelSize(n.x,n.y),this.kernelSize=cD.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return p_e[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e,n*.5,e*.5)}setSize(n,e){const t=1/n,i=1/e;this.uniforms.texelSize.value.set(t,i,t*.5,i*.5)}},g_e=class extends _s{constructor({kernelSize:n=cD.MEDIUM,resolutionScale:e=.5,width:t=wr.AUTO_SIZE,height:i=wr.AUTO_SIZE,resolutionX:r=t,resolutionY:s=i}={}){super("KawaseBlurPass"),this.renderTargetA=new wi(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new wr(this,r,s,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new m_e,this._blurMaterial.kernelSize=n,this.copyMaterial=new B$}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,r){const s=this.scene,o=this.camera,a=this.renderTargetA,l=this.renderTargetB,c=this.blurMaterial,u=c.kernelSequence;let h=e;this.fullscreenMaterial=c;for(let d=0,f=u.length;d #ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else @@ -7866,7 +7866,7 @@ gl_FragColor=vec4(texel.rgb*clamp(l,0.0,1.0),l); #else gl_FragColor=vec4(l); #endif -}`,p_e=class extends Oi{constructor(n=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:uu.replace(/\D+/g,"")},uniforms:{inputBuffer:new En(null),threshold:new En(0),smoothing:new En(1),range:new En(null)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:f_e,vertexShader:R$}),this.colorOutput=n,this.luminanceRange=e}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},m_e=class extends _s{constructor({renderTarget:n,luminanceRange:e,colorOutput:t,resolutionScale:i=1,width:r=wr.AUTO_SIZE,height:s=wr.AUTO_SIZE,resolutionX:o=r,resolutionY:a=s}={}){super("LuminancePass"),this.fullscreenMaterial=new p_e(t,e),this.needsSwap=!1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new wi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const l=this.resolution=new wr(this,o,a,i);l.addEventListener("change",c=>this.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,i,r){const s=this.fullscreenMaterial;s.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==Zi&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},g_e=`#ifdef FRAMEBUFFER_PRECISION_HIGH +}`,y_e=class extends Oi{constructor(n=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:uu.replace(/\D+/g,"")},uniforms:{inputBuffer:new En(null),threshold:new En(0),smoothing:new En(1),range:new En(null)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:v_e,vertexShader:D$}),this.colorOutput=n,this.luminanceRange=e}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},__e=class extends _s{constructor({renderTarget:n,luminanceRange:e,colorOutput:t,resolutionScale:i=1,width:r=wr.AUTO_SIZE,height:s=wr.AUTO_SIZE,resolutionX:o=r,resolutionY:a=s}={}){super("LuminancePass"),this.fullscreenMaterial=new y_e(t,e),this.needsSwap=!1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new wi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const l=this.resolution=new wr(this,o,a,i);l.addEventListener("change",c=>this.setSize(l.baseWidth,l.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,i,r){const s=this.fullscreenMaterial;s.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==Zi&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},x_e=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else uniform lowp sampler2D inputBuffer; @@ -7875,19 +7875,19 @@ uniform lowp sampler2D inputBuffer; #define WEIGHT_OUTER 0.0555555 varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; #include -}`,v_e="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",y_e=class extends Oi{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new En(null),texelSize:new En(new Fe)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:g_e,vertexShader:v_e})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},__e=`#ifdef FRAMEBUFFER_PRECISION_HIGH +}`,S_e="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",M_e=class extends Oi{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new En(null),texelSize:new En(new Fe)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:x_e,vertexShader:S_e})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},A_e=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; #else uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; #endif uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); #include -}`,x_e="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",S_e=class extends Oi{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new En(null),supportBuffer:new En(null),texelSize:new En(new Fe),radius:new En(.85)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:__e,vertexShader:x_e})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},M_e=class extends _s{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new wi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new y_e,this.upsamplingMaterial=new S_e,this.resolution=new Fe}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t=0;--d){const f=u[d];l.setSize(h.width,h.height),l.inputBuffer=h.texture,l.supportBuffer=c[d].texture,n.setRenderTarget(f),n.render(s,o),h=f}}setSize(n,e){const t=this.resolution;t.set(n,e);let i=t.width,r=t.height;for(let s=0,o=this.downsamplingMipmaps.length;sthis.setChanged()),this._inputColorSpace=Zo,this._outputColorSpace=zo}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=hu){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof wi||e instanceof mi||e instanceof Yn||e instanceof _s)&&this[n].dispose()}}},A_e=`#ifdef FRAMEBUFFER_PRECISION_HIGH +}`,w_e="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",E_e=class extends Oi{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new En(null),supportBuffer:new En(null),texelSize:new En(new Fe),radius:new En(.85)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:A_e,vertexShader:w_e})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},T_e=class extends _s{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new wi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new M_e,this.upsamplingMaterial=new E_e,this.resolution=new Fe}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t=0;--d){const f=u[d];l.setSize(h.width,h.height),l.inputBuffer=h.texture,l.supportBuffer=c[d].texture,n.setRenderTarget(f),n.render(s,o),h=f}}setSize(n,e){const t=this.resolution;t.set(n,e);let i=t.width,r=t.height;for(let s=0,o=this.downsamplingMipmaps.length;sthis.setChanged()),this._inputColorSpace=Zo,this._outputColorSpace=zo}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,e=hu){}update(n,e,t){}setSize(n,e){}initialize(n,e,t){}dispose(){for(const n of Object.keys(this)){const e=this[n];(e instanceof wi||e instanceof mi||e instanceof Yn||e instanceof _s)&&this[n].dispose()}}},b_e=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D map; #else uniform lowp sampler2D map; #endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,texel.a);}`,w_e=class extends bP{constructor({blendFunction:n=sn.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,mipmapBlur:i=!1,intensity:r=1,radius:s=.85,levels:o=8,kernelSize:a=oD.LARGE,resolutionScale:l=.5,width:c=wr.AUTO_SIZE,height:u=wr.AUTO_SIZE,resolutionX:h=c,resolutionY:d=u}={}){super("BloomEffect",A_e,{blendFunction:n,uniforms:new Map([["map",new En(null)],["intensity",new En(r)]])}),this.renderTarget=new wi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new d_e({kernelSize:a}),this.luminancePass=new m_e({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new M_e,this.mipmapBlurPass.enabled=i,this.mipmapBlurPass.radius=s,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=i?this.mipmapBlurPass.texture:this.renderTarget.texture;const f=this.resolution=new wr(this,h,d,l);f.addEventListener("change",v=>this.setSize(f.baseWidth,f.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,e,t){const i=this.renderTarget,r=this.luminancePass;r.enabled?(r.render(n,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,r.renderTarget):this.blurPass.render(n,r.renderTarget,i)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,e):this.blurPass.render(n,e,i)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(n,e),this.mipmapBlurPass.setSize(n,e)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.luminancePass.initialize(n,e,t),this.mipmapBlurPass.initialize(n,e,t),t!==void 0&&(this.renderTarget.texture.type=t,n!==null&&n.outputColorSpace===Bn&&(this.renderTarget.texture.colorSpace=Bn))}},L$=class extends _s{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new I$,this.overrideMaterialManager=t===null?null:new Az(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new Az(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,i,r){const s=this.scene,o=this.camera,a=this.selection,l=o.layers.mask,c=s.background,u=n.shadowMap.autoUpdate,h=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(s.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(h),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,s,o):n.render(s,o),o.layers.mask=l,s.background=c,n.shadowMap.autoUpdate=u}},E_e=`#include +uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,texel.a);}`,C_e=class extends TP{constructor({blendFunction:n=sn.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,mipmapBlur:i=!1,intensity:r=1,radius:s=.85,levels:o=8,kernelSize:a=cD.LARGE,resolutionScale:l=.5,width:c=wr.AUTO_SIZE,height:u=wr.AUTO_SIZE,resolutionX:h=c,resolutionY:d=u}={}){super("BloomEffect",b_e,{blendFunction:n,uniforms:new Map([["map",new En(null)],["intensity",new En(r)]])}),this.renderTarget=new wi(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new g_e({kernelSize:a}),this.luminancePass=new __e({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new T_e,this.mipmapBlurPass.enabled=i,this.mipmapBlurPass.radius=s,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=i?this.mipmapBlurPass.texture:this.renderTarget.texture;const f=this.resolution=new wr(this,h,d,l);f.addEventListener("change",v=>this.setSize(f.baseWidth,f.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,e,t){const i=this.renderTarget,r=this.luminancePass;r.enabled?(r.render(n,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,r.renderTarget):this.blurPass.render(n,r.renderTarget,i)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,e):this.blurPass.render(n,e,i)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(n,e),this.mipmapBlurPass.setSize(n,e)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.luminancePass.initialize(n,e,t),this.mipmapBlurPass.initialize(n,e,t),t!==void 0&&(this.renderTarget.texture.type=t,n!==null&&n.outputColorSpace===Dn&&(this.renderTarget.texture.colorSpace=Dn))}},U$=class extends _s{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new N$,this.overrideMaterialManager=t===null?null:new Tz(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new Tz(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,i,r){const s=this.scene,o=this.camera,a=this.selection,l=o.layers.mask,c=s.background,u=n.shadowMap.autoUpdate,h=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(s.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(h),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,s,o):n.render(s,o),o.layers.mask=l,s.background=c,n.shadowMap.autoUpdate=u}},R_e=`#include #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp sampler2D depthBuffer; #else @@ -7908,7 +7908,7 @@ vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1 #else vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0); #endif -gl_FragColor=vec4(n[index],d[index]);}`,T_e="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",b_e=class extends Oi{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new En(null),normalBuffer:new En(null),texelSize:new En(new Fe)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:E_e,vertexShader:T_e})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=hu){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},C_e=class extends _s{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=wr.AUTO_SIZE,height:i=wr.AUTO_SIZE,resolutionX:r=t,resolutionY:s=i}={}){super("DepthDownsamplingPass");const o=new b_e;o.normalBuffer=n,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new wi(1,1,{minFilter:ri,magFilter:ri,depthBuffer:!1,type:Yr}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const a=this.resolution=new wr(this,r,s,e);a.addEventListener("change",l=>this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=hu){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,i,r){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const i=n.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},R_e=`#include +gl_FragColor=vec4(n[index],d[index]);}`,P_e="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",I_e=class extends Oi{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new En(null),normalBuffer:new En(null),texelSize:new En(new Fe)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:R_e,vertexShader:P_e})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=hu){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},L_e=class extends _s{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=wr.AUTO_SIZE,height:i=wr.AUTO_SIZE,resolutionX:r=t,resolutionY:s=i}={}){super("DepthDownsamplingPass");const o=new I_e;o.normalBuffer=n,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new wi(1,1,{minFilter:ri,magFilter:ri,depthBuffer:!1,type:Yr}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const a=this.resolution=new wr(this,r,s,e);a.addEventListener("change",l=>this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=hu){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,i,r){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const i=n.getContext();if(!(i.getExtension("EXT_color_buffer_float")||i.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},D_e=`#include #include #include #define packFloatToRGBA(v) packDepthToRGBA(v) @@ -7942,10 +7942,10 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar); #include #endif #include -}`,P_e="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",I_e=class extends Oi{constructor(n,e,t,i,r=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:uu.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new En(null),depthBuffer:new En(null),resolution:new En(new Fe),texelSize:new En(new Fe),cameraNear:new En(.3),cameraFar:new En(1e3),aspect:new En(1),time:new En(0)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:r}),n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(i)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=hu){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=R_e.replace(An.FRAGMENT_HEAD,n.get(An.FRAGMENT_HEAD)||"").replace(An.FRAGMENT_MAIN_UV,n.get(An.FRAGMENT_MAIN_UV)||"").replace(An.FRAGMENT_MAIN_IMAGE,n.get(An.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=P_e.replace(An.VERTEX_HEAD,n.get(An.VERTEX_HEAD)||"").replace(An.VERTEX_MAIN_SUPPORT,n.get(An.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof Gn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return An}};function wz(n,e,t){for(const i of e){const r="$1"+n+i.charAt(0).toUpperCase()+i.slice(1),s=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(s,r))}}function L_e(n,e,t){let i=e.getFragmentShader(),r=e.getVertexShader();const s=i!==void 0&&/mainImage/.test(i),o=i!==void 0&&/mainUv/.test(i);if(t.attributes|=e.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&t.attributes&Pl.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!s&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,l=t.shaderParts;let c=l.get(An.FRAGMENT_HEAD)||"",u=l.get(An.FRAGMENT_MAIN_UV)||"",h=l.get(An.FRAGMENT_MAIN_IMAGE)||"",d=l.get(An.VERTEX_HEAD)||"",f=l.get(An.VERTEX_MAIN_SUPPORT)||"";const v=new Set,_=new Set;if(o&&(u+=` ${n}MainUv(UV); +}`,B_e="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",N_e=class extends Oi{constructor(n,e,t,i,r=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:uu.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new En(null),depthBuffer:new En(null),resolution:new En(new Fe),texelSize:new En(new Fe),cameraNear:new En(.3),cameraFar:new En(1e3),aspect:new En(1),time:new En(0)},blending:br,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:r}),n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(i)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=hu){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=D_e.replace(An.FRAGMENT_HEAD,n.get(An.FRAGMENT_HEAD)||"").replace(An.FRAGMENT_MAIN_UV,n.get(An.FRAGMENT_MAIN_UV)||"").replace(An.FRAGMENT_MAIN_IMAGE,n.get(An.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=B_e.replace(An.VERTEX_HEAD,n.get(An.VERTEX_HEAD)||"").replace(An.VERTEX_MAIN_SUPPORT,n.get(An.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof Gn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return An}};function bz(n,e,t){for(const i of e){const r="$1"+n+i.charAt(0).toUpperCase()+i.slice(1),s=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(s,r))}}function U_e(n,e,t){let i=e.getFragmentShader(),r=e.getVertexShader();const s=i!==void 0&&/mainImage/.test(i),o=i!==void 0&&/mainUv/.test(i);if(t.attributes|=e.getAttributes(),i===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&t.attributes&Pl.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!s&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,l=t.shaderParts;let c=l.get(An.FRAGMENT_HEAD)||"",u=l.get(An.FRAGMENT_MAIN_UV)||"",h=l.get(An.FRAGMENT_MAIN_IMAGE)||"",d=l.get(An.VERTEX_HEAD)||"",f=l.get(An.VERTEX_MAIN_SUPPORT)||"";const v=new Set,_=new Set;if(o&&(u+=` ${n}MainUv(UV); `,t.uvTransformation=!0),r!==null&&/mainSupport/.test(r)){const S=/mainSupport *\([\w\s]*?uv\s*?\)/.test(r);f+=` ${n}MainSupport(`,f+=S?`vUv); `:`); -`;for(const x of r.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const M of x[1].split(/\s*,\s*/))t.varyings.add(M),v.add(M),_.add(M);for(const x of r.matchAll(a))_.add(x[1])}for(const S of i.matchAll(a))_.add(S[1]);for(const S of e.defines.keys())_.add(S.replace(/\([\w\s,]*\)/g,""));for(const S of e.uniforms.keys())_.add(S);_.delete("while"),_.delete("for"),_.delete("if"),e.uniforms.forEach((S,x)=>t.uniforms.set(n+x.charAt(0).toUpperCase()+x.slice(1),S)),e.defines.forEach((S,x)=>t.defines.set(n+x.charAt(0).toUpperCase()+x.slice(1),S));const y=new Map([["fragment",i],["vertex",r]]);wz(n,_,t.defines),wz(n,_,y),i=y.get("fragment"),r=y.get("vertex");const m=e.blendMode;if(t.blendModes.set(m.blendFunction,m),s){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(h+=e.inputColorSpace===Bn?`color0 = sRGBTransferOETF(color0); +`;for(const x of r.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const M of x[1].split(/\s*,\s*/))t.varyings.add(M),v.add(M),_.add(M);for(const x of r.matchAll(a))_.add(x[1])}for(const S of i.matchAll(a))_.add(S[1]);for(const S of e.defines.keys())_.add(S.replace(/\([\w\s,]*\)/g,""));for(const S of e.uniforms.keys())_.add(S);_.delete("while"),_.delete("for"),_.delete("if"),e.uniforms.forEach((S,x)=>t.uniforms.set(n+x.charAt(0).toUpperCase()+x.slice(1),S)),e.defines.forEach((S,x)=>t.defines.set(n+x.charAt(0).toUpperCase()+x.slice(1),S));const y=new Map([["fragment",i],["vertex",r]]);bz(n,_,t.defines),bz(n,_,y),i=y.get("fragment"),r=y.get("vertex");const m=e.blendMode;if(t.blendModes.set(m.blendFunction,m),s){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(h+=e.inputColorSpace===Dn?`color0 = sRGBTransferOETF(color0); `:`color0 = sRGBToLinear(color0); `),e.outputColorSpace!==zo?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const S=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;h+=`${n}MainImage(color0, UV, `,t.attributes&Pl.DEPTH&&S.test(i)&&(h+="depth, ",t.readDepth=!0),h+=`color1); `;const x=n+"BlendOpacity";t.uniforms.set(x,m.opacity),h+=`color0 = blend${m.blendFunction}(color0, color1, ${x}); @@ -7954,15 +7954,15 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar); `}if(c+=i+` `,r!==null&&(d+=r+` -`),l.set(An.FRAGMENT_HEAD,c),l.set(An.FRAGMENT_MAIN_UV,u),l.set(An.FRAGMENT_MAIN_IMAGE,h),l.set(An.VERTEX_HEAD,d),l.set(An.VERTEX_MAIN_SUPPORT,f),e.extensions!==null)for(const S of e.extensions)t.extensions.add(S)}}var D_e=class extends _s{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new I_e(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new bye;let e=0;for(const o of this.effects)if(o.blendMode.blendFunction===sn.DST)n.attributes|=o.getAttributes()&Pl.DEPTH;else{if(n.attributes&o.getAttributes()&Pl.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${o.name})`);L_e("e"+e++,o,n)}let t=n.shaderParts.get(An.FRAGMENT_HEAD),i=n.shaderParts.get(An.FRAGMENT_MAIN_IMAGE),r=n.shaderParts.get(An.FRAGMENT_MAIN_UV);const s=/\bblend\b/g;for(const o of n.blendModes.values())t+=o.getShaderCode().replace(s,`blend${o.blendFunction}`)+` +`),l.set(An.FRAGMENT_HEAD,c),l.set(An.FRAGMENT_MAIN_UV,u),l.set(An.FRAGMENT_MAIN_IMAGE,h),l.set(An.VERTEX_HEAD,d),l.set(An.VERTEX_MAIN_SUPPORT,f),e.extensions!==null)for(const S of e.extensions)t.extensions.add(S)}}var F_e=class extends _s{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new N_e(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new Iye;let e=0;for(const o of this.effects)if(o.blendMode.blendFunction===sn.DST)n.attributes|=o.getAttributes()&Pl.DEPTH;else{if(n.attributes&o.getAttributes()&Pl.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${o.name})`);U_e("e"+e++,o,n)}let t=n.shaderParts.get(An.FRAGMENT_HEAD),i=n.shaderParts.get(An.FRAGMENT_MAIN_IMAGE),r=n.shaderParts.get(An.FRAGMENT_MAIN_UV);const s=/\bblend\b/g;for(const o of n.blendModes.values())t+=o.getShaderCode().replace(s,`blend${o.blendFunction}`)+` `;n.attributes&Pl.DEPTH?(n.readDepth&&(i=`float depth = readDepth(UV); - `+i),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===Bn&&(i+=`color0 = sRGBToLinear(color0); + `+i),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===Dn&&(i+=`color0 = sRGBToLinear(color0); `),n.uvTransformation?(r=`vec2 transformedUv = vUv; `+r,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(An.FRAGMENT_HEAD,t),n.shaderParts.set(An.FRAGMENT_MAIN_IMAGE,i),n.shaderParts.set(An.FRAGMENT_MAIN_UV,r);for(const[o,a]of n.shaderParts)a!==null&&n.shaderParts.set(o,a.trim().replace(/^#/,` -#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=hu){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,i,r){for(const s of this.effects)s.update(n,e,i);if(!this.skipRendering||this.renderToScreen){const s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=i*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const i of this.effects)i.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==Zi&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},B_e=class extends _s{constructor(n,e,{renderTarget:t,resolutionScale:i=1,width:r=wr.AUTO_SIZE,height:s=wr.AUTO_SIZE,resolutionX:o=r,resolutionY:a=s}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new L$(n,e,new eL);const l=this.renderPass;l.ignoreBackground=!0,l.skipShadowMapUpdate=!0;const c=l.getClearPass();c.overrideClearColor=new ct(7829503),c.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new wi(1,1,{minFilter:ri,magFilter:ri}),this.renderTarget.texture.name="NormalPass.Target");const u=this.resolution=new wr(this,o,a,i);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,r){const s=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,s,s)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}};const N_e=se.createContext(null),Ez=n=>(n.getAttributes()&Pl.CONVOLUTION)===Pl.CONVOLUTION,U_e=Qt.memo(se.forwardRef(({children:n,camera:e,scene:t,resolutionScale:i,enabled:r=!0,renderPriority:s=1,autoClear:o=!0,depthBuffer:a,enableNormalPass:l,stencilBuffer:c,multisampling:u=8,frameBufferType:h=yd},d)=>{const{gl:f,scene:v,camera:_,size:y}=Wr(),m=t||v,S=e||_,[x,M,R]=se.useMemo(()=>{const b=m0e(),w=new Tye(f,{depthBuffer:a,stencilBuffer:c,multisampling:u>0&&b?u:0,frameBufferType:h});w.addPass(new L$(m,S));let N=null,G=null;return l&&(G=new B_e(m,S),G.enabled=!1,w.addPass(G),i!==void 0&&b&&(N=new C_e({normalBuffer:G.texture,resolutionScale:i}),N.enabled=!1,w.addPass(N))),[w,G,N]},[S,f,a,c,u,h,m,l,i]);se.useEffect(()=>x==null?void 0:x.setSize(y.width,y.height),[x,y]),Ad((b,w)=>{if(r){const N=f.autoClear;f.autoClear=o,c&&!o&&f.clearStencil(),x.render(w),f.autoClear=N}},r?s:0);const T=se.useRef(null),P=Ece(T);se.useLayoutEffect(()=>{const b=[];if(T.current&&P.current&&x){const w=P.current.objects;for(let N=0;N{for(const w of b)x==null||x.removePass(w);M&&(M.enabled=!1),R&&(R.enabled=!1)}},[x,n,S,M,R,P]),se.useEffect(()=>{const b=f.toneMapping;return f.toneMapping=$o,()=>{f.toneMapping=b}},[]);const I=se.useMemo(()=>({composer:x,normalPass:M,downSamplingPass:R,resolutionScale:i,camera:S,scene:m}),[x,M,R,i,S,m]);return se.useImperativeHandle(d,()=>x,[x]),pe.jsx(N_e.Provider,{value:I,children:pe.jsx("group",{ref:T,children:n})})}));let F_e=0;const Tz=new WeakMap,O_e=(n,e)=>Qt.forwardRef(function({blendFunction:i=e==null?void 0:e.blendFunction,opacity:r=e==null?void 0:e.opacity,...s},o){let a=Tz.get(n);if(!a){const u=`@react-three/postprocessing/${n.name}-${F_e++}`;j9({[u]:n}),Tz.set(n,a=u)}const l=Wr(u=>u.camera),c=Qt.useMemo(()=>{var u,h;return[...(u=e==null?void 0:e.args)!=null?u:[],...(h=s.args)!=null?h:[{...e,...s}]]},[JSON.stringify(s)]);return pe.jsx(a,{camera:l,"blendMode-blendFunction":i,"blendMode-opacity-value":r,...s,ref:o,args:c})}),k_e=O_e(w_e,{blendFunction:sn.ADD}),aD=()=>{const{progress:n}=iue();return pe.jsxs(nue,{as:"div",center:!0,style:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[pe.jsx("span",{className:"canvas-loader"}),pe.jsxs("p",{style:{fontSize:14,color:"#F1F1F1",fontWeight:800,marginTop:40},children:[n.toFixed(2),"%"]})]})},z_e=()=>{const n=gy("./robot/scene.gltf");return pe.jsx("primitive",{object:n.scene,scale:2,"position-y":0,"rotation-y":0})},G_e=()=>pe.jsx(jA,{shadows:!0,frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},camera:{fov:45,near:.1,far:200,position:[-4,3,5]},children:pe.jsxs(U_e,{children:[pe.jsx("ambientLight",{intensity:10,position:[100,5,1]}),pe.jsx("directionalLight",{position:[100,5,1],intensity:1}),pe.jsx("directionalLight",{position:[-10,-10,-5],intensity:1}),pe.jsxs(se.Suspense,{fallback:pe.jsx(aD,{}),children:[pe.jsx(sD,{autoRotate:!0,enablePan:!0,enableZoom:!1,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/2}),pe.jsx(z_e,{}),pe.jsx(Rw,{all:!0})]}),pe.jsx(k_e,{blendFunction:sn.ALPHA})]})});var D$={exports:{}},Xs={},lD={};function B$(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bz(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function H_e(n){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}cD._isNativeReflectConstruct=W_e;cD._setPrototypeOf=CP;var _u={},$_e=k;function U$(){for(var n=arguments.length,e=new Array(n),t=0;tn.length)&&(e=n.length);for(var t=0,i=new Array(e);t0}var Q_e=new vy.Vector2,exe=new vy.Vector2;function $$(n){var e=n.map(function(c){return Array.isArray(c)?q1(vy.Vector2,G$(c)):c}),t=Er(e,3),i=t[0],r=t[1],s=t[2];if(yy(n))return!1;var o=Q_e.subVectors(r,i),a=exe.subVectors(s,i),l=a.cross(o);return l>0}var txe=Object.freeze({__proto__:null,isPointInTriangle:H$,triangleDeterminant:Pw,arePointsCollinear:yy,isTriangleClockwise:hD,getCircumcircle:V$,isPointInCircumcircle:W$,doThreePointsMakeARight:$$});ra._slicedToArray=Er;ra._toConsumableArray=G$;ra.arePointsCollinear=yy;ra.doThreePointsMakeARight=$$;ra.getCircumcircle=V$;ra.isPointInCircumcircle=W$;ra.isPointInTriangle=H$;ra.isTriangleClockwise=hD;ra.triangle=txe;ra.triangleDeterminant=Pw;var Ta=ra,hp=k,Rz=_u;function dD(n,e,t){return Math.max(e,Math.min(t,n))}function fD(n,e){return dD(n-Math.floor(n/e)*e,0,e)}function X$(n,e){var t=fD(e-n,Math.PI*2);return t>Math.PI&&(t-=Math.PI*2),t}function j$(n){return n/180*Math.PI}function Y$(n){return n*180/Math.PI}function J$(n,e){for(var t=e.radius,i=t===void 0?1:t,r=n.length/3,s=2/r,o=Math.PI*(3-2.2360679775),a=0;a2&&arguments[2]!==void 0?arguments[2]:Number.EPSILON;return Math.abs(n.x-e.x)2&&Ta.doThreePointsMakeARight(Ta._toConsumableArray(t.slice(-3)));)t.splice(t.length-2,1);for(var r=[e[e.length-1],e[e.length-2]],s=e.length-3;s>=0;s--)for(r.push(e[s]);r.length>2&&Ta.doThreePointsMakeARight(Ta._toConsumableArray(r.slice(-3)));)r.splice(r.length-2,1);r.splice(0,1),r.splice(r.length-1,1);var o=[].concat(t,r);return o}function Z$(n,e,t){var i=Ta._slicedToArray(e,2),r=i[0],s=i[1],o=Ta._slicedToArray(t,2),a=o[0],l=o[1];return a+(n-r)*(l-a)/(s-r)}function Q$(n){return n*n*n*(n*(n*6-15)+10)}function eX(n,e,t){return n*(1-t)+e*t}function mD(n,e,t){return(t-n)/(e-n)}function tX(n,e,t){var i=Math.sqrt(n*n+e*e+t*t);return[n/i,e/i,t/i]}function nX(n,e,t){var i=n*n,r=e*e,s=t*t,o=n*Math.sqrt(1-(r+s)/2+r*s/3),a=e*Math.sqrt(1-(s+i)/2+s*i/3),l=t*Math.sqrt(1-(i+r)/2+i*r/3);return[o,a,l]}function gD(n,e){var t=new hp.Vector3().crossVectors(n,e),i=n.dot(e),r=new hp.Matrix3().identity(),s=new hp.Matrix3().set(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0),o=new hp.Matrix3().multiplyMatrices(s,s).multiplyScalar(1/(1+i)),a=Rz.matrixSum3(Rz.matrixSum3(r,s),o);return a}function iX(n,e,t){var i=Math.asin(e),r=Math.atan2(n,-t);return[i,r]}function rX(n,e){var t=Math.sin(n),i=Math.cos(n),r=Math.sin(e)*i,s=-Math.cos(e)*i;return[r,t,s]}function sX(n,e){var t=Ta._slicedToArray(e,2),i=t[0],r=t[1],s=gD(n.normal,new hp.Vector3(0,1,0)),o=mD(i.clone().applyMatrix3(s).y,r.clone().applyMatrix3(s).y,0);return new hp.Vector3().lerpVectors(i,r,o)}function oX(n,e){var t=e.normal.dot(n);return t}function aX(n,e){var t=Ta._slicedToArray(n,3),i=t[0],r=t[1],s=t[2],o=Ta._slicedToArray(e,2),a=o[0],l=o[1];return s*a*l+r*a+i}function lX(n,e){var t=Ta._slicedToArray(e,2),i=t[0],r=t[1],s=i*r,o=n/s,a=n-s*o,l=a/i,c=a%i;return[c,l,o]}function cX(n,e){return n[0]+e[0]*n[1]}function uX(n,e){var t=n%e,i=Math.floor(n/e);return[t,i]}var nxe=Object.freeze({__proto__:null,clamp:dD,repeat:fD,deltaAngle:X$,degToRad:j$,radToDeg:Y$,fibonacciOnSphere:J$,vectorEquals:K$,lexicographic:pD,convexHull:q$,remap:Z$,fade:Q$,lerp:eX,inverseLerp:mD,normalize:tX,pointOnCubeToPointOnSphere:nX,rotateVectorOnVector:gD,pointToCoordinate:iX,coordinateToPoint:rX,planeSegmentIntersection:sX,pointToPlaneDistance:oX,getIndexFrom3D:aX,get3DFromIndex:lX,getIndexFrom2D:cX,get2DFromIndex:uX});Wn.clamp=dD;Wn.convexHull=q$;Wn.coordinateToPoint=rX;Wn.degToRad=j$;Wn.deltaAngle=X$;Wn.fade=Q$;Wn.fibonacciOnSphere=J$;Wn.get2DFromIndex=uX;Wn.get3DFromIndex=lX;Wn.getIndexFrom2D=cX;Wn.getIndexFrom3D=aX;Wn.inverseLerp=mD;Wn.lerp=eX;Wn.lexicographic=pD;Wn.misc=nxe;Wn.normalize=tX;Wn.planeSegmentIntersection=sX;Wn.pointOnCubeToPointOnSphere=nX;Wn.pointToCoordinate=iX;Wn.pointToPlaneDistance=oX;Wn.radToDeg=Y$;Wn.remap=Z$;Wn.repeat=fD;Wn.rotateVectorOnVector=gD;Wn.vectorEquals=K$;var pn=lD,vD=N$,Hr=Wn;function ixe(n,e){for(var t=0;t0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var i;t&1?i=Pz[t]^e&255:i=Pz[t]^e>>8&255,fn[t]=fn[t+256]=i,Mi[t]=Mi[t+256]=sxe[i%12]}};hX(0);var oxe=.5*(Math.sqrt(3)-1),bg=(3-Math.sqrt(3))/6,axe=1/3,va=1/6,lxe=function(e,t){var i,r,s,o=(e+t)*oxe,a=Math.floor(e+o),l=Math.floor(t+o),c=(a+l)*bg,u=e-a+c,h=t-l+c,d,f;u>h?(d=1,f=0):(d=0,f=1);var v=u-d+bg,_=h-f+bg,y=u-1+2*bg,m=h-1+2*bg;a&=255,l&=255;var S=Mi[a+fn[l]],x=Mi[a+d+fn[l+f]],M=Mi[a+1+fn[l+1]],R=.5-u*u-h*h;R<0?i=0:(R*=R,i=R*R*S.dot2(u,h));var T=.5-v*v-_*_;T<0?r=0:(T*=T,r=T*T*x.dot2(v,_));var P=.5-y*y-m*m;return P<0?s=0:(P*=P,s=P*P*M.dot2(y,m)),70*(i+r+s)},cxe=function(e,t,i){var r,s,o,a,l=(e+t+i)*axe,c=Math.floor(e+l),u=Math.floor(t+l),h=Math.floor(i+l),d=(c+u+h)*va,f=e-c+d,v=t-u+d,_=i-h+d,y,m,S,x,M,R;f>=v?v>=_?(y=1,m=0,S=0,x=1,M=1,R=0):f>=_?(y=1,m=0,S=0,x=1,M=0,R=1):(y=0,m=0,S=1,x=1,M=0,R=1):v<_?(y=0,m=0,S=1,x=0,M=1,R=1):f<_?(y=0,m=1,S=0,x=0,M=1,R=1):(y=0,m=1,S=0,x=1,M=1,R=0);var T=f-y+va,P=v-m+va,I=_-S+va,b=f-x+2*va,w=v-M+2*va,N=_-R+2*va,G=f-1+3*va,V=v-1+3*va,$=_-1+3*va;c&=255,u&=255,h&=255;var Z=Mi[c+fn[u+fn[h]]],X=Mi[c+y+fn[u+m+fn[h+S]]],re=Mi[c+x+fn[u+M+fn[h+R]]],O=Mi[c+1+fn[u+1+fn[h+1]]],Q=.6-f*f-v*v-_*_;Q<0?r=0:(Q*=Q,r=Q*Q*Z.dot3(f,v,_));var te=.6-T*T-P*P-I*I;te<0?s=0:(te*=te,s=te*te*X.dot3(T,P,I));var le=.6-b*b-w*w-N*N;le<0?o=0:(le*=le,o=le*le*re.dot3(b,w,N));var we=.6-G*G-V*V-$*$;return we<0?a=0:(we*=we,a=we*we*O.dot3(G,V,$)),32*(r+s+o+a)},uxe=function(e,t){var i=Math.floor(e),r=Math.floor(t);e=e-i,t=t-r,i=i&255,r=r&255;var s=Mi[i+fn[r]].dot2(e,t),o=Mi[i+fn[r+1]].dot2(e,t-1),a=Mi[i+1+fn[r]].dot2(e-1,t),l=Mi[i+1+fn[r+1]].dot2(e-1,t-1),c=Hr.fade(e);return Hr.lerp(Hr.lerp(s,a,c),Hr.lerp(o,l,c),Hr.fade(t))},hxe=function(e,t,i){var r=Math.floor(e),s=Math.floor(t),o=Math.floor(i);e=e-r,t=t-s,i=i-o,r=r&255,s=s&255,o=o&255;var a=Mi[r+fn[s+fn[o]]].dot3(e,t,i),l=Mi[r+fn[s+fn[o+1]]].dot3(e,t,i-1),c=Mi[r+fn[s+1+fn[o]]].dot3(e,t-1,i),u=Mi[r+fn[s+1+fn[o+1]]].dot3(e,t-1,i-1),h=Mi[r+1+fn[s+fn[o]]].dot3(e-1,t,i),d=Mi[r+1+fn[s+fn[o+1]]].dot3(e-1,t,i-1),f=Mi[r+1+fn[s+1+fn[o]]].dot3(e-1,t-1,i),v=Mi[r+1+fn[s+1+fn[o+1]]].dot3(e-1,t-1,i-1),_=Hr.fade(e),y=Hr.fade(t),m=Hr.fade(i);return Hr.lerp(Hr.lerp(Hr.lerp(a,h,_),Hr.lerp(l,d,_),m),Hr.lerp(Hr.lerp(c,f,_),Hr.lerp(u,v,_),m),y)},dX=Object.freeze({__proto__:null,seed:hX,simplex2:lxe,simplex3:cxe,perlin2:uxe,perlin3:hxe}),yD=Math.PI*2,fX=function(){function n(e){vD._classCallCheck(this,n),pn._defineProperty(this,"nextBurstTime",0),pn._defineProperty(this,"nextFlashEndTime",0),pn._defineProperty(this,"flashesDone",0),pn._defineProperty(this,"isFlashing",!1),pn._defineProperty(this,"currentCount",0),pn._defineProperty(this,"flashIntensity",0),pn._defineProperty(this,"isDecaying",!1),pn._defineProperty(this,"autoBurst",!0),pn._defineProperty(this,"decaySpeed",40),pn._defineProperty(this,"minInterval",5e3),pn._defineProperty(this,"maxInterval",1e4),pn._defineProperty(this,"minDuration",50),pn._defineProperty(this,"maxDuration",300),pn._defineProperty(this,"count",5),Object.assign(this,e)}return rxe(n,[{key:"scheduleNextBurst",value:function(t){var i=Math.random()*(this.maxInterval-this.minInterval)+this.minInterval;this.nextBurstTime=t+i/1e3,this.flashesDone=0,this.isFlashing=!1}},{key:"burst",value:function(){this.nextBurstTime=0,this.flashesDone=0,this.isFlashing=!1}},{key:"update",value:function(t,i){if(t>this.nextBurstTime&&this.currentCount===0&&(this.currentCount=Math.floor(Math.random()*this.count)+1),this.flashesDonethis.nextBurstTime)if(this.isFlashing)this.isFlashing&&t>this.nextFlashEndTime&&(this.isFlashing=!1,this.isDecaying=!0,this.flashesDone++,this.flashesDone>=this.currentCount&&(this.currentCount=0,this.autoBurst&&this.scheduleNextBurst(t)));else{this.isFlashing=!0,this.flashIntensity=1;var r=Math.random()*(this.maxDuration-this.minDuration)+this.minDuration;this.nextFlashEndTime=t+r/1e3}return this.isDecaying&&(this.flashIntensity-=i*this.decaySpeed,this.flashIntensity=Math.max(0,Math.min(1,this.flashIntensity)),this.flashIntensity<=0&&(this.isDecaying=!1,this.flashIntensity=0)),this.flashIntensity}}]),n}();function dxe(n){if(typeof n=="number")n=Math.abs(n);else if(typeof n=="string"){var e=n;n=0;for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},pX),e),r=i.radius,s=i.center,o=0;o2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},pX),e),r=i.radius,s=i.center,o=0;o2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},vX),e),r=i.radius,s=i.center,o=0;o2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},vX),e),r=i.radius,s=i.center,o=0;o2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},fxe),e),r=i.sides,s=i.center,o=typeof r=="number"?r:r[0],a=typeof r=="number"?r:r[1],l=0;l2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},AX),e),r=i.sides,s=i.center,o=typeof r=="number"?r:r[0],a=typeof r=="number"?r:r[1],l=typeof r=="number"?r:r[2],c=0;c2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},AX),e),r=i.sides,s=i.center,o=typeof r=="number"?r:r[0],a=typeof r=="number"?r:r[1],l=typeof r=="number"?r:r[2],c=0;c{const n=se.useRef(),[e]=se.useState(()=>mxe.inSphere(new Float32Array(5e3),{radius:1.2}));return Ad((t,i)=>{n.current&&(n.current.rotation.x-=i/10,n.current.rotation.y-=i/15)}),pe.jsx("group",{rotation:[0,0,Math.PI/4],children:pe.jsx(yye,{ref:n,positions:Float32Array.from(e),stride:3,frustumCulled:!0,children:pe.jsx(fye,{transparent:!0,color:"#f272c8",size:.002,sizeAttenuation:!0,depthWrite:!1})})})},vxe=()=>pe.jsx("div",{className:"w-full h-auto absolute inset-0 z-[-1]",children:pe.jsxs(jA,{camera:{position:[0,0,1]},children:[pe.jsx(se.Suspense,{fallback:null,children:pe.jsx(gxe,{})}),pe.jsx(Rw,{all:!0})]})}),A0=n=>typeof n=="number"&&!isNaN(n),Jh=n=>typeof n=="string",Ds=n=>typeof n=="function",Z1=n=>Jh(n)||Ds(n)?n:null,PP=n=>se.isValidElement(n)||Jh(n)||Ds(n)||A0(n);function yxe(n,e,t){t===void 0&&(t=300);const{scrollHeight:i,style:r}=n;requestAnimationFrame(()=>{r.minHeight="initial",r.height=i+"px",r.transition=`all ${t}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(e,t)})})}function Iw(n){let{enter:e,exit:t,appendPosition:i=!1,collapse:r=!0,collapseDuration:s=300}=n;return function(o){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:h,isIn:d,playToast:f}=o;const v=i?`${e}--${l}`:e,_=i?`${t}--${l}`:t,y=se.useRef(0);return se.useLayoutEffect(()=>{const m=h.current,S=v.split(" "),x=M=>{M.target===h.current&&(f(),m.removeEventListener("animationend",x),m.removeEventListener("animationcancel",x),y.current===0&&M.type!=="animationcancel"&&m.classList.remove(...S))};m.classList.add(...S),m.addEventListener("animationend",x),m.addEventListener("animationcancel",x)},[]),se.useEffect(()=>{const m=h.current,S=()=>{m.removeEventListener("animationend",S),r?yxe(m,u,s):u()};d||(c?S():(y.current=1,m.className+=` ${_}`,m.addEventListener("animationend",S)))},[d]),Qt.createElement(Qt.Fragment,null,a)}}function Lz(n,e){return n!=null?{content:n.content,containerId:n.props.containerId,id:n.props.toastId,theme:n.props.theme,type:n.props.type,data:n.props.data||{},isLoading:n.props.isLoading,icon:n.props.icon,status:e}:{}}const jr=new Map;let w0=[];const IP=new Set,_xe=n=>IP.forEach(e=>e(n)),EX=()=>jr.size>0;function TX(n,e){var t;if(e)return!((t=jr.get(e))==null||!t.isToastActive(n));let i=!1;return jr.forEach(r=>{r.isToastActive(n)&&(i=!0)}),i}function bX(n,e){PP(n)&&(EX()||w0.push({content:n,options:e}),jr.forEach(t=>{t.buildToast(n,e)}))}function Dz(n,e){jr.forEach(t=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===t.id&&t.toggle(n,e==null?void 0:e.id):t.toggle(n,e==null?void 0:e.id)})}function xxe(n){const{subscribe:e,getSnapshot:t,setProps:i}=se.useRef(function(s){const o=s.containerId||1;return{subscribe(a){const l=function(u,h,d){let f=1,v=0,_=[],y=[],m=[],S=h;const x=new Map,M=new Set,R=()=>{m=Array.from(x.values()),M.forEach(I=>I())},T=I=>{y=I==null?[]:y.filter(b=>b!==I),R()},P=I=>{const{toastId:b,onOpen:w,updateId:N,children:G}=I.props,V=N==null;I.staleId&&x.delete(I.staleId),x.set(b,I),y=[...y,I.props.toastId].filter($=>$!==I.staleId),R(),d(Lz(I,V?"added":"updated")),V&&Ds(w)&&w(se.isValidElement(G)&&G.props)};return{id:u,props:S,observe:I=>(M.add(I),()=>M.delete(I)),toggle:(I,b)=>{x.forEach(w=>{b!=null&&b!==w.props.toastId||Ds(w.toggle)&&w.toggle(I)})},removeToast:T,toasts:x,clearQueue:()=>{v-=_.length,_=[]},buildToast:(I,b)=>{if((we=>{let{containerId:Ne,toastId:q,updateId:fe}=we;const Te=Ne?Ne!==u:u!==1,Se=x.has(q)&&fe==null;return Te||Se})(b))return;const{toastId:w,updateId:N,data:G,staleId:V,delay:$}=b,Z=()=>{T(w)},X=N==null;X&&v++;const re={...S,style:S.toastStyle,key:f++,...Object.fromEntries(Object.entries(b).filter(we=>{let[Ne,q]=we;return q!=null})),toastId:w,updateId:N,data:G,closeToast:Z,isIn:!1,className:Z1(b.className||S.toastClassName),bodyClassName:Z1(b.bodyClassName||S.bodyClassName),progressClassName:Z1(b.progressClassName||S.progressClassName),autoClose:!b.isLoading&&(O=b.autoClose,Q=S.autoClose,O===!1||A0(O)&&O>0?O:Q),deleteToast(){const we=x.get(w),{onClose:Ne,children:q}=we.props;Ds(Ne)&&Ne(se.isValidElement(q)&&q.props),d(Lz(we,"removed")),x.delete(w),v--,v<0&&(v=0),_.length>0?P(_.shift()):R()}};var O,Q;re.closeButton=S.closeButton,b.closeButton===!1||PP(b.closeButton)?re.closeButton=b.closeButton:b.closeButton===!0&&(re.closeButton=!PP(S.closeButton)||S.closeButton);let te=I;se.isValidElement(I)&&!Jh(I.type)?te=se.cloneElement(I,{closeToast:Z,toastProps:re,data:G}):Ds(I)&&(te=I({closeToast:Z,toastProps:re,data:G}));const le={content:te,props:re,staleId:V};S.limit&&S.limit>0&&v>S.limit&&X?_.push(le):A0($)?setTimeout(()=>{P(le)},$):P(le)},setProps(I){S=I},setToggle:(I,b)=>{x.get(I).toggle=b},isToastActive:I=>y.some(b=>b===I),getSnapshot:()=>S.newestOnTop?m.reverse():m}}(o,s,_xe);jr.set(o,l);const c=l.observe(a);return w0.forEach(u=>bX(u.content,u.options)),w0=[],()=>{c(),jr.delete(o)}},setProps(a){var l;(l=jr.get(o))==null||l.setProps(a)},getSnapshot(){var a;return(a=jr.get(o))==null?void 0:a.getSnapshot()}}}(n)).current;i(n);const r=se.useSyncExternalStore(e,t,t);return{getToastToRender:function(s){if(!r)return[];const o=new Map;return r.forEach(a=>{const{position:l}=a.props;o.has(l)||o.set(l,[]),o.get(l).push(a)}),Array.from(o,a=>s(a[0],a[1]))},isToastActive:TX,count:r==null?void 0:r.length}}function Sxe(n){const[e,t]=se.useState(!1),[i,r]=se.useState(!1),s=se.useRef(null),o=se.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:h}=n;var d,f;function v(){t(!0)}function _(){t(!1)}function y(x){const M=s.current;o.canDrag&&M&&(o.didMove=!0,e&&_(),o.delta=n.draggableDirection==="x"?x.clientX-o.start:x.clientY-o.start,o.start!==x.clientX&&(o.canCloseOnClick=!1),M.style.transform=`translate3d(${n.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,M.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function m(){document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",m);const x=s.current;if(o.canDrag&&o.didMove&&x){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return r(!0),n.closeToast(),void n.collapseAll();x.style.transition="transform 0.2s, opacity 0.2s",x.style.removeProperty("transform"),x.style.removeProperty("opacity")}}(f=jr.get((d={id:n.toastId,containerId:n.containerId,fn:t}).containerId||1))==null||f.setToggle(d.id,d.fn),se.useEffect(()=>{if(n.pauseOnFocusLoss)return document.hasFocus()||_(),window.addEventListener("focus",v),window.addEventListener("blur",_),()=>{window.removeEventListener("focus",v),window.removeEventListener("blur",_)}},[n.pauseOnFocusLoss]);const S={onPointerDown:function(x){if(n.draggable===!0||n.draggable===x.pointerType){o.didMove=!1,document.addEventListener("pointermove",y),document.addEventListener("pointerup",m);const M=s.current;o.canCloseOnClick=!0,o.canDrag=!0,M.style.transition="none",n.draggableDirection==="x"?(o.start=x.clientX,o.removalDistance=M.offsetWidth*(n.draggablePercent/100)):(o.start=x.clientY,o.removalDistance=M.offsetHeight*(n.draggablePercent===80?1.5*n.draggablePercent:n.draggablePercent)/100)}},onPointerUp:function(x){const{top:M,bottom:R,left:T,right:P}=s.current.getBoundingClientRect();x.nativeEvent.type!=="touchend"&&n.pauseOnHover&&x.clientX>=T&&x.clientX<=P&&x.clientY>=M&&x.clientY<=R?_():v()}};return a&&l&&(S.onMouseEnter=_,n.stacked||(S.onMouseLeave=v)),h&&(S.onClick=x=>{u&&u(x),o.canCloseOnClick&&c()}),{playToast:v,pauseToast:_,isRunning:e,preventExitTransition:i,toastRef:s,eventHandlers:S}}function Mxe(n){let{delay:e,isRunning:t,closeToast:i,type:r="default",hide:s,className:o,style:a,controlledProgress:l,progress:c,rtl:u,isIn:h,theme:d}=n;const f=s||l&&c===0,v={...a,animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};l&&(v.transform=`scaleX(${c})`);const _=Go("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":u}),y=Ds(o)?o({rtl:u,type:r,defaultClassName:_}):Go(_,o),m={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{h&&i()}};return Qt.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},Qt.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${r}`}),Qt.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:y,style:v,...m}))}let Axe=1;const CX=()=>""+Axe++;function wxe(n){return n&&(Jh(n.toastId)||A0(n.toastId))?n.toastId:CX()}function yv(n,e){return bX(n,e),e.toastId}function $M(n,e){return{...e,type:e&&e.type||n,toastId:wxe(e)}}function w1(n){return(e,t)=>yv(e,$M(n,t))}function Fn(n,e){return yv(n,$M("default",e))}Fn.loading=(n,e)=>yv(n,$M("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Fn.promise=function(n,e,t){let i,{pending:r,error:s,success:o}=e;r&&(i=Jh(r)?Fn.loading(r,t):Fn.loading(r.render,{...t,...r}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,h,d)=>{if(h==null)return void Fn.dismiss(i);const f={type:u,...a,...t,data:d},v=Jh(h)?{render:h}:h;return i?Fn.update(i,{...f,...v}):Fn(v.render,{...f,...v}),d},c=Ds(n)?n():n;return c.then(u=>l("success",o,u)).catch(u=>l("error",s,u)),c},Fn.success=w1("success"),Fn.info=w1("info"),Fn.error=w1("error"),Fn.warning=w1("warning"),Fn.warn=Fn.warning,Fn.dark=(n,e)=>yv(n,$M("default",{theme:"dark",...e})),Fn.dismiss=function(n){(function(e){var t;if(EX()){if(e==null||Jh(t=e)||A0(t))jr.forEach(i=>{i.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const i=jr.get(e.containerId);i?i.removeToast(e.id):jr.forEach(r=>{r.removeToast(e.id)})}}else w0=w0.filter(i=>e!=null&&i.options.toastId!==e)})(n)},Fn.clearWaitingQueue=function(n){n===void 0&&(n={}),jr.forEach(e=>{!e.props.limit||n.containerId&&e.id!==n.containerId||e.clearQueue()})},Fn.isActive=TX,Fn.update=function(n,e){e===void 0&&(e={});const t=((i,r)=>{var s;let{containerId:o}=r;return(s=jr.get(o||1))==null?void 0:s.toasts.get(i)})(n,e);if(t){const{props:i,content:r}=t,s={delay:100,...i,...e,toastId:e.toastId||n,updateId:CX()};s.toastId!==n&&(s.staleId=n);const o=s.render||r;delete s.render,yv(o,s)}},Fn.done=n=>{Fn.update(n,{progress:1})},Fn.onChange=function(n){return IP.add(n),()=>{IP.delete(n)}},Fn.play=n=>Dz(!0,n),Fn.pause=n=>Dz(!1,n);const Exe=typeof window<"u"?se.useLayoutEffect:se.useEffect,E1=n=>{let{theme:e,type:t,isLoading:i,...r}=n;return Qt.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r})},MC={info:function(n){return Qt.createElement(E1,{...n},Qt.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(n){return Qt.createElement(E1,{...n},Qt.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(n){return Qt.createElement(E1,{...n},Qt.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(n){return Qt.createElement(E1,{...n},Qt.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Qt.createElement("div",{className:"Toastify__spinner"})}},Txe=n=>{const{isRunning:e,preventExitTransition:t,toastRef:i,eventHandlers:r,playToast:s}=Sxe(n),{closeButton:o,children:a,autoClose:l,onClick:c,type:u,hideProgressBar:h,closeToast:d,transition:f,position:v,className:_,style:y,bodyClassName:m,bodyStyle:S,progressClassName:x,progressStyle:M,updateId:R,role:T,progress:P,rtl:I,toastId:b,deleteToast:w,isIn:N,isLoading:G,closeOnClick:V,theme:$}=n,Z=Go("Toastify__toast",`Toastify__toast-theme--${$}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":I},{"Toastify__toast--close-on-click":V}),X=Ds(_)?_({rtl:I,position:v,type:u,defaultClassName:Z}):Go(Z,_),re=function(le){let{theme:we,type:Ne,isLoading:q,icon:fe}=le,Te=null;const Se={theme:we,type:Ne};return fe===!1||(Ds(fe)?Te=fe({...Se,isLoading:q}):se.isValidElement(fe)?Te=se.cloneElement(fe,Se):q?Te=MC.spinner():($e=>$e in MC)(Ne)&&(Te=MC[Ne](Se))),Te}(n),O=!!P||!l,Q={closeToast:d,type:u,theme:$};let te=null;return o===!1||(te=Ds(o)?o(Q):se.isValidElement(o)?se.cloneElement(o,Q):function(le){let{closeToast:we,theme:Ne,ariaLabel:q="close"}=le;return Qt.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Ne}`,type:"button",onClick:fe=>{fe.stopPropagation(),we(fe)},"aria-label":q},Qt.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Qt.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(Q)),Qt.createElement(f,{isIn:N,done:w,position:v,preventExitTransition:t,nodeRef:i,playToast:s},Qt.createElement("div",{id:b,onClick:c,"data-in":N,className:X,...r,style:y,ref:i},Qt.createElement("div",{...N&&{role:T},className:Ds(m)?m({type:u}):Go("Toastify__toast-body",m),style:S},re!=null&&Qt.createElement("div",{className:Go("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!G})},re),Qt.createElement("div",null,a)),te,Qt.createElement(Mxe,{...R&&!O?{key:`pb-${R}`}:{},rtl:I,theme:$,delay:l,isRunning:e,isIn:N,closeToast:d,hide:h,type:u,style:M,className:x,controlledProgress:O,progress:P||0})))},Lw=function(n,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${n}-enter`,exit:`Toastify--animate Toastify__${n}-exit`,appendPosition:e}},bxe=Iw(Lw("bounce",!0));Iw(Lw("slide",!0));Iw(Lw("zoom"));Iw(Lw("flip"));const Cxe={position:"top-right",transition:bxe,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Rxe(n){let e={...Cxe,...n};const t=n.stacked,[i,r]=se.useState(!0),s=se.useRef(null),{getToastToRender:o,isToastActive:a,count:l}=xxe(e),{className:c,style:u,rtl:h,containerId:d}=e;function f(_){const y=Go("Toastify__toast-container",`Toastify__toast-container--${_}`,{"Toastify__toast-container--rtl":h});return Ds(c)?c({position:_,rtl:h,defaultClassName:y}):Go(y,Z1(c))}function v(){t&&(r(!0),Fn.play())}return Exe(()=>{if(t){var _;const y=s.current.querySelectorAll('[data-in="true"]'),m=12,S=(_=e.position)==null?void 0:_.includes("top");let x=0,M=0;Array.from(y).reverse().forEach((R,T)=>{const P=R;P.classList.add("Toastify__toast--stacked"),T>0&&(P.dataset.collapsed=`${i}`),P.dataset.pos||(P.dataset.pos=S?"top":"bot");const I=x*(i?.2:1)+(i?0:m*T);P.style.setProperty("--y",`${S?I:-1*I}px`),P.style.setProperty("--g",`${m}`),P.style.setProperty("--s",""+(1-(i?M:0))),x+=P.offsetHeight,M+=.025})}},[i,l,t]),Qt.createElement("div",{ref:s,className:"Toastify",id:d,onMouseEnter:()=>{t&&(r(!1),Fn.pause())},onMouseLeave:v},o((_,y)=>{const m=y.length?{...u}:{...u,pointerEvents:"none"};return Qt.createElement("div",{className:f(_),style:m,key:`container-${_}`},y.map(S=>{let{content:x,props:M}=S;return Qt.createElement(Txe,{...M,stacked:t,collapseAll:v,isIn:a(M.toastId,M.containerId),style:M.style,key:`toast-${M.key}`},x)}))}))}class Dw{constructor(e=0,t="Network Error"){this.status=e,this.text=t}}const Pxe=()=>{if(!(typeof localStorage>"u"))return{get:n=>Promise.resolve(localStorage.getItem(n)),set:(n,e)=>Promise.resolve(localStorage.setItem(n,e)),remove:n=>Promise.resolve(localStorage.removeItem(n))}},Nf={origin:"https://api.emailjs.com",blockHeadless:!1,storageProvider:Pxe()},Ixe=n=>n?typeof n=="string"?{publicKey:n}:n.toString()==="[object Object]"?n:{}:{},Lxe=async(n,e,t={})=>{const i=await fetch(Nf.origin+n,{method:"POST",headers:t,body:e}),r=await i.text(),s=new Dw(i.status,r);if(i.ok)return s;throw s},Dxe=(n,e,t)=>{if(!n||typeof n!="string")throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e||typeof e!="string")throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t||typeof t!="string")throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates"},Bxe=n=>{if(n&&n.toString()!=="[object Object]")throw"The template params have to be the object. Visit https://www.emailjs.com/docs/sdk/send/"},Nxe=n=>n.webdriver||!n.languages||n.languages.length===0,Uxe=()=>new Dw(451,"Unavailable For Headless Browser"),Fxe=(n,e)=>{if(!Array.isArray(n))throw"The BlockList list has to be an array";if(typeof e!="string")throw"The BlockList watchVariable has to be a string"},Oxe=n=>{var e;return!((e=n.list)!=null&&e.length)||!n.watchVariable},kxe=(n,e)=>n instanceof FormData?n.get(e):n[e],zxe=(n,e)=>{if(Oxe(n))return!1;Fxe(n.list,n.watchVariable);const t=kxe(e,n.watchVariable);return typeof t!="string"?!1:n.list.includes(t)},Gxe=()=>new Dw(403,"Forbidden"),Hxe=(n,e)=>{if(typeof n!="number"||n<0)throw"The LimitRate throttle has to be a positive number";if(e&&typeof e!="string")throw"The LimitRate ID has to be a non-empty string"},Vxe=async(n,e,t)=>{const i=Number(await t.get(n)||0);return e-Date.now()+i},Wxe=async(n,e,t)=>{if(!e.throttle||!t)return!1;Hxe(e.throttle,e.id);const i=e.id||n;return await Vxe(i,e.throttle,t)>0?!0:(await t.set(i,Date.now().toString()),!1)},$xe=()=>new Dw(429,"Too Many Requests"),Xxe=async(n,e,t,i)=>{const r=Ixe(i),s=r.publicKey||Nf.publicKey,o=r.blockHeadless||Nf.blockHeadless,a=r.storageProvider||Nf.storageProvider,l={...Nf.blockList,...r.blockList},c={...Nf.limitRate,...r.limitRate};return o&&Nxe(navigator)?Promise.reject(Uxe()):(Dxe(s,n,e),Bxe(t),t&&zxe(l,t)?Promise.reject(Gxe()):await Wxe(location.pathname,c,a)?Promise.reject($xe()):Lxe("/api/v1.0/email/send",JSON.stringify({lib_version:"4.4.1",user_id:s,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"}))};var dn;(function(n){n.assertEqual=r=>r;function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},n.getValidEnumValues=r=>{const s=n.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),o={};for(const a of s)o[a]=r[a];return n.objectValues(o)},n.objectValues=r=>n.objectKeys(r).map(function(s){return r[s]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},n.find=(r,s)=>{for(const o of r)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=i,n.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(dn||(dn={}));var LP;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(LP||(LP={}));const yt=dn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ic=n=>{switch(typeof n){case"undefined":return yt.undefined;case"string":return yt.string;case"number":return isNaN(n)?yt.nan:yt.number;case"boolean":return yt.boolean;case"function":return yt.function;case"bigint":return yt.bigint;case"symbol":return yt.symbol;case"object":return Array.isArray(n)?yt.array:n===null?yt.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?yt.promise:typeof Map<"u"&&n instanceof Map?yt.map:typeof Set<"u"&&n instanceof Set?yt.set:typeof Date<"u"&&n instanceof Date?yt.date:yt.object;default:return yt.unknown}},rt=dn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),jxe=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Fs extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},i={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)i._errors.push(t(o));else{let a=i,l=0;for(;lt.message){const t={},i=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}Fs.create=n=>new Fs(n);const Jp=(n,e)=>{let t;switch(n.code){case rt.invalid_type:n.received===yt.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case rt.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,dn.jsonStringifyReplacer)}`;break;case rt.unrecognized_keys:t=`Unrecognized key(s) in object: ${dn.joinValues(n.keys,", ")}`;break;case rt.invalid_union:t="Invalid input";break;case rt.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${dn.joinValues(n.options)}`;break;case rt.invalid_enum_value:t=`Invalid enum value. Expected ${dn.joinValues(n.options)}, received '${n.received}'`;break;case rt.invalid_arguments:t="Invalid function arguments";break;case rt.invalid_return_type:t="Invalid function return type";break;case rt.invalid_date:t="Invalid date";break;case rt.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:dn.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case rt.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case rt.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case rt.custom:t="Invalid input";break;case rt.invalid_intersection_types:t="Intersection results could not be merged";break;case rt.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case rt.not_finite:t="Number must be finite";break;default:t=e.defaultError,dn.assertNever(n)}return{message:t}};let RX=Jp;function Yxe(n){RX=n}function XM(){return RX}const jM=n=>{const{data:e,path:t,errorMaps:i,issueData:r}=n,s=[...t,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const l=i.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:e,defaultError:a}).message;return{...r,path:s,message:a}},Jxe=[];function gt(n,e){const t=XM(),i=jM({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Jp?void 0:Jp].filter(r=>!!r)});n.common.issues.push(i)}class Ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const r of t){if(r.status==="aborted")return Ut;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const r of t){const s=await r.key,o=await r.value;i.push({key:s,value:o})}return Ir.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const r of t){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Ut;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}}const Ut=Object.freeze({status:"aborted"}),dp=n=>({status:"dirty",value:n}),Qr=n=>({status:"valid",value:n}),DP=n=>n.status==="aborted",BP=n=>n.status==="dirty",E0=n=>n.status==="valid",T0=n=>typeof Promise<"u"&&n instanceof Promise;function YM(n,e,t,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function PX(n,e,t,i,r){if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}var bt;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(bt||(bt={}));var kg,zg;class Oa{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Bz=(n,e)=>{if(E0(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Fs(n.common.issues);return this._error=t,this._error}}};function Yt(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:r}=n;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,a)=>{var l,c;const{message:u}=n;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??i)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??t)!==null&&c!==void 0?c:a.defaultError}},description:r}}class en{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Ic(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ic(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ir,ctx:{common:e.parent.common,data:e.data,parsedType:Ic(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(T0(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const r={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ic(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Bz(r,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ic(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(T0(r)?r:Promise.resolve(r));return Bz(i,s)}refine(e,t){const i=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{const o=e(r),a=()=>s.addIssue({code:rt.custom,...i(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof t=="function"?t(i,r):t),!1))}_refinement(e){return new qo({schema:this,typeName:Nt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ba.create(this,this._def)}nullable(){return iu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xo.create(this,this._def)}promise(){return qp.create(this,this._def)}or(e){return P0.create([this,e],this._def)}and(e){return I0.create(this,e,this._def)}transform(e){return new qo({...Yt(this._def),schema:this,typeName:Nt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new U0({...Yt(this._def),innerType:this,defaultValue:t,typeName:Nt.ZodDefault})}brand(){return new xD({typeName:Nt.ZodBranded,type:this,...Yt(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new F0({...Yt(this._def),innerType:this,catchValue:t,typeName:Nt.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return _y.create(this,e)}readonly(){return O0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Kxe=/^c[^\s-]{8,}$/i,qxe=/^[0-9a-z]+$/,Zxe=/^[0-9A-HJKMNP-TV-Z]{26}$/,Qxe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,e1e=/^[a-z0-9_-]{21}$/i,t1e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,n1e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,i1e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let AC;const r1e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,s1e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,o1e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,IX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",a1e=new RegExp(`^${IX}$`);function LX(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function l1e(n){return new RegExp(`^${LX(n)}$`)}function DX(n){let e=`${IX}T${LX(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function c1e(n,e){return!!((e==="v4"||!e)&&r1e.test(n)||(e==="v6"||!e)&&s1e.test(n))}class Ho extends en{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==yt.string){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_type,expected:yt.string,received:s.parsedType}),Ut}const i=new Ir;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(r=this._getOrReturnCtx(e,r),gt(r,{code:rt.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.lengthe.test(r),{validation:t,code:rt.invalid_string,...bt.errToObj(i)})}_addCheck(e){return new Ho({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...bt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...bt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...bt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...bt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...bt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...bt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...bt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...bt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...bt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...bt.errToObj(e)})}datetime(e){var t,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...bt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...bt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...bt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...bt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...bt.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...bt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...bt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...bt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...bt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...bt.errToObj(t)})}nonempty(e){return this.min(1,bt.errToObj(e))}trim(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new Ho({checks:[],typeName:Nt.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Yt(n)})};function u1e(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=t>i?t:i,s=parseInt(n.toFixed(r).replace(".","")),o=parseInt(e.toFixed(r).replace(".",""));return s%o/Math.pow(10,r)}class eu extends en{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==yt.number){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_type,expected:yt.number,received:s.parsedType}),Ut}let i;const r=new Ir;for(const s of this._def.checks)s.kind==="int"?dn.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?u1e(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.not_finite,message:s.message}),r.dirty()):dn.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,bt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,bt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,bt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,bt.toString(t))}setLimit(e,t,i,r){return new eu({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:bt.toString(r)}]})}_addCheck(e){return new eu({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:bt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:bt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:bt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:bt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:bt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:bt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:bt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:bt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:bt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&dn.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.valuenew eu({checks:[],typeName:Nt.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Yt(n)});class tu extends en{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==yt.bigint){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_type,expected:yt.bigint,received:s.parsedType}),Ut}let i;const r=new Ir;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):dn.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,bt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,bt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,bt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,bt.toString(t))}setLimit(e,t,i,r){return new tu({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:bt.toString(r)}]})}_addCheck(e){return new tu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:bt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:bt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:bt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:bt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:bt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new tu({checks:[],typeName:Nt.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Yt(n)})};class b0 extends en{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==yt.boolean){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.boolean,received:i.parsedType}),Ut}return Qr(e.data)}}b0.create=n=>new b0({typeName:Nt.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Yt(n)});class dd extends en{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==yt.date){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_type,expected:yt.date,received:s.parsedType}),Ut}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_date}),Ut}const i=new Ir;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(r=this._getOrReturnCtx(e,r),gt(r,{code:rt.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):dn.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new dd({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:bt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:bt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew dd({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:Nt.ZodDate,...Yt(n)});class JM extends en{_parse(e){if(this._getType(e)!==yt.symbol){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.symbol,received:i.parsedType}),Ut}return Qr(e.data)}}JM.create=n=>new JM({typeName:Nt.ZodSymbol,...Yt(n)});class C0 extends en{_parse(e){if(this._getType(e)!==yt.undefined){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.undefined,received:i.parsedType}),Ut}return Qr(e.data)}}C0.create=n=>new C0({typeName:Nt.ZodUndefined,...Yt(n)});class R0 extends en{_parse(e){if(this._getType(e)!==yt.null){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.null,received:i.parsedType}),Ut}return Qr(e.data)}}R0.create=n=>new R0({typeName:Nt.ZodNull,...Yt(n)});class Kp extends en{constructor(){super(...arguments),this._any=!0}_parse(e){return Qr(e.data)}}Kp.create=n=>new Kp({typeName:Nt.ZodAny,...Yt(n)});class Kh extends en{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Qr(e.data)}}Kh.create=n=>new Kh({typeName:Nt.ZodUnknown,...Yt(n)});class Hl extends en{_parse(e){const t=this._getOrReturnCtx(e);return gt(t,{code:rt.invalid_type,expected:yt.never,received:t.parsedType}),Ut}}Hl.create=n=>new Hl({typeName:Nt.ZodNever,...Yt(n)});class KM extends en{_parse(e){if(this._getType(e)!==yt.undefined){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.void,received:i.parsedType}),Ut}return Qr(e.data)}}KM.create=n=>new KM({typeName:Nt.ZodVoid,...Yt(n)});class Xo extends en{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),r=this._def;if(t.parsedType!==yt.array)return gt(t,{code:rt.invalid_type,expected:yt.array,received:t.parsedType}),Ut;if(r.exactLength!==null){const o=t.data.length>r.exactLength.value,a=t.data.lengthr.maxLength.value&&(gt(t,{code:rt.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>r.type._parseAsync(new Oa(t,o,t.path,a)))).then(o=>Ir.mergeArray(i,o));const s=[...t.data].map((o,a)=>r.type._parseSync(new Oa(t,o,t.path,a)));return Ir.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new Xo({...this._def,minLength:{value:e,message:bt.toString(t)}})}max(e,t){return new Xo({...this._def,maxLength:{value:e,message:bt.toString(t)}})}length(e,t){return new Xo({...this._def,exactLength:{value:e,message:bt.toString(t)}})}nonempty(e){return this.min(1,e)}}Xo.create=(n,e)=>new Xo({type:n,minLength:null,maxLength:null,exactLength:null,typeName:Nt.ZodArray,...Yt(e)});function Uf(n){if(n instanceof Qn){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=Ba.create(Uf(i))}return new Qn({...n._def,shape:()=>e})}else return n instanceof Xo?new Xo({...n._def,type:Uf(n.element)}):n instanceof Ba?Ba.create(Uf(n.unwrap())):n instanceof iu?iu.create(Uf(n.unwrap())):n instanceof ka?ka.create(n.items.map(e=>Uf(e))):n}class Qn extends en{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=dn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==yt.object){const c=this._getOrReturnCtx(e);return gt(c,{code:rt.invalid_type,expected:yt.object,received:c.parsedType}),Ut}const{status:i,ctx:r}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Hl&&this._def.unknownKeys==="strip"))for(const c in r.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=s[c],h=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Oa(r,h,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Hl){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")a.length>0&&(gt(r,{code:rt.unrecognized_keys,keys:a}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const h=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Oa(r,h,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const h=await u.key,d=await u.value;c.push({key:h,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>Ir.mergeObjectSync(i,c)):Ir.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return bt.errToObj,new Qn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var r,s,o,a;const l=(o=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,t,i).message)!==null&&o!==void 0?o:i.defaultError;return t.code==="unrecognized_keys"?{message:(a=bt.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Qn({...this._def,unknownKeys:"strip"})}passthrough(){return new Qn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Nt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Qn({...this._def,catchall:e})}pick(e){const t={};return dn.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new Qn({...this._def,shape:()=>t})}omit(e){const t={};return dn.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new Qn({...this._def,shape:()=>t})}deepPartial(){return Uf(this)}partial(e){const t={};return dn.objectKeys(this.shape).forEach(i=>{const r=this.shape[i];e&&!e[i]?t[i]=r:t[i]=r.optional()}),new Qn({...this._def,shape:()=>t})}required(e){const t={};return dn.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Ba;)s=s._def.innerType;t[i]=s}}),new Qn({...this._def,shape:()=>t})}keyof(){return BX(dn.objectKeys(this.shape))}}Qn.create=(n,e)=>new Qn({shape:()=>n,unknownKeys:"strip",catchall:Hl.create(),typeName:Nt.ZodObject,...Yt(e)});Qn.strictCreate=(n,e)=>new Qn({shape:()=>n,unknownKeys:"strict",catchall:Hl.create(),typeName:Nt.ZodObject,...Yt(e)});Qn.lazycreate=(n,e)=>new Qn({shape:n,unknownKeys:"strip",catchall:Hl.create(),typeName:Nt.ZodObject,...Yt(e)});class P0 extends en{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Fs(a.ctx.common.issues));return gt(t,{code:rt.invalid_union,unionErrors:o}),Ut}if(t.common.async)return Promise.all(i.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const l of i){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Fs(l));return gt(t,{code:rt.invalid_union,unionErrors:a}),Ut}}get options(){return this._def.options}}P0.create=(n,e)=>new P0({options:n,typeName:Nt.ZodUnion,...Yt(e)});const ll=n=>n instanceof D0?ll(n.schema):n instanceof qo?ll(n.innerType()):n instanceof B0?[n.value]:n instanceof nu?n.options:n instanceof N0?dn.objectValues(n.enum):n instanceof U0?ll(n._def.innerType):n instanceof C0?[void 0]:n instanceof R0?[null]:n instanceof Ba?[void 0,...ll(n.unwrap())]:n instanceof iu?[null,...ll(n.unwrap())]:n instanceof xD||n instanceof O0?ll(n.unwrap()):n instanceof F0?ll(n._def.innerType):[];class Bw extends en{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yt.object)return gt(t,{code:rt.invalid_type,expected:yt.object,received:t.parsedType}),Ut;const i=this.discriminator,r=t.data[i],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(gt(t,{code:rt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ut)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const r=new Map;for(const s of t){const o=ll(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,s)}}return new Bw({typeName:Nt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Yt(i)})}}function NP(n,e){const t=Ic(n),i=Ic(e);if(n===e)return{valid:!0,data:n};if(t===yt.object&&i===yt.object){const r=dn.objectKeys(e),s=dn.objectKeys(n).filter(a=>r.indexOf(a)!==-1),o={...n,...e};for(const a of s){const l=NP(n[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(t===yt.array&&i===yt.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let s=0;s{if(DP(s)||DP(o))return Ut;const a=NP(s.value,o.value);return a.valid?((BP(s)||BP(o))&&t.dirty(),{status:t.value,value:a.data}):(gt(i,{code:rt.invalid_intersection_types}),Ut)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}I0.create=(n,e,t)=>new I0({left:n,right:e,typeName:Nt.ZodIntersection,...Yt(t)});class ka extends en{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==yt.array)return gt(i,{code:rt.invalid_type,expected:yt.array,received:i.parsedType}),Ut;if(i.data.lengththis._def.items.length&&(gt(i,{code:rt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...i.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Oa(i,o,i.path,a)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Ir.mergeArray(t,o)):Ir.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ka({...this._def,rest:e})}}ka.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ka({items:n,typeName:Nt.ZodTuple,rest:null,...Yt(e)})};class L0 extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==yt.object)return gt(i,{code:rt.invalid_type,expected:yt.object,received:i.parsedType}),Ut;const r=[],s=this._def.keyType,o=this._def.valueType;for(const a in i.data)r.push({key:s._parse(new Oa(i,a,i.path,a)),value:o._parse(new Oa(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?Ir.mergeObjectAsync(t,r):Ir.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof en?new L0({keyType:e,valueType:t,typeName:Nt.ZodRecord,...Yt(i)}):new L0({keyType:Ho.create(),valueType:e,typeName:Nt.ZodRecord,...Yt(t)})}}class qM extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==yt.map)return gt(i,{code:rt.invalid_type,expected:yt.map,received:i.parsedType}),Ut;const r=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([a,l],c)=>({key:r._parse(new Oa(i,a,i.path,[c,"key"])),value:s._parse(new Oa(i,l,i.path,[c,"value"]))}));if(i.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ut;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(c.value,u.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Ut;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(c.value,u.value)}return{status:t.value,value:a}}}}qM.create=(n,e,t)=>new qM({valueType:e,keyType:n,typeName:Nt.ZodMap,...Yt(t)});class fd extends en{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==yt.set)return gt(i,{code:rt.invalid_type,expected:yt.set,received:i.parsedType}),Ut;const r=this._def;r.minSize!==null&&i.data.sizer.maxSize.value&&(gt(i,{code:rt.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Ut;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const a=[...i.data.values()].map((l,c)=>s._parse(new Oa(i,l,i.path,c)));return i.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,t){return new fd({...this._def,minSize:{value:e,message:bt.toString(t)}})}max(e,t){return new fd({...this._def,maxSize:{value:e,message:bt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}fd.create=(n,e)=>new fd({valueType:n,minSize:null,maxSize:null,typeName:Nt.ZodSet,...Yt(e)});class Ep extends en{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yt.function)return gt(t,{code:rt.invalid_type,expected:yt.function,received:t.parsedType}),Ut;function i(a,l){return jM({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,XM(),Jp].filter(c=>!!c),issueData:{code:rt.invalid_arguments,argumentsError:l}})}function r(a,l){return jM({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,XM(),Jp].filter(c=>!!c),issueData:{code:rt.invalid_return_type,returnTypeError:l}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof qp){const a=this;return Qr(async function(...l){const c=new Fs([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(i(l,f)),c}),h=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(h,s).catch(f=>{throw c.addIssue(r(h,f)),c})})}else{const a=this;return Qr(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new Fs([i(l,c.error)]);const u=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(u,s);if(!h.success)throw new Fs([r(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ep({...this._def,args:ka.create(e).rest(Kh.create())})}returns(e){return new Ep({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Ep({args:e||ka.create([]).rest(Kh.create()),returns:t||Kh.create(),typeName:Nt.ZodFunction,...Yt(i)})}}class D0 extends en{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}D0.create=(n,e)=>new D0({getter:n,typeName:Nt.ZodLazy,...Yt(e)});class B0 extends en{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return gt(t,{received:t.data,code:rt.invalid_literal,expected:this._def.value}),Ut}return{status:"valid",value:e.data}}get value(){return this._def.value}}B0.create=(n,e)=>new B0({value:n,typeName:Nt.ZodLiteral,...Yt(e)});function BX(n,e){return new nu({values:n,typeName:Nt.ZodEnum,...Yt(e)})}class nu extends en{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return gt(t,{expected:dn.joinValues(i),received:t.parsedType,code:rt.invalid_type}),Ut}if(YM(this,kg)||PX(this,kg,new Set(this._def.values)),!YM(this,kg).has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return gt(t,{received:t.data,code:rt.invalid_enum_value,options:i}),Ut}return Qr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return nu.create(e,{...this._def,...t})}exclude(e,t=this._def){return nu.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}kg=new WeakMap;nu.create=BX;class N0 extends en{constructor(){super(...arguments),zg.set(this,void 0)}_parse(e){const t=dn.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==yt.string&&i.parsedType!==yt.number){const r=dn.objectValues(t);return gt(i,{expected:dn.joinValues(r),received:i.parsedType,code:rt.invalid_type}),Ut}if(YM(this,zg)||PX(this,zg,new Set(dn.getValidEnumValues(this._def.values))),!YM(this,zg).has(e.data)){const r=dn.objectValues(t);return gt(i,{received:i.data,code:rt.invalid_enum_value,options:r}),Ut}return Qr(e.data)}get enum(){return this._def.values}}zg=new WeakMap;N0.create=(n,e)=>new N0({values:n,typeName:Nt.ZodNativeEnum,...Yt(e)});class qp extends en{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yt.promise&&t.common.async===!1)return gt(t,{code:rt.invalid_type,expected:yt.promise,received:t.parsedType}),Ut;const i=t.parsedType===yt.promise?t.data:Promise.resolve(t.data);return Qr(i.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}qp.create=(n,e)=>new qp({type:n,typeName:Nt.ZodPromise,...Yt(e)});class qo extends en{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Nt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:o=>{gt(i,o),o.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return Ut;const l=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return l.status==="aborted"?Ut:l.status==="dirty"||t.value==="dirty"?dp(l.value):l});{if(t.value==="aborted")return Ut;const a=this._def.schema._parseSync({data:o,path:i.path,parent:i});return a.status==="aborted"?Ut:a.status==="dirty"||t.value==="dirty"?dp(a.value):a}}if(r.type==="refinement"){const o=a=>{const l=r.refinement(a,s);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){const a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?Ut:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?Ut:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!E0(o))return o;const a=r.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>E0(o)?Promise.resolve(r.transform(o.value,s)).then(a=>({status:t.value,value:a})):o);dn.assertNever(r)}}qo.create=(n,e,t)=>new qo({schema:n,typeName:Nt.ZodEffects,effect:e,...Yt(t)});qo.createWithPreprocess=(n,e,t)=>new qo({schema:e,effect:{type:"preprocess",transform:n},typeName:Nt.ZodEffects,...Yt(t)});class Ba extends en{_parse(e){return this._getType(e)===yt.undefined?Qr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ba.create=(n,e)=>new Ba({innerType:n,typeName:Nt.ZodOptional,...Yt(e)});class iu extends en{_parse(e){return this._getType(e)===yt.null?Qr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}iu.create=(n,e)=>new iu({innerType:n,typeName:Nt.ZodNullable,...Yt(e)});class U0 extends en{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===yt.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}U0.create=(n,e)=>new U0({innerType:n,typeName:Nt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Yt(e)});class F0 extends en{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return T0(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Fs(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Fs(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}F0.create=(n,e)=>new F0({innerType:n,typeName:Nt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Yt(e)});class ZM extends en{_parse(e){if(this._getType(e)!==yt.nan){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.nan,received:i.parsedType}),Ut}return{status:"valid",value:e.data}}}ZM.create=n=>new ZM({typeName:Nt.ZodNaN,...Yt(n)});const h1e=Symbol("zod_brand");class xD extends en{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class _y extends en{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ut:s.status==="dirty"?(t.dirty(),dp(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Ut:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,t){return new _y({in:e,out:t,typeName:Nt.ZodPipeline})}}class O0 extends en{_parse(e){const t=this._def.innerType._parse(e),i=r=>(E0(r)&&(r.value=Object.freeze(r.value)),r);return T0(t)?t.then(r=>i(r)):i(t)}unwrap(){return this._def.innerType}}O0.create=(n,e)=>new O0({innerType:n,typeName:Nt.ZodReadonly,...Yt(e)});function NX(n,e={},t){return n?Kp.create().superRefine((i,r)=>{var s,o;if(!n(i)){const a=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,l=(o=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;r.addIssue({code:"custom",...c,fatal:l})}}):Kp.create()}const d1e={object:Qn.lazycreate};var Nt;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(Nt||(Nt={}));const f1e=(n,e={message:`Input not instance of ${n.name}`})=>NX(t=>t instanceof n,e),UX=Ho.create,FX=eu.create,p1e=ZM.create,m1e=tu.create,OX=b0.create,g1e=dd.create,v1e=JM.create,y1e=C0.create,_1e=R0.create,x1e=Kp.create,S1e=Kh.create,M1e=Hl.create,A1e=KM.create,w1e=Xo.create,E1e=Qn.create,T1e=Qn.strictCreate,b1e=P0.create,C1e=Bw.create,R1e=I0.create,P1e=ka.create,I1e=L0.create,L1e=qM.create,D1e=fd.create,B1e=Ep.create,N1e=D0.create,U1e=B0.create,F1e=nu.create,O1e=N0.create,k1e=qp.create,Nz=qo.create,z1e=Ba.create,G1e=iu.create,H1e=qo.createWithPreprocess,V1e=_y.create,W1e=()=>UX().optional(),$1e=()=>FX().optional(),X1e=()=>OX().optional(),j1e={string:n=>Ho.create({...n,coerce:!0}),number:n=>eu.create({...n,coerce:!0}),boolean:n=>b0.create({...n,coerce:!0}),bigint:n=>tu.create({...n,coerce:!0}),date:n=>dd.create({...n,coerce:!0})},Y1e=Ut;var T1=Object.freeze({__proto__:null,defaultErrorMap:Jp,setErrorMap:Yxe,getErrorMap:XM,makeIssue:jM,EMPTY_PATH:Jxe,addIssueToContext:gt,ParseStatus:Ir,INVALID:Ut,DIRTY:dp,OK:Qr,isAborted:DP,isDirty:BP,isValid:E0,isAsync:T0,get util(){return dn},get objectUtil(){return LP},ZodParsedType:yt,getParsedType:Ic,ZodType:en,datetimeRegex:DX,ZodString:Ho,ZodNumber:eu,ZodBigInt:tu,ZodBoolean:b0,ZodDate:dd,ZodSymbol:JM,ZodUndefined:C0,ZodNull:R0,ZodAny:Kp,ZodUnknown:Kh,ZodNever:Hl,ZodVoid:KM,ZodArray:Xo,ZodObject:Qn,ZodUnion:P0,ZodDiscriminatedUnion:Bw,ZodIntersection:I0,ZodTuple:ka,ZodRecord:L0,ZodMap:qM,ZodSet:fd,ZodFunction:Ep,ZodLazy:D0,ZodLiteral:B0,ZodEnum:nu,ZodNativeEnum:N0,ZodPromise:qp,ZodEffects:qo,ZodTransformer:qo,ZodOptional:Ba,ZodNullable:iu,ZodDefault:U0,ZodCatch:F0,ZodNaN:ZM,BRAND:h1e,ZodBranded:xD,ZodPipeline:_y,ZodReadonly:O0,custom:NX,Schema:en,ZodSchema:en,late:d1e,get ZodFirstPartyTypeKind(){return Nt},coerce:j1e,any:x1e,array:w1e,bigint:m1e,boolean:OX,date:g1e,discriminatedUnion:C1e,effect:Nz,enum:F1e,function:B1e,instanceof:f1e,intersection:R1e,lazy:N1e,literal:U1e,map:L1e,nan:p1e,nativeEnum:O1e,never:M1e,null:_1e,nullable:G1e,number:FX,object:E1e,oboolean:X1e,onumber:$1e,optional:z1e,ostring:W1e,pipeline:V1e,preprocess:H1e,promise:k1e,record:I1e,set:D1e,strictObject:T1e,string:UX,symbol:v1e,transformer:Nz,tuple:P1e,undefined:y1e,union:b1e,unknown:S1e,void:A1e,NEVER:Y1e,ZodIssueCode:rt,quotelessJson:jxe,ZodError:Fs});const J1e=SH.form` +#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=hu){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,i,r){for(const s of this.effects)s.update(n,e,i);if(!this.skipRendering||this.renderToScreen){const s=this.fullscreenMaterial;s.inputBuffer=e.texture,s.time+=i*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const i of this.effects)i.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==Zi&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},O_e=class extends _s{constructor(n,e,{renderTarget:t,resolutionScale:i=1,width:r=wr.AUTO_SIZE,height:s=wr.AUTO_SIZE,resolutionX:o=r,resolutionY:a=s}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new U$(n,e,new iL);const l=this.renderPass;l.ignoreBackground=!0,l.skipShadowMapUpdate=!0;const c=l.getClearPass();c.overrideClearColor=new ct(7829503),c.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new wi(1,1,{minFilter:ri,magFilter:ri}),this.renderTarget.texture.name="NormalPass.Target");const u=this.resolution=new wr(this,o,a,i);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,i,r){const s=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,s,s)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}};const k_e=se.createContext(null),Cz=n=>(n.getAttributes()&Pl.CONVOLUTION)===Pl.CONVOLUTION,z_e=Qt.memo(se.forwardRef(({children:n,camera:e,scene:t,resolutionScale:i,enabled:r=!0,renderPriority:s=1,autoClear:o=!0,depthBuffer:a,enableNormalPass:l,stencilBuffer:c,multisampling:u=8,frameBufferType:h=yd},d)=>{const{gl:f,scene:v,camera:_,size:y}=Wr(),m=t||v,S=e||_,[x,M,R]=se.useMemo(()=>{const b=_0e(),w=new Pye(f,{depthBuffer:a,stencilBuffer:c,multisampling:u>0&&b?u:0,frameBufferType:h});w.addPass(new U$(m,S));let N=null,G=null;return l&&(G=new O_e(m,S),G.enabled=!1,w.addPass(G),i!==void 0&&b&&(N=new L_e({normalBuffer:G.texture,resolutionScale:i}),N.enabled=!1,w.addPass(N))),[w,G,N]},[S,f,a,c,u,h,m,l,i]);se.useEffect(()=>x==null?void 0:x.setSize(y.width,y.height),[x,y]),Ad((b,w)=>{if(r){const N=f.autoClear;f.autoClear=o,c&&!o&&f.clearStencil(),x.render(w),f.autoClear=N}},r?s:0);const T=se.useRef(null),P=Rce(T);se.useLayoutEffect(()=>{const b=[];if(T.current&&P.current&&x){const w=P.current.objects;for(let N=0;N{for(const w of b)x==null||x.removePass(w);M&&(M.enabled=!1),R&&(R.enabled=!1)}},[x,n,S,M,R,P]),se.useEffect(()=>{const b=f.toneMapping;return f.toneMapping=$o,()=>{f.toneMapping=b}},[]);const I=se.useMemo(()=>({composer:x,normalPass:M,downSamplingPass:R,resolutionScale:i,camera:S,scene:m}),[x,M,R,i,S,m]);return se.useImperativeHandle(d,()=>x,[x]),pe.jsx(k_e.Provider,{value:I,children:pe.jsx("group",{ref:T,children:n})})}));let G_e=0;const Rz=new WeakMap,H_e=(n,e)=>Qt.forwardRef(function({blendFunction:i=e==null?void 0:e.blendFunction,opacity:r=e==null?void 0:e.opacity,...s},o){let a=Rz.get(n);if(!a){const u=`@react-three/postprocessing/${n.name}-${G_e++}`;q9({[u]:n}),Rz.set(n,a=u)}const l=Wr(u=>u.camera),c=Qt.useMemo(()=>{var u,h;return[...(u=e==null?void 0:e.args)!=null?u:[],...(h=s.args)!=null?h:[{...e,...s}]]},[JSON.stringify(s)]);return pe.jsx(a,{camera:l,"blendMode-blendFunction":i,"blendMode-opacity-value":r,...s,ref:o,args:c})}),V_e=H_e(C_e,{blendFunction:sn.ADD}),uD=()=>{const{progress:n}=aue();return pe.jsxs(oue,{as:"div",center:!0,style:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[pe.jsx("span",{className:"canvas-loader"}),pe.jsxs("p",{style:{fontSize:14,color:"#F1F1F1",fontWeight:800,marginTop:40},children:[n.toFixed(2),"%"]})]})},W_e=()=>{const n=my("./robot/scene.gltf");return pe.jsx("primitive",{object:n.scene,scale:2,"position-y":0,"rotation-y":0})},$_e=()=>pe.jsx($A,{shadows:!0,frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},camera:{fov:45,near:.1,far:200,position:[-4,3,5]},children:pe.jsxs(z_e,{children:[pe.jsx("ambientLight",{intensity:10,position:[100,5,1]}),pe.jsx("directionalLight",{position:[100,5,1],intensity:1}),pe.jsx("directionalLight",{position:[-10,-10,-5],intensity:1}),pe.jsxs(se.Suspense,{fallback:pe.jsx(uD,{}),children:[pe.jsx(lD,{autoRotate:!0,enablePan:!0,enableZoom:!1,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/2}),pe.jsx(W_e,{}),pe.jsx(bw,{all:!0})]}),pe.jsx(V_e,{blendFunction:sn.ALPHA})]})});var F$={exports:{}},Xs={},hD={};function O$(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pz(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function X_e(n){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}dD._isNativeReflectConstruct=Y_e;dD._setPrototypeOf=bP;var _u={},J_e=k;function z$(){for(var n=arguments.length,e=new Array(n),t=0;tn.length)&&(e=n.length);for(var t=0,i=new Array(e);t0}var ixe=new gy.Vector2,rxe=new gy.Vector2;function J$(n){var e=n.map(function(c){return Array.isArray(c)?K1(gy.Vector2,$$(c)):c}),t=Er(e,3),i=t[0],r=t[1],s=t[2];if(vy(n))return!1;var o=ixe.subVectors(r,i),a=rxe.subVectors(s,i),l=a.cross(o);return l>0}var sxe=Object.freeze({__proto__:null,isPointInTriangle:X$,triangleDeterminant:Cw,arePointsCollinear:vy,isTriangleClockwise:pD,getCircumcircle:j$,isPointInCircumcircle:Y$,doThreePointsMakeARight:J$});ra._slicedToArray=Er;ra._toConsumableArray=$$;ra.arePointsCollinear=vy;ra.doThreePointsMakeARight=J$;ra.getCircumcircle=j$;ra.isPointInCircumcircle=Y$;ra.isPointInTriangle=X$;ra.isTriangleClockwise=pD;ra.triangle=sxe;ra.triangleDeterminant=Cw;var Ta=ra,hp=k,Lz=_u;function mD(n,e,t){return Math.max(e,Math.min(t,n))}function gD(n,e){return mD(n-Math.floor(n/e)*e,0,e)}function K$(n,e){var t=gD(e-n,Math.PI*2);return t>Math.PI&&(t-=Math.PI*2),t}function q$(n){return n/180*Math.PI}function Z$(n){return n*180/Math.PI}function Q$(n,e){for(var t=e.radius,i=t===void 0?1:t,r=n.length/3,s=2/r,o=Math.PI*(3-2.2360679775),a=0;a2&&arguments[2]!==void 0?arguments[2]:Number.EPSILON;return Math.abs(n.x-e.x)2&&Ta.doThreePointsMakeARight(Ta._toConsumableArray(t.slice(-3)));)t.splice(t.length-2,1);for(var r=[e[e.length-1],e[e.length-2]],s=e.length-3;s>=0;s--)for(r.push(e[s]);r.length>2&&Ta.doThreePointsMakeARight(Ta._toConsumableArray(r.slice(-3)));)r.splice(r.length-2,1);r.splice(0,1),r.splice(r.length-1,1);var o=[].concat(t,r);return o}function nX(n,e,t){var i=Ta._slicedToArray(e,2),r=i[0],s=i[1],o=Ta._slicedToArray(t,2),a=o[0],l=o[1];return a+(n-r)*(l-a)/(s-r)}function iX(n){return n*n*n*(n*(n*6-15)+10)}function rX(n,e,t){return n*(1-t)+e*t}function yD(n,e,t){return(t-n)/(e-n)}function sX(n,e,t){var i=Math.sqrt(n*n+e*e+t*t);return[n/i,e/i,t/i]}function oX(n,e,t){var i=n*n,r=e*e,s=t*t,o=n*Math.sqrt(1-(r+s)/2+r*s/3),a=e*Math.sqrt(1-(s+i)/2+s*i/3),l=t*Math.sqrt(1-(i+r)/2+i*r/3);return[o,a,l]}function _D(n,e){var t=new hp.Vector3().crossVectors(n,e),i=n.dot(e),r=new hp.Matrix3().identity(),s=new hp.Matrix3().set(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0),o=new hp.Matrix3().multiplyMatrices(s,s).multiplyScalar(1/(1+i)),a=Lz.matrixSum3(Lz.matrixSum3(r,s),o);return a}function aX(n,e,t){var i=Math.asin(e),r=Math.atan2(n,-t);return[i,r]}function lX(n,e){var t=Math.sin(n),i=Math.cos(n),r=Math.sin(e)*i,s=-Math.cos(e)*i;return[r,t,s]}function cX(n,e){var t=Ta._slicedToArray(e,2),i=t[0],r=t[1],s=_D(n.normal,new hp.Vector3(0,1,0)),o=yD(i.clone().applyMatrix3(s).y,r.clone().applyMatrix3(s).y,0);return new hp.Vector3().lerpVectors(i,r,o)}function uX(n,e){var t=e.normal.dot(n);return t}function hX(n,e){var t=Ta._slicedToArray(n,3),i=t[0],r=t[1],s=t[2],o=Ta._slicedToArray(e,2),a=o[0],l=o[1];return s*a*l+r*a+i}function dX(n,e){var t=Ta._slicedToArray(e,2),i=t[0],r=t[1],s=i*r,o=n/s,a=n-s*o,l=a/i,c=a%i;return[c,l,o]}function fX(n,e){return n[0]+e[0]*n[1]}function pX(n,e){var t=n%e,i=Math.floor(n/e);return[t,i]}var oxe=Object.freeze({__proto__:null,clamp:mD,repeat:gD,deltaAngle:K$,degToRad:q$,radToDeg:Z$,fibonacciOnSphere:Q$,vectorEquals:eX,lexicographic:vD,convexHull:tX,remap:nX,fade:iX,lerp:rX,inverseLerp:yD,normalize:sX,pointOnCubeToPointOnSphere:oX,rotateVectorOnVector:_D,pointToCoordinate:aX,coordinateToPoint:lX,planeSegmentIntersection:cX,pointToPlaneDistance:uX,getIndexFrom3D:hX,get3DFromIndex:dX,getIndexFrom2D:fX,get2DFromIndex:pX});Wn.clamp=mD;Wn.convexHull=tX;Wn.coordinateToPoint=lX;Wn.degToRad=q$;Wn.deltaAngle=K$;Wn.fade=iX;Wn.fibonacciOnSphere=Q$;Wn.get2DFromIndex=pX;Wn.get3DFromIndex=dX;Wn.getIndexFrom2D=fX;Wn.getIndexFrom3D=hX;Wn.inverseLerp=yD;Wn.lerp=rX;Wn.lexicographic=vD;Wn.misc=oxe;Wn.normalize=sX;Wn.planeSegmentIntersection=cX;Wn.pointOnCubeToPointOnSphere=oX;Wn.pointToCoordinate=aX;Wn.pointToPlaneDistance=uX;Wn.radToDeg=Z$;Wn.remap=nX;Wn.repeat=gD;Wn.rotateVectorOnVector=_D;Wn.vectorEquals=eX;var pn=hD,xD=k$,Hr=Wn;function axe(n,e){for(var t=0;t0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var i;t&1?i=Dz[t]^e&255:i=Dz[t]^e>>8&255,fn[t]=fn[t+256]=i,Mi[t]=Mi[t+256]=cxe[i%12]}};mX(0);var uxe=.5*(Math.sqrt(3)-1),Cg=(3-Math.sqrt(3))/6,hxe=1/3,va=1/6,dxe=function(e,t){var i,r,s,o=(e+t)*uxe,a=Math.floor(e+o),l=Math.floor(t+o),c=(a+l)*Cg,u=e-a+c,h=t-l+c,d,f;u>h?(d=1,f=0):(d=0,f=1);var v=u-d+Cg,_=h-f+Cg,y=u-1+2*Cg,m=h-1+2*Cg;a&=255,l&=255;var S=Mi[a+fn[l]],x=Mi[a+d+fn[l+f]],M=Mi[a+1+fn[l+1]],R=.5-u*u-h*h;R<0?i=0:(R*=R,i=R*R*S.dot2(u,h));var T=.5-v*v-_*_;T<0?r=0:(T*=T,r=T*T*x.dot2(v,_));var P=.5-y*y-m*m;return P<0?s=0:(P*=P,s=P*P*M.dot2(y,m)),70*(i+r+s)},fxe=function(e,t,i){var r,s,o,a,l=(e+t+i)*hxe,c=Math.floor(e+l),u=Math.floor(t+l),h=Math.floor(i+l),d=(c+u+h)*va,f=e-c+d,v=t-u+d,_=i-h+d,y,m,S,x,M,R;f>=v?v>=_?(y=1,m=0,S=0,x=1,M=1,R=0):f>=_?(y=1,m=0,S=0,x=1,M=0,R=1):(y=0,m=0,S=1,x=1,M=0,R=1):v<_?(y=0,m=0,S=1,x=0,M=1,R=1):f<_?(y=0,m=1,S=0,x=0,M=1,R=1):(y=0,m=1,S=0,x=1,M=1,R=0);var T=f-y+va,P=v-m+va,I=_-S+va,b=f-x+2*va,w=v-M+2*va,N=_-R+2*va,G=f-1+3*va,V=v-1+3*va,$=_-1+3*va;c&=255,u&=255,h&=255;var Z=Mi[c+fn[u+fn[h]]],X=Mi[c+y+fn[u+m+fn[h+S]]],re=Mi[c+x+fn[u+M+fn[h+R]]],O=Mi[c+1+fn[u+1+fn[h+1]]],Q=.6-f*f-v*v-_*_;Q<0?r=0:(Q*=Q,r=Q*Q*Z.dot3(f,v,_));var te=.6-T*T-P*P-I*I;te<0?s=0:(te*=te,s=te*te*X.dot3(T,P,I));var le=.6-b*b-w*w-N*N;le<0?o=0:(le*=le,o=le*le*re.dot3(b,w,N));var we=.6-G*G-V*V-$*$;return we<0?a=0:(we*=we,a=we*we*O.dot3(G,V,$)),32*(r+s+o+a)},pxe=function(e,t){var i=Math.floor(e),r=Math.floor(t);e=e-i,t=t-r,i=i&255,r=r&255;var s=Mi[i+fn[r]].dot2(e,t),o=Mi[i+fn[r+1]].dot2(e,t-1),a=Mi[i+1+fn[r]].dot2(e-1,t),l=Mi[i+1+fn[r+1]].dot2(e-1,t-1),c=Hr.fade(e);return Hr.lerp(Hr.lerp(s,a,c),Hr.lerp(o,l,c),Hr.fade(t))},mxe=function(e,t,i){var r=Math.floor(e),s=Math.floor(t),o=Math.floor(i);e=e-r,t=t-s,i=i-o,r=r&255,s=s&255,o=o&255;var a=Mi[r+fn[s+fn[o]]].dot3(e,t,i),l=Mi[r+fn[s+fn[o+1]]].dot3(e,t,i-1),c=Mi[r+fn[s+1+fn[o]]].dot3(e,t-1,i),u=Mi[r+fn[s+1+fn[o+1]]].dot3(e,t-1,i-1),h=Mi[r+1+fn[s+fn[o]]].dot3(e-1,t,i),d=Mi[r+1+fn[s+fn[o+1]]].dot3(e-1,t,i-1),f=Mi[r+1+fn[s+1+fn[o]]].dot3(e-1,t-1,i),v=Mi[r+1+fn[s+1+fn[o+1]]].dot3(e-1,t-1,i-1),_=Hr.fade(e),y=Hr.fade(t),m=Hr.fade(i);return Hr.lerp(Hr.lerp(Hr.lerp(a,h,_),Hr.lerp(l,d,_),m),Hr.lerp(Hr.lerp(c,f,_),Hr.lerp(u,v,_),m),y)},gX=Object.freeze({__proto__:null,seed:mX,simplex2:dxe,simplex3:fxe,perlin2:pxe,perlin3:mxe}),SD=Math.PI*2,vX=function(){function n(e){xD._classCallCheck(this,n),pn._defineProperty(this,"nextBurstTime",0),pn._defineProperty(this,"nextFlashEndTime",0),pn._defineProperty(this,"flashesDone",0),pn._defineProperty(this,"isFlashing",!1),pn._defineProperty(this,"currentCount",0),pn._defineProperty(this,"flashIntensity",0),pn._defineProperty(this,"isDecaying",!1),pn._defineProperty(this,"autoBurst",!0),pn._defineProperty(this,"decaySpeed",40),pn._defineProperty(this,"minInterval",5e3),pn._defineProperty(this,"maxInterval",1e4),pn._defineProperty(this,"minDuration",50),pn._defineProperty(this,"maxDuration",300),pn._defineProperty(this,"count",5),Object.assign(this,e)}return lxe(n,[{key:"scheduleNextBurst",value:function(t){var i=Math.random()*(this.maxInterval-this.minInterval)+this.minInterval;this.nextBurstTime=t+i/1e3,this.flashesDone=0,this.isFlashing=!1}},{key:"burst",value:function(){this.nextBurstTime=0,this.flashesDone=0,this.isFlashing=!1}},{key:"update",value:function(t,i){if(t>this.nextBurstTime&&this.currentCount===0&&(this.currentCount=Math.floor(Math.random()*this.count)+1),this.flashesDonethis.nextBurstTime)if(this.isFlashing)this.isFlashing&&t>this.nextFlashEndTime&&(this.isFlashing=!1,this.isDecaying=!0,this.flashesDone++,this.flashesDone>=this.currentCount&&(this.currentCount=0,this.autoBurst&&this.scheduleNextBurst(t)));else{this.isFlashing=!0,this.flashIntensity=1;var r=Math.random()*(this.maxDuration-this.minDuration)+this.minDuration;this.nextFlashEndTime=t+r/1e3}return this.isDecaying&&(this.flashIntensity-=i*this.decaySpeed,this.flashIntensity=Math.max(0,Math.min(1,this.flashIntensity)),this.flashIntensity<=0&&(this.isDecaying=!1,this.flashIntensity=0)),this.flashIntensity}}]),n}();function gxe(n){if(typeof n=="number")n=Math.abs(n);else if(typeof n=="string"){var e=n;n=0;for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},yX),e),r=i.radius,s=i.center,o=0;o2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},yX),e),r=i.radius,s=i.center,o=0;o2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},SX),e),r=i.radius,s=i.center,o=0;o2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},SX),e),r=i.radius,s=i.center,o=0;o2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},vxe),e),r=i.sides,s=i.center,o=typeof r=="number"?r:r[0],a=typeof r=="number"?r:r[1],l=0;l2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},bX),e),r=i.sides,s=i.center,o=typeof r=="number"?r:r[0],a=typeof r=="number"?r:r[1],l=typeof r=="number"?r:r[2],c=0;c2&&arguments[2]!==void 0?arguments[2]:bd,i=pn._objectSpread2(pn._objectSpread2({},bX),e),r=i.sides,s=i.center,o=typeof r=="number"?r:r[0],a=typeof r=="number"?r:r[1],l=typeof r=="number"?r:r[2],c=0;c{const n=se.useRef(),[e]=se.useState(()=>_xe.inSphere(new Float32Array(5e3),{radius:1.2}));return Ad((t,i)=>{n.current&&(n.current.rotation.x-=i/10,n.current.rotation.y-=i/15)}),pe.jsx("group",{rotation:[0,0,Math.PI/4],children:pe.jsx(Mye,{ref:n,positions:Float32Array.from(e),stride:3,frustumCulled:!0,children:pe.jsx(vye,{transparent:!0,color:"#f272c8",size:.002,sizeAttenuation:!0,depthWrite:!1})})})},Sxe=()=>pe.jsx("div",{className:"w-full h-auto absolute inset-0 z-[-1]",children:pe.jsxs($A,{camera:{position:[0,0,1]},children:[pe.jsx(se.Suspense,{fallback:null,children:pe.jsx(xxe,{})}),pe.jsx(bw,{all:!0})]})}),A0=n=>typeof n=="number"&&!isNaN(n),Jh=n=>typeof n=="string",Ds=n=>typeof n=="function",q1=n=>Jh(n)||Ds(n)?n:null,RP=n=>se.isValidElement(n)||Jh(n)||Ds(n)||A0(n);function Mxe(n,e,t){t===void 0&&(t=300);const{scrollHeight:i,style:r}=n;requestAnimationFrame(()=>{r.minHeight="initial",r.height=i+"px",r.transition=`all ${t}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(e,t)})})}function Rw(n){let{enter:e,exit:t,appendPosition:i=!1,collapse:r=!0,collapseDuration:s=300}=n;return function(o){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:h,isIn:d,playToast:f}=o;const v=i?`${e}--${l}`:e,_=i?`${t}--${l}`:t,y=se.useRef(0);return se.useLayoutEffect(()=>{const m=h.current,S=v.split(" "),x=M=>{M.target===h.current&&(f(),m.removeEventListener("animationend",x),m.removeEventListener("animationcancel",x),y.current===0&&M.type!=="animationcancel"&&m.classList.remove(...S))};m.classList.add(...S),m.addEventListener("animationend",x),m.addEventListener("animationcancel",x)},[]),se.useEffect(()=>{const m=h.current,S=()=>{m.removeEventListener("animationend",S),r?Mxe(m,u,s):u()};d||(c?S():(y.current=1,m.className+=` ${_}`,m.addEventListener("animationend",S)))},[d]),Qt.createElement(Qt.Fragment,null,a)}}function Nz(n,e){return n!=null?{content:n.content,containerId:n.props.containerId,id:n.props.toastId,theme:n.props.theme,type:n.props.type,data:n.props.data||{},isLoading:n.props.isLoading,icon:n.props.icon,status:e}:{}}const jr=new Map;let w0=[];const PP=new Set,Axe=n=>PP.forEach(e=>e(n)),RX=()=>jr.size>0;function PX(n,e){var t;if(e)return!((t=jr.get(e))==null||!t.isToastActive(n));let i=!1;return jr.forEach(r=>{r.isToastActive(n)&&(i=!0)}),i}function IX(n,e){RP(n)&&(RX()||w0.push({content:n,options:e}),jr.forEach(t=>{t.buildToast(n,e)}))}function Uz(n,e){jr.forEach(t=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===t.id&&t.toggle(n,e==null?void 0:e.id):t.toggle(n,e==null?void 0:e.id)})}function wxe(n){const{subscribe:e,getSnapshot:t,setProps:i}=se.useRef(function(s){const o=s.containerId||1;return{subscribe(a){const l=function(u,h,d){let f=1,v=0,_=[],y=[],m=[],S=h;const x=new Map,M=new Set,R=()=>{m=Array.from(x.values()),M.forEach(I=>I())},T=I=>{y=I==null?[]:y.filter(b=>b!==I),R()},P=I=>{const{toastId:b,onOpen:w,updateId:N,children:G}=I.props,V=N==null;I.staleId&&x.delete(I.staleId),x.set(b,I),y=[...y,I.props.toastId].filter($=>$!==I.staleId),R(),d(Nz(I,V?"added":"updated")),V&&Ds(w)&&w(se.isValidElement(G)&&G.props)};return{id:u,props:S,observe:I=>(M.add(I),()=>M.delete(I)),toggle:(I,b)=>{x.forEach(w=>{b!=null&&b!==w.props.toastId||Ds(w.toggle)&&w.toggle(I)})},removeToast:T,toasts:x,clearQueue:()=>{v-=_.length,_=[]},buildToast:(I,b)=>{if((we=>{let{containerId:Ne,toastId:q,updateId:fe}=we;const Te=Ne?Ne!==u:u!==1,Se=x.has(q)&&fe==null;return Te||Se})(b))return;const{toastId:w,updateId:N,data:G,staleId:V,delay:$}=b,Z=()=>{T(w)},X=N==null;X&&v++;const re={...S,style:S.toastStyle,key:f++,...Object.fromEntries(Object.entries(b).filter(we=>{let[Ne,q]=we;return q!=null})),toastId:w,updateId:N,data:G,closeToast:Z,isIn:!1,className:q1(b.className||S.toastClassName),bodyClassName:q1(b.bodyClassName||S.bodyClassName),progressClassName:q1(b.progressClassName||S.progressClassName),autoClose:!b.isLoading&&(O=b.autoClose,Q=S.autoClose,O===!1||A0(O)&&O>0?O:Q),deleteToast(){const we=x.get(w),{onClose:Ne,children:q}=we.props;Ds(Ne)&&Ne(se.isValidElement(q)&&q.props),d(Nz(we,"removed")),x.delete(w),v--,v<0&&(v=0),_.length>0?P(_.shift()):R()}};var O,Q;re.closeButton=S.closeButton,b.closeButton===!1||RP(b.closeButton)?re.closeButton=b.closeButton:b.closeButton===!0&&(re.closeButton=!RP(S.closeButton)||S.closeButton);let te=I;se.isValidElement(I)&&!Jh(I.type)?te=se.cloneElement(I,{closeToast:Z,toastProps:re,data:G}):Ds(I)&&(te=I({closeToast:Z,toastProps:re,data:G}));const le={content:te,props:re,staleId:V};S.limit&&S.limit>0&&v>S.limit&&X?_.push(le):A0($)?setTimeout(()=>{P(le)},$):P(le)},setProps(I){S=I},setToggle:(I,b)=>{x.get(I).toggle=b},isToastActive:I=>y.some(b=>b===I),getSnapshot:()=>S.newestOnTop?m.reverse():m}}(o,s,Axe);jr.set(o,l);const c=l.observe(a);return w0.forEach(u=>IX(u.content,u.options)),w0=[],()=>{c(),jr.delete(o)}},setProps(a){var l;(l=jr.get(o))==null||l.setProps(a)},getSnapshot(){var a;return(a=jr.get(o))==null?void 0:a.getSnapshot()}}}(n)).current;i(n);const r=se.useSyncExternalStore(e,t,t);return{getToastToRender:function(s){if(!r)return[];const o=new Map;return r.forEach(a=>{const{position:l}=a.props;o.has(l)||o.set(l,[]),o.get(l).push(a)}),Array.from(o,a=>s(a[0],a[1]))},isToastActive:PX,count:r==null?void 0:r.length}}function Exe(n){const[e,t]=se.useState(!1),[i,r]=se.useState(!1),s=se.useRef(null),o=se.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:h}=n;var d,f;function v(){t(!0)}function _(){t(!1)}function y(x){const M=s.current;o.canDrag&&M&&(o.didMove=!0,e&&_(),o.delta=n.draggableDirection==="x"?x.clientX-o.start:x.clientY-o.start,o.start!==x.clientX&&(o.canCloseOnClick=!1),M.style.transform=`translate3d(${n.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,M.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function m(){document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",m);const x=s.current;if(o.canDrag&&o.didMove&&x){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return r(!0),n.closeToast(),void n.collapseAll();x.style.transition="transform 0.2s, opacity 0.2s",x.style.removeProperty("transform"),x.style.removeProperty("opacity")}}(f=jr.get((d={id:n.toastId,containerId:n.containerId,fn:t}).containerId||1))==null||f.setToggle(d.id,d.fn),se.useEffect(()=>{if(n.pauseOnFocusLoss)return document.hasFocus()||_(),window.addEventListener("focus",v),window.addEventListener("blur",_),()=>{window.removeEventListener("focus",v),window.removeEventListener("blur",_)}},[n.pauseOnFocusLoss]);const S={onPointerDown:function(x){if(n.draggable===!0||n.draggable===x.pointerType){o.didMove=!1,document.addEventListener("pointermove",y),document.addEventListener("pointerup",m);const M=s.current;o.canCloseOnClick=!0,o.canDrag=!0,M.style.transition="none",n.draggableDirection==="x"?(o.start=x.clientX,o.removalDistance=M.offsetWidth*(n.draggablePercent/100)):(o.start=x.clientY,o.removalDistance=M.offsetHeight*(n.draggablePercent===80?1.5*n.draggablePercent:n.draggablePercent)/100)}},onPointerUp:function(x){const{top:M,bottom:R,left:T,right:P}=s.current.getBoundingClientRect();x.nativeEvent.type!=="touchend"&&n.pauseOnHover&&x.clientX>=T&&x.clientX<=P&&x.clientY>=M&&x.clientY<=R?_():v()}};return a&&l&&(S.onMouseEnter=_,n.stacked||(S.onMouseLeave=v)),h&&(S.onClick=x=>{u&&u(x),o.canCloseOnClick&&c()}),{playToast:v,pauseToast:_,isRunning:e,preventExitTransition:i,toastRef:s,eventHandlers:S}}function Txe(n){let{delay:e,isRunning:t,closeToast:i,type:r="default",hide:s,className:o,style:a,controlledProgress:l,progress:c,rtl:u,isIn:h,theme:d}=n;const f=s||l&&c===0,v={...a,animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};l&&(v.transform=`scaleX(${c})`);const _=Go("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":u}),y=Ds(o)?o({rtl:u,type:r,defaultClassName:_}):Go(_,o),m={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{h&&i()}};return Qt.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},Qt.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${r}`}),Qt.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:y,style:v,...m}))}let bxe=1;const LX=()=>""+bxe++;function Cxe(n){return n&&(Jh(n.toastId)||A0(n.toastId))?n.toastId:LX()}function yv(n,e){return IX(n,e),e.toastId}function $M(n,e){return{...e,type:e&&e.type||n,toastId:Cxe(e)}}function A1(n){return(e,t)=>yv(e,$M(n,t))}function Fn(n,e){return yv(n,$M("default",e))}Fn.loading=(n,e)=>yv(n,$M("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Fn.promise=function(n,e,t){let i,{pending:r,error:s,success:o}=e;r&&(i=Jh(r)?Fn.loading(r,t):Fn.loading(r.render,{...t,...r}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,h,d)=>{if(h==null)return void Fn.dismiss(i);const f={type:u,...a,...t,data:d},v=Jh(h)?{render:h}:h;return i?Fn.update(i,{...f,...v}):Fn(v.render,{...f,...v}),d},c=Ds(n)?n():n;return c.then(u=>l("success",o,u)).catch(u=>l("error",s,u)),c},Fn.success=A1("success"),Fn.info=A1("info"),Fn.error=A1("error"),Fn.warning=A1("warning"),Fn.warn=Fn.warning,Fn.dark=(n,e)=>yv(n,$M("default",{theme:"dark",...e})),Fn.dismiss=function(n){(function(e){var t;if(RX()){if(e==null||Jh(t=e)||A0(t))jr.forEach(i=>{i.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const i=jr.get(e.containerId);i?i.removeToast(e.id):jr.forEach(r=>{r.removeToast(e.id)})}}else w0=w0.filter(i=>e!=null&&i.options.toastId!==e)})(n)},Fn.clearWaitingQueue=function(n){n===void 0&&(n={}),jr.forEach(e=>{!e.props.limit||n.containerId&&e.id!==n.containerId||e.clearQueue()})},Fn.isActive=PX,Fn.update=function(n,e){e===void 0&&(e={});const t=((i,r)=>{var s;let{containerId:o}=r;return(s=jr.get(o||1))==null?void 0:s.toasts.get(i)})(n,e);if(t){const{props:i,content:r}=t,s={delay:100,...i,...e,toastId:e.toastId||n,updateId:LX()};s.toastId!==n&&(s.staleId=n);const o=s.render||r;delete s.render,yv(o,s)}},Fn.done=n=>{Fn.update(n,{progress:1})},Fn.onChange=function(n){return PP.add(n),()=>{PP.delete(n)}},Fn.play=n=>Uz(!0,n),Fn.pause=n=>Uz(!1,n);const Rxe=typeof window<"u"?se.useLayoutEffect:se.useEffect,w1=n=>{let{theme:e,type:t,isLoading:i,...r}=n;return Qt.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...r})},xC={info:function(n){return Qt.createElement(w1,{...n},Qt.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(n){return Qt.createElement(w1,{...n},Qt.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(n){return Qt.createElement(w1,{...n},Qt.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(n){return Qt.createElement(w1,{...n},Qt.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Qt.createElement("div",{className:"Toastify__spinner"})}},Pxe=n=>{const{isRunning:e,preventExitTransition:t,toastRef:i,eventHandlers:r,playToast:s}=Exe(n),{closeButton:o,children:a,autoClose:l,onClick:c,type:u,hideProgressBar:h,closeToast:d,transition:f,position:v,className:_,style:y,bodyClassName:m,bodyStyle:S,progressClassName:x,progressStyle:M,updateId:R,role:T,progress:P,rtl:I,toastId:b,deleteToast:w,isIn:N,isLoading:G,closeOnClick:V,theme:$}=n,Z=Go("Toastify__toast",`Toastify__toast-theme--${$}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":I},{"Toastify__toast--close-on-click":V}),X=Ds(_)?_({rtl:I,position:v,type:u,defaultClassName:Z}):Go(Z,_),re=function(le){let{theme:we,type:Ne,isLoading:q,icon:fe}=le,Te=null;const Se={theme:we,type:Ne};return fe===!1||(Ds(fe)?Te=fe({...Se,isLoading:q}):se.isValidElement(fe)?Te=se.cloneElement(fe,Se):q?Te=xC.spinner():($e=>$e in xC)(Ne)&&(Te=xC[Ne](Se))),Te}(n),O=!!P||!l,Q={closeToast:d,type:u,theme:$};let te=null;return o===!1||(te=Ds(o)?o(Q):se.isValidElement(o)?se.cloneElement(o,Q):function(le){let{closeToast:we,theme:Ne,ariaLabel:q="close"}=le;return Qt.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Ne}`,type:"button",onClick:fe=>{fe.stopPropagation(),we(fe)},"aria-label":q},Qt.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Qt.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(Q)),Qt.createElement(f,{isIn:N,done:w,position:v,preventExitTransition:t,nodeRef:i,playToast:s},Qt.createElement("div",{id:b,onClick:c,"data-in":N,className:X,...r,style:y,ref:i},Qt.createElement("div",{...N&&{role:T},className:Ds(m)?m({type:u}):Go("Toastify__toast-body",m),style:S},re!=null&&Qt.createElement("div",{className:Go("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!G})},re),Qt.createElement("div",null,a)),te,Qt.createElement(Txe,{...R&&!O?{key:`pb-${R}`}:{},rtl:I,theme:$,delay:l,isRunning:e,isIn:N,closeToast:d,hide:h,type:u,style:M,className:x,controlledProgress:O,progress:P||0})))},Pw=function(n,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${n}-enter`,exit:`Toastify--animate Toastify__${n}-exit`,appendPosition:e}},Ixe=Rw(Pw("bounce",!0));Rw(Pw("slide",!0));Rw(Pw("zoom"));Rw(Pw("flip"));const Lxe={position:"top-right",transition:Ixe,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Dxe(n){let e={...Lxe,...n};const t=n.stacked,[i,r]=se.useState(!0),s=se.useRef(null),{getToastToRender:o,isToastActive:a,count:l}=wxe(e),{className:c,style:u,rtl:h,containerId:d}=e;function f(_){const y=Go("Toastify__toast-container",`Toastify__toast-container--${_}`,{"Toastify__toast-container--rtl":h});return Ds(c)?c({position:_,rtl:h,defaultClassName:y}):Go(y,q1(c))}function v(){t&&(r(!0),Fn.play())}return Rxe(()=>{if(t){var _;const y=s.current.querySelectorAll('[data-in="true"]'),m=12,S=(_=e.position)==null?void 0:_.includes("top");let x=0,M=0;Array.from(y).reverse().forEach((R,T)=>{const P=R;P.classList.add("Toastify__toast--stacked"),T>0&&(P.dataset.collapsed=`${i}`),P.dataset.pos||(P.dataset.pos=S?"top":"bot");const I=x*(i?.2:1)+(i?0:m*T);P.style.setProperty("--y",`${S?I:-1*I}px`),P.style.setProperty("--g",`${m}`),P.style.setProperty("--s",""+(1-(i?M:0))),x+=P.offsetHeight,M+=.025})}},[i,l,t]),Qt.createElement("div",{ref:s,className:"Toastify",id:d,onMouseEnter:()=>{t&&(r(!1),Fn.pause())},onMouseLeave:v},o((_,y)=>{const m=y.length?{...u}:{...u,pointerEvents:"none"};return Qt.createElement("div",{className:f(_),style:m,key:`container-${_}`},y.map(S=>{let{content:x,props:M}=S;return Qt.createElement(Pxe,{...M,stacked:t,collapseAll:v,isIn:a(M.toastId,M.containerId),style:M.style,key:`toast-${M.key}`},x)}))}))}class Iw{constructor(e=0,t="Network Error"){this.status=e,this.text=t}}const Bxe=()=>{if(!(typeof localStorage>"u"))return{get:n=>Promise.resolve(localStorage.getItem(n)),set:(n,e)=>Promise.resolve(localStorage.setItem(n,e)),remove:n=>Promise.resolve(localStorage.removeItem(n))}},Nf={origin:"https://api.emailjs.com",blockHeadless:!1,storageProvider:Bxe()},Nxe=n=>n?typeof n=="string"?{publicKey:n}:n.toString()==="[object Object]"?n:{}:{},Uxe=async(n,e,t={})=>{const i=await fetch(Nf.origin+n,{method:"POST",headers:t,body:e}),r=await i.text(),s=new Iw(i.status,r);if(i.ok)return s;throw s},Fxe=(n,e,t)=>{if(!n||typeof n!="string")throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e||typeof e!="string")throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t||typeof t!="string")throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates"},Oxe=n=>{if(n&&n.toString()!=="[object Object]")throw"The template params have to be the object. Visit https://www.emailjs.com/docs/sdk/send/"},kxe=n=>n.webdriver||!n.languages||n.languages.length===0,zxe=()=>new Iw(451,"Unavailable For Headless Browser"),Gxe=(n,e)=>{if(!Array.isArray(n))throw"The BlockList list has to be an array";if(typeof e!="string")throw"The BlockList watchVariable has to be a string"},Hxe=n=>{var e;return!((e=n.list)!=null&&e.length)||!n.watchVariable},Vxe=(n,e)=>n instanceof FormData?n.get(e):n[e],Wxe=(n,e)=>{if(Hxe(n))return!1;Gxe(n.list,n.watchVariable);const t=Vxe(e,n.watchVariable);return typeof t!="string"?!1:n.list.includes(t)},$xe=()=>new Iw(403,"Forbidden"),Xxe=(n,e)=>{if(typeof n!="number"||n<0)throw"The LimitRate throttle has to be a positive number";if(e&&typeof e!="string")throw"The LimitRate ID has to be a non-empty string"},jxe=async(n,e,t)=>{const i=Number(await t.get(n)||0);return e-Date.now()+i},Yxe=async(n,e,t)=>{if(!e.throttle||!t)return!1;Xxe(e.throttle,e.id);const i=e.id||n;return await jxe(i,e.throttle,t)>0?!0:(await t.set(i,Date.now().toString()),!1)},Jxe=()=>new Iw(429,"Too Many Requests"),Kxe=async(n,e,t,i)=>{const r=Nxe(i),s=r.publicKey||Nf.publicKey,o=r.blockHeadless||Nf.blockHeadless,a=r.storageProvider||Nf.storageProvider,l={...Nf.blockList,...r.blockList},c={...Nf.limitRate,...r.limitRate};return o&&kxe(navigator)?Promise.reject(zxe()):(Fxe(s,n,e),Oxe(t),t&&Wxe(l,t)?Promise.reject($xe()):await Yxe(location.pathname,c,a)?Promise.reject(Jxe()):Uxe("/api/v1.0/email/send",JSON.stringify({lib_version:"4.4.1",user_id:s,service_id:n,template_id:e,template_params:t}),{"Content-type":"application/json"}))};var dn;(function(n){n.assertEqual=r=>r;function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},n.getValidEnumValues=r=>{const s=n.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),o={};for(const a of s)o[a]=r[a];return n.objectValues(o)},n.objectValues=r=>n.objectKeys(r).map(function(s){return r[s]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},n.find=(r,s)=>{for(const o of r)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=i,n.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(dn||(dn={}));var IP;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(IP||(IP={}));const yt=dn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pc=n=>{switch(typeof n){case"undefined":return yt.undefined;case"string":return yt.string;case"number":return isNaN(n)?yt.nan:yt.number;case"boolean":return yt.boolean;case"function":return yt.function;case"bigint":return yt.bigint;case"symbol":return yt.symbol;case"object":return Array.isArray(n)?yt.array:n===null?yt.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?yt.promise:typeof Map<"u"&&n instanceof Map?yt.map:typeof Set<"u"&&n instanceof Set?yt.set:typeof Date<"u"&&n instanceof Date?yt.date:yt.object;default:return yt.unknown}},rt=dn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),qxe=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Fs extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},i={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)i._errors.push(t(o));else{let a=i,l=0;for(;lt.message){const t={},i=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}Fs.create=n=>new Fs(n);const Kp=(n,e)=>{let t;switch(n.code){case rt.invalid_type:n.received===yt.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case rt.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,dn.jsonStringifyReplacer)}`;break;case rt.unrecognized_keys:t=`Unrecognized key(s) in object: ${dn.joinValues(n.keys,", ")}`;break;case rt.invalid_union:t="Invalid input";break;case rt.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${dn.joinValues(n.options)}`;break;case rt.invalid_enum_value:t=`Invalid enum value. Expected ${dn.joinValues(n.options)}, received '${n.received}'`;break;case rt.invalid_arguments:t="Invalid function arguments";break;case rt.invalid_return_type:t="Invalid function return type";break;case rt.invalid_date:t="Invalid date";break;case rt.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:dn.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case rt.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case rt.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case rt.custom:t="Invalid input";break;case rt.invalid_intersection_types:t="Intersection results could not be merged";break;case rt.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case rt.not_finite:t="Number must be finite";break;default:t=e.defaultError,dn.assertNever(n)}return{message:t}};let DX=Kp;function Zxe(n){DX=n}function XM(){return DX}const jM=n=>{const{data:e,path:t,errorMaps:i,issueData:r}=n,s=[...t,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const l=i.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:e,defaultError:a}).message;return{...r,path:s,message:a}},Qxe=[];function gt(n,e){const t=XM(),i=jM({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Kp?void 0:Kp].filter(r=>!!r)});n.common.issues.push(i)}class Ir{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const r of t){if(r.status==="aborted")return Ut;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const r of t){const s=await r.key,o=await r.value;i.push({key:s,value:o})}return Ir.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const r of t){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Ut;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}}const Ut=Object.freeze({status:"aborted"}),dp=n=>({status:"dirty",value:n}),Qr=n=>({status:"valid",value:n}),LP=n=>n.status==="aborted",DP=n=>n.status==="dirty",E0=n=>n.status==="valid",T0=n=>typeof Promise<"u"&&n instanceof Promise;function YM(n,e,t,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function BX(n,e,t,i,r){if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}var bt;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(bt||(bt={}));var zg,Gg;class Oa{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Fz=(n,e)=>{if(E0(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Fs(n.common.issues);return this._error=t,this._error}}};function Yt(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:r}=n;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,a)=>{var l,c;const{message:u}=n;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??i)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??t)!==null&&c!==void 0?c:a.defaultError}},description:r}}class en{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Pc(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Pc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ir,ctx:{common:e.parent.common,data:e.data,parsedType:Pc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(T0(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const r={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pc(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Fz(r,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pc(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(T0(r)?r:Promise.resolve(r));return Fz(i,s)}refine(e,t){const i=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{const o=e(r),a=()=>s.addIssue({code:rt.custom,...i(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof t=="function"?t(i,r):t),!1))}_refinement(e){return new qo({schema:this,typeName:Nt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ba.create(this,this._def)}nullable(){return iu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xo.create(this,this._def)}promise(){return Zp.create(this,this._def)}or(e){return P0.create([this,e],this._def)}and(e){return I0.create(this,e,this._def)}transform(e){return new qo({...Yt(this._def),schema:this,typeName:Nt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new U0({...Yt(this._def),innerType:this,defaultValue:t,typeName:Nt.ZodDefault})}brand(){return new AD({typeName:Nt.ZodBranded,type:this,...Yt(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new F0({...Yt(this._def),innerType:this,catchValue:t,typeName:Nt.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return yy.create(this,e)}readonly(){return O0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const e1e=/^c[^\s-]{8,}$/i,t1e=/^[0-9a-z]+$/,n1e=/^[0-9A-HJKMNP-TV-Z]{26}$/,i1e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,r1e=/^[a-z0-9_-]{21}$/i,s1e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,o1e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,a1e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let SC;const l1e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,c1e=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,u1e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,NX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",h1e=new RegExp(`^${NX}$`);function UX(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function d1e(n){return new RegExp(`^${UX(n)}$`)}function FX(n){let e=`${NX}T${UX(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function f1e(n,e){return!!((e==="v4"||!e)&&l1e.test(n)||(e==="v6"||!e)&&c1e.test(n))}class Ho extends en{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==yt.string){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_type,expected:yt.string,received:s.parsedType}),Ut}const i=new Ir;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.lengths.value&&(r=this._getOrReturnCtx(e,r),gt(r,{code:rt.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.lengthe.test(r),{validation:t,code:rt.invalid_string,...bt.errToObj(i)})}_addCheck(e){return new Ho({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...bt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...bt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...bt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...bt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...bt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...bt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...bt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...bt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...bt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...bt.errToObj(e)})}datetime(e){var t,i;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(i=e==null?void 0:e.local)!==null&&i!==void 0?i:!1,...bt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...bt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...bt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...bt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...bt.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...bt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...bt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...bt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...bt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...bt.errToObj(t)})}nonempty(e){return this.min(1,bt.errToObj(e))}trim(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ho({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new Ho({checks:[],typeName:Nt.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Yt(n)})};function p1e(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=t>i?t:i,s=parseInt(n.toFixed(r).replace(".","")),o=parseInt(e.toFixed(r).replace(".",""));return s%o/Math.pow(10,r)}class eu extends en{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==yt.number){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_type,expected:yt.number,received:s.parsedType}),Ut}let i;const r=new Ir;for(const s of this._def.checks)s.kind==="int"?dn.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?p1e(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.not_finite,message:s.message}),r.dirty()):dn.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,bt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,bt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,bt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,bt.toString(t))}setLimit(e,t,i,r){return new eu({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:bt.toString(r)}]})}_addCheck(e){return new eu({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:bt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:bt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:bt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:bt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:bt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:bt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:bt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:bt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:bt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&dn.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.valuenew eu({checks:[],typeName:Nt.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...Yt(n)});class tu extends en{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==yt.bigint){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_type,expected:yt.bigint,received:s.parsedType}),Ut}let i;const r=new Ir;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.datas.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),gt(i,{code:rt.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):dn.assertNever(s);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,bt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,bt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,bt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,bt.toString(t))}setLimit(e,t,i,r){return new tu({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:bt.toString(r)}]})}_addCheck(e){return new tu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:bt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:bt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:bt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:bt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:bt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new tu({checks:[],typeName:Nt.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...Yt(n)})};class b0 extends en{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==yt.boolean){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.boolean,received:i.parsedType}),Ut}return Qr(e.data)}}b0.create=n=>new b0({typeName:Nt.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...Yt(n)});class dd extends en{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==yt.date){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_type,expected:yt.date,received:s.parsedType}),Ut}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return gt(s,{code:rt.invalid_date}),Ut}const i=new Ir;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()s.value&&(r=this._getOrReturnCtx(e,r),gt(r,{code:rt.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):dn.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new dd({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:bt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:bt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew dd({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:Nt.ZodDate,...Yt(n)});class JM extends en{_parse(e){if(this._getType(e)!==yt.symbol){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.symbol,received:i.parsedType}),Ut}return Qr(e.data)}}JM.create=n=>new JM({typeName:Nt.ZodSymbol,...Yt(n)});class C0 extends en{_parse(e){if(this._getType(e)!==yt.undefined){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.undefined,received:i.parsedType}),Ut}return Qr(e.data)}}C0.create=n=>new C0({typeName:Nt.ZodUndefined,...Yt(n)});class R0 extends en{_parse(e){if(this._getType(e)!==yt.null){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.null,received:i.parsedType}),Ut}return Qr(e.data)}}R0.create=n=>new R0({typeName:Nt.ZodNull,...Yt(n)});class qp extends en{constructor(){super(...arguments),this._any=!0}_parse(e){return Qr(e.data)}}qp.create=n=>new qp({typeName:Nt.ZodAny,...Yt(n)});class Kh extends en{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Qr(e.data)}}Kh.create=n=>new Kh({typeName:Nt.ZodUnknown,...Yt(n)});class Gl extends en{_parse(e){const t=this._getOrReturnCtx(e);return gt(t,{code:rt.invalid_type,expected:yt.never,received:t.parsedType}),Ut}}Gl.create=n=>new Gl({typeName:Nt.ZodNever,...Yt(n)});class KM extends en{_parse(e){if(this._getType(e)!==yt.undefined){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.void,received:i.parsedType}),Ut}return Qr(e.data)}}KM.create=n=>new KM({typeName:Nt.ZodVoid,...Yt(n)});class Xo extends en{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),r=this._def;if(t.parsedType!==yt.array)return gt(t,{code:rt.invalid_type,expected:yt.array,received:t.parsedType}),Ut;if(r.exactLength!==null){const o=t.data.length>r.exactLength.value,a=t.data.lengthr.maxLength.value&&(gt(t,{code:rt.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>r.type._parseAsync(new Oa(t,o,t.path,a)))).then(o=>Ir.mergeArray(i,o));const s=[...t.data].map((o,a)=>r.type._parseSync(new Oa(t,o,t.path,a)));return Ir.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new Xo({...this._def,minLength:{value:e,message:bt.toString(t)}})}max(e,t){return new Xo({...this._def,maxLength:{value:e,message:bt.toString(t)}})}length(e,t){return new Xo({...this._def,exactLength:{value:e,message:bt.toString(t)}})}nonempty(e){return this.min(1,e)}}Xo.create=(n,e)=>new Xo({type:n,minLength:null,maxLength:null,exactLength:null,typeName:Nt.ZodArray,...Yt(e)});function Uf(n){if(n instanceof Qn){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=Ba.create(Uf(i))}return new Qn({...n._def,shape:()=>e})}else return n instanceof Xo?new Xo({...n._def,type:Uf(n.element)}):n instanceof Ba?Ba.create(Uf(n.unwrap())):n instanceof iu?iu.create(Uf(n.unwrap())):n instanceof ka?ka.create(n.items.map(e=>Uf(e))):n}class Qn extends en{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=dn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==yt.object){const c=this._getOrReturnCtx(e);return gt(c,{code:rt.invalid_type,expected:yt.object,received:c.parsedType}),Ut}const{status:i,ctx:r}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Gl&&this._def.unknownKeys==="strip"))for(const c in r.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=s[c],h=r.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Oa(r,h,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Gl){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(c==="strict")a.length>0&&(gt(r,{code:rt.unrecognized_keys,keys:a}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const h=r.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Oa(r,h,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const h=await u.key,d=await u.value;c.push({key:h,value:d,alwaysSet:u.alwaysSet})}return c}).then(c=>Ir.mergeObjectSync(i,c)):Ir.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return bt.errToObj,new Qn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var r,s,o,a;const l=(o=(s=(r=this._def).errorMap)===null||s===void 0?void 0:s.call(r,t,i).message)!==null&&o!==void 0?o:i.defaultError;return t.code==="unrecognized_keys"?{message:(a=bt.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Qn({...this._def,unknownKeys:"strip"})}passthrough(){return new Qn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Nt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Qn({...this._def,catchall:e})}pick(e){const t={};return dn.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new Qn({...this._def,shape:()=>t})}omit(e){const t={};return dn.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new Qn({...this._def,shape:()=>t})}deepPartial(){return Uf(this)}partial(e){const t={};return dn.objectKeys(this.shape).forEach(i=>{const r=this.shape[i];e&&!e[i]?t[i]=r:t[i]=r.optional()}),new Qn({...this._def,shape:()=>t})}required(e){const t={};return dn.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Ba;)s=s._def.innerType;t[i]=s}}),new Qn({...this._def,shape:()=>t})}keyof(){return OX(dn.objectKeys(this.shape))}}Qn.create=(n,e)=>new Qn({shape:()=>n,unknownKeys:"strip",catchall:Gl.create(),typeName:Nt.ZodObject,...Yt(e)});Qn.strictCreate=(n,e)=>new Qn({shape:()=>n,unknownKeys:"strict",catchall:Gl.create(),typeName:Nt.ZodObject,...Yt(e)});Qn.lazycreate=(n,e)=>new Qn({shape:n,unknownKeys:"strip",catchall:Gl.create(),typeName:Nt.ZodObject,...Yt(e)});class P0 extends en{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function r(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Fs(a.ctx.common.issues));return gt(t,{code:rt.invalid_union,unionErrors:o}),Ut}if(t.common.async)return Promise.all(i.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const l of i){const c={...t,common:{...t.common,issues:[]},parent:null},u=l._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Fs(l));return gt(t,{code:rt.invalid_union,unionErrors:a}),Ut}}get options(){return this._def.options}}P0.create=(n,e)=>new P0({options:n,typeName:Nt.ZodUnion,...Yt(e)});const ll=n=>n instanceof D0?ll(n.schema):n instanceof qo?ll(n.innerType()):n instanceof B0?[n.value]:n instanceof nu?n.options:n instanceof N0?dn.objectValues(n.enum):n instanceof U0?ll(n._def.innerType):n instanceof C0?[void 0]:n instanceof R0?[null]:n instanceof Ba?[void 0,...ll(n.unwrap())]:n instanceof iu?[null,...ll(n.unwrap())]:n instanceof AD||n instanceof O0?ll(n.unwrap()):n instanceof F0?ll(n._def.innerType):[];class Lw extends en{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yt.object)return gt(t,{code:rt.invalid_type,expected:yt.object,received:t.parsedType}),Ut;const i=this.discriminator,r=t.data[i],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(gt(t,{code:rt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ut)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const r=new Map;for(const s of t){const o=ll(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,s)}}return new Lw({typeName:Nt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Yt(i)})}}function BP(n,e){const t=Pc(n),i=Pc(e);if(n===e)return{valid:!0,data:n};if(t===yt.object&&i===yt.object){const r=dn.objectKeys(e),s=dn.objectKeys(n).filter(a=>r.indexOf(a)!==-1),o={...n,...e};for(const a of s){const l=BP(n[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(t===yt.array&&i===yt.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let s=0;s{if(LP(s)||LP(o))return Ut;const a=BP(s.value,o.value);return a.valid?((DP(s)||DP(o))&&t.dirty(),{status:t.value,value:a.data}):(gt(i,{code:rt.invalid_intersection_types}),Ut)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}I0.create=(n,e,t)=>new I0({left:n,right:e,typeName:Nt.ZodIntersection,...Yt(t)});class ka extends en{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==yt.array)return gt(i,{code:rt.invalid_type,expected:yt.array,received:i.parsedType}),Ut;if(i.data.lengththis._def.items.length&&(gt(i,{code:rt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...i.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Oa(i,o,i.path,a)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Ir.mergeArray(t,o)):Ir.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ka({...this._def,rest:e})}}ka.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ka({items:n,typeName:Nt.ZodTuple,rest:null,...Yt(e)})};class L0 extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==yt.object)return gt(i,{code:rt.invalid_type,expected:yt.object,received:i.parsedType}),Ut;const r=[],s=this._def.keyType,o=this._def.valueType;for(const a in i.data)r.push({key:s._parse(new Oa(i,a,i.path,a)),value:o._parse(new Oa(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?Ir.mergeObjectAsync(t,r):Ir.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,i){return t instanceof en?new L0({keyType:e,valueType:t,typeName:Nt.ZodRecord,...Yt(i)}):new L0({keyType:Ho.create(),valueType:e,typeName:Nt.ZodRecord,...Yt(t)})}}class qM extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==yt.map)return gt(i,{code:rt.invalid_type,expected:yt.map,received:i.parsedType}),Ut;const r=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([a,l],c)=>({key:r._parse(new Oa(i,a,i.path,[c,"key"])),value:s._parse(new Oa(i,l,i.path,[c,"value"]))}));if(i.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ut;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(c.value,u.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Ut;(c.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(c.value,u.value)}return{status:t.value,value:a}}}}qM.create=(n,e,t)=>new qM({valueType:e,keyType:n,typeName:Nt.ZodMap,...Yt(t)});class fd extends en{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==yt.set)return gt(i,{code:rt.invalid_type,expected:yt.set,received:i.parsedType}),Ut;const r=this._def;r.minSize!==null&&i.data.sizer.maxSize.value&&(gt(i,{code:rt.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Ut;u.status==="dirty"&&t.dirty(),c.add(u.value)}return{status:t.value,value:c}}const a=[...i.data.values()].map((l,c)=>s._parse(new Oa(i,l,i.path,c)));return i.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,t){return new fd({...this._def,minSize:{value:e,message:bt.toString(t)}})}max(e,t){return new fd({...this._def,maxSize:{value:e,message:bt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}fd.create=(n,e)=>new fd({valueType:n,minSize:null,maxSize:null,typeName:Nt.ZodSet,...Yt(e)});class Ep extends en{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yt.function)return gt(t,{code:rt.invalid_type,expected:yt.function,received:t.parsedType}),Ut;function i(a,l){return jM({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,XM(),Kp].filter(c=>!!c),issueData:{code:rt.invalid_arguments,argumentsError:l}})}function r(a,l){return jM({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,XM(),Kp].filter(c=>!!c),issueData:{code:rt.invalid_return_type,returnTypeError:l}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Zp){const a=this;return Qr(async function(...l){const c=new Fs([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(i(l,f)),c}),h=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(h,s).catch(f=>{throw c.addIssue(r(h,f)),c})})}else{const a=this;return Qr(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new Fs([i(l,c.error)]);const u=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(u,s);if(!h.success)throw new Fs([r(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ep({...this._def,args:ka.create(e).rest(Kh.create())})}returns(e){return new Ep({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new Ep({args:e||ka.create([]).rest(Kh.create()),returns:t||Kh.create(),typeName:Nt.ZodFunction,...Yt(i)})}}class D0 extends en{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}D0.create=(n,e)=>new D0({getter:n,typeName:Nt.ZodLazy,...Yt(e)});class B0 extends en{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return gt(t,{received:t.data,code:rt.invalid_literal,expected:this._def.value}),Ut}return{status:"valid",value:e.data}}get value(){return this._def.value}}B0.create=(n,e)=>new B0({value:n,typeName:Nt.ZodLiteral,...Yt(e)});function OX(n,e){return new nu({values:n,typeName:Nt.ZodEnum,...Yt(e)})}class nu extends en{constructor(){super(...arguments),zg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return gt(t,{expected:dn.joinValues(i),received:t.parsedType,code:rt.invalid_type}),Ut}if(YM(this,zg)||BX(this,zg,new Set(this._def.values)),!YM(this,zg).has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return gt(t,{received:t.data,code:rt.invalid_enum_value,options:i}),Ut}return Qr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return nu.create(e,{...this._def,...t})}exclude(e,t=this._def){return nu.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}zg=new WeakMap;nu.create=OX;class N0 extends en{constructor(){super(...arguments),Gg.set(this,void 0)}_parse(e){const t=dn.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==yt.string&&i.parsedType!==yt.number){const r=dn.objectValues(t);return gt(i,{expected:dn.joinValues(r),received:i.parsedType,code:rt.invalid_type}),Ut}if(YM(this,Gg)||BX(this,Gg,new Set(dn.getValidEnumValues(this._def.values))),!YM(this,Gg).has(e.data)){const r=dn.objectValues(t);return gt(i,{received:i.data,code:rt.invalid_enum_value,options:r}),Ut}return Qr(e.data)}get enum(){return this._def.values}}Gg=new WeakMap;N0.create=(n,e)=>new N0({values:n,typeName:Nt.ZodNativeEnum,...Yt(e)});class Zp extends en{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==yt.promise&&t.common.async===!1)return gt(t,{code:rt.invalid_type,expected:yt.promise,received:t.parsedType}),Ut;const i=t.parsedType===yt.promise?t.data:Promise.resolve(t.data);return Qr(i.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Zp.create=(n,e)=>new Zp({type:n,typeName:Nt.ZodPromise,...Yt(e)});class qo extends en{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Nt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:o=>{gt(i,o),o.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return Ut;const l=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return l.status==="aborted"?Ut:l.status==="dirty"||t.value==="dirty"?dp(l.value):l});{if(t.value==="aborted")return Ut;const a=this._def.schema._parseSync({data:o,path:i.path,parent:i});return a.status==="aborted"?Ut:a.status==="dirty"||t.value==="dirty"?dp(a.value):a}}if(r.type==="refinement"){const o=a=>{const l=r.refinement(a,s);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){const a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?Ut:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?Ut:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!E0(o))return o;const a=r.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>E0(o)?Promise.resolve(r.transform(o.value,s)).then(a=>({status:t.value,value:a})):o);dn.assertNever(r)}}qo.create=(n,e,t)=>new qo({schema:n,typeName:Nt.ZodEffects,effect:e,...Yt(t)});qo.createWithPreprocess=(n,e,t)=>new qo({schema:e,effect:{type:"preprocess",transform:n},typeName:Nt.ZodEffects,...Yt(t)});class Ba extends en{_parse(e){return this._getType(e)===yt.undefined?Qr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ba.create=(n,e)=>new Ba({innerType:n,typeName:Nt.ZodOptional,...Yt(e)});class iu extends en{_parse(e){return this._getType(e)===yt.null?Qr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}iu.create=(n,e)=>new iu({innerType:n,typeName:Nt.ZodNullable,...Yt(e)});class U0 extends en{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===yt.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}U0.create=(n,e)=>new U0({innerType:n,typeName:Nt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Yt(e)});class F0 extends en{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return T0(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Fs(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Fs(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}F0.create=(n,e)=>new F0({innerType:n,typeName:Nt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Yt(e)});class ZM extends en{_parse(e){if(this._getType(e)!==yt.nan){const i=this._getOrReturnCtx(e);return gt(i,{code:rt.invalid_type,expected:yt.nan,received:i.parsedType}),Ut}return{status:"valid",value:e.data}}}ZM.create=n=>new ZM({typeName:Nt.ZodNaN,...Yt(n)});const m1e=Symbol("zod_brand");class AD extends en{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class yy extends en{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ut:s.status==="dirty"?(t.dirty(),dp(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Ut:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,t){return new yy({in:e,out:t,typeName:Nt.ZodPipeline})}}class O0 extends en{_parse(e){const t=this._def.innerType._parse(e),i=r=>(E0(r)&&(r.value=Object.freeze(r.value)),r);return T0(t)?t.then(r=>i(r)):i(t)}unwrap(){return this._def.innerType}}O0.create=(n,e)=>new O0({innerType:n,typeName:Nt.ZodReadonly,...Yt(e)});function kX(n,e={},t){return n?qp.create().superRefine((i,r)=>{var s,o;if(!n(i)){const a=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,l=(o=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;r.addIssue({code:"custom",...c,fatal:l})}}):qp.create()}const g1e={object:Qn.lazycreate};var Nt;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(Nt||(Nt={}));const v1e=(n,e={message:`Input not instance of ${n.name}`})=>kX(t=>t instanceof n,e),zX=Ho.create,GX=eu.create,y1e=ZM.create,_1e=tu.create,HX=b0.create,x1e=dd.create,S1e=JM.create,M1e=C0.create,A1e=R0.create,w1e=qp.create,E1e=Kh.create,T1e=Gl.create,b1e=KM.create,C1e=Xo.create,R1e=Qn.create,P1e=Qn.strictCreate,I1e=P0.create,L1e=Lw.create,D1e=I0.create,B1e=ka.create,N1e=L0.create,U1e=qM.create,F1e=fd.create,O1e=Ep.create,k1e=D0.create,z1e=B0.create,G1e=nu.create,H1e=N0.create,V1e=Zp.create,Oz=qo.create,W1e=Ba.create,$1e=iu.create,X1e=qo.createWithPreprocess,j1e=yy.create,Y1e=()=>zX().optional(),J1e=()=>GX().optional(),K1e=()=>HX().optional(),q1e={string:n=>Ho.create({...n,coerce:!0}),number:n=>eu.create({...n,coerce:!0}),boolean:n=>b0.create({...n,coerce:!0}),bigint:n=>tu.create({...n,coerce:!0}),date:n=>dd.create({...n,coerce:!0})},Z1e=Ut;var E1=Object.freeze({__proto__:null,defaultErrorMap:Kp,setErrorMap:Zxe,getErrorMap:XM,makeIssue:jM,EMPTY_PATH:Qxe,addIssueToContext:gt,ParseStatus:Ir,INVALID:Ut,DIRTY:dp,OK:Qr,isAborted:LP,isDirty:DP,isValid:E0,isAsync:T0,get util(){return dn},get objectUtil(){return IP},ZodParsedType:yt,getParsedType:Pc,ZodType:en,datetimeRegex:FX,ZodString:Ho,ZodNumber:eu,ZodBigInt:tu,ZodBoolean:b0,ZodDate:dd,ZodSymbol:JM,ZodUndefined:C0,ZodNull:R0,ZodAny:qp,ZodUnknown:Kh,ZodNever:Gl,ZodVoid:KM,ZodArray:Xo,ZodObject:Qn,ZodUnion:P0,ZodDiscriminatedUnion:Lw,ZodIntersection:I0,ZodTuple:ka,ZodRecord:L0,ZodMap:qM,ZodSet:fd,ZodFunction:Ep,ZodLazy:D0,ZodLiteral:B0,ZodEnum:nu,ZodNativeEnum:N0,ZodPromise:Zp,ZodEffects:qo,ZodTransformer:qo,ZodOptional:Ba,ZodNullable:iu,ZodDefault:U0,ZodCatch:F0,ZodNaN:ZM,BRAND:m1e,ZodBranded:AD,ZodPipeline:yy,ZodReadonly:O0,custom:kX,Schema:en,ZodSchema:en,late:g1e,get ZodFirstPartyTypeKind(){return Nt},coerce:q1e,any:w1e,array:C1e,bigint:_1e,boolean:HX,date:x1e,discriminatedUnion:L1e,effect:Oz,enum:G1e,function:O1e,instanceof:v1e,intersection:D1e,lazy:k1e,literal:z1e,map:U1e,nan:y1e,nativeEnum:H1e,never:T1e,null:A1e,nullable:$1e,number:GX,object:R1e,oboolean:K1e,onumber:J1e,optional:W1e,ostring:Y1e,pipeline:j1e,preprocess:X1e,promise:V1e,record:N1e,set:F1e,strictObject:P1e,string:zX,symbol:S1e,transformer:Oz,tuple:B1e,undefined:M1e,union:I1e,unknown:E1e,void:b1e,NEVER:Z1e,ZodIssueCode:rt,quotelessJson:qxe,ZodError:Fs});const Q1e=wH.form` bg-[#233554] p-3 w-[350px] @@ -7976,15 +7976,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho gap-4 text-white focus:outline-none -`;function K1e(){const[n,e]=se.useState(!1),[t,i]=se.useState(null),[r,s]=se.useState({name:"",email:"",message:""}),o=T1.object({name:T1.string().min(2,{message:"Name is too short! must contain at least 2 character(s)"}),email:T1.string().email({message:"Invalid email!"}),message:T1.string().min(10,{message:"Message is too short! must contain at least 10 character(s)"})}),a=u=>{const{target:h}=u,{name:d,value:f}=h;s({...r,[d]:f})},l=()=>{i(null),e(!0);const u=o.safeParse(r);if(!u.success){i(u.error),e(!1);return}Xxe("service_8wr47cj","template_vx3y50z",{from_name:r.name,to_name:"Niv Shtibel",from_email:r.email,to_email:"sujata@jsmastery.pro",message:r.message},"7AsLir4APmIG9WcFz").then(()=>{e(!1),Fn.success("Thank you. I will get back to you as soon as possible."),s({name:"",email:"",message:""})},h=>{e(!1),Fn.error("Ahh, something went wrong. Please try again."),console.error(h)})},c=u=>{window.open(u,"_blank")};return pe.jsxs(J1e,{children:[pe.jsx("label",{className:"flex flex-col",children:pe.jsx("input",{type:"text",name:"name",value:r.name,onChange:u=>{a(u)},placeholder:"Name",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})}),pe.jsx("label",{className:"flex flex-col",children:pe.jsx("input",{type:"email",name:"email",value:r.email,onChange:u=>{a(u)},placeholder:"Email",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})}),pe.jsx("label",{className:"flex flex-col",children:pe.jsx("textarea",{rows:7,name:"message",value:r.message,onChange:u=>{a(u)},placeholder:"Message",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})}),pe.jsxs("div",{className:"flex justify-between",children:[pe.jsx("div",{className:"flex gap-3 justify-center items-center",children:G2.map((u,h)=>pe.jsx("div",{onClick:()=>c(u.url),onKeyDown:()=>c(u.url),role:"button",tabIndex:h,title:u.name,className:"group hover:translate-y-[-4px] transition-all duration-400",children:pe.jsx(u.icon,{size:25,className:"fill-primary group-hover:fill-callToAction"})},h))}),pe.jsx(AR,{onClick:l,children:n?"Sending...":"Send"})]}),t&&pe.jsx("div",{className:"text-red-600",children:t.issues[0].message})]})}const q1e=()=>pe.jsxs("div",{className:"relative z-0",children:[pe.jsxs("section",{id:"contact",className:"container mt-44 mx-auto flex xl:flex-row flex-col-reverse gap-10 overflow-hidden",children:[pe.jsxs(vo.div,{initial:"hidden",whileInView:"show",variants:kR({direction:"left",type:"tween",delay:.2,duration:1}),className:"flex-[0.75] bg-black-100 p-8 rounded-2xl",children:[pe.jsx("p",{className:"text-white font-black md:text-[60px] sm:text-[50px] xs:text-[40px] text-[30px] mb-6",children:"Contact me"}),pe.jsx(K1e,{})]}),pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:kR({direction:"right",type:"tween",delay:.2,duration:1}),className:"xl:flex-1 xl:h-auto md:h-[550px] h-[350px]",children:pe.jsx(G_e,{})})]}),pe.jsx(vxe,{})]}),Z1e=""+new URL("oversight-BfXmDlUF.png",import.meta.url).href,Q1e=""+new URL("checkpoint-BjSZZGEo.png",import.meta.url).href,eSe=""+new URL("magshimim-BzYRKfWn.png",import.meta.url).href,tSe=[{title:"National Cyber Education Program",company_name:"Magshmim",icon:eSe,iconBgColor:"#f0f0f0",date:"Nov 2015 - Nov 2018",points:["Taught various programming languages, including the basics of different data structures, recursion, complexity, code conventions, client-server configuration, sockets, TCP/UDP, DNS, OSI model, encryption methods, dynamic memory, pointers, and assembly.","Provided a comprehensive curriculum that covered both fundamental and advanced topics in programming.","Encouraged hands-on learning and provided practical exercises and projects to reinforce learning.","Encouraged collaboration and teamwork among students to foster a supportive and engaging learning environment.","Emphasized the importance of good coding practices and conventions to ensure code quality and maintainability."]},{title:"Automation Developer",company_name:"Check Point Software Technologies",icon:Q1e,iconBgColor:"#f0f0f0",date:"Jul 2020 - Mar 2021",points:["Developed a C++ program to detect failures in industrial machinery before errors occurred, such as software compatibility issues from OS updates, reducing technical assistance, and improving equipment availability for employees by 15%.","Facilitated the maintenance of high-quality standards for automation tools and software through Azure Event Hubs and Log Analytics for bug detection in adherence to best practices, resulting in a 40% reduction in code issues.","Constructed team goals through requirements gathering, short-term and long-term planning, project management, and mentorship in collaboration with others, resulting in a more cohesive and productive team environment."]},{title:"Fullstack Developer",company_name:"Oversight (SenseApps)",icon:Z1e,iconBgColor:"#f0f0f0",date:"Mar 2021 - Present",points:["Developed an e-commerce management web application targeted at shop owners providing detailed and comprehensive tools such as full dashboard analytics, and a configurable WhatsApp chatbot using Node.js (Nest.js) and React.js.","Containerized services for automated deployment using Docker and integrated Jenkins, resulting in a 30% improvement in software reliability and faster deployment while enabling a scalable host architecture","Spearheaded the development of a new codebase architecture, implementing best practices around variable and function naming, DRY principle and comments, reducing employee onboarding time, and improving overall code readability.","Directed team-wide unit testing for the frontend and backend, increasing code coverage and confidence in code changes, leading to a 25% decrease in regression bugs and reduced time spent on manual testing.","Led an effort to rewrite the codebase with an opinionated framework, NestJS, increasing development velocity across multiple departments and system maintenance through a modular architecture with lightweight microservices.","Implemented Kafka as an internal messaging system, boosting data handling and communication efficiency, resulting in a 30% improved processing speed and increased customer satisfaction."]}];var Nw={},kX={exports:{}};/*! +`;function eSe(){const[n,e]=se.useState(!1),[t,i]=se.useState(null),[r,s]=se.useState({name:"",email:"",message:""}),o=E1.object({name:E1.string().min(2,{message:"Name is too short! must contain at least 2 character(s)"}),email:E1.string().email({message:"Invalid email!"}),message:E1.string().min(10,{message:"Message is too short! must contain at least 10 character(s)"})}),a=u=>{const{target:h}=u,{name:d,value:f}=h;s({...r,[d]:f})},l=()=>{i(null),e(!0);const u=o.safeParse(r);if(!u.success){i(u.error),e(!1);return}Kxe("service_8wr47cj","template_vx3y50z",{from_name:r.name,to_name:"Niv Shtibel",from_email:r.email,to_email:"sujata@jsmastery.pro",message:r.message},"7AsLir4APmIG9WcFz").then(()=>{e(!1),Fn.success("Thank you. I will get back to you as soon as possible."),s({name:"",email:"",message:""})},h=>{e(!1),Fn.error("Ahh, something went wrong. Please try again."),console.error(h)})},c=u=>{window.open(u,"_blank")};return pe.jsxs(Q1e,{children:[pe.jsx("label",{className:"flex flex-col",children:pe.jsx("input",{type:"text",name:"name",value:r.name,onChange:u=>{a(u)},placeholder:"Name",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})}),pe.jsx("label",{className:"flex flex-col",children:pe.jsx("input",{type:"email",name:"email",value:r.email,onChange:u=>{a(u)},placeholder:"Email",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})}),pe.jsx("label",{className:"flex flex-col",children:pe.jsx("textarea",{rows:7,name:"message",value:r.message,onChange:u=>{a(u)},placeholder:"Message",className:"bg-tertiary py-4 px-6 placeholder:text-secondary text-black rounded-lg outline-none border-none font-medium"})}),pe.jsxs("div",{className:"flex justify-between",children:[pe.jsx("div",{className:"flex gap-3 justify-center items-center",children:z2.map((u,h)=>pe.jsx("div",{onClick:()=>c(u.url),onKeyDown:()=>c(u.url),role:"button",tabIndex:h,title:u.name,className:"group hover:translate-y-[-4px] transition-all duration-400",children:pe.jsx(u.icon,{size:25,className:"fill-primary group-hover:fill-callToAction"})},h))}),pe.jsx(SR,{onClick:l,children:n?"Sending...":"Send"})]}),t&&pe.jsx("div",{className:"text-red-600",children:t.issues[0].message})]})}const tSe=()=>pe.jsxs("div",{className:"relative z-0",children:[pe.jsxs("section",{id:"contact",className:"container mt-44 mx-auto flex xl:flex-row flex-col-reverse gap-10 overflow-hidden",children:[pe.jsxs(vo.div,{initial:"hidden",whileInView:"show",variants:OR({direction:"left",type:"tween",delay:.2,duration:1}),className:"flex-[0.75] bg-black-100 p-8 rounded-2xl",children:[pe.jsx("p",{className:"text-white font-black md:text-[60px] sm:text-[50px] xs:text-[40px] text-[30px] mb-6",children:"Contact me"}),pe.jsx(eSe,{})]}),pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:OR({direction:"right",type:"tween",delay:.2,duration:1}),className:"xl:flex-1 xl:h-auto md:h-[550px] h-[350px]",children:pe.jsx($_e,{})})]}),pe.jsx(Sxe,{})]}),nSe=""+new URL("oversight-BfXmDlUF.png",import.meta.url).href,iSe=""+new URL("checkpoint-BjSZZGEo.png",import.meta.url).href,rSe=""+new URL("magshimim-BzYRKfWn.png",import.meta.url).href,sSe=[{title:"National Cyber Education Program",company_name:"Magshmim",icon:rSe,iconBgColor:"#f0f0f0",date:"Nov 2015 - Nov 2018",points:["Taught various programming languages, including the basics of different data structures, recursion, complexity, code conventions, client-server configuration, sockets, TCP/UDP, DNS, OSI model, encryption methods, dynamic memory, pointers, and assembly.","Provided a comprehensive curriculum that covered both fundamental and advanced topics in programming.","Encouraged hands-on learning and provided practical exercises and projects to reinforce learning.","Encouraged collaboration and teamwork among students to foster a supportive and engaging learning environment.","Emphasized the importance of good coding practices and conventions to ensure code quality and maintainability."]},{title:"Automation Developer",company_name:"Check Point Software Technologies",icon:iSe,iconBgColor:"#f0f0f0",date:"Jul 2020 - Mar 2021",points:["Developed a C++ program to detect failures in industrial machinery before errors occurred, such as software compatibility issues from OS updates, reducing technical assistance, and improving equipment availability for employees by 15%.","Facilitated the maintenance of high-quality standards for automation tools and software through Azure Event Hubs and Log Analytics for bug detection in adherence to best practices, resulting in a 40% reduction in code issues.","Constructed team goals through requirements gathering, short-term and long-term planning, project management, and mentorship in collaboration with others, resulting in a more cohesive and productive team environment."]},{title:"Fullstack Developer",company_name:"Oversight (SenseApps)",icon:nSe,iconBgColor:"#f0f0f0",date:"Mar 2021 - Present",points:["Developed an e-commerce management web application targeted at shop owners providing detailed and comprehensive tools such as full dashboard analytics, and a configurable WhatsApp chatbot using Node.js (Nest.js) and React.js.","Containerized services for automated deployment using Docker and integrated Jenkins, resulting in a 30% improvement in software reliability and faster deployment while enabling a scalable host architecture","Spearheaded the development of a new codebase architecture, implementing best practices around variable and function naming, DRY principle and comments, reducing employee onboarding time, and improving overall code readability.","Directed team-wide unit testing for the frontend and backend, increasing code coverage and confidence in code changes, leading to a 25% decrease in regression bugs and reduced time spent on manual testing.","Led an effort to rewrite the codebase with an opinionated framework, NestJS, increasing development velocity across multiple departments and system maintenance through a modular architecture with lightweight microservices.","Implemented Kafka as an internal messaging system, boosting data handling and communication efficiency, resulting in a 30% improved processing speed and increased customer satisfaction."]}];var Dw={},VX={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",i),nSe.default.createElement("div",{className:(0,iSe.default)(e,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":t==="2-columns","vertical-timeline--one-column-left":t==="1-column"||t==="1-column-left","vertical-timeline--one-column-right":t==="1-column-right"})},r));GX.propTypes={children:xc.default.oneOfType([xc.default.arrayOf(xc.default.node),xc.default.node]).isRequired,className:xc.default.string,animate:xc.default.bool,layout:xc.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:xc.default.string};var rSe=GX;Nw.default=rSe;var Uw={};function UP(){return UP=Object.assign||function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}var OP=new Map,b1=new WeakMap,Uz=0,HX=void 0;function aSe(n){HX=n}function lSe(n){return n?(b1.has(n)||(Uz+=1,b1.set(n,Uz.toString())),b1.get(n)):"0"}function cSe(n){return Object.keys(n).sort().filter(function(e){return n[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?lSe(n.root):n[e])}).toString()}function uSe(n){var e=cSe(n),t=OP.get(e);if(!t){var i=new Map,r,s=new IntersectionObserver(function(o){o.forEach(function(a){var l,c=a.isIntersecting&&r.some(function(u){return a.intersectionRatio>=u});n.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=c),(l=i.get(a.target))==null||l.forEach(function(u){u(c,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},OP.set(e,t)}return t}function MD(n,e,t,i){if(t===void 0&&(t={}),i===void 0&&(i=HX),typeof window.IntersectionObserver>"u"&&i!==void 0){var r=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=uSe(t),o=s.id,a=s.observer,l=s.elements,c=l.get(n)||[];return l.has(n)||l.set(n,c),c.push(e),a.observe(n),function(){c.splice(c.indexOf(e),1),c.length===0&&(l.delete(n),a.unobserve(n)),l.size===0&&(a.disconnect(),OP.delete(o))}}var hSe=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function Fz(n){return typeof n.children!="function"}var QM=function(n){sSe(e,n);function e(i){var r;return r=n.call(this,i)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,o){s&&r.props.triggerOnce&&r.unobserve(),Fz(r.props)||r.setState({inView:s,entry:o}),r.props.onChange&&r.props.onChange(s,o)},r.state={inView:!!i.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,o=r.root,a=r.rootMargin,l=r.trackVisibility,c=r.delay,u=r.fallbackInView;this._unobserveCb=MD(this.node,this.handleChange,{threshold:s,root:o,rootMargin:a,trackVisibility:l,delay:c},u)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!Fz(this.props)){var r=this.state,s=r.inView,o=r.entry;return this.props.children({inView:s,entry:o,ref:this.handleNode})}var a=this.props,l=a.children,c=a.as,u=oSe(a,hSe);return se.createElement(c||"div",UP({ref:this.handleNode},u),l)},e}(se.Component);QM.displayName="InView";QM.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function dSe(n){var e=n===void 0?{}:n,t=e.threshold,i=e.delay,r=e.trackVisibility,s=e.rootMargin,o=e.root,a=e.triggerOnce,l=e.skip,c=e.initialInView,u=e.fallbackInView,h=se.useRef(),d=se.useState({inView:!!c}),f=d[0],v=d[1],_=se.useCallback(function(m){h.current!==void 0&&(h.current(),h.current=void 0),!l&&m&&(h.current=MD(m,function(S,x){v({inView:S,entry:x}),x.isIntersecting&&a&&h.current&&(h.current(),h.current=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:r,delay:i},u))},[Array.isArray(t)?t.toString():t,o,s,a,l,r,u,i]);se.useEffect(function(){!h.current&&f.entry&&!a&&!l&&v({inView:!!c})});var y=[_,f.inView,f.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}const fSe=Object.freeze(Object.defineProperty({__proto__:null,InView:QM,default:QM,defaultFallbackInView:aSe,observe:MD,useInView:dSe},Symbol.toStringTag,{value:"Module"})),pSe=sj(fSe);Uw.__esModule=!0;Uw.default=void 0;var Sc=AD(se),Kn=AD(C$),C1=AD(zX),mSe=pSe;function AD(n){return n&&n.__esModule?n:{default:n}}const VX=({children:n="",className:e="",contentArrowStyle:t=null,contentStyle:i=null,date:r="",dateClassName:s="",icon:o=null,iconClassName:a="",iconOnClick:l=null,onTimelineElementClick:c=null,iconStyle:u=null,id:h="",position:d="",style:f=null,textClassName:v="",intersectionObserverProps:_={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:y=!1})=>Sc.default.createElement(mSe.InView,_,({inView:m,ref:S})=>Sc.default.createElement("div",{ref:S,id:h,className:(0,C1.default)(e,"vertical-timeline-element",{"vertical-timeline-element--left":d==="left","vertical-timeline-element--right":d==="right","vertical-timeline-element--no-children":n===""}),style:f},Sc.default.createElement(Sc.default.Fragment,null,Sc.default.createElement("span",{style:u,onClick:l,className:(0,C1.default)(a,"vertical-timeline-element-icon",{"bounce-in":m||y,"is-hidden":!(m||y)})},o),Sc.default.createElement("div",{style:i,onClick:c,className:(0,C1.default)(v,"vertical-timeline-element-content",{"bounce-in":m||y,"is-hidden":!(m||y)})},Sc.default.createElement("div",{style:t,className:"vertical-timeline-element-content-arrow"}),n,Sc.default.createElement("span",{className:(0,C1.default)(s,"vertical-timeline-element-date")},r)))));VX.propTypes={children:Kn.default.oneOfType([Kn.default.arrayOf(Kn.default.node),Kn.default.node]),className:Kn.default.string,contentArrowStyle:Kn.default.shape({}),contentStyle:Kn.default.shape({}),date:Kn.default.node,dateClassName:Kn.default.string,icon:Kn.default.element,iconClassName:Kn.default.string,iconStyle:Kn.default.shape({}),iconOnClick:Kn.default.func,onTimelineElementClick:Kn.default.func,id:Kn.default.string,position:Kn.default.string,style:Kn.default.shape({}),textClassName:Kn.default.string,visible:Kn.default.bool,intersectionObserverProps:Kn.default.shape({root:Kn.default.object,rootMargin:Kn.default.string,threshold:Kn.default.number,triggerOnce:Kn.default.bool})};var gSe=VX;Uw.default=gSe;var WX={VerticalTimeline:Nw.default,VerticalTimelineElement:Uw.default};const vSe=n=>pe.jsxs(WX.VerticalTimelineElement,{contentStyle:{background:"#112240",color:"#fff",boxShadow:"0 10px 30px -10px rgb(2 12 27 / 70%)"},contentArrowStyle:{borderRight:"7px solid #112240"},date:n.experience.date,iconStyle:{background:n.experience.iconBgColor},icon:pe.jsx("div",{className:"flex justify-center items-center w-full h-full",children:pe.jsx("img",{src:n.experience.icon,alt:n.experience.company_name,className:"w-[90%] h-[90%] object-contain"})}),children:[pe.jsxs("div",{children:[pe.jsx("h3",{className:"text-white text-[24px] font-bold",children:n.experience.title}),pe.jsx("p",{className:"text-secondary text-[16px] font-semibold",style:{margin:0},children:n.experience.company_name})]}),pe.jsx("ul",{className:"mt-5 list-disc ml-5 space-y-2",children:n.experience.points.map((e,t)=>pe.jsx("li",{className:"text-secondary text-[14px] pl-1 tracking-wider",children:e},`experience-point-${t}`))})]}),ySe=()=>pe.jsxs("section",{id:"work",className:"container mt-44 mx-auto",children:[pe.jsxs(vo.div,{initial:"hidden",whileInView:"show",variants:TA(null),className:"flex flex-col gap-2 items-center",children:[pe.jsx("p",{className:"text-primary text-3xl uppercase",children:"What i have done so far"}),pe.jsx("h1",{className:"text-secondary text-4xl sm:text-7xl font-bold",children:"Work Experience."})]}),pe.jsx("div",{className:"mt-20 flex flex-col",children:pe.jsx(WX.VerticalTimeline,{children:tSe.slice(0).reverse().map((n,e)=>pe.jsx(vSe,{experience:n},`experience-${e}`))})})]}),_Se=n=>{const e=gy("./desktop_pc/scene.gltf");return pe.jsxs("mesh",{children:[pe.jsx("hemisphereLight",{intensity:.15,groundColor:"black"}),pe.jsx("spotLight",{position:[-20,50,10],angle:.12,penumbra:1,intensity:1,castShadow:!0,"shadow-mapSize":1024}),pe.jsx("directionalLight",{position:[5,5,5],intensity:4}),pe.jsx("primitive",{object:e.scene,scale:n.isMobile?.7:.75,position:n.isMobile?[0,-2.5,-2.2]:[0,-3.25,-1.5],rotation:[-.01,-.2,-.1]})]})},xSe=()=>{const[n,e]=se.useState(!1);return se.useEffect(()=>{const t=window.matchMedia("(max-width: 500px)");e(t.matches);const i=r=>{e(r.matches)};return t.addEventListener("change",i),()=>{t.removeEventListener("change",i)}},[]),pe.jsxs(jA,{frameloop:"demand",shadows:!0,dpr:[1,2],camera:{position:[20,16,5],fov:25},gl:{preserveDrawingBuffer:!0},children:[pe.jsxs(se.Suspense,{fallback:pe.jsx(aD,{}),children:[pe.jsx(sD,{enablePan:!1,enableZoom:!1,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/2}),pe.jsx(_Se,{isMobile:n})]}),pe.jsx(Rw,{all:!0})]})},SSe=()=>pe.jsxs("section",{id:"Hero",className:"relative h-screen",children:[pe.jsxs("div",{className:"absolute inset-0 top-[23%] max-w-7xl mx-auto sm:px-16 px-6 flex flex-row items-start gap-5 md:top-[250px]",children:[pe.jsxs("div",{className:"flex flex-col justify-center items-center mt-5",children:[pe.jsx("div",{className:"w-5 h-5 rounded-full bg-callToAction"}),pe.jsx("div",{className:"w-1 sm:h-80 h-40 hero-gradient"})]}),pe.jsxs("div",{children:[pe.jsxs("h1",{className:"font-black text-secondary lg:text-[80px] sm:text-[60px] xs:text-[50px] text-[40px] lg:leading-[98px] mt-2",children:["Hi, I'm"," ",pe.jsx("span",{className:"text-callToAction",children:"Niv"})]}),pe.jsxs("p",{className:"sm:text-[18px] text-[14px] text-secondary uppercase tracking-wider mt-2 text-white-100",children:["I’m a full-stack developer.",pe.jsx("br",{}),"specializing in Node.js and React."]})]})]}),pe.jsx(xSe,{}),pe.jsx("div",{className:"absolute bottom-[10%] md:bottom-[10%] w-full flex justify-center items-center",children:pe.jsx("a",{href:"#about",children:pe.jsx("div",{className:"w-[35px] h-[64px] rounded-3xl border-4 border-secondary flex justify-center items-start p-2",children:pe.jsx(vo.div,{animate:{y:[0,24,0]},transition:{duration:1.5,repeat:1/0,repeatType:"loop"},className:"w-3 h-3 rounded-full bg-secondary mb-1"})})})})]}),MSe=[{title:"Sense Apps - Whatsapp (Backend)",description:` Shopify application that integrates with users' shops, tracks end-customer activity, and implements a messaging flow using the Meta API to communicate with customers. +*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o(typeof window=="object"&&document.documentElement.style.setProperty("--line-color",i),oSe.default.createElement("div",{className:(0,aSe.default)(e,"vertical-timeline",{"vertical-timeline--animate":n,"vertical-timeline--two-columns":t==="2-columns","vertical-timeline--one-column-left":t==="1-column"||t==="1-column-left","vertical-timeline--one-column-right":t==="1-column-right"})},r));$X.propTypes={children:_c.default.oneOfType([_c.default.arrayOf(_c.default.node),_c.default.node]).isRequired,className:_c.default.string,animate:_c.default.bool,layout:_c.default.oneOf(["1-column-left","1-column","2-columns","1-column-right"]),lineColor:_c.default.string};var lSe=$X;Dw.default=lSe;var Bw={};function NP(){return NP=Object.assign||function(n){for(var e=1;e=0)&&(t[r]=n[r]);return t}var FP=new Map,T1=new WeakMap,kz=0,XX=void 0;function hSe(n){XX=n}function dSe(n){return n?(T1.has(n)||(kz+=1,T1.set(n,kz.toString())),T1.get(n)):"0"}function fSe(n){return Object.keys(n).sort().filter(function(e){return n[e]!==void 0}).map(function(e){return e+"_"+(e==="root"?dSe(n.root):n[e])}).toString()}function pSe(n){var e=fSe(n),t=FP.get(e);if(!t){var i=new Map,r,s=new IntersectionObserver(function(o){o.forEach(function(a){var l,c=a.isIntersecting&&r.some(function(u){return a.intersectionRatio>=u});n.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=c),(l=i.get(a.target))==null||l.forEach(function(u){u(c,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},FP.set(e,t)}return t}function ED(n,e,t,i){if(t===void 0&&(t={}),i===void 0&&(i=XX),typeof window.IntersectionObserver>"u"&&i!==void 0){var r=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var s=pSe(t),o=s.id,a=s.observer,l=s.elements,c=l.get(n)||[];return l.has(n)||l.set(n,c),c.push(e),a.observe(n),function(){c.splice(c.indexOf(e),1),c.length===0&&(l.delete(n),a.unobserve(n)),l.size===0&&(a.disconnect(),FP.delete(o))}}var mSe=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function zz(n){return typeof n.children!="function"}var QM=function(n){cSe(e,n);function e(i){var r;return r=n.call(this,i)||this,r.node=null,r._unobserveCb=null,r.handleNode=function(s){r.node&&(r.unobserve(),!s&&!r.props.triggerOnce&&!r.props.skip&&r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=s||null,r.observeNode()},r.handleChange=function(s,o){s&&r.props.triggerOnce&&r.unobserve(),zz(r.props)||r.setState({inView:s,entry:o}),r.props.onChange&&r.props.onChange(s,o)},r.state={inView:!!i.initialInView,entry:void 0},r}var t=e.prototype;return t.componentDidUpdate=function(r){(r.rootMargin!==this.props.rootMargin||r.root!==this.props.root||r.threshold!==this.props.threshold||r.skip!==this.props.skip||r.trackVisibility!==this.props.trackVisibility||r.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},t.componentWillUnmount=function(){this.unobserve(),this.node=null},t.observeNode=function(){if(!(!this.node||this.props.skip)){var r=this.props,s=r.threshold,o=r.root,a=r.rootMargin,l=r.trackVisibility,c=r.delay,u=r.fallbackInView;this._unobserveCb=ED(this.node,this.handleChange,{threshold:s,root:o,rootMargin:a,trackVisibility:l,delay:c},u)}},t.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},t.render=function(){if(!zz(this.props)){var r=this.state,s=r.inView,o=r.entry;return this.props.children({inView:s,entry:o,ref:this.handleNode})}var a=this.props,l=a.children,c=a.as,u=uSe(a,mSe);return se.createElement(c||"div",NP({ref:this.handleNode},u),l)},e}(se.Component);QM.displayName="InView";QM.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};function gSe(n){var e=n===void 0?{}:n,t=e.threshold,i=e.delay,r=e.trackVisibility,s=e.rootMargin,o=e.root,a=e.triggerOnce,l=e.skip,c=e.initialInView,u=e.fallbackInView,h=se.useRef(),d=se.useState({inView:!!c}),f=d[0],v=d[1],_=se.useCallback(function(m){h.current!==void 0&&(h.current(),h.current=void 0),!l&&m&&(h.current=ED(m,function(S,x){v({inView:S,entry:x}),x.isIntersecting&&a&&h.current&&(h.current(),h.current=void 0)},{root:o,rootMargin:s,threshold:t,trackVisibility:r,delay:i},u))},[Array.isArray(t)?t.toString():t,o,s,a,l,r,u,i]);se.useEffect(function(){!h.current&&f.entry&&!a&&!l&&v({inView:!!c})});var y=[_,f.inView,f.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}const vSe=Object.freeze(Object.defineProperty({__proto__:null,InView:QM,default:QM,defaultFallbackInView:hSe,observe:ED,useInView:gSe},Symbol.toStringTag,{value:"Module"})),ySe=cj(vSe);Bw.__esModule=!0;Bw.default=void 0;var xc=TD(se),Kn=TD(L$),b1=TD(WX),_Se=ySe;function TD(n){return n&&n.__esModule?n:{default:n}}const jX=({children:n="",className:e="",contentArrowStyle:t=null,contentStyle:i=null,date:r="",dateClassName:s="",icon:o=null,iconClassName:a="",iconOnClick:l=null,onTimelineElementClick:c=null,iconStyle:u=null,id:h="",position:d="",style:f=null,textClassName:v="",intersectionObserverProps:_={rootMargin:"0px 0px -40px 0px",triggerOnce:!0},visible:y=!1})=>xc.default.createElement(_Se.InView,_,({inView:m,ref:S})=>xc.default.createElement("div",{ref:S,id:h,className:(0,b1.default)(e,"vertical-timeline-element",{"vertical-timeline-element--left":d==="left","vertical-timeline-element--right":d==="right","vertical-timeline-element--no-children":n===""}),style:f},xc.default.createElement(xc.default.Fragment,null,xc.default.createElement("span",{style:u,onClick:l,className:(0,b1.default)(a,"vertical-timeline-element-icon",{"bounce-in":m||y,"is-hidden":!(m||y)})},o),xc.default.createElement("div",{style:i,onClick:c,className:(0,b1.default)(v,"vertical-timeline-element-content",{"bounce-in":m||y,"is-hidden":!(m||y)})},xc.default.createElement("div",{style:t,className:"vertical-timeline-element-content-arrow"}),n,xc.default.createElement("span",{className:(0,b1.default)(s,"vertical-timeline-element-date")},r)))));jX.propTypes={children:Kn.default.oneOfType([Kn.default.arrayOf(Kn.default.node),Kn.default.node]),className:Kn.default.string,contentArrowStyle:Kn.default.shape({}),contentStyle:Kn.default.shape({}),date:Kn.default.node,dateClassName:Kn.default.string,icon:Kn.default.element,iconClassName:Kn.default.string,iconStyle:Kn.default.shape({}),iconOnClick:Kn.default.func,onTimelineElementClick:Kn.default.func,id:Kn.default.string,position:Kn.default.string,style:Kn.default.shape({}),textClassName:Kn.default.string,visible:Kn.default.bool,intersectionObserverProps:Kn.default.shape({root:Kn.default.object,rootMargin:Kn.default.string,threshold:Kn.default.number,triggerOnce:Kn.default.bool})};var xSe=jX;Bw.default=xSe;var YX={VerticalTimeline:Dw.default,VerticalTimelineElement:Bw.default};const SSe=n=>pe.jsxs(YX.VerticalTimelineElement,{contentStyle:{background:"#112240",color:"#fff",boxShadow:"0 10px 30px -10px rgb(2 12 27 / 70%)"},contentArrowStyle:{borderRight:"7px solid #112240"},date:n.experience.date,iconStyle:{background:n.experience.iconBgColor},icon:pe.jsx("div",{className:"flex justify-center items-center w-full h-full",children:pe.jsx("img",{src:n.experience.icon,alt:n.experience.company_name,className:"w-[90%] h-[90%] object-contain"})}),children:[pe.jsxs("div",{children:[pe.jsx("h3",{className:"text-white text-[24px] font-bold",children:n.experience.title}),pe.jsx("p",{className:"text-secondary text-[16px] font-semibold",style:{margin:0},children:n.experience.company_name})]}),pe.jsx("ul",{className:"mt-5 list-disc ml-5 space-y-2",children:n.experience.points.map((e,t)=>pe.jsx("li",{className:"text-secondary text-[14px] pl-1 tracking-wider",children:e},`experience-point-${t}`))})]}),MSe=()=>pe.jsxs("section",{id:"work",className:"container mt-44 mx-auto",children:[pe.jsxs(vo.div,{initial:"hidden",whileInView:"show",variants:wA(null),className:"flex flex-col gap-2 items-center",children:[pe.jsx("p",{className:"text-primary text-3xl uppercase",children:"What i have done so far"}),pe.jsx("h1",{className:"text-secondary text-4xl sm:text-7xl font-bold",children:"Work Experience."})]}),pe.jsx("div",{className:"mt-20 flex flex-col",children:pe.jsx(YX.VerticalTimeline,{children:sSe.slice(0).reverse().map((n,e)=>pe.jsx(SSe,{experience:n},`experience-${e}`))})})]}),ASe=n=>{const e=my("./desktop_pc/scene.gltf");return pe.jsxs("mesh",{children:[pe.jsx("hemisphereLight",{intensity:.15,groundColor:"black"}),pe.jsx("spotLight",{position:[-20,50,10],angle:.12,penumbra:1,intensity:1,castShadow:!0,"shadow-mapSize":1024}),pe.jsx("directionalLight",{position:[5,5,5],intensity:4}),pe.jsx("primitive",{object:e.scene,scale:n.isMobile?.7:.75,position:n.isMobile?[0,-2.5,-2.2]:[0,-3.25,-1.5],rotation:[-.01,-.2,-.1]})]})},wSe=()=>{const[n,e]=se.useState(!1);return se.useEffect(()=>{const t=window.matchMedia("(max-width: 500px)");e(t.matches);const i=r=>{e(r.matches)};return t.addEventListener("change",i),()=>{t.removeEventListener("change",i)}},[]),pe.jsxs($A,{frameloop:"demand",shadows:!0,dpr:[1,2],camera:{position:[20,16,5],fov:25},gl:{preserveDrawingBuffer:!0},children:[pe.jsxs(se.Suspense,{fallback:pe.jsx(uD,{}),children:[pe.jsx(lD,{enablePan:!1,enableZoom:!1,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/2}),pe.jsx(ASe,{isMobile:n})]}),pe.jsx(bw,{all:!0})]})},ESe=()=>pe.jsxs("section",{id:"Hero",className:"relative h-screen",children:[pe.jsxs("div",{className:"absolute inset-0 top-[23%] max-w-7xl mx-auto sm:px-16 px-6 flex flex-row items-start gap-5 md:top-[250px]",children:[pe.jsxs("div",{className:"flex flex-col justify-center items-center mt-5",children:[pe.jsx("div",{className:"w-5 h-5 rounded-full bg-callToAction"}),pe.jsx("div",{className:"w-1 sm:h-80 h-40 hero-gradient"})]}),pe.jsxs("div",{children:[pe.jsxs("h1",{className:"font-black text-secondary lg:text-[80px] sm:text-[60px] xs:text-[50px] text-[40px] lg:leading-[98px] mt-2",children:["Hi, I'm"," ",pe.jsx("span",{className:"text-callToAction",children:"Niv"})]}),pe.jsxs("p",{className:"sm:text-[18px] text-[14px] text-secondary uppercase tracking-wider mt-2 text-white-100",children:["I’m a full-stack developer.",pe.jsx("br",{}),"specializing in Node.js and React."]})]})]}),pe.jsx(wSe,{}),pe.jsx("div",{className:"absolute bottom-[10%] md:bottom-[10%] w-full flex justify-center items-center",children:pe.jsx("a",{href:"#about",children:pe.jsx("div",{className:"w-[35px] h-[64px] rounded-3xl border-4 border-secondary flex justify-center items-start p-2",children:pe.jsx(vo.div,{animate:{y:[0,24,0]},transition:{duration:1.5,repeat:1/0,repeatType:"loop"},className:"w-3 h-3 rounded-full bg-secondary mb-1"})})})})]}),TSe=[{title:"Sense Apps - Whatsapp (Backend)",description:` Shopify application that integrates with users' shops, tracks end-customer activity, and implements a messaging flow using the Meta API to communicate with customers. The application also provides analytics on customer data and displays the created flows in a dashboard panel.`,technologies:["Node.js","NestJS","Kafka","Redis","PostgreSQL","React","TypeScript","Docker","Kubernetes"],github:"",demo:"https://apps.shopify.com/sense-whatsapp",image:"https://i.ibb.co/0nZ3Z3S/Portfolio.png"},{title:"Users Library",description:`Responsive user library app in React, enabling users to view, edit, and delete user data from an API. - The app includes field validation, error handling, Redux for state management, TypeScript for code quality, and a search filter for convenient user lookup.`,technologies:["React","Redux(toolkit)","Zod","Framer Motion","Vite"],github:"https://github.com/NivSv/Users-Library",demo:"https://nivsv.github.io/Users-Library",image:"https://i.ibb.co/0nZ3Z3S/Portfolio.png"},{title:"Users API",description:"This app is a user API with CRUD functionality, filtering, department/user count feature, and error handling. supporting create/delete departments, unit testing, and CI/CD.",technologies:["NestJS","Zod","Typescript","pg","Turborepo","Docker"],github:"https://github.com/NivSv/Users-API",demo:"https://users-api-iexe.onrender.com/api",image:"https://i.ibb.co/0nZ3Z3S/Portfolio.png"}];function ASe(n){return au({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M752 100c-61.8 0-112 50.2-112 112 0 47.7 29.9 88.5 72 104.6v27.6L512 601.4 312 344.2v-27.6c42.1-16.1 72-56.9 72-104.6 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 50.6 33.8 93.5 80 107.3v34.4c0 9.7 3.3 19.3 9.3 27L476 672.3v33.6c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-33.6l226.7-291.6c6-7.7 9.3-17.3 9.3-27v-34.4c46.2-13.8 80-56.7 80-107.3 0-61.8-50.2-112-112-112zM224 212a48.01 48.01 0 0 1 96 0 48.01 48.01 0 0 1-96 0zm336 600a48.01 48.01 0 0 1-96 0 48.01 48.01 0 0 1 96 0zm192-552a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"},child:[]}]})(n)}function wSe(n){return au({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"},child:[]}]})(n)}function ESe(n){return au({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"},child:[]}]})(n)}function TSe(n){return au({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 0 0 .6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0 0 46.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"},child:[]}]})(n)}const bSe=({project:n,key:e,leftSide:t})=>pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:mI({delay:.2*e,direction:t?"left":"right",duration:.5,type:"spring"}),className:"flex flex-col md:flex-row gap-10 justify-center mt-28",children:pe.jsxs("div",{className:"flex flex-col items-center gap-2",children:[pe.jsx("p",{className:"text-md text-callToAction",children:"Featured Project"}),pe.jsx("p",{className:"text-3xl text-primaryLight font-bold",children:n.title}),pe.jsx("div",{className:"text-primary border-solid bg-[#233554] p-2 border-[#233554] w-[400px] text-center rounded-md border-4 shadow-lg",children:n.description}),pe.jsx("div",{className:"flex gap-2 flex-wrap text-primary max-w-sm",children:n.technologies.map((i,r)=>pe.jsx("p",{children:i},r))}),pe.jsxs("div",{className:"flex",children:[n.demo&&pe.jsx("a",{href:n.demo,target:"_blank",rel:"noreferrer",title:"Demo Link",children:pe.jsx(ESe,{size:40,className:"fill-primaryLight hover:translate-y-[-4px] transition-all duration-400 hover:fill-callToAction"})}),n.github&&pe.jsx("a",{className:"hover:",href:n.github,target:"_blank",rel:"noreferrer",title:"Demo Link",children:pe.jsx(wSe,{size:40,className:"fill-primaryLight hover:translate-y-[-4px] transition-all duration-400 hover:fill-callToAction"})})]})]})},`project-${e}`),CSe=()=>pe.jsxs("section",{id:"projects",className:"container mt-44 mx-auto overflow-hidden",children:[pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:TA(null),className:"flex flex-col gap-2 items-center",children:pe.jsx("h1",{className:"text-secondary text-4xl sm:text-7xl inline font-bold",children:"Projects."})}),MSe.map((n,e)=>pe.jsx(bSe,{project:n,leftSide:e%2===0},e))]}),RSe=""+new URL("reactjs-LYxsbuPE.png",import.meta.url).href,PSe=""+new URL("docker-DrQKSZ7f.png",import.meta.url).href,ISe=""+new URL("nodejs-BctxLIqp.png",import.meta.url).href,LSe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFoBAMAAACIy3zmAAAAJFBMVEXu7u7///+kHRDZLCBjZGZTVFbOHBCKi4zh1NOIBwDBsK/ddm4xh3M+AAANv0lEQVR42uycz2vcSBbHu8CJg3OpYrNYdC4TGcz25LLTDWKILwlIOPiUg0Qbn5YWiIVcNuDGwaf0Em+Cc+uBBbOXdDI9NsklWUPwJv/clurnq1JJ3RnsdGcoEYilKnV/9NWrV++9krpF+IZbfPsudlse2kN7aA/toT20h/bQHvqPCC02JI5/T7se2kN7aA/toT20h/bQHvqPBe2TAA/toT20h/bQHtpDe2gP7aumPnPx0B7aQ3toD+2hPbSH9tC+auqhPbSH9tAe2kN7aA/toX3V1GcuHtpDe2gP7aE9tIf20B7aV009tIf20B7aQ3toD+2hPbSvmvokwEN7aA/toT20h/bQHtpD+6qph756aIykVX030K96Ub51wY98J9DBeZHnvaLYGuHvBBqRV1HRY1uUvybfBTQqZe7JLacmsvzQZO2TRqZaF1to6aGpaUDmEntrtNzQCDPTiCQ4+6/IPywzNLlxzkfgB/Y/NQ3OXlwsMfRN6TX+Rt4WeZF/DoTizLCvDkse+D3Q75XXeExnl+jxhNyWB6LHoyuEDt69FrPY2jv0VdBYmAZTlo69gB67ro9Qw74y6GGWTdjuapbtfUXVlKxFBfAYP/Hjn4AXKX6+oogZraRxssfwkjim+HMmAcj0dEX+kR8voO8rhO+7dOhhTFnLQ+tpHCe7eE5oDCdBMJ+8LaDTLvLJlUBTfeOk/OhbFDremxM6OAdsUX6hBrX2J6Dp0hOqEjV5QndX6B9xfz5ok6w3IWALzo3Zsbh3+dDB74F+VfSsbevL2Q3RFa2ZTQX1fVcHnc4JDT2djOwKulH/Ebw/pzG11VhQE1m00m1lGiUqgKPzy/WiiORu99/aRD4jfJnQNxT0fANRebqIA0eAG0EvPQhPxsC7lCZyBUq3S5d3vxkaKU9Hw4xnzPUdK98XfSRK5igMw5OTk9yYHq8AuvTYMyaXMkUB8ZByckL7v7dzzbxZQp9swITmKqBXk2wHN3XWni66Zzg5IXAuo6VBGA6Y0icnwLDlpH6ZNk2DiTPU1Bm9UobwmBibgI3OATNX+kQbdq+YXL7SZUNTZ3SzsKMjtX0CaQszDaU0MBF11qVCN3dG2jVEEwv6X2AKpEOwpN5U0Errbw9NcF4PfR26uk2KvBEqpbVV/4AvKZ7GHHqOzCUA0B/d5sE3ahsM2zQOejl3Wt8eesOY/ODWNmsI1J7DrlBat3Q7FWhesJwbWnnZ+aHxGEj9wRTaKnx0Q2HTY+OYDY2C0zLTY1OUyPlKMnx8eHCGSMWWaMPBwbtnFjTMEQl5eXp4+AwqPQ5z7XQvYCya2wFUL2Q2/Yt5HTY05pkewadZJnI+OueeJuVedjiy8m1yzBt2RhAa5ohkbch7IKyVDjU1nRJfi097b8TWea6ogTkzZhu6jCsTGqFR9pKhzywg2M9KojjJ+iOjakxOeUOc9ScAmuWIor78QvUYYa20QV3QIPrLlx5EplFfLlOA7qZl5VXoafnVIzzkX5WMaJPcKfdTWDUmzzPQoKBZwPSIW/yq7iGpmdKQmjEWvRzs9b6cQZdtMVegWab35FeBWUKQXxVz+dVId17PYIPs3+KhKYMOEvtUqTR1ZQ6oMkAteizsw1HPaeAOaMw+/lDSUAggFjvyEMvOkEj3p9AsCSih0fPUPlUpTd2Cgzjf+iwKpX+qDMoobII2IPDQPJSOZOejtAY6ldDWZYlajlCabnautXWm49Tf6pkr0ObXJCO0YqGVevGJIIud0Egrfcs8N9nFUGnLsHtb0GNjO0HshuGcSvexEjpJtdR1QltKo2lsf5yptE2tda5YxwAwd35qUDrN7uN14Uay7Vg4L5pJOe6Jy6axHM7qA1s2tGHYZX3UGYSYzOEY1SpNGQ+JECvbpgN6bZgJvYhMX8smuqVupdup/CB5m/g3QQCTOpdRX5A73QYX+gdcB51s08vGAZ9Vdngrd36s9kXErc+2z16+UKZj2jS/ruwpZdhnf6ZMIvRmbED0HHUxwzoik/luJUdMtFct43VuHX0+ByMyZbsPZPjMiSjTUPl1WPe4xgduad14yuVnXxR0DApo2Kz4ZVmHyRzeRXaoTpTQEzajHXEUGThxH7ZHd/nVUKLyXCR9m1lhOuIXzMMXel3JfZEj3q6n7kXlcITW0TX7hlsjXKf0Hlb1WyqQyj4YUCqvht5vkUEJx2gqzSxoF8vrzfpIZuO3LZBNq2QHrGNg99SGr7CU0EYOpVOmhEck/GqSB/Jc4UscSu+qu/RuJLPx4Dxqos4nn+qZSydTo3SffxUzggQB6CMxT6ZaaNJSUptK87sxwnbKGJRFGYvaHI55DfOGmaSZNk19MdtdEcNHQ/Oal/Bme/rcdlpV+pqI7oiVjf+WO3jCvFcfIRnM1RJCokPSlpjSHhkZdcJuOb8FD/S5wl4MpbnLS9KniBgFp8KpYjXsi+ou647TpvewhmYgepuy5hV+aQD6qKp0W84/MU23NLRyDd0Gw25i7t5xKZ08wHrxJ945PDzg2yHd9pnBMMQUnrtSrU/jTMUD6SGA3qjD2mxiBg13XDYtfEerxS+BTtRJuWVyyu5zb9aH5647VgJAwJRtIwU9rjXasJZ5E57jVlruOgI57jWmYBzyzm3HSsC6mfMo6M3Z1N0G5tBp03I2CWqgY243uzPXXGACkfQVNGRwO5Fu3RhlN8Cp9O4M6JRDP5q55gKzSD6Lc2hI7RiOtUNQtLhsmrqyZug+aYQGq1vT1MjUFHSD9Va33L5Al9Jq3q6D3iON5gFWt/AQZuyPWNVUJAH1c0jt4Ow2ZeNPWqA+x+N8Y5twv7AHq2RBWk1sQaEnVvG0yhHzesN2D8FBOA804d93sL29f8D+0Y3uPCUO6HZaLSGwmPQ4UdjMlep0a2MOaueQdWXjGjqBVgA3PrlA6PVUZS5Aaabs8b5KL81svGE4Vq9rRjauoYdC0Er19hqIUHjrn2On0rx1TaQ25b2Bie3mjOG44WzuNCs9FZZYgb6ljEGeO41dNq1K7py6j+1sPG8ajnnNJU0alb4mLLECzWOhh6Dym7iU1tVKXj9JrWJNM3XuNp7Of3AjNBf0fvWRzyAFqYIyacumEX6mn3HlH8V6/6/ObAc1rs4apiPcaB7tVBc6BLQQL9HFuZauKJhKB/vpU2x8VMIKgbfHdQ6iOw/zhDQrjZMYRtRUvECINxWzjDi3nVaLNeh5mmQTecHrGpr8s5Y6cjDbRnMxA1pEPNtqRaadZLwAKQoxT4Tw09ShdMKTLeAkY/FNb2ZGpA2pQPFzs3kQka/+QzZTJ5CNgLTpiAm/msIKk1CaG8Q2LGb3eXH7ZlOCaGrvip2KUbN5tGEhiQRlXUy0imSyXy7zvMhcBUgxNpnWAXB55HZRnUxggthQqRGJbaPSGImIONt5Rmc2Hv08aunbXZZTD5LMWYCUBdf04PRUVPt2GfSnmalWI3Ov99dmpdUCRJbFMobYxdqxMOzUXepVPVRdlS9+ibXxOagH7h6VtXELuqXr/am0290WGKOulQChdDWw5fO+ysbDGZWPGubeoDGeLosV07QCxmsGq86VgEotD7buWdl4c72mzuq77swFQleWVmTBCQ/roFXdI3O0lplLXmezG/XM8JyZSpPnpqLZE/nw1Go2Q2nrVJ7ZsnSrKUGczTwHNE7S6i1md8VMAGNXNp5alytzxHxWvaZu9um6csQhX5+Aj8O0M7t6IVrB+nOcPRzKlY11/TBhAHvs6BICNF9XSlhbqRk4E9tyoS21nuFZVU4t649g57a6CZToSBbKRGEV8YUNecXZHoHQwHwrqdYgbGauQFNZs4f2g0dr3Bdn2bb1wDhNWzO2fnVIWuLM8mFCNtfzc7HoIXTW0IC625yNb1TXxu3Ho16wqpv1tFRwWs4u22fVZ6lOKVR6UL4bhk5Fva5Fb8BTXds93qeXrE7V0A0BhnsIgrXxCkfL8YgXIvjGS/1qiNHKnq9hA1N0EMG/Xn5tlaeiCnRDKNfM7ICu2cVf8zSt+bwwQsZu4Fobn1mpMdbGv/3Lze618UEzs7E2vmBoYNjdpkqNeUmjBbxGXgPWDeebHjt/Id8eGr2pXZeY4erq1sa/xRv69WvjTubKev5iXu1r11IPXJGoyYwWBF2hrs7ptcwLfIky6Iwbh2PNOnPnx4W++Rn8d1xX+hhs1nnv8cWiX1e1qWevjUvmBUKTN52vWxsfvyaLfzGYvGqmtlzdxoQsw9vMZK0z99p45+4IL8cr2CjojudbG6fueZE/QmH9YkOdEzGZx/cW+3Mf1m9j4Led2Wvj44sF/7CKtY/Izc6stfHxR9JaKuhy0cmaHe3tl8ky/hZCxbAtt7EEP+DgeGsO11Nzt4EWkKo0vezO/7aHozLnHwluLSd0qzo7mm5jOaFblRCbMX8g/2/njlEYhMEoADdbV6/gJj2lW+dsju0xPF3FIAXp0KHQPPg23T4C0byH/pee0eXDdqyP/kfPnbbjVOeIeXnP5fSoixjy93477gE2ZDLh8Q17W+eUcYrtiL3cyhCE3g6rYx3XTpRforeL670MYej2q3wcut/bMPS/zsQ/DgHQ0NDQ0NDQ0ND5aCEAGhoaGhoaGhpaayq5QENDQ0NDQ0NDa02hoaGhoaGhoaG1ppILNDQ0NDQ0NDS01hQaGhoaGhoaGlprKgRAQ0NDQ0NDQ0NrTaGhoaGhoaGhoXPQLwHdP1GgRzkLAAAAAElFTkSuQmCC",DSe=""+new URL("kafka-5lxhOryP.png",import.meta.url).href,BSe=[{name:"React",image:RSe},{name:"Docker",image:PSe},{name:"Node.js",image:ISe},{name:"Redis",image:LSe},{name:"Kafka",image:DSe}],NSe=({icon:n})=>{const[e]=rD([n]);return pe.jsxs(pye,{speed:1.75,rotationIntensity:1,floatIntensity:2,children:[pe.jsx("ambientLight",{intensity:.25}),pe.jsx("directionalLight",{position:[0,0,.05]}),pe.jsxs("mesh",{castShadow:!0,receiveShadow:!0,scale:2.75,children:[pe.jsx("icosahedronGeometry",{args:[1,1]}),pe.jsx("meshStandardMaterial",{color:new ct(16775403),polygonOffset:!0,polygonOffsetFactor:-5,flatShading:!0}),pe.jsx(aye,{position:[0,0,1],rotation:[2*Math.PI,0,6.25],scale:1,map:e})]})]})},USe=({icon:n})=>pe.jsxs(jA,{frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},children:[pe.jsxs(se.Suspense,{fallback:pe.jsx(aD,{}),children:[pe.jsx(sD,{enablePan:!1,enableZoom:!1}),pe.jsx(NSe,{icon:n})]}),pe.jsx(Rw,{all:!0})]}),FSe=()=>pe.jsxs("section",{id:"technologies",className:"container mt-44 mx-auto",children:[pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:TA(null),className:"flex flex-col gap-2 items-center",children:pe.jsx("h1",{className:"text-secondary text-4xl sm:text-7xl inline font-bold",children:"Technologies."})}),pe.jsx("div",{className:"flex flex-row flex-wrap justify-center gap-10 mt-16",children:BSe.map(n=>pe.jsx("div",{className:"w-28 h-28",title:n.name,children:pe.jsx(USe,{icon:n.image})},n.name))})]}),OSe=()=>pe.jsxs(pe.Fragment,{children:[pe.jsx(SSe,{}),pe.jsx(Qee,{}),pe.jsx(FSe,{}),pe.jsx(ySe,{}),pe.jsx(CSe,{}),pe.jsx(q1e,{})]});function $X(n,e){return function(){return n.apply(e,arguments)}}const{toString:kSe}=Object.prototype,{getPrototypeOf:wD}=Object,Fw=(n=>e=>{const t=kSe.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),oa=n=>(n=n.toLowerCase(),e=>Fw(e)===n),Ow=n=>e=>typeof e===n,{isArray:pm}=Array,k0=Ow("undefined");function zSe(n){return n!==null&&!k0(n)&&n.constructor!==null&&!k0(n.constructor)&&Os(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const XX=oa("ArrayBuffer");function GSe(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&XX(n.buffer),e}const HSe=Ow("string"),Os=Ow("function"),jX=Ow("number"),kw=n=>n!==null&&typeof n=="object",VSe=n=>n===!0||n===!1,Q1=n=>{if(Fw(n)!=="object")return!1;const e=wD(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},WSe=oa("Date"),$Se=oa("File"),XSe=oa("Blob"),jSe=oa("FileList"),YSe=n=>kw(n)&&Os(n.pipe),JSe=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Os(n.append)&&((e=Fw(n))==="formdata"||e==="object"&&Os(n.toString)&&n.toString()==="[object FormData]"))},KSe=oa("URLSearchParams"),[qSe,ZSe,QSe,eMe]=["ReadableStream","Request","Response","Headers"].map(oa),tMe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function xy(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,r;if(typeof n!="object"&&(n=[n]),pm(n))for(i=0,r=n.length;i0;)if(r=t[i],e===r.toLowerCase())return r;return null}const Nh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,JX=n=>!k0(n)&&n!==Nh;function kP(){const{caseless:n}=JX(this)&&this||{},e={},t=(i,r)=>{const s=n&&YX(e,r)||r;Q1(e[s])&&Q1(i)?e[s]=kP(e[s],i):Q1(i)?e[s]=kP({},i):pm(i)?e[s]=i.slice():e[s]=i};for(let i=0,r=arguments.length;i(xy(e,(r,s)=>{t&&Os(r)?n[s]=$X(r,t):n[s]=r},{allOwnKeys:i}),n),iMe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),rMe=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},sMe=(n,e,t,i)=>{let r,s,o;const a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)o=r[s],(!i||i(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&wD(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},oMe=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},aMe=n=>{if(!n)return null;if(pm(n))return n;let e=n.length;if(!jX(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},lMe=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&wD(Uint8Array)),cMe=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=i.next())&&!r.done;){const s=r.value;e.call(n,s[0],s[1])}},uMe=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},hMe=oa("HTMLFormElement"),dMe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),Oz=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),fMe=oa("RegExp"),KX=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};xy(t,(r,s)=>{let o;(o=e(r,s,n))!==!1&&(i[s]=o||r)}),Object.defineProperties(n,i)},pMe=n=>{KX(n,(e,t)=>{if(Os(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(Os(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},mMe=(n,e)=>{const t={},i=r=>{r.forEach(s=>{t[s]=!0})};return pm(n)?i(n):i(String(n).split(e)),t},gMe=()=>{},vMe=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,wC="abcdefghijklmnopqrstuvwxyz",kz="0123456789",qX={DIGIT:kz,ALPHA:wC,ALPHA_DIGIT:wC+wC.toUpperCase()+kz},yMe=(n=16,e=qX.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;n--;)t+=e[Math.random()*i|0];return t};function _Me(n){return!!(n&&Os(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const xMe=n=>{const e=new Array(10),t=(i,r)=>{if(kw(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const s=pm(i)?[]:{};return xy(i,(o,a)=>{const l=t(o,r+1);!k0(l)&&(s[a]=l)}),e[r]=void 0,s}}return i};return t(n,0)},SMe=oa("AsyncFunction"),MMe=n=>n&&(kw(n)||Os(n))&&Os(n.then)&&Os(n.catch),ZX=((n,e)=>n?setImmediate:e?((t,i)=>(Nh.addEventListener("message",({source:r,data:s})=>{r===Nh&&s===t&&i.length&&i.shift()()},!1),r=>{i.push(r),Nh.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Os(Nh.postMessage)),AMe=typeof queueMicrotask<"u"?queueMicrotask.bind(Nh):typeof process<"u"&&process.nextTick||ZX,ze={isArray:pm,isArrayBuffer:XX,isBuffer:zSe,isFormData:JSe,isArrayBufferView:GSe,isString:HSe,isNumber:jX,isBoolean:VSe,isObject:kw,isPlainObject:Q1,isReadableStream:qSe,isRequest:ZSe,isResponse:QSe,isHeaders:eMe,isUndefined:k0,isDate:WSe,isFile:$Se,isBlob:XSe,isRegExp:fMe,isFunction:Os,isStream:YSe,isURLSearchParams:KSe,isTypedArray:lMe,isFileList:jSe,forEach:xy,merge:kP,extend:nMe,trim:tMe,stripBOM:iMe,inherits:rMe,toFlatObject:sMe,kindOf:Fw,kindOfTest:oa,endsWith:oMe,toArray:aMe,forEachEntry:cMe,matchAll:uMe,isHTMLForm:hMe,hasOwnProperty:Oz,hasOwnProp:Oz,reduceDescriptors:KX,freezeMethods:pMe,toObjectSet:mMe,toCamelCase:dMe,noop:gMe,toFiniteNumber:vMe,findKey:YX,global:Nh,isContextDefined:JX,ALPHABET:qX,generateString:yMe,isSpecCompliantForm:_Me,toJSONObject:xMe,isAsyncFn:SMe,isThenable:MMe,setImmediate:ZX,asap:AMe};function jt(n,e,t,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}ze.inherits(jt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ze.toJSONObject(this.config),code:this.code,status:this.status}}});const QX=jt.prototype,e7={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{e7[n]={value:n}});Object.defineProperties(jt,e7);Object.defineProperty(QX,"isAxiosError",{value:!0});jt.from=(n,e,t,i,r,s)=>{const o=Object.create(QX);return ze.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),jt.call(o,n.message,e,t,i,r),o.cause=n,o.name=n.name,s&&Object.assign(o,s),o};const wMe=null;function zP(n){return ze.isPlainObject(n)||ze.isArray(n)}function t7(n){return ze.endsWith(n,"[]")?n.slice(0,-2):n}function zz(n,e,t){return n?n.concat(e).map(function(r,s){return r=t7(r),!t&&s?"["+r+"]":r}).join(t?".":""):e}function EMe(n){return ze.isArray(n)&&!n.some(zP)}const TMe=ze.toFlatObject(ze,{},null,function(e){return/^is[A-Z]/.test(e)});function zw(n,e,t){if(!ze.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=ze.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,y){return!ze.isUndefined(y[_])});const i=t.metaTokens,r=t.visitor||u,s=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&ze.isSpecCompliantForm(e);if(!ze.isFunction(r))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(ze.isDate(v))return v.toISOString();if(!l&&ze.isBlob(v))throw new jt("Blob is not supported. Use a Buffer instead.");return ze.isArrayBuffer(v)||ze.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function u(v,_,y){let m=v;if(v&&!y&&typeof v=="object"){if(ze.endsWith(_,"{}"))_=i?_:_.slice(0,-2),v=JSON.stringify(v);else if(ze.isArray(v)&&EMe(v)||(ze.isFileList(v)||ze.endsWith(_,"[]"))&&(m=ze.toArray(v)))return _=t7(_),m.forEach(function(x,M){!(ze.isUndefined(x)||x===null)&&e.append(o===!0?zz([_],M,s):o===null?_:_+"[]",c(x))}),!1}return zP(v)?!0:(e.append(zz(y,_,s),c(v)),!1)}const h=[],d=Object.assign(TMe,{defaultVisitor:u,convertValue:c,isVisitable:zP});function f(v,_){if(!ze.isUndefined(v)){if(h.indexOf(v)!==-1)throw Error("Circular reference detected in "+_.join("."));h.push(v),ze.forEach(v,function(m,S){(!(ze.isUndefined(m)||m===null)&&r.call(e,m,ze.isString(S)?S.trim():S,_,d))===!0&&f(m,_?_.concat(S):[S])}),h.pop()}}if(!ze.isObject(n))throw new TypeError("data must be an object");return f(n),e}function Gz(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function ED(n,e){this._pairs=[],n&&zw(n,this,e)}const n7=ED.prototype;n7.append=function(e,t){this._pairs.push([e,t])};n7.toString=function(e){const t=e?function(i){return e.call(this,i,Gz)}:Gz;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function bMe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function i7(n,e,t){if(!e)return n;const i=t&&t.encode||bMe,r=t&&t.serialize;let s;if(r?s=r(e,t):s=ze.isURLSearchParams(e)?e.toString():new ED(e,t).toString(i),s){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+s}return n}class Hz{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ze.forEach(this.handlers,function(i){i!==null&&e(i)})}}const r7={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},CMe=typeof URLSearchParams<"u"?URLSearchParams:ED,RMe=typeof FormData<"u"?FormData:null,PMe=typeof Blob<"u"?Blob:null,IMe={isBrowser:!0,classes:{URLSearchParams:CMe,FormData:RMe,Blob:PMe},protocols:["http","https","file","blob","url","data"]},TD=typeof window<"u"&&typeof document<"u",GP=typeof navigator=="object"&&navigator||void 0,LMe=TD&&(!GP||["ReactNative","NativeScript","NS"].indexOf(GP.product)<0),DMe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",BMe=TD&&window.location.href||"http://localhost",NMe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:TD,hasStandardBrowserEnv:LMe,hasStandardBrowserWebWorkerEnv:DMe,navigator:GP,origin:BMe},Symbol.toStringTag,{value:"Module"})),ms={...NMe,...IMe};function UMe(n,e){return zw(n,new ms.classes.URLSearchParams,Object.assign({visitor:function(t,i,r,s){return ms.isNode&&ze.isBuffer(t)?(this.append(i,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function FMe(n){return ze.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function OMe(n){const e={},t=Object.keys(n);let i;const r=t.length;let s;for(i=0;i=t.length;return o=!o&&ze.isArray(r)?r.length:o,l?(ze.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!a):((!r[o]||!ze.isObject(r[o]))&&(r[o]=[]),e(t,i,r[o],s)&&ze.isArray(r[o])&&(r[o]=OMe(r[o])),!a)}if(ze.isFormData(n)&&ze.isFunction(n.entries)){const t={};return ze.forEachEntry(n,(i,r)=>{e(FMe(i),r,t,0)}),t}return null}function kMe(n,e,t){if(ze.isString(n))try{return(e||JSON.parse)(n),ze.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(0,JSON.stringify)(n)}const Sy={transitional:r7,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const i=t.getContentType()||"",r=i.indexOf("application/json")>-1,s=ze.isObject(e);if(s&&ze.isHTMLForm(e)&&(e=new FormData(e)),ze.isFormData(e))return r?JSON.stringify(s7(e)):e;if(ze.isArrayBuffer(e)||ze.isBuffer(e)||ze.isStream(e)||ze.isFile(e)||ze.isBlob(e)||ze.isReadableStream(e))return e;if(ze.isArrayBufferView(e))return e.buffer;if(ze.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return UMe(e,this.formSerializer).toString();if((a=ze.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return zw(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),kMe(e)):e}],transformResponse:[function(e){const t=this.transitional||Sy.transitional,i=t&&t.forcedJSONParsing,r=this.responseType==="json";if(ze.isResponse(e)||ze.isReadableStream(e))return e;if(e&&ze.isString(e)&&(i&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?jt.from(a,jt.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ms.classes.FormData,Blob:ms.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ze.forEach(["delete","get","head","post","put","patch"],n=>{Sy.headers[n]={}});const zMe=ze.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),GMe=n=>{const e={};let t,i,r;return n&&n.split(` -`).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!t||e[t]&&zMe[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},Vz=Symbol("internals");function Cg(n){return n&&String(n).trim().toLowerCase()}function eS(n){return n===!1||n==null?n:ze.isArray(n)?n.map(eS):String(n)}function HMe(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const VMe=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function EC(n,e,t,i,r){if(ze.isFunction(i))return i.call(this,e,t);if(r&&(e=t),!!ze.isString(e)){if(ze.isString(i))return e.indexOf(i)!==-1;if(ze.isRegExp(i))return i.test(e)}}function WMe(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function $Me(n,e){const t=ze.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(r,s,o){return this[i].call(this,e,r,s,o)},configurable:!0})})}class gs{constructor(e){e&&this.set(e)}set(e,t,i){const r=this;function s(a,l,c){const u=Cg(l);if(!u)throw new Error("header name must be a non-empty string");const h=ze.findKey(r,u);(!h||r[h]===void 0||c===!0||c===void 0&&r[h]!==!1)&&(r[h||l]=eS(a))}const o=(a,l)=>ze.forEach(a,(c,u)=>s(c,u,l));if(ze.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(ze.isString(e)&&(e=e.trim())&&!VMe(e))o(GMe(e),t);else if(ze.isHeaders(e))for(const[a,l]of e.entries())s(l,a,i);else e!=null&&s(t,e,i);return this}get(e,t){if(e=Cg(e),e){const i=ze.findKey(this,e);if(i){const r=this[i];if(!t)return r;if(t===!0)return HMe(r);if(ze.isFunction(t))return t.call(this,r,i);if(ze.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Cg(e),e){const i=ze.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||EC(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let r=!1;function s(o){if(o=Cg(o),o){const a=ze.findKey(i,o);a&&(!t||EC(i,i[a],a,t))&&(delete i[a],r=!0)}}return ze.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let i=t.length,r=!1;for(;i--;){const s=t[i];(!e||EC(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const t=this,i={};return ze.forEach(this,(r,s)=>{const o=ze.findKey(i,s);if(o){t[o]=eS(r),delete t[s];return}const a=e?WMe(s):String(s).trim();a!==s&&delete t[s],t[a]=eS(r),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ze.forEach(this,(i,r)=>{i!=null&&i!==!1&&(t[r]=e&&ze.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[Vz]=this[Vz]={accessors:{}}).accessors,r=this.prototype;function s(o){const a=Cg(o);i[a]||($Me(r,o),i[a]=!0)}return ze.isArray(e)?e.forEach(s):s(e),this}}gs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ze.reduceDescriptors(gs.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});ze.freezeMethods(gs);function TC(n,e){const t=this||Sy,i=e||t,r=gs.from(i.headers);let s=i.data;return ze.forEach(n,function(a){s=a.call(t,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function o7(n){return!!(n&&n.__CANCEL__)}function mm(n,e,t){jt.call(this,n??"canceled",jt.ERR_CANCELED,e,t),this.name="CanceledError"}ze.inherits(mm,jt,{__CANCEL__:!0});function a7(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new jt("Request failed with status code "+t.status,[jt.ERR_BAD_REQUEST,jt.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function XMe(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function jMe(n,e){n=n||10;const t=new Array(n),i=new Array(n);let r=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[s];o||(o=c),t[r]=l,i[r]=c;let h=s,d=0;for(;h!==r;)d+=t[h++],h=h%n;if(r=(r+1)%n,r===s&&(s=(s+1)%n),c-o{t=u,r=null,s&&(clearTimeout(s),s=null),n.apply(null,c)};return[(...c)=>{const u=Date.now(),h=u-t;h>=i?o(c,u):(r=c,s||(s=setTimeout(()=>{s=null,o(r)},i-h)))},()=>r&&o(r)]}const eA=(n,e,t=3)=>{let i=0;const r=jMe(50,250);return YMe(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-i,c=r(l),u=o<=a;i=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(h)},t)},Wz=(n,e)=>{const t=n!=null;return[i=>e[0]({lengthComputable:t,total:n,loaded:i}),e[1]]},$z=n=>(...e)=>ze.asap(()=>n(...e)),JMe=ms.hasStandardBrowserEnv?function(){const e=ms.navigator&&/(msie|trident)/i.test(ms.navigator.userAgent),t=document.createElement("a");let i;function r(s){let o=s;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return i=r(window.location.href),function(o){const a=ze.isString(o)?r(o):o;return a.protocol===i.protocol&&a.host===i.host}}():function(){return function(){return!0}}(),KMe=ms.hasStandardBrowserEnv?{write(n,e,t,i,r,s){const o=[n+"="+encodeURIComponent(e)];ze.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),ze.isString(i)&&o.push("path="+i),ze.isString(r)&&o.push("domain="+r),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function qMe(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function ZMe(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function l7(n,e){return n&&!qMe(e)?ZMe(n,e):e}const Xz=n=>n instanceof gs?{...n}:n;function pd(n,e){e=e||{};const t={};function i(c,u,h){return ze.isPlainObject(c)&&ze.isPlainObject(u)?ze.merge.call({caseless:h},c,u):ze.isPlainObject(u)?ze.merge({},u):ze.isArray(u)?u.slice():u}function r(c,u,h){if(ze.isUndefined(u)){if(!ze.isUndefined(c))return i(void 0,c,h)}else return i(c,u,h)}function s(c,u){if(!ze.isUndefined(u))return i(void 0,u)}function o(c,u){if(ze.isUndefined(u)){if(!ze.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,h){if(h in e)return i(c,u);if(h in n)return i(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>r(Xz(c),Xz(u),!0)};return ze.forEach(Object.keys(Object.assign({},n,e)),function(u){const h=l[u]||r,d=h(n[u],e[u],u);ze.isUndefined(d)&&h!==a||(t[u]=d)}),t}const c7=n=>{const e=pd({},n);let{data:t,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=gs.from(o),e.url=i7(l7(e.baseURL,e.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(ze.isFormData(t)){if(ms.hasStandardBrowserEnv||ms.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(ms.hasStandardBrowserEnv&&(i&&ze.isFunction(i)&&(i=i(e)),i||i!==!1&&JMe(e.url))){const c=r&&s&&KMe.read(s);c&&o.set(r,c)}return e},QMe=typeof XMLHttpRequest<"u",eAe=QMe&&function(n){return new Promise(function(t,i){const r=c7(n);let s=r.data;const o=gs.from(r.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=r,u,h,d,f,v;function _(){f&&f(),v&&v(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function m(){if(!y)return;const x=gs.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),R={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};a7(function(P){t(P),_()},function(P){i(P),_()},R),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(m)},y.onabort=function(){y&&(i(new jt("Request aborted",jt.ECONNABORTED,n,y)),y=null)},y.onerror=function(){i(new jt("Network Error",jt.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let M=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const R=r.transitional||r7;r.timeoutErrorMessage&&(M=r.timeoutErrorMessage),i(new jt(M,R.clarifyTimeoutError?jt.ETIMEDOUT:jt.ECONNABORTED,n,y)),y=null},s===void 0&&o.setContentType(null),"setRequestHeader"in y&&ze.forEach(o.toJSON(),function(M,R){y.setRequestHeader(R,M)}),ze.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),c&&([d,v]=eA(c,!0),y.addEventListener("progress",d)),l&&y.upload&&([h,f]=eA(l),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",f)),(r.cancelToken||r.signal)&&(u=x=>{y&&(i(!x||x.type?new mm(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const S=XMe(r.url);if(S&&ms.protocols.indexOf(S)===-1){i(new jt("Unsupported protocol "+S+":",jt.ERR_BAD_REQUEST,n));return}y.send(s||null)})},tAe=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let i=new AbortController,r;const s=function(c){if(!r){r=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof jt?u:new mm(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,s(new jt(`timeout ${e} of ms exceeded`,jt.ETIMEDOUT))},e);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),n=null)};n.forEach(c=>c.addEventListener("abort",s));const{signal:l}=i;return l.unsubscribe=()=>ze.asap(a),l}},nAe=function*(n,e){let t=n.byteLength;if(t{const r=iAe(n,e);let s=0,o,a=l=>{o||(o=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await r.next();if(c){a(),l.close();return}let h=u.byteLength;if(t){let d=s+=h;t(d)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},Gw=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",u7=Gw&&typeof ReadableStream=="function",sAe=Gw&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),h7=(n,...e)=>{try{return!!n(...e)}catch{return!1}},oAe=u7&&h7(()=>{let n=!1;const e=new Request(ms.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),Yz=64*1024,HP=u7&&h7(()=>ze.isReadableStream(new Response("").body)),tA={stream:HP&&(n=>n.body)};Gw&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!tA[e]&&(tA[e]=ze.isFunction(n[e])?t=>t[e]():(t,i)=>{throw new jt(`Response type '${e}' is not supported`,jt.ERR_NOT_SUPPORT,i)})})})(new Response);const aAe=async n=>{if(n==null)return 0;if(ze.isBlob(n))return n.size;if(ze.isSpecCompliantForm(n))return(await new Request(ms.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(ze.isArrayBufferView(n)||ze.isArrayBuffer(n))return n.byteLength;if(ze.isURLSearchParams(n)&&(n=n+""),ze.isString(n))return(await sAe(n)).byteLength},lAe=async(n,e)=>{const t=ze.toFiniteNumber(n.getContentLength());return t??aAe(e)},cAe=Gw&&(async n=>{let{url:e,method:t,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:h="same-origin",fetchOptions:d}=c7(n);c=c?(c+"").toLowerCase():"text";let f=tAe([r,s&&s.toAbortSignal()],o),v;const _=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let y;try{if(l&&oAe&&t!=="get"&&t!=="head"&&(y=await lAe(u,i))!==0){let R=new Request(e,{method:"POST",body:i,duplex:"half"}),T;if(ze.isFormData(i)&&(T=R.headers.get("content-type"))&&u.setContentType(T),R.body){const[P,I]=Wz(y,eA($z(l)));i=jz(R.body,Yz,P,I)}}ze.isString(h)||(h=h?"include":"omit");const m="credentials"in Request.prototype;v=new Request(e,{...d,signal:f,method:t.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:m?h:void 0});let S=await fetch(v);const x=HP&&(c==="stream"||c==="response");if(HP&&(a||x&&_)){const R={};["status","statusText","headers"].forEach(b=>{R[b]=S[b]});const T=ze.toFiniteNumber(S.headers.get("content-length")),[P,I]=a&&Wz(T,eA($z(a),!0))||[];S=new Response(jz(S.body,Yz,P,()=>{I&&I(),_&&_()}),R)}c=c||"text";let M=await tA[ze.findKey(tA,c)||"text"](S,n);return!x&&_&&_(),await new Promise((R,T)=>{a7(R,T,{data:M,headers:gs.from(S.headers),status:S.status,statusText:S.statusText,config:n,request:v})})}catch(m){throw _&&_(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new jt("Network Error",jt.ERR_NETWORK,n,v),{cause:m.cause||m}):jt.from(m,m&&m.code,n,v)}}),VP={http:wMe,xhr:eAe,fetch:cAe};ze.forEach(VP,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const Jz=n=>`- ${n}`,uAe=n=>ze.isFunction(n)||n===null||n===!1,d7={getAdapter:n=>{n=ze.isArray(n)?n:[n];const{length:e}=n;let t,i;const r={};for(let s=0;s`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : -`+s.map(Jz).join(` -`):" "+Jz(s[0]):"as no adapter specified";throw new jt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:VP};function bC(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new mm(null,n)}function Kz(n){return bC(n),n.headers=gs.from(n.headers),n.data=TC.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),d7.getAdapter(n.adapter||Sy.adapter)(n).then(function(i){return bC(n),i.data=TC.call(n,n.transformResponse,i),i.headers=gs.from(i.headers),i},function(i){return o7(i)||(bC(n),i&&i.response&&(i.response.data=TC.call(n,n.transformResponse,i.response),i.response.headers=gs.from(i.response.headers))),Promise.reject(i)})}const f7="1.7.7",bD={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{bD[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});const qz={};bD.transitional=function(e,t,i){function r(s,o){return"[Axios v"+f7+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,a)=>{if(e===!1)throw new jt(r(o," has been removed"+(t?" in "+t:"")),jt.ERR_DEPRECATED);return t&&!qz[o]&&(qz[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,a):!0}};function hAe(n,e,t){if(typeof n!="object")throw new jt("options must be an object",jt.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let r=i.length;for(;r-- >0;){const s=i[r],o=e[s];if(o){const a=n[s],l=a===void 0||o(a,s,n);if(l!==!0)throw new jt("option "+s+" must be "+l,jt.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new jt("Unknown option "+s,jt.ERR_BAD_OPTION)}}const WP={assertOptions:hAe,validators:bD},Mc=WP.validators;class qh{constructor(e){this.defaults=e,this.interceptors={request:new Hz,response:new Hz}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=` -`+s):i.stack=s}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=pd(this.defaults,t);const{transitional:i,paramsSerializer:r,headers:s}=t;i!==void 0&&WP.assertOptions(i,{silentJSONParsing:Mc.transitional(Mc.boolean),forcedJSONParsing:Mc.transitional(Mc.boolean),clarifyTimeoutError:Mc.transitional(Mc.boolean)},!1),r!=null&&(ze.isFunction(r)?t.paramsSerializer={serialize:r}:WP.assertOptions(r,{encode:Mc.function,serialize:Mc.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&ze.merge(s.common,s[t.method]);s&&ze.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),t.headers=gs.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(t)===!1||(l=l&&_.synchronous,a.unshift(_.fulfilled,_.rejected))});const c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let u,h=0,d;if(!l){const v=[Kz.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),d=v.length,u=Promise.resolve(t);h{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(a=>{i.subscribe(a),s=a}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},e(function(s,o,a){i.reason||(i.reason=new mm(s,o,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CD(function(r){e=r}),cancel:e}}}function dAe(n){return function(t){return n.apply(null,t)}}function fAe(n){return ze.isObject(n)&&n.isAxiosError===!0}const $P={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($P).forEach(([n,e])=>{$P[e]=n});function p7(n){const e=new qh(n),t=$X(qh.prototype.request,e);return ze.extend(t,qh.prototype,e,{allOwnKeys:!0}),ze.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return p7(pd(n,r))},t}const Di=p7(Sy);Di.Axios=qh;Di.CanceledError=mm;Di.CancelToken=CD;Di.isCancel=o7;Di.VERSION=f7;Di.toFormData=zw;Di.AxiosError=jt;Di.Cancel=Di.CanceledError;Di.all=function(e){return Promise.all(e)};Di.spread=dAe;Di.isAxiosError=fAe;Di.mergeConfig=pd;Di.AxiosHeaders=gs;Di.formToJSON=n=>s7(ze.isHTMLForm(n)?new FormData(n):n);Di.getAdapter=d7.getAdapter;Di.HttpStatusCode=$P;Di.default=Di;const pAe=Di.create({baseURL:"https://api.github.com/repos/NivSv/my-portfolio"}),mAe=async()=>await pAe.get(""),gAe={getRepoData:mAe},vAe=()=>{const[n,e]=se.useState(0),[t,i]=se.useState(0);return se.useEffect(()=>{gAe.getRepoData().then(r=>{e(r.data.stargazers_count),i(r.data.forks_count)}).catch(r=>{console.log(r)})},[]),pe.jsxs("div",{className:"h-[10%] mt-16 mb-4 flex flex-col items-center",children:[pe.jsx("div",{className:"flex mb-5 gap-7 md:hidden",children:G2.map((r,s)=>pe.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",className:"inline-block",children:pe.jsx(r.icon,{size:27,className:"fill-primary hover:fill-callToAction transition-all duration-300"})},s))}),pe.jsxs("a",{href:"https://github.com/NivSv/my-portfolio",target:"_blank",rel:"noreferrer",className:"flex flex-col items-center justify-center group",children:[pe.jsx("p",{className:"text-primary text-base group-hover:text-callToAction transition-all duration-300",children:"Built by Niv Shtibel"}),pe.jsx(se.Suspense,{fallback:pe.jsx("div",{children:"Loading..."}),children:pe.jsxs("div",{className:"flex text-primary text-sm gap-4",children:[pe.jsxs("div",{className:"flex items-center gap-1 group-hover:text-callToAction group-hover:fill-callToAction transition-all duration-300",children:[pe.jsx(TSe,{}),pe.jsx("p",{children:n})]}),pe.jsxs("div",{className:"flex items-center text-sm gap-1 group-hover:text-callToAction group-hover:fill-callToAction transition-all duration-300",children:[pe.jsx(ASe,{}),pe.jsx("p",{children:t})]})]})})]})]})};function yAe(){return pe.jsxs("div",{className:"font-Assistant",children:[pe.jsx(qee,{}),pe.jsx(VJ,{}),pe.jsx(WJ,{}),pe.jsx(OSe,{}),pe.jsx(vAe,{}),pe.jsx(Rxe,{position:"bottom-right"})]})}CC.createRoot(document.getElementById("root")).render(pe.jsx(Qt.StrictMode,{children:pe.jsx(yAe,{})})); + The app includes field validation, error handling, Redux for state management, TypeScript for code quality, and a search filter for convenient user lookup.`,technologies:["React","Redux(toolkit)","Zod","Framer Motion","Vite"],github:"https://github.com/NivSv/Users-Library",demo:"https://nivsv.github.io/Users-Library",image:"https://i.ibb.co/0nZ3Z3S/Portfolio.png"},{title:"Users API",description:"This app is a user API with CRUD functionality, filtering, department/user count feature, and error handling. supporting create/delete departments, unit testing, and CI/CD.",technologies:["NestJS","Zod","Typescript","pg","Turborepo","Docker"],github:"https://github.com/NivSv/Users-API",demo:"https://users-api-iexe.onrender.com/api",image:"https://i.ibb.co/0nZ3Z3S/Portfolio.png"}];function bSe(n){return au({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M752 100c-61.8 0-112 50.2-112 112 0 47.7 29.9 88.5 72 104.6v27.6L512 601.4 312 344.2v-27.6c42.1-16.1 72-56.9 72-104.6 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 50.6 33.8 93.5 80 107.3v34.4c0 9.7 3.3 19.3 9.3 27L476 672.3v33.6c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-33.6l226.7-291.6c6-7.7 9.3-17.3 9.3-27v-34.4c46.2-13.8 80-56.7 80-107.3 0-61.8-50.2-112-112-112zM224 212a48.01 48.01 0 0 1 96 0 48.01 48.01 0 0 1-96 0zm336 600a48.01 48.01 0 0 1-96 0 48.01 48.01 0 0 1 96 0zm192-552a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"},child:[]}]})(n)}function CSe(n){return au({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"},child:[]}]})(n)}function RSe(n){return au({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"},child:[]}]})(n)}function PSe(n){return au({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 0 0 .6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0 0 46.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"},child:[]}]})(n)}const ISe=({project:n,key:e,leftSide:t})=>pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:yI({delay:.2*e,direction:t?"left":"right",duration:.5,type:"spring"}),className:"flex flex-col md:flex-row gap-10 justify-center mt-28",children:pe.jsxs("div",{className:"flex flex-col items-center gap-2",children:[pe.jsx("p",{className:"text-md text-callToAction",children:"Featured Project"}),pe.jsx("p",{className:"text-3xl text-primaryLight font-bold",children:n.title}),pe.jsx("div",{className:"text-primary border-solid bg-[#233554] p-2 border-[#233554] w-[400px] text-center rounded-md border-4 shadow-lg",children:n.description}),pe.jsx("div",{className:"flex gap-2 flex-wrap text-primary max-w-sm",children:n.technologies.map((i,r)=>pe.jsx("p",{children:i},r))}),pe.jsxs("div",{className:"flex",children:[n.demo&&pe.jsx("a",{href:n.demo,target:"_blank",rel:"noreferrer",title:"Demo Link",children:pe.jsx(RSe,{size:40,className:"fill-primaryLight hover:translate-y-[-4px] transition-all duration-400 hover:fill-callToAction"})}),n.github&&pe.jsx("a",{className:"hover:",href:n.github,target:"_blank",rel:"noreferrer",title:"Demo Link",children:pe.jsx(CSe,{size:40,className:"fill-primaryLight hover:translate-y-[-4px] transition-all duration-400 hover:fill-callToAction"})})]})]})},`project-${e}`),LSe=()=>pe.jsxs("section",{id:"projects",className:"container mt-44 mx-auto overflow-hidden",children:[pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:wA(null),className:"flex flex-col gap-2 items-center",children:pe.jsx("h1",{className:"text-secondary text-4xl sm:text-7xl inline font-bold",children:"Projects."})}),TSe.map((n,e)=>pe.jsx(ISe,{project:n,leftSide:e%2===0},e))]}),DSe=""+new URL("reactjs-LYxsbuPE.png",import.meta.url).href,BSe=""+new URL("docker-DrQKSZ7f.png",import.meta.url).href,NSe=""+new URL("nodejs-BctxLIqp.png",import.meta.url).href,USe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFoBAMAAACIy3zmAAAAJFBMVEXu7u7///+kHRDZLCBjZGZTVFbOHBCKi4zh1NOIBwDBsK/ddm4xh3M+AAANv0lEQVR42uycz2vcSBbHu8CJg3OpYrNYdC4TGcz25LLTDWKILwlIOPiUg0Qbn5YWiIVcNuDGwaf0Em+Cc+uBBbOXdDI9NsklWUPwJv/clurnq1JJ3RnsdGcoEYilKnV/9NWrV++9krpF+IZbfPsudlse2kN7aA/toT20h/bQHvqPCC02JI5/T7se2kN7aA/toT20h/bQHvqPBe2TAA/toT20h/bQHtpDe2gP7aumPnPx0B7aQ3toD+2hPbSH9tC+auqhPbSH9tAe2kN7aA/toX3V1GcuHtpDe2gP7aE9tIf20B7aV009tIf20B7aQ3toD+2hPbSvmvokwEN7aA/toT20h/bQHtpD+6qph756aIykVX030K96Ub51wY98J9DBeZHnvaLYGuHvBBqRV1HRY1uUvybfBTQqZe7JLacmsvzQZO2TRqZaF1to6aGpaUDmEntrtNzQCDPTiCQ4+6/IPywzNLlxzkfgB/Y/NQ3OXlwsMfRN6TX+Rt4WeZF/DoTizLCvDkse+D3Q75XXeExnl+jxhNyWB6LHoyuEDt69FrPY2jv0VdBYmAZTlo69gB67ro9Qw74y6GGWTdjuapbtfUXVlKxFBfAYP/Hjn4AXKX6+oogZraRxssfwkjim+HMmAcj0dEX+kR8voO8rhO+7dOhhTFnLQ+tpHCe7eE5oDCdBMJ+8LaDTLvLJlUBTfeOk/OhbFDremxM6OAdsUX6hBrX2J6Dp0hOqEjV5QndX6B9xfz5ok6w3IWALzo3Zsbh3+dDB74F+VfSsbevL2Q3RFa2ZTQX1fVcHnc4JDT2djOwKulH/Ebw/pzG11VhQE1m00m1lGiUqgKPzy/WiiORu99/aRD4jfJnQNxT0fANRebqIA0eAG0EvPQhPxsC7lCZyBUq3S5d3vxkaKU9Hw4xnzPUdK98XfSRK5igMw5OTk9yYHq8AuvTYMyaXMkUB8ZByckL7v7dzzbxZQp9swITmKqBXk2wHN3XWni66Zzg5IXAuo6VBGA6Y0icnwLDlpH6ZNk2DiTPU1Bm9UobwmBibgI3OATNX+kQbdq+YXL7SZUNTZ3SzsKMjtX0CaQszDaU0MBF11qVCN3dG2jVEEwv6X2AKpEOwpN5U0Errbw9NcF4PfR26uk2KvBEqpbVV/4AvKZ7GHHqOzCUA0B/d5sE3ahsM2zQOejl3Wt8eesOY/ODWNmsI1J7DrlBat3Q7FWhesJwbWnnZ+aHxGEj9wRTaKnx0Q2HTY+OYDY2C0zLTY1OUyPlKMnx8eHCGSMWWaMPBwbtnFjTMEQl5eXp4+AwqPQ5z7XQvYCya2wFUL2Q2/Yt5HTY05pkewadZJnI+OueeJuVedjiy8m1yzBt2RhAa5ohkbch7IKyVDjU1nRJfi097b8TWea6ogTkzZhu6jCsTGqFR9pKhzywg2M9KojjJ+iOjakxOeUOc9ScAmuWIor78QvUYYa20QV3QIPrLlx5EplFfLlOA7qZl5VXoafnVIzzkX5WMaJPcKfdTWDUmzzPQoKBZwPSIW/yq7iGpmdKQmjEWvRzs9b6cQZdtMVegWab35FeBWUKQXxVz+dVId17PYIPs3+KhKYMOEvtUqTR1ZQ6oMkAteizsw1HPaeAOaMw+/lDSUAggFjvyEMvOkEj3p9AsCSih0fPUPlUpTd2Cgzjf+iwKpX+qDMoobII2IPDQPJSOZOejtAY6ldDWZYlajlCabnautXWm49Tf6pkr0ObXJCO0YqGVevGJIIud0Egrfcs8N9nFUGnLsHtb0GNjO0HshuGcSvexEjpJtdR1QltKo2lsf5yptE2tda5YxwAwd35qUDrN7uN14Uay7Vg4L5pJOe6Jy6axHM7qA1s2tGHYZX3UGYSYzOEY1SpNGQ+JECvbpgN6bZgJvYhMX8smuqVupdup/CB5m/g3QQCTOpdRX5A73QYX+gdcB51s08vGAZ9Vdngrd36s9kXErc+2z16+UKZj2jS/ruwpZdhnf6ZMIvRmbED0HHUxwzoik/luJUdMtFct43VuHX0+ByMyZbsPZPjMiSjTUPl1WPe4xgduad14yuVnXxR0DApo2Kz4ZVmHyRzeRXaoTpTQEzajHXEUGThxH7ZHd/nVUKLyXCR9m1lhOuIXzMMXel3JfZEj3q6n7kXlcITW0TX7hlsjXKf0Hlb1WyqQyj4YUCqvht5vkUEJx2gqzSxoF8vrzfpIZuO3LZBNq2QHrGNg99SGr7CU0EYOpVOmhEck/GqSB/Jc4UscSu+qu/RuJLPx4Dxqos4nn+qZSydTo3SffxUzggQB6CMxT6ZaaNJSUptK87sxwnbKGJRFGYvaHI55DfOGmaSZNk19MdtdEcNHQ/Oal/Bme/rcdlpV+pqI7oiVjf+WO3jCvFcfIRnM1RJCokPSlpjSHhkZdcJuOb8FD/S5wl4MpbnLS9KniBgFp8KpYjXsi+ou647TpvewhmYgepuy5hV+aQD6qKp0W84/MU23NLRyDd0Gw25i7t5xKZ08wHrxJ945PDzg2yHd9pnBMMQUnrtSrU/jTMUD6SGA3qjD2mxiBg13XDYtfEerxS+BTtRJuWVyyu5zb9aH5647VgJAwJRtIwU9rjXasJZ5E57jVlruOgI57jWmYBzyzm3HSsC6mfMo6M3Z1N0G5tBp03I2CWqgY243uzPXXGACkfQVNGRwO5Fu3RhlN8Cp9O4M6JRDP5q55gKzSD6Lc2hI7RiOtUNQtLhsmrqyZug+aYQGq1vT1MjUFHSD9Va33L5Al9Jq3q6D3iON5gFWt/AQZuyPWNVUJAH1c0jt4Ow2ZeNPWqA+x+N8Y5twv7AHq2RBWk1sQaEnVvG0yhHzesN2D8FBOA804d93sL29f8D+0Y3uPCUO6HZaLSGwmPQ4UdjMlep0a2MOaueQdWXjGjqBVgA3PrlA6PVUZS5Aaabs8b5KL81svGE4Vq9rRjauoYdC0Er19hqIUHjrn2On0rx1TaQ25b2Bie3mjOG44WzuNCs9FZZYgb6ljEGeO41dNq1K7py6j+1sPG8ajnnNJU0alb4mLLECzWOhh6Dym7iU1tVKXj9JrWJNM3XuNp7Of3AjNBf0fvWRzyAFqYIyacumEX6mn3HlH8V6/6/ObAc1rs4apiPcaB7tVBc6BLQQL9HFuZauKJhKB/vpU2x8VMIKgbfHdQ6iOw/zhDQrjZMYRtRUvECINxWzjDi3nVaLNeh5mmQTecHrGpr8s5Y6cjDbRnMxA1pEPNtqRaadZLwAKQoxT4Tw09ShdMKTLeAkY/FNb2ZGpA2pQPFzs3kQka/+QzZTJ5CNgLTpiAm/msIKk1CaG8Q2LGb3eXH7ZlOCaGrvip2KUbN5tGEhiQRlXUy0imSyXy7zvMhcBUgxNpnWAXB55HZRnUxggthQqRGJbaPSGImIONt5Rmc2Hv08aunbXZZTD5LMWYCUBdf04PRUVPt2GfSnmalWI3Ov99dmpdUCRJbFMobYxdqxMOzUXepVPVRdlS9+ibXxOagH7h6VtXELuqXr/am0290WGKOulQChdDWw5fO+ysbDGZWPGubeoDGeLosV07QCxmsGq86VgEotD7buWdl4c72mzuq77swFQleWVmTBCQ/roFXdI3O0lplLXmezG/XM8JyZSpPnpqLZE/nw1Go2Q2nrVJ7ZsnSrKUGczTwHNE7S6i1md8VMAGNXNp5alytzxHxWvaZu9um6csQhX5+Aj8O0M7t6IVrB+nOcPRzKlY11/TBhAHvs6BICNF9XSlhbqRk4E9tyoS21nuFZVU4t649g57a6CZToSBbKRGEV8YUNecXZHoHQwHwrqdYgbGauQFNZs4f2g0dr3Bdn2bb1wDhNWzO2fnVIWuLM8mFCNtfzc7HoIXTW0IC625yNb1TXxu3Ho16wqpv1tFRwWs4u22fVZ6lOKVR6UL4bhk5Fva5Fb8BTXds93qeXrE7V0A0BhnsIgrXxCkfL8YgXIvjGS/1qiNHKnq9hA1N0EMG/Xn5tlaeiCnRDKNfM7ICu2cVf8zSt+bwwQsZu4Fobn1mpMdbGv/3Lze618UEzs7E2vmBoYNjdpkqNeUmjBbxGXgPWDeebHjt/Id8eGr2pXZeY4erq1sa/xRv69WvjTubKev5iXu1r11IPXJGoyYwWBF2hrs7ptcwLfIky6Iwbh2PNOnPnx4W++Rn8d1xX+hhs1nnv8cWiX1e1qWevjUvmBUKTN52vWxsfvyaLfzGYvGqmtlzdxoQsw9vMZK0z99p45+4IL8cr2CjojudbG6fueZE/QmH9YkOdEzGZx/cW+3Mf1m9j4Led2Wvj44sF/7CKtY/Izc6stfHxR9JaKuhy0cmaHe3tl8ky/hZCxbAtt7EEP+DgeGsO11Nzt4EWkKo0vezO/7aHozLnHwluLSd0qzo7mm5jOaFblRCbMX8g/2/njlEYhMEoADdbV6/gJj2lW+dsju0xPF3FIAXp0KHQPPg23T4C0byH/pee0eXDdqyP/kfPnbbjVOeIeXnP5fSoixjy93477gE2ZDLh8Q17W+eUcYrtiL3cyhCE3g6rYx3XTpRforeL670MYej2q3wcut/bMPS/zsQ/DgHQ0NDQ0NDQ0ND5aCEAGhoaGhoaGhpaayq5QENDQ0NDQ0NDa02hoaGhoaGhoaG1ppILNDQ0NDQ0NDS01hQaGhoaGhoaGlprKgRAQ0NDQ0NDQ0NrTaGhoaGhoaGhoXPQLwHdP1GgRzkLAAAAAElFTkSuQmCC",FSe=""+new URL("kafka-5lxhOryP.png",import.meta.url).href,OSe=[{name:"React",image:DSe},{name:"Docker",image:BSe},{name:"Node.js",image:NSe},{name:"Redis",image:USe},{name:"Kafka",image:FSe}],kSe=({icon:n})=>{const[e]=aD([n]);return pe.jsxs(yye,{speed:1.75,rotationIntensity:1,floatIntensity:2,children:[pe.jsx("ambientLight",{intensity:.25}),pe.jsx("directionalLight",{position:[0,0,.05]}),pe.jsxs("mesh",{castShadow:!0,receiveShadow:!0,scale:2.75,children:[pe.jsx("icosahedronGeometry",{args:[1,1]}),pe.jsx("meshStandardMaterial",{color:new ct(16775403),polygonOffset:!0,polygonOffsetFactor:-5,flatShading:!0}),pe.jsx(hye,{position:[0,0,1],rotation:[2*Math.PI,0,6.25],scale:1,map:e})]})]})},zSe=({icon:n})=>pe.jsxs($A,{frameloop:"demand",dpr:[1,2],gl:{preserveDrawingBuffer:!0},children:[pe.jsxs(se.Suspense,{fallback:pe.jsx(uD,{}),children:[pe.jsx(lD,{enablePan:!1,enableZoom:!1}),pe.jsx(kSe,{icon:n})]}),pe.jsx(bw,{all:!0})]}),GSe=()=>pe.jsxs("section",{id:"technologies",className:"container mt-44 mx-auto",children:[pe.jsx(vo.div,{initial:"hidden",whileInView:"show",variants:wA(null),className:"flex flex-col gap-2 items-center",children:pe.jsx("h1",{className:"text-secondary text-4xl sm:text-7xl inline font-bold",children:"Technologies."})}),pe.jsx("div",{className:"flex flex-row flex-wrap justify-center gap-10 mt-16",children:OSe.map(n=>pe.jsx("div",{className:"w-28 h-28",title:n.name,children:pe.jsx(zSe,{icon:n.image})},n.name))})]}),HSe=()=>pe.jsxs(pe.Fragment,{children:[pe.jsx(ESe,{}),pe.jsx(ite,{}),pe.jsx(GSe,{}),pe.jsx(MSe,{}),pe.jsx(LSe,{}),pe.jsx(tSe,{})]});function JX(n,e){return function(){return n.apply(e,arguments)}}const{toString:VSe}=Object.prototype,{getPrototypeOf:bD}=Object,Nw=(n=>e=>{const t=VSe.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),oa=n=>(n=n.toLowerCase(),e=>Nw(e)===n),Uw=n=>e=>typeof e===n,{isArray:mm}=Array,k0=Uw("undefined");function WSe(n){return n!==null&&!k0(n)&&n.constructor!==null&&!k0(n.constructor)&&Os(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const KX=oa("ArrayBuffer");function $Se(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&KX(n.buffer),e}const XSe=Uw("string"),Os=Uw("function"),qX=Uw("number"),Fw=n=>n!==null&&typeof n=="object",jSe=n=>n===!0||n===!1,Z1=n=>{if(Nw(n)!=="object")return!1;const e=bD(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},YSe=oa("Date"),JSe=oa("File"),KSe=oa("Blob"),qSe=oa("FileList"),ZSe=n=>Fw(n)&&Os(n.pipe),QSe=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Os(n.append)&&((e=Nw(n))==="formdata"||e==="object"&&Os(n.toString)&&n.toString()==="[object FormData]"))},eMe=oa("URLSearchParams"),[tMe,nMe,iMe,rMe]=["ReadableStream","Request","Response","Headers"].map(oa),sMe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _y(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,r;if(typeof n!="object"&&(n=[n]),mm(n))for(i=0,r=n.length;i0;)if(r=t[i],e===r.toLowerCase())return r;return null}const Nh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,QX=n=>!k0(n)&&n!==Nh;function OP(){const{caseless:n}=QX(this)&&this||{},e={},t=(i,r)=>{const s=n&&ZX(e,r)||r;Z1(e[s])&&Z1(i)?e[s]=OP(e[s],i):Z1(i)?e[s]=OP({},i):mm(i)?e[s]=i.slice():e[s]=i};for(let i=0,r=arguments.length;i(_y(e,(r,s)=>{t&&Os(r)?n[s]=JX(r,t):n[s]=r},{allOwnKeys:i}),n),aMe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),lMe=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},cMe=(n,e,t,i)=>{let r,s,o;const a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)o=r[s],(!i||i(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&bD(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},uMe=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},hMe=n=>{if(!n)return null;if(mm(n))return n;let e=n.length;if(!qX(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},dMe=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&bD(Uint8Array)),fMe=(n,e)=>{const i=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=i.next())&&!r.done;){const s=r.value;e.call(n,s[0],s[1])}},pMe=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},mMe=oa("HTMLFormElement"),gMe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,r){return i.toUpperCase()+r}),Gz=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),vMe=oa("RegExp"),e7=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};_y(t,(r,s)=>{let o;(o=e(r,s,n))!==!1&&(i[s]=o||r)}),Object.defineProperties(n,i)},yMe=n=>{e7(n,(e,t)=>{if(Os(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(Os(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},_Me=(n,e)=>{const t={},i=r=>{r.forEach(s=>{t[s]=!0})};return mm(n)?i(n):i(String(n).split(e)),t},xMe=()=>{},SMe=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,MC="abcdefghijklmnopqrstuvwxyz",Hz="0123456789",t7={DIGIT:Hz,ALPHA:MC,ALPHA_DIGIT:MC+MC.toUpperCase()+Hz},MMe=(n=16,e=t7.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;n--;)t+=e[Math.random()*i|0];return t};function AMe(n){return!!(n&&Os(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const wMe=n=>{const e=new Array(10),t=(i,r)=>{if(Fw(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const s=mm(i)?[]:{};return _y(i,(o,a)=>{const l=t(o,r+1);!k0(l)&&(s[a]=l)}),e[r]=void 0,s}}return i};return t(n,0)},EMe=oa("AsyncFunction"),TMe=n=>n&&(Fw(n)||Os(n))&&Os(n.then)&&Os(n.catch),n7=((n,e)=>n?setImmediate:e?((t,i)=>(Nh.addEventListener("message",({source:r,data:s})=>{r===Nh&&s===t&&i.length&&i.shift()()},!1),r=>{i.push(r),Nh.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Os(Nh.postMessage)),bMe=typeof queueMicrotask<"u"?queueMicrotask.bind(Nh):typeof process<"u"&&process.nextTick||n7,ze={isArray:mm,isArrayBuffer:KX,isBuffer:WSe,isFormData:QSe,isArrayBufferView:$Se,isString:XSe,isNumber:qX,isBoolean:jSe,isObject:Fw,isPlainObject:Z1,isReadableStream:tMe,isRequest:nMe,isResponse:iMe,isHeaders:rMe,isUndefined:k0,isDate:YSe,isFile:JSe,isBlob:KSe,isRegExp:vMe,isFunction:Os,isStream:ZSe,isURLSearchParams:eMe,isTypedArray:dMe,isFileList:qSe,forEach:_y,merge:OP,extend:oMe,trim:sMe,stripBOM:aMe,inherits:lMe,toFlatObject:cMe,kindOf:Nw,kindOfTest:oa,endsWith:uMe,toArray:hMe,forEachEntry:fMe,matchAll:pMe,isHTMLForm:mMe,hasOwnProperty:Gz,hasOwnProp:Gz,reduceDescriptors:e7,freezeMethods:yMe,toObjectSet:_Me,toCamelCase:gMe,noop:xMe,toFiniteNumber:SMe,findKey:ZX,global:Nh,isContextDefined:QX,ALPHABET:t7,generateString:MMe,isSpecCompliantForm:AMe,toJSONObject:wMe,isAsyncFn:EMe,isThenable:TMe,setImmediate:n7,asap:bMe};function jt(n,e,t,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}ze.inherits(jt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ze.toJSONObject(this.config),code:this.code,status:this.status}}});const i7=jt.prototype,r7={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{r7[n]={value:n}});Object.defineProperties(jt,r7);Object.defineProperty(i7,"isAxiosError",{value:!0});jt.from=(n,e,t,i,r,s)=>{const o=Object.create(i7);return ze.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),jt.call(o,n.message,e,t,i,r),o.cause=n,o.name=n.name,s&&Object.assign(o,s),o};const CMe=null;function kP(n){return ze.isPlainObject(n)||ze.isArray(n)}function s7(n){return ze.endsWith(n,"[]")?n.slice(0,-2):n}function Vz(n,e,t){return n?n.concat(e).map(function(r,s){return r=s7(r),!t&&s?"["+r+"]":r}).join(t?".":""):e}function RMe(n){return ze.isArray(n)&&!n.some(kP)}const PMe=ze.toFlatObject(ze,{},null,function(e){return/^is[A-Z]/.test(e)});function Ow(n,e,t){if(!ze.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=ze.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,y){return!ze.isUndefined(y[_])});const i=t.metaTokens,r=t.visitor||u,s=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&ze.isSpecCompliantForm(e);if(!ze.isFunction(r))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(ze.isDate(v))return v.toISOString();if(!l&&ze.isBlob(v))throw new jt("Blob is not supported. Use a Buffer instead.");return ze.isArrayBuffer(v)||ze.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function u(v,_,y){let m=v;if(v&&!y&&typeof v=="object"){if(ze.endsWith(_,"{}"))_=i?_:_.slice(0,-2),v=JSON.stringify(v);else if(ze.isArray(v)&&RMe(v)||(ze.isFileList(v)||ze.endsWith(_,"[]"))&&(m=ze.toArray(v)))return _=s7(_),m.forEach(function(x,M){!(ze.isUndefined(x)||x===null)&&e.append(o===!0?Vz([_],M,s):o===null?_:_+"[]",c(x))}),!1}return kP(v)?!0:(e.append(Vz(y,_,s),c(v)),!1)}const h=[],d=Object.assign(PMe,{defaultVisitor:u,convertValue:c,isVisitable:kP});function f(v,_){if(!ze.isUndefined(v)){if(h.indexOf(v)!==-1)throw Error("Circular reference detected in "+_.join("."));h.push(v),ze.forEach(v,function(m,S){(!(ze.isUndefined(m)||m===null)&&r.call(e,m,ze.isString(S)?S.trim():S,_,d))===!0&&f(m,_?_.concat(S):[S])}),h.pop()}}if(!ze.isObject(n))throw new TypeError("data must be an object");return f(n),e}function Wz(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function CD(n,e){this._pairs=[],n&&Ow(n,this,e)}const o7=CD.prototype;o7.append=function(e,t){this._pairs.push([e,t])};o7.toString=function(e){const t=e?function(i){return e.call(this,i,Wz)}:Wz;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function IMe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function a7(n,e,t){if(!e)return n;const i=t&&t.encode||IMe,r=t&&t.serialize;let s;if(r?s=r(e,t):s=ze.isURLSearchParams(e)?e.toString():new CD(e,t).toString(i),s){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+s}return n}class $z{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ze.forEach(this.handlers,function(i){i!==null&&e(i)})}}const l7={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},LMe=typeof URLSearchParams<"u"?URLSearchParams:CD,DMe=typeof FormData<"u"?FormData:null,BMe=typeof Blob<"u"?Blob:null,NMe={isBrowser:!0,classes:{URLSearchParams:LMe,FormData:DMe,Blob:BMe},protocols:["http","https","file","blob","url","data"]},RD=typeof window<"u"&&typeof document<"u",zP=typeof navigator=="object"&&navigator||void 0,UMe=RD&&(!zP||["ReactNative","NativeScript","NS"].indexOf(zP.product)<0),FMe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",OMe=RD&&window.location.href||"http://localhost",kMe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:RD,hasStandardBrowserEnv:UMe,hasStandardBrowserWebWorkerEnv:FMe,navigator:zP,origin:OMe},Symbol.toStringTag,{value:"Module"})),ms={...kMe,...NMe};function zMe(n,e){return Ow(n,new ms.classes.URLSearchParams,Object.assign({visitor:function(t,i,r,s){return ms.isNode&&ze.isBuffer(t)?(this.append(i,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function GMe(n){return ze.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function HMe(n){const e={},t=Object.keys(n);let i;const r=t.length;let s;for(i=0;i=t.length;return o=!o&&ze.isArray(r)?r.length:o,l?(ze.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!a):((!r[o]||!ze.isObject(r[o]))&&(r[o]=[]),e(t,i,r[o],s)&&ze.isArray(r[o])&&(r[o]=HMe(r[o])),!a)}if(ze.isFormData(n)&&ze.isFunction(n.entries)){const t={};return ze.forEachEntry(n,(i,r)=>{e(GMe(i),r,t,0)}),t}return null}function VMe(n,e,t){if(ze.isString(n))try{return(e||JSON.parse)(n),ze.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(0,JSON.stringify)(n)}const xy={transitional:l7,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const i=t.getContentType()||"",r=i.indexOf("application/json")>-1,s=ze.isObject(e);if(s&&ze.isHTMLForm(e)&&(e=new FormData(e)),ze.isFormData(e))return r?JSON.stringify(c7(e)):e;if(ze.isArrayBuffer(e)||ze.isBuffer(e)||ze.isStream(e)||ze.isFile(e)||ze.isBlob(e)||ze.isReadableStream(e))return e;if(ze.isArrayBufferView(e))return e.buffer;if(ze.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return zMe(e,this.formSerializer).toString();if((a=ze.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ow(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),VMe(e)):e}],transformResponse:[function(e){const t=this.transitional||xy.transitional,i=t&&t.forcedJSONParsing,r=this.responseType==="json";if(ze.isResponse(e)||ze.isReadableStream(e))return e;if(e&&ze.isString(e)&&(i&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?jt.from(a,jt.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ms.classes.FormData,Blob:ms.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ze.forEach(["delete","get","head","post","put","patch"],n=>{xy.headers[n]={}});const WMe=ze.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$Me=n=>{const e={};let t,i,r;return n&&n.split(` +`).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!t||e[t]&&WMe[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},Xz=Symbol("internals");function Rg(n){return n&&String(n).trim().toLowerCase()}function Q1(n){return n===!1||n==null?n:ze.isArray(n)?n.map(Q1):String(n)}function XMe(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const jMe=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function AC(n,e,t,i,r){if(ze.isFunction(i))return i.call(this,e,t);if(r&&(e=t),!!ze.isString(e)){if(ze.isString(i))return e.indexOf(i)!==-1;if(ze.isRegExp(i))return i.test(e)}}function YMe(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function JMe(n,e){const t=ze.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(r,s,o){return this[i].call(this,e,r,s,o)},configurable:!0})})}class gs{constructor(e){e&&this.set(e)}set(e,t,i){const r=this;function s(a,l,c){const u=Rg(l);if(!u)throw new Error("header name must be a non-empty string");const h=ze.findKey(r,u);(!h||r[h]===void 0||c===!0||c===void 0&&r[h]!==!1)&&(r[h||l]=Q1(a))}const o=(a,l)=>ze.forEach(a,(c,u)=>s(c,u,l));if(ze.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(ze.isString(e)&&(e=e.trim())&&!jMe(e))o($Me(e),t);else if(ze.isHeaders(e))for(const[a,l]of e.entries())s(l,a,i);else e!=null&&s(t,e,i);return this}get(e,t){if(e=Rg(e),e){const i=ze.findKey(this,e);if(i){const r=this[i];if(!t)return r;if(t===!0)return XMe(r);if(ze.isFunction(t))return t.call(this,r,i);if(ze.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Rg(e),e){const i=ze.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||AC(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let r=!1;function s(o){if(o=Rg(o),o){const a=ze.findKey(i,o);a&&(!t||AC(i,i[a],a,t))&&(delete i[a],r=!0)}}return ze.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let i=t.length,r=!1;for(;i--;){const s=t[i];(!e||AC(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const t=this,i={};return ze.forEach(this,(r,s)=>{const o=ze.findKey(i,s);if(o){t[o]=Q1(r),delete t[s];return}const a=e?YMe(s):String(s).trim();a!==s&&delete t[s],t[a]=Q1(r),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ze.forEach(this,(i,r)=>{i!=null&&i!==!1&&(t[r]=e&&ze.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[Xz]=this[Xz]={accessors:{}}).accessors,r=this.prototype;function s(o){const a=Rg(o);i[a]||(JMe(r,o),i[a]=!0)}return ze.isArray(e)?e.forEach(s):s(e),this}}gs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ze.reduceDescriptors(gs.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});ze.freezeMethods(gs);function wC(n,e){const t=this||xy,i=e||t,r=gs.from(i.headers);let s=i.data;return ze.forEach(n,function(a){s=a.call(t,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function u7(n){return!!(n&&n.__CANCEL__)}function gm(n,e,t){jt.call(this,n??"canceled",jt.ERR_CANCELED,e,t),this.name="CanceledError"}ze.inherits(gm,jt,{__CANCEL__:!0});function h7(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new jt("Request failed with status code "+t.status,[jt.ERR_BAD_REQUEST,jt.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function KMe(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function qMe(n,e){n=n||10;const t=new Array(n),i=new Array(n);let r=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=i[s];o||(o=c),t[r]=l,i[r]=c;let h=s,d=0;for(;h!==r;)d+=t[h++],h=h%n;if(r=(r+1)%n,r===s&&(s=(s+1)%n),c-o{t=u,r=null,s&&(clearTimeout(s),s=null),n.apply(null,c)};return[(...c)=>{const u=Date.now(),h=u-t;h>=i?o(c,u):(r=c,s||(s=setTimeout(()=>{s=null,o(r)},i-h)))},()=>r&&o(r)]}const eA=(n,e,t=3)=>{let i=0;const r=qMe(50,250);return ZMe(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-i,c=r(l),u=o<=a;i=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(h)},t)},jz=(n,e)=>{const t=n!=null;return[i=>e[0]({lengthComputable:t,total:n,loaded:i}),e[1]]},Yz=n=>(...e)=>ze.asap(()=>n(...e)),QMe=ms.hasStandardBrowserEnv?function(){const e=ms.navigator&&/(msie|trident)/i.test(ms.navigator.userAgent),t=document.createElement("a");let i;function r(s){let o=s;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return i=r(window.location.href),function(o){const a=ze.isString(o)?r(o):o;return a.protocol===i.protocol&&a.host===i.host}}():function(){return function(){return!0}}(),eAe=ms.hasStandardBrowserEnv?{write(n,e,t,i,r,s){const o=[n+"="+encodeURIComponent(e)];ze.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),ze.isString(i)&&o.push("path="+i),ze.isString(r)&&o.push("domain="+r),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tAe(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function nAe(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function d7(n,e){return n&&!tAe(e)?nAe(n,e):e}const Jz=n=>n instanceof gs?{...n}:n;function pd(n,e){e=e||{};const t={};function i(c,u,h){return ze.isPlainObject(c)&&ze.isPlainObject(u)?ze.merge.call({caseless:h},c,u):ze.isPlainObject(u)?ze.merge({},u):ze.isArray(u)?u.slice():u}function r(c,u,h){if(ze.isUndefined(u)){if(!ze.isUndefined(c))return i(void 0,c,h)}else return i(c,u,h)}function s(c,u){if(!ze.isUndefined(u))return i(void 0,u)}function o(c,u){if(ze.isUndefined(u)){if(!ze.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,h){if(h in e)return i(c,u);if(h in n)return i(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>r(Jz(c),Jz(u),!0)};return ze.forEach(Object.keys(Object.assign({},n,e)),function(u){const h=l[u]||r,d=h(n[u],e[u],u);ze.isUndefined(d)&&h!==a||(t[u]=d)}),t}const f7=n=>{const e=pd({},n);let{data:t,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=gs.from(o),e.url=a7(d7(e.baseURL,e.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(ze.isFormData(t)){if(ms.hasStandardBrowserEnv||ms.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(ms.hasStandardBrowserEnv&&(i&&ze.isFunction(i)&&(i=i(e)),i||i!==!1&&QMe(e.url))){const c=r&&s&&eAe.read(s);c&&o.set(r,c)}return e},iAe=typeof XMLHttpRequest<"u",rAe=iAe&&function(n){return new Promise(function(t,i){const r=f7(n);let s=r.data;const o=gs.from(r.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=r,u,h,d,f,v;function _(){f&&f(),v&&v(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function m(){if(!y)return;const x=gs.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),R={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};h7(function(P){t(P),_()},function(P){i(P),_()},R),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(m)},y.onabort=function(){y&&(i(new jt("Request aborted",jt.ECONNABORTED,n,y)),y=null)},y.onerror=function(){i(new jt("Network Error",jt.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let M=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const R=r.transitional||l7;r.timeoutErrorMessage&&(M=r.timeoutErrorMessage),i(new jt(M,R.clarifyTimeoutError?jt.ETIMEDOUT:jt.ECONNABORTED,n,y)),y=null},s===void 0&&o.setContentType(null),"setRequestHeader"in y&&ze.forEach(o.toJSON(),function(M,R){y.setRequestHeader(R,M)}),ze.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),c&&([d,v]=eA(c,!0),y.addEventListener("progress",d)),l&&y.upload&&([h,f]=eA(l),y.upload.addEventListener("progress",h),y.upload.addEventListener("loadend",f)),(r.cancelToken||r.signal)&&(u=x=>{y&&(i(!x||x.type?new gm(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const S=KMe(r.url);if(S&&ms.protocols.indexOf(S)===-1){i(new jt("Unsupported protocol "+S+":",jt.ERR_BAD_REQUEST,n));return}y.send(s||null)})},sAe=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let i=new AbortController,r;const s=function(c){if(!r){r=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof jt?u:new gm(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,s(new jt(`timeout ${e} of ms exceeded`,jt.ETIMEDOUT))},e);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),n=null)};n.forEach(c=>c.addEventListener("abort",s));const{signal:l}=i;return l.unsubscribe=()=>ze.asap(a),l}},oAe=function*(n,e){let t=n.byteLength;if(t{const r=aAe(n,e);let s=0,o,a=l=>{o||(o=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await r.next();if(c){a(),l.close();return}let h=u.byteLength;if(t){let d=s+=h;t(d)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},kw=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",p7=kw&&typeof ReadableStream=="function",cAe=kw&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),m7=(n,...e)=>{try{return!!n(...e)}catch{return!1}},uAe=p7&&m7(()=>{let n=!1;const e=new Request(ms.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),qz=64*1024,GP=p7&&m7(()=>ze.isReadableStream(new Response("").body)),tA={stream:GP&&(n=>n.body)};kw&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!tA[e]&&(tA[e]=ze.isFunction(n[e])?t=>t[e]():(t,i)=>{throw new jt(`Response type '${e}' is not supported`,jt.ERR_NOT_SUPPORT,i)})})})(new Response);const hAe=async n=>{if(n==null)return 0;if(ze.isBlob(n))return n.size;if(ze.isSpecCompliantForm(n))return(await new Request(ms.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(ze.isArrayBufferView(n)||ze.isArrayBuffer(n))return n.byteLength;if(ze.isURLSearchParams(n)&&(n=n+""),ze.isString(n))return(await cAe(n)).byteLength},dAe=async(n,e)=>{const t=ze.toFiniteNumber(n.getContentLength());return t??hAe(e)},fAe=kw&&(async n=>{let{url:e,method:t,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:h="same-origin",fetchOptions:d}=f7(n);c=c?(c+"").toLowerCase():"text";let f=sAe([r,s&&s.toAbortSignal()],o),v;const _=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let y;try{if(l&&uAe&&t!=="get"&&t!=="head"&&(y=await dAe(u,i))!==0){let R=new Request(e,{method:"POST",body:i,duplex:"half"}),T;if(ze.isFormData(i)&&(T=R.headers.get("content-type"))&&u.setContentType(T),R.body){const[P,I]=jz(y,eA(Yz(l)));i=Kz(R.body,qz,P,I)}}ze.isString(h)||(h=h?"include":"omit");const m="credentials"in Request.prototype;v=new Request(e,{...d,signal:f,method:t.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:m?h:void 0});let S=await fetch(v);const x=GP&&(c==="stream"||c==="response");if(GP&&(a||x&&_)){const R={};["status","statusText","headers"].forEach(b=>{R[b]=S[b]});const T=ze.toFiniteNumber(S.headers.get("content-length")),[P,I]=a&&jz(T,eA(Yz(a),!0))||[];S=new Response(Kz(S.body,qz,P,()=>{I&&I(),_&&_()}),R)}c=c||"text";let M=await tA[ze.findKey(tA,c)||"text"](S,n);return!x&&_&&_(),await new Promise((R,T)=>{h7(R,T,{data:M,headers:gs.from(S.headers),status:S.status,statusText:S.statusText,config:n,request:v})})}catch(m){throw _&&_(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new jt("Network Error",jt.ERR_NETWORK,n,v),{cause:m.cause||m}):jt.from(m,m&&m.code,n,v)}}),HP={http:CMe,xhr:rAe,fetch:fAe};ze.forEach(HP,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const Zz=n=>`- ${n}`,pAe=n=>ze.isFunction(n)||n===null||n===!1,g7={getAdapter:n=>{n=ze.isArray(n)?n:[n];const{length:e}=n;let t,i;const r={};for(let s=0;s`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : +`+s.map(Zz).join(` +`):" "+Zz(s[0]):"as no adapter specified";throw new jt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:HP};function EC(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new gm(null,n)}function Qz(n){return EC(n),n.headers=gs.from(n.headers),n.data=wC.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),g7.getAdapter(n.adapter||xy.adapter)(n).then(function(i){return EC(n),i.data=wC.call(n,n.transformResponse,i),i.headers=gs.from(i.headers),i},function(i){return u7(i)||(EC(n),i&&i.response&&(i.response.data=wC.call(n,n.transformResponse,i.response),i.response.headers=gs.from(i.response.headers))),Promise.reject(i)})}const v7="1.7.7",PD={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{PD[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});const e4={};PD.transitional=function(e,t,i){function r(s,o){return"[Axios v"+v7+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,a)=>{if(e===!1)throw new jt(r(o," has been removed"+(t?" in "+t:"")),jt.ERR_DEPRECATED);return t&&!e4[o]&&(e4[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,a):!0}};function mAe(n,e,t){if(typeof n!="object")throw new jt("options must be an object",jt.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let r=i.length;for(;r-- >0;){const s=i[r],o=e[s];if(o){const a=n[s],l=a===void 0||o(a,s,n);if(l!==!0)throw new jt("option "+s+" must be "+l,jt.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new jt("Unknown option "+s,jt.ERR_BAD_OPTION)}}const VP={assertOptions:mAe,validators:PD},Sc=VP.validators;class qh{constructor(e){this.defaults=e,this.interceptors={request:new $z,response:new $z}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=` +`+s):i.stack=s}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=pd(this.defaults,t);const{transitional:i,paramsSerializer:r,headers:s}=t;i!==void 0&&VP.assertOptions(i,{silentJSONParsing:Sc.transitional(Sc.boolean),forcedJSONParsing:Sc.transitional(Sc.boolean),clarifyTimeoutError:Sc.transitional(Sc.boolean)},!1),r!=null&&(ze.isFunction(r)?t.paramsSerializer={serialize:r}:VP.assertOptions(r,{encode:Sc.function,serialize:Sc.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&ze.merge(s.common,s[t.method]);s&&ze.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),t.headers=gs.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(t)===!1||(l=l&&_.synchronous,a.unshift(_.fulfilled,_.rejected))});const c=[];this.interceptors.response.forEach(function(_){c.push(_.fulfilled,_.rejected)});let u,h=0,d;if(!l){const v=[Qz.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,c),d=v.length,u=Promise.resolve(t);h{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(a=>{i.subscribe(a),s=a}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},e(function(s,o,a){i.reason||(i.reason=new gm(s,o,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ID(function(r){e=r}),cancel:e}}}function gAe(n){return function(t){return n.apply(null,t)}}function vAe(n){return ze.isObject(n)&&n.isAxiosError===!0}const WP={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(WP).forEach(([n,e])=>{WP[e]=n});function y7(n){const e=new qh(n),t=JX(qh.prototype.request,e);return ze.extend(t,qh.prototype,e,{allOwnKeys:!0}),ze.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return y7(pd(n,r))},t}const Di=y7(xy);Di.Axios=qh;Di.CanceledError=gm;Di.CancelToken=ID;Di.isCancel=u7;Di.VERSION=v7;Di.toFormData=Ow;Di.AxiosError=jt;Di.Cancel=Di.CanceledError;Di.all=function(e){return Promise.all(e)};Di.spread=gAe;Di.isAxiosError=vAe;Di.mergeConfig=pd;Di.AxiosHeaders=gs;Di.formToJSON=n=>c7(ze.isHTMLForm(n)?new FormData(n):n);Di.getAdapter=g7.getAdapter;Di.HttpStatusCode=WP;Di.default=Di;const yAe=Di.create({baseURL:"https://api.github.com/repos/NivSv/my-portfolio"}),_Ae=async()=>await yAe.get(""),xAe={getRepoData:_Ae},SAe=()=>{const[n,e]=se.useState(0),[t,i]=se.useState(0);return se.useEffect(()=>{xAe.getRepoData().then(r=>{e(r.data.stargazers_count),i(r.data.forks_count)}).catch(r=>{console.log(r)})},[]),pe.jsxs("div",{className:"h-[10%] mt-16 mb-4 flex flex-col items-center",children:[pe.jsx("div",{className:"flex mb-5 gap-7 md:hidden",children:z2.map((r,s)=>pe.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",className:"inline-block",children:pe.jsx(r.icon,{size:27,className:"fill-primary hover:fill-callToAction transition-all duration-300"})},s))}),pe.jsxs("a",{href:"https://github.com/NivSv/my-portfolio",target:"_blank",rel:"noreferrer",className:"flex flex-col items-center justify-center group",children:[pe.jsx("p",{className:"text-primary text-base group-hover:text-callToAction transition-all duration-300",children:"Built by Niv Shtibel"}),pe.jsx(se.Suspense,{fallback:pe.jsx("div",{children:"Loading..."}),children:pe.jsxs("div",{className:"flex text-primary text-sm gap-4",children:[pe.jsxs("div",{className:"flex items-center gap-1 group-hover:text-callToAction group-hover:fill-callToAction transition-all duration-300",children:[pe.jsx(PSe,{}),pe.jsx("p",{children:n})]}),pe.jsxs("div",{className:"flex items-center text-sm gap-1 group-hover:text-callToAction group-hover:fill-callToAction transition-all duration-300",children:[pe.jsx(bSe,{}),pe.jsx("p",{children:t})]})]})})]})]})};function MAe(){return pe.jsxs("div",{className:"font-Assistant",children:[pe.jsx(tte,{}),pe.jsx(jJ,{}),pe.jsx(YJ,{}),pe.jsx(HSe,{}),pe.jsx(SAe,{}),pe.jsx(Dxe,{position:"bottom-right"})]})}TC.createRoot(document.getElementById("root")).render(pe.jsx(Qt.StrictMode,{children:pe.jsx(MAe,{})})); diff --git a/index.html b/index.html index 432a938..a1ddba9 100644 --- a/index.html +++ b/index.html @@ -88,7 +88,7 @@ }) } - +