PageSourceSearch

https://lotcheck.ai/assets/js/editor.js

js lotcheck.ai collected 2026-10-05 12:52:30 UTC 1,253,395 bytes, 4,881 lines download raw bytes

vendor: 9,661 bytes, line 1
1(()=>{var WF=Object.create;var JS=Object.defineProperty;var XF=Object.getOwnPropertyDescriptor;var qF=Object.getOwnPropertyNames;var YF=Object.getPrototypeOf,jF=Object.prototype.hasOwnProperty;var zr=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),ZF=(n,e)=>{for(var t in e)JS(n,t,{get:e[t],enumerable:!0})},KF=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qF(e))!jF.call(n,r)&&r!==t&&JS(n,r,{get:()=>e[r],enumerable:!(i=XF(e,r))||i.enumerable});return n};var gi=(n,e,t)=>(t=n!=null?WF(YF(n)):{},KF(e||!n||!n.__esModule?JS(t,"default",{value:n,enumerable:!0}):t,n));var O3=zr(Ct=>{"use strict";var tT=Symbol.for("react.transitional.element"),QF=Symbol.for("react.portal"),JF=Symbol.for("react.fragment"),$F=Symbol.for("react.strict_mode"),e4=Symbol.for("react.profiler"),t4=Symbol.for("react.consumer"),n4=Symbol.for("react.context"),i4=Symbol.for("react.forward_ref"),r4=Symbol.for("react.suspense"),a4=Symbol.for("react.memo"),w3=Symbol.for("react.lazy"),o4=Symbol.for("react.activity"),S3=Symbol.iterator;function s4(n){return n===null||typeof n!="object"?null:(n=S3&&n[S3]||n["@@iterator"],typeof n=="function"?n:null)}var A3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C3=Object.assign,R3={};function Qf(n,e,t){this.props=n,this.context=e,this.refs=R3,this.updater=t||A3}Qf.prototype.isReactComponent={};Qf.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("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")};Qf.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function D3(){}D3.prototype=Qf.prototype;function nT(n,e,t){this.props=n,this.context=e,this.refs=R3,this.updater=t||A3}var iT=nT.prototype=new D3;iT.constructor=nT;C3(iT,Qf.prototype);iT.isPureReactComponent=!0;var T3=Array.isArray;function eT(){}var wn={H:null,A:null,T:null,S:null},U3=Object.prototype.hasOwnProperty;function rT(n,e,t){var i=t.ref;return{$$typeof:tT,type:n,key:e,ref:i!==void 0?i:null,props:t}}function l4(n,e){return rT(n.type,e,n.props)}function aT(n){return typeof n=="object"&&n!==null&&n.$$typeof===tT}function u4(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var E3=/\/+/g;function $S(n,e){return typeof n=="object"&&n!==null&&n.key!=null?u4(""+n.key):e.toString(36)}function c4(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(eT,eT):(n.status="pending",n.then(function(e){n.status==="pending"&&(n.status="fulfilled",n.value=e)},function(e){n.status==="pending"&&(n.status="rejected",n.reason=e)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Kf(n,e,t,i,r){var a=typeof n;(a==="undefined"||a==="boolean")&&(n=null);var o=!1;if(n===null)o=!0;else switch(a){case"bigint":case"string":case"number":o=!0;break;case"object":switch(n.$$typeof){case tT:case QF:o=!0;break;case w3:return o=n._init,Kf(o(n._payload),e,t,i,r)}}if(o)return r=r(n),o=i===""?"."+$S(n,0):i,T3(r)?(t="",o!=null&&(t=o.replace(E3,"$&/")+"/"),Kf(r,e,t,"",function(f){return f})):r!=null&&(aT(r)&&(r=l4(r,t+(r.key==null||n&&n.key===r.key?"":(""+r.key).replace(E3,"$&/")+"/")+o)),e.push(r)),1;o=0;var l=i===""?".":i+":";if(T3(n))for(var c=0;c<n.length;c++)i=n[c],a=l+$S(i,c),o+=Kf(i,e,t,a,r);else if(c=s4(n),typeof c=="function")for(n=c.call(n),c=0;!(i=n.next()).done;)i=i.value,a=l+$S(i,c++),o+=Kf(i,e,t,a,r);else if(a==="object"){if(typeof n.then=="function")return Kf(c4(n),e,t,i,r);throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function yy(n,e,t){if(n==null)return n;var i=[],r=0;return Kf(n,i,"","",function(a){return e.call(t,a,r++)}),i}function f4(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var M3=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},d4={map:yy,forEach:function(n,e,t){yy(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return yy(n,function(){e++}),e},toArray:function(n){return yy(n,function(e){return e})||[]},only:function(n){if(!aT(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Ct.Activity=o4;Ct.Children=d4;Ct.Component=Qf;Ct.Fragment=JF;Ct.Profiler=e4;Ct.PureComponent=nT;Ct.StrictMode=$F;Ct.Suspense=r4;Ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=wn;Ct.__COMPILER_RUNTIME={__proto__:null,c:function(n){return wn.H.useMemoCache(n)}};Ct.cache=function(n){return function(){return n.apply(null,arguments)}};Ct.cacheSignal=function(){return null};Ct.cloneElement=function(n,e,t){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var i=C3({},n.props),r=n.key;if(e!=null)for(a in e.key!==void 0&&(r=""+e.key),e)!U3.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(i[a]=e[a]);var a=arguments.length-2;if(a===1)i.children=t;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];i.children=o}return rT(n.type,r,i)};Ct.createContext=function(n){return n={$$typeof:n4,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:t4,_context:n},n};Ct.createElement=function(n,e,t){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)U3.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=t;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];r.children=l}if(n&&n.defaultProps)for(i in o=n.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return rT(n,a,r)};Ct.createRef=function(){return{current:null}};Ct.forwardRef=function(n){return{$$typeof:i4,render:n}};Ct.isValidElement=aT;Ct.lazy=function(n){return{$$typeof:w3,_payload:{_status:-1,_result:n},_init:f4}};Ct.memo=function(n,e){return{$$typeof:a4,type:n,compare:e===void 0?null:e}};Ct.startTransition=function(n){var e=wn.T,t={};wn.T=t;try{var i=n(),r=wn.S;r!==null&&r(t,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(eT,M3)}catch(a){M3(a)}finally{e!==null&&t.types!==null&&(e.types=t.types),wn.T=e}};Ct.unstable_useCacheRefresh=function(){return wn.H.useCacheRefresh()};Ct.use=function(n){return wn.H.use(n)};Ct.useActionState=function(n,e,t){return wn.H.useActionState(n,e,t)};Ct.useCallback=function(n,e){return wn.H.useCallback(n,e)};Ct.useContext=function(n){return wn.H.useContext(n)};Ct.useDebugValue=function(){};Ct.useDeferredValue=function(n,e){return wn.H.useDeferredValue(n,e)};Ct.useEffect=function(n,e){return wn.H.useEffect(n,e)};Ct.useEffectEvent=function(n){return wn.H.useEffectEvent(n)};Ct.useId=function(){return wn.H.useId()};Ct.useImperativeHandle=function(n,e,t){return wn.H.useImperativeHandle(n,e,t)};Ct.useInsertionEffect=function(n,e){return wn.H.useInsertionEffect(n,e)};Ct.useLayoutEffect=function(n,e){return wn.H.useLayoutEffect(n,e)};Ct.useMemo=function(n,e){return wn.H.useMemo(n,e)};Ct.useOptimistic=function(n,e){return wn.H.useOptimistic(n,e)};Ct.useReducer=function(n,e,t){return wn.H.useReducer(n,e,t)};Ct.useRef=function(n){return wn.H.useRef(n)};Ct.useState=function(n){return wn.H.useState(n)};Ct.useSyncExternalStore=function(n,e,t){return wn.H.useSyncExternalStore(n,e,t)};Ct.useTransition=function(){return wn.H.useTransition()};Ct.version="19.2.4"});var or=zr((qX,L3)=>{"use strict";L3.exports=O3()});var G3=zr(On=>{"use strict";function uT(n,e){var t=n.length;n.push(e);e:for(;0<t;){var i=t-1>>>1,r=n[i];if(0<_y(r,e))n[i]=e,n[t]=r,t=i;else break e}}function Lo(n){return n.length===0?null:n[0]}function xy(n){if(n.length===0)return null;var e=n[0],t=n.pop();if(t!==e){n[0]=t;e:for(var i=0,r=n.length,a=r>>>1;i<a;){var o=2*(i+1)-1,l=n[o],c=o+1,f=n[c];if(0>_y(l,t))c<r&&0>_y(f,l)?(n[i]=f,n[c]=t,i=c):(n[i]=l,n[o]=t,i=o);else if(c<r&&0>_y(f,t))n[i]=f,n[c]=t,i=c;else break e}}return e}function _y(n,e){var t=n.sortIndex-e.sortIndex;return t!==0?t:n.id-e.id}On.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(N3=performance,On.unstable_now=function(){return N3.now()}):(oT=Date,P3=oT.now(),On.unstable_now=function(){return oT.now()-P3});var N3,oT,P3,bs=[],Pl=[],h4=1,Pa=null,sr=3,cT=!1,Xp=!1,qp=!1,fT=!1,k3=typeof setTimeout=="function"?setTimeout:null,F3=typeof clearTimeout=="function"?clearTimeout:null,I3=typeof setImmediate<"u"?setImmediate:null;function by(n){for(var e=Lo(Pl);e!==null;){if(e.callback===null)xy(Pl);else if(e.startTime<=n)xy(Pl),e.sortIndex=e.expirationTime,uT(bs,e);else break;e=Lo(Pl)}}function dT(n){if(qp=!1,by(n),!Xp)if(Lo(bs)!==null)Xp=!0,$f||($f=!0,Jf());else{var e=Lo(Pl);e!==null&&hT(dT,e.startTime-n)}}var $f=!1,Yp=-1,B3=5,H3=-1;function V3(){return fT?!0:!(On.unstable_now()-H3<B3)}
vendor: 15,375 bytes, lines 1-8
1function sT(){if(fT=!1,$f){var n=On.unstable_now();H3=n;var e=!0;try{e:{Xp=!1,qp&&(qp=!1,F3(Yp),Yp=-1),cT=!0;var t=sr;try{t:{for(by(n),Pa=Lo(bs);Pa!==null&&!(Pa.expirationTime>n&&V3());){var i=Pa.callback;if(typeof i=="function"){Pa.callback=null,sr=Pa.priorityLevel;var r=i(Pa.expirationTime<=n);if(n=On.unstable_now(),typeof r=="function"){Pa.callback=r,by(n),e=!0;break t}Pa===Lo(bs)&&xy(bs),by(n)}else xy(bs);Pa=Lo(bs)}if(Pa!==null)e=!0;else{var a=Lo(Pl);a!==null&&hT(dT,a.startTime-n),e=!1}}break e}finally{Pa=null,sr=t,cT=!1}e=void 0}}finally{e?Jf():$f=!1}}}var Jf;typeof I3=="function"?Jf=function(){I3(sT)}:typeof MessageChannel<"u"?(lT=new MessageChannel,z3=lT.port2,lT.port1.onmessage=sT,Jf=function(){z3.postMessage(null)}):Jf=function(){k3(sT,0)};var lT,z3;function hT(n,e){Yp=k3(function(){n(On.unstable_now())},e)}On.unstable_IdlePriority=5;On.unstable_ImmediatePriority=1;On.unstable_LowPriority=4;On.unstable_NormalPriority=3;On.unstable_Profiling=null;On.unstable_UserBlockingPriority=2;On.unstable_cancelCallback=function(n){n.callback=null};On.unstable_forceFrameRate=function(n){0>n||125<n?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B3=0<n?Math.floor(1e3/n):5};On.unstable_getCurrentPriorityLevel=function(){return sr};On.unstable_next=function(n){switch(sr){case 1:case 2:case 3:var e=3;break;default:e=sr}var t=sr;sr=e;try{return n()}finally{sr=t}};On.unstable_requestPaint=function(){fT=!0};On.unstable_runWithPriority=function(n,e){switch(n){case 1:case 2:case 3:case 4:case 5:break;default:n=3}var t=sr;sr=n;try{return e()}finally{sr=t}};On.unstable_scheduleCallback=function(n,e,t){var i=On.unstable_now();switch(typeof t=="object"&&t!==null?(t=t.delay,t=typeof t=="number"&&0<t?i+t:i):t=i,n){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=t+r,n={id:h4++,callback:e,priorityLevel:n,startTime:t,expirationTime:r,sortIndex:-1},t>i?(n.sortIndex=t,uT(Pl,n),Lo(bs)===null&&n===Lo(Pl)&&(qp?(F3(Yp),Yp=-1):qp=!0,hT(dT,t-i))):(n.sortIndex=r,uT(bs,n),Xp||cT||(Xp=!0,$f||($f=!0,Jf()))),n};On.unstable_shouldYield=V3;On.unstable_wrapCallback=function(n){var e=sr;return function(){var t=sr;sr=e;try{return n.apply(this,arguments)}finally{sr=t}}}});var Sy=zr((jX,W3)=>{"use strict";W3.exports=G3()});var q3=zr(xr=>{"use strict";var p4=or();function X3(n){var e="https://react.dev/errors/"+n;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Il(){}var br={d:{f:Il,r:function(){throw Error(X3(522))},D:Il,C:Il,L:Il,m:Il,X:Il,S:Il,M:Il},p:0,findDOMNode:null},m4=Symbol.for("react.portal");function g4(n,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m4,key:i==null?null:""+i,children:n,containerInfo:e,implementation:t}}var jp=p4.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Ty(n,e){if(n==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}xr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=br;xr.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(X3(299));return g4(n,e,null,t)};xr.flushSync=function(n){var e=jp.T,t=br.p;try{if(jp.T=null,br.p=2,n)return n()}finally{jp.T=e,br.p=t,br.d.f()}};xr.preconnect=function(n,e){typeof n=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,br.d.C(n,e))};xr.prefetchDNS=function(n){typeof n=="string"&&br.d.D(n)};xr.preinit=function(n,e){if(typeof n=="string"&&e&&typeof e.as=="string"){var t=e.as,i=Ty(t,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?br.d.S(n,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):t==="script"&&br.d.X(n,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};xr.preinitModule=function(n,e){if(typeof n=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=Ty(e.as,e.crossOrigin);br.d.M(n,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&br.d.M(n)};xr.preload=function(n,e){if(typeof n=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,i=Ty(t,e.crossOrigin);br.d.L(n,t,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};xr.preloadModule=function(n,e){if(typeof n=="string")if(e){var t=Ty(e.as,e.crossOrigin);br.d.m(n,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else br.d.m(n)};xr.requestFormReset=function(n){br.d.r(n)};xr.unstable_batchedUpdates=function(n,e){return n(e)};xr.useFormState=function(n,e,t){return jp.H.useFormState(n,e,t)};xr.useFormStatus=function(){return jp.H.useHostTransitionStatus()};xr.version="19.2.4"});var Z3=zr((KX,j3)=>{"use strict";function Y3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y3)}catch(n){console.error(n)}}Y3(),j3.exports=q3()});var sL=zr(j_=>{"use strict";var yi=Sy(),xD=or(),v4=Z3();function Ve(n){var e="https://react.dev/errors/"+n;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function SD(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function Nm(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,(e.flags&4098)!==0&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function TD(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function ED(n){if(n.tag===31){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function K3(n){if(Nm(n)!==n)throw Error(Ve(188))}function y4(n){var e=n.alternate;if(!e){if(e=Nm(n),e===null)throw Error(Ve(188));return e!==n?null:n}for(var t=n,i=e;;){var r=t.return;if(r===null)break;var a=r.alternate;if(a===null){if(i=r.return,i!==null){t=i;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===t)return K3(r),n;if(a===i)return K3(r),e;a=a.sibling}throw Error(Ve(188))}if(t.return!==i.return)t=r,i=a;else{for(var o=!1,l=r.child;l;){if(l===t){o=!0,t=r,i=a;break}if(l===i){o=!0,i=r,t=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===t){o=!0,t=a,i=r;break}if(l===i){o=!0,i=a,t=r;break}l=l.sibling}if(!o)throw Error(Ve(189))}}if(t.alternate!==i)throw Error(Ve(190))}if(t.tag!==3)throw Error(Ve(188));return t.stateNode.current===t?n:e}function MD(n){var e=n.tag;if(e===5||e===26||e===27||e===6)return n;for(n=n.child;n!==null;){if(e=MD(n),e!==null)return e;n=n.sibling}return null}var Rn=Object.assign,_4=Symbol.for("react.element"),Ey=Symbol.for("react.transitional.element"),nm=Symbol.for("react.portal"),ad=Symbol.for("react.fragment"),wD=Symbol.for("react.strict_mode"),YT=Symbol.for("react.profiler"),AD=Symbol.for("react.consumer"),Cs=Symbol.for("react.context"),VE=Symbol.for("react.forward_ref"),jT=Symbol.for("react.suspense"),ZT=Symbol.for("react.suspense_list"),GE=Symbol.for("react.memo"),zl=Symbol.for("react.lazy");Symbol.for("react.scope");var KT=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var b4=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var Q3=Symbol.iterator;function Zp(n){return n===null||typeof n!="object"?null:(n=Q3&&n[Q3]||n["@@iterator"],typeof n=="function"?n:null)}var x4=Symbol.for("react.client.reference");function QT(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===x4?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case ad:return"Fragment";case YT:return"Profiler";case wD:return"StrictMode";case jT:return"Suspense";case ZT:return"SuspenseList";case KT:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case nm:return"Portal";case Cs:return n.displayName||"Context";case AD:return(n._context.displayName||"Context")+".Consumer";case VE:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case GE:return e=n.displayName||null,e!==null?e:QT(n.type)||"Memo";case zl:e=n._payload,n=n._init;try{return QT(n(e))}catch{}}return null}var im=Array.isArray,Tt=xD.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,nn=v4.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lc={pending:!1,data:null,method:null,action:null},JT=[],od=-1;function ko(n){return{current:n}}function Di(n){0>od||(n.current=JT[od],JT[od]=null,od--)}function Sn(n,e){od++,JT[od]=n.current,n.current=e}var zo=ko(null),bm=ko(null),jl=ko(null),i_=ko(null);function r_(n,e){switch(Sn(jl,e),Sn(bm,n),Sn(zo,null),e.nodeType){case 9:case 11:n=(n=e.documentElement)&&(n=n.namespaceURI)?rD(n):0;break;default:if(n=e.tagName,e=e.namespaceURI)e=rD(e),n=YO(e,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Di(zo),Sn(zo,n)}function Ed(){Di(zo),Di(bm),Di(jl)}function $T(n){n.memoizedState!==null&&Sn(i_,n);var e=zo.current,t=YO(e,n.type);e!==t&&(Sn(bm,n),Sn(zo,t))}function a_(n){bm.current===n&&(Di(zo),Di(bm)),i_.current===n&&(Di(i_),Um._currentValue=lc)}var pT,J3;function rc(n){if(pT===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);pT=e&&e[1]||"",J3=-1<t.stack.indexOf(`
2    at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
3`+pT+n+J3}var mT=!1;function gT(n,e){if(!n||mT)return"";mT=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(g){var p=g}Reflect.construct(n,[],m)}else{try{m.call()}catch(g){p=g}n.call(m.prototype)}}else{try{throw Error()}catch(g){p=g}(m=n())&&typeof m.catch=="function"&&m.catch(function(){})}}catch(g){if(g&&p&&typeof g.stack=="string")return[g.stack,p.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),o=a[0],l=a[1];if(o&&l){var c=o.split(`
4`),f=l.split(`
5`);for(r=i=0;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;for(;r<f.length&&!f[r].includes("DetermineComponentFrameRoot");)r++;if(i===c.length||r===f.length)for(i=c.length-1,r=f.length-1;1<=i&&0<=r&&c[i]!==f[r];)r--;for(;1<=i&&0<=r;i--,r--)if(c[i]!==f[r]){if(i!==1||r!==1)do if(i--,r--,0>r||c[i]!==f[r]){var d=`
6`+c[i].replace(" at new "," at ");return n.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",n.displayName)),d}while(1<=i&&0<=r);break}}}finally{mT=!1,Error.prepareStackTrace=t}return(t=n?n.displayName||n.name:"")?rc(t):""}function S4(n,e){switch(n.tag){case 26:case 27:case 5:return rc(n.type);case 16:return rc("Lazy");case 13:return n.child!==e&&e!==null?rc("Suspense Fallback"):rc("Suspense");case 19:return rc("SuspenseList");case 0:case 15:return gT(n.type,!1);case 11:return gT(n.type.render,!1);case 1:return gT(n.type,!0);case 31:return rc("Activity");default:return""}}function $3(n){try{var e="",t=null;do e+=S4(n,t),t=n,n=n.return;while(n);return e}catch(i){return`
7Error generating stack: `+i.message+`
8`+i.stack}}var eE=Object.prototype.hasOwnProperty,WE=yi.unstable_scheduleCallback,vT=yi.unstable_cancelCallback,T4=yi.unstable_shouldYield,E4=yi.unstable_requestPaint,ga=yi.unstable_now,M4=yi.unstable_getCurrentPriorityLevel,CD=yi.unstable_ImmediatePriority,RD=yi.unstable_UserBlockingPriority,o_=yi.unstable_NormalPriority,w4=yi.unstable_LowPriority,DD=yi.unstable_IdlePriority,A4=yi.log,C4=yi.unstable_setDisableYieldValue,Pm=null,va=null;function Gl(n){if(typeof A4=="function"&&C4(n),va&&typeof va.setStrictMode=="function")try{va.setStrictMode(Pm,n)}catch{}}var ya=Math.clz32?Math.clz32:U4,R4=Math.log,D4=Math.LN2;function U4(n){return n>>>=0,n===0?32:31-(R4(n)/D4|0)|0}var My=256,wy=262144,Ay=4194304;function ac(n){var e=n&42;if(e!==0)return e;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function O_(n,e,t){var i=n.pendingLanes;if(i===0)return 0;var r=0,a=n.suspendedLanes,o=n.pingedLanes;n=n.warmLanes;var l=i&134217727;return l!==0?(i=l&~a,i!==0?r=ac(i):(o&=l,o!==0?r=ac(o):t||(t=l&~n,t!==0&&(r=ac(t))))):(l=i&~a,l!==0?r=ac(l):o!==0?r=ac(o):t||(t=i&~n,t!==0&&(r=ac(t)))),r===0?0:e!==0&&e!==r&&(e&a)===0&&(a=r&-r,t=e&-e,a>=t||a===32&&(t&4194048)!==0)?e:r}function Im(n,e){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&e)===0}function O4(n,e){switch(n){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function UD(){var n=Ay;return Ay<<=1,(Ay&62914560)===0&&(Ay=4194304),n}function yT(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function zm(n,e){n.pendingLanes|=e,e!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function L4(n,e,t,i,r,a){var o=n.pendingLanes;n.pendingLanes=t,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=t,n.entangledLanes&=t,n.errorRecoveryDisabledLanes&=t,n.shellSuspendCounter=0;var l=n.entanglements,c=n.expirationTimes,f=n.hiddenUpdates;for(t=o&~t;0<t;){var d=31-ya(t),m=1<<d;
vendor: 8,991 bytes, line 8
8l[d]=0,c[d]=-1;var p=f[d];if(p!==null)for(f[d]=null,d=0;d<p.length;d++){var g=p[d];g!==null&&(g.lane&=-536870913)}t&=~m}i!==0&&OD(n,i,0),a!==0&&r===0&&n.tag!==0&&(n.suspendedLanes|=a&~(o&~e))}function OD(n,e,t){n.pendingLanes|=e,n.suspendedLanes&=~e;var i=31-ya(e);n.entangledLanes|=e,n.entanglements[i]=n.entanglements[i]|1073741824|t&261930}function LD(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var i=31-ya(t),r=1<<i;r&e|n[i]&e&&(n[i]|=e),t&=~r}}function ND(n,e){var t=e&-e;return t=(t&42)!==0?1:XE(t),(t&(n.suspendedLanes|e))!==0?0:t}function XE(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function qE(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function PD(){var n=nn.p;return n!==0?n:(n=window.event,n===void 0?32:rL(n.type))}function eR(n,e){var t=nn.p;try{return nn.p=n,e()}finally{nn.p=t}}var su=Math.random().toString(36).slice(2),Vi="__reactFiber$"+su,Gr="__reactProps$"+su,Pd="__reactContainer$"+su,tE="__reactEvents$"+su,N4="__reactListeners$"+su,P4="__reactHandles$"+su,tR="__reactResources$"+su,km="__reactMarker$"+su;function YE(n){delete n[Vi],delete n[Gr],delete n[tE],delete n[N4],delete n[P4]}function sd(n){var e=n[Vi];if(e)return e;for(var t=n.parentNode;t;){if(e=t[Pd]||t[Vi]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=uD(n);n!==null;){if(t=n[Vi])return t;n=uD(n)}return e}n=t,t=n.parentNode}return null}function Id(n){if(n=n[Vi]||n[Pd]){var e=n.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return n}return null}function rm(n){var e=n.tag;if(e===5||e===26||e===27||e===6)return n.stateNode;throw Error(Ve(33))}function vd(n){var e=n[tR];return e||(e=n[tR]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Ri(n){n[km]=!0}var ID=new Set,zD={};function yc(n,e){Md(n,e),Md(n+"Capture",e)}function Md(n,e){for(zD[n]=e,n=0;n<e.length;n++)ID.add(e[n])}var I4=RegExp("^[: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]*$"),nR={},iR={};function z4(n){return eE.call(iR,n)?!0:eE.call(nR,n)?!1:I4.test(n)?iR[n]=!0:(nR[n]=!0,!1)}function Vy(n,e,t){if(z4(e))if(t===null)n.removeAttribute(e);else{switch(typeof t){case"undefined":case"function":case"symbol":n.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){n.removeAttribute(e);return}}n.setAttribute(e,""+t)}}function Cy(n,e,t){if(t===null)n.removeAttribute(e);else{switch(typeof t){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(e);return}n.setAttribute(e,""+t)}}function xs(n,e,t,i){if(i===null)n.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(t);return}n.setAttributeNS(e,t,""+i)}}function za(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function kD(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function k4(n,e,t){var i=Object.getOwnPropertyDescriptor(n.constructor.prototype,e);if(!n.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,a=i.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){t=""+o,a.call(this,o)}}),Object.defineProperty(n,e,{enumerable:i.enumerable}),{getValue:function(){return t},setValue:function(o){t=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function nE(n){if(!n._valueTracker){var e=kD(n)?"checked":"value";n._valueTracker=k4(n,e,""+n[e])}}function FD(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=kD(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function s_(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}}var F4=/[\n"\\]/g;function Ba(n){return n.replace(F4,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function iE(n,e,t,i,r,a,o,l){n.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?n.type=o:n.removeAttribute("type"),e!=null?o==="number"?(e===0&&n.value===""||n.value!=e)&&(n.value=""+za(e)):n.value!==""+za(e)&&(n.value=""+za(e)):o!=="submit"&&o!=="reset"||n.removeAttribute("value"),e!=null?rE(n,o,za(e)):t!=null?rE(n,o,za(t)):i!=null&&n.removeAttribute("value"),r==null&&a!=null&&(n.defaultChecked=!!a),r!=null&&(n.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?n.name=""+za(l):n.removeAttribute("name")}function BD(n,e,t,i,r,a,o,l){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(n.type=a),e!=null||t!=null){if(!(a!=="submit"&&a!=="reset"||e!=null)){nE(n);return}t=t!=null?""+za(t):"",e=e!=null?""+za(e):t,l||e===n.value||(n.value=e),n.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,n.checked=l?n.checked:!!i,n.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(n.name=o),nE(n)}function rE(n,e,t){e==="number"&&s_(n.ownerDocument)===n||n.defaultValue===""+t||(n.defaultValue=""+t)}function yd(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r<t.length;r++)e["$"+t[r]]=!0;for(t=0;t<n.length;t++)r=e.hasOwnProperty("$"+n[t].value),n[t].selected!==r&&(n[t].selected=r),r&&i&&(n[t].defaultSelected=!0)}else{for(t=""+za(t),e=null,r=0;r<n.length;r++){if(n[r].value===t){n[r].selected=!0,i&&(n[r].defaultSelected=!0);return}e!==null||n[r].disabled||(e=n[r])}e!==null&&(e.selected=!0)}}function HD(n,e,t){if(e!=null&&(e=""+za(e),e!==n.value&&(n.value=e),t==null)){n.defaultValue!==e&&(n.defaultValue=e);return}n.defaultValue=t!=null?""+za(t):""}function VD(n,e,t,i){if(e==null){if(i!=null){if(t!=null)throw Error(Ve(92));if(im(i)){if(1<i.length)throw Error(Ve(93));i=i[0]}t=i}t==null&&(t=""),e=t}t=za(e),n.defaultValue=t,i=n.textContent,i===t&&i!==""&&i!==null&&(n.value=i),nE(n)}function wd(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var B4=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function rR(n,e,t){var i=e.indexOf("--")===0;t==null||typeof t=="boolean"||t===""?i?n.setProperty(e,""):e==="float"?n.cssFloat="":n[e]="":i?n.setProperty(e,t):typeof t!="number"||t===0||B4.has(e)?e==="float"?n.cssFloat=t:n[e]=(""+t).trim():n[e]=t+"px"}function GD(n,e,t){if(e!=null&&typeof e!="object")throw Error(Ve(62));if(n=n.style,t!=null){for(var i in t)!t.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&t[r]!==i&&rR(n,r,i)}else for(var a in e)e.hasOwnProperty(a)&&rR(n,a,e[a])}function jE(n){if(n.indexOf("-")===-1)return!1;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 H4=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
8dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),V4=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Gy(n){return V4.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Rs(){}var aE=null;function ZE(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ld=null,_d=null;function aR(n){var e=Id(n);if(e&&(n=e.stateNode)){var t=n[Gr]||null;e:switch(n=e.stateNode,e.type){case"input":if(iE(n,t.value,t.defaultValue,t.defaultValue,t.checked,t.defaultChecked,t.type,t.name),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll('input[name="'+Ba(""+e)+'"][type="radio"]'),e=0;e<t.length;e++){var i=t[e];if(i!==n&&i.form===n.form){var r=i[Gr]||null;if(!r)throw Error(Ve(90));iE(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<t.length;e++)i=t[e],i.form===n.form&&FD(i)}break e;case"textarea":HD(n,t.value,t.defaultValue);break e;case"select":e=t.value,e!=null&&yd(n,!!t.multiple,e,!1)}}}var _T=!1;function WD(n,e,t){if(_T)return n(e,t);_T=!0;try{var i=n(e);return i}finally{if(_T=!1,(ld!==null||_d!==null)&&(W_(),ld&&(e=ld,n=_d,_d=ld=null,aR(e),n)))for(e=0;e<n.length;e++)aR(n[e])}}function xm(n,e){var t=n.stateNode;if(t===null)return null;var i=t[Gr]||null;if(i===null)return null;t=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(n=n.type,i=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!i;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(Ve(231,e,typeof t));return t}var Ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oE=!1;if(Ns)try{ed={},Object.defineProperty(ed,"passive",{get:function(){oE=!0}}),window.addEventListener("test",ed,ed),window.removeEventListener("test",ed,ed)}catch{oE=!1}var ed,Wl=null,KE=null,Wy=null;function XD(){if(Wy)return Wy;var n,e=KE,t=e.length,i,r="value"in Wl?Wl.value:Wl.textContent,a=r.length;for(n=0;n<t&&e[n]===r[n];n++);var o=t-n;for(i=1;i<=o&&e[t-i]===r[a-i];i++);return Wy=r.slice(n,1<i?1-i:void 0)}function Xy(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function Ry(){return!0}function oR(){return!1}function Wr(n){function e(t,i,r,a,o){this._reactName=t,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in n)n.hasOwnProperty(l)&&(t=n[l],this[l]=t?t(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Ry:oR,this.isPropagationStopped=oR,this}return Rn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=Ry)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=Ry)},persist:function(){},isPersistent:Ry}),e}var _c={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},L_=Wr(_c),Fm=Rn({},_c,{view:0,detail:0}),G4=Wr(Fm),bT,xT,Kp,N_=Rn({},Fm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:QE,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Kp&&(Kp&&n.type==="mousemove"?(bT=n.screenX-Kp.screenX,xT=n.screenY-Kp.screenY):xT=bT=0,Kp=n),bT)},movementY:function(n){return"movementY"in n?n.movementY:xT}}),sR=Wr(N_),W4=Rn({},N_,{dataTransfer:0}),X4=Wr(W4),q4=Rn({},Fm,{relatedTarget:0}),ST=Wr(q4),Y4=Rn({},_c,{animationName:0,elapsedTime:0,pseudoElement:0}),j4=Wr(Y4),Z4=Rn({}
vendor: 1,134 bytes, line 8
8,_c,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),K4=Wr(Z4),Q4=Rn({},_c,{data:0}),lR=Wr(Q4),J4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$4={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tB(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=eB[n])?!!e[n]:!1}function QE(){return tB}var nB=Rn({},Fm,{key:function(n){if(n.key){var e=J4[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Xy(n),n===13?"Enter":String.fromCharCode(n)):n.type==="
8keydown"||n.type==="keyup"?$4[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:QE,charCode:function(n){return n.type==="keypress"?Xy(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Xy(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),iB=Wr(nB),rB=Rn({},N_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uR=Wr(rB),aB=Rn({},Fm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:QE}),oB=Wr(aB),sB=Rn({},_c,{propertyName:0,elapsedTime:0,pseudoElement:0}),lB=Wr(sB),uB=Rn({},N_,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),cB=Wr(uB),fB=Rn({},_c,{newState:0,oldState:0}),dB=Wr(fB),hB=[9,13,27,32],JE=Ns&&"CompositionEvent"in window,sm=null;Ns&&"documentMode"in document&&(sm=document.documentMode);var pB=Ns&&"TextEvent"in window&&!sm,qD=Ns&&(!JE||sm&&8<sm&&11>=sm),cR=" ",fR=!1;function YD(n,e){switch(n){case"keyup":return hB.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jD(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ud=!1;function mB(n,e){switch(n){case"compositionend":return jD(e);case"keypress":return e.which!==32?null:(fR=!0,cR);case"textInput":return n=e.data,n===cR&&fR?null:n;default:return null}}function gB(n,e){if(ud)return n==="compositionend"||!JE&&YD(n,e)?(n=XD(),Wy=KE=Wl=null,ud=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return qD&&e.locale!=="ko"?null:e.data;default:return null}}var vB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function dR(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!vB[n.type]:e==="textarea"}function ZD(n,e,t,i){ld?_d?_d.push(i):_d=[i]:ld=i,e=M_(e,"onChange"),0<e.length&&(t=new L_("onChange","change",null,t,i),n.push({event:t,listeners:e}))}var lm=null,Sm=null;function yB(n){WO(n,0)}function P_(n){var e=rm(n);if(FD(e))return n}function hR(n,e){if(n==="change")return e}var KD=!1;Ns&&(Ns?(Uy="oninput"in document,Uy||(TT=document.createElement("div"),TT.setAttribute("oninput","return;"),Uy=typeof TT.oninput=="function"),Dy=Uy):Dy=!1,KD=Dy&&(!document.documentMode||9<document.documentMode));var Dy,Uy,TT;function pR(){lm&&(lm.detachEvent("onpropertychange",QD),Sm=lm=null)}function QD(n){if(n.propertyName==="value"&&P_(Sm)){var e=[];ZD(e,Sm,n,ZE(n)),WD(yB,e)}}function _B(n,e,t){n==="focusin"?(pR(),lm=e,Sm=t,lm.attachEvent("onpropertychange",QD)):n==="focusout"&&pR()}function bB(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return P_(Sm)}function xB(n,e){if(n==="click")return P_(e)}function SB(n,e){if(n==="input"||n==="change")return P_(e)}function TB(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var ba=typeof Object.is=="function"?Object.is:TB;function Tm(n,e){if(ba(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(i=0;i<t.length;i++){var r=t[i];if(!eE.call(e,r)||!ba(n[r],e[r]))return!1}return!0}function mR(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function gR(n,e){var t=mR(n);n=0;for(var i;t;){if(t.nodeType===3){if(i=n+t.textContent.length,n<=e&&i>=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=mR(t)}}function JD(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?JD(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function $D(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var e=s_(n.document);e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=s_(n.document)}return e}function $E(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")}var EB=Ns&&"documentMode"in document&&11>
vendor: 107,136 bytes, line 8
8=document.documentMode,cd=null,sE=null,um=null,lE=!1;function vR(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;lE||cd==null||cd!==s_(i)||(i=cd,"selectionStart"in i&&$E(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}),um&&Tm(um,i)||(um=i,i=M_(sE,"onSelect"),0<i.length&&(e=new L_("onSelect","select",null,e,t),n.push({event:e,listeners:i}),e.target=cd)))}function ic(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var fd={animationend:ic("Animation","AnimationEnd"),animationiteration:ic("Animation","AnimationIteration"),animationstart:ic("Animation","AnimationStart"),transitionrun:ic("Transition","TransitionRun"),transitionstart:ic("Transition","TransitionStart"),transitioncancel:ic("Transition","TransitionCancel"),transitionend:ic("Transition","TransitionEnd")},ET={},eU={};Ns&&(eU=document.createElement("div").style,"AnimationEvent"in window||(delete fd.animationend.animation,delete fd.animationiteration.animation,delete fd.animationstart.animation),"TransitionEvent"in window||delete fd.transitionend.transition);function bc(n){if(ET[n])return ET[n];if(!fd[n])return n;var e=fd[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in eU)return ET[n]=e[t];return n}var tU=bc("animationend"),nU=bc("animationiteration"),iU=bc("animationstart"),MB=bc("transitionrun"),wB=bc("transitionstart"),AB=bc("transitioncancel"),rU=bc("transitionend"),aU=new Map,uE="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");uE.push("scrollEnd");function uo(n,e){aU.set(n,e),yc(e,[n])}var l_=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Ia=[],dd=0,eM=0;function I_(){for(var n=dd,e=eM=dd=0;e<n;){var t=Ia[e];Ia[e++]=null;var i=Ia[e];Ia[e++]=null;var r=Ia[e];Ia[e++]=null;var a=Ia[e];if(Ia[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}a!==0&&oU(t,r,a)}}function z_(n,e,t,i){Ia[dd++]=n,Ia[dd++]=e,Ia[dd++]=t,Ia[dd++]=i,eM|=i,n.lanes|=i,n=n.alternate,n!==null&&(n.lanes|=i)}function tM(n,e,t,i){return z_(n,e,t,i),u_(n)}function xc(n,e){return z_(n,null,null,e),u_(n)}function oU(n,e,t){n.lanes|=t;var i=n.alternate;i!==null&&(i.lanes|=t);for(var r=!1,a=n.return;a!==null;)a.childLanes|=t,i=a.alternate,i!==null&&(i.childLanes|=t),a.tag===22&&(n=a.stateNode,n===null||n._visibility&1||(r=!0)),n=a,a=a.return;return n.tag===3?(a=n.stateNode,r&&e!==null&&(r=31-ya(t),n=a.hiddenUpdates,i=n[r],i===null?n[r]=[e]:i.push(e),e.lane=t|536870912),a):null}function u_(n){if(50<ym)throw ym=0,DE=null,Error(Ve(185));for(var e=n.return;e!==null;)n=e,e=n.return;return n.tag===3?n.stateNode:null}var hd={};function CB(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.refCleanup=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 pa(n,e,t,i){return new CB(n,e,t,i)}function nM(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Us(n,e){var t=n.alternate;return t===null?(t=pa(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&65011712,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.refCleanup=n.refCleanup,t}function sU(n,e){n.flags&=65011714;var t=n.alternate;return t===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,n.type=t.type,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n}function qy(n,e,t,i,r,a){var o=0;if(i=n,typeof n=="function")nM(n)&&(o=1);else if(typeof n=="string")o=U5(n,t,zo.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case KT:return n=pa(31,t,e,r),n.elementType=KT,n.lanes=a,n;case ad:return uc(t.children,r,a,e);case wD:o=8,r|=24;break;case YT:return n=pa(12,t,e,r|2),n.elementType=YT,n.lanes=a,n;case jT:return n=pa(13,t,e,r),n.elementType=jT,n.lanes=a,n;case ZT:return n=pa(19,t,e,r),n.elementType=ZT,n.lanes=a,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Cs:o=10;break e;case AD:o=9;break e;case VE:o=11;break e;case GE:o=14;break e;case zl:o=16,i=null;break e}o=29,t=Error(Ve(130,n===null?"null":typeof n,"")),i=null}return e=pa(o,t,e,r),e.elementType=n,e.type=i,e.lanes=a,e}function uc(n,e,t,i){return n=pa(7,n,i,e),n.lanes=t,n}function MT(n,e,t){return n=pa(6,n,null,e),n.lanes=t,n}function lU(n){var e=pa(18,null,null,0);return e.stateNode=n,e}function wT(n,e,t){return e=pa(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}var yR=new WeakMap;function Ha(n,e){if(typeof n=="object"&&n!==null){var t=yR.get(n);return t!==void 0?t:(e={value:n,source:e,stack:$3(e)},yR.set(n,e),e)}return{value:n,source:e,stack:$3(e)}}var pd=[],md=0,c_=null,Em=0,ka=[],Fa=0,iu=null,No=1,Po="";function ws(n,e){pd[md++]=Em,pd[md++]=c_,c_=n,Em=e}function uU(n,e,t){ka[Fa++]=No,ka[Fa++]=Po,ka[Fa++]=iu,iu=n;var i=No;n=Po;var r=32-ya(i)-1;i&=~(1<<r),t+=1;var a=32-ya(e)+r;if(30<a){var o=r-r%5;a=(i&(1<<o)-1).toString(32),i>>=o,r-=o,No=1<<32-ya(e)+r|t<<r|i,Po=a+n}else No=1<<a|t<<r|i,Po=n}function iM(n){n.return!==null&&(ws(n,1),uU(n,1,0))}function rM(n){for(;n===c_;)c_=pd[--md],pd[md]=null,Em=pd[--md],pd[md]=null;for(;n===iu;)iu=ka[--Fa],ka[Fa]=null,Po=ka[--Fa],ka[Fa]=null,No=ka[--Fa],ka[Fa]=null}function cU(n,e){ka[Fa++]=No,ka[Fa++]=Po,ka[Fa++]=iu,No=e.id,Po=e.overflow,iu=n}var Gi=null,Cn=null,Yt=!1,Zl=null,Va=!1,cE=Error(Ve(519));function ru(n){var e=Error(Ve(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Mm(Ha(e,n)),cE}function _R(n){var e=n.stateNode,t=n.type,i=n.memoizedProps;switch(e[Vi]=n,e[Gr]=i,t){case"dialog":Ft("cancel",e),Ft("close",e);break;case"iframe":case"object":case"embed":Ft("load",e);break;case"video":case"audio":for(t=0;t<Rm.length;t++)Ft(Rm[t],e);break;case"source":Ft("error",e);break;case"img":case"image":case"link":Ft("error",e),Ft("load",e);break;case"details":Ft("toggle",e);break;case"input":Ft("invalid",e),BD(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ft("invalid",e);break;case"textarea":Ft("invalid",e),VD(e,i.value,i.defaultValue,i.children)}t=i.children,typeof t!="string"&&typeof t!="number"&&typeof t!="bigint"||e.textContent===""+t||i.suppressHydrationWarning===!0||qO(e.textContent,t)?(i.popover!=null&&(Ft("beforetoggle",e),Ft("toggle",e)),i.onScroll!=null&&Ft("scroll",e),i.onScrollEnd!=null&&Ft("scrollend",e),i.onClick!=null&&(e.onclick=Rs),e=!0):e=!1,e||ru(n,!0)}function bR(n){for(Gi=n.return;Gi;)switch(Gi.tag){case 5:case 31:case 13:Va=!1;return;case 27:case 3:Va=!0;return;default:Gi=Gi.return}}function td(n){if(n!==Gi)return!1;if(!Yt)return bR(n),Yt=!0,!1;var e=n.tag,t;if((t=e!==3&&e!==27)&&((t=e===5)&&(t=n.type,t=!(t!=="form"&&t!=="button")||PE(n.type,n.memoizedProps)),t=!t),t&&Cn&&ru(n),bR(n),e===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Ve(317));Cn=lD(n)}else if(e===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Ve(317));Cn=lD(n)}else e===27?(e=Cn,lu(n.type)?(n=FE,FE=null,Cn=n):Cn=e):Cn=Gi?Wa(n.stateNode.nextSibling):null;return!0}function hc(){Cn=Gi=null,Yt=!1}function AT(){var n=Zl;return n!==null&&(Hr===null?Hr=n:Hr.push.apply(Hr,n),Zl=null),n}function Mm(n){Zl===null?Zl=[n]:Zl.push(n)}var fE=ko(null),Sc=null,Ds=null;function Fl(n,e,t){Sn(fE,e._currentValue),e._currentValue=t}function Os(n){n._currentValue=fE.current,Di(fE)}function dE(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 hE(n,e,t,i){var r=n.child;for(r!==null&&(r.return=n);r!==null;){var a=r.dependencies;if(a!==null){var o=r.child;a=a.firstContext;e:for(;a!==null;){var l=a;a=r;for(var c=0;c<e.length;c++)if(l.context===e[c]){a.lanes|=t,l=a.alternate,l!==null&&(l.lanes|=t),dE(a.return,t,n),i||(o=null);break e}a=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(Ve(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),dE(o,t,n),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===n){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function zd(n,e,t,i){n=null;for(var r=e,a=!1;r!==null;){if(!a){if((r.flags&524288)!==0)a=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(Ve(387));if(o=o.memoizedProps,o!==null){var l=r.type;ba(r.pendingProps.value,o.value)||(n!==null?n.push(l):n=[l])}}else if(r===i_.current){if(o=r.alternate,o===null)throw Error(Ve(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(n!==null?n.push(Um):n=[Um])}r=r.return}n!==null&&hE(e,n,t,i),e.flags|=262144}function f_(n){for(n=n.firstContext;n!==null;){if(!ba(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function pc(n){Sc=n,Ds=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Wi(n){return fU(Sc,n)}function Oy(n,e){return Sc===null&&pc(n),fU(n,e)}function fU(n,e){var t=e._currentValue;if(e={context:e,memoizedValue:t,next:null},Ds===null){if(n===null)throw Error(Ve(308));Ds=e,n.dependencies={lanes:0,firstContext:e},n.flags|=524288}else Ds=Ds.next=e;return t}var RB=typeof AbortController<"u"?AbortController:function(){var n=[],e=this.signal={aborted:!1,addEventListener:function(t,i){n.push(i)}};this.abort=function(){e.aborted=!0,n.forEach(function(t){return t()})}},DB=yi.unstable_scheduleCallback,UB=yi.unstable_NormalPriority,ui={$$typeof:Cs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function aM(){return{controller:new RB,data:new Map,refCount:0}}function Bm(n){n.refCount--,n.refCount===0&&DB(UB,function(){n.controller.abort()})}var cm=null,pE=0,Ad=0,bd=null;function OB(n,e){if(cm===null){var t=cm=[];pE=0,Ad=DM(),bd={status:"pending",value:void 0,then:function(i){t.push(i)}}}return pE++,e.then(xR,xR),e}function xR(){if(--pE===0&&cm!==null){bd!==null&&(bd.status="fulfilled");var n=cm;cm=null,Ad=0,bd=null;for(var e=0;e<n.length;e++)(0,n[e])()}}function LB(n,e){var t=[],i={status:"pending",value:null,reason:null,then:function(r){t.push(r)}};return n.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<t.length;r++)(0,t[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<t.length;r++)(0,t[r])(void 0)}),i}var SR=Tt.S;Tt.S=function(n,e){MO=ga(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&OB(n,e),SR!==null&&SR(n,e)};var cc=ko(null);function oM(){var n=cc.current;return n!==null?n:_n.pooledCache}function Yy(n,e){e===null?Sn(cc,cc.current):Sn(cc,e.pool)}function dU(){var n=oM();return n===null?null:{parent:ui._currentValue,pool:n}}var kd=Error(Ve(460)),sM=Error(Ve(474)),k_=Error(Ve(542)),d_={then:function(){}};function TR(n){return n=n.status,n==="fulfilled"||n==="rejected"}function hU(n,e,t){switch(t=n[t],t===void 0?n.push(e):t!==e&&(e.then(Rs,Rs),e=t),e.status){case"fulfilled":return e.value;case"rejected":throw n=e.reason,MR(n),n;default:if(typeof e.status=="string")e.then(Rs,Rs);else{if(n=_n,n!==null&&100<n.shellSuspendCounter)throw Error(Ve(482));n=e,n.status="pending",n.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw n=e.reason,MR(n),n}throw fc=e,kd}}function oc(n){try{var e=n._init;return e(n._payload)}catch(t){throw t!==null&&typeof t=="object"&&typeof t.then=="function"?(fc=t,kd):t}}var fc=null;function ER(){if(fc===null)throw Error(Ve(459));var n=fc;return fc=null,n}function MR(n){if(n===kd||n===k_)throw Error(Ve(483))}var xd=null,wm=0;function Ly(n){var e=wm;return wm+=1,xd===null&&(xd=[]),hU(xd,n,e)}function Qp(n,e){e=e.props.ref,n.ref=e!==void 0?e:null}function Ny(n,e){throw e.$$typeof===_4?Error(Ve(525)):(n=Object.prototype.toString.call(e),Error(Ve(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n)))}function pU(n){function e(_,b){if(n){var S=_.deletions;S===null?(_.deletions=[b],_.flags|=16):S.push(b)}}function t(_,b){if(!n)return null;for(;b!==null;)e(_,b),b=b.sibling;return null}function i(_){for(var b=new Map;_!==null;)_.key!==null?b.set(_.key,_):b.set(_.index,_),_=_.sibling;return b}function r(_,b){return _=Us(_,b),_.index=0,_.sibling=null,_}function a(_,b,S){return _.index=S,n?(S=_.alternate,S!==null?(S=S.index,S<b?(_.flags|=67108866,b):S):(_.flags|=67108866,b)):(_.flags|=1048576,b)}function o(_){return n&&_.alternate===null&&(_.flags|=67108866),_}function l(_,b,S,E){return b===null||b.tag!==6?(b=MT(S,_.mode,E),b.return=_,b):(b=r(b,S),b.return=_,b)}function c(_,b,S,E){var C=S.type;return C===ad?d(_,b,S.props.children,E,S.key):b!==null&&(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===zl&&oc(C)===b.type)?(b=r(b,S.props),Qp(b,S),b.return=_,b):(b=qy(S.type,S.key,S.props,null,_.mode,E),Qp(b,S),b.return=_,b)}function f(_,b,S,E){return b===null||b.tag!==4||b.stateNode.containerInfo!==S.containerInfo||b.stateNode.implementation!==S.implementation?(b=wT(S,_.mode,E),b.return=_,b):(b=r(b,S.children||[]),b.return=_,b)}function d(_,b,S,E,C){return b===null||b.tag!==7?(b=uc(S,_.mode,E,C),b.return=_,b):(b=r(b,S),b.return=_,b)}function m(_,b,S){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return b=MT(""+b,_.mode,S),b.return=_,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ey:return S=qy(b.type,b.key,b.props,null,_.mode,S),Qp(S,b),S.return=_,S;case nm:return b=wT(b,_.mode,S),b.return=_,b;case zl:return b=oc(b),m(_,b,S)}if(im(b)||Zp(b))return b=uc(b,_.mode,S,null),b.return=_,b;if(typeof b.then=="function")return m(_,Ly(b),S);if(b.$$typeof===Cs)return m(_,Oy(_,b),S);Ny(_,b)}return null}function p(_,b,S,E){var C=b!==null?b.key:null;if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return C!==null?null:l(_,b,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ey:return S.key===C?c(_,b,S,E):null;case nm:return S.key===C?f(_,b,S,E):null;case zl:return S=oc(S),p(_,b,S,E)}if(im(S)||Zp(S))return C!==null?null:d(_,b,S,E,null);if(typeof S.then=="function")return p(_,b,Ly(S),E);if(S.$$typeof===Cs)return p(_,b,Oy(_,S),E);Ny(_,S)}return null}function g(_,b,S,E,C){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return _=_.get(S)||null,l(b,_,""+E,C);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case Ey:return _=_.get(E.key===null?S:E.key)||null,c(b,_,E,C);case nm:return _=_.get(E.key===null?S:E.key)||null,f(b,_,E,C);case zl:return E=oc(E),g(_,b,S,E,C)}if(im(E)||Zp(E))return _=_.get(S)||null,d(b,_,E,C,null);if(typeof E.then=="function")return g(_,b,S,Ly(E),C);if(E.$$typeof===Cs)return g(_,b,S,Oy(b,E),C);Ny(b,E)}return null}function y(_,b,S,E){for(var C=null,D=null,U=b,w=b=0,R=null;U!==null&&w<S.length;w++){U.index>w?(R=U,U=null):R=U.sibling;var L=p(_,U,S[w],E);if(L===null){U===null&&(U=R);break}n&&U&&L.alternate===null&&e(_,U),b=a(L,b,w),D===null?C=L:D.sibling=L,D=L,U=R}if(w===S.length)return t(_,U),Yt&&ws(_,w),C;if(U===null){for(;w<S.length;w++)U=m(_,S[w],E),U!==null&&(b=a(U,b,w),D===null?C=U:D.sibling=U,D=U);return Yt&&ws(_,w),C}for(U=i(U);w<S.length;w++)R=g(U,_,w,S[w],E),R!==null&&(n&&R.alternate!==null&&U.delete(R.key===null?w:R.key),b=a(R,b,w),D===null?C=R:D.sibling=R,D=R);return n&&U.forEach(function(I){return e(_,I)}),Yt&&ws(_,w),C}function T(_,b,S,E){if(S==null)throw Error(Ve(151));for(var C=null,D=null,U=b,w=b=0,R=null,L=S.next();U!==null&&!L.done;w++,L=S.next()){U.index>w?(R=U,U=null):R=U.sibling;var I=p(_,U,L.value,E);if(I===null){U===null&&(U=R);break}n&&U&&I.alternate===null&&e(_,U),b=a(I,b,w),D===null?C=I:D.sibling=I,D=I,U=R}if(L.done)return t(_,U),Yt&&ws(_,w),C;if(U===null){for(;!L.done;w++,L=S.next())L=m(_,L.value,E),L!==null&&(b=a(L,b,w),D===null?C=L:D.sibling=L,D=L);return Yt&&ws(_,w),C}for(U=i(U);!L.done;w++,L=S.next())L=g(U,_,w,L.value,E),L!==null&&(n&&L.alternate!==null&&U.delete(L.key===null?w:L.key),b=a(L,b,w),D===null?C=L:D.sibling=L,D=L);return n&&U.forEach(function(z){return e(_,z)}),Yt&&ws(_,w),C}function x(_,b,S,E){if(typeof S=="object"&&S!==null&&S.type===ad&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Ey:e:{for(var C=S.key;b!==null;){if(b.key===C){if(C=S.type,C===ad){if(b.tag===7){t(_,b.sibling),E=r(b,S.props.children),E.return=_,_=E;break e}}else if(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===zl&&oc(C)===b.type){t(_,b.sibling),E=r(b,S.props),Qp(E,S),E.return=_,_=E;break e}t(_,b);break}else e(_,b);b=b.sibling}S.type===ad?(E=uc(S.props.children,_.mode,E,S.key),E.return=_,_=E):(E=qy(S.type,S.key,S.props,null,_.mode,E),Qp(E,S),E.return=_,_=E)}return o(_);case nm:e:{for(C=S.key;b!==null;){if(b.key===C)if(b.tag===4&&b.stateNode.containerInfo===S.containerInfo&&b.stateNode.implementation===S.implementation){t(_,b.sibling),E=r(b,S.children||[]),E.return=_,_=E;break e}else{t(_,b);break}else e(_,b);b=b.sibling}E=wT(S,_.mode,E),E.return=_,_=E}return o(_);case zl:return S=oc(S),x(_,b,S,E)}if(im(S))return y(_,b,S,E);if(Zp(S)){if(C=Zp(S),typeof C!="function")throw Error(Ve(150));return S=C.call(S),T(_,b,S,E)}if(typeof S.then=="function")return x(_,b,Ly(S),E);if(S.$$typeof===Cs)return x(_,b,Oy(_,S),E);Ny(_,S)}return typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint"?(S=""+S,b!==null&&b.tag===6?(t(_,b.sibling),E=r(b,S),E.return=_,_=E):(t(_,b),E=MT(S,_.mode,E),E.return=_,_=E),o(_)):t(_,b)}return function(_,b,S,E){try{wm=0;var C=x(_,b,S,E);return xd=null,C}catch(U){if(U===kd||U===k_)throw U;var D=pa(29,U,null,_.mode);return D.lanes=E,D.return=_,D}finally{}}}var mc=pU(!0),mU=pU(!1),kl=!1;function lM(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mE(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Kl(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Ql(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,(tn&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=u_(n),oU(n,null,t),e}return z_(n,i,e,t),u_(n)}function fm(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194048)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,LD(n,t)}}function CT(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,a=null;if(t=t.firstBaseUpdate,t!==null){do{var o={lane:t.lane,tag:t.tag,payload:t.payload,callback:null,next:null};a===null?r=a=o:a=a.next=o,t=t.next}while(t!==null);a===null?r=a=e:a=a.next=e}else r=a=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}var gE=!1;function dm(){if(gE){var n=bd;if(n!==null)throw n}}function hm(n,e,t,i){gE=!1;var r=n.updateQueue;kl=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,f=c.next;c.next=null,o===null?a=f:o.next=f,o=c;var d=n.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=f:l.next=f,d.lastBaseUpdate=c))}if(a!==null){var m=r.baseState;o=0,d=f=c=null,l=a;do{var p=l.lane&-536870913,g=p!==l.lane;if(g?(Xt&p)===p:(i&p)===p){p!==0&&p===Ad&&(gE=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var y=n,T=l;p=e;var x=t;switch(T.tag){case 1:if(y=T.payload,typeof y=="function"){m=y.call(x,m,p);break e}m=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=T.payload,p=typeof y=="function"?y.call(x,m,p):y,p==null)break e;m=Rn({},m,p);break e;case 2:kl=!0}}p=l.callback,p!==null&&(n.flags|=64,g&&(n.flags|=8192),g=r.callbacks,g===null?r.callbacks=[p]:g.push(p))}else g={lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(f=d=g,c=m):d=d.next=g,o|=p;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;g=l,l=g.next,g.next=null,r.lastBaseUpdate=g,r.shared.pending=null}}while(!0);d===null&&(c=m),r.baseState=c,r.firstBaseUpdate=f,r.lastBaseUpdate=d,a===null&&(r.shared.lanes=0),ou|=o,n.lanes=o,n.memoizedState=m}}function gU(n,e){if(typeof n!="function")throw Error(Ve(191,n));n.call(e)}function vU(n,e){var t=n.callbacks;if(t!==null)for(n.callbacks=null,n=0;n<t.length;n++)gU(t[n],e)}var Cd=ko(null),h_=ko(0);function wR(n,e){n=ks,Sn(h_,n),Sn(Cd,e),ks=n|e.baseLanes}function vE(){Sn(h_,ks),Sn(Cd,Cd.current)}function uM(){ks=h_.current,Di(Cd),Di(h_)}var xa=ko(null),Ga=null;function Bl(n){var e=n.alternate;Sn(Qn,Qn.current&1),Sn(xa,n),Ga===null&&(e===null||Cd.current!==null||e.memoizedState!==null)&&(Ga=n)}function yE(n){Sn(Qn,Qn.current),Sn(xa,n),Ga===null&&(Ga=n)}function yU(n){n.tag===22?(Sn(Qn,Qn.current),Sn(xa,n),Ga===null&&(Ga=n)):Hl(n)}function Hl(){Sn(Qn,Qn.current),Sn(xa,xa.current)}function ha(n){Di(xa),Ga===n&&(Ga=null),Di(Qn)}var Qn=ko(0);function p_(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||zE(t)||kE(t)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ps=0,Ut=null,vn=null,si=null,m_=!1,Sd=!1,gc=!1,g_=0,Am=0,Td=null,NB=0;function Wn(){throw Error(Ve(321))}function cM(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!ba(n[t],e[t]))return!1;return!0}function fM(n,e,t,i,r,a){return Ps=a,Ut=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Tt.H=n===null||n.memoizedState===null?ZU:SM,gc=!1,a=t(i,r),gc=!1,Sd&&(a=bU(e,t,i,r)),_U(n),a}function _U(n){Tt.H=Cm;var e=vn!==null&&vn.next!==null;if(Ps=0,si=vn=Ut=null,m_=!1,Am=0,Td=null,e)throw Error(Ve(300));n===null||ci||(n=n.dependencies,n!==null&&f_(n)&&(ci=!0))}function bU(n,e,t,i){Ut=n;var r=0;do{if(Sd&&(Td=null),Am=0,Sd=!1,25<=r)throw Error(Ve(301));if(r+=1,si=vn=null,n.updateQueue!=null){var a=n.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Tt.H=KU,a=e(t,i)}while(Sd);return a}function PB(){var n=Tt.H,e=n.useState()[0];return e=typeof e.then=="function"?Hm(e):e,n=n.useState()[0],(vn!==null?vn.memoizedState:null)!==n&&(Ut.flags|=1024),e}function dM(){var n=g_!==0;return g_=0,n}function hM(n,e,t){e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~t}function pM(n){if(m_){for(n=n.memoizedState;n!==null;){var e=n.queue;e!==null&&(e.pending=null),n=n.next}m_=!1}Ps=0,si=vn=Ut=null,Sd=!1,Am=g_=0,Td=null}function Sr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return si===null?Ut.memoizedState=si=n:si=si.next=n,si}function Jn(){if(vn===null){var n=Ut.alternate;n=n!==null?n.memoizedState:null}else n=vn.next;var e=si===null?Ut.memoizedState:si.next;if(e!==null)si=e,vn=n;else{if(n===null)throw Ut.alternate===null?Error(Ve(467)):Error(Ve(310));vn=n,n={memoizedState:vn.memoizedState,baseState:vn.baseState,baseQueue:vn.baseQueue,queue:vn.queue,next:null},si===null?Ut.memoizedState=si=n:si=si.next=n}return si}function F_(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hm(n){var e=Am;return Am+=1,Td===null&&(Td=[]),n=hU(Td,n,e),e=Ut,(si===null?e.memoizedState:si.next)===null&&(e=e.alternate,Tt.H=e===null||e.memoizedState===null?ZU:SM),n}function B_(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Hm(n);if(n.$$typeof===Cs)return Wi(n)}throw Error(Ve(438,String(n)))}function mM(n){var e=null,t=Ut.updateQueue;if(t!==null&&(e=t.memoCache),e==null){var i=Ut.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),t===null&&(t=F_(),Ut.updateQueue=t),t.memoCache=e,t=e.data[e.index],t===void 0)for(t=e.data[e.index]=Array(n),i=0;i<n;i++)t[i]=b4;return e.index++,t}function Is(n,e){return typeof e=="function"?e(n):e}function jy(n){var e=Jn();return gM(e,vn,n)}function gM(n,e,t){var i=n.queue;if(i===null)throw Error(Ve(311));i.lastRenderedReducer=t;var r=n.baseQueue,a=i.pending;if(a!==null){if(r!==null){var o=r.next;r.next=a.next,a.next=o}e.baseQueue=r=a,i.pending=null}if(a=n.baseState,r===null)n.memoizedState=a;else{e=r.next;var l=o=null,c=null,f=e,d=!1;do{var m=f.lane&-536870913;if(m!==f.lane?(Xt&m)===m:(Ps&m)===m){var p=f.revertLane;if(p===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),m===Ad&&(d=!0);else if((Ps&p)===p){f=f.next,p===Ad&&(d=!0);continue}else m={lane:0,revertLane:f.revertLane,gesture:null,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null},c===null?(l=c=m,o=a):c=c.next=m,Ut.lanes|=p,ou|=p;m=f.action,gc&&t(a,m),a=f.hasEagerState?f.eagerState:t(a,m)}else p={lane:m,revertLane:f.revertLane,gesture:f.gesture,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null},c===null?(l=c=p,o=a):c=c.next=p,Ut.lanes|=m,ou|=m;f=f.next}while(f!==null&&f!==e);if(c===null?o=a:c.next=l,!ba(a,n.memoizedState)&&(ci=!0,d&&(t=bd,t!==null)))throw t;n.memoizedState=a,n.baseState=o,n.baseQueue=c,i.lastRenderedState=a}return r===null&&(i.lanes=0),[n.memoizedState,i.dispatch]}function RT(n){var e=Jn(),t=e.queue;if(t===null)throw Error(Ve(311));t.lastRenderedReducer=n;var i=t.dispatch,r=t.pending,a=e.memoizedState;if(r!==null){t.pending=null;var o=r=r.next;do a=n(a,o.action),o=o.next;while(o!==r);ba(a,e.memoizedState)||(ci=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),t.lastRenderedState=a}return[a,i]}function xU(n,e,t){var i=Ut,r=Jn(),a=Yt;if(a){if(t===void 0)throw Error(Ve(407));t=t()}else t=e();var o=!ba((vn||r).memoizedState,t);if(o&&(r.memoizedState=t,ci=!0),r=r.queue,vM(EU.bind(null,i,r,n),[n]),r.getSnapshot!==e||o||si!==null&&si.memoizedState.tag&1){if(i.flags|=2048,Rd(9,{destroy:void 0},TU.bind(null,i,r,t,e),null),_n===null)throw Error(Ve(349));a||(Ps&127)!==0||SU(i,e,t)}return t}function SU(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=Ut.updateQueue,e===null?(e=F_(),Ut.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function TU(n,e,t,i){e.value=t,e.getSnapshot=i,MU(e)&&wU(n)}function EU(n,e,t){return t(function(){MU(e)&&wU(n)})}function MU(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!ba(n,t)}catch{return!0}}function wU(n){var e=xc(n,2);e!==null&&Vr(e,n,2)}function _E(n){var e=Sr();if(typeof n=="function"){var t=n;if(n=t(),gc){Gl(!0);try{t()}finally{Gl(!1)}}}return e.memoizedState=e.baseState=n,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Is,lastRenderedState:n},e}function AU(n,e,t,i){return n.baseState=t,gM(n,vn,typeof i=="function"?i:Is)}function IB(n,e,t,i,r){if(V_(n))throw Error(Ve(485));if(n=e.action,n!==null){var a={payload:r,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){a.listeners.push(o)}};Tt.T!==null?t(!0):a.isTransition=!1,i(a),t=e.pending,t===null?(a.next=e.pending=a,CU(e,a)):(a.next=t.next,e.pending=t.next=a)}}function CU(n,e){var t=e.action,i=e.payload,r=n.state;if(e.isTransition){var a=Tt.T,o={};Tt.T=o;try{var l=t(r,i),c=Tt.S;c!==null&&c(o,l),AR(n,e,l)}catch(f){bE(n,e,f)}finally{a!==null&&o.types!==null&&(a.types=o.types),Tt.T=a}}else try{a=t(r,i),AR(n,e,a)}catch(f){bE(n,e,f)}}function AR(n,e,t){t!==null&&typeof t=="object"&&typeof t.then=="function"?t.then(function(i){CR(n,e,i)},function(i){return bE(n,e,i)}):CR(n,e,t)}function CR(n,e,t){e.status="fulfilled",e.value=t,RU(e),n.state=t,e=n.pending,e!==null&&(t=e.next,t===e?n.pending=null:(t=t.next,e.next=t,CU(n,t)))}function bE(n,e,t){var i=n.pending;if(n.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=t,RU(e),e=e.next;while(e!==i)}n.action=null}function RU(n){n=n.listeners;for(var e=0;e<n.length;e++)(0,n[e])()}function DU(n,e){return e}function RR(n,e){if(Yt){var t=_n.formState;if(t!==null){e:{var i=Ut;if(Yt){if(Cn){t:{for(var r=Cn,a=Va;r.nodeType!==8;){if(!a){r=null;break t}if(r=Wa(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){Cn=Wa(r.nextSibling),i=r.data==="F!";break e}}ru(i)}i=!1}i&&(e=t[0])}}return t=Sr(),t.memoizedState=t.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:DU,lastRenderedState:e},t.queue=i,t=qU.bind(null,Ut,i),i.dispatch=t,i=_E(!1),a=xM.bind(null,Ut,!1,i.queue),i=Sr(),r={state:e,dispatch:null,action:n,pending:null},i.queue=r,t=IB.bind(null,Ut,r,a,t),r.dispatch=t,i.memoizedState=n,[e,t,!1]}function DR(n){var e=Jn();return UU(e,vn,n)}function UU(n,e,t){if(e=gM(n,e,DU)[0],n=jy(Is)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Hm(e)}catch(o){throw o===kd?k_:o}else i=e;e=Jn();var r=e.queue,a=r.dispatch;return t!==e.memoizedState&&(Ut.flags|=2048,Rd(9,{destroy:void 0},zB.bind(null,r,t),null)),[i,a,n]}function zB(n,e){n.action=e}function UR(n){var e=Jn(),t=vn;if(t!==null)return UU(e,t,n);Jn(),e=e.memoizedState,t=Jn();var i=t.queue.dispatch;return t.memoizedState=n,[e,i,!1]}function Rd(n,e,t,i){return n={tag:n,create:t,deps:i,inst:e,next:null},e=Ut.updateQueue,e===null&&(e=F_(),Ut.updateQueue=e),t=e.lastEffect,t===null?e.lastEffect=n.next=n:(i=t.next,t.next=n,n.next=i,e.lastEffect=n),n}function OU(){return Jn().memoizedState}function Zy(n,e,t,i){var r=Sr();Ut.flags|=n,r.memoizedState=Rd(1|e,{destroy:void 0},t,i===void 0?null:i)}function H_(n,e,t,i){var r=Jn();i=i===void 0?null:i;var a=r.memoizedState.inst;vn!==null&&i!==null&&cM(i,vn.memoizedState.deps)?r.memoizedState=Rd(e,a,t,i):(Ut.flags|=n,r.memoizedState=Rd(1|e,a,t,i))}function OR(n,e){Zy(8390656,8,n,e)}function vM(n,e){H_(2048,8,n,e)}function kB(n){Ut.flags|=4;var e=Ut.updateQueue;if(e===null)e=F_(),Ut.updateQueue=e,e.events=[n];else{var t=e.events;t===null?e.events=[n]:t.push(n)}}function LU(n){var e=Jn().memoizedState;return kB({ref:e,nextImpl:n}),function(){if((tn&2)!==0)throw Error(Ve(440));return e.impl.apply(void 0,arguments)}}function NU(n,e){return H_(4,2,n,e)}function PU(n,e){return H_(4,4,n,e)}function IU(n,e){if(typeof e=="function"){n=n();var t=e(n);return function(){typeof t=="function"?t():e(null)}}if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function zU(n,e,t){t=t!=null?t.concat([n]):null,H_(4,4,IU.bind(null,e,n),t)}function yM(){}function kU(n,e){var t=Jn();e=e===void 0?null:e;var i=t.memoizedState;return e!==null&&cM(e,i[1])?i[0]:(t.memoizedState=[n,e],n)}function FU(n,e){var t=Jn();e=e===void 0?null:e;var i=t.memoizedState;if(e!==null&&cM(e,i[1]))return i[0];if(i=n(),gc){Gl(!0);try{n()}finally{Gl(!1)}}return t.memoizedState=[i,e],i}function _M(n,e,t){return t===void 0||(Ps&1073741824)!==0&&(Xt&261930)===0?n.memoizedState=e:(n.memoizedState=t,n=AO(),Ut.lanes|=n,ou|=n,t)}function BU(n,e,t,i){return ba(t,e)?t:Cd.current!==null?(n=_M(n,t,i),ba(n,e)||(ci=!0),n):(Ps&42)===0||(Ps&1073741824)!==0&&(Xt&261930)===0?(ci=!0,n.memoizedState=t):(n=AO(),Ut.lanes|=n,ou|=n,e)}function HU(n,e,t,i,r){var a=nn.p;nn.p=a!==0&&8>a?a:8;var o=Tt.T,l={};Tt.T=l,xM(n,!1,e,t);try{var c=r(),f=Tt.S;if(f!==null&&f(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=LB(c,i);pm(n,e,d,_a(n))}else pm(n,e,i,_a(n))}catch(m){pm(n,e,{then:function(){},status:"rejected",reason:m},_a())}finally{nn.p=a,o!==null&&l.types!==null&&(o.types=l.types),Tt.T=o}}function FB(){}function xE(n,e,t,i){if(n.tag!==5)throw Error(Ve(476));var r=VU(n).queue;HU(n,r,e,lc,t===null?FB:function(){return GU(n),t(i)})}function VU(n){var e=n.memoizedState;if(e!==null)return e;e={memoizedState:lc,baseState:lc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Is,lastRenderedState:lc},next:null};var t={};return e.next={memoizedState:t,baseState:t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Is,lastRenderedState:t},next:null},n.memoizedState=e,n=n.alternate,n!==null&&(n.memoizedState=e),e}function GU(n){var e=VU(n);e.next===null&&(e=n.alternate.memoizedState),pm(n,e.next.queue,{},_a())}function bM(){return Wi(Um)}function WU(){return Jn().memoizedState}function XU(){return Jn().memoizedState}function BB(n){for(var e=n.return;e!==null;){switch(e.tag){case 24:case 3:var t=_a();n=Kl(t);var i=Ql(e,n,t);i!==null&&(Vr(i,e,t),fm(i,e,t)),e={cache:aM()},n.payload=e;return}e=e.return}}function HB(n,e,t){var i=_a();t={lane:i,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null},V_(n)?YU(e,t):(t=tM(n,e,t,i),t!==null&&(Vr(t,n,i),jU(t,e,i)))}function qU(n,e,t){var i=_a();pm(n,e,t,i)}function pm(n,e,t,i){var r={lane:i,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null};if(V_(n))YU(e,r);else{var a=n.alternate;if(n.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,l=a(o,t);if(r.hasEagerState=!0,r.eagerState=l,ba(l,o))return z_(n,e,r,0),_n===null&&I_(),!1}catch{}finally{}if(t=tM(n,e,r,i),t!==null)return Vr(t,n,i),jU(t,e,i),!0}return!1}function xM(n,e,t,i){if(i={lane:2,revertLane:DM(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},V_(n)){if(e)throw Error(Ve(479))}else e=tM(n,t,i,2),e!==null&&Vr(e,n,2)}function V_(n){var e=n.alternate;return n===Ut||e!==null&&e===Ut}function YU(n,e){Sd=m_=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function jU(n,e,t){if((t&4194048)!==0){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,LD(n,t)}}var Cm={readContext:Wi,use:B_,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useLayoutEffect:Wn,useInsertionEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useSyncExternalStore:Wn,useId:Wn,useHostTransitionStatus:Wn,useFormState:Wn,useActionState:Wn,useOptimistic:Wn,useMemoCache:Wn,useCacheRefresh:Wn};Cm.useEffectEvent=Wn;var ZU={readContext:Wi,use:B_,useCallback:function(n,e){return Sr().memoizedState=[n,e===void 0?null:e],n},useContext:Wi,useEffect:OR,useImperativeHandle:function(n,e,t){t=t!=null?t.concat([n]):null,Zy(4194308,4,IU.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Zy(4194308,4,n,e)},useInsertionEffect:function(n,e){Zy(4,2,n,e)},useMemo:function(n,e){var t=Sr();e=e===void 0?null:e;var i=n();if(gc){Gl(!0);try{n()}finally{Gl(!1)}}return t.memoizedState=[i,e],i},useReducer:function(n,e,t){var i=Sr();if(t!==void 0){var r=t(e);if(gc){Gl(!0);try{t(e)}finally{Gl(!1)}}}else r=e;return i.memoizedState=i.baseState=r,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:r},i.queue=n,n=n.dispatch=HB.bind(null,Ut,n),[i.memoizedState,n]},useRef:function(n){var e=Sr();return n={current:n},e.memoizedState=n},useState:function(n){n=_E(n);var e=n.queue,t=qU.bind(null,Ut,e);return e.dispatch=t,[n.memoizedState,t]},useDebugValue:yM,useDeferredValue:function(n,e){var t=Sr();return _M(t,n,e)},useTransition:function(){var n=_E(!1);return n=HU.bind(null,Ut,n.queue,!0,!1),Sr().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,e,t){var i=Ut,r=Sr();if(Yt){if(t===void 0)throw Error(Ve(407));t=t()}else{if(t=e(),_n===null)throw Error(Ve(349));(Xt&127)!==0||SU(i,e,t)}r.memoizedState=t;var a={value:t,getSnapshot:e};return r.queue=a,OR(EU.bind(null,i,a,n),[n]),i.flags|=2048,Rd(9,{destroy:void 0},TU.bind(null,i,a,t,e),null),t},useId:function(){var n=Sr(),e=_n.identifierPrefix;if(Yt){var t=Po,i=No;t=(i&~(1<<32-ya(i)-1)).toString(32)+t,e="_"+e+"R_"+t,t=g_++,0<t&&(e+="H"+t.toString(32)),e+="_"}else t=NB++,e="_"+e+"r_"+t.toString(32)+"_";return n.memoizedState=e},useHostTransitionStatus:bM,useFormState:RR,useActionState:RR,useOptimistic:function(n){var e=Sr();e.memoizedState=e.baseState=n;var t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=t,e=xM.bind(null,Ut,!0,t),t.dispatch=e,[n,e]},useMemoCache:mM,useCacheRefresh:function(){return Sr().memoizedState=BB.bind(null,Ut)},useEffectEvent:function(n){var e=Sr(),t={impl:n};return e.memoizedState=t,function(){if((tn&2)!==0)throw Error(Ve(440));return t.impl.apply(void 0,arguments)}}},SM={readContext:Wi,use:B_,useCallback:kU,useContext:Wi,useEffect:vM,useImperativeHandle:zU,useInsertionEffect:NU,useLayoutEffect:PU,useMemo:FU,useReducer:jy,useRef:OU,useState:function(){return jy(Is)},useDebugValue:yM,useDeferredValue:function(n,e){var t=Jn();return BU(t,vn.memoizedState,n,e)},useTransition:function(){var n=jy(Is)[0],e=Jn().memoizedState;return[typeof n=="boolean"?n:Hm(n),e]},useSyncExternalStore:xU,useId:WU,useHostTransitionStatus:bM,useFormState:DR,useActionState:DR,useOptimistic:function(n,e){var t=Jn();return AU(t,vn,n,e)},useMemoCache:mM,useCacheRefresh:XU};SM.useEffectEvent=LU;var KU={readContext:Wi,use:B_,useCallback:kU,useContext:Wi,useEffect:vM,useImperativeHandle:zU,useInsertionEffect:NU,useLayoutEffect:PU,useMemo:FU,useReducer:RT,useRef:OU,useState:function(){return RT(Is)},useDebugValue:yM,useDeferredValue:function(n,e){var t=Jn();return vn===null?_M(t,n,e):BU(t,vn.memoizedState,n,e)},useTransition:function(){var n=RT(Is)[0],e=Jn().memoizedState;return[typeof n=="boolean"?n:Hm(n),e]},useSyncExternalStore:xU,useId:WU,useHostTransitionStatus:bM,useFormState:UR,useActionState:UR,useOptimistic:function(n,e){var t=Jn();return vn!==null?AU(t,vn,n,e):(t.baseState=n,[n,t.queue.dispatch])},useMemoCache:mM,useCacheRefresh:XU};KU.useEffectEvent=LU;function DT(n,e,t,i){e=n.memoizedState,t=t(i,e),t=t==null?e:Rn({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var SE={enqueueSetState:function(n,e,t){n=n._reactInternals;var i=_a(),r=Kl(i);r.payload=e,t!=null&&(r.callback=t),e=Ql(n,r,i),e!==null&&(Vr(e,n,i),fm(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var i=_a(),r=Kl(i);r.tag=1,r.payload=e,t!=null&&(r.callback=t),e=Ql(n,r,i),e!==null&&(Vr(e,n,i),fm(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=_a(),i=Kl(t);i.tag=2,e!=null&&(i.callback=e),e=Ql(n,i,t),e!==null&&(Vr(e,n,t),fm(e,n,t))}};function LR(n,e,t,i,r,a,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(i,a,o):e.prototype&&e.prototype.isPureReactComponent?!Tm(t,i)||!Tm(r,a):!0}function NR(n,e,t,i){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,i),e.state!==n&&SE.enqueueReplaceState(e,e.state,null)}function vc(n,e){var t=e;if("ref"in e){t={};for(var i in e)i!=="ref"&&(t[i]=e[i])}if(n=n.defaultProps){t===e&&(t=Rn({},t));for(var r in n)t[r]===void 0&&(t[r]=n[r])}return t}function QU(n){l_(n)}function JU(n){console.error(n)}function $U(n){l_(n)}function v_(n,e){try{var t=n.onUncaughtError;t(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function PR(n,e,t){try{var i=n.onCaughtError;i(t.value,{componentStack:t.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function TE(n,e,t){return t=Kl(t),t.tag=3,t.payload={element:null},t.callback=function(){v_(n,e)},t}function eO(n){return n=Kl(n),n.tag=3,n}function tO(n,e,t,i){var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;n.payload=function(){return r(a)},n.callback=function(){PR(e,t,i)}}var o=t.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){PR(e,t,i),typeof r!="function"&&(Jl===null?Jl=new Set([this]):Jl.add(this));var l=i.stack;this.componentDidCatch(i.value,{componentStack:l!==null?l:""})})}function VB(n,e,t,i,r){if(t.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=t.alternate,e!==null&&zd(e,t,r,!0),t=xa.current,t!==null){switch(t.tag){case 31:case 13:return Ga===null?S_():t.alternate===null&&Xn===0&&(Xn=3),t.flags&=-257,t.flags|=65536,t.lanes=r,i===d_?t.flags|=16384:(e=t.updateQueue,e===null?t.updateQueue=new Set([i]):e.add(i),HT(n,i,r)),!1;case 22:return t.flags|=65536,i===d_?t.flags|=16384:(e=t.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},t.updateQueue=e):(t=e.retryQueue,t===null?e.retryQueue=new Set([i]):t.add(i)),HT(n,i,r)),!1}throw Error(Ve(435,t.tag))}return HT(n,i,r),S_(),!1}if(Yt)return e=xa.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==cE&&(n=Error(Ve(422),{cause:i}),Mm(Ha(n,t)))):(i!==cE&&(e=Error(Ve(423),{cause:i}),Mm(Ha(e,t))),n=n.current.alternate,n.flags|=65536,r&=-r,n.lanes|=r,i=Ha(i,t),r=TE(n.stateNode,i,r),CT(n,r),Xn!==4&&(Xn=2)),!1;var a=Error(Ve(520),{cause:i});if(a=Ha(a,t),vm===null?vm=[a]:vm.push(a),Xn!==4&&(Xn=2),e===null)return!0;i=Ha(i,t),t=e;do{switch(t.tag){case 3:return t.flags|=65536,n=r&-r,t.lanes|=n,n=TE(t.stateNode,i,n),CT(t,n),!1;case 1:if(e=t.type,a=t.stateNode,(t.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Jl===null||!Jl.has(a))))return t.flags|=65536,r&=-r,t.lanes|=r,r=eO(r),tO(r,n,t,i),CT(t,r),!1}t=t.return}while(t!==null);return!1}var TM=Error(Ve(461)),ci=!1;function Hi(n,e,t,i){e.child=n===null?mU(e,null,t,i):mc(e,n.child,t,i)}function IR(n,e,t,i,r){t=t.render;var a=e.ref;if("ref"in i){var o={};for(var l in i)l!=="ref"&&(o[l]=i[l])}else o=i;return pc(e),i=fM(n,e,t,o,a,r),l=dM(),n!==null&&!ci?(hM(n,e,r),zs(n,e,r)):(Yt&&l&&iM(e),e.flags|=1,Hi(n,e,i,r),e.child)}function zR(n,e,t,i,r){if(n===null){var a=t.type;return typeof a=="function"&&!nM(a)&&a.defaultProps===void 0&&t.compare===null?(e.tag=15,e.type=a,nO(n,e,a,i,r)):(n=qy(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(a=n.child,!EM(n,r)){var o=a.memoizedProps;if(t=t.compare,t=t!==null?t:Tm,t(o,i)&&n.ref===e.ref)return zs(n,e,r)}return e.flags|=1,n=Us(a,i),n.ref=e.ref,n.return=e,e.child=n}function nO(n,e,t,i,r){if(n!==null){var a=n.memoizedProps;if(Tm(a,i)&&n.ref===e.ref)if(ci=!1,e.pendingProps=i=a,EM(n,r))(n.flags&131072)!==0&&(ci=!0);else return e.lanes=n.lanes,zs(n,e,r)}return EE(n,e,t,i,r)}function iO(n,e,t,i){var r=i.children,a=n!==null?n.memoizedState:null;if(n===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(a=a!==null?a.baseLanes|t:t,n!==null){for(i=e.child=n.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~a}else i=0,e.child=null;return kR(n,e,a,t,i)}if((t&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},n!==null&&Yy(e,a!==null?a.cachePool:null),a!==null?wR(e,a):vE(),yU(e);else return i=e.lanes=536870912,kR(n,e,a!==null?a.baseLanes|t:t,t,i)}else a!==null?(Yy(e,a.cachePool),wR(e,a),Hl(e),e.memoizedState=null):(n!==null&&Yy(e,null),vE(),Hl(e));return Hi(n,e,r,t),e.child}function am(n,e){return n!==null&&n.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function kR(n,e,t,i,r){var a=oM();return a=a===null?null:{parent:ui._currentValue,pool:a},e.memoizedState={baseLanes:t,cachePool:a},n!==null&&Yy(e,null),vE(),yU(e),n!==null&&zd(n,e,i,!0),e.childLanes=r,null}function Ky(n,e){return e=y_({mode:e.mode,children:e.children},n.mode),e.ref=n.ref,n.child=e,e.return=n,e}function FR(n,e,t){return mc(e,n.child,null,t),n=Ky(e,e.pendingProps),n.flags|=2,ha(e),e.memoizedState=null,n}function GB(n,e,t){var i=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,n===null){if(Yt){if(i.mode==="hidden")return n=Ky(e,i),e.lanes=536870912,am(null,n);if(yE(e),(n=Cn)?(n=ZO(n,Va),n=n!==null&&n.data==="&"?n:null,n!==null&&(e.memoizedState={dehydrated:n,treeContext:iu!==null?{id:No,overflow:Po}:null,retryLane:536870912,hydrationErrors:null},t=lU(n),t.return=e,e.child=t,Gi=e,Cn=null)):n=null,n===null)throw ru(e);return e.lanes=536870912,null}return Ky(e,i)}var a=n.memoizedState;if(a!==null){var o=a.dehydrated;if(yE(e),r)if(e.flags&256)e.flags&=-257,e=FR(n,e,t);else if(e.memoizedState!==null)e.child=n.child,e.flags|=128,e=null;else throw Error(Ve(558));else if(ci||zd(n,e,t,!1),r=(t&n.childLanes)!==0,ci||r){if(i=_n,i!==null&&(o=ND(i,t),o!==0&&o!==a.retryLane))throw a.retryLane=o,xc(n,o),Vr(i,n,o),TM;S_(),e=FR(n,e,t)}else n=a.treeContext,Cn=Wa(o.nextSibling),Gi=e,Yt=!0,Zl=null,Va=!1,n!==null&&cU(e,n),e=Ky(e,i),e.flags|=4096;return e}return n=Us(n.child,{mode:i.mode,children:i.children}),n.ref=e.ref,e.child=n,n.return=e,n}function Qy(n,e){var t=e.ref;if(t===null)n!==null&&n.ref!==null&&(e.flags|=4194816);else{if(typeof t!="function"&&typeof t!="object")throw Error(Ve(284));(n===null||n.ref!==t)&&(e.flags|=4194816)}}function EE(n,e,t,i,r){return pc(e),t=fM(n,e,t,i,void 0,r),i=dM(),n!==null&&!ci?(hM(n,e,r),zs(n,e,r)):(Yt&&i&&iM(e),e.flags|=1,Hi(n,e,t,r),e.child)}function BR(n,e,t,i,r,a){return pc(e),e.updateQueue=null,t=bU(e,i,t,r),_U(n),i=dM(),n!==null&&!ci?(hM(n,e,a),zs(n,e,a)):(Yt&&i&&iM(e),e.flags|=1,Hi(n,e,t,a),e.child)}function HR(n,e,t,i,r){if(pc(e),e.stateNode===null){var a=hd,o=t.contextType;typeof o=="object"&&o!==null&&(a=Wi(o)),a=new t(i,a),e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=SE,e.stateNode=a,a._reactInternals=e,a=e.stateNode,a.props=i,a.state=e.memoizedState,a.refs={},lM(e),o=t.contextType,a.context=typeof o=="object"&&o!==null?Wi(o):hd,a.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(DT(e,t,o,i),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(o=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),o!==a.state&&SE.enqueueReplaceState(a,a.state,null),hm(e,i,a,r),dm(),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(n===null){a=e.stateNode;var l=e.memoizedProps,c=vc(t,l);a.props=c;var f=a.context,d=t.contextType;o=hd,typeof d=="object"&&d!==null&&(o=Wi(d));var m=t.getDerivedStateFromProps;d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function",l=e.pendingProps!==l,d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l||f!==o)&&NR(e,a,i,o),kl=!1;var p=e.memoizedState;a.state=p,hm(e,i,a,r),dm(),f=e.memoizedState,l||p!==f||kl?(typeof m=="function"&&(DT(e,t,m,i),f=e.memoizedState),(c=kl||LR(e,t,c,i,p,f,o))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=f),a.props=i,a.state=f,a.context=o,i=c):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,mE(n,e),o=e.memoizedProps,d=vc(t,o),a.props=d,m=e.pendingProps,p=a.context,f=t.contextType,c=hd,typeof f=="object"&&f!==null&&(c=Wi(f)),l=t.getDerivedStateFromProps,(f=typeof l=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==m||p!==c)&&NR(e,a,i,c),kl=!1,p=e.memoizedState,a.state=p,hm(e,i,a,r),dm();var g=e.memoizedState;o!==m||p!==g||kl||n!==null&&n.dependencies!==null&&f_(n.dependencies)?(typeof l=="function"&&(DT(e,t,l,i),g=e.memoizedState),(d=kl||LR(e,t,d,i,p,g,c)||n!==null&&n.dependencies!==null&&f_(n.dependencies))?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,g,c)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=g),a.props=i,a.state=g,a.context=c,i=d):(typeof a.componentDidUpdate!="function"||o===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),i=!1)}return a=i,Qy(n,e),i=(e.flags&128)!==0,a||i?(a=e.stateNode,t=i&&typeof t.getDerivedStateFromError!="function"?null:a.render(),e.flags|=1,n!==null&&i?(e.child=mc(e,n.child,null,r),e.child=mc(e,null,t,r)):Hi(n,e,t,r),e.memoizedState=a.state,n=e.child):n=zs(n,e,r),n}function VR(n,e,t,i){return hc(),e.flags|=256,Hi(n,e,t,i),e.child}var UT={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function OT(n){return{baseLanes:n,cachePool:dU()}}function LT(n,e,t){return n=n!==null?n.childLanes&~t:0,e&&(n|=ma),n}function rO(n,e,t){var i=e.pendingProps,r=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=n!==null&&n.memoizedState===null?!1:(Qn.current&2)!==0),o&&(r=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,n===null){if(Yt){if(r?Bl(e):Hl(e),(n=Cn)?(n=ZO(n,Va),n=n!==null&&n.data!=="&"?n:null,n!==null&&(e.memoizedState={dehydrated:n,treeContext:iu!==null?{id:No,overflow:Po}:null,retryLane:536870912,hydrationErrors:null},t=lU(n),t.return=e,e.child=t,Gi=e,Cn=null)):n=null,n===null)throw ru(e);return kE(n)?e.lanes=32:e.lanes=536870912,null}var l=i.children;return i=i.fallback,r?(Hl(e),r=e.mode,l=y_({mode:"hidden",children:l},r),i=uc(i,r,t,null),l.return=e,i.return=e,l.sibling=i,e.child=l,i=e.child,i.memoizedState=OT(t),i.childLanes=LT(n,o,t),e.memoizedState=UT,am(null,i)):(Bl(e),ME(e,l))}var c=n.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(a)e.flags&256?(Bl(e),e.flags&=-257,e=NT(n,e,t)):e.memoizedState!==null?(Hl(e),e.child=n.child,e.flags|=128,e=null):(Hl(e),l=i.fallback,r=e.mode,i=y_({mode:"visible",children:i.children},r),l=uc(l,r,t,null),l.flags|=2,i.return=e,l.return=e,i.sibling=l,e.child=i,mc(e,n.child,null,t),i=e.child,i.memoizedState=OT(t),i.childLanes=LT(n,o,t),e.memoizedState=UT,e=am(null,i));else if(Bl(e),kE(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var f=o.dgst;o=f,i=Error(Ve(419)),i.stack="",i.digest=o,Mm({value:i,source:null,stack:null}),e=NT(n,e,t)}else if(ci||zd(n,e,t,!1),o=(t&n.childLanes)!==0,ci||o){if(o=_n,o!==null&&(i=ND(o,t),i!==0&&i!==c.retryLane))throw c.retryLane=i,xc(n,i),Vr(o,n,i),TM;zE(l)||S_(),e=NT(n,e,t)}else zE(l)?(e.flags|=192,e.child=n.child,e=null):(n=c.treeContext,Cn=Wa(l.nextSibling),Gi=e,Yt=!0,Zl=null,Va=!1,n!==null&&cU(e,n),e=ME(e,i.children),e.flags|=4096);return e}return r?(Hl(e),l=i.fallback,r=e.mode,c=n.child,f=c.sibling,i=Us(c,{mode:"hidden",children:i.children}),i.subtreeFlags=c.subtreeFlags&65011712,f!==null?l=Us(f,l):(l=uc(l,r,t,null),l.flags|=2),l.return=e,i.return=e,i.sibling=l,e.child=i,am(null,i),i=e.child,l=n.child.memoizedState,l===null?l=OT(t):(r=l.cachePool,r!==null?(c=ui._currentValue,r=r.parent!==c?{parent:c,pool:c}:r):r=dU(),l={baseLanes:l.baseLanes|t,cachePool:r}),i.memoizedState=l,i.childLanes=LT(n,o,t),e.memoizedState=UT,am(n.child,i)):(Bl(e),t=n.child,n=t.sibling,t=Us(t,{mode:"visible",children:i.children}),t.return=e,t.sibling=null,n!==null&&(o=e.deletions,o===null?(e.deletions=[n],e.flags|=16):o.push(n)),e.child=t,e.memoizedState=null,t)}function ME(n,e){return e=y_({mode:"visible",children:e},n.mode),e.return=n,n.child=e}function y_(n,e){return n=pa(22,n,null,e),n.lanes=0,n}function NT(n,e,t){return mc(e,n.child,null,t),n=ME(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function GR(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),dE(n.return,e,t)}function PT(n,e,t,i,r,a){var o=n.memoizedState;o===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r,treeForkCount:a}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=t,o.tailMode=r,o.treeForkCount=a)}function aO(n,e,t){var i=e.pendingProps,r=i.revealOrder,a=i.tail;i=i.children;var o=Qn.current,l=(o&2)!==0;if(l?(o=o&1|2,e.flags|=128):o&=1,Sn(Qn,o),Hi(n,e,i,t),i=Yt?Em:0,!l&&n!==null&&(n.flags&128)!==0)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&GR(n,t,e);else if(n.tag===19)GR(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}switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&p_(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),PT(e,!1,r,t,a,i);break;case"backwards":case"unstable_legacy-backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&p_(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}PT(e,!0,t,null,a,i);break;case"together":PT(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function zs(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),ou|=e.lanes,(t&e.childLanes)===0)if(n!==null){if(zd(n,e,t,!1),(t&e.childLanes)===0)return null}else return null;if(n!==null&&e.child!==n.child)throw Error(Ve(153));if(e.child!==null){for(n=e.child,t=Us(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=Us(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function EM(n,e){return(n.lanes&e)!==0?!0:(n=n.dependencies,!!(n!==null&&f_(n)))}function WB(n,e,t){switch(e.tag){case 3:r_(e,e.stateNode.containerInfo),Fl(e,ui,n.memoizedState.cache),hc();break;case 27:case 5:$T(e);break;case 4:r_(e,e.stateNode.containerInfo);break;case 10:Fl(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,yE(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(Bl(e),e.flags|=128,null):(t&e.child.childLanes)!==0?rO(n,e,t):(Bl(e),n=zs(n,e,t),n!==null?n.sibling:null);Bl(e);break;case 19:var r=(n.flags&128)!==0;if(i=(t&e.childLanes)!==0,i||(zd(n,e,t,!1),i=(t&e.childLanes)!==0),r){if(i)return aO(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Sn(Qn,Qn.current),i)break;return null;case 22:return e.lanes=0,iO(n,e,t,e.pendingProps);case 24:Fl(e,ui,n.memoizedState.cache)}return zs(n,e,t)}function oO(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps)ci=!0;else{if(!EM(n,t)&&(e.flags&128)===0)return ci=!1,WB(n,e,t);ci=(n.flags&131072)!==0}else ci=!1,Yt&&(e.flags&1048576)!==0&&uU(e,Em,e.index);switch(e.lanes=0,e.tag){case 16:e:{var i=e.pendingProps;if(n=oc(e.elementType),e.type=n,typeof n=="function")nM(n)?(i=vc(n,i),e.tag=1,e=HR(null,e,n,i,t)):(e.tag=0,e=EE(null,e,n,i,t));else{if(n!=null){var r=n.$$typeof;if(r===VE){e.tag=11,e=IR(null,e,n,i,t);break e}else if(r===GE){e.tag=14,e=zR(null,e,n,i,t);break e}}throw e=QT(n)||n,Error(Ve(306,e,""))}}return e;case 0:return EE(n,e,e.type,e.pendingProps,t);case 1:return i=e.type,r=vc(i,e.pendingProps),HR(n,e,i,r,t);case 3:e:{if(r_(e,e.stateNode.containerInfo),n===null)throw Error(Ve(387));i=e.pendingProps;var a=e.memoizedState;r=a.element,mE(n,e),hm(e,i,null,t);var o=e.memoizedState;if(i=o.cache,Fl(e,ui,i),i!==a.cache&&hE(e,[ui],t,!0),dm(),i=o.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){e=VR(n,e,i,t);break e}else if(i!==r){r=Ha(Error(Ve(424)),e),Mm(r),e=VR(n,e,i,t);break e}else{switch(n=e.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Cn=Wa(n.firstChild),Gi=e,Yt=!0,Zl=null,Va=!0,t=mU(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling}else{if(hc(),i===r){e=zs(n,e,t);break e}Hi(n,e,i,t)}e=e.child}return e;case 26:return Qy(n,e),n===null?(t=fD(e.type,null,e.pendingProps,null))?e.memoizedState=t:Yt||(t=e.type,n=e.pendingProps,i=w_(jl.current).createElement(t),i[Vi]=e,i[Gr]=n,Xi(i,t,n),Ri(i),e.stateNode=i):e.memoizedState=fD(e.type,n.memoizedProps,e.pendingProps,n.memoizedState),null;case 27:return $T(e),n===null&&Yt&&(i=e.stateNode=KO(e.type,e.pendingProps,jl.current),Gi=e,Va=!0,r=Cn,lu(e.type)?(FE=r,Cn=Wa(i.firstChild)):Cn=r),Hi(n,e,e.pendingProps.children,t),Qy(n,e),n===null&&(e.flags|=4194304),e.child;case 5:return n===null&&Yt&&((r=i=Cn)&&(i=y5(i,e.type,e.pendingProps,Va),i!==null?(e.stateNode=i,Gi=e,Cn=Wa(i.firstChild),Va=!1,r=!0):r=!1),r||ru(e)),$T(e),r=e.type,a=e.pendingProps,o=n!==null?n.memoizedProps:null,i=a.children,PE(r,a)?i=null:o!==null&&PE(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=fM(n,e,PB,null,null,t),Um._currentValue=r),Qy(n,e),Hi(n,e,i,t),e.child;case 6:return n===null&&Yt&&((n=t=Cn)&&(t=_5(t,e.pendingProps,Va),t!==null?(e.stateNode=t,Gi=e,Cn=null,n=!0):n=!1),n||ru(e)),null;case 13:return rO(n,e,t);case 4:return r_(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=mc(e,null,i,t):Hi(n,e,i,t),e.child;case 11:return IR(n,e,e.type,e.pendingProps,t);case 7:return Hi(n,e,e.pendingProps,t),e.child;case 8:return Hi(n,e,e.pendingProps.children,t),e.child;case 12:return Hi(n,e,e.pendingProps.children,t),e.child;case 10:return i=e.pendingProps,Fl(e,e.type,i.value),Hi(n,e,i.children,t),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,pc(e),r=Wi(r),i=i(r),e.flags|=1,Hi(n,e,i,t),e.child;case 14:return zR(n,e,e.type,e.pendingProps,t);case 15:return nO(n,e,e.type,e.pendingProps,t);case 19:return aO(n,e,t);case 31:return GB(n,e,t);case 22:return iO(n,e,t,e.pendingProps);case 24:return pc(e),i=Wi(ui),n===null?(r=oM(),r===null&&(r=_n,a=aM(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=t),r=a),e.memoizedState={parent:i,cache:r},lM(e),Fl(e,ui,r)):((n.lanes&t)!==0&&(mE(n,e),hm(e,null,null,t),dm()),r=n.memoizedState,a=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Fl(e,ui,i)):(i=a.cache,Fl(e,ui,i),i!==r.cache&&hE(e,[ui],t,!0))),Hi(n,e,e.pendingProps.children,t),e.child;case 29:throw e.pendingProps}throw Error(Ve(156,e.tag))}function Ss(n){n.flags|=4}function IT(n,e,t,i,r){if((e=(n.mode&32)!==0)&&(e=!1),e){if(n.flags|=16777216,(r&335544128)===r)if(n.stateNode.complete)n.flags|=8192;else if(DO())n.flags|=8192;else throw fc=d_,sM}else n.flags&=-16777217}function WR(n,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!$O(e))if(DO())n.flags|=8192;else throw fc=d_,sM}function Py(n,e){e!==null&&(n.flags|=4),n.flags&16384&&(e=n.tag!==22?UD():536870912,n.lanes|=e,Dd|=e)}function Jp(n,e){if(!Yt)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 An(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&65011712,i|=r.flags&65011712,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 XB(n,e,t){var i=e.pendingProps;switch(rM(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return An(e),null;case 1:return An(e),null;case 3:return t=e.stateNode,i=null,n!==null&&(i=n.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Os(ui),Ed(),t.pendingContext&&(t.context=t.pendingContext,t.pendingContext=null),(n===null||n.child===null)&&(td(e)?Ss(e):n===null||n.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,AT())),An(e),null;case 26:var r=e.type,a=e.memoizedState;return n===null?(Ss(e),a!==null?(An(e),WR(e,a)):(An(e),IT(e,r,null,i,t))):a?a!==n.memoizedState?(Ss(e),An(e),WR(e,a)):(An(e),e.flags&=-16777217):(n=n.memoizedProps,n!==i&&Ss(e),An(e),IT(e,r,n,i,t)),null;case 27:if(a_(e),t=jl.current,r=e.type,n!==null&&e.stateNode!=null)n.memoizedProps!==i&&Ss(e);else{if(!i){if(e.stateNode===null)throw Error(Ve(166));return An(e),null}n=zo.current,td(e)?_R(e,n):(n=KO(r,i,t),e.stateNode=n,Ss(e))}return An(e),null;case 5:if(a_(e),r=e.type,n!==null&&e.stateNode!=null)n.memoizedProps!==i&&Ss(e);else{if(!i){if(e.stateNode===null)throw Error(Ve(166));return An(e),null}if(a=zo.current,td(e))_R(e,a);else{var o=w_(jl.current);switch(a){case 1:a=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":a=o.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":a=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":a=o.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof i.is=="string"?o.createElement("select",{is:i.is}):o.createElement("select"),i.multiple?a.multiple=!0:i.size&&(a.size=i.size);break;default:a=typeof i.is=="string"?o.createElement(r,{is:i.is}):o.createElement(r)}}a[Vi]=e,a[Gr]=i;e:for(o=e.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break e;for(;o.sibling===null;){if(o.return===null||o.return===e)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}e.stateNode=a;e:switch(Xi(a,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ss(e)}}return An(e),IT(e,e.type,n===null?null:n.memoizedProps,e.pendingProps,t),null;case 6:if(n&&e.stateNode!=null)n.memoizedProps!==i&&Ss(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(Ve(166));if(n=jl.current,td(e)){if(n=e.stateNode,t=e.memoizedProps,i=null,r=Gi,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}n[Vi]=e,n=!!(n.nodeValue===t||i!==null&&i.suppressHydrationWarning===!0||qO(n.nodeValue,t)),n||ru(e,!0)}else n=w_(n).createTextNode(i),n[Vi]=e,e.stateNode=n}return An(e),null;case 31:if(t=e.memoizedState,n===null||n.memoizedState!==null){if(i=td(e),t!==null){if(n===null){if(!i)throw Error(Ve(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Ve(557));n[Vi]=e}else hc(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;An(e),n=!1}else t=AT(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=t),n=!0;if(!n)return e.flags&256?(ha(e),e):(ha(e),null);if((e.flags&128)!==0)throw Error(Ve(558))}return An(e),null;case 13:if(i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(r=td(e),i!==null&&i.dehydrated!==null){if(n===null){if(!r)throw Error(Ve(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(Ve(317));r[Vi]=e}else hc(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;An(e),r=!1}else r=AT(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(ha(e),e):(ha(e),null)}return ha(e),(e.flags&128)!==0?(e.lanes=t,e):(t=i!==null,n=n!==null&&n.memoizedState!==null,t&&(i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)),t!==n&&t&&(e.child.flags|=8192),Py(e,e.updateQueue),An(e),null);case 4:return Ed(),n===null&&UM(e.stateNode.containerInfo),An(e),null;case 10:return Os(e.type),An(e),null;case 19:if(Di(Qn),i=e.memoizedState,i===null)return An(e),null;if(r=(e.flags&128)!==0,a=i.rendering,a===null)if(r)Jp(i,!1);else{if(Xn!==0||n!==null&&(n.flags&128)!==0)for(n=e.child;n!==null;){if(a=p_(n),a!==null){for(e.flags|=128,Jp(i,!1),n=a.updateQueue,e.updateQueue=n,Py(e,n),e.subtreeFlags=0,n=t,t=e.child;t!==null;)sU(t,n),t=t.sibling;return Sn(Qn,Qn.current&1|2),Yt&&ws(e,i.treeForkCount),e.child}n=n.sibling}i.tail!==null&&ga()>b_&&(e.flags|=128,r=!0,Jp(i,!1),e.lanes=4194304)}else{if(!r)if(n=p_(a),n!==null){if(e.flags|=128,r=!0,n=n.updateQueue,e.updateQueue=n,Py(e,n),Jp(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Yt)return An(e),null}else 2*ga()-i.renderingStartTime>b_&&t!==536870912&&(e.flags|=128,r=!0,Jp(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(n=i.last,n!==null?n.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(n=i.tail,i.rendering=n,i.tail=n.sibling,i.renderingStartTime=ga(),n.sibling=null,t=Qn.current,Sn(Qn,r?t&1|2:t&1),Yt&&ws(e,i.treeForkCount),n):(An(e),null);case 22:case 23:return ha(e),uM(),i=e.memoizedState!==null,n!==null?n.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(t&536870912)!==0&&(e.flags&128)===0&&(An(e),e.subtreeFlags&6&&(e.flags|=8192)):An(e),t=e.updateQueue,t!==null&&Py(e,t.retryQueue),t=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==t&&(e.flags|=2048),n!==null&&Di(cc),null;case 24:return t=null,n!==null&&(t=n.memoizedState.cache),e.memoizedState.cache!==t&&(e.flags|=2048),Os(ui),An(e),null;case 25:return null;case 30:return null}throw Error(Ve(156,e.tag))}function qB(n,e){switch(rM(e),e.tag){case 1:return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Os(ui),Ed(),n=e.flags,(n&65536)!==0&&(n&128)===0?(e.flags=n&-65537|128,e):null;case 26:case 27:case 5:return a_(e),null;case 31:if(e.memoizedState!==null){if(ha(e),e.alternate===null)throw Error(Ve(340));hc()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 13:if(ha(e),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ve(340));hc()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Di(Qn),null;case 4:return Ed(),null;case 10:return Os(e.type),null;case 22:case 23:return ha(e),uM(),n!==null&&Di(cc),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 24:return Os(ui),null;case 25:return null;default:return null}}function sO(n,e){switch(rM(e),e.tag){case 3:Os(ui),Ed();break;case 26:case 27:case 5:a_(e);break;case 4:Ed();break;case 31:e.memoizedState!==null&&ha(e);break;case 13:ha(e);break;case 19:Di(Qn);break;case 10:Os(e.type);break;case 22:case 23:ha(e),uM(),n!==null&&Di(cc);break;case 24:Os(ui)}}function Vm(n,e){try{var t=e.updateQueue,i=t!==null?t.lastEffect:null;if(i!==null){var r=i.next;t=r;do{if((t.tag&n)===n){i=void 0;var a=t.create,o=t.inst;i=a(),o.destroy=i}t=t.next}while(t!==r)}}catch(l){fn(e,e.return,l)}}function au(n,e,t){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&n)===n){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=e;var c=t,f=l;try{f()}catch(d){fn(r,c,d)}}}i=i.next}while(i!==a)}}catch(d){fn(e,e.return,d)}}function lO(n){var e=n.updateQueue;if(e!==null){var t=n.stateNode;try{vU(e,t)}catch(i){fn(n,n.return,i)}}}function uO(n,e,t){t.props=vc(n.type,n.memoizedProps),t.state=n.memoizedState;try{t.componentWillUnmount()}catch(i){fn(n,e,i)}}function mm(n,e){try{var t=n.ref;if(t!==null){switch(n.tag){case 26:case 27:case 5:var i=n.stateNode;break;case 30:i=n.stateNode;break;default:i=n.stateNode}typeof t=="function"?n.refCleanup=t(i):t.current=i}}catch(r){fn(n,e,r)}}function Io(n,e){var t=n.ref,i=n.refCleanup;if(t!==null)if(typeof i=="function")try{i()}catch(r){fn(n,e,r)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof t=="function")try{t(null)}catch(r){fn(n,e,r)}else t.current=null}function cO(n){var e=n.type,t=n.memoizedProps,i=n.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":t.autoFocus&&i.focus();break e;case"img":t.src?i.src=t.src:t.srcSet&&(i.srcset=t.srcSet)}}catch(r){fn(n,n.return,r)}}function zT(n,e,t){try{var i=n.stateNode;d5(i,n.type,t,e),i[Gr]=e}catch(r){fn(n,n.return,r)}}function fO(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&lu(n.type)||n.tag===4}function kT(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||fO(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.tag===27&&lu(n.type)||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 wE(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t).insertBefore(n,e):(e=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,e.appendChild(n),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Rs));else if(i!==4&&(i===27&&lu(n.type)&&(t=n.stateNode,e=null),n=n.child,n!==null))for(wE(n,e,t),n=n.sibling;n!==null;)wE(n,e,t),n=n.sibling}function __(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&&(i===27&&lu(n.type)&&(t=n.stateNode),n=n.child,n!==null))for(__(n,e,t),n=n.sibling;n!==null;)__(n,e,t),n=n.sibling}function dO(n){var e=n.stateNode,t=n.memoizedProps;try{for(var i=n.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);Xi(e,i,t),e[Vi]=n,e[Gr]=t}catch(a){fn(n,n.return,a)}}var As=!1,li=!1,FT=!1,XR=typeof WeakSet=="function"?WeakSet:Set,Ci=null;function YB(n,e){if(n=n.containerInfo,LE=D_,n=$D(n),$E(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,a=i.focusNode;i=i.focusOffset;try{t.nodeType,a.nodeType}catch{t=null;break e}var o=0,l=-1,c=-1,f=0,d=0,m=n,p=null;t:for(;;){for(var g;m!==t||r!==0&&m.nodeType!==3||(l=o+r),m!==a||i!==0&&m.nodeType!==3||(c=o+i),m.nodeType===3&&(o+=m.nodeValue.length),(g=m.firstChild)!==null;)p=m,m=g;for(;;){if(m===n)break t;if(p===t&&++f===r&&(l=o),p===a&&++d===i&&(c=o),(g=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=g}t=l===-1||c===-1?null:{start:l,end:c}}else t=null}t=t||{start:0,end:0}}else t=null;for(NE={focusedElem:n,selectionRange:t},D_=!1,Ci=e;Ci!==null;)if(e=Ci,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ci=n;else for(;Ci!==null;){switch(e=Ci,a=e.alternate,n=e.flags,e.tag){case 0:if((n&4)!==0&&(n=e.updateQueue,n=n!==null?n.events:null,n!==null))for(t=0;t<n.length;t++)r=n[t],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&a!==null){n=void 0,t=e,r=a.memoizedProps,a=a.memoizedState,i=t.stateNode;try{var y=vc(t.type,r);n=i.getSnapshotBeforeUpdate(y,a),i.__reactInternalSnapshotBeforeUpdate=n}catch(T){fn(t,t.return,T)}}break;case 3:if((n&1024)!==0){if(n=e.stateNode.containerInfo,t=n.nodeType,t===9)IE(n);else if(t===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":IE(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(Ve(163))}if(n=e.sibling,n!==null){n.return=e.return,Ci=n;break}Ci=e.return}}function hO(n,e,t){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Es(n,t),i&4&&Vm(5,t);break;case 1:if(Es(n,t),i&4)if(n=t.stateNode,e===null)try{n.componentDidMount()}catch(o){fn(t,t.return,o)}else{var r=vc(t.type,e.memoizedProps);e=e.memoizedState;try{n.componentDidUpdate(r,e,n.__reactInternalSnapshotBeforeUpdate)}catch(o){fn(t,t.return,o)}}i&64&&lO(t),i&512&&mm(t,t.return);break;case 3:if(Es(n,t),i&64&&(n=t.updateQueue,n!==null)){if(e=null,t.child!==null)switch(t.child.tag){case 27:case 5:e=t.child.stateNode;break;case 1:e=t.child.stateNode}try{vU(n,e)}catch(o){fn(t,t.return,o)}}break;case 27:e===null&&i&4&&dO(t);case 26:case 5:Es(n,t),e===null&&i&4&&cO(t),i&512&&mm(t,t.return);break;case 12:Es(n,t);break;case 31:Es(n,t),i&4&&gO(n,t);break;case 13:Es(n,t),i&4&&vO(n,t),i&64&&(n=t.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(t=n5.bind(null,t),b5(n,t))));break;case 22:if(i=t.memoizedState!==null||As,!i){e=e!==null&&e.memoizedState!==null||li,r=As;var a=li;As=i,(li=e)&&!a?Ms(n,t,(t.subtreeFlags&8772)!==0):Es(n,t),As=r,li=a}break;case 30:break;default:Es(n,t)}}function pO(n){var e=n.alternate;e!==null&&(n.alternate=null,pO(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&YE(e)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ln=null,Br=!1;function Ts(n,e,t){for(t=t.child;t!==null;)mO(n,e,t),t=t.sibling}function mO(n,e,t){if(va&&typeof va.onCommitFiberUnmount=="function")try{va.onCommitFiberUnmount(Pm,t)}catch{}switch(t.tag){case 26:li||Io(t,e),Ts(n,e,t),t.memoizedState?t.memoizedState.count--:t.stateNode&&(t=t.stateNode,t.parentNode.removeChild(t));break;case 27:li||Io(t,e);var i=Ln,r=Br;lu(t.type)&&(Ln=t.stateNode,Br=!1),Ts(n,e,t),_m(t.stateNode),Ln=i,Br=r;break;case 5:li||Io(t,e);case 6:if(i=Ln,r=Br,Ln=null,Ts(n,e,t),Ln=i,Br=r,Ln!==null)if(Br)try{(Ln.nodeType===9?Ln.body:Ln.nodeName==="HTML"?Ln.ownerDocument.body:Ln).removeChild(t.stateNode)}catch(a){fn(t,e,a)}else try{Ln.removeChild(t.stateNode)}catch(a){fn(t,e,a)}break;case 18:Ln!==null&&(Br?(n=Ln,oD(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.stateNode),Nd(n)):oD(Ln,t.stateNode));break;case 4:i=Ln,r=Br,Ln=t.stateNode.containerInfo,Br=!0,Ts(n,e,t),Ln=i,Br=r;break;case 0:case 11:case 14:case 15:au(2,t,e),li||au(4,t,e),Ts(n,e,t);break;case 1:li||(Io(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"&&uO(t,e,i)),Ts(n,e,t);break;case 21:Ts(n,e,t);break;case 22:li=(i=li)||t.memoizedState!==null,Ts(n,e,t),li=i;break;default:Ts(n,e,t)}}function gO(n,e){if(e.memoizedState===null&&(n=e.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Nd(n)}catch(t){fn(e,e.return,t)}}}function vO(n,e){if(e.memoizedState===null&&(n=e.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Nd(n)}catch(t){fn(e,e.return,t)}}function jB(n){switch(n.tag){case 31:case 13:case 19:var e=n.stateNode;return e===null&&(e=n.stateNode=new XR),e;case 22:return n=n.stateNode,e=n._retryCache,e===null&&(e=n._retryCache=new XR),e;default:throw Error(Ve(435,n.tag))}}function Iy(n,e){var t=jB(n);e.forEach(function(i){if(!t.has(i)){t.add(i);var r=i5.bind(null,n,i);i.then(r,r)}})}function kr(n,e){var t=e.deletions;if(t!==null)for(var i=0;i<t.length;i++){var r=t[i],a=n,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(lu(l.type)){Ln=l.stateNode,Br=!1;break e}break;case 5:Ln=l.stateNode,Br=!1;break e;case 3:case 4:Ln=l.stateNode.containerInfo,Br=!0;break e}l=l.return}if(Ln===null)throw Error(Ve(160));mO(a,o,r),Ln=null,Br=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)yO(e,n),e=e.sibling}var lo=null;function yO(n,e){var t=n.alternate,i=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:kr(e,n),Fr(n),i&4&&(au(3,n,n.return),Vm(3,n),au(5,n,n.return));break;case 1:kr(e,n),Fr(n),i&512&&(li||t===null||Io(t,t.return)),i&64&&As&&(n=n.updateQueue,n!==null&&(i=n.callbacks,i!==null&&(t=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=t===null?i:t.concat(i))));break;case 26:var r=lo;if(kr(e,n),Fr(n),i&512&&(li||t===null||Io(t,t.return)),i&4){var a=t!==null?t.memoizedState:null;if(i=n.memoizedState,t===null)if(i===null)if(n.stateNode===null){e:{i=n.type,t=n.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":a=r.getElementsByTagName("title")[0],(!a||a[km]||a[Vi]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),Xi(a,i,t),a[Vi]=n,Ri(a),i=a;break e;case"link":var o=hD("link","href",r).get(i+(t.href||""));if(o){for(var l=0;l<o.length;l++)if(a=o[l],a.getAttribute("href")===(t.href==null||t.href===""?null:t.href)&&a.getAttribute("rel")===(t.rel==null?null:t.rel)&&a.getAttribute("title")===(t.title==null?null:t.title)&&a.getAttribute("crossorigin")===(t.crossOrigin==null?null:t.crossOrigin)){o.splice(l,1);break t}}a=r.createElement(i),Xi(a,i,t),r.head.appendChild(a);break;case"meta":if(o=hD("meta","content",r).get(i+(t.content||""))){for(l=0;l<o.length;l++)if(a=o[l],a.getAttribute("content")===(t.content==null?null:""+t.content)&&a.getAttribute("name")===(t.name==null?null:t.name)&&a.getAttribute("property")===(t.property==null?null:t.property)&&a.getAttribute("http-equiv")===(t.httpEquiv==null?null:t.httpEquiv)&&a.getAttribute("charset")===(t.charSet==null?null:t.charSet)){o.splice(l,1);break t}}a=r.createElement(i),Xi(a,i,t),r.head.appendChild(a);break;default:throw Error(Ve(468,i))}a[Vi]=n,Ri(a),i=a}n.stateNode=i}else pD(r,n.type,n.stateNode);else n.stateNode=dD(r,i,n.memoizedProps);else a!==i?(a===null?t.stateNode!==null&&(t=t.stateNode,t.parentNode.removeChild(t)):a.count--,i===null?pD(r,n.type,n.stateNode):dD(r,i,n.memoizedProps)):i===null&&n.stateNode!==null&&zT(n,n.memoizedProps,t.memoizedProps)}break;case 27:kr(e,n),Fr(n),i&512&&(li||t===null||Io(t,t.return)),t!==null&&i&4&&zT(n,n.memoizedProps,t.memoizedProps);break;case 5:if(kr(e,n),Fr(n),i&512&&(li||t===null||Io(t,t.return)),n.flags&32){r=n.stateNode;try{wd(r,"")}catch(y){fn(n,n.return,y)}}i&4&&n.stateNode!=null&&(r=n.memoizedProps,zT(n,r,t!==null?t.memoizedProps:r)),i&1024&&(FT=!0);break;case 6:if(kr(e,n),Fr(n),i&4){if(n.stateNode===null)throw Error(Ve(162));i=n.memoizedProps,t=n.stateNode;try{t.nodeValue=i}catch(y){fn(n,n.return,y)}}break;case 3:if(e_=null,r=lo,lo=A_(e.containerInfo),kr(e,n),lo=r,Fr(n),i&4&&t!==null&&t.memoizedState.isDehydrated)try{Nd(e.containerInfo)}catch(y){fn(n,n.return,y)}FT&&(FT=!1,_O(n));break;case 4:i=lo,lo=A_(n.stateNode.containerInfo),kr(e,n),Fr(n),lo=i;break;case 12:kr(e,n),Fr(n);break;case 31:kr(e,n),Fr(n),i&4&&(i=n.updateQueue,i!==null&&(n.updateQueue=null,Iy(n,i)));break;case 13:kr(e,n),Fr(n),n.child.flags&8192&&n.memoizedState!==null!=(t!==null&&t.memoizedState!==null)&&(G_=ga()),i&4&&(i=n.updateQueue,i!==null&&(n.updateQueue=null,Iy(n,i)));break;case 22:r=n.memoizedState!==null;var c=t!==null&&t.memoizedState!==null,f=As,d=li;if(As=f||r,li=d||c,kr(e,n),li=d,As=f,Fr(n),i&8192)e:for(e=n.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(t===null||c||As||li||sc(n)),t=null,e=n;;){if(e.tag===5||e.tag===26){if(t===null){c=t=e;try{if(a=c.stateNode,r)o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var m=c.memoizedProps.style,p=m!=null&&m.hasOwnProperty("display")?m.display:null;l.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(y){fn(c,c.return,y)}}}else if(e.tag===6){if(t===null){c=e;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(y){fn(c,c.return,y)}}}else if(e.tag===18){if(t===null){c=e;try{var g=c.stateNode;r?sD(g,!0):sD(c.stateNode,!1)}catch(y){fn(c,c.return,y)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===n)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;t===e&&(t=null),e=e.return}t===e&&(t=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=n.updateQueue,i!==null&&(t=i.retryQueue,t!==null&&(i.retryQueue=null,Iy(n,t))));break;case 19:kr(e,n),Fr(n),i&4&&(i=n.updateQueue,i!==null&&(n.updateQueue=null,Iy(n,i)));break;case 30:break;case 21:break;default:kr(e,n),Fr(n)}}function Fr(n){var e=n.flags;if(e&2){try{for(var t,i=n.return;i!==null;){if(fO(i)){t=i;break}i=i.return}if(t==null)throw Error(Ve(160));switch(t.tag){case 27:var r=t.stateNode,a=kT(n);__(n,a,r);break;case 5:var o=t.stateNode;t.flags&32&&(wd(o,""),t.flags&=-33);var l=kT(n);__(n,l,o);break;case 3:case 4:var c=t.stateNode.containerInfo,f=kT(n);wE(n,f,c);break;default:throw Error(Ve(161))}}catch(d){fn(n,n.return,d)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function _O(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var e=n;_O(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),n=n.sibling}}function Es(n,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)hO(n,e.alternate,e),e=e.sibling}function sc(n){for(n=n.child;n!==null;){var e=n;switch(e.tag){case 0:case 11:case 14:case 15:au(4,e,e.return),sc(e);break;case 1:Io(e,e.return);var t=e.stateNode;typeof t.componentWillUnmount=="function"&&uO(e,e.return,t),sc(e);break;case 27:_m(e.stateNode);case 26:case 5:Io(e,e.return),sc(e);break;case 22:e.memoizedState===null&&sc(e);break;case 30:sc(e);break;default:sc(e)}n=n.sibling}}function Ms(n,e,t){for(t=t&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=n,a=e,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ms(r,a,t),Vm(4,a);break;case 1:if(Ms(r,a,t),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(f){fn(i,i.return,f)}if(i=a,r=i.updateQueue,r!==null){var l=i.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)gU(c[r],l)}catch(f){fn(i,i.return,f)}}t&&o&64&&lO(a),mm(a,a.return);break;case 27:dO(a);case 26:case 5:Ms(r,a,t),t&&i===null&&o&4&&cO(a),mm(a,a.return);break;case 12:Ms(r,a,t);break;case 31:Ms(r,a,t),t&&o&4&&gO(r,a);break;case 13:Ms(r,a,t),t&&o&4&&vO(r,a);break;case 22:a.memoizedState===null&&Ms(r,a,t),mm(a,a.return);break;case 30:break;default:Ms(r,a,t)}e=e.sibling}}function MM(n,e){var t=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==t&&(n!=null&&n.refCount++,t!=null&&Bm(t))}function wM(n,e){n=null,e.alternate!==null&&(n=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==n&&(e.refCount++,n!=null&&Bm(n))}function so(n,e,t,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bO(n,e,t,i),e=e.sibling}function bO(n,e,t,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:so(n,e,t,i),r&2048&&Vm(9,e);break;case 1:so(n,e,t,i);break;case 3:so(n,e,t,i),r&2048&&(n=null,e.alternate!==null&&(n=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==n&&(e.refCount++,n!=null&&Bm(n)));break;case 12:if(r&2048){so(n,e,t,i),n=e.stateNode;try{var a=e.memoizedProps,o=a.id,l=a.onPostCommit;typeof l=="function"&&l(o,e.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(c){fn(e,e.return,c)}}else so(n,e,t,i);break;case 31:so(n,e,t,i);break;case 13:so(n,e,t,i);break;case 23:break;case 22:a=e.stateNode,o=e.alternate,e.memoizedState!==null?a._visibility&2?so(n,e,t,i):gm(n,e):a._visibility&2?so(n,e,t,i):(a._visibility|=2,id(n,e,t,i,(e.subtreeFlags&10256)!==0||!1)),r&2048&&MM(o,e);break;case 24:so(n,e,t,i),r&2048&&wM(e.alternate,e);break;default:so(n,e,t,i)}}function id(n,e,t,i,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var a=n,o=e,l=t,c=i,f=o.flags;switch(o.tag){case 0:case 11:case 15:id(a,o,l,c,r),Vm(8,o);break;case 23:break;case 22:var d=o.stateNode;o.memoizedState!==null?d._visibility&2?id(a,o,l,c,r):gm(a,o):(d._visibility|=2,id(a,o,l,c,r)),r&&f&2048&&MM(o.alternate,o);break;case 24:id(a,o,l,c,r),r&&f&2048&&wM(o.alternate,o);break;default:id(a,o,l,c,r)}e=e.sibling}}function gm(n,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var t=n,i=e,r=i.flags;switch(i.tag){case 22:gm(t,i),r&2048&&MM(i.alternate,i);break;case 24:gm(t,i),r&2048&&wM(i.alternate,i);break;default:gm(t,i)}e=e.sibling}}var om=8192;function nd(n,e,t){if(n.subtreeFlags&om)for(n=n.child;n!==null;)xO(n,e,t),n=n.sibling}function xO(n,e,t){switch(n.tag){case 26:nd(n,e,t),n.flags&om&&n.memoizedState!==null&&O5(t,lo,n.memoizedState,n.memoizedProps);break;case 5:nd(n,e,t);break;case 3:case 4:var i=lo;lo=A_(n.stateNode.containerInfo),nd(n,e,t),lo=i;break;case 22:n.memoizedState===null&&(i=n.alternate,i!==null&&i.memoizedState!==null?(i=om,om=16777216,nd(n,e,t),om=i):nd(n,e,t));break;default:nd(n,e,t)}}function SO(n){var e=n.alternate;if(e!==null&&(n=e.child,n!==null)){e.child=null;do e=n.sibling,n.sibling=null,n=e;while(n!==null)}}function $p(n){var e=n.deletions;if((n.flags&16)!==0){if(e!==null)for(var t=0;t<e.length;t++){var i=e[t];Ci=i,EO(i,n)}SO(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)TO(n),n=n.sibling}function TO(n){switch(n.tag){case 0:case 11:case 15:$p(n),n.flags&2048&&au(9,n,n.return);break;case 3:$p(n);break;case 12:$p(n);break;case 22:var e=n.stateNode;n.memoizedState!==null&&e._visibility&2&&(n.return===null||n.return.tag!==13)?(e._visibility&=-3,Jy(n)):$p(n);break;default:$p(n)}}function Jy(n){var e=n.deletions;if((n.flags&16)!==0){if(e!==null)for(var t=0;t<e.length;t++){var i=e[t];Ci=i,EO(i,n)}SO(n)}for(n=n.child;n!==null;){switch(e=n,e.tag){case 0:case 11:case 15:au(8,e,e.return),Jy(e);break;case 22:t=e.stateNode,t._visibility&2&&(t._visibility&=-3,Jy(e));break;default:Jy(e)}n=n.sibling}}function EO(n,e){for(;Ci!==null;){var t=Ci;switch(t.tag){case 0:case 11:case 15:au(8,t,e);break;case 23:case 22:if(t.memoizedState!==null&&t.memoizedState.cachePool!==null){var i=t.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Bm(t.memoizedState.cache)}if(i=t.child,i!==null)i.return=t,Ci=i;else e:for(t=n;Ci!==null;){i=Ci;var r=i.sibling,a=i.return;if(pO(i),i===t){Ci=null;break e}if(r!==null){r.return=a,Ci=r;break e}Ci=a}}}var ZB={getCacheForType:function(n){var e=Wi(ui),t=e.data.get(n);return t===void 0&&(t=n(),e.data.set(n,t)),t},cacheSignal:function(){return Wi(ui).controller.signal}},KB=typeof WeakMap=="function"?WeakMap:Map,tn=0,_n=null,Bt=null,Xt=0,cn=0,da=null,Xl=!1,Fd=!1,AM=!1,ks=0,Xn=0,ou=0,dc=0,CM=0,ma=0,Dd=0,vm=null,Hr=null,AE=!1,G_=0,MO=0,b_=1/0,x_=null,Jl=null,vi=0,$l=null,Ud=null,Ls=0,CE=0,RE=null,wO=null,ym=0,DE=null;function _a(){return(tn&2)!==0&&Xt!==0?Xt&-Xt:Tt.T!==null?DM():PD()}function AO(){if(ma===0)if((Xt&536870912)===0||Yt){var n=wy;wy<<=1,(wy&3932160)===0&&(wy=262144),ma=n}else ma=536870912;return n=xa.current,n!==null&&(n.flags|=32),ma}function Vr(n,e,t){(n===_n&&(cn===2||cn===9)||n.cancelPendingCommit!==null)&&(Od(n,0),ql(n,Xt,ma,!1)),zm(n,t),((tn&2)===0||n!==_n)&&(n===_n&&((tn&2)===0&&(dc|=t),Xn===4&&ql(n,Xt,ma,!1)),Fo(n))}function CO(n,e,t){if((tn&6)!==0)throw Error(Ve(327));var i=!t&&(e&127)===0&&(e&n.expiredLanes)===0||Im(n,e),r=i?$B(n,e):BT(n,e,!0),a=i;do{if(r===0){Fd&&!i&&ql(n,e,0,!1);break}else{if(t=n.current.alternate,a&&!QB(t)){r=BT(n,e,!1),a=!1;continue}if(r===2){if(a=e,n.errorRecoveryDisabledLanes&a)var o=0;else o=n.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var l=n;r=vm;var c=l.current.memoizedState.isDehydrated;if(c&&(Od(l,o).flags|=256),o=BT(l,o,!1),o!==2){if(AM&&!c){l.errorRecoveryDisabledLanes|=a,dc|=a,r=4;break e}a=Hr,Hr=r,a!==null&&(Hr===null?Hr=a:Hr.push.apply(Hr,a))}r=o}if(a=!1,r!==2)continue}}if(r===1){Od(n,0),ql(n,e,0,!0);break}e:{switch(i=n,a=r,a){case 0:case 1:throw Error(Ve(345));case 4:if((e&4194048)!==e)break;case 6:ql(i,e,ma,!Xl);break e;case 2:Hr=null;break;case 3:case 5:break;default:throw Error(Ve(329))}if((e&62914560)===e&&(r=G_+300-ga(),10<r)){if(ql(i,e,ma,!Xl),O_(i,0,!0)!==0)break e;Ls=e,i.timeoutHandle=jO(qR.bind(null,i,t,Hr,x_,AE,e,ma,dc,Dd,Xl,a,"Throttled",-0,0),r);break e}qR(i,t,Hr,x_,AE,e,ma,dc,Dd,Xl,a,null,-0,0)}}break}while(!0);Fo(n)}function qR(n,e,t,i,r,a,o,l,c,f,d,m,p,g){if(n.timeoutHandle=-1,m=e.subtreeFlags,m&8192||(m&16785408)===16785408){m={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rs},xO(e,a,m);var y=(a&62914560)===a?G_-ga():(a&4194048)===a?MO-ga():0;if(y=L5(m,y),y!==null){Ls=a,n.cancelPendingCommit=y(jR.bind(null,n,e,a,t,i,r,o,l,c,d,m,null,p,g)),ql(n,a,o,!f);return}}jR(n,e,a,t,i,r,o,l,c)}function QB(n){for(var e=n;;){var t=e.tag;if((t===0||t===11||t===15)&&e.flags&16384&&(t=e.updateQueue,t!==null&&(t=t.stores,t!==null)))for(var i=0;i<t.length;i++){var r=t[i],a=r.getSnapshot;r=r.value;try{if(!ba(a(),r))return!1}catch{return!1}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ql(n,e,t,i){e&=~CM,e&=~dc,n.suspendedLanes|=e,n.pingedLanes&=~e,i&&(n.warmLanes|=e),i=n.expirationTimes;for(var r=e;0<r;){var a=31-ya(r),o=1<<a;i[a]=-1,r&=~o}t!==0&&OD(n,t,e)}function W_(){return(tn&6)===0?(Gm(0,!1),!1):!0}function RM(){if(Bt!==null){if(cn===0)var n=Bt.return;else n=Bt,Ds=Sc=null,pM(n),xd=null,wm=0,n=Bt;for(;n!==null;)sO(n.alternate,n),n=n.return;Bt=null}}function Od(n,e){var t=n.timeoutHandle;t!==-1&&(n.timeoutHandle=-1,m5(t)),t=n.cancelPendingCommit,t!==null&&(n.cancelPendingCommit=null,t()),Ls=0,RM(),_n=n,Bt=t=Us(n.current,null),Xt=e,cn=0,da=null,Xl=!1,Fd=Im(n,e),AM=!1,Dd=ma=CM=dc=ou=Xn=0,Hr=vm=null,AE=!1,(e&8)!==0&&(e|=e&32);var i=n.entangledLanes;if(i!==0)for(n=n.entanglements,i&=e;0<i;){var r=31-ya(i),a=1<<r;e|=n[r],i&=~a}return ks=e,I_(),t}function RO(n,e){Ut=null,Tt.H=Cm,e===kd||e===k_?(e=ER(),cn=3):e===sM?(e=ER(),cn=4):cn=e===TM?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,da=e,Bt===null&&(Xn=1,v_(n,Ha(e,n.current)))}function DO(){var n=xa.current;return n===null?!0:(Xt&4194048)===Xt?Ga===null:(Xt&62914560)===Xt||(Xt&536870912)!==0?n===Ga:!1}function UO(){var n=Tt.H;return Tt.H=Cm,n===null?Cm:n}function OO(){var n=Tt.A;return Tt.A=ZB,n}function S_(){Xn=4,Xl||(Xt&4194048)!==Xt&&xa.current!==null||(Fd=!0),(ou&134217727)===0&&(dc&134217727)===0||_n===null||ql(_n,Xt,ma,!1)}function BT(n,e,t){var i=tn;tn|=2;var r=UO(),a=OO();(_n!==n||Xt!==e)&&(x_=null,Od(n,e)),e=!1;var o=Xn;e:do try{if(cn!==0&&Bt!==null){var l=Bt,c=da;switch(cn){case 8:RM(),o=6;break e;case 3:case 2:case 9:case 6:xa.current===null&&(e=!0);var f=cn;if(cn=0,da=null,gd(n,l,c,f),t&&Fd){o=0;break e}break;default:f=cn,cn=0,da=null,gd(n,l,c,f)}}JB(),o=Xn;break}catch(d){RO(n,d)}while(!0);return e&&n.shellSuspendCounter++,Ds=Sc=null,tn=i,Tt.H=r,Tt.A=a,Bt===null&&(_n=null,Xt=0,I_()),o}function JB(){for(;Bt!==null;)LO(Bt)}function $B(n,e){var t=tn;tn|=2;var i=UO(),r=OO();_n!==n||Xt!==e?(x_=null,b_=ga()+500,Od(n,e)):Fd=Im(n,e);e:do try{if(cn!==0&&Bt!==null){e=Bt;var a=da;t:switch(cn){case 1:cn=0,da=null,gd(n,e,a,1);break;case 2:case 9:if(TR(a)){cn=0,da=null,YR(e);break}e=function(){cn!==2&&cn!==9||_n!==n||(cn=7),Fo(n)},a.then(e,e);break e;case 3:cn=7;break e;case 4:cn=5;break e;case 7:TR(a)?(cn=0,da=null,YR(e)):(cn=0,da=null,gd(n,e,a,7));break;case 5:var o=null;switch(Bt.tag){case 26:o=Bt.memoizedState;case 5:case 27:var l=Bt;if(o?$O(o):l.stateNode.complete){cn=0,da=null;var c=l.sibling;if(c!==null)Bt=c;else{var f=l.return;f!==null?(Bt=f,X_(f)):Bt=null}break t}}cn=0,da=null,gd(n,e,a,5);break;case 6:cn=0,da=null,gd(n,e,a,6);break;case 8:RM(),Xn=6;break e;default:throw Error(Ve(462))}}e5();break}catch(d){RO(n,d)}while(!0);return Ds=Sc=null,Tt.H=i,Tt.A=r,tn=t,Bt!==null?0:(_n=null,Xt=0,I_(),Xn)}function e5(){for(;Bt!==null&&!T4();)LO(Bt)}function LO(n){var e=oO(n.alternate,n,ks);n.memoizedProps=n.pendingProps,e===null?X_(n):Bt=e}function YR(n){var e=n,t=e.alternate;switch(e.tag){case 15:case 0:e=BR(t,e,e.pendingProps,e.type,void 0,Xt);break;case 11:e=BR(t,e,e.pendingProps,e.type.render,e.ref,Xt);break;case 5:pM(e);default:sO(t,e),e=Bt=sU(e,ks),e=oO(t,e,ks)}n.memoizedProps=n.pendingProps,e===null?X_(n):Bt=e}function gd(n,e,t,i){Ds=Sc=null,pM(e),xd=null,wm=0;var r=e.return;try{if(VB(n,r,e,t,Xt)){Xn=1,v_(n,Ha(t,n.current)),Bt=null;return}}catch(a){if(r!==null)throw Bt=r,a;Xn=1,v_(n,Ha(t,n.current)),Bt=null;return}e.flags&32768?(Yt||i===1?n=!0:Fd||(Xt&536870912)!==0?n=!1:(Xl=n=!0,(i===2||i===9||i===3||i===6)&&(i=xa.current,i!==null&&i.tag===13&&(i.flags|=16384))),NO(e,n)):X_(e)}function X_(n){var e=n;do{if((e.flags&32768)!==0){NO(e,Xl);return}n=e.return;var t=XB(e.alternate,e,ks);if(t!==null){Bt=t;return}if(e=e.sibling,e!==null){Bt=e;return}Bt=e=n}while(e!==null);Xn===0&&(Xn=5)}function NO(n,e){do{var t=qB(n.alternate,n);if(t!==null){t.flags&=32767,Bt=t;return}if(t=n.return,t!==null&&(t.flags|=32768,t.subtreeFlags=0,t.deletions=null),!e&&(n=n.sibling,n!==null)){Bt=n;return}Bt=n=t}while(n!==null);Xn=6,Bt=null}function jR(n,e,t,i,r,a,o,l,c){n.cancelPendingCommit=null;do q_();while(vi!==0);if((tn&6)!==0)throw Error(Ve(327));if(e!==null){if(e===n.current)throw Error(Ve(177));if(a=e.lanes|e.childLanes,a|=eM,L4(n,t,a,o,l,c),n===_n&&(Bt=_n=null,Xt=0),Ud=e,$l=n,Ls=t,CE=a,RE=r,wO=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,r5(o_,function(){return FO(),null})):(n.callbackNode=null,n.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Tt.T,Tt.T=null,r=nn.p,nn.p=2,o=tn,tn|=4;try{YB(n,e,t)}finally{tn=o,nn.p=r,Tt.T=i}}vi=1,PO(),IO(),zO()}}function PO(){if(vi===1){vi=0;var n=$l,e=Ud,t=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||t){t=Tt.T,Tt.T=null;var i=nn.p;nn.p=2;var r=tn;tn|=4;try{yO(e,n);var a=NE,o=$D(n.containerInfo),l=a.focusedElem,c=a.selectionRange;if(o!==l&&l&&l.ownerDocument&&JD(l.ownerDocument.documentElement,l)){if(c!==null&&$E(l)){var f=c.start,d=c.end;if(d===void 0&&(d=f),"selectionStart"in l)l.selectionStart=f,l.selectionEnd=Math.min(d,l.value.length);else{var m=l.ownerDocument||document,p=m&&m.defaultView||window;if(p.getSelection){var g=p.getSelection(),y=l.textContent.length,T=Math.min(c.start,y),x=c.end===void 0?T:Math.min(c.end,y);!g.extend&&T>x&&(o=x,x=T,T=o);var _=gR(l,T),b=gR(l,x);if(_&&b&&(g.rangeCount!==1||g.anchorNode!==_.node||g.anchorOffset!==_.offset||g.focusNode!==b.node||g.focusOffset!==b.offset)){var S=m.createRange();S.setStart(_.node,_.offset),g.removeAllRanges(),T>x?(g.addRange(S),g.extend(b.node,b.offset)):(S.setEnd(b.node,b.offset),g.addRange(S))}}}}for(m=[],g=l;g=g.parentNode;)g.nodeType===1&&m.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<m.length;l++){var E=m[l];E.element.scrollLeft=E.left,E.element.scrollTop=E.top}}D_=!!LE,NE=LE=null}finally{tn=r,nn.p=i,Tt.T=t}}n.current=e,vi=2}}function IO(){if(vi===2){vi=0;var n=$l,e=Ud,t=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||t){t=Tt.T,Tt.T=null;var i=nn.p;nn.p=2;var r=tn;tn|=4;try{hO(n,e.alternate,e)}finally{tn=r,nn.p=i,Tt.T=t}}vi=3}}function zO(){if(vi===4||vi===3){vi=0,E4();var n=$l,e=Ud,t=Ls,i=wO;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?vi=5:(vi=0,Ud=$l=null,kO(n,n.pendingLanes));var r=n.pendingLanes;if(r===0&&(Jl=null),qE(t),e=e.stateNode,va&&typeof va.onCommitFiberRoot=="function")try{va.onCommitFiberRoot(Pm,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Tt.T,r=nn.p,nn.p=2,Tt.T=null;try{for(var a=n.onRecoverableError,o=0;o<i.length;o++){var l=i[o];a(l.value,{componentStack:l.stack})}}finally{Tt.T=e,nn.p=r}}(Ls&3)!==0&&q_(),Fo(n),r=n.pendingLanes,(t&261930)!==0&&(r&42)!==0?n===DE?ym++:(ym=0,DE=n):ym=0,Gm(0,!1)}}function kO(n,e){(n.pooledCacheLanes&=e)===0&&(e=n.pooledCache,e!=null&&(n.pooledCache=null,Bm(e)))}function q_(){return PO(),IO(),zO(),FO()}function FO(){if(vi!==5)return!1;var n=$l,e=CE;CE=0;var t=qE(Ls),i=Tt.T,r=nn.p;try{nn.p=32>t?32:t,Tt.T=null,t=RE,RE=null;var a=$l,o=Ls;if(vi=0,Ud=$l=null,Ls=0,(tn&6)!==0)throw Error(Ve(331));var l=tn;if(tn|=4,TO(a.current),bO(a,a.current,o,t),tn=l,Gm(0,!1),va&&typeof va.onPostCommitFiberRoot=="function")try{va.onPostCommitFiberRoot(Pm,a)}catch{}return!0}finally{nn.p=r,Tt.T=i,kO(n,e)}}function ZR(n,e,t){e=Ha(t,e),e=TE(n.stateNode,e,2),n=Ql(n,e,2),n!==null&&(zm(n,2),Fo(n))}function fn(n,e,t){if(n.tag===3)ZR(n,n,t);else for(;e!==null;){if(e.tag===3){ZR(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Jl===null||!Jl.has(i))){n=Ha(t,n),t=eO(2),i=Ql(e,t,2),i!==null&&(tO(t,i,e,n),zm(i,2),Fo(i));break}}e=e.return}}function HT(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new KB;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)||(AM=!0,r.add(t),n=t5.bind(null,n,e,t),e.then(n,n))}function t5(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),n.pingedLanes|=n.suspendedLanes&t,n.warmLanes&=~t,_n===n&&(Xt&t)===t&&(Xn===4||Xn===3&&(Xt&62914560)===Xt&&300>ga()-G_?(tn&2)===0&&Od(n,0):CM|=t,Dd===Xt&&(Dd=0)),Fo(n)}function BO(n,e){e===0&&(e=UD()),n=xc(n,e),n!==null&&(zm(n,e),Fo(n))}function n5(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),BO(n,t)}function i5(n,e){var t=0;switch(n.tag){case 31:case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;case 22:i=n.stateNode._retryCache;break;default:throw Error(Ve(314))}i!==null&&i.delete(e),BO(n,t)}function r5(n,e){return WE(n,e)}var T_=null,rd=null,UE=!1,E_=!1,VT=!1,Yl=0;function Fo(n){n!==rd&&n.next===null&&(rd===null?T_=rd=n:rd=rd.next=n),E_=!0,UE||(UE=!0,o5())}function Gm(n,e){if(!VT&&E_){VT=!0;do for(var t=!1,i=T_;i!==null;){if(!e)if(n!==0){var r=i.pendingLanes;if(r===0)var a=0;else{var o=i.suspendedLanes,l=i.pingedLanes;a=(1<<31-ya(42|n)+1)-1,a&=r&~(o&~l),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(t=!0,KR(i,a))}else a=Xt,a=O_(i,i===_n?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(a&3)===0||Im(i,a)||(t=!0,KR(i,a));i=i.next}while(t);VT=!1}}function a5(){HO()}function HO(){E_=UE=!1;var n=0;Yl!==0&&p5()&&(n=Yl);for(var e=ga(),t=null,i=T_;i!==null;){var r=i.next,a=VO(i,e);a===0?(i.next=null,t===null?T_=r:t.next=r,r===null&&(rd=t)):(t=i,(n!==0||(a&3)!==0)&&(E_=!0)),i=r}vi!==0&&vi!==5||Gm(n,!1),Yl!==0&&(Yl=0)}function VO(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,r=n.expirationTimes,a=n.pendingLanes&-62914561;0<a;){var o=31-ya(a),l=1<<o,c=r[o];c===-1?((l&t)===0||(l&i)!==0)&&(r[o]=O4(l,e)):c<=e&&(n.expiredLanes|=l),a&=~l}if(e=_n,t=Xt,t=O_(n,n===e?t:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),i=n.callbackNode,t===0||n===e&&(cn===2||cn===9)||n.cancelPendingCommit!==null)return i!==null&&i!==null&&vT(i),n.callbackNode=null,n.callbackPriority=0;if((t&3)===0||Im(n,t)){if(e=t&-t,e===n.callbackPriority)return e;switch(i!==null&&vT(i),qE(t)){case 2:case 8:t=RD;break;case 32:t=o_;break;case 268435456:t=DD;break;default:t=o_}return i=GO.bind(null,n),t=WE(t,i),n.callbackPriority=e,n.callbackNode=t,e}return i!==null&&i!==null&&vT(i),n.callbackPriority=2,n.callbackNode=null,2}function GO(n,e){if(vi!==0&&vi!==5)return n.callbackNode=null,n.callbackPriority=0,null;var t=n.callbackNode;if(q_()&&n.callbackNode!==t)return null;var i=Xt;return i=O_(n,n===_n?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),i===0?null:(CO(n,i,e),VO(n,ga()),n.callbackNode!=null&&n.callbackNode===t?GO.bind(null,n):null)}function KR(n,e){if(q_())return null;CO(n,e,!0)}function o5(){g5(function(){(tn&6)!==0?WE(CD,a5):HO()})}function DM(){if(Yl===0){var n=Ad;n===0&&(n=My,My<<=1,(My&261888)===0&&(My=256)),Yl=n}return Yl}function QR(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Gy(""+n)}function JR(n,e){var t=e.ownerDocument.createElement("input");return t.name=e.name,t.value=e.value,n.id&&t.setAttribute("form",n.id),e.parentNode.insertBefore(t,e),n=new FormData(n),t.parentNode.removeChild(t),n}function s5(n,e,t,i,r){if(e==="submit"&&t&&t.stateNode===r){var a=QR((r[Gr]||null).action),o=i.submitter;o&&(e=(e=o[Gr]||null)?QR(e.formAction):o.getAttribute("formAction"),e!==null&&(a=e,o=null));var l=new L_("action","action",null,i,r);n.push({event:l,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Yl!==0){var c=o?JR(r,o):new FormData(r);xE(t,{pending:!0,data:c,method:r.method,action:a},null,c)}}else typeof a=="function"&&(l.preventDefault(),c=o?JR(r,o):new FormData(r),xE(t,{pending:!0,data:c,method:r.method,action:a},a,c))},currentTarget:r}]})}}for(zy=0;zy<uE.length;zy++)ky=uE[zy],$R=ky.toLowerCase(),eD=ky[0].toUpperCase()+ky.slice(1),uo($R,"on"+eD);var ky,$R,eD,zy;uo(tU,"onAnimationEnd");uo(nU,"onAnimationIteration");uo(iU,"onAnimationStart");uo("dblclick","onDoubleClick");uo("focusin","onFocus");uo("focusout","onBlur");uo(MB,"onTransitionRun");uo(wB,"onTransitionStart");uo(AB,"onTransitionCancel");uo(rU,"onTransitionEnd");Md("onMouseEnter",["mouseout","mouseover"]);Md("onMouseLeave",["mouseout","mouseover"]);Md("onPointerEnter",["pointerout","pointerover"]);Md("onPointerLeave",["pointerout","pointerover"]);yc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yc("onBeforeInput",["compositionend","keypress","textInput","paste"]);yc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rm="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),l5=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rm));function WO(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var i=n[t],r=i.event;i=i.listeners;e:{var a=void 0;if(e)for(var o=i.length-1;0<=o;o--){var l=i[o],c=l.instance,f=l.currentTarget;if(l=l.listener,c!==a&&r.isPropagationStopped())break e;a=l,r.currentTarget=f;try{a(r)}catch(d){l_(d)}r.currentTarget=null,a=c}else for(o=0;o<i.length;o++){if(l=i[o],c=l.instance,f=l.currentTarget,l=l.listener,c!==a&&r.isPropagationStopped())break e;a=l,r.currentTarget=f;try{a(r)}catch(d){l_(d)}r.currentTarget=null,a=c}}}}function Ft(n,e){var t=e[tE];t===void 0&&(t=e[tE]=new Set);var i=n+"__bubble";t.has(i)||(XO(e,n,2,!1),t.add(i))}function GT(n,e,t){var i=0;e&&(i|=4),XO(t,n,i,e)}var Fy="_reactListening"+Math.random().toString(36).slice(2);function UM(n){if(!n[Fy]){n[Fy]=!0,ID.forEach(function(t){t!=="selectionchange"&&(l5.has(t)||GT(t,!1,n),GT(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[Fy]||(e[Fy]=!0,GT("selectionchange",!1,e))}}function XO(n,e,t,i){switch(rL(e)){case 2:var r=I5;break;case 8:r=z5;break;default:r=PM}t=r.bind(null,e,t,n),r=void 0,!oE||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?n.addEventListener(e,t,{capture:!0,passive:r}):n.addEventListener(e,t,!0):r!==void 0?n.addEventListener(e,t,{passive:r}):n.addEventListener(e,t,!1)}function WT(n,e,t,i,r){var a=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=i.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=sd(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){i=a=o;continue e}l=l.parentNode}}i=i.return}WD(function(){var f=a,d=ZE(t),m=[];e:{var p=aU.get(n);if(p!==void 0){var g=L_,y=n;switch(n){case"keypress":if(Xy(t)===0)break e;case"keydown":case"keyup":g=iB;break;case"focusin":y="focus",g=ST;break;case"focusout":y="blur",g=ST;break;case"beforeblur":case"afterblur":g=ST;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=sR;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=X4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=oB;break;case tU:case nU:case iU:g=j4;break;case rU:g=lB;break;case"scroll":case"scrollend":g=G4;break;case"wheel":g=cB;break;case"copy":case"cut":case"paste":g=K4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=uR;break;case"toggle":case"beforetoggle":g=dB}var T=(e&4)!==0,x=!T&&(n==="scroll"||n==="scrollend"),_=T?p!==null?p+"Capture":null:p;T=[];for(var b=f,S;b!==null;){var E=b;if(S=E.stateNode,E=E.tag,E!==5&&E!==26&&E!==27||S===null||_===null||(E=xm(b,_),E!=null&&T.push(Dm(b,E,S))),x)break;b=b.return}0<T.length&&(p=new g(p,y,null,t,d),m.push({event:p,listeners:T}))}}if((e&7)===0){e:{if(p=n==="mouseover"||n==="pointerover",g=n==="mouseout"||n==="pointerout",p&&t!==aE&&(y=t.relatedTarget||t.fromElement)&&(sd(y)||y[Pd]))break e;if((g||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,g?(y=t.relatedTarget||t.toElement,g=f,y=y?sd(y):null,y!==null&&(x=Nm(y),T=y.tag,y!==x||T!==5&&T!==27&&T!==6)&&(y=null)):(g=null,y=f),g!==y)){if(T=sR,E="onMouseLeave",_="onMouseEnter",b="mouse",(n==="pointerout"||n==="pointerover")&&(T=uR,E="onPointerLeave",_="onPointerEnter",b="pointer"),x=g==null?p:rm(g),S=y==null?p:rm(y),p=new T(E,b+"leave",g,t,d),p.target=x,p.relatedTarget=S,E=null,sd(d)===f&&(T=new T(_,b+"enter",y,t,d),T.target=S,T.relatedTarget=x,E=T),x=E,g&&y)t:{for(T=u5,_=g,b=y,S=0,E=_;E;E=T(E))S++;E=0;for(var C=b;C;C=T(C))E++;for(;0<S-E;)_=T(_),S--;for(;0<E-S;)b=T(b),E--;for(;S--;){if(_===b||b!==null&&_===b.alternate){T=_;break t}_=T(_),b=T(b)}T=null}else T=null;g!==null&&tD(m,p,g,T,!1),y!==null&&x!==null&&tD(m,x,y,T,!0)}}
vendor: 5,142 bytes, lines 8-9
8e:{if(p=f?rm(f):window,g=p.nodeName&&p.nodeName.toLowerCase(),g==="select"||g==="input"&&p.type==="file")var D=hR;else if(dR(p))if(KD)D=SB;else{D=bB;var U=_B}else g=p.nodeName,!g||g.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?f&&jE(f.elementType)&&(D=hR):D=xB;if(D&&(D=D(n,f))){ZD(m,D,t,d);break e}U&&U(n,p,f),n==="focusout"&&f&&p.type==="number"&&f.memoizedProps.value!=null&&rE(p,"number",p.value)}switch(U=f?rm(f):window,n){case"focusin":(dR(U)||U.contentEditable==="true")&&(cd=U,sE=f,um=null);break;case"focusout":um=sE=cd=null;break;case"mousedown":lE=!0;break;case"contextmenu":case"mouseup":case"dragend":lE=!1,vR(m,t,d);break;case"selectionchange":if(EB)break;case"keydown":case"keyup":vR(m,t,d)}var w;if(JE)e:{switch(n){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else ud?YD(n,t)&&(R="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(R="onCompositionStart");R&&(qD&&t.locale!=="ko"&&(ud||R!=="onCompositionStart"?R==="onCompositionEnd"&&ud&&(w=XD()):(Wl=d,KE="value"in Wl?Wl.value:Wl.textContent,ud=!0)),U=M_(f,R),0<U.length&&(R=new lR(R,n,null,t,d),m.push({event:R,listeners:U}),w?R.data=w:(w=jD(t),w!==null&&(R.data=w)))),(w=pB?mB(n,t):gB(n,t))&&(R=M_(f,"onBeforeInput"),0<R.length&&(U=new lR("onBeforeInput","beforeinput",null,t,d),m.push({event:U,listeners:R}),U.data=w)),s5(m,n,f,t,d)}WO(m,e)})}function Dm(n,e,t){return{instance:n,listener:e,currentTarget:t}}function M_(n,e){for(var t=e+"Capture",i=[];n!==null;){var r=n,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=xm(n,t),r!=null&&i.unshift(Dm(n,r,a)),r=xm(n,e),r!=null&&i.push(Dm(n,r,a))),n.tag===3)return i;n=n.return}return[]}function u5(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function tD(n,e,t,i,r){for(var a=e._reactName,o=[];t!==null&&t!==i;){var l=t,c=l.alternate,f=l.stateNode;if(l=l.tag,c!==null&&c===i)break;l!==5&&l!==26&&l!==27||f===null||(c=f,r?(f=xm(t,a),f!=null&&o.unshift(Dm(t,f,c))):r||(f=xm(t,a),f!=null&&o.push(Dm(t,f,c)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var c5=/\r\n?/g,f5=/\u0000|\uFFFD/g;function nD(n){return(typeof n=="string"?n:""+n).replace(c5,`
9`).replace(f5,"")}function qO(n,e){return e=nD(e),nD(n)===e}function gn(n,e,t,i,r,a){switch(t){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||wd(n,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&wd(n,""+i);break;case"className":Cy(n,"class",i);break;case"tabIndex":Cy(n,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Cy(n,t,i);break;case"style":GD(n,i,a);break;case"data":if(e!=="object"){Cy(n,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||t!=="href")){n.removeAttribute(t);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){n.removeAttribute(t);break}i=Gy(""+i),n.setAttribute(t,i);break;case"action":case"formAction":if(typeof i=="function"){n.setAttribute(t,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(t==="formAction"?(e!=="input"&&gn(n,e,"name",r.name,r,null),gn(n,e,"formEncType",r.formEncType,r,null),gn(n,e,"formMethod",r.formMethod,r,null),gn(n,e,"formTarget",r.formTarget,r,null)):(gn(n,e,"encType",r.encType,r,null),gn(n,e,"method",r.method,r,null),gn(n,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){n.removeAttribute(t);break}i=Gy(""+i),n.setAttribute(t,i);break;case"onClick":i!=null&&(n.onclick=Rs);break;case"onScroll":i!=null&&Ft("scroll",n);break;case"onScrollEnd":i!=null&&Ft("scrollend",n);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(Ve(61));if(t=i.__html,t!=null){if(r.children!=null)throw Error(Ve(60));n.innerHTML=t}}break;case"multiple":n.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":n.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){n.removeAttribute("xlink:href");break}t=Gy(""+i),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?n.setAttribute(t,""+i):n.removeAttribute(t);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
9ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?n.setAttribute(t,""):n.removeAttribute(t);break;case"capture":case"download":i===!0?n.setAttribute(t,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?n.setAttribute(t,i):n.removeAttribute(t);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?n.setAttribute(t,i):n.removeAttribute(t);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?n.removeAttribute(t):n.setAttribute(t,i);break;case"popover":Ft("beforetoggle",n),Ft("toggle",n),Vy(n,"popover",i);break;case"xlinkActuate":xs(n,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":xs(n,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":xs(n,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":xs(n,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":xs(n,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":xs(n,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":xs(n,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":xs(n,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":xs(n,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Vy(n,"is",i);break;case"innerText":case"textContent":break;default:(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(t=H4.get(t)||t,Vy(n,t,i))}}function OE(n,e,t,i,r,a){switch(t){case"style":GD(n,i,a);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(Ve(61));if(t=i.__html,t!=null){if(r.children!=null)throw Error(Ve(60));n.innerHTML=t}}break;case"children":typeof i=="string"?wd(n,i):(typeof i=="number"||typeof i=="bigint")&&wd(n,""+i);break;case"onScroll":i!=null&&Ft("scroll",n);break;case"onScrollEnd":i!=null&&Ft("scrollend",n);break;case"onClick":i!=null&&(n.onclick=Rs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zD.hasOwnProperty(t))e:{if(t[0]==="o"&&t[1]==="n"&&(r=t.endsWith("Capture"),e=t.slice(2,r?t.length-7:void 0),a=n[Gr]||null,a=a!=null?a[t]:null,typeof a=="function"&&n.removeEventListener(e,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(t in n?n[t]=null:n.hasAttribute(t)&&n.removeAttribute(t)),n.addEventListener(e,i,r);break e}t in n?n[t]=i:i===!0?n.setAttribute(t,""):Vy(n,t,i)}}}function Xi(n,e,t){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ft("error",n),Ft("load",n);var i=!1,r=!1,a;for(a in t)if(t.hasOwnProperty(a)){var o=t[a];if(o!=null)switch(a){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Ve(137,e));default:gn(n,e,a,o,t,null)}}r&&gn(n,e,"srcSet",t.srcSet,t,null),i&&gn(n,e,"src",t.src,t,null);return;case"input":Ft("invalid",n);var l=a=o=r=null,c=null,f=null;for(i in t)if(t.hasOwnProperty(i)){var d=t[i];if(d!=null)switch(i){case"name":r=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":f=d;break;case"value":a=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(Ve(137,e));break;default:gn(n,e,i,d,t,null)}}BD(n,a,l,c,f,o,r,!1);return;case"select":Ft("invalid",n),i=o=a=null;for(r in t)if(t.hasOwnProperty(r)&&(l=t[r],l!=null))switch(r){case"value":a=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:gn(n,e,r,l,t,null)}e=a,t=o,n.multiple=!!i,e!=null?yd(n,!!i,e,!1):t!=null&&yd(n,!!i,t,!0);return;case"textarea":Ft("invalid",n),a=r=i=null;for(o in t)if(t.hasOwnProperty(o)&&(l=t[o],l!=null))switch(o){case"value":i=l;break;case"defaultValue":r=l;break;case"children":a=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(Ve(91));break;default:gn(n,e,o,l,t,null)}VD(n,i,r,a);return;case"option":for(c in t)if(t.hasOwnProperty(c)&&(i=t[c],i!=null))switch(c){case"selected":n.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:gn(n,e,c,i,t,null)}return;case"dialog":Ft("beforetoggle",n),Ft("toggle",n),Ft("cancel",n),Ft("close",n);break;case"iframe":case"object":Ft("load",n);break;case"video":case"audio":for(i=0;i<Rm.length;i++)Ft(Rm[i],n);break;case"image":Ft("error",n),Ft("load",n);break;case"details":Ft("toggle",n);break;case"embed":case"source":case"link":Ft("error",n),Ft("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(f in t)if(t.hasOwnProperty(f)&&(i=t[f],i!=null))switch(f){case"children":case"dangerouslySetInnerHTML":throw Error(Ve(137,e));default:gn(n,e,f,i,t,null)}return;default:if(jE(e)){for(d in t)t.hasOwnProperty(d)&&(i=t[d],i!==void 0&&OE(n,e,d,i,t,void 0));return}}for(l in t)t.hasOwnProperty(l)&&(i=t[l],i!=null&&gn(n,e,l,i,t,null))}function d5(n,e,t,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,o=null,l=null,c=null,f=null,d=null;for(g in t){var m=t[g];if(t.hasOwnProperty(g)&&m!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":c=m;default:i.hasOwnProperty(g)||gn(n,e,g,null,i,m)}}for(var p in i){var g=i[p];if(m=t[p],i.hasOwnProperty(p)&&(g!=null||m!=null))switch(p){case"type":a=g;break;case"name":r=g;break;case"checked":f=g;break;case"defaultChecked":d=g;break;case"value":o=g;break;case"defaultValue":l=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(Ve(137,e));break;default:g!==m&&gn(n,e,p,g,i,m)}}iE(n,o,l,c,f,d,a,r);return;case"select":g=o=l=p=null;for(a in t)if(c=t[a],t.hasOwnProperty(a)&&c!=null)switch(a){case"value":break;case"multiple":g=c;default:i.hasOwnProperty(a)||gn(n,e,a,null,i,c)}for(r in i)if(a=i[r],c=t[r],i.hasOwnProperty(r)&&(a!=null||c!=null))switch(r){case"value":p=a;break;case"defaultValue":l=a;break;case"multiple":o=a;
vendor: 5,730 bytes, line 9
9default:a!==c&&gn(n,e,r,a,i,c)}e=l,t=o,i=g,p!=null?yd(n,!!t,p,!1):!!i!=!!t&&(e!=null?yd(n,!!t,e,!0):yd(n,!!t,t?[]:"",!1));return;case"textarea":g=p=null;for(l in t)if(r=t[l],t.hasOwnProperty(l)&&r!=null&&!i.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:gn(n,e,l,null,i,r)}for(o in i)if(r=i[o],a=t[o],i.hasOwnProperty(o)&&(r!=null||a!=null))switch(o){case"value":p=r;break;case"defaultValue":g=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(Ve(91));break;default:r!==a&&gn(n,e,o,r,i,a)}HD(n,p,g);return;case"option":for(var y in t)if(p=t[y],t.hasOwnProperty(y)&&p!=null&&!i.hasOwnProperty(y))switch(y){case"selected":n.selected=!1;break;default:gn(n,e,y,null,i,p)}for(c in i)if(p=i[c],g=t[c],i.hasOwnProperty(c)&&p!==g&&(p!=null||g!=null))switch(c){case"selected":n.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:gn(n,e,c,p,i,g)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var T in t)p=t[T],t.hasOwnProperty(T)&&p!=null&&!i.hasOwnProperty(T)&&gn(n,e,T,null,i,p);for(f in i)if(p=i[f],g=t[f],i.hasOwnProperty(f)&&p!==g&&(p!=null||g!=null))switch(f){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(Ve(137,e));break;default:gn(n,e,f,p,i,g)}return;default:if(jE(e)){for(var x in t)p=t[x],t.hasOwnProperty(x)&&p!==void 0&&!i.hasOwnProperty(x)&&OE(n,e,x,void 0,i,p);for(d in i)p=i[d],g=t[d],!i.hasOwnProperty(d)||p===g||p===void 0&&g===void 0||OE(n,e,d,p,i,g);return}}for(var _ in t)p=t[_],t.hasOwnProperty(_)&&p!=null&&!i.hasOwnProperty(_)&&gn(n,e,_,null,i,p);for(m in i)p=i[m],g=t[m],!i.hasOwnProperty(m)||p===g||p==null&&g==null||gn(n,e,m,p,i,g)}function iD(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function h5(){if(typeof performance.getEntriesByType=="function"){for(var n=0,e=0,t=performance.getEntriesByType("resource"),i=0;i<t.length;i++){var r=t[i],a=r.transferSize,o=r.initiatorType,l=r.duration;if(a&&l&&iD(o)){for(o=0,l=r.responseEnd,i+=1;i<t.length;i++){var c=t[i],f=c.startTime;if(f>l)break;var d=c.transferSize,m=c.initiatorType;d&&iD(m)&&(c=c.responseEnd,o+=d*(c<l?1:(l-f)/(c-f)))}if(--i,e+=8*(a+o)/(r.duration/1e3),n++,10<n)break}}if(0<n)return e/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var LE=null,NE=null;function w_(n){return n.nodeType===9?n:n.ownerDocument}function rD(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function YO(n,e){if(n===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&e==="foreignObject"?0:n}function PE(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var XT=null;function p5(){var n=window.event;return n&&n.type==="popstate"?n===XT?!1:(XT=n,!0):(XT=null,!1)}var jO=typeof setTimeout=="function"?setTimeout:void 0,m5=typeof clearTimeout=="function"?clearTimeout:void 0,aD=typeof Promise=="function"?Promise:void 0,g5=typeof queueMicrotask=="function"?queueMicrotask:typeof aD<"u"?function(n){return aD.resolve(null).then(n).catch(v5)}:jO;function v5(n){setTimeout(function(){throw n})}function lu(n){return n==="head"}function oD(n,e){var t=e,i=0;do{var r=t.nextSibling;if(n.removeChild(t),r&&r.nodeType===8)if(t=r.data,t==="/$"||t==="/&"){if(i===0){n.removeChild(r),Nd(e);return}i--}else if(t==="$"||t==="$?"||t==="$~"||t==="$!"||t==="&")i++;else if(t==="html")_m(n.ownerDocument.documentElement);else if(t==="head"){t=n.ownerDocument.head,_m(t);for(var a=t.firstChild;a;){var o=a.nextSibling,l=a.nodeName;a[km]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&a.rel.toLowerCase()==="stylesheet"||t.removeChild(a),a=o}}else t==="body"&&_m(n.ownerDocument.body);t=r}while(t);Nd(e)}function sD(n,e){var t=n;n=0;do{var i=t.nextSibling;if(t.nodeType===1?e?(t._stashedDisplay=t.style.display,t.style.display="none"):(t.style.display=t._stashedDisplay||"",t.getAttribute("style")===""&&t.removeAttribute("style")):t.nodeType===3&&(e?(t._stashedText=t.nodeValue,t.nodeValue=""):t.nodeValue=t._stashedText||""),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(n===0)break;n--}else t!=="$"&&t!=="$?"&&t!=="$~"&&t!=="$!"||n++;t=i}while(t)}function IE(n){var e=n.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var t=e;switch(e=e.nextSibling,t.nodeName){case"HTML":case"HEAD":case"BODY":IE(t),YE(t);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(t.rel.toLowerCase()==="stylesheet")continue}n.removeChild(t)}}function y5(n,e,t,i){for(;n.nodeType===1;){var r=t;if(n.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(i){if(!n[km])switch(e){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(a=n.getAttribute("rel"),a==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(a!==r.rel||n.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||n.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||n.getAttribute("title")!==(r.title==null?null:r.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(a=n.getAttribute("src"),(a!==(r.src==null?null:r.src)||n.getAttribute("type")!==(r.type==null?null:r.type)||n.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}
vendor: 21,350 bytes, line 9
9else if(e==="input"&&n.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&n.getAttribute("name")===a)return n}else return n;if(n=Wa(n.nextSibling),n===null)break}return null}function _5(n,e,t){if(e==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!t||(n=Wa(n.nextSibling),n===null))return null;return n}function ZO(n,e){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!e||(n=Wa(n.nextSibling),n===null))return null;return n}function zE(n){return n.data==="$?"||n.data==="$~"}function kE(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function b5(n,e){var t=n.ownerDocument;if(n.data==="$~")n._reactRetry=e;else if(n.data!=="$?"||t.readyState!=="loading")e();else{var i=function(){e(),t.removeEventListener("DOMContentLoaded",i)};t.addEventListener("DOMContentLoaded",i),n._reactRetry=i}}function Wa(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return n}var FE=null;function lD(n){n=n.nextSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"||t==="/&"){if(e===0)return Wa(n.nextSibling);e--}else t!=="$"&&t!=="$!"&&t!=="$?"&&t!=="$~"&&t!=="&"||e++}n=n.nextSibling}return null}function uD(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"){if(e===0)return n;e--}else t!=="/$"&&t!=="/&"||e++}n=n.previousSibling}return null}function KO(n,e,t){switch(e=w_(t),n){case"html":if(n=e.documentElement,!n)throw Error(Ve(452));return n;case"head":if(n=e.head,!n)throw Error(Ve(453));return n;case"body":if(n=e.body,!n)throw Error(Ve(454));return n;default:throw Error(Ve(451))}}function _m(n){for(var e=n.attributes;e.length;)n.removeAttributeNode(e[0]);YE(n)}var Xa=new Map,cD=new Set;function A_(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Fs=nn.d;nn.d={f:x5,r:S5,D:T5,C:E5,L:M5,m:w5,X:C5,S:A5,M:R5};function x5(){var n=Fs.f(),e=W_();return n||e}function S5(n){var e=Id(n);e!==null&&e.tag===5&&e.type==="form"?GU(e):Fs.r(n)}var Bd=typeof document>"u"?null:document;function QO(n,e,t){var i=Bd;if(i&&typeof e=="string"&&e){var r=Ba(e);r='link[rel="'+n+'"][href="'+r+'"]',typeof t=="string"&&(r+='[crossorigin="'+t+'"]'),cD.has(r)||(cD.add(r),n={rel:n,crossOrigin:t,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),Xi(e,"link",n),Ri(e),i.head.appendChild(e)))}}function T5(n){Fs.D(n),QO("dns-prefetch",n,null)}function E5(n,e){Fs.C(n,e),QO("preconnect",n,e)}function M5(n,e,t){Fs.L(n,e,t);var i=Bd;if(i&&n&&e){var r='link[rel="preload"][as="'+Ba(e)+'"]';e==="image"&&t&&t.imageSrcSet?(r+='[imagesrcset="'+Ba(t.imageSrcSet)+'"]',typeof t.imageSizes=="string"&&(r+='[imagesizes="'+Ba(t.imageSizes)+'"]')):r+='[href="'+Ba(n)+'"]';var a=r;switch(e){case"style":a=Ld(n);break;case"script":a=Hd(n)}Xa.has(a)||(n=Rn({rel:"preload",href:e==="image"&&t&&t.imageSrcSet?void 0:n,as:e},t),Xa.set(a,n),i.querySelector(r)!==null||e==="style"&&i.querySelector(Wm(a))||e==="script"&&i.querySelector(Xm(a))||(e=i.createElement("link"),Xi(e,"link",n),Ri(e),i.head.appendChild(e)))}}function w5(n,e){Fs.m(n,e);var t=Bd;if(t&&n){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+Ba(i)+'"][href="'+Ba(n)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Hd(n)}if(!Xa.has(a)&&(n=Rn({rel:"modulepreload",href:n},e),Xa.set(a,n),t.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(t.querySelector(Xm(a)))return}i=t.createElement("link"),Xi(i,"link",n),Ri(i),t.head.appendChild(i)}}}function A5(n,e,t){Fs.S(n,e,t);var i=Bd;if(i&&n){var r=vd(i).hoistableStyles,a=Ld(n);e=e||"default";var o=r.get(a);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(Wm(a)))l.loading=5;else{n=Rn({rel:"stylesheet",href:n,"data-precedence":e},t),(t=Xa.get(a))&&OM(n,t);var c=o=i.createElement("link");Ri(c),Xi(c,"link",n),c._p=new Promise(function(f,d){c.onload=f,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,$y(o,e,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(a,o)}}}function C5(n,e){Fs.X(n,e);var t=Bd;if(t&&n){var i=vd(t).hoistableScripts,r=Hd(n),a=i.get(r);a||(a=t.querySelector(Xm(r)),a||(n=Rn({src:n,async:!0},e),(e=Xa.get(r))&&LM(n,e),a=t.createElement("script"),Ri(a),Xi(a,"link",n),t.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function R5(n,e){Fs.M(n,e);var t=Bd;if(t&&n){var i=vd(t).hoistableScripts,r=Hd(n),a=i.get(r);a||(a=t.querySelector(Xm(r)),a||(n=Rn({src:n,async:!0,type:"module"},e),(e=Xa.get(r))&&LM(n,e),a=t.createElement("script"),Ri(a),Xi(a,"link",n),t.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function fD(n,e,t,i){var r=(r=jl.current)?A_(r):null;if(!r)throw Error(Ve(446));switch(n){case"meta":case"title":return null;case"style":return typeof t.precedence=="string"&&typeof t.href=="string"?(e=Ld(t.href),t=vd(r).hoistableStyles,i=t.get(e),i||(i={type:"style",instance:null,count:0,state:null},t.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(t.rel==="stylesheet"&&typeof t.href=="string"&&typeof t.precedence=="string"){n=Ld(t.href);var a=vd(r).hoistableStyles,o=a.get(n);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(n,o),(a=r.querySelector(Wm(n)))&&!a._p&&(o.instance=a,o.state.loading=5),Xa.has(n)||(t={rel:"preload",as:"style",href:t.href,crossOrigin:t.crossOrigin,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy},Xa.set(n,t),a||D5(r,n,t,o.state))),e&&i===null)throw Error(Ve(528,""));return o}if(e&&i!==null)throw Error(Ve(529,""));return null;case"script":return e=t.async,t=t.src,typeof t=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Hd(t),t=vd(r).hoistableScripts,i=t.get(e),i||(i={type:"script",instance:null,count:0,state:null},t.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(Ve(444,n))}}function Ld(n){return'href="'+Ba(n)+'"'}function Wm(n){return'link[rel="stylesheet"]['+n+"]"}function JO(n){return Rn({},n,{"data-precedence":n.precedence,precedence:null})}function D5(n,e,t,i){n.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=n.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),Xi(e,"link",t),Ri(e),n.head.appendChild(e))}function Hd(n){return'[src="'+Ba(n)+'"]'}function Xm(n){return"script[async]"+n}function dD(n,e,t){if(e.count++,e.instance===null)switch(e.type){case"style":var i=n.querySelector('style[data-href~="'+Ba(t.href)+'"]');if(i)return e.instance=i,Ri(i),i;var r=Rn({},t,{"data-href":t.href,"data-precedence":t.precedence,href:null,precedence:null});return i=(n.ownerDocument||n).createElement("style"),Ri(i),Xi(i,"style",r),$y(i,t.precedence,n),e.instance=i;case"stylesheet":r=Ld(t.href);var a=n.querySelector(Wm(r));if(a)return e.state.loading|=4,e.instance=a,Ri(a),a;i=JO(t),(r=Xa.get(r))&&OM(i,r),a=(n.ownerDocument||n).createElement("link"),Ri(a);var o=a;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Xi(a,"link",i),e.state.loading|=4,$y(a,t.precedence,n),e.instance=a;case"script":return a=Hd(t.src),(r=n.querySelector(Xm(a)))?(e.instance=r,Ri(r),r):(i=t,(r=Xa.get(a))&&(i=Rn({},t),LM(i,r)),n=n.ownerDocument||n,r=n.createElement("script"),Ri(r),Xi(r,"link",i),n.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(Ve(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,$y(i,t.precedence,n));return e.instance}function $y(n,e,t){for(var i=t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,o=0;o<i.length;o++){var l=i[o];if(l.dataset.precedence===e)a=l;else if(a!==r)break}a?a.parentNode.insertBefore(n,a.nextSibling):(e=t.nodeType===9?t.head:t,e.insertBefore(n,e.firstChild))}function OM(n,e){n.crossOrigin==null&&(n.crossOrigin=e.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=e.referrerPolicy),n.title==null&&(n.title=e.title)}function LM(n,e){n.crossOrigin==null&&(n.crossOrigin=e.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=e.referrerPolicy),n.integrity==null&&(n.integrity=e.integrity)}var e_=null;function hD(n,e,t){if(e_===null){var i=new Map,r=e_=new Map;r.set(t,i)}else r=e_,i=r.get(t),i||(i=new Map,r.set(t,i));if(i.has(n))return i;for(i.set(n,null),t=t.getElementsByTagName(n),r=0;r<t.length;r++){var a=t[r];if(!(a[km]||a[Vi]||n==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var o=a.getAttribute(e)||"";o=n+o;var l=i.get(o);l?l.push(a):i.set(o,[a])}}return i}function pD(n,e,t){n=n.ownerDocument||n,n.head.insertBefore(t,e==="title"?n.querySelector("head > title"):null)}function U5(n,e,t){if(t===1||e.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return n=e.disabled,typeof e.precedence=="string"&&n==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function $O(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function O5(n,e,t,i){if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var r=Ld(i.href),a=e.querySelector(Wm(r));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=C_.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=a,Ri(a);return}a=e.ownerDocument||e,i=JO(i),(r=Xa.get(r))&&OM(i,r),a=a.createElement("link"),Ri(a);var o=a;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Xi(a,"link",i),t.instance=a}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(n.count++,t=C_.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}var qT=0;function L5(n,e){return n.stylesheets&&n.count===0&&t_(n,n.stylesheets),0<n.count||0<n.imgCount?function(t){var i=setTimeout(function(){if(n.stylesheets&&t_(n,n.stylesheets),n.unsuspend){var a=n.unsuspend;n.unsuspend=null,a()}},6e4+e);0<n.imgBytes&&qT===0&&(qT=62500*h5());var r=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&t_(n,n.stylesheets),n.unsuspend)){var a=n.unsuspend;n.unsuspend=null,a()}},(n.imgBytes>qT?50:800)+e);return n.unsuspend=t,function(){n.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function C_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)t_(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var R_=null;function t_(n,e){n.stylesheets=null,n.unsuspend!==null&&(n.count++,R_=new Map,e.forEach(N5,n),R_=null,C_.call(n))}function N5(n,e){if(!(e.state.loading&4)){var t=R_.get(n);if(t)var i=t.get(null);else{t=new Map,R_.set(n,t);for(var r=n.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var o=r[a];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(t.set(o.dataset.precedence,o),i=o)}i&&t.set(null,i)}r=e.instance,o=r.getAttribute("data-precedence"),a=t.get(o)||i,a===i&&t.set(null,r),t.set(o,r),this.count++,i=C_.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(r,n.firstChild)),e.state.loading|=4}}var Um={$$typeof:Cs,Provider:null,Consumer:null,_currentValue:lc,_currentValue2:lc,_threadCount:0};function P5(n,e,t,i,r,a,o,l,c){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yT(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yT(0),this.hiddenUpdates=yT(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function eL(n,e,t,i,r,a,o,l,c,f,d,m){return n=new P5(n,e,t,o,c,f,d,m,l),e=1,a===!0&&(e|=24),a=pa(3,null,null,e),n.current=a,a.stateNode=n,e=aM(),e.refCount++,n.pooledCache=e,e.refCount++,a.memoizedState={element:i,isDehydrated:t,cache:e},lM(a),n}function tL(n){return n?(n=hd,n):hd}function nL(n,e,t,i,r,a){r=tL(r),i.context===null?i.context=r:i.pendingContext=r,i=Kl(e),i.payload={element:t},a=a===void 0?null:a,a!==null&&(i.callback=a),t=Ql(n,i,e),t!==null&&(Vr(t,n,e),fm(t,n,e))}function mD(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function NM(n,e){mD(n,e),(n=n.alternate)&&mD(n,e)}function iL(n){if(n.tag===13||n.tag===31){var e=xc(n,67108864);e!==null&&Vr(e,n,67108864),NM(n,67108864)}}function gD(n){if(n.tag===13||n.tag===31){var e=_a();e=XE(e);var t=xc(n,e);t!==null&&Vr(t,n,e),NM(n,e)}}var D_=!0;function I5(n,e,t,i){var r=Tt.T;Tt.T=null;var a=nn.p;try{nn.p=2,PM(n,e,t,i)}finally{nn.p=a,Tt.T=r}}function z5(n,e,t,i){var r=Tt.T;Tt.T=null;var a=nn.p;try{nn.p=8,PM(n,e,t,i)}finally{nn.p=a,Tt.T=r}}function PM(n,e,t,i){if(D_){var r=BE(i);if(r===null)WT(n,e,i,U_,t),vD(n,i);else if(F5(r,n,e,t,i))i.stopPropagation();else if(vD(n,i),e&4&&-1<k5.indexOf(n)){for(;r!==null;){var a=Id(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ac(a.pendingLanes);if(o!==0){var l=a;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-ya(o);l.entanglements[1]|=c,o&=~c}Fo(a),(tn&6)===0&&(b_=ga()+500,Gm(0,!1))}}break;case 31:case 13:l=xc(a,2),l!==null&&Vr(l,a,2),W_(),NM(a,2)}if(a=BE(i),a===null&&WT(n,e,i,U_,t),a===r)break;r=a}r!==null&&i.stopPropagation()}else WT(n,e,i,null,t)}}function BE(n){return n=ZE(n),IM(n)}var U_=null;function IM(n){if(U_=null,n=sd(n),n!==null){var e=Nm(n);if(e===null)n=null;else{var t=e.tag;if(t===13){if(n=TD(e),n!==null)return n;n=null}else if(t===31){if(n=ED(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null)}}return U_=n,null}function rL(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(M4()){case CD:return 2;case RD:return 8;case o_:case w4:return 32;case DD:return 268435456;default:return 32}default:return 32}}var HE=!1,eu=null,tu=null,nu=null,Om=new Map,Lm=new Map,Vl=[],k5="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function vD(n,e){switch(n){case"focusin":case"focusout":eu=null;break;case"dragenter":case"dragleave":tu=null;break;case"mouseover":case"mouseout":nu=null;break;case"pointerover":case"pointerout":Om.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lm.delete(e.pointerId)}}function em(n,e,t,i,r,a){return n===null||n.nativeEvent!==a?(n={blockedOn:e,domEventName:t,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},e!==null&&(e=Id(e),e!==null&&iL(e)),n):(n.eventSystemFlags|=i,e=n.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),n)}function F5(n,e,t,i,r){switch(e){case"focusin":return eu=em(eu,n,e,t,i,r),!0;case"dragenter":return tu=em(tu,n,e,t,i,r),!0;case"mouseover":return nu=em(nu,n,e,t,i,r),!0;case"pointerover":var a=r.pointerId;return Om.set(a,em(Om.get(a)||null,n,e,t,i,r)),!0;case"gotpointercapture":return a=r.pointerId,Lm.set(a,em(Lm.get(a)||null,n,e,t,i,r)),!0}return!1}function aL(n){var e=sd(n.target);if(e!==null){var t=Nm(e);if(t!==null){if(e=t.tag,e===13){if(e=TD(t),e!==null){n.blockedOn=e,eR(n.priority,function(){gD(t)});return}}else if(e===31){if(e=ED(t),e!==null){n.blockedOn=e,eR(n.priority,function(){gD(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function n_(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=BE(n.nativeEvent);if(t===null){t=n.nativeEvent;var i=new t.constructor(t.type,t);aE=i,t.target.dispatchEvent(i),aE=null}else return e=Id(t),e!==null&&iL(e),n.blockedOn=t,!1;e.shift()}return!0}function yD(n,e,t){n_(n)&&t.delete(e)}function B5(){HE=!1,eu!==null&&n_(eu)&&(eu=null),tu!==null&&n_(tu)&&(tu=null),nu!==null&&n_(nu)&&(nu=null),Om.forEach(yD),Lm.forEach(yD)}function By(n,e){n.blockedOn===e&&(n.blockedOn=null,HE||(HE=!0,yi.unstable_scheduleCallback(yi.unstable_NormalPriority,B5)))}var Hy=null;function _D(n){Hy!==n&&(Hy=n,yi.unstable_scheduleCallback(yi.unstable_NormalPriority,function(){Hy===n&&(Hy=null);for(var e=0;e<n.length;e+=3){var t=n[e],i=n[e+1],r=n[e+2];if(typeof i!="function"){if(IM(i||t)===null)continue;break}var a=Id(t);a!==null&&(n.splice(e,3),e-=3,xE(a,{pending:!0,data:r,method:t.method,action:i},i,r))}}))}function Nd(n){function e(c){return By(c,n)}eu!==null&&By(eu,n),tu!==null&&By(tu,n),nu!==null&&By(nu,n),Om.forEach(e),Lm.forEach(e);for(var t=0;t<Vl.length;t++){var i=Vl[t];i.blockedOn===n&&(i.blockedOn=null)}for(;0<Vl.length&&(t=Vl[0],t.blockedOn===null);)aL(t),t.blockedOn===null&&Vl.shift();if(t=(n.ownerDocument||n).$$reactFormReplay,t!=null)for(i=0;i<t.length;i+=3){var r=t[i],a=t[i+1],o=r[Gr]||null;if(typeof a=="function")o||_D(t);else if(o){var l=null;if(a&&a.hasAttribute("formAction")){if(r=a,o=a[Gr]||null)l=o.formAction;else if(IM(r)!==null)continue}else l=o.action;typeof l=="function"?t[i+1]=l:(t.splice(i,3),i-=3),_D(t)}}}function oL(){function n(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(o){return r=o})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),i||setTimeout(t,20)}function t(){if(!i&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(t,100),function(){i=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function zM(n){this._internalRoot=n}Y_.prototype.render=zM.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Ve(409));var t=e.current,i=_a();nL(t,i,n,e,null,null)};Y_.prototype.unmount=zM.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;nL(n.current,2,null,n,null,null),W_(),e[Pd]=null}};function Y_(n){this._internalRoot=n}Y_.prototype.unstable_scheduleHydration=function(n){if(n){var e=PD();n={blockedOn:null,target:n,priority:e};for(var t=0;t<Vl.length&&e!==0&&e<Vl[t].priority;t++);Vl.splice(t,0,n),t===0&&aL(n)}};var bD=xD.version;if(bD!=="19.2.4")throw Error(Ve(527,bD,"19.2.4"));nn.findDOMNode=function(n){var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(Ve(188)):(n=Object.keys(n).join(","),Error(Ve(268,n)));return n=y4(e),n=n!==null?MD(n):null,n=n===null?null:n.stateNode,n};var H5={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Tt,reconcilerVersion:"19.2.4"};
vendor: 7,444 bytes, line 9
9if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(tm=__REACT_DEVTOOLS_GLOBAL_HOOK__,!tm.isDisabled&&tm.supportsFiber))try{Pm=tm.inject(H5),va=tm}catch{}var tm;j_.createRoot=function(n,e){if(!SD(n))throw Error(Ve(299));var t=!1,i="",r=QU,a=JU,o=$U;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(a=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError)),e=eL(n,1,!1,null,null,t,i,null,r,a,o,oL),n[Pd]=e.current,UM(n),new zM(e)};j_.hydrateRoot=function(n,e,t){if(!SD(n))throw Error(Ve(299));var i=!1,r="",a=QU,o=JU,l=$U,c=null;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(l=t.onRecoverableError),t.formState!==void 0&&(c=t.formState)),e=eL(n,1,!0,e,t??null,i,r,c,a,o,l,oL),e.context=tL(null),t=e.current,i=_a(),i=XE(i),r=Kl(i),r.callback=null,Ql(t,r,i),t=i,e.current.lanes=t,zm(e,t),Fo(e),n[Pd]=e.current,UM(n),new Y_(e)};j_.version="19.2.4"});var cL=zr((JX,uL)=>{"use strict";function lL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lL)}catch(n){console.error(n)}}lL(),uL.exports=sL()});var jP=zr(YP=>{"use strict";var ap=or();function _9(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var b9=typeof Object.is=="function"?Object.is:_9,x9=ap.useState,S9=ap.useEffect,T9=ap.useLayoutEffect,E9=ap.useDebugValue;function M9(n,e){var t=e(),i=x9({inst:{value:t,getSnapshot:e}}),r=i[0].inst,a=i[1];return T9(function(){r.value=t,r.getSnapshot=e,zw(r)&&a({inst:r})},[n,t,e]),S9(function(){return zw(r)&&a({inst:r}),n(function(){zw(r)&&a({inst:r})})},[n]),E9(t),t}function zw(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!b9(n,t)}catch{return!0}}function w9(n,e){return e()}var A9=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w9:M9;YP.useSyncExternalStore=ap.useSyncExternalStore!==void 0?ap.useSyncExternalStore:A9});var KP=zr((iq,ZP)=>{"use strict";ZP.exports=jP()});var JP=zr(QP=>{"use strict";var p1=or(),C9=KP();function R9(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var D9=typeof Object.is=="function"?Object.is:R9,U9=C9.useSyncExternalStore,O9=p1.useRef,L9=p1.useEffect,N9=p1.useMemo,P9=p1.useDebugValue;QP.useSyncExternalStoreWithSelector=function(n,e,t,i,r){var a=O9(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=N9(function(){function c(g){if(!f){if(f=!0,d=g,g=i(g),r!==void 0&&o.hasValue){var y=o.value;if(r(y,g))return m=y}return m=g}if(y=m,D9(d,g))return y;var T=i(g);return r!==void 0&&r(y,T)?(d=g,y):(d=g,m=T)}var f=!1,d,m,p=t===void 0?null:t;return[function(){return c(e())},p===null?void 0:function(){return c(p())}]},[e,t,i,r]);var l=U9(n,a[0],a[1]);return L9(function(){o.hasValue=!0,o.value=l},[l]),P9(l),l}});var eI=zr((aq,$P)=>{"use strict";$P.exports=JP()});var dI=zr(g1=>{"use strict";var B9=Symbol.for("react.transitional.element"),H9=Symbol.for("react.fragment");function fI(n,e,t){var i=null;if(t!==void 0&&(i=""+t),e.key!==void 0&&(i=""+e.key),"key"in e){t={};for(var r in e)r!=="key"&&(t[r]=e[r])}else t=e;return e=t.ref,{$$typeof:B9,type:n,key:i,ref:e!==void 0?e:null,props:t}}g1.Fragment=H9;g1.jsx=fI;g1.jsxs=fI});var Sv=zr((fq,hI)=>{"use strict";hI.exports=dI()});var hn=gi(or()),Lz=gi(cL());var Dn=gi(or()),wI=gi(or());var lf={};ZF(lf,{ACESFilmicToneMapping:()=>Lu,AddEquation:()=>Zs,AddOperation:()=>ew,AdditiveAnimationBlendMode:()=>o1,AdditiveBlending:()=>Wx,AgXToneMapping:()=>Qx,AlphaFormat:()=>r1,AlwaysCompare:()=>dw,AlwaysDepth:()=>dg,AlwaysStencilFunc:()=>Hb,AmbientLight:()=>v0,AnimationAction:()=>A0,AnimationClip:()=>Du,AnimationLoader:()=>ox,AnimationMixer:()=>_x,AnimationObjectGroup:()=>yx,AnimationUtils:()=>ax,ArcCurve:()=>zg,ArrayCamera:()=>T0,ArrowHelper:()=>zx,AttachedBindMode:()=>Fb,Audio:()=>M0,AudioAnalyser:()=>vx,AudioContext:()=>Hh,AudioListener:()=>mx,AudioLoader:()=>hx,AxesHelper:()=>kx,BackSide:()=>Ni,BasicDepthPacking:()=>aw,BasicShadowMap:()=>Gx,BatchedMesh:()=>Cg,BezierInterpolant:()=>c0,Bone:()=>Th,BooleanKeyframeTrack:()=>qo,Box2:()=>Mx,Box3:()=>bn,Box3Helper:()=>Px,BoxGeometry:()=>Eu,BoxHelper:()=>Nx,BufferAttribute:()=>an,BufferGeometry:()=>wt,BufferGeometryLoader:()=>x0,ByteType:()=>e1,Cache:()=>go,Camera:()=>Kc,CameraHelper:()=>Lx,CanvasTexture:()=>ix,CapsuleGeometry:()=>Lg,CatmullRomCurve3:()=>kg,CineonToneMapping:()=>Zx,CircleGeometry:()=>Ng,ClampToEdgeWrapping:()=>Mr,Clock:()=>Wh,Color:()=>tt,ColorKeyframeTrack:()=>zh,ColorManagement:()=>Pt,Compatibility:()=>rP,CompressedArrayTexture:()=>tx,CompressedCubeTexture:()=>nx,CompressedTexture:()=>Gc,CompressedTextureLoader:()=>sx,ConeGeometry:()=>wh,ConstantAlphaFactor:()=>Q2,ConstantColorFactor:()=>Z2,Controls:()=>Bx,CubeCamera:()=>S0,CubeDepthTexture:()=>Og,CubeReflectionMapping:()=>Eo,CubeRefractionMapping:()=>ol,CubeTexture:()=>Tu,CubeTextureLoader:()=>lx,CubeUVReflectionMapping:()=>$c,CubicBezierCurve:()=>Ah,CubicBezierCurve3:()=>Fg,CubicInterpolant:()=>l0,CullFaceBack:()=>Vx,CullFaceFront:()=>N2,CullFaceFrontBack:()=>yN,CullFaceNone:()=>L2,Curve:()=>Zr,CurvePath:()=>Hg,CustomBlending:()=>P2,CustomToneMapping:()=>Kx,CylinderGeometry:()=>Wc,Cylindrical:()=>Tx,Data3DTexture:()=>Fc,DataArrayTexture:()=>kc,DataTexture:()=>wr,DataTextureLoader:()=>ux,DataUtils:()=>Wb,DecrementStencilOp:()=>IN,DecrementWrapStencilOp:()=>kN,DefaultLoadingManager:()=>_w,DepthFormat:()=>vo,DepthStencilFormat:()=>sl,DepthTexture:()=>Qs,DetachedBindMode:()=>tw,DirectionalLight:()=>g0,DirectionalLightHelper:()=>Ox,DiscreteInterpolant:()=>u0,DodecahedronGeometry:()=>Pg,DoubleSide:()=>Zi,DstAlphaFactor:()=>W2,DstColorFactor:()=>q2,DynamicCopyUsage:()=>JN,DynamicDrawUsage:()=>hw,DynamicReadUsage:()=>ZN,EdgesGeometry:()=>Ig,EllipseCurve:()=>Xc,EqualCompare:()=>uw,EqualDepth:()=>pg,EqualStencilFunc:()=>VN,EquirectangularReflectionMapping:()=>Yh,EquirectangularRefractionMapping:()=>jh,Euler:()=>jr,EventDispatcher:()=>wa,ExternalTexture:()=>Mh,ExtrudeGeometry:()=>Xg,FileLoader:()=>ja,Float16BufferAttribute:()=>Kb,Float32BufferAttribute:()=>ut,FloatType:()=>Yi,Fog:()=>xg,FogExp2:()=>bg,FramebufferTexture:()=>ex,FrontSide:()=>Go,Frustum:()=>Ks,FrustumArray:()=>Ag,GLBufferAttribute:()=>Sx,GLSL1:()=>eP,GLSL3:()=>l1,GreaterCompare:()=>cw,GreaterDepth:()=>gg,GreaterEqualCompare:()=>mv,GreaterEqualDepth:()=>mg,GreaterEqualStencilFunc:()=>qN,GreaterStencilFunc:()=>WN,GridHelper:()=>Dx,Group:()=>Ys,HalfFloatType:()=>wo,HemisphereLight:()=>d0,HemisphereLightHelper:()=>Rx,IcosahedronGeometry:()=>qg,ImageBitmapLoader:()=>dx,ImageLoader:()=>Uu,ImageUtils:()=>_g,IncrementStencilOp:()=>PN,IncrementWrapStencilOp:()=>zN,InstancedBufferAttribute:()=>_o,InstancedBufferGeometry:()=>el,InstancedInterleavedBuffer:()=>tl,InstancedMesh:()=>wg,Int16BufferAttribute:()=>jb,Int32BufferAttribute:()=>Zb,Int8BufferAttribute:()=>Xb,IntType:()=>R0,InterleavedBuffer:()=>Vc,InterleavedBufferAttribute:()=>dr,Interpolant:()=>$s,InterpolateBezier:()=>Bb,InterpolateDiscrete:()=>dh,InterpolateLinear:()=>yg,InterpolateSmooth:()=>ag,InterpolationSamplingMode:()=>iP,InterpolationSamplingType:()=>nP,InvertStencilOp:()=>FN,KeepStencilOp:()=>gu,KeyframeTrack:()=>Ar,LOD:()=>Tg,LatheGeometry:()=>
9Yg,Layers:()=>Xo,LessCompare:()=>lw,LessDepth:()=>hg,LessEqualCompare:()=>pv,LessEqualDepth:()=>bu,LessEqualStencilFunc:()=>GN,LessStencilFunc:()=>HN,Light:()=>So,LightProbe:()=>_0,Line:()=>bo,Line3:()=>Xh,LineBasicMaterial:()=>Li,LineCurve:()=>Ch,LineCurve3:()=>Bg,LineDashedMaterial:()=>s0,LineLoop:()=>Rg,LineSegments:()=>Ca,LinearFilter:()=>dn,LinearInterpolant:()=>Ih,LinearMipMapLinearFilter:()=>TN,LinearMipMapNearestFilter:()=>SN,LinearMipmapLinearFilter:()=>Mo,LinearMipmapNearestFilter:()=>Zh,LinearSRGBColorSpace:()=>Wo,LinearToneMapping:()=>Yx,LinearTransfer:()=>ph,Loader:()=>ji,LoaderUtils:()=>Bh,LoadingManager:()=>kh,LoopOnce:()=>nw,LoopPingPong:()=>rw,LoopRepeat:()=>iw,MOUSE:()=>il,Material:()=>bi,MaterialBlending:()=>_N,MaterialLoader:()=>b0,MathUtils:()=>tp,Matrix2:()=>Ex,Matrix3:()=>Et,Matrix4:()=>mt,MaxEquation:()=>F2,Mesh:()=>ln,MeshBasicMaterial:()=>Aa,MeshDepthMaterial:()=>Mu,MeshDistanceMaterial:()=>wu,MeshLambertMaterial:()=>a0,MeshMatcapMaterial:()=>o0,MeshNormalMaterial:()=>r0,MeshPhongMaterial:()=>n0,MeshPhysicalMaterial:()=>t0,MeshStandardMaterial:()=>Zc,MeshToonMaterial:()=>i0,MinEquation:()=>k2,MirroredRepeatWrapping:()=>fh,MixOperation:()=>$2,MultiplyBlending:()=>qx,MultiplyOperation:()=>qh,NearestFilter:()=>Yn,NearestMipMapLinearFilter:()=>xN,NearestMipMapNearestFilter:()=>bN,NearestMipmapLinearFilter:()=>ef,NearestMipmapNearestFilter:()=>$x,NeutralToneMapping:()=>Jx,NeverCompare:()=>sw,NeverDepth:()=>fg,NeverStencilFunc:()=>BN,NoBlending:()=>To,NoColorSpace:()=>jo,NoNormalPacking:()=>DN,NoToneMapping:()=>Qr,NormalAnimationBlendMode:()=>hv,NormalBlending:()=>_u,NormalGAPacking:()=>ON,NormalRGPacking:()=>UN,NotEqualCompare:()=>fw,NotEqualDepth:()=>vg,NotEqualStencilFunc:()=>XN,NumberKeyframeTrack:()=>Au,Object3D:()=>$t,ObjectLoader:()=>fx,ObjectSpaceNormalMap:()=>ow,OctahedronGeometry:()=>Lh,OneFactor:()=>H2,OneMinusConstantAlphaFactor:()=>J2,OneMinusConstantColorFactor:()=>K2,OneMinusDstAlphaFactor:()=>X2,OneMinusDstColorFactor:()=>Y2,OneMinusSrcAlphaFactor:()=>cg,OneMinusSrcColorFactor:()=>G2,OrthographicCamera:()=>Kr,PCFShadowMap:()=>Ou,PCFSoftShadowMap:()=>Jc,PMREMGenerator:()=>_v,Path:()=>qc,PerspectiveCamera:()=>Tn,Plane:()=>qi,PlaneGeometry:()=>xo,PlaneHelper:()=>Ix,PointLight:()=>m0,PointLightHelper:()=>Cx,Points:()=>Dg,PointsMaterial:()=>Eh,PolarGridHelper:()=>Ux,PolyhedronGeometry:()=>Js,PositionalAudio:()=>gx,PropertyBinding:()=>sn,PropertyMixer:()=>w0,QuadraticBezierCurve:()=>Rh,QuadraticBezierCurve3:()=>Dh,Quaternion:()=>ei,QuaternionKeyframeTrack:()=>Cu,QuaternionLinearInterpolant:()=>f0,R11_EAC_Format:()=>V0,RED_GREEN_RGTC2_Format:()=>fv,RED_RGTC1_Format:()=>uv,REVISION:()=>nl,RG11_EAC_Format:()=>W0,RGBADepthPacking:()=>s1,RGBAFormat:()=>_i,RGBAIntegerFormat:()=>N0,RGBA_ASTC_10x10_Format:()=>iv,RGBA_ASTC_10x5_Format:()=>ev,RGBA_ASTC_10x6_Format:()=>tv,RGBA_ASTC_10x8_Format:()=>nv,RGBA_ASTC_12x10_Format:()=>rv,RGBA_ASTC_12x12_Format:()=>av,RGBA_ASTC_4x4_Format:()=>q0,RGBA_ASTC_5x4_Format:()=>Y0,RGBA_ASTC_5x5_Format:()=>j0,RGBA_ASTC_6x5_Format:()=>Z0,RGBA_ASTC_6x6_Format:()=>K0,RGBA_ASTC_8x5_Format:()=>Q0,RGBA_ASTC_8x6_Format:()=>J0,RGBA_ASTC_8x8_Format:()=>$0,RGBA_BPTC_Format:()=>ov,RGBA_ETC2_EAC_Format:()=>H0,RGBA_PVRTC_2BPPV1_Format:()=>k0,RGBA_PVRTC_4BPPV1_Format:()=>z0,RGBA_S3TC_DXT1_Format:()=>Jh,RGBA_S3TC_DXT3_Format:()=>$h,RGBA_S3TC_DXT5_Format:()=>ep,RGBDepthPacking:()=>CN,RGBFormat:()=>a1,RGBIntegerFormat:()=>EN,RGB_BPTC_SIGNED_Format:()=>sv,RGB_BPTC_UNSIGNED_Format:()=>lv,RGB_ETC1_Format:()=>F0,RGB_ETC2_Format:()=>B0,RGB_PVRTC_2BPPV1_Format:()=>I0,RGB_PVRTC_4BPPV1_Format:()=>P0,RGB_S3TC_DXT1_Format:()=>Qh,RGDepthPacking:()=>RN,RGFormat:()=>Nu,RGIntegerFormat:()=>L0,RawShaderMaterial:()=>Ph,Ray:()=>yo,Raycaster:()=>Gh,RectAreaLight:()=>y0,RedFormat:()=>O0,RedIntegerFormat:()=>Kh,ReinhardToneMapping:()=>jx,RenderTarget:()=>_h,RenderTarget3D:()=>bx,RepeatWrapping:()=>ch,ReplaceStencilOp:()=>NN,ReverseSubtractEquation:()=>z2,RingGeometry:()=>jg,SIGNED_R11_EAC_Format:()=>G0,SIGNED_RED_GREEN_RGTC2_Format:()=>dv,SIGNED_RED_RGTC1_Format:()=>cv,SIGNED_RG11_EAC_Format:()=>X0,SRGBColorSpace:()=>Oi,SRGBTransfer:()=>rn,Scene:()=>Hc,ShaderChunk:()=>Rt,ShaderLib:()=>Za,ShaderMaterial:()=>xi,ShadowMaterial:()=>e0,Shape:()=>Ma,ShapeGeometry:()=>Zg,ShapePath:()=>Fx,ShapeUtils:()=>Ya,ShortType:()=>t1,Skeleton:()=>Mg,SkeletonHelper:()=>Ax,SkinnedMesh:()=>Eg,Source:()=>mo,Sphere:()=>En,SphereGeometry:()=>Nh,Spherical:()=>Qc,SphericalHarmonics3:()=>Fh,SplineCurve:()=>Uh,SpotLight:()=>p0,SpotLightHelper:()=>wx,Sprite:()=>Sg,SpriteMaterial:()=>Sh,SrcAlphaFactor:()=>ug,SrcAlphaSaturateFactor:()=>j2,SrcColorFactor:()=>V2,StaticCopyUsage:()=>QN,StaticDrawUsage:()=>mh,StaticReadUsage:()=>jN,StereoCamera:()=>px,StreamCopyUsage:()=>$N,StreamDrawUsage:()=>YN,StreamReadUsage:()=>KN,StringKeyframeTrack:()=>Yo,SubtractEquation:()=>I2,SubtractiveBlending:()=>Xx,TOUCH:()=>rl,TangentSpaceNormalMap:()=>ll,TetrahedronGeometry:()=>Kg,Texture:()=>Bn,TextureLoader:()=>cx,TextureUtils:()=>Hx,Timer:()=>E0,TimestampQuery:()=>tP,TorusGeometry:()=>Qg,TorusKnotGeometry:()=>Jg,Triangle:()=>po,TriangleFanDrawMode:()=>AN,TriangleStripDrawMode:()=>wN,TrianglesDrawMode:()=>MN,TubeGeometry:()=>$g,UVMapping:()=>C0,Uint16BufferAttribute:()=>bh,Uint32BufferAttribute:()=>xh,Uint8BufferAttribute:()=>qb,Uint8ClampedBufferAttribute:()=>Yb,Uniform:()=>Vh,UniformsGroup:()=>xx,UniformsLib:()=>lt,UniformsUtils:()=>Zo,UnsignedByteType:()=>Ki,UnsignedInt101111Type:()=>i1,UnsignedInt248Type:()=>nf,UnsignedInt5999Type:()=>n1,UnsignedIntType:()=>Ra,UnsignedShort4444Type:()=>D0,UnsignedShort5551Type:()=>U0,UnsignedShortType:()=>tf,VSMShadowMap:()=>al,Vector2:()=>Le,Vector3:()=>H,Vector4:()=>Nt,VectorKeyframeTrack:()=>Ru,VideoFrameTexture:()=>$b,VideoTexture:()=>Ug,WebGL3DRenderTarget:()=>Gb,WebGLArrayRenderTarget:()=>Vb,WebGLCoordinateSystem:()=>
vendor: 4,828 bytes, line 9
9Yr,WebGLCubeRenderTarget:()=>bv,WebGLRenderTarget:()=>fr,WebGLRenderer:()=>xv,WebGLUtils:()=>qP,WebGPUCoordinateSystem:()=>xu,WebXRController:()=>Bc,WireframeGeometry:()=>jc,WrapAroundEnding:()=>hh,ZeroCurvatureEnding:()=>vu,ZeroFactor:()=>B2,ZeroSlopeEnding:()=>yu,ZeroStencilOp:()=>LN,createCanvasElement:()=>pw,error:()=>pt,getConsoleFunction:()=>sP,log:()=>vh,setConsoleFunction:()=>oP,warn:()=>ot,warnOnce:()=>yh});var nl="183",il={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},rl={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},L2=0,Vx=1,N2=2,yN=3,Gx=0,Ou=1,Jc=2,al=3,Go=0,Ni=1,Zi=2,To=0,_u=1,Wx=2,Xx=3,qx=4,P2=5,_N=6,Zs=100,I2=101,z2=102,k2=103,F2=104,B2=200,H2=201,V2=202,G2=203,ug=204,cg=205,W2=206,X2=207,q2=208,Y2=209,j2=210,Z2=211,K2=212,Q2=213,J2=214,fg=0,dg=1,hg=2,bu=3,pg=4,mg=5,gg=6,vg=7,qh=0,$2=1,ew=2,Qr=0,Yx=1,jx=2,Zx=3,Lu=4,Kx=5,Qx=6,Jx=7,Fb="attached",tw="detached",C0=300,Eo=301,ol=302,Yh=303,jh=304,$c=306,ch=1e3,Mr=1001,fh=1002,Yn=1003,$x=1004,bN=1004,ef=1005,xN=1005,dn=1006,Zh=1007,SN=1007,Mo=1008,TN=1008,Ki=1009,e1=1010,t1=1011,tf=1012,R0=1013,Ra=1014,Yi=1015,wo=1016,D0=1017,U0=1018,nf=1020,n1=35902,i1=35899,r1=1021,a1=1022,_i=1023,vo=1026,sl=1027,O0=1028,Kh=1029,Nu=1030,L0=1031,EN=1032,N0=1033,Qh=33776,Jh=33777,$h=33778,ep=33779,P0=35840,I0=35841,z0=35842,k0=35843,F0=36196,B0=37492,H0=37496,V0=37488,G0=37489,W0=37490,X0=37491,q0=37808,Y0=37809,j0=37810,Z0=37811,K0=37812,Q0=37813,J0=37814,$0=37815,ev=37816,tv=37817,nv=37818,iv=37819,rv=37820,av=37821,ov=36492,sv=36494,lv=36495,uv=36283,cv=36284,fv=36285,dv=36286,nw=2200,iw=2201,rw=2202,dh=2300,yg=2301,ag=2302,Bb=2303,vu=2400,yu=2401,hh=2402,hv=2500,o1=2501,MN=0,wN=1,AN=2,aw=3200,s1=3201,CN=3202,RN=3203,ll=0,ow=1,jo="",Oi="srgb",Wo="srgb-linear",ph="linear",rn="srgb",DN="",UN="rg",ON="ga",LN=0,gu=7680,NN=7681,PN=7682,IN=7683,zN=34055,kN=34056,FN=5386,BN=512,HN=513,VN=514,GN=515,WN=516,XN=517,qN=518,Hb=519,sw=512,lw=513,uw=514,pv=515,cw=516,fw=517,mv=518,dw=519,mh=35044,hw=35048,YN=35040,jN=35045,ZN=35049,KN=35041,QN=35046,JN=35050,$N=35042,eP="100",l1="300 es",Yr=2e3,xu=2001,tP={COMPUTE:"compute",RENDER:"render"},nP={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},iP={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},rP={TEXTURE_COMPARE:"depthTextureCompare"};function V5(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}var G5={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function lh(n,e){return new G5[n](e)}function aP(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function gh(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function pw(){let n=gh("canvas");return n.style.display="block",n}var fL={},Su=null;function oP(n){Su=n}function sP(){return Su}function vh(...n){let e="THREE."+n.shift();Su?Su("log",e,...n):console.log(e,...n)}function lP(n){let e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){let t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function ot(...n){n=lP(n);let e="THREE."+n.shift();if(Su)Su("warn",e,...n);else{let t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function pt(...n){n=lP(n);let e="THREE."+n.shift();if(Su)Su("error",e,...n);else{let t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function yh(...n){let e=n.join(" ");e in fL||(fL[e]=!0,ot(...n))}function uP(n,e,t){return new Promise(function(i,r){function a(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(a,t);break;default:i()}}setTimeout(a,t)})}var cP={[fg]:dg,[hg]:gg,[pg]:vg,[bu]:mg,[dg]:fg,[gg]:hg,[vg]:pg,[mg]:bu},wa=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){let i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){let i=this._listeners;if(i===void 0)return;let r=i[e];if(r!==void 0){let a=r.indexOf(t);a!==-1&&r.splice(a,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let i=t[e.type];if(i!==void 0){e.target=this;let r=i.slice(0);for(let a=0,o=r.length;a<o;a++)r[a].call(this,e);e.target=null}}},lr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","5
95","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],dL=1234567,Ic=Math.PI/180,zc=180/Math.PI;function Ea(){let n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(lr[n&255]+lr[n>>8&255]+lr[n>>16&255]+lr[n>>24&255]+"-"+lr[e&255]+lr[e>>8&255]+"-"+lr[e>>16&15|64]+lr[e>>24&255]+"-"+lr[t&63|128]+lr[t>>8&255]+"-"+lr[t>>16&255]+lr[t>>24&255]+lr[i&255]+lr[i>>8&255]+lr[i>>16&255]+lr[i>>24&255]).toLowerCase()}function xt(n,e,t){return Math.max(e,Math.min(t,n))}function mw(n,e){return(n%e+e)%e}function W5(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function X5(n,e,t){return n!==e?(t-n)/(e-n):0}function og(n,e,t){return(1-t)*n+t*e}function q5(n,e,t,i){return og(n,e,1-Math.exp(-t*i))}function Y5(n,e=1){return e-Math.abs(mw(n,e*2)-e)}function j5(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Z5(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function K5(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Q5(n,e){return n+Math.random()*(e-n)}function J5(n){return n*(.5-Math.random())}function $5(n){n!==void 0&&(dL=n);let e=dL+=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 e6(n){return n*Ic}function t6(n){return n*zc}function n6(n){return(n&n-1)===0&&n!==0}function i6(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function r6(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function a6(n,e,t,i,r){let a=Math.cos,o=Math.sin,l=a(t/2),c=o(t/2),f=a((e+i)/2),d=o((e+i)/2),m=a((e-i)/2),p=o((e-i)/2),g=a((i-e)/2),y=o((i-e)/2);switch(r){case"XYX":n.set(l*d,c*m,c*p,l*f);break;case"YZY":n.set(c*p,l*d,c*m,l*f);break;case"ZXZ":n.set(c*m,c*p,l*d,l*f);break;case"XZX":n.set(l*d,c*y,c*g,l*f);break;case"YXY":n.set(c*g,l*d,c*y,l*f);break;case"ZYZ":n.set(c*y,c*g,l*d,l*f);break;default:ot("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Er(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 Ot(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.")}}var tp={DEG2RAD:Ic,RAD2DEG:zc,generateUUID:Ea,clamp:xt,euclideanModulo:mw,mapLinear:W5,inverseLerp:X5,lerp:og,damp:q5,pingpong:Y5,smoothstep:j5,smootherstep:Z5,randInt:K5,randFloat:Q5,randFloatSpread:J5,seededRandom:$5,degToRad:e6,radToDeg:t6,isPowerOfTwo:n6,ceilPowerOfTwo:i6,floorPowerOfTwo:r6,setQuaternionFromProperEuler:a6,normalize:Ot,denormalize:Er},Le=class n{constructor(e=0,t=0){n.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}
vendor: 5,415 bytes, line 9
9sub(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){let 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=xt(this.x,e.x,t.x),this.y=xt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=xt(this.x,e,t),this.y=xt(this.y,e,t),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(xt(i,e,t))}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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(xt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let 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){let i=Math.cos(t),r=Math.sin(t),a=this.x-e.x,o=this.y-e.y;return this.x=a*i-o*r+e.x,this.y=a*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}},ei=class{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,a,o,l){let c=i[r+0],f=i[r+1],d=i[r+2],m=i[r+3],p=a[o+0],g=a[o+1],y=a[o+2],T=a[o+3];if(m!==T||c!==p||f!==g||d!==y){let x=c*p+f*g+d*y+m*T;x<0&&(p=-p,g=-g,y=-y,T=-T,x=-x);let _=1-l;if(x<.9995){let b=Math.acos(x),S=Math.sin(b);_=Math.sin(_*b)/S,l=Math.sin(l*b)/S,c=c*_+p*l,f=f*_+g*l,d=d*_+y*l,m=m*_+T*l}else{c=c*_+p*l,f=f*_+g*l,d=d*_+y*l,m=m*_+T*l;let b=1/Math.sqrt(c*c+f*f+d*d+m*m);c*=b,f*=b,d*=b,m*=b}}e[t]=c,e[t+1]=f,e[t+2]=d,e[t+3]=m}static multiplyQuaternionsFlat(e,t,i,r,a,o){let l=i[r],c=i[r+1],f=i[r+2],d=i[r+3],m=a[o],p=a[o+1],g=a[o+2],y=a[o+3];return e[t]=l*y+d*m+c*g-f*p,e[t+1]=c*y+d*p+f*m-l*g,e[t+2]=f*y+d*g+l*p-c*m,e[t+3]=d*y-l*m-c*p-f*g,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){let i=e._x,r=e._y,a=e._z,o=e._order,l=Math.cos,c=Math.sin,f=l(i/2),d=l(r/2),m=l(a/2),p=c(i/2),g=c(r/2),y=c(a/2);switch(o){case"XYZ":this._x=p*d*m+f*g*y,this._y=f*g*m-p*d*y,this._z=f*d*y+p*g*m,this._w=f*d*m-p*g*y;break;case"YXZ":this._x=p*d*m+f*g*y,this._y=f*g*m-p*d*y,this._z=f*d*y-p*g*m,this._w=f*d*m+p*g*y;break;case"ZXY":this._x=p*d*m-f*g*y,this._y=f*g*m+p*d*y,this._z=f*d*y+p*g*m,this._w=f*d*m-p*g*y;break;case"ZYX":this._x=p*d*m-f*g*y,this._y=f*g*m+p*d*y,this._z=f*d*y-p*g*m,this._w=f*d*m+p*g*y;break;case"YZX":this._x=p*d*m+f*g*y,this._y=f*g*m+p*d*y,this._z=f*d*y-p*g*m,this._w=f*d*m-p*g*y;break;case"XZY":this._x=p*d*m-f*g*y,this._y=f*g*m-p*d*y,this._z=f*d*y+p*g*m,this._w=f*d*m+p*g*y;break;default:ot("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let 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){let t=e.elements,i=t[0],r=t[4],a=t[8],o=t[1],l=t[5],c=t[9],f=t[2],d=t[6],m=t[10],p=i+l+m;if(p>0){let g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-c)*g,this._y=(a-f)*g,this._z=(o-r)*g}else if(i>l&&i>m){let g=2*Math.sqrt(1+i-l-m);this._w=(d-c)/g,this._x=.25*g,this._y=(r+o)/g,this._z=(a+f)/g}else if(l>m){let g=2*Math.sqrt(1+l-i-m);this._w=(a-f)/g,this._x=(r+o)/g,this._y=.25*g,this._z=(c+d)/g}else{let g=2*Math.sqrt(1+m-i-l);this._w=(o-r)/g,this._x=(a+f)/g,this._y=(c+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>
vendor: 22,106 bytes, line 9
9Math.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(xt(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let 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){let i=e._x,r=e._y,a=e._z,o=e._w,l=t._x,c=t._y,f=t._z,d=t._w;return this._x=i*d+o*l+r*f-a*c,this._y=r*d+o*c+a*l-i*f,this._z=a*d+o*f+i*c-r*l,this._w=o*d-i*l-r*c-a*f,this._onChangeCallback(),this}slerp(e,t){let i=e._x,r=e._y,a=e._z,o=e._w,l=this.dot(e);l<0&&(i=-i,r=-r,a=-a,o=-o,l=-l);let c=1-t;if(l<.9995){let f=Math.acos(l),d=Math.sin(f);c=Math.sin(c*f)/d,t=Math.sin(t*f)/d,this._x=this._x*c+i*t,this._y=this._y*c+r*t,this._z=this._z*c+a*t,this._w=this._w*c+o*t,this._onChangeCallback()}else this._x=this._x*c+i*t,this._y=this._y*c+r*t,this._z=this._z*c+a*t,this._w=this._w*c+o*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),a*Math.sin(t),a*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}},H=class n{constructor(e=0,t=0,i=0){n.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(hL.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(hL.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*r,this.y=a[1]*t+a[4]*i+a[7]*r,this.z=a[2]*t+a[5]*i+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,r=this.z,a=e.elements,o=1/(a[3]*t+a[7]*i+a[11]*r+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*r+a[12])*o,this.y=(a[1]*t+a[5]*i+a[9]*r+a[13])*o,this.z=(a[2]*t+a[6]*i+a[10]*r+a[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,r=this.z,a=e.x,o=e.y,l=e.z,c=e.w,f=2*(o*r-l*i),d=2*(l*t-a*r),m=2*(a*i-o*t);return this.x=t+c*f+o*m-l*d,this.y=i+c*d+l*f-a*m,this.z=r+c*m+a*d-o*f,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r,this.y=a[1]*t+a[5]*i+a[9]*r,this.z=a[2]*t+a[6]*i+a[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=xt(this.x,e.x,t.x),this.y=xt(this.y,e.y,t.y),this.z=xt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=xt(this.x,e,t),this.y=xt(this.y,e,t),this.z=xt(this.z,e,t),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(xt(i,e,t))}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){let i=e.x,r=e.y,a=e.z,o=t.x,l=t.y,c=t.z;return this.x=r*c-a*l,this.y=a*o-i*c,this.z=i*l-r*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return kM.copy(this).projectOnVector(e),this.sub(kM)}reflect(e){return this.sub(kM.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(xt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let 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){let 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){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let 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(){let 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}},kM=new H,hL=new ei,Et=class n{constructor(e,t,i,r,a,o,l,c,f){n.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,a,o,l,c,f)}set(e,t,i,r,a,o,l,c,f){let d=this.elements;return d[0]=e,d[1]=r,d[2]=l,d[3]=t,d[4]=a,d[5]=c,d[6]=i,d[7]=o,d[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let 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){let 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){let i=e.elements,r=t.elements,a=this.elements,o=i[0],l=i[3],c=i[6],f=i[1],d=i[4],m=i[7],p=i[2],g=i[5],y=i[8],T=r[0],x=r[3],_=r[6],b=r[1],S=r[4],E=r[7],C=r[2],D=r[5],U=r[8];return a[0]=o*T+l*b+c*C,a[3]=o*x+l*S+c*D,a[6]=o*_+l*E+c*U,a[1]=f*T+d*b+m*C,a[4]=f*x+d*S+m*D,a[7]=f*_+d*E+m*U,a[2]=p*T+g*b+y*C,a[5]=p*x+g*S+y*D,a[8]=p*_+g*E+y*U,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],o=e[4],l=e[5],c=e[6],f=e[7],d=e[8];return t*o*d-t*l*f-i*a*d+i*l*c+r*a*f-r*o*c}invert(){let e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],o=e[4],l=e[5],c=e[6],f=e[7],d=e[8],m=d*o-l*f,p=l*c-d*a,g=f*a-o*c,y=t*m+i*p+r*g;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);let T=1/y;return e[0]=m*T,e[1]=(r*f-d*i)*T,e[2]=(l*i-r*o)*T,e[3]=p*T,e[4]=(d*t-r*c)*T,e[5]=(r*a-l*t)*T,e[6]=g*T,e[7]=(i*c-f*t)*T,e[8]=(o*t-i*a)*T,this}transpose(){let e,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){let 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,a,o,l){let c=Math.cos(a),f=Math.sin(a);return this.set(i*c,i*f,-i*(c*o+f*l)+o+e,-r*f,r*c,-r*(-f*o+c*l)+l+t,0,0,1),this}scale(e,t){return this.premultiply(FM.makeScale(e,t)),this}rotate(e){return this.premultiply(FM.makeRotation(-e)),this}translate(e,t){return this.premultiply(FM.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){let 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){let 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){let 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)}},FM=new Et,pL=new Et().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),mL=new Et().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function o6(){let n={enabled:!0,workingColorSpace:Wo,spaces:{},convert:function(r,a,o){return this.enabled===!1||a===o||!a||!o||(this.spaces[a].transfer===rn&&(r.r=js(r.r),r.g=js(r.g),r.b=js(r.b)),this.spaces[a].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===rn&&(r.r=uh(r.r),r.g=uh(r.g),r.b=uh(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===jo?ph:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,o){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return yh("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return yh("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,a)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Wo]:{primaries:e,whitePoint:i,transfer:ph,toXYZ:pL,fromXYZ:mL,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Oi},outputColorSpaceConfig:{drawingBufferColorSpace:Oi}},[Oi]:{primaries:e,whitePoint:i,transfer:rn,toXYZ:pL,fromXYZ:mL,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Oi}}}),n}var Pt=o6();function js(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function uh(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}var Vd,_g=class{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Vd===void 0&&(Vd=gh("canvas")),Vd.width=e.width,Vd.height=e.height;let r=Vd.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Vd}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=gh("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let r=i.getImageData(0,0,e.width,e.height),a=r.data;for(let o=0;o<a.length;o++)a[o]=js(a[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){let t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(js(t[i]/255)*255):t[i]=js(t[i]);return{data:t,width:e.width,height:e.height}}else return ot("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},s6=0,mo=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:s6++}),this.uuid=Ea(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let o=0,l=r.length;o<l;o++)r[o].isDataTexture?a.push(BM(r[o].image)):a.push(BM(r[o]))}else a=BM(r);i.url=a}return t||(e.images[this.uuid]=i),i}};function BM(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?_g.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(ot("Texture: Unable to serialize Texture."),{})}var l6=0,HM=new H,Bn=class n extends wa{constructor(e=n.DEFAULT_IMAGE,t=n.DEFAULT_MAPPING,i=Mr,r=Mr,a=dn,o=Mo,l=_i,c=Ki,f=n.DEFAULT_ANISOTROPY,d=jo){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:l6++}),this.uuid=Ea(),this.name="",this.source=new mo(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=a,this.minFilter=o,this.anisotropy=f,this.format=l,this.internalFormat=null,this.type=c,this.offset=new Le(0,0),this.repeat=new Le(1,1),this.center=new Le(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Et,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(HM).x}get height(){return this.source.getSize(HM).y}get depth(){return this.source.getSize(HM).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let i=e[t];if(i===void 0){ot(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){ot(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==C0)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ch:e.x=e.x-Math.floor(e.x);break;case Mr:e.x=e.x<0?0:1;break;case fh: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 ch:e.y=e.y-Math.floor(e.y);break;case Mr:e.y=e.y<0?0:1;break;case fh: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++}};Bn.DEFAULT_IMAGE=null;Bn.DEFAULT_MAPPING=C0;Bn.DEFAULT_ANISOTROPY=1;var Nt=class n{constructor(e=0,t=0,i=0,r=1){n.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}
vendor: 5,515 bytes, line 9
9sub(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){let t=this.x,i=this.y,r=this.z,a=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*a,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*a,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*a,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let 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,a,c=e.elements,f=c[0],d=c[4],m=c[8],p=c[1],g=c[5],y=c[9],T=c[2],x=c[6],_=c[10];if(Math.abs(d-p)<.01&&Math.abs(m-T)<.01&&Math.abs(y-x)<.01){if(Math.abs(d+p)<.1&&Math.abs(m+T)<.1&&Math.abs(y+x)<.1&&Math.abs(f+g+_-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let S=(f+1)/2,E=(g+1)/2,C=(_+1)/2,D=(d+p)/4,U=(m+T)/4,w=(y+x)/4;return S>E&&S>C?S<.01?(i=0,r=.707106781,a=.707106781):(i=Math.sqrt(S),r=D/i,a=U/i):E>C?E<.01?(i=.707106781,r=0,a=.707106781):(r=Math.sqrt(E),i=D/r,a=w/r):C<.01?(i=.707106781,r=.707106781,a=0):(a=Math.sqrt(C),i=U/a,r=w/a),this.set(i,r,a,t),this}let b=Math.sqrt((x-y)*(x-y)+(m-T)*(m-T)+(p-d)*(p-d));return Math.abs(b)<.001&&(b=1),this.x=(x-y)/b,this.y=(m-T)/b,this.z=(p-d)/b,this.w=Math.acos((f+g+_-1)/2),this}setFromMatrixPosition(e){let 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=xt(this.x,e.x,t.x),this.y=xt(this.y,e.y,t.y),this.z=xt(this.z,e.z,t.z),this.w=xt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=xt(this.x,e,t),this.y=xt(this.y,e,t),this.z=xt(this.z,e,t),this.w=xt(this.w,e,t),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(xt(i,e,t))}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}},_h=class extends wa{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:dn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Nt(0,0,e,t),this.scissorTest=!1,this.viewport=new Nt(0,0,e,t),this.textures=[];let r={width:e,height:t,depth:i.depth},a=new Bn(r),o=i.count;for(let l=0;l<o;l++)this.textures[l]=a.clone(),this.textures[l].isRenderTargetTexture=!0,this.textures[l].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){let t={minFilter:dn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace
vendor: 7,805 bytes, line 9
9=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let r=Object.assign({},e.textures[t].image);this.textures[t].source=new mo(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},fr=class extends _h{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}},kc=class extends Bn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Yn,this.minFilter=Yn,this.wrapR=Mr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Vb=class extends fr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new kc(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},Fc=class extends Bn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=Yn,this.minFilter=Yn,this.wrapR=Mr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Gb=class extends fr{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new Fc(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},mt=class n{constructor(e,t,i,r,a,o,l,c,f,d,m,p,g,y,T,x){n.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,a,o,l,c,f,d,m,p,g,y,T,x)}set(e,t,i,r,a,o,l,c,f,d,m,p,g,y,T,x){let _=this.elements;return _[0]=e,_[4]=t,_[8]=i,_[12]=r,_[1]=a,_[5]=o,_[9]=l,_[13]=c,_[2]=f,_[6]=d,_[10]=m,_[14]=p,_[3]=g,_[7]=y,_[11]=T,_[15]=x,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 n().fromArray(this.elements)}copy(e){let 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){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let 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 this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(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){if(e.determinant()===0)return this.identity();let t=this.elements,i=e.elements,r=1/Gd.setFromMatrixColumn(e,0).length(),a=1/Gd.setFromMatrixColumn(e,1).length(),o=1/Gd.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]*a,t[5]=i[5]*a,t[6]=i[6]*a,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){let t=this.elements,i=e.x,r=e.y,a=e.z,o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),f=Math.sin(r),d=Math.cos(a),m=Math.sin(a);if(e.order==="XYZ"){let p=o*d,g=o*m,y=l*d,T=l*m;t[0]=c*d,t[4]=-c*m,t[8]=f,t[1]=g+y*f,t[5]=p-T*f,t[9]=-l*c,t[2]=T-p*f,t[6]=y+g*f,t[10]=o*c}else if(e.order==="YXZ"){let p=c*d,g=c*m,y=f*d,T=f*m;t[0]=p+T*l,t[4]=y*l-g,t[8]=o*f,t[1]=o*m,t[5]=o*d,t[9]=-l,t[2]=g*l-y,t[6]=T+p*l,t[10]=o*c}else if(e.order==="ZXY"){let p=c*d,g=c*m,y=f*d,T=f*m;t[0]=p-T*l,t[4]=-o*m,t[8]=y+g*l,t[1]=g+y*l,t[5]=o*d,t[9]=T-p*l,t[2]=-o*f,t[6]=l,t[10]=o*c}else if(e.order==="ZYX"){let p=o*d,g=o*m,y=l*d,T=l*m;t[0]=c*d,t[4]=y*f-g,t[8]=p*f+T,t[1]=c*m,t[5]=T*f+p,t[9]=g*f-y,t[2]=-f,t[6]=l*c,t[10]=o*c}else if(e.order==="YZX"){let p=o*c,g=o*f,y=l*c,T=l*f;t[0]=c*d,t[4]=T-p*m,t[8]=y*m+g,t[1]=m,t[5]=o*d,t[9]=-l*d,t[2]=-f*d,t[6]=g*m+y,t[10]=p-T*m}else if(e.order==="XZY"){let p=o*c,g=o*f,y=l*c,T=l*f;t[0]=c*d,t[4]=-m,t[8]=f*d,t[1]=p*m+T,t[5]=o*d,t[9]=g*m-y,t[2]=y*m-g,t[6]=l*d,t[10]=T*m+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(u6,e,c6)}lookAt(e,t,i){let r=this.elements;return Sa.subVectors(e,t),Sa.lengthSq()===0&&(Sa.z=1),Sa.normalize(),uu.crossVectors(i,Sa),uu.lengthSq()===0&&(Math.abs(i.z)===1?Sa.x+=1e-4:Sa.z+=1e-4,Sa.normalize(),uu.crossVectors(i,Sa)),uu.normalize(),Z_.crossVectors(Sa,uu),r[0]=uu.x,r[4]=Z_.x,r[8]=Sa.x,r[1]=uu.y,r[5]=Z_.y,r[9]=Sa.y,r[2]=uu.z,r[6]=Z_.z,r[10]=Sa.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,r=t.elements,a=this.elements,o=i[0],l=i[4],c=i[8],f=i[12],d=i[1],m=i[5],p=i[9],g=i[13],y=i[2],T=i[6],x=i[10],_=i[14],b=i[3],S=i[7],E=i[11],C=i[15],D=r[0],U=r[4],w=r[8],R=r[12],L=r[1],I=r[5],z=r[9],B=r[13],V=r[2],W=r[6],X=r[10],K=r[14],pe=r[3],Q=r[7],ee=r[11],G=r[15];return a[0]=o*D+l*L+c*V+f*pe,a[4]=o*U+l*I+c*W+f*Q,a[8]=o*w+l*z+c*X+f*ee,a[12]=o*R+l*B+c*K+f*G,a[1]=d*D+m*L+p*V+g*pe,a[5]=d*U+m*I+p*W+g*Q,a[9]=d*w+m*z+p*X+g*ee,a[13]=d*R+m*B+p*K+g*G,a[2]=y*D+T*L+x*V+_*pe,a[6]=y*U+T*I+x*W+_*Q,a[10]=y*w+T*z+x*X+_*ee,a[14]=y*R+T*B+x*K+_*G,a[3]=b*D+S*L+E*V+C*pe,a[7]=b*U+S*I+E*W+C*Q,a[11]=b*w+S*z+E*X+C*ee,a[15]=b*R+S*B+E*K+C*G,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],i=e[4],r=e[8],a=e[12],o=e[1],l=e[5],c=e[9],f=e[13],d=e[2],m=e[6],p=e[10],g=e[14],y=e[3],T=e[7],x=e[11],_=e[15],b=c*g-f*p,S=l*g-f*m,E=l*p-c*m,C=o*g-f*d,D=o*p-c*d,U=o*m-l*d;return t*(T*b-x*S+_*E)-i*(y*b-x*C+_*D)+r*(y*S-T*C+_*U)-a*(y*E-T*D+x*U)}transpose(){let e=this.elements,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){let 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(){let e=this.elements,t=e[0],i=e[1],r=e[2],a=e[3],o=e[4],l=e[5],c=e[6],f=e[7],d=e[8],m=e[9],p=e[10],g=e[11],y=e[12],T=e[13],x=e[14],_=e[15],b=t*l-i*o,S=t*c-r*o,E=t*f-a*o,C=i*c-r*l,D=i*f-a*l,U=r*f-a*c,w=d*T-m*y,R=d*x-p*y,L=d*_-g*y,I=m*x-p*T,z=m*_-g*T,B=p*_-g*x,V=b*B-S*z+E*I+C*L-D*R+U*w;if(V===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let W=1/V;
vendor: 16,848 bytes, line 9
9return e[0]=(l*B-c*z+f*I)*W,e[1]=(r*z-i*B-a*I)*W,e[2]=(T*U-x*D+_*C)*W,e[3]=(p*D-m*U-g*C)*W,e[4]=(c*L-o*B-f*R)*W,e[5]=(t*B-r*L+a*R)*W,e[6]=(x*E-y*U-_*S)*W,e[7]=(d*U-p*E+g*S)*W,e[8]=(o*z-l*L+f*w)*W,e[9]=(i*L-t*z-a*w)*W,e[10]=(y*D-T*E+_*b)*W,e[11]=(m*E-d*D-g*b)*W,e[12]=(l*R-o*I-c*w)*W,e[13]=(t*I-i*R+r*w)*W,e[14]=(T*S-y*C-x*b)*W,e[15]=(d*C-m*S+p*b)*W,this}scale(e){let t=this.elements,i=e.x,r=e.y,a=e.z;return t[0]*=i,t[4]*=r,t[8]*=a,t[1]*=i,t[5]*=r,t[9]*=a,t[2]*=i,t[6]*=r,t[10]*=a,t[3]*=i,t[7]*=r,t[11]*=a,this}getMaxScaleOnAxis(){let 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){let 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){let 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){let 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){let i=Math.cos(t),r=Math.sin(t),a=1-i,o=e.x,l=e.y,c=e.z,f=a*o,d=a*l;return this.set(f*o+i,f*l-r*c,f*c+r*l,0,f*l+r*c,d*l+i,d*c-r*o,0,f*c-r*l,d*c+r*o,a*c*c+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,a,o){return this.set(1,i,a,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){let r=this.elements,a=t._x,o=t._y,l=t._z,c=t._w,f=a+a,d=o+o,m=l+l,p=a*f,g=a*d,y=a*m,T=o*d,x=o*m,_=l*m,b=c*f,S=c*d,E=c*m,C=i.x,D=i.y,U=i.z;return r[0]=(1-(T+_))*C,r[1]=(g+E)*C,r[2]=(y-S)*C,r[3]=0,r[4]=(g-E)*D,r[5]=(1-(p+_))*D,r[6]=(x+b)*D,r[7]=0,r[8]=(y+S)*U,r[9]=(x-b)*U,r[10]=(1-(p+T))*U,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let a=this.determinant();if(a===0)return i.set(1,1,1),t.identity(),this;let o=Gd.set(r[0],r[1],r[2]).length(),l=Gd.set(r[4],r[5],r[6]).length(),c=Gd.set(r[8],r[9],r[10]).length();a<0&&(o=-o),co.copy(this);let f=1/o,d=1/l,m=1/c;return co.elements[0]*=f,co.elements[1]*=f,co.elements[2]*=f,co.elements[4]*=d,co.elements[5]*=d,co.elements[6]*=d,co.elements[8]*=m,co.elements[9]*=m,co.elements[10]*=m,t.setFromRotationMatrix(co),i.x=o,i.y=l,i.z=c,this}makePerspective(e,t,i,r,a,o,l=Yr,c=!1){let f=this.elements,d=2*a/(t-e),m=2*a/(i-r),p=(t+e)/(t-e),g=(i+r)/(i-r),y,T;if(c)y=a/(o-a),T=o*a/(o-a);else if(l===Yr)y=-(o+a)/(o-a),T=-2*o*a/(o-a);else if(l===xu)y=-o/(o-a),T=-o*a/(o-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return f[0]=d,f[4]=0,f[8]=p,f[12]=0,f[1]=0,f[5]=m,f[9]=g,f[13]=0,f[2]=0,f[6]=0,f[10]=y,f[14]=T,f[3]=0,f[7]=0,f[11]=-1,f[15]=0,this}makeOrthographic(e,t,i,r,a,o,l=Yr,c=!1){let f=this.elements,d=2/(t-e),m=2/(i-r),p=-(t+e)/(t-e),g=-(i+r)/(i-r),y,T;if(c)y=1/(o-a),T=o/(o-a);else if(l===Yr)y=-2/(o-a),T=-(o+a)/(o-a);else if(l===xu)y=-1/(o-a),T=-a/(o-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return f[0]=d,f[4]=0,f[8]=0,f[12]=p,f[1]=0,f[5]=m,f[9]=0,f[13]=g,f[2]=0,f[6]=0,f[10]=y,f[14]=T,f[3]=0,f[7]=0,f[11]=0,f[15]=1,this}equals(e){let 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){let 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}},Gd=new H,co=new mt,u6=new H(0,0,0),c6=new H(1,1,1),uu=new H,Z_=new H,Sa=new H,gL=new mt,vL=new ei,jr=class n{constructor(e=0,t=0,i=0,r=n.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){let r=e.elements,a=r[0],o=r[4],l=r[8],c=r[1],f=r[5],d=r[9],m=r[2],p=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(xt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,f),this._z=0);break;case"YXZ":this._x=Math.asin(-xt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(l,g),this._z=Math.atan2(c,f)):(this._y=Math.atan2(-m,a),this._z=0);break;case"ZXY":this._x=Math.asin(xt(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-m,g),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-xt(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(xt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-d,f),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(l,g));break;case"XZY":this._z=Math.asin(-xt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,f),this._y=Math.atan2(l,a)):(this._x=Math.atan2(-d,g),this._y=0);break;default:ot("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return gL.makeRotationFromQuaternion(e),this.setFromRotationMatrix(gL,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return vL.setFromEuler(this),this.setFromQuaternion(vL,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}};jr.DEFAULT_ORDER="XYZ";var Xo=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},f6=0,yL=new H,Wd=new ei,Bs=new mt,K_=new H,qm=new H,d6=new H,h6=new ei,_L=new H(1,0,0),bL=new H(0,1,0),xL=new H(0,0,1),SL={type:"added"},p6={type:"removed"},Xd={type:"childadded",child:null},VM={type:"childremoved",child:null},$t=class n extends wa{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:f6++}),this.uuid=Ea(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=n.DEFAULT_UP.clone();let e=new H,t=new jr,i=new ei,r=new H(1,1,1);function a(){i.setFromEuler(t,!1)}function o(){t.setFromQuaternion(i,void 0,!1)}t._onChange(a),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new mt},normalMatrix:{value:new Et}}),this.matrix=new mt,this.matrixWorld=new mt,this.matrixAutoUpdate=n.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=n.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Xo,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Wd.setFromAxisAngle(e,t),this.quaternion.multiply(Wd),this}rotateOnWorldAxis(e,t){return Wd.setFromAxisAngle(e,t),this.quaternion.premultiply(Wd),this}rotateX(e){return this.rotateOnAxis(_L,e)}rotateY(e){return this.rotateOnAxis(bL,e)}rotateZ(e){return this.rotateOnAxis(xL,e)}translateOnAxis(e,t){return yL.copy(e).applyQuaternion(this.quaternion),this.position.add(yL.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(_L,e)}translateY(e){return this.translateOnAxis(bL,e)}translateZ(e){return this.translateOnAxis(xL,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Bs.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?K_.copy(e):K_.set(e,t,i);let r=this.parent;this.updateWorldMatrix(!0,!1),qm.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Bs.lookAt(qm,K_,this.up):Bs.lookAt(K_,qm,this.up),this.quaternion.setFromRotationMatrix(Bs),r&&(Bs.extractRotation(r.matrixWorld),Wd.setFromRotationMatrix(Bs),this.quaternion.premultiply(Wd.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(pt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(SL),Xd.child=e,this.dispatchEvent(Xd),Xd.child=null):pt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(p6),VM.child=e,this.dispatchEvent(VM),VM.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Bs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Bs.multiply(e.parent.matrixWorld)),e.applyMatrix4(Bs),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(SL),Xd.child=e,this.dispatchEvent(Xd),Xd.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){let o=this.children[i].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);let r=this.children;for(let a=0,o=r.length;a<o;a++)r[a].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(qm,e,d6),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(qm,h6,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,i=e.y,r=e.z,a=this.matrix.elements;a[12]+=t-a[0]*t-a[4]*i-a[8]*r,a[13]+=i-a[1]*t-a[5]*i-a[9]*r,a[14]+=r-a[2]*t-a[6]*i-a[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){let i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){let r=this.children;for(let a=0,o=r.length;a<o;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(e){let t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),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.geometryInfo=this._geometryInfo.map(l=>({...l,boundingBox:l.boundingBox?l.boundingBox.toJSON():void 0,boundingSphere:l.boundingSphere?l.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(l=>({...l})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(l,c){return l[c.uuid]===void 0&&(l[c.uuid]=c.toJSON(e)),c.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=a(e.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let c=l.shapes;if(Array.isArray(c))for(let f=0,d=c.length;f<d;f++){let m=c[f];a(e.shapes,m)}else a(e.shapes,c)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let l=[];for(let c=0,f=this.material.length;c<f;c++)l.push(a(e.materials,this.material[c]));r.material=l}else r.material=a(e.materials,this.material);if(this.children.length>0){r.children=[];for(let l=0;l<this.children.length;l++)r.children.push(this.children[l].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let l=0;l<this.animations.length;l++){let c=this.animations[l];r.animations.push(a(e.animations,c))}}if(t){let l=o(e.geometries),c=o(e.materials),f=o(e.textures),d=o(e.images),m=o(e.shapes),p=o(e.skeletons),g=o(e.animations),y=o(e.nodes);l.length>0&&(i.geometries=l),c.length>0&&(i.materials=c),f.length>0&&(i.textures=f),d.length>0&&(i.images=d),m.length>0&&(i.shapes=m),p.length>
vendor: 8,238 bytes, line 9
90&&(i.skeletons=p),g.length>0&&(i.animations=g),y.length>0&&(i.nodes=y)}return i.object=r,i;function o(l){let c=[];for(let f in l){let d=l[f];delete d.metadata,c.push(d)}return c}}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),e.pivot!==null&&(this.pivot=e.pivot.clone()),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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){let r=e.children[i];this.add(r.clone())}return this}};$t.DEFAULT_UP=new H(0,1,0);$t.DEFAULT_MATRIX_AUTO_UPDATE=!0;$t.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Ys=class extends $t{constructor(){super(),this.isGroup=!0,this.type="Group"}},m6={type:"move"},Bc=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ys,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 Ys,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new H,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new H),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ys,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new H,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new H),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){let t=this._hand;if(t)for(let 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,a=null,o=null,l=this._targetRay,c=this._grip,f=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(let T of e.hand.values()){let x=t.getJointPose(T,i),_=this._getHandJoint(f,T);x!==null&&(_.matrix.fromArray(x.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=x.radius),_.visible=x!==null}let d=f.joints["index-finger-tip"],m=f.joints["thumb-tip"],p=d.position.distanceTo(m.position),g=.02,y=.005;f.inputState.pinching&&p>g+y?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&p<=g-y&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),a!==null&&(c.matrix.fromArray(a.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,a.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(a.linearVelocity)):c.hasLinearVelocity=!1,a.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(a.angularVelocity)):c.hasAngularVelocity=!1));l!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&a!==null&&(r=a),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(m6)))}return l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new Ys;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}},fP={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},cu={h:0,s:0,l:0},Q_={h:0,s:0,l:0};function GM(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}var tt=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){let 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=Oi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Pt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Pt.workingColorSpace){return this.r=e,this.g=t,this.b=i,Pt.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Pt.workingColorSpace){if(e=mw(e,1),t=xt(t,0,1),i=xt(i,0,1),t===0)this.r=this.g=this.b=i;else{let a=i<=.5?i*(1+t):i+t-i*t,o=2*i-a;this.r=GM(o,a,e+1/3),this.g=GM(o,a,e),this.b=GM(o,a,e-1/3)}return Pt.colorSpaceToWorking(this,r),this}setStyle(e,t=Oi){function i(a){a!==void 0&&parseFloat(a)<1&&ot("C
9olor: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let a,o=r[1],l=r[2];switch(o){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:ot("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let a=r[1],o=a.length;if(o===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(a,16),t);ot("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Oi){let i=fP[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ot("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=js(e.r),this.g=js(e.g),this.b=js(e.b),this}copyLinearToSRGB(e){return this.r=uh(e.r),this.g=uh(e.g),this.b=uh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Oi){return Pt.workingToColorSpace(ur.copy(this),e),Math.round(xt(ur.r*255,0,255))*65536+Math.round(xt(ur.g*255,0,255))*256+Math.round(xt(ur.b*255,0,255))}getHexString(e=Oi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Pt.workingColorSpace){Pt.workingToColorSpace(ur.copy(this),t);let i=ur.r,r=ur.g,a=ur.b,o=Math.max(i,r,a),l=Math.min(i,r,a),c,f,d=(l+o)/2;if(l===o)c=0,f=0;else{let m=o-l;switch(f=d<=.5?m/(o+l):m/(2-o-l),o){case i:c=(r-a)/m+(r<a?6:0);break;case r:c=(a-i)/m+2;break;case a:c=(i-r)/m+4;break}c/=6}return e.h=c,e.s=f,e.l=d,e}getRGB(e,t=Pt.workingColorSpace){return Pt.workingToColorSpace(ur.copy(this),t),e.r=ur.r,e.g=ur.g,e.b=ur.b,e}getStyle(e=Oi){Pt.workingToColorSpace(ur.copy(this),e);let t=ur.r,i=ur.g,r=ur.b;return e!==Oi?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(cu),this.setHSL(cu.h+e,cu.s+t,cu.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(cu),e.getHSL(Q_);let i=og(cu.h,Q_.h,t),r=og(cu.s,Q_.s,t),a=og(cu.l,Q_.l,t);return this.setHSL(i,r,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,r=this.b,a=e.elements;return this.r=a[0]*t+a[3]*i+a[6]*r,this.g=a[1]*t+a[4]*i+a[7]*r,this.b=a[2]*t+a[5]*i+a[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},ur=new tt;tt.NAMES=fP;var bg=class n{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new tt(e),this.density=t}clone(){return new n(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}},xg=class n{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new tt(e),this.near=t,this.far=i}clone(){return new n(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},Hc=class extends $t{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 jr,this.environmentIntensity=1,this.environmentRotation=new jr,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){let 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}},fo=new H,Hs=new H,WM=new H,Vs=new H,qd=new H,Yd=new H,TL=new H,XM=new H,qM=new H,YM=new H,jM=new Nt,ZM=new Nt,KM=new Nt,po=class n{constructor(e=new H,t=new H,i=new H){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),fo.subVectors(e,t),r.cross(fo);let a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,t,i,r,a){fo.subVectors(r,t),Hs.subVectors(i,t),WM.subVectors(e,t);let o=fo.dot(fo),l=fo.dot(Hs),c=fo.dot(WM),f=Hs.dot(Hs),d=Hs.dot(WM),m=o*f-l*l;if(m===0)return a.set(0,0,0),null;let p=1/m,g=(f*c-l*d)*p,y=(o*d-l*c)*p;return a.set(1-g-y,y,g)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Vs)===null?!1:Vs.x>=0&&Vs.y>=0&&Vs.x+Vs.y<=1}static getInterpolation(e,t,i,r,a,o,l,c){return this.getBarycoord(e,t,i,r,Vs)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(a,Vs.x),c.addScaledVector(o,Vs.y),c.addScaledVector(l,Vs.z),c)}static getInterpolatedAttribute(e,t,i,r,a,o){return jM.setScalar(0),ZM.setScalar(0),KM.setScalar(0),jM.fromBufferAttribute(e,t),ZM.fromBufferAttribute(e,i),KM.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(jM,a.x),o.addScaledVector(ZM,a.y),o.addScaledVector(KM,a.z),o}static isFrontFacing(e,t,i,r){return fo.subVectors(i,t),Hs.subVectors(e,t),fo.cross(Hs).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 fo.subVectors(this.c,this.b),Hs.subVectors(this.a,this.b),fo.cross(Hs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return n.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return n.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,a){return n.getInterpolation(e,this.a,this.b,this.c,t,i,r,a)}containsPoint(e){return n.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return n.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,r=this.b,a=this.c,o,l;qd.subVectors(r,i),Yd.subVectors(a,i),XM.subVectors(e,i);let c=qd.dot(XM),f=Yd.dot(XM);if(c<=0&&f<=0)return t.copy(i);qM.subVectors(e,r);let d=qd.dot(qM),m=Yd.dot(qM);if(d>=0&&m<=d)return t.copy(r);let p=c*m-d*f;if(p<=0&&c>=0&&d<=0)return o=c/(c-d),t.copy(i).addScaledVector(qd,o);YM.subVectors(e,a);let g=qd.dot(YM),y=Yd.dot(YM);if(y>=0&&g<=y)return t.copy(a);let T=g*f-c*y;if(T<=0&&f>=0&&y<=0)return l=f/(f-y),t.copy(i).addScaledVector(Yd,l);let x=d*y-g*m;if(x<=0&&m-d>=0&&g-y>=0)return TL.subVectors(a,r),l=(m-d)/(m-d+(g-y)),t.copy(r).addScaledVector(TL,l);let _=1/(x+T+p);return o=T*_,l=p*_,t.copy(i).addScaledVector(qd,o).addScaledVector(Yd,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},bn=class{constructor(e=new H(1/0,1/0,1/0),t=new H(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(ho.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(ho.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=ho.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(i!==void 0){let a=i.getAttribute("position");if(t===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let o=0,l=a.count;o<l;o++)e.isMesh===!0?e.getVertexPosition(o,ho):ho.fromBufferAttribute(a,o),ho.applyMatrix4(e.matrixWorld),this.expandByPoint(ho);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),J_.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),J_.copy(i.boundingBox)),J_.applyMatrix4(e.matrixWorld),this.union(J_)}let r=e.children;for(let a=0,o=r.length;a<o;a++)this.expandByObject(r[a],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,ho),ho.distanceToSquared(e.center)<=e.radius*e.radiu
vendor: 28,730 bytes, line 9
9s}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(Ym),$_.subVectors(this.max,Ym),jd.subVectors(e.a,Ym),Zd.subVectors(e.b,Ym),Kd.subVectors(e.c,Ym),fu.subVectors(Zd,jd),du.subVectors(Kd,Zd),Tc.subVectors(jd,Kd);let t=[0,-fu.z,fu.y,0,-du.z,du.y,0,-Tc.z,Tc.y,fu.z,0,-fu.x,du.z,0,-du.x,Tc.z,0,-Tc.x,-fu.y,fu.x,0,-du.y,du.x,0,-Tc.y,Tc.x,0];return!QM(t,jd,Zd,Kd,$_)||(t=[1,0,0,0,1,0,0,0,1],!QM(t,jd,Zd,Kd,$_))?!1:(eb.crossVectors(fu,du),t=[eb.x,eb.y,eb.z],QM(t,jd,Zd,Kd,$_))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ho).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ho).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:(Gs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Gs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Gs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Gs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Gs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Gs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Gs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Gs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Gs),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},Gs=[new H,new H,new H,new H,new H,new H,new H,new H],ho=new H,J_=new bn,jd=new H,Zd=new H,Kd=new H,fu=new H,du=new H,Tc=new H,Ym=new H,$_=new H,eb=new H,Ec=new H;function QM(n,e,t,i,r){for(let a=0,o=n.length-3;a<=o;a+=3){Ec.fromArray(n,a);let l=r.x*Math.abs(Ec.x)+r.y*Math.abs(Ec.y)+r.z*Math.abs(Ec.z),c=e.dot(Ec),f=t.dot(Ec),d=i.dot(Ec);if(Math.max(-Math.max(c,f,d),Math.min(c,f,d))>l)return!1}return!0}var qs=g6();function g6(){let n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let c=0;c<256;++c){let f=c-127;f<-27?(i[c]=0,i[c|256]=32768,r[c]=24,r[c|256]=24):f<-14?(i[c]=1024>>-f-14,i[c|256]=1024>>-f-14|32768,r[c]=-f-1,r[c|256]=-f-1):f<=15?(i[c]=f+15<<10,i[c|256]=f+15<<10|32768,r[c]=13,r[c|256]=13):f<128?(i[c]=31744,i[c|256]=64512,r[c]=24,r[c|256]=24):(i[c]=31744,i[c|256]=64512,r[c]=13,r[c|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let c=1;c<1024;++c){let f=c<<13,d=0;for(;(f&8388608)===0;)f<<=1,d-=8388608;f&=-8388609,d+=947912704,a[c]=f|d}for(let c=1024;c<2048;++c)a[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(l[c]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:o,offsetTable:l}}function qr(n){Math.abs(n)>65504&&ot("DataUtils.toHalfFloat(): Value out of range."),n=xt(n,-65504,65504),qs.floatView[0]=n;let e=qs.uint32View[0],t=e>>23&511;return qs.baseTable[t]+((e&8388607)>>qs.shiftTable[t])}function ig(n){let e=n>>10;return qs.uint32View[0]=qs.mantissaTable[qs.offsetTable[e]+(n&1023)]+qs.exponentTable[e],qs.floatView[0]}var Wb=class{static toHalfFloat(e){return qr(e)}static fromHalfFloat(e){return ig(e)}},fi=new H,tb=new Le,v6=0,an=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:v6++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=mh,this.updateRanges=[],this.gpuType=Yi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}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,a=this.itemSize;r<a;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)tb.fromBufferAttribute(this,t),tb.applyMatrix3(e),this.setXY(t,tb.x,tb.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyMatrix3(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyMatrix4(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.applyNormalMatrix(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)fi.fromBufferAttribute(this,t),fi.transformDirection(e),this.setXYZ(t,fi.x,fi.y,fi.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Er(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ot(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Er(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Er(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Er(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Er(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,a){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array),a=Ot(a,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==mh&&(e.usage=this.usage),e}},Xb=class extends an{constructor(e,t,i){super(new Int8Array(e),t,i)}},qb=class extends an{constructor(e,t,i){super(new Uint8Array(e),t,i)}},Yb=class extends an{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}},jb=class extends an{constructor(e,t,i){super(new Int16Array(e),t,i)}},bh=class extends an{constructor(e,t,i){super(new Uint16Array(e),t,i)}},Zb=class extends an{constructor(e,t,i){super(new Int32Array(e),t,i)}},xh=class extends an{constructor(e,t,i){super(new Uint32Array(e),t,i)}},Kb=class extends an{constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}getX(e){let t=ig(this.array[e*this.itemSize]);return this.normalized&&(t=Er(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=qr(t),this}getY(e){let t=ig(this.array[e*this.itemSize+1]);return this.normalized&&(t=Er(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+1]=qr(t),this}getZ(e){let t=ig(this.array[e*this.itemSize+2]);return this.normalized&&(t=Er(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+2]=qr(t),this}getW(e){let t=ig(this.array[e*this.itemSize+3]);return this.normalized&&(t=Er(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=qr(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array)),this.array[e+0]=qr(t),this.array[e+1]=qr(i),this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array)),this.array[e+0]=qr(t),this.array[e+1]=qr(i),this.array[e+2]=qr(r),this}setXYZW(e,t,i,r,a){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array),a=Ot(a,this.array)),this.array[e+0]=qr(t),this.array[e+1]=qr(i),this.array[e+2]=qr(r),this.array[e+3]=qr(a),this}},ut=class extends an{constructor(e,t,i){super(new Float32Array(e),t,i)}},y6=new bn,jm=new H,JM=new H,En=class{constructor(e=new H,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){let i=this.center;t!==void 0?i.copy(t):y6.setFromPoints(e).getCenter(i);let r=0;for(let a=0,o=e.length;a<o;a++)r=Math.max(r,i.distanceToSquared(e[a]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;jm.subVectors(e,this.center);let t=jm.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(jm,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):(JM.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(jm.copy(e.center).add(JM)),this.expandByPoint(jm.copy(e.center).sub(JM))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},_6=0,qa=new mt,$M=new $t,Qd=new H,Ta=new bn,Zm=new bn,Ui=new H,wt=class n extends wa{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:_6++}),this.uuid=Ea(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(V5(e)?xh:bh)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(i!==void 0){let a=new Et().getNormalMatrix(e);i.applyNormalMatrix(a),i.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return qa.makeRotationFromQuaternion(e),this.applyMatrix4(qa),this}rotateX(e){return qa.makeRotationX(e),this.applyMatrix4(qa),this}rotateY(e){return qa.makeRotationY(e),this.applyMatrix4(qa),this}rotateZ(e){return qa.makeRotationZ(e),this.applyMatrix4(qa),this}translate(e,t,i){return qa.makeTranslation(e,t,i),this.applyMatrix4(qa),this}scale(e,t,i){return qa.makeScale(e,t,i),this.applyMatrix4(qa),this}lookAt(e){return $M.lookAt(e),$M.updateMatrix(),this.applyMatrix4($M.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qd).negate(),this.translate(Qd.x,Qd.y,Qd.z),this}setFromPoints(e){let t=this.getAttribute("position");if(t===void 0){let i=[];for(let r=0,a=e.length;r<a;r++){let o=e[r];i.push(o.x,o.y,o.z||0)}this.setAttribute("position",new ut(i,3))}else{let i=Math.min(e.length,t.count);for(let r=0;r<i;r++){let a=e[r];t.setXYZ(r,a.x,a.y,a.z||0)}e.length>t.count&&ot("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new bn);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){pt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new H(-1/0,-1/0,-1/0),new H(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){let a=t[i];Ta.setFromBufferAttribute(a),this.morphTargetsRelative?(Ui.addVectors(this.boundingBox.min,Ta.min),this.boundingBox.expandByPoint(Ui),Ui.addVectors(this.boundingBox.max,Ta.max),this.boundingBox.expandByPoint(Ui)):(this.boundingBox.expandByPoint(Ta.min),this.boundingBox.expandByPoint(Ta.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&pt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new En);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){pt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new H,1/0);return}if(e){let i=this.boundingSphere.center;if(Ta.setFromBufferAttribute(e),t)for(let a=0,o=t.length;a<o;a++){let l=t[a];Zm.setFromBufferAttribute(l),this.morphTargetsRelative?(Ui.addVectors(Ta.min,Zm.min),Ta.expandByPoint(Ui),Ui.addVectors(Ta.max,Zm.max),Ta.expandByPoint(Ui)):(Ta.expandByPoint(Zm.min),Ta.expandByPoint(Zm.max))}Ta.getCenter(i);let r=0;for(let a=0,o=e.count;a<o;a++)Ui.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(Ui));if(t)for(let a=0,o=t.length;a<o;a++){let l=t[a],c=this.morphTargetsRelative;for(let f=0,d=l.count;f<d;f++)Ui.fromBufferAttribute(l,f),c&&(Qd.fromBufferAttribute(e,f),Ui.add(Qd)),r=Math.max(r,i.distanceToSquared(Ui))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&pt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){pt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let i=t.position,r=t.normal,a=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new an(new Float32Array(4*i.count),4));let o=this.getAttribute("tangent"),l=[],c=[];for(let w=0;w<i.count;w++)l[w]=new H,c[w]=new H;let f=new H,d=new H,m=new H,p=new Le,g=new Le,y=new Le,T=new H,x=new H;function _(w,R,L){f.fromBufferAttribute(i,w),d.fromBufferAttribute(i,R),m.fromBufferAttribute(i,L),p.fromBufferAttribute(a,w),g.fromBufferAttribute(a,R),y.fromBufferAttribute(a,L),d.sub(f),m.sub(f),g.sub(p),y.sub(p);let I=1/(g.x*y.y-y.x*g.y);isFinite(I)&&(T.copy(d).multiplyScalar(y.y).addScaledVector(m,-g.y).multiplyScalar(I),x.copy(m).multiplyScalar(g.x).addScaledVector(d,-y.x).multiplyScalar(I),l[w].add(T),l[R].add(T),l[L].add(T),c[w].add(x),c[R].add(x),c[L].add(x))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let w=0,R=b.length;w<R;++w){let L=b[w],I=L.start,z=L.count;for(let B=I,V=I+z;B<V;B+=3)_(e.getX(B+0),e.getX(B+1),e.getX(B+2))}let S=new H,E=new H,C=new H,D=new H;function U(w){C.fromBufferAttribute(r,w),D.copy(C);let R=l[w];S.copy(R),S.sub(C.multiplyScalar(C.dot(R))).normalize(),E.crossVectors(D,R);let I=E.dot(c[w])<0?-1:1;o.setXYZW(w,S.x,S.y,S.z,I)}for(let w=0,R=b.length;w<R;++w){let L=b[w],I=L.start,z=L.count;for(let B=I,V=I+z;B<V;B+=3)U(e.getX(B+0)),U(e.getX(B+1)),U(e.getX(B+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new an(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let p=0,g=i.count;p<g;p++)i.setXYZ(p,0,0,0);let r=new H,a=new H,o=new H,l=new H,c=new H,f=new H,d=new H,m=new H;if(e)for(let p=0,g=e.count;p<g;p+=3){let y=e.getX(p+0),T=e.getX(p+1),x=e.getX(p+2);r.fromBufferAttribute(t,y),a.fromBufferAttribute(t,T),o.fromBufferAttribute(t,x),d.subVectors(o,a),m.subVectors(r,a),d.cross(m),l.fromBufferAttribute(i,y),c.fromBufferAttribute(i,T),f.fromBufferAttribute(i,x),l.add(d),c.add(d),f.add(d),i.setXYZ(y,l.x,l.y,l.z),i.setXYZ(T,c.x,c.y,c.z),i.setXYZ(x,f.x,f.y,f.z)}else for(let p=0,g=t.count;p<g;p+=3)r.fromBufferAttribute(t,p+0),a.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,a),m.subVectors(r,a),d.cross(m),i.setXYZ(p+0,d.x,d.y,d.z),i.setXYZ(p+1,d.x,d.y,d.z),i.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Ui.fromBufferAttribute(e,t),Ui.normalize(),e.setXYZ(t,Ui.x,Ui.y,Ui.z)}toNonIndexed(){function e(l,c){let f=l.array,d=l.itemSize,m=l.normalized,p=new f.constructor(c.length*d),g=0,y=0;for(let T=0,x=c.length;T<x;T++){l.isInterleavedBufferAttribute?g=c[T]*l.data.stride+l.offset:g=c[T]*d;for(let _=0;_<d;_++)p[y++]=f[g++]}return new an(p,d,m)}if(this.index===null)return ot("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new n,i=this.index.array,r=this.attributes;for(let l in r){let c=r[l],f=e(c,i);t.setAttribute(l,f)}let a=this.morphAttributes;for(let l in a){let c=[],f=a[l];for(let d=0,m=f.length;d<m;d++){let p=f[d],g=e(p,i);c.push(g)}t.morphAttributes[l]=c}t.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let l=0,c=o.length;l<c;l++){let f=o[l];t.addGroup(f.start,f.count,f.materialIndex)}return t}toJSON(){let e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){let c=this.parameters;for(let f in c)c[f]!==void 0&&(e[f]=c[f]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let c in i){let f=i[c];e.data.attributes[c]=f.toJSON(e.data)}let r={},a=!1;for(let c in this.morphAttributes){let f=this.morphAttributes[c],d=[];for(let m=0,p=f.length;m<p;m++){let g=f[m];d.push(g.toJSON(e.data))}d.length>0&&(r[c]=d,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let l=this.boundingSphere;return l!==null&&(e.data.boundingSphere=l.toJSON()),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;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone());let r=e.attributes;for(let f in r){let d=r[f];this.setAttribute(f,d.clone(t))}let a=e.morphAttributes;for(let f in a){let d=[],m=a[f];for(let p=0,g=m.length;p<g;p++)d.push(m[p].clone(t));this.morphAttributes[f]=d}this.morphTargetsRelative=e.morphTargetsRelative;let o=e.groups;for(let f=0,d=o.length;f<d;f++){let m=o[f];this.addGroup(m.start,m.count,m.materialIndex)}let l=e.boundingBox;l!==null&&(this.boundingBox=l.clone());let c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},Vc=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=mh,this.updateRanges=[],this.version=0,this.uuid=Ea()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}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,a=this.stride;r<a;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ea()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Ea()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},Tr=new H,dr=class n{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)Tr.fromBufferAttribute(this,t),Tr.applyMatrix4(e),this.setXYZ(t,Tr.x,Tr.y,Tr.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)Tr.fromBufferAttribute(this,t),Tr.applyNormalMatrix(e),this.setXYZ(t,Tr.x,Tr.y,Tr.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)Tr.fromBufferAttribute(this,t),Tr.transformDirection(e),this.setXYZ(t,Tr.x,Tr.y,Tr.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=Er(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ot(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Er(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Er(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Er(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Er(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,a){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array),a=Ot(a,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=a,this}clone(e){if(e===void 0){vh("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let i=0;i<this.count;i++){let r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[r+a])}return new an(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new n(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){vh("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let i=0;i<this.count;i++){let r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[r+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},b6=0,bi=class extends wa{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:b6++}),this.uuid=Ea(),this.name="",this.type="Material",this.blending=_u,this.side=Go,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=ug,this.blendDst=cg,this.blendEquation=Zs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tt(0,0,0),this.blendAlpha=0,this.depthFunc=bu,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Hb,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=gu,this.stencilZFail=gu,this.stencilZPass=gu,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){ot(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){ot(`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){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 9,082 bytes, line 9
9i.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.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),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!==_u&&(i.blending=this.blending),this.side!==Go&&(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!==ug&&(i.blendSrc=this.blendSrc),this.blendDst!==cg&&(i.blendDst=this.blendDst),this.blendEquation!==Zs&&(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!==bu&&(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!==Hb&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==gu&&(i.stencilFail=this.stencilFail),this.stencilZFail!==gu&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==gu&&(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.allowOverride===!1&&(i.allowOverride=!1),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(a){let o=[];for(let l in a){let c=a[l];delete c.metadata,o.push(c)}return o}if(t){let a=r(e.textures),o=r(e.images);a.length>0&&(i.textures=a),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;let t=e.clippingPlanes,i=null;if(t!==null){let r=t.length;i=new Array(r);for(let a=0;a!==r;++a)i[a]=t[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 6,270 bytes, line 9
9adows,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.allowOverride=e.allowOverride,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++}},Sh=class extends bi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new tt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},Jd,Km=new H,$d=new H,eh=new H,th=new Le,Qm=new Le,dP=new mt,nb=new H,Jm=new H,ib=new H,EL=new Le,e2=new Le,ML=new Le,Sg=class extends $t{constructor(e=new Sh){if(super(),this.isSprite=!0,this.type="Sprite",Jd===void 0){Jd=new wt;let t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new Vc(t,5);Jd.setIndex([0,1,2,0,2,3]),Jd.setAttribute("position",new dr(i,3,0,!1)),Jd.setAttribute("uv",new dr(i,2,3,!1))}this.geometry=Jd,this.material=e,this.center=new Le(.5,.5),this.count=1}raycast(e,t){e.camera===null&&pt('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),$d.setFromMatrixScale(this.matrixWorld),dP.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),eh.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&$d.multiplyScalar(-eh.z);let i=this.material.rotation,r,a;i!==0&&(a=Math.cos(i),r=Math.sin(i));let o=this.center;rb(nb.set(-.5,-.5,0),eh,o,$d,r,a),rb(Jm.set(.5,-.5,0),eh,o,$d,r,a),rb(ib.set(.5,.5,0),eh,o,$d,r,a),EL.set(0,0),e2.set(1,0),ML.set(1,1);let l=e.ray.intersectTriangle(nb,Jm,ib,!1,Km);if(l===null&&(rb(Jm.set(-.5,.5,0),eh,o,$d,r,a),e2.set(0,1),l=e.ray.intersectTriangle(nb,ib,Jm,!1,Km),l===null))return;let c=e.ray.origin.distanceTo(Km);c<e.near||c>e.far||t.push({distance:c,point:Km.clone(),uv:po.getInterpolation(Km,nb,Jm,ib,EL,e2,ML,new Le),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 rb(n,e,t,i,r,a){th.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Qm.x=a*th.x-r*th.y,Qm.y=r*th.x+a*th.y):Qm.copy(th),n.copy(e),n.x+=Qm.x,n.y+=Qm.y,n.applyMatrix4(dP)}var ab=new H,wL=new H,Tg=class extends $t{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let i=0,r=t.length;i<r;i++){let a=t[i];this.addLevel(a.object.clone(),a.distance,a.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,i=0){t=Math.abs(t);let r=this.levels,a;for(a=0;a<r.length&&!(t<r[a].distance);a++);return r.splice(a,0,{distance:t,hysteresis:i,object:e}),this.add(e),this}removeLevel(e){let t=this.levels;for(let i=0;i<t.length;i++)if(t[i].distance===e){let r=t.splice(i,1);return this.remove(r[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){let t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r;i++){let a=t[i].distance;if(t[i].object.visible&&(a-=a*t[i].hysteresis),e<a)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){ab.setFromMatrixPosition(this.matrixWorld);let r=e.ray.origin.distanceTo(ab);this.getObjectForDistance(r).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){ab.setFromMatrixPosition(e.matrixWorld),wL.setFromMatrixPosition(this.matrixWorld);let i=ab.distanceTo(wL)/e.zoom;t[0].object.visible=!0;let r,a;for(r=1,a=t.length;r<a;r++){let o=t[r].distance;if(t[r].object.visible&&(o-=o*t[r].hysteresis),i>=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<a;r++)t[r].object.visible=!1}}toJSON(e){let t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];let i=this.levels;for(let r=0,a=i.length;r<a;r++){let o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}},Ws=new H,t2=new H,ob=new H,hu=new H,n2=new H,sb=new H,i2=new H,yo=class{constructor(e=new H,t=new H(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,Ws)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let 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){let t=Ws.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ws.copy(this.origin).addScaledVector(this.direction,t),Ws.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){t2.copy(e).add(t).multiplyScalar(.5),ob.copy(t).sub(e).normalize(),hu.copy(this.origin).sub(t2);let a=e.distanceTo(t)*.5,o=-this.direction.dot(ob),l=hu.dot(this.direction),c=-hu.dot(ob),f=hu.lengthSq(),d=Math.abs(1-o*o),m,p,g,y;if(d>0)if(m=o*c-l,p=o*l-c,y=a*d,m>=0)if(p>=-y)if(p<=y){let T=1/d;m*=T,p*=T,g=m*(m+o*p+2*l)+p*(o*m+p+2*c)+f}else p=a,m=Math.max(0,-(o*p+l)),g=-m*m+p*(p+2*c)+f;else p=-a,m=Math.max(0,-(o*p+l)),g=-m*m+p*(p+2*c)+f;else p<=-y?(m=Math.max(0,-(-o*a+l)),p=m>0?-a:Math.min(Math.max(-a,-c),a),g=-m*m+p*(p+2*c)+f):p<=y?(m=0,p=Math.min(Math.max(-a,-c),a),g=p*(p+2*c)+f):(m=Math.max(0,-(o*a+l)),p=m>0?a:Math.min(Math.max(-a,-c),a),g=-m*m+p*(p+2*c)+f);else p=o>0?-a:a,m=Math.max(0,-(o*p+l)),g=-m*m+p*(p+2*c)+f;
vendor: 5,277 bytes, line 9
9return i&&i.copy(this.origin).addScaledVector(this.direction,m),r&&r.copy(t2).addScaledVector(ob,p),g}intersectSphere(e,t){Ws.subVectors(e.center,this.origin);let i=Ws.dot(this.direction),r=Ws.dot(Ws)-i*i,a=e.radius*e.radius;if(r>a)return null;let o=Math.sqrt(a-r),l=i-o,c=i+o;return c<0?null:l<0?this.at(c,t):this.at(l,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,a,o,l,c,f=1/this.direction.x,d=1/this.direction.y,m=1/this.direction.z,p=this.origin;return f>=0?(i=(e.min.x-p.x)*f,r=(e.max.x-p.x)*f):(i=(e.max.x-p.x)*f,r=(e.min.x-p.x)*f),d>=0?(a=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(a=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),i>o||a>r||((a>i||isNaN(i))&&(i=a),(o<r||isNaN(r))&&(r=o),m>=0?(l=(e.min.z-p.z)*m,c=(e.max.z-p.z)*m):(l=(e.max.z-p.z)*m,c=(e.min.z-p.z)*m),i>c||l>r)||((l>i||i!==i)&&(i=l),(c<r||r!==r)&&(r=c),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Ws)!==null}intersectTriangle(e,t,i,r,a){n2.subVectors(t,e),sb.subVectors(i,e),i2.crossVectors(n2,sb);let o=this.direction.dot(i2),l;if(o>0){if(r)return null;l=1}else if(o<0)l=-1,o=-o;else return null;hu.subVectors(this.origin,e);let c=l*this.direction.dot(sb.crossVectors(hu,sb));if(c<0)return null;let f=l*this.direction.dot(n2.cross(hu));if(f<0||c+f>o)return null;let d=-l*hu.dot(i2);return d<0?null:this.at(d/o,a)}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)}},Aa=class extends bi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tt(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 jr,this.combine=qh,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}},AL=new mt,Mc=new yo,lb=new En,CL=new H,ub=new H,cb=new H,fb=new H,r2=new H,db=new H,RL=new H,hb=new H,ln=class extends $t{constructor(e=new wt,t=new Aa){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=r.length;a<o;a++){let l=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=a}}}}getVertexPosition(e,t){let i=this.geometry,r=i.attributes.position,a=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);let l=this.morphTargetInfluences;if(a&&l){db.set(0,0,0);for(let c=0,f=a.length;c<f;c++){let d=l[c],m=a[c];d!==0&&(r2.fromBufferAttribute(m,e),o?db.addScaledVector(r2,d):db.addScaledVector(r2.sub(t),d))}t.add(db)}return t}raycast(e,t){let i=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),lb.copy(i.boundingSphere),lb.applyMatrix4(a),Mc.copy(e.ray).recast(e.near),!(lb.containsPoint(Mc.origin)===!1&&(Mc.intersectSphere(lb,CL)===null||Mc.origin.distanceToSquared(CL)>(e.far-e.near)**2))&&(AL.copy(a).invert(),Mc.copy(e.ray).applyMatrix4(AL),!(i.boundingBox!==null&&Mc.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Mc)))}_computeIntersections(e,t,i){let r,a=this.geometry,o=this.material,l=a.index,c=a.attributes.position,f=a.attributes.uv,d=a.attributes.uv1,m=a.attributes.normal,p=a.groups,g=a.drawRange;if(l!==null)if(Array.isArray(o))for(let y=0,T=p.length;y<T;y++){let x=p[y],_=o[x.materialIndex],b=Math.max(x.start,g.start),S=Math.min(l.count,Math.min(x.start+x.count,g.start+g.count));for(let E=b,C=S;E<C;
vendor: 4,401 bytes, line 9
9E+=3){let D=l.getX(E),U=l.getX(E+1),w=l.getX(E+2);r=pb(this,_,e,i,f,d,m,D,U,w),r&&(r.faceIndex=Math.floor(E/3),r.face.materialIndex=x.materialIndex,t.push(r))}}else{let y=Math.max(0,g.start),T=Math.min(l.count,g.start+g.count);for(let x=y,_=T;x<_;x+=3){let b=l.getX(x),S=l.getX(x+1),E=l.getX(x+2);r=pb(this,o,e,i,f,d,m,b,S,E),r&&(r.faceIndex=Math.floor(x/3),t.push(r))}}else if(c!==void 0)if(Array.isArray(o))for(let y=0,T=p.length;y<T;y++){let x=p[y],_=o[x.materialIndex],b=Math.max(x.start,g.start),S=Math.min(c.count,Math.min(x.start+x.count,g.start+g.count));for(let E=b,C=S;E<C;E+=3){let D=E,U=E+1,w=E+2;r=pb(this,_,e,i,f,d,m,D,U,w),r&&(r.faceIndex=Math.floor(E/3),r.face.materialIndex=x.materialIndex,t.push(r))}}else{let y=Math.max(0,g.start),T=Math.min(c.count,g.start+g.count);for(let x=y,_=T;x<_;x+=3){let b=x,S=x+1,E=x+2;r=pb(this,o,e,i,f,d,m,b,S,E),r&&(r.faceIndex=Math.floor(x/3),t.push(r))}}}};function x6(n,e,t,i,r,a,o,l){let c;if(e.side===Ni?c=i.intersectTriangle(o,a,r,!0,l):c=i.intersectTriangle(r,a,o,e.side===Go,l),c===null)return null;hb.copy(l),hb.applyMatrix4(n.matrixWorld);let f=t.ray.origin.distanceTo(hb);return f<t.near||f>t.far?null:{distance:f,point:hb.clone(),object:n}}function pb(n,e,t,i,r,a,o,l,c,f){n.getVertexPosition(l,ub),n.getVertexPosition(c,cb),n.getVertexPosition(f,fb);let d=x6(n,e,t,i,ub,cb,fb,RL);if(d){let m=new H;po.getBarycoord(RL,ub,cb,fb,m),r&&(d.uv=po.getInterpolatedAttribute(r,l,c,f,m,new Le)),a&&(d.uv1=po.getInterpolatedAttribute(a,l,c,f,m,new Le)),o&&(d.normal=po.getInterpolatedAttribute(o,l,c,f,m,new H),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));let p={a:l,b:c,c:f,normal:new H,materialIndex:0};po.getNormal(ub,cb,fb,p.normal),d.face=p,d.barycoord=m}return d}var DL=new H,UL=new Nt,OL=new Nt,S6=new H,LL=new mt,mb=new H,a2=new En,NL=new mt,o2=new yo,Eg=class extends ln{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Fb,this.bindMatrix=new mt,this.bindMatrixInverse=new mt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new bn),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,mb),this.boundingBox.expandByPoint(mb)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new En),this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,mb),this.boundingSphere.expandByPoint(mb)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),a2.copy(this.boundingSphere),a2.applyMatrix4(r),e.ray.intersectsSphere(a2)!==!1&&(NL.copy(r).invert(),o2.copy(e.ray).applyMatrix4(NL),!(this.boundingBox!==null&&o2.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,o2)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new Nt,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);let a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Fb?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===tw?this.bindMatrixInverse.copy(this.bindMatrix).invert():ot("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let i=this.skeleton,r=this.geometry;UL.fromBufferAttribute(r.attributes.skinIndex,e),OL.fromBufferAttribute(r.attributes.skinWeight,e),DL.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let a=0;a<4;a++){let o=OL.getComponent(a);if(o!==0){let l=UL.getComponent(a);LL.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(S6.copy(DL).applyMatrix4(LL),o)}}
vendor: 54,144 bytes, line 9
9return t.applyMatrix4(this.bindMatrixInverse)}},Th=class extends $t{constructor(){super(),this.isBone=!0,this.type="Bone"}},wr=class extends Bn{constructor(e=null,t=1,i=1,r,a,o,l,c,f=Yn,d=Yn,m,p){super(null,o,l,c,f,d,r,a,m,p),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},PL=new mt,T6=new mt,Mg=class n{constructor(e=[],t=[]){this.uuid=Ea(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){ot("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new mt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let i=new mt;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){let e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let a=0,o=e.length;a<o;a++){let l=e[a]?e[a].matrixWorld:T6;PL.multiplyMatrices(l,t[a]),PL.toArray(i,a*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new n(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4);t.set(this.boneMatrices);let i=new wr(t,e,e,_i,Yi);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){let r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){let a=e.bones[i],o=t[a];o===void 0&&(ot("Skeleton: No bone found with UUID:",a),o=new Th),this.bones.push(o),this.boneInverses.push(new mt().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){let e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,i=this.boneInverses;for(let r=0,a=t.length;r<a;r++){let o=t[r];e.bones.push(o.uuid);let l=i[r];e.boneInverses.push(l.toArray())}return e}},_o=class extends an{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},nh=new mt,IL=new mt,gb=[],zL=new bn,E6=new mt,$m=new ln,eg=new En,wg=class extends ln{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new _o(new Float32Array(i*16),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,E6)}computeBoundingBox(){let e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new bn),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,nh),zL.copy(e.boundingBox).applyMatrix4(nh),this.boundingBox.union(zL)}computeBoundingSphere(){let e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new En),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,nh),eg.copy(e.boundingSphere).applyMatrix4(nh),this.boundingSphere.union(eg)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.previousInstanceMatrix!==null&&(this.previousInstanceMatrix=e.previousInstanceMatrix.clone()),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let i=t.morphTargetInfluences,r=this.morphTexture.source.data.data,a=i.length+1,o=e*a+1;for(let l=0;l<i.length;l++)i[l]=r[o+l]}raycast(e,t){let i=this.matrixWorld,r=this.count;if($m.geometry=this.geometry,$m.material=this.material,$m.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),eg.copy(this.boundingSphere),eg.applyMatrix4(i),e.ray.intersectsSphere(eg)!==!1))for(let a=0;a<r;a++){this.getMatrixAt(a,nh),IL.multiplyMatrices(i,nh),$m.matrixWorld=IL,$m.raycast(e,gb);for(let o=0,l=gb.length;o<l;o++){let c=gb[o];c.instanceId=a,c.object=this,t.push(c)}gb.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new _o(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){let i=t.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new wr(new Float32Array(r*this.count),r,this.count,O0,Yi));let a=this.morphTexture.source.data.data,o=0;for(let f=0;f<i.length;f++)o+=i[f];let l=this.geometry.morphTargetsRelative?1:1-o,c=r*e;a[c]=l,a.set(i,c+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}},s2=new H,M6=new H,w6=new Et,qi=class{constructor(e=new H(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){let r=s2.subVectors(i,t).cross(M6.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let 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){let i=e.delta(s2),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/r;return a<0||a>1?null:t.copy(e.start).addScaledVector(i,a)}intersectsLine(e){let 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){let i=t||w6.getNormalMatrix(e),r=this.coplanarPoint(s2).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(a),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)}},wc=new En,A6=new Le(.5,.5),vb=new H,Ks=class{constructor(e=new qi,t=new qi,i=new qi,r=new qi,a=new qi,o=new qi){this.planes=[e,t,i,r,a,o]}set(e,t,i,r,a,o){let l=this.planes;return l[0].copy(e),l[1].copy(t),l[2].copy(i),l[3].copy(r),l[4].copy(a),l[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Yr,i=!1){let r=this.planes,a=e.elements,o=a[0],l=a[1],c=a[2],f=a[3],d=a[4],m=a[5],p=a[6],g=a[7],y=a[8],T=a[9],x=a[10],_=a[11],b=a[12],S=a[13],E=a[14],C=a[15];if(r[0].setComponents(f-o,g-d,_-y,C-b).normalize(),r[1].setComponents(f+o,g+d,_+y,C+b).normalize(),r[2].setComponents(f+l,g+m,_+T,C+S).normalize(),r[3].setComponents(f-l,g-m,_-T,C-S).normalize(),i)r[4].setComponents(c,p,x,E).normalize(),r[5].setComponents(f-c,g-p,_-x,C-E).normalize();else if(r[4].setComponents(f-c,g-p,_-x,C-E).normalize(),t===Yr)r[5].setComponents(f+c,g+p,_+x,C+E).normalize();else if(t===xu)r[5].setComponents(c,p,x,E).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(),wc.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),wc.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(wc)}intersectsSprite(e){wc.center.set(0,0,0);let t=A6.distanceTo(e.center);return wc.radius=.7071067811865476+t,wc.applyMatrix4(e.matrixWorld),this.intersectsSphere(wc)}intersectsSphere(e){let t=this.planes,i=e.center,r=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let r=t[i];if(vb.x=r.normal.x>0?e.max.x:e.min.x,vb.y=r.normal.y>0?e.max.y:e.min.y,vb.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(vb)<0)return!1}return!0}containsPoint(e){let 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)}},Bo=new mt,Ho=new Ks,Ag=class n{constructor(){this.coordinateSystem=Yr}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){let r=t.cameras[i];if(Bo.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ho.setFromProjectionMatrix(Bo,r.coordinateSystem,r.reversedDepth),Ho.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){let r=t.cameras[i];if(Bo.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ho.setFromProjectionMatrix(Bo,r.coordinateSystem,r.reversedDepth),Ho.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){let r=t.cameras[i];if(Bo.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ho.setFromProjectionMatrix(Bo,r.coordinateSystem,r.reversedDepth),Ho.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){let r=t.cameras[i];if(Bo.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ho.setFromProjectionMatrix(Bo,r.coordinateSystem,r.reversedDepth),Ho.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let i=0;i<t.cameras.length;i++){let r=t.cameras[i];if(Bo.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Ho.setFromProjectionMatrix(Bo,r.coordinateSystem,r.reversedDepth),Ho.containsPoint(e))return!0}return!1}clone(){return new n}};function l2(n,e){return n-e}function C6(n,e){return n.z-e.z}function R6(n,e){return e.z-n.z}var x2=class{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,r){let a=this.pool,o=this.list;this.index>=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});let l=a[this.index];o.push(l),this.index++,l.start=e,l.count=t,l.z=i,l.index=r}reset(){this.list.length=0,this.index=0}},Xr=new mt,D6=new tt(1,1,1),kL=new Ks,U6=new Ag,yb=new bn,Ac=new En,tg=new H,FL=new H,O6=new H,u2=new x2,cr=new ln,_b=[];function L6(n,e,t=0){let i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){let r=n.count;for(let a=0;a<r;a++)for(let o=0;o<i;o++)e.setComponent(a+t,o,n.getComponent(a,o))}else e.array.set(n.array,t*i);e.needsUpdate=!0}function Cc(n,e){if(n.constructor!==e.constructor){let t=Math.min(n.length,e.length);for(let i=0;i<t;i++)e[i]=n[i]}else{let t=Math.min(n.length,e.length);e.set(new n.constructor(n.buffer,0,t))}}var Cg=class extends ln{constructor(e,t,i=t*2,r){super(new wt,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);let t=new Float32Array(e*e*4),i=new wr(t,e,e,_i,Yi);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);let t=new Uint32Array(e*e),i=new wr(t,e,e,Kh,Ra);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);let t=new Float32Array(e*e*4).fill(1),i=new wr(t,e,e,_i,Yi);i.colorSpace=Pt.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){let t=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(let a in e.attributes){let o=e.getAttribute(a),{array:l,itemSize:c,normalized:f}=o,d=new l.constructor(i*c),m=new an(d,c,f);t.setAttribute(a,m)}if(e.getIndex()!==null){let a=i>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new an(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);let r=e.getAttribute(i),a=t.getAttribute(i);if(r.itemSize!==a.itemSize||r.normalized!==a.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new bn);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;let a=t[i].geometryIndex;this.getMatrixAt(i,Xr),this.getBoundingBoxAt(a,yb).applyMatrix4(Xr),e.union(yb)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new En);let e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let i=0,r=t.length;i<r;i++){if(t[i].active===!1)continue;let a=t[i].geometryIndex;this.getMatrixAt(i,Xr),this.getBoundingSphereAt(a,Ac).applyMatrix4(Xr),e.union(Ac)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");let i={visible:!0,active:!0,geometryIndex:e},r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(l2),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=i):(r=this._instanceInfo.length,this._instanceInfo.push(i));let a=this._matricesTexture;Xr.identity().toArray(a.image.data,r*16),a.needsUpdate=!0;let o=this._colorsTexture;return o&&(D6.toArray(o.image.data,r*4),o.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute("position").count:t;let o=e.getIndex();if(o!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=i===-1?o.count:i),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let c;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(l2),c=this._availableGeometryIds.shift(),a[c]=r):(c=this._geometryCount,this._geometryCount++,a.push(r)),this.setGeometryAt(c,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,c}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);let i=this.geometry,r=i.getIndex()!==null,a=i.getIndex(),o=t.getIndex(),l=this._geometryInfo[e];if(r&&o.count>l.reservedIndexCount||t.attributes.position.count>l.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let c=l.vertexStart,f=l.reservedVertexCount;l.vertexCount=t.getAttribute("position").count;for(let d in i.attributes){let m=t.getAttribute(d),p=i.getAttribute(d);L6(m,p,c);let g=m.itemSize;for(let y=m.count,T=f;y<T;y++){let x=c+y;for(let _=0;_<g;_++)p.setComponent(x,_,0)}p.needsUpdate=!0,p.addUpdateRange(c*g,f*g)}if(r){let d=l.indexStart,m=l.reservedIndexCount;l.indexCount=t.getIndex().count;for(let p=0;p<o.count;p++)a.setX(d+p,c+o.getX(p));for(let p=o.count,g=m;p<g;p++)a.setX(d+p,c);a.needsUpdate=!0,a.addUpdateRange(d,l.reservedIndexCount)}return l.start=r?l.indexStart:l.vertexStart,l.count=r?l.indexCount:l.vertexCount,l.boundingBox=null,t.boundingBox!==null&&(l.boundingBox=t.boundingBox.clone()),l.boundingSphere=null,t.boundingSphere!==null&&(l.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){let t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;let i=this._instanceInfo;for(let r=0,a=i.length;r<a;r++)i[r].active&&i[r].geometryIndex===e&&this.deleteInstance(r);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0,i=this._geometryInfo,r=i.map((o,l)=>l).sort((o,l)=>i[o].vertexStart-i[l].vertexStart),a=this.geometry;for(let o=0,l=i.length;o<l;o++){let c=r[o],f=i[c];if(f.active!==!1){if(a.index!==null){if(f.indexStart!==t){let{indexStart:d,vertexStart:m,reservedIndexCount:p}=f,g=a.index,y=g.array,T=e-m;for(let x=d;x<d+p;x++)y[x]=y[x]+T;g.array.copyWithin(t,d,d+p),g.addUpdateRange(t,p),g.needsUpdate=!0,f.indexStart=t}t+=f.reservedIndexCount}if(f.vertexStart!==e){let{vertexStart:d,reservedVertexCount:m}=f,p=a.attributes;for(let g in p){let y=p[g],{array:T,itemSize:x}=y;T.copyWithin(e*x,d*x,(d+m)*x),y.addUpdateRange(e*x,m*x),y.needsUpdate=!0}f.vertexStart=e}e+=f.reservedVertexCount,f.start=a.index?f.indexStart:f.vertexStart}}return this._nextIndexStart=t,this._nextVertexStart=e,this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;let i=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){let a=new bn,o=i.index,l=i.attributes.position;for(let c=r.start,f=r.start+r.count;c<f;c++){let d=c;o&&(d=o.getX(d)),a.expandByPoint(tg.fromBufferAttribute(l,d))}r.boundingBox=a}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;let i=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){let a=new En;this.getBoundingBoxAt(e,yb),yb.getCenter(a.center);let o=i.index,l=i.attributes.position,c=0;for(let f=r.start,d=r.start+r.count;f<d;f++){let m=f;o&&(m=o.getX(m)),tg.fromBufferAttribute(l,m),c=Math.max(c,a.center.distanceToSquared(tg))}a.radius=Math.sqrt(c),r.boundingSphere=a}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);let i=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),i.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);let i=this._geometryInfo[e];return t.vertexStart=i.vertexStart,t.vertexCount=i.vertexCount,t.reservedVertexCount=i.reservedVertexCount,t.indexStart=i.indexStart,t.indexCount=i.indexCount,t.reservedIndexCount=i.reservedIndexCount,t.start=i.start,t.count=i.count,t}setInstanceCount(e){let t=this._availableInstanceIds,i=this._instanceInfo;for(t.sort(l2);t[t.length-1]===i.length-1;)i.pop(),t.pop();if(e<i.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);let r=new Int32Array(e),a=new Int32Array(e);Cc(this._multiDrawCounts,r),Cc(this._multiDrawStarts,a),this._multiDrawCounts=r,this._multiDrawStarts=a,this._maxInstanceCount=e;let o=this._indirectTexture,l=this._matricesTexture,c=this._colorsTexture;o.dispose(),this._initIndirectTexture(),Cc(o.image.data,this._indirectTexture.image.data),l.dispose(),this._initMatricesTexture(),Cc(l.image.data,this._matricesTexture.image.data),c&&(c.dispose(),this._initColorsTexture(),Cc(c.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){let i=[...this._geometryInfo].filter(l=>l.active);if(Math.max(...i.map(l=>l.vertexStart+l.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(c=>c.indexStart+c.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);let a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new wt,this._initializeGeometry(a));let o=this.geometry;a.index&&Cc(a.index.array,o.index.array);for(let l in a.attributes)Cc(a.attributes[l].array,o.attributes[l].array)}raycast(e,t){let i=this._instanceInfo,r=this._geometryInfo,a=this.matrixWorld,o=this.geometry;cr.material=this.material,cr.geometry.index=o.index,cr.geometry.attributes=o.attributes,cr.geometry.boundingBox===null&&(cr.geometry.boundingBox=new bn),cr.geometry.boundingSphere===null&&(cr.geometry.boundingSphere=new En);for(let l=0,c=i.length;l<c;l++){if(!i[l].visible||!i[l].active)continue;let f=i[l].geometryIndex,d=r[f];cr.geometry.setDrawRange(d.start,d.count),this.getMatrixAt(l,cr.matrixWorld).premultiply(a),this.getBoundingBoxAt(f,cr.geometry.boundingBox),this.getBoundingSphereAt(f,cr.geometry.boundingSphere),cr.raycast(e,_b);for(let m=0,p=_b.length;m<p;m++){let g=_b[m];g.object=this,g.batchId=l,t.push(g)}_b.length=0}cr.material=null,cr.geometry.index=null,cr.geometry.attributes={},cr.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.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(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,r,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let o=r.getIndex(),l=o===null?1:o.array.BYTES_PER_ELEMENT,c=1;a.wireframe&&(c=2,l=r.attributes.position.count>65535?4:2);let f=this._instanceInfo,d=this._multiDrawStarts,m=this._multiDrawCounts,p=this._geometryInfo,g=this.perObjectFrustumCulled,y=this._indirectTexture,T=y.image.data,x=i.isArrayCamera?U6:kL;g&&!i.isArrayCamera&&(Xr.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),kL.setFromProjectionMatrix(Xr,i.coordinateSystem,i.reversedDepth));let _=0;if(this.sortObjects){Xr.copy(this.matrixWorld).invert(),tg.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Xr),FL.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Xr);for(let E=0,C=f.length;E<C;E++)if(f[E].visible&&f[E].active){let D=f[E].geometryIndex;this.getMatrixAt(E,Xr),this.getBoundingSphereAt(D,Ac).applyMatrix4(Xr);let U=!1;if(g&&(U=!x.intersectsSphere(Ac,i)),!U){let w=p[D],R=O6.subVectors(Ac.center,tg).dot(FL);u2.push(w.start,w.count,R,E)}}let b=u2.list,S=this.customSort;S===null?b.sort(a.transparent?R6:C6):S.call(this,b,i);for(let E=0,C=b.length;E<C;E++){let D=b[E];d[_]=D.start*l*c,m[_]=D.count*c,T[_]=D.index,_++}u2.reset()}else for(let b=0,S=f.length;b<S;b++)if(f[b].visible&&f[b].active){let E=f[b].geometryIndex,C=!1;if(g&&(this.getMatrixAt(b,Xr),this.getBoundingSphereAt(E,Ac).applyMatrix4(Xr),C=!x.intersectsSphere(Ac,i)),!C){let D=p[E];d[_]=D.start*l*c,m[_]=D.count*c,T[_]=b,_++}}y.needsUpdate=!0,this._multiDrawCount=_,this._visibilityChanged=!1}onBeforeShadow(e,t,i,r,a,o){this.onBeforeRender(e,null,r,a,o)}},Li=class extends bi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},Qb=new H,Jb=new H,BL=new mt,ng=new yo,bb=new En,c2=new H,HL=new H,bo=class extends $t{constructor(e=new wt,t=new Li){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,i=[0];for(let r=1,a=t.count;r<a;r++)Qb.fromBufferAttribute(t,r-1),Jb.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Qb.distanceTo(Jb);e.setAttribute("lineDistance",new ut(i,1))}else ot("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let i=this.geometry,r=this.matrixWorld,a=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),bb.copy(i.boundingSphere),bb.applyMatrix4(r),bb.radius+=a,e.ray.intersectsSphere(bb)===!1)return;BL.copy(r).invert(),ng.copy(e.ray).applyMatrix4(BL);let l=a/((this.scale.x+this.scale.y+this.scale.z)/3),c=l*l,f=this.isLineSegments?2:1,d=i.index,p=i.attributes.position;if(d!==null){let g=Math.max(0,o.start),y=Math.min(d.count,o.start+o.count);for(let T=g,x=y-1;T<x;T+=f){let _=d.getX(T),b=d.getX(T+1),S=xb(this,e,ng,c,_,b,T);S&&t.push(S)}if(this.isLineLoop){let T=d.getX(y-1),x=d.getX(g),_=xb(this,e,ng,c,T,x,y-1);_&&t.push(_)}}else{let g=Math.max(0,o.start),y=Math.min(p.count,o.start+o.count);for(let T=g,x=y-1;T<x;T+=f){let _=xb(this,e,ng,c,T,T+1,T);_&&t.push(_)}if(this.isLineLoop){let T=xb(this,e,ng,c,y-1,g,y-1);T&&t.push(T)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=r.length;a<o;a++){let l=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=a}}}}};function xb(n,e,t,i,r,a,o){let l=n.geometry.attributes.position;if(Qb.fromBufferAttribute(l,r),Jb.fromBufferAttribute(l,a),t.distanceSqToSegment(Qb,Jb,c2,HL)>i)return;c2.applyMatrix4(n.matrixWorld);let f=e.ray.origin.distanceTo(c2);if(!(f<e.near||f>e.far))return{distance:f,point:HL.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}var VL=new H,GL=new H,Ca=class extends bo{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,i=[];for(let r=0,a=t.count;r<a;r+=2)VL.fromBufferAttribute(t,r),GL.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+VL.distanceTo(GL);e.setAttribute("lineDistance",new ut(i,1))}else ot("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},Rg=class extends bo{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}},Eh=class extends bi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},WL=new mt,S2=new yo,Sb=new En,Tb=new H,Dg=class extends $t{constructor(e=new wt,t=new Eh){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let i=this.geometry,r=this.matrixWorld,a=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Sb.copy(i.boundingSphere),Sb.applyMatrix4(r),Sb.radius+=a,e.ray.intersectsSphere(Sb)===!1)return;WL.copy(r).invert(),S2.copy(e.ray).applyMatrix4(WL);let l=a/((this.scale.x+this.scale.y+this.scale.z)/3),c=l*l,f=i.index,m=i.attributes.position;if(f!==null){let p=Math.max(0,o.start),g=Math.min(f.count,o.start+o.count);for(let y=p,T=g;y<T;y++){let x=f.getX(y);Tb.fromBufferAttribute(m,x),XL(Tb,x,c,r,e,t,this)}}else{let p=Math.max(0,o.start),g=Math.min(m.count,o.start+o.count);for(let y=p,T=g;y<T;y++)Tb.fromBufferAttribute(m,y),XL(Tb,y,c,r,e,t,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,o=r.length;a<o;a++){let l=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=a}}}}};function XL(n,e,t,i,r,a,o){let l=S2.distanceSqToPoint(n);if(l<t){let c=new H;S2.closestPointToPoint(n,c),c.applyMatrix4(i);let f=r.ray.origin.distanceTo(c);if(f<r.near||f>r.far)return;a.push({distance:f,distanceToRay:Math.sqrt(l),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}var Ug=class extends Bn{constructor(e,t,i,r,a=dn,o=dn,l,c,f){super(e,t,i,r,a,o,l,c,f),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let d=this;function m(){d.needsUpdate=!0,d._requestVideoFrameCallbackId=e.requestVideoFrameCallback(m)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(m))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}},$b=class extends Ug{constructor(e,t,i,r,a,o,l,c){super({},e,t,i,r,a,o,l,c),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}},ex=class extends Bn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Yn,this.minFilter=Yn,this.generateMipmaps=!1,this.needsUpdate=!0}},Gc=class extends Bn{constructor(e,t,i,r,a,o,l,c,f,d,m,p){super(null,o,l,c,f,d,r,a,m,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},tx=class extends Gc{constructor(e,t,i,r,a,o){super(e,t,i,a,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Mr,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},nx=class extends Gc{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Eo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},Tu=class extends Bn{constructor(e=[],t=Eo,i,r,a,o,l,c,f,d){super(e,t,i,r,a,o,l,c,f,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},ix=class extends Bn{constructor(e,t,i,r,a,o,l,c,f){super(e,t,i,r,a,o,l,c,f),this.isCanvasTexture=!0,this.needsUpdate=!0}},Qs=class extends Bn{constructor(e,t,i=Ra,r,a,o,l=Yn,c=Yn,f,d=vo,m=1){if(d!==vo&&d!==sl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");let p={width:e,height:t,depth:m};super(p,r,a,o,l,c,d,i,f),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new mo(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Og=class extends Qs{constructor(e,t=Ra,i=Eo,r,a,o=Yn,l=Yn,c,f=vo){let d={width:e,height:e,depth:1},m=[d,d,d,d,d,d];super(e,e,t,i,r,a,o,l,c,f),this.image=m,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},Mh=class extends Bn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},Eu=class n extends wt{constructor(e=1,t=1,i=1,r=1,a=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:a,depthSegments:o};let l=this;r=Math.floor(r),a=Math.floor(a),o=Math.floor(o);let c=[],f=[],d=[],m=[],p=0,g=0;y("z","y","x",-1,-1,i,t,e,o,a,0),y("z","y","x",1,-1,i,t,-e,o,a,1),y("x","z","y",1,1,e,i,t,r,o,2),y("x","z","y",1,-1,e,i,-t,r,o,3),y("x","y","z",1,-1,e,t,i,r,a,4),y("x","y","z",-1,-1,e,t,-i,r,a,5),this.setIndex(c),this.setAttribute("position",new ut(f,3)),this.setAttribute("normal",new ut(d,3)),this.setAttribute("uv",new ut(m,2));function y(T,x,_,b,S,E,C,D,U,w,R){let L=E/U,I=C/w,z=E/2,B=C/2,V=D/2,W=U+1,X=w+1,K=0,pe=0,Q=new H;for(let ee=0;ee<X;ee++){let G=ee*I-B;for(let Z=0;Z<W;Z++){let ne=Z*L-z;Q[T]=ne*b,Q[x]=G*S,Q[_]=V,f.push(Q.x,Q.y,Q.z),Q[T]=0,Q[x]=0,Q[_]=D>0?1:-1,d.push(Q.x,Q.y,Q.z),m.push(Z/U),m.push(1-ee/w),K+=1}}for(let ee=0;ee<w;ee++)for(let G=0;G<U;G++){let Z=p+G+W*ee,ne=p+G+W*(ee+1),he=p+(G+1)+W*(ee+1),se=p+(G+1)+W*ee;c.push(Z,ne,se),c.push(ne,he,se),pe+=6}l.addGroup(g,pe,R),g+=pe,p+=K}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}},Lg=class n extends wt{constructor(e=1,t=1,i=4,r=8,a=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:r,heightSegments:a},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),a=Math.max(1,Math.floor(a));let o=[],l=[],c=[],f=[],d=t/2,m=Math.PI/2*e,p=t,g=2*m+p,y=i*2+a,T=r+1,x=new H,_=new H;for(let b=0;b<=y;b++){let S=0,E=0,C=0,D=0;if(b<=i){let R=b/i,L=R*Math.PI/2;E=-d-e*Math.cos(L),C=e*Math.sin(L),D=-e*Math.cos(L),S=R*m}else if(b<=i+a){let R=(b-i)/a;E=-d+R*t,C=e,D=0,S=m+R*p}else{let R=(b-i-a)/i,L=R*Math.PI/2;E=d+e*Math.sin(L),C=e*Math.cos(L),D=e*Math.sin(L),S=m+p+R*m}let U=Math.max(0,Math.min(1,S/g)),w=0;b===0?w=.5/r:b===y&&(w=-.5/r);for(let R=0;R<=r;R++){let L=R/r,I=L*Math.PI*2,z=Math.sin(I),B=Math.cos(I);_.x=-C*B,_.y=E,_.z=C*z,l.push(_.x,_.y,_.z),x.set(-C*B,D,C*z),x.normalize(),c.push(x.x,x.y,x.z),f.push(L+w,U)}if(b>0){let R=(b-1)*T;for(let L=0;L<r;L++){let I=R+L,z=R+L+1,B=b*T+L,V=b*T+L+1;o.push(I,z,B),o.push(z,V,B)}}}this.setIndex(o),this.setAttribute("position",new ut(l,3)),this.setAttribute("normal",new ut(c,3)),this.setAttribute("uv",new ut(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}},Ng=class n extends wt{constructor(e=1,t=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);let a=[],o=[],l=[],c=[],f=new H,d=new Le;o.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(let m=0,p=3;m<=t;m++,p+=3){let g=i+m/t*r;f.x=e*Math.cos(g),f.y=e*Math.sin(g),o.push(f.x,f.y,f.z),l.push(0,0,1),d.x=(o[p]/e+1)/2,d.y=(o[p+1]/e+1)/2,c.push(d.x,d.y)}for(let m=1;m<=t;m++)a.push(m,m+1,0);this.setIndex(a),this.setAttribute("position",new ut(o,3)),this.setAttribute("normal",new ut(l,3)),this.setAttribute("uv",new ut(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.radius,e.segments,e.thetaStart,e.thetaLength)}},Wc=class n extends wt{constructor(e=1,t=1,i=1,r=32,a=1,o=!1,l=0,c=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:a,openEnded:o,thetaStart:l,thetaLength:c};let f=this;r=Math.floor(r),a=Math.floor(a);let d=[],m=[],p=[],g=[],y=0,T=[],x=i/2,_=0;b(),o===!1&&(e>0&&S(!0),t>0&&S(!1)),this.setIndex(d),this.setAttribute("position",new ut(m,3)),this.setAttribute("normal",new ut(p,3)),this.setAttribute("uv",new ut(g,2));function b(){let E=new H,C=new H,D=0,U=(t-e)/i;for(let w=0;w<=a;w++){let R=[],L=w/a,I=L*(t-e)+e;for(let z=0;z<=r;z++){let B=z/r,V=B*c+l,W=Math.sin(V),X=Math.cos(V);C.x=I*W,C.y=-L*i+x,C.z=I*X,m.push(C.x,C.y,C.z),E.set(W,U,X).normalize(),p.push(E.x,E.y,E.z),g.push(B,1-L),R.push(y++)}T.push(R)}for(let w=0;w<r;w++)for(let R=0;R<a;R++){let L=T[R][w],I=T[R+1][w],z=T[R+1][w+1],B=T[R][w+1];(e>0||R!==0)&&(d.push(L,I,B),D+=3),(t>0||R!==a-1)&&(d.push(I,z,B),D+=3)}f.addGroup(_,D,0),_+=D}function S(E){let C=y,D=new Le,U=new H,w=0,R=E===!0?e:t,L=E===!0?1:-1;for(let z=1;z<=r;z++)m.push(0,x*L,0),p.push(0,L,0),g.push(.5,.5),y++;let I=y;for(let z=0;z<=r;z++){let V=z/r*c+l,W=Math.cos(V),X=Math.sin(V);U.x=R*X,U.y=x*L,U.z=R*W,m.push(U.x,U.y,U.z),p.push(0,L,0),D.x=W*.5+.5,D.y=X*.5*L+.5,g.push(D.x,D.y),y++}for(let z=0;z<r;z++){let B=C+z,V=I+z;E===!0?d.push(V,V+1,B):d.push(V+1,V,B),w+=3}f.addGroup(_,w,E===!0?1:2),_+=w}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},wh=class n extends Wc{constructor(e=1,t=1,i=32,r=1,a=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,a,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:l}}static fromJSON(e){return new n(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}},Js=class n extends wt{constructor(e=[],t=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};let a=[],o=[];l(r),f(i),d(),this.setAttribute("position",new ut(a,3)),this.setAttribute("normal",new ut(a.slice(),3)),this.setAttribute("uv",new ut(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(b){let S=new H,E=new H,C=new H;for(let D=0;D<t.length;D+=3)g(t[D+0],S),g(t[D+1],E),g(t[D+2],C),c(S,E,C,b)}function c(b,S,E,C){let D=C+1,U=[];for(let w=0;w<=D;w++){U[w]=[];let R=b.clone().lerp(E,w/D),L=S.clone().lerp(E,w/D),I=D-w;for(let z=0;z<=I;z++)z===0&&w===D?U[w][z]=R:U[w][z]=R.clone().lerp(L,z/I)}for(let w=0;w<D;w++)for(let R=0;R<2*(D-w)-1;R++){let L=Math.floor(R/2);R%2===0?(p(U[w][L+1]),p(U[w+1][L]),p(U[w][L])):(p(U[w][L+1]),p(U[w+1][L+1]),p(U[w+1][L]))}}function f(b){let S=new H;for(let E=0;E<a.length;E+=3)S.x=a[E+0],S.y=a[E+1],S.z=a[E+2],S.normalize().multiplyScalar(b),a[E+0]=S.x,a[E+1]=S.y,a[E+2]=S.z}function d(){let b=new H;for(let S=0;S<a.length;S+=3){b.x=a[S+0],b.y=a[S+1],b.z=a[S+2];let E=x(b)/2/Math.PI+.5,C=_(b)/Math.PI+.5;o.push(E,1-C)}y(),m()}function m(){for(let b=0;b<o.length;b+=6){let S=o[b+0],E=o[b+2],C=o[b+4],D=Math.max(S,E,C),U=Math.min(S,E,C);D>.9&&U<.1&&(S<.2&&(o[b+0]+=1),E<.2&&(o[b+2]+=1),C<.2&&(o[b+4]+=1))}}function p(b){a.push(b.x,b.y,b.z)}function g(b,S){let E=b*3;S.x=e[E+0],S.y=e[E+1],S.z=e[E+2]}function y(){let b=new H,S=new H,E=new H,C=new H,D=new Le,U=new Le,w=new Le;for(let R=0,L=0;R<a.length;R+=9,L+=6){b.set(a[R+0],a[R+1],a[R+2]),S.set(a[R+3],a[R+4],a[R+5]),E.set(a[R+6],a[R+7],a[R+8]),D.set(o[L+0],o[L+1]),U.set(o[L+2],o[L+3]),w.set(o[L+4],o[L+5]),C.copy(b).add(S).add(E).divideScalar(3);let I=x(C);T(D,L+0,b,I),T(U,L+2,S,I),T(w,L+4,E,I)}}function T(b,S,E,C){C<0&&b.x===1&&(o[S]=b.x-1),E.x===0&&E.z===0&&(o[S]=C/2/Math.PI+.5)}function x(b){return Math.atan2(b.z,-b.x)}function _(b){return Math.atan2(-b.y,Math.sqrt(b.x*b.x+b.z*b.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.vertices,e.indices,e.radius,e.detail)}},Pg=class n extends Js{constructor(e=1,t=0){let i=(1+Math.sqrt(5))/2,r=1/i,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(a,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new n(e.radius,e.detail)}},Eb=new H,Mb=new H,f2=new H,wb=new po,Ig=class extends wt{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){let r=Math.pow(10,4),a=Math.cos(Ic*t),o=e.getIndex(),l=e.getAttribute("position"),c=o?o.count:l.count,f=[0,0,0],d=["a","b","c"],m=new Array(3),p={},g=[];for(let y=0;y<c;y+=3){o?(f[0]=o.getX(y),f[1]=o.getX(y+1),f[2]=o.getX(y+2)):(f[0]=y,f[1]=y+1,f[2]=y+2);let{a:T,b:x,c:_}=wb;if(T.fromBufferAttribute(l,f[0]),x.fromBufferAttribute(l,f[1]),_.fromBufferAttribute(l,f[2]),wb.getNormal(f2),m[0]=`${Math.round(T.x*r)},${Math.round(T.y*r)},${Math.round(T.z*r)}`,m[1]=`${Math.round(x.x*r)},${Math.round(x.y*r)},${Math.round(x.z*r)}`,m[2]=`${Math.round(_.x*r)},${Math.round(_.y*r)},${Math.round(_.z*r)}`,!(m[0]===m[1]||m[1]===m[2]||m[2]===m[0]))for(let b=0;b<3;b++){let S=(b+1)%3,E=m[b],C=m[S],D=wb[d[b]],U=wb[d[S]],w=`${E}_${C}`,R=`${C}_${E}`;R in p&&p[R]?(f2.dot(p[R].normal)<=a&&(g.push(D.x,D.y,D.z),g.push(U.x,U.y,U.z)),p[R]=null):w in p||(p[w]={index0:f[b],index1:f[S],normal:f2.clone()})}}for(let y in p)if(p[y]){let{index0:T,index1:x}=p[y];Eb.fromBufferAttribute(l,T),Mb.fromBufferAttribute(l,x),g.push(Eb.x,Eb.y,Eb.z),g.push(Mb.x,Mb.y,Mb.z)}this.setAttribute("position",new ut(g,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}},Zr=class{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){ot("Curve: .getPoint() not implemented.")}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let 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;let t=[],i,r=this.getPoint(0),a=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),a+=i.distanceTo(r),t.push(a),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){let i=this.getLengths(),r=0,a=i.length,o;t?o=t:o=e*i[a-1];let l=0,c=a-1,f;for(;l<=c;)if(r=Math.floor(l+(c-l)/2),f=i[r]-o,f<0)l=r+1;else if(f>0)c=r-1;else{c=r;break}if(r=c,i[r]===o)return r/(a-1);let d=i[r],p=i[r+1]-d,g=(o-d)/p;return(r+g)/(a-1)}getTangent(e,t){let r=e-1e-4,a=e+1e-4;r<0&&(r=0),a>1&&(a=1);let o=this.getPoint(r),l=this.getPoint(a),c=t||(o.isVector2?new Le:new H);return c.copy(l).sub(o).normalize(),c}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){let i=new H,r=[],a=[],o=[],l=new H,c=new mt;for(let g=0;g<=e;g++){let y=g/e;r[g]=this.getTangentAt(y,new H)}a[0]=new H,o[0]=new H;let f=Number.MAX_VALUE,d=Math.abs(r[0].x),m=Math.abs(r[0].y),p=Math.abs(r[0].z);d<=f&&(f=d,i.set(1,0,0)),m<=f&&(f=m,i.set(0,1,0)),p<=f&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),a[0].crossVectors(r[0],l),o[0].crossVectors(r[0],a[0]);for(let g=1;g<=e;g++){if(a[g]=a[g-1].clone(),o[g]=o[g-1].clone(),l.crossVectors(r[g-1],r[g]),l.length()>Number.EPSILON){l.normalize();let y=Math.acos(xt(r[g-1].dot(r[g]),-1,1));a[g].applyMatrix4(c.makeRotationAxis(l,y))}o[g].crossVectors(r[g],a[g])}if(t===!0){let g=Math.acos(xt(a[0].dot(a[e]),-1,1));g/=e,r[0].dot(l.crossVectors(a[0],a[e]))>0&&(g=-g);for(let y=1;y<=e;y++)a[y].applyMatrix4(c.makeRotationAxis(r[y],g*y)),o[y].crossVectors(r[y],a[y])}return{tangents:r,normals:a,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},Xc=class extends Zr{constructor(e=0,t=0,i=1,r=1,a=0,o=Math.PI*2,l=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=a,this.aEndAngle=o,this.aClockwise=l,this.aRotation=c}getPoint(e,t=new Le){let i=t,r=Math.PI*2,a=this.aEndAngle-this.aStartAngle,o=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=r;for(;a>r;)a-=r;a<Number.EPSILON&&(o?a=0:a=r),this.aClockwise===!0&&!o&&(a===r?a=-r:a=a-r);let l=this.aStartAngle+e*a,c=this.aX+this.xRadius*Math.cos(l),f=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){let d=Math.cos(this.aRotation),m=Math.sin(this.aRotation),p=c-this.aX,g=f-this.aY;c=p*d-g*m+this.aX,f=p*m+g*d+this.aY}return i.set(c,f)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},zg=class extends Xc{constructor(e,t,i,r,a,o){super(e,t,i,i,r,a,o),this.isArcCurve=!0,this.type="ArcCurve"}};function gw(){let n=0,e=0,t=0,i=0;function r(a,o,l,c){n=a,e=l,t=-3*a+3*o-2*l-c,i=2*a-2*o+l+c}return{initCatmullRom:function(a,o,l,c,f){r(o,l,f*(l-a),f*(c-o))},initNonuniformCatmullRom:function(a,o,l,c,f,d,m){let p=(o-a)/f-(l-a)/(f+d)+(l-o)/d,g=(l-o)/d-(c-o)/(d+m)+(c-l)/m;p*=d,g*=d,r(o,l,p,g)},calc:function(a){let o=a*a,l=o*a;return n+e*a+t*o+i*l}}}var Ab=new H,d2=new gw,h2=new gw,p2=new gw,kg=class extends Zr{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new H){let i=t,r=this.points,a=r.length,o=(a-(this.closed?0:1))*e,l=Math.floor(o),c=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:c===0&&l===a-1&&(l=a-2,c=1);let f,d;this.closed||l>0?f=r[(l-1)%a]:(Ab.subVectors(r[0],r[1]).add(r[0]),f=Ab);let m=r[l%a],p=r[(l+1)%a];if(this.closed||l+2<a?d=r[(l+2)%a]:(Ab.subVectors(r[a-1],r[a-2]).add(r[a-1]),d=Ab),this.curveType==="centripetal"||this.curveType==="chordal"){let g=this.curveType==="chordal"?.5:.25,y=Math.pow(f.distanceToSquared(m),g),T=Math.pow(m.distanceToSquared(p),g),x=Math.pow(p.distanceToSquared(d),g);T<1e-4&&(T=1),y<1e-4&&(y=T),x<1e-4&&(x=T),d2.initNonuniformCatmullRom(f.x,m.x,p.x,d.x,y,T,x),h2.initNonuniformCatmullRom(f.y,m.y,p.y,d.y,y,T,x),p2.initNonuniformCatmullRom(f.z,m.z,p.z,d.z,y,T,x)}else this.curveType==="catmullrom"&&(d2.initCatmullRom(f.x,m.x,p.x,d.x,this.tension),h2.initCatmullRom(f.y,m.y,p.y,d.y,this.tension),p2.initCatmullRom(f.z,m.z,p.z,d.z,this.tension));return i.set(d2.calc(c),h2.calc(c),p2.calc(c)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let r=e.points[t];this.points.push(new H().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}};function qL(n,e,t,i,r){let a=(i-e)*.5,o=(r-t)*.5,l=n*n,c=n*l;return(2*t-2*i+a+o)*c+(-3*t+3*i-2*a-o)*l+a*n+t}function N6(n,e){let t=1-n;return t*t*e}function P6(n,e){return 2*(1-n)*n*e}function I6(n,e){return n*n*e}function sg(n,e,t,i){return N6(n,e)+P6(n,t)+I6(n,i)}function z6(n,e){let t=1-n;return t*t*t*e}function k6(n,e){let t=1-n;return 3*t*t*n*e}function F6(n,e){return 3*(1-n)*n*n*e}function B6(n,e){return n*n*n*e}function lg(n,e,t,i,r){return z6(n,e)+k6(n,t)+F6(n,i)+B6(n,r)}var Ah=class extends Zr{constructor(e=new Le,t=new Le,i=new Le,r=new Le){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Le){let i=t,r=this.v0,a=this.v1,o=this.v2,l=this.v3;return i.set(lg(e,r.x,a.x,o.x,l.x),lg(e,r.y,a.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},Fg=class extends Zr{constructor(e=new H,t=new H,i=new H,r=new H){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new H){let i=t,r=this.v0,a=this.v1,o=this.v2,l=this.v3;return i.set(lg(e,r.x,a.x,o.x,l.x),lg(e,r.y,a.y,o.y,l.y),lg(e,r.z,a.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}},Ch=class extends Zr{constructor(e=new Le,t=new Le){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Le){let i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 4,361 bytes, line 9
9getTangent(e,t=new Le){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Bg=class extends Zr{constructor(e=new H,t=new H){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new H){let i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new H){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Rh=class extends Zr{constructor(e=new Le,t=new Le,i=new Le){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Le){let i=t,r=this.v0,a=this.v1,o=this.v2;return i.set(sg(e,r.x,a.x,o.x),sg(e,r.y,a.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Dh=class extends Zr{constructor(e=new H,t=new H,i=new H){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new H){let i=t,r=this.v0,a=this.v1,o=this.v2;return i.set(sg(e,r.x,a.x,o.x),sg(e,r.y,a.y,o.y),sg(e,r.z,a.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},Uh=class extends Zr{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Le){let i=t,r=this.points,a=(r.length-1)*e,o=Math.floor(a),l=a-o,c=r[o===0?o:o-1],f=r[o],d=r[o>r.length-2?r.length-1:o+1],m=r[o>r.length-3?r.length-1:o+2];return i.set(qL(l,c.x,f.x,d.x,m.x),qL(l,c.y,f.y,d.y,m.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let r=e.points[t];this.points.push(r.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let r=e.points[t];this.points.push(new Le().fromArray(r))}return this}},rx=Object.freeze({__proto__:null,ArcCurve:zg,CatmullRomCurve3:kg,CubicBezierCurve:Ah,CubicBezierCurve3:Fg,EllipseCurve:Xc,LineCurve:Ch,LineCurve3:Bg,QuadraticBezierCurve:Rh,QuadraticBezierCurve3:Dh,SplineCurve:Uh}),Hg=class extends Zr{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new rx[i](t,e))}return this}getPoint(e,t){let i=e*this.getLength(),r=this.getCurveLengths(),a=0;for(;a<r.length;){if(r[a]>=i){let o=r[a]-i,l=this.curves[a],c=l.getLength(),f=c===0?0:1-o/c;return l.getPointAt(f,t)}a++}return null}getLength(){let 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;let e=[],t=0;for(let i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t=[],i;for(let r=0,a=this.curves;r<a.length;r++){let o=a[r],l=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isS
vendor: 45,850 bytes, lines 9-13
9plineCurve?e*o.points.length:e,c=o.getPoints(l);for(let f=0;f<c.length;f++){let d=c[f];i&&i.equals(d)||(t.push(d),i=d)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){let r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let r=e.curves[t];this.curves.push(new rx[r.type]().fromJSON(r))}return this}},qc=class extends Hg{constructor(e){super(),this.type="Path",this.currentPoint=new Le,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let i=new Ch(this.currentPoint.clone(),new Le(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){let a=new Rh(this.currentPoint.clone(),new Le(e,t),new Le(i,r));return this.curves.push(a),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,a,o){let l=new Ah(this.currentPoint.clone(),new Le(e,t),new Le(i,r),new Le(a,o));return this.curves.push(l),this.currentPoint.set(a,o),this}splineThru(e){let t=[this.currentPoint.clone()].concat(e),i=new Uh(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,a,o){let l=this.currentPoint.x,c=this.currentPoint.y;return this.absarc(e+l,t+c,i,r,a,o),this}absarc(e,t,i,r,a,o){return this.absellipse(e,t,i,i,r,a,o),this}ellipse(e,t,i,r,a,o,l,c){let f=this.currentPoint.x,d=this.currentPoint.y;return this.absellipse(e+f,t+d,i,r,a,o,l,c),this}absellipse(e,t,i,r,a,o,l,c){let f=new Xc(e,t,i,r,a,o,l,c);if(this.curves.length>0){let m=f.getPoint(0);m.equals(this.currentPoint)||this.lineTo(m.x,m.y)}this.curves.push(f);let d=f.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Ma=class extends qc{constructor(e){super(e),this.uuid=Ea(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){let r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let r=e.holes[t];this.holes.push(new qc().fromJSON(r))}return this}};function H6(n,e,t=2){let i=e&&e.length,r=i?e[0]*t:n.length,a=hP(n,0,r,t,!0),o=[];if(!a||a.next===a.prev)return o;let l,c,f;if(i&&(a=q6(n,e,a,t)),n.length>80*t){l=n[0],c=n[1];let d=l,m=c;for(let p=t;p<r;p+=t){let g=n[p],y=n[p+1];g<l&&(l=g),y<c&&(c=y),g>d&&(d=g),y>m&&(m=y)}f=Math.max(d-l,m-c),f=f!==0?32767/f:0}return Vg(a,o,t,l,c,f,0),o}function hP(n,e,t,i,r){let a;if(r===i8(n,e,t,i)>0)for(let o=e;o<t;o+=i)a=YL(o/i|0,n[o],n[o+1],a);else for(let o=t-i;o>=e;o-=i)a=YL(o/i|0,n[o],n[o+1],a);return a&&Oh(a,a.next)&&(Wg(a),a=a.next),a}function Yc(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Oh(t,t.next)||Fn(t.prev,t,t.next)===0)){if(Wg(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Vg(n,e,t,i,r,a,o){if(!n)return;!o&&a&&Q6(n,i,r,a);let l=n;for(;n.prev!==n.next;){let c=n.prev,f=n.next;if(a?G6(n,i,r,a):V6(n)){e.push(c.i,n.i,f.i),Wg(n),n=f.next,l=f.next;continue}if(n=f,n===l){o?o===1?(n=W6(Yc(n),e),Vg(n,e,t,i,r,a,2)):o===2&&X6(n,e,t,i,r,a):Vg(Yc(n),e,t,i,r,a,1);break}}}function V6(n){let e=n.prev,t=n,i=n.next;if(Fn(e,t,i)>=0)return!1;let r=e.x,a=t.x,o=i.x,l=e.y,c=t.y,f=i.y,d=Math.min(r,a,o),m=Math.min(l,c,f),p=Math.max(r,a,o),g=Math.max(l,c,f),y=i.next;for(;y!==e;){if(y.x>=d&&y.x<=p&&y.y>=m&&y.y<=g&&rg(r,l,a,c,o,f,y.x,y.y)&&Fn(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function G6(n,e,t,i){let r=n.prev,a=n,o=n.next;if(Fn(r,a,o)>=0)return!1;let l=r.x,c=a.x,f=o.x,d=r.y,m=a.y,p=o.y,g=Math.min(l,c,f),y=Math.min(d,m,p),T=Math.max(l,c,f),x=Math.max(d,m,p),_=T2(g,y,e,t,i),b=T2(T,x,e,t,i),S=n.prevZ,E=n.nextZ;for(;S&&S.z>=_&&E&&E.z<=b;){if(S.x>=g&&S.x<=T&&S.y>=y&&S.y<=x&&S!==r&&S!==o&&rg(l,d,c,m,f,p,S.x,S.y)&&Fn(S.prev,S,S.next)>=0||(S=S.prevZ,E.x>=g&&E.x<=T&&E.y>=y&&E.y<=x&&E!==r&&E!==o&&rg(l,d,c,m,f,p,E.x,E.y)&&Fn(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;S&&S.z>=_;){if(S.x>=g&&S.x<=T&&S.y>=y&&S.y<=x&&S!==r&&S!==o&&rg(l,d,c,m,f,p,S.x,S.y)&&Fn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;E&&E.z<=b;){if(E.x>=g&&E.x<=T&&E.y>=y&&E.y<=x&&E!==r&&E!==o&&rg(l,d,c,m,f,p,E.x,E.y)&&Fn(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function W6(n,e){let t=n;do{let i=t.prev,r=t.next.next;!Oh(i,r)&&mP(i,t,t.next,r)&&Gg(i,r)&&Gg(r,i)&&(e.push(i.i,t.i,r.i),Wg(t),Wg(t.next),t=n=r),t=t.next}while(t!==n);return Yc(t)}function X6(n,e,t,i,r,a){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&e8(o,l)){let c=gP(o,l);o=Yc(o,o.next),c=Yc(c,c.next),Vg(o,e,t,i,r,a,0),Vg(c,e,t,i,r,a,0);return}l=l.next}o=o.next}while(o!==n)}function q6(n,e,t,i){let r=[];for(let a=0,o=e.length;a<o;a++){let l=e[a]*i,c=a<o-1?e[a+1]*i:n.length,f=hP(n,l,c,i,!1);f===f.next&&(f.steiner=!0),r.push($6(f))}r.sort(Y6);for(let a=0;a<r.length;a++)t=j6(r[a],t);return t}function Y6(n,e){let t=n.x-e.x;if(t===0&&(t=n.y-e.y,t===0)){let i=(n.next.y-n.y)/(n.next.x-n.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=i-r}return t}function j6(n,e){let t=Z6(n,e);if(!t)return e;let i=gP(t,n);return Yc(i,i.next),Yc(t,t.next)}function Z6(n,e){let t=e,i=n.x,r=n.y,a=-1/0,o;if(Oh(n,t))return t;do{if(Oh(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){let m=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(m<=i&&m>a&&(a=m,o=t.x<t.next.x?t:t.next,m===i))return o}t=t.next}while(t!==e);if(!o)return null;let l=o,c=o.x,f=o.y,d=1/0;t=o;do{if(i>=t.x&&t.x>=c&&i!==t.x&&pP(r<f?i:a,r,c,f,r<f?a:i,r,t.x,t.y)){let m=Math.abs(r-t.y)/(i-t.x);Gg(t,n)&&(m<d||m===d&&(t.x>o.x||t.x===o.x&&K6(o,t)))&&(o=t,d=m)}t=t.next}while(t!==l);return o}function K6(n,e){return Fn(n.prev,n,e.prev)<0&&Fn(e.next,n,n.next)<0}function Q6(n,e,t,i){let r=n;do r.z===0&&(r.z=T2(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,J6(r)}function J6(n){let e,t=1;do{let i=n,r;n=null;let a=null;for(e=0;i;){e++;let o=i,l=0;for(let f=0;f<t&&(l++,o=o.nextZ,!!o);f++);let c=t;for(;l>0||c>0&&o;)l!==0&&(c===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,l--):(r=o,o=o.nextZ,c--),a?a.nextZ=r:n=r,r.prevZ=a,a=r;i=o}a.nextZ=null,t*=2}while(e>1);return n}function T2(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 $6(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function pP(n,e,t,i,r,a,o,l){return(r-o)*(e-l)>=(n-o)*(a-l)&&(n-o)*(i-l)>=(t-o)*(e-l)&&(t-o)*(a-l)>=(r-o)*(i-l)}function rg(n,e,t,i,r,a,o,l){return!(n===o&&e===l)&&pP(n,e,t,i,r,a,o,l)}function e8(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!t8(n,e)&&(Gg(n,e)&&Gg(e,n)&&n8(n,e)&&(Fn(n.prev,n,e.prev)||Fn(n,e.prev,e))||Oh(n,e)&&Fn(n.prev,n,n.next)>0&&Fn(e.prev,e,e.next)>0)}function Fn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Oh(n,e){return n.x===e.x&&n.y===e.y}function mP(n,e,t,i){let r=Rb(Fn(n,e,t)),a=Rb(Fn(n,e,i)),o=Rb(Fn(t,i,n)),l=Rb(Fn(t,i,e));return!!(r!==a&&o!==l||r===0&&Cb(n,t,e)||a===0&&Cb(n,i,e)||o===0&&Cb(t,n,i)||l===0&&Cb(t,e,i))}function Cb(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 Rb(n){return n>0?1:n<0?-1:0}function t8(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&&mP(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Gg(n,e){return Fn(n.prev,n,n.next)<0?Fn(n,e,n.next)>=0&&Fn(n,n.prev,e)>=0:Fn(n,e,n.prev)<0||Fn(n,n.next,e)<0}function n8(n,e){let t=n,i=!1,r=(n.x+e.x)/2,a=(n.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&r<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function gP(n,e){let t=E2(n.i,n.x,n.y),i=E2(e.i,e.x,e.y),r=n.next,a=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,a.next=i,i.prev=a,i}function YL(n,e,t,i){let r=E2(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 Wg(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 E2(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function i8(n,e,t,i){let r=0;for(let a=e,o=t-i;a<t;a+=i)r+=(n[o]-n[a])*(n[a+1]+n[o+1]),o=a;return r}var M2=class{static triangulate(e,t,i=2){return H6(e,t,i)}},Ya=class n{static area(e){let t=e.length,i=0;for(let r=t-1,a=0;a<t;r=a++)i+=e[r].x*e[a].y-e[a].x*e[r].y;return i*.5}static isClockWise(e){return n.area(e)<0}static triangulateShape(e,t){let i=[],r=[],a=[];jL(e),ZL(i,e);let o=e.length;t.forEach(jL);for(let c=0;c<t.length;c++)r.push(o),o+=t[c].length,ZL(i,t[c]);let l=M2.triangulate(i,r);for(let c=0;c<l.length;c+=3)a.push(l.slice(c,c+3));return a}};function jL(n){let e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function ZL(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}var Xg=class n extends wt{constructor(e=new Ma([new Le(.5,.5),new Le(-.5,.5),new Le(-.5,-.5),new Le(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let i=this,r=[],a=[];for(let l=0,c=e.length;l<c;l++){let f=e[l];o(f)}this.setAttribute("position",new ut(r,3)),this.setAttribute("uv",new ut(a,2)),this.computeVertexNormals();function o(l){let c=[],f=t.curveSegments!==void 0?t.curveSegments:12,d=t.steps!==void 0?t.steps:1,m=t.depth!==void 0?t.depth:1,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,g=t.bevelThickness!==void 0?t.bevelThickness:.2,y=t.bevelSize!==void 0?t.bevelSize:g-.1,T=t.bevelOffset!==void 0?t.bevelOffset:0,x=t.bevelSegments!==void 0?t.bevelSegments:3,_=t.extrudePath,b=t.UVGenerator!==void 0?t.UVGenerator:r8,S,E=!1,C,D,U,w;if(_){S=_.getSpacedPoints(d),E=!0,p=!1;let ge=_.isCatmullRomCurve3?_.closed:!1;C=_.computeFrenetFrames(d,ge),D=new H,U=new H,w=new H}p||(x=0,g=0,y=0,T=0);let R=l.extractPoints(f),L=R.shape,I=R.holes;if(!Ya.isClockWise(L)){L=L.reverse();for(let ge=0,me=I.length;ge<me;ge++){let ce=I[ge];Ya.isClockWise(ce)&&(I[ge]=ce.reverse())}}function B(ge){let ce=10000000000000001e-36,Te=ge[0];for(let F=1;F<=ge.length;F++){let He=F%ge.length,Me=ge[He],_e=Me.x-Te.x,Ae=Me.y-Te.y,P=_e*_e+Ae*Ae,O=Math.max(Math.abs(Me.x),Math.abs(Me.y),Math.abs(Te.x),Math.abs(Te.y)),q=ce*O*O;if(P<=q){ge.splice(He,1),F--;continue}Te=Me}}B(L),I.forEach(B);let V=I.length,W=L;for(let ge=0;ge<V;ge++){let me=I[ge];L=L.concat(me)}function X(ge,me,ce){return me||pt("ExtrudeGeometry: vec does not exist"),ge.clone().addScaledVector(me,ce)}let K=L.length;function pe(ge,me,ce){let Te,F,He,Me=ge.x-me.x,_e=ge.y-me.y,Ae=ce.x-ge.x,P=ce.y-ge.y,O=Me*Me+_e*_e,q=Me*P-_e*Ae;if(Math.abs(q)>Number.EPSILON){let de=Math.sqrt(O),le=Math.sqrt(Ae*Ae+P*P),ie=me.x-_e/de,ze=me.y+Me/de,Re=ce.x-P/le,Ye=ce.y+Ae/le,at=((Re-ie)*P-(Ye-ze)*Ae)/(Me*P-_e*Ae);Te=ie+Me*at-ge.x,F=ze+_e*at-ge.y;let we=Te*Te+F*F;if(we<=2)return new Le(Te,F);He=Math.sqrt(we/2)}else{let de=!1;Me>Number.EPSILON?Ae>Number.EPSILON&&(de=!0):Me<-Number.EPSILON?Ae<-Number.EPSILON&&(de=!0):Math.sign(_e)===Math.sign(P)&&(de=!0),de?(Te=-_e,F=Me,He=Math.sqrt(O)):(Te=Me,F=_e,He=Math.sqrt(O/2))}return new Le(Te/He,F/He)}let Q=[];for(let ge=0,me=W.length,ce=me-1,Te=ge+1;ge<me;ge++,ce++,Te++)ce===me&&(ce=0),Te===me&&(Te=0),Q[ge]=pe(W[ge],W[ce],W[Te]);let ee=[],G,Z=Q.concat();for(let ge=0,me=V;ge<me;ge++){let ce=I[ge];G=[];for(let Te=0,F=ce.length,He=F-1,Me=Te+1;Te<F;Te++,He++,Me++)He===F&&(He=0),Me===F&&(Me=0),G[Te]=pe(ce[Te],ce[He],ce[Me]);ee.push(G),Z=Z.concat(G)}let ne;if(x===0)ne=Ya.triangulateShape(W,I);else{let ge=[],me=[];for(let ce=0;ce<x;ce++){let Te=ce/x,F=g*Math.cos(Te*Math.PI/2),He=y*Math.sin(Te*Math.PI/2)+T;for(let Me=0,_e=W.length;Me<_e;Me++){let Ae=X(W[Me],Q[Me],He);Oe(Ae.x,Ae.y,-F),Te===0&&ge.push(Ae)}for(let Me=0,_e=V;Me<_e;Me++){let Ae=I[Me];G=ee[Me];let P=[];for(let O=0,q=Ae.length;O<q;O++){let de=X(Ae[O],G[O],He);Oe(de.x,de.y,-F),Te===0&&P.push(de)}Te===0&&me.push(P)}}ne=Ya.triangulateShape(ge,me)}let he=ne.length,se=y+T;for(let ge=0;ge<K;ge++){let me=p?X(L[ge],Z[ge],se):L[ge];E?(U.copy(C.normals[0]).multiplyScalar(me.x),D.copy(C.binormals[0]).multiplyScalar(me.y),w.copy(S[0]).add(U).add(D),Oe(w.x,w.y,w.z)):Oe(me.x,me.y,0)}for(let ge=1;ge<=d;ge++)for(let me=0;me<K;me++){let ce=p?X(L[me],Z[me],se):L[me];E?(U.copy(C.normals[ge]).multiplyScalar(ce.x),D.copy(C.binormals[ge]).multiplyScalar(ce.y),w.copy(S[ge]).add(U).add(D),Oe(w.x,w.y,w.z)):Oe(ce.x,ce.y,m/d*ge)}for(let ge=x-1;ge>=0;ge--){let me=ge/x,ce=g*Math.cos(me*Math.PI/2),Te=y*Math.sin(me*Math.PI/2)+T;for(let F=0,He=W.length;F<He;F++){let Me=X(W[F],Q[F],Te);Oe(Me.x,Me.y,m+ce)}for(let F=0,He=I.length;F<He;F++){let Me=I[F];G=ee[F];for(let _e=0,Ae=Me.length;_e<Ae;_e++){let P=X(Me[_e],G[_e],Te);E?Oe(P.x,P.y+S[d-1].y,S[d-1].x+ce):Oe(P.x,P.y,m+ce)}}}J(),te();function J(){let ge=r.length/3;if(p){let me=0,ce=K*me;for(let Te=0;Te<he;Te++){let F=ne[Te];Be(F[2]+ce,F[1]+ce,F[0]+ce)}me=d+x*2,ce=K*me;for(let Te=0;Te<he;Te++){let F=ne[Te];Be(F[0]+ce,F[1]+ce,F[2]+ce)}}else{for(let me=0;me<he;me++){let ce=ne[me];Be(ce[2],ce[1],ce[0])}for(let me=0;me<he;me++){let ce=ne[me];Be(ce[0]+K*d,ce[1]+K*d,ce[2]+K*d)}}i.addGroup(ge,r.length/3-ge,0)}function te(){let ge=r.length/3,me=0;re(W,me),me+=W.length;for(let ce=0,Te=I.length;ce<Te;ce++){let F=I[ce];re(F,me),me+=F.length}i.addGroup(ge,r.length/3-ge,1)}function re(ge,me){let ce=ge.length;for(;--ce>=0;){let Te=ce,F=ce-1;F<0&&(F=ge.length-1);for(let He=0,Me=d+x*2;He<Me;He++){let _e=K*He,Ae=K*(He+1),P=me+Te+_e,O=me+F+_e,q=me+F+Ae,de=me+Te+Ae;De(P,O,q,de)}}}function Oe(ge,me,ce){c.push(ge),c.push(me),c.push(ce)}function Be(ge,me,ce){Ue(ge),Ue(me),Ue(ce);let Te=r.length/3,F=b.generateTopUV(i,r,Te-3,Te-2,Te-1);Xe(F[0]),Xe(F[1]),Xe(F[2])}function De(ge,me,ce,Te){Ue(ge),Ue(me),Ue(Te),Ue(me),Ue(ce),Ue(Te);let F=r.length/3,He=b.generateSideWallUV(i,r,F-6,F-3,F-2,F-1);Xe(He[0]),Xe(He[1]),Xe(He[3]),Xe(He[1]),Xe(He[2]),Xe(He[3])}function Ue(ge){r.push(c[ge*3+0]),r.push(c[ge*3+1]),r.push(c[ge*3+2])}function Xe(ge){a.push(ge.x),a.push(ge.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return a8(t,i,e)}static fromJSON(e,t){let i=[];for(let a=0,o=e.shapes.length;a<o;a++){let l=t[e.shapes[a]];i.push(l)}let r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new rx[r.type]().fromJSON(r)),new n(i,e.options)}},r8={generateTopUV:function(n,e,t,i,r){let a=e[t*3],o=e[t*3+1],l=e[i*3],c=e[i*3+1],f=e[r*3],d=e[r*3+1];return[new Le(a,o),new Le(l,c),new Le(f,d)]},generateSideWallUV:function(n,e,t,i,r,a){let o=e[t*3],l=e[t*3+1],c=e[t*3+2],f=e[i*3],d=e[i*3+1],m=e[i*3+2],p=e[r*3],g=e[r*3+1],y=e[r*3+2],T=e[a*3],x=e[a*3+1],_=e[a*3+2];return Math.abs(l-d)<Math.abs(o-f)?[new Le(o,1-c),new Le(f,1-m),new Le(p,1-y),new Le(T,1-_)]:[new Le(l,1-c),new Le(d,1-m),new Le(g,1-y),new Le(x,1-_)]}};function a8(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){let a=n[i];t.shapes.push(a.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}var qg=class n extends Js{constructor(e=1,t=0){let i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],a=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,a,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new n(e.radius,e.detail)}},Yg=class n extends wt{constructor(e=[new Le(0,-.5),new Le(.5,0),new Le(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=xt(r,0,Math.PI*2);let a=[],o=[],l=[],c=[],f=[],d=1/t,m=new H,p=new Le,g=new H,y=new H,T=new H,x=0,_=0;for(let b=0;b<=e.length-1;b++)switch(b){case 0:x=e[b+1].x-e[b].x,_=e[b+1].y-e[b].y,g.x=_*1,g.y=-x,g.z=_*0,T.copy(g),g.normalize(),c.push(g.x,g.y,g.z);break;case e.length-1:c.push(T.x,T.y,T.z);break;default:x=e[b+1].x-e[b].x,_=e[b+1].y-e[b].y,g.x=_*1,g.y=-x,g.z=_*0,y.copy(g),g.x+=T.x,g.y+=T.y,g.z+=T.z,g.normalize(),c.push(g.x,g.y,g.z),T.copy(y)}for(let b=0;b<=t;b++){let S=i+b*d*r,E=Math.sin(S),C=Math.cos(S);for(let D=0;D<=e.length-1;D++){m.x=e[D].x*E,m.y=e[D].y,m.z=e[D].x*C,o.push(m.x,m.y,m.z),p.x=b/t,p.y=D/(e.length-1),l.push(p.x,p.y);let U=c[3*D+0]*E,w=c[3*D+1],R=c[3*D+0]*C;f.push(U,w,R)}}for(let b=0;b<t;b++)for(let S=0;S<e.length-1;S++){let E=S+b*e.length,C=E,D=E+e.length,U=E+e.length+1,w=E+1;a.push(C,D,w),a.push(U,w,D)}this.setIndex(a),this.setAttribute("position",new ut(o,3)),this.setAttribute("uv",new ut(l,2)),this.setAttribute("normal",new ut(f,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.points,e.segments,e.phiStart,e.phiLength)}},Lh=class n extends Js{constructor(e=1,t=0){let i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new n(e.radius,e.detail)}},xo=class n extends wt{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};let a=e/2,o=t/2,l=Math.floor(i),c=Math.floor(r),f=l+1,d=c+1,m=e/l,p=t/c,g=[],y=[],T=[],x=[];for(let _=0;_<d;_++){let b=_*p-o;for(let S=0;S<f;S++){let E=S*m-a;y.push(E,-b,0),T.push(0,0,1),x.push(S/l),x.push(1-_/c)}}for(let _=0;_<c;_++)for(let b=0;b<l;b++){let S=b+f*_,E=b+f*(_+1),C=b+1+f*(_+1),D=b+1+f*_;g.push(S,E,D),g.push(E,C,D)}this.setIndex(g),this.setAttribute("position",new ut(y,3)),this.setAttribute("normal",new ut(T,3)),this.setAttribute("uv",new ut(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.width,e.height,e.widthSegments,e.heightSegments)}},jg=class n extends wt{constructor(e=.5,t=1,i=32,r=1,a=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:a,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);let l=[],c=[],f=[],d=[],m=e,p=(t-e)/r,g=new H,y=new Le;for(let T=0;T<=r;T++){for(let x=0;x<=i;x++){let _=a+x/i*o;g.x=m*Math.cos(_),g.y=m*Math.sin(_),c.push(g.x,g.y,g.z),f.push(0,0,1),y.x=(g.x/t+1)/2,y.y=(g.y/t+1)/2,d.push(y.x,y.y)}m+=p}for(let T=0;T<r;T++){let x=T*(i+1);for(let _=0;_<i;_++){let b=_+x,S=b,E=b+i+1,C=b+i+2,D=b+1;l.push(S,E,D),l.push(E,C,D)}}this.setIndex(l),this.setAttribute("position",new ut(c,3)),this.setAttribute("normal",new ut(f,3)),this.setAttribute("uv",new ut(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}},Zg=class n extends wt{constructor(e=new Ma([new Le(0,.5),new Le(-.5,-.5),new Le(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};let i=[],r=[],a=[],o=[],l=0,c=0;if(Array.isArray(e)===!1)f(e);else for(let d=0;d<e.length;d++)f(e[d]),this.addGroup(l,c,d),l+=c,c=0;this.setIndex(i),this.setAttribute("position",new ut(r,3)),this.setAttribute("normal",new ut(a,3)),this.setAttribute("uv",new ut(o,2));function f(d){let m=r.length/3,p=d.extractPoints(t),g=p.shape,y=p.holes;Ya.isClockWise(g)===!1&&(g=g.reverse());for(let x=0,_=y.length;x<_;x++){let b=y[x];Ya.isClockWise(b)===!0&&(y[x]=b.reverse())}let T=Ya.triangulateShape(g,y);for(let x=0,_=y.length;x<_;x++){let b=y[x];g=g.concat(b)}for(let x=0,_=g.length;x<_;x++){let b=g[x];r.push(b.x,b.y,0),a.push(0,0,1),o.push(b.x,b.y)}for(let x=0,_=T.length;x<_;x++){let b=T[x],S=b[0]+m,E=b[1]+m,C=b[2]+m;i.push(S,E,C),c+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON(),t=this.parameters.shapes;return o8(t,e)}static fromJSON(e,t){let i=[];for(let r=0,a=e.shapes.length;r<a;r++){let o=t[e.shapes[r]];i.push(o)}return new n(i,e.curveSegments)}};function o8(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){let r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}var Nh=class n extends wt{constructor(e=1,t=32,i=16,r=0,a=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:a,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));let c=Math.min(o+l,Math.PI),f=0,d=[],m=new H,p=new H,g=[],y=[],T=[],x=[];for(let _=0;_<=i;_++){let b=[],S=_/i,E=0;_===0&&o===0?E=.5/t:_===i&&c===Math.PI&&(E=-.5/t);for(let C=0;C<=t;C++){let D=C/t;m.x=-e*Math.cos(r+D*a)*Math.sin(o+S*l),m.y=e*Math.cos(o+S*l),m.z=e*Math.sin(r+D*a)*Math.sin(o+S*l),y.push(m.x,m.y,m.z),p.copy(m).normalize(),T.push(p.x,p.y,p.z),x.push(D+E,1-S),b.push(f++)}d.push(b)}for(let _=0;_<i;_++)for(let b=0;b<t;b++){let S=d[_][b+1],E=d[_][b],C=d[_+1][b],D=d[_+1][b+1];(_!==0||o>0)&&g.push(S,E,D),(_!==i-1||c<Math.PI)&&g.push(E,C,D)}this.setIndex(g),this.setAttribute("position",new ut(y,3)),this.setAttribute("normal",new ut(T,3)),this.setAttribute("uv",new ut(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}},Kg=class n extends Js{constructor(e=1,t=0){let i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new n(e.radius,e.detail)}},Qg=class n extends wt{constructor(e=1,t=.4,i=12,r=48,a=Math.PI*2,o=0,l=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:a,thetaStart:o,thetaLength:l},i=Math.floor(i),r=Math.floor(r);let c=[],f=[],d=[],m=[],p=new H,g=new H,y=new H;for(let T=0;T<=i;T++){let x=o+T/i*l;for(let _=0;_<=r;_++){let b=_/r*a;g.x=(e+t*Math.cos(x))*Math.cos(b),g.y=(e+t*Math.cos(x))*Math.sin(b),g.z=t*Math.sin(x),f.push(g.x,g.y,g.z),p.x=e*Math.cos(b),p.y=e*Math.sin(b),y.subVectors(g,p).normalize(),d.push(y.x,y.y,y.z),m.push(_/r),m.push(T/i)}}for(let T=1;T<=i;T++)for(let x=1;x<=r;x++){let _=(r+1)*T+x-1,b=(r+1)*(T-1)+x-1,S=(r+1)*(T-1)+x,E=(r+1)*T+x;c.push(_,b,E),c.push(b,S,E)}this.setIndex(c),this.setAttribute("position",new ut(f,3)),this.setAttribute("normal",new ut(d,3)),this.setAttribute("uv",new ut(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}},Jg=class n extends wt{constructor(e=1,t=.4,i=64,r=8,a=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:a,q:o},i=Math.floor(i),r=Math.floor(r);let l=[],c=[],f=[],d=[],m=new H,p=new H,g=new H,y=new H,T=new H,x=new H,_=new H;for(let S=0;S<=i;++S){let E=S/i*a*Math.PI*2;b(E,a,o,e,g),b(E+.01,a,o,e,y),x.subVectors(y,g),_.addVectors(y,g),T.crossVectors(x,_),_.crossVectors(T,x),T.normalize(),_.normalize();for(let C=0;C<=r;++C){let D=C/r*Math.PI*2,U=-t*Math.cos(D),w=t*Math.sin(D);m.x=g.x+(U*_.x+w*T.x),m.y=g.y+(U*_.y+w*T.y),m.z=g.z+(U*_.z+w*T.z),c.push(m.x,m.y,m.z),p.subVectors(m,g).normalize(),f.push(p.x,p.y,p.z),d.push(S/i),d.push(C/r)}}for(let S=1;S<=i;S++)for(let E=1;E<=r;E++){let C=(r+1)*(S-1)+(E-1),D=(r+1)*S+(E-1),U=(r+1)*S+E,w=(r+1)*(S-1)+E;l.push(C,D,w),l.push(D,U,w)}this.setIndex(l),this.setAttribute("position",new ut(c,3)),this.setAttribute("normal",new ut(f,3)),this.setAttribute("uv",new ut(d,2));function b(S,E,C,D,U){let w=Math.cos(S),R=Math.sin(S),L=C/E*S,I=Math.cos(L);U.x=D*(2+I)*.5*w,U.y=D*(2+I)*R*.5,U.z=D*Math.sin(L)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new n(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}},$g=class n extends wt{constructor(e=new Dh(new H(-1,-1,0),new H(-1,1,0),new H(1,1,0)),t=64,i=1,r=8,a=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:a};let o=e.computeFrenetFrames(t,a);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;let l=new H,c=new H,f=new Le,d=new H,m=[],p=[],g=[],y=[];T(),this.setIndex(y),this.setAttribute("position",new ut(m,3)),this.setAttribute("normal",new ut(p,3)),this.setAttribute("uv",new ut(g,2));function T(){for(let S=0;S<t;S++)x(S);x(a===!1?t:0),b(),_()}function x(S){d=e.getPointAt(S/t,d);let E=o.normals[S],C=o.binormals[S];for(let D=0;D<=r;D++){let U=D/r*Math.PI*2,w=Math.sin(U),R=-Math.cos(U);c.x=R*E.x+w*C.x,c.y=R*E.y+w*C.y,c.z=R*E.z+w*C.z,c.normalize(),p.push(c.x,c.y,c.z),l.x=d.x+i*c.x,l.y=d.y+i*c.y,l.z=d.z+i*c.z,m.push(l.x,l.y,l.z)}}function _(){for(let S=1;S<=t;S++)for(let E=1;E<=r;E++){let C=(r+1)*(S-1)+(E-1),D=(r+1)*S+(E-1),U=(r+1)*S+E,w=(r+1)*(S-1)+E;y.push(C,D,w),y.push(D,U,w)}}function b(){for(let S=0;S<=t;S++)for(let E=0;E<=r;E++)f.x=S/t,f.y=E/r,g.push(f.x,f.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new n(new rx[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}},jc=class extends wt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){let t=[],i=new Set,r=new H,a=new H;if(e.index!==null){let o=e.attributes.position,l=e.index,c=e.groups;c.length===0&&(c=[{start:0,count:l.count,materialIndex:0}]);for(let f=0,d=c.length;f<d;++f){let m=c[f],p=m.start,g=m.count;for(let y=p,T=p+g;y<T;y+=3)for(let x=0;x<3;x++){let _=l.getX(y+x),b=l.getX(y+(x+1)%3);r.fromBufferAttribute(o,_),a.fromBufferAttribute(o,b),KL(r,a,i)===!0&&(t.push(r.x,r.y,r.z),t.push(a.x,a.y,a.z))}}}else{let o=e.attributes.position;for(let l=0,c=o.count/3;l<c;l++)for(let f=0;f<3;f++){let d=3*l+f,m=3*l+(f+1)%3;r.fromBufferAttribute(o,d),a.fromBufferAttribute(o,m),KL(r,a,i)===!0&&(t.push(r.x,r.y,r.z),t.push(a.x,a.y,a.z))}}this.setAttribute("position",new ut(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}};function KL(n,e,t){let i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}var QL=Object.freeze({__proto__:null,BoxGeometry:Eu,CapsuleGeometry:Lg,CircleGeometry:Ng,ConeGeometry:wh,CylinderGeometry:Wc,DodecahedronGeometry:Pg,EdgesGeometry:Ig,ExtrudeGeometry:Xg,IcosahedronGeometry:qg,LatheGeometry:Yg,OctahedronGeometry:Lh,PlaneGeometry:xo,PolyhedronGeometry:Js,RingGeometry:jg,ShapeGeometry:Zg,SphereGeometry:Nh,TetrahedronGeometry:Kg,TorusGeometry:Qg,TorusKnotGeometry:Jg,TubeGeometry:$g,WireframeGeometry:jc}),e0=class extends bi{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new tt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}};function rf(n){let e={};for(let t in n){e[t]={};for(let i in n[t]){let r=n[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(ot("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone():Array.isArray(r)?e[t][i]=r.slice():e[t][i]=r}}return e}function hr(n){let e={};for(let t=0;t<n.length;t++){let i=rf(n[t]);for(let r in i)e[r]=i[r]}return e}function s8(n){let e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function vw(n){let e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Pt.workingColorSpace}var Zo={clone:rf,merge:hr},l8=`void main() {
10	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
11}`,u8=`void main() {
12	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
13}`,xi=class extends bi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=l8,this.fragmentShader=u8,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=rf(e.uniforms),this.uniformsGroups=s8(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.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let r in this.uniforms){let 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;let i={};for(let r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},Ph=class extends xi{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}},Zc=class extends bi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new tt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new Le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new jr,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},t0=class extends Zc{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Le(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return xt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new tt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new tt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new tt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},n0=class extends bi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new tt(16777215),this.specular=new tt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new Le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new jr,this.combine=qh,this.reflectivity=1,this.envMapIntensity=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.envMapIntensity=e.envMapIntensity,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}},i0=class extends bi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new tt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new Le(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}},r0=class extends bi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new Le(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}},a0=class extends bi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new tt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new Le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new jr,this.combine=qh,this.reflectivity=1,this.envMapIntensity=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.envMapIntensity=e.envMapIntensity,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}},Mu=class extends bi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=aw,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}},wu=class extends bi{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}},o0=class extends bi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new tt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ll,this.normalScale=new Le(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}},s0=class extends Li{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 Pc(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function vP(n){function e(r,a){return n[r]-n[a]}let t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function w2(n,e,t){let i=n.length,r=new n.constructor(i);for(let a=0,o=0;o!==i;++a){let l=t[a]*e;for(let c=0;c!==e;++c)r[o++]=n[l+c]}return r}function yw(n,e,t,i){let r=1,a=n[0];for(;a!==void 0&&a[i]===void 0;)a=n[r++];if(a===void 0)return;let o=a[i];if(o!==void 0)if(Array.isArray(o))do o=a[i],o!==void 0&&(e.push(a.time),t.push(...o)),a=n[r++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[i],o!==void 0&&(e.push(a.time),o.toArray(t,t.length)),a=n[r++];while(a!==void 0);else do o=a[i],o!==void 0&&(e.push(a.time),t.push(o)),a=n[r++];while(a!==void 0)}function c8(n,e,t,i,r=30){let a=n.clone();a.name=e;let o=[];for(let c=0;c<a.tracks.length;++c){let f=a.tracks[c],d=f.getValueSize(),m=[],p=[];for(let g=0;g<f.times.length;++g){let y=f.times[g]*r;if(!(y<t||y>=i)){m.push(f.times[g]);for(let T=0;T<d;++T)p.push(f.values[g*d+T])}}m.length!==0&&(f.times=Pc(m,f.times.constructor),f.values=Pc(p,f.values.constructor),o.push(f))}a.tracks=o;let l=1/0;for(let c=0;c<a.tracks.length;++c)l>a.tracks[c].times[0]&&(l=a.tracks[c].times[0]);for(let c=0;c<a.tracks.length;++c)a.tracks[c].shift(-1*l);return a.resetDuration(),a}function f8(n,e=0,t=n,i=30){i<=0&&(i=30);let r=t.tracks.length,a=e/i;for(let o=0;o<r;++o){let l=t.tracks[o],c=l.ValueTypeName;
vendor: 6,806 bytes, line 13
13if(c==="bool"||c==="string")continue;let f=n.tracks.find(function(_){return _.name===l.name&&_.ValueTypeName===c});if(f===void 0)continue;let d=0,m=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=m/3);let p=0,g=f.getValueSize();f.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=g/3);let y=l.times.length-1,T;if(a<=l.times[0]){let _=d,b=m-d;T=l.values.slice(_,b)}else if(a>=l.times[y]){let _=y*m+d,b=_+m-d;T=l.values.slice(_,b)}else{let _=l.createInterpolant(),b=d,S=m-d;_.evaluate(a),T=_.resultBuffer.slice(b,S)}c==="quaternion"&&new ei().fromArray(T).normalize().conjugate().toArray(T);let x=f.times.length;for(let _=0;_<x;++_){let b=_*g+p;if(c==="quaternion")ei.multiplyQuaternionsFlat(f.values,b,T,0,f.values,b);else{let S=g-p*2;for(let E=0;E<S;++E)f.values[b+E]-=T[E]}}}return n.blendMode=o1,n}var ax=class{static convertArray(e,t){return Pc(e,t)}static isTypedArray(e){return aP(e)}static getKeyframeOrder(e){return vP(e)}static sortedArray(e,t,i){return w2(e,t,i)}static flattenJSON(e,t,i,r){yw(e,t,i,r)}static subclip(e,t,i,r,a=30){return c8(e,t,i,r,a)}static makeClipAdditive(e,t=0,i=e,r=30){return f8(e,t,i,r)}},$s=class{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,r=t[i],a=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let l=i+2;;){if(r===void 0){if(e<a)break i;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===l)break;if(a=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=a)){let l=t[1];e<l&&(i=2,a=l);for(let c=i-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===c)break;if(r=a,a=t[--i-1],e>=a)break t}o=i,i=0;break n}break e}for(;i<o;){let l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],a=t[i-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,a,r)}return this.interpolate_(i,a,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,a=e*r;for(let o=0;o!==r;++o)t[o]=i[a+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},l0=class extends $s{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:vu,endingEnd:vu}}intervalChanged_(e,t,i){let r=this.parameterPositions,a=e-2,o=e+1,l=r[a],c=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case yu:a=e,l=2*t-i;break;case hh:a=r.length-2,l=t+r[a]-r[a+1];break;default:a=e,l=i}if(c===void 0)switch(this.getSettings_().endingEnd){case yu:o=e,c=2*i-t;break;case hh:o=1,c=i+r[1]-r[0];break;default:o=e-1,c=t}let f=(i-t)*.5,d=this.valueSize;this._weightPrev=f/(t-l),this._weightNext=f/(c-i),this._offsetPrev=a*d,this._offsetNext=o*d}interpolate_(e,t,i,r){let a=this.resultBuffer,o=this.sampleValues,l=this.valueSize,c=e*l,f=c-l,d=this._offsetPrev,m=this._offsetNext,p=this._weightPrev,g=this._weightNext,y=(i-t)/(r-t),T=y*y,x=T*y,_=-p*x+2*p*T-p*y,b=(1+p)*x+(-1.5-2*p)*T+(-.5+p)*y+1,S=(-1-g)*x+(1.5+g)*T+.5*y,E=g*x-g*T;for(let C=0;C!==l;++C)a[C]=_*o[d+C]+b*o[f+C]+S*o[c+C]+E*o[m+C];return a}},Ih=class extends $s{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let a=this.resultBuffer,o=this.sampleValues,l=this.valueSize,c=e*l,f=c-l,d=(i-t)/(r-t),m=1-d;for(let p=0;p!==l;++p)a[p]=o[f+p]*m+o[c+p]*d;return a}},u0=class extends $s{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}},c0=class extends $s{interpolate_(e,t,i,r){let a=this.resultBuffer,o=this.sampleValues,l=this.valueSize,c=e*l,f=c-l,d=this.settings||this.DefaultSettings_,m=d.inTangents,p=d.outTangents;if(!m||!p){let T=(i-t)/(r-t),x=1-T;for(let _=0;_!==l;++_)a[_]=o[f+_]*x+o[c+_]*T;return a}let g=l*2,y=e-1;for(let T=0;T!==l;++T){let x=o[f+T],_=o[c+T],b=y*g+T*2,S=p[b],E=p[b+1],C=e*g+T*2,D=m[C],U=m[C+1],w=(i-t)/(r-t),R,L,I,z,B;for(let V=0;V<8;V++){R=w*w,L=R*w,I=1-w,z=I*I,B=z*I;let X=B*t+3*z*w*S+3*I*R*D+L*r-i;if(Math.abs(X)<1e-10)break;let K=3*z*(S-t)+6*I*w*(D-S)+3*R*(r-D);if(Math.abs(K)<1e-10)break;w=w-X/K,w=Math.max(0,Math.min(1,w))}a[T]=B*x+3*z*w*E+3*I*R*U+L*_}return a}},Ar=class{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Pc(t,this.TimeBufferType),this.values=Pc(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:Pc(e.times,Array),values:Pc(e.values,Array)};let r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new u0(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Ih(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new l0(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){let t=new c0(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.settings=this.settings),t}setInterpolation(e){let t;switch(e){case dh:t=this.InterpolantFactoryMethodDiscrete;break;case yg:t=this.InterpolantFactoryMethodLinear;break;case ag:t=this.InterpolantFactoryMethodSmooth;break;case Bb:t=this.InterpolantFactoryMethodBezier;break}if(t===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return ot("KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return dh;case this.InterpolantFactoryMethodLinear:return yg;case this.InterpolantFactoryMethodSmooth:return ag;case this.InterpolantFactoryMethodBezier:return Bb}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){let i=this.times,r=i.length,a=0,o=r-1;for(;a!==r&&i[a]<e;)++a;for(;o!==-1&&i[o]>t;)--o;if(++o,a!==0||o!==r){a>=o&&(o=Math.max(o,1),a=o-1);let l=this.getValueSize();this.times=i.slice(a,o),this.values=this.values.slice(a*l,o*l)}return this}validate(){let e=!0,t=this.getValueSize();
vendor: 19,358 bytes, line 13
13t-Math.floor(t)!==0&&(pt("KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,r=this.values,a=i.length;a===0&&(pt("KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==a;l++){let c=i[l];if(typeof c=="number"&&isNaN(c)){pt("KeyframeTrack: Time is not a valid number.",this,l,c),e=!1;break}if(o!==null&&o>c){pt("KeyframeTrack: Out of order keys.",this,l,c,o),e=!1;break}o=c}if(r!==void 0&&aP(r))for(let l=0,c=r.length;l!==c;++l){let f=r[l];if(isNaN(f)){pt("KeyframeTrack: Value is not a valid number.",this,l,f),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===ag,a=e.length-1,o=1;for(let l=1;l<a;++l){let c=!1,f=e[l],d=e[l+1];if(f!==d&&(l!==1||f!==e[0]))if(r)c=!0;else{let m=l*i,p=m-i,g=m+i;for(let y=0;y!==i;++y){let T=t[m+y];if(T!==t[p+y]||T!==t[g+y]){c=!0;break}}}if(c){if(l!==o){e[o]=e[l];let m=l*i,p=o*i;for(let g=0;g!==i;++g)t[p+g]=t[m+g]}++o}}if(a>0){e[o]=e[a];for(let l=a*i,c=o*i,f=0;f!==i;++f)t[c+f]=t[l+f];++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(){let e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};Ar.prototype.ValueTypeName="";Ar.prototype.TimeBufferType=Float32Array;Ar.prototype.ValueBufferType=Float32Array;Ar.prototype.DefaultInterpolation=yg;var qo=class extends Ar{constructor(e,t,i){super(e,t,i)}};qo.prototype.ValueTypeName="bool";qo.prototype.ValueBufferType=Array;qo.prototype.DefaultInterpolation=dh;qo.prototype.InterpolantFactoryMethodLinear=void 0;qo.prototype.InterpolantFactoryMethodSmooth=void 0;var zh=class extends Ar{constructor(e,t,i,r){super(e,t,i,r)}};zh.prototype.ValueTypeName="color";var Au=class extends Ar{constructor(e,t,i,r){super(e,t,i,r)}};Au.prototype.ValueTypeName="number";var f0=class extends $s{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let a=this.resultBuffer,o=this.sampleValues,l=this.valueSize,c=(i-t)/(r-t),f=e*l;for(let d=f+l;f!==d;f+=4)ei.slerpFlat(a,0,o,f-l,o,f,c);return a}},Cu=class extends Ar{constructor(e,t,i,r){super(e,t,i,r)}InterpolantFactoryMethodLinear(e){return new f0(this.times,this.values,this.getValueSize(),e)}};Cu.prototype.ValueTypeName="quaternion";Cu.prototype.InterpolantFactoryMethodSmooth=void 0;var Yo=class extends Ar{constructor(e,t,i){super(e,t,i)}};Yo.prototype.ValueTypeName="string";Yo.prototype.ValueBufferType=Array;Yo.prototype.DefaultInterpolation=dh;Yo.prototype.InterpolantFactoryMethodLinear=void 0;Yo.prototype.InterpolantFactoryMethodSmooth=void 0;var Ru=class extends Ar{constructor(e,t,i,r){super(e,t,i,r)}};Ru.prototype.ValueTypeName="vector";var Du=class{constructor(e="",t=-1,i=[],r=hv){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Ea(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(h8(i[o]).scale(r));let a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a.userData=JSON.parse(e.userData||"{}"),a}static toJSON(e){let t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let a=0,o=i.length;a!==o;++a)t.push(Ar.toJSON(i[a]));return r}static CreateFromMorphTargetSequence(e,t,i,r){let a=t.length,o=[];for(let l=0;l<a;l++){let c=[],f=[];c.push((l+a-1)%a,l,(l+1)%a),f.push(0,1,0);let d=vP(c);c=w2(c,1,d),f=w2(f,1,d),!r&&c[0]===0&&(c.push(a),f.push(f[0])),o.push(new Au(".morphTargetInfluences["+t[l].name+"]",c,f).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){let r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){let r={},a=/^([\w-]*?)([\d]+)$/;for(let l=0,c=e.length;l<c;l++){let f=e[l],d=f.name.match(a);if(d&&d.length>1){let m=d[1],p=r[m];p||(r[m]=p=[]),p.push(f)}}let o=[];for(let l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(ot("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return pt("AnimationClip: No animation in JSONLoader data."),null;let i=function(m,p,g,y,T){if(g.length!==0){let x=[],_=[];yw(g,x,_,y),x.length!==0&&T.push(new m(p,x,_))}},r=[],a=e.name||"default",o=e.fps||30,l=e.blendMode,c=e.length||-1,f=e.hierarchy||[];for(let m=0;m<f.length;m++){let p=f[m].keys;if(!(!p||p.length===0))if(p[0].morphTargets){let g={},y;for(y=0;y<p.length;y++)if(p[y].morphTargets)for(let T=0;T<p[y].morphTargets.length;T++)g[p[y].morphTargets[T]]=-1;for(let T in g){let x=[],_=[];for(let b=0;b!==p[y].morphTargets.length;++b){let S=p[y];x.push(S.time),_.push(S.morphTarget===T?1:0)}r.push(new Au(".morphTargetInfluence["+T+"]",x,_))}c=g.length*o}else{let g=".bones["+t[m].name+"]";i(Ru,g+".position",p,"pos",r),i(Cu,g+".quaternion",p,"rot",r),i(Ru,g+".scale",p,"scl",r)}}return r.length===0?null:new this(a,c,r,l)}resetDuration(){let e=this.tracks,t=0;for(let i=0,r=e.length;i!==r;++i){let a=this.tracks[i];t=Math.max(t,a.times[a.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let i=0;i<this.tracks.length;i++)e.push(this.tracks[i].clone());let t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}};function d8(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Au;case"vector":case"vector2":case"vector3":case"vector4":return Ru;case"color":return zh;case"quaternion":return Cu;case"bool":case"boolean":return qo;case"string":return Yo}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function h8(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=d8(n.type);if(n.times===void 0){let t=[],i=[];yw(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}var go={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(JL(n)||(this.files[n]=e))},get:function(n){if(this.enabled!==!1&&!JL(n))return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};function JL(n){try{let e=n.slice(n.indexOf(":")+1);return new URL(e).protocol==="blob:"}catch{return!1}}var kh=class{constructor(e,t,i){let r=this,a=!1,o=0,l=0,c,f=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this._abortController=null,this.itemStart=function(d){l++,a===!1&&r.onStart!==void 0&&r.onStart(d,o,l),a=!0},this.itemEnd=function(d){o++,r.onProgress!==void 0&&r.onProgress(d,o,l),o===l&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(d){r.onError!==void 0&&r.onError(d)},this.resolveURL=function(d){return c?c(d):d},this.setURLModifier=function(d){return c=d,this},this.addHandler=function(d,m){return f.push(d,m),this},this.removeHandler=function(d){let m=f.indexOf(d);return m!==-1&&f.splice(m,2),this},this.getHandler=function(d){for(let m=0,p=f.length;m<p;m+=2){let g=f[m],y=f[m+1];if(g.global&&(g.lastIndex=0),g.test(d))return y}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}},_w=new kh,ji=class{constructor(e){this.manager=e!==void 0?e:_w,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){let i=this;return new Promise(function(r,a){i.load(e,r,t,a)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}};ji.DEFAULT_MATERIAL_NAME="__DEFAULT";var Xs={},A2=class extends Error{constructor(e,t){super(e),this.response=t}},ja=class extends ji{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let a=go.get(`file:${e}`);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0),a;if(Xs[e]!==void 0){Xs[e].push({onLoad:t,onProgress:i,onError:r});return}Xs[e]=[],Xs[e].push({onLoad:t,onProgress:i,onError:r});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),l=this.mimeType,c=this.responseType;fetch(o).then(f=>{if(f.status===200||f.status===0){if(f.status===0&&ot("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||f.body===void 0||f.body.getReader===void 0)return f;let d=Xs[e],m=f.body.getReader(),p=f.headers.get("X-File-Size")||f.headers.get("Content-Length"),g=p?parseInt(p):0,y=g!==0,T=0,x=new ReadableStream({start(_){b();function b(){m.read().then(({done:S,value:E})=>{if(S)_.close();else{T+=E.byteLength;let C=new ProgressEvent("progress",{lengthComputable:y,loaded:T,total:g});for(let D=0,U=d.length;D<U;D++){let w=d[D];w.onProgress&&w.onProgress(C)}_.enqueue(E),b()}},S=>{_.error(S)})}}});return new Response(x)}else throw new A2(`fetch for "${f.url}" responded with ${f.status}: ${f.statusText}`,f)}).then(f=>{switch(c){case"arraybuffer":return f.arrayBuffer();case"blob":return f.blob();case"document":return f.text().then(d=>new DOMParser().parseFromString(d,l));case"json":return f.json();default:if(l==="")return f.text();{let m=/charset="?([^;"\s]*)"?/i.exec(l),p=m&&m[1]?m[1].toLowerCase():void 0,g=new TextDecoder(p);return f.arrayBuffer().then(y=>g.decode(y))}}}).then(f=>{go.add(`file:${e}`,f);let d=Xs[e];delete Xs[e];for(let m=0,p=d.length;m<p;m++){let g=d[m];g.onLoad&&g.onLoad(f)}}).catch(f=>{let d=Xs[e];if(d===void 0)throw this.manager.itemError(e),f;delete Xs[e];for(let m=0,p=d.length;m<p;m++){let g=d[m];g.onError&&g.onError(f)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},ox=class extends ji{constructor(e){super(e)}load(e,t,i,r){let a=this,o=new ja(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(a.parse(JSON.parse(l)))}catch(c){r?r(c):pt(c),a.manager.itemError(e)}},i,r)}parse(e){let t=[];for(let i=0;i<e.length;i++){let r=Du.parse(e[i]);t.push(r)}return t}},sx=class extends ji{constructor(e){super(e)}load(e,t,i,r){let a=this,o=[],l=new Gc,c=new ja(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(a.withCredentials);let f=0;function d(m){c.load(e[m],function(p){let g=a.parse(p,!0);o[m]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},f+=1,f===6&&(g.mipmapCount===1&&(l.minFilter=dn),l.image=o,l.format=g.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let m=0,p=e.length;m<p;++m)d(m);else c.load(e,function(m){let p=a.parse(m,!0);if(p.isCubemap){let g=p.mipmaps.length/p.mipmapCount;for(let y=0;y<g;y++){o[y]={mipmaps:[]};for(let T=0;T<p.mipmapCount;T++)o[y].mipmaps.push(p.mipmaps[y*p.mipmapCount+T]),o[y].format=p.format,o[y].width=p.width,o[y].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=dn),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}},ih=new WeakMap,Uu=class extends ji{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let a=this,o=go.get(`image:${e}`);if(o!==void 0){if(o.complete===!0)a.manager.itemStart(e),setTimeout(function(){t&&t(o),a.manager.itemEnd(e)},0);else{let m=ih.get(o);m===void 0&&(m=[],ih.set(o,m)),m.push({onLoad:t,onError:r})}return o}let l=gh("img");function c(){d(),t&&t(this);let m=ih.get(this)||[];for(let p=0;p<m.length;p++){let g=m[p];g.onLoad&&g.onLoad(this)}ih.delete(this),a.manager.itemEnd(e)}function f(m){d(),r&&r(m),go.remove(`image:${e}`);let p=ih.get(this)||[];for(let g=0;g<p.length;g++){let y=p[g];y.onError&&y.onError(m)}ih.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function d(){l.removeEventListener("load",c,!1),l.removeEventListener("error",f,!1)}return l.addEventListener("load",c,!1),l.addEventListener("error",f,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),go.add(`image:${e}`,l),a.manager.itemStart(e),l.src=e,l}},lx=class extends ji{constructor(e){super(e)}load(e,t,i,r){let a=new Tu;a.colorSpace=Oi;let o=new Uu(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function c(f){o.load(e[f],function(d){a.images[f]=d,l++,l===6&&(a.needsUpdate=!0,t&&t(a))},void 0,r)}for(let f=0;f<e.length;++f)c(f);return a}},ux=class extends ji{constructor(e){super(e)}load(e,t,i,r){let a=this,o=new wr,l=new ja(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(a.withCredentials),l.load(e,function(c){let f;try{f=a.parse(c)}catch(d){if(r!==void 0)r(d);else{d(d);return}}f.image!==void 0?o.image=f.image:f.data!==void 0&&(o.image.width=f.width,o.image.height=f.height,o.image.data=f.data),o.wrapS=f.wrapS!==void 0?f.wrapS:Mr,o.wrapT=f.wrapT!==void 0?f.wrapT:Mr,o.magFilter=f.magFilter!==void 0?f.magFilter:dn,o.minFilter=f.minFilter!==void 0?f.minFilter:dn,o.anisotropy=f.anisotropy!==void 0?f.anisotropy:1,f.colorSpace!==void 0&&(o.colorSpace=f.colorSpace),f.flipY!==void 0&&(o.flipY=f.flipY),f.format!==void 0&&(o.format=f.format),f.type!==void 0&&(o.type=f.type),f.mipmaps!==void 0&&(o.mipmaps=f.mipmaps,o.minFilter=Mo),f.mipmapCount===1&&(o.minFilter=dn),f.generateMipmaps!==void 0&&(o.generateMipmaps=f.generateMipmaps),o.needsUpdate=!0,t&&t(o,f)},i,r),o}},cx=class extends ji{constructor(e){super(e)}load(e,t,i,r){let a=new Bn,o=new Uu(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){a.image=l,a.needsUpdate=!0,t!==void 0&&t(a)},i,r),a}},So=class extends $t{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new tt(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}},d0=class extends So{constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy($t.DEFAULT_UP),this.updateMatrix(),this.groundColor=new tt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){let t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}},m2=new mt,$L=new H,eN=new H,h0=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Le(512,512),this.mapType=Ki,this.map=null,this.mapPass=null,this.matrix=new mt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ks,this._frameExtents=new Le(1,1),this._viewportCount=1,this._viewports=[new Nt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;$L.setFromMatrixPosition(e.matrixWorld),t.position.copy($L),eN.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(eN),t.updateMatrixWorld(),m2.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(m2,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===xu||t.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(m2)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},Db=new H,Ub=new ei,Vo=new H,Kc=class extends $t{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new mt,this.projectionMatrix=new mt,this.projectionMatrixInverse=new mt,this.coordinateSystem=Yr,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}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.matrixWorld.decompose(Db,Ub,Vo),Vo.x===1&&Vo.y===1&&Vo.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Db,Ub,Vo.set(1,1,1)).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorld.decompose(Db,Ub,Vo),Vo.x===1&&Vo.y===1&&Vo.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Db,Ub,Vo.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}},pu=new H,tN=new Le,nN=new Le,Tn=class extends Kc{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){let t=.5*this.getFilmHeight()/e;this.fov=zc*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Ic*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 4,950 bytes, line 13
13getEffectiveFOV(){return zc*2*Math.atan(Math.tan(Ic*.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){pu.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(pu.x,pu.y).multiplyScalar(-e/pu.z),pu.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(pu.x,pu.y).multiplyScalar(-e/pu.z)}getViewSize(e,t){return this.getViewBounds(e,tN,nN),t.subVectors(nN,tN)}setViewOffset(e,t,i,r,a,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=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Ic*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,a=-.5*r,o=this.view;if(this.view!==null&&this.view.enabled){let c=o.fullWidth,f=o.fullHeight;a+=o.offsetX*r/c,t-=o.offsetY*i/f,r*=o.width/c,i*=o.height/f}let l=this.filmOffset;l!==0&&(a+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let 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}},C2=class extends h0{constructor(){super(new Tn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,i=zc*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,a=e.distance||t.far;(i!==t.fov||r!==t.aspect||a!==t.far)&&(t.fov=i,t.aspect=r,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},p0=class extends So{constructor(e,t,i=0,r=Math.PI/3,a=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy($t.DEFAULT_UP),this.updateMatrix(),this.target=new $t,this.distance=i,this.angle=r,this.penumbra=a,this.decay=o,this.map=null,this.shadow=new C2}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}},R2=class extends h0{constructor(){super(new Tn(90,1,.5,500)),this.isPointLightShadow=!0}},m0=class extends So{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new R2}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}},Kr=class extends Kc{constructor(e=-1,t=1,i=1,r=-1,a=.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=a,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,a,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=a,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let 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,a=i-e,o=i+e,l=r+t,c=r-t;if(this.view!==null&&this.view.enabled){let f=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=f*this.view.offsetX,o=a+f*this.view.width,l-=d*this.view.offsetY,c=l-d*this.view.height}
vendor: 44,741 bytes, line 13
13this.projectionMatrix.makeOrthographic(a,o,l,c,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let 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}},D2=class extends h0{constructor(){super(new Kr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},g0=class extends So{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy($t.DEFAULT_UP),this.updateMatrix(),this.target=new $t,this.shadow=new D2}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},v0=class extends So{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}},y0=class extends So{constructor(e,t,i=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}},Fh=class{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new H)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let i=e.x,r=e.y,a=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*a),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*a)),t.addScaledVector(o[6],.315392*(3*a*a-1)),t.addScaledVector(o[7],1.092548*(i*a)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){let i=e.x,r=e.y,a=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*a),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*a),t.addScaledVector(o[6],.743125*a*a-.247708),t.addScaledVector(o[7],2*.429043*i*a),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){let i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){let i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){let i=e.x,r=e.y,a=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*a,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*a,t[6]=.315392*(3*a*a-1),t[7]=1.092548*i*a,t[8]=.546274*(i*i-r*r)}},_0=class extends So{constructor(e=new Fh,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}},b0=class n extends ji{constructor(e){super(e),this.textures={}}load(e,t,i,r){let a=this,o=new ja(a.manager);o.setPath(a.path),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(e,function(l){try{t(a.parse(JSON.parse(l)))}catch(c){r?r(c):pt(c),a.manager.itemError(e)}},i,r)}parse(e){let t=this.textures;function i(a){return t[a]===void 0&&ot("MaterialLoader: Undefined texture",a),t[a]}let r=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new tt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(r.allowOverride=e.allowOverride),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let a in e.uniforms){let o=e.uniforms[a];switch(r.uniforms[a]={},o.type){case"t":r.uniforms[a].value=i(o.value);break;case"c":r.uniforms[a].value=new tt().setHex(o.value);break;case"v2":r.uniforms[a].value=new Le().fromArray(o.value);break;case"v3":r.uniforms[a].value=new H().fromArray(o.value);break;case"v4":r.uniforms[a].value=new Nt().fromArray(o.value);break;case"m3":r.uniforms[a].value=new Et().fromArray(o.value);break;case"m4":r.uniforms[a].value=new mt().fromArray(o.value);break;default:r.uniforms[a].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(let a in e.extensions)r.extensions[a]=e.extensions[a];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 a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),r.normalScale=new Le().fromArray(a)}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 Le().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}createMaterialFromType(e){return n.createMaterialFromType(e)}static createMaterialFromType(e){let t={ShadowMaterial:e0,SpriteMaterial:Sh,RawShaderMaterial:Ph,ShaderMaterial:xi,PointsMaterial:Eh,MeshPhysicalMaterial:t0,MeshStandardMaterial:Zc,MeshPhongMaterial:n0,MeshToonMaterial:i0,MeshNormalMaterial:r0,MeshLambertMaterial:a0,MeshDepthMaterial:Mu,MeshDistanceMaterial:wu,MeshBasicMaterial:Aa,MeshMatcapMaterial:o0,LineDashedMaterial:s0,LineBasicMaterial:Li,Material:bi};return new t[e]}},Bh=class{static extractUrlBase(e){let t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},el=class extends wt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}},x0=class extends ji{constructor(e){super(e)}load(e,t,i,r){let a=this,o=new ja(a.manager);o.setPath(a.path),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(e,function(l){try{t(a.parse(JSON.parse(l)))}catch(c){r?r(c):pt(c),a.manager.itemError(e)}},i,r)}parse(e){let t={},i={};function r(g,y){if(t[y]!==void 0)return t[y];let x=g.interleavedBuffers[y],_=a(g,x.buffer),b=lh(x.type,_),S=new Vc(b,x.stride);return S.uuid=x.uuid,t[y]=S,S}function a(g,y){if(i[y]!==void 0)return i[y];let x=g.arrayBuffers[y],_=new Uint32Array(x).buffer;return i[y]=_,_}let o=e.isInstancedBufferGeometry?new el:new wt,l=e.data.index;if(l!==void 0){let g=lh(l.type,l.array);o.setIndex(new an(g,1))}let c=e.data.attributes;for(let g in c){let y=c[g],T;if(y.isInterleavedBufferAttribute){let x=r(e.data,y.data);T=new dr(x,y.itemSize,y.offset,y.normalized)}else{let x=lh(y.type,y.array),_=y.isInstancedBufferAttribute?_o:an;T=new _(x,y.itemSize,y.normalized)}y.name!==void 0&&(T.name=y.name),y.usage!==void 0&&T.setUsage(y.usage),o.setAttribute(g,T)}let f=e.data.morphAttributes;if(f)for(let g in f){let y=f[g],T=[];for(let x=0,_=y.length;x<_;x++){let b=y[x],S;if(b.isInterleavedBufferAttribute){let E=r(e.data,b.data);S=new dr(E,b.itemSize,b.offset,b.normalized)}else{let E=lh(b.type,b.array);S=new an(E,b.itemSize,b.normalized)}b.name!==void 0&&(S.name=b.name),T.push(S)}o.morphAttributes[g]=T}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);let m=e.data.groups||e.data.drawcalls||e.data.offsets;if(m!==void 0)for(let g=0,y=m.length;g!==y;++g){let T=m[g];o.addGroup(T.start,T.count,T.materialIndex)}let p=e.data.boundingSphere;return p!==void 0&&(o.boundingSphere=new En().fromJSON(p)),e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}},fx=class extends ji{constructor(e){super(e)}load(e,t,i,r){let a=this,o=this.path===""?Bh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;let l=new ja(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){let f=null;try{f=JSON.parse(c)}catch(m){r!==void 0&&r(m),m("ObjectLoader: Can't parse "+e+".",m.message);return}let d=f.metadata;if(d===void 0||d.type===void 0||d.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),pt("ObjectLoader: Can't load "+e);return}a.parse(f,t)},i,r)}async loadAsync(e,t){let i=this,r=this.path===""?Bh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;let a=new ja(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials);let o=await a.loadAsync(e,t),l;try{l=JSON.parse(o)}catch(f){throw new Error("ObjectLoader: Can't parse "+e+". "+f.message)}let c=l.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){let i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),a=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(f)}),l=this.parseTextures(e.textures,o),c=this.parseMaterials(e.materials,l),f=this.parseObject(e.object,a,c,l,i),d=this.parseSkeletons(e.skeletons,f);if(this.bindSkeletons(f,d),this.bindLightTargets(f),t!==void 0){let m=!1;for(let p in o)if(o[p].data instanceof HTMLImageElement){m=!0;break}m===!1&&t(f)}return f}async parseAsync(e){let t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),a=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,a),l=this.parseMaterials(e.materials,o),c=this.parseObject(e.object,r,l,o,t),f=this.parseSkeletons(e.skeletons,c);return this.bindSkeletons(c,f),this.bindLightTargets(c),c}parseShapes(e){let t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){let a=new Ma().fromJSON(e[i]);t[a.uuid]=a}return t}parseSkeletons(e,t){let i={},r={};if(t.traverse(function(a){a.isBone&&(r[a.uuid]=a)}),e!==void 0)for(let a=0,o=e.length;a<o;a++){let l=new Mg().fromJSON(e[a],r);i[l.uuid]=l}return i}parseGeometries(e,t){let i={};if(e!==void 0){let r=new x0;for(let a=0,o=e.length;a<o;a++){let l,c=e[a];switch(c.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(c);break;default:c.type in QL?l=QL[c.type].fromJSON(c,t):ot(`ObjectLoader: Unsupported geometry type "${c.type}"`)}l.uuid=c.uuid,c.name!==void 0&&(l.name=c.name),c.userData!==void 0&&(l.userData=c.userData),i[c.uuid]=l}}return i}parseMaterials(e,t){let i={},r={};if(e!==void 0){let a=new b0;a.setTextures(t);for(let o=0,l=e.length;o<l;o++){let c=e[o];i[c.uuid]===void 0&&(i[c.uuid]=a.parse(c)),r[c.uuid]=i[c.uuid]}}return r}parseAnimations(e){let t={};if(e!==void 0)for(let i=0;i<e.length;i++){let r=e[i],a=Du.parse(r);t[a.uuid]=a}return t}parseImages(e,t){let i=this,r={},a;function o(c){return i.manager.itemStart(c),a.load(c,function(){i.manager.itemEnd(c)},void 0,function(){i.manager.itemError(c),i.manager.itemEnd(c)})}function l(c){if(typeof c=="string"){let f=c,d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(f)?f:i.resourcePath+f;return o(d)}else return c.data?{data:lh(c.type,c.data),width:c.width,height:c.height}:null}if(e!==void 0&&e.length>0){let c=new kh(t);a=new Uu(c),a.setCrossOrigin(this.crossOrigin);for(let f=0,d=e.length;f<d;f++){let m=e[f],p=m.url;if(Array.isArray(p)){let g=[];for(let y=0,T=p.length;y<T;y++){let x=p[y],_=l(x);_!==null&&(_ instanceof HTMLImageElement?g.push(_):g.push(new wr(_.data,_.width,_.height)))}r[m.uuid]=new mo(g)}else{let g=l(m.url);r[m.uuid]=new mo(g)}}}return r}async parseImagesAsync(e){let t=this,i={},r;async function a(o){if(typeof o=="string"){let l=o,c=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(c)}else return o.data?{data:lh(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new Uu(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){let c=e[o],f=c.url;if(Array.isArray(f)){let d=[];for(let m=0,p=f.length;m<p;m++){let g=f[m],y=await a(g);y!==null&&(y instanceof HTMLImageElement?d.push(y):d.push(new wr(y.data,y.width,y.height)))}i[c.uuid]=new mo(d)}else{let d=await a(c.url);i[c.uuid]=new mo(d)}}}return i}parseTextures(e,t){function i(a,o){return typeof a=="number"?a:(ot("ObjectLoader.parseTexture: Constant should be in numeric form.",a),o[a])}let r={};if(e!==void 0)for(let a=0,o=e.length;a<o;a++){let l=e[a];l.image===void 0&&ot('ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&ot("ObjectLoader: Undefined image",l.image);let c=t[l.image],f=c.data,d;Array.isArray(f)?(d=new Tu,f.length===6&&(d.needsUpdate=!0)):(f&&f.data?d=new wr:d=new Bn,f&&(d.needsUpdate=!0)),d.source=c,d.uuid=l.uuid,l.name!==void 0&&(d.name=l.name),l.mapping!==void 0&&(d.mapping=i(l.mapping,p8)),l.channel!==void 0&&(d.channel=l.channel),l.offset!==void 0&&d.offset.fromArray(l.offset),l.repeat!==void 0&&d.repeat.fromArray(l.repeat),l.center!==void 0&&d.center.fromArray(l.center),l.rotation!==void 0&&(d.rotation=l.rotation),l.wrap!==void 0&&(d.wrapS=i(l.wrap[0],iN),d.wrapT=i(l.wrap[1],iN)),l.format!==void 0&&(d.format=l.format),l.internalFormat!==void 0&&(d.internalFormat=l.internalFormat),l.type!==void 0&&(d.type=l.type),l.colorSpace!==void 0&&(d.colorSpace=l.colorSpace),l.minFilter!==void 0&&(d.minFilter=i(l.minFilter,rN)),l.magFilter!==void 0&&(d.magFilter=i(l.magFilter,rN)),l.anisotropy!==void 0&&(d.anisotropy=l.anisotropy),l.flipY!==void 0&&(d.flipY=l.flipY),l.generateMipmaps!==void 0&&(d.generateMipmaps=l.generateMipmaps),l.premultiplyAlpha!==void 0&&(d.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(d.unpackAlignment=l.unpackAlignment),l.compareFunction!==void 0&&(d.compareFunction=l.compareFunction),l.userData!==void 0&&(d.userData=l.userData),r[l.uuid]=d}return r}parseObject(e,t,i,r,a){let o;function l(p){return t[p]===void 0&&ot("ObjectLoader: Undefined geometry",p),t[p]}function c(p){if(p!==void 0){if(Array.isArray(p)){let g=[];for(let y=0,T=p.length;y<T;y++){let x=p[y];i[x]===void 0&&ot("ObjectLoader: Undefined material",x),g.push(i[x])}return g}return i[p]===void 0&&ot("ObjectLoader: Undefined material",p),i[p]}}function f(p){return r[p]===void 0&&ot("ObjectLoader: Undefined texture",p),r[p]}let d,m;switch(e.type){case"Scene":o=new Hc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new tt(e.background):o.background=f(e.background)),e.environment!==void 0&&(o.environment=f(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new xg(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new bg(e.fog.color,e.fog.density)),e.fog.name!==""&&(o.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(o.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(o.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&o.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(o.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&o.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":o=new Tn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new Kr(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new v0(e.color,e.intensity);break;case"DirectionalLight":o=new g0(e.color,e.intensity),o.target=e.target||"";break;case"PointLight":o=new m0(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new y0(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new p0(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),o.target=e.target||"";break;case"HemisphereLight":o=new d0(e.color,e.groundColor,e.intensity);break;case"LightProbe":let p=new Fh().fromArray(e.sh);o=new _0(p,e.intensity);break;case"SkinnedMesh":d=l(e.geometry),m=c(e.material),o=new Eg(d,m),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":d=l(e.geometry),m=c(e.material),o=new ln(d,m);break;case"InstancedMesh":d=l(e.geometry),m=c(e.material);let g=e.count,y=e.instanceMatrix,T=e.instanceColor;o=new wg(d,m,g),o.instanceMatrix=new _o(new Float32Array(y.array),16),T!==void 0&&(o.instanceColor=new _o(new Float32Array(T.array),T.itemSize));break;case"BatchedMesh":d=l(e.geometry),m=c(e.material),o=new Cg(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,m),o.geometry=d,o.perObjectFrustumCulled=e.perObjectFrustumCulled,o.sortObjects=e.sortObjects,o._drawRanges=e.drawRanges,o._reservedRanges=e.reservedRanges,o._geometryInfo=e.geometryInfo.map(x=>{let _=null,b=null;return x.boundingBox!==void 0&&(_=new bn().fromJSON(x.boundingBox)),x.boundingSphere!==void 0&&(b=new En().fromJSON(x.boundingSphere)),{...x,boundingBox:_,boundingSphere:b}}),o._instanceInfo=e.instanceInfo,o._availableInstanceIds=e._availableInstanceIds,o._availableGeometryIds=e._availableGeometryIds,o._nextIndexStart=e.nextIndexStart,o._nextVertexStart=e.nextVertexStart,o._geometryCount=e.geometryCount,o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._matricesTexture=f(e.matricesTexture.uuid),o._indirectTexture=f(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=f(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(o.boundingSphere=new En().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(o.boundingBox=new bn().fromJSON(e.boundingBox));break;case"LOD":o=new Tg;break;case"Line":o=new bo(l(e.geometry),c(e.material));break;case"LineLoop":o=new Rg(l(e.geometry),c(e.material));break;case"LineSegments":o=new Ca(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":o=new Dg(l(e.geometry),c(e.material));break;case"Sprite":o=new Sg(c(e.material));break;case"Group":o=new Ys;break;case"Bone":o=new Th;break;default:o=new $t}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.pivot!==void 0&&(o.pivot=new H().fromArray(e.pivot)),e.morphTargetDictionary!==void 0&&(o.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),e.morphTargetInfluences!==void 0&&(o.morphTargetInfluences=e.morphTargetInfluences.slice()),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.static!==void 0&&(o.static=e.static),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){let p=e.children;for(let g=0;g<p.length;g++)o.add(this.parseObject(p[g],t,i,r,a))}if(e.animations!==void 0){let p=e.animations;for(let g=0;g<p.length;g++){let y=p[g];o.animations.push(a[y])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);let p=e.levels;for(let g=0;g<p.length;g++){let y=p[g],T=o.getObjectByProperty("uuid",y.object);T!==void 0&&o.addLevel(T,y.distance,y.hysteresis)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){let r=t[i.skeleton];r===void 0?ot("ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){let i=t.target,r=e.getObjectByProperty("uuid",i);r!==void 0?t.target=r:t.target=new $t}})}},p8={UVMapping:C0,CubeReflectionMapping:Eo,CubeRefractionMapping:ol,EquirectangularReflectionMapping:Yh,EquirectangularRefractionMapping:jh,CubeUVReflectionMapping:$c},iN={RepeatWrapping:ch,ClampToEdgeWrapping:Mr,MirroredRepeatWrapping:fh},rN={NearestFilter:Yn,NearestMipmapNearestFilter:$x,NearestMipmapLinearFilter:ef,LinearFilter:dn,LinearMipmapNearestFilter:Zh,LinearMipmapLinearFilter:Mo},g2=new WeakMap,dx=class extends ji{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&ot("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&ot("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}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);let a=this,o=go.get(`image-bitmap:${e}`);if(o!==void 0){if(a.manager.itemStart(e),o.then){o.then(f=>{if(g2.has(o)===!0)r&&r(g2.get(o)),a.manager.itemError(e),a.manager.itemEnd(e);else return t&&t(f),a.manager.itemEnd(e),f});return}return setTimeout(function(){t&&t(o),a.manager.itemEnd(e)},0),o}let l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,l.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let c=fetch(e,l).then(function(f){return f.blob()}).then(function(f){return createImageBitmap(f,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(f){return go.add(`image-bitmap:${e}`,f),t&&t(f),a.manager.itemEnd(e),f}).catch(function(f){r&&r(f),g2.set(c,f),go.remove(`image-bitmap:${e}`),a.manager.itemError(e),a.manager.itemEnd(e)});go.add(`image-bitmap:${e}`,c),a.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},Ob,Hh=class{static getContext(){return Ob===void 0&&(Ob=new(window.AudioContext||window.webkitAudioContext)),Ob}static setContext(e){Ob=e}},hx=class extends ji{constructor(e){super(e)}load(e,t,i,r){let a=this,o=new ja(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(c){try{let f=c.slice(0);Hh.getContext().decodeAudioData(f,function(m){t(m)}).catch(l)}catch(f){l(f)}},i,r);function l(c){r?r(c):pt(c),a.manager.itemError(e)}}},aN=new mt,oN=new mt,Rc=new mt,px=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Tn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Tn,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){let 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,Rc.copy(e.projectionMatrix);let r=t.eyeSep/2,a=r*t.near/t.focus,o=t.near*Math.tan(Ic*t.fov*.5)/t.zoom,l,c;oN.elements[12]=-r,aN.elements[12]=r,l=-o*t.aspect+a,c=o*t.aspect+a,Rc.elements[0]=2*t.near/(c-l),Rc.elements[8]=(c+l)/(c-l),this.cameraL.projectionMatrix.copy(Rc),l=-o*t.aspect-a,c=o*t.aspect-a,Rc.elements[0]=2*t.near/(c-l),Rc.elements[8]=(c+l)/(c-l),this.cameraR.projectionMatrix.copy(Rc)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(oN),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(aN)}},rh=-90,ah=1,S0=class extends $t{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new Tn(rh,ah,e,t);r.layers=this.layers,this.add(r);let a=new Tn(rh,ah,e,t);a.layers=this.layers,this.add(a);let o=new Tn(rh,ah,e,t);o.layers=this.layers,this.add(o);let l=new Tn(rh,ah,e,t);l.layers=this.layers,this.add(l);let c=new Tn(rh,ah,e,t);c.layers=this.layers,this.add(c);let f=new Tn(rh,ah,e,t);f.layers=this.layers,this.add(f)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,r,a,o,l,c]=t;for(let f of t)this.remove(f);if(e===Yr)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===xu)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let f of t)this.add(f),f.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[a,o,l,c,f,d]=this.children,m=e.getRenderTarget(),p=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;let T=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let x=!1;e.isWebGLRenderer===!0?x=e.state.buffers.depth.getReversed():x=e.reversedDepthBuffer,e.setRenderTarget(i,0,r),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(i,1,r),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(i,2,r),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(i,3,r),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),e.setRenderTarget(i,4,r),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,f),i.texture.generateMipmaps=T,e.setRenderTarget(i,5,r),x&&e.autoClear===!1&&e.clearDepth(),e.render(t,d),e.setRenderTarget(m,p,g),e.xr.enabled=y,i.texture.needsPMREMUpdate=!0}},T0=class extends Tn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},E0=class{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=m8.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}};function m8(){this._document.hidden===!1&&this.reset()}var Dc=new H,v2=new ei,g8=new H,Uc=new H,Oc=new H,mx=class extends $t{constructor(){super(),this.type="AudioListener",this.context=Hh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new E0}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),this._timer.update();let t=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(Dc,v2,g8),Uc.set(0,0,-1).applyQuaternion(v2),Oc.set(0,1,0).applyQuaternion(v2),t.positionX){let i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Dc.x,i),t.positionY.linearRampToValueAtTime(Dc.y,i),t.positionZ.linearRampToValueAtTime(Dc.z,i),t.forwardX.linearRampToValueAtTime(Uc.x,i),t.forwardY.linearRampToValueAtTime(Uc.y,i),t.forwardZ.linearRampToValueAtTime(Uc.z,i),t.upX.linearRampToValueAtTime(Oc.x,i),t.upY.linearRampToValueAtTime(Oc.y,i),t.upZ.linearRampToValueAtTime(Oc.z,i)}else t.setPosition(Dc.x,Dc.y,Dc.z),t.setOrientation(Uc.x,Uc.y,Uc.z,Oc.x,Oc.y,Oc.z)}},M0=class extends $t{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){ot("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){ot("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;let 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){ot("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){ot("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){ot("Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(ot("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){ot("Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(ot("Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}},Lc=new H,sN=new ei,v8=new H,Nc=new H,gx=class extends M0{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Lc,sN,v8),Nc.set(0,0,1).applyQuaternion(sN);let t=this.panner;if(t.positionX){let i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Lc.x,i),t.positionY.linearRampToValueAtTime(Lc.y,i),t.positionZ.linearRampToValueAtTime(Lc.z,i),t.orientationX.linearRampToValueAtTime(Nc.x,i),t.orientationY.linearRampToValueAtTime(Nc.y,i),t.orientationZ.linearRampToValueAtTime(Nc.z,i)}else t.setPosition(Lc.x,Lc.y,Lc.z),t.setOrientation(Nc.x,Nc.y,Nc.z)}},vx=class{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0,t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}},w0=class{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,a,o;switch(t){case"quaternion":r=this._slerp,a=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,a=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,a=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=a,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){let i=this.buffer,r=this.valueSize,a=e*r+r,o=this.cumulativeWeight;if(o===0){for(let l=0;l!==r;++l)i[a+l]=i[l];o=t}else{o+=t;let l=t/o;this._mixBufferRegion(i,a,0,l,r)}this.cumulativeWeight=o}accumulateAdditive(e){let t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,i=this.buffer,r=e*t+t,a=this.cumulativeWeight,o=this.cumulativeWeightAdditive,l=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){let c=t*this._origIndex;this._mixBufferRegion(i,r,c,1-a,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);
vendor: 4,240 bytes, line 13
13for(let c=t,f=t+t;c!==f;++c)if(i[c]!==i[c+t]){l.setValue(i,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let a=i,o=r;a!==o;++a)t[a]=t[r+a%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,a){if(r>=.5)for(let o=0;o!==a;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){ei.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,a){let o=this._workIndex*a;ei.multiplyQuaternionsFlat(e,o,e,t,e,i),ei.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,a){let o=1-r;for(let l=0;l!==a;++l){let c=t+l;e[c]=e[c]*o+e[i+l]*r}}_lerpAdditive(e,t,i,r,a){for(let o=0;o!==a;++o){let l=t+o;e[l]=e[l]+e[i+o]*r}}},bw="\\[\\]\\.:\\/",y8=new RegExp("["+bw+"]","g"),xw="[^"+bw+"]",_8="[^"+bw.replace("\\.","")+"]",b8=/((?:WC+[\/:])*)/.source.replace("WC",xw),x8=/(WCOD+)?/.source.replace("WCOD",_8),S8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xw),T8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xw),E8=new RegExp("^"+b8+x8+S8+T8+"$"),M8=["material","materials","bones","map"],U2=class{constructor(e,t,i){let r=i||sn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=i.length;r!==a;++r)i[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},sn=class n{constructor(e,t,i){this.path=t,this.parsedPath=i||n.parseTrackName(t),this.node=n.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 n.Composite(e,t,i):new n(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(y8,"")}static parseTrackName(e){let t=E8.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let 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){let a=i.nodeName.substring(r+1);M8.indexOf(a)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=a)}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){let i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){let i=function(a){for(let o=0;o<a.length;o++){let l=a[o];if(l.name===t||l.uuid===t)return l;let c=i(l.children);if(c)return c}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,149 bytes, line 13
13_setValue_array_setMatrixWorldNeedsUpdate(e,t){let i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,i=t.objectName,r=t.propertyName,a=t.propertyIndex;if(e||(e=n.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){ot("PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let f=t.objectIndex;switch(i){case"materials":if(!e.material){pt("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){pt("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){pt("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===f){f=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){pt("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){pt("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){pt("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(f!==void 0){if(e[f]===void 0){pt("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[f]}}let o=e[r];if(o===void 0){let f=t.nodeName;pt("PropertyBinding: Trying to update property for track: "+f+"."+r+" but it wasn't found.",e);return}let l=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?l=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(a!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){pt("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){pt("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[a]!==void 0&&(a=e.morphTargetDictionary[a])}c=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=a}else o.fromArray!==void 0&&o.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(c=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};sn.Composite=U2;sn.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};sn.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};sn.prototype.GetterByBindingType=[sn.prototype._getValue_direct,sn.prototype._getValue_array,sn.prototype._getValue_arrayElement,sn.prototype._getValue_toArray];sn.prototype.SetterByBindingTypeAndVersioning=[[sn.prototype._setValue_direct,sn.prototype._setValue_direct_setNeedsUpdate,sn.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[sn.prototype._setValue_array,sn.prototype._setValue_array_setNeedsUpdate,sn.prototype._setValue_array_setMatr
vendor: 16,511 bytes, line 13
13ixWorldNeedsUpdate],[sn.prototype._setValue_arrayElement,sn.prototype._setValue_arrayElement_setNeedsUpdate,sn.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[sn.prototype._setValue_fromArray,sn.prototype._setValue_fromArray_setNeedsUpdate,sn.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var yx=class{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Ea(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){let e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length,l,c=e.length,f=this.nCachedObjects_;for(let d=0,m=arguments.length;d!==m;++d){let p=arguments[d],g=p.uuid,y=t[g];if(y===void 0){y=c++,t[g]=y,e.push(p);for(let T=0,x=o;T!==x;++T)a[T].push(new sn(p,i[T],r[T]))}else if(y<f){l=e[y];let T=--f,x=e[T];t[x.uuid]=y,e[y]=x,t[g]=T,e[T]=p;for(let _=0,b=o;_!==b;++_){let S=a[_],E=S[T],C=S[y];S[y]=E,C===void 0&&(C=new sn(p,i[_],r[_])),S[T]=C}}else e[y]!==l&&pt("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=f}remove(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length,a=this.nCachedObjects_;for(let o=0,l=arguments.length;o!==l;++o){let c=arguments[o],f=c.uuid,d=t[f];if(d!==void 0&&d>=a){let m=a++,p=e[m];t[p.uuid]=d,e[d]=p,t[f]=m,e[m]=c;for(let g=0,y=r;g!==y;++g){let T=i[g],x=T[m],_=T[d];T[d]=x,T[m]=_}}}this.nCachedObjects_=a}uncache(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length,a=this.nCachedObjects_,o=e.length;for(let l=0,c=arguments.length;l!==c;++l){let f=arguments[l],d=f.uuid,m=t[d];if(m!==void 0)if(delete t[d],m<a){let p=--a,g=e[p],y=--o,T=e[y];t[g.uuid]=m,e[m]=g,t[T.uuid]=p,e[p]=T,e.pop();for(let x=0,_=r;x!==_;++x){let b=i[x],S=b[p],E=b[y];b[m]=S,b[p]=E,b.pop()}}else{let p=--o,g=e[p];p>0&&(t[g.uuid]=m),e[m]=g,e.pop();for(let y=0,T=r;y!==T;++y){let x=i[y];x[m]=x[p],x.pop()}}}this.nCachedObjects_=a}subscribe_(e,t){let i=this._bindingsIndicesByPath,r=i[e],a=this._bindings;if(r!==void 0)return a[r];let o=this._paths,l=this._parsedPaths,c=this._objects,f=c.length,d=this.nCachedObjects_,m=new Array(f);r=a.length,i[e]=r,o.push(e),l.push(t),a.push(m);for(let p=d,g=c.length;p!==g;++p){let y=c[p];m[p]=new sn(y,e,t)}return m}unsubscribe_(e){let t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){let r=this._paths,a=this._parsedPaths,o=this._bindings,l=o.length-1,c=o[l],f=e[l];t[f]=i,o[i]=c,o.pop(),a[i]=a[l],a.pop(),r[i]=r[l],r.pop()}}},A0=class{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;let a=t.tracks,o=a.length,l=new Array(o),c={endingStart:vu,endingEnd:vu};for(let f=0;f!==o;++f){let d=a[f].createInterpolant(null);l[f]=d,d.settings=c}this._interpolantSettings=c,this._interpolants=l,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=iw,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=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){let r=this._clip.duration,a=e._clip.duration,o=a/r,l=r/a;e.warp(1,o,t),this.warp(l,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){let 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){let r=this._mixer,a=r.time,o=this.timeScale,l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);let c=l.parameterPositions,f=l.sampleValues;return c[0]=a,c[1]=a+i,f[0]=e/o,f[1]=t/o,this}stopWarping(){let 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}let a=this._startTime;if(a!==null){let c=(e-a)*i;c<0||i===0?t=0:(this._startTime=null,t=i*c)}t*=this._updateTimeScale(e);let o=this._updateTime(t),l=this._updateWeight(e);if(l>0){let c=this._interpolants,f=this._propertyBindings;switch(this.blendMode){case o1:for(let d=0,m=c.length;d!==m;++d)c[d].evaluate(o),f[d].accumulateAdditive(l);break;case hv:default:for(let d=0,m=c.length;d!==m;++d)c[d].evaluate(o),f[d].accumulate(r,l)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let i=this._weightInterpolant;if(i!==null){let 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;let i=this._timeScaleInterpolant;if(i!==null){let 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){let t=this._clip.duration,i=this.loop,r=this.time+e,a=this._loopCount,o=i===rw;if(e===0)return a===-1?r:o&&(a&1)===1?t-r:r;if(i===nw){a===-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(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){let l=Math.floor(r/t);r-=t*l,a+=Math.abs(l);let c=this.repetitions-a;if(c<=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(c===1){let f=e<0;this._setEndings(f,!f,o)}else this._setEndings(!1,!1,o);this._loopCount=a,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=r;if(o&&(a&1)===1)return t-r}return r}_setEndings(e,t,i){let r=this._interpolantSettings;i?(r.endingStart=yu,r.endingEnd=yu):(e?r.endingStart=this.zeroSlopeAtStart?yu:vu:r.endingStart=hh,t?r.endingEnd=this.zeroSlopeAtEnd?yu:vu:r.endingEnd=hh)}_scheduleFading(e,t,i){let r=this._mixer,a=r.time,o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);let l=o.parameterPositions,c=o.sampleValues;return l[0]=a,c[0]=t,l[1]=a+e,c[1]=i,this}},w8=new Float32Array(1),_x=class extends wa{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(e,t){let i=e._localRoot||this._root,r=e._clip.tracks,a=r.length,o=e._propertyBindings,l=e._interpolants,c=i.uuid,f=this._bindingsByRootAndName,d=f[c];d===void 0&&(d={},f[c]=d);for(let m=0;m!==a;++m){let p=r[m],g=p.name,y=d[g];if(y!==void 0)++y.referenceCount,o[m]=y;else{if(y=o[m],y!==void 0){y._cacheIndex===null&&(++y.referenceCount,this._addInactiveBinding(y,c,g));continue}let T=t&&t._propertyBindings[m].binding.parsedPath;y=new w0(sn.create(i,g,T),p.ValueTypeName,p.getValueSize()),++y.referenceCount,this._addInactiveBinding(y,c,g),o[m]=y}l[m].resultBuffer=y.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let i=(e._localRoot||this._root).uuid,r=e._clip.uuid,a=this._actionsByClip[r];this._bindAction(e,a&&a.knownActions[0]),this._addInactiveAction(e,r,i)}let t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){let a=t[i];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){let a=t[i];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let 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){let t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,i){let r=this._actions,a=this._actionsByClip,o=a[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[t]=o;else{let l=o.knownActions;e._byClipCacheIndex=l.length,l.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){let t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;let a=e._clip.uuid,o=this._actionsByClip,l=o[a],c=l.knownActions,f=c[c.length-1],d=e._byClipCacheIndex;f._byClipCacheIndex=d,c[d]=f,c.pop(),e._byClipCacheIndex=null;let m=l.actionByRoot,p=(e._localRoot||this._root).uuid;delete m[p],c.length===0&&delete o[a],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){let a=t[i];--a.referenceCount===0&&this._removeInactiveBinding(a)}}_lendAction(e){let t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_takeBackAction(e){let t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_addInactiveBinding(e,t,i){let r=this._bindingsByRootAndName,a=this._bindings,o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=a.length,a.push(e)}_removeInactiveBinding(e){let t=this._bindings,i=e.binding,r=i.rootNode.uuid,a=i.path,o=this._bindingsByRootAndName,l=o[r],c=t[t.length-1],f=e._cacheIndex;c._cacheIndex=f,t[f]=c,t.pop(),delete l[a],Object.keys(l).length===0&&delete o[r]}_lendBinding(e){let t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_takeBackBinding(e){let t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,a=t[r];e._cacheIndex=r,t[r]=e,a._cacheIndex=i,t[i]=a}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return i===void 0&&(i=new Ih(new Float32Array(2),new Float32Array(2),1,w8),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){let t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,a=t[r];e.__cacheIndex=r,t[r]=e,a.__cacheIndex=i,t[i]=a}clipAction(e,t,i){let r=t||this._root,a=r.uuid,o=typeof e=="string"?Du.findByName(r,e):e,l=o!==null?o.uuid:e,c=this._actionsByClip[l],f=null;if(i===void 0&&(o!==null?i=o.blendMode:i=hv),c!==void 0){let m=c.actionByRoot[a];if(m!==void 0&&m.blendMode===i)return m;f=c.knownActions[0],o===null&&(o=f._clip)}if(o===null)return null;let d=new A0(this,o,t,i);return this._bindAction(d,f),this._addInactiveAction(d,l,a),d}existingAction(e,t){let i=t||this._root,r=i.uuid,a=typeof e=="string"?Du.findByName(i,e):e,o=a?a.uuid:e,l=this._actionsByClip[o];return l!==void 0&&l.actionByRoot[r]||null}stopAllAction(){let e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;let t=this._actions,i=this._nActiveActions,r=this.time+=e,a=Math.sign(e),o=this._accuIndex^=1;for(let f=0;f!==i;++f)t[f]._update(r,e,a,o);let l=this._bindings,c=this._nActiveBindings;for(let f=0;f!==c;++f)l[f].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,i=e.uuid,r=this._actionsByClip,a=r[i];if(a!==void 0){let o=a.knownActions;for(let l=0,c=o.length;l!==c;++l){let f=o[l];this._deactivateAction(f);let d=f._cacheIndex,m=t[t.length-1];f._cacheIndex=null,f._byClipCacheIndex=null,m._cacheIndex=d,t[d]=m,t.pop(),this._removeInactiveBindingsForAction(f)}delete r[i]}}uncacheRoot(e){let t=e.uuid,i=this._actionsByClip;for(let o in i){let l=i[o].actionByRoot,c=l[t];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}let r=this._bindingsByRootAndName,a=r[t];if(a!==void 0)for(let o in a){let l=a[o];l.restoreOriginalState(),this._removeInactiveBinding(l)}}uncacheAction(e,t){let i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}},bx=class extends _h{constructor(e=1,t=1,i=1,r={}){super(e,t,r),this.isRenderTarget3D=!0,this.depth=i,this.texture=new Fc(null,e,t,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}},Vh=class n{constructor(e){this.value=e}clone(){return new n(this.value.clone===void 0?this.value:this.value.clone())}},A8=0,xx=class extends wa{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:A8++}),this.name="",this.usage=mh,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){let t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;let t=e.uniforms;this.uniforms.length=0;for(let i=0,r=t.length;i<r;i++){let a=Array.isArray(t[i])?t[i]:[t[i]];for(let o=0;o<a.length;o++)this.uniforms.push(a[o].clone())}return this}clone(){return new this.constructor().copy(this)}},tl=class extends Vc{constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){let t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){let t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}},Sx=class{constructor(e,t,i,r,a,o=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=a,this.normalized=o,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}},lN=new mt,Gh=class{constructor(e,t,i=0,r=1/0){this.ray=new yo(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new Xo,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):pt("Raycaster: 
13Unsupported camera type: "+t.type)}setFromXRController(e){return lN.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(lN),this}intersectObject(e,t=!0,i=[]){return O2(e,this,i,t),i.sort(uN),i}intersectObjects(e,t=!0,i=[]){for(let r=0,a=e.length;r<a;r++)O2(e[r],this,i,t);return i.sort(uN),i}};function uN(n,e){return n.distance-e.distance}function O2(n,e,t,i){let r=!0;if(n.layers.test(e.layers)&&n.raycast(e,t)===!1&&(r=!1),r===!0&&i===!0){let a=n.children;for(let o=0,l=a.length;o<l;o++)O2(a[o],e,t,!0)}}var Wh=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,ot("THREE.Clock: This module has been deprecated. Please use THREE.Timer instead.")}start(){this.startTime=performance.now(),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){let t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}},Qc=class{constructor(e=1,t=0,i=0){this.radius=e,this.phi=t,this.theta=i}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=xt(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(xt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}},Tx=class{constructor(e=1,t=0,i=0){this.radius=e,this.theta=t,this.y=i}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}},Ex=class n{constructor(e,t,i,r){n.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,r){let a=this.elements;return a[0]=e,a[2]=t,a[1]=i,a[3]=r,this}},cN=new Le,Mx=class{constructor(e=new Le(1/0,1/0),t=new Le(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=cN.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,cN).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)}},fN=new H,Lb=new H,oh=new H,sh=new H,y2=new H,C8=new H,R8=new H,Xh=class{constructor(e=new H,t=new H){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){fN.subVectors(e,this.start),Lb.subVectors(this.end,this.start);let i=Lb.dot(Lb),a=Lb.dot(fN)/i;return t&&(a=xt(a,0,1)),a}closestPointToPoint(e,t,i){let r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}
vendor: 21,872 bytes, line 13
13distanceSqToLine3(e,t=C8,i=R8){let r=10000000000000001e-32,a,o,l=this.start,c=e.start,f=this.end,d=e.end;oh.subVectors(f,l),sh.subVectors(d,c),y2.subVectors(l,c);let m=oh.dot(oh),p=sh.dot(sh),g=sh.dot(y2);if(m<=r&&p<=r)return t.copy(l),i.copy(c),t.sub(i),t.dot(t);if(m<=r)a=0,o=g/p,o=xt(o,0,1);else{let y=oh.dot(y2);if(p<=r)o=0,a=xt(-y/m,0,1);else{let T=oh.dot(sh),x=m*p-T*T;x!==0?a=xt((T*g-y*p)/x,0,1):a=0,o=(T*a+g)/p,o<0?(o=0,a=xt(-y/m,0,1)):o>1&&(o=1,a=xt((T-y)/m,0,1))}}return t.copy(l).addScaledVector(oh,a),i.copy(c).addScaledVector(sh,o),t.distanceToSquared(i)}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)}},dN=new H,wx=class extends $t{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";let i=new wt,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,l=1,c=32;o<c;o++,l++){let f=o/c*Math.PI*2,d=l/c*Math.PI*2;r.push(Math.cos(f),Math.sin(f),1,Math.cos(d),Math.sin(d),1)}i.setAttribute("position",new ut(r,3));let a=new Li({fog:!1,toneMapped:!1});this.cone=new Ca(i,a),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),dN.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(dN),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},mu=new H,Nb=new mt,_2=new mt,Ax=class extends Ca{constructor(e){let t=yP(e),i=new wt,r=[],a=[];for(let f=0;f<t.length;f++){let d=t[f];d.parent&&d.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),a.push(0,0,0),a.push(0,0,0))}i.setAttribute("position",new ut(r,3)),i.setAttribute("color",new ut(a,3));let o=new Li({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,o),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;let l=new tt(255),c=new tt(65280);this.setColors(l,c)}updateMatrixWorld(e){let t=this.bones,i=this.geometry,r=i.getAttribute("position");_2.copy(this.root.matrixWorld).invert();for(let a=0,o=0;a<t.length;a++){let l=t[a];l.parent&&l.parent.isBone&&(Nb.multiplyMatrices(_2,l.matrixWorld),mu.setFromMatrixPosition(Nb),r.setXYZ(o,mu.x,mu.y,mu.z),Nb.multiplyMatrices(_2,l.parent.matrixWorld),mu.setFromMatrixPosition(Nb),r.setXYZ(o+1,mu.x,mu.y,mu.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){let r=this.geometry.getAttribute("color");for(let a=0;a<r.count;a+=2)r.setXYZ(a,e.r,e.g,e.b),r.setXYZ(a+1,t.r,t.g,t.b);return r.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}};function yP(n){let e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push(...yP(n.children[t]));return e}var Cx=class extends ln{constructor(e,t,i){let r=new Nh(t,4,2),a=new Aa({wireframe:!0,fog:!1,toneMapped:!1});super(r,a),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},D8=new H,hN=new tt,pN=new tt,Rx=class extends $t{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";let r=new Lh(t);r.rotateY(Math.PI*.5),this.material=new Aa({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);let a=r.getAttribute("position"),o=new Float32Array(a.count*3);r.setAttribute("color",new an(o,3)),this.add(new ln(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{let t=e.geometry.getAttribute("color");hN.copy(this.light.color),pN.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){let a=i<r/2?hN:pN;t.setXYZ(i,a.r,a.g,a.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(D8.setFromMatrixPosition(this.light.matrixWorld).negate())}},Dx=class extends Ca{constructor(e=10,t=10,i=4473924,r=8947848){i=new tt(i),r=new tt(r);let a=t/2,o=e/t,l=e/2,c=[],f=[];for(let p=0,g=0,y=-l;p<=t;p++,y+=o){c.push(-l,0,y,l,0,y),c.push(y,0,-l,y,0,l);let T=p===a?i:r;T.toArray(f,g),g+=3,T.toArray(f,g),g+=3,T.toArray(f,g),g+=3,T.toArray(f,g),g+=3}let d=new wt;d.setAttribute("position",new ut(c,3)),d.setAttribute("color",new ut(f,3));let m=new Li({vertexColors:!0,toneMapped:!1});super(d,m),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},Ux=class extends Ca{constructor(e=10,t=16,i=8,r=64,a=4473924,o=8947848){a=new tt(a),o=new tt(o);let l=[],c=[];if(t>1)for(let m=0;m<t;m++){let p=m/t*(Math.PI*2),g=Math.sin(p)*e,y=Math.cos(p)*e;l.push(0,0,0),l.push(g,0,y);let T=m&1?a:o;c.push(T.r,T.g,T.b),c.push(T.r,T.g,T.b)}for(let m=0;m<i;m++){let p=m&1?a:o,g=e-e/i*m;for(let y=0;y<r;y++){let T=y/r*(Math.PI*2),x=Math.sin(T)*g,_=Math.cos(T)*g;l.push(x,0,_),c.push(p.r,p.g,p.b),T=(y+1)/r*(Math.PI*2),x=Math.sin(T)*g,_=Math.cos(T)*g,l.push(x,0,_),c.push(p.r,p.g,p.b)}}let f=new wt;f.setAttribute("position",new ut(l,3)),f.setAttribute("color",new ut(c,3));let d=new Li({vertexColors:!0,toneMapped:!1});super(f,d),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}},mN=new H,Pb=new H,gN=new H,Ox=class extends $t{constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new wt;r.setAttribute("position",new ut([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let a=new Li({fog:!1,toneMapped:!1});this.lightPlane=new bo(r,a),this.add(this.lightPlane),r=new wt,r.setAttribute("position",new ut([0,0,0,0,0,1],3)),this.targetLine=new bo(r,a),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),mN.setFromMatrixPosition(this.light.matrixWorld),Pb.setFromMatrixPosition(this.light.target.matrixWorld),gN.subVectors(Pb,mN),this.lightPlane.lookAt(Pb),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Pb),this.targetLine.scale.z=gN.length()}},Ib=new H,qn=new Kc,Lx=class extends Ca{constructor(e){let t=new wt,i=new Li({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],a=[],o={};l("n1","n2"),l("n2","n4"),l("n4","n3"),l("n3","n1"),l("f1","f2"),l("f2","f4"),l("f4","f3"),l("f3","f1"),l("n1","f1"),l("n2","f2"),l("n3","f3"),l("n4","f4"),l("p","n1"),l("p","n2"),l("p","n3"),l("p","n4"),l("u1","u2"),l("u2","u3"),l("u3","u1"),l("c","t"),l("p","c"),l("cn1","cn2"),l("cn3","cn4"),l("cf1","cf2"),l("cf3","cf4");function l(y,T){c(y),c(T)}function c(y){r.push(0,0,0),a.push(0,0,0),o[y]===void 0&&(o[y]=[]),o[y].push(r.length/3-1)}t.setAttribute("position",new ut(r,3)),t.setAttribute("color",new ut(a,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();let f=new tt(16755200),d=new tt(16711680),m=new tt(43775),p=new tt(16777215),g=new tt(3355443);this.setColors(f,d,m,p,g)}setColors(e,t,i,r,a){let l=this.geometry.getAttribute("color");return l.setXYZ(0,e.r,e.g,e.b),l.setXYZ(1,e.r,e.g,e.b),l.setXYZ(2,e.r,e.g,e.b),l.setXYZ(3,e.r,e.g,e.b),l.setXYZ(4,e.r,e.g,e.b),l.setXYZ(5,e.r,e.g,e.b),l.setXYZ(6,e.r,e.g,e.b),l.setXYZ(7,e.r,e.g,e.b),l.setXYZ(8,e.r,e.g,e.b),l.setXYZ(9,e.r,e.g,e.b),l.setXYZ(10,e.r,e.g,e.b),l.setXYZ(11,e.r,e.g,e.b),l.setXYZ(12,e.r,e.g,e.b),l.setXYZ(13,e.r,e.g,e.b),l.setXYZ(14,e.r,e.g,e.b),l.setXYZ(15,e.r,e.g,e.b),l.setXYZ(16,e.r,e.g,e.b),l.setXYZ(17,e.r,e.g,e.b),l.setXYZ(18,e.r,e.g,e.b),l.setXYZ(19,e.r,e.g,e.b),l.setXYZ(20,e.r,e.g,e.b),l.setXYZ(21,e.r,e.g,e.b),l.setXYZ(22,e.r,e.g,e.b),l.setXYZ(23,e.r,e.g,e.b),l.setXYZ(24,t.r,t.g,t.b),l.setXYZ(25,t.r,t.g,t.b),l.setXYZ(26,t.r,t.g,t.b),l.setXYZ(27,t.r,t.g,t.b),l.setXYZ(28,t.r,t.g,t.b),l.setXYZ(29,t.r,t.g,t.b),l.setXYZ(30,t.r,t.g,t.b),l.setXYZ(31,t.r,t.g,t.b),l.setXYZ(32,i.r,i.g,i.b),l.setXYZ(33,i.r,i.g,i.b),l.setXYZ(34,i.r,i.g,i.b),l.setXYZ(35,i.r,i.g,i.b),l.setXYZ(36,i.r,i.g,i.b),l.setXYZ(37,i.r,i.g,i.b),l.setXYZ(38,r.r,r.g,r.b),l.setXYZ(39,r.r,r.g,r.b),l.setXYZ(40,a.r,a.g,a.b),l.setXYZ(41,a.r,a.g,a.b),l.setXYZ(42,a.r,a.g,a.b),l.setXYZ(43,a.r,a.g,a.b),l.setXYZ(44,a.r,a.g,a.b),l.setXYZ(45,a.r,a.g,a.b),l.setXYZ(46,a.r,a.g,a.b),l.setXYZ(47,a.r,a.g,a.b),l.setXYZ(48,a.r,a.g,a.b),l.setXYZ(49,a.r,a.g,a.b),l.needsUpdate=!0,this}update(){let e=this.geometry,t=this.pointMap,i=1,r=1,a,o;if(qn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)a=1,o=0;else if(this.camera.coordinateSystem===Yr)a=-1,o=1;else if(this.camera.coordinateSystem===xu)a=0,o=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);$n("c",t,e,qn,0,0,a),$n("t",t,e,qn,0,0,o),$n("n1",t,e,qn,-i,-r,a),$n("n2",t,e,qn,i,-r,a),$n("n3",t,e,qn,-i,r,a),$n("n4",t,e,qn,i,r,a),$n("f1",t,e,qn,-i,-r,o),$n("f2",t,e,qn,i,-r,o),$n("f3",t,e,qn,-i,r,o),$n("f4",t,e,qn,i,r,o),$n("u1",t,e,qn,i*.7,r*1.1,a),$n("u2",t,e,qn,-i*.7,r*1.1,a),$n("u3",t,e,qn,0,r*2,a),$n("cf1",t,e,qn,-i,0,o),$n("cf2",t,e,qn,i,0,o),$n("cf3",t,e,qn,0,-r,o),$n("cf4",t,e,qn,0,r,o),$n("cn1",t,e,qn,-i,0,a),$n("cn2",t,e,qn,i,0,a),$n("cn3",t,e,qn,0,-r,a),$n("cn4",t,e,qn,0,r,a),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function $n(n,e,t,i,r,a,o){Ib.set(r,a,o).unproject(i);let l=e[n];if(l!==void 0){let c=t.getAttribute("position");for(let f=0,d=l.length;f<d;f++)c.setXYZ(l[f],Ib.x,Ib.y,Ib.z)}}var zb=new bn,Nx=class extends Ca{constructor(e,t=16776960){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),a=new wt;a.setIndex(new an(i,1)),a.setAttribute("position",new an(r,3)),super(a,new Li({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&zb.setFromObject(this.object),zb.isEmpty())return;let e=zb.min,t=zb.max,i=this.geometry.attributes.position,r=i.array;r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=t.y,r[5]=t.z,r[6]=e.x,r[7]=e.y,r[8]=t.z,r[9]=t.x,r[10]=e.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=e.z,r[15]=e.x,r[16]=t.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=t.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Px=class extends Ca{constructor(e,t=16776960){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],a=new wt;a.setIndex(new an(i,1)),a.setAttribute("position",new ut(r,3)),super(a,new Li({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}},Ix=class extends bo{constructor(e,t=1,i=16776960){let r=i,a=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o=new wt;o.setAttribute("position",new ut(a,3)),o.computeBoundingSphere(),super(o,new Li({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;let l=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],c=new wt;c.setAttribute("position",new ut(l,3)),c.computeBoundingSphere(),this.add(new ln(c,new Aa({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}},vN=new H,kb,b2,zx=class extends $t{constructor(e=new H(0,0,1),t=new H(0,0,0),i=1,r=16776960,a=i*.2,o=a*.2){super(),this.type="ArrowHelper",kb===void 0&&(kb=new wt,kb.setAttribute("position",new ut([0,0,0,0,1,0],3)),b2=new wh(.5,1,5,1),b2.translate(0,-.5,0)),this.position.copy(t),this.line=new bo(kb,new Li({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ln(b2,new Aa({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,a,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{vN.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(vN,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()}},kx=class extends Ca{constructor(e=1){let 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 wt;r.setAttribute("position",new ut(t,3)),r.setAttribute("color",new ut(i,3));let a=new Li({vertexColors:!0,toneMapped:!1});super(r,a),this.type="AxesHelper"}setColors(e,t,i){let r=new tt,a=this.geometry.attributes.color.array;return r.set(e),r.toArray(a,0),r.toArray(a,3),r.set(t),r.toArray(a,6),r.toArray(a,9),r.set(i),r.toArray(a,12),r.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Fx=class{constructor(){this.type="ShapePath",this.color=new tt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new qc,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,a,o){return this.currentPath.bezierCurveTo(e,t,i,r,a,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(_){let b=[];for(let S=0,E=_.length;S<E;S++){let C=_[S],D=new Ma;D.curves=C.curves,b.push(D)}return b}function i(_,b){let S=b.length,E=!1;for(let C=S-1,D=0;D<S;C=D++){let U=b[C],w=b[D],R=w.x-U.x,L=w.y-U.y;if(Math.abs(L)>Number.EPSILON){if(L<0&&(U=b[D],R=-R,w=b[C],L=-L),_.y<U.y||_.y>w.y)continue;if(_.y===U.y){if(_.x===U.x)return!0}else{let I=L*(_.x-U.x)-R*(_.y-U.y);if(I===0)return!0;if(I<0)continue;E=!E}}else{if(_.y!==U.y)continue;if(w.x<=_.x&&_.x<=U.x||U.x<=_.x&&_.x<=w.x)return!0}}return E}let r=Ya.isClockWise,a=this.subPaths;if(a.length===0)return[];let o,l,c,f=[];if(a.length===1)return l=a[0],c=new Ma,c.curves=l.curves,f.push(c),f;let d=!r(a[0].getPoints());d=e?!d:d;let m=[],p=[],g=[],y=0,T;p[y]=void 0,g[y]=[];for(let _=0,b=a.length;_<b;_++)l=a[_],T=l.getPoints(),o=r(T),o=e?!o:o,o?(!d&&p[y]&&y++,p[y]={s:new Ma,p:T},p[y].s.curves=l.curves,d&&y++,g[y]=[]):g[y].push({h:l,p:T[0]});if(!p[0])return t(a);if(p.length>1){let _=!1,b=0;for(let S=0,E=p.length;S<E;S++)m[S]=[];for(let S=0,E=p.length;S<E;S++){let C=g[S];for(let D=0;D<C.length;D++){let U=C[D],w=!0;for(let R=0;R<p.length;R++)i(U.p,p[R].p)&&(S!==R&&b++,w?(w=!1,m[R].push(U)):_=!0);w&&m[S].push(U)}}b>0&&_===!1&&(g=m)}let x;for(let _=0,b=p.length;_<b;_++){c=p[_].s,f.push(c),x=g[_];for(let S=0,E=x.length;S<E;S++)c.holes.push(x[S].h)}return f}},Bx=class extends wa{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){ot("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}};function U8(n,e){let t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(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 O8(n,e){let 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 L8(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function u1(n,e,t,i){let r=N8(i);switch(t){case r1:return n*e;case O0:return n*e/r.components*r.byteLength;case Kh:return n*e/r.components*r.byteLength;case Nu:return n*e*2/r.components*r.byteLength;case L0:return n*e*2/r.components*r.byteLength;case a1:return n*e*3/r.components*r.byteLength;case _i:return n*e*4/r.components*r.byteLength;case N0:return n*e*4/r.components*r.byteLength;case Qh:case Jh:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case $h:case ep:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case I0:case k0:return Math.max(n,16)*Math.max(e,8)/4;case P0:case z0:return Math.max(n,8)*Math.max(e,8)/2;case F0:case B0:case V0:case G0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case H0:case W0:case X0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case q0:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Y0:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case j0:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case Z0:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case K0:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case Q0:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case J0:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case $0:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case ev:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case tv:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case nv:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case iv:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case rv:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case av:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case ov:case sv:case lv:return Math.ceil(n/4)*Math.ceil(e/4)*16;case uv:case cv:return Math.ceil(n/4)*Math.ceil(e/4)*8;case fv:case dv:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function N8(n){switch(n){case Ki:case e1:return{byteLength:1,components:1};case tf:case t1:case wo:return{byteLength:2,components:1};case D0:case U0:return{byteLength:2,components:4};case Ra:case R0:case Yi:return{byteLength:4,components:1};case n1:case i1:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}var Hx=class{static contain(e,t){return U8(e,t)}static cover(e,t){return O8(e,t)}static fill(e){return L8(e)}static getByteLength(e,t,i,r){return u1(e,t,i,r)}};typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:nl}}));typeof window<"u"&&(window.__THREE__?ot("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=nl);function HP(){let n=null,e=!1,t=null,i=null;function r(a,o){t(a,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(a){t=a},setContext:function(a){n=a}}}function P8(n){let e=new WeakMap;function t(l,c){let f=l.array,d=l.usage,m=f.byteLength,p=n.createBuffer();n.bindBuffer(c,p),n.bufferData(c,f,d),l.onUploadCallback();let g;if(f instanceof Float32Array)g=n.FLOAT;else if(typeof Float16Array<"u"&&f instanceof Float16Array)g=n.HALF_FLOAT;else if(f instanceof Uint16Array)l.isFloat16BufferAttribute?g=n.HALF_FLOAT:g=n.UNSIGNED_SHORT;else if(f instanceof Int16Array)g=n.SHORT;else if(f instanceof Uint32Array)g=n.UNSIGNED_INT;else if(f instanceof Int32Array)g=n.INT;else if(f instanceof Int8Array)g=n.BYTE;else if(f instanceof Uint8Array)g=n.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)g=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:p,type:g,bytesPerElement:f.BYTES_PER_ELEMENT,version:l.version,size:m}}function i(l,c,f){let d=c.array,m=c.updateRanges;if(n.bindBuffer(f,l),m.length===0)n.bufferSubData(f,0,d);else{m.sort((g,y)=>g.start-y.start);let p=0;for(let g=1;g<m.length;g++){let y=m[p],T=m[g];T.start<=y.start+y.count+1?y.count=Math.max(y.count,T.start+T.count-y.start):(++p,m[p]=T)}m.length=p+1;for(let g=0,y=m.length;g<y;g++){let T=m[g];n.bufferSubData(f,T.start*d.BYTES_PER_ELEMENT,d,T.start,T.count)}c.clearUpdateRanges()}c.onUploadCallback()}function r(l){return l.isInterleavedBufferAttribute&&(l=l.data),e.get(l)}function a(l){l.isInterleavedBufferAttribute&&(l=l.data);let c=e.get(l);c&&(n.deleteBuffer(c.buffer),e.delete(l))}
vendor: 4,709 bytes, lines 13-126
13function o(l,c){if(l.isInterleavedBufferAttribute&&(l=l.data),l.isGLBufferAttribute){let d=e.get(l);(!d||d.version<l.version)&&e.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}let f=e.get(l);if(f===void 0)e.set(l,t(l,c));else if(f.version<l.version){if(f.size!==l.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");i(f.buffer,l,c),f.version=l.version}}return{get:r,remove:a,update:o}}var I8=`#ifdef USE_ALPHAHASH
14	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
15#endif`,z8=`#ifdef USE_ALPHAHASH
16	const float ALPHA_HASH_SCALE = 0.05;
17	float hash2D( vec2 value ) {
18		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
19	}
20	float hash3D( vec3 value ) {
21		return hash2D( vec2( hash2D( value.xy ), value.z ) );
22	}
23	float getAlphaHashThreshold( vec3 position ) {
24		float maxDeriv = max(
25			length( dFdx( position.xyz ) ),
26			length( dFdy( position.xyz ) )
27		);
28		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
29		vec2 pixScales = vec2(
30			exp2( floor( log2( pixScale ) ) ),
31			exp2( ceil( log2( pixScale ) ) )
32		);
33		vec2 alpha = vec2(
34			hash3D( floor( pixScales.x * position.xyz ) ),
35			hash3D( floor( pixScales.y * position.xyz ) )
36		);
37		float lerpFactor = fract( log2( pixScale ) );
38		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
39		float a = min( lerpFactor, 1.0 - lerpFactor );
40		vec3 cases = vec3(
41			x * x / ( 2.0 * a * ( 1.0 - a ) ),
42			( x - 0.5 * a ) / ( 1.0 - a ),
43			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
44		);
45		float threshold = ( x < ( 1.0 - a ) )
46			? ( ( x < a ) ? cases.x : cases.y )
47			: cases.z;
48		return clamp( threshold , 1.0e-6, 1.0 );
49	}
50#endif`,k8=`#ifdef USE_ALPHAMAP
51	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
52#endif`,F8=`#ifdef USE_ALPHAMAP
53	uniform sampler2D alphaMap;
54#endif`,B8=`#ifdef USE_ALPHATEST
55	#ifdef ALPHA_TO_COVERAGE
56	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
57	if ( diffuseColor.a == 0.0 ) discard;
58	#else
59	if ( diffuseColor.a < alphaTest ) discard;
60	#endif
61#endif`,H8=`#ifdef USE_ALPHATEST
62	uniform float alphaTest;
63#endif`,V8=`#ifdef USE_AOMAP
64	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
65	reflectedLight.indirectDiffuse *= ambientOcclusion;
66	#if defined( USE_CLEARCOAT ) 
67		clearcoatSpecularIndirect *= ambientOcclusion;
68	#endif
69	#if defined( USE_SHEEN ) 
70		sheenSpecularIndirect *= ambientOcclusion;
71	#endif
72	#if defined( USE_ENVMAP ) && defined( STANDARD )
73		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
74		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
75	#endif
76#endif`,G8=`#ifdef USE_AOMAP
77	uniform sampler2D aoMap;
78	uniform float aoMapIntensity;
79#endif`,W8=`#ifdef USE_BATCHING
80	#if ! defined( GL_ANGLE_multi_draw )
81	#define gl_DrawID _gl_DrawID
82	uniform int _gl_DrawID;
83	#endif
84	uniform highp sampler2D batchingTexture;
85	uniform highp usampler2D batchingIdTexture;
86	mat4 getBatchingMatrix( const in float i ) {
87		int size = textureSize( batchingTexture, 0 ).x;
88		int j = int( i ) * 4;
89		int x = j % size;
90		int y = j / size;
91		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
92		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
93		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
94		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
95		return mat4( v1, v2, v3, v4 );
96	}
97	float getIndirectIndex( const in int i ) {
98		int size = textureSize( batchingIdTexture, 0 ).x;
99		int x = i % size;
100		int y = i / size;
101		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
102	}
103#endif
104#ifdef USE_BATCHING_COLOR
105	uniform sampler2D batchingColorTexture;
106	vec4 getBatchingColor( const in float i ) {
107		int size = textureSize( batchingColorTexture, 0 ).x;
108		int j = int( i );
109		int x = j % size;
110		int y = j / size;
111		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
112	}
113#endif`,X8=`#ifdef USE_BATCHING
114	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
115#endif`,q8=`vec3 transformed = vec3( position );
116#ifdef USE_ALPHAHASH
117	vPosition = vec3( position );
118#endif`,Y8=`vec3 objectNormal = vec3( normal );
119#ifdef USE_TANGENT
120	vec3 objectTangent = vec3( tangent.xyz );
121#endif`,j8=`float G_BlinnPhong_Implicit( ) {
122	return 0.25;
123}
124float D_BlinnPhong( const in float shininess, const in float dotNH ) {
125	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
126}
127vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
128	vec3 halfDir = normalize( lightDir + viewDir );
129	float dotNH = saturate( dot( normal, halfDir ) );
130	float dotVH = saturate( dot( viewDir, halfDir ) );
131	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
132	float G = G_BlinnPhong_Implicit( );
133	float D = D_BlinnPhong( shininess, dotNH );
134	return F * ( G * D );
135} // validated`,Z8=`#ifdef USE_IRIDESCENCE
136	const mat3 XYZ_TO_REC709 = mat3(
137		 3.2404542, -0.9692660,  0.0556434,
138		-1.5371385,  1.8760108, -0.2040259,
139		-0.4985314,  0.0415560,  1.0572252
140	);
141	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
142		vec3 sqrtF0 = sqrt( fresnel0 );
143		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
144	}
145	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
146		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
147	}
148	float IorToFresnel0( float transmittedIor, float incidentIor ) {
149		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
150	}
151	vec3 evalSensitivity( float OPD, vec3 shift ) {
152		float phase = 2.0 * PI * OPD * 1.0e-9;
153		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
154		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
155		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
156		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
157		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
158		xyz /= 1.0685e-7;
159		vec3 rgb = XYZ_TO_REC709 * xyz;
160		return rgb;
161	}
162	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
163		vec3 I;
164		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
165		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
166		float cosTheta2Sq = 1.0 - sinTheta2Sq;
167		if ( cosTheta2Sq < 0.0 ) {
168			return vec3( 1.0 );
169		}
170		float cosTheta2 = sqrt( cosTheta2Sq );
171		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
172		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
173		float T121 = 1.0 - R12;
174		float phi12 = 0.0;
175		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
176		float phi21 = PI - phi12;
177		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
178		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
179		vec3 phi23 = vec3( 0.0 );
180		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
181		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
182		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
183		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
184		vec3 phi = vec3( phi21 ) + phi23;
185		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
186		vec3 r123 = sqrt( R123 );
187		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
188		vec3 C0 = R12 + Rs;
189		I = C0;
190		vec3 Cm = Rs - T121;
191		for ( int m = 1; m <= 2; ++ m ) {
192			Cm *= r123;
193			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
194			I += Cm * Sm;
195		}
196		return max( I, vec3( 0.0 ) );
197	}
198#endif`,K8=`#ifdef USE_BUMPMAP
199	uniform sampler2D bumpMap;
200	uniform float bumpScale;
201	vec2 dHdxy_fwd() {
202		vec2 dSTdx = dFdx( vBumpMapUv );
203		vec2 dSTdy = dFdy( vBumpMapUv );
204		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
205		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
206		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
207		return vec2( dBx, dBy );
208	}
209	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
210		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
211		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
212		vec3 vN = surf_norm;
213		vec3 R1 = cross( vSigmaY, vN );
214		vec3 R2 = cross( vN, vSigmaX );
215		float fDet = dot( vSigmaX, R1 ) * faceDirection;
216		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
217		return normalize( abs( fDet ) * surf_norm - vGrad );
218	}
219#endif`,Q8=`#if NUM_CLIPPING_PLANES > 0
220	vec4 plane;
221	#ifdef ALPHA_TO_COVERAGE
222		float distanceToPlane, distanceGradient;
223		float clipOpacity = 1.0;
224		#pragma unroll_loop_start
225		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
226			plane = clippingPlanes[ i ];
227			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
228			distanceGradient = fwidth( distanceToPlane ) / 2.0;
229			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
230			if ( clipOpacity == 0.0 ) discard;
231		}
232		#pragma unroll_loop_end
233		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
234			float unionClipOpacity = 1.0;
235			#pragma unroll_loop_start
236			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
237				plane = clippingPlanes[ i ];
238				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
239				distanceGradient = fwidth( distanceToPlane ) / 2.0;
240				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
241			}
242			#pragma unroll_loop_end
243			clipOpacity *= 1.0 - unionClipOpacity;
244		#endif
245		diffuseColor.a *= clipOpacity;
246		if ( diffuseColor.a == 0.0 ) discard;
247	#else
248		#pragma unroll_loop_start
249		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
250			plane = clippingPlanes[ i ];
251			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
252		}
253		#pragma unroll_loop_end
254		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
255			bool clipped = true;
256			#pragma unroll_loop_start
257			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
258				plane = clippingPlanes[ i ];
259				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
260			}
261			#pragma unroll_loop_end
262			if ( clipped ) discard;
263		#endif
264	#endif
265#endif`,J8=`#if NUM_CLIPPING_PLANES > 0
266	varying vec3 vClipPosition;
267	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
268#endif`,$8=`#if NUM_CLIPPING_PLANES > 0
269	varying vec3 vClipPosition;
270#endif`,eH=`#if NUM_CLIPPING_PLANES > 0
271	vClipPosition = - mvPosition.xyz;
272#endif`,tH=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
273	diffuseColor *= vColor;
274#endif`,nH=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
275	varying vec4 vColor;
276#endif`,iH=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
277	varying vec4 vColor;
278#endif`,rH=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
279	vColor = vec4( 1.0 );
280#endif
281#ifdef USE_COLOR_ALPHA
282	vColor *= color;
283#elif defined( USE_COLOR )
284	vColor.rgb *= color;
285#endif
286#ifdef USE_INSTANCING_COLOR
287	vColor.rgb *= instanceColor.rgb;
288#endif
289#ifdef USE_BATCHING_COLOR
290	vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
291#endif`,aH=`#define PI 3.141592653589793
292#define PI2 6.283185307179586
293#define PI_HALF 1.5707963267948966
294#define RECIPROCAL_PI 0.3183098861837907
295#define RECIPROCAL_PI2 0.15915494309189535
296#define EPSILON 1e-6
297#ifndef saturate
298#define saturate( a ) clamp( a, 0.0, 1.0 )
299#endif
300#define whiteComplement( a ) ( 1.0 - saturate( a ) )
301float pow2( const in float x ) { return x*x; }
302vec3 pow2( const in vec3 x ) { return x*x; }
303float pow3( const in float x ) { return x*x*x; }
304float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
305float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
306float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
307highp float rand( const in vec2 uv ) {
308	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
309	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
310	return fract( sin( sn ) * c );
311}
312#ifdef HIGH_PRECISION
313	float precisionSafeLength( vec3 v ) { return length( v ); }
314#else
315	float precisionSafeLength( vec3 v ) {
316		float maxComponent = max3( abs( v ) );
317		return length( v / maxComponent ) * maxComponent;
318	}
319#endif
320struct IncidentLight {
321	vec3 color;
322	vec3 direction;
323	bool visible;
324};
325struct ReflectedLight {
326	vec3 directDiffuse;
327	vec3 directSpecular;
328	vec3 indirectDiffuse;
329	vec3 indirectSpecular;
330};
331#ifdef USE_ALPHAHASH
332	varying vec3 vPosition;
333#endif
334vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
335	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
336}
337vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
338	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
339}
340bool isPerspectiveMatrix( mat4 m ) {
341	return m[ 2 ][ 3 ] == - 1.0;
342}
343vec2 equirectUv( in vec3 dir ) {
344	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
345	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
346	return vec2( u, v );
347}
348vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
349	return RECIPROCAL_PI * diffuseColor;
350}
351vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
352	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
353	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
354}
355float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
356	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
357	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
358} // validated`,oH=`#ifdef ENVMAP_TYPE_CUBE_UV
359	#define cubeUV_minMipLevel 4.0
360	#define cubeUV_minTileSize 16.0
361	float getFace( vec3 direction ) {
362		vec3 absDirection = abs( direction );
363		float face = - 1.0;
364		if ( absDirection.x > absDirection.z ) {
365			if ( absDirection.x > absDirection.y )
366				face = direction.x > 0.0 ? 0.0 : 3.0;
367			else
368				face = direction.y > 0.0 ? 1.0 : 4.0;
369		} else {
370			if ( absDirection.z > absDirection.y )
371				face = direction.z > 0.0 ? 2.0 : 5.0;
372			else
373				face = direction.y > 0.0 ? 1.0 : 4.0;
374		}
375		return face;
376	}
377	vec2 getUV( vec3 direction, float face ) {
378		vec2 uv;
379		if ( face == 0.0 ) {
380			uv = vec2( direction.z, direction.y ) / abs( direction.x );
381		} else if ( face == 1.0 ) {
382			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
383		} else if ( face == 2.0 ) {
384			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
385		} else if ( face == 3.0 ) {
386			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
387		} else if ( face == 4.0 ) {
388			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
389		} else {
390			uv = vec2( direction.x, direction.y ) / abs( direction.z );
391		}
392		return 0.5 * ( uv + 1.0 );
393	}
394	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
395		float face = getFace( direction );
396		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
397		mipInt = max( mipInt, cubeUV_minMipLevel );
398		float faceSize = exp2( mipInt );
399		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
400		if ( face > 2.0 ) {
401			uv.y += faceSize;
402			face -= 3.0;
403		}
404		uv.x += face * faceSize;
405		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
406		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
407		uv.x *= CUBEUV_TEXEL_WIDTH;
408		uv.y *= CUBEUV_TEXEL_HEIGHT;
409		#ifdef texture2DGradEXT
410			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
411		#else
412			return texture2D( envMap, uv ).rgb;
413		#endif
414	}
415	#define cubeUV_r0 1.0
416	#define cubeUV_m0 - 2.0
417	#define cubeUV_r1 0.8
418	#define cubeUV_m1 - 1.0
419	#define cubeUV_r4 0.4
420	#define cubeUV_m4 2.0
421	#define cubeUV_r5 0.305
422	#define cubeUV_m5 3.0
423	#define cubeUV_r6 0.21
424	#define cubeUV_m6 4.0
425	float roughnessToMip( float roughness ) {
426		float mip = 0.0;
427		if ( roughness >= cubeUV_r1 ) {
428			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
429		} else if ( roughness >= cubeUV_r4 ) {
430			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
431		} else if ( roughness >= cubeUV_r5 ) {
432			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
433		} else if ( roughness >= cubeUV_r6 ) {
434			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
435		} else {
436			mip = - 2.0 * log2( 1.16 * roughness );		}
437		return mip;
438	}
439	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
440		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
441		float mipF = fract( mip );
442		float mipInt = floor( mip );
443		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
444		if ( mipF == 0.0 ) {
445			return vec4( color0, 1.0 );
446		} else {
447			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
448			return vec4( mix( color0, color1, mipF ), 1.0 );
449		}
450	}
451#endif`,sH=`vec3 transformedNormal = objectNormal;
452#ifdef USE_TANGENT
453	vec3 transformedTangent = objectTangent;
454#endif
455#ifdef USE_BATCHING
456	mat3 bm = mat3( batchingMatrix );
457	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
458	transformedNormal = bm * transformedNormal;
459	#ifdef USE_TANGENT
460		transformedTangent = bm * transformedTangent;
461	#endif
462#endif
463#ifdef USE_INSTANCING
464	mat3 im = mat3( instanceMatrix );
465	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
466	transformedNormal = im * transformedNormal;
467	#ifdef USE_TANGENT
468		transformedTangent = im * transformedTangent;
469	#endif
470#endif
471transformedNormal = normalMatrix * transformedNormal;
472#ifdef FLIP_SIDED
473	transformedNormal = - transformedNormal;
474#endif
475#ifdef USE_TANGENT
476	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
477	#ifdef FLIP_SIDED
478		transformedTangent = - transformedTangent;
479	#endif
480#endif`,lH=`#ifdef USE_DISPLACEMENTMAP
481	uniform sampler2D displacementMap;
482	uniform float displacementScale;
483	uniform float displacementBias;
484#endif`,uH=`#ifdef USE_DISPLACEMENTMAP
485	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
485placementBias );
486#endif`,cH=`#ifdef USE_EMISSIVEMAP
487	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
488	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
489		emissiveColor = sRGBTransferEOTF( emissiveColor );
490	#endif
491	totalEmissiveRadiance *= emissiveColor.rgb;
492#endif`,fH=`#ifdef USE_EMISSIVEMAP
493	uniform sampler2D emissiveMap;
494#endif`,dH="gl_FragColor = linearToOutputTexel( gl_FragColor );",hH=`vec4 LinearTransferOETF( in vec4 value ) {
495	return value;
496}
497vec4 sRGBTransferEOTF( in vec4 value ) {
498	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
499}
500vec4 sRGBTransferOETF( in vec4 value ) {
501	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 );
502}`,pH=`#ifdef USE_ENVMAP
503	#ifdef ENV_WORLDPOS
504		vec3 cameraToFrag;
505		if ( isOrthographic ) {
506			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
507		} else {
508			cameraToFrag = normalize( vWorldPosition - cameraPosition );
509		}
510		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
511		#ifdef ENVMAP_MODE_REFLECTION
512			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
513		#else
514			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
515		#endif
516	#else
517		vec3 reflectVec = vReflect;
518	#endif
519	#ifdef ENVMAP_TYPE_CUBE
520		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
521		#ifdef ENVMAP_BLENDING_MULTIPLY
522			outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
523		#elif defined( ENVMAP_BLENDING_MIX )
524			outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
525		#elif defined( ENVMAP_BLENDING_ADD )
526			outgoingLight += envColor.xyz * specularStrength * reflectivity;
527		#endif
528	#endif
529#endif`,mH=`#ifdef USE_ENVMAP
530	uniform float envMapIntensity;
531	uniform float flipEnvMap;
532	uniform mat3 envMapRotation;
533	#ifdef ENVMAP_TYPE_CUBE
534		uniform samplerCube envMap;
535	#else
536		uniform sampler2D envMap;
537	#endif
538#endif`,gH=`#ifdef USE_ENVMAP
539	uniform float reflectivity;
540	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
541		#define ENV_WORLDPOS
542	#endif
543	#ifdef ENV_WORLDPOS
544		varying vec3 vWorldPosition;
545		uniform float refractionRatio;
546	#else
547		varying vec3 vReflect;
548	#endif
549#endif`,vH=`#ifdef USE_ENVMAP
550	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
551		#define ENV_WORLDPOS
552	#endif
553	#ifdef ENV_WORLDPOS
554		
555		varying vec3 vWorldPosition;
556	#else
557		varying vec3 vReflect;
558		uniform float refractionRatio;
559	#endif
560#endif`,yH=`#ifdef USE_ENVMAP
561	#ifdef ENV_WORLDPOS
562		vWorldPosition = worldPosition.xyz;
563	#else
564		vec3 cameraToVertex;
565		if ( isOrthographic ) {
566			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
567		} else {
568			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
569		}
570		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
571		#ifdef ENVMAP_MODE_REFLECTION
572			vReflect = reflect( cameraToVertex, worldNormal );
573		#else
574			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
575		#endif
576	#endif
577#endif`,_H=`#ifdef USE_FOG
578	vFogDepth = - mvPosition.z;
579#endif`,bH=`#ifdef USE_FOG
580	varying float vFogDepth;
581#endif`,xH=`#ifdef USE_FOG
582	#ifdef FOG_EXP2
583		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
584	#else
585		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
586	#endif
587	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
588#endif`,SH=`#ifdef USE_FOG
589	uniform vec3 fogColor;
590	varying float vFogDepth;
591	#ifdef FOG_EXP2
592		uniform float fogDensity;
593	#else
594		uniform float fogNear;
595		uniform float fogFar;
596	#endif
597#endif`,TH=`#ifdef USE_GRADIENTMAP
598	uniform sampler2D gradientMap;
599#endif
600vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
601	float dotNL = dot( normal, lightDirection );
602	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
603	#ifdef USE_GRADIENTMAP
604		return vec3( texture2D( gradientMap, coord ).r );
605	#else
606		vec2 fw = fwidth( coord ) * 0.5;
607		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
608	#endif
609}`,EH=`#ifdef USE_LIGHTMAP
610	uniform sampler2D lightMap;
611	uniform float lightMapIntensity;
612#endif`,MH=`LambertMaterial material;
613material.diffuseColor = diffuseColor.rgb;
614material.specularStrength = specularStrength;`,wH=`varying vec3 vViewPosition;
615struct LambertMaterial {
616	vec3 diffuseColor;
617	float specularStrength;
618};
619void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
620	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
621	vec3 irradiance = dotNL * directLight.color;
622	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
623}
624void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
625	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
626}
627#define RE_Direct				RE_Direct_Lambert
628#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,AH=`uniform bool receiveShadow;
629uniform vec3 ambientLightColor;
630#if defined( USE_LIGHT_PROBES )
631	uniform vec3 lightProbe[ 9 ];
632#endif
633vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
634	float x = normal.x, y = normal.y, z = normal.z;
635	vec3 result = shCoefficients[ 0 ] * 0.886227;
636	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
637	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
638	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
639	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
640	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
641	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
642	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
643	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
644	return result;
645}
646vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
647	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
648	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
649	return irradiance;
650}
651vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
652	vec3 irradiance = ambientLightColor;
653	return irradiance;
654}
655float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
656	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
657	if ( cutoffDistance > 0.0 ) {
658		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
659	}
660	return distanceFalloff;
661}
662float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
663	return smoothstep( coneCosine, penumbraCosine, angleCosine );
664}
665#if NUM_DIR_LIGHTS > 0
666	struct DirectionalLight {
667		vec3 direction;
668		vec3 color;
669	};
670	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
671	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
672		light.color = directionalLight.color;
673		light.direction = directionalLight.direction;
674		light.visible = true;
675	}
676#endif
677#if NUM_POINT_LIGHTS > 0
678	struct PointLight {
679		vec3 position;
680		vec3 color;
681		float distance;
682		float decay;
683	};
684	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
685	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
686		vec3 lVector = pointLight.position - geometryPosition;
687		light.direction = normalize( lVector );
688		float lightDistance = length( lVector );
689		light.color = pointLight.color;
690		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
691		light.visible = ( light.color != vec3( 0.0 ) );
692	}
693#endif
694#if NUM_SPOT_LIGHTS > 0
695	struct SpotLight {
696		vec3 position;
697		vec3 direction;
698		vec3 color;
699		float distance;
700		float decay;
701		float coneCos;
702		float penumbraCos;
703	};
704	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
705	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
706		vec3 lVector = spotLight.position - geometryPosition;
707		light.direction = normalize( lVector );
708		float angleCos = dot( light.direction, spotLight.direction );
709		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
710		if ( spotAttenuation > 0.0 ) {
711			float lightDistance = length( lVector );
712			light.color = spotLight.color * spotAttenuation;
713			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
714			light.visible = ( light.color != vec3( 0.0 ) );
715		} else {
716			light.color = vec3( 0.0 );
717			light.visible = false;
718		}
719	}
720#endif
721#if NUM_RECT_AREA_LIGHTS > 0
722	struct RectAreaLight {
723		vec3 color;
724		vec3 position;
725		vec3 halfWidth;
726		vec3 halfHeight;
727	};
728	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
729	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
730#endif
731#if NUM_HEMI_LIGHTS > 0
732	struct HemisphereLight {
733		vec3 direction;
734		vec3 skyColor;
735		vec3 groundColor;
736	};
737	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
738	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
739		float dotNL = dot( normal, hemiLight.direction );
740		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
741		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
742		return irradiance;
743	}
744#endif`,CH=`#ifdef USE_ENVMAP
745	vec3 getIBLIrradiance( const in vec3 normal ) {
746		#ifdef ENVMAP_TYPE_CUBE_UV
747			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
748			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
749			return PI * envMapColor.rgb * envMapIntensity;
750		#else
751			return vec3( 0.0 );
752		#endif
753	}
754	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
755		#ifdef ENVMAP_TYPE_CUBE_UV
756			vec3 reflectVec = reflect( - viewDir, normal );
757			reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
758			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
759			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
760			return envMapColor.rgb * envMapIntensity;
761		#else
762			return vec3( 0.0 );
763		#endif
764	}
765	#ifdef USE_ANISOTROPY
766		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
767			#ifdef ENVMAP_TYPE_CUBE_UV
768				vec3 bentNormal = cross( bitangent, viewDir );
769				bentNormal = normalize( cross( bentNormal, bitangent ) );
770				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
771				return getIBLRadiance( viewDir, bentNormal, roughness );
772			#else
773				return vec3( 0.0 );
774			#endif
775		}
776	#endif
777#endif`,RH=`ToonMaterial material;
778material.diffuseColor = diffuseColor.rgb;`,DH=`varying vec3 vViewPosition;
779struct ToonMaterial {
780	vec3 diffuseColor;
781};
782void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
783	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
784	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
785}
786void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
787	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
788}
789#define RE_Direct				RE_Direct_Toon
790#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,UH=`BlinnPhongMaterial material;
791material.diffuseColor = diffuseColor.rgb;
792material.specularColor = specular;
793material.specularShininess = shininess;
794material.specularStrength = specularStrength;`,OH=`varying vec3 vViewPosition;
795struct BlinnPhongMaterial {
796	vec3 diffuseColor;
797	vec3 specularColor;
798	float specularShininess;
799	float specularStrength;
800};
801void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
802	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
803	vec3 irradiance = dotNL * directLight.color;
804	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
805	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
806}
807void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
808	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
809}
810#define RE_Direct				RE_Direct_BlinnPhong
811#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,LH=`PhysicalMaterial material;
812material.diffuseColor = diffuseColor.rgb;
813material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
814material.metalness = metalnessFactor;
815vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
816float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
817material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
818material.roughness = min( material.roughness, 1.0 );
819#ifdef IOR
820	material.ior = ior;
821	#ifdef USE_SPECULAR
822		float specularIntensityFactor = specularIntensity;
823		vec3 specularColorFactor = specularColor;
824		#ifdef USE_SPECULAR_COLORMAP
825			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
826		#endif
827		#ifdef USE_SPECULAR_INTENSITYMAP
828			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
829		#endif
830		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
831	#else
832		float specularIntensityFactor = 1.0;
833		vec3 specularColorFactor = vec3( 1.0 );
834		material.specularF90 = 1.0;
835	#endif
836	material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;
837	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
838#else
839	material.specularColor = vec3( 0.04 );
840	material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );
841	material.specularF90 = 1.0;
842#endif
843#ifdef USE_CLEARCOAT
844	material.clearcoat = clearcoat;
845	material.clearcoatRoughness = clearcoatRoughness;
846	material.clearcoatF0 = vec3( 0.04 );
847	material.clearcoatF90 = 1.0;
848	#ifdef USE_CLEARCOATMAP
849		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
850	#endif
851	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
852		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
853	#endif
854	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
855	material.clearcoatRoughness += geometryRoughness;
856	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
857#endif
858#ifdef USE_DISPERSION
859	material.dispersion = dispersion;
860#endif
861#ifdef USE_IRIDESCENCE
862	material.iridescence = iridescence;
863	material.iridescenceIOR = iridescenceIOR;
864	#ifdef USE_IRIDESCENCEMAP
865		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
866	#endif
867	#ifdef USE_IRIDESCENCE_THICKNESSMAP
868		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
869	#else
870		material.iridescenceThickness = iridescenceThicknessMaximum;
871	#endif
872#endif
873#ifdef USE_SHEEN
874	material.sheenColor = sheenColor;
875	#ifdef USE_SHEEN_COLORMAP
876		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
877	#endif
878	material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 );
879	#ifdef USE_SHEEN_ROUGHNESSMAP
880		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
881	#endif
882#endif
883#ifdef USE_ANISOTROPY
884	#ifdef USE_ANISOTROPYMAP
885		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
886		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
887		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
888	#else
889		vec2 anisotropyV = anisotropyVector;
890	#endif
891	material.anisotropy = length( anisotropyV );
892	if( material.anisotropy == 0.0 ) {
893		anisotropyV = vec2( 1.0, 0.0 );
894	} else {
895		anisotropyV /= material.anisotropy;
896		material.anisotropy = saturate( material.anisotropy );
897	}
898	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
899	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
900	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
901#endif`,NH
vendor: 9,654 bytes, lines 901-1132
901=`uniform sampler2D dfgLUT;
902struct PhysicalMaterial {
903	vec3 diffuseColor;
904	vec3 diffuseContribution;
905	vec3 specularColor;
906	vec3 specularColorBlended;
907	float roughness;
908	float metalness;
909	float specularF90;
910	float dispersion;
911	#ifdef USE_CLEARCOAT
912		float clearcoat;
913		float clearcoatRoughness;
914		vec3 clearcoatF0;
915		float clearcoatF90;
916	#endif
917	#ifdef USE_IRIDESCENCE
918		float iridescence;
919		float iridescenceIOR;
920		float iridescenceThickness;
921		vec3 iridescenceFresnel;
922		vec3 iridescenceF0;
923		vec3 iridescenceFresnelDielectric;
924		vec3 iridescenceFresnelMetallic;
925	#endif
926	#ifdef USE_SHEEN
927		vec3 sheenColor;
928		float sheenRoughness;
929	#endif
930	#ifdef IOR
931		float ior;
932	#endif
933	#ifdef USE_TRANSMISSION
934		float transmission;
935		float transmissionAlpha;
936		float thickness;
937		float attenuationDistance;
938		vec3 attenuationColor;
939	#endif
940	#ifdef USE_ANISOTROPY
941		float anisotropy;
942		float alphaT;
943		vec3 anisotropyT;
944		vec3 anisotropyB;
945	#endif
946};
947vec3 clearcoatSpecularDirect = vec3( 0.0 );
948vec3 clearcoatSpecularIndirect = vec3( 0.0 );
949vec3 sheenSpecularDirect = vec3( 0.0 );
950vec3 sheenSpecularIndirect = vec3(0.0 );
951vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
952    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
953    float x2 = x * x;
954    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
955    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
956}
957float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
958	float a2 = pow2( alpha );
959	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
960	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
961	return 0.5 / max( gv + gl, EPSILON );
962}
963float D_GGX( const in float alpha, const in float dotNH ) {
964	float a2 = pow2( alpha );
965	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
966	return RECIPROCAL_PI * a2 / pow2( denom );
967}
968#ifdef USE_ANISOTROPY
969	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
970		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
971		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
972		float v = 0.5 / ( gv + gl );
973		return v;
974	}
975	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
976		float a2 = alphaT * alphaB;
977		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
978		highp float v2 = dot( v, v );
979		float w2 = a2 / v2;
980		return RECIPROCAL_PI * a2 * pow2 ( w2 );
981	}
982#endif
983#ifdef USE_CLEARCOAT
984	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
985		vec3 f0 = material.clearcoatF0;
986		float f90 = material.clearcoatF90;
987		float roughness = material.clearcoatRoughness;
988		float alpha = pow2( roughness );
989		vec3 halfDir = normalize( lightDir + viewDir );
990		float dotNL = saturate( dot( normal, lightDir ) );
991		float dotNV = saturate( dot( normal, viewDir ) );
992		float dotNH = saturate( dot( normal, halfDir ) );
993		float dotVH = saturate( dot( viewDir, halfDir ) );
994		vec3 F = F_Schlick( f0, f90, dotVH );
995		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
996		float D = D_GGX( alpha, dotNH );
997		return F * ( V * D );
998	}
999#endif
1000vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1001	vec3 f0 = material.specularColorBlended;
1002	float f90 = material.specularF90;
1003	float roughness = material.roughness;
1004	float alpha = pow2( roughness );
1005	vec3 halfDir = normalize( lightDir + viewDir );
1006	float dotNL = saturate( dot( normal, lightDir ) );
1007	float dotNV = saturate( dot( normal, viewDir ) );
1008	float dotNH = saturate( dot( normal, halfDir ) );
1009	float dotVH = saturate( dot( viewDir, halfDir ) );
1010	vec3 F = F_Schlick( f0, f90, dotVH );
1011	#ifdef USE_IRIDESCENCE
1012		F = mix( F, material.iridescenceFresnel, material.iridescence );
1013	#endif
1014	#ifdef USE_ANISOTROPY
1015		float dotTL = dot( material.anisotropyT, lightDir );
1016		float dotTV = dot( material.anisotropyT, viewDir );
1017		float dotTH = dot( material.anisotropyT, halfDir );
1018		float dotBL = dot( material.anisotropyB, lightDir );
1019		float dotBV = dot( material.anisotropyB, viewDir );
1020		float dotBH = dot( material.anisotropyB, halfDir );
1021		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1022		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1023	#else
1024		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1025		float D = D_GGX( alpha, dotNH );
1026	#endif
1027	return F * ( V * D );
1028}
1029vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1030	const float LUT_SIZE = 64.0;
1031	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1032	const float LUT_BIAS = 0.5 / LUT_SIZE;
1033	float dotNV = saturate( dot( N, V ) );
1034	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1035	uv = uv * LUT_SCALE + LUT_BIAS;
1036	return uv;
1037}
1038float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1039	float l = length( f );
1040	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1041}
1042vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1043	float x = dot( v1, v2 );
1044	float y = abs( x );
1045	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1046	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1047	float v = a / b;
1048	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1049	return cross( v1, v2 ) * theta_sintheta;
1050}
1051vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1052	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1053	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1054	vec3 lightNormal = cross( v1, v2 );
1055	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1056	vec3 T1, T2;
1057	T1 = normalize( V - N * dot( V, N ) );
1058	T2 = - cross( N, T1 );
1059	mat3 mat = mInv * transpose( mat3( T1, T2, N ) );
1060	vec3 coords[ 4 ];
1061	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1062	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1063	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1064	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1065	coords[ 0 ] = normalize( coords[ 0 ] );
1066	coords[ 1 ] = normalize( coords[ 1 ] );
1067	coords[ 2 ] = normalize( coords[ 2 ] );
1068	coords[ 3 ] = normalize( coords[ 3 ] );
1069	vec3 vectorFormFactor = vec3( 0.0 );
1070	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1071	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1072	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1073	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1074	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1075	return vec3( result );
1076}
1077#if defined( USE_SHEEN )
1078float D_Charlie( float roughness, float dotNH ) {
1079	float alpha = pow2( roughness );
1080	float invAlpha = 1.0 / alpha;
1081	float cos2h = dotNH * dotNH;
1082	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1083	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1084}
1085float V_Neubelt( float dotNV, float dotNL ) {
1086	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1087}
1088vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1089	vec3 halfDir = normalize( lightDir + viewDir );
1090	float dotNL = saturate( dot( normal, lightDir ) );
1091	float dotNV = saturate( dot( normal, viewDir ) );
1092	float dotNH = saturate( dot( normal, halfDir ) );
1093	float D = D_Charlie( sheenRoughness, dotNH );
1094	float V = V_Neubelt( dotNV, dotNL );
1095	return sheenColor * ( D * V );
1096}
1097#endif
1098float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1099	float dotNV = saturate( dot( normal, viewDir ) );
1100	float r2 = roughness * roughness;
1101	float rInv = 1.0 / ( roughness + 0.1 );
1102	float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;
1103	float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;
1104	float DG = exp( a * dotNV + b );
1105	return saturate( DG );
1106}
1107vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1108	float dotNV = saturate( dot( normal, viewDir ) );
1109	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1110	return specularColor * fab.x + specularF90 * fab.y;
1111}
1112#ifdef USE_IRIDESCENCE
1113void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
1114#else
1115void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
1116#endif
1117	float dotNV = saturate( dot( normal, viewDir ) );
1118	vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;
1119	#ifdef USE_IRIDESCENCE
1120		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1121	#else
1122		vec3 Fr = specularColor;
1123	#endif
1124	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1125	float Ess = fab.x + fab.y;
1126	float Ems = 1.0 - Ess;
1127	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1128	singleScatter += FssEss;
1129	multiScatter += Fms * Ems;
1130}
1131vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1132	vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 1133-1262
1133	float dotNL = saturate( dot( normal, lightDir ) );
1134	float dotNV = saturate( dot( normal, viewDir ) );
1135	vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;
1136	vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;
1137	vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;
1138	vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;
1139	float Ess_V = dfgV.x + dfgV.y;
1140	float Ess_L = dfgL.x + dfgL.y;
1141	float Ems_V = 1.0 - Ess_V;
1142	float Ems_L = 1.0 - Ess_L;
1143	vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;
1144	vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );
1145	float compensationFactor = Ems_V * Ems_L;
1146	vec3 multiScatter = Fms * compensationFactor;
1147	return singleScatter + multiScatter;
1148}
1149#if NUM_RECT_AREA_LIGHTS > 0
1150	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1151		vec3 normal = geometryNormal;
1152		vec3 viewDir = geometryViewDir;
1153		vec3 position = geometryPosition;
1154		vec3 lightPos = rectAreaLight.position;
1155		vec3 halfWidth = rectAreaLight.halfWidth;
1156		vec3 halfHeight = rectAreaLight.halfHeight;
1157		vec3 lightColor = rectAreaLight.color;
1158		float roughness = material.roughness;
1159		vec3 rectCoords[ 4 ];
1160		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1161		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1162		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1163		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1164		vec4 t1 = texture2D( ltc_1, uv );
1165		vec4 t2 = texture2D( ltc_2, uv );
1166		mat3 mInv = mat3(
1167			vec3( t1.x, 0, t1.y ),
1168			vec3(    0, 1,    0 ),
1169			vec3( t1.z, 0, t1.w )
1170		);
1171		vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y );
1172		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1173		reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1174		#ifdef USE_CLEARCOAT
1175			vec3 Ncc = geometryClearcoatNormal;
1176			vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness );
1177			vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat );
1178			vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat );
1179			mat3 mInvClearcoat = mat3(
1180				vec3( t1Clearcoat.x, 0, t1Clearcoat.y ),
1181				vec3(             0, 1,             0 ),
1182				vec3( t1Clearcoat.z, 0, t1Clearcoat.w )
1183			);
1184			vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y;
1185			clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords );
1186		#endif
1187	}
1188#endif
1189void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1190	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1191	vec3 irradiance = dotNL * directLight.color;
1192	#ifdef USE_CLEARCOAT
1193		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1194		vec3 ccIrradiance = dotNLcc * directLight.color;
1195		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1196	#endif
1197	#ifdef USE_SHEEN
1198 
1199 		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1200 
1201 		float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1202 		float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );
1203 
1204 		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );
1205 
1206 		irradiance *= sheenEnergyComp;
1207 
1208 	#endif
1209	reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );
1210	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );
1211}
1212void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1213	vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );
1214	#ifdef USE_SHEEN
1215		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1216		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1217		diffuse *= sheenEnergyComp;
1218	#endif
1219	reflectedLight.indirectDiffuse += diffuse;
1220}
1221void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
1222	#ifdef USE_CLEARCOAT
1223		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1224	#endif
1225	#ifdef USE_SHEEN
1226		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI;
1227 	#endif
1228	vec3 singleScatteringDielectric = vec3( 0.0 );
1229	vec3 multiScatteringDielectric = vec3( 0.0 );
1230	vec3 singleScatteringMetallic = vec3( 0.0 );
1231	vec3 multiScatteringMetallic = vec3( 0.0 );
1232	#ifdef USE_IRIDESCENCE
1233		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1234		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1235	#else
1236		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );
1237		computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );
1238	#endif
1239	vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );
1240	vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );
1241	vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;
1242	vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );
1243	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1244	vec3 indirectSpecular = radiance * singleScattering;
1245	indirectSpecular += multiScattering * cosineWeightedIrradiance;
1246	vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;
1247	#ifdef USE_SHEEN
1248		float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1249		float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;
1250		indirectSpecular *= sheenEnergyComp;
1251		indirectDiffuse *= sheenEnergyComp;
1252	#endif
1253	reflectedLight.indirectSpecular += indirectSpecular;
1254	reflectedLight.indirectDiffuse += indirectDiffuse;
1255}
1256#define RE_Direct				RE_Direct_Physical
1257#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1258#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1259#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1260float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1261	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1262}`,
1262PH=`
1263vec3 geometryPosition = - vViewPosition;
1264vec3 geometryNormal = normal;
1265vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1266vec3 geometryClearcoatNormal = vec3( 0.0 );
1267#ifdef USE_CLEARCOAT
1268	geometryClearcoatNormal = clearcoatNormal;
1269#endif
1270#ifdef USE_IRIDESCENCE
1271	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1272	if ( material.iridescenceThickness == 0.0 ) {
1273		material.iridescence = 0.0;
1274	} else {
1275		material.iridescence = saturate( material.iridescence );
1276	}
1277	if ( material.iridescence > 0.0 ) {
1278		material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1279		material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );
1280		material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );
1281		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1282	}
1283#endif
1284IncidentLight directLight;
1285#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1286	PointLight pointLight;
1287	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1288	PointLightShadow pointLightShadow;
1289	#endif
1290	#pragma unroll_loop_start
1291	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1292		pointLight = pointLights[ i ];
1293		getPointLightInfo( pointLight, geometryPosition, directLight );
1294		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
1295		pointLightShadow = pointLightShadows[ i ];
1296		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1297		#endif
1298		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1299	}
1300	#pragma unroll_loop_end
1301#endif
1302#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1303	SpotLight spotLight;
1304	vec4 spotColor;
1305	vec3 spotLightCoord;
1306	bool inSpotLightMap;
1307	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1308	SpotLightShadow spotLightShadow;
1309	#endif
1310	#pragma unroll_loop_start
1311	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1312		spotLight = spotLights[ i ];
1313		getSpotLightInfo( spotLight, geometryPosition, directLight );
1314		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1315		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1316		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1317		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1318		#else
1319		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1320		#endif
1321		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1322			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1323			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1324			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1325			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1326		#endif
1327		#undef SPOT_LIGHT_MAP_INDEX
1328		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1329		spotLightShadow = spotLightShadows[ i ];
1330		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1331		#endif
1332		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1333	}
1334	#pragma unroll_loop_end
1335#endif
1336#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1337	DirectionalLight directionalLight;
1338	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1339	DirectionalLightShadow directionalLightShadow;
1340	#endif
1341	#pragma unroll_loop_start
1342	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1343		directionalLight = directionalLights[ i ];
1344		getDirectionalLightInfo( directionalLight, directLight );
1345		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1346		directionalLightShadow = directionalLightShadows[ i ];
1347		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1348		#endif
1349		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1350	}
1351	#pragma unroll_loop_end
1352#endif
1353#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1354	RectAreaLight rectAreaLight;
1355	#pragma unroll_loop_start
1356	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1357		rectAreaLight = rectAreaLights[ i ];
1358		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1359	}
1360	#pragma unroll_loop_end
1361#endif
1362#if defined( RE_IndirectDiffuse )
1363	vec3 iblIrradiance = vec3( 0.0 );
1364	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1365	#if defined( USE_LIGHT_PROBES )
1366		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1367	#endif
1368	#if ( NUM_HEMI_LIGHTS > 0 )
1369		#pragma unroll_loop_start
1370		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1371			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1372		}
1373		#pragma unroll_loop_end
1374	#endif
1375#endif
1376#if defined( RE_IndirectSpecular )
1377	vec3 radiance = vec3( 0.0 );
1378	vec3 clearcoatRadiance = vec3( 0.0 );
1379#endif`,IH=`#if defined( RE_IndirectDiffuse )
1380	#ifdef USE_LIGHTMAP
1381		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1382		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1383		irradiance += lightMapIrradiance;
1384	#endif
1385	#if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV )
1386		#if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG )
1387			iblIrradiance += getIBLIrradiance( geometryNormal );
1388		#endif
1389	#endif
1390#endif
1391#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1392	#ifdef USE_ANISOTROPY
1393		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1394	#else
1395		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1396	#endif
1397	#ifdef USE_CLEARCOAT
1398		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1399	#endif
1400#endif`,zH=`#if defined( RE_IndirectDiffuse )
1401	#if defined( LAMBERT ) || defined( PHONG )
1402		irradiance += iblIrradiance;
1403	#endif
1404	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1405#endif
1406#if defined( RE_IndirectSpecular )
1407	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1408#endif`,kH=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1409	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1410#endif`,FH=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1411	uniform float logDepthBufFC;
1412	varying float vFragDepth;
1413	varying float vIsPerspective;
1414#endif`,BH=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1415	varying float vFragDepth;
1416	varying float vIsPerspective;
1417#endif`,HH=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
1418	vFragDepth = 1.0 + gl_Position.w;
1419	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1420#endif`,VH=`#ifdef USE_MAP
1421	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1422	#ifdef DECODE_VIDEO_TEXTURE
1423		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1424	#endif
1425	diffuseColor *= sampledDiffuseColor;
1426#endif`,GH=`#ifdef USE_MAP
1427	uniform sampler2D map;
1428#endif`,WH=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1429	#if defined( USE_POINTS_UV )
1430		vec2 uv = vUv;
1431	#else
1432		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1433	#endif
1434#endif
1435#ifdef USE_MAP
1436	diffuseColor *= texture2D( map, uv );
1437#endif
1438#ifdef USE_ALPHAMAP
1439	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1440#endif`,XH=`#if defined( USE_POINTS_UV )
1441	varying vec2 vUv;
1442#else
1443	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1444		uniform mat3 uvTransform;
1445	#endif
1446#endif
1447#ifdef USE_MAP
1448	uniform sampler2D map;
1449#endif
1450#ifdef USE_ALPHAMAP
1451	uniform sampler2D alphaMap;
1452#endif`,qH=`float metalnessFactor = metalness;
1453#ifdef USE_METALNESSMAP
1454	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1455	metalnessFactor *= texelMetalness.b;
1456#endif`,YH=`#ifdef USE_METALNESSMAP
1457	uniform sampler2D metalnessMap;
1458#endif`,jH=`#ifdef USE_INSTANCING_MORPH
1459	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1460	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1461	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1462		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1463	}
1464#endif`,ZH=`#if defined( USE_MORPHCOLORS )
1465	vColor *= morphTargetBaseInfluence;
1466	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1467		#if defined( USE_COLOR_ALPHA )
1468			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1469		#elif defined( USE_COLOR )
1470			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1471		#endif
1472	}
1473#endif`,KH=`#ifdef USE_MORPHNORMALS
1474	objectNormal *= morphTargetBaseInfluence;
1475	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1476		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1477	}
1478#endif`,QH=`#ifdef USE_MORPHTARGETS
1479	#ifndef USE_INSTANCING_MORPH
1480		uniform float morphTargetBaseInfluence;
1481		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1482	#endif
1483	uniform sampler2DArray morphTargetsTexture;
1484	uniform ivec2 morphTargetsTextureSize;
1485	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1486		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1487		int y = texelIndex / morphTargetsTextureSize.x;
1488		int x = texelIndex - y * morphTargetsTextureSize.x;
1489		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1490		return texelFetch( morphTargetsTexture, morphUV, 0 );
1491	}
1492#endif`,JH=`#ifdef USE_MORPHTARGETS
1493	transformed *= morphTargetBaseInfluence;
1494	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1495		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1496	}
1497#endif`,$H=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1498#ifdef FLAT_SHADED
1499	vec3 fdx = dFdx( vViewPosition );
1500	vec3 fdy = dFdy( vViewPosition );
1501	vec3 normal = normalize( cross( fdx, fdy ) );
1502#else
1503	vec3 normal = normalize( vNormal );
1504	#ifdef DOUBLE_SIDED
1505		normal *= faceDirection;
1506	#endif
1507#endif
1508#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1509	#ifdef USE_TANGENT
1510		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1511	#else
1512		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1513		#if defined( USE_NORMALMAP )
1514			vNormalMapUv
1515		#elif defined( USE_CLEARCOAT_NORMALMAP )
1516			vClearcoatNormalMapUv
1517		#else
1518			vUv
1519		#endif
1520		);
1521	#endif
1522	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1523		tbn[0] *= faceDirection;
1524		tbn[1] *= faceDirection;
1525	#endif
1526#endif
1527#ifdef USE_CLEARCOAT_NORMALMAP
1528	#ifdef USE_TANGENT
1529		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1530	#else
1531		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1532	#endif
1533	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1534		tbn2[0] *= faceDirection;
1535		tbn2[1] *= faceDirection;
1536	#endif
1537#endif
1538vec3 nonPerturbedNormal = normal;`,eV=`#ifdef USE_NORMALMAP_OBJECTSPACE
1539	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1540	#ifdef FLIP_SIDED
1541		normal = - normal;
1542	#endif
1543	#ifdef DOUBLE_SIDED
1544		normal = normal * faceDirection;
1545	#endif
1546	normal = normalize( normalMatrix * normal );
1547#elif defined( USE_NORMALMAP_TANGENTSPACE )
1548	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1549	mapN.xy *= normalScale;
1550	normal = normalize( tbn * mapN );
1551#elif defined( USE_BUMPMAP )
1552	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1553#endif`,tV=`#ifndef FLAT_SHADED
1554	varying vec3 vNormal;
1555	#ifdef USE_TANGENT
1556		varying vec3 vTangent;
1557		varying vec3 vBitangent;
1558	#endif
1559#endif`,nV=`#ifndef FLAT_SHADED
1560	varying vec3 vNormal;
1561	#ifdef USE_TANGENT
1562		varying vec3 vTangent;
1563		varying vec3 vBitangent;
1564	#endif
1565#endif`,iV=`#ifndef FLAT_SHADED
1566	vNormal = normalize( transformedNormal );
1567	#ifdef USE_TANGENT
1568		vTangent = normalize( transformedTangent );
1569		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1570	#endif
1571#endif`,rV=`#ifdef USE_NORMALMAP
1572	uniform sampler2D normalMap;
1573	uniform vec2 normalScale;
1574#endif
1575#ifdef USE_NORMALMAP_OBJECTSPACE
1576	uniform mat3 normalMatrix;
1577#endif
1578#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1579	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1580		vec3 q0 = dFdx( eye_pos.xyz );
1581		vec3 q1 = dFdy( eye_pos.xyz );
1582		vec2 st0 = dFdx( uv.st );
1583		vec2 st1 = dFdy( uv.st );
1584		vec3 N = surf_norm;
1585		vec3 q1perp = cross( q1, N );
1586		vec3 q0perp = cross( N, q0 );
1587		vec3 T = q1perp * st0.x + q0perp * st1.x;
1588		vec3 B = q1perp * st0.y + q0perp * st1.y;
1589		float det = max( dot( T, T ), dot( B, B ) );
1590		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1591		return mat3( T * scale, B * scale, N );
1592	}
1593#endif`,aV=`#ifdef USE_CLEARCOAT
1594	vec3 clearcoatNormal = nonPerturbedNormal;
1595#endif`,oV=`#ifdef USE_CLEARCOAT_NORMALMAP
1596	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1597	clearcoatMapN.xy *= clearcoatNormalScale;
1598	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1599#endif`,sV=`#ifdef USE_CLEARCOATMAP
1600	uniform sampler2D clearcoatMap;
1601#endif
1602#ifdef USE_CLEARCOAT_NORMALMAP
1603	uniform sampler2D clearcoatNormalMap;
1604	uniform vec2 clearcoatNormalScale;
1605#endif
1606#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1607	uniform sampler2D clearcoatRoughnessMap;
1608#endif`,lV=`#ifdef USE_IRIDESCENCEMAP
1609	uniform sampler2D iridescenceMap;
1610#endif
1611#ifdef USE_IRIDESCENCE_THICKNESSMAP
1612	uniform sampler2D iridescenceThicknessMap;
1613#endif`,uV=`#ifdef OPAQUE
1614diffuseColor.a = 1.0;
1615#endif
1616#ifdef USE_TRANSMISSION
1617diffuseColor.a *= material.transmissionAlpha;
1618#endif
1619gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,cV=`vec3 packNormalToRGB( const in vec3 normal ) {
1620	return normalize( normal ) * 0.5 + 0.5;
1621}
1622vec3 unpackRGBToNormal( const in vec3 rgb ) {
1623	return 2.0 * rgb.xyz - 1.0;
1624}
1625const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1626const float Inv255 = 1. / 255.;
1627const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1628const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1629const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1630const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1631vec4 packDepthToRGBA( const in float v ) {
1632	if( v <= 0.0 )
1633		return vec4( 0., 0., 0., 0. );
1634	if( v >= 1.0 )
1635		return vec4( 1., 1., 1., 1. );
1636	float vuf;
1637	float af = modf( v * PackFactors.a, vuf );
1638	float bf = modf( vuf * ShiftRight8, vuf );
1639	float gf = modf( vuf * ShiftRight8, vuf );
1640	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
1641}
1642vec3 packDepthToRGB( const in float v ) {
1643	if( v <= 0.0 )
1644		return vec3( 0., 0., 0. );
1645	if( v >= 1.0 )
1646		return vec3( 1., 1., 1. );
1647	float vuf;
1648	float bf = modf( v * PackFactors.b, vuf );
1649	float gf = modf( vuf * ShiftRight8, vuf );
1650	return vec3( vuf * Inv255, gf * PackUpscale, bf );
1651}
1652vec2 packDepthToRG( const in float v ) {
1653	if( v <= 0.0 )
1654		return vec2( 0., 0. );
1655	if( v >= 1.0 )
1656		return vec2( 1., 1. );
1657	float vuf;
1658	float gf = modf( v * 256., vuf );
1659	return vec2( vuf * Inv255, gf );
1660}
1661float unpackRGBAToDepth( const in vec4 v ) {
1662	return dot( v, UnpackFactors4 );
1663}
1664float unpackRGBToDepth( const in vec3 v ) {
1665	return dot( v, UnpackFactors3 );
1666}
1667float unpackRGToDepth( const in vec2 v ) {
1668	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
1669}
1670vec4 pack2HalfToRGBA( const in vec2 v ) {
1671	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1672	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1673}
1674vec2 unpackRGBATo2Half( const in vec4 v ) {
1675	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1676}
1677float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1678	return ( viewZ + near ) / ( near - far );
1679}
1680float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1681	#ifdef USE_REVERSED_DEPTH_BUFFER
1682	
1683		return depth * ( far - near ) - far;
1684	#else
1685		return depth * ( near - far ) - near;
1686	#endif
1687}
1688float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1689	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1690}
1691float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1692	
1693	#ifdef USE_REVERSED_DEPTH_BUFFER
1694		return ( near * far ) / ( ( near - far ) * depth - near );
1695	#else
1696		return ( near * far ) / ( ( far - near ) * depth - far );
1697	#endif
1698}`,fV=`#ifdef PREMULTIPLIED_ALPHA
1699	gl_FragColor.rgb *= gl_FragColor.a;
1700#endif`,dV=`vec4 mvPosition = vec4( transformed, 1.0 );
1701#ifdef USE_BATCHING
1702	mvPosition = batchingMatrix * mvPosition;
1703#endif
1704#ifdef USE_INSTANCING
1705	mvPosition = instanceMatrix * mvPosition;
1706#endif
1707mvPosition = modelViewMatrix * mvPosition;
1708gl_Position = projectionMatrix * mvPosition;`,hV=`#ifdef DITHERING
1709	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1710#endif`,pV=`#ifdef DITHERING
1711	vec3 dithering( vec3 color ) {
1712		float grid_position = rand( gl_FragCoord.xy );
1713		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1714		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1715		return color + dither_shift_RGB;
1716	}
1717#endif`,mV=`float roughnessFactor = roughness;
1718#ifdef USE_ROUGHNESSMAP
1719	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1720	roughnessFactor *= texelRoughness.g;
1721#endif`,gV=`#ifdef USE_ROUGHNESSMAP
1722	uniform sampler2D roughnessMap;
1723#endif`,vV=`#if NUM_SPOT_LIGHT_COORDS > 0
1724	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1725#endif
1726#if NUM_SPOT_LIGHT_MAPS > 0
1727	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1728#endif
1729#ifdef USE_SHADOWMAP
1730	#if NUM_DIR_LIGHT_SHADOWS > 0
1731		#if defined( SHADOWMAP_TYPE_PCF )
1732			uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1733		#else
1734			uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1735		#endif
1736		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1737		struct DirectionalLightShadow {
1738			float shadowIntensity;
1739			float shadowBias;
1740			float shadowNormalBias;
1741			float shadowRadius;
1742			vec2 shadowMapSize;
1743		};
1744		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1745	#endif
1746	#if NUM_SPOT_LIGHT_SHADOWS > 0
1747		#if defined( SHADOWMAP_TYPE_PCF )
1748			uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1749		#else
1750			uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1751		#endif
1752		struct SpotLightShadow {
1753			float shadowIntensity;
1754			float shadowBias;
1755			float shadowNormalBias;
1756			float shadowRadius;
1757			vec2 shadowMapSize;
1758		};
1759		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1760	#endif
1761	#if NUM_POINT_LIGHT_SHADOWS > 0
1762		#if defined( SHADOWMAP_TYPE_PCF )
1763			uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1764		#elif defined( SHADOWMAP_TYPE_BASIC )
1765			uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1766		#endif
1767		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1768		struct PointLightShadow {
1769			float shadowIntensity;
1770			float shadowBias;
1771			float shadowNormalBias;
1772			float shadowRadius;
1773			vec2 shadowMapSize;
1774			float shadowCameraNear;
1775			float shadowCameraFar;
1776		};
1777		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1778	#endif
1779	#if defined( SHADOWMAP_TYPE_PCF )
1780		float interleavedGradientNoise( vec2 position ) {
1781			return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );
1782		}
1783		vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {
1784			const float goldenAngle = 2.399963229728653;
1785			float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );
1786			float theta = float( sampleIndex ) * goldenAngle + phi;
1787			return vec2( cos( theta ), sin( theta ) ) * r;
1788		}
1789	#endif
1790	#if defined( SHADOWMAP_TYPE_PCF )
1791		float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1792			float shadow = 1.0;
1793			shadowCoord.xyz /= shadowCoord.w;
1794			shadowCoord.z += shadowBias;
1795			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1796			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1797			if ( frustumTest ) {
1798				vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1799				float radius = shadowRadius * texelSize.x;
1800				float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1801				shadow = (
1802					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +
1803					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +
1804					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +
1805					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +
1806					texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )
1807				) * 0.2;
1808			}
1809			return mix( 1.0, shadow, shadowIntensity );
1810		}
1811	#elif defined( SHADOWMAP_TYPE_VSM )
1812		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1813			float shadow = 1.0;
1814			shadowCoord.xyz /= shadowCoord.w;
1815			#ifdef USE_REVERSED_DEPTH_BUFFER
1816				shadowCoord.z -= shadowBias;
1817			#else
1818				shadowCoord.z += shadowBias;
1819			#endif
1820			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1821			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1822			if ( frustumTest ) {
1823				vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;
1824				float mean = distribution.x;
1825				float variance = distribution.y * distribution.y;
1826				#ifdef USE_REVERSED_DEPTH_BUFFER
1827					float hard_shadow = step( mean, shadowCoord.z );
1828				#else
1829					float hard_shadow = step( shadowCoord.z, mean );
1830				#endif
1831				
1832				if ( hard_shadow == 1.0 ) {
1833					shadow = 1.0;
1834				} else {
1835					variance = max( variance, 0.0000001 );
1836					float d = shadowCoord.z - mean;
1837					float p_max = variance / ( variance + d * d );
1838					p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );
1839					shadow = max( hard_shadow, p_max );
1840				}
1841			}
1842			return mix( 1.0, shadow, shadowIntensity );
1843		}
1844	#else
1845		float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1846			float shadow = 1.0;
1847			shadowCoord.xyz /= shadowCoord.w;
1848			#ifdef USE_REVERSED_DEPTH_BUFFER
1849				shadowCoord.z -= shadowBias;
1850			#else
1851				shadowCoord.z += shadowBias;
1852			#endif
1853			bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1854			bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1855			if ( frustumTest ) {
1856				float depth = texture2D( shadowMap, shadowCoord.xy ).r;
1857				#ifdef USE_REVERSED_DEPTH_BUFFER
1858					shadow = step( depth, shadowCoord.z );
1859				#else
1860					shadow = step( shadowCoord.z, depth );
1861				#endif
1862			}
1863			return mix( 1.0, shadow, shadowIntensity );
1864		}
1865	#endif
1866	#if NUM_POINT_LIGHT_SHADOWS > 0
1867	#if defined( SHADOWMAP_TYPE_PCF )
1868	float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1869		float shadow = 1.0;
1870		vec3 lightToPosition = shadowCoord.xyz;
1871		vec3 bd3D = normalize( lightToPosition );
1872		vec3 absVec = abs( lightToPosition );
1873		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1874		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
1875			#ifdef USE_REVERSED_DEPTH_BUFFER
1876				float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1877				dp -= shadowBias;
1878			#else
1879				float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1880				dp += shadowBias;
1881			#endif
1882			float texelSize = shadowRadius / shadowMapSize.x;
1883			vec3 absDir = abs( bd3D );
1884			vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );
1885			tangent = normalize( cross( bd3D, tangent ) );
1886			vec3 bitangent = cross( bd3D, tangent );
1887			float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2;
1888			vec2 sample0 = vogelDiskSample( 0, 5, phi );
1889			vec2 sample1 = vogelDiskSample( 1, 5, phi );
1890			vec2 sample2 = vogelDiskSample( 2, 5, phi );
1891			vec2 sample3 = vogelDiskSample( 3, 5, phi );
1892			vec2 sample4 = vogelDiskSample( 4, 5, phi );
1893			shadow = (
1894				texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) +
1895				texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) +
1896				texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) +
1897				texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) +
1898				texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) )
1899			) * 0.2;
1900		}
1901		return mix( 1.0, shadow, shadowIntensity );
1902	}
1903	#elif defined( SHADOWMAP_TYPE_BASIC )
1904	float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1905		float shadow = 1.0;
1906		vec3 lightToPosition = shadowCoord.xyz;
1907		vec3 absVec = abs( lightToPosition );
1908		float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );
1909		if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {
1910			float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1911			dp += shadowBias;
1912			vec3 bd3D = normalize( lightToPosition );
1913			float depth = textureCube( shadowMap, bd3D ).r;
1914			#ifdef USE_REVERSED_DEPTH_BUFFER
1915				depth = 1.0 - depth;
1916			#endif
1917			shadow = step( dp, depth );
1918		}
1919		return mix( 1.0, shadow, shadowIntensity );
1920	}
1921	#endif
1922	#endif
1923#endif`,yV=`#if NUM_SPOT_LIGHT_COORDS > 0
1924	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1925	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1926#endif
1927#ifdef USE_SHADOWMAP
1928	#if NUM_DIR_LIGHT_SHADOWS > 0
1929		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
1930		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1931		struct DirectionalLightShadow {
1932			float shadowIntensity;
1933			float shadowBias;
1934			float shadowNormalBias;
1935			float shadowRadius;
1936			vec2 shadowMapSize;
1937		};
1938		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1939	#endif
1940	#if NUM_SPOT_LIGHT_SHADOWS > 0
1941		struct SpotLightShadow {
1942			float shadowIntensity;
1943			float shadowBias;
1944			float shadowNormalBias;
1945			float shadowRadius;
1946			vec2 shadowMapSize;
1947		};
1948		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1949	#endif
1950	#if NUM_POINT_LIGHT_SHADOWS > 0
1951		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
1952		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1953		struct PointLightShadow {
1954			float shadowIntensity;
1955			float shadowBias;
1956			float shadowNormalBias;
1957			float shadowRadius;
1958			vec2 shadowMapSize;
1959			float shadowCameraNear;
1960			float shadowCameraFar;
1961		};
1962		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1963	#endif
1964#endif`,_V=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1965	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
1966	vec4 shadowWorldPosition;
1967#endif
1968#if defined( USE_SHADOWMAP )
1969	#if NUM_DIR_LIGHT_SHADOWS > 0
1970		#pragma unroll_loop_start
1971		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
1972			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
1973			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
1974		}
1975		#pragma unroll_loop_end
1976	#endif
1977	#if NUM_POINT_LIGHT_SHADOWS > 0
1978		#pragma unroll_loop_start
1979		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
1980			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
1981			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
1982		}
1983		#pragma unroll_loop_end
1984	#endif
1985#endif
1986#if NUM_SPOT_LIGHT_COORDS > 0
1987	#pragma unroll_loop_start
1988	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
1989		shadowWorldPosition = worldPosition;
1990		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1991			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
1992		#endif
1993		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
1994	}
1995	#pragma unroll_loop_end
1996#endif`,bV=`float getShadowMask() {
1997	float shadow = 1.0;
1998	#ifdef USE_SHADOWMAP
1999	#if NUM_DIR_LIGHT_SHADOWS > 0
2000	DirectionalLightShadow directionalLight;
2001	#pragma unroll_loop_start
2002	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2003		directionalLight = directionalLightShadows[ i ];
2004		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
2005	}
2006	#pragma unroll_loop_end
2007	#endif
2008	#if NUM_SPOT_LIGHT_SHADOWS > 0
2009	SpotLightShadow spotLight;
2010	#pragma unroll_loop_start
2011	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
2012		spotLight = spotLightShadows[ i ];
2013		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
2014	}
2015	#pragma unroll_loop_end
2016	#endif
2017	#if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )
2018	PointLightShadow pointLight;
2019	#pragma unroll_loop_start
2020	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2021		pointLight = pointLightShadows[ i ];
2022		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2023	}
2024	#pragma unroll_loop_end
2025	#endif
2026	#endif
2027	return shadow;
2028}`,xV=`#ifdef USE_SKINNING
2029	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2030	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2031	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2032	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2033#endif`,SV=`#ifdef USE_SKINNING
2034	uniform mat4 bindMatrix;
2035	uniform mat4 bindMatrixInverse;
2036	uniform highp sampler2D boneTexture;
2037	mat4 getBoneMatrix( const in float i ) {
2038		int size = textureSize( boneTexture, 0 ).x;
2039		int j = int( i ) * 4;
2040		int x = j % size;
2041		int y = j / size;
2042		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2043		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2044		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2045		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2046		return mat4( v1, v2, v3, v4 );
2047	}
2048#endif`,TV=`#ifdef USE_SKINNING
2049	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2050	vec4 skinned = vec4( 0.0 );
2051	skinned += boneMatX * skinVertex * skinWeight.x;
2052	skinned += boneMatY * skinVertex * skinWeight.y;
2053	skinned += boneMatZ * skinVertex * skinWeight.z;
2054	skinned += boneMatW * skinVertex * skinWeight.w;
2055	transformed = ( bindMatrixInverse * skinned ).xyz;
2056#endif`,EV=`#ifdef USE_SKINNING
2057	mat4 skinMatrix = mat4( 0.0 );
2058	skinMatrix += skinWeight.x * boneMatX;
2059	skinMatrix += skinWeight.y * boneMatY;
2060	skinMatrix += skinWeight.z * boneMatZ;
2061	skinMatrix += skinWeight.w * boneMatW;
2062	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2063	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2064	#ifdef USE_TANGENT
2065		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2066	#endif
2067#endif`,MV=`float specularStrength;
2068#ifdef USE_SPECULARMAP
2069	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2070	specularStrength = texelSpecular.r;
2071#else
2072	specularStrength = 1.0;
2073#endif`,wV=`#ifdef USE_SPECULARMAP
2074	uniform sampler2D specularMap;
2075#endif`,AV=`#if defined( TONE_MAPPING )
2076	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2077#endif`,CV=`#ifndef saturate
2078#define saturate( a ) clamp( a, 0.0, 1.0 )
2079#endif
2080uniform float toneMappingExposure;
2081vec3 LinearToneMapping( vec3 color ) {
2082	return saturate( toneMappingExposure * color );
2083}
2084vec3 ReinhardToneMapping( vec3 color ) {
2085	color *= toneMappingExposure;
2086	return saturate( color / ( vec3( 1.0 ) + color ) );
2087}
2088vec3 CineonToneMapping( vec3 color ) {
2089	color *= toneMappingExposure;
2090	color = max( vec3( 0.0 ), color - 0.004 );
2091	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2092}
2093vec3 RRTAndODTFit( vec3 v ) {
2094	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2095	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2096	return a / b;
2097}
2098vec3 ACESFilmicToneMapping( vec3 color ) {
2099	const mat3 ACESInputMat = mat3(
2100		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2101		vec3( 0.04823, 0.01566, 0.83777 )
2102	);
2103	const mat3 ACESOutputMat = mat3(
2104		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2105		vec3( -0.07367, -0.00605,  1.07602 )
2106	);
2107	color *= toneMappingExposure / 0.6;
2108	color = ACESInputMat * color;
2109	color = RRTAndODTFit( color );
2110	color = ACESOutputMat * color;
2111	return saturate( color );
2112}
2113const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2114	vec3( 1.6605, - 0.1246, - 0.0182 ),
2115	vec3( - 0.5876, 1.1329, - 0.1006 ),
2116	vec3( - 0.0728, - 0.0083, 1.1187 )
2117);
2118const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2119	vec3( 0.6274, 0.0691, 0.0164 ),
2120	vec3( 0.3293, 0.9195, 0.0880 ),
2121	vec3( 0.0433, 0.0113, 0.8956 )
2122);
2123vec3 agxDefaultContrastApprox( vec3 x ) {
2124	vec3 x2 = x * x;
2125	vec3 x4 = x2 * x2;
2126	return + 15.5 * x4 * x2
2127		- 40.14 * x4 * x
2128		+ 31.96 * x4
2129		- 6.868 * x2 * x
2130		+ 0.4298 * x2
2131		+ 0.1191 * x
2132		- 0.00232;
2133}
2134vec3 AgXToneMapping( vec3 color ) {
2135	const mat3 AgXInsetMatrix = mat3(
2136		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2137		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2138		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2139	);
2140	const mat3 AgXOutsetMatrix = mat3(
2141		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2142		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2143		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2144	);
2145	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2146	color *= toneMappingExposure;
2147	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2148	color = AgXInsetMatrix * color;
2149	color = max( color, 1e-10 );	color = log2( color );
2150	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2151	color = clamp( color, 0.0, 1.0 );
2152	color = agxDefaultContrastApprox( color );
2153	color = AgXOutsetMatrix * color;
2154	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2155	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2156	color = clamp( color, 0.0, 1.0 );
2157	return color;
2158}
2159vec3 NeutralToneMapping( vec3 color ) {
2160	const float StartCompression = 0.8 - 0.04;
2161	const float Desaturation = 0.15;
2162	color *= toneMappingExposure;
2163	float x = min( color.r, min( color.g, color.b ) );
2164	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2165	color -= offset;
2166	float peak = max( color.r, max( color.g, color.b ) );
2167	if ( peak < StartCompression ) return color;
2168	float d = 1. - StartCompression;
2169	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2170	color *= newPeak / peak;
2171	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2172	return mix( color, vec3( newPeak ), g );
2173}
2174vec3 CustomToneMapping( vec3 color ) { return color; }`,RV=`#ifdef USE_TRANSMISSION
2175	material.transmission = transmission;
2176	material.transmissionAlpha = 1.0;
2177	material.thickness = thickness;
2178	material.attenuationDistance = attenuationDistance;
2179	material.attenuationColor = attenuationColor;
2180	#ifdef USE_TRANSMISSIONMAP
2181		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2182	#endif
2183	#ifdef USE_THICKNESSMAP
2184		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2185	#endif
2186	vec3 pos = vWorldPosition;
2187	vec3 v = normalize( cameraPosition - pos );
2188	vec3 n = inverseTransformDirection( normal, viewMatrix );
2189	vec4 transmitted = getIBLVolumeRefraction(
2190		n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90,
2191		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2192		material.attenuationColor, material.attenuationDistance );
2193	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2194	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2195#endif`,DV=`#ifdef USE_TRANSMISSION
2196	uniform float transmission;
2197	uniform float thickness;
2198	uniform float attenuationDistance;
2199	uniform vec3 attenuationColor;
2200	#ifdef USE_TRANSMISSIONMAP
2201		uniform sampler2D transmissionMap;
2202	#endif
2203	#ifdef USE_THICKNESSMAP
2204		uniform sampler2D thicknessMap;
2205	#endif
2206	uniform vec2 transmissionSamplerSize;
2207	uniform sampler2D transmissionSamplerMap;
2208	uniform mat4 modelMatrix;
2209	uniform mat4 projectionMatrix;
2210	varying vec3 vWorldPosition;
2211	float w0( float a ) {
2212		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2213	}
2214	float w1( float a ) {
2215		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2216	}
2217	float w2( float a ){
2218		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2219	}
2220	float w3( float a ) {
2221		return ( 1.0 / 6.0 ) * ( a * a * a );
2222	}
2223	float g0( float a ) {
2224		return w0( a ) + w1( a );
2225	}
2226	float g1( float a ) {
2227		return w2( a ) + w3( a );
2228	}
2229	float h0( float a ) {
2230		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2231	}
2232	float h1( float a ) {
2233		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2234	}
2235	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2236		uv = uv * texelSize.zw + 0.5;
2237		vec2 iuv = floor( uv );
2238		vec2 fuv = fract( uv );
2239		float g0x = g0( fuv.x );
2240		float g1x = g1( fuv.x );
2241		float h0x = h0( fuv.x );
2242		float h1x = h1( fuv.x );
2243		float h0y = h0( fuv.y );
2244		float h1y = h1( fuv.y );
2245		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2246		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2247		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2248		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2249		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2250			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2251	}
2252	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2253		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2254		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2255		vec2 fLodSizeInv = 1.0 / fLodSize;
2256		vec2 cLodSizeInv = 1.0 / cLodSize;
2257		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2258		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2259		return mix( fSample, cSample, fract( lod ) );
2260	}
2261	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2262		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2263		vec3 modelScale;
2264		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2265		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2266		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2267		return normalize( refractionVector ) * thickness * modelScale;
2268	}
2269	float applyIorToRoughness( const in float roughness, const in float ior ) {
2270		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2271	}
2272	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2273		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2274		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2275	}
2276	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2277		if ( isinf( attenuationDistance ) ) {
2278			return vec3( 1.0 );
2279		} else {
2280			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2281			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2282		}
2283	}
2284	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2285		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2286		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2287		const in vec3 attenuationColor, const in float attenuationDistance ) {
2288		vec4 transmittedLight;
2289		vec3 transmittance;
2290		#ifdef USE_DISPERSION
2291			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2292			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2293			for ( int i = 0; i < 3; i ++ ) {
2294				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2295				vec3 refractedRayExit = position + transmissionRay;
2296				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2297				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2298				refractionCoords += 1.0;
2299				refractionCoords /= 2.0;
2300				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2301				transmittedLight[ i ] = transmissionSample[ i ];
2302				transmittedLight.a += transmissionSample.a;
2303				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2304			}
2305			transmittedLight.a /= 3.0;
2306		#else
2307			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2308			vec3 refractedRayExit = position + transmissionRay;
2309			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2310			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2311			refractionCoords += 1.0;
2312			refractionCoords /= 2.0;
2313			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2314			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2315		#endif
2316		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2317		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2318		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2319		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2320	}
2321#endif`,UV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2322	varying vec2 vUv;
2323#endif
2324#ifdef USE_MAP
2325	varying vec2 vMapUv;
2326#endif
2327#ifdef USE_ALPHAMAP
2328	varying vec2 vAlphaMapUv;
2329#endif
2330#ifdef USE_LIGHTMAP
2331	varying vec2 vLightMapUv;
2332#endif
2333#ifdef USE_AOMAP
2334	varying vec2 vAoMapUv;
2335#endif
2336#ifdef USE_BUMPMAP
2337	varying vec2 vBumpMapUv;
2338#endif
2339#ifdef USE_NORMALMAP
2340	varying vec2 vNormalMapUv;
2341#endif
2342#ifdef USE_EMISSIVEMAP
2343	varying vec2 vEmissiveMapUv;
2344#endif
2345#ifdef USE_METALNESSMAP
2346	varying vec2 vMetalnessMapUv;
2347#endif
2348#ifdef USE_ROUGHNESSMAP
2349	varying vec2 vRoughnessMapUv;
2350#endif
2351#ifdef USE_ANISOTROPYMAP
2352	varying vec2 vAnisotropyMapUv;
2353#endif
2354#ifdef USE_CLEARCOATMAP
2355	varying vec2 vClearcoatMapUv;
2356#endif
2357#ifdef USE_CLEARCOAT_NORMALMAP
2358	varying vec2 vClearcoatNormalMapUv;
2359#endif
2360#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2361	varying vec2 vClearcoatRoughnessMapUv;
2362#endif
2363#ifdef USE_IRIDESCENCEMAP
2364	varying vec2 vIridescenceMapUv;
2365#endif
2366#ifdef USE_IRIDESCENCE_THICKNESSMAP
2367	varying vec2 vIridescenceThicknessMapUv;
2368#endif
2369#ifdef USE_SHEEN_COLORMAP
2370	varying vec2 vSheenColorMapUv;
2371#endif
2372#ifdef USE_SHEEN_ROUGHNESSMAP
2373	varying vec2 vSheenRoughnessMapUv;
2374#endif
2375#ifdef USE_SPECULARMAP
2376	varying vec2 vSpecularMapUv;
2377#endif
2378#ifdef USE_SPECULAR_COLORMAP
2379	varying vec2 vSpecularColorMapUv;
2380#endif
2381#ifdef USE_SPECULAR_INTENSITYMAP
2382	varying vec2 vSpecularIntensityMapUv;
2383#endif
2384#ifdef USE_TRANSMISSIONMAP
2385	uniform mat3 transmissionMapTransform;
2386	varying vec2 vTransmissionMapUv;
2387#endif
2388#ifdef USE_THICKNESSMAP
2389	uniform mat3 thicknessMapTransform;
2390	varying vec2 vThicknessMapUv;
2391#endif`,OV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2392	varying vec2 vUv;
2393#endif
2394#ifdef USE_MAP
2395	uniform mat3 mapTransform;
2396	varying vec2 vMapUv;
2397#endif
2398#ifdef USE_ALPHAMAP
2399	uniform mat3 alphaMapTransform;
2400	varying vec2 vAlphaMapUv;
2401#endif
2402#ifdef USE_LIGHTMAP
2403	uniform mat3 lightMapTransform;
2404	varying vec2 vLightMapUv;
2405#endif
2406#ifdef USE_AOMAP
2407	uniform mat3 aoMapTransform;
2408	varying vec2 vAoMapUv;
2409#endif
2410#ifdef USE_BUMPMAP
2411	uniform mat3 bumpMapTransform;
2412	varying vec2 vBumpMapUv;
2413#endif
2414#ifdef USE_NORMALMAP
2415	uniform mat3 normalMapTransform;
2416	varying vec2 vNormalMapUv;
2417#endif
2418#ifdef USE_DISPLACEMENTMAP
2419	uniform mat3 displacementMapTransform;
2420	varying vec2 vDisplacementMapUv;
2421#endif
2422#ifdef USE_EMISSIVEMAP
2423	uniform mat3 emissiveMapTransform;
2424	varying vec2 vEmissiveMapUv;
2425#endif
2426#ifdef USE_METALNESSMAP
2427	uniform mat3 metalnessMapTransform;
2428	varying vec2 vMetalnessMapUv;
2429#endif
2430#ifdef USE_ROUGHNESSMAP
2431	uniform mat3 roughnessMapTransform;
2432	varying vec2 vRoughnessMapUv;
2433#endif
2434#ifdef USE_ANISOTROPYMAP
2435	uniform mat3 anisotropyMapTransform;
2436	varying vec2 vAnisotropyMapUv;
2437#endif
2438#ifdef USE_CLEARCOATMAP
2439	uniform mat3 clearcoatMapTransform;
2440	varying vec2 vClearcoatMapUv;
2441#endif
2442#ifdef USE_CLEARCOAT_NORMALMAP
2443	uniform mat3 clearcoatNormalMapTransform;
2444	varying vec2 vClearcoatNormalMapUv;
2445#endif
2446#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2447	uniform mat3 clearcoatRoughnessMapTransform;
2448	varying vec2 vClearcoatRoughnessMapUv;
2449#endif
2450#ifdef USE_SHEEN_COLORMAP
2451	uniform mat3 sheenColorMapTransform;
2452	varying vec2 vSheenColorMapUv;
2453#endif
2454#ifdef USE_SHEEN_ROUGHNESSMAP
2455	uniform mat3 sheenRoughnessMapTransform;
2456	varying vec2 vSheenRoughnessMapUv;
2457#endif
2458#ifdef USE_IRIDESCENCEMAP
2459	uniform mat3 iridescenceMapTransform;
2460	varying vec2 vIridescenceMapUv;
2461#endif
2462#ifdef USE_IRIDESCENCE_THICKNESSMAP
2463	uniform mat3 iridescenceThicknessMapTransform;
2464	varying vec2 vIridescenceThicknessMapUv;
2465#endif
2466#ifdef USE_SPECULARMAP
2467	uniform mat3 specularMapTransform;
2468	varying vec2 vSpecularMapUv;
2469#endif
2470#ifdef USE_SPECULAR_COLORMAP
2471	uniform mat3 specularColorMapTransform;
2472	varying vec2 vSpecularColorMapUv;
2473#endif
2474#ifdef USE_SPECULAR_INTENSITYMAP
2475	uniform mat3 specularIntensityMapTransform;
2476	varying vec2 vSpecularIntensityMapUv;
2477#endif
2478#ifdef USE_TRANSMISSIONMAP
2479	uniform mat3 transmissionMapTransform;
2480	varying vec2 vTransmissionMapUv;
2481#endif
2482#ifdef USE_THICKNESSMAP
2483	uniform mat3 thicknessMapTransform;
2484	varying vec2 vThicknessMapUv;
2485#endif`,LV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2486	vUv = vec3( uv, 1 ).xy;
2487#endif
2488#ifdef USE_MAP
2489	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2490#endif
2491#ifdef USE_ALPHAMAP
2492	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2493#endif
2494#ifdef USE_LIGHTMAP
2495	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2496#endif
2497#ifdef USE_AOMAP
2498	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2499#endif
2500#ifdef USE_BUMPMAP
2501	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2502#endif
2503#ifdef USE_NORMALMAP
2504	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2505#endif
2506#ifdef USE_DISPLACEMENTMAP
2507	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2508#endif
2509#ifdef USE_EMISSIVEMAP
2510	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2511#endif
2512#ifdef USE_METALNESSMAP
2513	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2514#endif
2515#ifdef USE_ROUGHNESSMAP
2516	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2517#endif
2518#ifdef USE_ANISOTROPYMAP
2519	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2520#endif
2521#ifdef USE_CLEARCOATMAP
2522	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2523#endif
2524#ifdef USE_CLEARCOAT_NORMALMAP
2525	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2526#endif
2527#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2528	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2529#endif
2530#ifdef USE_IRIDESCENCEMAP
2531	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2532#endif
2533#ifdef USE_IRIDESCENCE_THICKNESSMAP
2534	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2535#endif
2536#ifdef USE_SHEEN_COLORMAP
2537	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2538#endif
2539#ifdef USE_SHEEN_ROUGHNESSMAP
2540	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2541#endif
2542#ifdef USE_SPECULARMAP
2543	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2544#endif
2545#ifdef USE_SPECULAR_COLORMAP
2546	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2547#endif
2548#ifdef USE_SPECULAR_INTENSITYMAP
2549	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2550#endif
2551#ifdef USE_TRANSMISSIONMAP
2552	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2553#endif
2554#ifdef USE_THICKNESSMAP
2555	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2556#endif`,NV=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2557	vec4 worldPosition = vec4( transformed, 1.0 );
2558	#ifdef USE_BATCHING
2559		worldPosition = batchingMatrix * worldPosition;
2560	#endif
2561	#ifdef USE_INSTANCING
2562		worldPosition = instanceMatrix * worldPosition;
2563	#endif
2564	worldPosition = modelMatrix * worldPosition;
2565#endif`,PV=`varying vec2 vUv;
2566uniform mat3 uvTransform;
2567void main() {
2568	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2569	gl_Position = vec4( position.xy, 1.0, 1.0 );
2570}`,IV=`uniform sampler2D t2D;
2571uniform float backgroundIntensity;
2572varying vec2 vUv;
2573void main() {
2574	vec4 texColor = texture2D( t2D, vUv );
2575	#ifdef DECODE_VIDEO_TEXTURE
2576		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
2577	#endif
2578	texColor.rgb *= backgroundIntensity;
2579	gl_FragColor = texColor;
2580	#include <tonemapping_fragment>
2581	#include <colorspace_fragment>
2582}`,zV=`varying vec3 vWorldDirection;
2583#include <common>
2584void main() {
2585	vWorldDirection = transformDirection( position, modelMatrix );
2586	#include <begin_vertex>
2587	#include <project_vertex>
2588	gl_Position.z = gl_Position.w;
2589}`,kV=`#ifdef ENVMAP_TYPE_CUBE
2590	uniform samplerCube envMap;
2591#elif defined( ENVMAP_TYPE_CUBE_UV )
2592	uniform sampler2D envMap;
2593#endif
2594uniform float flipEnvMap;
2595uniform float backgroundBlurriness;
2596uniform float backgroundIntensity;
2597uniform mat3 backgroundRotation;
2598varying vec3 vWorldDirection;
2599#include <cube_uv_reflection_fragment>
2600void main() {
2601	#ifdef ENVMAP_TYPE_CUBE
2602		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
2603	#elif defined( ENVMAP_TYPE_CUBE_UV )
2604		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2605	#else
2606		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2607	#endif
2608	texColor.rgb *= backgroundIntensity;
2609	gl_FragColor = texColor;
2610	#include <tonemapping_fragment>
2611	#include <colorspace_fragment>
2612}`,FV=`varying vec3 vWorldDirection;
2613#include <common>
2614void main() {
2615	vWorldDirection = transformDirection( position, modelMatrix );
2616	#include <begin_vertex>
2617	#include <project_vertex>
2618	gl_Position.z = gl_Position.w;
2619}`,BV=`uniform samplerCube tCube;
2620uniform float tFlip;
2621uniform float opacity;
2622varying vec3 vWorldDirection;
2623void main() {
2624	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2625	gl_FragColor = texColor;
2626	gl_FragColor.a *= opacity;
2627	#include <tonemapping_fragment>
2628	#include <colorspace_fragment>
2629}`,HV=`#include <common>
2630#include <batching_pars_vertex>
2631#include <uv_pars_vertex>
2632#include <displacementmap_pars_vertex>
2633#include <morphtarget_pars_vertex>
2634#include <skinning_pars_vertex>
2635#include <logdepthbuf_pars_vertex>
2636#include <clipping_planes_pars_vertex>
2637varying vec2 vHighPrecisionZW;
2638void main() {
2639	#include <uv_vertex>
2640	#include <batching_vertex>
2641	#include <skinbase_vertex>
2642	#include <morphinstance_vertex>
2643	#ifdef USE_DISPLACEMENTMAP
2644		#include <beginnormal_vertex>
2645		#include <morphnormal_vertex>
2646		#include <skinnormal_vertex>
2647	#endif
2648	#include <begin_vertex>
2649	#include <morphtarget_vertex>
2650	#include <skinning_vertex>
2651	#include <displacementmap_vertex>
2652	#include <project_vertex>
2653	#include <logdepthbuf_vertex>
2654	#include <clipping_planes_vertex>
2655	vHighPrecisionZW = gl_Position.zw;
2656}`,VV=`#if DEPTH_PACKING == 3200
2657	uniform float opacity;
2658#endif
2659#include <common>
2660#include <packing>
2661#include <uv_pars_fragment>
2662#include <map_pars_fragment>
2663#include <alphamap_pars_fragment>
2664#include <alphatest_pars_fragment>
2665#include <alphahash_pars_fragment>
2666#include <logdepthbuf_pars_fragment>
2667#include <clipping_planes_pars_fragment>
2668varying vec2 vHighPrecisionZW;
2669void main() {
2670	vec4 diffuseColor = vec4( 1.0 );
2671	#include <clipping_planes_fragment>
2672	#if DEPTH_PACKING == 3200
2673		diffuseColor.a = opacity;
2674	#endif
2675	#include <map_fragment>
2676	#include <alphamap_fragment>
2677	#include <alphatest_fragment>
2678	#include <alphahash_fragment>
2679	#include <logdepthbuf_fragment>
2680	#ifdef USE_REVERSED_DEPTH_BUFFER
2681		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
2682	#else
2683		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
2684	#endif
2685	#if DEPTH_PACKING == 3200
2686		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2687	#elif DEPTH_PACKING == 3201
2688		gl_FragColor = packDepthToRGBA( fragCoordZ );
2689	#elif DEPTH_PACKING == 3202
2690		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
2691	#elif DEPTH_PACKING == 3203
2692		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2693	#endif
2694}`,GV=`#define DISTANCE
2695varying vec3 vWorldPosition;
2696#include <common>
2697#include <batching_pars_vertex>
2698#include <uv_pars_vertex>
2699#include <displacementmap_pars_vertex>
2700#include <morphtarget_pars_vertex>
2701#include <skinning_pars_vertex>
2702#include <clipping_planes_pars_vertex>
2703void main() {
2704	#include <uv_vertex>
2705	#include <batching_vertex>
2706	#include <skinbase_vertex>
2707	#include <morphinstance_vertex>
2708	#ifdef USE_DISPLACEMENTMAP
2709		#include <beginnormal_vertex>
2710		#include <morphnormal_vertex>
2711		#include <skinnormal_vertex>
2712	#endif
2713	#include <begin_vertex>
2714	#include <morphtarget_vertex>
2715	#include <skinning_vertex>
2716	#include <displacementmap_vertex>
2717	#include <project_vertex>
2718	#include <worldpos_vertex>
2719	#include <clipping_planes_vertex>
2720	vWorldPosition = worldPosition.xyz;
2721}`,WV=`#define DISTANCE
2722uniform vec3 referencePosition;
2723uniform float nearDistance;
2724uniform float farDistance;
2725varying vec3 vWorldPosition;
2726#include <common>
2727#include <uv_pars_fragment>
2728#include <map_pars_fragment>
2729#include <alphamap_pars_fragment>
2730#include <alphatest_pars_fragment>
2731#include <alphahash_pars_fragment>
2732#include <clipping_planes_pars_fragment>
2733void main () {
2734	vec4 diffuseColor = vec4( 1.0 );
2735	#include <clipping_planes_fragment>
2736	#include <map_fragment>
2737	#include <alphamap_fragment>
2738	#include <alphatest_fragment>
2739	#include <alphahash_fragment>
2740	float dist = length( vWorldPosition - referencePosition );
2741	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2742	dist = saturate( dist );
2743	gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
2744}`,XV=`varying vec3 vWorldDirection;
2745#include <common>
2746void main() {
2747	vWorldDirection = transformDirection( position, modelMatrix );
2748	#include <begin_vertex>
2749	#include <project_vertex>
2750}`,qV=`uniform sampler2D tEquirect;
2751varying vec3 vWorldDirection;
2752#include <common>
2753void main() {
2754	vec3 direction = normalize( vWorldDirection );
2755	vec2 sampleUV = equirectUv( direction );
2756	gl_FragColor = texture2D( tEquirect, sampleUV );
2757	#include <tonemapping_fragment>
2758	#include <colorspace_fragment>
2759}`,YV=`uniform float scale;
2760attribute float lineDistance;
2761varying float vLineDistance;
2762#include <common>
2763#include <uv_pars_vertex>
2764#include <color_pars_vertex>
2765#include <fog_pars_vertex>
2766#include <morphtarget_pars_vertex>
2767#include <logdepthbuf_pars_vertex>
2768#include <clipping_planes_pars_vertex>
2769void main() {
2770	vLineDistance = scale * lineDistance;
2771	#include <uv_vertex>
2772	#include <color_vertex>
2773	#include <morphinstance_vertex>
2774	#include <morphcolor_vertex>
2775	#include <begin_vertex>
2776	#include <morphtarget_vertex>
2777	#include <project_vertex>
2778	#include <logdepthbuf_vertex>
2779	#include <clipping_planes_vertex>
2780	#include <fog_vertex>
2781}`,jV=`uniform vec3 diffuse;
2782uniform float opacity;
2783uniform float dashSize;
2784uniform float totalSize;
2785varying float vLineDistance;
2786#include <common>
2787#include <color_pars_fragment>
2788#include <uv_pars_fragment>
2789#include <map_pars_fragment>
2790#include <fog_pars_fragment>
2791#include <logdepthbuf_pars_fragment>
2792#include <clipping_planes_pars_fragment>
2793void main() {
2794	vec4 diffuseColor = vec4( diffuse, opacity );
2795	#include <clipping_planes_fragment>
2796	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2797		discard;
2798	}
2799	vec3 outgoingLight = vec3( 0.0 );
2800	#include <logdepthbuf_fragment>
2801	#include <map_fragment>
2802	#include <color_fragment>
2803	outgoingLight = diffuseColor.rgb;
2804	#include <opaque_fragment>
2805	#include <tonemapping_fragment>
2806	#include <colorspace_fragment>
2807	#include <fog_fragment>
2808	#include <premultiplied_alpha_fragment>
2809}`,ZV=`#include <common>
2810#include <batching_pars_vertex>
2811#include <uv_pars_vertex>
2812#include <envmap_pars_vertex>
2813#include <color_pars_vertex>
2814#include <fog_pars_vertex>
2815#include <morphtarget_pars_vertex>
2816#include <skinning_pars_vertex>
2817#include <logdepthbuf_pars_vertex>
2818#include <clipping_planes_pars_vertex>
2819void main() {
2820	#include <uv_vertex>
2821	#include <color_vertex>
2822	#include <morphinstance_vertex>
2823	#include <morphcolor_vertex>
2824	#include <batching_vertex>
2825	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2826		#include <beginnormal_vertex>
2827		#include <morphnormal_vertex>
2828		#include <skinbase_vertex>
2829		#include <skinnormal_vertex>
2830		#include <defaultnormal_vertex>
2831	#endif
2832	#include <begin_vertex>
2833	#include <morphtarget_vertex>
2834	#include <skinning_vertex>
2835	#include <project_vertex>
2836	#include <logdepthbuf_vertex>
2837	#include <clipping_planes_vertex>
2838	#include <worldpos_vertex>
2839	#include <envmap_vertex>
2840	#include <fog_vertex>
2841}`,KV=`uniform vec3 diffuse;
2842uniform float opacity;
2843#ifndef FLAT_SHADED
2844	varying vec3 vNormal;
2845#endif
2846#include <common>
2847#include <dithering_pars_fragment>
2848#include <color_pars_fragment>
2849#include <uv_pars_fragment>
2850#include <map_pars_fragment>
2851#include <alphamap_pars_fragment>
2852#include <alphatest_pars_fragment>
2853#include <alphahash_pars_fragment>
2854#include <aomap_pars_fragment>
2855#include <lightmap_pars_fragment>
2856#include <envmap_common_pars_fragment>
2857#include <envmap_pars_fragment>
2858#include <fog_pars_fragment>
2859#include <specularmap_pars_fragment>
2860#include <logdepthbuf_pars_fragment>
2861#include <clipping_planes_pars_fragment>
2862void main() {
2863	vec4 diffuseColor = vec4( diffuse, opacity );
2864	#include <clipping_planes_fragment>
2865	#include <logdepthbuf_fragment>
2866	#include <map_fragment>
2867	#include <color_fragment>
2868	#include <alphamap_fragment>
2869	#include <alphatest_fragment>
2870	#include <alphahash_fragment>
2871	#include <specularmap_fragment>
2872	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2873	#ifdef USE_LIGHTMAP
2874		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2875		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2876	#else
2877		reflectedLight.indirectDiffuse += vec3( 1.0 );
2878	#endif
2879	#include <aomap_fragment>
2880	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2881	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2882	#include <envmap_fragment>
2883	#include <opaque_fragment>
2884	#include <tonemapping_fragment>
2885	#include <colorspace_fragment>
2886	#include <fog_fragment>
2887	#include <premultiplied_alpha_fragment>
2888	#include <dithering_fragment>
2889}`,QV=`#define LAMBERT
2890varying vec3 vViewPosition;
2891#include <common>
2892#include <batching_pars_vertex>
2893#include <uv_pars_vertex>
2894#include <displacementmap_pars_vertex>
2895#include <envmap_pars_vertex>
2896#include <color_pars_vertex>
2897#include <fog_pars_vertex>
2898#include <normal_pars_vertex>
2899#include <morphtarget_pars_vertex>
2900#include <skinning_pars_vertex>
2901#include <shadowmap_pars_vertex>
2902#include <logdepthbuf_pars_vertex>
2903#include <clipping_planes_pars_vertex>
2904void main() {
2905	#include <uv_vertex>
2906	#include <color_vertex>
2907	#include <morphinstance_vertex>
2908	#include <morphcolor_vertex>
2909	#include <batching_vertex>
2910	#include <beginnormal_vertex>
2911	#include <morphnormal_vertex>
2912	#include <skinbase_vertex>
2913	#include <skinnormal_vertex>
2914	#include <defaultnormal_vertex>
2915	#include <normal_vertex>
2916	#include <begin_vertex>
2917	#include <morphtarget_vertex>
2918	#include <skinning_vertex>
2919	#include <displacementmap_vertex>
2920	#include <project_vertex>
2921	#include <logdepthbuf_vertex>
2922	#include <clipping_planes_vertex>
2923	vViewPosition = - mvPosition.xyz;
2924	#include <worldpos_vertex>
2925	#include <envmap_vertex>
2926	#include <shadowmap_vertex>
2927	#include <fog_vertex>
2928}`,JV=`#define LAMBERT
2929uniform vec3 diffuse;
2930uniform vec3 emissive;
2931uniform float opacity;
2932#include <common>
2933#include <dithering_pars_fragment>
2934#include <color_pars_fragment>
2935#include <uv_pars_fragment>
2936#include <map_pars_fragment>
2937#include <alphamap_pars_fragment>
2938#include <alphatest_pars_fragment>
2939#include <alphahash_pars_fragment>
2940#include <aomap_pars_fragment>
2941#include <lightmap_pars_fragment>
2942#include <emissivemap_pars_fragment>
2943#include <cube_uv_reflection_fragment>
2944#include <envmap_common_pars_fragment>
2945#include <envmap_pars_fragment>
2946#include <envmap_physical_pars_fragment>
2947#include <fog_pars_fragment>
2948#include <bsdfs>
2949#include <lights_pars_begin>
2950#include <normal_pars_fragment>
2951#include <lights_lambert_pars_fragment>
2952#include <shadowmap_pars_fragment>
2953#include <bumpmap_pars_fragment>
2954#include <normalmap_pars_fragment>
2955#include <specularmap_pars_fragment>
2956#include <logdepthbuf_pars_fragment>
2957#include <clipping_planes_pars_fragment>
2958void main() {
2959	vec4 diffuseColor = vec4( diffuse, opacity );
2960	#include <clipping_planes_fragment>
2961	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2962	vec3 totalEmissiveRadiance = emissive;
2963	#include <logdepthbuf_fragment>
2964	#include <map_fragment>
2965	#include <color_fragment>
2966	#include <alphamap_fragment>
2967	#include <alphatest_fragment>
2968	#include <alphahash_fragment>
2969	#include <specularmap_fragment>
2970	#include <normal_fragment_begin>
2971	#include <normal_fragment_maps>
2972	#include <emissivemap_fragment>
2973	#include <lights_lambert_fragment>
2974	#include <lights_fragment_begin>
2975	#include <lights_fragment_maps>
2976	#include <lights_fragment_end>
2977	#include <aomap_fragment>
2978	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
2979	#include <envmap_fragment>
2980	#include <opaque_fragment>
2981	#include <tonemapping_fragment>
2982	#include <colorspace_fragment>
2983	#include <fog_fragment>
2984	#include <premultiplied_alpha_fragment>
2985	#include <dithering_fragment>
2986}`,$V=`#define MATCAP
2987varying vec3 vViewPosition;
2988#include <common>
2989#include <batching_pars_vertex>
2990#include <uv_pars_vertex>
2991#include <color_pars_vertex>
2992#include <displacementmap_pars_vertex>
2993#include <fog_pars_vertex>
2994#include <normal_pars_vertex>
2995#include <morphtarget_pars_vertex>
2996#include <skinning_pars_vertex>
2997#include <logdepthbuf_pars_vertex>
2998#include <clipping_planes_pars_vertex>
2999void main() {
3000	#include <uv_vertex>
3001	#include <color_vertex>
3002	#include <morphinstance_vertex>
3003	#include <morphcolor_vertex>
3004	#include <batching_vertex>
3005	#include <beginnormal_vertex>
3006	#include <morphnormal_vertex>
3007	#include <skinbase_vertex>
3008	#include <skinnormal_vertex>
3009	#include <defaultnormal_vertex>
3010	#include <normal_vertex>
3011	#include <begin_vertex>
3012	#include <morphtarget_vertex>
3013	#include <skinning_vertex>
3014	#include <displacementmap_vertex>
3015	#include <project_vertex>
3016	#include <logdepthbuf_vertex>
3017	#include <clipping_planes_vertex>
3018	#include <fog_vertex>
3019	vViewPosition = - mvPosition.xyz;
3020}`,eG=`#define MATCAP
3021uniform vec3 diffuse;
3022uniform float opacity;
3023uniform sampler2D matcap;
3024varying vec3 vViewPosition;
3025#include <common>
3026#include <dithering_pars_fragment>
3027#include <color_pars_fragment>
3028#include <uv_pars_fragment>
3029#include <map_pars_fragment>
3030#include <alphamap_pars_fragment>
3031#include <alphatest_pars_fragment>
3032#include <alphahash_pars_fragment>
3033#include <fog_pars_fragment>
3034#include <normal_pars_fragment>
3035#
3035include <bumpmap_pars_fragment>
3036#include <normalmap_pars_fragment>
3037#include <logdepthbuf_pars_fragment>
3038#include <clipping_planes_pars_fragment>
3039void main() {
3040	vec4 diffuseColor = vec4( diffuse, opacity );
3041	#include <clipping_planes_fragment>
3042	#include <logdepthbuf_fragment>
3043	#include <map_fragment>
3044	#include <color_fragment>
3045	#include <alphamap_fragment>
3046	#include <alphatest_fragment>
3047	#include <alphahash_fragment>
3048	#include <normal_fragment_begin>
3049	#include <normal_fragment_maps>
3050	vec3 viewDir = normalize( vViewPosition );
3051	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3052	vec3 y = cross( viewDir, x );
3053	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3054	#ifdef USE_MATCAP
3055		vec4 matcapColor = texture2D( matcap, uv );
3056	#else
3057		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3058	#endif
3059	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3060	#include <opaque_fragment>
3061	#include <tonemapping_fragment>
3062	#include <colorspace_fragment>
3063	#include <fog_fragment>
3064	#include <premultiplied_alpha_fragment>
3065	#include <dithering_fragment>
3066}`,tG=`#define NORMAL
3067#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3068	varying vec3 vViewPosition;
3069#endif
3070#include <common>
3071#include <batching_pars_vertex>
3072#include <uv_pars_vertex>
3073#include <displacementmap_pars_vertex>
3074#include <normal_pars_vertex>
3075#include <morphtarget_pars_vertex>
3076#include <skinning_pars_vertex>
3077#include <logdepthbuf_pars_vertex>
3078#include <clipping_planes_pars_vertex>
3079void main() {
3080	#include <uv_vertex>
3081	#include <batching_vertex>
3082	#include <beginnormal_vertex>
3083	#include <morphinstance_vertex>
3084	#include <morphnormal_vertex>
3085	#include <skinbase_vertex>
3086	#include <skinnormal_vertex>
3087	#include <defaultnormal_vertex>
3088	#include <normal_vertex>
3089	#include <begin_vertex>
3090	#include <morphtarget_vertex>
3091	#include <skinning_vertex>
3092	#include <displacementmap_vertex>
3093	#include <project_vertex>
3094	#include <logdepthbuf_vertex>
3095	#include <clipping_planes_vertex>
3096#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3097	vViewPosition = - mvPosition.xyz;
3098#endif
3099}`,nG=`#define NORMAL
3100uniform float opacity;
3101#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3102	varying vec3 vViewPosition;
3103#endif
3104#include <uv_pars_fragment>
3105#include <normal_pars_fragment>
3106#include <bumpmap_pars_fragment>
3107#include <normalmap_pars_fragment>
3108#include <logdepthbuf_pars_fragment>
3109#include <clipping_planes_pars_fragment>
3110void main() {
3111	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3112	#include <clipping_planes_fragment>
3113	#include <logdepthbuf_fragment>
3114	#include <normal_fragment_begin>
3115	#include <normal_fragment_maps>
3116	gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a );
3117	#ifdef OPAQUE
3118		gl_FragColor.a = 1.0;
3119	#endif
3120}`,iG=`#define PHONG
3121varying vec3 vViewPosition;
3122#include <common>
3123#include <batching_pars_vertex>
3124#include <uv_pars_vertex>
3125#include <displacementmap_pars_vertex>
3126#include <envmap_pars_vertex>
3127#include <color_pars_vertex>
3128#include <fog_pars_vertex>
3129#include <normal_pars_vertex>
3130#include <morphtarget_pars_vertex>
3131#include <skinning_pars_vertex>
3132#include <shadowmap_pars_vertex>
3133#include <logdepthbuf_pars_vertex>
3134#include <clipping_planes_pars_vertex>
3135void main() {
3136	#include <uv_vertex>
3137	#include <color_vertex>
3138	#include <morphcolor_vertex>
3139	#include <batching_vertex>
3140	#include <beginnormal_vertex>
3141	#include <morphinstance_vertex>
3142	#include <morphnormal_vertex>
3143	#include <skinbase_vertex>
3144	#include <skinnormal_vertex>
3145	#include <defaultnormal_vertex>
3146	#include <normal_vertex>
3147	#include <begin_vertex>
3148	#include <morphtarget_vertex>
3149	#include <skinning_vertex>
3150	#include <displacementmap_vertex>
3151	#include <project_vertex>
3152	#include <logdepthbuf_vertex>
3153	#include <clipping_planes_vertex>
3154	vViewPosition = - mvPosition.xyz;
3155	#include <worldpos_vertex>
3156	#include <envmap_vertex>
3157	#include <shadowmap_vertex>
3158	#include <fog_vertex>
3159}`,rG=`#define PHONG
3160uniform vec3 diffuse;
3161uniform vec3 emissive;
3162uniform vec3 specular;
3163uniform float shininess;
3164uniform float opacity;
3165#include <common>
3166#include <dithering_pars_fragment>
3167#include <color_pars_fragment>
3168#include <uv_pars_fragment>
3169#include <map_pars_fragment>
3170#include <alphamap_pars_fragment>
3171#include <alphatest_pars_fragment>
3172#include <alphahash_pars_fragment>
3173#include <aomap_pars_fragment>
3174#include <lightmap_pars_fragment>
3175#include <emissivemap_pars_fragment>
3176#include <cube_uv_reflection_fragment>
3177#include <envmap_common_pars_fragment>
3178#include <envmap_pars_fragment>
3179#include <envmap_physical_pars_fragment>
3180#include <fog_pars_fragment>
3181#include <bsdfs>
3182#include <lights_pars_begin>
3183#include <normal_pars_fragment>
3184#include <lights_phong_pars_fragment>
3185#include <shadowmap_pars_fragment>
3186#include <bumpmap_pars_fragment>
3187#include <normalmap_pars_fragment>
3188#include <specularmap_pars_fragment>
3189#include <logdepthbuf_pars_fragment>
3190#include <clipping_planes_pars_fragment>
3191void main() {
3192	vec4 diffuseColor = vec4( diffuse, opacity );
3193	#include <clipping_planes_fragment>
3194	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3195	vec3 totalEmissiveRadiance = emissive;
3196	#include <logdepthbuf_fragment>
3197	#include <map_fragment>
3198	#include <color_fragment>
3199	#include <alphamap_fragment>
3200	#include <alphatest_fragment>
3201	#include <alphahash_fragment>
3202	#include <specularmap_fragment>
3203	#include <normal_fragment_begin>
3204	#include <normal_fragment_maps>
3205	#include <emissivemap_fragment>
3206	#include <lights_phong_fragment>
3207	#include <lights_fragment_begin>
3208	#include <lights_fragment_maps>
3209	#include <lights_fragment_end>
3210	#include <aomap_fragment>
3211	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3212	#include <envmap_fragment>
3213	#include <opaque_fragment>
3214	#include <tonemapping_fragment>
3215	#include <colorspace_fragment>
3216	#include <fog_fragment>
3217	#include <premultiplied_alpha_fragment>
3218	#include <dithering_fragment>
3219}`,aG=`#define STANDARD
3220varying vec3 vViewPosition;
3221#ifdef USE_TRANSMISSION
3222	varying vec3 vWorldPosition;
3223#endif
3224#include <common>
3225#include <batching_pars_vertex>
3226#include <uv_pars_vertex>
3227#include <displacementmap_pars_vertex>
3228#include <color_pars_vertex>
3229#include <fog_pars_vertex>
3230#include <normal_pars_vertex>
3231#include <morphtarget_pars_vertex>
3232#include <skinning_pars_vertex>
3233#include <shadowmap_pars_vertex>
3234#include <logdepthbuf_pars_vertex>
3235#include <clipping_planes_pars_vertex>
3236void main() {
3237	#include <uv_vertex>
3238	#include <color_vertex>
3239	#include <morphinstance_vertex>
3240	#include <morphcolor_vertex>
3241	#include <batching_vertex>
3242	#include <beginnormal_vertex>
3243	#include <morphnormal_vertex>
3244	#include <skinbase_vertex>
3245	#include <skinnormal_vertex>
3246	#include <defaultnormal_vertex>
3247	#include <normal_vertex>
3248	#include <begin_vertex>
3249	#include <morphtarget_vertex>
3250	#include <skinning_vertex>
3251	#include <displacementmap_vertex>
3252	#include <project_vertex>
3253	#include <logdepthbuf_vertex>
3254	#include <clipping_planes_vertex>
3255	vViewPosition = - mvPosition.xyz;
3256	#include <worldpos_vertex>
3257	#include <shadowmap_vertex>
3258	#include <fog_vertex>
3259#ifdef USE_TRANSMISSION
3260	vWorldPosition = worldPosition.xyz;
3261#endif
3262}`,oG=`#define STANDARD
3263#ifdef PHYSICAL
3264	#define IOR
3265	#define USE_SPECULAR
3266#endif
3267uniform vec3 diffuse;
3268uniform vec3 emissive;
3269uniform float roughness;
3270uniform float metalness;
3271uniform float opacity;
3272#ifdef IOR
3273	uniform float ior;
3274#endif
3275#ifdef USE_SPECULAR
3276	uniform float specularIntensity;
3277	uniform vec3 specularColor;
3278	#ifdef USE_SPECULAR_COLORMAP
3279		uniform sampler2D specularColorMap;
3280	#endif
3281	#ifdef USE_SPECULAR_INTENSITYMAP
3282		uniform sampler2D specularIntensityMap;
3283	#endif
3284#endif
3285#ifdef USE_CLEARCOAT
3286	uniform float clearcoat;
3287	uniform float clearcoatRoughness;
3288#endif
3289#ifdef USE_DISPERSION
3290	uniform float dispersion;
3291#endif
3292#ifdef USE_IRIDESCENCE
3293	uniform float iridescence;
3294	uniform float iridescenceIOR;
3295	uniform float iridescenceThicknessMinimum;
3296	uniform float iridescenceThicknessMaximum;
3297#endif
3298#ifdef USE_SHEEN
3299	uniform vec3 sheenColor;
3300	uniform float sheenRoughness;
3301	#ifdef USE_SHEEN_COLORMAP
3302		uniform sampler2D sheenColorMap;
3303	#endif
3304	#ifdef USE_SHEEN_ROUGHNESSMAP
3305		uniform sampler2D sheenRoughnessMap;
3306	#endif
3307#endif
3308#ifdef USE_ANISOTROPY
3309	uniform vec2 anisotropyVector;
3310	#ifdef USE_ANISOTROPYMAP
3311		uniform sampler2D anisotropyMap;
3312	#endif
3313#endif
3314varying vec3 vViewPosition;
3315#include <common>
3316#include <dithering_pars_fragment>
3317#include <color_pars_fragment>
3318#include <uv_pars_fragment>
3319#include <map_pars_fragment>
3320#include <alphamap_pars_fragment>
3321#include <alphatest_pars_fragment>
3322#include <alphahash_pars_fragment>
3323#include <aomap_pars_fragment>
3324#include <lightmap_pars_fragment>
3325#include <emissivemap_pars_fragment>
3326#include <iridescence_fragment>
3327#include <cube_uv_reflection_fragment>
3328#include <envmap_common_pars_fragment>
3329#include <envmap_physical_pars_fragment>
3330#include <fog_pars_fragment>
3331#include <lights_pars_begin>
3332#include <normal_pars_fragment>
3333#include <lights_physical_pars_fragment>
3334#include <transmission_pars_fragment>
3335#include <shadowmap_pars_fragment>
3336#include <bumpmap_pars_fragment>
3337#include <normalmap_pars_fragment>
3338#include <clearcoat_pars_fragment>
3339#include <iridescence_pars_fragment>
3340#include <roughnessmap_pars_fragment>
3341#include <metalnessmap_pars_fragment>
3342#include <logdepthbuf_pars_fragment>
3343#include <clipping_planes_pars_fragment>
3344void main() {
3345	vec4 diffuseColor = vec4( diffuse, opacity );
3346	#include <clipping_planes_fragment>
3347	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3348	vec3 totalEmissiveRadiance = emissive;
3349	#include <logdepthbuf_fragment>
3350	#include <map_fragment>
3351	#include <color_fragment>
3352	#include <alphamap_fragment>
3353	#include <alphatest_fragment>
3354	#include <alphahash_fragment>
3355	#include <roughnessmap_fragment>
3356	#include <metalnessmap_fragment>
3357	#include <normal_fragment_begin>
3358	#include <normal_fragment_maps>
3359	#include <clearcoat_normal_fragment_begin>
3360	#include <clearcoat_normal_fragment_maps>
3361	#include <emissivemap_fragment>
3362	#include <lights_physical_fragment>
3363	#include <lights_fragment_begin>
3364	#include <lights_fragment_maps>
3365	#include <lights_fragment_end>
3366	#include <aomap_fragment>
3367	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3368	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3369	#include <transmission_fragment>
3370	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3371	#ifdef USE_SHEEN
3372 
3373		outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;
3374 
3375 	#endif
3376	#ifdef USE_CLEARCOAT
3377		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3378		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3379		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3380	#endif
3381	#include <opaque_fragment>
3382	#include <tonemapping_fragment>
3383	#include <colorspace_fragment>
3384	#include <fog_fragment>
3385	#include <premultiplied_alpha_fragment>
3386	#include <dithering_fragment>
3387}`,sG=`#define TOON
3388varying vec3 vViewPosition;
3389#include <common>
3390#include <batching_pars_vertex>
3391#include <uv_pars_vertex>
3392#include <displacementmap_pars_vertex>
3393#include <color_pars_vertex>
3394#include <fog_pars_vertex>
3395#include <normal_pars_vertex>
3396#include <morphtarget_pars_vertex>
3397#include <skinning_pars_vertex>
3398#include <shadowmap_pars_vertex>
3399#include <logdepthbuf_pars_vertex>
3400#include <clipping_planes_pars_vertex>
3401void main() {
3402	#include <uv_vertex>
3403	#include <color_vertex>
3404	#include <morphinstance_vertex>
3405	#include <morphcolor_vertex>
3406	#include <batching_vertex>
3407	#include <beginnormal_vertex>
3408	#include <morphnormal_vertex>
3409	#include <skinbase_vertex>
3410	#include <skinnormal_vertex>
3411	#include <defaultnormal_vertex>
3412	#include <normal_vertex>
3413	#include <begin_vertex>
3414	#include <morphtarget_vertex>
3415	#include <skinning_vertex>
3416	#include <displacementmap_vertex>
3417	#include <project_vertex>
3418	#include <logdepthbuf_vertex>
3419	#include <clipping_planes_vertex>
3420	vViewPosition = - mvPosition.xyz;
3421	#include <worldpos_vertex>
3422	#include <shadowmap_vertex>
3423	#include <fog_vertex>
3424}`,lG=`#define TOON
3425uniform vec3 diffuse;
3426uniform vec3 emissive;
3427uniform float opacity;
3428#include <common>
3429#include <dithering_pars_fragment>
3430#include <color_pars_fragment>
3431#include <uv_pars_fragment>
3432#include <map_pars_fragment>
3433#include <alphamap_pars_fragment>
3434#include <alphatest_pars_fragment>
3435#include <alphahash_pars_fragment>
3436#include <aomap_pars_fragment>
3437#include <lightmap_pars_fragment>
3438#include <emissivemap_pars_fragment>
3439#include <gradientmap_pars_fragment>
3440#include <fog_pars_fragment>
3441#include <bsdfs>
3442#include <lights_pars_begin>
3443#include <normal_pars_fragment>
3444#include <lights_toon_pars_fragment>
3445#include <shadowmap_pars_fragment>
3446#include <bumpmap_pars_fragment>
3447#include <normalmap_pars_fragment>
3448#include <logdepthbuf_pars_fragment>
3449#include <clipping_planes_pars_fragment>
3450void main() {
3451	vec4 diffuseColor = vec4( diffuse, opacity );
3452	#include <clipping_planes_fragment>
3453	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3454	vec3 totalEmissiveRadiance = emissive;
3455	#include <logdepthbuf_fragment>
3456	#include <map_fragment>
3457	#include <color_fragment>
3458	#include <alphamap_fragment>
3459	#include <alphatest_fragment>
3460	#include <alphahash_fragment>
3461	#include <normal_fragment_begin>
3462	#include <normal_fragment_maps>
3463	#include <emissivemap_fragment>
3464	#include <lights_toon_fragment>
3465	#include <lights_fragment_begin>
3466	#include <lights_fragment_maps>
3467	#include <lights_fragment_end>
3468	#include <aomap_fragment>
3469	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3470	#include <opaque_fragment>
3471	#include <tonemapping_fragment>
3472	#include <colorspace_fragment>
3473	#include <fog_fragment>
3474	#include <premultiplied_alpha_fragment>
3475	#include <dithering_fragment>
3476}`,uG=`uniform float size;
3477uniform float scale;
3478#include <common>
3479#include <color_pars_vertex>
3480#include <fog_pars_vertex>
3481#include <morphtarget_pars_vertex>
3482#include <logdepthbuf_pars_vertex>
3483#include <clipping_planes_pars_vertex>
3484#ifdef USE_POINTS_UV
3485	varying vec2 vUv;
3486	uniform mat3 uvTransform;
3487#endif
3488void main() {
3489	#ifdef USE_POINTS_UV
3490		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3491	#endif
3492	#include <color_vertex>
3493	#include <morphinstance_vertex>
3494	#include <morphcolor_vertex>
3495	#include <begin_vertex>
3496	#include <morphtarget_vertex>
3497	#include <project_vertex>
3498	gl_PointSize = size;
3499	#ifdef USE_SIZEATTENUATION
3500		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3501		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3502	#endif
3503	#include <logdepthbuf_vertex>
3504	#include <clipping_planes_vertex>
3505	#include <worldpos_vertex>
3506	#include <fog_vertex>
3507}`,cG=`uniform vec3 diffuse;
3508uniform float opacity;
3509#include <common>
3510#include <color_pars_fragment>
3511#include <map_particle_pars_fragment>
3512#include <alphatest_pars_fragment>
3513#include <alphahash_pars_fragment>
3514#include <fog_pars_fragment>
3515#include <logdepthbuf_pars_fragment>
3516#include <clipping_planes_pars_fragment>
3517void main() {
3518	vec4 diffuseColor = vec4( diffuse, opacity );
3519	#include <clipping_planes_fragment>
3520	vec3 outgoingLight = vec3( 0.0 );
3521	#include <logdepthbuf_fragment>
3522	#include <map_particle_fragment>
3523	#include <color_fragment>
3524	#include <alphatest_fragment>
3525	#include <alphahash_fragment>
3526	outgoingLight = diffuseColor.rgb;
3527	#include <opaque_fragment>
3528	#include <tonemapping_fragment>
3529	#include <colorspace_fragment>
3530	#include <fog_fragment>
3531	#include <premultiplied_alpha_fragment>
3532}`,fG=`#include <common>
3533#include <batching_pars_vertex>
3534#include <fog_pars_vertex>
3535#include <morphtarget_pars_vertex>
3536#include <skinning_pars_vertex>
3537#include <logdepthbuf_pars_vertex>
3538#include <shadowmap_pars_vertex>
3539void main() {
3540	#include <batching_vertex>
3541	#include <beginnormal_vertex>
3542	#include <morphinstance_vertex>
3543	#include <morphnormal_vertex>
3544	#include <skinbase_vertex>
3545	#include <skinnormal_vertex>
3546	#include <defaultnormal_vertex>
3547	#include <begin_vertex>
3548	#include <morphtarget_vertex>
3549	#include <skinning_vertex>
3550	#include <project_vertex>
3551	#include <logdepthbuf_vertex>
3552	#include <worldpos_vertex>
3553	#include <shadowmap_vertex>
3554	#include <fog_vertex>
3555}`,dG=`uniform vec3 color;
3556uniform float opacity;
3557#include <common>
3558#include <fog_pars_fragment>
3559#include <bsdfs>
3560#include <lights_pars_begin>
3561#include <logdepthbuf_pars_fragment>
3562#include <shadowmap_pars_fragment>
3563#include <shadowmask_pars_fragment>
3564void main() {
3565	#include <logdepthbuf_fragment>
3566	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3567	#include <tonemapping_fragment>
3568	#include <colorspace_fragment>
3569	#include <fog_fragment>
3570	#include <premultiplied_alpha_fragment>
3571}`,hG=`uniform float rotation;
3572uniform vec2 center;
3573#include <common>
3574#include <uv_pars_vertex>
3575#include <fog_pars_vertex>
3576#include <logdepthbuf_pars_vertex>
3577#include <clipping_planes_pars_vertex>
3578void main() {
3579	#include <uv_vertex>
3580	vec4 mvPosition = modelViewMatrix[ 3 ];
3581	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3582	#ifndef USE_SIZEATTENUATION
3583		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3584		if ( isPerspective ) scale *= - mvPosition.z;
3585	#endif
3586	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3587	vec2 rotatedPosition;
3588	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3589	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3590	mvPosition.xy += rotatedPosition;
3591	gl_Position = projectionMatrix * mvPosition;
3592	#include <logdepthbuf_vertex>
3593	#include <clipping_planes_vertex>
3594	#include <fog_vertex>
3595}`,pG=`uniform vec3 diffuse;
3596uniform float opacity;
3597#include <common>
3598#include <uv_pars_fragment>
3599#include <map_pars_fragment>
3600#include <alphamap_pars_fragment>
3601#include <alphatest_pars_fragment>
3602#include <alphahash_pars_fragment>
3603#include <fog_pars_fragment>
3604#include <logdepthbuf_pars_fragment>
3605#include <clipping_planes_pars_fragment>
3606void main() {
3607	vec4 diffuseColor = vec4( diffuse, opacity );
3608	#include <clipping_planes_fragment>
3609	vec3 outgoingLight = vec3( 0.0 );
3610	#include <logdepthbuf_fragment>
3611	#include <map_fragment>
3612	#include <alphamap_fragment>
3613	#include <alphatest_fragment>
3614	#include <alphahash_fragment>
3615	outgoingLight = diffuseColor.rgb;
3616	#include <opaque_fragment>
3617	#include <tonemapping_fragment>
3618	#include <colorspace_fragment>
3619	#include <fog_fragment>
3620}`,Rt={alphahash_fragment:I8,alphahash_pars_fragment:z8,alphamap_fragment:k8,alphamap_pars_fragment:F8,alphatest_fragment:B8,alphatest_pars_fragment:H8,aomap_fragment:V8,aomap_pars_fragment:G8,batching_pars_vertex:W8,batching_vertex:X8,begin_vertex:q8,beginnormal_vertex:Y8,bsdfs:j8,iridescence_fragment:Z8,bumpmap_pars_fragment:K8,clipping_planes_fragment:Q8,clipping_planes_pars_fragment:J8,clipping_planes_pars_vertex:$8,clipping_planes_vertex:eH,color_fragment:tH,color_pars_fragment:nH,color_pars_vertex:iH,color_vertex:rH,common:aH,cube_uv_reflection_fragment:oH,defaultnormal_vertex:sH,displacementmap_pars_vertex:lH,displacementmap_vertex:uH,emissivemap_fragment:cH,emissivemap_pars_fragment:fH,colorspace_fragment:dH,colorspace_pars_fragment:hH,envmap_fragment:pH,envmap_common_pars_fragment:mH,envmap_pars_fragment:gH,envmap_pars_vertex:vH,envmap_physical_pars_fragment:CH,envmap_vertex:yH,fog_vertex:_H,fog_pars_vertex:bH,fog_fragment:xH,fog_pars_fragment:SH,gradientmap_pars_fragment:TH,lightmap_pars_fragment:EH,lights_lambert_fragment:MH,lights_lambert_pars_fragment:wH,lights_pars_begin:AH,lights_toon_fragment:RH,lights_toon_pars_fragment:DH,lights_phong_fragment:UH,lights_phong_pars_fragment:OH,lights_physical_fragment:LH,lights_physical_pars_fragment:NH,lights_fragment_begin:PH,lights_fragment_maps:IH,lights_fragment_end:zH,logdepthbuf_fragment:kH,logdepthbuf_pars_fragment:FH,logdepthbuf_pars_vertex:BH,logdepthbuf_vertex:HH,map_fragment:VH,map_pars_fragment:GH,map_particle_fragment:WH,map_particle_pars_fragment:XH,metalnessmap_fragment:qH,metalnessmap_pars_fragment:YH,morphinstance_vertex:jH,morphcolor_vertex:ZH,morphnormal_vertex:KH,morphtarget_pars_vertex:QH,morphtarget_vertex:JH,normal_fragment_begin:$H,normal_fragment_maps:eV,normal_pars_fragment:tV,normal_pars_vertex:nV,normal_vertex:iV,normalmap_pars_fragment:rV,clearcoat_normal_fragment_begin:aV,clearcoat_normal_fragment_maps:oV,clearcoat_pars_fragment:sV,iridescence_pars_fragment:lV,opaque_fragment:uV,packing:cV,premultiplied_alpha_fragment:fV,project_vertex:dV,dithering_fragment:hV,dithering_pars_fragment:pV,roughnessmap_fragment:mV,roughnessmap_pars_fragment:gV,shadowmap_pars_fragment:vV,shadowmap_pars_vertex:yV,shadowmap_vertex:_V,shadowmask_pars_fragment:bV,skinbase_vertex:xV,skinning_pars_vertex:SV,skinning_vertex:TV,skinnormal_vertex:EV,specularmap_fragment:MV,specularmap_pars_fragment:wV,tonemapping_fragment:AV,tonemapping_pars_fragment:CV,transmission_fragment:RV,transmission_pars_fragment:DV,uv_pars_fragment:UV,uv_pars_vertex:OV,uv_vertex:LV,worldpos_vertex:NV,background_vert:PV,background_frag:IV,backgroundCube_vert:zV,backgroundCube_frag:kV,cube_vert:FV,cube_frag:BV,depth_vert:HV,depth_frag:VV,distance_vert:GV,distance_frag:WV,equirect_vert:XV,equirect_frag:qV,linedashed_vert:YV,linedashed_frag:jV,meshbasic_vert:ZV,meshbasic_frag:KV,meshlambert_vert:QV,meshlambert_frag:JV,meshmatcap_vert:$V,meshmatcap_frag:eG,meshnormal_vert:tG,meshnormal_frag:nG,meshphong_vert:iG,meshphong_frag:rG,meshphysical_vert:aG,meshphysical_frag:oG,meshtoon_vert:sG,meshtoon_frag:lG,points_vert:uG,points_frag:cG,shadow_vert:fG,shadow_frag:dG,sprite_vert:hG,sprite_frag:pG},lt={common:{diffuse:{value:new tt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Et},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Et}},envmap:{envMap:{value:null},envMapRotation:{value:new Et},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Et}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Et}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Et},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Et},normalScale:{value:new Le(1,1)}}
vendor: 4,783 bytes, line 3620
3620,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Et},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Et}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Et}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Et}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},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 tt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0},uvTransform:{value:new Et}},sprite:{diffuse:{value:new tt(16777215)},opacity:{value:1},center:{value:new Le(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Et},alphaMap:{value:null},alphaMapTransform:{value:new Et},alphaTest:{value:0}}},Za={basic:{uniforms:hr([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.fog]),vertexShader:Rt.meshbasic_vert,fragmentShader:Rt.meshbasic_frag},lambert:{uniforms:hr([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,lt.lights,{emissive:{value:new tt(0)},envMapIntensity:{value:1}}]),vertexShader:Rt.meshlambert_vert,fragmentShader:Rt.meshlambert_frag},phong:{uniforms:hr([lt.common,lt.specularmap,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,lt.lights,{emissive:{value:new tt(0)},specular:{value:new tt(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Rt.meshphong_vert,fragmentShader:Rt.meshphong_frag},standard:{uniforms:hr([lt.common,lt.envmap,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.roughnessmap,lt.metalnessmap,lt.fog,lt.lights,{emissive:{value:new tt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Rt.meshphysical_vert,fragmentShader:Rt.meshphysical_frag},toon:{uniforms:hr([lt.common,lt.aomap,lt.lightmap,lt.emissivemap,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.gradientmap,lt.fog,lt.lights,{emissive:{value:new tt(0)}}]),vertexShader:Rt.meshtoon_vert,fragmentShader:Rt.meshtoon_frag},matcap:{uniforms:hr([lt.common,lt.bumpmap,lt.normalmap,lt.displacementmap,lt.fog,{matcap:{value:null}}]),vertexShader:Rt.meshmatcap_vert,fragmentShader:Rt.meshmatcap_frag},points:{uniforms:hr([lt.points,lt.fog]),vertexShader:Rt.points_vert,fragmentShader:Rt.points_frag},dashed:{uniforms:hr([lt.common,lt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Rt.linedashed_vert,fragmentShader:Rt.linedashed_frag},depth:{uniforms:hr([lt.common,lt.displacementmap]),vertexShader:Rt.depth_vert,fragmentShader:Rt.depth_frag},normal:{uniforms:hr([lt.common,lt.bumpmap,lt.normalmap,lt.displacementmap,{opacity:{value:1}}]),vertexShader:Rt.meshnormal_vert,fragmentShader:Rt.meshnormal_frag},sprite:{uniforms:hr([lt.sprite,lt.fog]),vertexShader:Rt.sprite_vert,fragmentShader:Rt.sprite_frag},background:{uniforms:{uvTransform:{value:new Et},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Rt.background_vert,fragmentShader:Rt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Et}},vertexShader:Rt.backgroundCube_vert,fragmentShader:Rt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Rt.cube_vert,fragmentShader:Rt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Rt.equirect_vert,fragmentShader:Rt.equirect_frag}
vendor: 4,480 bytes, line 3620
3620,distance:{uniforms:hr([lt.common,lt.displacementmap,{referencePosition:{value:new H},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Rt.distance_vert,fragmentShader:Rt.distance_frag},shadow:{uniforms:hr([lt.lights,lt.fog,{color:{value:new tt(0)},opacity:{value:1}}]),vertexShader:Rt.shadow_vert,fragmentShader:Rt.shadow_frag}};Za.physical={uniforms:hr([Za.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Et},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Et},clearcoatNormalScale:{value:new Le(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Et},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Et},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Et},sheen:{value:0},sheenColor:{value:new tt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Et},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Et},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Et},transmissionSamplerSize:{value:new Le},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Et},attenuationDistance:{value:0},attenuationColor:{value:new tt(0)},specularColor:{value:new tt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Et},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Et},anisotropyVector:{value:new Le},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Et}}]),vertexShader:Rt.meshphysical_vert,fragmentShader:Rt.meshphysical_frag};var c1={r:0,b:0,g:0},af=new jr,mG=new mt;function gG(n,e,t,i,r,a){let o=new tt(0),l=r===!0?0:1,c,f,d=null,m=0,p=null;function g(b){let S=b.isScene===!0?b.background:null;if(S&&S.isTexture){let E=b.backgroundBlurriness>0;S=e.get(S,E)}return S}function y(b){let S=!1,E=g(b);E===null?x(o,l):E&&E.isColor&&(x(E,1),S=!0);let C=n.xr.getEnvironmentBlendMode();C==="additive"?t.buffers.color.setClear(0,0,0,1,a):C==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,a),(n.autoClear||S)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function T(b,S){let E=g(S);E&&(E.isCubeTexture||E.mapping===$c)?(f===void 0&&(f=new ln(new Eu(1,1,1),new xi({name:"BackgroundCubeMaterial",uniforms:rf(Za.backgroundCube.uniforms),vertexShader:Za.backgroundCube.vertexShader,fragmentShader:Za.backgroundCube.fragmentShader,side:Ni,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(C,D,U){this.matrixWorld.copyPosition(U.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),af.copy(S.backgroundRotation),af.x*=-1,af.y*=-1,af.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(af.y*=-1,af.z*=-1),f.material.uniforms.envMap.value=E,f.material.uniforms.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,f.material.uniforms.backgroundRotation.value.setFromMatrix4(mG.makeRotationFromEuler(af)),f.material.toneMapped=Pt.getTransfer(E.colorSpace)!==rn,(d!==E||m!==E.version||p!==n.toneMapping)&&(f.material.needsUpdate=!0,d=E,m=E.version,p=n.toneMapping),f.layers.enableAll(),b.unshift(f,f.geometry,f.material,0,0,null)):E&&E.isTexture&&(c===void 0&&(c=new ln(new xo(2,2),new xi({name:"BackgroundMaterial",uniforms:rf(Za.background.uniforms),vertexShader:Za.background.vertexShader,fragmentShader:Za.background.fragmentShader,side:Go,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=E,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Pt.getTransfer(E.colorSpace)!==rn,E.matrixAutoUpdate===!0&&E.updateMatrix(),c.material.uniforms.uvTransform.value.copy(E.matrix
vendor: 5,860 bytes, line 3620
3620),(d!==E||m!==E.version||p!==n.toneMapping)&&(c.material.needsUpdate=!0,d=E,m=E.version,p=n.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function x(b,S){b.getRGB(c1,vw(n)),t.buffers.color.setClear(c1.r,c1.g,c1.b,S,a)}function _(){f!==void 0&&(f.geometry.dispose(),f.material.dispose(),f=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(b,S=1){o.set(b),l=S,x(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,x(o,l)},render:y,addToRenderList:T,dispose:_}}function vG(n,e){let t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null),a=r,o=!1;function l(I,z,B,V,W){let X=!1,K=m(I,V,B,z);a!==K&&(a=K,f(a.object)),X=g(I,V,B,W),X&&y(I,V,B,W),W!==null&&e.update(W,n.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,E(I,z,B,V),W!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function c(){return n.createVertexArray()}function f(I){return n.bindVertexArray(I)}function d(I){return n.deleteVertexArray(I)}function m(I,z,B,V){let W=V.wireframe===!0,X=i[z.id];X===void 0&&(X={},i[z.id]=X);let K=I.isInstancedMesh===!0?I.id:0,pe=X[K];pe===void 0&&(pe={},X[K]=pe);let Q=pe[B.id];Q===void 0&&(Q={},pe[B.id]=Q);let ee=Q[W];return ee===void 0&&(ee=p(c()),Q[W]=ee),ee}function p(I){let z=[],B=[],V=[];for(let W=0;W<t;W++)z[W]=0,B[W]=0,V[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:z,enabledAttributes:B,attributeDivisors:V,object:I,attributes:{},index:null}}function g(I,z,B,V){let W=a.attributes,X=z.attributes,K=0,pe=B.getAttributes();for(let Q in pe)if(pe[Q].location>=0){let G=W[Q],Z=X[Q];if(Z===void 0&&(Q==="instanceMatrix"&&I.instanceMatrix&&(Z=I.instanceMatrix),Q==="instanceColor"&&I.instanceColor&&(Z=I.instanceColor)),G===void 0||G.attribute!==Z||Z&&G.data!==Z.data)return!0;K++}return a.attributesNum!==K||a.index!==V}function y(I,z,B,V){let W={},X=z.attributes,K=0,pe=B.getAttributes();for(let Q in pe)if(pe[Q].location>=0){let G=X[Q];G===void 0&&(Q==="instanceMatrix"&&I.instanceMatrix&&(G=I.instanceMatrix),Q==="instanceColor"&&I.instanceColor&&(G=I.instanceColor));let Z={};Z.attribute=G,G&&G.data&&(Z.data=G.data),W[Q]=Z,K++}a.attributes=W,a.attributesNum=K,a.index=V}function T(){let I=a.newAttributes;for(let z=0,B=I.length;z<B;z++)I[z]=0}function x(I){_(I,0)}function _(I,z){let B=a.newAttributes,V=a.enabledAttributes,W=a.attributeDivisors;B[I]=1,V[I]===0&&(n.enableVertexAttribArray(I),V[I]=1),W[I]!==z&&(n.vertexAttribDivisor(I,z),W[I]=z)}function b(){let I=a.newAttributes,z=a.enabledAttributes;for(let B=0,V=z.length;B<V;B++)z[B]!==I[B]&&(n.disableVertexAttribArray(B),z[B]=0)}function S(I,z,B,V,W,X,K){K===!0?n.vertexAttribIPointer(I,z,B,W,X):n.vertexAttribPointer(I,z,B,V,W,X)}function E(I,z,B,V){T();let W=V.attributes,X=B.getAttributes(),K=z.defaultAttributeValues;for(let pe in X){let Q=X[pe];if(Q.location>=0){let ee=W[pe];if(ee===void 0&&(pe==="instanceMatrix"&&I.instanceMatrix&&(ee=I.instanceMatrix),pe==="instanceColor"&&I.instanceColor&&(ee=I.instanceColor)),ee!==void 0){let G=ee.normalized,Z=ee.itemSize,ne=e.get(ee);if(ne===void 0)continue;let he=ne.buffer,se=ne.type,J=ne.bytesPerElement,te=se===n.INT||se===n.UNSIGNED_INT||ee.gpuType===R0;if(ee.isInterleavedBufferAttribute){let re=ee.data,Oe=re.stride,Be=ee.offset;if(re.isInstancedInterleavedBuffer){for(let De=0;De<Q.locationSize;De++)_(Q.location+De,re.meshPerAttribute);I.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=re.meshPerAttribute*re.count)}else for(let De=0;De<Q.locationSize;De++)x(Q.location+De);n.bindBuffer(n.ARRAY_BUFFER,he);for(let De=0;De<Q.locationSize;De++)S(Q.location+De,Z/Q.locationSize,se,G,Oe*J,(Be+Z/Q.locationSize*De)*J,te)}else{if(ee.isInstancedBufferAttribute){for(let re=0;re<Q.locationSize;re++)_(Q.location+re,ee.meshPerAttribute);I.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=ee.meshPerAttribute*ee.count)}else for(let re=0;re<Q.locationSize;re++)x(Q.location+re);n.bindBuffer(n.ARRAY_BUFFER,he);for(let re=0;re<Q.locationSize;re++)S(Q.location+re,Z/Q.locationSize,se,G,Z*J,Z/Q.locationSize*re*J,te)}}else if(K!==void 0){let G=K[pe];if(G!==void 0)switch(G.length){case 2:n.vertexAttrib2fv(Q.location,G);break;case 3:n.vertexAttrib3fv(Q.location,G);break;case 4:n.vertexAttrib4fv(Q.location,G);break;default:n.vertexAttrib1fv(Q.location,G)}}}}b()}function C(){R();for(let I in i){let z=i[I];for(let B in z){let V=z[B];for(let W in V){let X=V[W];for(let K in X)d(X[K].object),delete X[K];delete V[W]}}delete i[I]}}function D(I){if(i[I.id]===void 0)return;let z=i[I.id];for(let B in z){let V=z[B];for(let W in V){let X=V[W];for(let K in X)d(X[K].object),delete X[K];delete V[W]}}delete i[I.id]}function U(I){for(let z in i){let B=i[z];for(let V in B){let W=B[V];if(W[I.id]===void 0)continue;let X=W[I.id];for(let K in X)d(X[K].object),delete X[K];delete W[I.id]}}}function w(I){for(let z in i){let B=i[z],V=I.isInstancedMesh===!0?I.id:0,W=B[V];if(W!==void 0){for(let X in W){let K=W[X];for(let pe in K)d(K[pe].object),delete K[pe];delete W[X]}delete B[V],Object.keys(B).length===0&&delete i[z]}}}function R(){L(),o=!0,a!==r&&(a=r,f(a.object))}function L(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:l,reset:R,resetDefaultState:L,dispose:C,releaseStatesOfGeometry:D,releaseStatesOfObject:w,releaseStatesOfProgram:U,initAttributes:T,enableAttribute:x,disableUnusedAttributes:b}}function yG(n,e,t){let i;function r(f){i=f}function a(f,d){n.drawArrays(i,f,d),t.update(d,i,1)}function o(f,d,m){m!==0&&(n.drawArraysInstanced(i,f,d,m),t.update(d,i,m))}function l(f,d,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,f,0,d,0,m);let g=0;for(let y=0;y<m;y++)g+=d[y];t.update(g,i,1)}function c(f,d,m,p){if(m===0)return;let g=e.get("WEBGL_multi_draw");if(g===null)for(let y=0;y<f.length;y++)o(f[y],d[y],p[y]);
vendor: 6,581 bytes, line 3620
3620else{g.multiDrawArraysInstancedWEBGL(i,f,0,d,0,p,0,m);let y=0;for(let T=0;T<m;T++)y+=d[T]*p[T];t.update(y,i,1)}}this.setMode=r,this.render=a,this.renderInstances=o,this.renderMultiDraw=l,this.renderMultiDrawInstances=c}function _G(n,e,t,i){let r;function a(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){let U=e.get("EXT_texture_filter_anisotropic");r=n.getParameter(U.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(U){return!(U!==_i&&i.convert(U)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function l(U){let w=U===wo&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(U!==Ki&&i.convert(U)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&U!==Yi&&!w)}function c(U){if(U==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";U="mediump"}return U==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let f=t.precision!==void 0?t.precision:"highp",d=c(f);d!==f&&(ot("WebGLRenderer:",f,"not supported, using",d,"instead."),f=d);let m=t.logarithmicDepthBuffer===!0,p=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),g=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),y=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),T=n.getParameter(n.MAX_TEXTURE_SIZE),x=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),_=n.getParameter(n.MAX_VERTEX_ATTRIBS),b=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),S=n.getParameter(n.MAX_VARYING_VECTORS),E=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),C=n.getParameter(n.MAX_SAMPLES),D=n.getParameter(n.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:l,precision:f,logarithmicDepthBuffer:m,reversedDepthBuffer:p,maxTextures:g,maxVertexTextures:y,maxTextureSize:T,maxCubemapSize:x,maxAttributes:_,maxVertexUniforms:b,maxVaryings:S,maxFragmentUniforms:E,maxSamples:C,samples:D}}function bG(n){let e=this,t=null,i=0,r=!1,a=!1,o=new qi,l=new Et,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(m,p){let g=m.length!==0||p||i!==0||r;return r=p,i=m.length,g},this.beginShadows=function(){a=!0,d(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(m,p){t=d(m,p,0)},this.setState=function(m,p,g){let y=m.clippingPlanes,T=m.clipIntersection,x=m.clipShadows,_=n.get(m);if(!r||y===null||y.length===0||a&&!x)a?d(null):f();else{let b=a?0:i,S=b*4,E=_.clippingState||null;c.value=E,E=d(y,p,S,g);for(let C=0;C!==S;++C)E[C]=t[C];_.clippingState=E,this.numIntersection=T?this.numPlanes:0,this.numPlanes+=b}};function f(){c.value!==t&&(c.value=t,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(m,p,g,y){let T=m!==null?m.length:0,x=null;if(T!==0){if(x=c.value,y!==!0||x===null){let _=g+T*4,b=p.matrixWorldInverse;l.getNormalMatrix(b),(x===null||x.length<_)&&(x=new Float32Array(_));for(let S=0,E=g;S!==T;++S,E+=4)o.copy(m[S]).applyMatrix4(b,l),o.normal.toArray(x,E),x[E+3]=o.constant}c.value=x,c.needsUpdate=!0}return e.numPlanes=T,e.numIntersection=0,x}}var Pu=4,_P=[.125,.215,.35,.446,.526,.582],sf=20,xG=256,gv=new Kr,bP=new tt,Sw=null,Tw=0,Ew=0,Mw=!1,SG=new H,_v=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,i=.1,r=100,a={}){let{size:o=256,position:l=SG}=a;Sw=this._renderer.getRenderTarget(),Tw=this._renderer.getActiveCubeFace(),Ew=this._renderer.getActiveMipmapLevel(),Mw=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);let c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,i,r,c,l),t>0&&this._blur(c,0,0,t),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=TP(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=SP(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.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._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(Sw,Tw,Ew),this._renderer.xr.enabled=Mw,e.scissorTest=!1,np(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Eo||e.mapping===ol?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Sw=this._renderer.getRenderTarget(),Tw=this._renderer.getActiveCubeFace(),Ew=this._renderer.getActiveMipmapLevel(),Mw=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:dn,minFilter:dn,generateMipmaps:!1,type:wo,format:_i,colorSpace:Wo,depthBuffer:!1},r=xP(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=xP(e,t,i);let{_lodMax:a}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=TG(a)),this._blurMaterial=MG(a,e,t),this._ggxMaterial=EG(a,e,t)}return r}_compileMaterial(e){let t=new ln(new wt,e);this._renderer.compile(t,gv)}_sceneToCubeUV(e,t,i,r,a){let c=new Tn(90,1,t,i),f=[1,-1,1,1,1,1],d=[1,1,1,-1,-1,-1],m=this._renderer,p=m.autoClear,g=m.toneMapping;m.getClearColor(bP),m.toneMapping=Qr,m.autoClear=!1,m.state.buffers.depth.getReversed()&&(m.setRenderTarget(r),m.clearDepth(),m.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new ln(new Eu,new Aa({name:"PMREM.Backgroun
3620d",side:Ni,depthWrite:!1,depthTest:!1})));let T=this._backgroundBox,x=T.material,_=!1,b=e.background;b?b.isColor&&(x.color.copy(b),e.background=null,_=!0):(x.color.copy(bP),_=!0);for(let S=0;S<6;S++){let E=S%3;E===0?(c.up.set(0,f[S],0),c.position.set(a.x,a.y,a.z),c.lookAt(a.x+d[S],a.y,a.z)):E===1?(c.up.set(0,0,f[S]),c.position.set(a.x,a.y,a.z),c.lookAt(a.x,a.y+d[S],a.z)):(c.up.set(0,f[S],0),c.position.set(a.x,a.y,a.z),c.lookAt(a.x,a.y,a.z+d[S]));let C=this._cubeSize;np(r,E*C,S>2?C:0,C,C),m.setRenderTarget(r),_&&m.render(T,c),m.render(e,c)}m.toneMapping=g,m.autoClear=p,e.background=b}_textureToCubeUV(e,t){let i=this._renderer,r=e.mapping===Eo||e.mapping===ol;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=TP()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=SP());let a=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=a;let l=a.uniforms;l.envMap.value=e;let c=this._cubeSize;np(t,0,0,3*c,2*c),i.setRenderTarget(t),i.render(o,gv)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let a=1;a<r;a++)this._applyGGXFilter(e,a-1,a);t.autoClear=i}_applyGGXFilter(e,t,i){let r=this._renderer,a=this._pingPongRenderTarget,o=this._ggxMaterial,l=this._lodMeshes[i];l.material=o;let c=o.uniforms,f=i/(this._lodMeshes.length-1),d=t/(this._lodMeshes.length-1),m=Math.sqrt(f*f-d*d),p=0+f*1.25,g=m*p,{_lodMax:y}=this,T=this._sizeLods[i],x=3*T*(i>y-Pu?i-y+Pu:0),_=4*(this._cubeSize-T);c.envMap.value=e.texture,c.roughness.value=g,c.mipInt.value=y-t,np(a,x,_,3*T,2*T),r.setRenderTarget(a),r.render(l,gv),c.envMap.value=a.texture,c.roughness.value=0,c.mipInt.value=y-i,np(e,x,_,3*T,2*T),r.setRenderTarget(e),r.render(l,gv)}_blur(e,t,i,r,a){let o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",a),this._halfBlur(o,e,i,i,r,"longitudinal",a)}_halfBlur(e,t,i,r,a,o,l){let c=this._renderer,f=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&pt("blur direction must be either latitudinal or longitudinal!");let d=3,m=this._lodMeshes[r];m.material=f;let p=f.uniforms,g=this._sizeLods[i]-1,y=isFinite(a)?Math.PI/(2*g):2*Math.PI/(2*sf-1),T=a/y,x=isFinite(a)?1+Math.floor(d*T):sf;x>sf&&ot(`sigmaRadians, ${a}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${sf}`);let _=[],b=0;for(let U=0;U<sf;
vendor: 4,646 bytes, lines 3620-3711
3620++U){let w=U/T,R=Math.exp(-w*w/2);_.push(R),U===0?b+=R:U<x&&(b+=2*R)}for(let U=0;U<_.length;U++)_[U]=_[U]/b;p.envMap.value=e.texture,p.samples.value=x,p.weights.value=_,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l);let{_lodMax:S}=this;p.dTheta.value=y,p.mipInt.value=S-i;let E=this._sizeLods[r],C=3*E*(r>S-Pu?r-S+Pu:0),D=4*(this._cubeSize-E);np(t,C,D,3*E,2*E),c.setRenderTarget(t),c.render(m,gv)}};function TG(n){let e=[],t=[],i=[],r=n,a=n-Pu+1+_P.length;for(let o=0;o<a;o++){let l=Math.pow(2,r);e.push(l);let c=1/l;o>n-Pu?c=_P[o-n+Pu-1]:o===0&&(c=0),t.push(c);let f=1/(l-2),d=-f,m=1+f,p=[d,d,m,d,m,m,d,d,m,m,d,m],g=6,y=6,T=3,x=2,_=1,b=new Float32Array(T*y*g),S=new Float32Array(x*y*g),E=new Float32Array(_*y*g);for(let D=0;D<g;D++){let U=D%3*2/3-1,w=D>2?0:-1,R=[U,w,0,U+2/3,w,0,U+2/3,w+1,0,U,w,0,U+2/3,w+1,0,U,w+1,0];b.set(R,T*y*D),S.set(p,x*y*D);let L=[D,D,D,D,D,D];E.set(L,_*y*D)}let C=new wt;C.setAttribute("position",new an(b,T)),C.setAttribute("uv",new an(S,x)),C.setAttribute("faceIndex",new an(E,_)),i.push(new ln(C,null)),r>Pu&&r--}return{lodMeshes:i,sizeLods:e,sigmas:t}}function xP(n,e,t){let i=new fr(n,e,t);return i.texture.mapping=$c,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function np(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function EG(n,e,t){return new xi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:xG,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:d1(),fragmentShader:`
3621
3622			precision highp float;
3623			precision highp int;
3624
3625			varying vec3 vOutputDirection;
3626
3627			uniform sampler2D envMap;
3628			uniform float roughness;
3629			uniform float mipInt;
3630
3631			#define ENVMAP_TYPE_CUBE_UV
3632			#include <cube_uv_reflection_fragment>
3633
3634			#define PI 3.14159265359
3635
3636			// Van der Corput radical inverse
3637			float radicalInverse_VdC(uint bits) {
3638				bits = (bits << 16u) | (bits >> 16u);
3639				bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
3640				bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
3641				bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
3642				bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
3643				return float(bits) * 2.3283064365386963e-10; // / 0x100000000
3644			}
3645
3646			// Hammersley sequence
3647			vec2 hammersley(uint i, uint N) {
3648				return vec2(float(i) / float(N), radicalInverse_VdC(i));
3649			}
3650
3651			// GGX VNDF importance sampling (Eric Heitz 2018)
3652			// "Sampling the GGX Distribution of Visible Normals"
3653			// https://jcgt.org/published/0007/04/01/
3654			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
3655				float alpha = roughness * roughness;
3656
3657				// Section 4.1: Orthonormal basis
3658				vec3 T1 = vec3(1.0, 0.0, 0.0);
3659				vec3 T2 = cross(V, T1);
3660
3661				// Section 4.2: Parameterization of projected area
3662				float r = sqrt(Xi.x);
3663				float phi = 2.0 * PI * Xi.y;
3664				float t1 = r * cos(phi);
3665				float t2 = r * sin(phi);
3666				float s = 0.5 * (1.0 + V.z);
3667				t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
3668
3669				// Section 4.3: Reprojection onto hemisphere
3670				vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V;
3671
3672				// Section 3.4: Transform back to ellipsoid configuration
3673				return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
3674			}
3675
3676			void main() {
3677				vec3 N = normalize(vOutputDirection);
3678				vec3 V = N; // Assume view direction equals normal for pre-filtering
3679
3680				vec3 prefilteredColor = vec3(0.0);
3681				float totalWeight = 0.0;
3682
3683				// For very low roughness, just sample the environment directly
3684				if (roughness < 0.001) {
3685					gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
3686					return;
3687				}
3688
3689				// Tangent space basis for VNDF sampling
3690				vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
3691				vec3 tangent = normalize(cross(up, N));
3692				vec3 bitangent = cross(N, tangent);
3693
3694				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
3695					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
3696
3697					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
3698					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
3699
3700					// Transform H back to world space
3701					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
3702					vec3 L = normalize(2.0 * dot(V, H) * H - V);
3703
3704					float NdotL = max(dot(N, L), 0.0);
3705
3706					if(NdotL > 0.0) {
3707						// Sample environment at fixed mip level
3708						// VNDF importance sampling handles the distribution filtering
3709						vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
3710
3711						// Weight by NdotL for the split-sum approximation
3712						// VNDF PDF naturally accounts for the visible microfacet distribution
3713						prefilteredColor += sampleColor * NdotL;
3714						totalWeight += NdotL;
3715					}
3716				}
3717
3718				if (totalWeight > 0.0) {
3719					prefilteredColor = prefilteredColor / totalWeight;
3720				}
3721
3722				gl_FragColor = vec4(prefilteredColor, 1.0);
3723			}
3724		`,blending:To,depthTest:!1,depthWrite:!1})}function MG(n,e,t){let i=new Float32Array(sf),r=new H(0,1,0);return new xi({name:"SphericalGaussianBlur",defines:{n:sf,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:d1(),fragmentShader:`
3725
3726			precision mediump float;
3727			precision mediump int;
3728
3729			varying vec3 vOutputDirection;
3730
3731			uniform sampler2D envMap;
3732			uniform int samples;
3733			uniform float weights[ n ];
3734			uniform bool latitudinal;
3735			uniform float dTheta;
3736			uniform float mipInt;
3737			uniform vec3 poleAxis;
3738
3739			#define ENVMAP_TYPE_CUBE_UV
3740			#include <cube_uv_reflection_fragment>
3741
3742			vec3 getSample( float theta, vec3 axis ) {
3743
3744				float cosTheta = cos( theta );
3745				// Rodrigues' axis-angle rotation
3746				vec3 sampleDirection = vOutputDirection * cosTheta
3747					+ cross( axis, vOutputDirection ) * sin( theta )
3748					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3749
3750				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3751
3752			}
3753
3754			void main() {
3755
3756				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3757
3758				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3759
3760					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3761
3762				}
3763
3764				axis = normalize( axis );
3765
3766				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3767				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3768
3769				for ( int i = 1; i < n; i++ ) {
3770
3771					if ( i >= samples ) {
3772
3773						break;
3774
3775					}
3776
3777					float theta = dTheta * float( i );
3778					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3779					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3780
3781				}
3782
3783			}
3784		`,blending:To,depthTest:!1,depthWrite:!1})}function SP(){return new xi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:d1(),fragmentShader:`
3785
3786			precision mediump float;
3787			precision mediump int;
3788
3789			varying vec3 vOutputDirection;
3790
3791			uniform sampler2D envMap;
3792
3793			#include <common>
3794
3795			void main() {
3796
3797				vec3 outputDirection = normalize( vOutputDirection );
3798				vec2 uv = equirectUv( outputDirection );
3799
3800				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3801
3802			}
3803		`,blending:To,depthTest:!1,depthWrite:!1})}function TP(){return new xi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:d1(),fragmentShader:`
3804
3805			precision mediump float;
3806			precision mediump int;
3807
3808			uniform float flipEnvMap;
3809
3810			varying vec3 vOutputDirection;
3811
3812			uniform samplerCube envMap;
3813
3814			void main() {
3815
3816				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3817
3818			}
3819		`,blending:To,depthTest:!1,depthWrite:!1})}function d1(){return`
3820
3821		precision mediump float;
3822		precision mediump int;
3823
3824		attribute float faceIndex;
3825
3826		varying vec3 vOutputDirection;
3827
3828		// RH coordinate system; PMREM face-indexing convention
3829		vec3 getDirection( vec2 uv, float face ) {
3830
3831			uv = 2.0 * uv - 1.0;
3832
3833			vec3 direction = vec3( uv, 1.0 );
3834
3835			if ( face == 0.0 ) {
3836
3837				direction = direction.zyx; // ( 1, v, u ) pos x
3838
3839			} else if ( face == 1.0 ) {
3840
3841				direction = direction.xzy;
3842				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3843
3844			} else if ( face == 2.0 ) {
3845
3846				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3847
3848			} else if ( face == 3.0 ) {
3849
3850				direction = direction.zyx;
3851				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3852
3853			} else if ( face == 4.0 ) {
3854
3855				direction = direction.xzy;
3856				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3857
3858			} else if ( face == 5.0 ) {
3859
3860				direction.z *= -1.0; // ( u, v, -1 ) neg z
3861
3862			}
3863
3864			return direction;
3865
3866		}
3867
3868		void main() {
3869
3870			vOutputDirection = getDirection( uv, faceIndex );
3871			gl_Position = vec4( position, 1.0 );
3872
3873		}
3874	`}var bv=class extends fr{constructor(e=1,t={}
vendor: 12,116 bytes, lines 3874-3955
3874){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Tu(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}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;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
3875
3876				varying vec3 vWorldDirection;
3877
3878				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
3879
3880					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
3881
3882				}
3883
3884				void main() {
3885
3886					vWorldDirection = transformDirection( position, modelMatrix );
3887
3888					#include <begin_vertex>
3889					#include <project_vertex>
3890
3891				}
3892			`,fragmentShader:`
3893
3894				uniform sampler2D tEquirect;
3895
3896				varying vec3 vWorldDirection;
3897
3898				#include <common>
3899
3900				void main() {
3901
3902					vec3 direction = normalize( vWorldDirection );
3903
3904					vec2 sampleUV = equirectUv( direction );
3905
3906					gl_FragColor = texture2D( tEquirect, sampleUV );
3907
3908				}
3909			`},r=new Eu(5,5,5),a=new xi({name:"CubemapFromEquirect",uniforms:rf(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Ni,blending:To});a.uniforms.tEquirect.value=t;let o=new ln(r,a),l=t.minFilter;return t.minFilter===Mo&&(t.minFilter=dn),new S0(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,i=!0,r=!0){let a=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(a)}};function wG(n){let e=new WeakMap,t=new WeakMap,i=null;function r(p,g=!1){return p==null?null:g?o(p):a(p)}function a(p){if(p&&p.isTexture){let g=p.mapping;if(g===Yh||g===jh)if(e.has(p)){let y=e.get(p).texture;return l(y,p.mapping)}else{let y=p.image;if(y&&y.height>0){let T=new bv(y.height);return T.fromEquirectangularTexture(n,p),e.set(p,T),p.addEventListener("dispose",f),l(T.texture,p.mapping)}else return null}}return p}function o(p){if(p&&p.isTexture){let g=p.mapping,y=g===Yh||g===jh,T=g===Eo||g===ol;if(y||T){let x=t.get(p),_=x!==void 0?x.texture.pmremVersion:0;if(p.isRenderTargetTexture&&p.pmremVersion!==_)return i===null&&(i=new _v(n)),x=y?i.fromEquirectangular(p,x):i.fromCubemap(p,x),x.texture.pmremVersion=p.pmremVersion,t.set(p,x),x.texture;if(x!==void 0)return x.texture;{let b=p.image;return y&&b&&b.height>0||T&&b&&c(b)?(i===null&&(i=new _v(n)),x=y?i.fromEquirectangular(p):i.fromCubemap(p),x.texture.pmremVersion=p.pmremVersion,t.set(p,x),p.addEventListener("dispose",d),x.texture):null}}}return p}function l(p,g){return g===Yh?p.mapping=Eo:g===jh&&(p.mapping=ol),p}function c(p){let g=0,y=6;for(let T=0;T<y;T++)p[T]!==void 0&&g++;return g===y}function f(p){let g=p.target;g.removeEventListener("dispose",f);let y=e.get(g);y!==void 0&&(e.delete(g),y.dispose())}function d(p){let g=p.target;g.removeEventListener("dispose",d);let y=t.get(g);y!==void 0&&(t.delete(g),y.dispose())}function m(){e=new WeakMap,t=new WeakMap,i!==null&&(i.dispose(),i=null)}return{get:r,dispose:m}}function AG(n){let e={};function t(i){if(e[i]!==void 0)return e[i];let r=n.getExtension(i);return e[i]=r,r}return{has:function(i){return t(i)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(i){let r=t(i);return r===null&&yh("WebGLRenderer: "+i+" extension not supported."),r}}}function CG(n,e,t,i){let r={},a=new WeakMap;function o(m){let p=m.target;p.index!==null&&e.remove(p.index);for(let y in p.attributes)e.remove(p.attributes[y]);p.removeEventListener("dispose",o),delete r[p.id];let g=a.get(p);g&&(e.remove(g),a.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(m,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function c(m){let p=m.attributes;for(let g in p)e.update(p[g],n.ARRAY_BUFFER)}function f(m){let p=[],g=m.index,y=m.attributes.position,T=0;if(y===void 0)return;if(g!==null){let b=g.array;T=g.version;for(let S=0,E=b.length;S<E;S+=3){let C=b[S+0],D=b[S+1],U=b[S+2];p.push(C,D,D,U,U,C)}}else{let b=y.array;T=y.version;for(let S=0,E=b.length/3-1;S<E;S+=3){let C=S+0,D=S+1,U=S+2;p.push(C,D,D,U,U,C)}}let x=new(y.count>=65535?xh:bh)(p,1);x.version=T;let _=a.get(m);_&&e.remove(_),a.set(m,x)}function d(m){let p=a.get(m);if(p){let g=m.index;g!==null&&p.version<g.version&&f(m)}else f(m);return a.get(m)}return{get:l,update:c,getWireframeAttribute:d}}function RG(n,e,t){let i;function r(p){i=p}let a,o;function l(p){a=p.type,o=p.bytesPerElement}function c(p,g){n.drawElements(i,g,a,p*o),t.update(g,i,1)}function f(p,g,y){y!==0&&(n.drawElementsInstanced(i,g,a,p*o,y),t.update(g,i,y))}function d(p,g,y){if(y===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,g,0,a,p,0,y);let x=0;for(let _=0;_<y;_++)x+=g[_];t.update(x,i,1)}function m(p,g,y,T){if(y===0)return;let x=e.get("WEBGL_multi_draw");if(x===null)for(let _=0;_<p.length;_++)f(p[_]/o,g[_],T[_]);else{x.multiDrawElementsInstancedWEBGL(i,g,0,a,p,0,T,0,y);let _=0;for(let b=0;b<y;b++)_+=g[b]*T[b];t.update(_,i,1)}}this.setMode=r,this.setIndex=l,this.render=c,this.renderInstances=f,this.renderMultiDraw=d,this.renderMultiDrawInstances=m}function DG(n){let e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function i(a,o,l){switch(t.calls++,o){case n.TRIANGLES:t.triangles+=l*(a/3);break;case n.LINES:t.lines+=l*(a/2);break;case n.LINE_STRIP:t.lines+=l*(a-1);break;case n.LINE_LOOP:t.lines+=l*a;break;case n.POINTS:t.points+=l*a;break;default:pt("WebGLInfo: Unknown draw mode:",o);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:i}}function UG(n,e,t){let i=new WeakMap,r=new Nt;function a(o,l,c){let f=o.morphTargetInfluences,d=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,m=d!==void 0?d.length:0,p=i.get(l);if(p===void 0||p.count!==m){let R=function(){U.dispose(),i.delete(l),l.removeEventListener("dispose",R)};p!==void 0&&p.texture.dispose();let g=l.morphAttributes.position!==void 0,y=l.morphAttributes.normal!==void 0,T=l.morphAttributes.color!==void 0,x=l.morphAttributes.position||[],_=l.morphAttributes.normal||[],b=l.morphAttributes.color||[],S=0;g===!0&&(S=1),y===!0&&(S=2),T===!0&&(S=3);let E=l.attributes.position.count*S,C=1;E>e.maxTextureSize&&(C=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);let D=new Float32Array(E*C*4*m),U=new kc(D,E,C,m);U.type=Yi,U.needsUpdate=!0;let w=S*4;for(let L=0;L<m;L++){let I=x[L],z=_[L],B=b[L],V=E*C*4*L;for(let W=0;W<I.count;W++){let X=W*w;g===!0&&(r.fromBufferAttribute(I,W),D[V+X+0]=r.x,D[V+X+1]=r.y,D[V+X+2]=r.z,D[V+X+3]=0),y===!0&&(r.fromBufferAttribute(z,W),D[V+X+4]=r.x,D[V+X+5]=r.y,D[V+X+6]=r.z,D[V+X+7]=0),T===!0&&(r.fromBufferAttribute(B,W),D[V+X+8]=r.x,D[V+X+9]=r.y,D[V+X+10]=r.z,D[V+X+11]=B.itemSize===4?r.w:1)}}p={count:m,texture:U,size:new Le(E,C)},i.set(l,p),l.addEventListener("dispose",R)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)c.getUniforms().setValue(n,"morphTexture",o.morphTexture,t);else{let g=0;for(let T=0;T<f.length;T++)g+=f[T];let y=l.morphTargetsRelative?1:1-g;c.getUniforms().setValue(n,"morphTargetBaseInfluence",y),c.getUniforms().setValue(n,"morphTargetInfluences",f)}c.getUniforms().setValue(n,"morphTargetsTexture",p.texture,t),c.getUniforms().setValue(n,"morphTargetsTextureSize",p.size)}return{update:a}}function OG(n,e,t,i,r){let a=new WeakMap;function o(f){let d=r.render.frame,m=f.geometry,p=e.get(f,m);if(a.get(p)!==d&&(e.update(p),a.set(p,d)),f.isInstancedMesh&&(f.hasEventListener("dispose",c)===!1&&f.addEventListener("dispose",c),a.get(f)!==d&&(t.update(f.instanceMatrix,n.ARRAY_BUFFER),f.instanceColor!==null&&t.update(f.instanceColor,n.ARRAY_BUFFER),a.set(f,d))),f.isSkinnedMesh){let g=f.skeleton;a.get(g)!==d&&(g.update(),a.set(g,d))}return p}function l(){a=new WeakMap}function c(f){let d=f.target;d.removeEventListener("dispose",c),i.releaseStatesOfObject(d),t.remove(d.instanceMatrix),d.instanceColor!==null&&t.remove(d.instanceColor)}return{update:o,dispose:l}}var LG={[Yx]:"LINEAR_TONE_MAPPING",[jx]:"REINHARD_TONE_MAPPING",[Zx]:"CINEON_TONE_MAPPING",[Lu]:"ACES_FILMIC_TONE_MAPPING",[Qx]:"AGX_TONE_MAPPING",[Jx]:"NEUTRAL_TONE_MAPPING",[Kx]:"CUSTOM_TONE_MAPPING"};function NG(n,e,t,i,r){let a=new fr(e,t,{type:n,depthBuffer:i,stencilBuffer:r}),o=new fr(e,t,{type:wo,depthBuffer:!1,stencilBuffer:!1}),l=new wt;l.setAttribute("position",new ut([-1,3,0,-1,-1,0,3,-1,0],3)),l.setAttribute("uv",new ut([0,2,0,0,2,0],2));let c=new Ph({uniforms:{tDiffuse:{value:null}},vertexShader:`
3910			precision highp float;
3911
3912			uniform mat4 modelViewMatrix;
3913			uniform mat4 projectionMatrix;
3914
3915			attribute vec3 position;
3916			attribute vec2 uv;
3917
3918			varying vec2 vUv;
3919
3920			void main() {
3921				vUv = uv;
3922				gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3923			}`,fragmentShader:`
3924			precision highp float;
3925
3926			uniform sampler2D tDiffuse;
3927
3928			varying vec2 vUv;
3929
3930			#include <tonemapping_pars_fragment>
3931			#include <colorspace_pars_fragment>
3932
3933			void main() {
3934				gl_FragColor = texture2D( tDiffuse, vUv );
3935
3936				#ifdef LINEAR_TONE_MAPPING
3937					gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
3938				#elif defined( REINHARD_TONE_MAPPING )
3939					gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
3940				#elif defined( CINEON_TONE_MAPPING )
3941					gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
3942				#elif defined( ACES_FILMIC_TONE_MAPPING )
3943					gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
3944				#elif defined( AGX_TONE_MAPPING )
3945					gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
3946				#elif defined( NEUTRAL_TONE_MAPPING )
3947					gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
3948				#elif defined( CUSTOM_TONE_MAPPING )
3949					gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
3950				#endif
3951
3952				#ifdef SRGB_TRANSFER
3953					gl_FragColor = sRGBTransferOETF( gl_FragColor );
3954				#endif
3955			}`,depthTest:!1,depthWrite:!1}),f=new ln(l,c),d=new Kr(-1,1,1,-1,0,1),m=null,p=null,g=!1,y,T=null,x=[],_=!1;this.setSize=function(b,S){a.setSize(b,S),o.setSize(b,S);for(let E=0;E<x.length;E++){let C=x[E];C.setSize&&C.setSize(b,S)}},this.setEffects=function(b){x=b,_=x.length>0&&x[0].isRenderPass===!0;let S=a.width,E=a.height;for(let C=0;C<x.length;C++){let D=x[C];D.setSize&&D.setSize(S,E)}},this.begin=function(b,S){if(g||b.toneMapping===Qr&&x.length===0)return!1;if(T=S,S!==null){let E=S.width,C=S.height;(a.width!==E||a.height!==C)&&this.setSize(E,C)}return _===!1&&b.setRenderTarget(a),y=b.toneMapping,b.toneMapping=Qr,!0},this.hasRenderPass=function(){return _},this.end=function(b,S){b.toneMapping=y,g=!0;let E=a,C=o;for(let D=0;D<x.length;D++){let U=x[D];if(U.enabled!==!1&&(U.render(b,C,E,S),U.needsSwap!==!1)){let w=E;E=C,C=w}}if(m!==b.outputColorSpace||p!==b.toneMapping){m=b.outputColorSpace,p=b.toneMapping,c.defines={},Pt.getTransfer(m)===rn&&(c.defines.SRGB_TRANSFER="");let D=LG[p];D&&(c.defines[D]=""),c.needsUpdate=!0}c.uniforms.tDiffuse.value=E.texture,b.setRenderTarget(T),b.render(f,d),T=null,g=!1},this.isCompositing=function(){return g},this.dispose=function(){a.dispose(),o.dispose(),l.dispose(),c.dispose()}}var VP=new Bn,Cw=new Qs(1,1),GP=new kc,WP=new Fc,XP=new Tu,EP=[],MP=[],wP=new Float32Array(16),AP=new Float32Array(9),CP=new Float32Array(4);function rp(n,e,t){let i=n[0];if(i<=0||i>0)return n;let r=e*t,a=EP[r];if(a===void 0&&(a=new Float32Array(r),EP[r]=a),e!==0){i.toArray(a,0);for(let o=1,l=0;o!==e;++o)l+=t,n[o].toArray(a,l)}return a}function Si(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t<i;t++)if(n[t]!==e[t])return!1;return!0}function Ti(n,e){for(let t=0,i=e.length;t<i;t++)n[t]=e[t]}function h1(n,e){let t=MP[e];t===void 0&&(t=new Int32Array(e),MP[e]=t);for(let i=0;i!==e;++i)t[i]=n.allocateTextureUnit();return t}function PG(n,e){let t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function IG(n,e){let t=this.cache;
vendor: 3,861 bytes, line 3955
3955if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Si(t,e))return;n.uniform2fv(this.addr,e),Ti(t,e)}}function zG(n,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Si(t,e))return;n.uniform3fv(this.addr,e),Ti(t,e)}}function kG(n,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Si(t,e))return;n.uniform4fv(this.addr,e),Ti(t,e)}}function FG(n,e){let t=this.cache,i=e.elements;if(i===void 0){if(Si(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Ti(t,e)}else{if(Si(t,i))return;CP.set(i),n.uniformMatrix2fv(this.addr,!1,CP),Ti(t,i)}}function BG(n,e){let t=this.cache,i=e.elements;if(i===void 0){if(Si(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Ti(t,e)}else{if(Si(t,i))return;AP.set(i),n.uniformMatrix3fv(this.addr,!1,AP),Ti(t,i)}}function HG(n,e){let t=this.cache,i=e.elements;if(i===void 0){if(Si(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Ti(t,e)}else{if(Si(t,i))return;wP.set(i),n.uniformMatrix4fv(this.addr,!1,wP),Ti(t,i)}}function VG(n,e){let t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function GG(n,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Si(t,e))return;n.uniform2iv(this.addr,e),Ti(t,e)}}function WG(n,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Si(t,e))return;n.uniform3iv(this.addr,e),Ti(t,e)}}function XG(n,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Si(t,e))return;n.uniform4iv(this.addr,e),Ti(t,e)}}function qG(n,e){let t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function YG(n,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Si(t,e))return;n.uniform2uiv(this.addr,e),Ti(t,e)}}function jG(n,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Si(t,e))return;n.uniform3uiv(this.addr,e),Ti(t,e)}}function ZG(n,e){let t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Si(t,e))return;n.uniform4uiv(this.addr,e),Ti(t,e)}}function KG(n,e,t){let i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r);let a;this.type===n.SAMPLER_2D_SHADOW?(Cw.compareFunction=t.isReversedDepthBuffer()?mv:pv,a=Cw):a=VP,t.setTexture2D(e||a,r)}function QG(n,e,t){let i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture3D(e||WP,r)}function JG(n,e,t){let i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTextureCube(e||XP,r)}function $G(n,e,t){let i=this.cache,r=t.allocateTextureUnit();i[0]!==r&&(n.uniform1i(this.addr,r),i[0]=r),t.setTexture2DArray(e||GP,r)}function e7(n){switch(n){case 5126:return PG;case 35664:return IG;case 35665:return zG;case 35666:return kG;case 35674:return FG;case 35675:return BG;case 35676:return HG;case 5124:case 35670:return VG;case 35667:case 35671:return GG;case 35668:case 35672:return WG;case 35669:case 35673:return XG;case 5125:return qG;case 36294:return YG;case 36295:return jG;case 36296:return ZG;case 35678:case 36198:case 36298:case 36306:case 35682:return KG;case 35679:case 36299:case 36307:return QG;
vendor: 9,660 bytes, lines 3955-3990
3955case 35680:case 36300:case 36308:case 36293:return JG;case 36289:case 36303:case 36311:case 36292:return $G}}function t7(n,e){n.uniform1fv(this.addr,e)}function n7(n,e){let t=rp(e,this.size,2);n.uniform2fv(this.addr,t)}function i7(n,e){let t=rp(e,this.size,3);n.uniform3fv(this.addr,t)}function r7(n,e){let t=rp(e,this.size,4);n.uniform4fv(this.addr,t)}function a7(n,e){let t=rp(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function o7(n,e){let t=rp(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function s7(n,e){let t=rp(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function l7(n,e){n.uniform1iv(this.addr,e)}function u7(n,e){n.uniform2iv(this.addr,e)}function c7(n,e){n.uniform3iv(this.addr,e)}function f7(n,e){n.uniform4iv(this.addr,e)}function d7(n,e){n.uniform1uiv(this.addr,e)}function h7(n,e){n.uniform2uiv(this.addr,e)}function p7(n,e){n.uniform3uiv(this.addr,e)}function m7(n,e){n.uniform4uiv(this.addr,e)}function g7(n,e,t){let i=this.cache,r=e.length,a=h1(t,r);Si(i,a)||(n.uniform1iv(this.addr,a),Ti(i,a));let o;this.type===n.SAMPLER_2D_SHADOW?o=Cw:o=VP;for(let l=0;l!==r;++l)t.setTexture2D(e[l]||o,a[l])}function v7(n,e,t){let i=this.cache,r=e.length,a=h1(t,r);Si(i,a)||(n.uniform1iv(this.addr,a),Ti(i,a));for(let o=0;o!==r;++o)t.setTexture3D(e[o]||WP,a[o])}function y7(n,e,t){let i=this.cache,r=e.length,a=h1(t,r);Si(i,a)||(n.uniform1iv(this.addr,a),Ti(i,a));for(let o=0;o!==r;++o)t.setTextureCube(e[o]||XP,a[o])}function _7(n,e,t){let i=this.cache,r=e.length,a=h1(t,r);Si(i,a)||(n.uniform1iv(this.addr,a),Ti(i,a));for(let o=0;o!==r;++o)t.setTexture2DArray(e[o]||GP,a[o])}function b7(n){switch(n){case 5126:return t7;case 35664:return n7;case 35665:return i7;case 35666:return r7;case 35674:return a7;case 35675:return o7;case 35676:return s7;case 5124:case 35670:return l7;case 35667:case 35671:return u7;case 35668:case 35672:return c7;case 35669:case 35673:return f7;case 5125:return d7;case 36294:return h7;case 36295:return p7;case 36296:return m7;case 35678:case 36198:case 36298:case 36306:case 35682:return g7;case 35679:case 36299:case 36307:return v7;case 35680:case 36300:case 36308:case 36293:return y7;case 36289:case 36303:case 36311:case 36292:return _7}}var Rw=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=e7(t.type)}},Dw=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=b7(t.type)}},Uw=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){let r=this.seq;for(let a=0,o=r.length;a!==o;++a){let l=r[a];l.setValue(e,t[l.id],i)}}},ww=/(\w+)(\])?(\[|\.)?/g;function RP(n,e){n.seq.push(e),n.map[e.id]=e}function x7(n,e,t){let i=n.name,r=i.length;for(ww.lastIndex=0;;){let a=ww.exec(i),o=ww.lastIndex,l=a[1],c=a[2]==="]",f=a[3];if(c&&(l=l|0),f===void 0||f==="["&&o+2===r){RP(t,f===void 0?new Rw(l,n,e):new Dw(l,n,e));break}else{let m=t.map[l];m===void 0&&(m=new Uw(l),RP(t,m)),t=m}}}var ip=class{constructor(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let o=0;o<i;++o){let l=e.getActiveUniform(t,o),c=e.getUniformLocation(t,l.name);x7(l,c,this)}let r=[],a=[];for(let o of this.seq)o.type===e.SAMPLER_2D_SHADOW||o.type===e.SAMPLER_CUBE_SHADOW||o.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(o):a.push(o);r.length>0&&(this.seq=r.concat(a))}setValue(e,t,i,r){let a=this.map[t];a!==void 0&&a.setValue(e,i,r)}setOptional(e,t,i){let r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let a=0,o=t.length;a!==o;++a){let l=t[a],c=i[l.id];c.needsUpdate!==!1&&l.setValue(e,c.value,r)}}static seqWithValue(e,t){let i=[];for(let r=0,a=e.length;r!==a;++r){let o=e[r];o.id in t&&i.push(o)}return i}};function DP(n,e,t){let i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}var S7=37297,T7=0;function E7(n,e){let t=n.split(`
3956`),i=[],r=Math.max(e-6,0),a=Math.min(e+6,t.length);for(let o=r;o<a;o++){let l=o+1;i.push(`${l===e?">":" "} ${l}: ${t[o]}`)}return i.join(`
3957`)}var UP=new Et;function M7(n){Pt._getMatrix(UP,Pt.workingColorSpace,n);let e=`mat3( ${UP.elements.map(t=>t.toFixed(4))} )`;switch(Pt.getTransfer(n)){case ph:return[e,"LinearTransferOETF"];case rn:return[e,"sRGBTransferOETF"];default:return ot("WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function OP(n,e,t){let i=n.getShaderParameter(e,n.COMPILE_STATUS),a=(n.getShaderInfoLog(e)||"").trim();if(i&&a==="")return"";let o=/ERROR: 0:(\d+)/.exec(a);if(o){let l=parseInt(o[1]);return t.toUpperCase()+`
3958
3959`+a+`
3960
3961`+E7(n.getShaderSource(e),l)}else return a}function w7(n,e){let t=M7(e);return[`vec4 ${n}( vec4 value ) {`,`	return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
3962`)}var A7={[Yx]:"Linear",[jx]:"Reinhard",[Zx]:"Cineon",[Lu]:"ACESFilmic",[Qx]:"AgX",[Jx]:"Neutral",[Kx]:"Custom"};function C7(n,e){let t=A7[e];return t===void 0?(ot("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+n+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}var f1=new H;function R7(){Pt.getLuminanceCoefficients(f1);let n=f1.x.toFixed(4),e=f1.y.toFixed(4),t=f1.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${n}, ${e}, ${t} );`,"	return dot( weights, rgb );","}"].join(`
3963`)}function D7(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(yv).join(`
3964`)}function U7(n){let e=[];for(let t in n){let i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(`
3965`)}function O7(n,e){let t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){let a=n.getActiveAttrib(e,r),o=a.name,l=1;a.type===n.FLOAT_MAT2&&(l=2),a.type===n.FLOAT_MAT3&&(l=3),a.type===n.FLOAT_MAT4&&(l=4),t[o]={type:a.type,location:n.getAttribLocation(e,o),locationSize:l}}return t}function yv(n){return n!==""}function LP(n,e){let t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function NP(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var L7=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ow(n){return n.replace(L7,P7)}var N7=new Map;function P7(n,e){let t=Rt[e];if(t===void 0){let i=N7.get(e);if(i!==void 0)t=Rt[i],ot('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Ow(t)}var I7=/#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 PP(n){return n.replace(I7,z7)}function z7(n,e,t,i){let r="";for(let a=parseInt(e);a<parseInt(t);a++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function IP(n){let e=`precision ${n.precision} float;
3966	precision ${n.precision} int;
3967	precision ${n.precision} sampler2D;
3968	precision ${n.precision} samplerCube;
3969	precision ${n.precision} sampler3D;
3970	precision ${n.precision} sampler2DArray;
3971	precision ${n.precision} sampler2DShadow;
3972	precision ${n.precision} samplerCubeShadow;
3973	precision ${n.precision} sampler2DArrayShadow;
3974	precision ${n.precision} isampler2D;
3975	precision ${n.precision} isampler3D;
3976	precision ${n.precision} isamplerCube;
3977	precision ${n.precision} isampler2DArray;
3978	precision ${n.precision} usampler2D;
3979	precision ${n.precision} usampler3D;
3980	precision ${n.precision} usamplerCube;
3981	precision ${n.precision} usampler2DArray;
3982	`;return n.precision==="highp"?e+=`
3983#define HIGH_PRECISION`:n.precision==="mediump"?e+=`
3984#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=`
3985#define LOW_PRECISION`),e}var k7={[Ou]:"SHADOWMAP_TYPE_PCF",[al]:"SHADOWMAP_TYPE_VSM"};function F7(n){return k7[n.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}var B7={[Eo]:"ENVMAP_TYPE_CUBE",[ol]:"ENVMAP_TYPE_CUBE",[$c]:"ENVMAP_TYPE_CUBE_UV"};function H7(n){return n.envMap===!1?"ENVMAP_TYPE_CUBE":B7[n.envMapMode]||"ENVMAP_TYPE_CUBE"}var V7={[ol]:"ENVMAP_MODE_REFRACTION"};function G7(n){return n.envMap===!1?"ENVMAP_MODE_REFLECTION":V7[n.envMapMode]||"ENVMAP_MODE_REFLECTION"}var W7={[qh]:"ENVMAP_BLENDING_MULTIPLY",[$2]:"ENVMAP_BLENDING_MIX",[ew]:"ENVMAP_BLENDING_ADD"};function X7(n){return n.envMap===!1?"ENVMAP_BLENDING_NONE":W7[n.combine]||"ENVMAP_BLENDING_NONE"}function q7(n){let e=n.envMapCubeUVHeight;if(e===null)return null;let t=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:i,maxMip:t}}function Y7(n,e,t,i){let r=n.getContext(),a=t.defines,o=t.vertexShader,l=t.fragmentShader,c=F7(t),f=H7(t),d=G7(t),m=X7(t),p=q7(t),g=D7(t),y=U7(a),T=r.createProgram(),x,_,b=t.glslVersion?"#version "+t.glslVersion+`
3986`:"";t.isRawShaderMaterial?(x=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(yv).join(`
3987`),x.length>0&&(x+=`
3988`),_=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y].filter(yv).join(`
3989`),_.length>0&&(_+=`
3990`)):(x=[IP(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.extensionCl
vendor: 6,474 bytes, lines 3990-3992
3990ipCullDistance?"#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 "+d:"",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 "+c:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","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",`
3991`].filter(yv).join(`
3992`),_=[IP(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,y,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+f:"",t.envMap?"#define "+d:"",t.envMap?"#define "+m:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
3992IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#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 "+c:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Qr?"#define TONE_MAPPING":"",t.toneMapping!==Qr?Rt.tonemapping_pars_fragment:"",t.toneMapping!==Qr?C7("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Rt.colorspace_pars_fragment,w7("linearToOutputTexel",t.outputColorSpace),R7(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
3993`].filter(yv).join(`
3994`)),o=Ow(o),o=LP(o,t),o=NP(o,t),l=Ow(l),l=LP(l,t),l=NP(l,t),o=PP(o),l=PP(l),t.isRawShaderMaterial!==!0&&(b=`#version 300 es
3995`,x=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3996`)+`
3997`+x,_=["#define varying in",t.glslVersion===l1?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===l1?"":"#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(`
3998`)+`
3999`+_);let S=b+x+o,E=b+_+l,C=DP(r,r.VERTEX_SHADER,S),D=DP(r,r.FRAGMENT_SHADER,E);r.attachShader(T,C),r.attachShader(T,D),t.index0AttributeName!==void 0?r.bindAttribLocation(T,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(T,0,"position"),r.linkProgram(T);function U(I){if(n.debug.checkShaderErrors){let z=r.getProgramInfoLog(T)||"",B=r.getShaderInfoLog(C)||"",V=r.getShaderInfoLog(D)||"",W=z.trim(),X=B.trim(),K=V.trim(),pe=!0,Q=!0;if(r.getProgramParameter(T,r.LINK_STATUS)===!1)if(pe=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,T,C,D);else{let ee=OP(r,C,"vertex"),G=OP(r,D,"fragment");pt("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(T,r.VALIDATE_STATUS)+`
4000
4001Material Name: `+I.name+`
4002Material Type: `+I.type+`
4003
4004Program Info Log: `+W+`
4005`+ee+`
4006`+G)}else W!==""?ot("WebGLProgram: Program Info Log:",W):(X===""||K==="")&&(Q=!1);Q&&(I.diagnostics={runnable:pe,programLog:W,vertexShader:{log:X,prefix:x},fragmentShader:{log:K,prefix:_}})}r.deleteShader(C),r.deleteShader(D),w=new ip(r,T),R=O7(r,T)}let w;this.getUniforms=function(){return w===void 0&&U(this),w};let R;this.getAttributes=function(){return R===void 0&&U(this),R};let L=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return L===!1&&(L=r.getProgramParameter(T,S7)),L},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(T),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=T7++,this.cacheKey=e,this.usedTimes=1,this.program=T,this.vertexShader=C,this.fragmentShader=D,this}var j7=0,Lw=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),a=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(a)===!1&&(o.add(a),a.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let 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){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new Nw(e),t.set(e,i)),i}},Nw=class{constructor(e){this.id=j7++,this.code=e,this.usedTimes=0}};function Z7(n,e,t,i,r,a){let o=new Xo,l=new Lw,c=new Set,f=[],d=new Map,m=i.logarithmicDepthBuffer,p=i.precision,g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(w){return c.add(w),w===0?"uv":`uv${w}`}function T(w,R,L,I,z){let B=I.fog,V=z.geometry,W=w.isMeshStandardMaterial||w.isMeshLambertMaterial||w.isMeshPhongMaterial?I.environment:null,X=w.isMeshStandardMaterial||w.isMeshLambertMaterial&&!w.envMap||w.isMeshPhongMaterial&&!w.envMap,K=e.get(w.envMap||W,X),pe=K&&K.mapping===$c?K.image.height:null,Q=g[w.type];w.precision!==null&&(p=i.getMaxPrecision(w.precision),p!==w.precision&&ot("WebGLProgram.getParameters:",w.precision,"not supported, using",p,"instead."));let ee=V.morphAttributes.position||V.morphAttributes.normal||V.morphAttributes.color,G=ee!==void 0?ee.length:0,Z=0;V.morphAttributes.position!==void 0&&(Z=1),V.morphAttributes.normal!==void 0&&(Z=2),V.morphAttributes.color!==void 0&&(Z=3);let ne,he,se,J;if(Q){let dt=Za[Q];ne=dt.vertexShader,he=dt.fragmentShader}else ne=w.vertexShader,he=w.fragmentShader,l.update(w),se=l.getVertexShaderID(w),J=l.getFragmentShaderID(w);let te=n.getRenderTarget(),re=n.state.buffers.depth.getReversed(),Oe=z.isInstancedMesh===!0,Be=z.isBatchedMesh===!0,De=!!w.map,Ue=!!w.matcap,Xe=!!K,ge=!!w.aoMap,me=!!w.lightMap,ce=!!w.bumpMap,Te=!!w.normalMap,F=!!w.displacementMap,He=!!w.emissiveMap,Me=!!w.metalnessMap,_e=!!w.roughnessMap,Ae=w.anisotropy>0,P=w.clearcoat>0,O=w.dispersion>0,q=w.iridescence>0,de=w.sheen>0,le=w.transmission>0,ie=Ae&&!!w.anisotropyMap,ze=P&&!!w.clearcoatMap,Re=P&&!!w.clearcoatNormalMap,Ye=P&&!!w.clearcoatRoughnessMap,at=q&&!!w.iridescenceMap,we=q&&!!w.iridescenceThicknessMap,Pe=de&&!!w.sheenColorMap,Fe=de&&!!w.sheenRoughnessMap,Y=!!w.specularMap,oe=!!w.specularColorMap,Ge=!!w.specularIntensityMap,j=le&&!!w.transmissionMap,Se=le&&!!w.thicknessMap,Ie=!!w.gradientMap,Ke=!!w.alphaMap,ke=w.alphaTest>0,fe=!!w.alphaHash,qe=!!w.extensions,it=Qr;w.toneMapped&&(te===null||te.isXRRenderTarget===!0)&&(it=n.toneMapping);let rt={shaderID:Q,shaderType:w.type,shaderName:w.name,vertexShader:ne,fragmentShader:he,defines:w.defines,customVertexShaderID:se,customFragmentShaderID:J,isRawShaderMaterial:w.isRawShaderMaterial===!0,glslVersion:w.glslVersion,precision:p,batching:Be,batchingColor:Be&&z._colorsTexture!==null,instancing:Oe,instancingColor:Oe&&z.instanceColor!==null,instancingMorph:Oe&&z.morphTexture!==null,outputColorSpace:te===null?n.outputColorSpace:te.isXRRenderTarget===!0?te.texture.colorSpace:Wo,alphaToCoverage:!!w.alphaToCoverage,map:De,matcap:Ue,envMap:Xe,envMapMode:Xe&&K.mapping,envMapCubeUVHeight:pe,aoMap:ge,lightMap:me,bumpMap:ce,normalMap:Te,displacementMap:F,emissiveMap:He,normalMapObjectSpace:Te&&w.normalMapType===ow,normalMapTangentSpace:Te&&w.normalMapType===ll,metalnessMap:Me,roughnessMap:_e,anisotropy:Ae,anisotropyMap:ie,clearcoat:P,clearcoatMap:ze,clearcoatNormalMap:Re,clearcoatRoughnessMap:Ye,dispersion:O,iridescence:q,iridescenceMap:at,iridescenceThicknessMap:we,sheen:de,sheenColorMap:Pe,sheenRoughnessMap:Fe,specularMap:Y,specularColorMap:oe,specularIntensityMap:Ge,transmission:le,transmissionMap:j,thicknessMap:Se,gradientMap:Ie,opaque:w.transparent===!1&&w.blending===_u&&w.alphaToCoverage===!1,alphaMap:Ke,alphaTest:ke,alphaHash:fe,combine:w.combine,mapUv:De&&y(w.map.channel),aoMapUv:ge&&y(w.aoMap.channel),lightMapUv:me&&y(w.lightMap.channel),bumpMapUv:ce&&y(w.bumpMap.channel),normalMapUv:Te&&y(w.normalMap.channel),displacementMapUv:F&&y(w.displacementMap.channel),emissiveMapUv:He&&y(w.emissiveMap.channel),metalnessMapUv:Me&&y(w.metalnessMap.channel),roughnessMapUv:_e&&y(w.roughnessMap.channel),anisotropyMapUv:ie&&y(w.anisotropyMap.channel),clearcoatMapUv:ze&&y(w.clearcoatMap.channel),clearcoatNormalMapUv:Re&&y(w.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ye&&y(w.clearcoatRoughnessMap.channel),iridescenceMapUv:at&&y(w.iridescenceMap.channel),iridescenceThicknessMapUv:we&&y(w.iridescenceThicknessMap.channel),sheenColorMapUv:Pe&&y(w.sheenColorMap.channel),sheenRoughnessMapUv:Fe&&y(w.sheenRoughnessMap.channel),specularMapUv:Y&&y(w.specularMap.channel),specularColorMapUv:oe&&y(w.specularColorMap.channel),specularIntensityMapUv:Ge&&y(w.specularIntensityMap.channel),transmissionMapUv:j&&y(w.transmissionMap.channel),thicknessMapUv:Se&&y(w.thicknessMap.channel),alphaMapUv:Ke&&y(w.alphaMap.channel),vertexTangents:!!V.attributes.tangent&&(Te||Ae),vertexColors:w.vertexColors,vertexAlphas:w.vertexColors===!0&&!!V.attributes.color&&V.attributes.color.itemSize===4,pointsUvs:z.isPoints===!0&&!!V.attributes.uv&&(De||Ke),fog:!!B,useFog:w.fog===!0,fogExp2:!!B&&B.isFogExp2,flatShading:w.wireframe===!1&&(w.flatShading===!0||V.attributes.normal===void 0&&Te===!1&&(w.isMeshLambertMaterial||w.isMeshPhongMaterial||w.isMeshStandardMaterial||w.isMeshPhysicalMaterial)),sizeAttenuation:w.sizeAttenuation===!0,logarithmicDepthBuffer:m,reversedDepthBuffer:re,skinning:z.isSkinnedMesh===!0,morphTargets:V.morphAttributes.position!==void 0,morphNormals:V.morphAttributes.normal!==void 0,morphColors:V.morphAttributes.color!==void 0,morphTargetsCount:G,morphTextureStride:Z,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:w.dithering,shadowMapEnabled:n.shadowMap.enabled&&L.length>0,shadowMapType:n.shadowMap.type,toneMapping:it,decodeVideoTexture:De&&w.map.isVideoTexture===!0&&Pt.getTransfer(w.map.colorSpace)===rn,decodeVideoTextureEmissive:He&&w.emissiveMap.isVideoTexture===!0&&Pt.getTransfer(w.emissiveMap.colorSpace)===rn,premultipliedAlpha:w.premultipliedAlpha,doubleSided:w.side===Zi,flipSided:w.side===Ni,useDepthPacking:w.depthPacking>=0,depthPacking:w.depthPacking||0,index0AttributeName:w.index0AttributeName,extensionCl
vendor: 6,824 bytes, line 4006
4006ipCullDistance:qe&&w.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(qe&&w.extensions.multiDraw===!0||Be)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:w.customProgramCacheKey()};return rt.vertexUv1s=c.has(1),rt.vertexUv2s=c.has(2),rt.vertexUv3s=c.has(3),c.clear(),rt}function x(w){let R=[];if(w.shaderID?R.push(w.shaderID):(R.push(w.customVertexShaderID),R.push(w.customFragmentShaderID)),w.defines!==void 0)for(let L in w.defines)R.push(L),R.push(w.defines[L]);return w.isRawShaderMaterial===!1&&(_(R,w),b(R,w),R.push(n.outputColorSpace)),R.push(w.customProgramCacheKey),R.join()}function _(w,R){w.push(R.precision),w.push(R.outputColorSpace),w.push(R.envMapMode),w.push(R.envMapCubeUVHeight),w.push(R.mapUv),w.push(R.alphaMapUv),w.push(R.lightMapUv),w.push(R.aoMapUv),w.push(R.bumpMapUv),w.push(R.normalMapUv),w.push(R.displacementMapUv),w.push(R.emissiveMapUv),w.push(R.metalnessMapUv),w.push(R.roughnessMapUv),w.push(R.anisotropyMapUv),w.push(R.clearcoatMapUv),w.push(R.clearcoatNormalMapUv),w.push(R.clearcoatRoughnessMapUv),w.push(R.iridescenceMapUv),w.push(R.iridescenceThicknessMapUv),w.push(R.sheenColorMapUv),w.push(R.sheenRoughnessMapUv),w.push(R.specularMapUv),w.push(R.specularColorMapUv),w.push(R.specularIntensityMapUv),w.push(R.transmissionMapUv),w.push(R.thicknessMapUv),w.push(R.combine),w.push(R.fogExp2),w.push(R.sizeAttenuation),w.push(R.morphTargetsCount),w.push(R.morphAttributeCount),w.push(R.numDirLights),w.push(R.numPointLights),w.push(R.numSpotLights),w.push(R.numSpotLightMaps),w.push(R.numHemiLights),w.push(R.numRectAreaLights),w.push(R.numDirLightShadows),w.push(R.numPointLightShadows),w.push(R.numSpotLightShadows),w.push(R.numSpotLightShadowsWithMaps),w.push(R.numLightProbes),w.push(R.shadowMapType),w.push(R.toneMapping),w.push(R.numClippingPlanes),w.push(R.numClipIntersection),w.push(R.depthPacking)}function b(w,R){o.disableAll(),R.instancing&&o.enable(0),R.instancingColor&&o.enable(1),R.instancingMorph&&o.enable(2),R.matcap&&o.enable(3),R.envMap&&o.enable(4),R.normalMapObjectSpace&&o.enable(5),R.normalMapTangentSpace&&o.enable(6),R.clearcoat&&o.enable(7),R.iridescence&&o.enable(8),R.alphaTest&&o.enable(9),R.vertexColors&&o.enable(10),R.vertexAlphas&&o.enable(11),R.vertexUv1s&&o.enable(12),R.vertexUv2s&&o.enable(13),R.vertexUv3s&&o.enable(14),R.vertexTangents&&o.enable(15),R.anisotropy&&o.enable(16),R.alphaHash&&o.enable(17),R.batching&&o.enable(18),R.dispersion&&o.enable(19),R.batchingColor&&o.enable(20),R.gradientMap&&o.enable(21),w.push(o.mask),o.disableAll(),R.fog&&o.enable(0),R.useFog&&o.enable(1),R.flatShading&&o.enable(2),R.logarithmicDepthBuffer&&o.enable(3),R.reversedDepthBuffer&&o.enable(4),R.skinning&&o.enable(5),R.morphTargets&&o.enable(6),R.morphNormals&&o.enable(7),R.morphColors&&o.enable(8),R.premultipliedAlpha&&o.enable(9),R.shadowMapEnabled&&o.enable(10),R.doubleSided&&o.enable(11),R.flipSided&&o.enable(12),R.useDepthPacking&&o.enable(13),R.dithering&&o.enable(14),R.transmission&&o.enable(15),R.sheen&&o.enable(16),R.opaque&&o.enable(17),R.pointsUvs&&o.enable(18),R.decodeVideoTexture&&o.enable(19),R.decodeVideoTextureEmissive&&o.enable(20),R.alphaToCoverage&&o.enable(21),w.push(o.mask)}function S(w){let R=g[w.type],L;if(R){let I=Za[R];L=Zo.clone(I.uniforms)}else L=w.uniforms;return L}function E(w,R){let L=d.get(R);return L!==void 0?++L.usedTimes:(L=new Y7(n,R,w,r),f.push(L),d.set(R,L)),L}function C(w){if(--w.usedTimes===0){let R=f.indexOf(w);f[R]=f[f.length-1],f.pop(),d.delete(w.cacheKey),w.destroy()}}function D(w){l.remove(w)}function U(){l.dispose()}return{getParameters:T,getProgramCacheKey:x,getUniforms:S,acquireProgram:E,releaseProgram:C,releaseShaderCache:D,programs:f,dispose:U}}function K7(){let n=new WeakMap;function e(o){return n.has(o)}function t(o){let l=n.get(o);return l===void 0&&(l={},n.set(o,l)),l}function i(o){n.delete(o)}function r(o,l,c){n.get(o)[l]=c}function a(){n=new WeakMap}return{has:e,get:t,remove:i,update:r,dispose:a}}function Q7(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.materialVariant!==e.materialVariant?n.materialVariant-e.materialVariant:n.z!==e.z?n.z-e.z:n.id-e.id}function zP(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function kP(){let n=[],e=0,t=[],i=[],r=[];function a(){e=0,t.length=0,i.length=0,r.length=0}function o(p){let g=0;return p.isInstancedMesh&&(g+=2),p.isSkinnedMesh&&(g+=1),g}function l(p,g,y,T,x,_){let b=n[e];return b===void 0?(b={id:p.id,object:p,geometry:g,material:y,materialVariant:o(p),groupOrder:T,renderOrder:p.renderOrder,z:x,group:_},n[e]=b):(b.id=p.id,b.object=p,b.geometry=g,b.material=y,b.materialVariant=o(p),b.groupOrder=T,b.renderOrder=p.renderOrder,b.z=x,b.group=_),e++,b}function c(p,g,y,T,x,_){let b=l(p,g,y,T,x,_);y.transmission>0?i.push(b):y.transparent===!0?r.push(b):t.push(b)}function f(p,g,y,T,x,_){let b=l(p,g,y,T,x,_);y.transmission>0?i.unshift(b):y.transparent===!0?r.unshift(b):t.unshift(b)}function d(p,g){t.length>1&&t.sort(p||Q7),i.length>1&&i.sort(g||zP),r.length>1&&r.sort(g||zP)}function m(){for(let p=e,g=n.length;p<g;p++){let y=n[p];if(y.id===null)break;y.id=null,y.object=null,y.geometry=null,y.material=null,y.group=null}}return{opaque:t,transmissive:i,transparent:r,init:a,push:c,unshift:f,finish:m,sort:d}}function J7(){let n=new WeakMap;function e(i,r){let a=n.get(i),o;return a===void 0?(o=new kP,n.set(i,[o])):r>=a.length?(o=new kP,a.push(o)):o=a[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function $7(){let 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 H,color:new tt};break;case"SpotLight":t={position:new H,direction:new H,color:new tt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new H,color:new tt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new H,skyColor:new tt,groundColor:new tt};break;case"RectAreaLight":t={color:new tt,position:new H,halfWidth:new H,halfHeight:new H};break}return n[e.id]=t,t}}}function e9(){let 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 Le};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Le};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Le,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}var t9=0;
vendor: 5,773 bytes, line 4006
4006function n9(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function i9(n){let e=new $7,t=e9(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let f=0;f<9;f++)i.probe.push(new H);let r=new H,a=new mt,o=new mt;function l(f){let d=0,m=0,p=0;for(let R=0;R<9;R++)i.probe[R].set(0,0,0);let g=0,y=0,T=0,x=0,_=0,b=0,S=0,E=0,C=0,D=0,U=0;f.sort(n9);for(let R=0,L=f.length;R<L;R++){let I=f[R],z=I.color,B=I.intensity,V=I.distance,W=null;if(I.shadow&&I.shadow.map&&(I.shadow.map.texture.format===Nu?W=I.shadow.map.texture:W=I.shadow.map.depthTexture||I.shadow.map.texture),I.isAmbientLight)d+=z.r*B,m+=z.g*B,p+=z.b*B;else if(I.isLightProbe){for(let X=0;X<9;X++)i.probe[X].addScaledVector(I.sh.coefficients[X],B);U++}else if(I.isDirectionalLight){let X=e.get(I);if(X.color.copy(I.color).multiplyScalar(I.intensity),I.castShadow){let K=I.shadow,pe=t.get(I);pe.shadowIntensity=K.intensity,pe.shadowBias=K.bias,pe.shadowNormalBias=K.normalBias,pe.shadowRadius=K.radius,pe.shadowMapSize=K.mapSize,i.directionalShadow[g]=pe,i.directionalShadowMap[g]=W,i.directionalShadowMatrix[g]=I.shadow.matrix,b++}i.directional[g]=X,g++}else if(I.isSpotLight){let X=e.get(I);X.position.setFromMatrixPosition(I.matrixWorld),X.color.copy(z).multiplyScalar(B),X.distance=V,X.coneCos=Math.cos(I.angle),X.penumbraCos=Math.cos(I.angle*(1-I.penumbra)),X.decay=I.decay,i.spot[T]=X;let K=I.shadow;if(I.map&&(i.spotLightMap[C]=I.map,C++,K.updateMatrices(I),I.castShadow&&D++),i.spotLightMatrix[T]=K.matrix,I.castShadow){let pe=t.get(I);pe.shadowIntensity=K.intensity,pe.shadowBias=K.bias,pe.shadowNormalBias=K.normalBias,pe.shadowRadius=K.radius,pe.shadowMapSize=K.mapSize,i.spotShadow[T]=pe,i.spotShadowMap[T]=W,E++}T++}else if(I.isRectAreaLight){let X=e.get(I);X.color.copy(z).multiplyScalar(B),X.halfWidth.set(I.width*.5,0,0),X.halfHeight.set(0,I.height*.5,0),i.rectArea[x]=X,x++}else if(I.isPointLight){let X=e.get(I);if(X.color.copy(I.color).multiplyScalar(I.intensity),X.distance=I.distance,X.decay=I.decay,I.castShadow){let K=I.shadow,pe=t.get(I);pe.shadowIntensity=K.intensity,pe.shadowBias=K.bias,pe.shadowNormalBias=K.normalBias,pe.shadowRadius=K.radius,pe.shadowMapSize=K.mapSize,pe.shadowCameraNear=K.camera.near,pe.shadowCameraFar=K.camera.far,i.pointShadow[y]=pe,i.pointShadowMap[y]=W,i.pointShadowMatrix[y]=I.shadow.matrix,S++}i.point[y]=X,y++}else if(I.isHemisphereLight){let X=e.get(I);X.skyColor.copy(I.color).multiplyScalar(B),X.groundColor.copy(I.groundColor).multiplyScalar(B),i.hemi[_]=X,_++}}x>0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=lt.LTC_FLOAT_1,i.rectAreaLTC2=lt.LTC_FLOAT_2):(i.rectAreaLTC1=lt.LTC_HALF_1,i.rectAreaLTC2=lt.LTC_HALF_2)),i.ambient[0]=d,i.ambient[1]=m,i.ambient[2]=p;let w=i.hash;(w.directionalLength!==g||w.pointLength!==y||w.spotLength!==T||w.rectAreaLength!==x||w.hemiLength!==_||w.numDirectionalShadows!==b||w.numPointShadows!==S||w.numSpotShadows!==E||w.numSpotMaps!==C||w.numLightProbes!==U)&&(i.directional.length=g,i.spot.length=T,i.rectArea.length=x,i.point.length=y,i.hemi.length=_,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=E,i.spotShadowMap.length=E,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=E+C-D,i.spotLightMap.length=C,i.numSpotLightShadowsWithMaps=D,i.numLightProbes=U,w.directionalLength=g,w.pointLength=y,w.spotLength=T,w.rectAreaLength=x,w.hemiLength=_,w.numDirectionalShadows=b,w.numPointShadows=S,w.numSpotShadows=E,w.numSpotMaps=C,w.numLightProbes=U,i.version=t9++)}function c(f,d){let m=0,p=0,g=0,y=0,T=0,x=d.matrixWorldInverse;for(let _=0,b=f.length;_<b;_++){let S=f[_];if(S.isDirectionalLight){let E=i.directional[m];E.direction.setFromMatrixPosition(S.matrixWorld),r.setFromMatrixPosition(S.target.matrixWorld),E.direction.sub(r),E.direction.transformDirection(x),m++}else if(S.isSpotLight){let E=i.spot[g];E.position.setFromMatrixPosition(S.matrixWorld),E.position.applyMatrix4(x),E.direction.setFromMatrixPosition(S.matrixWorld),r.setFromMatrixPosition(S.target.matrixWorld),E.direction.sub(r),E.direction.transformDirection(x),g++}else if(S.isRectAreaLight){let E=i.rectArea[y];E.position.setFromMatrixPosition(S.matrixWorld),E.position.applyMatrix4(x),o.identity(),a.copy(S.matrixWorld),a.premultiply(x),o.extractRotation(a),E.halfWidth.set(S.width*.5,0,0),E.halfHeight.set(0,S.height*.5,0),E.halfWidth.applyMatrix4(o),E.halfHeight.applyMatrix4(o),y++}else if(S.isPointLight){let E=i.point[p];E.position.setFromMatrixPosition(S.matrixWorld),E.position.applyMatrix4(x),p++}else if(S.isHemisphereLight){let E=i.hemi[T];E.direction.setFromMatrixPosition(S.matrixWorld),E.direction.transformDirection(x),T++}}}return{setup:l,setupView:c,state:i}}function FP(n){let e=new i9(n),t=[],i=[];function r(d){f.camera=d,t.length=0,i.length=0}function a(d){t.push(d)}function o(d){i.push(d)}function l(){e.setup(t)}function c(d){e.setupView(t,d)}let f={lightsArray:t,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:f,setupLights:l,setupLightsView:c,pushLight:a,pushShadow:o}}function r9(n){let e=new WeakMap;function t(r,a=0){let o=e.get(r),l;return o===void 0?(l=new FP(n),e.set(r,[l])):a>=o.length?(l=new FP(n),o.push(l)):l=o[a],l}
vendor: 16,488 bytes, lines 4006-4033
4006function i(){e=new WeakMap}return{get:t,dispose:i}}var a9=`void main() {
4007	gl_Position = vec4( position, 1.0 );
4008}`,o9=`uniform sampler2D shadow_pass;
4009uniform vec2 resolution;
4010uniform float radius;
4011void main() {
4012	const float samples = float( VSM_SAMPLES );
4013	float mean = 0.0;
4014	float squared_mean = 0.0;
4015	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
4016	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
4017	for ( float i = 0.0; i < samples; i ++ ) {
4018		float uvOffset = uvStart + i * uvStride;
4019		#ifdef HORIZONTAL_PASS
4020			vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;
4021			mean += distribution.x;
4022			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
4023		#else
4024			float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;
4025			mean += depth;
4026			squared_mean += depth * depth;
4027		#endif
4028	}
4029	mean = mean / samples;
4030	squared_mean = squared_mean / samples;
4031	float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
4032	gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
4033}`,s9=[new H(1,0,0),new H(-1,0,0),new H(0,1,0),new H(0,-1,0),new H(0,0,1),new H(0,0,-1)],l9=[new H(0,-1,0),new H(0,-1,0),new H(0,0,1),new H(0,0,-1),new H(0,-1,0),new H(0,-1,0)],BP=new mt,vv=new H,Aw=new H;function u9(n,e,t){let i=new Ks,r=new Le,a=new Le,o=new Nt,l=new Mu,c=new wu,f={},d=t.maxTextureSize,m={[Go]:Ni,[Ni]:Go,[Zi]:Zi},p=new xi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Le},radius:{value:4}},vertexShader:a9,fragmentShader:o9}),g=p.clone();g.defines.HORIZONTAL_PASS=1;let y=new wt;y.setAttribute("position",new an(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let T=new ln(y,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ou;let _=this.type;this.render=function(D,U,w){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||D.length===0)return;this.type===Jc&&(ot("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Ou);let R=n.getRenderTarget(),L=n.getActiveCubeFace(),I=n.getActiveMipmapLevel(),z=n.state;z.setBlending(To),z.buffers.depth.getReversed()===!0?z.buffers.color.setClear(0,0,0,0):z.buffers.color.setClear(1,1,1,1),z.buffers.depth.setTest(!0),z.setScissorTest(!1);let B=_!==this.type;B&&U.traverse(function(V){V.material&&(Array.isArray(V.material)?V.material.forEach(W=>W.needsUpdate=!0):V.material.needsUpdate=!0)});for(let V=0,W=D.length;V<W;V++){let X=D[V],K=X.shadow;if(K===void 0){ot("WebGLShadowMap:",X,"has no shadow.");continue}if(K.autoUpdate===!1&&K.needsUpdate===!1)continue;r.copy(K.mapSize);let pe=K.getFrameExtents();r.multiply(pe),a.copy(K.mapSize),(r.x>d||r.y>d)&&(r.x>d&&(a.x=Math.floor(d/pe.x),r.x=a.x*pe.x,K.mapSize.x=a.x),r.y>d&&(a.y=Math.floor(d/pe.y),r.y=a.y*pe.y,K.mapSize.y=a.y));let Q=n.state.buffers.depth.getReversed();if(K.camera._reversedDepth=Q,K.map===null||B===!0){if(K.map!==null&&(K.map.depthTexture!==null&&(K.map.depthTexture.dispose(),K.map.depthTexture=null),K.map.dispose()),this.type===al){if(X.isPointLight){ot("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}K.map=new fr(r.x,r.y,{format:Nu,type:wo,minFilter:dn,magFilter:dn,generateMipmaps:!1}),K.map.texture.name=X.name+".shadowMap",K.map.depthTexture=new Qs(r.x,r.y,Yi),K.map.depthTexture.name=X.name+".shadowMapDepth",K.map.depthTexture.format=vo,K.map.depthTexture.compareFunction=null,K.map.depthTexture.minFilter=Yn,K.map.depthTexture.magFilter=Yn}else X.isPointLight?(K.map=new bv(r.x),K.map.depthTexture=new Og(r.x,Ra)):(K.map=new fr(r.x,r.y),K.map.depthTexture=new Qs(r.x,r.y,Ra)),K.map.depthTexture.name=X.name+".shadowMap",K.map.depthTexture.format=vo,this.type===Ou?(K.map.depthTexture.compareFunction=Q?mv:pv,K.map.depthTexture.minFilter=dn,K.map.depthTexture.magFilter=dn):(K.map.depthTexture.compareFunction=null,K.map.depthTexture.minFilter=Yn,K.map.depthTexture.magFilter=Yn);K.camera.updateProjectionMatrix()}let ee=K.map.isWebGLCubeRenderTarget?6:1;for(let G=0;G<ee;G++){if(K.map.isWebGLCubeRenderTarget)n.setRenderTarget(K.map,G),n.clear();else{G===0&&(n.setRenderTarget(K.map),n.clear());let Z=K.getViewport(G);o.set(a.x*Z.x,a.y*Z.y,a.x*Z.z,a.y*Z.w),z.viewport(o)}if(X.isPointLight){let Z=K.camera,ne=K.matrix,he=X.distance||Z.far;he!==Z.far&&(Z.far=he,Z.updateProjectionMatrix()),vv.setFromMatrixPosition(X.matrixWorld),Z.position.copy(vv),Aw.copy(Z.position),Aw.add(s9[G]),Z.up.copy(l9[G]),Z.lookAt(Aw),Z.updateMatrixWorld(),ne.makeTranslation(-vv.x,-vv.y,-vv.z),BP.multiplyMatrices(Z.projectionMatrix,Z.matrixWorldInverse),K._frustum.setFromProjectionMatrix(BP,Z.coordinateSystem,Z.reversedDepth)}else K.updateMatrices(X);i=K.getFrustum(),E(U,w,K.camera,X,this.type)}K.isPointLightShadow!==!0&&this.type===al&&b(K,w),K.needsUpdate=!1}_=this.type,x.needsUpdate=!1,n.setRenderTarget(R,L,I)};function b(D,U){let w=e.update(T);p.defines.VSM_SAMPLES!==D.blurSamples&&(p.defines.VSM_SAMPLES=D.blurSamples,g.defines.VSM_SAMPLES=D.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),D.mapPass===null&&(D.mapPass=new fr(r.x,r.y,{format:Nu,type:wo})),p.uniforms.shadow_pass.value=D.map.depthTexture,p.uniforms.resolution.value=D.mapSize,p.uniforms.radius.value=D.radius,n.setRenderTarget(D.mapPass),n.clear(),n.renderBufferDirect(U,null,w,p,T,null),g.uniforms.shadow_pass.value=D.mapPass.texture,g.uniforms.resolution.value=D.mapSize,g.uniforms.radius.value=D.radius,n.setRenderTarget(D.map),n.clear(),n.renderBufferDirect(U,null,w,g,T,null)}function S(D,U,w,R){let L=null,I=w.isPointLight===!0?D.customDistanceMaterial:D.customDepthMaterial;if(I!==void 0)L=I;else if(L=w.isPointLight===!0?c:l,n.localClippingEnabled&&U.clipShadows===!0&&Array.isArray(U.clippingPlanes)&&U.clippingPlanes.length!==0||U.displacementMap&&U.displacementScale!==0||U.alphaMap&&U.alphaTest>0||U.map&&U.alphaTest>0||U.alphaToCoverage===!0){let z=L.uuid,B=U.uuid,V=f[z];V===void 0&&(V={},f[z]=V);let W=V[B];W===void 0&&(W=L.clone(),V[B]=W,U.addEventListener("dispose",C)),L=W}if(L.visible=U.visible,L.wireframe=U.wireframe,R===al?L.side=U.shadowSide!==null?U.shadowSide:U.side:L.side=U.shadowSide!==null?U.shadowSide:m[U.side],L.alphaMap=U.alphaMap,L.alphaTest=U.alphaToCoverage===!0?.5:U.alphaTest,L.map=U.map,L.clipShadows=U.clipShadows,L.clippingPlanes=U.clippingPlanes,L.clipIntersection=U.clipIntersection,L.displacementMap=U.displacementMap,L.displacementScale=U.displacementScale,L.displacementBias=U.displacementBias,L.wireframeLinewidth=U.wireframeLinewidth,L.linewidth=U.linewidth,w.isPointLight===!0&&L.isMeshDistanceMaterial===!0){let z=n.properties.get(L);z.light=w}return L}function E(D,U,w,R,L){if(D.visible===!1)return;if(D.layers.test(U.layers)&&(D.isMesh||D.isLine||D.isPoints)&&(D.castShadow||D.receiveShadow&&L===al)&&(!D.frustumCulled||i.intersectsObject(D))){D.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,D.matrixWorld);let B=e.update(D),V=D.material;if(Array.isArray(V)){let W=B.groups;for(let X=0,K=W.length;X<K;X++){let pe=W[X],Q=V[pe.materialIndex];if(Q&&Q.visible){let ee=S(D,Q,R,L);D.onBeforeShadow(n,D,U,w,B,ee,pe),n.renderBufferDirect(w,null,B,ee,D,pe),D.onAfterShadow(n,D,U,w,B,ee,pe)}}}else if(V.visible){let W=S(D,V,R,L);D.onBeforeShadow(n,D,U,w,B,W,null),n.renderBufferDirect(w,null,B,W,D,null),D.onAfterShadow(n,D,U,w,B,W,null)}}let z=D.children;for(let B=0,V=z.length;B<V;B++)E(z[B],U,w,R,L)}function C(D){D.target.removeEventListener("dispose",C);for(let w in f){let R=f[w],L=D.target.uuid;L in R&&(R[L].dispose(),delete R[L])}}}function c9(n,e){function t(){let j=!1,Se=new Nt,Ie=null,Ke=new Nt(0,0,0,0);return{setMask:function(ke){Ie!==ke&&!j&&(n.colorMask(ke,ke,ke,ke),Ie=ke)},setLocked:function(ke){j=ke},setClear:function(ke,fe,qe,it,rt){rt===!0&&(ke*=it,fe*=it,qe*=it),Se.set(ke,fe,qe,it),Ke.equals(Se)===!1&&(n.clearColor(ke,fe,qe,it),Ke.copy(Se))},reset:function(){j=!1,Ie=null,Ke.set(-1,0,0,0)}}}function i(){let j=!1,Se=!1,Ie=null,Ke=null,ke=null;return{setReversed:function(fe){if(Se!==fe){let qe=e.get("EXT_clip_control");fe?qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.ZERO_TO_ONE_EXT):qe.clipControlEXT(qe.LOWER_LEFT_EXT,qe.NEGATIVE_ONE_TO_ONE_EXT),Se=fe;let it=ke;ke=null,this.setClear(it)}},getReversed:function(){return Se},setTest:function(fe){fe?te(n.DEPTH_TEST):re(n.DEPTH_TEST)},setMask:function(fe){Ie!==fe&&!j&&(n.depthMask(fe),Ie=fe)},setFunc:function(fe){if(Se&&(fe=cP[fe]),Ke!==fe){switch(fe){case fg:n.depthFunc(n.NEVER);break;case dg:n.depthFunc(n.ALWAYS);break;case hg:n.depthFunc(n.LESS);break;case bu:n.depthFunc(n.LEQUAL);break;case pg:n.depthFunc(n.EQUAL);break;case mg:n.depthFunc(n.GEQUAL);break;case gg:n.depthFunc(n.GREATER);break;case vg:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ke=fe}},setLocked:function(fe){j=fe},setClear:function(fe){ke!==fe&&(ke=fe,Se&&(fe=1-fe),n.clearDepth(fe))},reset:function(){j=!1,Ie=null,Ke=null,ke=null,Se=!1}}}function r(){let j=!1,Se=null,Ie=null,Ke=null,ke=null,fe=null,qe=null,it=null,rt=null;return{setTest:function(dt){j||(dt?te(n.STENCIL_TEST):re(n.STENCIL_TEST))},setMask:function(dt){Se!==dt&&!j&&(n.stencilMask(dt),Se=dt)},setFunc:function(dt,jt,Ht){(Ie!==dt||Ke!==jt||ke!==Ht)&&(n.stencilFunc(dt,jt,Ht),Ie=dt,Ke=jt,ke=Ht)},setOp:function(dt,jt,Ht){(fe!==dt||qe!==jt||it!==Ht)&&(n.stencilOp(dt,jt,Ht),fe=dt,qe=jt,it=Ht)},setLocked:function(dt){j=dt},setClear:function(dt){rt!==dt&&(n.clearStencil(dt),rt=dt)},reset:function(){j=!1,Se=null,Ie=null,Ke=null,ke=null,fe=null,qe=null,it=null,rt=null}}}let a=new t,o=new i,l=new r,c=new WeakMap,f=new WeakMap,d={},m={},p=new WeakMap,g=[],y=null,T=!1,x=null,_=null,b=null,S=null,E=null,C=null,D=null,U=new tt(0,0,0),w=0,R=!1,L=null,I=null,z=null,B=null,V=null,W=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS),X=!1,K=0,pe=n.getParameter(n.VERSION);pe.indexOf("WebGL")!==-1?(K=parseFloat(/^WebGL (\d)/.exec(pe)[1]),X=K>=1):pe.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(pe)[1]),X=K>=2);let Q=null,ee={},G=n.getParameter(n.SCISSOR_BOX),Z=n.getParameter(n.VIEWPORT),ne=new Nt().fromArray(G),he=new Nt().fromArray(Z);function se(j,Se,Ie,Ke){let ke=new Uint8Array(4),fe=n.createTexture();n.bindTexture(j,fe),n.texParameteri(j,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(j,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let qe=0;qe<Ie;qe++)j===n.TEXTURE_3D||j===n.TEXTURE_2D_ARRAY?n.texImage3D(Se,0,n.RGBA,1,1,Ke,0,n.RGBA,n.UNSIGNED_BYTE,ke):n.texImage2D(Se+qe,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,ke);return fe}let J={};J[n.TEXTURE_2D]=se(n.TEXTURE_2D,n.TEXTURE_2D,1),J[n.TEXTURE_CUBE_MAP]=se(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),J[n.TEXTURE_2D_ARRAY]=se(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),J[n.TEXTURE_3D]=se(n.TEXTURE_3D,n.TEXTURE_3D,1,1),a.setClear(0,0,0,1),o.setClear(1),l.setClear(0),te(n.DEPTH_TEST),o.setFunc(bu),ce(!1),Te(Vx),te(n.CULL_FACE),ge(To);function te(j){d[j]!==!0&&(n.enable(j),d[j]=!0)}function re(j){d[j]!==!1&&(n.disable(j),d[j]=!1)}function Oe(j,Se){return m[j]!==Se?(n.bindFramebuffer(j,Se),m[j]=Se,j===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=Se),j===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=Se),!0):!1}function Be(j,Se){let Ie=g,Ke=!1;if(j){Ie=p.get(Se),Ie===void 0&&(Ie=[],p.set(Se,Ie));let ke=j.textures;if(Ie.length!==ke.length||Ie[0]!==n.COLOR_ATTACHMENT0){for(let fe=0,qe=ke.length;fe<qe;fe++)Ie[fe]=n.COLOR_ATTACHMENT0+fe;Ie.length=ke.length,Ke=!0}}else Ie[0]!==n.BACK&&(Ie[0]=n.BACK,Ke=!0);Ke&&n.drawBuffers(Ie)}function De(j){return y!==j?(n.useProgram(j),y=j,!0):!1}let Ue={[Zs]:n.FUNC_ADD,[I2]:n.FUNC_SUBTRACT,[z2]:n.FUNC_REVERSE_SUBTRACT};Ue[k2]=n.MIN,Ue[F2]=n.MAX;let Xe={[B2]:n.ZERO,[H2]:n.ONE,[V2]:n.SRC_COLOR,[ug]:n.SRC_ALPHA,[j2]:n.SRC_ALPHA_SATURATE,[q2]:n.DST_COLOR,[W2]:n.DST_ALPHA,[G2]:n.ONE_MINUS_SRC_COLOR,[cg]:n.ONE_MINUS_SRC_ALPHA,[Y2]:n.ONE_MINUS_DST_COLOR,[X2]:n.ONE_MINUS_DST_ALPHA,[Z2]:n.CONSTANT_COLOR,[K2]:n.ONE_MINUS_CONSTANT_COLOR,[Q2]:n.CONSTANT_ALPHA,[J2]:n.ONE_MINUS_CONSTANT_ALPHA};function ge(j,Se,Ie,Ke,ke,fe,qe,it,rt,dt){if(j===To){T===!0&&(re(n.BLEND),T=!1);return}if(T===!1&&(te(n.BLEND),T=!0),j!==P2){if(j!==x||dt!==R){if((_!==Zs||E!==Zs)&&(n.blendEquation(n.FUNC_ADD),_=Zs,E=Zs),dt)switch(j){case _u:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Wx:n.blendFunc(n.ONE,n.ONE);break;case Xx:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case qx:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:pt("WebGLState: Invalid blending: ",j);break}else switch(j){case _u:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Wx:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case Xx:pt("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case qx:pt("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:pt("WebGLState: Invalid blending: ",j);break}b=null,S=null,C=null,D=null,U.set(0,0,0),w=0,x=j,R=dt}return}ke=ke||Se,fe=fe||Ie,qe=qe||Ke,(Se!==_||ke!==E)&&(n.blendEquationSeparate(Ue[Se],Ue[ke]),_=Se,E=ke),(Ie!==b||Ke!==S||fe!==C||qe!==D)&&(n.blendFuncSeparate(Xe[Ie],Xe[Ke],Xe[fe],Xe[qe]),b=Ie,S=Ke,C=fe,D=qe),(it.equals(U)===!1||rt!==w)&&(n.blendColor(it.r,it.g,it.b,rt),U.copy(it),w=rt),x=j,R=!1}function me(j,Se){j.side===Zi?re(n.CULL_FACE):te(n.CULL_FACE);let Ie=j.side===Ni;Se&&(Ie=!Ie),ce(Ie),j.blending===_u&&j.transparent===!1?ge(To):ge(j.blending,j.blendEquation,j.blendSrc,j.blendDst,j.blendEquationAlpha,j.blendSrcAlpha,j.blendDstAlpha,j.blendColor,j.blendAlpha,j.premultipliedAlpha),o.setFunc(j.depthFunc),o.setTest(j.depthTest),o.setMask(j.depthWrite),a.setMask(j.colorWrite);let Ke=j.stencilWrite;l.setTest(Ke),Ke&&(l.setMask(j.stencilWriteMask),l.setFunc(j.stencilFunc,j.stencilRef,j.stencilFuncMask),l.setOp(j.stencilFail,j.stencilZFail,j.stencilZPass)),He(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits),j.alphaToCoverage===!0?te(n.SAMPLE_ALPHA_TO_COVERAGE):re(n.SAMPLE_ALPHA_TO_COVERAGE)}function ce(j){L!==j&&(j?n.frontFace(n.CW):n.frontFace(n.CCW),L=j)}function Te(j){j!==L2?(te(n.CULL_FACE),j!==I&&(j===Vx?n.cullFace(n.BACK):j===N2?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):re(n.CULL_FACE),I=j}function F(j){j!==z&&(X&&n.lineWidth(j),z=j)}function He(j,Se,Ie){j?(te(n.POLYGON_OFFSET_FILL),(B!==Se||V!==Ie)&&(B=Se,V=Ie,o.getReversed()&&(Se=-Se),n.polygonOffset(Se,Ie))):re(n.POLYGON_OFFSET_FILL)}function Me(j){j?te(n.SCISSOR_TEST):re(n.SCISSOR_TEST)}function _e(j){j===void 0&&(j=n.TEXTURE0+W-1),Q!==j&&(n.activeTexture(j),Q=j)}function Ae(j,Se,Ie){Ie===void 0&&(Q===null?Ie=n.TEXTURE0+W-1:Ie=Q);let Ke=ee[Ie];Ke===void 0&&(Ke={type:void 0,texture:void 0},ee[Ie]=Ke),(Ke.type!==j||Ke.texture!==Se)&&(Q!==Ie&&(n.activeTexture(Ie),Q=Ie),n.bindTexture(j,Se||J[j]),Ke.type=j,Ke.texture=Se)}function P(){let j=ee[Q];j!==void 0&&j.type!==void 0&&(n.bindTexture(j.type,null),j.type=void 0,j.texture=void 0)}function O(){try{n.compressedTexImage2D(...arguments)}catch(j){pt("WebGLState:",j)}}function q(){try{n.compressedTexImage3D(...arguments)}catch(j){pt("WebGLState:",j)}}function de(){try{n.texSubImage2D(...arguments)}catch(j){pt("WebGLState:",j)}}function le(){try{n.texSubImage3D(...arguments)}catch(j){pt("WebGLState:",j)}}function ie(){try{n.compressedTexSubImage2D(...arguments)}catch(j){pt("WebGLState:",j)}}function ze(){try{n.compressedTexSubImage3D(...arguments)}catch(j){pt("WebGLState:",j)}}function Re(){try{n.texStorage2D(...arguments)}catch(j){pt("WebGLState:",j)}}function Ye(){try{n.texStorage3D(...arguments)}catch(j){pt("WebGLState:",j)}}function at(){try{n.texImage2D(...arguments)}catch(j){pt("WebGLState:",j)}}function we(){try{n.texImage3D(...arguments)}catch(j){pt("WebGLState:",j)}}function Pe(j){ne.equals(j)===!1&&(n.scissor(j.x,j.y,j.z,j.w),ne.copy(j))}function Fe(j){he.equals(j)===!1&&(n.viewport(j.x,j.y,j.z,j.w),he.copy(j))}function Y(j,Se){let Ie=f.get(Se);Ie===void 0&&(Ie=new WeakMap,f.set(Se,Ie));let Ke=Ie.get(j);Ke===void 0&&(Ke=n.getUniformBlockIndex(Se,j.name),Ie.set(j,Ke))}function oe(j,Se){let Ke=f.get(Se).get(j);c.get(Se)!==Ke&&(n.uniformBlockBinding(Se,Ke,j.__bindingPointIndex),c.set(Se,Ke))}function Ge(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor
vendor: 16,413 bytes, line 4033
4033(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),o.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),d={},Q=null,ee={},m={},p=new WeakMap,g=[],y=null,T=!1,x=null,_=null,b=null,S=null,E=null,C=null,D=null,U=new tt(0,0,0),w=0,R=!1,L=null,I=null,z=null,B=null,V=null,ne.set(0,0,n.canvas.width,n.canvas.height),he.set(0,0,n.canvas.width,n.canvas.height),a.reset(),o.reset(),l.reset()}return{buffers:{color:a,depth:o,stencil:l},enable:te,disable:re,bindFramebuffer:Oe,drawBuffers:Be,useProgram:De,setBlending:ge,setMaterial:me,setFlipSided:ce,setCullFace:Te,setLineWidth:F,setPolygonOffset:He,setScissorTest:Me,activeTexture:_e,bindTexture:Ae,unbindTexture:P,compressedTexImage2D:O,compressedTexImage3D:q,texImage2D:at,texImage3D:we,updateUBOMapping:Y,uniformBlockBinding:oe,texStorage2D:Re,texStorage3D:Ye,texSubImage2D:de,texSubImage3D:le,compressedTexSubImage2D:ie,compressedTexSubImage3D:ze,scissor:Pe,viewport:Fe,reset:Ge}}function f9(n,e,t,i,r,a,o){let l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new Le,d=new WeakMap,m,p=new WeakMap,g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(P,O){return g?new OffscreenCanvas(P,O):gh("canvas")}function T(P,O,q){let de=1,le=Ae(P);if((le.width>q||le.height>q)&&(de=q/Math.max(le.width,le.height)),de<1)if(typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&P instanceof ImageBitmap||typeof VideoFrame<"u"&&P instanceof VideoFrame){let ie=Math.floor(de*le.width),ze=Math.floor(de*le.height);m===void 0&&(m=y(ie,ze));let Re=O?y(ie,ze):m;return Re.width=ie,Re.height=ze,Re.getContext("2d").drawImage(P,0,0,ie,ze),ot("WebGLRenderer: Texture has been resized from ("+le.width+"x"+le.height+") to ("+ie+"x"+ze+")."),Re}else return"data"in P&&ot("WebGLRenderer: Image in DataTexture is too big ("+le.width+"x"+le.height+")."),P;return P}function x(P){return P.generateMipmaps}function _(P){n.generateMipmap(P)}function b(P){return P.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:P.isWebGL3DRenderTarget?n.TEXTURE_3D:P.isWebGLArrayRenderTarget||P.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function S(P,O,q,de,le=!1){if(P!==null){if(n[P]!==void 0)return n[P];ot("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+P+"'")}let ie=O;if(O===n.RED&&(q===n.FLOAT&&(ie=n.R32F),q===n.HALF_FLOAT&&(ie=n.R16F),q===n.UNSIGNED_BYTE&&(ie=n.R8)),O===n.RED_INTEGER&&(q===n.UNSIGNED_BYTE&&(ie=n.R8UI),q===n.UNSIGNED_SHORT&&(ie=n.R16UI),q===n.UNSIGNED_INT&&(ie=n.R32UI),q===n.BYTE&&(ie=n.R8I),q===n.SHORT&&(ie=n.R16I),q===n.INT&&(ie=n.R32I)),O===n.RG&&(q===n.FLOAT&&(ie=n.RG32F),q===n.HALF_FLOAT&&(ie=n.RG16F),q===n.UNSIGNED_BYTE&&(ie=n.RG8)),O===n.RG_INTEGER&&(q===n.UNSIGNED_BYTE&&(ie=n.RG8UI),q===n.UNSIGNED_SHORT&&(ie=n.RG16UI),q===n.UNSIGNED_INT&&(ie=n.RG32UI),q===n.BYTE&&(ie=n.RG8I),q===n.SHORT&&(ie=n.RG16I),q===n.INT&&(ie=n.RG32I)),O===n.RGB_INTEGER&&(q===n.UNSIGNED_BYTE&&(ie=n.RGB8UI),q===n.UNSIGNED_SHORT&&(ie=n.RGB16UI),q===n.UNSIGNED_INT&&(ie=n.RGB32UI),q===n.BYTE&&(ie=n.RGB8I),q===n.SHORT&&(ie=n.RGB16I),q===n.INT&&(ie=n.RGB32I)),O===n.RGBA_INTEGER&&(q===n.UNSIGNED_BYTE&&(ie=n.RGBA8UI),q===n.UNSIGNED_SHORT&&(ie=n.RGBA16UI),q===n.UNSIGNED_INT&&(ie=n.RGBA32UI),q===n.BYTE&&(ie=n.RGBA8I),q===n.SHORT&&(ie=n.RGBA16I),q===n.INT&&(ie=n.RGBA32I)),O===n.RGB&&(q===n.UNSIGNED_INT_5_9_9_9_REV&&(ie=n.RGB9_E5),q===n.UNSIGNED_INT_10F_11F_11F_REV&&(ie=n.R11F_G11F_B10F)),O===n.RGBA){let ze=le?ph:Pt.getTransfer(de);q===n.FLOAT&&(ie=n.RGBA32F),q===n.HALF_FLOAT&&(ie=n.RGBA16F),q===n.UNSIGNED_BYTE&&(ie=ze===rn?n.SRGB8_ALPHA8:n.RGBA8),q===n.UNSIGNED_SHORT_4_4_4_4&&(ie=n.RGBA4),q===n.UNSIGNED_SHORT_5_5_5_1&&(ie=n.RGB5_A1)}return(ie===n.R16F||ie===n.R32F||ie===n.RG16F||ie===n.RG32F||ie===n.RGBA16F||ie===n.RGBA32F)&&e.get("EXT_color_buffer_float"),ie}function E(P,O){let q;return P?O===null||O===Ra||O===nf?q=n.DEPTH24_STENCIL8:O===Yi?q=n.DEPTH32F_STENCIL8:O===tf&&(q=n.DEPTH24_STENCIL8,ot("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):O===null||O===Ra||O===nf?q=n.DEPTH_COMPONENT24:O===Yi?q=n.DEPTH_COMPONENT32F:O===tf&&(q=n.DEPTH_COMPONENT16),q}function C(P,O){return x(P)===!0||P.isFramebufferTexture&&P.minFilter!==Yn&&P.minFilter!==dn?Math.log2(Math.max(O.width,O.height))+1:P.mipmaps!==void 0&&P.mipmaps.length>0?P.mipmaps.length:P.isCompressedTexture&&Array.isArray(P.image)?O.mipmaps.length:1}function D(P){let O=P.target;O.removeEventListener("dispose",D),w(O),O.isVideoTexture&&d.delete(O)}function U(P){let O=P.target;O.removeEventListener("dispose",U),L(O)}function w(P){let O=i.get(P);if(O.__webglInit===void 0)return;let q=P.source,de=p.get(q);if(de){let le=de[O.__cacheKey];le.usedTimes--,le.usedTimes===0&&R(P),Object.keys(de).length===0&&p.delete(q)}i.remove(P)}function R(P){let O=i.get(P);n.deleteTexture(O.__webglTexture);let q=P.source,de=p.get(q);delete de[O.__cacheKey],o.memory.textures--}function L(P){let O=i.get(P);if(P.depthTexture&&(P.depthTexture.dispose(),i.remove(P.depthTexture)),P.isWebGLCubeRenderTarget)for(let de=0;de<6;de++){if(Array.isArray(O.__webglFramebuffer[de]))for(let le=0;le<O.__webglFramebuffer[de].length;le++)n.deleteFramebuffer(O.__webglFramebuffer[de][le]);else n.deleteFramebuffer(O.__webglFramebuffer[de]);O.__webglDepthbuffer&&n.deleteRenderbuffer(O.__webglDepthbuffer[de])}else{if(Array.isArray(O.__webglFramebuffer))for(let de=0;de<O.__webglFramebuffer.length;de++)n.deleteFramebuffer(O.__webglFramebuffer[de]);else n.deleteFramebuffer(O.__webglFramebuffer);if(O.__webglDepthbuffer&&n.deleteRenderbuffer(O.__webglDepthbuffer),O.__webglMultisampledFramebuffer&&n.deleteFramebuffer(O.__webglMultisampledFramebuffer),O.__webglColorRenderbuffer)for(let de=0;de<O.__webglColorRenderbuffer.length;de++)O.__webglColorRenderbuffer[de]&&n.deleteRenderbuffer(O.__webglColorRenderbuffer[de]);O.__webglDepthRenderbuffer&&n.deleteRenderbuffer(O.__webglDepthRenderbuffer)}let q=P.textures;for(let de=0,le=q.length;de<le;de++){let ie=i.get(q[de]);ie.__webglTexture&&(n.deleteTexture(ie.__webglTexture),o.memory.textures--),i.remove(q[de])}i.remove(P)}let I=0;function z(){I=0}function B(){let P=I;return P>=r.maxTextures&&ot("WebGLTextures: Trying to use "+P+" texture units while this GPU supports only "+r.maxTextures),I+=1,P}function V(P){let O=[];return O.push(P.wrapS),O.push(P.wrapT),O.push(P.wrapR||0),O.push(P.magFilter),O.push(P.minFilter),O.push(P.anisotropy),O.push(P.internalFormat),O.push(P.format),O.push(P.type),O.push(P.generateMipmaps),O.push(P.premultiplyAlpha),O.push(P.flipY),O.push(P.unpackAlignment),O.push(P.colorSpace),O.join()}function W(P,O){let q=i.get(P);if(P.isVideoTexture&&Me(P),P.isRenderTargetTexture===!1&&P.isExternalTexture!==!0&&P.version>0&&q.__version!==P.version){let de=P.image;if(de===null)ot("WebGLRenderer: Texture marked for update but no image data found.");else if(de.complete===!1)ot("WebGLRenderer: Texture marked for update but image is incomplete");else{J(q,P,O);return}}else P.isExternalTexture&&(q.__webglTexture=P.sourceTexture?P.sourceTexture:null);t.bindTexture(n.TEXTURE_2D,q.__webglTexture,n.TEXTURE0+O)}function X(P,O){let q=i.get(P);if(P.isRenderTargetTexture===!1&&P.version>0&&q.__version!==P.version){J(q,P,O);return}else P.isExternalTexture&&(q.__webglTexture=P.sourceTexture?P.sourceTexture:null);t.bindTexture(n.TEXTURE_2D_ARRAY,q.__webglTexture,n.TEXTURE0+O)}function K(P,O){let q=i.get(P);if(P.isRenderTargetTexture===!1&&P.version>0&&q.__version!==P.version){J(q,P,O);return}t.bindTexture(n.TEXTURE_3D,q.__webglTexture,n.TEXTURE0+O)}function pe(P,O){let q=i.get(P);if(P.isCubeDepthTexture!==!0&&P.version>0&&q.__version!==P.version){te(q,P,O);return}t.bindTexture(n.TEXTURE_CUBE_MAP,q.__webglTexture,n.TEXTURE0+O)}let Q={[ch]:n.REPEAT,[Mr]:n.CLAMP_TO_EDGE,[fh]:n.MIRRORED_REPEAT},ee={[Yn]:n.NEAREST,[$x]:n.NEAREST_MIPMAP_NEAREST,[ef]:n.NEAREST_MIPMAP_LINEAR,[dn]:n.LINEAR,[Zh]:n.LINEAR_MIPMAP_NEAREST,[Mo]:n.LINEAR_MIPMAP_LINEAR},G={[sw]:n.NEVER,[dw]:n.ALWAYS,[lw]:n.LESS,[pv]:n.LEQUAL,[uw]:n.EQUAL,[mv]:n.GEQUAL,[cw]:n.GREATER,[fw]:n.NOTEQUAL};function Z(P,O){if(O.type===Yi&&e.has("OES_texture_float_linear")===!1&&(O.magFilter===dn||O.magFilter===Zh||O.magFilter===ef||O.magFilter===Mo||O.minFilter===dn||O.minFilter===Zh||O.minFilter===ef||O.minFilter===Mo)&&ot("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(P,n.TEXTURE_WRAP_S,Q[O.wrapS]),n.texParameteri(P,n.TEXTURE_WRAP_T,Q[O.wrapT]),(P===n.TEXTURE_3D||P===n.TEXTURE_2D_ARRAY)&&n.texParameteri(P,n.TEXTURE_WRAP_R,Q[O.wrapR]),n.texParameteri(P,n.TEXTURE_MAG_FILTER,ee[O.magFilter]),n.texParameteri(P,n.TEXTURE_MIN_FILTER,ee[O.minFilter]),O.compareFunction&&(n.texParameteri(P,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(P,n.TEXTURE_COMPARE_FUNC,G[O.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(O.magFilter===Yn||O.minFilter!==ef&&O.minFilter!==Mo||O.type===Yi&&e.has("OES_texture_float_linear")===!1)return;if(O.anisotropy>1||i.get(O).__currentAnisotropy){let q=e.get("EXT_texture_filter_anisotropic");n.texParameterf(P,q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(O.anisotropy,r.getMaxAnisotropy())),i.get(O).__currentAnisotropy=O.anisotropy}}}function ne(P,O){let q=!1;P.__webglInit===void 0&&(P.__webglInit=!0,O.addEventListener("dispose",D));let de=O.source,le=p.get(de);le===void 0&&(le={},p.set(de,le));let ie=V(O);if(ie!==P.__cacheKey){le[ie]===void 0&&(le[ie]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,q=!0),le[ie].usedTimes++;let ze=le[P.__cacheKey];ze!==void 0&&(le[P.__cacheKey].usedTimes--,ze.usedTimes===0&&R(O)),P.__cacheKey=ie,P.__webglTexture=le[ie].texture}return q}function he(P,O,q){return Math.floor(Math.floor(P/q)/O)}function se(P,O,q,de){let ie=P.updateRanges;if(ie.length===0)t.texSubImage2D(n.TEXTURE_2D,0,0,0,O.width,O.height,q,de,O.data);else{ie.sort((we,Pe)=>we.start-Pe.start);let ze=0;for(let we=1;we<ie.length;we++){let Pe=ie[ze],Fe=ie[we],Y=Pe.start+Pe.count,oe=he(Fe.start,O.width,4),Ge=he(Pe.start,O.width,4);Fe.start<=Y+1&&oe===Ge&&he(Fe.start+Fe.count-1,O.width,4)===oe?Pe.count=Math.max(Pe.count,Fe.start+Fe.count-Pe.start):(++ze,ie[ze]=Fe)}ie.length=ze+1;let Re=n.getParameter(n.UNPACK_ROW_LENGTH),Ye=n.getParameter(n.UNPACK_SKIP_PIXELS),at=n.getParameter(n.UNPACK_SKIP_ROWS);n.pixelStorei(n.UNPACK_ROW_LENGTH,O.width);for(let we=0,Pe=ie.length;we<Pe;we++){let Fe=ie[we],Y=Math.floor(Fe.start/4),oe=Math.ceil(Fe.count/4),Ge=Y%O.width,j=Math.floor(Y/O.width),Se=oe,Ie=1;n.pixelStorei(n.UNPACK_SKIP_PIXELS,Ge),n.pixelStorei(n.UNPACK_SKIP_ROWS,j),t.texSubImage2D(n.TEXTURE_2D,0,Ge,j,Se,Ie,q,de,O.data)}P.clearUpdateRanges(),n.pixelStorei(n.UNPACK_ROW_LENGTH,Re),n.pixelStorei(n.UNPACK_SKIP_PIXELS,Ye),n.pixelStorei(n.UNPACK_SKIP_ROWS,at)}}function J(P,O,q){let de=n.TEXTURE_2D;(O.isDataArrayTexture||O.isCompressedArrayTexture)&&(de=n.TEXTURE_2D_ARRAY),O.isData3DTexture&&(de=n.TEXTURE_3D);let le=ne(P,O),ie=O.source;t.bindTexture(de,P.__webglTexture,n.TEXTURE0+q);let ze=i.get(ie);if(ie.version!==ze.__version||le===!0){t.activeTexture(n.TEXTURE0+q);let Re=Pt.getPrimaries(Pt.workingColorSpace),Ye=O.colorSpace===jo?null:Pt.getPrimaries(O.colorSpace),at=O.colorSpace===jo||Re===Ye?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,O.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,O.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,at);let we=T(O.image,!1,r.maxTextureSize);we=_e(O,we);let Pe=a.convert(O.format,O.colorSpace),Fe=a.convert(O.type),Y=S(O.internalFormat,Pe,Fe,O.colorSpace,O.isVideoTexture);Z(de,O);let oe,Ge=O.mipmaps,j=O.isVideoTexture!==!0,Se=ze.__version===void 0||le===!0,Ie=ie.dataReady,Ke=C(O,we);if(O.isDepthTexture)Y=E(O.format===sl,O.type),Se&&(j?t.texStorage2D(n.TEXTURE_2D,1,Y,we.width,we.height):t.texImage2D(n.TEXTURE_2D,0,Y,we.width,we.height,0,Pe,Fe,null));else if(O.isDataTexture)if(Ge.length>0){j&&Se&&t.texStorage2D(n.TEXTURE_2D,Ke,Y,Ge[0].width,Ge[0].height);for(let ke=0,fe=Ge.length;ke<fe;ke++)oe=Ge[ke],j?Ie&&t.texSubImage2D(n.TEXTURE_2D,ke,0,0,oe.width,oe.height,Pe,Fe,oe.data):t.texImage2D(n.TEXTURE_2D,ke,Y,oe.width,oe.height,0,Pe,Fe,oe.data);O.generateMipmaps=!1}else j?(Se&&t.texStorage2D(n.TEXTURE_2D,Ke,Y,we.width,we.height),Ie&&se(O,we,Pe,Fe)):t.texImage2D(n.TEXTURE_2D,0,Y,we.width,we.height,0,Pe,Fe,we.data);else if(O.isCompressedTexture)if(O.isCompressedArrayTexture){j&&Se&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Ke,Y,Ge[0].width,Ge[0].height,we.depth);for(let ke=0,fe=Ge.length;ke<fe;ke++)if(oe=Ge[ke],O.format!==_i)if(Pe!==null)if(j){if(Ie)if(O.layerUpdates.size>0){let qe=u1(oe.width,oe.height,O.format,O.type);for(let it of O.layerUpdates){let rt=oe.data.subarray(it*qe/oe.data.BYTES_PER_ELEMENT,(it+1)*qe/oe.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ke,0,0,it,oe.width,oe.height,1,Pe,rt)}O.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,ke,0,0,0,oe.width,oe.height,we.depth,Pe,oe.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,ke,Y,oe.width,oe.height,we.depth,0,oe.data,0,0);else ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else j?Ie&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,ke,0,0,0,oe.width,oe.height,we.depth,Pe,Fe,oe.data):t.texImage3D(n.TEXTURE_2D_ARRAY,ke,Y,oe.width,oe.height,we.depth,0,Pe,Fe,oe.data)}else{j&&Se&&t.texStorage2D(n.TEXTURE_2D,Ke,Y,Ge[0].width,Ge[0].height);for(let ke=0,fe=Ge.length;ke<fe;ke++)oe=Ge[ke],O.format!==_i?Pe!==null?j?Ie&&t.compressedTexSubImage2D(n.TEXTURE_2D,ke,0,0,oe.width,oe.height,Pe,oe.data):t.compressedTexImage2D(n.TEXTURE_2D,ke,Y,oe.width,oe.height,0,oe.data):ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):j?Ie&&t.texSubImage2D(n.TEXTURE_2D,ke,0,0,oe.width,oe.height,Pe,Fe,oe.data):t.texImage2D(n.TEXTURE_2D,ke,Y,oe.width,oe.height,0,Pe,Fe,oe.data)}else if(O.isDataArrayTexture)if(j){if(Se&&t.texStorage3D(n.TEXTURE_2D_ARRAY,Ke,Y,we.width,we.height,we.depth),Ie)if(O.layerUpdates.size>0){let ke=u1(we.width,we.height,O.format,O.type);for(let fe of O.layerUpdates){let qe=we.data.subarray(fe*ke/we.data.BYTES_PER_ELEMENT,(fe+1)*ke/we.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,fe,we.width,we.height,1,Pe,Fe,qe)}O.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,we.width,we.height,we.depth,Pe,Fe,we.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Y,we.width,we.height,we.depth,0,Pe,Fe,we.data);else if(O.isData3DTexture)j?(Se&&t.texStorage3D(n.TEXTURE_3D,Ke,Y,we.width,we.height,we.depth),Ie&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,we.width,we.height,we.depth,Pe,Fe,we.data)):t.texImage3D(n.TEXTURE_3D,0,Y,we.width,we.height,we.depth,0,Pe,Fe,we.data);else if(O.isFramebufferTexture){if(Se)if(j)t.texStorage2D(n.TEXTURE_2D,Ke,Y,we.width,we.height);else{let ke=we.width,fe=we.height;for(let qe=0;qe<Ke;qe++)t.texImage2D(n.TEXTURE_2D,qe,Y,ke,fe,0,Pe,Fe,null),ke>>=1,fe>>=1}}else if(Ge.length>0){if(j&&Se){let ke=Ae(Ge[0]);t.texStorage2D(n.TEXTURE_2D,Ke,Y,ke.width,ke.height)}for(let ke=0,fe=Ge.length;ke<fe;ke++)oe=Ge[ke],j?Ie&&t.texSubImage2D(n.TEXTURE_2D,ke,0,0,Pe,Fe,oe):t.texImage2D(n.TEXTURE_2D,ke,Y,Pe,Fe,oe);O.generateMipmaps=!1}else if(j){if(Se){let ke=Ae(we);t.texStorage2D(n.TEXTURE_2D,Ke,Y,ke.width,ke.height)}Ie&&t.texSubImage2D(n.TEXTURE_2D,0,0,0,Pe,Fe,we)}else t.texImage2D(n.TEXTURE_2D,0,Y,Pe,Fe,we);x(O)&&_(de),ze.__version=ie.version,O.onUpdate&&O.onUpdate(O)}P.__version=O.version}function te(P,O,q){if(O.image.length!==6)return;let de=ne(P,O),le=O.source;t.bindTexture(n.TEXTURE_CUBE_MAP,P.__webglTexture,n.TEXTURE0+q);let ie=i.get(le);if(le.version!==ie.__version||de===!0){t.activeTexture(n.TEXTURE0+q);
vendor: 14,371 bytes, line 4033
4033let ze=Pt.getPrimaries(Pt.workingColorSpace),Re=O.colorSpace===jo?null:Pt.getPrimaries(O.colorSpace),Ye=O.colorSpace===jo||ze===Re?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,O.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,O.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,O.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ye);let at=O.isCompressedTexture||O.image[0].isCompressedTexture,we=O.image[0]&&O.image[0].isDataTexture,Pe=[];for(let fe=0;fe<6;fe++)!at&&!we?Pe[fe]=T(O.image[fe],!0,r.maxCubemapSize):Pe[fe]=we?O.image[fe].image:O.image[fe],Pe[fe]=_e(O,Pe[fe]);let Fe=Pe[0],Y=a.convert(O.format,O.colorSpace),oe=a.convert(O.type),Ge=S(O.internalFormat,Y,oe,O.colorSpace),j=O.isVideoTexture!==!0,Se=ie.__version===void 0||de===!0,Ie=le.dataReady,Ke=C(O,Fe);Z(n.TEXTURE_CUBE_MAP,O);let ke;if(at){j&&Se&&t.texStorage2D(n.TEXTURE_CUBE_MAP,Ke,Ge,Fe.width,Fe.height);for(let fe=0;fe<6;fe++){ke=Pe[fe].mipmaps;for(let qe=0;qe<ke.length;qe++){let it=ke[qe];O.format!==_i?Y!==null?j?Ie&&t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,qe,0,0,it.width,it.height,Y,it.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,qe,Ge,it.width,it.height,0,it.data):ot("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):j?Ie&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,qe,0,0,it.width,it.height,Y,oe,it.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,qe,Ge,it.width,it.height,0,Y,oe,it.data)}}}else{if(ke=O.mipmaps,j&&Se){ke.length>0&&Ke++;let fe=Ae(Pe[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Ke,Ge,fe.width,fe.height)}for(let fe=0;fe<6;fe++)if(we){j?Ie&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,0,0,0,Pe[fe].width,Pe[fe].height,Y,oe,Pe[fe].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,0,Ge,Pe[fe].width,Pe[fe].height,0,Y,oe,Pe[fe].data);for(let qe=0;qe<ke.length;qe++){let rt=ke[qe].image[fe].image;j?Ie&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,qe+1,0,0,rt.width,rt.height,Y,oe,rt.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,qe+1,Ge,rt.width,rt.height,0,Y,oe,rt.data)}}else{j?Ie&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,0,0,0,Y,oe,Pe[fe]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,0,Ge,Y,oe,Pe[fe]);for(let qe=0;qe<ke.length;qe++){let it=ke[qe];j?Ie&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,qe+1,0,0,Y,oe,it.image[fe]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+fe,qe+1,Ge,Y,oe,it.image[fe])}}}x(O)&&_(n.TEXTURE_CUBE_MAP),ie.__version=le.version,O.onUpdate&&O.onUpdate(O)}P.__version=O.version}function re(P,O,q,de,le,ie){let ze=a.convert(q.format,q.colorSpace),Re=a.convert(q.type),Ye=S(q.internalFormat,ze,Re,q.colorSpace),at=i.get(O),we=i.get(q);if(we.__renderTarget=O,!at.__hasExternalTextures){let Pe=Math.max(1,O.width>>ie),Fe=Math.max(1,O.height>>ie);le===n.TEXTURE_3D||le===n.TEXTURE_2D_ARRAY?t.texImage3D(le,ie,Ye,Pe,Fe,O.depth,0,ze,Re,null):t.texImage2D(le,ie,Ye,Pe,Fe,0,ze,Re,null)}t.bindFramebuffer(n.FRAMEBUFFER,P),He(O)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,de,le,we.__webglTexture,0,F(O)):(le===n.TEXTURE_2D||le>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&le<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,de,le,we.__webglTexture,ie),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Oe(P,O,q){if(n.bindRenderbuffer(n.RENDERBUFFER,P),O.depthBuffer){let de=O.depthTexture,le=de&&de.isDepthTexture?de.type:null,ie=E(O.stencilBuffer,le),ze=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;He(O)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,F(O),ie,O.width,O.height):q?n.renderbufferStorageMultisample(n.RENDERBUFFER,F(O),ie,O.width,O.height):n.renderbufferStorage(n.RENDERBUFFER,ie,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ze,n.RENDERBUFFER,P)}else{let de=O.textures;for(let le=0;le<de.length;le++){let ie=de[le],ze=a.convert(ie.format,ie.colorSpace),Re=a.convert(ie.type),Ye=S(ie.internalFormat,ze,Re,ie.colorSpace);He(O)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,F(O),Ye,O.width,O.height):q?n.renderbufferStorageMultisample(n.RENDERBUFFER,F(O),Ye,O.width,O.height):n.renderbufferStorage(n.RENDERBUFFER,Ye,O.width,O.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function Be(P,O,q){let de=O.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(n.FRAMEBUFFER,P),!(O.depthTexture&&O.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");let le=i.get(O.depthTexture);if(le.__renderTarget=O,(!le.__webglTexture||O.depthTexture.image.width!==O.width||O.depthTexture.image.height!==O.height)&&(O.depthTexture.image.width=O.width,O.depthTexture.image.height=O.height,O.depthTexture.needsUpdate=!0),de){if(le.__webglInit===void 0&&(le.__webglInit=!0,O.depthTexture.addEventListener("dispose",D)),le.__webglTexture===void 0){le.__webglTexture=n.createTexture(),t.bindTexture(n.TEXTURE_CUBE_MAP,le.__webglTexture),Z(n.TEXTURE_CUBE_MAP,O.depthTexture);let at=a.convert(O.depthTexture.format),we=a.convert(O.depthTexture.type),Pe;O.depthTexture.format===vo?Pe=n.DEPTH_COMPONENT24:O.depthTexture.format===sl&&(Pe=n.DEPTH24_STENCIL8);for(let Fe=0;Fe<6;Fe++)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Fe,0,Pe,O.width,O.height,0,at,we,null)}}else W(O.depthTexture,0);let ie=le.__webglTexture,ze=F(O),Re=de?n.TEXTURE_CUBE_MAP_POSITIVE_X+q:n.TEXTURE_2D,Ye=O.depthTexture.format===sl?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;if(O.depthTexture.format===vo)He(O)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Ye,Re,ie,0,ze):n.framebufferTexture2D(n.FRAMEBUFFER,Ye,Re,ie,0);else if(O.depthTexture.format===sl)He(O)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Ye,Re,ie,0,ze):n.framebufferTexture2D(n.FRAMEBUFFER,Ye,Re,ie,0);else throw new Error("Unknown depthTexture format")}function De(P){let O=i.get(P),q=P.isWebGLCubeRenderTarget===!0;if(O.__boundDepthTexture!==P.depthTexture){let de=P.depthTexture;if(O.__depthDisposeCallback&&O.__depthDisposeCallback(),de){let le=()=>{delete O.__boundDepthTexture,delete O.__depthDisposeCallback,de.removeEventListener("dispose",le)};de.addEventListener("dispose",le),O.__depthDisposeCallback=le}O.__boundDepthTexture=de}if(P.depthTexture&&!O.__autoAllocateDepthBuffer)if(q)for(let de=0;de<6;de++)Be(O.__webglFramebuffer[de],P,de);else{let de=P.texture.mipmaps;de&&de.length>0?Be(O.__webglFramebuffer[0],P,0):Be(O.__webglFramebuffer,P,0)}else if(q){O.__webglDepthbuffer=[];for(let de=0;de<6;de++)if(t.bindFramebuffer(n.FRAMEBUFFER,O.__webglFramebuffer[de]),O.__webglDepthbuffer[de]===void 0)O.__webglDepthbuffer[de]=n.createRenderbuffer(),Oe(O.__webglDepthbuffer[de],P,!1);else{let le=P.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ie=O.__webglDepthbuffer[de];n.bindRenderbuffer(n.RENDERBUFFER,ie),n.framebufferRenderbuffer(n.FRAMEBUFFER,le,n.RENDERBUFFER,ie)}}else{let de=P.texture.mipmaps;if(de&&de.length>0?t.bindFramebuffer(n.FRAMEBUFFER,O.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,O.__webglFramebuffer),O.__webglDepthbuffer===void 0)O.__webglDepthbuffer=n.createRenderbuffer(),Oe(O.__webglDepthbuffer,P,!1);else{let le=P.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ie=O.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,ie),n.framebufferRenderbuffer(n.FRAMEBUFFER,le,n.RENDERBUFFER,ie)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ue(P,O,q){let de=i.get(P);O!==void 0&&re(de.__webglFramebuffer,P,P.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),q!==void 0&&De(P)}function Xe(P){let O=P.texture,q=i.get(P),de=i.get(O);P.addEventListener("dispose",U);let le=P.textures,ie=P.isWebGLCubeRenderTarget===!0,ze=le.length>1;if(ze||(de.__webglTexture===void 0&&(de.__webglTexture=n.createTexture()),de.__version=O.version,o.memory.textures++),ie){q.__webglFramebuffer=[];for(let Re=0;Re<6;Re++)if(O.mipmaps&&O.mipmaps.length>0){q.__webglFramebuffer[Re]=[];for(let Ye=0;Ye<O.mipmaps.length;Ye++)q.__webglFramebuffer[Re][Ye]=n.createFramebuffer()}else q.__webglFramebuffer[Re]=n.createFramebuffer()}else{if(O.mipmaps&&O.mipmaps.length>0){q.__webglFramebuffer=[];for(let Re=0;Re<O.mipmaps.length;Re++)q.__webglFramebuffer[Re]=n.createFramebuffer()}else q.__webglFramebuffer=n.createFramebuffer();if(ze)for(let Re=0,Ye=le.length;Re<Ye;Re++){let at=i.get(le[Re]);at.__webglTexture===void 0&&(at.__webglTexture=n.createTexture(),o.memory.textures++)}if(P.samples>0&&He(P)===!1){q.__webglMultisampledFramebuffer=n.createFramebuffer(),q.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,q.__webglMultisampledFramebuffer);for(let Re=0;Re<le.length;Re++){let Ye=le[Re];q.__webglColorRenderbuffer[Re]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,q.__webglColorRenderbuffer[Re]);let at=a.convert(Ye.format,Ye.colorSpace),we=a.convert(Ye.type),Pe=S(Ye.internalFormat,at,we,Ye.colorSpace,P.isXRRenderTarget===!0),Fe=F(P);n.renderbufferStorageMultisample(n.RENDERBUFFER,Fe,Pe,P.width,P.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Re,n.RENDERBUFFER,q.__webglColorRenderbuffer[Re])}n.bindRenderbuffer(n.RENDERBUFFER,null),P.depthBuffer&&(q.__webglDepthRenderbuffer=n.createRenderbuffer(),Oe(q.__webglDepthRenderbuffer,P,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(ie){t.bindTexture(n.TEXTURE_CUBE_MAP,de.__webglTexture),Z(n.TEXTURE_CUBE_MAP,O);for(let Re=0;Re<6;Re++)if(O.mipmaps&&O.mipmaps.length>0)for(let Ye=0;Ye<O.mipmaps.length;Ye++)re(q.__webglFramebuffer[Re][Ye],P,O,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,Ye);else re(q.__webglFramebuffer[Re],P,O,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0);x(O)&&_(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ze){for(let Re=0,Ye=le.length;Re<Ye;Re++){let at=le[Re],we=i.get(at),Pe=n.TEXTURE_2D;(P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(Pe=P.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(Pe,we.__webglTexture),Z(Pe,at),re(q.__webglFramebuffer,P,at,n.COLOR_ATTACHMENT0+Re,Pe,0),x(at)&&_(Pe)}t.unbindTexture()}else{let Re=n.TEXTURE_2D;if((P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(Re=P.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),t.bindTexture(Re,de.__webglTexture),Z(Re,O),O.mipmaps&&O.mipmaps.length>0)for(let Ye=0;Ye<O.mipmaps.length;Ye++)re(q.__webglFramebuffer[Ye],P,O,n.COLOR_ATTACHMENT0,Re,Ye);else re(q.__webglFramebuffer,P,O,n.COLOR_ATTACHMENT0,Re,0);x(O)&&_(Re),t.unbindTexture()}P.depthBuffer&&De(P)}function ge(P){let O=P.textures;for(let q=0,de=O.length;q<de;q++){let le=O[q];if(x(le)){let ie=b(P),ze=i.get(le).__webglTexture;t.bindTexture(ie,ze),_(ie),t.unbindTexture()}}}let me=[],ce=[];function Te(P){if(P.samples>0){if(He(P)===!1){let O=P.textures,q=P.width,de=P.height,le=n.COLOR_BUFFER_BIT,ie=P.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ze=i.get(P),Re=O.length>1;if(Re)for(let at=0;at<O.length;at++)t.bindFramebuffer(n.FRAMEBUFFER,ze.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+at,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,ze.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+at,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,ze.__webglMultisampledFramebuffer);let Ye=P.texture.mipmaps;Ye&&Ye.length>0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ze.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ze.__webglFramebuffer);for(let at=0;at<O.length;at++){if(P.resolveDepthBuffer&&(P.depthBuffer&&(le|=n.DEPTH_BUFFER_BIT),P.stencilBuffer&&P.resolveStencilBuffer&&(le|=n.STENCIL_BUFFER_BIT)),Re){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,ze.__webglColorRenderbuffer[at]);let we=i.get(O[at]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,we,0)}n.blitFramebuffer(0,0,q,de,0,0,q,de,le,n.NEAREST),c===!0&&(me.length=0,ce.length=0,me.push(n.COLOR_ATTACHMENT0+at),P.depthBuffer&&P.resolveDepthBuffer===!1&&(me.push(ie),ce.push(ie),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,ce)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,me))}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),Re)for(let at=0;at<O.length;at++){t.bindFramebuffer(n.FRAMEBUFFER,ze.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+at,n.RENDERBUFFER,ze.__webglColorRenderbuffer[at]);let we=i.get(O[at]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,ze.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+at,n.TEXTURE_2D,we,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ze.__webglMultisampledFramebuffer)}else if(P.depthBuffer&&P.resolveDepthBuffer===!1&&c){let O=P.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[O])}}}function F(P){return Math.min(r.maxSamples,P.samples)}function He(P){let O=i.get(P);return P.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&O.__useRenderToTexture!==!1}function Me(P){let O=o.render.frame;d.get(P)!==O&&(d.set(P,O),P.update())}function _e(P,O){let q=P.colorSpace,de=P.format,le=P.type;return P.isCompressedTexture===!0||P.isVideoTexture===!0||q!==Wo&&q!==jo&&(Pt.getTransfer(q)===rn?(de!==_i||le!==Ki)&&ot("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):pt("WebGLTextures: Unsupported texture color space:",q)),O}function Ae(P){return typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement?(f.width=P.naturalWidth||P.width,f.height=P.naturalHeight||P.height):typeof VideoFrame<"u"&&P instanceof VideoFrame?(f.width=P.displayWidth,f.height=P.displayHeight):(f.width=P.width,f.height=P.height),f}this.allocateTextureUnit=B,this.resetTextureUnits=z,this.setTexture2D=W,this.setTexture2DArray=X,this.setTexture3D=K,this.setTextureCube=pe,this.rebindTextures=Ue,this.setupRenderTarget=Xe,this.updateRenderTargetMipmap=ge,this.updateMultisampleRenderTarget=Te,this.setupDepthRenderbuffer=De,this.setupFrameBufferTexture=re,this.useMultisampledRTT=He,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function qP(n,e){function t(i,r=jo){let a,o=Pt.getTransfer(r);if(i===Ki)return n.UNSIGNED_BYTE;if(i===D0)return n.UNSIGNED_SHORT_4_4_4_4;if(i===U0)return n.UNSIGNED_SHORT_5_5_5_1;if(i===n1)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===i1)return n.UNSIGNED_INT_10F_11F_11F_REV;if(i===e1)return n.BYTE;if(i===t1)return n.SHORT;if(i===tf)return n.UNSIGNED_SHORT;if(i===R0)return n.INT;
vendor: 14,052 bytes, lines 4033-4057
4033if(i===Ra)return n.UNSIGNED_INT;if(i===Yi)return n.FLOAT;if(i===wo)return n.HALF_FLOAT;if(i===r1)return n.ALPHA;if(i===a1)return n.RGB;if(i===_i)return n.RGBA;if(i===vo)return n.DEPTH_COMPONENT;if(i===sl)return n.DEPTH_STENCIL;if(i===O0)return n.RED;if(i===Kh)return n.RED_INTEGER;if(i===Nu)return n.RG;if(i===L0)return n.RG_INTEGER;if(i===N0)return n.RGBA_INTEGER;if(i===Qh||i===Jh||i===$h||i===ep)if(o===rn)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(i===Qh)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Jh)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===$h)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===ep)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(i===Qh)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Jh)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===$h)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===ep)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===P0||i===I0||i===z0||i===k0)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(i===P0)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===I0)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===z0)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===k0)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===F0||i===B0||i===H0||i===V0||i===G0||i===W0||i===X0)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(i===F0||i===B0)return o===rn?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(i===H0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC;if(i===V0)return a.COMPRESSED_R11_EAC;if(i===G0)return a.COMPRESSED_SIGNED_R11_EAC;if(i===W0)return a.COMPRESSED_RG11_EAC;if(i===X0)return a.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===q0||i===Y0||i===j0||i===Z0||i===K0||i===Q0||i===J0||i===$0||i===ev||i===tv||i===nv||i===iv||i===rv||i===av)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(i===q0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Y0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===j0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Z0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===K0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===Q0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===J0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===$0)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===ev)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===tv)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===nv)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===iv)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===rv)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===av)return o===rn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===ov||i===sv||i===lv)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(i===ov)return o===rn?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===sv)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===lv)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===uv||i===cv||i===fv||i===dv)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(i===uv)return a.COMPRESSED_RED_RGTC1_EXT;if(i===cv)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===fv)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===dv)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===nf?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}var d9=`
4034void main() {
4035
4036	gl_Position = vec4( position, 1.0 );
4037
4038}`,h9=`
4039uniform sampler2DArray depthColor;
4040uniform float depthWidth;
4041uniform float depthHeight;
4042
4043void main() {
4044
4045	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
4046
4047	if ( coord.x >= 1.0 ) {
4048
4049		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
4050
4051	} else {
4052
4053		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
4054
4055	}
4056
4057}`,Pw=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let i=new Mh(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,i=new xi({vertexShader:d9,fragmentShader:h9,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ln(new xo(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Iw=class extends wa{constructor(e,t){super();let i=this,r=null,a=1,o=null,l="local-floor",c=1,f=null,d=null,m=null,p=null,g=null,y=null,T=typeof XRWebGLBinding<"u",x=new Pw,_={},b=t.getContextAttributes(),S=null,E=null,C=[],D=[],U=new Le,w=null,R=new Tn;R.viewport=new Nt;let L=new Tn;L.viewport=new Nt;let I=[R,L],z=new T0,B=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(J){let te=C[J];return te===void 0&&(te=new Bc,C[J]=te),te.getTargetRaySpace()},this.getControllerGrip=function(J){let te=C[J];return te===void 0&&(te=new Bc,C[J]=te),te.getGripSpace()},this.getHand=function(J){let te=C[J];return te===void 0&&(te=new Bc,C[J]=te),te.getHandSpace()};function W(J){let te=D.indexOf(J.inputSource);if(te===-1)return;let re=C[te];re!==void 0&&(re.update(J.inputSource,J.frame,f||o),re.dispatchEvent({type:J.type,data:J.inputSource}))}function X(){r.removeEventListener("select",W),r.removeEventListener("selectstart",W),r.removeEventListener("selectend",W),r.removeEventListener("squeeze",W),r.removeEventListener("squeezestart",W),r.removeEventListener("squeezeend",W),r.removeEventListener("end",X),r.removeEventListener("inputsourceschange",K);for(let J=0;J<C.length;J++){let te=D[J];te!==null&&(D[J]=null,C[J].disconnect(te))}B=null,V=null,x.reset();for(let J in _)delete _[J];e.setRenderTarget(S),g=null,p=null,m=null,r=null,E=null,se.stop(),i.isPresenting=!1,e.setPixelRatio(w),e.setSize(U.width,U.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(J){a=J,i.isPresenting===!0&&ot("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(J){l=J,i.isPresenting===!0&&ot("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||o},this.setReferenceSpace=function(J){f=J},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return m===null&&T&&(m=new XRWebGLBinding(r,t)),m},this.getFrame=function(){return y},this.getSession=function(){return r},this.setSession=async function(J){if(r=J,r!==null){if(S=e.getRenderTarget(),r.addEventListener("select",W),r.addEventListener("selectstart",W),r.addEventListener("selectend",W),r.addEventListener("squeeze",W),r.addEventListener("squeezestart",W),r.addEventListener("squeezeend",W),r.addEventListener("end",X),r.addEventListener("inputsourceschange",K),b.xrCompatible!==!0&&await t.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(U),T&&"createProjectionLayer"in XRWebGLBinding.prototype){let re=null,Oe=null,Be=null;b.depth&&(Be=b.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,re=b.stencil?sl:vo,Oe=b.stencil?nf:Ra);let De={colorFormat:t.RGBA8,depthFormat:Be,scaleFactor:a};m=this.getBinding(),p=m.createProjectionLayer(De),r.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),E=new fr(p.textureWidth,p.textureHeight,{format:_i,type:Ki,depthTexture:new Qs(p.textureWidth,p.textureHeight,Oe,void 0,void 0,void 0,void 0,void 0,void 0,re),stencilBuffer:b.stencil,colorSpace:e.outputColorSpace,samples:b.antialias?4:0,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}else{let re={antialias:b.antialias,alpha:!0,depth:b.depth,stencil:b.stencil,framebufferScaleFactor:a};g=new XRWebGLLayer(r,t,re),r.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),E=new fr(g.framebufferWidth,g.framebufferHeight,{format:_i,type:Ki,colorSpace:e.outputColorSpace,stencilBuffer:b.stencil,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}E.isXRRenderTarget=!0,this.setFoveation(c),f=null,o=await r.requestReferenceSpace(l),se.setContext(r),se.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};function K(J){for(let te=0;te<J.removed.length;te++){let re=J.removed[te],Oe=D.indexOf(re);Oe>=0&&(D[Oe]=null,C[Oe].disconnect(re))}for(let te=0;te<J.added.length;te++){let re=J.added[te],Oe=D.indexOf(re);if(Oe===-1){for(let De=0;De<C.length;De++)if(De>=D.length){D.push(re),Oe=De;break}else if(D[De]===null){D[De]=re,Oe=De;break}if(Oe===-1)break}let Be=C[Oe];Be&&Be.connect(re)}}let pe=new H,Q=new H;function ee(J,te,re){pe.setFromMatrixPosition(te.matrixWorld),Q.setFromMatrixPosition(re.matrixWorld);let Oe=pe.distanceTo(Q),Be=te.projectionMatrix.elements,De=re.projectionMatrix.elements,Ue=Be[14]/(Be[10]-1),Xe=Be[14]/(Be[10]+1),ge=(Be[9]+1)/Be[5],me=(Be[9]-1)/Be[5],ce=(Be[8]-1)/Be[0],Te=(De[8]+1)/De[0],F=Ue*ce,He=Ue*Te,Me=Oe/(-ce+Te),_e=Me*-ce;if(te.matrixWorld.decompose(J.position,J.quaternion,J.scale),J.translateX(_e),J.translateZ(Me),J.matrixWorld.compose(J.position,J.quaternion,J.scale),J.matrixWorldInverse.copy(J.matrixWorld).invert(),Be[10]===-1)J.projectionMatrix.copy(te.projectionMatrix),J.projectionMatrixInverse.copy(te.projectionMatrixInverse);else{let Ae=Ue+Me,P=Xe+Me,O=F-_e,q=He+(Oe-_e),de=ge*Xe/P*Ae,le=me*Xe/P*Ae;J.projectionMatrix.makePerspective(O,q,de,le,Ae,P),J.projectionMatrixInverse.copy(J.projectionMatrix).invert()}}function G(J,te){te===null?J.matrixWorld.copy(J.matrix):J.matrixWorld.multiplyMatrices(te.matrixWorld,J.matrix),J.matrixWorldInverse.copy(J.matrixWorld).invert()}this.updateCamera=function(J){if(r===null)return;let te=J.near,re=J.far;x.texture!==null&&(x.depthNear>0&&(te=x.depthNear),x.depthFar>0&&(re=x.depthFar)),z.near=L.near=R.near=te,z.far=L.far=R.far=re,(B!==z.near||V!==z.far)&&(r.updateRenderState({depthNear:z.near,depthFar:z.far}),B=z.near,V=z.far),z.layers.mask=J.layers.mask|6,R.layers.mask=z.layers.mask&-5,L.layers.mask=z.layers.mask&-3;let Oe=J.parent,Be=z.cameras;G(z,Oe);for(let De=0;De<Be.length;De++)G(Be[De],Oe);Be.length===2?ee(z,R,L):z.projectionMatrix.copy(R.projectionMatrix),Z(J,z,Oe)};function Z(J,te,re){re===null?J.matrix.copy(te.matrixWorld):(J.matrix.copy(re.matrixWorld),J.matrix.invert(),J.matrix.multiply(te.matrixWorld)),J.matrix.decompose(J.position,J.quaternion,J.scale),J.updateMatrixWorld(!0),J.projectionMatrix.copy(te.projectionMatrix),J.projectionMatrixInverse.copy(te.projectionMatrixInverse),J.isPerspectiveCamera&&(J.fov=zc*2*Math.atan(1/J.projectionMatrix.elements[5]),J.zoom=1)}this.getCamera=function(){return z},this.getFoveation=function(){if(!(p===null&&g===null))return c},this.setFoveation=function(J){c=J,p!==null&&(p.fixedFoveation=J),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=J)},this.hasDepthSensing=function(){return x.texture!==null},this.getDepthSensingMesh=function(){return x.getMesh(z)},this.getCameraTexture=function(J){return _[J]};let ne=null;function he(J,te){if(d=te.getViewerPose(f||o),y=te,d!==null){let re=d.views;g!==null&&(e.setRenderTargetFramebuffer(E,g.framebuffer),e.setRenderTarget(E));let Oe=!1;re.length!==z.cameras.length&&(z.cameras.length=0,Oe=!0);for(let Xe=0;Xe<re.length;Xe++){let ge=re[Xe],me=null;if(g!==null)me=g.getViewport(ge);else{let Te=m.getViewSubImage(p,ge);me=Te.viewport,Xe===0&&(e.setRenderTargetTextures(E,Te.colorTexture,Te.depthStencilTexture),e.setRenderTarget(E))}let ce=I[Xe];ce===void 0&&(ce=new Tn,ce.layers.enable(Xe),ce.viewport=new Nt,I[Xe]=ce),ce.matrix.fromArray(ge.transform.matrix),ce.matrix.decompose(ce.position,ce.quaternion,ce.scale),ce.projectionMatrix.fromArray(ge.projectionMatrix),ce.projectionMatrixInverse.copy(ce.projectionMatrix).invert(),ce.viewport.set(me.x,me.y,me.width,me.height),Xe===0&&(z.matrix.copy(ce.matrix),z.matrix.decompose(z.position,z.quaternion,z.scale)),Oe===!0&&z.cameras.push(ce)}let Be=r.enabledFeatures;if(Be&&Be.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&T){m=i.getBinding();let Xe=m.getDepthInformation(re[0]);Xe&&Xe.isValid&&Xe.texture&&x.init(Xe,r.renderState)}if(Be&&Be.includes("camera-access")&&T){e.state.unbindTexture(),m=i.getBinding();for(let Xe=0;Xe<re.length;Xe++){let ge=re[Xe].camera;if(ge){let me=_[ge];me||(me=new Mh,_[ge]=me);let ce=m.getCameraImage(ge);me.sourceTexture=ce}}}}for(let re=0;re<C.length;re++){let Oe=D[re],Be=C[re];Oe!==null&&Be!==void 0&&Be.update(Oe,te,f||o)}ne&&ne(J,te),te.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:te}),y=null}let se=new HP;se.setAnimationLoop(he),this.setAnimationLoop=function(J){ne=J},this.dispose=function(){}}},of=new jr,p9=new mt;function m9(n,e){function t(x,_){x.matrixAutoUpdate===!0&&x.updateMatrix(),_.value.copy(x.matrix)}function i(x,_){_.color.getRGB(x.fogColor.value,vw(n)),_.isFog?(x.fogNear.value=_.near,x.fogFar.value=_.far):_.isFogExp2&&(x.fogDensity.value=_.density)}function r(x,_,b,S,E){_.isMeshBasicMaterial?a(x,_):_.isMeshLambertMaterial?(a(x,_),_.envMap&&(x.envMapIntensity.value=_.envMapIntensity)):_.isMeshToonMaterial?(a(x,_),m(x,_)):_.isMeshPhongMaterial?(a(x,_),d(x,_),_.envMap&&(x.envMapIntensity.value=_.envMapIntensity)):_.isMeshStandardMaterial?(a(x,_),p(x,_),_.isMeshPhysicalMaterial&&g(x,_,E)):_.isMeshMat
4057capMaterial?(a(x,_),y(x,_)):_.isMeshDepthMaterial?a(x,_):_.isMeshDistanceMaterial?(a(x,_),T(x,_)):_.isMeshNormalMaterial?a(x,_):_.isLineBasicMaterial?(o(x,_),_.isLineDashedMaterial&&l(x,_)):_.isPointsMaterial?c(x,_,b,S):_.isSpriteMaterial?f(x,_):_.isShadowMaterial?(x.color.value.copy(_.color),x.opacity.value=_.opacity):_.isShaderMaterial&&(_.uniformsNeedUpdate=!1)}function a(x,_){x.opacity.value=_.opacity,_.color&&x.diffuse.value.copy(_.color),_.emissive&&x.emissive.value.copy(_.emissive).multiplyScalar(_.emissiveIntensity),_.map&&(x.map.value=_.map,t(_.map,x.mapTransform)),_.alphaMap&&(x.alphaMap.value=_.alphaMap,t(_.alphaMap,x.alphaMapTransform)),_.bumpMap&&(x.bumpMap.value=_.bumpMap,t(_.bumpMap,x.bumpMapTransform),x.bumpScale.value=_.bumpScale,_.side===Ni&&(x.bumpScale.value*=-1)),_.normalMap&&(x.normalMap.value=_.normalMap,t(_.normalMap,x.normalMapTransform),x.normalScale.value.copy(_.normalScale),_.side===Ni&&x.normalScale.value.negate()),_.displacementMap&&(x.displacementMap.value=_.displacementMap,t(_.displacementMap,x.displacementMapTransform),x.displacementScale.value=_.displacementScale,x.displacementBias.value=_.displacementBias),_.emissiveMap&&(x.emissiveMap.value=_.emissiveMap,t(_.emissiveMap,x.emissiveMapTransform)),_.specularMap&&(x.specularMap.value=_.specularMap,t(_.specularMap,x.specularMapTransform)),_.alphaTest>0&&(x.alphaTest.value=_.alphaTest);let b=e.get(_),S=b.envMap,E=b.envMapRotation;S&&(x.envMap.value=S,of.copy(E),of.x*=-1,of.y*=-1,of.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(of.y*=-1,of.z*=-1),x.envMapRotation.value.setFromMatrix4(p9.makeRotationFromEuler(of)),x.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=_.reflectivity,x.ior.value=_.ior,x.refractionRatio.value=_.refractionRatio),_.lightMap&&(x.lightMap.value=_.lightMap,x.lightMapIntensity.value=_.lightMapIntensity,t(_.lightMap,x.lightMapTransform)),_.ao
vendor: 26,247 bytes, line 4057
4057Map&&(x.aoMap.value=_.aoMap,x.aoMapIntensity.value=_.aoMapIntensity,t(_.aoMap,x.aoMapTransform))}function o(x,_){x.diffuse.value.copy(_.color),x.opacity.value=_.opacity,_.map&&(x.map.value=_.map,t(_.map,x.mapTransform))}function l(x,_){x.dashSize.value=_.dashSize,x.totalSize.value=_.dashSize+_.gapSize,x.scale.value=_.scale}function c(x,_,b,S){x.diffuse.value.copy(_.color),x.opacity.value=_.opacity,x.size.value=_.size*b,x.scale.value=S*.5,_.map&&(x.map.value=_.map,t(_.map,x.uvTransform)),_.alphaMap&&(x.alphaMap.value=_.alphaMap,t(_.alphaMap,x.alphaMapTransform)),_.alphaTest>0&&(x.alphaTest.value=_.alphaTest)}function f(x,_){x.diffuse.value.copy(_.color),x.opacity.value=_.opacity,x.rotation.value=_.rotation,_.map&&(x.map.value=_.map,t(_.map,x.mapTransform)),_.alphaMap&&(x.alphaMap.value=_.alphaMap,t(_.alphaMap,x.alphaMapTransform)),_.alphaTest>0&&(x.alphaTest.value=_.alphaTest)}function d(x,_){x.specular.value.copy(_.specular),x.shininess.value=Math.max(_.shininess,1e-4)}function m(x,_){_.gradientMap&&(x.gradientMap.value=_.gradientMap)}function p(x,_){x.metalness.value=_.metalness,_.metalnessMap&&(x.metalnessMap.value=_.metalnessMap,t(_.metalnessMap,x.metalnessMapTransform)),x.roughness.value=_.roughness,_.roughnessMap&&(x.roughnessMap.value=_.roughnessMap,t(_.roughnessMap,x.roughnessMapTransform)),_.envMap&&(x.envMapIntensity.value=_.envMapIntensity)}function g(x,_,b){x.ior.value=_.ior,_.sheen>0&&(x.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),x.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(x.sheenColorMap.value=_.sheenColorMap,t(_.sheenColorMap,x.sheenColorMapTransform)),_.sheenRoughnessMap&&(x.sheenRoughnessMap.value=_.sheenRoughnessMap,t(_.sheenRoughnessMap,x.sheenRoughnessMapTransform))),_.clearcoat>0&&(x.clearcoat.value=_.clearcoat,x.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(x.clearcoatMap.value=_.clearcoatMap,t(_.clearcoatMap,x.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,t(_.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(x.clearcoatNormalMap.value=_.clearcoatNormalMap,t(_.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===Ni&&x.clearcoatNormalScale.value.negate())),_.dispersion>0&&(x.dispersion.value=_.dispersion),_.iridescence>0&&(x.iridescence.value=_.iridescence,x.iridescenceIOR.value=_.iridescenceIOR,x.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(x.iridescenceMap.value=_.iridescenceMap,t(_.iridescenceMap,x.iridescenceMapTransform)),_.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=_.iridescenceThicknessMap,t(_.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),_.transmission>0&&(x.transmission.value=_.transmission,x.transmissionSamplerMap.value=b.texture,x.transmissionSamplerSize.value.set(b.width,b.height),_.transmissionMap&&(x.transmissionMap.value=_.transmissionMap,t(_.transmissionMap,x.transmissionMapTransform)),x.thickness.value=_.thickness,_.thicknessMap&&(x.thicknessMap.value=_.thicknessMap,t(_.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=_.attenuationDistance,x.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(x.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(x.anisotropyMap.value=_.anisotropyMap,t(_.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=_.specularIntensity,x.specularColor.value.copy(_.specularColor),_.specularColorMap&&(x.specularColorMap.value=_.specularColorMap,t(_.specularColorMap,x.specularColorMapTransform)),_.specularIntensityMap&&(x.specularIntensityMap.value=_.specularIntensityMap,t(_.specularIntensityMap,x.specularIntensityMapTransform))}function y(x,_){_.matcap&&(x.matcap.value=_.matcap)}function T(x,_){let b=e.get(_).light;x.referencePosition.value.setFromMatrixPosition(b.matrixWorld),x.nearDistance.value=b.shadow.camera.near,x.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function g9(n,e,t,i){let r={},a={},o=[],l=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function c(b,S){let E=S.program;i.uniformBlockBinding(b,E)}function f(b,S){let E=r[b.id];E===void 0&&(y(b),E=d(b),r[b.id]=E,b.addEventListener("dispose",x));let C=S.program;i.updateUBOMapping(b,C);let D=e.render.frame;a[b.id]!==D&&(p(b),a[b.id]=D)}function d(b){let S=m();b.__bindingPointIndex=S;let E=n.createBuffer(),C=b.__size,D=b.usage;return n.bindBuffer(n.UNIFORM_BUFFER,E),n.bufferData(n.UNIFORM_BUFFER,C,D),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,E),E}function m(){for(let b=0;b<l;b++)if(o.indexOf(b)===-1)return o.push(b),b;return pt("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(b){let S=r[b.id],E=b.uniforms,C=b.__cache;n.bindBuffer(n.UNIFORM_BUFFER,S);for(let D=0,U=E.length;D<U;D++){let w=Array.isArray(E[D])?E[D]:[E[D]];for(let R=0,L=w.length;R<L;R++){let I=w[R];if(g(I,D,R,C)===!0){let z=I.__offset,B=Array.isArray(I.value)?I.value:[I.value],V=0;for(let W=0;W<B.length;W++){let X=B[W],K=T(X);typeof X=="number"||typeof X=="boolean"?(I.__data[0]=X,n.bufferSubData(n.UNIFORM_BUFFER,z+V,I.__data)):X.isMatrix3?(I.__data[0]=X.elements[0],I.__data[1]=X.elements[1],I.__data[2]=X.elements[2],I.__data[3]=0,I.__data[4]=X.elements[3],I.__data[5]=X.elements[4],I.__data[6]=X.elements[5],I.__data[7]=0,I.__data[8]=X.elements[6],I.__data[9]=X.elements[7],I.__data[10]=X.elements[8],I.__data[11]=0):(X.toArray(I.__data,V),V+=K.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,z,I.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function g(b,S,E,C){let D=b.value,U=S+"_"+E;if(C[U]===void 0)return typeof D=="number"||typeof D=="boolean"?C[U]=D:C[U]=D.clone(),!0;{let w=C[U];if(typeof D=="number"||typeof D=="boolean"){if(w!==D)return C[U]=D,!0}else if(w.equals(D)===!1)return w.copy(D),!0}return!1}function y(b){let S=b.uniforms,E=0,C=16;for(let U=0,w=S.length;U<w;U++){let R=Array.isArray(S[U])?S[U]:[S[U]];for(let L=0,I=R.length;L<I;L++){let z=R[L],B=Array.isArray(z.value)?z.value:[z.value];for(let V=0,W=B.length;V<W;V++){let X=B[V],K=T(X),pe=E%C,Q=pe%K.boundary,ee=pe+Q;E+=Q,ee!==0&&C-ee<K.storage&&(E+=C-ee),z.__data=new Float32Array(K.storage/Float32Array.BYTES_PER_ELEMENT),z.__offset=E,E+=K.storage}}}let D=E%C;return D>0&&(E+=C-D),b.__size=E,b.__cache={},this}function T(b){let S={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(S.boundary=4,S.storage=4):b.isVector2?(S.boundary=8,S.storage=8):b.isVector3||b.isColor?(S.boundary=16,S.storage=12):b.isVector4?(S.boundary=16,S.storage=16):b.isMatrix3?(S.boundary=48,S.storage=48):b.isMatrix4?(S.boundary=64,S.storage=64):b.isTexture?ot("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ot("WebGLRenderer: Unsupported uniform value type.",b),S}function x(b){let S=b.target;S.removeEventListener("dispose",x);let E=o.indexOf(S.__bindingPointIndex);o.splice(E,1),n.deleteBuffer(r[S.id]),delete r[S.id],delete a[S.id]}function _(){for(let b in r)n.deleteBuffer(r[b]);o=[],r={},a={}}return{bind:c,update:f,dispose:_}}var v9=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),Ko=null;function y9(){return Ko===null&&(Ko=new wr(v9,16,16,Nu,wo),Ko.name="DFG_LUT",Ko.minFilter=dn,Ko.magFilter=dn,Ko.wrapS=Mr,Ko.wrapT=Mr,Ko.generateMipmaps=!1,Ko.needsUpdate=!0),Ko}var xv=class{constructor(e={}){let{canvas:t=pw(),context:i=null,depth:r=!0,stencil:a=!1,alpha:o=!1,antialias:l=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:f=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:m=!1,reversedDepthBuffer:p=!1,outputBufferType:g=Ki}=e;this.isWebGLRenderer=!0;let y;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");y=i.getContextAttributes().alpha}else y=o;let T=g,x=new Set([N0,L0,Kh]),_=new Set([Ki,Ra,tf,nf,D0,U0]),b=new Uint32Array(4),S=new Int32Array(4),E=null,C=null,D=[],U=[],w=null;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.toneMapping=Qr,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let R=this,L=!1;this._outputColorSpace=Oi;let I=0,z=0,B=null,V=-1,W=null,X=new Nt,K=new Nt,pe=null,Q=new tt(0),ee=0,G=t.width,Z=t.height,ne=1,he=null,se=null,J=new Nt(0,0,G,Z),te=new Nt(0,0,G,Z),re=!1,Oe=new Ks,Be=!1,De=!1,Ue=new mt,Xe=new H,ge=new Nt,me={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},ce=!1;function Te(){return B===null?ne:1}let F=i;function He(N,ae){return t.getContext(N,ae)}try{let N={alpha:!0,depth:r,stencil:a,antialias:l,premultipliedAlpha:c,preserveDrawingBuffer:f,powerPreference:d,failIfMajorPerformanceCaveat:m};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${nl}`),t.addEventListener("webglcontextlost",qe,!1),t.addEventListener("webglcontextrestored",it,!1),t.addEventListener("webglcontextcreationerror",rt,!1),F===null){let ae="webgl2";if(F=He(ae,N),F===null)throw He(ae)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(N){throw pt("WebGLRenderer: "+N.message),N}let Me,_e,Ae,P,O,q,de,le,ie,ze,Re,Ye,at,we,Pe,Fe,Y,oe,Ge,j,Se,Ie,Ke;function ke(){Me=new AG(F),Me.init(),Se=new qP(F,Me),_e=new _G(F,Me,e,Se),Ae=new c9(F,Me),_e.reversedDepthBuffer&&p&&Ae.buffers.depth.setReversed(!0),P=new DG(F),O=new K7,q=new f9(F,Me,Ae,O,_e,Se,P),de=new wG(R),le=new P8(F),Ie=new vG(F,le),ie=new CG(F,le,P,Ie),ze=new OG(F,ie,le,Ie,P),oe=new UG(F,_e,q),Pe=new bG(O),Re=new Z7(R,de,Me,_e,Ie,Pe),Ye=new m9(R,O),at=new J7,we=new r9(Me),Y=new gG(R,de,Ae,ze,y,c),Fe=new u9(R,ze,_e),Ke=new g9(F,P,_e,Ae),Ge=new yG(F,Me,P),j=new RG(F,Me,P),P.programs=Re.programs,R.capabilities=_e,R.extensions=Me,R.properties=O,R.renderLists=at,R.shadowMap=Fe,R.state=Ae,R.info=P}ke(),T!==Ki&&(w=new NG(T,t.width,t.height,r,a));let fe=new Iw(R,F);this.xr=fe,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){let N=Me.get("WEBGL_lose_context");N&&N.loseContext()},this.forceContextRestore=function(){let N=Me.get("WEBGL_lose_context");N&&N.restoreContext()},this.getPixelRatio=function(){return ne},this.setPixelRatio=function(N){N!==void 0&&(ne=N,this.setSize(G,Z,!1))},this.getSize=function(N){return N.set(G,Z)},this.setSize=function(N,ae,xe=!0){if(fe.isPresenting){ot("WebGLRenderer: Can't change size while VR device is presenting.");return}G=N,Z=ae,t.width=Math.floor(N*ne),t.height=Math.floor(ae*ne),xe===!0&&(t.style.width=N+"px",t.style.height=ae+"px"),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,N,ae)},this.getDrawingBufferSize=function(N){return N.set(G*ne,Z*ne).floor()},this.setDrawingBufferSize=function(N,ae,xe){G=N,Z=ae,ne=xe,t.width=Math.floor(N*xe),t.height=Math.floor(ae*xe),this.setViewport(0,0,N,ae)},this.setEffects=function(N){if(T===Ki){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(N){for(let ae=0;ae<N.length;ae++)if(N[ae].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}w.setEffects(N||[])},this.getCurrentViewport=function(N){return N.copy(X)},this.getViewport=function(N){return N.copy(J)},this.setViewport=function(N,ae,xe,ve){N.isVector4?J.set(N.x,N.y,N.z,N.w):J.set(N,ae,xe,ve),Ae.viewport(X.copy(J).multiplyScalar(ne).round())},this.getScissor=function(N){return N.copy(te)},this.setScissor=function(N,ae,xe,ve){N.isVector4?te.set(N.x,N.y,N.z,N.w):te.set(N,ae,xe,ve),Ae.scissor(K.copy(te).multiplyScalar(ne).round())},this.getScissorTest=function(){return re},this.setScissorTest=function(N){Ae.setScissorTest(re=N)},this.setOpaqueSort=function(N){he=N},this.setTransparentSort=function(N){se=N},this.getClearColor=function(N){return N.copy(Y.getClearColor())},this.setClearColor=function(){Y.setClearColor(...arguments)},this.getClearAlpha=function(){return Y.getClearAlpha()},this.setClearAlpha=function(){Y.setClearAlpha(...arguments)},this.clear=function(N=!0,ae=!0,xe=!0){let ve=0;if(N){let ye=!1;if(B!==null){let Je=B.texture.format;ye=x.has(Je)}if(ye){let Je=B.texture.type,et=_.has(Je),nt=Y.getClearColor(),Qe=Y.getClearAlpha(),ft=nt.r,vt=nt.g,Mt=nt.b;et?(b[0]=ft,b[1]=vt,b[2]=Mt,b[3]=Qe,F.clearBufferuiv(F.COLOR,0,b)):(S[0]=ft,S[1]=vt,S[2]=Mt,S[3]=Qe,F.clearBufferiv(F.COLOR,0,S))}else ve|=F.COLOR_BUFFER_BIT}ae&&(ve|=F.DEPTH_BUFFER_BIT),xe&&(ve|=F.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ve!==0&&F.clear(ve)},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",qe,!1),t.removeEventListener("webglcontextrestored",it,!1),t.removeEventListener("webglcontextcreationerror",rt,!1),Y.dispose(),at.dispose(),we.dispose(),O.dispose(),de.dispose(),ze.dispose(),Ie.dispose(),Ke.dispose(),Re.dispose(),fe.dispose(),fe.removeEventListener("sessionstart",Pi),fe.removeEventListener("sessionend",tr),di.stop()};function qe(N){N.preventDefault(),vh("WebGLRenderer: Context Lost."),L=!0}function it(){vh("WebGLRenderer: Context Restored."),L=!1;let N=P.autoReset,ae=Fe.enabled,xe=Fe.autoUpdate,ve=Fe.needsUpdate,ye=Fe.type;ke(),P.autoReset=N,Fe.enabled=ae,Fe.autoUpdate=xe,Fe.needsUpdate=ve,Fe.type=ye}function rt(N){pt("WebGLRenderer: A WebGL context could not be created. Reason: ",N.statusMessage)}function dt(N){let ae=N.target;ae.removeEventListener("dispose",dt),jt(ae)}function jt(N){Ht(N),O.remove(N)}function Ht(N){let ae=O.get(N).programs;ae!==void 0&&(ae.forEach(function(xe){Re.releaseProgram(xe)}),N.isShaderMaterial&&Re.releaseShaderCache(N))}this.renderBufferDirect=function(N,ae,xe,ve,ye,Je){ae===null&&(ae=me);let et=ye.isMesh&&ye.matrixWorld.determinant()<0,nt=is(N,ae,xe,ve,ye);Ae.setMaterial(ve,et);let Qe=xe.index,ft=1;if(ve.wireframe===!0){if(Qe=ie.getWireframeAttribute(xe),Qe===void 0)return;ft=2}let vt=xe.drawRange,Mt=xe.attributes.position,ht=vt.start*ft,Zt=(vt.start+vt.count)*ft;Je!==null&&(ht=Math.max(ht,Je.start*ft),Zt=Math.min(Zt,(Je.start+Je.count)*ft)),Qe!==null?(ht=Math.max(ht,0),Zt=Math.min(Zt,Qe.count)):Mt!=null&&(ht=Math.max(ht,0),Zt=Math.min(Zt,Mt.count));let en=Zt-ht;if(en<0||en===1/0)return;Ie.setup(ye,ve,nt,xe,Qe);let on,Lt=Ge;if(Qe!==null&&(on=le.get(Qe),Lt=j,Lt.setIndex(on)),ye.isMesh)ve.wireframe===!0?(Ae.setLineWidth(ve.wireframeLinewidth*Te()),Lt.setMode(F.LINES)):Lt.setMode(F.TRIANGLES);else if(ye.isLine){let Vt=ve.linewidth;Vt===void 0&&(Vt=1),Ae.setLineWidth(Vt*Te()),ye.isLineSegments?Lt.setMode(F.LINES):ye.isLineLoop?Lt.setMode(F.LINE_LOOP):Lt.setMode(F.LINE_STRIP)}else ye.isPoints?Lt.setMode(F.POINTS):ye.isSprite&&Lt.setMode(F.TRIANGLES);if(ye.isBatchedMesh)if(ye._multiDrawInstances!==null)yh("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Lt.renderMultiDrawInstances(ye._multiDrawStarts,ye._multiDrawCounts,ye._multiDrawCount,ye._multiDrawInstances);else if(Me.get("WEBGL_multi_draw"))Lt.renderMultiDraw(ye._multiDrawStarts,ye._multiDrawCounts,ye._multiDrawCount);else{let Vt=ye._multiDrawStarts,$e=ye._multiDrawCounts,Vn=ye._multiDrawCount,bt=Qe?le.get(Qe).bytesPerElement:1,Ei=O.get(ve).currentProgram.getUniforms();for(let hi=0;hi<Vn;hi++)Ei.setValue(F,"_gl_DrawID",hi),Lt.render(Vt[hi]/bt,$e[hi])}else if(ye.isInstancedMesh)Lt.renderInstances(ht,en,ye.count);else if(xe.isInstancedBufferGeometry){let Vt=xe._maxInstanceCount!==void 0?xe._maxInstanceCount:1/0,$e=Math.min(xe.instanceCount,Vt);Lt.renderInstances(ht,en,$e)}else Lt.render(ht,en)};function pn(N,ae,xe){N.transparent===!0&&N.side===Zi&&N.forceSinglePass===!1?(N.side=Ni,N.needsUpdate=!0,vr(N,ae,xe),N.side=Go,N.needsUpdate=!0,vr(N,ae,xe),N.side=Zi):vr(N,ae,xe)}this.compile=function(N,ae,xe=null){xe===null&&(xe=N),C=we.get(xe),C.init(ae),U.push(C),xe.traverseVisible(function(ye){ye.isLight&&ye.layers.test(ae.layers)&&(C.pushLight(ye),ye.castShadow&&C.pushShadow(ye))}),N!==xe&&N.traverseVisible(function(ye){ye.isLight&&ye.layers.test(ae.layers)&&(C.pushLight(ye),ye.castShadow&&C.pushShadow(ye))}),C.setupLights();let ve=new Set;return N.traverse(function(ye){if(!(ye.isMesh||ye.isPoints||ye.isLine||ye.isSprite))return;let Je=ye.material;if(Je)if(Array.isArray(Je))for(let et=0;et<Je.length;et++){let nt=Je[et];pn(nt,xe,ye),ve.add(nt)}else pn(Je,xe,ye),ve.add(Je)}),C=U.pop(),ve},this.compileAsync=function(N,ae,xe=null){let ve=this.compile(N,ae,xe);return new Promise(ye=>{function Je(){if(ve.forEach(function(et){O.get(et).currentProgram.isReady()&&ve.delete(et)}),ve.size===0){ye(N);return}setTimeout(Je,10)}Me.get("KHR_parallel_shader_compile")!==null?Je():setTimeout(Je,10)})};let ti=null;function $r(N){ti&&ti(N)}function Pi(){di.stop()}function tr(){di.start()}let di=new HP;di.setAnimationLoop($r),typeof self<"u"&&di.setContext(self),this.setAnimationLoop=function(N){ti=N,fe.setAnimationLoop(N),N===null?di.stop():di.start()},fe.addEventListener("sessionstart",Pi),fe.addEventListener("sessionend",tr),this.render=function(N,ae){if(ae!==void 0&&ae.isCamera!==!0){pt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(L===!0)return;let xe=fe.enabled===!0&&fe.isPresenting===!0,ve=w!==null&&(B===null||xe)&&w.begin(R,B);if(N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),ae.parent===null&&ae.matrixWorldAutoUpdate===!0&&ae.updateMatrixWorld(),fe.enabled===!0&&fe.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(fe.cameraAutoUpdate===!0&&fe.updateCamera(ae),ae=fe.getCamera()),N.isScene===!0&&N.onBeforeRender(R,N,ae,B),C=we.get(N,U.length),C.init(ae),U.push(C),Ue.multiplyMatrices(ae.projectionMatrix,ae.matrixWorldInverse),Oe.setFromProjectionMatrix(Ue,Yr,ae.reversedDepth),De=this.localClippingEnabled,Be=Pe.init(this.clippingPlanes,De),E=at.get(N,D.length),E.init(),D.push(E),fe.enabled===!0&&fe.isPresenting===!0){let et=R.xr.getDepthSensingMesh();et!==null&&jn(et,ae,-1/0,R.sortObjects)}jn(N,ae,0,R.sortObjects),E.finish(),R.sortObjects===!0&&E.sort(he,se),ce=fe.enabled===!1||fe.isPresenting===!1||fe.hasDepthSensing()===!1,ce&&Y.addToRenderList(E,N),this.info.render.frame++,Be===!0&&Pe.beginShadows();let ye=C.state.shadowsArray;if(Fe.render(ye,N,ae),Be===!0&&Pe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ve&&w.hasRenderPass())===!1){let et=E.opaque,nt=E.transmissive;if(C.setupLights(),ae.isArrayCamera){let Qe=ae.cameras;if(nt.length>0)for(let ft=0,vt=Qe.length;ft<vt;ft++){let Mt=Qe[ft];gr(et,nt,N,Mt)}ce&&Y.render(N);for(let ft=0,vt=Qe.length;ft<vt;ft++){let Mt=Qe[ft];Zn(E,N,Mt,Mt.viewport)}}else nt.length>0&&gr(et,nt,N,ae),ce&&Y.render(N),Zn(E,N,ae)}B!==null&&z===0&&(q.updateMultisampleRenderTarget(B),q.updateRenderTargetMipmap(B)),ve&&w.end(R),N.isScene===!0&&N.onAfterRender(R,N,ae),Ie.resetDefaultState(),V=-1,W=null,U.pop(),U.length>0?(C=U[U.length-1],Be===!0&&Pe.setGlobalState(R.clippingPlanes,C.state.camera)):C=null,D.pop(),D.length>0?E=D[D.length-1]:E=null};function jn(N,ae,xe,ve){if(N.visible===!1)return;if(N.layers.test(ae.layers)){if(N.isGroup)xe=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(ae);else if(N.isLight)C.pushLight(N),N.castShadow&&C.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||Oe.intersectsSprite(N)){ve&&ge.setFromMatrixPosition(N.matrixWorld).applyMatrix4(Ue);let et=ze.update(N),nt=N.material;nt.visible&&E.push(N,et,nt,xe,ge.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||Oe.intersectsObject(N))){let et=ze.update(N),nt=N.material;if(ve&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),ge.copy(N.boundingSphere.center)):(et.boundingSphere===null&&et.computeBoundingSphere(),ge.copy(et.boundingSphere.center)),ge.applyMatrix4(N.matrixWorld).applyMatrix4(Ue)),Array.isArray(nt)){let Qe=et.groups;for(let ft=0,vt=Qe.length;ft<vt;ft++){let Mt=Qe[ft],ht=nt[Mt.materialIndex];ht&&ht.visible&&E.push(N,et,ht,xe,ge.z,Mt)}}else nt.visible&&E.push(N,et,nt,xe,ge.z,null)}}let Je=N.children;for(let et=0,nt=Je.length;et<nt;et++)jn(Je[et],ae,xe,ve)}function Zn(N,ae,xe,ve){let{opaque:ye,transmissive:Je,transparent:et}=N;C.setupLightsView(xe),Be===!0&&Pe.setGlobalState(R.clippingPlanes,xe),ve&&Ae.viewport(X.copy(ve)),ye.length>0&&Qa(ye,ae,xe),Je.length>0&&Qa(Je,ae,xe),et.length>0&&Qa(et,ae,xe),Ae.buffers.depth.setTest(!0),Ae.buffers.depth.setMask(!0),Ae.buffers.color.setMask(!0),Ae.setPolygonOffset(!1)}function gr(N,ae,xe,ve){if((xe.isScene===!0?xe.overrideMaterial:null)!==null)return;if(C.state.transmissionRenderTarget[ve.id]===void 0){let ht=Me.has("EXT_color_buffer_half_float")||Me.has("EXT_color_buffer_float");C.state.transmissionRenderTarget[ve.id]=new fr(1,1,{generateMipmaps:!0,type:ht?wo:Ki,minFilter:Mo,samples:Math.max(4,_e.samples),stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Pt.workingColorSpace})}let Je=C.state.transmissionRenderTarget[ve.id],et=ve.viewport||X;Je.setSize(et.z*R.transmissionResolutionScale,et.w*R.transmissionResolutionScale);let nt=R.getRenderTarget(),Qe=R.getActiveCubeFace(),ft=R.getActiveMipmapLevel();R.setRenderTarget(Je),R.getClearColor(Q),ee=R.getClearAlpha(),ee<1&&R.setClearColor(16777215,.5),R.clear(),ce&&Y.render(xe);let vt=R.toneMapping;R.toneMapping=Qr;let Mt=ve.viewport;if(ve.viewport!==void 0&&(ve.viewport=void 0),C.setupLightsView(ve),Be===!0&&Pe.setGlobalState(R.clippingPlanes,ve),Qa(N,xe,ve),q.updateMultisampleRenderTarget(Je),q.updateRenderTargetMipmap(Je),Me.has("WEBGL_multisampled_render_to_texture")===!1){let ht=!1;for(let Zt=0,en=ae.length;Zt<en;Zt++){let on=ae[Zt],{object:Lt,geometry:Vt,material:$e,group:Vn}=on;if($e.side===Zi&&Lt.layers.test(ve.layers)){let bt=$e.side;$e.side=Ni,$e.needsUpdate=!0,Ao(Lt,xe,ve,Vt,$e,Vn),$e.side=bt,$e.needsUpdate=!0,ht=!0}}ht===!0&&(q.updateMultisampleRenderTarget(Je),q.updateRenderTargetMipmap(Je))}R.setRenderTarget(nt,Qe,ft),R.setClearColor(Q,ee),Mt!==void 0&&(ve.viewport=Mt),R.toneMapping=vt}function Qa(N,ae,xe){let ve=ae.isScene===!0?ae.overrideMaterial:null;for(let ye=0,Je=N.length;ye<Je;ye++){let et=N[ye],{object:nt,geometry:Qe,group:ft}=et,vt=et.material;vt.allowOverride===!0&&ve!==null&&(vt=ve),nt.layers.test(xe.layers)&&Ao(nt,ae,xe,Qe,vt,ft)}}function Ao(N,ae,xe,ve,ye,Je){N.onBeforeRender(R,ae,xe,ve,ye,Je),N.modelViewMatrix.multiplyMatrices(xe.matrixWorldInverse,N.matrixWorld),N.normalMatrix.getNormalMatrix(N.modelViewMatrix),ye.onBeforeRender(R,ae,xe,ve,N,Je),ye.transparent===!0&&ye.side===Zi&&ye.forceSinglePass===!1?(ye.side=Ni,ye.needsUpdate=!0,R.renderBufferDirect(xe,ae,ve,ye,N,Je),ye.side=Go,ye.needsUpdate=!0,R.renderBufferDirect(xe,ae,ve,ye,N,Je),ye.side=Zi):R.renderBufferDirect(xe,ae,ve,ye,N,Je),N.onAfterRender(R,ae,xe,ve,ye,Je)}function vr(N,ae,xe){ae.isScene!==!0&&(ae=me);let ve=O.get(N),ye=C.state.lights,Je=C.state.shadowsArray,et=ye.state.ver
vendor: 4,669 bytes, line 4057
4057sion,nt=Re.getParameters(N,ye.state,Je,ae,xe),Qe=Re.getProgramCacheKey(nt),ft=ve.programs;ve.environment=N.isMeshStandardMaterial||N.isMeshLambertMaterial||N.isMeshPhongMaterial?ae.environment:null,ve.fog=ae.fog;let vt=N.isMeshStandardMaterial||N.isMeshLambertMaterial&&!N.envMap||N.isMeshPhongMaterial&&!N.envMap;ve.envMap=de.get(N.envMap||ve.environment,vt),ve.envMapRotation=ve.environment!==null&&N.envMap===null?ae.environmentRotation:N.envMapRotation,ft===void 0&&(N.addEventListener("dispose",dt),ft=new Map,ve.programs=ft);let Mt=ft.get(Qe);if(Mt!==void 0){if(ve.currentProgram===Mt&&ve.lightsStateVersion===et)return ea(N,nt),Mt}else nt.uniforms=Re.getUniforms(N),N.onBeforeCompile(nt,R),Mt=Re.acquireProgram(nt,Qe),ft.set(Qe,Mt),ve.uniforms=nt.uniforms;let ht=ve.uniforms;return(!N.isShaderMaterial&&!N.isRawShaderMaterial||N.clipping===!0)&&(ht.clippingPlanes=Pe.uniform),ea(N,nt),ve.needsLights=Co(N),ve.lightsStateVersion=et,ve.needsLights&&(ht.ambientLightColor.value=ye.state.ambient,ht.lightProbe.value=ye.state.probe,ht.directionalLights.value=ye.state.directional,ht.directionalLightShadows.value=ye.state.directionalShadow,ht.spotLights.value=ye.state.spot,ht.spotLightShadows.value=ye.state.spotShadow,ht.rectAreaLights.value=ye.state.rectArea,ht.ltc_1.value=ye.state.rectAreaLTC1,ht.ltc_2.value=ye.state.rectAreaLTC2,ht.pointLights.value=ye.state.point,ht.pointLightShadows.value=ye.state.pointShadow,ht.hemisphereLights.value=ye.state.hemi,ht.directionalShadowMatrix.value=ye.state.directionalShadowMatrix,ht.spotLightMatrix.value=ye.state.spotLightMatrix,ht.spotLightMap.value=ye.state.spotLightMap,ht.pointShadowMatrix.value=ye.state.pointShadowMatrix),ve.currentProgram=Mt,ve.uniformsList=null,Mt}function Dr(N){if(N.uniformsList===null){let ae=N.currentProgram.getUniforms();N.uniformsList=ip.seqWithValue(ae.seq,N.uniforms)}return N.uniformsList}function ea(N,ae){let xe=O.get(N);xe.outputColorSpace=ae.outputColorSpace,xe.batching=ae.batching,xe.batchingColor=ae.batchingColor,xe.instancing=ae.instancing,xe.instancingColor=ae.instancingColor,xe.instancingMorph=ae.instancingMorph,xe.skinning=ae.skinning,xe.morphTargets=ae.morphTargets,xe.morphNormals=ae.morphNormals,xe.morphColors=ae.morphColors,xe.morphTargetsCount=ae.morphTargetsCount,xe.numClippingPlanes=ae.numClippingPlanes,xe.numIntersection=ae.numClipIntersection,xe.vertexAlphas=ae.vertexAlphas,xe.vertexTangents=ae.vertexTangents,xe.toneMapping=ae.toneMapping}function is(N,ae,xe,ve,ye){ae.isScene!==!0&&(ae=me),q.resetTextureUnits();let Je=ae.fog,et=ve.isMeshStandardMaterial||ve.isMeshLambertMaterial||ve.isMeshPhongMaterial?ae.environment:null,nt=B===null?R.outputColorSpace:B.isXRRenderTarget===!0?B.texture.colorSpace:Wo,Qe=ve.isMeshStandardMaterial||ve.isMeshLambertMaterial&&!ve.envMap||ve.isMeshPhongMaterial&&!ve.envMap,ft=de.get(ve.envMap||et,Qe),vt=ve.vertexColors===!0&&!!xe.attributes.color&&xe.attributes.color.itemSize===4,Mt=!!xe.attributes.tangent&&(!!ve.normalMap||ve.anisotropy>0),ht=!!xe.morphAttributes.position,Zt=!!xe.morphAttributes.normal,en=!!xe.morphAttributes.color,on=Qr;ve.toneMapped&&(B===null||B.isXRRenderTarget===!0)&&(on=R.toneMapping);let Lt=xe.morphAttributes.position||xe.morphAttributes.normal||xe.morphAttributes.color,Vt=Lt!==void 0?Lt.length:0,$e=O.get(ve),Vn=C.state.lights;if(Be===!0&&(De===!0||N!==W)){let Un=N===W&&ve.id===V;Pe.setState(ve,N,Un)}let bt=!1;ve.version===$e.__version?($e.needsLights&&$e.lightsStateVersion!==Vn.state.version||$e.outputColorSpace!==nt||ye.isBatchedMesh&&$e.batching===!1||!ye.isBatchedMesh&&$e.batching===!0||ye.isBatchedMesh&&$e.batchingColor===!0&&ye.colorTexture===null||ye.isBatchedMesh&&$e.batchingColor===!1&&ye.colorTexture!==null||ye.isInstancedMesh&&$e.instancing===!1||!ye.isInstancedMesh&&$e.instancing===!0||ye.isSkinnedMesh&&$e.skinning===!1||!ye.isSkinnedMesh&&$e.skinning===!0||ye.isInstancedMesh&&$e.instancingColor===!0&&ye.instanceColor===null||ye.isInstancedMesh&&$e.instancingColor===!1&&ye.instanceColor!==null||ye.isInstancedMesh&&$e.instancingMorph===!0&&ye.morphTexture===null||ye.isInstancedMesh&&$e.instancingMorph===!1&&ye.morphTexture!==null||$e.envMap!==ft||ve.fog===!0&&$e.fog!==Je||$e.numClippingPlanes!==void 0&&($e.numClippingPlanes!==Pe.numPlanes||$e.numIntersection!==Pe.numIntersection)||$e.vertexAlphas!==vt||$e.vertexTangents!==Mt||$e.morphTargets!==ht||$e.morphNormals!==Zt||$e.morphColors!==en||$e.toneMapping!==on||$e.morphTargetsCount!==Vt)&&(bt=!0):(bt=!0,$e.__version=ve.version);let Ei=$e.currentProgram;bt===!0&&(Ei=vr(ve,ae,ye));let hi=!1,Pn=!1,Ur=!1,Gt=Ei.getUniforms(),xn=$e.uniforms;if(Ae.useProgram(Ei.program)&&(hi=!0,Pn=!0,Ur=!0),ve.id!==V&&(V=ve.i
vendor: 4,713 bytes, line 4057
4057d,Pn=!0),hi||W!==N){Ae.buffers.depth.getReversed()&&N.reversedDepth!==!0&&(N._reversedDepth=!0,N.updateProjectionMatrix()),Gt.setValue(F,"projectionMatrix",N.projectionMatrix),Gt.setValue(F,"viewMatrix",N.matrixWorldInverse);let Or=Gt.map.cameraPosition;Or!==void 0&&Or.setValue(F,Xe.setFromMatrixPosition(N.matrixWorld)),_e.logarithmicDepthBuffer&&Gt.setValue(F,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),(ve.isMeshPhongMaterial||ve.isMeshToonMaterial||ve.isMeshLambertMaterial||ve.isMeshBasicMaterial||ve.isMeshStandardMaterial||ve.isShaderMaterial)&&Gt.setValue(F,"isOrthographic",N.isOrthographicCamera===!0),W!==N&&(W=N,Pn=!0,Ur=!0)}if($e.needsLights&&(Vn.state.directionalShadowMap.length>0&&Gt.setValue(F,"directionalShadowMap",Vn.state.directionalShadowMap,q),Vn.state.spotShadowMap.length>0&&Gt.setValue(F,"spotShadowMap",Vn.state.spotShadowMap,q),Vn.state.pointShadowMap.length>0&&Gt.setValue(F,"pointShadowMap",Vn.state.pointShadowMap,q)),ye.isSkinnedMesh){Gt.setOptional(F,ye,"bindMatrix"),Gt.setOptional(F,ye,"bindMatrixInverse");let Un=ye.skeleton;Un&&(Un.boneTexture===null&&Un.computeBoneTexture(),Gt.setValue(F,"boneTexture",Un.boneTexture,q))}ye.isBatchedMesh&&(Gt.setOptional(F,ye,"batchingTexture"),Gt.setValue(F,"batchingTexture",ye._matricesTexture,q),Gt.setOptional(F,ye,"batchingIdTexture"),Gt.setValue(F,"batchingIdTexture",ye._indirectTexture,q),Gt.setOptional(F,ye,"batchingColorTexture"),ye._colorsTexture!==null&&Gt.setValue(F,"batchingColorTexture",ye._colorsTexture,q));let yr=xe.morphAttributes;if((yr.position!==void 0||yr.normal!==void 0||yr.color!==void 0)&&oe.update(ye,xe,Ei),(Pn||$e.receiveShadow!==ye.receiveShadow)&&($e.receiveShadow=ye.receiveShadow,Gt.setValue(F,"receiveShadow",ye.receiveShadow)),(ve.isMeshStandardMaterial||ve.isMeshLambertMaterial||ve.isMeshPhongMaterial)&&ve.envMap===null&&ae.environment!==null&&(xn.envMapIntensity.value=ae.environmentIntensity),xn.dfgLUT!==void 0&&(xn.dfgLUT.value=y9()),Pn&&(Gt.setValue(F,"toneMappingExposure",R.toneMappingExposure),$e.needsLights&&rs(xn,Ur),Je&&ve.fog===!0&&Ye.refreshFogUniforms(xn,Je),Ye.refreshMaterialUniforms(xn,ve,ne,Z,C.state.transmissionRenderTarget[N.id]),ip.upload(F,Dr($e),xn,q)),ve.isShaderMaterial&&ve.uniformsNeedUpdate===!0&&(ip.upload(F,Dr($e),xn,q),ve.uniformsNeedUpdate=!1),ve.isSpriteMaterial&&Gt.setValue(F,"center",ye.center),Gt.setValue(F,"modelViewMatrix",ye.modelViewMatrix),Gt.setValue(F,"normalMatrix",ye.normalMatrix),Gt.setValue(F,"modelMatrix",ye.matrixWorld),ve.isShaderMaterial||ve.isRawShaderMaterial){let Un=ve.uniformsGroups;for(let Or=0,ta=Un.length;Or<ta;Or++){let Ja=Un[Or];Ke.update(Ja,Ei),Ke.bind(Ja,Ei)}}return Ei}function rs(N,ae){N.ambientLightColor.needsUpdate=ae,N.lightProbe.needsUpdate=ae,N.directionalLights.needsUpdate=ae,N.directionalLightShadows.needsUpdate=ae,N.pointLights.needsUpdate=ae,N.pointLightShadows.needsUpdate=ae,N.spotLights.needsUpdate=ae,N.spotLightShadows.needsUpdate=ae,N.rectAreaLights.needsUpdate=ae,N.hemisphereLights.needsUpdate=ae}function Co(N){return N.isMeshLambertMaterial||N.isMeshToonMaterial||N.isMeshPhongMaterial||N.isMeshStandardMaterial||N.isShadowMaterial||N.isShaderMaterial&&N.lights===!0}this.getActiveCubeFace=function(){return I},this.getActiveMipmapLevel=function(){return z},this.getRenderTarget=function(){return B},this.setRenderTargetTextures=function(N,ae,xe){let ve=O.get(N);ve.__autoAllocateDepthBuffer=N.resolveDepthBuffer===!1,ve.__autoAllocateDepthBuffer===!1&&(ve.__useRenderToTexture=!1),O.get(N.texture).__webglTexture=ae,O.get(N.depthTexture).__webglTexture=ve.__autoAllocateDepthBuffer?void 0:xe,ve.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(N,ae){let xe=O.get(N);xe.__webglFramebuffer=ae,xe.__useDefaultFramebuffer=ae===void 0};let as=F.createFramebuffer();this.setRenderTarget=function(N,ae=0,xe=0){B=N,I=ae,z=xe;let ve=null,ye=!1,Je=!1;if(N){let nt=O.get(N);if(nt.__useDefaultFramebuffer!==void 0){Ae.bindFramebuffer(F.FRAMEBUFFER,nt.__webglFramebuffer),X.copy(N.viewport),K.copy(N.scissor),pe=N.scissorTest,Ae.viewport(X),Ae.scissor(K),Ae.setScissorTest(pe),V=-1;return}else if(nt.__webglFramebuffer===void 0)q.setupRenderTarget(N);else if(nt.__hasExternalTextures)q.rebindTextures(N,O.get(N.texture).__webglTexture,O.get(N.depthTexture).__webglTexture);else if(N.depthBuffer){let vt=N.depthTexture;if(nt.__boundDepthTexture!==vt){if(vt!==null&&O.has(vt)&&(N.width!==vt.image.width||N.height!==vt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");q.setupDepthRenderbuffer(N)}}let Qe=N.texture;(Qe.isData3DTexture||Qe.isDataArrayTexture||Qe.isCompressedArrayTexture)&&(Je=!0);let ft=O.get(N).__webglFramebuffer;
vendor: 5,848 bytes, line 4057
4057N.isWebGLCubeRenderTarget?(Array.isArray(ft[ae])?ve=ft[ae][xe]:ve=ft[ae],ye=!0):N.samples>0&&q.useMultisampledRTT(N)===!1?ve=O.get(N).__webglMultisampledFramebuffer:Array.isArray(ft)?ve=ft[xe]:ve=ft,X.copy(N.viewport),K.copy(N.scissor),pe=N.scissorTest}else X.copy(J).multiplyScalar(ne).floor(),K.copy(te).multiplyScalar(ne).floor(),pe=re;if(xe!==0&&(ve=as),Ae.bindFramebuffer(F.FRAMEBUFFER,ve)&&Ae.drawBuffers(N,ve),Ae.viewport(X),Ae.scissor(K),Ae.setScissorTest(pe),ye){let nt=O.get(N.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+ae,nt.__webglTexture,xe)}else if(Je){let nt=ae;for(let Qe=0;Qe<N.textures.length;Qe++){let ft=O.get(N.textures[Qe]);F.framebufferTextureLayer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+Qe,ft.__webglTexture,xe,nt)}}else if(N!==null&&xe!==0){let nt=O.get(N.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,nt.__webglTexture,xe)}V=-1},this.readRenderTargetPixels=function(N,ae,xe,ve,ye,Je,et,nt=0){if(!(N&&N.isWebGLRenderTarget)){pt("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Qe=O.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&et!==void 0&&(Qe=Qe[et]),Qe){Ae.bindFramebuffer(F.FRAMEBUFFER,Qe);try{let ft=N.textures[nt],vt=ft.format,Mt=ft.type;if(N.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+nt),!_e.textureFormatReadable(vt)){pt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!_e.textureTypeReadable(Mt)){pt("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ae>=0&&ae<=N.width-ve&&xe>=0&&xe<=N.height-ye&&F.readPixels(ae,xe,ve,ye,Se.convert(vt),Se.convert(Mt),Je)}finally{let ft=B!==null?O.get(B).__webglFramebuffer:null;Ae.bindFramebuffer(F.FRAMEBUFFER,ft)}}},this.readRenderTargetPixelsAsync=async function(N,ae,xe,ve,ye,Je,et,nt=0){if(!(N&&N.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Qe=O.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&et!==void 0&&(Qe=Qe[et]),Qe)if(ae>=0&&ae<=N.width-ve&&xe>=0&&xe<=N.height-ye){Ae.bindFramebuffer(F.FRAMEBUFFER,Qe);let ft=N.textures[nt],vt=ft.format,Mt=ft.type;if(N.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+nt),!_e.textureFormatReadable(vt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!_e.textureTypeReadable(Mt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let ht=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,ht),F.bufferData(F.PIXEL_PACK_BUFFER,Je.byteLength,F.STREAM_READ),F.readPixels(ae,xe,ve,ye,Se.convert(vt),Se.convert(Mt),0);let Zt=B!==null?O.get(B).__webglFramebuffer:null;Ae.bindFramebuffer(F.FRAMEBUFFER,Zt);let en=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return F.flush(),await uP(F,en,4),F.bindBuffer(F.PIXEL_PACK_BUFFER,ht),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,Je),F.deleteBuffer(ht),F.deleteSync(en),Je}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(N,ae=null,xe=0){let ve=Math.pow(2,-xe),ye=Math.floor(N.image.width*ve),Je=Math.floor(N.image.height*ve),et=ae!==null?ae.x:0,nt=ae!==null?ae.y:0;q.setTexture2D(N,0),F.copyTexSubImage2D(F.TEXTURE_2D,xe,0,0,et,nt,ye,Je),Ae.unbindTexture()};let dl=F.createFramebuffer(),hl=F.createFramebuffer();this.copyTextureToTexture=function(N,ae,xe=null,ve=null,ye=0,Je=0){let et,nt,Qe,ft,vt,Mt,ht,Zt,en,on=N.isCompressedTexture?N.mipmaps[Je]:N.image;if(xe!==null)et=xe.max.x-xe.min.x,nt=xe.max.y-xe.min.y,Qe=xe.isBox3?xe.max.z-xe.min.z:1,ft=xe.min.x,vt=xe.min.y,Mt=xe.isBox3?xe.min.z:0;else{let xn=Math.pow(2,-ye);et=Math.floor(on.width*xn),nt=Math.floor(on.height*xn),N.isDataArrayTexture?Qe=on.depth:N.isData3DTexture?Qe=Math.floor(on.depth*xn):Qe=1,ft=0,vt=0,Mt=0}ve!==null?(ht=ve.x,Zt=ve.y,en=ve.z):(ht=0,Zt=0,en=0);let Lt=Se.convert(ae.format),Vt=Se.convert(ae.type),$e;ae.isData3DTexture?(q.setTexture3D(ae,0),$e=F.TEXTURE_3D):ae.isDataArrayTexture||ae.isCompressedArrayTexture?(q.setTexture2DArray(ae,0),$e=F.TEXTURE_2D_ARRAY):(q.setTexture2D(ae,0),$e=F.TEXTURE_2D),F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,ae.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ae.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,ae.unpackAlignment);let Vn=F.getParameter(F.UNPACK_ROW_LENGTH),bt=F.getParameter(F.UNPACK_IMAGE_HEIGHT),Ei=F.getParameter(F.UNPACK_SKIP_PIXELS),hi=F.getParameter(F.UNPACK_SKIP_ROWS),Pn=F.getParameter(F.UNPACK_SKIP_IMAGES);F.pixelStorei(F.UNPACK_ROW_LENGTH,on.width),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,on.height),F.pixelStorei(F.UNPACK_SKIP_PIXELS,ft),F.pixelStorei(F.UNPACK_SKIP_ROWS,vt),F.pixelStorei(F.UNPACK_SKIP_IMAGES,Mt);let Ur=N.isDataArrayTexture||N.isData3DTexture,Gt=ae.isDataArrayTexture||ae.isData3DTexture;if(N.isDepthTexture){let xn=O.get(N),yr=O.get(ae),Un=O.get(xn.__renderTarget),Or=O.get(yr.__renderTarget);Ae.bindFramebuffer(F.READ_FRAMEBUFFER,Un.__webglFramebuffer),Ae.bindFramebuffer(F.DRAW_FRAMEBUFFER,Or.__webglFramebuffer);for(let ta=0;ta<Qe;ta++)Ur&&(F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,O.get(N).__webglTexture,ye,Mt+ta),F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,O.get(ae).__webglTexture,Je,en+ta)),F.blitFramebuffer(ft,vt,et,nt,ht,Zt,et,nt,F.DEPTH_BUFFER_BIT,F.NEAREST);Ae.bindFramebuffer(F.READ_FRAMEBUFFER,null),Ae.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else if(ye!==0||N.isRenderTargetTexture||O.has(N)){let xn=O.get(N),yr=O.get(ae);Ae.bindFramebuffer(F.READ_FRAMEBUFFER,dl),Ae.bindFramebuffer(F.DRAW_FRAMEBUFFER,hl);for(let Un=0;
4057Un<Qe;Un++)Ur?F.framebufferTextureLayer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,xn.__webglTexture,ye,Mt+Un):F.framebufferTexture2D(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,xn.__webglTexture,ye),Gt?F.framebufferTextureLayer(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,yr.__webglTexture,Je,en+Un):F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,yr.__webglTexture,Je),ye!==0?F.blitFramebuffer(ft,vt,et,nt,ht,Zt,et,nt,F.COLOR_BUFFER_BIT,F.NEAREST):Gt?F.copyTexSubImage3D($e,Je,ht,Zt,en+Un,ft,vt,et,nt):F.copyTexSubImage2D($e,Je,ht,Zt,ft,vt,et,nt);Ae.bindFramebuffer(F.READ_FRAMEBUFFER,null),Ae.bindFramebuffer(F.DRAW_FRAMEBUFFER,null)}else Gt?N.isDataTexture||N.isData3DTexture?F.texSubImage3D($e,Je,ht,Zt,en,et,nt,Qe,Lt,Vt,on.data):ae.isCompressedArrayTexture?F.compressedTexSubImage3D($e,Je,ht,Zt,en,et,nt,Qe,Lt,on.data):F.texSubImage3D($e,Je,ht,Zt,en,et,nt,Qe,Lt,Vt,on):N.isDataTexture?F.texSubImage2D(F.TEXTURE_2D,Je,ht,Zt,et,nt,Lt,Vt,on.data):N.isCompressedTexture?F.compressedTexSubImage2D(F.TEXTURE_2D,Je,ht,Zt,on.width,on.height,Lt,on.data):F.texSubImage2D(F.TEXTURE_2D,Je,ht,Zt,et,nt,Lt,Vt,on);F.pixelStorei(F.UNPACK_ROW_LENGTH,Vn),F.pixelStorei(F.UNPACK_IMAGE_HEIGHT,bt),F.pixelStorei(F.UNPACK_SKIP_PIXELS,Ei),F.pixelStorei(F.UNPACK_SKIP_ROWS,hi),F.pixelStorei(F.UNPACK_SKIP_IMAGES,Pn),Je===0&&ae.generateMipmaps&&F.generateMipmap($e),Ae.unbindTexture()},this.initRenderTarget=function(N){O.get(N).__webglFramebuffer===void 0&&q.setupRenderTarget(N)},this.initTexture=function(N){N.isCubeTexture?q.setTextureCube(N,0):N.isData3DTexture?q.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?q.setTexture2DArray(N,0):q.setTexture2D(N,0),Ae.unbindTexture()},this.resetState=function(){I=0,z=0,B=null,Ae.reset(),Ie.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Yr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=Pt._getDrawingBufferColorSpace(e),t.unpackColorSpace=Pt._getUnpackColorSpace()}};var rI=gi(or(),1),aI=gi(eI(),1);var tI=n=>{let e,t=new Set,i=(f,d)=>{let m=typeof f=="function"?f(e):f;if(!Object.is(m,e)){let p=e;e=d??(typeof m!="object"||m===null)?m:Object.assign({},e,m),t.forEach(g=>g(e,p))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>c,subscribe:f=>(t.add(f),()=>t.delete(f))},c=e=n(i,r,l);return l},nI=n=>n?tI(n):tI;var{useSyncExternalStoreWithSelector:I9}=aI.default,z9=n=>n;function k9(n,e=z9,t){let i=I9(n.subscribe,n.getState,n.getInitialState,e,t);return rI.default.useDebugValue(i),i}var iI=(n,e)=>{let t=nI(n),i=(r,a=e)=>k9(t,r,a);return Object.assign(i,t),i},oI=(n,e)=>n?iI(n,e):iI;var F9=n=>typeof n=="object"&&typeof n.then=="function",uf=[];function sI(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;let i=n.length;if(e.length!==i)return!1;for(let r=0;r<i;r++)if(!t(n[r],e[r]))return!1;return!0}function lI(n,e=null,t=!1,i={}){e===null&&(e=[n]);for(let a of uf)if(sI(e,a.keys,a.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(a,"error"))throw a.error;if(Object.prototype.hasOwnProperty.call(a,"response"))return i.lifespan&&i.lifespan>0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,i.lifespan)),a.response;if(!t)throw a.promise}let r={keys:e,equal:i.equal,remove:()=>{let a=uf.indexOf(r);a!==-1&&uf.splice(a,1)},promise:(F9(n)?n:n(...e)).then(a=>{r.response=a,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(a=>r.error=a)};if(uf.push(r),!t)throw r.promise}var m1=(n,e,t)=>lI(n,e,!1,t),uI=(n,e,t)=>void lI(n,e,!0,t);var cI=n=>{if(n===void 0||n.length===0)uf.splice(0,uf.length);else{let e=uf.find(t=>sI(n,t.keys,t.equal));e&&e.remove()}};var fp=gi(Sy()),up=gi(Sv());var Hn=gi(or(),1);function v1(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){let r=v1(i,e,t);if(r)return r;i=e?null:i.sibling}}function pI(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}var kw=pI(Hn.createContext(null)),Tv=class extends Hn.Component{render(){return Hn.createElement(kw.Provider,{value:this._reactInternals},this.props.children)}};function Fw(){let n=Hn.useContext(kw);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");let e=Hn.useId();return Hn.useMemo(()=>{for(let t of[n,n?.alternate]){if(!t)continue;let i=v1(t,!1,r=>{let a=r.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[n,e])}var V9=Symbol.for("react.context"),G9=n=>n!==null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===V9;function W9(){let n=Fw(),[e]=Hn.useState(()=>new Map);e.clear();let t=n;for(;t;){let i=t.type;G9(i)&&i!==kw&&!e.has(i)&&e.set(i,Hn.use(pI(i))),t=t.return}return e}function mI(){let n=W9();return Hn.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>
4057i=>Hn.createElement(e,null,Hn.createElement(t.Provider,{...i,value:n.get(t)})),e=>Hn.createElement(Tv,{...e})),[n])}function AI(n){let e=n.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}var CI=n=>n&&n.isOrthographicCamera,RI=n=>n&&n.hasOwnProperty("current"),X9=n=>n!=null&&(typeof n=="string"||typeof n=="number"||n.isColor),dp=((n,e)=>typeof window<"u"&&(((n=window.document)==null?void 0:n.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?Dn.useLayoutEffect:Dn.useEffect;function $w(n){let e=Dn.useRef(n);return dp(()=>void(e.current=n),[n]),e}function DI(){let n=Fw(),e=mI();return Dn.useMemo(()=>({children:t})=>{let r=!!v1(n,!0,a=>a.type===Dn.StrictMode)?Dn.StrictMode:Dn.Fragment;return(0,up.jsx)(r,{children:(0,up.jsx)(e,{children:t})})},[n,e])}function UI({set:n}){return dp(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}var OI=(n=>(n=class extends Dn.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},n.getDerivedStateFromError=()=>({error:!0}),n))();function LI(n){var e;let 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}function cf(n){var e;return(e=n.__r3f)==null?void 0:e.root.getState()}var Nn={obj:n=>n===Object(n)&&!Nn.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,nul:n=>n===null,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(Nn.str(n)||Nn.num(n)||Nn.boo(n))return n===e;let a=Nn.obj(n);if(a&&i==="reference")return n===e;let o=Nn.arr(n);if(o&&t==="reference")return n===e;if((o||a)&&n===e)return!0;let l;for(l in n)if(!(l in e))return!1;if(a&&t==="shallow"&&i==="shallow"){for(l in r?e:n)if(!Nn.equ(n[l],e[l],{strict:r,objects:"reference"}))return!1}else for(l in r?e:n)if(n[l]!==e[l])return!1;if(Nn.und(l)){if(o&&n.length===0&&e.length===0||a&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function NI(n){let e={nodes:{},materials:{},meshes:{}};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),t.isMesh&&!e.meshes[t.name]&&(e.meshes[t.name]=t)}),e}function PI(n){n.type!=="Scene"&&(n.dispose==null||n.dispose());for(let e in n){let t=n[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}var II=["children","key","ref"];function q9(n){let e={};for(let t in n)II.includes(t)||(e[t]=n[t]);return e}function x1(n,e,t,i){let r=n,a=r?.__r3f;return a||(a={root:e,type:t,parent:null,children:[],props:q9(i),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=a)),a}function Ev(n,e){if(!e.includes("-"))return{root:n,key:e,target:n[e]};if(e in n)return{root:n,key:e,target:n[e]};let t=n,i=e.split("-");for(let r of i){if(typeof t!="object"||t===null){if(t!==void 0){let a=i.slice(i.indexOf(r)).join("-");return{root:t,key:a,target:void 0}}return{root:n,key:e,target:void 0}}e=r,n=t,t=t[e]}return{root:n,key:e,target:t}}var gI=/-\d+$/;function S1(n,e){if(Nn.str(e.props.attach)){if(gI.test(e.props.attach)){let r=e.props.attach.replace(gI,""),{root:a,key:o}=Ev(n.object,r);Array.isArray(a[o])||(a[o]=[])}let{root:t,key:i}=Ev(n.object,e.props.attach);e.previousAttach=t[i],t[i]=e.object}else Nn.fun(e.props.attach)&&(e.previousAttach=e.props.attach(n.object,e.object))}function T1(n,e){if(Nn.str(e.props.attach)){let{root:t,key:i}=Ev(n.object,e.props.attach),r=e.previousAttach;r===void 0?delete t[i]:t[i]=r}else e.previousAttach==null||e.previousAttach(n.object,e.object);delete e.previousAttach}var Yw=[...II,"args","dispose","attach","object","onUpdate","dispose"],vI=new Map;function Y9(n){let e=vI.get(n.constructor);try{e||(e=new n.constructor,vI.set(n.constructor,e))}catch{}return e}function j9(n,e){let t={};for(let i in e)if(!Yw.includes(i)&&!Nn.equ(e[i],n.props[i])){t[i]=e[i];for(let r in e)r.startsWith(`${i}-`)&&(t[r]=e[r])}for(let i in n.props){if(Yw.includes(i)||e.hasOwnProperty(i))continue;let{root:r,key:a}=Ev(n.object,i);if(r.constructor&&r.constructor.length===0){let o=Y9(r);Nn.und(o)||(t[a]=o[a])}else t[a]=0}return t}var Z9=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],K9=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function ul(n,e){var t;let i=n.__r3f,r=i&&AI(i).getState(),a=i?.eventCount;for(let l in e){let c=e[l];
4057if(Yw.includes(l))continue;if(i&&K9.test(l)){typeof c=="function"?i.handlers[l]=c:delete i.handlers[l],i.eventCount=Object.keys(i.handlers).length;continue}if(c===void 0)continue;let{root:f,key:d,target:m}=Ev(n,l);if(m===void 0&&(typeof f!="object"||f===null))throw Error(`R3F: Cannot set "${l}". Ensure it is an object before setting "${d}".`);if(m instanceof Xo&&c instanceof Xo)m.mask=c.mask;else if(m instanceof tt&&X9(c))m.set(c);else if(m!==null&&typeof m=="object"&&typeof m.set=="function"&&typeof m.copy=="function"&&c!=null&&c.constructor&&m.constructor===c.constructor)m.copy(c);else if(m!==null&&typeof m=="object"&&typeof m.set=="function"&&Array.isArray(c))typeof m.fromArray=="function"?m.fromArray(c):m.set(...c);else if(m!==null&&typeof m=="object"&&typeof m.set=="function"&&typeof c=="number")typeof m.setScalar=="function"?m.setScalar(c):m.set(c);else{var o;f[d]=c,r&&!r.linear&&Z9.includes(d)&&(o=f[d])!=null&&o.isTexture&&f[d].format===_i&&f[d].type===Ki&&(f[d].colorSpace=Oi)}}if(i!=null&&i.parent&&r!=null&&r.internal&&(t=i.object)!=null&&t.isObject3D&&a!==i.eventCount){let l=i.object,c=r.internal.interaction.indexOf(l);c>-1&&r.internal.interaction.splice(c,1),i.eventCount&&l.raycast!==null&&r.internal.interaction.push(l)}return i&&i.props.attach===void 0&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&hp(i),n}function hp(n){var e;if(!n.parent)return;n.props.onUpdate==null||n.props.onUpdate(n.object);let t=(e=n.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function Q9(n,e){n.manual||(CI(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())}var Cr=n=>n?.isObject3D;function y1(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function zI(n,e,t,i){let r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function J9(n,e){let{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)=>{zI(t.capturedMap,e,i,r)})}function kI(n){function e(c){let{internal:f}=n.getState(),d=c.offsetX-f.initialClick[0],m=c.offsetY-f.initialClick[1];return Math.round(Math.sqrt(d*d+m*m))}function t(c){return c.filter(f=>["Move","Over","Enter","Out","Leave"].some(d=>{var m;return(m=f.__r3f)==null?void 0:m.handlers["onPointer"+d]}))}function i(c,f){let d=n.getState(),m=new Set,p=[],g=f?f(d.internal.interaction):d.internal.interaction;for(let _=0;_<g.length;_++){let b=cf(g[_]);b&&(b.raycaster.camera=void 0)}d.previousRoot||d.events.compute==null||d.events.compute(c,d);function y(_){let b=cf(_);if(!b||!b.events.enabled||b.raycaster.camera===null)return[];if(b.raycaster.camera===void 0){var S;b.events.compute==null||b.events.compute(c,b,(S=b.previousRoot)==null?void 0:S.getState()),b.raycaster.camera===void 0&&(b.raycaster.camera=null)}return b.raycaster.camera?b.raycaster.intersectObject(_,!0):[]}let T=g.flatMap(y).sort((_,b)=>{let S=cf(_.object),E=cf(b.object);return!S||!E?_.distance-b.distance:E.events.priority-S.events.priority||_.distance-b.distance}).filter(_=>{let b=y1(_);return m.has(b)?!1:(m.add(b),!0)});d.events.filter&&(T=d.events.filter(T,d));for(let _ of T){let b=_.object;for(;b;){var x;(x=b.__r3f)!=null&&x.eventCount&&p.push({..._,eventObject:b}),b=b.parent}}if("pointerId"in c&&d.internal.capturedMap.has(c.pointerId))for(let _ of d.internal.capturedMap.get(c.pointerId).values())m.has(y1(_.intersection))||p.push(_.intersection);return p}function r(c,f,d,m){if(c.length){let p={stopped:!1};for(let g of c){let y=cf(g.object);if(y||g.object.traverseAncestors(T=>{let x=cf(T);if(x)return y=x,!1}),y){let{raycaster:T,pointer:x,camera:_,internal:b}=y,S=new H(x.x,x.y,0).unproject(_),E=R=>{var L,I;return(L=(I=b.capturedMap.get(R))==null?void 0:I.has(g.eventObject))!=null?L:!1},C=R=>{let L={intersection:g,target:f.target};b.capturedMap.has(R)?b.capturedMap.get(R).set(g.eventObject,L):b.capturedMap.set(R,new Map([[g.eventObject,L]])),f.target.setPointerCapture(R)},D=R=>{let L=b.capturedMap.get(R);L&&zI(b.capturedMap,g.eventObject,L,R)},U={};for(let R in f){let L=f[R];typeof L!="function"&&(U[R]=L)}
4057let w={...g,...U,pointer:x,intersections:c,stopped:p.stopped,delta:d,unprojectedPoint:S,ray:T.ray,camera:_,stopPropagation(){let R="pointerId"in f&&b.capturedMap.get(f.pointerId);if((!R||R.has(g.eventObject))&&(w.stopped=p.stopped=!0,b.hovered.size&&Array.from(b.hovered.values()).find(L=>L.eventObject===g.eventObject))){let L=c.slice(0,c.indexOf(g));a([...L,g])}},target:{hasPointerCapture:E,setPointerCapture:C,releasePointerCapture:D},currentTarget:{hasPointerCapture:E,setPointerCapture:C,releasePointerCapture:D},nativeEvent:f};if(m(w),p.stopped===!0)break}}}return c}function a(c){let{internal:f}=n.getState();for(let d of f.hovered.values())if(!c.length||!c.find(m=>m.object===d.object&&m.index===d.index&&m.instanceId===d.instanceId)){let p=d.eventObject.__r3f;if(f.hovered.delete(y1(d)),p!=null&&p.eventCount){let g=p.handlers,y={...d,intersections:c};g.onPointerOut==null||g.onPointerOut(y),g.onPointerLeave==null||g.onPointerLeave(y)}}}function o(c,f){for(let d=0;d<f.length;d++){let m=f[d].__r3f;m==null||m.handlers.onPointerMissed==null||m.handlers.onPointerMissed(c)}}function l(c){switch(c){case"onPointerLeave":case"onPointerCancel":return()=>a([]);case"onLostPointerCapture":return f=>{let{internal:d}=n.getState();"pointerId"in f&&d.capturedMap.has(f.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(f.pointerId)&&(d.capturedMap.delete(f.pointerId),a([]))})}}return function(d){let{onPointerMissed:m,internal:p}=n.getState();p.lastEvent.current=d;let g=c==="onPointerMove",y=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",x=i(d,g?t:void 0),_=y?e(d):0;c==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=x.map(S=>S.eventObject)),y&&!x.length&&_<=2&&(o(d,p.interaction),m&&m(d)),g&&a(x);function b(S){let E=S.eventObject,C=E.__r3f;if(!(C!=null&&C.eventCount))return;let D=C.handlers;if(g){if(D.onPointerOver||D.onPointerEnter||D.onPointerOut||D.onPointerLeave){let U=y1(S),w=p.hovered.get(U);w?w.stopped&&S.stopPropagation():(p.hovered.set(U,S),D.onPointerOver==null||D.onPointerOver(S),D.onPointerEnter==null||D.onPointerEnter(S))}D.onPointerMove==null||D.onPointerMove(S)}else{let U=D[c];U?(!y||p.initialHits.includes(E))&&(o(d,p.interaction.filter(w=>!p.initialHits.includes(w))),U(S)):y&&p.initialHits.includes(E)&&o(d,p.interaction.filter(w=>!p.initialHits.includes(w)))}}r(x,d,_,b)}}return{handlePointer:l}}var yI=n=>!!(n!=null&&n.render),eA=Dn.createContext(null),$9=(n,e)=>{let t=oI((l,c)=>{let f=new H,d=new H,m=new H;function p(_=c().camera,b=d,S=c().size){let{width:E,height:C,top:D,left:U}=S,w=E/C;b.isVector3?m.copy(b):m.set(...b);let R=_.getWorldPosition(f).distanceTo(m);if(CI(_))return{width:E/_.zoom,height:C/_.zoom,top:D,left:U,factor:1,distance:R,aspect:w};{let L=_.fov*Math.PI/180,I=2*Math.tan(L/2)*R,z=I*(E/C);return{width:z,height:I,top:D,left:U,factor:E/z,distance:R,aspect:w}}}let g,y=_=>l(b=>({performance:{...b.performance,current:_}})),T=new Le;return{set:l,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(_=1)=>n(c(),_),advance:(_,b)=>e(_,b,c()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Wh,pointer:T,mouse:T,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let _=c();g&&clearTimeout(g),_.performance.current!==_.performance.min&&y(_.performance.min),g=setTimeout(()=>y(c().performance.max),_.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:_=>l(b=>({...b,events:{...b.events,..._}})),setSize:(_,b,S=0,E=0)=>{let C=c().camera,D={width:_,height:b,top:S,left:E};l(U=>({size:D,viewport:{...U.viewport,...p(C,d,D)}}))},setDpr:_=>l(b=>{let S=LI(_);return{viewport:{...b.viewport,dpr:S,initialDpr:b.viewport.initialDpr||S}}}),setFrameloop:(_="always")=>{let b=c().clock;b.stop(),b.elapsedTime=0,_!=="never"&&(b.start(),b.elapsedTime=0),l(()=>({frameloop:_}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:Dn.createRef(),active:!1,frames:0,priority:0,subscribe:(_,b,S)=>{let E=c().internal;return E.priority=E.priority+(b>0?1:0),E.subscribers.push({ref:_,priority:b,store:S}),E.subscribers=E.subscribers.sort((C,D)=>C.priority-D.priority),()=>{let C=c().internal;C!=null&&C.subscribers&&(C.priority=C.priority-(b>0?1:0),C.subscribers=C.subscribers.filter(D=>D.ref!==_))}}}}}),i=t.getState(),r=i.size,a=i.viewport.dpr,o=i.camera;return t.subscribe(()=>
4057{let{camera:l,size:c,viewport:f,gl:d,set:m}=t.getState();if(c.width!==r.width||c.height!==r.height||f.dpr!==a){r=c,a=f.dpr,Q9(l,c),f.dpr>0&&d.setPixelRatio(f.dpr);let p=typeof HTMLCanvasElement<"u"&&d.domElement instanceof HTMLCanvasElement;d.setSize(c.width,c.height,p)}l!==o&&(o=l,m(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(l)}})))}),t.subscribe(l=>n(l)),t};function tA(){let n=Dn.useContext(eA);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function pr(n=t=>t,e){return tA()(n,e)}function Mv(n,e=0){let t=tA(),i=t.getState().internal.subscribe,r=$w(n);return dp(()=>i(r,e,t),[e,i,t]),null}var _I=new WeakMap,eW=n=>{var e;return typeof n=="function"&&(n==null||(e=n.prototype)==null?void 0:e.constructor)===n};function FI(n,e){return function(t,...i){let r;return eW(t)?(r=_I.get(t),r||(r=new t,_I.set(t,r))):r=t,n&&n(r),Promise.all(i.map(a=>new Promise((o,l)=>r.load(a,c=>{Cr(c?.scene)&&Object.assign(c,NI(c.scene)),o(c)},e,c=>l(new Error(`Could not load ${a}: ${c?.message}`))))))}}function nA(n,e,t,i){let r=Array.isArray(e)?e:[e],a=m1(FI(t,i),[n,...r],{equal:Nn.equ});return Array.isArray(e)?a:a[0]}nA.preload=function(n,e,t){let i=Array.isArray(e)?e:[e];return uI(FI(t),[n,...i])};nA.clear=function(n,e){let t=Array.isArray(e)?e:[e];return cI([n,...t])};var tW=1,nW=8,iW=32,rW=2,aW={name:"@react-three/fiber",version:"9.5.0",description:"A React renderer for Threejs",keywords:["react","renderer","fiber","three","threejs"],author:"Paul Henschel (https://github.com/drcmda)",license:"MIT",maintainers:["Josh Ellis (https://github.com/joshuaellis)","Cody Bennett (https://github.com/codyjasonbennett)","Kris Baumgarter (https://github.com/krispya)"],bugs:{url:"https://github.com/pmndrs/react-three-fiber/issues"},homepage:"https://github.com/pmndrs/react-three-fiber#readme",repository:{type:"git",url:"git+https://github.com/pmndrs/react-three-fiber.git"},collective:{type:"opencollective",url:"https://opencollective.com/react-three-fiber"},main:"dist/react-three-fiber.cjs.js",module:"dist/react-three-fiber.esm.js",types:"dist/react-three-fiber.cjs.d.ts","react-native":"native/dist/react-three-fiber-native.cjs.js",sideEffects:!1,preconstruct:{entrypoints:["index.tsx","native.tsx"]},scripts:{prebuild:"cp ../../readme.md readme.md"},devDependencies:{"@types/react-reconciler":"^0.32.3","react-reconciler":"^0.33.0"},dependencies:{"@babel/runtime":"^7.17.8","@types/webxr":"*","base64-js":"^1.5.1",buffer:"^6.0.3","its-fine":"^2.0.0","react-use-measure":"^2.1.7",scheduler:"^0.27.0","suspend-react":"^0.1.3","use-sync-external-store":"^1.4.0",zustand:"^5.0.3"},peerDependencies:{expo:">=43.0","expo-asset":">=8.4","expo-file-system":">=11.0","expo-gl":">=11.0",react:">=19 <19.3","react-dom":">=19 <19.3","react-native":">=0.78",three:">=0.156"},peerDependenciesMeta:{"react-dom":{optional:!0},"react-native":{optional:!0},expo:{optional:!0},"expo-asset":{optional:!0},"expo-file-system":{optional:!0},"expo-gl":{optional:!0}}};function oW(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bI={exports:{}},jw={exports:{}};jw.exports;var xI;function sW(){return xI||(xI=1,function(n){n.exports=function(e){function t(s,u,h,v){return new Zz(s,u,h,v)}function i(){}function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(s){var u=s,h=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(h=u.return),s=u.return;while(s)}return u.tag===3?h:null}function o(s){if(a(s)!==s)throw Error(r(188))}function l(s){var u=s.alternate;if(!u){if(u=a(s),u===null)throw Error(r(188));return u!==s?null:s}for(var h=s,v=u;;){var M=h.return;if(M===null)break;var A=M.alternate;if(A===null){if(v=M.return,v!==null){h=v;continue}break}if(M.child===A.child){for(A=M.child;A;){if(A===h)return o(M),s;if(A===v)return o(M),u;A=A.sibling}throw Error(r(188))}if(h.return!==v.return)h=M,v=A;else{for(var k=!1,$=M.child;$;){if($===h){k=!0,h=M,v=A;break}if($===v){k=!0,v=M,h=A;break}$=$.sibling}if(!k){for($=A.child;$;){if($===h){k=!0,h=A,v=M;break}if($===v){k=!0,v=A,h=M;break}$=$.sibling}if(!k)throw Error(r(189))}}if(h.alternate!==v)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:u}function c(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=c(s),u!==null)return u;s=s.sibling}return null}function f(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(s.tag!==4&&(u=f(s),u!==null))return u;s=s.sibling}return null}function d(s){return s===null||typeof s!="object"?null:(s=HC&&s[HC]||s["@@iterator"],typeof s=="function"?s:null)}function m(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===ek?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case Df:return"Fragment";case yS:return"Profiler";case FC:return"StrictMode";case bS:return"Suspense";case xS:return"SuspenseList";case TS:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case Rf:return"Portal";case El:return s.displayName||"Context";case BC:return(s._context.displayName||"Context")+".Consumer";case _S:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case SS:return u=s.displayName||null,u!==null?u:m(s.type)||"Memo";case Ml:u=s._payload,s=s._init;try{return m(s(u))}catch{}}return null}function p(s){return{current:s}}function g(s){0>Lf||(s.current=RS[Lf],RS[Lf]=null,Lf--)}function y(s,u){Lf++,RS[Lf]=s.current,s.current=u}function T(s){return s>>>=0,s===0?32:31-(CF(s)/RF|0)|0}function x(s){var u=s&42;if(u!==0)return u;switch(s&-s){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;
vendor: 17,963 bytes, lines 4057-4064
4057case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function _(s,u,h){var v=s.pendingLanes;if(v===0)return 0;var M=0,A=s.suspendedLanes,k=s.pingedLanes;s=s.warmLanes;var $=v&134217727;return $!==0?(v=$&~A,v!==0?M=x(v):(k&=$,k!==0?M=x(k):h||(h=$&~s,h!==0&&(M=x(h))))):($=v&~A,$!==0?M=x($):k!==0?M=x(k):h||(h=v&~s,h!==0&&(M=x(h)))),M===0?0:u!==0&&u!==M&&(u&A)===0&&(A=M&-M,h=u&-u,A>=h||A===32&&(h&4194048)!==0)?u:M}function b(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function S(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32: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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function E(){var s=$v;return $v<<=1,($v&62914560)===0&&($v=4194304),s}function C(s){for(var u=[],h=0;31>h;h++)u.push(s);return u}function D(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function U(s,u,h,v,M,A){var k=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var $=s.entanglements,Ce=s.expirationTimes,We=s.hiddenUpdates;for(h=k&~h;0<h;){var st=31-oa(h),je=1<<st;$[st]=0,Ce[st]=-1;var ct=We[st];if(ct!==null)for(We[st]=null,st=0;st<ct.length;st++){var At=ct[st];At!==null&&(At.lane&=-536870913)}h&=~je}v!==0&&w(s,v,0),A!==0&&M===0&&s.tag!==0&&(s.suspendedLanes|=A&~(k&~u))}function w(s,u,h){s.pendingLanes|=u,s.suspendedLanes&=~u;var v=31-oa(u);s.entangledLanes|=u,s.entanglements[v]=s.entanglements[v]|1073741824|h&261930}function R(s,u){var h=s.entangledLanes|=u;for(s=s.entanglements;h;){var v=31-oa(h),M=1<<v;M&u|s[v]&u&&(s[v]|=u),h&=~M}}function L(s,u){var h=u&-u;return h=(h&42)!==0?1:I(h),(h&(s.suspendedLanes|u))!==0?0:h}function I(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function z(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function B(s){if(typeof NF=="function"&&PF(s),sa&&typeof sa.setStrictMode=="function")try{sa.setStrictMode(Lp,s)}catch{}}function V(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}function W(s){if(OS===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);OS=u&&u[1]||"",h3=-1<h.stack.indexOf(`
4058    at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
4059`+OS+s+h3}function X(s,u){if(!s||LS)return"";LS=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(u){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(At){var ct=At}Reflect.construct(s,[],je)}else{try{je.call()}catch(At){ct=At}s.call(je.prototype)}}else{try{throw Error()}catch(At){ct=At}(je=s())&&typeof je.catch=="function"&&je.catch(function(){})}}catch(At){if(At&&ct&&typeof At.stack=="string")return[At.stack,ct.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var M=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");M&&M.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=v.DetermineComponentFrameRoot(),k=A[0],$=A[1];if(k&&$){var Ce=k.split(`
4060`),We=$.split(`
4061`);for(M=v=0;v<Ce.length&&!Ce[v].includes("DetermineComponentFrameRoot");)v++;for(;M<We.length&&!We[M].includes("DetermineComponentFrameRoot");)M++;if(v===Ce.length||M===We.length)for(v=Ce.length-1,M=We.length-1;1<=v&&0<=M&&Ce[v]!==We[M];)M--;for(;1<=v&&0<=M;v--,M--)if(Ce[v]!==We[M]){if(v!==1||M!==1)do if(v--,M--,0>M||Ce[v]!==We[M]){var st=`
4062`+Ce[v].replace(" at new "," at ");return s.displayName&&st.includes("<anonymous>")&&(st=st.replace("<anonymous>",s.displayName)),st}while(1<=v&&0<=M);break}}}finally{LS=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?W(h):""}function K(s,u){switch(s.tag){case 26:case 27:case 5:return W(s.type);case 16:return W("Lazy");case 13:return s.child!==u&&u!==null?W("Suspense Fallback"):W("Suspense");case 19:return W("SuspenseList");case 0:case 15:return X(s.type,!1);case 11:return X(s.type.render,!1);case 1:return X(s.type,!0);case 31:return W("Activity");default:return""}}function pe(s){try{var u="",h=null;do u+=K(s,h),h=s,s=s.return;while(s);return u}catch(v){return`
4063Error generating stack: `+v.message+`
4064`+v.stack}}function Q(s,u){if(typeof s=="object"&&s!==null){var h=p3.get(s);return h!==void 0?h:(u={value:s,source:u,stack:pe(u)},p3.set(s,u),u)}return{value:s,source:u,stack:pe(u)}}function ee(s,u){Pf[If++]=Np,Pf[If++]=ty,ty=s,Np=u}function G(s,u,h){Ua[Oa++]=Uo,Ua[Oa++]=Oo,Ua[Oa++]=wl,wl=s;var v=Uo;s=Oo;var M=32-oa(v)-1;v&=~(1<<M),h+=1;var A=32-oa(u)+M;if(30<A){var k=M-M%5;A=(v&(1<<k)-1).toString(32),v>>=k,M-=k,Uo=1<<32-oa(u)+M|h<<M|v,Oo=A+s}else Uo=1<<A|h<<M|v,Oo=s}function Z(s){s.return!==null&&(ee(s,1),G(s,1,0))}function ne(s){for(;s===ty;)ty=Pf[--If],Pf[If]=null,Np=Pf[--If],Pf[If]=null;for(;s===wl;)wl=Ua[--Oa],Ua[Oa]=null,Oo=Ua[--Oa],Ua[Oa]=null,Uo=Ua[--Oa],Ua[Oa]=null}function he(s,u){Ua[Oa++]=Uo,Ua[Oa++]=Oo,Ua[Oa++]=wl,Uo=u.id,Oo=u.overflow,wl=s}function se(s,u){y(Al,u),y(Pp,s),y(Fi,null),s=ik(u),g(Fi),y(Fi,s)}function J(){g(Fi),g(Pp),g(Al)}function te(s){s.memoizedState!==null&&y(ny,s);var u=Fi.current,h=rk(u,s.type);u!==h&&(y(Pp,s),y(Fi,h))}function re(s){Pp.current===s&&(g(Fi),g(Pp)),ny.current===s&&(g(ny),hs?ju._currentValue=Uf:ju._currentValue2=Uf)}function Oe(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw me(Q(u,s)),NS}function Be(s,u){if(!ar)throw Error(r(175));rF(s.stateNode,s.type,s.memoizedProps,u,s)||Oe(s,!0)}function De(s){for(Bi=s.return;Bi;)switch(Bi.tag){case 5:case 31:case 13:La=!1;return;case 27:case 3:La=!0;return;default:Bi=Bi.return}}function Ue(s){if(!ar||s!==Bi)return!1;if(!qt)return De(s),qt=!0,!1;var u=s.tag;if(pi?u!==3&&u!==27&&(u!==5||e3(s.type)&&!Kv(s.type,s.memoizedProps))&&In&&Oe(s):u!==3&&(u!==5||e3(s.type)&&!Kv(s.type,s.memoizedProps))&&In&&Oe(s),De(s),u===13){if(!ar)throw Error(r(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));In=uF(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));In=lF(s)}else In=pi&&u===27?jk(s.type,In):Bi?$C(s.stateNode):null;return!0}function Xe(){ar&&(In=Bi=null,qt=!1)}function ge(){var s=Cl;return s!==null&&(Ir===null?Ir=s:Ir.push.apply(Ir,s),Cl=null),s}function me(s){Cl===null?Cl=[s]:Cl.push(s)}function ce(s,u,h){hs?(y(iy,u._currentValue),u._currentValue=h):(y(iy,u._currentValue2),u._currentValue2=h)}function Te(s){var u=iy.current;hs?s._currentValue=u:s._currentValue2=u,g(iy)}function F(s,u,h){for(;s!==null;){var v=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,v!==null&&(v.childLanes|=u)):v!==null&&(v.childLanes&u)!==u&&(v.childLanes|=u),s===h)break;s=s.return}}function He(s,u,h,v){var M=s.child;for(M!==null&&(M.return=s);M!==null;){var A=M.dependencies;if(A!==null){var k=M.child;A=A.firstContext;e:for(;A!==null;){var $=A;A=M;for(var Ce=0;Ce<u.length;Ce++)if($.context===u[Ce]){A.lanes|=h,$=A.alternate,$!==null&&($.lanes|=h),F(A.return,h,s),v||(k=null);break e}A=$.next}}else if(M.tag===18){if(k=M.return,k===null)throw Error(r(341));k.lanes|=h,A=k.alternate,A!==null&&(A.lanes|=h),F(k,h,s),k=null}else k=M.child;if(k!==null)k.return=M;else for(k=M;k!==null;){if(k===s){k=null;break}if(M=k.sibling,M!==null){M.return=k.return,k=M;break}k=k.return}M=k}}function Me(s,u,h,v){s=null;for(var M=u,A=!1;M!==null;){if(!A){if((M.flags&524288)!==0)A=!0;else if((M.flags&262144)!==0)break}if(M.tag===10){var k=M.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var $=M.type;la(M.pendingProps.value,k.value)||(s!==null?s.push($):s=[$])}}else if(M===ny.current){if(k=M.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==M.memoizedState.memoizedState&&(s!==null?s.push(ju):s=[ju])}M=M.return}s!==null&&He(u,s,h,v),u.flags|=262144}function _e(s){for(s=s.firstContext;s!==null;){var u=s.context;if(!la(hs?u._currentValue:u._currentValue2,s.memoizedValue))return!0;s=s.next}return!1}function Ae(s){Zu=s,ms=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function P(s){return q(Zu,s)}function O(s,u){return Zu===null&&Ae(s),q(s,u)}function q(s,u){var h=hs?u._currentValue:u._currentValue2;if(u={context:u,memoizedValue:h,next:null},ms===null){if(s===null)throw Error(r(308));ms=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else ms=ms.next=u;return h}function de(){return{controller:new zF,data:new Map,refCount:0}}function le(s){s.refCount--,s.refCount===0&&kF(FF,function(){s.controller.abort()})}function ie(){}function ze(s){s!==zf&&s.next===null&&(zf===null?ry=zf=s:zf=zf.next=s),ay=!0,PS||(PS=!0,Y())}function Re(s,u){if(!IS&&ay){IS=!0;do for(var h=!1,v=ry;v!==null;){if(!u)if(s!==0){var M=v.pendingLanes;if(M===0)var A=0;else{var k=v.suspendedLanes,$=v.pingedLanes;A=(1<<31-oa(42|s)+1)-1,A&=M&~(k&~$),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(h=!0,Fe(v,A))}else A=Wt,A=_(v,v===yn?A:0,v.cancelPendingCommit!==null||v.timeoutHandle!==Yu),(A&3)===0||b(v,A)||(h=!0,Fe(v,A));v=v.next}while(h);IS=!1}}function Ye(){at()}function at(){ay=PS=!1;var s=0;Ku!==0&&hk()&&(s=Ku);for(var u=Nr(),h=null,v=ry;v!==null;){var M=v.next,A=we(v,u);A===0?(v.next=null,h===null?ry=M:h.next=M,M===null&&(zf=h)):(h=v,(s!==0||(A&3)!==0)&&(ay=!0)),v=M}mi!==0&&mi!==5||Re(s,!1),Ku!==0&&(Ku=0)}function we(s,u){for(var h=s.suspendedLanes,v=s.pingedLanes,M=s.expirationTimes,A=s.pendingLanes&-62914561;0<A;){var k=31-oa(A),$=1<<k,Ce=M[k];Ce===-1?(($&h)===0||($&v)!==0)&&(M[k]=S($,u)):Ce<=u&&(s.expiredLanes|=$),A&=~$}if(u=yn,h=Wt,h=_(s,s===u?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==Yu),v=s.callbackNode,h===0||s===u&&(un===2||un===9)||s.cancelPendingCommit!==null)return v!==null&&v!==null&&DS(v),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||b(s,h)){if(u=h&-h,u===s.callbackPriority)return u;switch(v!==null&&DS(v),z(h)){case 2:case 8:h=OF;break;case 32:h=US;break;case 268435456:h=LF;break;default:h=US}return v=Pe.bind(null,s),h=ey(h,v),s.callbackPriority=u,s.callbackNode=h,u}return v!==null&&v!==null&&DS(v),s.callbackPriority=2,s.callbackNode=null,2}function Pe(s,u){if(mi!==0&&mi!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(Rp()&&s.callbackNode!==h)return null;var v=Wt;return v=_(s,s===yn?v:0,s.cancelPendingCommit!==null||s.timeoutHandle!==Yu),v===0?null:(pC(s,v,u),we(s,Nr()),s.callbackNode!=null&&s.callbackNode===h?Pe.bind(null,s):null)}function Fe(s,u){if(Rp())return null;pC(s,u,!0)}function Y(){bk?xk(function(){(zt&6)!==0?ey(f3,Ye):at()}):ey(f3,Ye)}function oe(){if(Ku===0){var s=kf;s===0&&(s=Qv,Qv<<=1,(Qv&261888)===0&&(Qv=256)),Ku=s}return Ku}function Ge(s,u){if(Ip===null){var h=Ip=[];zS=0,kf=oe(),Ff={status:"pending",value:void 0,then:function(v){h.push(v)}}}return zS++,u.then(j,j),u}function j(){if(--zS===0&&Ip!==null){Ff!==null&&(Ff.status="fulfilled");var s=Ip;Ip=null,kf=0,Ff=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function Se(s,u){var h=[],v={status:"pending",value:null,reason:null,then:function(M){h.push(M)}};return s.then(function(){v.status="fulfilled",v.value=u;for(var M=0;M<h.length;M++)(0,h[M])(u)},function(M){for(v.status="rejected",v.reason=M,M=0;M<h.length;M++)(0,h[M])(void 0)}),v}function Ie(){var s=Qu.current;return s!==null?s:yn.pooledCache}function Ke(s,u){u===null?y(Qu,Qu.current):y(Qu,u.pool)}function ke(){var s=Ie();return s===null?null:{parent:hs?zn._currentValue:zn._currentValue2,pool:s}}function fe(s,u){if(la(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var h=Object.keys(s),v=Object.keys(u);if(h.length!==v.length)return!1;for(v=0;v<h.length;v++){var M=h[v];if(!IF.call(u,M)||!la(s[M],u[M]))return!1}return!0}function qe(s){return s=s.status,s==="fulfilled"||s==="rejected"}function it(s,u,h){switch(h=s[h],h===void 0?s.push(u):h!==u&&(u.then(ie,ie),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,jt(s),s;default:if(typeof u.status=="string")u.then(ie,ie);else{if(s=yn,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(v){if(u.status==="pending"){var M=u;M.status="fulfilled",M.value=v}},function(v){if(u.status==="pending"){var M=u;M.status="rejected",M.reason=v}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,jt(s),s}throw Ju=u,Bf}}function rt(s){try{var u=s._init;return u(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Ju=h,Bf):h}}function dt(){if(Ju===null)throw Error(r(459));var s=Ju;return Ju=null,s}function jt(s){if(s===Bf||s===oy)throw Error(r(483))}function Ht(s){var u=zp;return zp+=1,Hf===null&&(Hf=[]),it(Hf,s,u)}function pn(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function ti(s,u){throw u.$$typeof===Jz?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function $r(s){function u(be,ue){if(s){var Ee=be.deletions;Ee===null?(be.deletions=[ue],be.flags|=16):Ee.push(ue)}}function h(be,ue){if(!s)return null;for(;ue!==null;)u(be,ue),ue=ue.sibling;return null}function v(be){for(var ue=new Map;be!==null;)be.key!==null?ue.set(be.key,be):ue.set(be.index,be),be=be.sibling;return ue}function M(be,ue){return be=ds(be,ue),be.index=0,be.sibling=null,be}function A(be,ue,Ee){return be.index=Ee,s?(Ee=be.alternate,Ee!==null?(Ee=Ee.index,Ee<ue?(be.flags|=67108866,ue):Ee):(be.flags|=67108866,ue)):(be.flags|=1048576,ue)}function k(be){return s&&be.alternate===null&&(be.flags|=67108866),be}function $(be,ue,Ee,Ze){return ue===null||ue.tag!==6?(ue=pS(Ee,be.mode,Ze),ue.return=be,ue):(ue=M(ue,Ee),ue.return=be,ue)}function Ce(be,ue,Ee,Ze){var _t=Ee.type;return _t===Df?st(be,ue,Ee.props.children,Ze,Ee.key):ue!==null&&(ue.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===Ml&&rt(_t)===ue.type)?(ue=M(ue,Ee.props),pn(ue,Ee),ue.return=be,ue):(ue=Yv(Ee.type,Ee.key,Ee.props,null,be.mode,Ze),pn(ue,Ee),ue.return=be,ue)}function We(be,ue,Ee,Ze){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==Ee.containerInfo||ue.stateNode.implementation!==Ee.implementation?(ue=mS(Ee,be.mode,Ze),ue.return=be,ue):(ue=M(ue,Ee.children||[]),ue.return=be,ue)}function st(be,ue,Ee,Ze,_t){return ue===null||ue.tag!==7?(ue=qu(Ee,be.mode,Ze,_t),ue.return=be,ue):(ue=M(ue,Ee),ue.return=be,ue)}function je(be,ue,Ee){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=pS(""+ue,be.mode,Ee),ue.return=be,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case jv:return Ee=Yv(ue.type,ue.key,ue.props,null,be.mode,Ee),pn(Ee,ue),Ee.return=be,Ee;case Rf:return ue=mS(ue,be.mode,Ee),ue.return=be,ue;case Ml:return ue=rt(ue),je(be,ue,Ee)}if(Zv(ue)||d(ue))return ue=qu(ue,be.mode,Ee,null),ue.return=be,ue;if(typeof ue.then=="function")return je(be,Ht(ue),Ee);if(ue.$$typeof===El)return je(be,O(be,ue),Ee);ti(be,ue)}return null}function ct(be,ue,Ee,Ze){var _t=ue!==null?ue.key:null;if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return _t!==null?null:$(be,ue,""+Ee,Ze);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case jv:return Ee.key===_t?Ce(be,ue,Ee,Ze):null;case Rf:return Ee.key===_t?We(be,ue,Ee,Ze):null;case Ml:return Ee=rt(Ee),ct(be,ue,Ee,Ze)}if(Zv(Ee)||d(Ee))return _t!==null?null:st(be,ue,Ee,Ze,null);if(typeof Ee.then=="function")return ct(be,ue,Ht(Ee),Ze);if(Ee.$$typeof===El)return ct(be,ue,O(be,Ee),Ze);ti(be,Ee)}return null}function At(be,ue,Ee,Ze,_t){if(typeof Ze=="string"&&Ze!==""||typeof Ze=="number"||typeof Ze=="bigint")return be=be.get(Ee)||null,$(ue,be,""+Ze,_t);if(typeof Ze=="object"&&Ze!==null){switch(Ze.$$typeof){case jv:return be=be.get(Ze.key===null?Ee:Ze.key)||null,Ce(ue,be,Ze,_t);case Rf:return be=be.get(Ze.key===null?Ee:Ze.key)||null,We(ue,be,Ze,_t);case Ml:return Ze=rt(Ze),At(be,ue,Ee,Ze,_t)}if(Zv(Ze)||d(Ze))return be=be.get(Ee)||null,st(ue,be,Ze,_t,null);if(typeof Ze.then=="function")return At(be,ue,Ee,Ht(Ze),_t);if(Ze.$$typeof===El)return At(be,ue,Ee,O(ue,Ze),_t);ti(ue,Ze)}return null}function oi(be,ue,Ee,Ze){for(var _t=null,kn=null,St=ue,Qt=ue=0,Ai=null;St!==null&&Qt<Ee.length;Qt++){St.index>Qt?(Ai=St,St=null):Ai=St.sibling;var Jt=ct(be,St,Ee[Qt],Ze);if(Jt===null){St===null&&(St=Ai);break}s&&St&&Jt.alternate===null&&u(be,St),ue=A(Jt,ue,Qt),kn===null?_t=Jt:kn.sibling=Jt,kn=Jt,St=Ai}if(Qt===Ee.length)return h(be,St),qt&&ee(be,Qt),_t;if(St===null){for(;Qt<Ee.length;Qt++)St=je(be,Ee[Qt],Ze),St!==null&&(ue=A(St,ue,Qt),kn===null?_t=St:kn.sibling=St,kn=St);return qt&&ee(be,Qt),_t}for(St=v(St);Qt<Ee.length;Qt++)Ai=At(St,be,Qt,Ee[Qt],Ze),Ai!==null&&(s&&Ai.alternate!==null&&St.delete(Ai.key===null?Qt:Ai.key),ue=A(Ai,ue,Qt),kn===null?_t=Ai:kn.sibling=Ai,kn=Ai);return s&&St.forEach(function(Nl){return u(be,Nl)}),qt&&ee(be,Qt),_t}function Wp(be,ue,Ee,Ze){if(Ee==null)throw Error(r(151));for(var _t=null,kn=null,St=ue,Qt=ue=0,Ai=null,Jt=Ee.next();St!==null&&!Jt.done;Qt++,Jt=Ee.next()){St.index>Qt?(Ai=St,St=null):Ai=St.sibling;var Nl=ct(be,St,Jt.value,Ze);if(Nl===null){St===null&&(St=Ai);break}s&&St&&Nl.alternate===null&&u(be,St),ue=A(Nl,ue,Qt),kn===null?_t=Nl:kn.sibling=Nl,kn=Nl,St=Ai}if(Jt.done)return h(be,St),qt&&ee(be,Qt),_t;if(St===null){for(;!Jt.done;
vendor: 5,165 bytes, line 4064
4064Qt++,Jt=Ee.next())Jt=je(be,Jt.value,Ze),Jt!==null&&(ue=A(Jt,ue,Qt),kn===null?_t=Jt:kn.sibling=Jt,kn=Jt);return qt&&ee(be,Qt),_t}for(St=v(St);!Jt.done;Qt++,Jt=Ee.next())Jt=At(St,be,Qt,Jt.value,Ze),Jt!==null&&(s&&Jt.alternate!==null&&St.delete(Jt.key===null?Qt:Jt.key),ue=A(Jt,ue,Qt),kn===null?_t=Jt:kn.sibling=Jt,kn=Jt);return s&&St.forEach(function(GF){return u(be,GF)}),qt&&ee(be,Qt),_t}function nc(be,ue,Ee,Ze){if(typeof Ee=="object"&&Ee!==null&&Ee.type===Df&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case jv:e:{for(var _t=Ee.key;ue!==null;){if(ue.key===_t){if(_t=Ee.type,_t===Df){if(ue.tag===7){h(be,ue.sibling),Ze=M(ue,Ee.props.children),Ze.return=be,be=Ze;break e}}else if(ue.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===Ml&&rt(_t)===ue.type){h(be,ue.sibling),Ze=M(ue,Ee.props),pn(Ze,Ee),Ze.return=be,be=Ze;break e}h(be,ue);break}else u(be,ue);ue=ue.sibling}Ee.type===Df?(Ze=qu(Ee.props.children,be.mode,Ze,Ee.key),Ze.return=be,be=Ze):(Ze=Yv(Ee.type,Ee.key,Ee.props,null,be.mode,Ze),pn(Ze,Ee),Ze.return=be,be=Ze)}return k(be);case Rf:e:{for(_t=Ee.key;ue!==null;){if(ue.key===_t)if(ue.tag===4&&ue.stateNode.containerInfo===Ee.containerInfo&&ue.stateNode.implementation===Ee.implementation){h(be,ue.sibling),Ze=M(ue,Ee.children||[]),Ze.return=be,be=Ze;break e}else{h(be,ue);break}else u(be,ue);ue=ue.sibling}Ze=mS(Ee,be.mode,Ze),Ze.return=be,be=Ze}return k(be);case Ml:return Ee=rt(Ee),nc(be,ue,Ee,Ze)}if(Zv(Ee))return oi(be,ue,Ee,Ze);if(d(Ee)){if(_t=d(Ee),typeof _t!="function")throw Error(r(150));return Ee=_t.call(Ee),Wp(be,ue,Ee,Ze)}if(typeof Ee.then=="function")return nc(be,ue,Ht(Ee),Ze);if(Ee.$$typeof===El)return nc(be,ue,O(be,Ee),Ze);ti(be,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint"?(Ee=""+Ee,ue!==null&&ue.tag===6?(h(be,ue.sibling),Ze=M(ue,Ee),Ze.return=be,be=Ze):(h(be,ue),Ze=pS(Ee,be.mode,Ze),Ze.return=be,be=Ze),k(be)):h(be,ue)}return function(be,ue,Ee,Ze){try{zp=0;var _t=nc(be,ue,Ee,Ze);return Hf=null,_t}catch(St){if(St===Bf||St===oy)throw St;var kn=t(29,St,null,be.mode);return kn.lanes=Ze,kn.return=be,kn}finally{}}}function Pi(){for(var s=Vf,u=FS=Vf=0;u<s;){var h=Na[u];Na[u++]=null;var v=Na[u];Na[u++]=null;var M=Na[u];Na[u++]=null;var A=Na[u];if(Na[u++]=null,v!==null&&M!==null){var k=v.pending;k===null?M.next=M:(M.next=k.next,k.next=M),v.pending=M}A!==0&&Zn(h,M,A)}}function tr(s,u,h,v){Na[Vf++]=s,Na[Vf++]=u,Na[Vf++]=h,Na[Vf++]=v,FS|=v,s.lanes|=v,s=s.alternate,s!==null&&(s.lanes|=v)}function di(s,u,h,v){return tr(s,u,h,v),gr(s)}function jn(s,u){return tr(s,null,null,u),gr(s)}function Zn(s,u,h){s.lanes|=h;var v=s.alternate;v!==null&&(v.lanes|=h);for(var M=!1,A=s.return;A!==null;)A.childLanes|=h,v=A.alternate,v!==null&&(v.childLanes|=h),A.tag===22&&(s=A.stateNode,s===null||s._visibility&1||(M=!0)),s=A,A=A.return;return s.tag===3?(A=s.stateNode,M&&u!==null&&(M=31-oa(h),s=A.hiddenUpdates,v=s[M],v===null?s[M]=[u]:v.push(u),u.lane=h|536870912),A):null}function gr(s){if(50<Gp)throw Gp=0,QS=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}function Qa(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ao(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function vr(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Dr(s,u,h){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(zt&2)!==0){var M=v.pending;return M===null?u.next=u:(u.next=M.next,M.next=u),v.pending=u,u=gr(s),Zn(s,null,h),u}return tr(s,v,u,h),gr(s)}function ea(s,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var v=u.lanes;v&=s.pendingLanes,h|=v,u.lanes=h,R(s,h)}}function is(s,u){var h=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,h===v)){var M=null,A=null;if(h=h.firstBaseUpdate,h!==null){do{var k={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};A===null?M=A=k:A=A.next=k,h=h.next}while(h!==null);A===null?M=A=u:A=A.next=u}else M=A=u;h={baseState:v.baseState,firstBaseUpdate:M,lastBaseUpdate:A,shared:v.shared,callbacks:v.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=u:s.next=u,h.lastBaseUpdate=u}function rs(){if(BS){var s=Ff;if(s!==null)throw s}}function Co(s,u,h,v){BS=!1;var M=s.updateQueue;Rl=!1;var A=M.firstBaseUpdate,k=M.lastBaseUpdate,$=M.shared.pending;if($!==null){M.shared.pending=null;var Ce=$,We=Ce.next;Ce.next=null,k===null?A=We:k.next=We,k=Ce;var st=s.alternate;st!==null&&(st=st.updateQueue,$=st.lastBaseUpdate,$!==k&&($===null?st.firstBaseUpdate=We:$.next=We,st.lastBaseUpdate=Ce))}if(A!==null){var je=M.baseState;k=0,st=We=Ce=null,$=A;do{var ct=$.lane&-536870913,At=ct!==$.lane;if(At?(Wt&ct)===ct:(v&ct)===ct){ct!==0&&ct===kf&&(BS=!0),st!==null&&(st=st.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var oi=s,Wp=$;ct=u;var nc=h;switch(Wp.tag){case 1:if(oi=Wp.payload,typeof oi=="function"){je=oi.call(nc,je,ct);break e}
vendor: 5,698 bytes, line 4064
4064je=oi;break e;case 3:oi.flags=oi.flags&-65537|128;case 0:if(oi=Wp.payload,ct=typeof oi=="function"?oi.call(nc,je,ct):oi,ct==null)break e;je=vS({},je,ct);break e;case 2:Rl=!0}}ct=$.callback,ct!==null&&(s.flags|=64,At&&(s.flags|=8192),At=M.callbacks,At===null?M.callbacks=[ct]:At.push(ct))}else At={lane:ct,tag:$.tag,payload:$.payload,callback:$.callback,next:null},st===null?(We=st=At,Ce=je):st=st.next=At,k|=ct;if($=$.next,$===null){if($=M.shared.pending,$===null)break;At=$,$=At.next,At.next=null,M.lastBaseUpdate=At,M.shared.pending=null}}while(!0);st===null&&(Ce=je),M.baseState=Ce,M.firstBaseUpdate=We,M.lastBaseUpdate=st,A===null&&(M.shared.lanes=0),Ul|=k,s.lanes=k,s.memoizedState=je}}function as(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function dl(s,u){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)as(h[s],u)}function hl(s,u){s=ys,y(ly,s),y(Gf,u),ys=s|u.baseLanes}function N(){y(ly,ys),y(Gf,Gf.current)}function ae(){ys=ly.current,g(Gf),g(ly)}function xe(s){var u=s.alternate;y(Kn,Kn.current&1),y(ua,s),ao===null&&(u===null||Gf.current!==null||u.memoizedState!==null)&&(ao=s)}function ve(s){y(Kn,Kn.current),y(ua,s),ao===null&&(ao=s)}function ye(s){s.tag===22?(y(Kn,Kn.current),y(ua,s),ao===null&&(ao=s)):Je()}function Je(){y(Kn,Kn.current),y(ua,ua.current)}function et(s){g(ua),ao===s&&(ao=null),g(Kn)}function nt(s){for(var u=s;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||wS(h)||AS(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function Qe(){throw Error(r(321))}function ft(s,u){if(u===null)return!1;for(var h=0;h<u.length&&h<s.length;h++)if(!la(s[h],u[h]))return!1;return!0}function vt(s,u,h,v,M,A){return gs=A,Dt=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,yt.H=s===null||s.memoizedState===null?v3:HS,ec=!1,A=h(v,M),ec=!1,Wf&&(A=ht(u,h,v,M)),Mt(s),A}function Mt(s){yt.H=Fp;var u=mn!==null&&mn.next!==null;if(gs=0,ni=mn=Dt=null,uy=!1,kp=0,Xf=null,u)throw Error(r(300));s===null||ii||(s=s.dependencies,s!==null&&_e(s)&&(ii=!0))}function ht(s,u,h,v){Dt=s;var M=0;do{if(Wf&&(Xf=null),kp=0,Wf=!1,25<=M)throw Error(r(301));if(M+=1,ni=mn=null,s.updateQueue!=null){var A=s.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}yt.H=y3,A=u(h,v)}while(Wf);return A}function Zt(){var s=yt.H,u=s.useState()[0];return u=typeof u.then=="function"?bt(u):u,s=s.useState()[0],(mn!==null?mn.memoizedState:null)!==s&&(Dt.flags|=1024),u}function en(){var s=cy!==0;return cy=0,s}function on(s,u,h){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~h}function Lt(s){if(uy){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}uy=!1}gs=0,ni=mn=Dt=null,Wf=!1,kp=cy=0,Xf=null}function Vt(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ni===null?Dt.memoizedState=ni=s:ni=ni.next=s,ni}function $e(){if(mn===null){var s=Dt.alternate;s=s!==null?s.memoizedState:null}else s=mn.next;var u=ni===null?Dt.memoizedState:ni.next;if(u!==null)ni=u,mn=s;else{if(s===null)throw Dt.alternate===null?Error(r(467)):Error(r(310));mn=s,s={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},ni===null?Dt.memoizedState=ni=s:ni=ni.next=s}return ni}function Vn(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bt(s){var u=kp;return kp+=1,Xf===null&&(Xf=[]),s=it(Xf,s,u),u=Dt,(ni===null?u.memoizedState:ni.next)===null&&(u=u.alternate,yt.H=u===null||u.memoizedState===null?v3:HS),s}function Ei(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return bt(s);if(s.$$typeof===El)return P(s)}throw Error(r(438,String(s)))}function hi(s){var u=null,h=Dt.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var v=Dt.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(u={data:v.data.map(function(M){return M.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=Vn(),Dt.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(s),v=0;v<s;v++)h[v]=$z;return u.index++,h}function Pn(s,u){return typeof u=="function"?u(s):u}function Ur(s){var u=$e();return Gt(u,mn,s)}function Gt(s,u,h){var v=s.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=h;var M=s.baseQueue,A=v.pending;if(A!==null){if(M!==null){var k=M.next;M.next=A.next,A.next=k}u.baseQueue=M=A,v.pending=null}if(A=s.baseState,M===null)s.memoizedState=A;else{u=M.next;var $=k=null,Ce=null,We=u,st=!1;do{var je=We.lane&-536870913;if(je!==We.lane?(Wt&je)===je:(gs&je)===je){var ct=We.revertLane;if(ct===0)Ce!==null&&(Ce=Ce.next={lane:0,revertLane:0,gesture:null,action:We.action,hasEagerState:We.hasEagerState,eagerState:We.eagerState,next:null}),je===kf&&(st=!0);else if((gs&ct)===ct){We=We.next,ct===kf&&(st=!0);continue}else je={lane:0,revertLane:We.revertLane,gesture:null,action:We.action,hasEagerState:We.hasEagerState,eagerState:We.eagerState,next:null},Ce===null?($=Ce=je,k=A):Ce=Ce.next=je,Dt.lanes|=ct,Ul|=ct;je=We.action,ec&&h(A,je),A=We.hasEagerState?We.eagerState:h(A,je)}else ct={lane:je,revertLane:We.revertLane,gesture:We.gesture,action:We.action,hasEagerState:We.hasEagerState,eagerState:We.eagerState,next:null},Ce===null?($=Ce=ct,k=A):Ce=Ce.next=ct,Dt.lanes|=je,Ul|=je;We=We.next}
vendor: 7,666 bytes, line 4064
4064while(We!==null&&We!==u);if(Ce===null?k=A:Ce.next=$,!la(A,s.memoizedState)&&(ii=!0,st&&(h=Ff,h!==null)))throw h;s.memoizedState=A,s.baseState=k,s.baseQueue=Ce,v.lastRenderedState=A}return M===null&&(v.lanes=0),[s.memoizedState,v.dispatch]}function xn(s){var u=$e(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var v=h.dispatch,M=h.pending,A=u.memoizedState;if(M!==null){h.pending=null;var k=M=M.next;do A=s(A,k.action),k=k.next;while(k!==M);la(A,u.memoizedState)||(ii=!0),u.memoizedState=A,u.baseQueue===null&&(u.baseState=A),h.lastRenderedState=A}return[A,v]}function yr(s,u,h){var v=Dt,M=$e(),A=qt;if(A){if(h===void 0)throw Error(r(407));h=h()}else h=u();var k=!la((mn||M).memoizedState,h);if(k&&(M.memoizedState=h,ii=!0),M=M.queue,ls(ta.bind(null,v,M,s),[s]),M.getSnapshot!==u||k||ni!==null&&ni.memoizedState.tag&1){if(v.flags|=2048,ss(9,{destroy:void 0},Or.bind(null,v,M,h,u),null),yn===null)throw Error(r(349));A||(gs&127)!==0||Un(v,u,h)}return h}function Un(s,u,h){s.flags|=16384,s={getSnapshot:u,value:h},u=Dt.updateQueue,u===null?(u=Vn(),Dt.updateQueue=u,u.stores=[s]):(h=u.stores,h===null?u.stores=[s]:h.push(s))}function Or(s,u,h,v){u.value=h,u.getSnapshot=v,Ja(u)&&gp(s)}function ta(s,u,h){return h(function(){Ja(u)&&gp(s)})}function Ja(s){var u=s.getSnapshot;s=s.value;try{var h=u();return!la(s,h)}catch{return!0}}function gp(s){var u=jn(s,2);u!==null&&Lr(u,s,2)}function pl(s){var u=Vt();if(typeof s=="function"){var h=s;if(s=h(),ec){B(!0);try{h()}finally{B(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:s},u}function os(s,u,h,v){return s.baseState=h,Gt(s,mn,typeof v=="function"?v:Pn)}function ml(s,u,h,v,M){if(Pv(s))throw Error(r(485));if(s=u.action,s!==null){var A={payload:M,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){A.listeners.push(k)}};yt.T!==null?h(!0):A.isTransition=!1,v(A),h=u.pending,h===null?(A.next=u.pending=A,gl(u,A)):(A.next=h.next,u.pending=h.next=A)}}function gl(s,u){var h=u.action,v=u.payload,M=s.state;if(u.isTransition){var A=yt.T,k={};yt.T=k;try{var $=h(M,v),Ce=yt.S;Ce!==null&&Ce(k,$),vp(s,u,$)}catch(We){zu(s,u,We)}finally{A!==null&&k.types!==null&&(A.types=k.types),yt.T=A}}else try{A=h(M,v),vp(s,u,A)}catch(We){zu(s,u,We)}}function vp(s,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(v){vl(s,u,v)},function(v){return zu(s,u,v)}):vl(s,u,h)}function vl(s,u,h){u.status="fulfilled",u.value=h,yf(u),s.state=h,u=s.pending,u!==null&&(h=u.next,h===u?s.pending=null:(h=h.next,u.next=h,gl(s,h)))}function zu(s,u,h){var v=s.pending;if(s.pending=null,v!==null){v=v.next;do u.status="rejected",u.reason=h,yf(u),u=u.next;while(u!==v)}s.action=null}function yf(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function yp(s,u){return u}function ku(s,u){if(qt){var h=yn.formState;if(h!==null){e:{var v=Dt;if(qt){if(In){var M=qk(In,La);if(M){In=$C(M),v=Yk(M);break e}}Oe(v)}v=!1}v&&(u=h[0])}}h=Vt(),h.memoizedState=h.baseState=u,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yp,lastRenderedState:u},h.queue=v,h=eo.bind(null,Dt,v),v.dispatch=h,v=pl(!1);var A=H1.bind(null,Dt,!1,v.queue);return v=Vt(),M={state:u,dispatch:null,action:s,pending:null},v.queue=M,h=ml.bind(null,Dt,M,A,h),M.dispatch=h,v.memoizedState=s,[u,h,!1]}function _f(s){var u=$e();return _p(u,mn,s)}function _p(s,u,h){if(u=Gt(s,u,yp)[0],s=Ur(Pn)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var v=bt(u)}catch(k){throw k===Bf?oy:k}else v=u;u=$e();var M=u.queue,A=M.dispatch;return h!==u.memoizedState&&(Dt.flags|=2048,ss(9,{destroy:void 0},na.bind(null,M,h),null)),[v,A,s]}function na(s,u){s.action=u}function bf(s){var u=$e(),h=mn;if(h!==null)return _p(u,h,s);$e(),u=u.memoizedState,h=$e();var v=h.queue.dispatch;return h.memoizedState=s,[u,v,!1]}function ss(s,u,h,v){return s={tag:s,create:h,deps:v,inst:u,next:null},u=Dt.updateQueue,u===null&&(u=Vn(),Dt.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=s.next=s:(v=h.next,h.next=s,s.next=v,u.lastEffect=s),s}function bp(){return $e().memoizedState}function yl(s,u,h,v){var M=Vt();Dt.flags|=s,M.memoizedState=ss(1|u,{destroy:void 0},h,v===void 0?null:v)}function Fu(s,u,h,v){var M=$e();v=v===void 0?null:v;var A=M.memoizedState.inst;mn!==null&&v!==null&&ft(v,mn.memoizedState.deps)?M.memoizedState=ss(u,A,h,v):(Dt.flags|=s,M.memoizedState=ss(1|u,A,h,v))}function xp(s,u){yl(8390656,8,s,u)}function ls(s,u){Fu(2048,8,s,u)}function Bu(s){Dt.flags|=4;var u=Dt.updateQueue;if(u===null)u=Vn(),Dt.updateQueue=u,u.events=[s];else{var h=u.events;h===null?u.events=[s]:h.push(s)}}function $a(s){var u=$e().memoizedState;return Bu({ref:u,nextImpl:s}),function(){if((zt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function Sp(s,u){return Fu(4,2,s,u)}function xf(s,u){return Fu(4,4,s,u)}function Sf(s,u){if(typeof u=="function"){s=s();var h=u(s);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function _l(s,u,h){h=h!=null?h.concat([s]):null,Fu(4,4,Sf.bind(null,u,s),h)}function Tf(){}function bl(s,u){var h=$e();u=u===void 0?null:u;var v=h.memoizedState;return u!==null&&ft(u,v[1])?v[0]:(h.memoizedState=[s,u],s)}function Ef(s,u){var h=$e();u=u===void 0?null:u;var v=h.memoizedState;if(u!==null&&ft(u,v[1]))return v[0];if(v=s(),ec){B(!0);try{s()}finally{B(!1)}}return h.memoizedState=[v,u],v}function Ii(s,u,h){return h===void 0||(gs&1073741824)!==0&&(Wt&261930)===0?s.memoizedState=u:(s.memoizedState=h,s=hC(),Dt.lanes|=s,Ul|=s,h)}function Lv(s,u,h,v){return la(h,u)?h:Gf.current!==null?(s=Ii(s,h,v),la(s,u)||(ii=!0),s):(gs&42)===0||(gs&1073741824)!==0&&(Wt&261930)===0?(ii=!0,s.memoizedState=h):(s=hC(),Dt.lanes|=s,Ul|=s,u)}function Hu(s,u,h,v,M){var A=ps();Mi(A!==0&&8>A?A:8);var k=yt.T,$={};yt.T=$,H1(s,!1,u,h);try{var Ce=M(),We=yt.S;if(We!==null&&We($,Ce),Ce!==null&&typeof Ce=="object"&&typeof Ce.then=="function"){var st=Se(Ce,v);xl(s,u,st,ra(s))}else xl(s,u,v,ra(s))}catch(je){xl(s,u,{then:function(){},status:"rejected",reason:je},ra())}finally{Mi(A),k!==null&&$.types!==null&&(k.types=$.types),yt.T=k}}function Vu(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:Uf,baseState:Uf,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:Uf},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:h},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function Mf(){return P(ju)}function Nv(){return $e().memoizedState}function zi(){return $e().memoizedState}function ia(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var h=ra();s=vr(h);var v=Dr(u,s,h);v!==null&&(Lr(v,u,h),ea(v,u,h)),u={cache:de()},s.payload=u;return}u=u.return}}function nr(s,u,h){var v=ra();h={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Pv(s)?EA(u,h):(h=di(s,u,h,v),h!==null&&(Lr(h,s,v),MA(h,u,v)))}function eo(s,u,h){var v=ra();xl(s,u,h,v)}function xl(s,u,h,v){var M={lane:v,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Pv(s))EA(u,M);else{var A=s.alternate;if(s.lanes===0&&(A===null||A.lanes===0)&&(A=u.lastRenderedReducer,A!==null))try{var k=u.lastRenderedState,$=A(k,h);if(M.hasEagerState=!0,M.eagerState=$,la($,k))return tr(s,u,M,0),yn===null&&Pi(),!1}catch{}finally{}if(h=di(s,u,M,v),h!==null)return Lr(h,s,v),MA(h,u,v),!0}return!1}function H1(s,u,h,v){if(v={lane:2,revertLane:oe(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null}
vendor: 18,702 bytes, line 4064
4064,Pv(s)){if(u)throw Error(r(479))}else u=di(s,h,v,2),u!==null&&Lr(u,s,2)}function Pv(s){var u=s.alternate;return s===Dt||u!==null&&u===Dt}function EA(s,u){Wf=uy=!0;var h=s.pending;h===null?u.next=u:(u.next=h.next,h.next=u),s.pending=u}function MA(s,u,h){if((h&4194048)!==0){var v=u.lanes;v&=s.pendingLanes,h|=v,u.lanes=h,R(s,h)}}function V1(s,u,h,v){u=s.memoizedState,h=h(v,u),h=h==null?u:vS({},u,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}function wA(s,u,h,v,M,A,k){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(v,A,k):u.prototype&&u.prototype.isPureReactComponent?!fe(h,v)||!fe(M,A):!0}function AA(s,u,h,v){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,v),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,v),u.state!==s&&VS.enqueueReplaceState(u,u.state,null)}function Gu(s,u){var h=u;if("ref"in u){h={};for(var v in u)v!=="ref"&&(h[v]=u[v])}if(s=s.defaultProps){h===u&&(h=vS({},h));for(var M in s)h[M]===void 0&&(h[M]=s[M])}return h}function Iv(s,u){try{var h=s.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(v){setTimeout(function(){throw v})}}function CA(s,u,h){try{var v=s.onCaughtError;v(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(M){setTimeout(function(){throw M})}}function G1(s,u,h){return h=vr(h),h.tag=3,h.payload={element:null},h.callback=function(){Iv(s,u)},h}function RA(s){return s=vr(s),s.tag=3,s}function DA(s,u,h,v){var M=h.type.getDerivedStateFromError;if(typeof M=="function"){var A=v.value;s.payload=function(){return M(A)},s.callback=function(){CA(u,h,v)}}var k=h.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(s.callback=function(){CA(u,h,v),typeof M!="function"&&(Ol===null?Ol=new Set([this]):Ol.add(this));var $=v.stack;this.componentDidCatch(v.value,{componentStack:$!==null?$:""})})}function Nz(s,u,h,v,M){if(h.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(u=h.alternate,u!==null&&Me(u,h,M,!0),h=ua.current,h!==null){switch(h.tag){case 31:case 13:return ao===null?Xv():h.alternate===null&&Gn===0&&(Gn=3),h.flags&=-257,h.flags|=65536,h.lanes=M,v===sy?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([v]):u.add(v),dS(s,v,M)),!1;case 22:return h.flags|=65536,v===sy?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([v])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([v]):h.add(v)),dS(s,v,M)),!1}throw Error(r(435,h.tag))}return dS(s,v,M),Xv(),!1}if(qt)return u=ua.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=M,v!==NS&&(s=Error(r(422),{cause:v}),me(Q(s,h)))):(v!==NS&&(u=Error(r(423),{cause:v}),me(Q(u,h))),s=s.current.alternate,s.flags|=65536,M&=-M,s.lanes|=M,v=Q(v,h),M=G1(s.stateNode,v,M),is(s,M),Gn!==4&&(Gn=2)),!1;var A=Error(r(520),{cause:v});if(A=Q(A,h),Hp===null?Hp=[A]:Hp.push(A),Gn!==4&&(Gn=2),u===null)return!0;v=Q(v,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,s=M&-M,h.lanes|=s,s=G1(h.stateNode,v,s),is(h,s),!1;case 1:if(u=h.type,A=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(Ol===null||!Ol.has(A))))return h.flags|=65536,M&=-M,h.lanes|=M,M=RA(M),DA(M,s,h,v),is(h,M),!1}h=h.return}while(h!==null);return!1}function ki(s,u,h,v){u.child=s===null?g3(u,null,h,v):$u(u,s.child,h,v)}function UA(s,u,h,v,M){h=h.render;var A=u.ref;if("ref"in v){var k={};for(var $ in v)$!=="ref"&&(k[$]=v[$])}else k=v;return Ae(u),v=vt(s,u,h,k,A,M),$=en(),s!==null&&!ii?(on(s,u,M),us(s,u,M)):(qt&&$&&Z(u),u.flags|=1,ki(s,u,v,M),u.child)}function OA(s,u,h,v,M){if(s===null){var A=h.type;return typeof A=="function"&&!hS(A)&&A.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=A,LA(s,u,A,v,M)):(s=Yv(h.type,null,v,u,u.mode,M),s.ref=u.ref,s.return=u,u.child=s)}if(A=s.child,!K1(s,M)){var k=A.memoizedProps;if(h=h.compare,h=h!==null?h:fe,h(k,v)&&s.ref===u.ref)return us(s,u,M)}return u.flags|=1,s=ds(A,v),s.ref=u.ref,s.return=u,u.child=s}function LA(s,u,h,v,M){if(s!==null){var A=s.memoizedProps;if(fe(A,v)&&s.ref===u.ref)if(ii=!1,u.pendingProps=v=A,K1(s,M))(s.flags&131072)!==0&&(ii=!0);else return u.lanes=s.lanes,us(s,u,M)}return W1(s,u,h,v,M)}function NA(s,u,h,v){var M=v.children,A=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),v.mode==="hidden"){if((u.flags&128)!==0){if(A=A!==null?A.baseLanes|h:h,s!==null){for(v=u.child=s.child,M=0;v!==null;)M=M|v.lanes|v.childLanes,v=v.sibling;v=M&~A}else v=0,u.child=null;return PA(s,u,A,h,v)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Ke(u,A!==null?A.cachePool:null),A!==null?hl(u,A):N(),ye(u);else return v=u.lanes=536870912,PA(s,u,A!==null?A.baseLanes|h:h,h,v)}else A!==null?(Ke(u,A.cachePool),hl(u,A),Je(),u.memoizedState=null):(s!==null&&Ke(u,null),N(),Je());return ki(s,u,M,h),u.child}function Tp(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function PA(s,u,h,v,M){var A=Ie();return A=A===null?null:{parent:hs?zn._currentValue:zn._currentValue2,pool:A},u.memoizedState={baseLanes:h,cachePool:A},s!==null&&Ke(u,null),N(),ye(u),s!==null&&Me(s,u,v,!0),u.childLanes=M,null}function zv(s,u){return u=Fv({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function IA(s,u,h){return $u(u,s.child,null,h),s=zv(u,u.pendingProps),s.flags|=2,et(u),u.memoizedState=null,s}function Pz(s,u,h){var v=u.pendingProps,M=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(qt){if(v.mode==="hidden")return s=zv(u,v),u.lanes=536870912,Tp(null,s);if(ve(u),(s=In)?(s=nF(s,La),s!==null&&(u.memoizedState={dehydrated:s,treeContext:wl!==null?{id:Uo,overflow:Oo}:null,retryLane:536870912,hydrationErrors:null},h=LC(s),h.return=u,u.child=h,Bi=u,In=null)):s=null,s===null)throw Oe(u);return u.lanes=536870912,null}return zv(u,v)}var A=s.memoizedState;if(A!==null){var k=A.dehydrated;if(ve(u),M)if(u.flags&256)u.flags&=-257,u=IA(s,u,h);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(ii||Me(s,u,h,!1),M=(h&s.childLanes)!==0,ii||M){if(v=yn,v!==null&&(k=L(v,h),k!==0&&k!==A.retryLane))throw A.retryLane=k,jn(s,k),Lr(v,s,k),GS;Xv(),u=IA(s,u,h)}else s=A.treeContext,ar&&(In=Qk(k),Bi=u,qt=!0,Cl=null,La=!1,s!==null&&he(u,s)),u=zv(u,v),u.flags|=4096;return u}return s=ds(s.child,{mode:v.mode,children:v.children}),s.ref=u.ref,u.child=s,s.return=u,s}function kv(s,u){var h=u.ref;if(h===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(u.flags|=4194816)}}function W1(s,u,h,v,M){return Ae(u),h=vt(s,u,h,v,void 0,M),v=en(),s!==null&&!ii?(on(s,u,M),us(s,u,M)):(qt&&v&&Z(u),u.flags|=1,ki(s,u,h,M),u.child)}function zA(s,u,h,v,M,A){return Ae(u),u.updateQueue=null,h=ht(u,v,h,M),Mt(s),v=en(),s!==null&&!ii?(on(s,u,A),us(s,u,A)):(qt&&v&&Z(u),u.flags|=1,ki(s,u,h,A),u.child)}function kA(s,u,h,v,M){if(Ae(u),u.stateNode===null){var A=Nf,k=h.contextType;typeof k=="object"&&k!==null&&(A=P(k)),A=new h(v,A),u.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=VS,u.stateNode=A,A._reactInternals=u,A=u.stateNode,A.props=v,A.state=u.memoizedState,A.refs={},Qa(u),k=h.contextType,A.context=typeof k=="object"&&k!==null?P(k):Nf,A.state=u.memoizedState,k=h.getDerivedStateFromProps,typeof k=="function"&&(V1(u,h,k,v),A.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(k=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),k!==A.state&&VS.enqueueReplaceState(A,A.state,null),Co(u,v,A,M),rs(),A.state=u.memoizedState),typeof A.componentDidMount=="function"&&(u.flags|=4194308),v=!0}else if(s===null){A=u.stateNode;var $=u.memoizedProps,Ce=Gu(h,$);A.props=Ce;var We=A.context,st=h.contextType;k=Nf,typeof st=="object"&&st!==null&&(k=P(st));var je=h.getDerivedStateFromProps;st=typeof je=="function"||typeof A.getSnapshotBeforeUpdate=="function",$=u.pendingProps!==$,st||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||($||We!==k)&&AA(u,A,v,k),Rl=!1;var ct=u.memoizedState;A.state=ct,Co(u,v,A,M),rs(),We=u.memoizedState,$||ct!==We||Rl?(typeof je=="function"&&(V1(u,h,je,v),We=u.memoizedState),(Ce=Rl||wA(u,h,Ce,v,ct,We,k))?(st||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(u.flags|=4194308)):(typeof A.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=v,u.memoizedState=We),A.props=v,A.state=We,A.context=k,v=Ce):(typeof A.componentDidMount=="function"&&(u.flags|=4194308),v=!1)}else{A=u.stateNode,Ao(s,u),k=u.memoizedProps,st=Gu(h,k),A.props=st,je=u.pendingProps,ct=A.context,We=h.contextType,Ce=Nf,typeof We=="object"&&We!==null&&(Ce=P(We)),$=h.getDerivedStateFromProps,(We=typeof $=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(k!==je||ct!==Ce)&&AA(u,A,v,Ce),Rl=!1,ct=u.memoizedState,A.state=ct,Co(u,v,A,M),rs();var At=u.memoizedState;k!==je||ct!==At||Rl||s!==null&&s.dependencies!==null&&_e(s.dependencies)?(typeof $=="function"&&(V1(u,h,$,v),At=u.memoizedState),(st=Rl||wA(u,h,st,v,ct,At,Ce)||s!==null&&s.dependencies!==null&&_e(s.dependencies))?(We||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(v,At,Ce),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(v,At,Ce)),typeof A.componentDidUpdate=="function"&&(u.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof A.componentDidUpdate!="function"||k===s.memoizedProps&&ct===s.memoizedState||(u.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||k===s.memoizedProps&&ct===s.memoizedState||(u.flags|=1024),u.memoizedProps=v,u.memoizedState=At),A.props=v,A.state=At,A.context=Ce,v=st):(typeof A.componentDidUpdate!="function"||k===s.memoizedProps&&ct===s.memoizedState||(u.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||k===s.memoizedProps&&ct===s.memoizedState||(u.flags|=1024),v=!1)}return A=v,kv(s,u),v=(u.flags&128)!==0,A||v?(A=u.stateNode,h=v&&typeof h.getDerivedStateFromError!="function"?null:A.render(),u.flags|=1,s!==null&&v?(u.child=$u(u,s.child,null,M),u.child=$u(u,null,h,M)):ki(s,u,h,M),u.memoizedState=A.state,s=u.child):s=us(s,u,M),s}function FA(s,u,h,v){return Xe(),u.flags|=256,ki(s,u,h,v),u.child}function X1(s){return{baseLanes:s,cachePool:ke()}}function q1(s,u,h){return s=s!==null?s.childLanes&~h:0,u&&(s|=fa),s}function BA(s,u,h){var v=u.pendingProps,M=!1,A=(u.flags&128)!==0,k;if((k=A)||(k=s!==null&&s.memoizedState===null?!1:(Kn.current&2)!==0),k&&(M=!0,u.flags&=-129),k=(u.flags&32)!==0,u.flags&=-33,s===null){if(qt){if(M?xe(u):Je(),(s=In)?(s=iF(s,La),s!==null&&(u.memoizedState={dehydrated:s,treeContext:wl!==null?{id:Uo,overflow:Oo}:null,retryLane:536870912,hydrationErrors:null},h=LC(s),h.return=u,u.child=h,Bi=u,In=null)):s=null,s===null)throw Oe(u);return AS(s)?u.lanes=32:u.lanes=536870912,null}var $=v.children;return v=v.fallback,M?(Je(),M=u.mode,$=Fv({mode:"hidden",children:$},M),v=qu(v,M,h,null),$.return=u,v.return=u,$.sibling=v,u.child=$,v=u.child,v.memoizedState=X1(h),v.childLanes=q1(s,k,h),u.memoizedState=WS,Tp(null,v)):(xe(u),Y1(u,$))}var Ce=s.memoizedState;if(Ce!==null&&($=Ce.dehydrated,$!==null)){if(A)u.flags&256?(xe(u),u.flags&=-257,u=j1(s,u,h)):u.memoizedState!==null?(Je(),u.child=s.child,u.flags|=128,u=null):(Je(),$=v.fallback,M=u.mode,v=Fv({mode:"visible",children:v.children},M),$=qu($,M,h,null),$.flags|=2,v.return=u,$.return=u,v.sibling=$,u.child=v,$u(u,s.child,null,h),v=u.child,v.memoizedState=X1(h),v.childLanes=q1(s,k,h),u.memoizedState=WS,u=Tp(null,v));else if(xe(u),AS($))k=Wk($).digest,v=Error(r(419)),v.stack="",v.digest=k,me({value:v,source:null,stack:null}),u=j1(s,u,h);else if(ii||Me(s,u,h,!1),k=(h&s.childLanes)!==0,ii||k){if(k=yn,k!==null&&(v=L(k,h),v!==0&&v!==Ce.retryLane))throw Ce.retryLane=v,jn(s,v),Lr(k,s,v),GS;wS($)||Xv(),u=j1(s,u,h)}else wS($)?(u.flags|=192,u.child=s.child,u=null):(s=Ce.treeContext,ar&&(In=Jk($),Bi=u,qt=!0,Cl=null,La=!1,s!==null&&he(u,s)),u=Y1(u,v.children),u.flags|=4096);return u}return M?(Je(),$=v.fallback,M=u.mode,Ce=s.child,A=Ce.sibling,v=ds(Ce,{mode:"hidden",children:v.children}),v.subtreeFlags=Ce.subtreeFlags&65011712,A!==null?$=ds(A,$):($=qu($,M,h,null),$.flags|=2),$.return=u,v.return=u,v.sibling=$,u.child=v,Tp(null,v),v=u.child,$=s.child.memoizedState,$===null?$=X1(h):(M=$.cachePool,M!==null?(Ce=hs?zn._currentValue:zn._currentValue2,M=M.parent!==Ce?{parent:Ce,pool:Ce}:M):M=ke(),$={baseLanes:$.baseLanes|h,cachePool:M}),v.memoizedState=$,v.childLanes=q1(s,k,h),u.memoizedState=WS,Tp(s.child,v)):(xe(u),h=s.child,s=h.sibling,h=ds(h,{mode:"visible",children:v.children}),h.return=u,h.sibling=null,s!==null&&(k=u.deletions,k===null?(u.deletions=[s],u.flags|=16):k.push(s)),u.child=h,u.memoizedState=null,h)}function Y1(s,u){return u=Fv({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function Fv(s,u){return s=t(22,s,null,u),s.lanes=0,s}function j1(s,u,h){return $u(u,s.child,null,h),s=Y1(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function HA(s,u,h){s.lanes|=u;var v=s.alternate;v!==null&&(v.lanes|=u),F(s.return,u,h)}function Z1(s,u,h,v,M,A){var k=s.memoizedState;k===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:v,tail:h,tailMode:M,treeForkCount:A}:(k.isBackwards=u,k.rendering=null,k.renderingStartTime=0,k.last=v,k.tail=h,k.tailMode=M,k.treeForkCount=A)}function VA(s,u,h){var v=u.pendingProps,M=v.revealOrder,A=v.tail;v=v.children;var k=Kn.current,$=(k&2)!==0;if($?(k=k&1|2,u.flags|=128):k&=1,y(Kn,k),ki(s,u,v,h),v=qt?Np:0,!$&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&HA(s,h,u);else if(s.tag===19)HA(s,h,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(M){case"forwards":for(h=u.child,M=null;h!==null;)s=h.alternate,s!==null&&nt(s)===null&&(M=h),h=h.sibling;h=M,h===null?(M=u.child,u.child=null):(M=h.sibling,h.sibling=null),Z1(u,!1,M,h,A,v);break;case"backwards":case"unstable_legacy-backwards":for(h=null,M=u.child,u.child=null;M!==null;){if(s=M.alternate,s!==null&&nt(s)===null){u.child=M;break}s=M.sibling,M.sibling=h,h=M,M=s}Z1(u,!0,h,null,A,v);break;case"together":Z1(u,!1,null,null,void 0,v);break;default:u.memoizedState=null}return u.child}function us(s,u,h){if(s!==null&&(u.dependencies=s.dependencies),Ul|=u.lanes,(h&u.childLanes)===0)if(s!==null){if(Me(s,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,h=ds(s,s.pendingProps),u.child=h,h.return=u;s.sibling!==null;)s=s.sibling,h=h.sibling=ds(s,s.pendingProps),h.return=u;h.sibling=null}return u.child}function K1(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&_e(s)))}function Iz(s,u,h){switch(u.tag){case 3:se(u,u.stateNode.containerInfo),ce(u,zn,s.memoizedState.cache),Xe();break;case 27:case 5:te(u);break;case 4:se(u,u.stateNode.containerInfo);break;case 10:ce(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,ve(u),null;break;case 13:var v=u.memoizedState;if(v!==null)return v.dehydrated!==null?(xe(u),u.flags|=128,null):(h&u.child.childLanes)!==0?BA(s,u,h):(xe(u),s=us(s,u,h),s!==null?s.sibling:null);xe(u);break;case 19:var M=(s.flags&128)!==0;if(v=(h&u.childLanes)!==0,v||(Me(s,u,h,!1),v=(h&u.childLanes)!==0),M){if(v)return VA(s,u,h);u.flags|=128}if(M=u.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),y(Kn,Kn.current),v)break;return null;case 22:return u.lanes=0,NA(s,u,h,u.pendingProps);case 24:ce(u,zn,s.memoizedState.cache)}return us(s,u,h)}function GA(s,u,h){if(s!==null)if(s.memoizedProps!==u.pendingProps)ii=!0;else{if(!K1(s,h)&&(u.flags&128)===0)return ii=!1,Iz(s,u,h);ii=(s.flags&131072)!==0}else ii=!1,qt&&(u.flags&1048576)!==0&&G(u,Np,u.index);switch(u.lanes=0,u.tag){case 16:e:{var v=u.pendingProps;if(s=rt(u.elementType),u.type=s,typeof s=="function")hS(s)?(v=Gu(s,v),u.tag=1,u=kA(null,u,s,v,h)):(u.tag=0,u=W1(null,u,s,v,h));else{if(s!=null){var M=s.$$typeof;if(M===_S){u.tag=11,u=UA(null,u,s,v,h);break e}else if(M===SS){u.tag=14,u=OA(null,u,s,v,h);break e}}throw u=m(s)||s,Error(r(306,u,""))}}return u;case 0:return W1(s,u,u.type,u.pendingProps,h);case 1:return v=u.type,M=Gu(v,u.pendingProps),kA(s,u,v,M,h);case 3:e:{if(se(u,u.stateNode.containerInfo),s===null)throw Error(r(387));var A=u.pendingProps;M=u.memoizedState,v=M.element,Ao(s,u),Co(u,A,null,h);var k=u.memoizedState;if(A=k.cache,ce(u,zn,A),A!==M.cache&&He(u,[zn],h,!0),rs(),A=k.element,ar&&M.isDehydrated)if(M={element:A,isDehydrated:!1,cache:k.cache},u.updateQueue.baseState=M,u.memoizedState=M,u.flags&256){u=FA(s,u,A,h);break e}else if(A!==v){v=Q(Error(r(424)),u),me(v),u=FA(s,u,A,h);break e}else for(ar&&(In=Kk(u.stateNode.containerInfo),Bi=u,qt=!0,Cl=null,La=!0),h=g3(u,null,A,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Xe(),A===v){u=us(s,u,h);break e}ki(s,u,A,h)}u=u.child}return u;case 26:if(ro)return kv(s,u),s===null?(h=n3(u.type,null,u.pendingProps,null))?u.memoizedState=h:qt||(u.stateNode=TF(u.type,u.pendingProps,Al.current,u)):u.memoizedState=n3(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:if(pi)return te(u),s===null&&pi&&qt&&(v=u.stateNode=l3(u.type,u.pendingProps,Al.current,Fi.current,!1),Bi=u,La=!0,In=$k(u.type,v,In)),ki(s,u,u.pendingProps.children,h),kv(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&qt&&(bF(u.type,u.pendingProps,Fi.current),(M=v=In)&&(v=eF(v,u.type,u.pendingProps,La),v!==null?(u.stateNode=v,Bi=u,In=Zk(v),La=!1,M=!0):M=!1),M||Oe(u)),te(u),M=u.type,A=u.pendingProps,k=s!==null?s.memoizedProps:null,v=A.children,Kv(M,A)?v=null:k!==null&&Kv(M,k)&&(u.flags|=32),u.memoizedState!==null&&(M=vt(s,u,Zt,null,null,h),hs?ju._
vendor: 6,224 bytes, line 4064
4064currentValue=M:ju._currentValue2=M),kv(s,u),ki(s,u,v,h),u.child;case 6:return s===null&&qt&&(xF(u.pendingProps,Fi.current),(s=h=In)&&(h=tF(h,u.pendingProps,La),h!==null?(u.stateNode=h,Bi=u,In=null,s=!0):s=!1),s||Oe(u)),null;case 13:return BA(s,u,h);case 4:return se(u,u.stateNode.containerInfo),v=u.pendingProps,s===null?u.child=$u(u,null,v,h):ki(s,u,v,h),u.child;case 11:return UA(s,u,u.type,u.pendingProps,h);case 7:return ki(s,u,u.pendingProps,h),u.child;case 8:return ki(s,u,u.pendingProps.children,h),u.child;case 12:return ki(s,u,u.pendingProps.children,h),u.child;case 10:return v=u.pendingProps,ce(u,u.type,v.value),ki(s,u,v.children,h),u.child;case 9:return M=u.type._context,v=u.pendingProps.children,Ae(u),M=P(M),v=v(M),u.flags|=1,ki(s,u,v,h),u.child;case 14:return OA(s,u,u.type,u.pendingProps,h);case 15:return LA(s,u,u.type,u.pendingProps,h);case 19:return VA(s,u,h);case 31:return Pz(s,u,h);case 22:return NA(s,u,h,u.pendingProps);case 24:return Ae(u),v=P(zn),s===null?(M=Ie(),M===null&&(M=yn,A=de(),M.pooledCache=A,A.refCount++,A!==null&&(M.pooledCacheLanes|=h),M=A),u.memoizedState={parent:v,cache:M},Qa(u),ce(u,zn,M)):((s.lanes&h)!==0&&(Ao(s,u),Co(u,null,null,h),rs()),M=s.memoizedState,A=u.memoizedState,M.parent!==v?(M={parent:v,cache:v},u.memoizedState=M,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=M),ce(u,zn,v)):(v=A.cache,ce(u,zn,v),v!==M.cache&&He(u,[zn],h,!0))),ki(s,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function to(s){s.flags|=4}function Bv(s){Do&&(s.flags|=8)}function WA(s,u){if(s!==null&&s.child===u.child)return!1;if((u.flags&16)!==0)return!0;for(s=u.child;s!==null;){if((s.flags&8218)!==0||(s.subtreeFlags&8218)!==0)return!0;s=s.sibling}return!1}function Q1(s,u,h,v){if(rr)for(h=u.child;h!==null;){if(h.tag===5||h.tag===6)ES(s,h.stateNode);else if(!(h.tag===4||pi&&h.tag===27)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===u)break;for(;h.sibling===null;){if(h.return===null||h.return===u)return;h=h.return}h.sibling.return=h.return,h=h.sibling}else if(Do)for(var M=u.child;M!==null;){if(M.tag===5){var A=M.stateNode;h&&v&&(A=QC(A,M.type,M.memoizedProps)),ES(s,A)}else if(M.tag===6)A=M.stateNode,h&&v&&(A=JC(A,M.memoizedProps)),ES(s,A);else if(M.tag!==4){if(M.tag===22&&M.memoizedState!==null)A=M.child,A!==null&&(A.return=M),Q1(s,M,!0,!0);else if(M.child!==null){M.child.return=M,M=M.child;continue}}if(M===u)break;for(;M.sibling===null;){if(M.return===null||M.return===u)return;M=M.return}M.sibling.return=M.return,M=M.sibling}}function XA(s,u,h,v){var M=!1;if(Do)for(var A=u.child;A!==null;){if(A.tag===5){var k=A.stateNode;h&&v&&(k=QC(k,A.type,A.memoizedProps)),ZC(s,k)}else if(A.tag===6)k=A.stateNode,h&&v&&(k=JC(k,A.memoizedProps)),ZC(s,k);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)M=A.child,M!==null&&(M.return=A),XA(s,A,!0,!0),M=!0;else if(A.child!==null){A.child.return=A,A=A.child;continue}}if(A===u)break;for(;A.sibling===null;){if(A.return===null||A.return===u)return M;A=A.return}A.sibling.return=A.return,A=A.sibling}return M}function qA(s,u){if(Do&&WA(s,u)){s=u.stateNode;var h=s.containerInfo,v=jC();XA(v,u,!1,!1),s.pendingChildren=v,to(u),Gk(h,v)}}function J1(s,u,h,v){if(rr)s.memoizedProps!==v&&to(u);else if(Do){var M=s.stateNode,A=s.memoizedProps;if((s=WA(s,u))||A!==v){var k=Fi.current;A=Vk(M,h,A,v,!s,null),A===M?u.stateNode=M:(Bv(u),GC(A,h,v,k)&&to(u),u.stateNode=A,s&&Q1(A,u,!1,!1))}else u.stateNode=M}}function $1(s,u,h,v,M){if((s.mode&32)!==0&&(h===null?mk(u,v):gk(u,h,v))){if(s.flags|=16777216,(M&335544128)===M||MS(u,v))if(XC(s.stateNode,u,v))s.flags|=8192;else if(yC())s.flags|=8192;else throw Ju=sy,kS}else s.flags&=-16777217}function YA(s,u){if(MF(u)){if(s.flags|=16777216,!s3(u))if(yC())s.flags|=8192;else throw Ju=sy,kS}else s.flags&=-16777217}function Hv(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?E():536870912,s.lanes|=u,jf|=u)}function Ep(s,u){if(!qt)switch(s.tailMode){case"hidden":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var v=null;h!==null;)h.alternate!==null&&(v=h),h=h.sibling;v===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:v.sibling=null}}function Mn(s){var u=s.alternate!==null&&s.alternate.child===s.child,h=0,v=0;if(u)for(var M=s.child;M!==null;)h|=M.lanes|M.childLanes,v|=M.subtreeFlags&65011712,v|=M.flags&65011712,M.return=s,M=M.sibling;else for(M=s.child;M!==null;)h|=M.lanes|M.childLanes,v|=M.subtreeFlags,v|=M.flags,M.return=s,M=M.sibling;return s.subtreeFlags|=v,s.childLanes=h,u}function zz(s,u,h){var v=u.pendingProps;switch(ne(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mn(u),null;case 1:return Mn(u),null;case 3:return h=u.stateNode,v=null,s!==null&&(v=s.memoizedState.cache),u.memoizedState.cache!==v&&(u.flags|=2048),Te(zn),J(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(Ue(u)?to(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,ge())),qA(s,u),Mn(u),null;case 26:if(ro){var M=u.type,A=u.memoizedState;return s===null?(to(u),A!==null?(Mn(u),YA(u,A)):(Mn(u),$1(u,M,null,v,h))):A?A!==s.memoizedState?(to(u),Mn(u),YA(u,A)):(Mn(u),u.flags&=-16777217):(A=s.memoizedProps,rr?A!==v&&to(u):J1(s,u,M,v),Mn(u),$1(u,M,A,v,h)),null}case 27:if(pi){if(re(u),h=Al.current,M=u.type,s!==null&&u.stateNode!=null)rr?s.memoizedProps!==v&&to(u):J1(s,u,M,v);else{if(!v){if(u.stateNode===null)throw Error(r(166));return Mn(u),null}s=Fi.current,Ue(u)?Be(u,s):(s=l3(M,v,h,s,!0),u.stateNode=s,to(u))}return Mn(u),null}case 5:if(re(u),M=u.type,s!==null&&u.stateNode!=null)J1(s,u,M,v);else{if(!v){if(u.stateNode===null)throw Error(r(166));return Mn(u),null}if(A=Fi.current,Ue(u))Be(u,A),pF(u.stateNode,M,v,A)&&(u.flags|=64);else{var k=sk(M,v,Al.current,A,u);Bv(u),Q1(k,u,!1,!1),u.stateNode=k,GC(k,M,v,A)&&to(u)}}return Mn(u),$1(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,h),null;case 6:if(s&&u.stateNode!=null)h=s.memoizedProps,rr?h!==v&&to(u):Do&&(h!==v?(s=Al.current,h=Fi.current,Bv(u),u.stateNode=WC(v,s,h,u)):u.stateNode=s.stateNode);else{if(typeof v!="string"&&u.stateNode===null)throw Error(r(166));
vendor: 11,669 bytes, line 4064
4064if(s=Al.current,h=Fi.current,Ue(u)){if(!ar)throw Error(r(176));if(s=u.stateNode,h=u.memoizedProps,v=null,M=Bi,M!==null)switch(M.tag){case 27:case 5:v=M.memoizedProps}aF(s,h,u,v)||Oe(u,!0)}else Bv(u),u.stateNode=WC(v,s,h,u)}return Mn(u),null;case 31:if(h=u.memoizedState,s===null||s.memoizedState!==null){if(v=Ue(u),h!==null){if(s===null){if(!v)throw Error(r(318));if(!ar)throw Error(r(556));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));oF(s,u)}else Xe(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Mn(u),s=!1}else h=ge(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return u.flags&256?(et(u),u):(et(u),null);if((u.flags&128)!==0)throw Error(r(558))}return Mn(u),null;case 13:if(v=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(M=Ue(u),v!==null&&v.dehydrated!==null){if(s===null){if(!M)throw Error(r(318));if(!ar)throw Error(r(344));if(M=u.memoizedState,M=M!==null?M.dehydrated:null,!M)throw Error(r(317));sF(M,u)}else Xe(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Mn(u),M=!1}else M=ge(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=M),M=!0;if(!M)return u.flags&256?(et(u),u):(et(u),null)}return et(u),(u.flags&128)!==0?(u.lanes=h,u):(h=v!==null,s=s!==null&&s.memoizedState!==null,h&&(v=u.child,M=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(M=v.alternate.memoizedState.cachePool.pool),A=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(A=v.memoizedState.cachePool.pool),A!==M&&(v.flags|=2048)),h!==s&&h&&(u.child.flags|=8192),Hv(u,u.updateQueue),Mn(u),null);case 4:return J(),qA(s,u),s===null&&fk(u.stateNode.containerInfo),Mn(u),null;case 10:return Te(u.type),Mn(u),null;case 19:if(g(Kn),v=u.memoizedState,v===null)return Mn(u),null;if(M=(u.flags&128)!==0,A=v.rendering,A===null)if(M)Ep(v,!1);else{if(Gn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(A=nt(s),A!==null){for(u.flags|=128,Ep(v,!1),s=A.updateQueue,u.updateQueue=s,Hv(u,s),u.subtreeFlags=0,s=h,h=u.child;h!==null;)OC(h,s),h=h.sibling;return y(Kn,Kn.current&1|2),qt&&ee(u,v.treeForkCount),u.child}s=s.sibling}v.tail!==null&&Nr()>Vp&&(u.flags|=128,M=!0,Ep(v,!1),u.lanes=4194304)}else{if(!M)if(s=nt(A),s!==null){if(u.flags|=128,M=!0,s=s.updateQueue,u.updateQueue=s,Hv(u,s),Ep(v,!0),v.tail===null&&v.tailMode==="hidden"&&!A.alternate&&!qt)return Mn(u),null}else 2*Nr()-v.renderingStartTime>Vp&&h!==536870912&&(u.flags|=128,M=!0,Ep(v,!1),u.lanes=4194304);v.isBackwards?(A.sibling=u.child,u.child=A):(s=v.last,s!==null?s.sibling=A:u.child=A,v.last=A)}return v.tail!==null?(s=v.tail,v.rendering=s,v.tail=s.sibling,v.renderingStartTime=Nr(),s.sibling=null,h=Kn.current,y(Kn,M?h&1|2:h&1),qt&&ee(u,v.treeForkCount),s):(Mn(u),null);case 22:case 23:return et(u),ae(),v=u.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(u.flags|=8192):v&&(u.flags|=8192),v?(h&536870912)!==0&&(u.flags&128)===0&&(Mn(u),u.subtreeFlags&6&&(u.flags|=8192)):Mn(u),h=u.updateQueue,h!==null&&Hv(u,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==h&&(u.flags|=2048),s!==null&&g(Qu),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),Te(zn),Mn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function kz(s,u){switch(ne(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Te(zn),J(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return re(u),null;case 31:if(u.memoizedState!==null){if(et(u),u.alternate===null)throw Error(r(340));Xe()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(et(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Xe()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return g(Kn),null;case 4:return J(),null;case 10:return Te(u.type),null;case 22:case 23:return et(u),ae(),s!==null&&g(Qu),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Te(zn),null;case 25:return null;default:return null}}function jA(s,u){switch(ne(u),u.tag){case 3:Te(zn),J();break;case 26:case 27:case 5:re(u);break;case 4:J();break;case 31:u.memoizedState!==null&&et(u);break;case 13:et(u);break;case 19:g(Kn);break;case 10:Te(u.type);break;case 22:case 23:et(u),ae(),s!==null&&g(Qu);break;case 24:Te(zn)}}function Mp(s,u){try{var h=u.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var M=v.next;h=M;do{if((h.tag&s)===s){v=void 0;var A=h.create,k=h.inst;v=A(),k.destroy=v}h=h.next}while(h!==M)}}catch($){Kt(u,u.return,$)}}function Sl(s,u,h){try{var v=u.updateQueue,M=v!==null?v.lastEffect:null;if(M!==null){var A=M.next;v=A;do{if((v.tag&s)===s){var k=v.inst,$=k.destroy;if($!==void 0){k.destroy=void 0,M=u;var Ce=h,We=$;try{We()}catch(st){Kt(M,Ce,st)}}}v=v.next}while(v!==A)}}catch(st){Kt(u,u.return,st)}}function ZA(s){var u=s.updateQueue;if(u!==null){var h=s.stateNode;try{dl(u,h)}catch(v){Kt(s,s.return,v)}}}function KA(s,u,h){h.props=Gu(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(v){Kt(s,u,v)}}function wp(s,u){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var v=Dp(s.stateNode);break;case 30:v=s.stateNode;break;default:v=s.stateNode}typeof h=="function"?s.refCleanup=h(v):h.current=v}}catch(M){Kt(s,u,M)}}function Ro(s,u){var h=s.ref,v=s.refCleanup;if(h!==null)if(typeof v=="function")try{v()}catch(M){Kt(s,u,M)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(M){Kt(s,u,M)}else h.current=null}function QA(s){var u=s.type,h=s.memoizedProps,v=s.stateNode;try{Uk(v,u,h,s)}catch(M){Kt(s,s.return,M)}}function eS(s,u,h){try{Ok(s.stateNode,s.type,h,u,s)}catch(v){Kt(s,s.return,v)}}function JA(s){return s.tag===5||s.tag===3||(ro?s.tag===26:!1)||(pi?s.tag===27&&Of(s.type):!1)||s.tag===4}function tS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||JA(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(pi&&s.tag===27&&Of(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function nS(s,u,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,u?Nk(h,s,u):Rk(h,s);else if(v!==4&&(pi&&v===27&&Of(s.type)&&(h=s.stateNode,u=null),s=s.child,s!==null))for(nS(s,u,h),s=s.sibling;s!==null;)nS(s,u,h),s=s.sibling}function Vv(s,u,h){var v=s.tag;if(v===5||v===6)s=s.stateNode,u?Lk(h,s,u):Ck(h,s);else if(v!==4&&(pi&&v===27&&Of(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(Vv(s,u,h),s=s.sibling;s!==null;)Vv(s,u,h),s=s.sibling}function $A(s,u,h){s=s.containerInfo;try{KC(s,h)}catch(v){Kt(u,u.return,v)}}function eC(s){var u=s.stateNode,h=s.memoizedProps;try{AF(s.type,h,u,s)}catch(v){Kt(s,s.return,v)}}function Fz(s,u){for(ak(s.containerInfo),wi=u;wi!==null;)if(s=wi,u=s.child,(s.subtreeFlags&1028)!==0&&u!==null)u.return=s,wi=u;else for(;wi!==null;){s=wi;var h=s.alternate;switch(u=s.flags,s.tag){case 0:if((u&4)!==0&&(u=s.updateQueue,u=u!==null?u.events:null,u!==null))for(var v=0;v<u.length;v++){var M=u[v];M.ref.impl=M.nextImpl}break;case 11:case 15:break;case 1:if((u&1024)!==0&&h!==null){u=void 0,v=s,M=h.memoizedProps,h=h.memoizedState;var A=v.stateNode;try{var k=Gu(v.type,M);u=A.getSnapshotBeforeUpdate(k,h),A.__reactInternalSnapshotBeforeUpdate=u}catch($){Kt(v,v.return,$)}}break;case 3:(u&1024)!==0&&rr&&Hk(s.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(r(163))}if(u=s.sibling,u!==null){u.return=s.return,wi=u;break}wi=s.return}}function tC(s,u,h){var v=h.flags;switch(h.tag){case 0:case 11:case 15:cs(s,h),v&4&&Mp(5,h);break;case 1:if(cs(s,h),v&4)if(s=h.stateNode,u===null)try{s.componentDidMount()}catch(k){Kt(h,h.return,k)}else{var M=Gu(h.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(M,u,s.__reactInternalSnapshotBeforeUpdate)}catch(k){Kt(h,h.return,k)}}v&64&&ZA(h),v&512&&wp(h,h.return);break;case 3:if(cs(s,h),v&64&&(v=h.updateQueue,v!==null)){if(s=null,h.child!==null)switch(h.child.tag){case 27:case 5:s=Dp(h.child.stateNode);break;case 1:s=h.child.stateNode}try{dl(v,s)}catch(k){Kt(h,h.return,k)}}break;case 27:pi&&u===null&&v&4&&eC(h);case 26:case 5:if(cs(s,h),u===null){if(v&4)QA(h);else if(v&64){s=h.type,u=h.memoizedProps,M=h.stateNode;try{cF(M,s,u,h)}catch(k){Kt(h,h.return,k)}}}v&512&&wp(h,h.return);break;case 12:cs(s,h);break;case 31:cs(s,h),v&4&&iC(s,h);break;case 13:cs(s,h),v&4&&rC(s,h),v&64&&(v=h.memoizedState,v!==null&&(v=v.dehydrated,v!==null&&(h=qz.bind(null,h),Xk(v,h))));break;case 22:if(v=h.memoizedState!==null||vs,!v){u=u!==null&&u.memoizedState!==null||ri,M=vs;var A=ri;vs=v,(ri=u)&&!A?fs(s,h,(h.subtreeFlags&8772)!==0):cs(s,h),vs=M,ri=A}break;case 30:break;default:cs(s,h)}}function nC(s){var u=s.alternate;u!==null&&(s.alternate=null,nC(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&pk(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function no(s,u,h){for(h=h.child;h!==null;)iS(s,u,h),h=h.sibling}function iS(s,u,h){if(sa&&typeof sa.onCommitFiberUnmount=="function")try{sa.onCommitFiberUnmount(Lp,h)}catch{}switch(h.tag){case 26:if(ro){ri||Ro(h,u),no(s,u,h),h.memoizedState?r3(h.memoizedState):h.stateNode&&o3(h.stateNode);break}case 27:if(pi){ri||Ro(h,u);var v=ai,M=Pr;Of(h.type)&&(ai=h.stateNode,Pr=!1),no(s,u,h),u3(h.stateNode),ai=v,Pr=M;break}case 5:ri||Ro(h,u);case 6:if(rr){if(v=ai,M=Pr,ai=null,no(s,u,h),ai=v,Pr=M,ai!==null)if(Pr)try{Ik(ai,h.stateNode)}catch(A){Kt(h,u,A)}else try{Pk(ai,h.stateNode)}catch(A){Kt(h,u,A)}}else no(s,u,h);break;case 18:rr&&ai!==null&&(Pr?vF(ai,h.stateNode):gF(ai,h.stateNode));break;case 4:rr?(v=ai,M=Pr,ai=h.stateNode.containerInfo,Pr=!0,no(s,u,h),ai=v,Pr=M):(Do&&$A(h.stateNode,h,jC()),no(s,u,h));break;case 0:case 11:case 14:case 15:Sl(2,h,u),ri||Sl(4,h,u),no(s,u,h);break;case 1:ri||(Ro(h,u),v=h.stateNode,typeof v.componentWillUnmount=="function"&&KA(h,u,v)),no(s,u,h);break;case 21:no(s,u,h);break;case 22:ri=(v=ri)||h.memoizedState!==null,no(s,u,h),ri=v;break;default:no(s,u,h)}}function iC(s,u){if(ar&&u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{dF(s)}catch(h){Kt(u,u.return,h)}}}function rC(s,u){if(ar&&u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{hF(s)}catch(h){Kt(u,u.return,h)}}function Bz(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new _3),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new _3),u;default:throw Error(r(435,s.tag))}}function Gv(s,u){var h=Bz(s);u.forEach(function(v){if(!h.has(v)){h.add(v);var M=Yz.bind(null,s,v);v.then(M,M)}})}function ir(s,u){var h=u.deletions;if(h!==null)for(var v=0;v<h.length;v++){var M=h[v],A=s,k=u;if(rr){var $=k;e:for(;$!==null;){switch($.tag){case 27:if(pi){if(Of($.type)){ai=$.stateNode,Pr=!1;break e}break}case 5:ai=$.stateNode,Pr=!1;break e;case 3:case 4:ai=$.stateNode.containerInfo,Pr=!0;break e}$=$.return}if(ai===null)throw Error(r(160));iS(A,k,M),ai=null,Pr=!1}else iS(A,k,M);A=M.alternate,A!==null&&(A.return=null),M.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)aC(u,s),u=u.sibling}function aC(s,u){var h=s.alternate,v=s.flags;
4064switch(s.tag){case 0:case 11:case 14:case 15:ir(u,s),_r(s),v&4&&(Sl(3,s,s.return),Mp(3,s),Sl(5,s,s.return));break;case 1:ir(u,s),_r(s),v&512&&(ri||h===null||Ro(h,h.return)),v&64&&vs&&(s=s.updateQueue,s!==null&&(v=s.callbacks,v!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?v:h.concat(v))));break;case 26:if(ro){var M=oo;if(ir(u,s),_r(s),v&512&&(ri||h===null||Ro(h,h.return)),v&4){v=h!==null?h.memoizedState:null;var A=s.memoizedState;h===null?A===null?s.stateNode===null?s.stateNode=SF(M,s.type,s.memoizedProps,s):a3(M,s.type,s.stateNode):s.stateNode=i3(M,A,s.memoizedProps):v!==A?(v===null?h.stateNode!==null&&o3(h.stateNode):r3(v),A===null?a3(M,s.type,s.stateNode):i3(M,A,s.memoizedProps)):A===null&&s.stateNode!==null&&eS(s,s.memoizedProps,h.memoizedProps)}break}case 27:if(pi){ir(u,s),_r(s),v&512&&(ri||h===null||Ro(h,h.return)),h!==null&&v&4&&eS(s,s.memoizedProps,h.memoizedProps);break}case 5:if(ir(u,s),_r(s),v&512&&(ri||h===null||Ro(h,h.return)),rr){if(s.flags&32){M=s.stateNode;try{YC(M)}catch(je){Kt(s,s.return,je)}}v&4&&s.stateNode!=null&&(M=s.memoizedProps,eS(s,M,h!==null?h.memoizedProps:M)),v&1024&&(XS=!0)}else Do&&s.alternate!==null&&(s.alternate.stateNode=s.stateNode);break;case 6:if(ir(u,s),_r(s),v&4&&rr){if(s.stateNode===null)throw Error(r(162));v=s.memoizedProps,h=h!==null?h.memoizedProps:v,M=s.stateNode;try{Dk(M,h,v)}catch(je){Kt(s,s.return,je)}}break;case 3:if(ro?(EF(),M=oo,oo=CS(u.containerInfo),ir(u,s),oo=M):ir(u,s),_r(s),v&4){if(rr&&ar&&h!==null&&h.memoizedState.isDehydrated)try{fF(u.containerInfo)}catch(je){Kt(s,s.return,je)}if(Do){v=u.containerInfo,h=u.pendingChildren;try{KC(v,h)}catch(je){Kt(s,s.return,je)}}}XS&&(XS=!1,oC(s));break;case 4:ro?(h=oo,oo=CS(s.stateNode.containerInfo),ir(u,s),_r(s),oo=h):(ir(u,s),_r(s)),v&4&&Do&&$A(s.stateNode,s,s.stateNode.pendingChildren);break;case 12:ir(u,s),_r(s);break;case 31:ir(u,s),_r(s),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Gv(s,v)));break;case 13:ir(u,s),_r(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(gy=Nr()),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Gv(s,v)));break;case 22:M=s.memoizedState!==null;var k=h!==null&&h.memoizedState!==null,$=vs,Ce=ri;if(vs=$||M,ri=Ce||k,ir(u,s),ri=Ce,vs=$,_r(s),v&8192&&(u=s.stateNode,u._visibility=M?u._visibility&-2:u._visibility|1,M&&(h===null||k||vs||ri||Wu(s)),rr)){e:if(h=null,rr)for(u=s;;){if(u.tag===5||ro&&u.tag===26){if(h===null){k=h=u;try{A=k.stateNode,M?zk(A):Fk(k.stateNode,k.memoizedProps)}catch(je){Kt(k,k.return,je)}}}else if(u.tag===6){if(h===null){k=u;try{var We=k.stateNode;M?kk(We):Bk(We,k.memoizedProps)}catch(je){Kt(k,k.return,je)}}}else if(u.tag===18){if(h===null){k=u;try{var st=k.stateNode;M?yF(st):_F(k.stateNode)}catch(je){Kt(k,k.return,je)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}}v&4&&(v=s.updateQueue,v!==null&&(h=v.retryQueue,h!==null&&(v.retryQueue=null,Gv(s,h))));break;case 19:ir(u,s),_r(s),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Gv(s,v)));break;case 30:break;case 21:break;default:ir(u,s),_r(s)}}function _r(s){var u=s.flags;if(u&2){try{for(var h,v=s.return;v!==null;){if(JA(v)){h=v;break}v=v.return}if(rr){if(h==null)throw Error(r(160));switch(h.tag){case 27:if(pi){var M=h.stateNode,A=tS(s);Vv(s,A,M);break}case 5:var k=h.stateNode;h.flags&32&&(YC(k),h.flags&=-33);var $=tS(s);Vv(s,$,k);break;case 3:case 4:var Ce=h.stateNode.containerInfo,We=tS(s);nS(s,We,Ce);break;default:throw Error(r(161))}}}catch(st){Kt(s,s.return,st)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function oC(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;oC(u),u.tag===5&&u.flags&1024&&_k(u.stateNode),s=s.sibling}}function cs(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)tC(s,u.alternate,u),u=u.sibling}function Wu(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:Sl(4,u,u.return),Wu(u);break;case 1:Ro(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&KA(u,u.return,h),Wu(u);break;case 27:pi&&u3(u.stateNode);case 26:case 5:Ro(u,u.return),Wu(u);break;case 22:u.memoizedState===null&&Wu(u);break;case 30:Wu(u);break;default:Wu(u)}s=s.sibling}}function fs(s,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var v=u.alternate,M=s,A=u,k=A.flags;switch(A.tag){case 0:case 11:case 15:fs(M,A,h),Mp(4,A);break;case 1:if(fs(M,A,h),v=A,M=v.stateNode,typeof M.componentDidMount=="function")try{M.componentDidMount()}catch(We){Kt(v,v.return,We)}if(v=A,M=v.updateQueue,M!==null){var $=v.stateNode;try{var Ce=M.shared.hiddenCallbacks;
vendor: 5,605 bytes, line 4064
4064if(Ce!==null)for(M.shared.hiddenCallbacks=null,M=0;M<Ce.length;M++)as(Ce[M],$)}catch(We){Kt(v,v.return,We)}}h&&k&64&&ZA(A),wp(A,A.return);break;case 27:pi&&eC(A);case 26:case 5:fs(M,A,h),h&&v===null&&k&4&&QA(A),wp(A,A.return);break;case 12:fs(M,A,h);break;case 31:fs(M,A,h),h&&k&4&&iC(M,A);break;case 13:fs(M,A,h),h&&k&4&&rC(M,A);break;case 22:A.memoizedState===null&&fs(M,A,h),wp(A,A.return);break;case 30:break;default:fs(M,A,h)}u=u.sibling}}function rS(s,u){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&le(h))}function aS(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&le(s))}function io(s,u,h,v){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)sC(s,u,h,v),u=u.sibling}function sC(s,u,h,v){var M=u.flags;switch(u.tag){case 0:case 11:case 15:io(s,u,h,v),M&2048&&Mp(9,u);break;case 1:io(s,u,h,v);break;case 3:io(s,u,h,v),M&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&le(s)));break;case 12:if(M&2048){io(s,u,h,v),s=u.stateNode;try{var A=u.memoizedProps,k=A.id,$=A.onPostCommit;typeof $=="function"&&$(k,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Ce){Kt(u,u.return,Ce)}}else io(s,u,h,v);break;case 31:io(s,u,h,v);break;case 13:io(s,u,h,v);break;case 23:break;case 22:A=u.stateNode,k=u.alternate,u.memoizedState!==null?A._visibility&2?io(s,u,h,v):Ap(s,u):A._visibility&2?io(s,u,h,v):(A._visibility|=2,wf(s,u,h,v,(u.subtreeFlags&10256)!==0||!1)),M&2048&&rS(k,u);break;case 24:io(s,u,h,v),M&2048&&aS(u.alternate,u);break;default:io(s,u,h,v)}}function wf(s,u,h,v,M){for(M=M&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var A=s,k=u,$=h,Ce=v,We=k.flags;switch(k.tag){case 0:case 11:case 15:wf(A,k,$,Ce,M),Mp(8,k);break;case 23:break;case 22:var st=k.stateNode;k.memoizedState!==null?st._visibility&2?wf(A,k,$,Ce,M):Ap(A,k):(st._visibility|=2,wf(A,k,$,Ce,M)),M&&We&2048&&rS(k.alternate,k);break;case 24:wf(A,k,$,Ce,M),M&&We&2048&&aS(k.alternate,k);break;default:wf(A,k,$,Ce,M)}u=u.sibling}}function Ap(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=s,v=u,M=v.flags;switch(v.tag){case 22:Ap(h,v),M&2048&&rS(v.alternate,v);break;case 24:Ap(h,v),M&2048&&aS(v.alternate,v);break;default:Ap(h,v)}u=u.sibling}}function Xu(s,u,h){if(s.subtreeFlags&qf)for(s=s.child;s!==null;)lC(s,u,h),s=s.sibling}function lC(s,u,h){switch(s.tag){case 26:if(Xu(s,u,h),s.flags&qf)if(s.memoizedState!==null)wF(h,oo,s.memoizedState,s.memoizedProps);else{var v=s.stateNode,M=s.type;s=s.memoizedProps,((u&335544128)===u||MS(M,s))&&qC(h,v,M,s)}break;case 5:Xu(s,u,h),s.flags&qf&&(v=s.stateNode,M=s.type,s=s.memoizedProps,((u&335544128)===u||MS(M,s))&&qC(h,v,M,s));break;case 3:case 4:ro?(v=oo,oo=CS(s.stateNode.containerInfo),Xu(s,u,h),oo=v):Xu(s,u,h);break;case 22:s.memoizedState===null&&(v=s.alternate,v!==null&&v.memoizedState!==null?(v=qf,qf=16777216,Xu(s,u,h),qf=v):Xu(s,u,h));break;default:Xu(s,u,h)}}function uC(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function Cp(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var v=u[h];wi=v,fC(v,s)}uC(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)cC(s),s=s.sibling}function cC(s){switch(s.tag){case 0:case 11:case 15:Cp(s),s.flags&2048&&Sl(9,s,s.return);break;case 3:Cp(s);break;case 12:Cp(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,Wv(s)):Cp(s);break;default:Cp(s)}}function Wv(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var v=u[h];wi=v,fC(v,s)}uC(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Sl(8,u,u.return),Wv(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,Wv(u));break;default:Wv(u)}s=s.sibling}}function fC(s,u){for(;wi!==null;){var h=wi;switch(h.tag){case 0:case 11:case 15:Sl(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var v=h.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:le(h.memoizedState.cache)}if(v=h.child,v!==null)v.return=h,wi=v;else e:for(h=s;wi!==null;){v=wi;var M=v.sibling,A=v.return;if(nC(v),v===h){wi=null;break e}if(M!==null){M.return=A,wi=M;break e}wi=A}}}function oS(s){var u=ck(s);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(r(364));return u}if(s=Sk(s),s===null)throw Error(r(362));return s.stateNode.current}function sS(s,u){var h=s.tag;switch(u.$$typeof){case fy:if(s.type===u.value)return!0;break;case dy:e:{for(u=u.value,s=[s,0],h=0;h<s.length;){var v=s[h++],M=v.tag,A=s[h++],k=u[A];if(M!==5&&M!==26&&M!==27||!Op(v)){for(;k!=null&&sS(v,k);)A++,k=u[A];if(A===u.length){u=!0;break e}else for(v=v.child;v!==null;)s.push(v,A),v=v.sibling}}u=!1}return u;case hy:if((h===5||h===26||h===27)&&Mk(s.stateNode,u.value))return!0;break;case my:if((h===5||h===6||h===26||h===27)&&(s=Ek(s),s!==null&&0<=s.indexOf(u.value)))return!0;break;case py:if((h===5||h===26||h===27)&&(s=s.memoizedProps["data-testname"],typeof s=="string"&&s.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function lS(s){switch(s.$$typeof){case fy:return"<"+(m(s.value)||"Unknown")+">";case dy:return":has("+(lS(s)||"")+")";case hy:return'[role="'+s.value+'"]';
vendor: 5,042 bytes, line 4064
4064case my:return'"'+s.value+'"';case py:return'[data-testname="'+s.value+'"]';default:throw Error(r(365))}}function dC(s,u){var h=[];s=[s,0];for(var v=0;v<s.length;){var M=s[v++],A=M.tag,k=s[v++],$=u[k];if(A!==5&&A!==26&&A!==27||!Op(M)){for(;$!=null&&sS(M,$);)k++,$=u[k];if(k===u.length)h.push(M);else for(M=M.child;M!==null;)s.push(M,k),M=M.sibling}}return h}function uS(s,u){if(!Up)throw Error(r(363));s=oS(s),s=dC(s,u),u=[],s=Array.from(s);for(var h=0;h<s.length;){var v=s[h++],M=v.tag;if(M===5||M===26||M===27)Op(v)||u.push(v.stateNode);else for(v=v.child;v!==null;)s.push(v),v=v.sibling}return u}function ra(){return(zt&2)!==0&&Wt!==0?Wt&-Wt:yt.T!==null?oe():dk()}function hC(){if(fa===0)if((Wt&536870912)===0||qt){var s=Jv;Jv<<=1,(Jv&3932160)===0&&(Jv=262144),fa=s}else fa=536870912;return s=ua.current,s!==null&&(s.flags|=32),fa}function Lr(s,u,h){(s===yn&&(un===2||un===9)||s.cancelPendingCommit!==null)&&(Af(s,0),Tl(s,Wt,fa,!1)),D(s,h),((zt&2)===0||s!==yn)&&(s===yn&&((zt&2)===0&&(tc|=h),Gn===4&&Tl(s,Wt,fa,!1)),ze(s))}function pC(s,u,h){if((zt&6)!==0)throw Error(r(327));var v=!h&&(u&127)===0&&(u&s.expiredLanes)===0||b(s,u),M=v?Gz(s,u):fS(s,u,!0),A=v;do{if(M===0){Yf&&!v&&Tl(s,u,0,!1);break}else{if(h=s.current.alternate,A&&!Hz(h)){M=fS(s,u,!1),A=!1;continue}if(M===2){if(A=u,s.errorRecoveryDisabledLanes&A)var k=0;else k=s.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){u=k;e:{var $=s;M=Hp;var Ce=ar&&$.current.memoizedState.isDehydrated;if(Ce&&(Af($,k).flags|=256),k=fS($,k,!1),k!==2){if(qS&&!Ce){$.errorRecoveryDisabledLanes|=A,tc|=A,M=4;break e}A=Ir,Ir=M,A!==null&&(Ir===null?Ir=A:Ir.push.apply(Ir,A))}M=k}if(A=!1,M!==2)continue}}if(M===1){Af(s,0),Tl(s,u,0,!0);break}e:{switch(v=s,A=M,A){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Tl(v,u,fa,!Dl);break e;case 2:Ir=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(M=gy+300-Nr(),10<M)){if(Tl(v,u,fa,!Dl),_(v,0,!0)!==0)break e;_s=u,v.timeoutHandle=lk(mC.bind(null,v,h,Ir,vy,jS,u,fa,tc,jf,Dl,A,"Throttled",-0,0),M);break e}mC(v,h,Ir,vy,jS,u,fa,tc,jf,Dl,A,null,-0,0)}}break}while(!0);ze(s)}function mC(s,u,h,v,M,A,k,$,Ce,We,st,je,ct,At){if(s.timeoutHandle=Yu,je=u.subtreeFlags,je&8192||(je&16785408)===16785408){je=vk(),lC(u,A,je);var oi=(A&62914560)===A?gy-Nr():(A&4194048)===A?b3-Nr():0;if(oi=yk(je,oi),oi!==null){_s=A,s.cancelPendingCommit=oi(EC.bind(null,s,u,A,h,v,M,k,$,Ce,st,je,null,ct,At)),Tl(s,A,k,!We);return}}EC(s,u,A,h,v,M,k,$,Ce)}function Hz(s){for(var u=s;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var v=0;v<h.length;v++){var M=h[v],A=M.getSnapshot;M=M.value;try{if(!la(A(),M))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Tl(s,u,h,v){u&=~YS,u&=~tc,s.suspendedLanes|=u,s.pingedLanes&=~u,v&&(s.warmLanes|=u),v=s.expirationTimes;for(var M=u;0<M;){var A=31-oa(M),k=1<<A;v[A]=-1,M&=~k}h!==0&&w(s,h,u)}function gC(){return(zt&6)===0?(Re(0,!1),!1):!0}function cS(){if(kt!==null){if(un===0)var s=kt.return;else s=kt,ms=Zu=null,Lt(s),Hf=null,zp=0,s=kt;for(;s!==null;)jA(s.alternate,s),s=s.return;kt=null}}function Af(s,u){var h=s.timeoutHandle;h!==Yu&&(s.timeoutHandle=Yu,uk(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),_s=0,cS(),yn=s,kt=h=ds(s.current,null),Wt=u,un=0,ca=null,Dl=!1,Yf=b(s,u),qS=!1,jf=fa=YS=tc=Ul=Gn=0,Ir=Hp=null,jS=!1,(u&8)!==0&&(u|=u&32);var v=s.entangledLanes;if(v!==0)for(s=s.entanglements,v&=u;0<v;){var M=31-oa(v),A=1<<M;u|=s[M],v&=~A}return ys=u,Pi(),h}function vC(s,u){Dt=null,yt.H=Fp,u===Bf||u===oy?(u=dt(),un=3):u===kS?(u=dt(),un=4):un=u===GS?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,ca=u,kt===null&&(Gn=1,Iv(s,Q(u,s.current)))}function yC(){var s=ua.current;return s===null?!0:(Wt&4194048)===Wt?ao===null:(Wt&62914560)===Wt||(Wt&536870912)!==0?s===ao:!1}function _C(){var s=yt.H;return yt.H=Fp,s===null?Fp:s}function bC(){var s=yt.A;return yt.A=HF,s}function Xv(){Gn=4,Dl||(Wt&4194048)!==Wt&&ua.current!==null||(Yf=!0),(Ul&134217727)===0&&(tc&134217727)===0||yn===null||Tl(yn,Wt,fa,!1)}function fS(s,u,h){var v=zt;zt|=2;var M=_C(),A=bC();(yn!==s||Wt!==u)&&(vy=null,Af(s,u)),u=!1;var k=Gn;e:do try{if(un!==0&&kt!==null){var $=kt,Ce=ca;switch(un){case 8:cS(),k=6;break e;case 3:case 2:case 9:case 6:ua.current===null&&(u=!0);var We=un;if(un=0,ca=null,Cf(s,$,Ce,We),h&&Yf){k=0;break e}break;default:We=un,un=0,ca=null,Cf(s,$,Ce,We)}}Vz(),k=Gn;break}catch(st){vC(s,st)}while(!0);return u&&s.shellSuspendCounter++,ms=Zu=null,zt=v,yt.H=M,yt.A=A,kt===null&&(yn=null,Wt=0,Pi()),k}function Vz(){for(;kt!==null;)xC(kt)}function Gz(s,u){var h=zt;zt|=2;var v=_C(),M=bC();yn!==s||Wt!==u?(vy=null,Vp=Nr()+500,Af(s,u)):Yf=b(s,u);e:do try{if(un!==0&&kt!==null){u=kt;var A=ca;t:switch(un){case 1:un=0,ca=null,Cf(s,u,A,1);break;case 2:case 9:if(qe(A)){un=0,ca=null,SC(u);break}
vendor: 5,459 bytes, line 4064
4064u=function(){un!==2&&un!==9||yn!==s||(un=7),ze(s)},A.then(u,u);break e;case 3:un=7;break e;case 4:un=5;break e;case 7:qe(A)?(un=0,ca=null,SC(u)):(un=0,ca=null,Cf(s,u,A,7));break;case 5:var k=null;switch(kt.tag){case 26:k=kt.memoizedState;case 5:case 27:var $=kt,Ce=$.type,We=$.pendingProps;if(k?s3(k):XC($.stateNode,Ce,We)){un=0,ca=null;var st=$.sibling;if(st!==null)kt=st;else{var je=$.return;je!==null?(kt=je,qv(je)):kt=null}break t}}un=0,ca=null,Cf(s,u,A,5);break;case 6:un=0,ca=null,Cf(s,u,A,6);break;case 8:cS(),Gn=6;break e;default:throw Error(r(462))}}Wz();break}catch(ct){vC(s,ct)}while(!0);return ms=Zu=null,yt.H=v,yt.A=M,zt=h,kt!==null?0:(yn=null,Wt=0,Pi(),Gn)}function Wz(){for(;kt!==null&&!DF();)xC(kt)}function xC(s){var u=GA(s.alternate,s,ys);s.memoizedProps=s.pendingProps,u===null?qv(s):kt=u}function SC(s){var u=s,h=u.alternate;switch(u.tag){case 15:case 0:u=zA(h,u,u.pendingProps,u.type,void 0,Wt);break;case 11:u=zA(h,u,u.pendingProps,u.type.render,u.ref,Wt);break;case 5:Lt(u);default:jA(h,u),u=kt=OC(u,ys),u=GA(h,u,ys)}s.memoizedProps=s.pendingProps,u===null?qv(s):kt=u}function Cf(s,u,h,v){ms=Zu=null,Lt(u),Hf=null,zp=0;var M=u.return;try{if(Nz(s,M,u,h,Wt)){Gn=1,Iv(s,Q(h,s.current)),kt=null;return}}catch(A){if(M!==null)throw kt=M,A;Gn=1,Iv(s,Q(h,s.current)),kt=null;return}u.flags&32768?(qt||v===1?s=!0:Yf||(Wt&536870912)!==0?s=!1:(Dl=s=!0,(v===2||v===9||v===3||v===6)&&(v=ua.current,v!==null&&v.tag===13&&(v.flags|=16384))),TC(u,s)):qv(u)}function qv(s){var u=s;do{if((u.flags&32768)!==0){TC(u,Dl);return}s=u.return;var h=zz(u.alternate,u,ys);if(h!==null){kt=h;return}if(u=u.sibling,u!==null){kt=u;return}kt=u=s}while(u!==null);Gn===0&&(Gn=5)}function TC(s,u){do{var h=kz(s.alternate,s);if(h!==null){h.flags&=32767,kt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(s=s.sibling,s!==null)){kt=s;return}kt=s=h}while(s!==null);Gn=6,kt=null}function EC(s,u,h,v,M,A,k,$,Ce){s.cancelPendingCommit=null;do Rp();while(mi!==0);if((zt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(A=u.lanes|u.childLanes,A|=FS,U(s,h,A,k,$,Ce),s===yn&&(kt=yn=null,Wt=0),Zf=u,Ll=s,_s=h,ZS=A,KS=M,x3=v,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,jz(US,function(){return RC(),null})):(s.callbackNode=null,s.callbackPriority=0),v=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||v){v=yt.T,yt.T=null,M=ps(),Mi(2),k=zt,zt|=4;try{Fz(s,u,h)}finally{zt=k,Mi(M),yt.T=v}}mi=1,MC(),wC(),AC()}}function MC(){if(mi===1){mi=0;var s=Ll,u=Zf,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=yt.T,yt.T=null;var v=ps();Mi(2);var M=zt;zt|=4;try{aC(u,s),ok(s.containerInfo)}finally{zt=M,Mi(v),yt.T=h}}s.current=u,mi=2}}function wC(){if(mi===2){mi=0;var s=Ll,u=Zf,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=yt.T,yt.T=null;var v=ps();Mi(2);var M=zt;zt|=4;try{tC(s,u.alternate,u)}finally{zt=M,Mi(v),yt.T=h}}mi=3}}function AC(){if(mi===4||mi===3){mi=0,UF();var s=Ll,u=Zf,h=_s,v=x3;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?mi=5:(mi=0,Zf=Ll=null,CC(s,s.pendingLanes));var M=s.pendingLanes;if(M===0&&(Ol=null),z(h),u=u.stateNode,sa&&typeof sa.onCommitFiberRoot=="function")try{sa.onCommitFiberRoot(Lp,u,void 0,(u.current.flags&128)===128)}catch{}if(v!==null){u=yt.T,M=ps(),Mi(2),yt.T=null;try{for(var A=s.onRecoverableError,k=0;k<v.length;k++){var $=v[k];A($.value,{componentStack:$.stack})}}finally{yt.T=u,Mi(M)}}(_s&3)!==0&&Rp(),ze(s),M=s.pendingLanes,(h&261930)!==0&&(M&42)!==0?s===QS?Gp++:(Gp=0,QS=s):Gp=0,ar&&mF(),Re(0,!1)}}function CC(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,le(u)))}function Rp(){return MC(),wC(),AC(),RC()}function RC(){if(mi!==5)return!1;var s=Ll,u=ZS;ZS=0;var h=z(_s),v=32>h?32:h;h=yt.T;var M=ps();try{Mi(v),yt.T=null,v=KS,KS=null;var A=Ll,k=_s;if(mi=0,Zf=Ll=null,_s=0,(zt&6)!==0)throw Error(r(331));var $=zt;if(zt|=4,cC(A.current),sC(A,A.current,k,v),zt=$,Re(0,!1),sa&&typeof sa.onPostCommitFiberRoot=="function")try{sa.onPostCommitFiberRoot(Lp,A)}catch{}return!0}finally{Mi(M),yt.T=h,CC(s,u)}}function DC(s,u,h){u=Q(h,u),u=G1(s.stateNode,u,2),s=Dr(s,u,2),s!==null&&(D(s,2),ze(s))}function Kt(s,u,h){if(s.tag===3)DC(s,s,h);else for(;u!==null;){if(u.tag===3){DC(u,s,h);break}else if(u.tag===1){var v=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Ol===null||!Ol.has(v))){s=Q(h,s),h=RA(2),v=Dr(u,h,2),v!==null&&(DA(h,v,u,s),D(v,2),ze(v));break}}u=u.return}}function dS(s,u,h){var v=s.pingCache;if(v===null){v=s.pingCache=new VF;var M=new Set;v.set(u,M)}else M=v.get(u),M===void 0&&(M=new Set,v.set(u,M));M.has(h)||(qS=!0,M.add(h),s=Xz.bind(null,s,u,h),u.then(s,s))}function Xz(s,u,h){var v=s.pingCache;v!==null&&v.delete(u),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,yn===s&&(Wt&h)===h&&(Gn===4||Gn===3&&(Wt&62914560)===Wt&&300>Nr()-gy?(zt&2)===0&&Af(s,0):YS|=h,jf===Wt&&(jf=0)),ze(s)}function UC(s,u){u===0&&(u=E()),s=jn(s,u),s!==null&&(D(s,u),ze(s))}function qz(s){var u=s.memoizedState,h=0;u!==null&&(h=u.retryLane),UC(s,h)}function Yz(s,u){var h=0;switch(s.tag){case 31:case 13:var v=s.stateNode,M=s.memoizedState;M!==null&&(h=M.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(u),UC(s,h)}function jz(s,u){return ey(s,u)}function Zz(s,u,h,v){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 5,459 bytes, line 4064
4064ype=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hS(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ds(s,u){var h=s.alternate;return h===null?(h=t(s.tag,u,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=u,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&65011712,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,u=s.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function OC(s,u){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=h.childLanes,s.lanes=h.lanes,s.child=h.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=h.memoizedProps,s.memoizedState=h.memoizedState,s.updateQueue=h.updateQueue,s.type=h.type,u=h.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function Yv(s,u,h,v,M,A){var k=0;if(v=s,typeof s=="function")hS(s)&&(k=1);else if(typeof s=="string")k=ro&&pi?t3(s,h,Fi.current)?26:c3(s)?27:5:ro?t3(s,h,Fi.current)?26:5:pi&&c3(s)?27:5;else e:switch(s){case TS:return s=t(31,h,u,M),s.elementType=TS,s.lanes=A,s;case Df:return qu(h.children,M,A,u);case FC:k=8,M|=24;break;case yS:return s=t(12,h,u,M|2),s.elementType=yS,s.lanes=A,s;case bS:return s=t(13,h,u,M),s.elementType=bS,s.lanes=A,s;case xS:return s=t(19,h,u,M),s.elementType=xS,s.lanes=A,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case El:k=10;break e;case BC:k=9;break e;case _S:k=11;break e;case SS:k=14;break e;case Ml:k=16,v=null;break e}k=29,h=Error(r(130,s===null?"null":typeof s,"")),v=null}return u=t(k,h,u,M),u.elementType=s,u.type=v,u.lanes=A,u}function qu(s,u,h,v){return s=t(7,s,v,u),s.lanes=h,s}function pS(s,u,h){return s=t(6,s,null,u),s.lanes=h,s}function LC(s){var u=t(18,null,null,0);return u.stateNode=s,u}function mS(s,u,h){return u=t(4,s.children!==null?s.children:[],s.key,u),u.lanes=h,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}function Kz(s,u,h,v,M,A,k,$,Ce){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Yu,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=C(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=C(0),this.hiddenUpdates=C(null),this.identifierPrefix=v,this.onUncaughtError=M,this.onCaughtError=A,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ce,this.incompleteTransitions=new Map}function NC(s,u,h,v,M,A,k,$,Ce,We,st,je){return s=new Kz(s,u,h,k,Ce,We,st,je,$),u=1,A===!0&&(u|=24),A=t(3,null,null,u),s.current=A,A.stateNode=s,u=de(),u.refCount++,s.pooledCache=u,u.refCount++,A.memoizedState={element:v,isDehydrated:h,cache:u},Qa(A),s}function PC(s){return s?(s=Nf,s):Nf}function IC(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=l(u),s=s!==null?c(s):null,s===null?null:Dp(s.stateNode)}function zC(s,u,h,v,M,A){M=PC(M),v.context===null?v.context=M:v.pendingContext=M,v=vr(u),v.payload={element:h},A=A===void 0?null:A,A!==null&&(v.callback=A),h=Dr(s,v,u),h!==null&&(Lr(h,s,u),ea(h,s,u))}function kC(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<u?h:u}}function gS(s,u){kC(s,u),(s=s.alternate)&&kC(s,u)}var It={},Qz=wI.default,aa=fp.default,vS=Object.assign,Jz=Symbol.for("react.element"),jv=Symbol.for("react.transitional.element"),Rf=Symbol.for("react.portal"),Df=Symbol.for("react.fragment"),FC=Symbol.for("react.strict_mode"),yS=Symbol.for("react.profiler"),BC=Symbol.for("react.consumer"),El=Symbol.for("react.context"),_S=Symbol.for("react.forward_ref"),bS=Symbol.for("react.suspense"),xS=Symbol.for("react.suspense_list"),SS=Symbol.for("react.memo"),Ml=Symbol.for("react.lazy"),TS=Symbol.for("react.activity"),$z=Symbol.for("react.memo_cache_sentinel"),HC=Symbol.iterator,ek=Symbol.for("react.client.reference"),Zv=Array.isArray,yt=Qz.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,tk=e.rendererVersion,nk=e.rendererPackageName,VC=e.extraDevToolsConfig,Dp=e.getPublicInstance,ik=e.getRootHostContext,rk=e.getChildHostContext,ak=e.prepareForCommit,ok=e.resetAfterCommit,sk=e.createInstance;e.cloneMutableInstance;var ES=e.appendInitialChild,GC=e.finalizeInitialChildren,Kv=e.shouldSetTextContent,WC=e.createTextInstance;e.cloneMutableTextInstance;var lk=e.scheduleTimeout,uk=e.cancelTimeout,Yu=e.noTimeout,hs=e.isPrimaryRenderer;e.warnsIfNotActing;var rr=e.supportsMutation,Do=e.supportsPersistence,ar=e.supportsHydration,ck=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var fk=e.preparePortalMount;
4064e.prepareScopeUpdate,e.getInstanceFromScope;var Mi=e.setCurrentUpdatePriority,ps=e.getCurrentUpdatePriority,dk=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var hk=e.shouldAttemptEagerTransition,pk=e.detachDeletedInstance;e.requestPostPaintCallback;var mk=e.maySuspendCommit,gk=e.maySuspendCommitOnUpdate,MS=e.maySuspendCommitInSyncRender,XC=e.preloadInstance,vk=e.startSuspendingCommit,qC=e.suspendInstance;e.suspendOnActiveViewTransition;var yk=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var Uf=e.NotPendingTransition,ju=e.HostTransitionContext,_k=e.resetFormInstance;e.bindToConsole;var bk=e.supportsMicrotasks,xk=e.scheduleMicrotask,Up=e.supportsTestSelectors,Sk=e.findFiberRoot,Tk=e.getBoundingRect,Ek=e.getTextContent,Op=e.isHiddenSubtree,Mk=e.matchAccessibilityRole,wk=e.setFocusIfFocusable,Ak=e.setupIntersectionObserver,Ck=e.appendChild,Rk=e.appendChildToContainer,Dk=e.commitTextUpdate,Uk=e.commitMount,Ok=e.commitUpdate,Lk=e.insertBefore,Nk=e.insertInContainerBefore,Pk=e.removeChild,Ik=e.removeChildFromContainer,YC=e.resetTextContent,zk=e.hideInstance,kk=e.hideTextInstance,Fk=e.unhideInstance,Bk=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var Hk=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var Vk=e.cloneInstance,jC=e.createContainerChildSet,ZC=e.appendChildToContainerChildSet,Gk=e.finalizeContainerChildren,KC=e.replaceContainerChildren,QC=e.cloneHiddenInstance,JC=e.cloneHiddenTextInstance,wS=e.isSuspenseInstancePending,AS=e.isSuspenseInstanceFallback,Wk=e.getSuspenseInstanceFallbackErrorDetails,Xk=e.registerSuspenseInstanceRetry,qk=e.canHydrateFormStateMarker,Yk=e.isFormStateMarkerMatching,$C=e.getNextHydratableSibling,jk=e.getNextHydratableSiblingAfterSingleton,Zk=e.getFirstHydratableChild,Kk=e.getFirstHydratableChildWithinContainer,Qk=e.getFirstHydratableChildWithinActivityInstance,Jk=e.getFirstHydratableChildWithinSuspenseInstance,$k=e.getFirstHydratableChildWithinSingleton,eF=e.canHydrateInstance,tF=e.canHydrateTextInstance,nF=e.canHydrateActivityInstance,iF=e.canHydrateSuspenseInstance,rF=e.hydrateInstance,aF=e.hydrateTextInstance,oF=e.hydrateActivityInstance,sF=e.hydrateSuspenseInstance,lF=e.getNextHydratableInstanceAfterActivityInstance,uF=e.getNextHydratableInstanceAfterSuspenseInstance,cF=e.commitHydratedInstance,fF=e.commitHydratedContainer,dF=e.commitHydratedActivityInstance,hF=e.commitHydratedSuspenseInstance,pF=e.finalizeHydratedChildren,mF=e.flushHydrationEvents;e.clearActivityBoundary;var gF=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var vF=e.clearSuspenseBoundaryFromContainer,yF=e.hideDehydratedBoundary,_F=e.unhideDehydratedBoundary,e3=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var bF=e.validateHydratableInstance,xF=e.validateHydratableTextInstance,ro=e.supportsResources,t3=e.isHostHoistableType,CS=e.getHoistableRoot,n3=e.getResource,i3=e.acquireResource,r3=e.releaseResource,SF=e.hydrateHoistable,a3=e.mountHoistable,o3=e.unmountHoistable,TF=e.createHoistableInstance,EF=e.prepareToCommitHoistables,MF=e.mayResourceSuspendCommit,s3=e.preloadResource,wF=e.suspendResource,pi=e.supportsSingletons,l3=e.resolveSingletonInstance,AF=e.acquireSingletonInstance,u3=e.releaseSingletonInstance,c3=e.isHostSingletonType,Of=e.isSingletonScope,RS=[],Lf=-1,Nf={},oa=Math.clz32?Math.clz32:T,CF=Math.log,RF=Math.LN2,Qv=256,Jv=262144,$v=4194304,ey=aa.unstable_scheduleCallback,DS=aa.unstable_cancelCallback,DF=aa.unstable_shouldYield,UF=aa.unstable_requestPaint,Nr=aa.unstable_now,f3=aa.unstable_ImmediatePriority,OF=aa.unstable_UserBlockingPriority,US=aa.unstable_NormalPriority,LF=aa.unstable_IdlePriority,NF=aa.log,PF=aa.unstable_setDisableYieldValue,
4064Lp=null,sa=null,la=typeof Object.is=="function"?Object.is:V,d3=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},IF=Object.prototype.hasOwnProperty,OS,h3,LS=!1,p3=new WeakMap,Pf=[],If=0,ty=null,Np=0,Ua=[],Oa=0,wl=null,Uo=1,Oo="",Fi=p(null),Pp=p(null),Al=p(null),ny=p(null),Bi=null,In=null,qt=!1,Cl=null,La=!1,NS=Error(r(519)),iy=p(null),Zu=null,ms=null,zF=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(h,v){s.push(v)}};this.abort=function(){u.aborted=!0,s.forEach(function(h){return h()})}},kF=aa.unstable_scheduleCallback,FF=aa.unstable_NormalPriority,zn={$$typeof:El,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},ry=null,zf=null,PS=!1,ay=!1,IS=!1,Ku=0,Ip=null,zS=0,kf=0,Ff=null,m3=yt.S;yt.S=function(s,u){b3=Nr(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&Ge(s,u),m3!==null&&m3(s,u)};var Qu=p(null),Bf=Error(r(460)),kS=Error(r(474)),oy=Error(r(542)),sy={then:function(){}},Ju=null,Hf=null,zp=0,$u=$r(!0),g3=$r(!1),Na=[],Vf=0,FS=0,Rl=!1,BS=!1,Gf=p(null),ly=p(0),ua=p(null),ao=null,Kn=p(0),gs=0,Dt=null,mn=null,ni=null,uy=!1,Wf=!1,ec=!1,cy=0,kp=0,Xf=null,BF=0,Fp={readContext:P,use:Ei,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};Fp.useEffectEvent=Qe;var v3={readContext:P,use:Ei,useCallback:function(s,u){return Vt().memoizedState=[s,u===void 0?null:u],s},useContext:P,useEffect:xp,useImperativeHandle:function(s,u,h){h=h!=null?h.concat([s]):null,yl(4194308,4,Sf.bind(null,u,s),h)},useLayoutEffect:function(s,u){return yl(4194308,4,s,u)},useInsertionEffect:function(s,u){yl(4,2,s,u)},useMemo:function(s,u){var h=Vt();u=u===void 0?null:u;var v=s();if(ec){B(!0);try{s()}finally{B(!1)}}return h.memoizedState=[v,u],v},useReducer:function(s,u,h){var v=Vt();if(h!==void 0){var M=h(u);if(ec){B(!0);try{h(u)}finally{B(!1)}}}else M=u;return v.memoizedState=v.baseState=M,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:M},v.queue=s,s=s.dispatch=nr.bind(null,Dt,s),[v.memoizedState,s]},useRef:function(s){var u=Vt();return s={current:s},u.memoizedState=s},useState:function(s){s=pl(s);var u=s.queue,h=eo.bind(null,Dt,u);return u.dispatch=h,[s.memoizedState,h]},useDebugValue:Tf,useDeferredValue:function(s,u){var h=Vt();return Ii(h,s,u)},useTransition:function(){var s=pl(!1);return s=Hu.bind(null,Dt,s.queue,!0,!1),Vt().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,h){var v=Dt,M=Vt();if(qt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),yn===null)throw Error(r(349));(Wt&127)!==0||Un(v,u,h)}M.memoizedState=h;var A={value:h,getSnapshot:u};return M.queue=A,xp(ta.bind(null,v,A,s),[s]),v.flags|=2048,ss(9,{destroy:void 0},Or.bind(null,v,A,h,u),null),h},useId:function(){var s=Vt(),u=yn.identifierPrefix;if(qt){var h=Oo,v=Uo;h=(v&~(1<<32-oa(v)-1)).toString(32)+h,u="_"+u+"R_"+h,h=cy++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=BF++,u="_"+u+"r_"+h.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:Mf,useFormState:ku,useActionState:ku,useOptimistic:function(s){var u=Vt();u.memoizedState=u.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=H1.bind(null,Dt,!0,h),h.dispatch=u,[s,u]},useMemoCache:hi,useCacheRefresh:function(){return Vt().memoizedState=ia.bind(null,Dt)},useEffectEvent:function(s){var u=Vt(),h={impl:s};return u.memoizedState=h,function(){if((zt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},HS={readContext:P,use:Ei,useCallback:bl,useContext:P,useEffect:ls,useImperativeHandle:_l,useInsertionEffect:Sp,useLayoutEffect:xf,useMemo:Ef,useReducer:Ur,useRef:bp,useState:function(){return Ur(Pn)},useDebugValue:Tf,useDeferredValue:function(s,u){var h=$e();return Lv(h,mn.memoizedState,s,u)},useTransition:function(){var s=Ur(Pn)[0],u=$e().memoizedState;return[typeof s=="boolean"?s:bt(s),u]},useSyncExternalStore:yr,useId:Nv,useHostTransitionStatus:Mf,useFormState:_f,useActionState:_f,useOptimistic:function(s,u){var h=$e();return os(h,mn,s,u)},useMemoCache:hi,useCacheRefresh:zi};HS.useEffectEvent=$a;var y3={readContext:P,use:Ei,useCallback:bl,useContext:P,useEffect:ls,useImperativeHandle:_l,useInsertionEffect:Sp,useLayoutEffect:xf,useMemo:Ef,useReducer:xn,useRef:bp,useState:function(){return xn(Pn)},useDebugValue:Tf,useDeferredValue:function(s,u){var h=$e();return mn===null?Ii(h,s,u):Lv(h,mn.memoizedState,s,u)},useTransition:function(){var s=xn(Pn)[0],u=$e().memoizedState;return[typeof s=="boolean"?s:bt(s),u]},useSyncExternalStore:yr,useId:Nv,useHostTransitionStatus:Mf,useFormState:bf,useActionState:bf,useOptimistic:function(s,u){var h=$e();return mn!==null?os(h,mn,s,u):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:hi,useCacheRefresh:zi};y3.useEffectEvent=$a;var VS={enqueueSetState:function(s,u,h){s=s._reactInternals;var v=ra(),M=vr(v);M.payload=u,h!=null&&(M.callback=h),u=Dr(s,M,v),u!==null&&(Lr(u,s,v),ea(u,s,v))},enqueueReplaceState:function(s,u,h){s=s._reactInternals;var v=ra(),M=vr(v);M.tag=1,M.payload=u,h!=null&&(M.callback=h),u=Dr(s,M,v),u!==null&&(Lr(u,s,v),ea(u,s,v))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var h=ra(),v=vr(h);v.tag=2,u!=null&&(v.callback=u),u=Dr(s,v,h),u!==null&&(Lr(u,s,h),ea(u,s,h))}},GS=Error(r(461)),ii=!1,WS={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},vs=!1,ri=!1,XS=!1,_3=typeof WeakSet=="function"?WeakSet:Set,wi=null,ai=null,Pr=!1,oo=null,qf=8192,HF={getCacheForType:function(s){var u=P(zn),h=u.data.get(s);return h===void 0&&(h=s(),u.data.set(s,h)),h},cacheSignal:function(){return P(zn).controller.signal}},fy=0,dy=1,hy=2,py=3,my=4;if(typeof Symbol=="function"&&Symbol.for){var Bp=Symbol.for;fy=Bp("selector.component"),dy=Bp("selector.has_pseudo_class"),hy=Bp("selector.role"),py=Bp("selector.test_id"),my=Bp("selector.text")}var VF=typeof WeakMap=="function"?WeakMap:Map,zt=0,yn=null,kt=null,Wt=0,un=0,ca=null,Dl=!1,Yf=!1,qS=!1,ys=0,Gn=0,Ul=0,tc=0,YS=0,fa=0,jf=0,Hp=null,Ir=null,jS=!1,gy=0,b3=0,Vp=1/0,vy=null,Ol=null,mi=0,Ll=null,Zf=null,_s=0,ZS=0,KS=null,x3=null,Gp=0,QS=null;return It.attemptContinuousHydration=function(s){if(s.tag===13||s.tag===31){var u=jn(s,67108864);u!==null&&Lr(u,s,67108864),gS(s,67108864)}},It.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13||s.tag===31){var u=ra();u=I(u);var h=jn(s,u);h!==null&&Lr(h,s,u),gS(s,u)}},It.attemptSynchronousHydration=function(s){switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var u=x(s.pendingLanes);if(u!==0){for(s.pendingLanes|=2,s.entangledLanes|=2;u;){var h=1<<31-oa(u);s.entanglements[1]|=h,u&=~h}ze(s),(zt&6)===0&&(Vp=Nr()+500,Re(0,!1))}}break;case 31:case 13:u=jn(s,2),u!==null&&Lr(u,s,2),gC(),gS(s,2)}},It.batchedUpdates=function(s,u){return s(u)},It.createComponentSelector=function(s){return{$$typeof:fy,value:s}},It.createContainer=function(s,u,h,v,M,A,k,$,Ce,We){return NC(s,u,!1,null,h,v,A,null,k,$,Ce,We)},It.createHasPseudoClassSelector=function(s){return{$$typeof:dy,value:s}},It.createHydrationContainer=function(s,u,h,v,M,A,k,$,Ce,We,st,je,ct,At){var oi;return s=NC(h,v,!0,s,M,A,$,At,Ce,We,st,je),s.context=PC(null),h=s.current,v=ra(),v=I(v),M=vr(v),M.callback=(oi=u)!=null?oi:null,Dr(h,M,v),u=v,s.current.lanes=u,D(s,u),ze(s),s},It.createPortal=function(s,u,h){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rf,key:v==null?null:""+v,children:s,containerInfo:u,implementation:h}},It.createRoleSelector=function(s){return{$$typeof:hy,value:s}},It.createTestNameSelector=function(s){return{$$typeof:py,value:s}},It.createTextSelector=function(s){return{$$typeof:my,value:s}},It.defaultOnCaughtError=function(s){console.error(s)},It.defaultOnRecoverableError=function(s){d3(s)},It.defaultOnUncaughtError=function(s){d3(s)},It.deferredUpdates=function(s){var u=yt.T,h=ps();try{return Mi(32),yt.T=null,s()}finally{Mi(h),yt.T=u}},It.discreteUpdates=function(s,u,h,v,M){var A=yt.T,k=ps();try{return Mi(2),yt.T=null,s(u,h,v,M)}finally{Mi(k),yt.T=A,zt===0&&(Vp=Nr()+500)}},It.findAllNodes=uS,It.findBoundingRects=function(s,u){if(!Up)throw Error(r(363));u=uS(s,u),s=[];for(var h=0;h<u.length;h++)s.push(Tk(u[h]));for(u=s.length-1;0<u;u--){h=s[u];for(var v=h.x,M=v+h.width,A=h.y,k=A+h.height,$=u-1;0<=$;$--)if(u!==$){var Ce=s[$],We=Ce.x,st=We+Ce.width,je=Ce.y,ct=je+Ce.height;if(v>=We&&A>=je&&M<=st&&k<=ct){s.splice(u,1);break}else if(v!==We||h.width!==Ce.width||ct<A||je>k){if(!(A!==je||h.height!==Ce.height||st<v||We>M)){We>v&&(Ce.width+=We-v,Ce.x=v),st<M&&(Ce.width=M-We),s.splice(u,1);break}}else{je>A&&(Ce.height+=je-A,Ce.y=A),ct<k&&(Ce.height=k-je),s.splice(u,1);break}}}return s},It.findHostInstance=IC,It.findHostInstanceWithNoPortals=function(s){return s=l(s),s=s!==null?f(s):null,s===null?null:Dp(s.stateNode)},It.findHostInstanceWithWarning=function(s){return IC(s)},It.flushPassiveEffects=Rp,It.flushSyncFromReconciler=function(s){var u=zt;zt|=1;var h=yt.T,v=ps();try{if(Mi(2),yt.T=null,s)return s()}
4064finally{Mi(v),yt.T=h,zt=u,(zt&6)===0&&Re(0,!1)}},It.flushSyncWork=gC,It.focusWithin=function(s,u){if(!Up)throw Error(r(363));for(s=oS(s),u=dC(s,u),u=Array.from(u),s=0;s<u.length;){var h=u[s++],v=h.tag;if(!Op(h)){if((v===5||v===26||v===27)&&wk(h.stateNode))return!0;for(h=h.child;h!==null;)u.push(h),h=h.sibling}}return!1},It.getFindAllNodesFailureDescription=function(s,u){if(!Up)throw Error(r(363));var h=0,v=[];s=[oS(s),0];for(var M=0;M<s.length;){var A=s[M++],k=A.tag,$=s[M++],Ce=u[$];if((k!==5&&k!==26&&k!==27||!Op(A))&&(sS(A,Ce)&&(v.push(lS(Ce)),$++,$>h&&(h=$)),$<u.length))for(A=A.child;A!==null;)s.push(A,$),A=A.sibling}if(h<u.length){for(s=[];h<u.length;h++)s.push(lS(u[h]));return`findAllNodes was able to match part of the selector:
4065  `+(v.join(" > ")+`
4066
4067No matching component was found for:
4068  `)+s.join(" > ")}return null},It.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 27:case 5:return Dp(s.child.stateNode);default:return s.child.stateNode}},It.injectIntoDevTools=function(){var s={bundleType:0,version:tk,rendererPackageName:nk,currentDispatcherRef:yt,reconcilerVersion:"19.2.0"};if(VC!==null&&(s.rendererConfig=VC),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)s=!0;else{try{Lp=u.inject(s),sa=u}catch{}s=!!u.checkDCE}}return s},It.isAlreadyRendering=function(){return(zt&6)!==0},It.observeVisibleRects=function(s,u,h,v){if(!Up)throw Error(r(363));s=uS(s,u);var M=Ak(s,h,v).disconnect;return{disconnect:function(){M()}}},It.shouldError=function(){return null},It.shouldSuspend=function(){return!1},It.startHostTransition=function(s,u,h,v){if(s.tag!==5)throw Error(r(476));var M=Vu(s).queue;Hu(s,M,u,Uf,h===null?i:function(){var A=Vu(s);return A.next===null&&(A=s.alternate.memoizedState),xl(s,A.next.queue,{},ra()),h(v)})},It.updateContainer=function(s,u,h,v){var M=u.current,A=ra();return zC(M,A,s,u,h,v),A},It.updateContainerSync=function(s,u,h,v){return zC(u.current,2,s,u,h,v),2},It},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0})}(jw)),jw.exports}var lW={exports:{}};lW.exports;var SI;function uW(){return SI||(SI=1,bI.exports=sW()),bI.exports}var cW=uW(),fW=oW(cW);function dW(n){let e=fW(n);return e.injectIntoDevTools(),e}var BI=0,cp={},hW=/^three(?=[A-Z])/,A1=n=>`${n[0].toUpperCase()}${n.slice(1)}`,pW=0,mW=n=>typeof n=="function";function wv(n){if(mW(n)){let e=`${pW++}`;return cp[e]=n,e}else Object.assign(cp,n)}function HI(n,e){let t=A1(n),i=cp[t];if(n!=="primitive"&&!i)throw new Error(`R3F: ${t} 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(n==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function gW(n,e,t){var i;return n=A1(n)in cp?n:n.replace(hW,""),HI(n,e),n==="primitive"&&(i=e.object)!=null&&i.__r3f&&delete e.object.__r3f,x1(e.object,t,n,e)}function vW(n){if(!n.isHidden){var e;n.props.attach&&(e=n.parent)!=null&&e.object?T1(n.parent,n):Cr(n.object)&&(n.object.visible=!1),n.isHidden=!0,hp(n)}}function VI(n){if(n.isHidden){var e;n.props.attach&&(e=n.parent)!=null&&e.object?S1(n.parent,n):Cr(n.object)&&n.props.visible!==!1&&(n.object.visible=!0),n.isHidden=!1,hp(n)}}function iA(n,e,t){let i=e.root.getState();if(!(!n.parent&&n.object!==i.scene)){if(!e.object){var r,a;let o=cp[A1(e.type)];e.object=(r=e.props.object)!=null?r:new o(...(a=e.props.args)!=null?a:[]),e.object.__r3f=e}if(ul(e.object,e.props),e.props.attach)S1(n,e);else if(Cr(e.object)&&Cr(n.object)){let o=n.object.children.indexOf(t?.object);if(t&&o!==-1){let l=n.object.children.indexOf(e.object);if(l!==-1){n.object.children.splice(l,1);let c=l<o?o-1:o;n.object.children.splice(c,0,e.object)}else e.object.parent=n.object,n.object.children.splice(o,0,e.object),e.object.dispatchEvent({type:"added"}),n.object.dispatchEvent({type:"childadded",child:e.object})}else n.object.add(e.object)}for(let o of e.children)iA(e,o);hp(e)}}function Bw(n,e){e&&(e.parent=n,n.children.push(e),iA(n,e))}function TI(n,e,t){if(!e||!t)return;e.parent=n;let i=n.children.indexOf(t);i!==-1?n.children.splice(i,0,e):n.children.push(e),iA(n,e,t)}function GI(n){if(typeof n.dispose=="function"){let e=()=>{try{n.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():(0,fp.unstable_scheduleCallback)(fp.unstable_IdlePriority,e)}}function Zw(n,e,t){if(!e)return;e.parent=null;let i=n.children.indexOf(e);i!==-1&&n.children.splice(i,1),e.props.attach?T1(n,e):Cr(e.object)&&Cr(n.object)&&(n.object.remove(e.object),J9(AI(e),e.object));let r=e.props.dispose!==null&&t!==!1;for(let a=e.children.length-1;a>=0;a--){let o=e.children[a];Zw(e,o,r)}e.children.length=0,delete e.object.__r3f,r&&e.type!=="primitive"&&e.object.type!=="Scene"&&GI(e.object),t===void 0&&hp(e)}function yW(n,e){for(let t of[n,n.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();let i=t.ref(e);typeof i=="function"&&(t.refCleanup=i)}else t.ref&&(t.ref.current=e)}var b1=[];function _W(){for(let[t]of b1){let i=t.parent;if(i){t.props.attach?T1(i,t):Cr(t.object)&&Cr(i.object)&&i.object.remove(t.object);for(let r of t.children)r.props.attach?T1(t,r):Cr(r.object)&&Cr(t.object)&&t.object.remove(r.object)}t.isHidden&&VI(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&GI(t.object)}for(let[t,i,r]of b1){t.props=i;let a=t.parent;if(a){var n,e;let o=cp[A1(t.type)];
4068t.object=(n=t.props.object)!=null?n:new o(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,yW(r,t.object),ul(t.object,t.props),t.props.attach?S1(a,t):Cr(t.object)&&Cr(a.object)&&a.object.add(t.object);for(let l of t.children)l.props.attach?S1(t,l):Cr(l.object)&&Cr(t.object)&&t.object.add(l.object);hp(t)}}b1.length=0}var Hw=()=>{},EI={},_1=BI,bW=0,xW=4,E1=dW({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:gW,removeChild:Zw,appendChild:Bw,appendInitialChild:Bw,insertBefore:TI,appendChildToContainer(n,e){let t=n.getState().scene.__r3f;!e||!t||Bw(t,e)},removeChildFromContainer(n,e){let t=n.getState().scene.__r3f;!e||!t||Zw(t,e)},insertInContainerBefore(n,e,t){let i=n.getState().scene.__r3f;!e||!t||!i||TI(i,e,t)},getRootHostContext:()=>EI,getChildHostContext:()=>EI,commitUpdate(n,e,t,i,r){var a,o,l;HI(e,i);let c=!1;if((n.type==="primitive"&&t.object!==i.object||((a=i.args)==null?void 0:a.length)!==((o=t.args)==null?void 0:o.length)||(l=i.args)!=null&&l.some((d,m)=>{var p;return d!==((p=t.args)==null?void 0:p[m])}))&&(c=!0),c)b1.push([n,{...i},r]);else{let d=j9(n,i);Object.keys(d).length&&(Object.assign(n.props,d),ul(n.object,d))}(r.sibling===null||(r.flags&xW)===bW)&&_W()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:n=>n?.object,prepareForCommit:()=>null,preparePortalMount:n=>x1(n.getState().scene,n,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:vW,unhideInstance:VI,createTextInstance:Hw,hideTextInstance:Hw,unhideTextInstance:Hw,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:Dn.createContext(null),setCurrentUpdatePriority(n){_1=n},getCurrentUpdatePriority(){return _1},resolveUpdatePriority(){var n;if(_1!==BI)return _1;switch(typeof window<"u"&&((n=window.event)==null?void 0:n.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return rW;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return nW;default:return iW}},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:aW.version,applyViewTransitionName(n,e,t){},restoreViewTransitionName(n,e){},cancelViewTransitionName(n,e,t){},cancelRootViewTransitionName(n){},restoreRootViewTransitionName(n){},InstanceMeasurement:null,measureInstance:n=>null,wasInstanceInViewport:n=>!0,hasInstanceChanged:(n,e)=>!1,hasInstanceAffectedParent:(n,e)=>!1,suspendOnActiveViewTransition(n,e){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(n){},createViewTransitionInstance:n=>null,getCurrentGestureOffset(n){throw new Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance(n,e){return n},cloneMutableTextInstance(n){return n},cloneRootViewTransitionContainer(n){throw new Error("Not implemented.")},removeRootViewTransitionClone(n,e){throw new Error("Not implemented.")},createFragmentInstance:n=>null,updateFragmentInstanceFiber(n,e){},commitNewChildToFragmentInstance(n,e){},deleteChildFromFragmentInstance(n,e){},measureClonedInstance:n=>null,maySuspendCommitOnUpdate:(n,e,t)=>!1,maySuspendCommitInSyncRender:(n,e)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(n,e)=>null}),Iu=new Map,op={objects:"shallow",strict:!1};function SW(n,e){if(!e&&typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){let{width:t,height:i,top:r,left:a}=n.parentElement.getBoundingClientRect();return{width:t,height:i,top:r,left:a}}else if(!e&&typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function rA(n){let e=Iu.get(n),t=e?.fiber,i=e?.store;e&&console.warn("R3F.createRoot should only be called once!");let r=typeof reportError=="function"?reportError:console.error,a=i||$9(w1,Jw),o=t||E1.createContainer(a,tW,null,!1,null,"",r,r,r,null);e||Iu.set(n,{fiber:o,store:a});let l,c,f=!1,d=null;return{async configure(m={}){let p;d=new Promise(G=>p=G);let{gl:g,size:y,scene:T,events:x,onCreated:_,shadows:b=!1,linear:S=!1,flat:E=!1,legacy:C=!1,orthographic:D=!1,frameloop:U="always",dpr:w=[1,2],performance:R,raycaster:L,camera:I,onPointerMissed:z}=m,B=a.getState(),V=B.gl;if(!B.gl){let G={canvas:n,powerPreference:"high-performance",antialias:!0,alpha:!0},Z=typeof g=="function"?await g(G):g;yI(Z)?V=Z:V=new xv({...G,...g}),B.set({gl:V})}let W=B.raycaster;W||B.set({raycaster:W=new Gh});let{params:X,...K}=L||{};if(Nn.equ(K,W,op)||ul(W,{...K}),Nn.equ(X,W.params,op)||ul(W,{params:{...W.params,...X}}),!B.camera||B.camera===c&&!Nn.equ(c,I,op)){c=I;let G=I?.isCamera,Z=G?I:D?new Kr(0,0,0,0,.1,1e3):new Tn(75,0,.1,1e3);G||(Z.position.z=5,I&&(ul(Z,I),Z.manual||("aspect"in I||"left"in I||"right"in I||"bottom"in I||"top"in I)&&(Z.manual=!0,Z.updateProjectionMatrix())),!B.camera&&!(I!=null&&I.rotation)&&Z.lookAt(0,0,0)),B.set({camera:Z}),W.camera=Z}if(!B.scene){let G;T!=null&&T.isScene?(G=T,x1(G,a,"",{})):(G=new Hc,x1(G,a,"",{}),T&&ul(G,T)),B.set({scene:G})}x&&!B.events.handlers&&B.set({events:x(a)});let pe=SW(n,y);if(Nn.equ(pe,B.size,op)||B.setSize(pe.width,pe.height,pe.top,pe.left),w&&B.viewport.dpr!==LI(w)&&B.setDpr(w),B.frameloop!==U&&B.setFrameloop(U),B.onPointerMissed||B.set({onPointerMissed:z}),R&&!Nn.equ(R,B.performance,op)&&B.set(G=>({performance:{...G.performance,...R}})),!B.xr){var Q;let G=(he,se)=>{let J=a.getState();J.frameloop!=="never"&&Jw(he,!0,J,se)},Z=()=>{let he=a.getState();he.gl.xr.enabled=he.gl.xr.isPresenting,he.gl.xr.setAnimationLoop(he.gl.xr.isPresenting?G:null),he.gl.xr.isPresenting||w1(he)},ne={connect(){let he=a.getState().gl;he.xr.addEventListener("sessionstart",Z),he.xr.addEventListener("sessionend",Z)},disconnect(){let he=a.getState().gl;he.xr.removeEventListener("sessionstart",Z),he.xr.removeEventListener("sessionend",Z)}};typeof((Q=V.xr)==null?void 0:Q.addEventListener)=="function"&&ne.connect(),B.set({xr:ne})}if(V.shadowMap){let G=V.shadowMap.enabled,Z=V.shadowMap.type;if(V.shadowMap.enabled=!!b,Nn.boo(b))V.shadowMap.type=Jc;else if(Nn.str(b)){var ee;let ne={basic:Gx,percentage:Ou,soft:Jc,variance:al};V.shadowMap.type=(ee=ne[b])!=null?ee:Jc}else Nn.obj(b)&&Object.assign(V.shadowMap,b);(G!==V.shadowMap.enabled||Z!==V.shadowMap.type)&&(V.shadowMap.needsUpdate=!0)}
4068return Pt.enabled=!C,f||(V.outputColorSpace=S?Wo:Oi,V.toneMapping=E?Qr:Lu),B.legacy!==C&&B.set(()=>({legacy:C})),B.linear!==S&&B.set(()=>({linear:S})),B.flat!==E&&B.set(()=>({flat:E})),g&&!Nn.fun(g)&&!yI(g)&&!Nn.equ(g,V,op)&&ul(V,g),l=_,f=!0,p(),this},render(m){return!f&&!d&&this.configure(),d.then(()=>{E1.updateContainer((0,up.jsx)(TW,{store:a,children:m,onCreated:l,rootElement:n}),o,null,()=>{})}),a},unmount(){C1(n)}}}function TW({store:n,children:e,onCreated:t,rootElement:i}){return dp(()=>{let r=n.getState();r.set(a=>({internal:{...a.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),(0,up.jsx)(eA.Provider,{value:n,children:e})}function C1(n,e){let t=Iu.get(n),i=t?.fiber;if(i){let r=t?.store.getState();r&&(r.internal.active=!1),E1.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var a,o,l,c;r.events.disconnect==null||r.events.disconnect(),(a=r.gl)==null||(o=a.renderLists)==null||o.dispose==null||o.dispose(),(l=r.gl)==null||l.forceContextLoss==null||l.forceContextLoss(),(c=r.gl)!=null&&c.xr&&r.xr.disconnect(),PI(r.sce
4068ne),Iu.delete(n),e&&e(n)}catch{}},500)})}}var EW=new Set,MW=new Set,wW=new Set;function Vw(n,e){if(n.size)for(let{callback:t}of n.values())t(e)}function lp(n,e){switch(n){case"before":return Vw(EW,e);case"after":return Vw(MW,e);case"tail":return Vw(wW,e)}}var Gw,Ww;function Kw(n,e,t){let i=e.clock.getDelta();e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Gw=e.internal.subscribers;for(let r=0;r<Gw.length;r++)Ww=Gw[r],Ww.ref.current(Ww.store.getState(),i,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}var M1=!1,Qw=!1,Xw,MI,sp;function WI(n){MI=requestAnimationFrame(WI),M1=!0,Xw=0,lp("before",n),Qw=!0;for(let t of Iu.values()){var e;sp=t.store.getState(),sp.internal.active&&(sp.frameloop==="always"||sp.internal.frames>0)&&!((e=sp.gl.xr)!=null&&e.isPresenting)&&(Xw+=Kw(n,sp))}if(Qw=!1,lp("after",n),Xw===0)return lp("tail",n),M1=!1,cancelAnimationFrame(MI)}function w1(n,e=1){var t;if(!n)return Iu.forEach(i=>w1(i.store.getState(),e));(t=n.gl.xr)!=null&&t.isPresenting||!n.internal.active||n.frameloop==="never"||(e>1?n.internal.frames=Math.min(60,n.internal.frames+e):Qw?n.internal.frames=2:n.internal.frames=1,M1||(M1=!0,requestAnimationFrame(WI)))}function Jw(n,e=!0,t,i){if(e&&lp("before",n),t)Kw(n,t,i);else for(let r of Iu.values())Kw(n,r.store.getState());e&&lp("after",n)}var qw={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 aA(n){let{handlePointer:e}=kI(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(qw).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;let{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{let{set:i,events:r}=n.getState();if(r.disconnect==null||r.disconnect(),i(a=>({events:{...a.events,connected:t}})),r.handlers)for(let a in r.handlers){let o=r.handlers[a],[l,c]=qw[a];t.addEventListener(l,o,{passive:c})}},disconnect:()=>{let{set:t,events:i}=n.getState();if(i.connected){if(i.handlers)for(let r in i.handlers){let a=i.handlers[r],[o]=qw[r];i.connected.removeEventListener(o,a)}t(r=>({events:{...r.events,connected:void 0}}))}}}}var Rr=gi(or());var Da=gi(or(),1);function XI(n,e){let t;return(...i)=>{window.clearTimeout(t),t=window.setTimeout(()=>n(...i),e)}}function qI({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){let r=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[a,o]=(0,Da.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=(0,Da.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),c=n?typeof n=="number"?n:n.scroll:null,f=n?typeof n=="number"?n:n.resize:null,d=(0,Da.useRef)(!1);(0,Da.useEffect)(()=>(d.current=!0,()=>void(d.current=!1)));let[m,p,g]=(0,Da.useMemo)(()=>{let _=()=>{if(!l.current.element)return;let{left:b,top:S,width:E,height:C,bottom:D,right:U,x:w,y:R}=l.current.element.getBoundingClientRect(),L={left:b,top:S,width:E,height:C,bottom:D,right:U,x:w,y:R};l.current.element instanceof HTMLElement&&i&&(L.height=l.current.element.offsetHeight,L.width=l.current.element.offsetWidth),Object.freeze(L),d.current&&!DW(l.current.lastBounds,L)&&o(l.current.lastBounds=L)};return[_,f?XI(_,f):_,c?XI(_,c):_]},[o,i,c,f]);function y(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(_=>
4068_.removeEventListener("scroll",g,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null),l.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",l.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",l.current.orientationHandler))}function T(){l.current.element&&(l.current.resizeObserver=new r(g),l.current.resizeObserver.observe(l.current.element),e&&l.current.scrollContainers&&l.current.scrollContainers.forEach(_=>_.addEventListener("scroll",g,{capture:!0,passive:!0})),l.current.orientationHandler=()=>{g()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",l.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",l.current.orientationHandler))}let x=_=>{!_||_===l.current.element||(y(),l.current.element=_,l.current.scrollContainers=YI(_),T())};return CW(g,!!e),AW(p),(0,Da.useEffect)(()=>{y(),T()},[e,g,p]),(0,Da.useEffect)(()=>y,[]),[x,a,m]}function AW(n){(0,Da.useEffect)(()=>{let e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function CW(n,e){(0,Da.useEffect)(()=>{if(e){let t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function YI(n){let e=[];
4068if(!n||n===document.body)return e;let{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(a=>a==="auto"||a==="scroll")&&e.push(n),[...e,...YI(n.parentElement)]}var RW=["x","y","top","bottom","left","right","width","height"],DW=(n,e)=>RW.every(t=>n[t]===e[t]);var Qo=gi(Sv());var Oq=gi(Sy());function UW({ref:n,children:e,fallback:t,resize:i,style:r,gl:a,events:o=aA,eventSource:l,eventPrefix:c,shadows:f,linear:d,flat:m,legacy:p,orthographic:g,frameloop:y,dpr:T,performance:x,raycaster:_,camera:b,scene:S,onPointerMissed:E,onCreated:C,...D}){Rr.useMemo(()=>wv(lf),[]);let U=DI(),[w,R]=qI({scroll:!0,debounce:{scroll:50,resize:0},...i}),L=Rr.useRef(null),I=Rr.useRef(null);Rr.useImperativeHandle(n,()=>L.current);let z=$w(E),[B,V]=Rr.useState(!1),[W,X]=Rr.useState(!1);if(B)throw B;if(W)throw W;let K=Rr.useRef(null);return dp(()=>{let Q=L.current;if(R.width>0&&R.height>0&&Q){K.current||(K.current=rA(Q));async function ee(){await K.current.configure({gl:a,scene:S,events:o,shadows:f,linear:d,flat:m,legacy:p,orthographic:g,frameloop:y,dpr:T,performance:x,raycaster:_,camera:b,size:R,onPointerMissed:(...G)=>z.current==null?void 0:z.current(...G),onCreated:G=>{G.events.connect==null||G.events.connect(l?RI(l)?l.current:l:I.current),c&&G.setEvents({compute:(Z,ne)=>{let he=Z[c+"X"],se=Z[c+"Y"];ne.pointer.set(he/ne.size.width*2-1,-(se/ne.size.height)*2+1),ne.raycaster.setFromCamera(ne.pointer,ne.camera)}}),C?.(G)}}),K.current.render((0,Qo.jsx)(U,{children:(0,Qo.jsx)(OI,{set:X,children:(0,Qo.jsx)(Rr.Suspense,{fallback:(0,Qo.jsx)(UI,{set:V}),children:e??null})})}))}ee()}}),Rr.useEffect(()=>{let Q=L.current;if(Q)return()=>C1(Q)},[]),(0,Qo.jsx)("div",{ref:I,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:l?"none":"auto",...r},...D,children:(0,Qo.jsx)("div",{ref:w,style:{width:"100%",height:"100%"},children:(0,Qo.jsx)("canvas",{ref:L,style:{display:"block"},children:t})})})}function jI(n){return(0,Qo.jsx)(Tv,{children:(0,Qo.jsx)(UW,{...n})})}function Ka(){return Ka=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ka.apply(null,arguments)}var R1=parseInt(nl.replace(/\D+/g,""));var oA=R1>=125?"uv1":"uv2";var OW=Object.defineProperty,LW=(n,e,t)=>e in n?OW(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,NW=(n,e,t)=>(LW(n,typeof e!="symbol"?e+"":e,t),t),D1=class{constructor(){NW(this,"_listeners")}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let 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;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let r=this._listeners[e];if(r!==void 0){let a=r.indexOf(t);a!==-1&&r.splice(a,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let r=i.slice(0);for(let a=0,o=r.length;a<o;a++)r[a].call(this,e);e.target=null}}};var PW=Object.defineProperty,IW=(n,e,t)=>e in n?PW(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,gt=(n,e,t)=>(IW(n,typeof e!="symbol"?e+"":e,t),t),U1=new yo,ZI=new qi,zW=Math.cos(70*(Math.PI/180)),KI=(n,e)=>(n%e+e)%e,Av=class extends D1{constructor(e,t){super(),gt(this,"object"),gt(this,"domElement"),gt(this,"enabled",!0),gt(this,"target",new H),gt(this,"minDistance",0),gt(this,"maxDistance",1/0),gt(this,"minZoom",0),gt(this,"maxZoom",1/0),gt(this,"minPolarAngle",0),gt(this,"maxPolarAngle",Math.PI),gt(this,"minAzimuthAngle",-1/0),gt(this,"maxAzimuthAngle",1/0),gt(this,"enableDamping",!1),gt(this,"dampingFactor",.05),gt(this,"enableZoom",!0),gt(this,"zoomSpeed",1),gt(this,"enableRotate",!0),gt(this,"rotateSpeed",1),gt(this,"enablePan",!0),gt(this,"panSpeed",1),gt(this,"screenSpacePanning",!0),gt(this,"keyPanSpeed",7),gt(this,"zoomToCursor",!1),gt(this,"autoRotate",!1),gt(this,"autoRotateSpeed",2),gt(this,"reverseOrbit",!1),gt(this,"reverseHorizontalOrbit",!1),gt(this,"reverseVerticalOrbit",!1),gt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),gt(this,"mouseButtons",{LEFT:il.ROTATE,MIDDLE:il.DOLLY,RIGHT:il.PAN}),gt(this,"touches",{ONE:rl.ROTATE,TWO:rl.DOLLY_PAN}),gt(this,"target0"),gt(this,"position0"),gt(this,"zoom0"),gt(this,"_domElementKeyEvents",null),gt(this,"getPolarAngle"),gt(this,"getAzimuthalAngle"),gt(this,"setPolarAngle"),gt(this,"setAzimuthalAngle"),gt(this,"getDistance"),gt(this,"getZoomScale"),gt(this,"listenToKeyEvents"),gt(this,"stopListenToKeyEvents"),gt(this,"saveState"),gt(this,"reset"),gt(this,"update"),gt(this,"connect"),gt(this,"dispose"),gt(this,"dollyIn"),gt(this,"dollyOut"),gt(this,"getScale"),gt(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>d.phi,this.getAzimuthalAngle=()=>d.theta,this.setPolarAngle=Y=>
4068{let oe=KI(Y,2*Math.PI),Ge=d.phi;Ge<0&&(Ge+=2*Math.PI),oe<0&&(oe+=2*Math.PI);let j=Math.abs(oe-Ge);2*Math.PI-j<j&&(oe<Ge?oe+=2*Math.PI:Ge+=2*Math.PI),m.phi=oe-Ge,i.update()},this.setAzimuthalAngle=Y=>{let oe=KI(Y,2*Math.PI),Ge=d.theta;Ge<0&&(Ge+=2*Math.PI),oe<0&&(oe+=2*Math.PI);let j=Math.abs(oe-Ge);2*Math.PI-j<j&&(oe<Ge?oe+=2*Math.PI:Ge+=2*Math.PI),m.theta=oe-Ge,i.update()},this.getDistance=()=>i.object.position.distanceTo(i.target),this.listenToKeyEvents=Y=>{Y.addEventListener("keydown",ie),this._domElementKeyEvents=Y},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ie),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(),c=l.NONE},this.update=(()=>{let Y=new H,oe=new H(0,1,0),Ge=new ei().setFromUnitVectors(e.up,oe),j=Ge.clone().invert(),Se=new H,Ie=new ei,Ke=2*Math.PI;return function(){let fe=i.object.position;Ge.setFromUnitVectors(e.up,oe),j.copy(Ge).invert(),Y.copy(fe).sub(i.target),Y.applyQuaternion(Ge),d.setFromVector3(Y),i.autoRotate&&c===l.NONE&&V(z()),i.enableDamping?(d.theta+=m.theta*i.dampingFactor,d.phi+=m.phi*i.dampingFactor):(d.theta+=m.theta,d.phi+=m.phi);let qe=i.minAzimuthAngle,it=i.maxAzimuthAngle;
4068isFinite(qe)&&isFinite(it)&&(qe<-Math.PI?qe+=Ke:qe>Math.PI&&(qe-=Ke),it<-Math.PI?it+=Ke:it>Math.PI&&(it-=Ke),qe<=it?d.theta=Math.max(qe,Math.min(it,d.theta)):d.theta=d.theta>(qe+it)/2?Math.max(qe,d.theta):Math.min(it,d.theta)),d.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,d.phi)),d.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(g,i.dampingFactor):i.target.add(g),i.zoomToCursor&&R||i.object.isOrthographicCamera?d.radius=ne(d.radius):d.radius=ne(d.radius*p),Y.setFromSpherical(d),Y.applyQuaternion(j),fe.copy(i.target).add(Y),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(m.theta*=1-i.dampingFactor,m.phi*=1-i.dampingFactor,g.multiplyScalar(1-i.dampingFactor)):(m.set(0,0,0),g.set(0,0,0));let rt=!1;if(i.zoomToCursor&&R){let dt=null;if(i.object instanceof Tn&&i.object.isPerspectiveCamera){let jt=Y.length();dt=ne(jt*p);let Ht=jt-dt;i.object.position.addScaledVector(U,Ht),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){let jt=new H(w.x,w.y,0);jt.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),rt=!0;let Ht=new H(w.x,w.y,0);Ht.unproject(i.object),i.object.position.sub(Ht).add(jt),i.object.updateMatrixWorld(),dt=Y.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;dt!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(dt).add(i.object.position):(U1.origin.copy(i.object.position),U1.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(U1.direction))<zW?e.lookAt(i.target):(ZI.setFromNormalAndCoplanarPoint(i.object.up,i.target),U1.intersectPlane(ZI,i.target))))}else i.object instanceof Kr&&i.object.isOrthographicCamera&&(rt=p!==1,rt&&(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix()));return p=1,R=!1,rt||Se.distanceToSquared(i.object.position)>f||8*(1-Ie.dot(i.object.quaternion))>f?(i.dispatchEvent(r),Se.copy(i.object.position),Ie.copy(i.object.quaternion),rt=!1,!0):!1}})(),this.connect=Y=>{i.domElement=Y,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Ye),i.domElement.addEventListener("pointerdown",Ae),i.domElement.addEventListener("pointercancel",O),i.domElement.addEventListener("wheel",le)},this.dispose=()=>{var Y,oe,Ge,j,Se,Ie;i.domElement&&(i.domElement.style.touchAction="auto"),(Y=i.domElement)==null||Y.removeEventListener("contextmenu",Ye),(oe=i.domElement)==null||oe.removeEventListener("pointerdown",Ae),(Ge=i.domElement)==null||Ge.removeEventListener("pointercancel",O),(j=i.domElement)==null||j.removeEventListener("wheel",le),(Se=i.domElement)==null||Se.ownerDocument.removeEventListener("pointermove",P),(Ie=i.domElement)==null||Ie.ownerDocument.removeEventListener("pointerup",O),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",ie)};let i=this,r={type:"change"},a={type:"start"},o={type:"end"},l={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},c=l.NONE,f=1e-6,d=new Qc,m=new Qc,p=1,g=new H,y=new Le,T=new Le,x=new Le,_=new Le,b=new Le,S=new Le,E=new Le,C=new Le,D=new Le,U=new H,w=new Le,R=!1,L=[],I={};function z(){return 2*Math.PI/60/60*i.autoRotateSpeed}function B(){return Math.pow(.95,i.zoomSpeed)}function V(Y){i.reverseOrbit||i.reverseHorizontalOrbit?m.theta+=Y:m.theta-=Y}function W(Y){i.reverseOrbit||i.reverseVerticalOrbit?m.phi+=Y:m.phi-=Y}let X=(()=>{let Y=new H;return function(Ge,j){Y.setFromMatrixColumn(j,0),Y.multiplyScalar(-Ge),g.add(Y)}})(),K=(()=>{let Y=new H;return function(Ge,j){i.screenSpacePanning===!0?Y.setFromMatrixColumn(j,1):(Y.setFromMatrixColumn(j,0),Y.crossVectors(i.object.up,Y)),Y.multiplyScalar(Ge),g.add(Y)}})(),pe=(()=>{let Y=new H;return function(Ge,j){let Se=i.domElement;if(Se&&i.object instanceof Tn&&i.object.isPerspectiveCamera){let Ie=i.object.position;Y.copy(Ie).sub(i.target);let Ke=Y.length();Ke*=Math.tan(i.object.fov/2*Math.PI/180),X(2*Ge*Ke/Se.clientHeight,i.object.matrix),K(2*j*Ke/Se.clientHeight,i.object.matrix)}else Se&&i.object instanceof Kr&&i.object.isOrthographicCamera?(X(Ge*(i.object.right-i.object.left)/i.object.zoom/Se.clientWidth,i.object.matrix),K(j*(i.object.top-i.object.bottom)/i.object.zoom/Se.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function Q(Y){i.object instanceof Tn&&i.object.isPerspectiveCamera||i.object instanceof Kr&&i.object.isOrthographicCamera?p=Y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ee(Y){Q(p/Y)}function G(Y){Q(p*Y)}function Z(Y){if(!i.zoomToCursor||!i.domElement)return;R=!0;let oe=i.domElement.getBoundingClientRect(),Ge=Y.clientX-oe.left,j=Y.clientY-oe.top,Se=oe.width,Ie=oe.height;w.x=Ge/Se*2-1,w.y=-(j/Ie)*2+1,U.set(w.x,w.y,1).unproject(i.object).sub(i.object.position).normalize()}function ne(Y){return Math.max(i.minDistance,Math.min(i.maxDistance,Y))}function he(Y){y.set(Y.clientX,Y.clientY)}function se(Y){Z(Y),E.set(Y.clientX,Y.clientY)}function J(Y){_.set(Y.clientX,Y.clientY)}function te(Y){T.set(Y.clientX,Y.clientY),x.subVectors(T,y).multiplyScalar(i.rotateSpeed);let oe=i.domElement;oe&&(V(2*Math.PI*x.x/oe.clientHeight),W(2*Math.PI*x.y/oe.clientHeight)),y.copy(T),i.update()}function re(Y){C.set(Y.clientX,Y.clientY),D.subVectors(C,E),D.y>0?ee(B()):D.y<0&&G(B()),E.copy(C),i.update()}function Oe(Y){b.set(Y.clientX,Y.clientY),S.subVectors(b,_).multiplyScalar(i.panSpeed),pe(S.x,S.y),_.copy(b),i.update()}function Be(Y){Z(Y),Y.deltaY<0?G(B()):Y.deltaY>0&&ee(B()),i.update()}function De(Y){let oe=!1;switch(Y.code){case i.keys.UP:pe(0,i.keyPanSpeed),oe=!0;break;case i.keys.BOTTOM:pe(0,-i.keyPanSpeed),oe=!0;break;case i.keys.LEFT:pe(i.keyPanSpeed,0),oe=!0;break;case i.keys.RIGHT:pe(-i.keyPanSpeed,0),oe=!0;break}oe&&(Y.preventDefault(),i.update())}function Ue(){if(L.length==1)y.set(L[0].pageX,L[0].pageY);else{let Y=.5*(L[0].pageX+L[1].pageX),oe=.5*(L[0].pageY+L[1].pageY);y.set(Y,oe)}}
4068function Xe(){if(L.length==1)_.set(L[0].pageX,L[0].pageY);else{let Y=.5*(L[0].pageX+L[1].pageX),oe=.5*(L[0].pageY+L[1].pageY);_.set(Y,oe)}}function ge(){let Y=L[0].pageX-L[1].pageX,oe=L[0].pageY-L[1].pageY,Ge=Math.sqrt(Y*Y+oe*oe);E.set(0,Ge)}function me(){i.enableZoom&&ge(),i.enablePan&&Xe()}function ce(){i.enableZoom&&ge(),i.enableRotate&&Ue()}function Te(Y){if(L.length==1)T.set(Y.pageX,Y.pageY);else{let Ge=Fe(Y),j=.5*(Y.pageX+Ge.x),Se=.5*(Y.pageY+Ge.y);T.set(j,Se)}x.subVectors(T,y).multiplyScalar(i.rotateSpeed);let oe=i.domElement;oe&&(V(2*Math.PI*x.x/oe.clientHeight),W(2*Math.PI*x.y/oe.clientHeight)),y.copy(T)}function F(Y){if(L.length==1)b.set(Y.pageX,Y.pageY);else{let oe=Fe(Y),Ge=.5*(Y.pageX+oe.x),j=.5*(Y.pageY+oe.y);b.set(Ge,j)}S.subVectors(b,_).multiplyScalar(i.panSpeed),pe(S.x,S.y),_.copy(b)}function He(Y){let oe=Fe(Y),Ge=Y.pageX-oe.x,j=Y.pageY-oe.y,Se=Math.sqrt(Ge*Ge+j*j);C.set(0,Se),D.set(0,Math.pow(C.y/E.y,i.zoomSpeed)),ee(D.y),E.copy(C)}function Me(Y){i.enableZoom&&He(Y),i.enablePan&&F(Y)}function _e(Y){i.enableZoom&&He(Y),i.enableRotate&&Te(Y)}function Ae(Y){var oe,Ge;i.enabled!==!1&&(L.length===0&&((oe=i.domElement)==null||oe.ownerDocument.addEventListener("pointermove",P),(Ge=i.domElement)==null||Ge.ownerDocument.addEventListener("pointerup",O)),at(Y),Y.pointerType==="touch"?ze(Y):q(Y))}function P(Y){i.enabled!==!1&&(Y.pointerType==="touch"?Re(Y):de(Y))}function O(Y){var oe,Ge,j;we(Y),L.length===0&&((oe=i.domElement)==null||oe.releasePointerCapture(Y.pointerId),(Ge=i.domElement)==null||Ge.ownerDocument.removeEventListener("pointermove",P),(j=i.domElement)==null||j.ownerDocument.removeEventListener("pointerup",O)),i.dispatchEvent(o),c=l.NONE}function q(Y){let oe;switch(Y.button){case 0:oe=i.mouseButtons.LEFT;break;case 1:oe=i.mouseButtons.MIDDLE;break;case 2:oe=i.mouseButtons.RIGHT;break;default:oe=-1}switch(oe){case il.DOLLY:if(i.enableZoom===!1)return;se(Y),c=l.DOLLY;break;case il.ROTATE:if(Y.ctrlKey||Y.metaKey||Y.shiftKey){if(i.enablePan===!1)return;J(Y),c=l.PAN}else{if(i.enableRotate===!1)return;he(Y),c=l.ROTATE}break;case il.PAN:if(Y.ctrlKey||Y.metaKey||Y.shiftKey){if(i.enableRotate===!1)return;he(Y),c=l.ROTATE}else{if(i.enablePan===!1)return;J(Y),c=l.PAN}break;default:c=l.NONE}c!==l.NONE&&i.dispatchEvent(a)}function de(Y){if(i.enabled!==!1)switch(c){case l.ROTATE:if(i.enableRotate===!1)return;te(Y);break;case l.DOLLY:if(i.enableZoom===!1)return;re(Y);break;case l.PAN:if(i.enablePan===!1)return;Oe(Y);break}}function le(Y){i.enabled===!1||i.enableZoom===!1||c!==l.NONE&&c!==l.ROTATE||(Y.preventDefault(),i.dispatchEvent(a),Be(Y),i.dispatchEvent(o))}function ie(Y){i.enabled===!1||i.enablePan===!1||De(Y)}function ze(Y){switch(Pe(Y),L.length){case 1:switch(i.touches.ONE){case rl.ROTATE:if(i.enableRotate===!1)return;Ue(),c=l.TOUCH_ROTATE;break;case rl.PAN:if(i.enablePan===!1)return;Xe(),c=l.TOUCH_PAN;break;default:c=l.NONE}break;case 2:switch(i.touches.TWO){case rl.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;me(),c=l.TOUCH_DOLLY_PAN;break;case rl.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;ce(),c=l.TOUCH_DOLLY_ROTATE;break;default:c=l.NONE}break;default:c=l.NONE}c!==l.NONE&&i.dispatchEvent(a)}function Re(Y){switch(Pe(Y),c){case l.TOUCH_ROTATE:if(i.enableRotate===!1)return;Te(Y),i.update();break;case l.TOUCH_PAN:if(i.enablePan===!1)return;F(Y),i.update();break;case l.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;Me(Y),i.update();break;case l.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;_e(Y),i.update();break;default:c=l.NONE}}function Ye(Y){i.enabled!==!1&&Y.preventDefault()}function at(Y){L.push(Y)}function we(Y){delete I[Y.pointerId];for(let oe=0;oe<L.length;oe++)if(L[oe].pointerId==Y.pointerId){L.splice(oe,1);return}}function Pe(Y){let oe=I[Y.pointerId];oe===void 0&&(oe=new Le,I[Y.pointerId]=oe),oe.set(Y.pageX,Y.pageY)}function Fe(Y){let oe=Y.pointerId===L[0].pointerId?L[1]:L[0];return I[oe.pointerId]}this.dollyIn=(Y=B())=>{G(Y),i.update()},this.dollyOut=(Y=B())=>{ee(Y),i.update()},this.getScale=()=>p,this.setScale=Y=>{Q(Y),i.update()},this.getZoomScale=()=>B(),t!==void 0&&this.connect(t),this.update()}};var QI=new bn,O1=new H,cl=class extends el{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new ut(e,3)),this.setAttribute("uv",new ut(t,2))}applyMatrix4(e){let t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let i=new tl(t,6,1);return this.setAttribute("instanceStart",new dr(i,3,0)),this.setAttribute("instanceEnd",new dr(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));let r=new tl(i,t*2,1);return this.setAttribute("instanceColorStart",new dr(r,t,0)),this.setAttribute("instanceColorEnd",new dr(r,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new jc(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new bn);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),QI.setFromBufferAttribute(t),this.boundingBox.union(QI))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new En),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let i=this.boundingSphere.center;this.boundingBox.getCenter(i);let r=0;for(let a=0,o=e.count;a<o;
4068a++)O1.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(O1)),O1.fromBufferAttribute(t,a),r=Math.max(r,i.distanceToSquared(O1));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}};var ff=class extends cl{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){let t=e.length-3,i=new Float32Array(2*t);for(let r=0;r<t;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return super.setPositions(i),this}setColors(e,t=3){let i=e.length-t,r=new Float32Array(2*i);if(t===3)for(let a=0;a<i;a+=t)r[2*a]=e[a],r[2*a+1]=e[a+1],r[2*a+2]=e[a+2],r[2*a+3]=e[a+3],r[2*a+4]=e[a+4],r[2*a+5]=e[a+5];else for(let a=0;a<i;a+=t)r[2*a]=e[a],r[2*a+1]=e[a+1],r[2*a+2]=e[a+2],r[2*a+3]=e[a+3],r[2*a+4]=e[a+4],r[2*a+5]=e[a+5],r[2*a+6]=e[a+6],r[2*a+7]=e[a+7];return super.setColors(r,t),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}};var fl=class extends xi{constructor(e){super({type:"LineMaterial",uniforms:Zo.clone(Zo.merge([lt.common,lt.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Le(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
4069				#include <common>
4070				#include <fog_pars_vertex>
4071				#include <logdepthbuf_pars_vertex>
4072				#include <clipping_planes_pars_vertex>
4073
4074				uniform float linewidth;
4075				uniform vec2 resolution;
4076
4077				attribute vec3 instanceStart;
4078				attribute vec3 instanceEnd;
4079
4080				#ifdef USE_COLOR
4081					#ifdef USE_LINE_COLOR_ALPHA
4082						varying vec4 vLineColor;
4083						attribute vec4 instanceColorStart;
4084						attribute vec4 instanceColorEnd;
4085					#else
4086						varying vec3 vLineColor;
4087						attribute vec3 instanceColorStart;
4088						attribute vec3 instanceColorEnd;
4089					#endif
4090				#endif
4091
4092				#ifdef WORLD_UNITS
4093
4094					varying vec4 worldPos;
4095					varying vec3 worldStart;
4096					varying vec3 worldEnd;
4097
4098					#ifdef USE_DASH
4099
4100						varying vec2 vUv;
4101
4102					#endif
4103
4104				#else
4105
4106					varying vec2 vUv;
4107
4108				#endif
4109
4110				#ifdef USE_DASH
4111
4112					uniform float dashScale;
4113					attribute float instanceDistanceStart;
4114					attribute float instanceDistanceEnd;
4115					varying float vLineDistance;
4116
4117				#endif
4118
4119				void trimSegment( const in vec4 start, inout vec4 end ) {
4120
4121					// trim end segment so it terminates between the camera plane and the near plane
4122
4123					// conservative estimate of the near plane
4124					float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
4125					float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
4126					float nearEstimate = - 0.5 * b / a;
4127
4128					float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
4129
4130					end.xyz = mix( start.xyz, end.xyz, alpha );
4131
4132				}
4133
4134				void main() {
4135
4136					#ifdef USE_COLOR
4137
4138						vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
4139
4140					#endif
4141
4142					#ifdef USE_DASH
4143
4144						vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
4145						vUv = uv;
4146
4147					#endif
4148
4149					float aspect = resolution.x / resolution.y;
4150
4151					// camera space
4152					vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
4153					vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
4154
4155					#ifdef WORLD_UNITS
4156
4157						worldStart = start.xyz;
4158						worldEnd = end.xyz;
4159
4160					#else
4161
4162						vUv = uv;
4163
4164					#endif
4165
4166					// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
4167					// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
4168					// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
4169					// perhaps there is a more elegant solution -- WestLangley
4170
4171					bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
4172
4173					if ( perspective ) {
4174
4175						if ( start.z < 0.0 && end.z >= 0.0 ) {
4176
4177							trimSegment( start, end );
4178
4179						} else if ( end.z < 0.0 && start.z >= 0.0 ) {
4180
4181							trimSegment( end, start );
4182
4183						}
4184
4185					}
4186
4187					// clip space
4188					vec4 clipStart = projectionMatrix * start;
4189					vec4 clipEnd = projectionMatrix * end;
4190
4191					// ndc space
4192					vec3 ndcStart = clipStart.xyz / clipStart.w;
4193					vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
4194
4195					// direction
4196					vec2 dir = ndcEnd.xy - ndcStart.xy;
4197
4198					// account for clip-space aspect ratio
4199					dir.x *= aspect;
4200					dir = normalize( dir );
4201
4202					#ifdef WORLD_UNITS
4203
4204						// get the offset direction as perpendicular to the view vector
4205						vec3 worldDir = normalize( end.xyz - start.xyz );
4206						vec3 offset;
4207						if ( position.y < 0.5 ) {
4208
4209							offset = normalize( cross( start.xyz, worldDir ) );
4210
4211						} else {
4212
4213							offset = normalize( cross( end.xyz, worldDir ) );
4214
4215						}
4216
4217						// sign flip
4218						if ( position.x < 0.0 ) offset *= - 1.0;
4219
4220						float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );
4221
4222						// don't extend the line if we're rendering dashes because we
4223						// won't be rendering the endcaps
4224						#ifndef USE_DASH
4225
4226							// extend the line bounds to encompass  endcaps
4227							start.xyz += - worldDir * linewidth * 0.5;
4228							end.xyz += worldDir * linewidth * 0.5;
4229
4230							// shift the position of the quad so it hugs the forward edge of the line
4231							offset.xy -= dir * forwardOffset;
4232							offset.z += 0.5;
4233
4234						#endif
4235
4236						// endcaps
4237						if ( position.y > 1.0 || position.y < 0.0 ) {
4238
4239							offset.xy += dir * 2.0 * forwardOffset;
4240
4241						}
4242
4243						// adjust for linewidth
4244						offset *= linewidth * 0.5;
4245
4246						// set the world position
4247						worldPos = ( position.y < 0.5 ) ? start : end;
4248						worldPos.xyz += offset;
4249
4250						// project the worldpos
4251						vec4 clip = projectionMatrix * worldPos;
4252
4253						// shift the depth of the projected points so the line
4254						// segments overlap neatly
4255						vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
4256						clip.z = clipPose.z * clip.w;
4257
4258					#else
4259
4260						vec2 offset = vec2( dir.y, - dir.x );
4261						// undo aspect ratio adjustment
4262						dir.x /= aspect;
4263						offset.x /= aspect;
4264
4265						// sign flip
4266						if ( position.x < 0.0 ) offset *= - 1.0;
4267
4268						// endcaps
4269						if ( position.y < 0.0 ) {
4270
4271							offset += - dir;
4272
4273						} else if ( position.y > 1.0 ) {
4274
4275							offset += dir;
4276
4277						}
4278
4279						// adjust for linewidth
4280						offset *= linewidth;
4281
4282						// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
4283						offset /= resolution.y;
4284
4285						// select end
4286						vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
4287
4288						// back to clip space
4289						offset *= clip.w;
4290
4291						clip.xy += offset;
4292
4293					#endif
4294
4295					gl_Position = clip;
4296
4297					vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
4298
4299					#include <logdepthbuf_vertex>
4300					#include <clipping_planes_vertex>
4301					#include <fog_vertex>
4302
4303				}
4304			`,fragmentShader:`
4305				uniform vec3 diffuse;
4306				uniform float opacity;
4307				uniform float linewidth;
4308
4309				#ifdef USE_DASH
4310
4311					uniform float dashOffset;
4312					uniform float dashSize;
4313					uniform float gapSize;
4314
4315				#endif
4316
4317				varying float vLineDistance;
4318
4319				#ifdef WORLD_UNITS
4320
4321					varying vec4 worldPos;
4322					varying vec3 worldStart;
4323					varying vec3 worldEnd;
4324
4325					#ifdef USE_DASH
4326
4327						varying vec2 vUv;
4328
4329					#endif
4330
4331				#else
4332
4333					varying vec2 vUv;
4334
4335				#endif
4336
4337				#include <common>
4338				#include <fog_pars_fragment>
4339				#include <logdepthbuf_pars_fragment>
4340				#include <clipping_planes_pars_fragment>
4341
4342				#ifdef USE_COLOR
4343					#ifdef USE_LINE_COLOR_ALPHA
4344						varying vec4 vLineColor;
4345					#else
4346						varying vec3 vLineColor;
4347					#endif
4348				#endif
4349
4350				vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
4351
4352					float mua;
4353					float mub;
4354
4355					vec3 p13 = p1 - p3;
4356					vec3 p43 = p4 - p3;
4357
4358					vec3 p21 = p2 - p1;
4359
4360					float d1343 = dot( p13, p43 );
4361					float d4321 = dot( p43, p21 );
4362					float d1321 = dot( p13, p21 );
4363					float d4343 = dot( p43, p43 );
4364					float d2121 = dot( p21, p21 );
4365
4366					float denom = d2121 * d4343 - d4321 * d4321;
4367
4368					float numer = d1343 * d4321 - d1321 * d4343;
4369
4370					mua = numer / denom;
4371					mua = clamp( mua, 0.0, 1.0 );
4372					mub = ( d1343 + d4321 * ( mua ) ) / d4343;
4373					mub = clamp( mub, 0.0, 1.0 );
4374
4375					return vec2( mua, mub );
4376
4377				}
4378
4379				void main() {
4380
4381					#include <clipping_planes_fragment>
4382
4383					#ifdef USE_DASH
4384
4385						if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
4386
4387						if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
4388
4389					#endif
4390
4391					float alpha = opacity;
4392
4393					#ifdef WORLD_UNITS
4394
4395						// Find the closest points on the view ray and the line segment
4396						vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
4397						vec3 lineDir = worldEnd - worldStart;
4398						vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
4399
4400						vec3 p1 = worldStart + lineDir * params.x;
4401						vec3 p2 = rayEnd * params.y;
4402						vec3 delta = p1 - p2;
4403						float len = length( delta );
4404						float norm = len / linewidth;
4405
4406						#ifndef USE_DASH
4407
4408							#ifdef USE_ALPHA_TO_COVERAGE
4409
4410								float dnorm = fwidth( norm );
4411								alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
4412
4413							#else
4414
4415								if ( norm > 0.5 ) {
4416
4417									discard;
4418
4419								}
4420
4421							#endif
4422
4423						#endif
4424
4425					#else
4426
4427						#ifdef USE_ALPHA_TO_COVERAGE
4428
4429							// artifacts appear on some hardware if a derivative is taken within a conditional
4430							float a = vUv.x;
4431							float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
4432							float len2 = a * a + b * b;
4433							float dlen = fwidth( len2 );
4434
4435							if ( abs( vUv.y ) > 1.0 ) {
4436
4437								alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
4438
4439							}
4440
4441						#else
4442
4443							if ( abs( vUv.y ) > 1.0 ) {
4444
4445								float a = vUv.x;
4446								float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
4447								float len2 = a * a + b * b;
4448
4449								if ( len2 > 1.0 ) discard;
4450
4451							}
4452
4453						#endif
4454
4455					#endif
4456
4457					vec4 diffuseColor = vec4( diffuse, alpha );
4458					#ifdef USE_COLOR
4459						#ifdef USE_LINE_COLOR_ALPHA
4460							diffuseColor *= vLineColor;
4461						#else
4462							diffuseColor.rgb *= vLineColor;
4463						#endif
4464					#endif
4465
4466					#include <logdepthbuf_fragment>
4467
4468					gl_FragColor = diffuseColor;
4469
4470					#include <tonemapping_fragment>
4471					#include <${R1>=154?"colorspace_fragment":"encodings_fragment"}>
4472					#include <fog_fragment>
4473					#include <premultiplied_alpha_fragment>
4474
4475				}
4476			`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}
4476,alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}};var sA=new Nt,JI=new H,$I=new H,Qi=new Nt,Ji=new Nt,Jo=new Nt,lA=new H,uA=new mt,$i=new Xh,ez=new H,L1=new bn,N1=new En,$o=new Nt,es,df;function tz(n,e,t){return $o.set(0,0,-e,1).applyMatrix4(n.projectionMatrix),$o.multiplyScalar(1/$o.w),$o.x=df/t.width,$o.y=df/t.height,$o.applyMatrix4(n.projectionMatrixInverse),$o.multiplyScalar(1/$o.w),Math.abs(Math.max($o.x,$o.y))}function kW(n,e){let t=n.matrixWorld,i=n.geometry,r=i.attributes.instanceStart,a=i.attributes.instanceEnd,o=Math.min(i.instanceCount,r.count);for(let l=0,c=o;l<c;l++){$i.start.fromBufferAttribute(r,l),$i.end.fromBufferAttribute(a,l),$i.applyMatrix4(t);let f=new H,d=new H;es.distanceSqToSegment($i.start,$i.end,d,f),d.distanceTo(f)<df*.5&&e.push({point:d,pointOnLine:f,distance:es.origin.distanceTo(d),object:n,face:null,faceIndex:l,uv:null,[oA]:null})}}function FW(n,e,t){let i=e.projectionMatrix,a=n.material.resolution,o=n.matrixWorld,l=n.geometry,c=l.attributes.instanceStart,f=l.attributes.instanceEnd,d=Math.min(l.instanceCount,c.count),m=-e.near;es.at(1,Jo),Jo.w=1,Jo.applyMatrix4(e.matrixWorldInverse),Jo.applyMatrix4(i),Jo.multiplyScalar(1/Jo.w),Jo.x*=a.x/2,Jo.y*=a.y/2,Jo.z=0,lA.copy(Jo),uA.multiplyMatrices(e.matrixWorldInverse,o);for(let p=0,g=d;p<g;p++){if(Qi.fromBufferAttribute(c,p),Ji.fromBufferAttribute(f,p),Qi.w=1,Ji.w=1,Qi.applyMatrix4(uA),Ji.applyMatrix4(uA),Qi.z>m&&Ji.z>m)continue;if(Qi.z>m){let S=Qi.z-Ji.z,E=(Qi.z-m)/S;Qi.lerp(Ji,E)}else if(Ji.z>m){let S=Ji.z-Qi.z,E=(Ji.z-m)/S;Ji.lerp(Qi,E)}Qi.applyMatrix4(i),Ji.applyMatrix4(i),Qi.multiplyScalar(1/Qi.w),Ji.multiplyScalar(1/Ji.w),Qi.x*=a.x/2,Qi.y*=a.y/2,Ji.x*=a.x/2,Ji.y*=a.y/2,$i.start.copy(Qi),$i.start.z=0,$i.end.copy(Ji),$i.end.z=0;let T=$i.closestPointToPointParameter(lA,!0);$i.at(T,ez);let x=tp.lerp(Qi.z,Ji.z,T),_=x>=-1&&x<=1,b=lA.distanceTo(ez)<df*.5;if(_&&b){$i.start.fromBufferAttribute(c,p),$i.end.fromBufferAttribute(f,p),$i.start.applyMatrix4(o),$i.end.applyMatrix4(o);let S=new H,E=new H;es.distanceSqToSegment($i.start,$i.end,E,S),t.push({point:E,pointOnLine:S,distance:es.origin.distanceTo(E),object:n,face:null,faceIndex:p,uv:null,[oA]:null})}}}var hf=class extends ln{constructor(e=new cl,t=new fl({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,r=new Float32Array(2*t.count);for(let o=0,l=0,c=t.count;o<c;o++,l+=2)JI.fromBufferAttribute(t,o),$I.fromBufferAttribute(i,o),r[l]=l===0?0:r[l-1],r[l+1]=r[l]+JI.distanceTo($I);let a=new tl(r,2,1);return e.setAttribute("instanceDistanceStart",new dr(a,1,0)),e.setAttribute("instanceDistanceEnd",new dr(a,1,1)),this}raycast(e,t){let i=this.material.worldUnits,r=e.camera;r===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let a=e.params.Line2!==void 0&&e.params.Line2.threshold||0;es=e.ray;let o=this.matrixWorld,l=this.geometry,c=this.material;df=c.linewidth+a,l.boundingSphere===null&&l.computeBoundingSphere(),N1.copy(l.boundingSphere).applyMatrix4(o);let f;if(i)f=df*.5;else{let m=Math.max(r.near,N1.distanceToPoint(es.origin));f=tz(r,m,c.resolution)}if(N1.radius+=f,es.intersectsSphere(N1)===!1)return;l.boundingBox===null&&l.computeBoundingBox(),L1.copy(l.boundingBox).applyMatrix4(o);let d;if(i)d=df*.5;else{let m=Math.max(r.near,L1.distanceToPoint(es.origin));d=tz(r,m,c.resolution)}L1.expandByScalar(d),es.intersectsBox(L1)!==!1&&(i?kW(this,t):FW(this,r,t))}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(sA),this.material.uniforms.resolution.value.set(sA.z,sA.w))}};var Cv=class extends hf{constructor(e=new ff,t=new fl({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}};var mr=gi(or());var cA=mr.forwardRef(function({points:e,color:t=16777215,vertexColors:i,linewidth:r,lineWidth:a,segments:o,dashed:l,...c},f){var d,m;let p=pr(_=>_.size),g=mr.useMemo(()=>o?new hf:new Cv,[o]),[y]=mr.useState(()=>new fl),T=(i==null||(d=i[0])==null?void 0:d.length)===4?4:3,x=mr.useMemo(()=>{let _=o?new cl:new ff,b=e.map(S=>{let E=Array.isArray(S);return S instanceof H||S instanceof Nt?[S.x,S.y,S.z]:S instanceof Le?[S.x,S.y,0]:E&&S.length===3?[S[0],S[1],S[2]]:E&&S.length===2?[S[0],S[1],0]:S});if(_.setPositions(b.flat()),i){t=16777215;let S=i.map(E=>E instanceof tt?E.toArray():E);_.setColors(S.flat(),T)}return _},[e,o,i,T]);return mr.useLayoutEffect(()=>{g.computeLineDistances()},[e,g]),mr.useLayoutEffect(()=>{l?y.defines.USE_DASH="":delete y.defines.USE_DASH,y.needsUpdate=!0},[l,y]),mr.useEffect(()=>()=>{x.dispose(),y.dispose()},[x]),mr.createElement("primitive",Ka({object:g,ref:f},c),mr.createElement("primitive",{object:x,attach:"geometry"}),mr.createElement("primitive",Ka({object:y,attach:"material",color:t,vertexColors:!!i,resolution:[p.width,p.height],linewidth:(m=r??a)!==null&&m!==void 0?m:1,dashed:l,transparent:T===4},c)))});var Jr=gi(or());function BW(){var n=Object.create(null);function e(r,a){var o=r.id,l=r.name,c=r.dependencies;c===void 0&&(c=[]);var f=r.init;f===void 0&&(f=function(){});var d=r.getTransferables;if(d===void 0&&(d=null),!n[o])try{c=c.map(function(p){return p&&p.isWorkerModule&&(e(p,function(g){if(g instanceof Error)throw g}),p=n[p.id].value),p}),f=i("<"+l+">.init",f),d&&(d=i("<"+l+">.getTransferables",d));var m=null;typeof f=="function"?m=f.apply(void 0,c):console.error("worker module init function failed to rehydrate"),n[o]={id:o,value:m,getTransferables:d},a(m)}catch(p){p&&p.noLog||console.error(p),a(p)}}
4476function t(r,a){var o,l=r.id,c=r.args;(!n[l]||typeof n[l].value!="function")&&a(new Error("Worker module "+l+": not found or its 'init' did not return a function"));try{var f=(o=n[l]).value.apply(o,c);f&&typeof f.then=="function"?f.then(d,function(m){return a(m instanceof Error?m:new Error(""+m))}):d(f)}catch(m){a(m)}function d(m){try{var p=n[l].getTransferables&&n[l].getTransferables(m);(!p||!Array.isArray(p)||!p.length)&&(p=void 0),a(m,p)}catch(g){console.error(g),a(g)}}}function i(r,a){var o=void 0;self.troikaDefine=function(c){return o=c};var l=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/
4477
4478troikaDefine(
4479`+a+`
4480)`],{type:"application/javascript"}));try{importScripts(l)}catch(c){console.error(c)}return URL.revokeObjectURL(l),delete self.troikaDefine,o}self.addEventListener("message",function(r){var a=r.data,o=a.messageId,l=a.action,c=a.data;try{l==="registerModule"&&e(c,function(f){f instanceof Error?postMessage({messageId:o,success:!1,error:f.message}):postMessage({messageId:o,success:!0,result:{isCallable:typeof f=="function"}})}),l==="callModule"&&t(c,function(f,d){f instanceof Error?postMessage({messageId:o,success:!1,error:f.message}):postMessage({messageId:o,success:!0,result:f},d||void 0)})}catch(f){postMessage({messageId:o,success:!1,error:f.stack})}})}function HW(n){var e=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];return e._getInitResult().then(function(r){if(typeof r=="function")return r.apply(void 0,t);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var t=n.dependencies,i=n.init;t=Array.isArray(t)?t.map(function(a){return a&&(a=a.onMainThread||a,a._getInitResult&&(a=a._getInitResult())),a}):[];var r=Promise.all(t).then(function(a){return i.apply(null,a)});return e._getInitResult=function(){return r},r},e}var iz=function(){var n=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),n=!0}catch(t){typeof process<"u",console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return iz=function(){return n},n},VW=0,GW=0,fA=!1,Rv=Object.create(null),Dv=Object.create(null),dA=Object.create(null);function pf(n){if((!n||typeof n.init!="function")&&!fA)throw new Error("requires `options.init` function");var e=n.dependencies,t=n.init,i=n.getTransferables,r=n.workerId,a=HW(n);r==null&&(r="#default");var o="workerModule"+ ++VW,l=n.name||o,c=null;e=e&&e.map(function(d){return typeof d=="function"&&!d.workerModuleData&&(fA=!0,d=pf({workerId:r,name:"<"+l+"> function dependency: "+d.name,init:`function(){return (
4481`+P1(d)+`
4482)}`}),fA=!1),d&&d.workerModuleData&&(d=d.workerModuleData),d});function f(){for(var d=[],m=arguments.length;m--;)d[m]=arguments[m];if(!iz())return a.apply(void 0,d);if(!c){c=nz(r,"registerModule",f.workerModuleData);var p=function(){c=null,Dv[r].delete(p)};(Dv[r]||(Dv[r]=new Set)).add(p)}return c.then(function(g){var y=g.isCallable;if(y)return nz(r,"callModule",{id:o,args:d});throw new Error("Worker module function was called but `init` did not return a callable function")})}return f.workerModuleData={isWorkerModule:!0,id:o,name:l,dependencies:e,init:P1(t),getTransferables:i&&P1(i)},f.onMainThread=a,f}function rz(n){Dv[n]&&Dv[n].forEach(function(e){e()}),Rv[n]&&(Rv[n].terminate(),delete Rv[n])}function P1(n){var e=n.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function WW(n){var e=Rv[n];if(!e){var t=P1(BW);e=Rv[n]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+n.replace(/\*/g,"")+` **/
4483
4484;(`+t+")()"],{type:"application/javascript"}))),e.onmessage=function(i){var r=i.data,a=r.messageId,o=dA[a];if(!o)throw new Error("WorkerModule response with empty or unknown messageId");delete dA[a],o(r)}}return e}function nz(n,e,t){return new Promise(function(i,r){var a=++GW;dA[a]=function(o){o.success?i(o.result):r(new Error("Error in worker "+e+" call: "+o.error))},WW(n).postMessage({messageId:a,action:e,data:t})})}function hA(){var n=function(e){function t(Q,ee,G,Z,ne,he,se,J){var te=1-se;J.x=te*te*Q+2*te*se*G+se*se*ne,J.y=te*te*ee+2*te*se*Z+se*se*he}function i(Q,ee,G,Z,ne,he,se,J,te,re){var Oe=1-te;re.x=Oe*Oe*Oe*Q+3*Oe*Oe*te*G+3*Oe*te*te*ne+te*te*te*se,re.y=Oe*Oe*Oe*ee+3*Oe*Oe*te*Z+3*Oe*te*te*he+te*te*te*J}function r(Q,ee){for(var G=/([MLQCZ])([^MLQCZ]*)/g,Z,ne,he,se,J;Z=G.exec(Q);){var te=Z[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(re){return parseFloat(re)});switch(Z[1]){case"M":se=ne=te[0],J=he=te[1];break;case"L":(te[0]!==se||te[1]!==J)&&ee("L",se,J,se=te[0],J=te[1]);break;case"Q":{ee("Q",se,J,se=te[2],J=te[3],te[0],te[1]);break}case"C":{ee("C",se,J,se=te[4],J=te[5],te[0],te[1],te[2],te[3]);break}case"Z":(se!==ne||J!==he)&&ee("L",se,J,ne,he);break}}}function a(Q,ee,G){G===void 0&&(G=16);var Z={x:0,y:0};r(Q,function(ne,he,se,J,te,re,Oe,Be,De){switch(ne){case"L":ee(he,se,J,te);break;case"Q":{for(var Ue=he,Xe=se,ge=1;ge<G;
4484ge++)t(he,se,re,Oe,J,te,ge/(G-1),Z),ee(Ue,Xe,Z.x,Z.y),Ue=Z.x,Xe=Z.y;break}case"C":{for(var me=he,ce=se,Te=1;Te<G;Te++)i(he,se,re,Oe,Be,De,J,te,Te/(G-1),Z),ee(me,ce,Z.x,Z.y),me=Z.x,ce=Z.y;break}}})}var o="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",l="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",c=new WeakMap,f={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function d(Q,ee){var G=Q.getContext?Q.getContext("webgl",f):Q,Z=c.get(G);if(!Z){let Oe=function(me){var ce=he[me];if(!ce&&(ce=he[me]=G.getExtension(me),!ce))throw new Error(me+" not supported");return ce},Be=function(me,ce){var Te=G.createShader(ce);return G.shaderSource(Te,me),G.compileShader(Te),Te},De=function(me,ce,Te,F){if(!se[me]){var He={},Me={},_e=G.createProgram();G.attachShader(_e,Be(ce,G.VERTEX_SHADER)),G.attachShader(_e,Be(Te,G.FRAGMENT_SHADER)),G.linkProgram(_e),se[me]={program:_e,transaction:function(P){G.useProgram(_e),P({setUniform:function(q,de){for(var le=[],ie=arguments.length-2;ie-- >0;)le[ie]=arguments[ie+2];var ze=Me[de]||(Me[de]=G.getUniformLocation(_e,de));G["uniform"+q].apply(G,[ze].concat(le))},setAttribute:function(q,de,le,ie,ze){var Re=He[q];Re||(Re=He[q]={buf:G.createBuffer(),loc:G.getAttribLocation(_e,q),data:null}),G.bindBuffer(G.ARRAY_BUFFER,Re.buf),G.vertexAttribPointer(Re.loc,de,G.FLOAT,!1,0,0),G.enableVertexAttribArray(Re.loc),ne?G.vertexAttribDivisor(Re.loc,ie):Oe("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Re.loc,ie),ze!==Re.data&&(G.bufferData(G.ARRAY_BUFFER,ze,le),Re.data=ze)}})}}}se[me].transaction(F)},Ue=function(me,ce){te++;try{G.activeTexture(G.TEXTURE0+te);var Te=J[me];Te||(Te=J[me]=G.createTexture(),G.bindTexture(G.TEXTURE_2D,Te),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_MIN_FILTER,G.NEAREST),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_MAG_FILTER,G.NEAREST)),G.bindTexture(G.TEXTURE_2D,Te),ce(Te,te)}finally{te--}},Xe=function(me,ce,Te){var F=G.createFramebuffer();re.push(F),G.bindFramebuffer(G.FRAMEBUFFER,F),G.activeTexture(G.TEXTURE0+ce),G.bindTexture(G.TEXTURE_2D,me),G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,me,0);try{Te(F)}finally{G.deleteFramebuffer(F),G.bindFramebuffer(G.FRAMEBUFFER,re[--re.length-1]||null)}},ge=function(){he={},se={},J={},te=-1,re.length=0};var ne=typeof WebGL2RenderingContext<"u"&&G instanceof WebGL2RenderingContext,he={},se={},J={},te=-1,re=[];G.canvas.addEventListener("webglcontextlost",function(me){ge(),me.preventDefault()},!1),c.set(G,Z={gl:G,isWebGL2:ne,getExtension:Oe,withProgram:De,withTexture:Ue,withTextureFramebuffer:Xe,handleContextLoss:ge})}ee(Z)}function m(Q,ee,G,Z,ne,he,se,J){se===void 0&&(se=15),J===void 0&&(J=null),d(Q,function(te){var re=te.gl,Oe=te.withProgram,Be=te.withTexture;Be("copy",function(De,Ue){re.texImage2D(re.TEXTURE_2D,0,re.RGBA,ne,he,0,re.RGBA,re.UNSIGNED_BYTE,ee),Oe("copy",o,l,function(Xe){var ge=Xe.setUniform,me=Xe.setAttribute;me("aUV",2,re.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ge("1i","image",Ue),re.bindFramebuffer(re.FRAMEBUFFER,J||null),re.disable(re.BLEND),re.colorMask(se&8,se&4,se&2,se&1),re.viewport(G,Z,ne,he),re.scissor(G,Z,ne,he),re.drawArrays(re.TRIANGLES,0,3)})})})}function p(Q,ee,G){var Z=Q.width,ne=Q.height;d(Q,function(he){var se=he.gl,J=new Uint8Array(Z*ne*4);se.readPixels(0,0,Z,ne,se.RGBA,se.UNSIGNED_BYTE,J),Q.width=ee,Q.height=G,m(se,J,0,0,Z,ne)})}var g=Object.freeze({__proto__:null,withWebGLContext:d,renderImageData:m,resizeWebGLCanvasWithoutClearing:p});function y(Q,ee,G,Z,ne,he){he===void 0&&(he=1);var se=new Uint8Array(Q*ee),J=Z[2]-Z[0],te=Z[3]-Z[1],re=[];a(G,function(me,ce,Te,F){re.push({x1:me,y1:ce,x2:Te,y2:F,minX:Math.min(me,Te),minY:Math.min(ce,F),maxX:Math.max(me,Te),maxY:Math.max(ce,F)})}),re.sort(function(me,ce){return me.maxX-ce.maxX});for(var Oe=0;Oe<Q;Oe++)for(var Be=0;Be<ee;Be++){var De=Xe(Z[0]+J*(Oe+.5)/Q,Z[1]+te*(Be+.5)/ee),Ue=Math.pow(1-Math.abs(De)/ne,he)/2;De<0&&(Ue=1-Ue),Ue=Math.max(0,Math.min(255,Math.round(Ue*255))),se[Be*Q+Oe]=Ue}return se;function Xe(me,ce){for(var Te=1/0,F=1/0,He=re.length;He--;){var Me=re[He];if(Me.maxX+F<=me)break;
4484if(me+F>Me.minX&&ce-F<Me.maxY&&ce+F>Me.minY){var _e=_(me,ce,Me.x1,Me.y1,Me.x2,Me.y2);_e<Te&&(Te=_e,F=Math.sqrt(Te))}}return ge(me,ce)&&(F=-F),F}function ge(me,ce){for(var Te=0,F=re.length;F--;){var He=re[F];if(He.maxX<=me)break;var Me=He.y1>ce!=He.y2>ce&&me<(He.x2-He.x1)*(ce-He.y1)/(He.y2-He.y1)+He.x1;Me&&(Te+=He.y1<He.y2?1:-1)}return Te!==0}}function T(Q,ee,G,Z,ne,he,se,J,te,re){he===void 0&&(he=1),J===void 0&&(J=0),te===void 0&&(te=0),re===void 0&&(re=0),x(Q,ee,G,Z,ne,he,se,null,J,te,re)}function x(Q,ee,G,Z,ne,he,se,J,te,re,Oe){he===void 0&&(he=1),te===void 0&&(te=0),re===void 0&&(re=0),Oe===void 0&&(Oe=0);for(var Be=y(Q,ee,G,Z,ne,he),De=new Uint8Array(Be.length*4),Ue=0;Ue<Be.length;Ue++)De[Ue*4+Oe]=Be[Ue];m(se,De,te,re,Q,ee,1<<3-Oe,J)}function _(Q,ee,G,Z,ne,he){var se=ne-G,J=he-Z,te=se*se+J*J,re=te?Math.max(0,Math.min(1,((Q-G)*se+(ee-Z)*J)/te)):0,Oe=Q-(G+re*se),Be=ee-(Z+re*J);return Oe*Oe+Be*Be}var b=Object.freeze({__proto__:null,generate:y,generateIntoCanvas:T,generateIntoFramebuffer:x}),S="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",E="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",C="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",D=new Float32Array([0,0,2,0,0,2]),U=null,w=!1,R={},L=new WeakMap;function I(Q){if(!w&&!W(Q))throw new Error("WebGL generation not supported")}function z(Q,ee,G,Z,ne,he,se){if(he===void 0&&(he=1),se===void 0&&(se=null),!se&&(se=U,!se)){var J=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!J)throw new Error("OffscreenCanvas or DOM canvas not supported");se=U=J.getContext("webgl",{depth:!1})}I(se);var te=new Uint8Array(Q*ee*4);d(se,function(De){var Ue=De.gl,Xe=De.withTexture,ge=De.withTextureFramebuffer;Xe("readable",function(me,ce){Ue.texImage2D(Ue.TEXTURE_2D,0,Ue.RGBA,Q,ee,0,Ue.RGBA,Ue.UNSIGNED_BYTE,null),ge(me,ce,function(Te){V(Q,ee,G,Z,ne,he,Ue,Te,0,0,0),Ue.readPixels(0,0,Q,ee,Ue.RGBA,Ue.UNSIGNED_BYTE,te)})})});for(var re=new Uint8Array(Q*ee),Oe=0,Be=0;Oe<te.length;Oe+=4)re[Be++]=te[Oe];return re}function B(Q,ee,G,Z,ne,he,se,J,te,re){he===void 0&&(he=1),J===void 0&&(J=0),te===void 0&&(te=0),re===void 0&&(re=0),V(Q,ee,G,Z,ne,he,se,null,J,te,re)}function V(Q,ee,G,Z,ne,he,se,J,te,re,Oe){he===void 0&&(he=1),te===void 0&&(te=0),re===void 0&&(re=0),Oe===void 0&&(Oe=0),I(se);var Be=[];a(G,function(De,Ue,Xe,ge){Be.push(De,Ue,Xe,ge)}),Be=new Float32Array(Be),d(se,function(De){var Ue=De.gl,Xe=De.isWebGL2,ge=De.getExtension,me=De.withProgram,ce=De.withTexture,Te=De.withTextureFramebuffer,F=De.handleContextLoss;if(ce("rawDistances",function(He,Me){(Q!==He._lastWidth||ee!==He._lastHeight)&&Ue.texImage2D(Ue.TEXTURE_2D,0,Ue.RGBA,He._lastWidth=Q,He._lastHeight=ee,0,Ue.RGBA,Ue.UNSIGNED_BYTE,null),me("main",S,E,function(_e){var Ae=_e.setAttribute,P=_e.setUniform,O=!Xe&&ge("ANGLE_instanced_arrays"),q=!Xe&&ge("EXT_blend_minmax");Ae("aUV",2,Ue.STATIC_DRAW,0,D),Ae("aLineSegment",4,Ue.DYNAMIC_DRAW,1,Be),P.apply(void 0,["4f","uGlyphBounds"].concat(Z)),P("1f","uMaxDistance",ne),P("1f","uExponent",he),Te(He,Me,function(de){Ue.enable(Ue.BLEND),Ue.colorMask(!0,!0,
4484!0,!0),Ue.viewport(0,0,Q,ee),Ue.scissor(0,0,Q,ee),Ue.blendFunc(Ue.ONE,Ue.ONE),Ue.blendEquationSeparate(Ue.FUNC_ADD,Xe?Ue.MAX:q.MAX_EXT),Ue.clear(Ue.COLOR_BUFFER_BIT),Xe?Ue.drawArraysInstanced(Ue.TRIANGLES,0,3,Be.length/4):O.drawArraysInstancedANGLE(Ue.TRIANGLES,0,3,Be.length/4)})}),me("post",o,C,function(_e){_e.setAttribute("aUV",2,Ue.STATIC_DRAW,0,D),_e.setUniform("1i","tex",Me),Ue.bindFramebuffer(Ue.FRAMEBUFFER,J),Ue.disable(Ue.BLEND),Ue.colorMask(Oe===0,Oe===1,Oe===2,Oe===3),Ue.viewport(te,re,Q,ee),Ue.scissor(te,re,Q,ee),Ue.drawArrays(Ue.TRIANGLES,0,3)})}),Ue.isContextLost())throw F(),new Error("webgl context lost")})}function W(Q){var ee=!Q||Q===U?R:Q.canvas||Q,G=L.get(ee);if(G===void 0){w=!0;var Z=null;try{var ne=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],he=z(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,Q);G=he&&ne.length===he.length&&he.every(function(se,J){return se===ne[J]}),G||(Z="bad trial run results",console.info(ne,he))}catch(se){G=!1,Z=se.message}Z&&console.warn("WebGL SDF generation not supported:",Z),w=!1,L.set(ee,G)}return G}var X=Object.freeze({__proto__:null,generate:z,generateIntoCanvas:B,generateIntoFramebuffer:V,isSupported:W});function K(Q,ee,G,Z,ne,he){ne===void 0&&(ne=Math.max(Z[2]-Z[0],Z[3]-Z[1])/2),he===void 0&&(he=1);try{return z.apply(X,arguments)}catch(se){return console.info("WebGL SDF generation failed, falling back to JS",se),y.apply(b,arguments)}}function pe(Q,ee,G,Z,ne,he,se,J,te,re){ne===void 0&&(ne=Math.max(Z[2]-Z[0],Z[3]-Z[1])/2),he===void 0&&(he=1),J===void 0&&(J=0),te===void 0&&(te=0),re===void 0&&(re=0);try{return B.apply(X,arguments)}catch(Oe){return console.info("WebGL SDF generation failed, falling back to JS",Oe),T.apply(b,arguments)}}return e.forEachPathCommand=r,e.generate=K,e.generateIntoCanvas=pe,e.javascript=b,e.pathToLineSegments=a,e.webgl=X,e.webglUtils=g,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return n}function XW(){var n=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},i={},r={};i.L=1,r[1]="L",Object.keys(t).forEach(function(F,He){i[F]=1<<He+1,r[i[F]]=F}),Object.freeze(i);var a=i.LRI|i.RLI|i.FSI,o=i.L|i.R|i.AL,l=i.B|i.S|i.WS|i.ON|i.FSI|i.LRI|i.RLI|i.PDI,c=i.BN|i.RLE|i.LRE|i.RLO|i.LRO|i.PDF,f=i.S|i.WS|i.B|a|i.PDI|c,d=null;function m(){if(!d){d=new Map;var F=function(Me){if(t.hasOwnProperty(Me)){var _e=0;t[Me].split(",").forEach(function(Ae){var P=Ae.split("+"),O=P[0],q=P[1];O=parseInt(O,36),q=q?parseInt(q,36):0,d.set(_e+=O,i[Me]);for(var de=0;de<q;de++)d.set(++_e,i[Me])})}};for(var He in t)F(He)}}
vendor: 7,091 bytes, line 4484
4484function p(F){return m(),d.get(F.codePointAt(0))||i.L}function g(F){return r[p(F)]}var y={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function T(F,He){var Me=36,_e=0,Ae=new Map,P=He&&new Map,O;return F.split(",").forEach(function q(de){if(de.indexOf("+")!==-1)for(var le=+de;le--;)q(O);else{O=de;var ie=de.split(">"),ze=ie[0],Re=ie[1];ze=String.fromCodePoint(_e+=parseInt(ze,Me)),Re=String.fromCodePoint(_e+=parseInt(Re,Me)),Ae.set(ze,Re),He&&P.set(Re,ze)}}),{map:Ae,reverseMap:P}}var x,_,b;function S(){if(!x){var F=T(y.pairs,!0),He=F.map,Me=F.reverseMap;x=He,_=Me,b=T(y.canonical,!1).map}}function E(F){return S(),x.get(F)||null}function C(F){return S(),_.get(F)||null}function D(F){return S(),b.get(F)||null}var U=i.L,w=i.R,R=i.EN,L=i.ES,I=i.ET,z=i.AN,B=i.CS,V=i.B,W=i.S,X=i.ON,K=i.BN,pe=i.NSM,Q=i.AL,ee=i.LRO,G=i.RLO,Z=i.LRE,ne=i.RLE,he=i.PDF,se=i.LRI,J=i.RLI,te=i.FSI,re=i.PDI;function Oe(F,He){for(var Me=125,_e=new Uint32Array(F.length),Ae=0;Ae<F.length;Ae++)_e[Ae]=p(F[Ae]);var P=new Map;function O(zi,ia){var nr=_e[zi];_e[zi]=ia,P.set(nr,P.get(nr)-1),nr&l&&P.set(l,P.get(l)-1),P.set(ia,(P.get(ia)||0)+1),ia&l&&P.set(l,(P.get(l)||0)+1)}for(var q=new Uint8Array(F.length),de=new Map,le=[],ie=null,ze=0;ze<F.length;ze++)ie||le.push(ie={start:ze,end:F.length-1,level:He==="rtl"?1:He==="ltr"?0:Mf(ze,!1)}),_e[ze]&V&&(ie.end=ze,ie=null);for(var Re=ne|Z|G|ee|a|re|he|V,Ye=function(zi){return zi+(zi&1?1:2)},at=function(zi){return zi+(zi&1?2:1)},we=0;we<le.length;we++){ie=le[we];var Pe=[{_level:ie.level,_override:0,_isolate:0}],Fe=void 0,Y=0,oe=0,Ge=0;P.clear();for(var j=ie.start;j<=ie.end;j++){var Se=_e[j];if(Fe=Pe[Pe.length-1],P.set(Se,(P.get(Se)||0)+1),Se&l&&P.set(l,(P.get(l)||0)+1),Se&Re)if(Se&(ne|Z)){q[j]=Fe._level;var Ie=(Se===ne?at:Ye)(Fe._level);Ie<=Me&&!Y&&!oe?Pe.push({_level:Ie,_override:0,_isolate:0}):Y||oe++}else if(Se&(G|ee)){q[j]=Fe._level;var Ke=(Se===G?at:Ye)(Fe._level);Ke<=Me&&!Y&&!oe?Pe.push({_level:Ke,_override:Se&G?w:U,_isolate:0}):Y||oe++}else if(Se&a){Se&te&&(Se=Mf(j+1,!0)===1?J:se),q[j]=Fe._level,Fe._override&&O(j,Fe._override);var ke=(Se===J?at:Ye)(Fe._level);ke<=Me&&Y===0&&oe===0?(Ge++,Pe.push({_level:ke,_override:0,_isolate:1,_isolInitIndex:j})):Y++}else if(Se&re){if(Y>0)Y--;else if(Ge>0){for(oe=0;!Pe[Pe.length-1]._isolate;)Pe.pop();var fe=Pe[Pe.length-1]._isolInitIndex;fe!=null&&(de.set(fe,j),de.set(j,fe)),Pe.pop(),Ge--}Fe=Pe[Pe.length-1],q[j]=Fe._level,Fe._override&&O(j,Fe._override)}else Se&he?(Y===0&&(oe>0?oe--:!Fe._isolate&&Pe.length>1&&(Pe.pop(),Fe=Pe[Pe.length-1])),q[j]=Fe._level):Se&V&&(q[j]=ie.level);else q[j]=Fe._level,Fe._override&&Se!==K&&O(j,Fe._override)}for(var qe=[],it=null,rt=ie.start;rt<=ie.end;rt++){var dt=_e[rt];if(!(dt&c)){var jt=q[rt],Ht=dt&a,pn=dt===re;it&&jt===it._level?(it._end=rt,it._endsWithIsolInit=Ht):qe.push(it={_start:rt,_end:rt,_level:jt,_startsWithPDI:pn,_endsWithIsolInit:Ht})}}for(var ti=[],$r=0;$r<qe.length;$r++){var Pi=qe[$r];if(!Pi._startsWithPDI||Pi._startsWithPDI&&!de.has(Pi._start)){for(var tr=[it=Pi],di=void 0;it&&it._endsWithIsolInit&&(di=de.get(it._end))!=null;)for(var jn=$r+1;jn<qe.length;jn++)if(qe[jn]._start===di){tr.push(it=qe[jn]);break}for(var Zn=[],gr=0;gr<tr.length;gr++)for(var Qa=tr[gr],Ao=Qa._start;Ao<=Qa._end;Ao++)Zn.push(Ao);for(var vr=q[Zn[0]],Dr=ie.level,ea=Zn[0]-1;ea>=0;ea--)if(!(_e[ea]&c)){Dr=q[ea];break}var is=Zn[Zn.length-1],rs=q[is],Co=ie.level;if(!(_e[is]&a)){for(var as=is+1;as<=ie.end;as++)if(!(_e[as]&c)){Co=q[as];break}}ti.push({_seqIndices:Zn,_sosType:Math.max(Dr,vr)%2?w:U,_eosType:Math.max(Co,rs)%2?w:U})}}for(var dl=0;dl<ti.length;dl++){var hl=ti[dl],N=hl._seqIndices,ae=hl._sosType,xe=hl._eosType,ve=q[N[0]]&1?w:U;if(P.get(pe))for(var ye=0;ye<N.length;ye++){var Je=N[ye];if(_e[Je]&pe){for(var et=ae,nt=ye-1;nt>=0;nt--)if(!(_e[N[nt]]&c)){et=_e[N[nt]];break}O(Je,et&(a|re)?X:et)}}if(P.get(R))for(var Qe=0;Qe<N.length;Qe++){var ft=N[Qe];if(_e[ft]&R)for(var vt=Qe-1;vt>=-1;vt--){var Mt=vt===-1?ae:_e[N[vt]];if(Mt&o){Mt===Q&&O(ft,z);break}}}if(P.get(Q))for(var ht=0;ht<N.length;ht++){var Zt=N[ht];_e[Zt]&Q&&O(Zt,w)}if(P.get(L)||P.get(B))for(var en=1;en<N.length-1;en++){var on=N[en];if(_e[on]&(L|B)){for(var Lt=0,Vt=0,$e=en-1;$e>=0&&(Lt=_e[N[$e]],!!(Lt&c));$e--);for(var Vn=en+1;Vn<N.length&&(Vt=_e[N[Vn]],!!(Vt&c));Vn++);Lt===Vt&&(_e[on]===L?Lt===R:Lt&(R|z))&&O(on,Lt)}}if(P.get(R))for(var bt=0;bt<N.length;bt++){var Ei=N[bt];if(_e[Ei]&R){for(var hi=bt-1;hi>=0&&_e[N[hi]]&(I|c);hi--)O(N[hi],R);for(bt++;bt<N.length&&_e[N[bt]]&(I|c|R);bt++)_e[N[bt]]!==R&&O(N[bt],R)}}if(P.get(I)||P.get(L)||P.get(B))for(var Pn=0;Pn<N.length;Pn++){var Ur=N[Pn];if(_e[Ur]&(I|L|B)){O(Ur,X);for(var Gt=Pn-1;Gt>=0&&_e[N[Gt]]&c;Gt--)O(N[Gt],X);for(var xn=Pn+1;xn<N.length&&_e[N[xn]]&c;xn++)O(N[xn],X)}}if(P.get(R))for(var yr=0,Un=ae;yr<N.length;yr++){var Or=N[yr],ta=_e[Or];ta&R?Un===U&&O(Or,U):ta&o&&(Un=ta)}if(P.get(l)){var Ja=w|R|z,gp=Ja|U,pl=[];{for(var os=[],ml=0;ml<N.length;ml++)if(_e[N[ml]]&l){var gl=F[N[ml]],vp=void 0;if(E(gl)!==null)if(os.length<63)os.push({char:gl,seqIndex:ml});else break;else if((vp=C(gl))!==null)for(var vl=os.length-1;vl>=0;vl--){var zu=os[vl].char;if(zu===vp||zu===C(D(gl))||E(D(zu))===gl){pl.push([os[vl].seqIndex,ml]),os.length=vl;break}}}pl.sort(function(zi,ia){return zi[0]-ia[0]})}for(var yf=0;yf<pl.length;yf++){for(var yp=pl[yf],ku=yp[0],_f=yp[1],_p=!1,na=0,bf=ku+1;bf<_f;bf++){var ss=N[bf];if(_e[ss]&gp){_p=!0;var bp=_e[ss]&Ja?w:U;if(bp===ve){na=bp;break}}}if(_p&&!na){na=ae;for(var yl=ku-1;yl>=0;yl--){var Fu=N[yl];if(_e[Fu]&gp){var xp=_e[Fu]&Ja?w:U;xp!==ve?na=xp:na=ve;break}}}if(na){if(_e[N[ku]]=_e[N[_f]]=na,na!==ve){for(var ls=ku+1;ls<N.length;ls++)if(!(_e[N[ls]]&c)){p(F[N[ls]])&pe&&(_e[N[ls]]=na);break}}if(na!==ve){for(var Bu=_f+1;Bu<N.length;Bu++)if(!(_e[N[Bu]]&c)){p(F[N[Bu]])&pe&&(_e[N[Bu]]=na);break}}}}for(var $a=0;$a<N.length;$a++)if(_e[N[$a]]&l){for(var Sp=$a,xf=$a,Sf=ae,_l=$a-1;_l>=0;_l--)if(_e[N[_l]]&c)Sp=_l;else{Sf=_e[N[_l]]&Ja?w:U;break}for(var Tf=xe,bl=$a+1;bl<N.length;bl++)if(_e[N[bl]]&(l|c))xf=bl;else{Tf=_e[N[bl]]&Ja?w:U;break}for(var Ef=Sp;Ef<=xf;Ef++)_e[N[Ef]]=Sf===Tf?Sf:ve;$a=xf}}}for(var Ii=ie.start;Ii<=ie.end;Ii++){var Lv=q[Ii],Hu=_e[Ii];if(Lv&1?Hu&(U|R|z)&&q[Ii]++:Hu&w?q[Ii]++:Hu&(z|R)&&(q[Ii]+=2),Hu&c&&(q[Ii]=Ii===0?ie.level:q[Ii-1]),Ii===ie.end||p(F[Ii])&(W|V))for(var Vu=Ii;Vu>=0&&p(F[Vu])&f;Vu--)q[Vu]=ie.level}}return{levels:q,paragraphs:le};function Mf(zi,ia){for(var nr=zi;nr<F.length;nr++){var eo=_e[nr];if(eo&(w|Q))return 1;if(eo&(V|U)||ia&&eo===re)return 0;if(eo&a){var xl=Nv(nr);nr=xl===-1?F.length:xl}}return 0}function Nv(zi){for(var ia=1,nr=zi+1;nr<F.length;nr++){var eo=_e[nr];if(eo&V)break;if(eo&re){if(--ia===0)return nr}else eo&a&&ia++}return-1}}var Be="14>1,j>2,t>2,u>2,1a>g,2v3>
44841,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",De;function Ue(){if(!De){var F=T(Be,!0),He=F.map,Me=F.reverseMap;Me.forEach(function(_e,Ae){He.set(Ae,_e)}),De=He}}function Xe(F){return Ue(),De.get(F)||null}function ge(F,He,Me,_e){var Ae=F.length;Me=Math.max(0,Me==null?0:+Me),_e=Math.min(Ae-1,_e==null?Ae-1:+_e);for(var P=new Map,O=Me;O<=_e;O++)if(He[O]&1){var q=Xe(F[O]);q!==null&&P.set(O,q)}return P}function me(F,He,Me,_e){var Ae=F.length;Me=Math.max(0,Me==null?0:+Me),_e=Math.min(Ae-1,_e==null?Ae-1:+_e);var P=[];return He.paragraphs.forEach(function(O){var q=Math.max(Me,O.start),de=Math.min(_e,O.end);if(q<de){for(var le=He.levels.slice(q,de+1),ie=de;ie>=q&&p(F[ie])&f;ie--)le[ie]=O.level;for(var ze=O.level,Re=1/0,Ye=0;Ye<le.length;Ye++){var at=le[Ye];at>ze&&(ze=at),at<Re&&(Re=at|1)}for(var we=ze;we>=Re;we--)for(var Pe=0;Pe<le.length;Pe++)if(le[Pe]>=we){for(var Fe=Pe;Pe+1<le.length&&le[Pe+1]>=we;)Pe++;Pe>Fe&&P.push([Fe+q,Pe+q])}}}),P}function ce(F,He,Me,_e){var Ae=Te(F,He,Me,_e),P=[].concat(F);return Ae.forEach(function(O,q){P[q]=(He.levels[O]&1?Xe(F[O]):null)||F[O]}),P.join("")}function Te(F,He,Me,_e){for(var Ae=me(F,He,Me,_e),P=[],O=0;O<F.length;O++)P[O]=O;return Ae.forEach(function(q){for(var de=q[0],le=q[1],ie=P.slice(de,le+1),ze=ie.length;ze--;)P[le-ze]=ie[ze]}),P}return e.closingToOpeningBracket=C,e.getBidiCharType=p,e.getBidiCharTypeName=g,e.getCanonicalBracket=D,e.getEmbeddingLevels=Oe,e.getMirroredCharacter=Xe,e.getMirroredCharactersMap=ge,e.getReorderSegments=me,e.getReorderedIndices=Te,e.getReorderedString=ce,e.openingToClosingBracket=E,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return n}var az=XW;var mA=/\bvoid\s+main\s*\(\s*\)\s*{/g;function pA(n){let e=/^[ \t]*#include +<([\w\d./]+)>/gm;function t(i,r){let a=Rt[r];return a?pA(a):i}return n.replace(e,t)}var er=[];for(let n=0;n<256;n++)er[n]=(n<16?"0":"")+n.toString(16);function qW(){let n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(er[n&255]+er[n>>8&255]+er[n>>16&255]+er[n>>24&255]+"-"+er[e&255]+er[e>>8&255]+"-"+er[e>>16&15|64]+er[e>>24&255]+"-"+er[t&63|128]+er[t>>8&255]+"-"+er[t>>16&255]+er[t>>24&255]+er[i&255]+er[i>>8&255]+er[i>>16&255]+er[i>>24&255]).toUpperCase()}var mf=Object.assign||function(){let n=arguments[0];for(let e=1,t=arguments.length;e<t;e++){let i=arguments[e];if(i)for(let r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},YW=Date.now(),oz=new WeakMap,sz=new Map,jW=1e10;function I1(n,e){let t=JW(e),i=oz.get(n);if(i||oz.set(n,i=Object.create(null)),i[t])return new i[t];let r=`_onBeforeCompile${t}`,a=function(f,d){n.onBeforeCompile.call(this,f,d);let m=this.customProgramCacheKey()+"|"+f.vertexShader+"|"+f.fragmentShader,p=sz[m];if(!p){let g=ZW(this,f,e,t);p=sz[m]=g}f.vertexShader=p.vertexShader,f.fragmentShader=p.fragmentShader,mf(f.uniforms,this.uniforms),e.timeUniform&&(f.uniforms[e.timeUniform]={get value(){return Date.now()-YW}}),this[r]&&this[r](f)},o=function(){return l(e.chained?n:n.clone())},l=function(f){let d=Object.create(f,c);return Object.defineProperty(d,"baseMaterial",{value:n}),Object.defineProperty(d,"id",{value:jW++}),d.uuid=qW(),d.uniforms=mf({},f.uniforms,e.uniforms),d.defines=mf({},f.defines,e.defines),d.defines[`TROIKA_DERIVED_MATERIAL_${t}`]="",d.extensions=mf({},f.extensions,e.extensions),d._listeners=void 0,d},c={constructor:{value:o},isDerivedMaterial:{value:!0},type:{get:()=>n.type,set:f=>{n.type=f}},isDerivedFrom:{writable:!0,configurable:!0,value:function(f){let d=this.baseMaterial;return f===d||d.isDerivedMaterial&&d.isDerivedFrom(f)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return n.customProgramCacheKey()+"|"+t}},onBeforeCompile:{get(){return a},set(f){this[r]=f}}
4484,copy:{writable:!0,configurable:!0,value:function(f){return n.copy.call(this,f),!n.isShaderMaterial&&!n.isDerivedMaterial&&(mf(this.extensions,f.extensions),mf(this.defines,f.defines),mf(this.uniforms,Zo.clone(f.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){let f=new n.constructor;return l(f).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let f=this._depthMaterial;return f||(f=this._depthMaterial=I1(n.isDerivedMaterial?n.getDepthMaterial():new Mu({depthPacking:s1}),e),f.defines.IS_DEPTH_MATERIAL="",f.uniforms=this.uniforms),f}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let f=this._distanceMaterial;return f||(f=this._distanceMaterial=I1(n.isDerivedMaterial?n.getDistanceMaterial():new wu,e),f.defines.IS_DISTANCE_MATERIAL="",f.uniforms=this.uniforms),f}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:f,_distanceMaterial:d}=this;f&&f.dispose(),d&&d.dispose(),n.dispose.call(this)}}};return i[t]=o,new o}function ZW(n,{vertexShader:e,fragmentShader:t},i,r){let{vertexDefs:a,vertexMainIntro:o,vertexMainOutro:l,vertexTransform:c,fragmentDefs:f,fragmentMainIntro:d,fragmentMainOutro:m,fragmentColorTransform:p,customRewriter:g,timeUniform:y}=i;if(a=a||"",o=o||"",l=l||"",f=f||"",d=d||"",m=m||"",(c||g)&&(e=pA(e)),(p||g)&&(t=t.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,`
4485//!BEGIN_POST_CHUNK $1
4486$&
4487//!END_POST_CHUNK
4488`),t=pA(t)),g){let T=g({vertexShader:e,fragmentShader:t});e=T.vertexShader,t=T.fragmentShader}if(p){let T=[];t=t.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,x=>(T.push(x),"")),m=`${p}
4489${T.join(`
4490`)}
4491${m}`}if(y){let T=`
4492uniform float ${y};
4493`;a=T+a,f=T+f}return c&&(e=`vec3 troika_position_${r};
4494vec3 troika_normal_${r};
4495vec2 troika_uv_${r};
4496${e}
4497`,a=`${a}
4498void troikaVertexTransform${r}(inout vec3 position, inout vec3 normal, inout vec2 uv) {
4499  ${c}
4500}
4501`,o=`
4502troika_position_${r} = vec3(position);
4503troika_normal_${r} = vec3(normal);
4504troika_uv_${r} = vec2(uv);
4505troikaVertexTransform${r}(troika_position_${r}, troika_normal_${r}, troika_uv_${r});
4506${o}
4507`,e=e.replace(/\b(position|normal|uv)\b/g,(T,x,_,b)=>/\battribute\s+vec[23]\s+$/.test(b.substr(0,_))?x:`troika_${x}_${r}`),n.map&&n.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${r}`))),e=lz(e,r,a,o,l),t=lz(t,r,f,d,m),{vertexShader:e,fragmentShader:t}}function lz(n,e,t,i,r){return(i||r||t)&&(n=n.replace(mA,`
4508${t}
4509void troikaOrigMain${e}() {`),n+=`
4510void main() {
4511  ${i}
4512  troikaOrigMain${e}();
4513  ${r}
4514}`),n}function KW(n,e){return n==="uniforms"?void 0:typeof e=="function"?e.toString():e}var QW=0,uz=new Map;function JW(n){let e=JSON.stringify(n,KW),t=uz.get(e);return t==null&&uz.set(e,t=++QW),t}function $W(){return typeof window>"u"&&(self.window=self),function(n){var e={parse:function(r){var a=e._bin,o=new Uint8Array(r);if(a.readASCII(o,0,4)=="ttcf"){var l=4;a.readUshort(o,l),l+=2,a.readUshort(o,l),l+=2;var c=a.readUint(o,l);l+=4;for(var f=[],d=0;d<c;d++){var m=a.readUint(o,l);l+=4,f.push(e._readFont(o,m))}return f}return[e._readFont(o,0)]},_readFont:function(r,a){var o=e._bin,l=a;o.readFixed(r,a),a+=4;var c=o.readUshort(r,a);a+=2,o.readUshort(r,a),a+=2,o.readUshort(r,a),a+=2,o.readUshort(r,a),a+=2;for(var f=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],d={_data:r,_offset:l},m={},p=0;p<c;p++){var g=o.readASCII(r,a,4);a+=4,o.readUint(r,a),a+=4;var y=o.readUint(r,a);a+=4;var T=o.readUint(r,a);a+=4,m[g]={offset:y,length:T}}for(p=0;p<f.length;p++){var x=f[p];m[x]&&(d[x.trim()]=e[x.trim()].parse(r,m[x].offset,m[x].length,d))}return d},_tabOffset:function(r,a,o){for(var l=e._bin,c=l.readUshort(r,o+4),f=o+12,d=0;d<c;d++){var m=l.readASCII(r,f,4);f+=4,l.readUint(r,f),f+=4;var p=l.readUint(r,f);if(f+=4,l.readUint(r,f),f+=4,m==a)return p}return 0}};e._bin={readFixed:function(r,a){return(r[a]<<8|r[a+1])+(r[a+2]<<8|r[a+3])/65540},readF2dot14:function(r,a){return e._bin.readShort(r,a)/16384},readInt:function(r,a){return e._bin._view(r).getInt32(a)},readInt8:function(r,a){return e._bin._view(r).getInt8(a)},readShort:function(r,a){return e._bin._view(r).getInt16(a)},readUshort:function(r,a){return e._bin._view(r).getUint16(a)},readUshorts:function(r,a,o){for(var l=[],c=0;c<o;
4514c++)l.push(e._bin.readUshort(r,a+2*c));return l},readUint:function(r,a){return e._bin._view(r).getUint32(a)},readUint64:function(r,a){return 4294967296*e._bin.readUint(r,a)+e._bin.readUint(r,a+4)},readASCII:function(r,a,o){for(var l="",c=0;c<o;c++)l+=String.fromCharCode(r[a+c]);return l},readUnicode:function(r,a,o){for(var l="",c=0;c<o;c++){var f=r[a++]<<8|r[a++];l+=String.fromCharCode(f)}return l},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(r,a,o){var l=e._bin._tdec;return l&&a==0&&o==r.length?l.decode(r):e._bin.readASCII(r,a,o)},readBytes:function(r,a,o){for(var l=[],c=0;c<o;c++)l.push(r[a+c]);return l},readASCIIArray:function(r,a,o){for(var l=[],c=0;c<o;c++)l.push(String.fromCharCode(r[a+c]));return l},_view:function(r){return r._dataView||(r._dataView=r.buffer?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(new Uint8Array(r).buffer))}},e._lctf={},e._lctf.parse=function(r,a,o,l,c){var f=e._bin,d={},m=a;f.readFixed(r,a),a+=4;var p=f.readUshort(r,a);a+=2;var g=f.readUshort(r,a);a+=2;var y=f.readUshort(r,a);return a+=2,d.scriptList=e._lctf.readScriptList(r,m+p),d.featureList=e._lctf.readFeatureList(r,m+g),d.lookupList=e._lctf.readLookupList(r,m+y,c),d},e._lctf.readLookupList=function(r,a,o){var l=e._bin,c=a,f=[],d=l.readUshort(r,a);a+=2;for(var m=0;m<d;m++){var p=l.readUshort(r,a);a+=2;var g=e._lctf.readLookupTable(r,c+p,o);f.push(g)}return f},e._lctf.readLookupTable=function(r,a,o){var l=e._bin,c=a,f={tabs:[]};f.ltype=l.readUshort(r,a),a+=2,f.flag=l.readUshort(r,a),a+=2;var d=l.readUshort(r,a);a+=2;for(var m=f.ltype,p=0;p<d;p++){var g=l.readUshort(r,a);a+=2;var y=o(r,m,c+g,f);f.tabs.push(y)}return f},e._lctf.numOfOnes=function(r){for(var a=0,o=0;o<32;o++)(r>>>o&1)!=0&&a++;return a},e._lctf.readClassDef=function(r,a){var o=e._bin,l=[],c=o.readUshort(r,a);if(a+=2,c==1){var f=o.readUshort(r,a);a+=2;var d=o.readUshort(r,a);a+=2;for(var m=0;m<d;m++)l.push(f+m),l.push(f+m),l.push(o.readUshort(r,a)),a+=2}if(c==2){var p=o.readUshort(r,a);for(a+=2,m=0;m<p;m++)l.push(o.readUshort(r,a)),a+=2,l.push(o.readUshort(r,a)),a+=2,l.push(o.readUshort(r,a)),a+=2}return l},e._lctf.getInterval=function(r,a){for(var o=0;o<r.length;o+=3){var l=r[o],c=r[o+1];if(r[o+2],l<=a&&a<=c)return o}return-1},e._lctf.readCoverage=function(r,a){var o=e._bin,l={};l.fmt=o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);return a+=2,l.fmt==1&&(l.tab=o.readUshorts(r,a,c)),l.fmt==2&&(l.tab=o.readUshorts(r,a,3*c)),l},e._lctf.coverageIndex=function(r,a){var o=r.tab;if(r.fmt==1)return o.indexOf(a);if(r.fmt==2){var l=e._lctf.getInterval(o,a);if(l!=-1)return o[l+2]+(a-o[l])}return-1},e._lctf.readFeatureList=function(r,a){var o=e._bin,l=a,c=[],f=o.readUshort(r,a);a+=2;for(var d=0;d<f;d++){var m=o.readASCII(r,a,4);a+=4;var p=o.readUshort(r,a);a+=2;var g=e._lctf.readFeatureTable(r,l+p);g.tag=m.trim(),c.push(g)}return c},e._lctf.readFeatureTable=function(r,a){var o=e._bin,l=a,c={},f=o.readUshort(r,a);a+=2,f>0&&(c.featureParams=l+f);var d=o.readUshort(r,a);a+=2,c.tab=[];for(var m=0;m<d;m++)c.tab.push(o.readUshort(r,a+2*m));return c},e._lctf.readScriptList=function(r,a){var o=e._bin,l=a,c={},f=o.readUshort(r,a);a+=2;for(var d=0;d<f;d++){var m=o.readASCII(r,a,4);a+=4;var p=o.readUshort(r,a);a+=2,c[m.trim()]=e._lctf.readScriptTable(r,l+p)}return c},e._lctf.readScriptTable=function(r,a){var o=e._bin,l=a,c={},f=o.readUshort(r,a);a+=2,f>0&&(c.default=e._lctf.readLangSysTable(r,l+f));var d=o.readUshort(r,a);a+=2;for(var m=0;m<d;m++){var p=o.readASCII(r,a,4);a+=4;var g=o.readUshort(r,a);a+=2,c[p.trim()]=e._lctf.readLangSysTable(r,l+g)}return c},e._lctf.readLangSysTable=function(r,a){var o=e._bin,l={};o.readUshort(r,a),a+=2,l.reqFeature=o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);return a+=2,l.features=o.readUshorts(r,a,c),l},e.CFF={},e.CFF.parse=function(r,a,o){var l=e._bin;(r=new Uint8Array(r.buffer,a,o))[a=0],r[++a],r[++a],r[++a],a++;var c=[];a=e.CFF.readIndex(r,a,c);for(var f=[],d=0;d<c.length-1;d++)f.push(l.readASCII(r,a+c[d],c[d+1]-c[d]));a+=c[c.length-1];var m=[];a=e.CFF.readIndex(r,a,m);var p=[];for(d=0;d<m.length-1;d++)p.push(e.CFF.readDict(r,a+m[d],a+m[d+1]));a+=m[m.length-1];var g=p[0],y=[];a=e.CFF.readIndex(r,a,y);var T=[];for(d=0;d<y.length-1;d++)T.push(l.readASCII(r,a+y[d],y[d+1]-y[d]));if(a+=y[y.length-1],e.CFF.readSubrs(r,a,g),g.CharStrings){a=g.CharStrings,y=[],a=e.CFF.readIndex(r,a,y);var x=[];for(d=0;d<y.length-1;d++)x.push(l.readBytes(r,a+y[d],y[d+1]-y[d]));g.CharStrings=x}if(g.ROS){a=g.FDArray;var _=[];for(a=e.CFF.readIndex(r,a,_),g.FDArray=[],d=0;d<_.length-1;d++){var b=e.CFF.readDict(r,a+_[d],a+_[d+1]);e.CFF._readFDict(r,b,T),g.FDArray.push(b)}a+=_[_.length-1],a=g.FDSelect,g.FDSelect=[];var S=r[a];if(a++,S!=3)throw S;var E=l.readUshort(r,a);for(a+=2,d=0;d<E+1;d++)g.FDSelect.push(l.readUshort(r,a),r[a+2]),a+=3}return g.Encoding&&(g.Encoding=e.CFF.readEncoding(r,g.Encoding,g.CharStrings.length)),g.charset&&(g.charset=e.CFF.readCharset(r,g.charset,g.CharStrings.length)),e.CFF._readFDict(r,g,T),g},e.CFF._readFDict=function(r,a,o){var l;
4514for(var c in a.Private&&(l=a.Private[1],a.Private=e.CFF.readDict(r,l,l+a.Private[0]),a.Private.Subrs&&e.CFF.readSubrs(r,l+a.Private.Subrs,a.Private)),a)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(c)!=-1&&(a[c]=o[a[c]-426+35])},e.CFF.readSubrs=function(r,a,o){var l=e._bin,c=[];a=e.CFF.readIndex(r,a,c);var f,d=c.length;f=d<1240?107:d<33900?1131:32768,o.Bias=f,o.Subrs=[];for(var m=0;m<c.length-1;m++)o.Subrs.push(l.readBytes(r,a+c[m],c[m+1]-c[m]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(r,a){for(var o=0;o<r.charset.length;o++)if(r.charset[o]==a)return o;return-1},e.CFF.glyphBySE=function(r,a){return a<0||a>255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[a])},e.CFF.readEncoding=function(r,a,o){e._bin;var l=[".notdef"],c=r[a];if(a++,c!=0)throw"error: unknown encoding format: "+c;var f=r[a];a++;for(var d=0;d<f;d++)l.push(r[a+d]);return l},e.CFF.readCharset=function(r,a,o){var l=e._bin,c=[".notdef"],f=r[a];if(a++,f==0)for(var d=0;d<o;d++){var m=l.readUshort(r,a);a+=2,c.push(m)}else{if(f!=1&&f!=2)throw"error: format: "+f;for(;c.length<o;){m=l.readUshort(r,a),a+=2;var p=0;for(f==1?(p=r[a],a++):(p=l.readUshort(r,a),a+=2),d=0;d<=p;d++)c.push(m),m++}}return c},e.CFF.readIndex=function(r,a,o){var l=e._bin,c=l.readUshort(r,a)+1,f=r[a+=2];if(a++,f==1)for(var d=0;d<c;d++)o.push(r[a+d]);else if(f==2)for(d=0;d<c;d++)o.push(l.readUshort(r,a+2*d));else if(f==3)for(d=0;d<c;d++)o.push(16777215&l.readUint(r,a+3*d-1));else if(c!=1)throw"unsupported offset size: "+f+", count: "+c;return(a+=c*f)-1},e.CFF.getCharString=function(r,a,o){var l=e._bin,c=r[a],f=r[a+1];r[a+2],r[a+3],r[a+4];var d=1,m=null,p=null;c<=20&&(m=c,d=1),c==12&&(m=100*c+f,d=2),21<=c&&c<=27&&(m=c,d=1),c==28&&(p=l.readShort(r,a+1),d=3),29<=c&&c<=31&&(m=c,d=1),32<=c&&c<=246&&(p=c-139,d=1),247<=c&&c<=250&&(p=256*(c-247)+f+108,d=2),251<=c&&c<=254&&(p=256*-(c-251)-f-108,d=2),c==255&&(p=l.readInt(r,a+1)/65535,d=5),o.val=p??"o"+m,o.size=d},e.CFF.readCharString=function(r,a,o){for(var l=a+o,c=e._bin,f=[];a<l;){var d=r[a],m=r[a+1];r[a+2],r[a+3],r[a+4];var p=1,g=null,y=null;d<=20&&(g=d,p=1),d==12&&(g=100*d+m,p=2),d!=19&&d!=20||(g=d,p=2),21<=d&&d<=27&&(g=d,p=1),d==28&&(y=c.readShort(r,a+1),p=3),29<=d&&d<=31&&(g=d,p=1),32<=d&&d<=246&&(y=d-139,p=1),247<=d&&d<=250&&(y=256*(d-247)+m+108,p=2),251<=d&&d<=254&&(y=256*-(d-251)-m-108,p=2),d==255&&(y=c.readInt(r,a+1)/65535,p=5),f.push(y??"o"+g),a+=p}return f},e.CFF.readDict=function(r,a,o){for(var l=e._bin,c={},f=[];a<o;){var d=r[a],m=r[a+1];r[a+2],r[a+3],r[a+4];var p=1,g=null,y=null;if(d==28&&(y=l.readShort(r,a+1),p=3),d==29&&(y=l.readInt(r,a+1),p=5),32<=d&&d<=246&&(y=d-139,p=1),247<=d&&d<=250&&(y=256*(d-247)+m+108,p=2),251<=d&&d<=254&&(y=256*-(d-251)-m-108,p=2),d==255)throw y=l.readInt(r,a+1)/65535,p=5,"unknown number";if(d==30){var T=[];for(p=1;;){var x=r[a+p];p++;var _=x>>4,b=15&x;if(_!=15&&T.push(_),b!=15&&T.push(b),b==15)break}for(var S="",E=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],C=0;C<T.length;C++)S+=E[T[C]];y=parseFloat(S)}d<=21&&(g=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][d],p=1,d==12&&(g=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][m],p=2)),g!=null?(c[g]=f.length==1?f[0]:f,f=[]):f.push(y),a+=p}return c},e.cmap={},e.cmap.parse=function(r,a,o){r=new Uint8Array(r.buffer,a,o),a=0;var l=e._bin,c={};l.readUshort(r,a),a+=2;var f=l.readUshort(r,a);a+=2;var d=[];c.tables=[];for(var m=0;m<f;m++){var p=l.readUshort(r,a);a+=2;var g=l.readUshort(r,a);a+=2;var y=l.readUint(r,a);a+=4;var T="p"+p+"e"+g,x=d.indexOf(y);if(x==-1){var _;x=c.tables.length,d.push(y);var b=l.readUshort(r,y);b==0?_=e.cmap.parse0(r,y):b==4?_=e.cmap.parse4(r,y):b==6?_=e.cmap.parse6(r,y):b==12?_=e.cmap.parse12(r,y):console.debug("unknown format: "+b,p,g,y),c.tables.push(_)}if(c[T]!=null)throw"multiple tables for one platform+encoding";c[T]=x}return c},e.cmap.parse0=function(r,a){var o=e._bin,l={};l.format=o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);a+=2,o.readUshort(r,a),a+=2,l.map=[];for(var f=0;f<c-6;f++)l.map.push(r[a+f]);return l},e.cmap.parse4=function(r,a){var o=e._bin,l=a,c={};c.format=o.readUshort(r,a),a+=2;var f=o.readUshort(r,a);a+=2,o.readUshort(r,a),a+=2;var d=o.readUshort(r,a);a+=2;var m=d/2;c.searchRange=o.readUshort(r,a),a+=2,c.entrySelector=o.readUshort(r,a),a+=2,c.rangeShift=o.readUshort(r,a),a+=2,c.endCount=o.readUshorts(r,a,m),a+=2*m,a+=2,c.startCount=o.readUshorts(r,a,m),a+=2*m,c.idDelta=[];for(var p=0;p<m;p++)c.idDelta.push(o.readShort(r,a)),a+=2;for(c.idRangeOffset=o.readUshorts(r,a,m),a+=2*m,c.glyphIdArray=[];a<l+f;)c.glyphIdArray.push(o.readUshort(r,a)),a+=2;return c},e.cmap.parse6=function(r,a){var o=e._bin,l={};l.format=o.readUshort(r,a),a+=2,o.readUshort(r,a),a+=2,o.readUshort(r,a),a+=2,l.firstCode=o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);a+=2,l.glyphIdArray=[];for(var f=0;f<c;f++)l.glyphIdArray.push(o.readUshort(r,a)),a+=2;return l},e.cmap.parse12=function(r,a){var o=e._bin,l={};l.format=o.readUshort(r,a),a+=2,a+=2,o.readUint(r,a),a+=4,o.readUint(r,a),a+=4;var c=o.readUint(r,a);a+=4,l.groups=[];for(var f=0;f<c;f++){var d=a+12*f,m=o.readUint(r,d+0),p=o.readUint(r,d+4),g=o.readUint(r,d+8);l.groups.push([m,p,g])}return l},e.glyf={},e.glyf.parse=function(r,a,o,l){for(var c=[],f=0;f<l.maxp.numGlyphs;f++)c.push(null);return c},e.glyf._parseGlyf=function(r,a){var o=e._bin,l=r._data,c=e._tabOffset(l,"glyf",r._offset)+r.loca[a];if(r.loca[a]==r.loca[a+1])return null;var f={};if(f.noc=o.readShort(l,c),c+=2,f.xMin=o.readShort(l,c),c+=2,f.yMin=o.readShort(l,c),c+=2,f.xMax=o.readShort(l,c),c+=2,f.yMax=o.readShort(l,c),c+=2,f.xMin>=f.xMax||f.yMin>=f.yMax)return null;if(f.noc>0){f.endPts=[];for(var d=0;d<f.noc;d++)f.endPts.push(o.readUshort(l,c)),c+=2;var m=o.readUshort(l,c);if(c+=2,l.length-c<m)return null;f.instructions=o.readBytes(l,c,m),c+=m;var p=f.endPts[f.noc-1]+1;for(f.flags=[],d=0;d<p;d++){var g=l[c];if(c++,f.flags.push(g),(8&g)!=0){var y=l[c];c++;for(var T=0;T<y;T++)f.flags.push(g),d++}}for(f.xs=[],d=0;d<p;d++){var x=(2&f.flags[d])!=0,_=(16&f.flags[d])!=0;x?(f.xs.push(_?l[c]:-l[c]),c++):_?f.xs.push(0):(f.xs.push(o.readShort(l,c)),c+=2)}for(f.ys=[],d=0;d<p;d++)x=(4&f.flags[d])!=0,_=(32&f.flags[d])!=0,x?(f.ys.push(_?l[c]:-l[c]),c++):_?f.ys.push(0):(f.ys.push(o.readShort(l,c)),c+=2);var b=0,S=0;for(d=0;d<p;d++)b+=f.xs[d],S+=f.ys[d],f.xs[d]=b,f.ys[d]=S}else{var E;f.parts=[];do{E=o.readUshort(l,c),c+=2;var C={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(f.parts.push(C),C.glyphIndex=o.readUshort(l,c),c+=2,1&E){var D=o.readShort(l,c);c+=2;var U=o.readShort(l,c);c+=2}else D=o.readInt8(l,c),c++,U=o.readInt8(l,c),c++;2&E?(C.m.tx=D,C.m.ty=U):(C.p1=D,C.p2=U),8&E?(C.m.a=C.m.d=o.readF2dot14(l,c),c+=2):64&E?(C.m.a=o.readF2dot14(l,c),c+=2,C.m.d=o.readF2dot14(l,c),c+=2):128&E&&(C.m.a=o.readF2dot14(l,c),c+=2,C.m.b=o.readF2dot14(l,c),c+=2,C.m.c=o.readF2dot14(l,c),c+=2,C.m.d=o.readF2dot14(l,c),c+=2)}while(32&E);if(256&E){var w=o.readUshort(l,c);for(c+=2,f.instr=[],d=0;d<w;d++)f.instr.push(l[c]),c++}}return f},e.GDEF={},e.GDEF.parse=function(r,a,o,l){var c=a;a+=4;var f=e._bin.readUshort(r,a);return{glyphClassDef:f===0?null:e._lctf.readClassDef(r,c+f)}},e.GPOS={},e.GPOS.parse=function(r,a,o,l){return e._lctf.parse(r,a,o,l,e.GPOS.subt)},e.GPOS.subt=function(r,a,o,l){var c=e._bin,f=o,d={};if(d.fmt=c.readUshort(r,o),o+=2,a==1||a==2||a==3||a==7||a==8&&d.fmt<=2){var m=c.readUshort(r,o);o+=2,d.coverage=e._lctf.readCoverage(r,m+f)}if(a==1&&d.fmt==1){var p=c.readUshort(r,o);o+=2,p!=0&&(d.pos=e.GPOS.readValueRecord(r,o,p))}else if(a==2&&d.fmt>=1&&d.fmt<=2){p=c.readUshort(r,o),o+=2;var g=c.readUshort(r,o);o+=2;var y=e._lctf.numOfOnes(p),T=e._lctf.numOfOnes(g);if(d.fmt==1){d.pairsets=[];var x=c.readUshort(r,o);o+=2;for(var _=0;_<x;_++){var b=f+c.readUshort(r,o);o+=2;var S=c.readUshort(r,b);b+=2;
4514for(var E=[],C=0;C<S;C++){var D=c.readUshort(r,b);b+=2,p!=0&&(z=e.GPOS.readValueRecord(r,b,p),b+=2*y),g!=0&&(B=e.GPOS.readValueRecord(r,b,g),b+=2*T),E.push({gid2:D,val1:z,val2:B})}d.pairsets.push(E)}}if(d.fmt==2){var U=c.readUshort(r,o);o+=2;var w=c.readUshort(r,o);o+=2;var R=c.readUshort(r,o);o+=2;var L=c.readUshort(r,o);for(o+=2,d.classDef1=e._lctf.readClassDef(r,f+U),d.classDef2=e._lctf.readClassDef(r,f+w),d.matrix=[],_=0;_<R;_++){var I=[];for(C=0;C<L;C++){var z=null,B=null;p!=0&&(z=e.GPOS.readValueRecord(r,o,p),o+=2*y),g!=0&&(B=e.GPOS.readValueRecord(r,o,g),o+=2*T),I.push({val1:z,val2:B})}d.matrix.push(I)}}}else if(a==4&&d.fmt==1)d.markCoverage=e._lctf.readCoverage(r,c.readUshort(r,o)+f),d.baseCoverage=e._lctf.readCoverage(r,c.readUshort(r,o+2)+f),d.markClassCount=c.readUshort(r,o+4),d.markArray=e.GPOS.readMarkArray(r,c.readUshort(r,o+6)+f),d.baseArray=e.GPOS.readBaseArray(r,c.readUshort(r,o+8)+f,d.markClassCount);else if(a==6&&d.fmt==1)d.mark1Coverage=e._lctf.readCoverage(r,c.readUshort(r,o)+f),d.mark2Coverage=e._lctf.readCoverage(r,c.readUshort(r,o+2)+f),d.markClassCount=c.readUshort(r,o+4),d.mark1Array=e.GPOS.readMarkArray(r,c.readUshort(r,o+6)+f),d.mark2Array=e.GPOS.readBaseArray(r,c.readUshort(r,o+8)+f,d.markClassCount);else{if(a==9&&d.fmt==1){var V=c.readUshort(r,o);o+=2;var W=c.readUint(r,o);if(o+=4,l.ltype==9)l.ltype=V;else if(l.ltype!=V)throw"invalid extension substitution";return e.GPOS.subt(r,l.ltype,f+W)}console.debug("unsupported GPOS table LookupType",a,"format",d.fmt)}return d},e.GPOS.readValueRecord=function(r,a,o){var l=e._bin,c=[];return c.push(1&o?l.readShort(r,a):0),a+=1&o?2:0,c.push(2&o?l.readShort(r,a):0),a+=2&o?2:0,c.push(4&o?l.readShort(r,a):0),a+=4&o?2:0,c.push(8&o?l.readShort(r,a):0),a+=8&o?2:0,c},e.GPOS.readBaseArray=function(r,a,o){var l=e._bin,c=[],f=a,d=l.readUshort(r,a);a+=2;for(var m=0;m<d;m++){for(var p=[],g=0;g<o;g++)p.push(e.GPOS.readAnchorRecord(r,f+l.readUshort(r,a))),a+=2;c.push(p)}return c},e.GPOS.readMarkArray=function(r,a){var o=e._bin,l=[],c=a,f=o.readUshort(r,a);a+=2;for(var d=0;d<f;d++){var m=e.GPOS.readAnchorRecord(r,o.readUshort(r,a+2)+c);m.markClass=o.readUshort(r,a),l.push(m),a+=4}return l},e.GPOS.readAnchorRecord=function(r,a){var o=e._bin,l={};return l.fmt=o.readUshort(r,a),l.x=o.readShort(r,a+2),l.y=o.readShort(r,a+4),l},e.GSUB={},e.GSUB.parse=function(r,a,o,l){return e._lctf.parse(r,a,o,l,e.GSUB.subt)},e.GSUB.subt=function(r,a,o,l){var c=e._bin,f=o,d={};if(d.fmt=c.readUshort(r,o),o+=2,a!=1&&a!=2&&a!=4&&a!=5&&a!=6)return null;if(a==1||a==2||a==4||a==5&&d.fmt<=2||a==6&&d.fmt<=2){var m=c.readUshort(r,o);o+=2,d.coverage=e._lctf.readCoverage(r,f+m)}if(a==1&&d.fmt>=1&&d.fmt<=2){if(d.fmt==1)d.delta=c.readShort(r,o),o+=2;else if(d.fmt==2){var p=c.readUshort(r,o);o+=2,d.newg=c.readUshorts(r,o,p),o+=2*d.newg.length}}else if(a==2&&d.fmt==1){p=c.readUshort(r,o),o+=2,d.seqs=[];for(var g=0;g<p;g++){var y=c.readUshort(r,o)+f;o+=2;var T=c.readUshort(r,y);d.seqs.push(c.readUshorts(r,y+2,T))}}else if(a==4)for(d.vals=[],p=c.readUshort(r,o),o+=2,g=0;g<p;g++){var x=c.readUshort(r,o);o+=2,d.vals.push(e.GSUB.readLigatureSet(r,f+x))}else if(a==5&&d.fmt==2){if(d.fmt==2){var _=c.readUshort(r,o);o+=2,d.cDef=e._lctf.readClassDef(r,f+_),d.scset=[];var b=c.readUshort(r,o);for(o+=2,g=0;g<b;g++){var S=c.readUshort(r,o);o+=2,d.scset.push(S==0?null:e.GSUB.readSubClassSet(r,f+S))}}}else if(a==6&&d.fmt==3){if(d.fmt==3){for(g=0;g<3;g++){p=c.readUshort(r,o),o+=2;for(var E=[],C=0;C<p;C++)E.push(e._lctf.readCoverage(r,f+c.readUshort(r,o+2*C)));o+=2*p,g==0&&(d.backCvg=E),g==1&&(d.inptCvg=E),g==2&&(d.ahedCvg=E)}p=c.readUshort(r,o),o+=2,d.lookupRec=e.GSUB.readSubstLookupRecords(r,o,p)}}else{if(a==7&&d.fmt==1){var D=c.readUshort(r,o);o+=2;var U=c.readUint(r,o);if(o+=4,l.ltype==9)l.ltype=D;else if(l.ltype!=D)throw"invalid extension substitution";return e.GSUB.subt(r,l.ltype,f+U)}console.debug("unsupported GSUB table LookupType",a,"format",d.fmt)}return d},e.GSUB.readSubClassSet=function(r,a){var o=e._bin.readUshort,l=a,c=[],f=o(r,a);a+=2;for(var d=0;d<f;d++){var m=o(r,a);a+=2,c.push(e.GSUB.readSubClassRule(r,l+m))}return c},e.GSUB.readSubClassRule=function(r,a){var o=e._bin.readUshort,l={},c=o(r,a),f=o(r,a+=2);a+=2,l.input=[];for(var d=0;d<c-1;d++)l.input.push(o(r,a)),a+=2;
4514return l.substLookupRecords=e.GSUB.readSubstLookupRecords(r,a,f),l},e.GSUB.readSubstLookupRecords=function(r,a,o){for(var l=e._bin.readUshort,c=[],f=0;f<o;f++)c.push(l(r,a),l(r,a+2)),a+=4;return c},e.GSUB.readChainSubClassSet=function(r,a){var o=e._bin,l=a,c=[],f=o.readUshort(r,a);a+=2;for(var d=0;d<f;d++){var m=o.readUshort(r,a);a+=2,c.push(e.GSUB.readChainSubClassRule(r,l+m))}return c},e.GSUB.readChainSubClassRule=function(r,a){for(var o=e._bin,l={},c=["backtrack","input","lookahead"],f=0;f<c.length;f++){var d=o.readUshort(r,a);a+=2,f==1&&d--,l[c[f]]=o.readUshorts(r,a,d),a+=2*l[c[f]].length}return d=o.readUshort(r,a),a+=2,l.subst=o.readUshorts(r,a,2*d),a+=2*l.subst.length,l},e.GSUB.readLigatureSet=function(r,a){var o=e._bin,l=a,c=[],f=o.readUshort(r,a);a+=2;for(var d=0;d<f;d++){var m=o.readUshort(r,a);a+=2,c.push(e.GSUB.readLigature(r,l+m))}return c},e.GSUB.readLigature=function(r,a){var o=e._bin,l={chain:[]};l.nglyph=o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);a+=2;for(var f=0;f<c-1;f++)l.chain.push(o.readUshort(r,a)),a+=2;return l},e.head={},e.head.parse=function(r,a,o){var l=e._bin,c={};return l.readFixed(r,a),a+=4,c.fontRevision=l.readFixed(r,a),a+=4,l.readUint(r,a),a+=4,l.readUint(r,a),a+=4,c.flags=l.readUshort(r,a),a+=2,c.unitsPerEm=l.readUshort(r,a),a+=2,c.created=l.readUint64(r,a),a+=8,c.modified=l.readUint64(r,a),a+=8,c.xMin=l.readShort(r,a),a+=2,c.yMin=l.readShort(r,a),a+=2,c.xMax=l.readShort(r,a),a+=2,c.yMax=l.readShort(r,a),a+=2,c.macStyle=l.readUshort(r,a),a+=2,c.lowestRecPPEM=l.readUshort(r,a),a+=2,c.fontDirectionHint=l.readShort(r,a),a+=2,c.indexToLocFormat=l.readShort(r,a),a+=2,c.glyphDataFormat=l.readShort(r,a),a+=2,c},e.hhea={},e.hhea.parse=function(r,a,o){var l=e._bin,c={};return l.readFixed(r,a),a+=4,c.ascender=l.readShort(r,a),a+=2,c.descender=l.readShort(r,a),a+=2,c.lineGap=l.readShort(r,a),a+=2,c.advanceWidthMax=l.readUshort(r,a),a+=2,c.minLeftSideBearing=l.readShort(r,a),a+=2,c.minRightSideBearing=l.readShort(r,a),a+=2,c.xMaxExtent=l.readShort(r,a),a+=2,c.caretSlopeRise=l.readShort(r,a),a+=2,c.caretSlopeRun=l.readShort(r,a),a+=2,c.caretOffset=l.readShort(r,a),a+=2,a+=8,c.metricDataFormat=l.readShort(r,a),a+=2,c.numberOfHMetrics=l.readUshort(r,a),a+=2,c},e.hmtx={},e.hmtx.parse=function(r,a,o,l){for(var c=e._bin,f={aWidth:[],lsBearing:[]},d=0,m=0,p=0;p<l.maxp.numGlyphs;p++)p<l.hhea.numberOfHMetrics&&(d=c.readUshort(r,a),a+=2,m=c.readShort(r,a),a+=2),f.aWidth.push(d),f.lsBearing.push(m);return f},e.kern={},e.kern.parse=function(r,a,o,l){var c=e._bin,f=c.readUshort(r,a);if(a+=2,f==1)return e.kern.parseV1(r,a-2,o,l);var d=c.readUshort(r,a);a+=2;for(var m={glyph1:[],rval:[]},p=0;p<d;p++){a+=2,o=c.readUshort(r,a),a+=2;var g=c.readUshort(r,a);a+=2;var y=g>>>8;if((y&=15)!=0)throw"unknown kern table format: "+y;a=e.kern.readFormat0(r,a,m)}return m},e.kern.parseV1=function(r,a,o,l){var c=e._bin;c.readFixed(r,a),a+=4;var f=c.readUint(r,a);a+=4;for(var d={glyph1:[],rval:[]},m=0;m<f;m++){c.readUint(r,a),a+=4;var p=c.readUshort(r,a);a+=2,c.readUshort(r,a),a+=2;var g=p>>>8;if((g&=15)!=0)throw"unknown kern table format: "+g;a=e.kern.readFormat0(r,a,d)}return d},e.kern.readFormat0=function(r,a,o){var l=e._bin,c=-1,f=l.readUshort(r,a);a+=2,l.readUshort(r,a),a+=2,l.readUshort(r,a),a+=2,l.readUshort(r,a),a+=2;for(var d=0;d<f;d++){var m=l.readUshort(r,a);a+=2;var p=l.readUshort(r,a);a+=2;var g=l.readShort(r,a);a+=2,m!=c&&(o.glyph1.push(m),o.rval.push({glyph2:[],vals:[]}));var y=o.rval[o.rval.length-1];y.glyph2.push(p),y.vals.push(g),c=m}return a},e.loca={},e.loca.parse=function(r,a,o,l){var c=e._bin,f=[],d=l.head.indexToLocFormat,m=l.maxp.numGlyphs+1;if(d==0)for(var p=0;p<m;p++)f.push(c.readUshort(r,a+(p<<1))<<1);if(d==1)for(p=0;p<m;p++)f.push(c.readUint(r,a+(p<<2)));return f},e.maxp={},e.maxp.parse=function(r,a,o){var l=e._bin,c={},f=l.readUint(r,a);return a+=4,c.numGlyphs=l.readUshort(r,a),a+=2,f==65536&&(c.maxPoints=l.readUshort(r,a),a+=2,c.maxContours=l.readUshort(r,a),a+=2,c.maxCompositePoints=l.readUshort(r,a),a+=2,c.maxCompositeContours=l.readUshort(r,a),a+=2,c.maxZones=l.readUshort(r,a),a+=2,c.maxTwilightPoints=l.readUshort(r,a),a+=2,c.maxStorage=l.readUshort(r,a),a+=2,c.maxFunctionDefs=l.readUshort(r,a),a+=2,c.maxInstructionDefs=l.readUshort(r,a),a+=2,c.maxStackElements=l.readUshort(r,a),a+=2,c.maxSizeOfInstru
4514ctions=l.readUshort(r,a),a+=2,c.maxComponentElements=l.readUshort(r,a),a+=2,c.maxComponentDepth=l.readUshort(r,a),a+=2),c},e.name={},e.name.parse=function(r,a,o){var l=e._bin,c={};l.readUshort(r,a),a+=2;var f=l.readUshort(r,a);a+=2,l.readUshort(r,a);for(var d,m=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],p=a+=2,g=0;g<f;g++){var y=l.readUshort(r,a);a+=2;var T=l.readUshort(r,a);a+=2;var x=l.readUshort(r,a);a+=2;var _=l.readUshort(r,a);a+=2;var b=l.readUshort(r,a);a+=2;var S=l.readUshort(r,a);a+=2;var E,C=m[_],D=p+12*f+S;if(y==0)E=l.readUnicode(r,D,b/2);else if(y==3&&T==0)E=l.readUnicode(r,D,b/2);else if(T==0)E=l.readASCII(r,D,b);else if(T==1)E=l.readUnicode(r,D,b/2);else if(T==3)E=l.readUnicode(r,D,b/2);else{if(y!=1)throw"unknown encoding "+T+", platformID: "+y;E=l.readASCII(r,D,b),console.debug("reading unknown MAC encoding "+T+" as ASCII")}var U="p"+y+","+x.toString(16);c[U]==null&&(c[U]={}),c[U][C!==void 0?C:_]=E,c[U]._lang=x}for(var w in c)if(c[w].postScriptName!=null&&c[w]._lang==1033)return c[w];for(var w in c)if(c[w].postScriptName!=null&&c[w]._lang==0)return c[w];for(var w in c)if(c[w].postScriptName!=null&&c[w]._lang==3084)return c[w];for(var w in c)if(c[w].postScriptName!=null)return c[w];for(var w in c){d=w;break}return console.debug("returning name table with languageID "+c[d]._lang),c[d]},e["OS/2"]={},e["OS/2"].parse=function(r,a,o){var l=e._bin.readUshort(r,a);a+=2;var c={};if(l==0)e["OS/2"].version0(r,a,c);else if(l==1)e["OS/2"].version1(r,a,c);else if(l==2||l==3||l==4)e["OS/2"].version2(r,a,c);else{if(l!=5)throw"unknown OS/2 table version: "+l;e["OS/2"].version5(r,a,c)}return c},e["OS/2"].version0=function(r,a,o){var l=e._bin;return o.xAvgCharWidth=l.readShort(r,a),a+=2,o.usWeightClass=l.readUshort(r,a),a+=2,o.usWidthClass=l.readUshort(r,a),a+=2,o.fsType=l.readUshort(r,a),a+=2,o.ySubscriptXSize=l.readShort(r,a),a+=2,o.ySubscriptYSize=l.readShort(r,a),a+=2,o.ySubscriptXOffset=l.readShort(r,a),a+=2,o.ySubscriptYOffset=l.readShort(r,a),a+=2,o.ySuperscriptXSize=l.readShort(r,a),a+=2,o.ySuperscriptYSize=l.readShort(r,a),a+=2,o.ySuperscriptXOffset=l.readShort(r,a),a+=2,o.ySuperscriptYOffset=l.readShort(r,a),a+=2,o.yStrikeoutSize=l.readShort(r,a),a+=2,o.yStrikeoutPosition=l.readShort(r,a),a+=2,o.sFamilyClass=l.readShort(r,a),a+=2,o.panose=l.readBytes(r,a,10),a+=10,o.ulUnicodeRange1=l.readUint(r,a),a+=4,o.ulUnicodeRange2=l.readUint(r,a),a+=4,o.ulUnicodeRange3=l.readUint(r,a),a+=4,o.ulUnicodeRange4=l.readUint(r,a),a+=4,o.achVendID=[l.readInt8(r,a),l.readInt8(r,a+1),l.readInt8(r,a+2),l.readInt8(r,a+3)],a+=4,o.fsSelection=l.readUshort(r,a),a+=2,o.usFirstCharIndex=l.readUshort(r,a),a+=2,o.usLastCharIndex=l.readUshort(r,a),a+=2,o.sTypoAscender=l.readShort(r,a),a+=2,o.sTypoDescender=l.readShort(r,a),a+=2,o.sTypoLineGap=l.readShort(r,a),a+=2,o.usWinAscent=l.readUshort(r,a),a+=2,o.usWinDescent=l.readUshort(r,a),a+=2},e["OS/2"].version1=function(r,a,o){var l=e._bin;return a=e["OS/2"].version0(r,a,o),o.ulCodePageRange1=l.readUint(r,a),a+=4,o.ulCodePageRange2=l.readUint(r,a),a+=4},e["OS/2"].version2=function(r,a,o){var l=e._bin;return a=e["OS/2"].version1(r,a,o),o.sxHeight=l.readShort(r,a),a+=2,o.sCapHeight=l.readShort(r,a),a+=2,o.usDefault=l.readUshort(r,a),a+=2,o.usBreak=l.readUshort(r,a),a+=2,o.usMaxContext=l.readUshort(r,a),a+=2},e["OS/2"].version5=function(r,a,o){var l=e._bin;return a=e["OS/2"].version2(r,a,o),o.usLowerOpticalPointSize=l.readUshort(r,a),a+=2,o.usUpperOpticalPointSize=l.readUshort(r,a),a+=2},e.post={},e.post.parse=function(r,a,o){var l=e._bin,c={};return c.version=l.readFixed(r,a),a+=4,c.italicAngle=l.readFixed(r,a),a+=4,c.underlinePosition=l.readShort(r,a),a+=2,c.underlineThickness=l.readShort(r,a),a+=2,c},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(r,a){var o=r.cmap,l=-1;
4514if(o.p0e4!=null?l=o.p0e4:o.p3e1!=null?l=o.p3e1:o.p1e0!=null?l=o.p1e0:o.p0e3!=null&&(l=o.p0e3),l==-1)throw"no familiar platform and encoding!";var c=o.tables[l];if(c.format==0)return a>=c.map.length?0:c.map[a];if(c.format==4){for(var f=-1,d=0;d<c.endCount.length;d++)if(a<=c.endCount[d]){f=d;break}return f==-1||c.startCount[f]>a?0:65535&(c.idRangeOffset[f]!=0?c.glyphIdArray[a-c.startCount[f]+(c.idRangeOffset[f]>>1)-(c.idRangeOffset.length-f)]:a+c.idDelta[f])}if(c.format==12){if(a>c.groups[c.groups.length-1][1])return 0;for(d=0;d<c.groups.length;d++){var m=c.groups[d];if(m[0]<=a&&a<=m[1])return m[2]+(a-m[0])}return 0}throw"unknown cmap table format "+c.format},e.U.glyphToPath=function(r,a){var o={cmds:[],crds:[]};if(r.SVG&&r.SVG.entries[a]){var l=r.SVG.entries[a];return l==null?o:(typeof l=="string"&&(l=e.SVG.toPath(l),r.SVG.entries[a]=l),l)}if(r.CFF){var c={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:r.CFF.Private?r.CFF.Private.defaultWidthX:0,open:!1},f=r.CFF,d=r.CFF.Private;if(f.ROS){for(var m=0;f.FDSelect[m+2]<=a;)m+=2;d=f.FDArray[f.FDSelect[m+1]].Private}e.U._drawCFF(r.CFF.CharStrings[a],c,f,d,o)}else r.glyf&&e.U._drawGlyf(a,r,o);return o},e.U._drawGlyf=function(r,a,o){var l=a.glyf[r];l==null&&(l=a.glyf[r]=e.glyf._parseGlyf(a,r)),l!=null&&(l.noc>-1?e.U._simpleGlyph(l,o):e.U._compoGlyph(l,a,o))},e.U._simpleGlyph=function(r,a){for(var o=0;o<r.noc;o++){for(var l=o==0?0:r.endPts[o-1]+1,c=r.endPts[o],f=l;f<=c;f++){var d=f==l?c:f-1,m=f==c?l:f+1,p=1&r.flags[f],g=1&r.flags[d],y=1&r.flags[m],T=r.xs[f],x=r.ys[f];
4514if(f==l)if(p){if(!g){e.U.P.moveTo(a,T,x);continue}e.U.P.moveTo(a,r.xs[d],r.ys[d])}else g?e.U.P.moveTo(a,r.xs[d],r.ys[d]):e.U.P.moveTo(a,(r.xs[d]+T)/2,(r.ys[d]+x)/2);p?g&&e.U.P.lineTo(a,T,x):y?e.U.P.qcurveTo(a,T,x,r.xs[m],r.ys[m]):e.U.P.qcurveTo(a,T,x,(T+r.xs[m])/2,(x+r.ys[m])/2)}e.U.P.closePath(a)}},e.U._compoGlyph=function(r,a,o){for(var l=0;l<r.parts.length;l++){var c={cmds:[],crds:[]},f=r.parts[l];e.U._drawGlyf(f.glyphIndex,a,c);for(var d=f.m,m=0;m<c.crds.length;m+=2){var p=c.crds[m],g=c.crds[m+1];o.crds.push(p*d.a+g*d.b+d.tx),o.crds.push(p*d.c+g*d.d+d.ty)}for(m=0;m<c.cmds.length;m++)o.cmds.push(c.cmds[m])}},e.U._getGlyphClass=function(r,a){var o=e._lctf.getInterval(a,r);return o==-1?0:a[o+2]},e.U._applySubs=function(r,a,o,l){for(var c=r.length-a-1,f=0;f<o.tabs.length;f++)if(o.tabs[f]!=null){var d,m=o.tabs[f];if(!m.coverage||(d=e._lctf.coverageIndex(m.coverage,r[a]))!=-1){if(o.ltype==1)r[a],m.fmt==1?r[a]=r[a]+m.delta:r[a]=m.newg[d];else if(o.ltype==4)for(var p=m.vals[d],g=0;g<p.length;g++){var y=p[g],T=y.chain.length;if(!(T>c)){for(var x=!0,_=0,b=0;b<T;b++){for(;r[a+_+(1+b)]==-1;)_++;y.chain[b]!=r[a+_+(1+b)]&&(x=!1)}if(x){for(r[a]=y.nglyph,b=0;b<T+_;b++)r[a+b+1]=-1;break}}}else if(o.ltype==5&&m.fmt==2)for(var S=e._lctf.getInterval(m.cDef,r[a]),E=m.cDef[S+2],C=m.scset[E],D=0;D<C.length;D++){var U=C[D],w=U.input;if(!(w.length>c)){for(x=!0,b=0;b<w.length;b++){var R=e._lctf.getInterval(m.cDef,r[a+1+b]);if(S==-1&&m.cDef[R+2]!=w[b]){x=!1;break}}if(x){var L=U.substLookupRecords;for(g=0;g<L.length;g+=2)L[g],L[g+1]}}}else if(o.ltype==6&&m.fmt==3){if(!e.U._glsCovered(r,m.backCvg,a-m.backCvg.length)||!e.U._glsCovered(r,m.inptCvg,a)||!e.U._glsCovered(r,m.ahedCvg,a+m.inptCvg.length))continue;var I=m.lookupRec;for(D=0;D<I.length;D+=2){S=I[D];var z=l[I[D+1]];e.U._applySubs(r,a+S,z,l)}}}}},e.U._glsCovered=function(r,a,o){for(var l=0;l<a.length;l++)if(e._lctf.coverageIndex(a[l],r[o+l])==-1)return!1;return!0},e.U.glyphsToPath=function(r,a,o){for(var l={cmds:[],crds:[]},c=0,f=0;f<a.length;f++){var d=a[f];if(d!=-1){for(var m=f<a.length-1&&a[f+1]!=-1?a[f+1]:0,p=e.U.glyphToPath(r,d),g=0;g<p.crds.length;g+=2)l.crds.push(p.crds[g]+c),l.crds.push(p.crds[g+1]);for(o&&l.cmds.push(o),g=0;g<p.cmds.length;g++)l.cmds.push(p.cmds[g]);o&&l.cmds.push("X"),c+=r.hmtx.aWidth[d],f<a.length-1&&(c+=e.U.getPairAdjustment(r,d,m))}}return l},e.U.P={},e.U.P.moveTo=function(r,a,o){r.cmds.push("M"),r.crds.push(a,o)},e.U.P.lineTo=function(r,a,o){r.cmds.push("L"),r.crds.push(a,o)},e.U.P.curveTo=function(r,a,o,l,c,f,d){r.cmds.push("C"),r.crds.push(a,o,l,c,f,d)},e.U.P.qcurveTo=function(r,a,o,l,c){r.cmds.push("Q"),r.crds.push(a,o,l,c)},e.U.P.closePath=function(r){r.cmds.push("Z")},e.U._drawCFF=function(r,a,o,l,c){for(var f=a.stack,d=a.nStems,m=a.haveWidth,p=a.width,g=a.open,y=0,T=a.x,x=a.y,_=0,b=0,S=0,E=0,C=0,D=0,U=0,w=0,R=0,L=0,I={val:0,size:0};y<r.length;){e.CFF.getCharString(r,y,I);var z=I.val;if(y+=I.size,z=="o1"||z=="o18")f.length%2!=0&&!m&&(p=f.shift()+l.nominalWidthX),d+=f.length>>1,f.length=0,m=!0;else if(z=="o3"||z=="o23")f.length%2!=0&&!m&&(p=f.shift()+l.nominalWidthX),d+=f.length>>1,f.length=0,m=!0;else if(z=="o4")f.length>1&&!m&&(p=f.shift()+l.nominalWidthX,m=!0),g&&e.U.P.closePath(c),x+=f.pop(),e.U.P.moveTo(c,T,x),g=!0;else if(z=="o5")for(;f.length>0;)T+=f.shift(),x+=f.shift(),e.U.P.lineTo(c,T,x);else if(z=="o6"||z=="o7")for(var B=f.length,V=z=="o6",W=0;W<B;W++){var X=f.shift();V?T+=X:x+=X,V=!V,e.U.P.lineTo(c,T,x)}else if(z=="o8"||z=="o24"){B=f.length;for(var K=0;K+6<=B;)_=T+f.shift(),b=x+f.shift(),S=_+f.shift(),E=b+f.shift(),T=S+f.shift(),x=E+f.shift(),e.U.P.curveTo(c,_,b,S,E,T,x),K+=6;z=="o24"&&(T+=f.shift(),x+=f.shift(),e.U.P.lineTo(c,T,x))}else{if(z=="o11")break;if(z=="o1234"||z=="o1235"||z=="o1236"||z=="o1237")z=="o1234"&&(b=x,S=(_=T+f.shift())+f.shift(),L=E=b+f.shift(),D=E,w=x,T=(U=(C=(R=S+f.shift())+f.shift())+f.shift())+f.shift(),e.U.P.curveTo(c,_,b,S,E,R,L),e.U.P.curveTo(c,C,D,U,w,T,x)),z=="o1235"&&(_=T+f.shift(),b=x+f.shift(),S=_+f.shift(),E=b+f.shift(),R=S+f.shift(),L=E+f.shift(),C=R+f.shift(),D=L+f.shift(),U=C+f.shift(),w=D+f.shift(),T=U+f.shift(),x=w+f.shift(),f.shift(),e.U.P.curveTo(c,_,b,S,E,R,L),e.U.P.curveTo(c,C,D,U,w,T,x)),z=="o1236"&&(_=T+f.shift(),b=x+f.shift(),S=_+f.shift(),L=E=b+f.shift(),D=E,U=(C=(R=S+f.shift())+f.shift())+f.shift(),w=D+f.shift(),T=U+f.shift(),e.U.P.curveTo(c,_,b,S,E,R,L),e.U.P.curveTo(c,C,D,U,w,T,x)),z=="o1237"&&(_=T+f.shift(),b=x+f.shift(),S=_+f.shift(),E=b+f.shift(),R=S+f.shift(),L=E+f.shift(),C=R+f.shift(),D=L+f.shift(),U=C+f.shift(),w=D+f.shift(),Math.abs(U-T)>Math.abs(w-x)?T=U+f.shift():x=w+f.shift(),e.U.P.curveTo(c,_,b,S,E,R,L),e.U.P.curveTo(c,C,D,U,w,T,x));else if(z=="o14"){if(f.length>0&&!m&&(p=f.shift()+o.nominalWidthX,m=!0),f.length==4){var pe=f.shift(),Q=f.shift(),ee=f.shift(),G=f.shift(),Z=e.CFF.glyphBySE(o,ee),ne=e.CFF.glyphBySE(o,G);
4514e.U._drawCFF(o.CharStrings[Z],a,o,l,c),a.x=pe,a.y=Q,e.U._drawCFF(o.CharStrings[ne],a,o,l,c)}g&&(e.U.P.closePath(c),g=!1)}else if(z=="o19"||z=="o20")f.length%2!=0&&!m&&(p=f.shift()+l.nominalWidthX),d+=f.length>>1,f.length=0,m=!0,y+=d+7>>3;else if(z=="o21")f.length>2&&!m&&(p=f.shift()+l.nominalWidthX,m=!0),x+=f.pop(),T+=f.pop(),g&&e.U.P.closePath(c),e.U.P.moveTo(c,T,x),g=!0;else if(z=="o22")f.length>1&&!m&&(p=f.shift()+l.nominalWidthX,m=!0),T+=f.pop(),g&&e.U.P.closePath(c),e.U.P.moveTo(c,T,x),g=!0;else if(z=="o25"){for(;f.length>6;)T+=f.shift(),x+=f.shift(),e.U.P.lineTo(c,T,x);_=T+f.shift(),b=x+f.shift(),S=_+f.shift(),E=b+f.shift(),T=S+f.shift(),x=E+f.shift(),e.U.P.curveTo(c,_,b,S,E,T,x)}else if(z=="o26")for(f.length%2&&(T+=f.shift());f.length>0;)_=T,b=x+f.shift(),T=S=_+f.shift(),x=(E=b+f.shift())+f.shift(),e.U.P.curveTo(c,_,b,S,E,T,x);else if(z=="o27")for(f.length%2&&(x+=f.shift());f.length>0;)b=x,S=(_=T+f.shift())+f.shift(),E=b+f.shift(),T=S+f.shift(),x=E,e.U.P.curveTo(c,_,b,S,E,T,x);else if(z=="o10"||z=="o29"){var he=z=="o10"?l:o;if(f.length==0)console.debug("error: empty stack");else{var se=f.pop(),J=he.Subrs[se+he.Bias];a.x=T,a.y=x,a.nStems=d,a.haveWidth=m,a.width=p,a.open=g,e.U._drawCFF(J,a,o,l,c),T=a.x,x=a.y,d=a.nStems,m=a.haveWidth,p=a.width,g=a.open}}else if(z=="o30"||z=="o31"){var te=f.length,re=(K=0,z=="o31");for(K+=te-(B=-3&te);K<B;)re?(b=x,S=(_=T+f.shift())+f.shift(),x=(E=b+f.shift())+f.shift(),B-K==5?(T=S+f.shift(),K++):T=S,re=!1):(_=T,b=x+f.shift(),S=_+f.shift(),E=b+f.shift(),T=S+f.shift(),B-K==5?(x=E+f.shift(),K++):x=E,re=!0),e.U.P.curveTo(c,_,b,S,E,T,x),K+=4}else{if((z+"").charAt(0)=="o")throw console.debug("Unknown operation: "+z,r),z;f.push(z)}}}a.x=T,a.y=x,a.nStems=d,a.haveWidth=m,a.width=p,a.open=g};var t=e,i={Typr:t};return n.Typr=t,n.default=i,Object.defineProperty(n,"__esModule",{value:!0}),n}({}).Typr}function eX(){return function(n){var e=Uint8Array,t=Uint16Array,i=Uint32Array,r=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(z,B){for(var V=new t(31),W=0;W<31;++W)V[W]=B+=1<<z[W-1];var X=new i(V[30]);for(W=1;W<30;++W)for(var K=V[W];K<V[W+1];++K)X[K]=K-V[W]<<5|W;return[V,X]},c=l(r,2),f=c[0],d=c[1];f[28]=258,d[258]=28;for(var m=l(a,0)[0],p=new t(32768),g=0;g<32768;++g){var y=(43690&g)>>>1|(21845&g)<<1;y=(61680&(y=(52428&y)>>>2|(13107&y)<<2))>>>4|(3855&y)<<4,p[g]=((65280&y)>>>8|(255&y)<<8)>>>1}var T=function(z,B,V){for(var W=z.length,X=0,K=new t(B);X<W;++X)++K[z[X]-1];var pe,Q=new t(B);for(X=0;X<B;++X)Q[X]=Q[X-1]+K[X-1]<<1;if(V){pe=new t(1<<B);var ee=15-B;for(X=0;X<W;++X)if(z[X])for(var G=X<<4|z[X],Z=B-z[X],ne=Q[z[X]-1]++<<Z,he=ne|(1<<Z)-1;ne<=he;++ne)pe[p[ne]>>>ee]=G}else for(pe=new t(W),X=0;X<W;++X)z[X]&&(pe[X]=p[Q[z[X]-1]++]>>>15-z[X]);return pe},x=new e(288);for(g=0;g<144;++g)x[g]=8;for(g=144;g<256;++g)x[g]=9;for(g=256;g<280;++g)x[g]=7;for(g=280;g<288;++g)x[g]=8;var _=new e(32);for(g=0;g<32;++g)_[g]=5;var b=T(x,9,1),S=T(_,5,1),E=function(z){for(var B=z[0],V=1;V<z.length;++V)z[V]>B&&(B=z[V]);return B},C=function(z,B,V){var W=B/8|0;
4514return(z[W]|z[W+1]<<8)>>(7&B)&V},D=function(z,B){var V=B/8|0;return(z[V]|z[V+1]<<8|z[V+2]<<16)>>(7&B)},U=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],w=function(z,B,V){var W=new Error(B||U[z]);if(W.code=z,Error.captureStackTrace&&Error.captureStackTrace(W,w),!V)throw W;return W},R=function(z,B,V){var W=z.length;if(!W||V&&!V.l&&W<5)return B||new e(0);var X=!B||V,K=!V||V.i;V||(V={}),B||(B=new e(3*W));var pe,Q=function(Fe){var Y=B.length;if(Fe>Y){var oe=new e(Math.max(2*Y,Fe));oe.set(B),B=oe}},ee=V.f||0,G=V.p||0,Z=V.b||0,ne=V.l,he=V.d,se=V.m,J=V.n,te=8*W;do{if(!ne){V.f=ee=C(z,G,1);var re=C(z,G+1,3);if(G+=3,!re){var Oe=z[(Me=((pe=G)/8|0)+(7&pe&&1)+4)-4]|z[Me-3]<<8,Be=Me+Oe;if(Be>W){K&&w(0);break}X&&Q(Z+Oe),B.set(z.subarray(Me,Be),Z),V.b=Z+=Oe,V.p=G=8*Be;continue}if(re==1)ne=b,he=S,se=9,J=5;else if(re==2){var De=C(z,G,31)+257,Ue=C(z,G+10,15)+4,Xe=De+C(z,G+5,31)+1;G+=14;for(var ge=new e(Xe),me=new e(19),ce=0;ce<Ue;++ce)me[o[ce]]=C(z,G+3*ce,7);G+=3*Ue;var Te=E(me),F=(1<<Te)-1,He=T(me,Te,1);for(ce=0;ce<Xe;){var Me,_e=He[C(z,G,F)];if(G+=15&_e,(Me=_e>>>4)<16)ge[ce++]=Me;else{var Ae=0,P=0;for(Me==16?(P=3+C(z,G,3),G+=2,Ae=ge[ce-1]):Me==17?(P=3+C(z,G,7),G+=3):Me==18&&(P=11+C(z,G,127),G+=7);P--;)ge[ce++]=Ae}}var O=ge.subarray(0,De),q=ge.subarray(De);se=E(O),J=E(q),ne=T(O,se,1),he=T(q,J,1)}else w(1);if(G>te){K&&w(0);break}}X&&Q(Z+131072);for(var de=(1<<se)-1,le=(1<<J)-1,ie=G;;ie=G){var ze=(Ae=ne[D(z,G)&de])>>>4;if((G+=15&Ae)>te){K&&w(0);break}if(Ae||w(2),ze<256)B[Z++]=ze;else{if(ze==256){ie=G,ne=null;break}var Re=ze-254;if(ze>264){var Ye=r[ce=ze-257];Re=C(z,G,(1<<Ye)-1)+f[ce],G+=Ye}var at=he[D(z,G)&le],we=at>>>4;if(at||w(3),G+=15&at,q=m[we],we>3&&(Ye=a[we],q+=D(z,G)&(1<<Ye)-1,G+=Ye),G>te){K&&w(0);break}X&&Q(Z+131072);for(var Pe=Z+Re;Z<Pe;Z+=4)B[Z]=B[Z-q],B[Z+1]=B[Z+1-q],B[Z+2]=B[Z+2-q],B[Z+3]=B[Z+3-q];Z=Pe}}V.l=ne,V.p=ie,V.b=Z,ne&&(ee=1,V.m=se,V.d=he,V.n=J)}while(!ee);return Z==B.length?B:function(Fe,Y,oe){(Y==null||Y<0)&&(Y=0),(oe==null||oe>Fe.length)&&(oe=Fe.length);var Ge=new(Fe instanceof t?t:Fe instanceof i?i:e)(oe-Y);return Ge.set(Fe.subarray(Y,oe)),Ge}(B,0,Z)},L=new e(0),I=typeof TextDecoder<"u"&&new TextDecoder;try{I.decode(L,{stream:!0})}catch{}return n.convert_streams=function(z){var B=new DataView(z),V=0;function W(){var De=B.getUint16(V);return V+=2,De}function X(){var De=B.getUint32(V);return V+=4,De}function K(De){Oe.setUint16(Be,De),Be+=2}function pe(De){Oe.setUint32(Be,De),Be+=4}for(var Q={signature:X(),flavor:X(),length:X(),numTables:W(),reserved:W(),totalSfntSize:X(),majorVersion:W(),minorVersion:W(),metaOffset:X(),metaLength:X(),metaOrigLength:X(),privOffset:X(),privLength:X()},ee=0;Math.pow(2,ee)<=Q.numTables;)ee++;ee--;for(var G=16*Math.pow(2,ee),Z=16*Q.numTables-G,ne=12,he=[],se=0;se<Q.numTables;se++)he.push({tag:X(),offset:X(),compLength:X(),origLength:X(),origChecksum:X()}),ne+=16;var J,te=new Uint8Array(12+16*he.length+he.reduce(function(De,Ue){return De+Ue.origLength+4},0)),re=te.buffer,Oe=new DataView(re),Be=0;return pe(Q.flavor),K(Q.numTables),K(G),K(ee),K(Z),he.forEach(function(De){pe(De.tag),pe(De.origChecksum),pe(ne),pe(De.origLength),De.outOffset=ne,(ne+=De.origLength)%4!=0&&(ne+=4-ne%4)}),he.forEach(function(De){var Ue,Xe=z.slice(De.offset,De.offset+De.compLength);if(De.compLength!=De.origLength){var ge=new Uint8Array(De.origLength);Ue=new Uint8Array(Xe,2),R(Ue,ge)}else ge=new Uint8Array(Xe);te.set(ge,De.outOffset);var me=0;(ne=De.outOffset+De.origLength)%4!=0&&(me=4-ne%4),te.set(new Uint8Array(me).buffer,De.outOffset+De.origLength),J=ne+me}),re.slice(0,J)},Object.defineProperty(n,"__esModule",{value:!0}),n}({}).convert_streams}function tX(n,e){let t={M:2,L:2,Q:4,C:6,Z:0},i={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},r=1,a=2,o=4,l=8,c=16,f=32,d;function m(U){if(!d){let w={R:a,L:r,D:o,C:c,U:f,T:l};d=new Map;for(let R in i){let L=0;i[R].split(",").forEach(I=>{let[z,B]=I.split("+");z=parseInt(z,36),B=B?parseInt(B,36):0,d.set(L+=z,w[R]);for(let V=B;V--;)d.set(++L,w[R])})}}return d.get(U)||f}let p=1,g=2,y=3,T=4,x=[null,"isol","init","fina","medi"];function _(U){let w=new Uint8Array(U.length),R=f,L=p,I=-1;for(let z=0;z<U.length;z++){let B=U.codePointAt(z),V=m(B)|0,W=p;V&l||(R&(r|o|c)?V&(a|o|c)?(W=y,(L===p||L===y)&&w[I]++):V&(r|f)&&(L===g||L===T)&&w[I]--:R&(a|f)&&(L===g||L===T)&&w[I]--,L=w[z]=W,R=V,I=z,B>65535&&z++)}return w}function b(U,w){let R=[];for(let I=0;I<w.length;I++){let z=w.codePointAt(I);z>65535&&I++,R.push(n.U.codeToGlyph(U,z))}let L=U.GSUB;if(L){let{lookupList:I,featureList:z}=L,B,V=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,W=[];z.forEach(X=>{if(V.test(X.tag))for(let K=0;K<X.tab.length;K++){if(W[X.tab[K]])continue;W[X.tab[K]]=!0;let pe=I[X.tab[K]],Q=/^(isol|init|fina|medi)$/.test(X.tag);Q&&!B&&(B=_(w));for(let ee=0;ee<R.length;ee++)(!B||!Q||x[B[ee]]===X.tag)&&n.U._applySubs(R,ee,pe,I)}})}return R}function S(U,w){let R=new Int16Array(w.length*3),L=0;for(;L<w.length;L++){let V=w[L];if(V===-1)continue;R[L*3+2]=U.hmtx.aWidth[V];let W=U.GPOS;if(W){let X=W.lookupList;for(let K=0;K<X.length;K++){let pe=X[K];for(let Q=0;Q<pe.tabs.length;Q++){let ee=pe.tabs[Q];if(pe.ltype===1){if(n._lctf.coverageIndex(ee.coverage,V)!==-1&&ee.pos){B(ee.pos,L);break}}else if(pe.ltype===2){let G=null,Z=I();if(Z!==-1){let ne=n._lctf.coverageIndex(ee.coverage,w[Z]);if(ne!==-1){if(ee.fmt===1){let he=ee.pairsets[ne];for(let se=0;se<he.length;se++)he[se].gid2===V&&(G=he[se])}else if(ee.fmt===2){let he=n.U._getGlyphClass(w[Z],ee.classDef1),se=n.U._getGlyphClass(V,ee.classDef2);G=ee.matrix[he][se]}if(G){G.val1&&B(G.val1,Z),G.val2&&B(G.val2,L);break}}}}else if(pe.ltype===4){let G=n._lctf.coverageIndex(ee.markCoverage,V);if(G!==-1){let Z=I(z),ne=Z===-1?-1:n._lctf.coverageIndex(ee.baseCoverage,w[Z]);if(ne!==-1){let he=ee.markArray[G],se=ee.baseArray[ne][he.markClass];R[L*3]=se.x-he.x+R[Z*3]-R[Z*3+2],R[L*3+1]=se.y-he.y+R[Z*3+1];break}}}else if(pe.ltype===6){let G=n._lctf.coverageIndex(ee.mark1Coverage,V);if(G!==-1){let Z=I();if(Z!==-1){let ne=w[Z];if(E(U,ne)===3){let he=n._lctf.coverageIndex(ee.mark2Coverage,ne);
4514if(he!==-1){let se=ee.mark1Array[G],J=ee.mark2Array[he][se.markClass];R[L*3]=J.x-se.x+R[Z*3]-R[Z*3+2],R[L*3+1]=J.y-se.y+R[Z*3+1];break}}}}}}}}else if(U.kern&&!U.cff){let X=I();if(X!==-1){let K=U.kern.glyph1.indexOf(w[X]);if(K!==-1){let pe=U.kern.rval[K].glyph2.indexOf(V);pe!==-1&&(R[X*3+2]+=U.kern.rval[K].vals[pe])}}}}return R;function I(V){for(let W=L-1;W>=0;W--)if(w[W]!==-1&&(!V||V(w[W])))return W;return-1}function z(V){return E(U,V)===1}function B(V,W){for(let X=0;X<3;X++)R[W*3+X]+=V[X]||0}}function E(U,w){let R=U.GDEF&&U.GDEF.glyphClassDef;return R?n.U._getGlyphClass(w,R):0}function C(...U){for(let w=0;w<U.length;w++)if(typeof U[w]=="number")return U[w]}function D(U){let w=Object.create(null),R=U["OS/2"],L=U.hhea,I=U.head.unitsPerEm,z=C(R&&R.sTypoAscender,L&&L.ascender,I),B={unitsPerEm:I,ascender:z,descender:C(R&&R.sTypoDescender,L&&L.descender,0),capHeight:C(R&&R.sCapHeight,z),xHeight:C(R&&R.sxHeight,z),lineGap:C(R&&R.sTypoLineGap,L&&L.lineGap),supportsCodePoint(V){return n.U.codeToGlyph(U,V)>0},forEachGlyph(V,W,X,K){let pe=0,Q=1/B.unitsPerEm*W,ee=b(U,V),G=0,Z=S(U,ee);return ee.forEach((ne,he)=>{if(ne!==-1){let se=w[ne];if(!se){let{cmds:J,crds:te}=n.U.glyphToPath(U,ne),re="",Oe=0;for(let ge=0,me=J.length;ge<me;ge++){let ce=t[J[ge]];re+=J[ge];for(let Te=1;Te<=ce;Te++)re+=(Te>1?",":"")+te[Oe++]}let Be,De,Ue,Xe;if(te.length){Be=De=1/0,Ue=Xe=-1/0;for(let ge=0,me=te.length;ge<me;ge+=2){let ce=te[ge],Te=te[ge+1];ce<Be&&(Be=ce),Te<De&&(De=Te),ce>Ue&&(Ue=ce),Te>Xe&&(Xe=Te)}}else Be=Ue=De=Xe=0;se=w[ne]={index:ne,advanceWidth:U.hmtx.aWidth[ne],xMin:Be,yMin:De,xMax:Ue,yMax:Xe,path:re}}K.call(null,se,pe+Z[he*3]*Q,Z[he*3+1]*Q,G),pe+=Z[he*3+2]*Q,X&&(pe+=X*W)}G+=V.codePointAt(G)>65535?2:1}),pe}};return B}return function(w){let R=new Uint8Array(w,0,4),L=n._bin.readASCII(R,0,4);if(L==="wOFF")w=e(w);else if(L==="wOF2")throw new Error("woff2 fonts not supported");return D(n.parse(w)[0])}}var nX=pf({name:"Typr Font Parser",dependencies:[$W,eX,tX],init(n,e,t){let i=n(),r=e();return t(i,r)}});function iX(){return function(n){var e=function(){this.buckets=new Map};e.prototype.add=function(S){var E=S>>5;this.buckets.set(E,(this.buckets.get(E)||0)|1<<(31&S))},e.prototype.has=function(S){var E=this.buckets.get(S>>5);return E!==void 0&&(E&1<<(31&S))!=0},e.prototype.serialize=function(){var S=[];return this.buckets.forEach(function(E,C){S.push((+C).toString(36)+":"+E.toString(36))}),S.join(",")},e.prototype.deserialize=function(S){var E=this;this.buckets.clear(),S.split(",").forEach(function(C){var D=C.split(":");E.buckets.set(parseInt(D[0],36),parseInt(D[1],36))})};var t=Math.pow(2,8),i=t-1,r=~i;function a(S){var E=function(D){return D&r}(S).toString(16),C=function(D){return(D&r)+t-1}(S).toString(16);return"codepoint-index/plane"+(S>>16)+"/"+E+"-"+C+".json"}function o(S,E){var C=S&i,D=E.codePointAt(C/6|0);return((D=(D||48)-48)&1<<C%6)!=0}function l(S,E){var C;(C=S,C.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(D){return D.split("-").map(function(U){return parseInt(U.trim(),16)})})).forEach(function(D){var U=D[0],w=D[1];w===void 0&&(w=U),E(U,w)})}function c(S,E){l(S,function(C,D){for(var U=C;U<=D;U++)E(U)})}var f={},d={},m=new WeakMap,p="https://cdn.jsdelivr.net/gh/lojjic/[email protected]/packages/data";function g(S){var E=m.get(S);return E||(E=new e,c(S.ranges,function(C){return E.add(C)}),m.set(S,E)),E}var y,T=new Map;function x(S,E,C){return S[E]?E:S[C]?C:function(D){for(var U in D)return U}(S)}function _(S,E){var C=E;if(!S.includes(C)){C=1/0;for(var D=0;D<S.length;D++)Math.abs(S[D]-E)<Math.abs(C-E)&&(C=S[D])}return C}function b(S){return y||(y=new Set,c("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(E){y.add(E)})),y.has(S)}return n.CodePointSet=e,n.clearCache=function(){f={},d={}},n.getFontsForString=function(S,E){E===void 0&&(E={});var C,D=E.lang;D===void 0&&(D=/\p{Script=Hangul}/u.test(C=S)?"ko":/\p{Script=Hiragana}|\p{Script=Katakana}/u.test(C)?"ja":"en");var U=E.category;U===void 0&&(U="sans-serif");var w=E.style;w===void 0&&(w="normal");var R=E.weight;R===void 0&&(R=400);var L=(E.dataUrl||p).replace(/\/$/g,""),I=new Map,z=new Uint8Array(S.length),B={},V={},W=new Array(S.length),X=new Map,K=!1;function pe(G){var Z=T.get(G);return Z||(Z=fetch(L+"/"+G).then(function(ne){if(!ne.ok)throw new Error(ne.statusText);return ne.json().then(function(he){if(!Array.isArray(he)||he[0]!==1)throw new Error("Incorrect schema version; need 1, got "+he[0]);return he[1]})}).catch(function(ne){if(L!==p)return K||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+L+'", trying default CDN. '+ne.message),K=!0),L=p,T.delete(G),pe(G);throw ne}),T.set(G,Z)),Z}
4514for(var Q=function(G){var Z=S.codePointAt(G),ne=a(Z);W[G]=ne,f[ne]||X.has(ne)||X.set(ne,pe(ne).then(function(he){f[ne]=he})),Z>65535&&(G++,ee=G)},ee=0;ee<S.length;ee++)Q(ee);return Promise.all(X.values()).then(function(){X.clear();for(var G=function(ne){var he=S.codePointAt(ne),se=null,J=f[W[ne]],te=void 0;for(var re in J){var Oe=V[re];if(Oe===void 0&&(Oe=V[re]=new RegExp(re).test(D||"en")),Oe){for(var Be in te=re,J[re])if(o(he,J[re][Be])){se=Be;break}break}}if(!se){e:for(var De in J)if(De!==te){for(var Ue in J[De])if(o(he,J[De][Ue])){se=Ue;break e}}}se||(console.debug("No font coverage for U+"+he.toString(16)),se="latin"),W[ne]=se,d[se]||X.has(se)||X.set(se,pe("font-meta/"+se+".json").then(function(Xe){d[se]=Xe})),he>65535&&(ne++,Z=ne)},Z=0;Z<S.length;Z++)G(Z);return Promise.all(X.values())}).then(function(){for(var G,Z=null,ne=0;ne<S.length;ne++){var he=S.codePointAt(ne);if(Z&&(b(he)||g(Z).has(he)))z[ne]=z[ne-1];else{Z=d[W[ne]];var se=B[Z.id];if(!se){var J=Z.typeforms,te=x(J,U,"sans-serif"),re=x(J[te],w,"normal"),Oe=_((G=J[te])===null||G===void 0?void 0:G[re],R);se=B[Z.id]=L+"/font-files/"+Z.id+"/"+te+"."+re+"."+Oe+".woff"}var Be=I.get(se);Be==null&&(Be=I.size,I.set(se,Be)),z[ne]=Be}he>65535&&(ne++,z[ne]=z[ne-1])}return{fontUrls:Array.from(I.keys()),chars:z}})},Object.defineProperty(n,"__esModule",{value:!0}),n}({})}function rX(n,e){let t=Object.create(null),i=Object.create(null);function r(o,l){let c=f=>{console.error(`Failure loading font ${o}`,f)};try{let f=new XMLHttpRequest;f.open("get",o,!0),f.responseType="arraybuffer",f.onload=function(){if(f.status>=400)c(new Error(f.statusText));else if(f.status>0)try{let d=n(f.response);d.src=o,l(d)}catch(d){c(d)}},f.onerror=c,f.send()}catch(f){c(f)}}function a(o,l){let c=t[o];c?l(c):i[o]?i[o].push(l):(i[o]=[l],r(o,f=>{f.src=o,t[o]=f,i[o].forEach(d=>d(f)),delete i[o]}))}return function(o,l,{lang:c,fonts:f=[],style:d="normal",weight:m="normal",unicodeFontsURL:p}={}){let g=new Uint8Array(o.length),y=[];o.length||b();let T=new Map,x=[];if(d!=="italic"&&(d="normal"),typeof m!="number"&&(m=m==="bold"?700:400),f&&!Array.isArray(f)&&(f=[f]),f=f.slice().filter(E=>!E.lang||E.lang.test(c)).reverse(),f.length){let U=0;(function w(R=0){for(let L=R,I=o.length;L<I;L++){let z=o.codePointAt(L);if(U===1&&y[g[L-1]].supportsCodePoint(z)||L>0&&/\s/.test(o[L]))g[L]=g[L-1],U===2&&(x[x.length-1][1]=L);else for(let B=g[L],V=f.length;B<=V;B++)if(B===V){let W=U===2?x[x.length-1]:x[x.length]=[L,L];W[1]=L,U=2}else{g[L]=B;let{src:W,unicodeRange:X}=f[B];if(!X||S(z,X)){let K=t[W];if(!K){a(W,()=>{w(L)});return}if(K.supportsCodePoint(z)){let pe=T.get(K);typeof pe!="number"&&(pe=y.length,y.push(K),T.set(K,pe)),g[L]=pe,U=1;break}}}z>65535&&L+1<I&&(g[L+1]=g[L],L++,U===2&&(x[x.length-1][1]=L))}_()})()}else x.push([0,o.length-1]),_();function _(){if(x.length){let E=x.map(C=>o.substring(C[0],C[1]+1)).join(`
4515`);e.getFontsForString(E,{lang:c||void 0,style:d,weight:m,dataUrl:p}).then(({fontUrls:C,chars:D})=>{let U=y.length,w=0;x.forEach(L=>{for(let I=0,z=L[1]-L[0];I<=z;I++)g[L[0]+I]=D[w++]+U;w++});let R=0;C.forEach((L,I)=>{a(L,z=>{y[I+U]=z,++R===C.length&&b()})})})}else b()}function b(){l({chars:g,fonts:y})}function S(E,C){for(let D=0;D<C.length;D++){let[U,w=U]=C[D];if(U<=E&&E<=w)return!0}return!1}}}var aX=pf({name:"FontResolver",dependencies:[rX,nX,iX],init(n,e,t){return n(e,t())}});function oX(n,e){let i=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,r="[^\\S\\u00A0]",a=new RegExp(`${r}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function o({text:y,lang:T,fonts:x,style:_,weight:b,preResolvedFonts:S,unicodeFontsURL:E},C){let D=({chars:U,fonts:w})=>{let R,L,I=[];for(let z=0;z<U.length;z++)U[z]!==L?(L=U[z],I.push(R={start:z,end:z,fontObj:w[U[z]]})):R.end=z;C(I)};S?D(S):n(y,D,{lang:T,fonts:x,style:_,weight:b,unicodeFontsURL:E})}function l({text:y="",font:T,lang:x,sdfGlyphSize:_=64,fontSize:b=400,fontWeight:S=1,fontStyle:E="normal",letterSpacing:C=0,lineHeight:D="normal",maxWidth:U=1/0,direction:w,textAlign:R="left",textIndent:L=0,whiteSpace:I="normal",overflowWrap:z="normal",anchorX:B=0,anchorY:V=0,metricsOnly:W=!1,unicodeFontsURL:X,preResolvedFonts:K=null,includeCaretPositions:pe=!1,chunkedBoundsSize:Q=8192,colorRanges:ee=null},G){let Z=m(),ne={fontLoad:0,typesetting:0};y.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),y=y.replace(/\r\n/g,`
4516`).replace(/\r/g,`
4517`)),b=+b,C=+C,U=+U,D=D||"normal",L=+L,o({text:y,lang:x,style:E,weight:S,fonts:typeof T=="string"?[{src:T}]:T,unicodeFontsURL:X,preResolvedFonts:K},he=>{ne.fontLoad=m()-Z;let se=isFinite(U),J=null,te=null,re=null,Oe=null,Be=null,De=null,Ue=null,Xe=null,ge=0,me=0,ce=I!=="nowrap",Te=new Map,F=m(),He=L,Me=0,_e=new p,Ae=[_e];he.forEach(le=>{let{fontObj:ie}=le,{ascender:ze,descender:Re,unitsPerEm:Ye,lineGap:at,capHeight:we,xHeight:Pe}=ie,Fe=Te.get(ie);if(!Fe){let Se=b/Ye,Ie=D==="normal"?(ze-Re+at)*Se:D*b,Ke=(Ie-(ze-Re)*Se)/2,ke=Math.min(Ie,(ze-Re)*Se),fe=(ze+Re)/2*Se+ke/2;Fe={index:Te.size,src:ie.src,fontObj:ie,fontSizeMult:Se,unitsPerEm:Ye,ascender:ze*Se,descender:Re*Se,capHeight:we*Se,xHeight:Pe*Se,lineHeight:Ie,baseline:-Ke-ze*Se,caretTop:fe,caretBottom:fe-ke},Te.set(ie,Fe)}let{fontSizeMult:Y}=Fe,oe=y.slice(le.start,le.end+1),Ge,j;ie.forEachGlyph(oe,b,C,(Se,Ie,Ke,ke)=>{Ie+=Me,ke+=le.start,Ge=Ie,j=Se;let fe=y.charAt(ke),qe=Se.advanceWidth*Y,it=_e.count,rt;if("isEmpty"in Se||(Se.isWhitespace=!!fe&&new RegExp(r).test(fe),Se.canBreakAfter=!!fe&&a.test(fe),Se.isEmpty=Se.xMin===Se.xMax||Se.yMin===Se.yMax||i.test(fe)),!Se.isWhitespace&&!Se.isEmpty&&me++,ce&&se&&!Se.isWhitespace&&Ie+qe+He>U&&it){if(_e.glyphAt(it-1).glyphObj.canBreakAfter)rt=new p,He=-Ie;else for(let jt=it;jt--;)if(jt===0&&z==="break-word"){rt=new p,He=-Ie;break}else if(_e.glyphAt(jt).glyphObj.canBreakAfter){rt=_e.splitAt(jt+1);let Ht=rt.glyphAt(0).x;He-=Ht;for(let pn=rt.count;pn--;)rt.glyphAt(pn).x-=Ht;break}rt&&(_e.isSoftWrapped=!0,_e=rt,Ae.push(_e),ge=U)}let dt=_e.glyphAt(_e.count);dt.glyphObj=Se,dt.x=Ie+He,dt.y=Ke,dt.width=qe,dt.charIndex=ke,dt.fontData=Fe,fe===`
4518`&&(_e=new p,Ae.push(_e),He=-(Ie+qe+C*b)+L)}),Me=Ge+j.advanceWidth*Y+C*b});let P=0;Ae.forEach(le=>{let ie=!0;for(let ze=le.count;ze--;){let Re=le.glyphAt(ze);ie&&!Re.glyphObj.isWhitespace&&(le.width=Re.x+Re.width,le.width>ge&&(ge=le.width),ie=!1);let{lineHeight:Ye,capHeight:at,xHeight:we,baseline:Pe}=Re.fontData;Ye>le.lineHeight&&(le.lineHeight=Ye);let Fe=Pe-le.baseline;Fe<0&&(le.baseline+=Fe,le.cap+=Fe,le.ex+=Fe),le.cap=Math.max(le.cap,le.baseline+at),le.ex=Math.max(le.ex,le.baseline+we)}le.baseline-=P,le.cap-=P,le.ex-=P,P+=le.lineHeight});let O=0,q=0;
4518if(B&&(typeof B=="number"?O=-B:typeof B=="string"&&(O=-ge*(B==="left"?0:B==="center"?.5:B==="right"?1:f(B)))),V&&(typeof V=="number"?q=-V:typeof V=="string"&&(q=V==="top"?0:V==="top-baseline"?-Ae[0].baseline:V==="top-cap"?-Ae[0].cap:V==="top-ex"?-Ae[0].ex:V==="middle"?P/2:V==="bottom"?P:V==="bottom-baseline"?-Ae[Ae.length-1].baseline:f(V)*P)),!W){let le=e.getEmbeddingLevels(y,w);J=new Uint16Array(me),te=new Uint8Array(me),re=new Float32Array(me*2),Oe={},Ue=[1/0,1/0,-1/0,-1/0],Xe=[],pe&&(De=new Float32Array(y.length*4)),ee&&(Be=new Uint8Array(me*3));let ie=0,ze=-1,Re=-1,Ye,at;if(Ae.forEach((we,Pe)=>{let{count:Fe,width:Y}=we;if(Fe>0){let oe=0;for(let ke=Fe;ke--&&we.glyphAt(ke).glyphObj.isWhitespace;)oe++;let Ge=0,j=0;if(R==="center")Ge=(ge-Y)/2;else if(R==="right")Ge=ge-Y;else if(R==="justify"&&we.isSoftWrapped){let ke=0;for(let fe=Fe-oe;fe--;)we.glyphAt(fe).glyphObj.isWhitespace&&ke++;j=(ge-Y)/ke}if(j||Ge){let ke=0;for(let fe=0;fe<Fe;fe++){let qe=we.glyphAt(fe),it=qe.glyphObj;qe.x+=Ge+ke,j!==0&&it.isWhitespace&&fe<Fe-oe&&(ke+=j,qe.width+=j)}}let Se=e.getReorderSegments(y,le,we.glyphAt(0).charIndex,we.glyphAt(we.count-1).charIndex);for(let ke=0;ke<Se.length;ke++){let[fe,qe]=Se[ke],it=1/0,rt=-1/0;for(let dt=0;dt<Fe;dt++)if(we.glyphAt(dt).charIndex>=fe){let jt=dt,Ht=dt;for(;Ht<Fe;Ht++){let pn=we.glyphAt(Ht);if(pn.charIndex>qe)break;Ht<Fe-oe&&(it=Math.min(it,pn.x),rt=Math.max(rt,pn.x+pn.width))}for(let pn=jt;pn<Ht;pn++){let ti=we.glyphAt(pn);ti.x=rt-(ti.x+ti.width-it)}break}}let Ie,Ke=ke=>Ie=ke;for(let ke=0;ke<Fe;ke++){let fe=we.glyphAt(ke);Ie=fe.glyphObj;let qe=Ie.index,it=le.levels[fe.charIndex]&1;if(it){let rt=e.getMirroredCharacter(y[fe.charIndex]);rt&&fe.fontData.fontObj.forEachGlyph(rt,0,0,Ke)}if(pe){let{charIndex:rt,fontData:dt}=fe,jt=fe.x+O,Ht=fe.x+fe.width+O;De[rt*4]=it?Ht:jt,De[rt*4+1]=it?jt:Ht,De[rt*4+2]=we.baseline+dt.caretBottom+q,De[rt*4+3]=we.baseline+dt.caretTop+q;let pn=rt-ze;pn>1&&d(De,ze,pn),ze=rt}if(ee){let{charIndex:rt}=fe;for(;rt>Re;)Re++,ee.hasOwnProperty(Re)&&(at=ee[Re])}if(!Ie.isWhitespace&&!Ie.isEmpty){let rt=ie++,{fontSizeMult:dt,src:jt,index:Ht}=fe.fontData,pn=Oe[jt]||(Oe[jt]={});pn[qe]||(pn[qe]={path:Ie.path,pathBounds:[Ie.xMin,Ie.yMin,Ie.xMax,Ie.yMax]});let ti=fe.x+O,$r=fe.y+we.baseline+q;re[rt*2]=ti,re[rt*2+1]=$r;let Pi=ti+Ie.xMin*dt,tr=$r+Ie.yMin*dt,di=ti+Ie.xMax*dt,jn=$r+Ie.yMax*dt;Pi<Ue[0]&&(Ue[0]=Pi),tr<Ue[1]&&(Ue[1]=tr),di>Ue[2]&&(Ue[2]=di),jn>Ue[3]&&(Ue[3]=jn),rt%Q===0&&(Ye={start:rt,end:rt,rect:[1/0,1/0,-1/0,-1/0]},Xe.push(Ye)),Ye.end++;let Zn=Ye.rect;if(Pi<Zn[0]&&(Zn[0]=Pi),tr<Zn[1]&&(Zn[1]=tr),di>Zn[2]&&(Zn[2]=di),jn>Zn[3]&&(Zn[3]=jn),J[rt]=qe,te[rt]=Ht,ee){let gr=rt*3;Be[gr]=at>>16&255,Be[gr+1]=at>>8&255,Be[gr+2]=at&255}}}}}),De){let we=y.length-ze;we>1&&d(De,ze,we)}}let de=[];Te.forEach(({index:le,src:ie,unitsPerEm:ze,ascender:Re,descender:Ye,lineHeight:at,capHeight:we,xHeight:Pe})=>{de[le]={src:ie,unitsPerEm:ze,ascender:Re,descender:Ye,lineHeight:at,capHeight:we,xHeight:Pe}}),ne.typesetting=m()-F,G({glyphIds:J,glyphFontIndices:te,glyphPositions:re,glyphData:Oe,fontData:de,caretPositions:De,glyphColors:Be,chunkedBounds:Xe,fontSize:b,topBaseline:q+Ae[0].baseline,blockBounds:[O,q-P,O+ge,q],visibleBounds:Ue,timings:ne})})}function c(y,T){l({...y,metricsOnly:!0},x=>{let[_,b,S,E]=x.blockBounds;T({width:S-_,height:E-b})})}function f(y){let T=y.match(/^([\d.]+)%$/),x=T?parseFloat(T[1]):NaN;return isNaN(x)?0:x/100}function d(y,T,x){let _=y[T*4],b=y[T*4+1],S=y[T*4+2],E=y[T*4+3],C=(b-_)/x;for(let D=0;D<x;D++){let U=(T+D)*4;y[U]=_+C*D,y[U+1]=_+C*(D+1),y[U+2]=S,y[U+3]=E}}function m(){return(self.performance||Date).now()}function p(){this.data=[]}let g=["glyphObj","x","y","width","charIndex","fontData"];return p.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/g.length)},glyphAt(y){let T=p.flyweight;return T.data=this.data,T.index=y,T},splitAt(y){let T=new p;return T.data=this.data.splice(y*g.length),T}},p.flyweight=g.reduce((y,T,x,_)=>(Object.defineProperty(y,T,{get(){return this.data[this.index*g.length+x]},set(b){this.data[this.index*g.length+x]=b}}),y),{data:null,index:0}),{typeset:l,measure:c}}var vf=()=>(self.performance||Date).now(),B1=hA(),cz;function sX(n,e,t,i,r,a,o,l,c,f,d=!0){return d?uX(n,e,t,i,r,a,o,l,c,f).then(null,m=>(cz||(console.warn("WebGL SDF generation failed, falling back to JS",m),cz=!0),dz(n,e,t,i,r,a,o,l,c,f))):dz(n,e,t,i,r,a,o,l,c,f)}var F1=[],lX=5,yA=0;function bz(){let n=vf();for(;F1.length&&vf()-n<lX;)F1.shift()();yA=F1.length?setTimeout(bz,0):0}var uX=(...n)=>new Promise((e,t)=>
4518{F1.push(()=>{let i=vf();try{B1.webgl.generateIntoCanvas(...n),e({timing:vf()-i})}catch(r){t(r)}}),yA||(yA=setTimeout(bz,0))}),cX=4,fX=2e3,fz={},dX=0;function dz(n,e,t,i,r,a,o,l,c,f){let d="TroikaTextSDFGenerator_JS_"+dX++%cX,m=fz[d];return m||(m=fz[d]={workerModule:pf({name:d,workerId:d,dependencies:[hA,vf],init(p,g){let y=p().javascript.generate;return function(...T){let x=g();return{textureData:y(...T),timing:g()-x}}},getTransferables(p){return[p.textureData.buffer]}}),requests:0,idleTimer:null}),m.requests++,clearTimeout(m.idleTimer),m.workerModule(n,e,t,i,r,a).then(({textureData:p,timing:g})=>{let y=vf(),T=new Uint8Array(p.length*4);for(let x=0;x<p.length;x++)T[x*4+f]=p[x];return B1.webglUtils.renderImageData(o,T,l,c,n,e,1<<3-f),g+=vf()-y,--m.requests===0&&(m.idleTimer=setTimeout(()=>{rz(d)},fX)),{timing:g}})}function hX(n){n._warm||(B1.webgl.isSupported(n),n._warm=!0)}var pX=B1.webglUtils.resizeWebGLCanvasWithoutClearing,gf={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},mX=new tt,gX=!1;function pp(){return(self.performance||Date).now()}var hz=Object.create(null);function xz(n,e){gX=!0,n=yX({},n);let t=pp(),{defaultFontURL:i}=gf,r=[];if(i&&r.push({label:"default",src:pz(i)}),n.font&&r.push({label:"user",src:pz(n.font)}),n.font=r,n.text=""+n.text,n.sdfGlyphSize=n.sdfGlyphSize||gf.sdfGlyphSize,n.unicodeFontsURL=n.unicodeFontsURL||gf.unicodeFontsURL,n.c
4518olorRanges!=null){let g={};for(let y in n.colorRanges)if(n.colorRanges.hasOwnProperty(y)){let T=n.colorRanges[y];typeof T!="number"&&(T=mX.set(T).getHex()),g[y]=T}n.colorRanges=g}Object.freeze(n);let{textureWidth:a,sdfExponent:o}=gf,{sdfGlyphSize:l}=n,c=a/l*4,f=hz[l];if(!f){let g=document.createElement("canvas");g.width=a,g.height=l*256/c,f=hz[l]={glyphCount:0,sdfGlyphSize:l,sdfCanvas:g,sdfTexture:new Bn(g,void 0,void 0,void 0,dn,dn),contextLost:!1,glyphsByFont:new Map},f.sdfTexture.generateMipmaps=!1,vX(f)}let{sdfTexture:d,sdfCanvas:m}=f;(gf.useWorker?Mz:bX)(n).then(g=>{let{glyphIds:y,glyphFontIndices:T,fontData:x,glyphPositions:_,fontSize:b,timings:S}=g,E=[],C=new Float32Array(y.length*4),D=0,U=0,w=pp(),R=x.map(V=>{let W=f.glyphsByFont.get(V.src);return W||f.glyphsByFont.set(V.src,W=new Map),W});y.forEach((V,W)=>{let X=T[W],{src:K,unitsPerEm:pe}=x[X],Q=R[X].get(V);if(!Q){let{path:he,pathBounds:se}=g.glyphData[K][V],J=Math.max(se[2]-se[0],se[3]-se[1])/l*(gf.sdfMargin*l+.5),te=f.glyphCount++,re=[se[0]-J,se[1]-J,se[2]+J,se[3]+J];R[X].set(V,Q={path:he,atlasIndex:te,sdfViewBox:re}),E.push(Q)}let{sdfViewBox:ee}=Q,G=_[U++],Z=_[U++],ne=b/pe;C[D++]=G+ee[0]*ne,C[D++]=Z+ee[1]*ne,C[D++]=G+ee[2]*ne,C[D++]=Z+ee[3]*ne,y[W]=Q.atlasIndex}),S.quads=(S.quads||0)+(pp()-w);let L=pp();S.sdf={};let I=m.height,z=Math.ceil(f.glyphCount/c),B=Math.pow(2,Math.ceil(Math.log2(z*l)));B>I&&(console.info(`Increasing SDF texture size ${I}->${B}`),pX(m,a,B),d.dispose()),Promise.all(E.map(V=>Sz(V,f,n.gpuAccelerateSDF).then(({timing:W})=>{S.sdf[V.atlasIndex]=W}))).then(()=>{E.length&&!f.contextLost&&(Ez(f),d.needsUpdate=!0),S.sdfTotal=pp()-L,S.total=pp()-t,e(Object.freeze({parameters:n,sdfTexture:d,sdfGlyphSize:l,sdfExponent:o,glyphBounds:C,glyphAtlasIndices:y,glyphColors:g.glyphColors,caretPositions:g.caretPositions,chunkedBounds:g.chunkedBounds,ascender:g.ascender,descender:g.descender,lineHeight:g.lineHeight,capHeight:g.capHeight,xHeight:g.xHeight,topBaseline:g.topBaseline,blockBounds:g.blockBounds,visibleBounds:g.visibleBounds,timings:g.timings}))})}),Promise.resolve().then(()=>{f.contextLost||hX(m)})}function Sz({path:n,atlasIndex:e,sdfViewBox:t},{sdfGlyphSize:i,sdfCanvas:r,contextLost:a},o){if(a)return Promise.resolve({timing:-1});let{textureWidth:l,sdfExponent:c}=gf,f=Math.max(t[2]-t[0],t[3]-t[1]),d=Math.floor(e/4),m=d%(l/i)*i,p=Math.floor(d/(l/i))*i,g=e%4;return sX(i,i,n,t,f,c,r,m,p,g,o)}function vX(n){let e=n.sdfCanvas;e.addEventListener("webglcontextlost",t=>{console.log("Context Lost",t),t.preventDefault(),n.contextLost=!0}),e.addEventListener("webglcontextrestored",t=>{console.log("Context Restored",t),n.contextLost=!1;let i=[];n.glyphsByFont.forEach(r=>{r.forEach(a=>{i.push(Sz(a,n,!0))})}),Promise.all(i).then(()=>{Ez(n),n.sdfTexture.needsUpdate=!0})})}function Tz({font:n,characters:e,sdfGlyphSize:t},i){let r=Array.isArray(e)?e.join(`
4519`):""+e;xz({font:n,sdfGlyphSize:t,text:r},i)}function yX(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}var z1;function pz(n){return z1||(z1=typeof document>"u"?{}:document.createElement("a")),z1.href=n,z1.href}function Ez(n){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");let{sdfCanvas:e,sdfTexture:t}=n,{width:i,height:r}=e,a=n.sdfCanvas.getContext("webgl"),o=t.image.data;(!o||o.length!==i*r*4)&&(o=new Uint8Array(i*r*4),t.image={width:i,height:r,data:o},t.flipY=!1,t.isDataTexture=!0),a.readPixels(0,0,i,r,a.RGBA,a.UNSIGNED_BYTE,o)}}
4519var _X=pf({name:"Typesetter",dependencies:[oX,aX,az],init(n,e,t){return n(e,t())}}),Mz=pf({name:"Typesetter",dependencies:[_X],init(n){return function(e){return new Promise(t=>{n.typeset(e,t)})}},getTransferables(n){let e=[];for(let t in n)n[t]&&n[t].buffer&&e.push(n[t].buffer);return e}}),bX=Mz.onMainThread;var mz={};function xX(n){let e=mz[n];return e||(e=mz[n]=new xo(1,1,n,n).translate(.5,.5,0)),e}var SX="aTroikaGlyphBounds",gz="aTroikaGlyphIndex",TX="aTroikaGlyphColor",_A=class extends el{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new En,this.boundingBox=new bn}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let t=xX(e);["position","normal","uv"].forEach(i=>{this.attributes[i]=t.attributes[i].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,i,r,a){this.updateAttributeData(SX,e,4),this.updateAttributeData(gz,t,1),this.updateAttributeData(TX,a,3),this._blockBounds=i,this._chunkedBounds=r,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){let e=this._blockBounds;if(e){let{curveRadius:t,boundingBox:i}=this;if(t){let{PI:r,floor:a,min:o,max:l,sin:c,cos:f}=Math,d=r/2,m=r*2,p=Math.abs(t),g=e[0]/p,y=e[2]/p,T=a((g+d)/m)!==a((y+d)/m)?-p:o(c(g)*p,c(y)*p),x=a((g-d)/m)!==a((y-d)/m)?p:l(c(g)*p,c(y)*p),_=a((g+r)/m)!==a((y+r)/m)?p*2:l(p-f(g)*p,p-f(y)*p);i.min.set(T,e[1],t<0?-_:0),i.max.set(x,e[3],t<0?0:_)}else i.min.set(e[0],e[1],0),i.max.set(e[2],e[3],0);i.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(gz).count,i=this._chunkedBounds;if(i)for(let r=i.length;r--;){t=i[r].end;let a=i[r].rect;if(a[1]<e.w&&a[3]>e.y&&a[0]<e.z&&a[2]>e.x)break}this.instanceCount=t}updateAttributeData(e,t,i){let r=this.getAttribute(e);t?r&&r.array.length===t.length?(r.array.set(t),r.needsUpdate=!0):(this.setAttribute(e,new _o(t,i)),delete this._maxInstanceCount,this.dispose()):r&&this.deleteAttribute(e)}},EX=`
4520uniform vec2 uTroikaSDFTextureSize;
4521uniform float uTroikaSDFGlyphSize;
4522uniform vec4 uTroikaTotalBounds;
4523uniform vec4 uTroikaClipRect;
4524uniform mat3 uTroikaOrient;
4525uniform bool uTroikaUseGlyphColors;
4526uniform float uTroikaEdgeOffset;
4527uniform float uTroikaBlurRadius;
4528uniform vec2 uTroikaPositionOffset;
4529uniform float uTroikaCurveRadius;
4530attribute vec4 aTroikaGlyphBounds;
4531attribute float aTroikaGlyphIndex;
4532attribute vec3 aTroikaGlyphColor;
4533varying vec2 vTroikaGlyphUV;
4534varying vec4 vTroikaTextureUVBounds;
4535varying float vTroikaTextureChannel;
4536varying vec3 vTroikaGlyphColor;
4537varying vec2 vTroikaGlyphDimensions;
4538`,MX=`
4539vec4 bounds = aTroikaGlyphBounds;
4540bounds.xz += uTroikaPositionOffset.x;
4541bounds.yw -= uTroikaPositionOffset.y;
4542
4543vec4 outlineBounds = vec4(
4544  bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,
4545  bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius
4546);
4547vec4 clippedBounds = vec4(
4548  clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),
4549  clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)
4550);
4551
4552vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);
4553
4554position.xy = mix(bounds.xy, bounds.zw, clippedXY);
4555
4556uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);
4557
4558float rad = uTroikaCurveRadius;
4559if (rad != 0.0) {
4560  float angle = position.x / rad;
4561  position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);
4562  normal.xz = vec2(sin(angle), cos(angle));
4563}
4564  
4565position = uTroikaOrient * position;
4566normal = uTroikaOrient * normal;
4567
4568vTroikaGlyphUV = clippedXY.xy;
4569vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);
4570
4571
4572float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;
4573vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;
4574vec2 txStartUV = txUvPerSquare * vec2(
4575  mod(floor(aTroikaGlyphIndex / 4.0), txCols),
4576  floor(floor(aTroikaGlyphIndex / 4.0) / txCols)
4577);
4578vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);
4579vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);
4580`,wX=`
4581uniform sampler2D uTroikaSDFTexture;
4582uniform vec2 uTroikaSDFTextureSize;
4583uniform float uTroikaSDFGlyphSize;
4584uniform float uTroikaSDFExponent;
4585uniform float uTroikaEdgeOffset;
4586uniform float uTroikaFillOpacity;
4587uniform float uTroikaBlurRadius;
4588uniform vec3 uTroikaStrokeColor;
4589uniform float uTroikaStrokeWidth;
4590uniform float uTroikaStrokeOpacity;
4591uniform bool uTroikaSDFDebug;
4592varying vec2 vTroikaGlyphUV;
4593varying vec4 vTroikaTextureUVBounds;
4594varying float vTroikaTextureChannel;
4595varying vec2 vTroikaGlyphDimensions;
4596
4597float troikaSdfValueToSignedDistance(float alpha) {
4598  // Inverse of exponential encoding in webgl-sdf-generator
4599  
4600  float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);
4601  float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;
4602  float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);
4603  return signedDist;
4604}
4605
4606float troikaGlyphUvToSdfValue(vec2 glyphUV) {
4607  vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);
4608  vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);
4609  float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1
4610  return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;
4611}
4612
4613float troikaGlyphUvToDistance(vec2 uv) {
4614  return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));
4615}
4616
4617float troikaGetAADist() {
4618  
4619  #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300
4620  return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;
4621  #else
4622  return vTroikaGlyphDimensions.x / 64.0;
4623  #endif
4624}
4625
4626float troikaGetFragDistValue() {
4627  vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);
4628  float distance = troikaGlyphUvToDistance(clampedGlyphUV);
4629 
4630  // Extrapolate distance when outside bounds:
4631  distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 
4632    length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);
4633
4634  
4635
4636  return distance;
4637}
4638
4639float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {
4640  #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)
4641  float alpha = step(-distanceOffset, -distance);
4642  #else
4643
4644  float alpha = smoothstep(
4645    distanceOffset + aaDist,
4646    distanceOffset - aaDist,
4647    distance
4648  );
4649  #endif
4650
4651  return alpha;
4652}
4653`,AX=`
4654float aaDist = troikaGetAADist();
4655float fragDistance = troikaGetFragDistValue();
4656float edgeAlpha = uTroikaSDFDebug ?
4657  troikaGlyphUvToSdfValue(vTroikaGlyphUV) :
4658  troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));
4659
4660#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)
4661vec4 fillRGBA = gl_FragColor;
4662fillRGBA.a *= uTroikaFillOpacity;
4663vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);
4664if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;
4665gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(
4666  -uTroikaStrokeWidth - aaDist,
4667  -uTroikaStrokeWidth + aaDist,
4668  fragDistance
4669));
4670gl_FragColor.a *= edgeAlpha;
4671#endif
4672
4673if (edgeAlpha == 0.0) {
4674  discard;
4675}
4676`;function CX(n){let e=I1(n,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new Le},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Nt(0,0,0,0)},uTroikaClipRect:{value:new Nt(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new Le},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new tt},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Et},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:EX,vertexTransform:MX,fragmentDefs:wX,fragmentColorTransform:AX,customRewriter({vertexShader:t,fragmentShader:i}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(i)&&(i=i.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(t)||(t=t.replace(mA,`uniform vec3 diffuse;
4677$&
4678vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
4679`))),{vertexShader:t,fragmentShader:i}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}var bA=new Aa({color:16777215,side:Zi,transparent:!0}),vz=8421504,yz=new mt,k1=new H,gA=new H,Uv=[],RX=new H,vA="+x+y";function _z(n){return Array.isArray(n)?n[0]:n}var wz=()=>{let n=new ln(new xo(1,1),bA);return wz=()=>n,n},Az=()=>{let n=new ln(new xo(1,1,32,1),bA);return Az=()=>n,n},DX={type:"syncstart"},UX={type:"synccomplete"},Cz=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],OX=Cz.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail"),Ov=class extends ln{constructor(){let e=new _A;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=vz,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=vA,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(DX),xz({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);let i=this._queuedSyncs;i&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{i.forEach(r=>r&&r())})),this.dispatchEvent(UX),e&&e()})))}onBeforeRender(e,t,i,r,a,o){this.sync(),a.isTroikaTextMaterial&&this._prepareForRender(a)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return CX(e)}get material(){let e=this._derivedMaterial,t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=bA.clone());if((!e||!e.isDerivedFrom(t))&&(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function i(){t.removeEventListener("dispose",i),e.dispose()})),this.hasOutline()){let i=e._outlineMtl;
4679return i||(i=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),i.isTextOutlineMaterial=!0,i.depthWrite=!1,i.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),i.dispose()})),[i,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return _z(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return _z(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){let t=e.isTextOutlineMaterial,i=e.uniforms,r=this.textRenderInfo;if(r){let{sdfTexture:l,blockBounds:c}=r;i.uTroikaSDFTexture.value=l,i.uTroikaSDFTextureSize.value.set(l.image.width,l.image.height),i.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,i.uTroikaSDFExponent.value=r.sdfExponent,i.uTroikaTotalBounds.value.fromArray(c),i.uTroikaUseGlyphColors.value=!t&&!!r.glyphColors;let f=0,d=0,m=0,p,g,y,T=0,x=0;if(t){let{outlineWidth:b,outlineOffsetX:S,outlineOffsetY:E,outlineBlur:C,outlineOpacity:D}=this;f=this._parsePercent(b)||0,d=Math.max(0,this._parsePercent(C)||0),p=D,T=this._parsePercent(S)||0,x=this._parsePercent(E)||0}else m=Math.max(0,this._parsePercent(this.strokeWidth)||0),m&&(y=this.strokeColor,i.uTroikaStrokeColor.value.set(y??vz),g=this.strokeOpacity,g==null&&(g=1)),p=this.fillOpacity;i.uTroikaEdgeOffset.value=f,i.uTroikaPositionOffset.value.set(T,x),i.uTroikaBlurRadius.value=d,i.uTroikaStrokeWidth.value=m,i.uTroikaStrokeOpacity.value=g,i.uTroikaFillOpacity.value=p??1,i.uTroikaCurveRadius.value=this.curveRadius||0;let _=this.clipRect;if(_&&Array.isArray(_)&&_.length===4)i.uTroikaClipRect.value.fromArray(_);else{let b=(this.fontSize||.1)*100;i.uTroikaClipRect.value.set(c[0]-b,c[1]-b,c[2]+b,c[3]+b)}this.geometry.applyClipRect(i.uTroikaClipRect.value)}i.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;let a=t?this.outlineColor||0:this.color;if(a==null)delete e.color;else{let l=e.hasOwnProperty("color")?e.color:e.color=new tt;(a!==l._input||typeof a=="object")&&l.set(l._input=a)}let o=this.orientation||vA;if(o!==e._orientation){let l=i.uTroikaOrient.value;o=o.replace(/[^-+xyz]/g,"");let c=o!==vA&&o.match(/^([-+])([xyz])([-+])([xyz])$/);if(c){let[,f,d,m,p]=c;k1.set(0,0,0)[d]=f==="-"?1:-1,gA.set(0,0,0)[p]=m==="-"?-1:1,yz.lookAt(RX,k1.cross(gA),gA),l.setFromMatrix4(yz)}else l.identity();e._orientation=o}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),i=t?parseFloat(t[1]):NaN;e=(isNaN(i)?0:i/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new Le){t.copy(e);let i=this.curveRadius;return i&&(t.x=Math.atan2(e.x,Math.abs(i)-Math.abs(e.z))*Math.abs(i)),t}worldPositionToTextCoords(e,t=new Le){return k1.copy(e),this.localPositionToTextCoords(this.worldToLocal(k1),t)}raycast(e,t){let{textRenderInfo:i,curveRadius:r}=this;if(i){let a=i.blockBounds,o=r?Az():wz(),l=o.geometry,{position:c,uv:f}=l.attributes;for(let d=0;d<f.count;d++){let m=a[0]+f.getX(d)*(a[2]-a[0]),p=a[1]+f.getY(d)*(a[3]-a[1]),g=0;r&&(g=r-Math.cos(m/r)*r,m=Math.sin(m/r)*r),c.setXYZ(d,m,p,g)}l.boundingSphere=this.geometry.boundingSphere,l.boundingBox=this.geometry.boundingBox,o.matrixWorld=this.matrixWorld,o.material.side=this.material.side,Uv.length=0,o.raycast(e,Uv);for(let d=0;d<Uv.length;d++)Uv[d].object=this,t.push(Uv[d])}}copy(e){let t=this.geometry;return super.copy(e),this.geometry=t,OX.forEach(i=>{this[i]=e[i]}),this}clone(){return new this.constructor().copy(this)}};Cz.forEach(n=>{let e="_private_"+n;Object.defineProperty(Ov.prototype,n,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});var RY=new bn,DY=new tt;var mp=Jr.forwardRef(({sdfGlyphSize:n=64,anchorX:e="center",anchorY:t="middle",font:i,fontSize:r=1,children:a,characters:o,onSync:l,...c},f)=>{let d=pr(({invalidate:y})=>y),[m]=Jr.useState(()=>new Ov),[p,g]=Jr.useMemo(()=>{let y=[],T="";
4679return Jr.Children.forEach(a,x=>{typeof x=="string"||typeof x=="number"?T+=x:y.push(x)}),[y,T]},[a]);return m1(()=>new Promise(y=>Tz({font:i,characters:o},y)),["troika-text",i,o]),Jr.useLayoutEffect(()=>void m.sync(()=>{d(),l&&l(m)})),Jr.useEffect(()=>()=>m.dispose(),[m]),Jr.createElement("primitive",Ka({object:m,ref:f,font:i,text:g,anchorX:e,anchorY:t,fontSize:r,sdfGlyphSize:n},c),p)});function Rz(n,e,t,i){var r;return r=class extends xi{constructor(a){super({vertexShader:e,fragmentShader:t,...a});for(let o in n)this.uniforms[o]=new Vh(n[o]),Object.defineProperty(this,o,{get(){return this.uniforms[o].value},set(l){this.uniforms[o].value=l}});this.uniforms=Zo.clone(this.uniforms),i?.(this)}},r.key=tp.generateUUID(),r}var LX=()=>parseInt(nl.replace(/\D+/g,"")),Dz=LX();var ts=gi(or());var xA=ts.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:a=!1,onChange:o,onStart:l,onEnd:c,...f},d)=>{let m=pr(D=>D.invalidate),p=pr(D=>D.camera),g=pr(D=>D.gl),y=pr(D=>D.events),T=pr(D=>D.setEvents),x=pr(D=>D.set),_=pr(D=>D.get),b=pr(D=>D.performance),S=e||p,E=i||y.connected||g.domElement,C=ts.useMemo(()=>new Av(S),[S]);return Mv(()=>{C.enabled&&C.update()},-1),ts.useEffect(()=>(a&&C.connect(a===!0?E:a),C.connect(E),()=>void C.dispose()),[a,E,t,C,m]),ts.useEffect(()=>{let D=R=>{m(),t&&b.regress(),o&&o(R)},U=R=>{l&&l(R)},w=R=>{c&&c(R)};return C.addEventListener("change",D),C.addEventListener("start",U),C.addEventListener("end",w),()=>{C.removeEventListener("start",U),C.removeEventListener("end",w),C.removeEventListener("change",D)}},[o,l,c,C,m,T]),ts.useEffect(()=>{if(n){let D=_().controls;return x({controls:C}),()=>x({controls:D})}},[n,C]),ts.createElement("primitive",Ka({ref:d,object:C,enableDamping:r},f))});var XY=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288});var qY=Math.PI*2,YY=Math.PI/2;var jY=Math.PI/180;var ZY=1/8,KY=/Mac/.test(globalThis?.navigator?.platform);var ns=gi(or());var NX=Rz({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new tt,sectionColor:new tt,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new H,worldPlanePosition:new H},`
4680    varying vec3 localPosition;
4681    varying vec4 worldPosition;
4682
4683    uniform vec3 worldCamProjPosition;
4684    uniform vec3 worldPlanePosition;
4685    uniform float fadeDistance;
4686    uniform bool infiniteGrid;
4687    uniform bool followCamera;
4688
4689    void main() {
4690      localPosition = position.xzy;
4691      if (infiniteGrid) localPosition *= 1.0 + fadeDistance;
4692      
4693      worldPosition = modelMatrix * vec4(localPosition, 1.0);
4694      if (followCamera) {
4695        worldPosition.xyz += (worldCamProjPosition - worldPlanePosition);
4696        localPosition = (inverse(modelMatrix) * worldPosition).xyz;
4697      }
4698
4699      gl_Position = projectionMatrix * viewMatrix * worldPosition;
4700    }
4701  `,`
4702    varying vec3 localPosition;
4703    varying vec4 worldPosition;
4704
4705    uniform vec3 worldCamProjPosition;
4706    uniform float cellSize;
4707    uniform float sectionSize;
4708    uniform vec3 cellColor;
4709    uniform vec3 sectionColor;
4710    uniform float fadeDistance;
4711    uniform float fadeStrength;
4712    uniform float fadeFrom;
4713    uniform float cellThickness;
4714    uniform float sectionThickness;
4715
4716    float getGrid(float size, float thickness) {
4717      vec2 r = localPosition.xz / size;
4718      vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r);
4719      float line = min(grid.x, grid.y) + 1.0 - thickness;
4720      return 1.0 - min(line, 1.0);
4721    }
4722
4723    void main() {
4724      float g1 = getGrid(cellSize, cellThickness);
4725      float g2 = getGrid(sectionSize, sectionThickness);
4726
4727      vec3 from = worldCamProjPosition*vec3(fadeFrom);
4728      float dist = distance(from, worldPosition.xyz);
4729      float d = 1.0 - min(dist / fadeDistance, 1.0);
4730      vec3 color = mix(cellColor, sectionColor, min(1.0, sectionThickness * g2));
4731
4732      gl_FragColor = vec4(color, (g1 + g2) * pow(d, fadeStrength));
4733      gl_FragColor.a = mix(0.75 * gl_FragColor.a, gl_FragColor.a, g2);
4734      if (gl_FragColor.a <= 0.0) discard;
4735
4736      #include <tonemapping_fragment>
4737      #include <${Dz>=154?"colorspace_fragment":"encodings_fragment"}>
4738    }
4739  `),SA=ns.forwardRef(({args:n,cellColor:e="#000000",sectionColor:t="#2080ff",cellSize:i=.5,sectionSize:r=1,followCamera:a=!1,infiniteGrid:o=!1,fadeDistance:l=100,fadeStrength:c=1,fadeFrom:f=1,cellThickness:d=.5,sectionThickness:m=1,side:p=Ni,...g},y)=>{wv({GridMaterial:NX});let T=ns.useRef(null);ns.useImperativeHandle(y,()=>T.current,[]);let x=new qi,_=new H(0,1,0),b=new H(0,0,0);Mv(C=>{x.setFromNormalAndCoplanarPoint(_,b).applyMatrix4(T.current.matrixWorld);let D=T.current.material,U=D.uniforms.worldCamProjPosition,w=D.uniforms.worldPlanePosition;x.projectPoint(C.camera.position,U.value),w.value.set(0,0,0).applyMatrix4(T.current.matrixWorld)});let S={cellSize:i,sectionSize:r,cellColor:e,sectionColor:t,cellThickness:d,sectionThickness:m},E={fadeDistance:l,fadeStrength:c,fadeFrom:f,infiniteGrid:o,followCamera:a};return ns.createElement("mesh",Ka({ref:T,frustumCulled:!1},g),ns.createElement("gridMaterial",Ka({transparent:!0,"extensions-derivatives":!0,side:p},S,E)),ns.createElement("planeGeometry",{args:n}))});var Ne=gi(Sv()),Uz=[{id:"studio",label:"Studio",sqft:400,w:20,d:20,h:12,stories:1,beds:0},{id:"1bed",label:"1 Bedroom",sqft:600,w:24,d:25,h:14,stories:1,beds:1},{id:"2bed",label:"2 Bedroom",sqft:1e3,w:28,d:36,h:14,stories:1,beds:2},{id:"2bed-2s",label:"2-Bed Two-Story",sqft:1200,w:24,d:25,h:24,stories:2,beds:2},{id:"garage",label:"Garage Conversion",sqft:500,w:20,d:25,h:12,stories:1,beds:1}],TA={front:15,side:4,rear:4,max_height:16};function PX(n){let e=n[0],t=e.reduce((y,T)=>y+T[1],0)/e.length,i=e.reduce((y,T)=>y+T[0],0)/e.length,r=111320,a=111320*Math.cos(t*Math.PI/180),o=3.28084,l=e.map(([y,T])=>({x:(y-i)*a*o,z:-(T-t)*r*o})),c=l.map(y=>y.x),f=l.map(y=>y.z),d=Math.min(...c),m=Math.max(...c),p=Math.min(...f),g=Math.max(...f);return{pts:l,w:m-d,d:g-p,cx:(d+m)/2,cz:(p+g)/2,minX:d,maxX:m,minZ:p,maxZ:g}}function IX({lot:n}){let{camera:e}=pr();return(0,hn.useEffect)(()=>{let t=Math.max(n.w,n.d)*.9;e.position.set(n.cx+t*.5,t*.6,n.cz+t*.7),e.lookAt(n.cx,0,n.cz),e.updateProjectionMatrix()},[n,e]),null}function zX({preset:n,position:e,rotation:t=0,draggable:i,onDrag:r,onDragStart:a,onDragEnd:o}){let l=n.h,c=n.stories===2?6:4,[f,d]=(0,hn.useState)(!1),[m,p]=(0,hn.useState)(!1),g=(0,hn.useMemo)(()=>new qi(new H(0,1,0),0),[]),y=(0,hn.useMemo)(()=>new H,[]),T=(0,hn.useCallback)(b=>{i&&(b.stopPropagation(),p(!0),a?.())},[i,a]),x=(0,hn.useCallback)(b=>{if(!m||!r)return;b.stopPropagation(),b.ray?.intersectPlane(g,y)&&r(y.x,y.z)},[m,r,g,y]),_=(0,hn.useCallback)(()=>{m&&(p(!1),o?.())},[m,o]);return(0,Ne.jsxs)("group",{position:e,rotation:[0,-t,0],onPointerDown:T,onPointerMove:x,onPointerUp:_,onPointerOver:()=>i&&d(!0),onPointerOut:()=>d(!1),children:[i&&f&&!m&&(0,Ne.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.3,0],children:[(0,Ne.jsx)("ringGeometry",{args:[Math.max(n.w,n.d)*.6,Math.max(n.w,n.d)*.65,32]}),(0,Ne.jsx)("meshBasicMaterial",{color:"#44ff88",transparent:!0,opacity:.5})]}),(0,Ne.jsxs)("mesh",{position:[0,.25,0],children:[(0,Ne.jsx)("boxGeometry",{args:[n.w,.5,n.d]}),(0,Ne.jsx)("meshStandardMaterial",{color:m?"#aaa":"#888"})]}),(0,Ne.jsxs)("mesh",{position:[0,l/2+.5,0],castShadow:!0,children:[(0,Ne.jsx)("boxGeometry",{args:[n.w,l,n.d]}),(0,Ne.jsx)("meshStandardMaterial",{color:f?"#fff":"#f5f0e8"})]}),(0,Ne.jsxs)("mesh",{position:[0,l+.5+c/2,0],castShadow:!0,rotation:[0,Math.PI/2,0],children:[(0,Ne.jsx)("cylinderGeometry",{args:[0,n.w*.55,c,4,1]}),(0,Ne.jsx)("meshStandardMaterial",{color:"#6b4c3b"})]}),(0,Ne.jsxs)("mesh",{position:[0,4,n.d/2+.05],children:[(0,Ne.jsx)("planeGeometry",{args:[3.5,7.5]}),(0,Ne.jsx)("meshStandardMaterial",{color:"#4a3520"})]}),n.sqft>=600&&(0,Ne.jsxs)(Ne.Fragment,{children:[(0,Ne.jsxs)("mesh",{position:[-n.w/3,l*.55,n.d/2+.05],children:[(0,Ne.jsx)("planeGeometry",{args:[4,4]}),(0,Ne.jsx)("meshStandardMaterial",{color:"#88bbdd",transparent:!0,opacity:.7})]}),(0,Ne.jsxs)("mesh",{position:[n.w/3,l*.55,n.d/2+.05],children:[(0,Ne.jsx)("planeGeometry",{args:[4,4]}),(0,Ne.jsx)("meshStandardMaterial",{color:"#88bbdd",transparent:!0,opacity:.7})]})]}),(0,Ne.jsx)(mp,{position:[0,l+c+4,0],fontSize:Math.max(n.w*.2,3),color:m?"#ffff44":"#44ff88",anchorX:"center",anchorY:"bottom",outlineWidth:.15,outlineColor:"#000",children:m?"Drop to place":`${n.label} \xB7 ${n.sqft} sf`})]})}function kX({lot:n,setbacks:e,frontIdx:t,sides:i}){return(0,Ne.jsx)("group",{children:i.map((r,a)=>{let o=a===t,l=a===i.reduce((d,m,p)=>
4739{if(p===t)return d;let g=Math.sqrt((m.midX-i[t].midX)**2+(m.midZ-i[t].midZ)**2),y=Math.sqrt((i[d]?.midX-i[t]?.midX)**2+(i[d]?.midZ-i[t]?.midZ)**2);return g>y?p:d},i.findIndex((d,m)=>m!==t)),c=o?e.front:l?e.rear:e.side,f=o?"#ff4444":l?"#ff8844":"#ffaa44";return r.edges.map((d,m)=>{let p=d.end.x-d.start.x,g=d.end.z-d.start.z;if(Math.sqrt(p*p+g*g)<.5)return null;let T=d.inwardNx,x=d.inwardNz,_=new Ma;return _.moveTo(d.start.x,-d.start.z),_.lineTo(d.end.x,-d.end.z),_.lineTo(d.end.x+T*c,-(d.end.z+x*c)),_.lineTo(d.start.x+T*c,-(d.start.z+x*c)),_.closePath(),(0,Ne.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.1,0],children:[(0,Ne.jsx)("shapeGeometry",{args:[_]}),(0,Ne.jsx)("meshBasicMaterial",{color:f,transparent:!0,opacity:.15,side:Zi,depthWrite:!1})]},`${a}-${m}`)})})})}function FX(n){let e=n.reduce((c,f)=>c+f.x,0)/n.length,t=n.reduce((c,f)=>c+f.z,0)/n.length,i=n.map((c,f)=>{let d=n[(f+1)%n.length],m=d.x-c.x,p=d.z-c.z,g=Math.sqrt(m*m+p*p),y=(c.x+d.x)/2,T=(c.z+d.z)/2,x=Math.atan2(p,m),_=-p/g,b=m/g,S=_*(e-y)+b*(t-T);return{start:c,end:d,len:g,midX:y,midZ:T,angle:x,inwardNx:S>0?_:-_,inwardNz:S>0?b:-b}}),r=(c,f)=>{let d=Math.abs(c-f)%Math.PI;return Math.min(d,Math.PI-d)},a=[],o=[i[0]];for(let c=1;c<i.length;c++)r(i[c].angle,o[0].angle)<.35?o.push(i[c]):(a.push(l(o)),o=[i[c]]);a.length>0&&r(o[0].angle,a[0].edges[0].angle)<.35?a[0]=l([...o,...a[0].edges]):a.push(l(o));function l(c){let f=c.reduce((T,x)=>T+x.len,0),d=c.reduce((T,x)=>T+x.midX*x.len,0)/f,m=c.reduce((T,x)=>T+x.midZ*x.len,0)/f,p=c.reduce((T,x)=>T+x.inwardNx*x.len,0)/f,g=c.reduce((T,x)=>T+x.inwardNz*x.len,0)/f,y=Math.sqrt(p*p+g*g)||1;return{edges:c,totalLen:f,angle:c[0].angle,midX:d,midZ:m,inwardNx:p/y,inwardNz:g/y}}return a.length>=3?a:i.map(c=>l([c]))}function BX(n,e,t){if(t!=null&&t<n.length)return t;if(e){let r=0,a=1/0;return n.forEach((o,l)=>{let c=Math.sqrt((o.midX-e.x)**2+(o.midZ-e.z)**2);c<a&&(a=c,r=l)}),r}return n.map((r,a)=>({s:r,i:a})).sort((r,a)=>r.s.totalLen-a.s.totalLen)[0].i}function HX(n,e,t,i,r){let a=n.pts,o=(x,_)=>{let b=!1;for(let S=0,E=a.length-1;S<a.length;E=S++){let{x:C,z:D}=a[S],{x:U,z:w}=a[E];D>_!=w>_&&x<(U-C)*(_-D)/(w-D)+C&&(b=!b)}return b},l=a.reduce((x,_)=>x+_.x,0)/a.length,c=a.reduce((x,_)=>x+_.z,0)/a.length,f=e[t],d=e.reduce((x,_,b)=>{if(b===t)return x;let S=Math.sqrt((_.midX-f.midX)**2+(_.midZ-f.midZ)**2),E=x?Math.sqrt((x.midX-f.midX)**2+(x.midZ-f.midZ)**2):0;return S>E?_:x},null)||f,m=r.w/2,p=r.d/2,g=i.rear+p,y=d.angle,T=(x,_,b)=>{let S=Math.cos(b),E=Math.sin(b);return[[-m,-p],[m,-p],[m,p],[-m,p]].every(([C,D])=>o(x+C*S-D*E,_+C*E+D*S))};for(let x of[1,1.5,2,2.5]){let _=d.midX+d.inwardNx*g*x,b=d.midZ+d.inwardNz*g*x;for(let S=0;S<=.4;S+=.05)for(let E of[1,-1]){let C=d.edges[0],D=_+(C.end.x-C.start.x)*S*E,U=b+(C.end.z-C.start.z)*S*E;if(T(D,U,y))return{x:D,z:U,rot:y}}}return{x:l,z:c,rot:0}}function VX({geometry:n,zoneRules:e,preset:t,showSetbacks:i,showADU:r,showLabels:a,aduOverride:o,onADUMove:l,rotationOffset:c,frontPoint:f,frontSideIndex:d,onFrontSideChange:m}){let[p,g]=(0,hn.useState)(!1),y=(0,hn.useMemo)(()=>PX(n.coordinates),[n]),T=(0,hn.useMemo)(()=>({front:e?.front_setback??TA.front,side:e?.side_setback??TA.side,rear:e?.rear_setback??TA.rear}),[e]),x=(0,hn.useMemo)(()=>{let R=new Ma;R.moveTo(y.pts[0].x,-y.pts[0].z);for(let L=1;L<y.pts.length;L++)R.lineTo(y.pts[L].x,-y.pts[L].z);return R.closePath(),R},[y]),_=(0,hn.useMemo)(()=>{let R=y.pts.map(L=>[L.x,.1,L.z]);return R.push(R[0]),R},[y]),b=(0,hn.useMemo)(()=>FX(y.pts),[y]),S=(0,hn.useMemo)(()=>BX(b,f,d),[b,f,d]),E=(0,hn.useMemo)(()=>HX(y,b,S,T,t),[y,b,S,T,t]),C=o?[o.x,0,o.z]:[E.x,0,E.z],D=o?o.rot:E.rot,U=D+(c||0),w=Math.max(y.w,y.d)*.03;return(0,Ne.jsxs)(Ne.Fragment,{children:[(0,Ne.jsx)(IX,{lot:y}),(0,Ne.jsx)(xA,{makeDefault:!0,enabled:!p,maxPolarAngle:Math.PI/2.1,minDistance:20,maxDistance:Math.max(y.w,y.d)*3,target:[y.cx,0,y.cz]}),(0,Ne.jsx)("ambientLight",{intensity:.6}),(0,Ne.jsx)("directionalLight",{position:[y.cx+80,120,y.cz+40],intensity:1.5,castShadow:!0}),(0,Ne.jsx)("hemisphereLight",{args:["#b1e1ff","#557755",.3]}),(0,Ne.jsx)(SA,{position:[y.cx,-.02,y.cz],args:[500,500],cellSize:10,
4739cellThickness:.4,cellColor:"#2a2a2a",sectionSize:50,sectionThickness:.8,sectionColor:"#3a3a3a",fadeDistance:400,infiniteGrid:!0}),(0,Ne.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[y.cx,-.2,y.cz],children:[(0,Ne.jsx)("planeGeometry",{args:[y.w*4,y.d*4]}),(0,Ne.jsx)("meshStandardMaterial",{color:"#1a2610"})]}),(0,Ne.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.05,0],children:[(0,Ne.jsx)("shapeGeometry",{args:[x]}),(0,Ne.jsx)("meshStandardMaterial",{color:"#3d6b1e",side:Zi,depthWrite:!1})]}),b.map((R,L)=>{let I=L===S,z=[];return R.edges.forEach(B=>{z.length||z.push([B.start.x,.2,B.start.z]),z.push([B.end.x,.2,B.end.z])}),(0,Ne.jsxs)("group",{children:[(0,Ne.jsx)(cA,{points:z,color:I?"#4488ff":"white",lineWidth:I?5:2}),z.slice(0,-1).map((B,V)=>{let W=z[V+1],X=(B[0]+W[0])/2,K=(B[2]+W[2])/2,pe=W[0]-B[0],Q=W[2]-B[2],ee=Math.sqrt(pe*pe+Q*Q);return(0,Ne.jsxs)("mesh",{position:[X,2,K],rotation:[0,Math.atan2(pe,Q),0],onClick:G=>{G.stopPropagation(),m?.(L)},onPointerOver:G=>{G.stopPropagation(),document.body.style.cursor="pointer"},onPointerOut:()=>document.body.style.cursor="auto",children:[(0,Ne.jsx)("boxGeometry",{args:[4,6,ee]}),(0,Ne.jsx)("meshBasicMaterial",{transparent:!0,opacity:0})]},V)}),I&&(0,Ne.jsx)(mp,{position:[R.midX-R.inwardNx*8,2,R.midZ-R.inwardNz*8],fontSize:Math.max(y.w,y.d)*.025,color:"#4488ff",anchorX:"center",outlineWidth:.2,outlineColor:"#000",children:"STREET"})]},`side-${L}`)}),i&&(0,Ne.jsx)(kX,{lot:y,setbacks:T,frontIdx:S,sides:b}),r&&(0,Ne.jsx)(zX,{preset:t,position:C,rotation:U,draggable:!0,onDrag:(R,L)=>l?.({x:R,z:L,rot:D}),onDragStart:()=>g(!0),onDragEnd:()=>g(!1)}),a&&(0,Ne.jsxs)(Ne.Fragment,{children:[(0,Ne.jsx)(mp,{position:[y.cx,1,y.maxZ+w*3],fontSize:w,color:"#fff",anchorX:"center",outlineWidth:w*.05,outlineColor:"#000",children:`${Math.round(y.w)}' wide`}),(0,Ne.jsx)(mp,{position:[y.maxX+w*3,1,y.cz],fontSize:w,color:"#fff",anchorX:"center",rotation:[0,-Math.PI/2,0],outlineWidth:w*.05,outlineColor:"#000",children:`${Math.round(y.d)}' deep`})]})]})}function Oz({parcelData:n,zoneRules:e}){let[t,i]=(0,hn.useState)(Uz[1]),[r,a]=(0,hn.useState)(!0),[o,l]=(0,hn.useState)(!0),[c,f]=(0,hn.useState)(!0),[d,m]=(0,hn.useState)(null),[p,g]=(0,hn.useState)(0),[y,T]=(0,hn.useState)(null),[x,_]=(0,hn.useState)(null);return(0,hn.useEffect)(()=>{if(n.geocode_lat&&n.geocode_lon&&n.geometry?.coordinates){let b=n.geometry.coordinates[0],S=b.reduce((w,R)=>w+R[1],0)/b.length,E=b.reduce((w,R)=>w+R[0],0)/b.length,C=111320,D=111320*Math.cos(S*Math.PI/180),U=3.28084;T({x:(n.geocode_lon-E)*D*U,z:-(n.geocode_lat-S)*C*U})}},[n]),n.geometry?.coordinates?(0,Ne.jsxs)("div",{style:{display:"flex",height:"100%",background:"#0a0a0a",color:"#fff",fontFamily:"Helvetica Neue, Helvetica, Arial, sans-serif"},children:[(0,Ne.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,Ne.jsx)(jI,{shadows:!0,gl:{antialias:!0,toneMapping:Lu},camera:{fov:45,near:.1,far:5e3},style:{width:"100%",height:"100%",background:"#0a0a0a"},children:(0,Ne.jsx)(VX,{geometry:n.geometry,zoneRules:e,preset:t,showSetbacks:r,showADU:o,showLabels:c,aduOverride:d,onADUMove:m,rotationOffset:p*Math.PI/180,frontPoint:y,frontSideIndex:x,onFrontSideChange:b=>{_(b),m(null)}})}),(0,Ne.jsx)("div",{style:{position:"absolute",bottom:12,left:12,fontSize:10,opacity:.2},children:"Drag to orbit \xB7 Scroll to zoom \xB7 Click edge = set street \xB7 Drag ADU to move"})]}),(0,Ne.jsxs)("div",{style:{width:260,borderLeft:"1px solid rgba(255,255,255,0.08)",overflowY:"auto",fontSize:12},children:[(0,Ne.jsxs)("div",{style:{padding:"14px 12px",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[(0,Ne.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.15em",opacity:.3,marginBottom:8},children:"Property"}),(0,Ne.jsx)("p",{style:{fontWeight:600,fontSize:13,marginBottom:4},children:n.full_address}),(0,Ne.jsxs)("p",{style:{opacity:.4,marginBottom:6},children:[n.county," County"]}),(0,Ne.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.3},children:"Lot"}),(0,Ne.jsxs)("p",{style:{fontWeight:600}
4739,children:[Math.round(n.lot_area_sqft).toLocaleString()," sf"]})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.3},children:"Points"}),(0,Ne.jsx)("p",{style:{fontWeight:600},children:n.geometry.coordinates[0].length})]})]})]}),(0,Ne.jsxs)("div",{style:{padding:"14px 12px",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[(0,Ne.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.15em",opacity:.3,marginBottom:8},children:e?"Zone Rules":"Default Setbacks (CA)"}),(0,Ne.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.3},children:"Front"}),(0,Ne.jsxs)("p",{style:{fontWeight:600,color:"#ff4444"},children:[e?.front_setback??15,"'"]})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.3},children:"Side"}),(0,Ne.jsxs)("p",{style:{fontWeight:600,color:"#ffaa44"},children:[e?.side_setback??4,"'"]})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.3},children:"Rear"}),(0,Ne.jsxs)("p",{style:{fontWeight:600,color:"#ff8844"},children:[e?.rear_setback??4,"'"]})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.3},children:"Height"}),(0,Ne.jsxs)("p",{style:{fontWeight:600},children:[e?.max_height??16,"'"]})]})]})]}),(0,Ne.jsxs)("div",{style:{padding:"14px 12px",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[(0,Ne.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.15em",opacity:.3,marginBottom:8},children:"ADU Type"}),Uz.map(b=>(0,Ne.jsxs)("button",{onClick:()=>i(b),style:{display:"flex",justifyContent:"space-between",width:"100%",padding:"7px 8px",marginBottom:3,background:t.id===b.id?"rgba(68,255,136,0.1)":"rgba(255,255,255,0.03)",border:t.id===b.id?"1px solid rgba(68,255,136,0.3)":"1px solid rgba(255,255,255,0.06)",color:"#fff",cursor:"pointer",fontSize:12},children:[(0,Ne.jsx)("span",{style:{fontWeight:t.id===b.id?700:400},children:b.label}),(0,Ne.jsxs)("span",{style:{opacity:.4},children:[b.sqft," sf"]})]},b.id))]}),(0,Ne.jsxs)("div",{style:{padding:"14px 12px",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[(0,Ne.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.15em",opacity:.3,marginBottom:8},children:"Rotation"}),(0,Ne.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,Ne.jsx)("input",{type:"range",min:0,max:360,step:5,value:p,onChange:b=>g(+b.target.value),style:{flex:1,accentColor:"#44ff88"}}),(0,Ne.jsxs)("span",{style:{fontWeight:600,width:36,textAlign:"right"},children:[p,"\xB0"]})]}),(0,Ne.jsx)("div",{style:{display:"flex",gap:4,marginTop:6},children:[0,90,180,270].map(b=>(0,Ne.jsxs)("button",{onClick:()=>g(b),style:{flex:1,padding:"4px",fontSize:10,cursor:"pointer",color:"#fff",background:p===b?"rgba(68,255,136,0.1)":"rgba(255,255,255,0.03)",border:p===b?"1px solid rgba(68,255,136,0.3)":"1px solid rgba(255,255,255,0.06)"},children:[b,"\xB0"]},b))})]}),(0,Ne.jsxs)("div",{style:{padding:"14px 12px",borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[(0,Ne.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.15em",opacity:.3,marginBottom:8},children:"Display"}),(0,Ne.jsx)("p",{style:{fontSize:10,opacity:.3,marginBottom:6},children:"Click any lot edge to set as street."}),(d||x!=null)&&(0,Ne.jsxs)("div",{style:{display:"flex",gap:4,marginBottom:8},children:[d&&(0,Ne.jsx)("button",{onClick:()=>m(null),style:{flex:1,padding:"5px",fontSize:10,cursor:"pointer",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"#ffaa44"},children:"\u21BA Reset Position"}),x!=null&&(0,Ne.jsx)("button",{onClick:()=>{_(null),m(null)},style:{flex:1,padding:"5px",fontSize:10,cursor:"pointer",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"#4488ff"},children:"\u21BA Reset Front"})]}),[["Setbacks",r,a],["ADU",o,l],["Labels",c,f]].map(([b,S,E])=>(0,Ne.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"3px 0",cursor:"pointer"},children:[(0,Ne.jsx)("div",{onClick:()=>E(!S),style:{width:32,height:18,borderRadius:9,position:"relative",background:S?"rgba(68,255,136,0.3)":"rgba(255,255,255,0.1)",transition:"background 0.2s"},children:(0,Ne.jsx)("div",{style:{width:14,height:14,borderRadius:7,position:"absolute",top:2,left:S?16:2,background:S?"#44ff88":"#666",transition:"left 0.2s"}})}),(0,Ne.jsx)("span",{style:{opacity:S?.8:.35},children:b})]},b))]}),(0,Ne.jsxs)("div",{style:{padding:"14px 12px"},children:[(0,Ne.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.15em",opacity:.3,marginBottom:8},children:"ADU Summary"}),(0,Ne.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6,opacity:.6},children:[(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.5},children:"Size"}),(0,Ne.jsxs)("p",{children:[t.sqft," sf (",t.w,"' \xD7 ",t.d,"')"]})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.5},children:"Height"}),(0,Ne.jsxs)("p",{children:[t.h,"' (",t.stories," story)"]})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.5},children:"Beds"}),(0,Ne.jsx)("p",{children:t.beds})]}),(0,Ne.jsxs)("div",{children:[(0,Ne.jsx)("span",{style:{opacity:.5},children:"Coverage"}),(0,Ne.jsxs)("p",{children:[(t.w*t.d/n.lot_area_sqft*100).toFixed(1),"%"]})]})]})]})]})]}):(0,Ne.jsx)("div",{style:{color:"#fff",padding:40},children:"No parcel geometry available."})}var GX={mounted(){let n=JSON.parse(this.el.dataset.parcel),e=this.el.dataset.zoneRules?JSON.parse(this.el.dataset.zoneRules):null;this._root=(0,Lz.createRoot)(this.el),this._root.render((0,Ne.jsx)(Oz,{parcelData:n,zoneRules:e}))},updated(){let n=JSON.parse(this.el.dataset.parcel),e=this.el.dataset.zoneRules?JSON.parse(this.el.dataset.zoneRules):null;this._root.render((0,Ne.jsx)(Oz,{parcelData:n,zoneRules:e}))},destroyed(){this._root?.unmount()}};window.__EDITOR_3D_HOOK__=GX;})();
4740/*! Bundled license information:
4741
4742react/cjs/react.production.js:
4743  (**
4744   * @license React
4745   * react.production.js
4746   *
4747   * Copyright (c) Meta Platforms, Inc. and affiliates.
4748   *
4749   * This source code is licensed under the MIT license found in the
4750   * LICENSE file in the root directory of this source tree.
4751   *)
4752
4753scheduler/cjs/scheduler.production.js:
4754  (**
4755   * @license React
4756   * scheduler.production.js
4757   *
4758   * Copyright (c) Meta Platforms, Inc. and affiliates.
4759   *
4760   * This source code is licensed under the MIT license found in the
4761   * LICENSE file in the root directory of this source tree.
4762   *)
4763
4764react-dom/cjs/react-dom.production.js:
4765  (**
4766   * @license React
4767   * react-dom.production.js
4768   *
4769   * Copyright (c) Meta Platforms, Inc. and affiliates.
4770   *
4771   * This source code is licensed under the MIT license found in the
4772   * LICENSE file in the root directory of this source tree.
4773   *)
4774
4775react-dom/cjs/react-dom-client.production.js:
4776  (**
4777   * @license React
4778   * react-dom-client.production.js
4779   *
4780   * Copyright (c) Meta Platforms, Inc. and affiliates.
4781   *
4782   * This source code is licensed under the MIT license found in the
4783   * LICENSE file in the root directory of this source tree.
4784   *)
4785
4786use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
4787  (**
4788   * @license React
4789   * use-sync-external-store-shim.production.js
4790   *
4791   * Copyright (c) Meta Platforms, Inc. and affiliates.
4792   *
4793   * This source code is licensed under the MIT license found in the
4794   * LICENSE file in the root directory of this source tree.
4795   *)
4796
4797use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js:
4798  (**
4799   * @license React
4800   * use-sync-external-store-shim/with-selector.production.js
4801   *
4802   * Copyright (c) Meta Platforms, Inc. and affiliates.
4803   *
4804   * This source code is licensed under the MIT license found in the
4805   * LICENSE file in the root directory of this source tree.
4806   *)
4807
4808react/cjs/react-jsx-runtime.production.js:
4809  (**
4810   * @license React
4811   * react-jsx-runtime.production.js
4812   *
4813   * Copyright (c) Meta Platforms, Inc. and affiliates.
4814   *
4815   * This source code is licensed under the MIT license found in the
4816   * LICENSE file in the root directory of this source tree.
4817   *)
4818
4819three/build/three.core.js:
4820three/build/three.module.js:
4821  (**
4822   * @license
4823   * Copyright 2010-2026 Three.js Authors
4824   * SPDX-License-Identifier: MIT
4825   *)
4826
4827@react-three/fiber/dist/events-5a94e5eb.esm.js:
4828  (**
4829   * @license React
4830   * react-reconciler-constants.production.js
4831   *
4832   * Copyright (c) Meta Platforms, Inc. and affiliates.
4833   *
4834   * This source code is licensed under the MIT license found in the
4835   * LICENSE file in the root directory of this source tree.
4836   *)
4837  (**
4838  * @license React
4839  * react-reconciler.production.js
4840  *
4841  * Copyright (c) Meta Platforms, Inc. and affiliates.
4842  *
4843  * This source code is licensed under the MIT license found in the
4844  * LICENSE file in the root directory of this source tree.
4845  *)
4846  (**
4847  * @license React
4848  * react-reconciler.development.js
4849  *
4850  * Copyright (c) Meta Platforms, Inc. and affiliates.
4851  *
4852  * This source code is licensed under the MIT license found in the
4853  * LICENSE file in the root directory of this source tree.
4854  *)
4855
4856troika-three-text/dist/troika-three-text.esm.js:
4857  (*!
4858  Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering.
4859  Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE
4860  *)
4861  (*!
4862  Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate
4863  (https://github.com/101arrowz/fflate) for use in Troika text rendering. 
4864  Original licenses apply: 
4865  - fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT)
4866  - woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2)
4867  *)
4868  (*!
4869  Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver)
4870  for use in Troika text rendering. 
4871  Original MIT license applies
4872  *)
4873
4874camera-controls/dist/camera-controls.module.js:
4875  (*!
4876   * camera-controls
4877   * https://github.com/yomotsu/camera-controls
4878   * (c) 2017 @yomotsu
4879   * Released under the MIT License.
4880   *)
4881*/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.