tokentracker-cli 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/{DashboardPage-DS1P0Mo_.js → DashboardPage-DEZCzCqB.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-DrN-vtKo.js → LeaderboardPage-BaHIGvSw.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfilePage-CBYJri8H.js → LeaderboardProfilePage-BCvKUQ4z.js} +1 -1
- package/dashboard/dist/assets/{ThemeToggle-Cv3W_rFS.js → ThemeToggle-BVMjkcsk.js} +1 -1
- package/dashboard/dist/assets/{leaderboard-columns-hzLR05GY.js → leaderboard-columns-BvsbuvV1.js} +1 -1
- package/dashboard/dist/assets/{main-DvYXwZBy.js → main-Cs8rK2ak.js} +13 -13
- package/dashboard/dist/index.html +1 -1
- package/dashboard/dist/share.html +1 -1
- package/package.json +1 -1
- package/src/lib/local-api.js +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-
|
|
2
|
-
function i2(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function P1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r2(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var mm={exports:{}},Lc={},gm={exports:{}},Jt={};var xb;function s2(){if(xb)return Jt;xb=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=p&&z[p]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function y(z,ie,ve){this.props=z,this.context=ie,this.refs=w,this.updater=ve||v}y.prototype.isReactComponent={},y.prototype.setState=function(z,ie){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,ie,"setState")},y.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function x(){}x.prototype=y.prototype;function M(z,ie,ve){this.props=z,this.context=ie,this.refs=w,this.updater=ve||v}var A=M.prototype=new x;A.constructor=M,_(A,y.prototype),A.isPureReactComponent=!0;var T=Array.isArray,D=Object.prototype.hasOwnProperty,I={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function S(z,ie,ve){var Ee,Ue={},le=null,be=null;if(ie!=null)for(Ee in ie.ref!==void 0&&(be=ie.ref),ie.key!==void 0&&(le=""+ie.key),ie)D.call(ie,Ee)&&!U.hasOwnProperty(Ee)&&(Ue[Ee]=ie[Ee]);var Se=arguments.length-2;if(Se===1)Ue.children=ve;else if(1<Se){for(var Ne=Array(Se),et=0;et<Se;et++)Ne[et]=arguments[et+2];Ue.children=Ne}if(z&&z.defaultProps)for(Ee in Se=z.defaultProps,Se)Ue[Ee]===void 0&&(Ue[Ee]=Se[Ee]);return{$$typeof:t,type:z,key:le,ref:be,props:Ue,_owner:I.current}}function R(z,ie){return{$$typeof:t,type:z.type,key:ie,ref:z.ref,props:z.props,_owner:z._owner}}function H(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function F(z){var ie={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(ve){return ie[ve]})}var W=/\/+/g;function X(z,ie){return typeof z=="object"&&z!==null&&z.key!=null?F(""+z.key):ie.toString(36)}function V(z,ie,ve,Ee,Ue){var le=typeof z;(le==="undefined"||le==="boolean")&&(z=null);var be=!1;if(z===null)be=!0;else switch(le){case"string":case"number":be=!0;break;case"object":switch(z.$$typeof){case t:case e:be=!0}}if(be)return be=z,Ue=Ue(be),z=Ee===""?"."+X(be,0):Ee,T(Ue)?(ve="",z!=null&&(ve=z.replace(W,"$&/")+"/"),V(Ue,ie,ve,"",function(et){return et})):Ue!=null&&(H(Ue)&&(Ue=R(Ue,ve+(!Ue.key||be&&be.key===Ue.key?"":(""+Ue.key).replace(W,"$&/")+"/")+z)),ie.push(Ue)),1;if(be=0,Ee=Ee===""?".":Ee+":",T(z))for(var Se=0;Se<z.length;Se++){le=z[Se];var Ne=Ee+X(le,Se);be+=V(le,ie,ve,Ne,Ue)}else if(Ne=m(z),typeof Ne=="function")for(z=Ne.call(z),Se=0;!(le=z.next()).done;)le=le.value,Ne=Ee+X(le,Se++),be+=V(le,ie,ve,Ne,Ue);else if(le==="object")throw ie=String(z),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.");return be}function q(z,ie,ve){if(z==null)return z;var Ee=[],Ue=0;return V(z,Ee,"","",function(le){return ie.call(ve,le,Ue++)}),Ee}function J(z){if(z._status===-1){var ie=z._result;ie=ie(),ie.then(function(ve){(z._status===0||z._status===-1)&&(z._status=1,z._result=ve)},function(ve){(z._status===0||z._status===-1)&&(z._status=2,z._result=ve)}),z._status===-1&&(z._status=0,z._result=ie)}if(z._status===1)return z._result.default;throw z._result}var Q={current:null},$={transition:null},Y={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:$,ReactCurrentOwner:I};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Jt.Children={map:q,forEach:function(z,ie,ve){q(z,function(){ie.apply(this,arguments)},ve)},count:function(z){var ie=0;return q(z,function(){ie++}),ie},toArray:function(z){return q(z,function(ie){return ie})||[]},only:function(z){if(!H(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Jt.Component=y,Jt.Fragment=n,Jt.Profiler=r,Jt.PureComponent=M,Jt.StrictMode=i,Jt.Suspense=u,Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Jt.act=Z,Jt.cloneElement=function(z,ie,ve){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var Ee=_({},z.props),Ue=z.key,le=z.ref,be=z._owner;if(ie!=null){if(ie.ref!==void 0&&(le=ie.ref,be=I.current),ie.key!==void 0&&(Ue=""+ie.key),z.type&&z.type.defaultProps)var Se=z.type.defaultProps;for(Ne in ie)D.call(ie,Ne)&&!U.hasOwnProperty(Ne)&&(Ee[Ne]=ie[Ne]===void 0&&Se!==void 0?Se[Ne]:ie[Ne])}var Ne=arguments.length-2;if(Ne===1)Ee.children=ve;else if(1<Ne){Se=Array(Ne);for(var et=0;et<Ne;et++)Se[et]=arguments[et+2];Ee.children=Se}return{$$typeof:t,type:z.type,key:Ue,ref:le,props:Ee,_owner:be}},Jt.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:s,_context:z},z.Consumer=z},Jt.createElement=S,Jt.createFactory=function(z){var ie=S.bind(null,z);return ie.type=z,ie},Jt.createRef=function(){return{current:null}},Jt.forwardRef=function(z){return{$$typeof:c,render:z}},Jt.isValidElement=H,Jt.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:J}},Jt.memo=function(z,ie){return{$$typeof:f,type:z,compare:ie===void 0?null:ie}},Jt.startTransition=function(z){var ie=$.transition;$.transition={};try{z()}finally{$.transition=ie}},Jt.unstable_act=Z,Jt.useCallback=function(z,ie){return Q.current.useCallback(z,ie)},Jt.useContext=function(z){return Q.current.useContext(z)},Jt.useDebugValue=function(){},Jt.useDeferredValue=function(z){return Q.current.useDeferredValue(z)},Jt.useEffect=function(z,ie){return Q.current.useEffect(z,ie)},Jt.useId=function(){return Q.current.useId()},Jt.useImperativeHandle=function(z,ie,ve){return Q.current.useImperativeHandle(z,ie,ve)},Jt.useInsertionEffect=function(z,ie){return Q.current.useInsertionEffect(z,ie)},Jt.useLayoutEffect=function(z,ie){return Q.current.useLayoutEffect(z,ie)},Jt.useMemo=function(z,ie){return Q.current.useMemo(z,ie)},Jt.useReducer=function(z,ie,ve){return Q.current.useReducer(z,ie,ve)},Jt.useRef=function(z){return Q.current.useRef(z)},Jt.useState=function(z){return Q.current.useState(z)},Jt.useSyncExternalStore=function(z,ie,ve){return Q.current.useSyncExternalStore(z,ie,ve)},Jt.useTransition=function(){return Q.current.useTransition()},Jt.version="18.3.1",Jt}var bb;function Rv(){return bb||(bb=1,gm.exports=s2()),gm.exports}var Sb;function a2(){if(Sb)return Lc;Sb=1;var t=Rv(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,f){var h,p={},m=null,v=null;f!==void 0&&(m=""+f),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)i.call(u,h)&&!s.hasOwnProperty(h)&&(p[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:e,type:c,key:m,ref:v,props:p,_owner:r.current}}return Lc.Fragment=n,Lc.jsx=o,Lc.jsxs=o,Lc}var wb;function o2(){return wb||(wb=1,mm.exports=a2()),mm.exports}var B=o2(),N=Rv();const Gl=P1(N),k1=i2({__proto__:null,default:Gl},[N]);var Id={},vm={exports:{}},Vi={},ym={exports:{}},_m={};var Eb;function l2(){return Eb||(Eb=1,(function(t){function e($,Y){var Z=$.length;$.push(Y);e:for(;0<Z;){var z=Z-1>>>1,ie=$[z];if(0<r(ie,Y))$[z]=Y,$[Z]=ie,Z=z;else break e}}function n($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var Y=$[0],Z=$.pop();if(Z!==Y){$[0]=Z;e:for(var z=0,ie=$.length,ve=ie>>>1;z<ve;){var Ee=2*(z+1)-1,Ue=$[Ee],le=Ee+1,be=$[le];if(0>r(Ue,Z))le<ie&&0>r(be,Ue)?($[z]=be,$[le]=Z,z=le):($[z]=Ue,$[Ee]=Z,z=Ee);else if(le<ie&&0>r(be,Z))$[z]=be,$[le]=Z,z=le;else break e}}return Y}function r($,Y){var Z=$.sortIndex-Y.sortIndex;return Z!==0?Z:$.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var u=[],f=[],h=1,p=null,m=3,v=!1,_=!1,w=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A($){for(var Y=n(f);Y!==null;){if(Y.callback===null)i(f);else if(Y.startTime<=$)i(f),Y.sortIndex=Y.expirationTime,e(u,Y);else break;Y=n(f)}}function T($){if(w=!1,A($),!_)if(n(u)!==null)_=!0,J(D);else{var Y=n(f);Y!==null&&Q(T,Y.startTime-$)}}function D($,Y){_=!1,w&&(w=!1,x(S),S=-1),v=!0;var Z=m;try{for(A(Y),p=n(u);p!==null&&(!(p.expirationTime>Y)||$&&!F());){var z=p.callback;if(typeof z=="function"){p.callback=null,m=p.priorityLevel;var ie=z(p.expirationTime<=Y);Y=t.unstable_now(),typeof ie=="function"?p.callback=ie:p===n(u)&&i(u),A(Y)}else i(u);p=n(u)}if(p!==null)var ve=!0;else{var Ee=n(f);Ee!==null&&Q(T,Ee.startTime-Y),ve=!1}return ve}finally{p=null,m=Z,v=!1}}var I=!1,U=null,S=-1,R=5,H=-1;function F(){return!(t.unstable_now()-H<R)}function W(){if(U!==null){var $=t.unstable_now();H=$;var Y=!0;try{Y=U(!0,$)}finally{Y?X():(I=!1,U=null)}}else I=!1}var X;if(typeof M=="function")X=function(){M(W)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,q=V.port2;V.port1.onmessage=W,X=function(){q.postMessage(null)}}else X=function(){y(W,0)};function J($){U=$,I||(I=!0,X())}function Q($,Y){S=y(function(){$(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){_||v||(_=!0,J(D))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var Y=3;break;default:Y=m}var Z=m;m=Y;try{return $()}finally{m=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,Y){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Z=m;m=$;try{return Y()}finally{m=Z}},t.unstable_scheduleCallback=function($,Y,Z){var z=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,$){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=Z+ie,$={id:h++,callback:Y,priorityLevel:$,startTime:Z,expirationTime:ie,sortIndex:-1},Z>z?($.sortIndex=Z,e(f,$),n(u)===null&&$===n(f)&&(w?(x(S),S=-1):w=!0,Q(T,Z-z))):($.sortIndex=ie,e(u,$),_||v||(_=!0,J(D))),$},t.unstable_shouldYield=F,t.unstable_wrapCallback=function($){var Y=m;return function(){var Z=m;m=Y;try{return $.apply(this,arguments)}finally{m=Z}}}})(_m)),_m}var Mb;function c2(){return Mb||(Mb=1,ym.exports=l2()),ym.exports}var Tb;function u2(){if(Tb)return Vi;Tb=1;var t=Rv(),e=c2();function n(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,r={};function s(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(r[a]=l,a=0;a<l.length;a++)i.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function m(a){return u.call(p,a)?!0:u.call(h,a)?!1:f.test(a)?p[a]=!0:(h[a]=!0,!1)}function v(a,l,d,g){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function _(a,l,d,g){if(l===null||typeof l>"u"||v(a,l,d,g))return!0;if(g)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(a,l,d,g,b,E,k){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=d,this.propertyName=a,this.type=l,this.sanitizeURL=E,this.removeEmptyString=k}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){y[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];y[l]=new w(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){y[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){y[a]=new w(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){y[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){y[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){y[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){y[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){y[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function M(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){y[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),y.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){y[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function A(a,l,d,g){var b=y.hasOwnProperty(l)?y[l]:null;(b!==null?b.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(_(l,d,b,g)&&(d=null),g||b===null?m(l)&&(d===null?a.removeAttribute(l):a.setAttribute(l,""+d)):b.mustUseProperty?a[b.propertyName]=d===null?b.type===3?!1:"":d:(l=b.attributeName,g=b.attributeNamespace,d===null?a.removeAttribute(l):(b=b.type,d=b===3||b===4&&d===!0?"":""+d,g?a.setAttributeNS(g,l,d):a.setAttribute(l,d))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),I=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),F=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),$=Symbol.iterator;function Y(a){return a===null||typeof a!="object"?null:(a=$&&a[$]||a["@@iterator"],typeof a=="function"?a:null)}var Z=Object.assign,z;function ie(a){if(z===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
|
|
3
|
-
`+z+a}var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DEZCzCqB.js","assets/ThemeToggle-BVMjkcsk.js","assets/LeaderboardPage-BaHIGvSw.js","assets/leaderboard-columns-BvsbuvV1.js","assets/LeaderboardProfilePage-BCvKUQ4z.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function i2(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function P1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r2(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var mm={exports:{}},Lc={},gm={exports:{}},Jt={};var xb;function s2(){if(xb)return Jt;xb=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(z){return z===null||typeof z!="object"?null:(z=p&&z[p]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,w={};function y(z,ie,_e){this.props=z,this.context=ie,this.refs=w,this.updater=_e||v}y.prototype.isReactComponent={},y.prototype.setState=function(z,ie){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,ie,"setState")},y.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function x(){}x.prototype=y.prototype;function M(z,ie,_e){this.props=z,this.context=ie,this.refs=w,this.updater=_e||v}var A=M.prototype=new x;A.constructor=M,_(A,y.prototype),A.isPureReactComponent=!0;var T=Array.isArray,D=Object.prototype.hasOwnProperty,I={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function S(z,ie,_e){var Ee,Ue={},le=null,be=null;if(ie!=null)for(Ee in ie.ref!==void 0&&(be=ie.ref),ie.key!==void 0&&(le=""+ie.key),ie)D.call(ie,Ee)&&!U.hasOwnProperty(Ee)&&(Ue[Ee]=ie[Ee]);var Se=arguments.length-2;if(Se===1)Ue.children=_e;else if(1<Se){for(var Ne=Array(Se),et=0;et<Se;et++)Ne[et]=arguments[et+2];Ue.children=Ne}if(z&&z.defaultProps)for(Ee in Se=z.defaultProps,Se)Ue[Ee]===void 0&&(Ue[Ee]=Se[Ee]);return{$$typeof:t,type:z,key:le,ref:be,props:Ue,_owner:I.current}}function R(z,ie){return{$$typeof:t,type:z.type,key:ie,ref:z.ref,props:z.props,_owner:z._owner}}function H(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function F(z){var ie={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(_e){return ie[_e]})}var W=/\/+/g;function X(z,ie){return typeof z=="object"&&z!==null&&z.key!=null?F(""+z.key):ie.toString(36)}function V(z,ie,_e,Ee,Ue){var le=typeof z;(le==="undefined"||le==="boolean")&&(z=null);var be=!1;if(z===null)be=!0;else switch(le){case"string":case"number":be=!0;break;case"object":switch(z.$$typeof){case t:case e:be=!0}}if(be)return be=z,Ue=Ue(be),z=Ee===""?"."+X(be,0):Ee,T(Ue)?(_e="",z!=null&&(_e=z.replace(W,"$&/")+"/"),V(Ue,ie,_e,"",function(et){return et})):Ue!=null&&(H(Ue)&&(Ue=R(Ue,_e+(!Ue.key||be&&be.key===Ue.key?"":(""+Ue.key).replace(W,"$&/")+"/")+z)),ie.push(Ue)),1;if(be=0,Ee=Ee===""?".":Ee+":",T(z))for(var Se=0;Se<z.length;Se++){le=z[Se];var Ne=Ee+X(le,Se);be+=V(le,ie,_e,Ne,Ue)}else if(Ne=m(z),typeof Ne=="function")for(z=Ne.call(z),Se=0;!(le=z.next()).done;)le=le.value,Ne=Ee+X(le,Se++),be+=V(le,ie,_e,Ne,Ue);else if(le==="object")throw ie=String(z),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.");return be}function q(z,ie,_e){if(z==null)return z;var Ee=[],Ue=0;return V(z,Ee,"","",function(le){return ie.call(_e,le,Ue++)}),Ee}function J(z){if(z._status===-1){var ie=z._result;ie=ie(),ie.then(function(_e){(z._status===0||z._status===-1)&&(z._status=1,z._result=_e)},function(_e){(z._status===0||z._status===-1)&&(z._status=2,z._result=_e)}),z._status===-1&&(z._status=0,z._result=ie)}if(z._status===1)return z._result.default;throw z._result}var Q={current:null},$={transition:null},Y={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:$,ReactCurrentOwner:I};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Jt.Children={map:q,forEach:function(z,ie,_e){q(z,function(){ie.apply(this,arguments)},_e)},count:function(z){var ie=0;return q(z,function(){ie++}),ie},toArray:function(z){return q(z,function(ie){return ie})||[]},only:function(z){if(!H(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Jt.Component=y,Jt.Fragment=n,Jt.Profiler=r,Jt.PureComponent=M,Jt.StrictMode=i,Jt.Suspense=u,Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Jt.act=Z,Jt.cloneElement=function(z,ie,_e){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var Ee=_({},z.props),Ue=z.key,le=z.ref,be=z._owner;if(ie!=null){if(ie.ref!==void 0&&(le=ie.ref,be=I.current),ie.key!==void 0&&(Ue=""+ie.key),z.type&&z.type.defaultProps)var Se=z.type.defaultProps;for(Ne in ie)D.call(ie,Ne)&&!U.hasOwnProperty(Ne)&&(Ee[Ne]=ie[Ne]===void 0&&Se!==void 0?Se[Ne]:ie[Ne])}var Ne=arguments.length-2;if(Ne===1)Ee.children=_e;else if(1<Ne){Se=Array(Ne);for(var et=0;et<Ne;et++)Se[et]=arguments[et+2];Ee.children=Se}return{$$typeof:t,type:z.type,key:Ue,ref:le,props:Ee,_owner:be}},Jt.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:s,_context:z},z.Consumer=z},Jt.createElement=S,Jt.createFactory=function(z){var ie=S.bind(null,z);return ie.type=z,ie},Jt.createRef=function(){return{current:null}},Jt.forwardRef=function(z){return{$$typeof:c,render:z}},Jt.isValidElement=H,Jt.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:J}},Jt.memo=function(z,ie){return{$$typeof:f,type:z,compare:ie===void 0?null:ie}},Jt.startTransition=function(z){var ie=$.transition;$.transition={};try{z()}finally{$.transition=ie}},Jt.unstable_act=Z,Jt.useCallback=function(z,ie){return Q.current.useCallback(z,ie)},Jt.useContext=function(z){return Q.current.useContext(z)},Jt.useDebugValue=function(){},Jt.useDeferredValue=function(z){return Q.current.useDeferredValue(z)},Jt.useEffect=function(z,ie){return Q.current.useEffect(z,ie)},Jt.useId=function(){return Q.current.useId()},Jt.useImperativeHandle=function(z,ie,_e){return Q.current.useImperativeHandle(z,ie,_e)},Jt.useInsertionEffect=function(z,ie){return Q.current.useInsertionEffect(z,ie)},Jt.useLayoutEffect=function(z,ie){return Q.current.useLayoutEffect(z,ie)},Jt.useMemo=function(z,ie){return Q.current.useMemo(z,ie)},Jt.useReducer=function(z,ie,_e){return Q.current.useReducer(z,ie,_e)},Jt.useRef=function(z){return Q.current.useRef(z)},Jt.useState=function(z){return Q.current.useState(z)},Jt.useSyncExternalStore=function(z,ie,_e){return Q.current.useSyncExternalStore(z,ie,_e)},Jt.useTransition=function(){return Q.current.useTransition()},Jt.version="18.3.1",Jt}var bb;function Rv(){return bb||(bb=1,gm.exports=s2()),gm.exports}var Sb;function a2(){if(Sb)return Lc;Sb=1;var t=Rv(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,f){var h,p={},m=null,v=null;f!==void 0&&(m=""+f),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)i.call(u,h)&&!s.hasOwnProperty(h)&&(p[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:e,type:c,key:m,ref:v,props:p,_owner:r.current}}return Lc.Fragment=n,Lc.jsx=o,Lc.jsxs=o,Lc}var wb;function o2(){return wb||(wb=1,mm.exports=a2()),mm.exports}var B=o2(),N=Rv();const Gl=P1(N),k1=i2({__proto__:null,default:Gl},[N]);var Id={},vm={exports:{}},Vi={},ym={exports:{}},_m={};var Eb;function l2(){return Eb||(Eb=1,(function(t){function e($,Y){var Z=$.length;$.push(Y);e:for(;0<Z;){var z=Z-1>>>1,ie=$[z];if(0<r(ie,Y))$[z]=Y,$[Z]=ie,Z=z;else break e}}function n($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var Y=$[0],Z=$.pop();if(Z!==Y){$[0]=Z;e:for(var z=0,ie=$.length,_e=ie>>>1;z<_e;){var Ee=2*(z+1)-1,Ue=$[Ee],le=Ee+1,be=$[le];if(0>r(Ue,Z))le<ie&&0>r(be,Ue)?($[z]=be,$[le]=Z,z=le):($[z]=Ue,$[Ee]=Z,z=Ee);else if(le<ie&&0>r(be,Z))$[z]=be,$[le]=Z,z=le;else break e}}return Y}function r($,Y){var Z=$.sortIndex-Y.sortIndex;return Z!==0?Z:$.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var u=[],f=[],h=1,p=null,m=3,v=!1,_=!1,w=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A($){for(var Y=n(f);Y!==null;){if(Y.callback===null)i(f);else if(Y.startTime<=$)i(f),Y.sortIndex=Y.expirationTime,e(u,Y);else break;Y=n(f)}}function T($){if(w=!1,A($),!_)if(n(u)!==null)_=!0,J(D);else{var Y=n(f);Y!==null&&Q(T,Y.startTime-$)}}function D($,Y){_=!1,w&&(w=!1,x(S),S=-1),v=!0;var Z=m;try{for(A(Y),p=n(u);p!==null&&(!(p.expirationTime>Y)||$&&!F());){var z=p.callback;if(typeof z=="function"){p.callback=null,m=p.priorityLevel;var ie=z(p.expirationTime<=Y);Y=t.unstable_now(),typeof ie=="function"?p.callback=ie:p===n(u)&&i(u),A(Y)}else i(u);p=n(u)}if(p!==null)var _e=!0;else{var Ee=n(f);Ee!==null&&Q(T,Ee.startTime-Y),_e=!1}return _e}finally{p=null,m=Z,v=!1}}var I=!1,U=null,S=-1,R=5,H=-1;function F(){return!(t.unstable_now()-H<R)}function W(){if(U!==null){var $=t.unstable_now();H=$;var Y=!0;try{Y=U(!0,$)}finally{Y?X():(I=!1,U=null)}}else I=!1}var X;if(typeof M=="function")X=function(){M(W)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,q=V.port2;V.port1.onmessage=W,X=function(){q.postMessage(null)}}else X=function(){y(W,0)};function J($){U=$,I||(I=!0,X())}function Q($,Y){S=y(function(){$(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){_||v||(_=!0,J(D))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var Y=3;break;default:Y=m}var Z=m;m=Y;try{return $()}finally{m=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,Y){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Z=m;m=$;try{return Y()}finally{m=Z}},t.unstable_scheduleCallback=function($,Y,Z){var z=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,$){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=Z+ie,$={id:h++,callback:Y,priorityLevel:$,startTime:Z,expirationTime:ie,sortIndex:-1},Z>z?($.sortIndex=Z,e(f,$),n(u)===null&&$===n(f)&&(w?(x(S),S=-1):w=!0,Q(T,Z-z))):($.sortIndex=ie,e(u,$),_||v||(_=!0,J(D))),$},t.unstable_shouldYield=F,t.unstable_wrapCallback=function($){var Y=m;return function(){var Z=m;m=Y;try{return $.apply(this,arguments)}finally{m=Z}}}})(_m)),_m}var Mb;function c2(){return Mb||(Mb=1,ym.exports=l2()),ym.exports}var Tb;function u2(){if(Tb)return Vi;Tb=1;var t=Rv(),e=c2();function n(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,r={};function s(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(r[a]=l,a=0;a<l.length;a++)i.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function m(a){return u.call(p,a)?!0:u.call(h,a)?!1:f.test(a)?p[a]=!0:(h[a]=!0,!1)}function v(a,l,d,g){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function _(a,l,d,g){if(l===null||typeof l>"u"||v(a,l,d,g))return!0;if(g)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(a,l,d,g,b,E,k){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=d,this.propertyName=a,this.type=l,this.sanitizeURL=E,this.removeEmptyString=k}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){y[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];y[l]=new w(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){y[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){y[a]=new w(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){y[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){y[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){y[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){y[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){y[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function M(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(x,M);y[l]=new w(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){y[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),y.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){y[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function A(a,l,d,g){var b=y.hasOwnProperty(l)?y[l]:null;(b!==null?b.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(_(l,d,b,g)&&(d=null),g||b===null?m(l)&&(d===null?a.removeAttribute(l):a.setAttribute(l,""+d)):b.mustUseProperty?a[b.propertyName]=d===null?b.type===3?!1:"":d:(l=b.attributeName,g=b.attributeNamespace,d===null?a.removeAttribute(l):(b=b.type,d=b===3||b===4&&d===!0?"":""+d,g?a.setAttributeNS(g,l,d):a.setAttribute(l,d))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),I=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),F=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),$=Symbol.iterator;function Y(a){return a===null||typeof a!="object"?null:(a=$&&a[$]||a["@@iterator"],typeof a=="function"?a:null)}var Z=Object.assign,z;function ie(a){if(z===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
|
|
3
|
+
`+z+a}var _e=!1;function Ee(a,l){if(!a||_e)return"";_e=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ge){var g=ge}Reflect.construct(a,[],l)}else{try{l.call()}catch(ge){g=ge}a.call(l.prototype)}else{try{throw Error()}catch(ge){g=ge}a()}}catch(ge){if(ge&&g&&typeof ge.stack=="string"){for(var b=ge.stack.split(`
|
|
4
4
|
`),E=g.stack.split(`
|
|
5
5
|
`),k=b.length-1,j=E.length-1;1<=k&&0<=j&&b[k]!==E[j];)j--;for(;1<=k&&0<=j;k--,j--)if(b[k]!==E[j]){if(k!==1||j!==1)do if(k--,j--,0>j||b[k]!==E[j]){var te=`
|
|
6
|
-
`+b[k].replace(" at new "," at ");return a.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",a.displayName)),te}while(1<=k&&0<=j);break}}}finally{ve=!1,Error.prepareStackTrace=d}return(a=a?a.displayName||a.name:"")?ie(a):""}function Ue(a){switch(a.tag){case 5:return ie(a.type);case 16:return ie("Lazy");case 13:return ie("Suspense");case 19:return ie("SuspenseList");case 0:case 2:case 15:return a=Ee(a.type,!1),a;case 11:return a=Ee(a.type.render,!1),a;case 1:return a=Ee(a.type,!0),a;default:return""}}function le(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case U:return"Fragment";case I:return"Portal";case R:return"Profiler";case S:return"StrictMode";case X:return"Suspense";case V:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case F:return(a.displayName||"Context")+".Consumer";case H:return(a._context.displayName||"Context")+".Provider";case W:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case q:return l=a.displayName||null,l!==null?l:le(a.type)||"Memo";case J:l=a._payload,a=a._init;try{return le(a(l))}catch{}}return null}function be(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(l);case 8:return l===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Se(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Ne(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function et(a){var l=Ne(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),g=""+a[l];if(!a.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var b=d.get,E=d.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return b.call(this)},set:function(k){g=""+k,E.call(this,k)}}),Object.defineProperty(a,l,{enumerable:d.enumerable}),{getValue:function(){return g},setValue:function(k){g=""+k},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function xt(a){a._valueTracker||(a._valueTracker=et(a))}function pn(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var d=l.getValue(),g="";return a&&(g=Ne(a)?a.checked?"true":"false":a.value),a=g,a!==d?(l.setValue(a),!0):!1}function ht(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ut(a,l){var d=l.checked;return Z({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??a._wrapperState.initialChecked})}function nn(a,l){var d=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;d=Se(l.value!=null?l.value:d),a._wrapperState={initialChecked:g,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Lt(a,l){l=l.checked,l!=null&&A(a,"checked",l,!1)}function an(a,l){Lt(a,l);var d=Se(l.value),g=l.type;if(d!=null)g==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+d):a.value!==""+d&&(a.value=""+d);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?Sn(a,l.type,d):l.hasOwnProperty("defaultValue")&&Sn(a,l.type,Se(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function ee(a,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var g=l.type;if(!(g!=="submit"&&g!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,d||l===a.value||(a.value=l),a.defaultValue=l}d=a.name,d!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,d!==""&&(a.name=d)}function Sn(a,l,d){(l!=="number"||ht(a.ownerDocument)!==a)&&(d==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+d&&(a.defaultValue=""+d))}var At=Array.isArray;function kt(a,l,d,g){if(a=a.options,l){l={};for(var b=0;b<d.length;b++)l["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=l.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&g&&(a[d].defaultSelected=!0)}else{for(d=""+Se(d),l=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,g&&(a[b].defaultSelected=!0);return}l!==null||a[b].disabled||(l=a[b])}l!==null&&(l.selected=!0)}}function it(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function O(a,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(At(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}a._wrapperState={initialValue:Se(d)}}function P(a,l){var d=Se(l.value),g=Se(l.defaultValue);d!=null&&(d=""+d,d!==a.value&&(a.value=d),l.defaultValue==null&&a.defaultValue!==d&&(a.defaultValue=d)),g!=null&&(a.defaultValue=""+g)}function re(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function xe(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function we(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?xe(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var ye,Ke=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,g,b){MSApp.execUnsafeLocalFunction(function(){return a(l,d,g,b)})}:a})(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(ye=ye||document.createElement("div"),ye.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=ye.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function ke(a,l){if(l){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=l;return}}a.textContent=l}var pt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ct=["Webkit","ms","Moz","O"];Object.keys(pt).forEach(function(a){Ct.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),pt[l]=pt[a]})});function Re(a,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||pt.hasOwnProperty(a)&&pt[a]?(""+l).trim():l+"px"}function Be(a,l){a=a.style;for(var d in l)if(l.hasOwnProperty(d)){var g=d.indexOf("--")===0,b=Re(d,l[d],g);d==="float"&&(d="cssFloat"),g?a.setProperty(d,b):a[d]=b}}var Ze=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function rt(a,l){if(l){if(Ze[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function $e(a,l){if(a.indexOf("-")===-1)return typeof l.is=="string";switch(a){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 Vt=null;function ne(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ve=null,Le=null,Xe=null;function Pe(a){if(a=vc(a)){if(typeof Ve!="function")throw Error(n(280));var l=a.stateNode;l&&(l=Ku(l),Ve(a.stateNode,a.type,l))}}function _e(a){Le?Xe?Xe.push(a):Xe=[a]:Le=a}function st(){if(Le){var a=Le,l=Xe;if(Xe=Le=null,Pe(a),l)for(a=0;a<l.length;a++)Pe(l[a])}}function Dt(a,l){return a(l)}function mn(){}var Kt=!1;function ci(a,l,d){if(Kt)return a(l,d);Kt=!0;try{return Dt(a,l,d)}finally{Kt=!1,(Le!==null||Xe!==null)&&(mn(),st())}}function ii(a,l){var d=a.stateNode;if(d===null)return null;var g=Ku(d);if(g===null)return null;d=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var Gs=!1;if(c)try{var br={};Object.defineProperty(br,"passive",{get:function(){Gs=!0}}),window.addEventListener("test",br,br),window.removeEventListener("test",br,br)}catch{Gs=!1}function K(a,l,d,g,b,E,k,j,te){var ge=Array.prototype.slice.call(arguments,3);try{l.apply(d,ge)}catch(Ce){this.onError(Ce)}}var oe=!1,he=null,Me=!1,Ie=null,vt={onError:function(a){oe=!0,he=a}};function tt(a,l,d,g,b,E,k,j,te){oe=!1,he=null,K.apply(vt,arguments)}function yt(a,l,d,g,b,E,k,j,te){if(tt.apply(this,arguments),oe){if(oe){var ge=he;oe=!1,he=null}else throw Error(n(198));Me||(Me=!0,Ie=ge)}}function Qe(a){var l=a,d=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,(l.flags&4098)!==0&&(d=l.return),a=l.return;while(a)}return l.tag===3?d:null}function Et(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function Tt(a){if(Qe(a)!==a)throw Error(n(188))}function bt(a){var l=a.alternate;if(!l){if(l=Qe(a),l===null)throw Error(n(188));return l!==a?null:a}for(var d=a,g=l;;){var b=d.return;if(b===null)break;var E=b.alternate;if(E===null){if(g=b.return,g!==null){d=g;continue}break}if(b.child===E.child){for(E=b.child;E;){if(E===d)return Tt(b),a;if(E===g)return Tt(b),l;E=E.sibling}throw Error(n(188))}if(d.return!==g.return)d=b,g=E;else{for(var k=!1,j=b.child;j;){if(j===d){k=!0,d=b,g=E;break}if(j===g){k=!0,g=b,d=E;break}j=j.sibling}if(!k){for(j=E.child;j;){if(j===d){k=!0,d=E,g=b;break}if(j===g){k=!0,g=E,d=b;break}j=j.sibling}if(!k)throw Error(n(189))}}if(d.alternate!==g)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?a:l}function un(a){return a=bt(a),a!==null?en(a):null}function en(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=en(a);if(l!==null)return l;a=a.sibling}return null}var En=e.unstable_scheduleCallback,Nn=e.unstable_cancelCallback,Kn=e.unstable_shouldYield,gn=e.unstable_requestPaint,L=e.unstable_now,ae=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,ce=e.unstable_NormalPriority,We=e.unstable_LowPriority,qe=e.unstable_IdlePriority,Ge=null,je=null;function ct(a){if(je&&typeof je.onCommitFiberRoot=="function")try{je.onCommitFiberRoot(Ge,a,void 0,(a.current.flags&128)===128)}catch{}}var He=Math.clz32?Math.clz32:Zt,Mt=Math.log,lt=Math.LN2;function Zt(a){return a>>>=0,a===0?32:31-(Mt(a)/lt|0)|0}var Nt=64,vn=4194304;function tn(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function In(a,l){var d=a.pendingLanes;if(d===0)return 0;var g=0,b=a.suspendedLanes,E=a.pingedLanes,k=d&268435455;if(k!==0){var j=k&~b;j!==0?g=tn(j):(E&=k,E!==0&&(g=tn(E)))}else k=d&~b,k!==0?g=tn(k):E!==0&&(g=tn(E));if(g===0)return 0;if(l!==0&&l!==g&&(l&b)===0&&(b=g&-g,E=l&-l,b>=E||b===16&&(E&4194240)!==0))return l;if((g&4)!==0&&(g|=d&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=g;0<l;)d=31-He(l),b=1<<d,g|=a[d],l&=~b;return g}function _t(a,l){switch(a){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mi(a,l){for(var d=a.suspendedLanes,g=a.pingedLanes,b=a.expirationTimes,E=a.pendingLanes;0<E;){var k=31-He(E),j=1<<k,te=b[k];te===-1?((j&d)===0||(j&g)!==0)&&(b[k]=_t(j,l)):te<=l&&(a.expiredLanes|=j),E&=~j}}function rn(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Ni(){var a=Nt;return Nt<<=1,(Nt&4194240)===0&&(Nt=64),a}function Ii(a){for(var l=[],d=0;31>d;d++)l.push(a);return l}function Wi(a,l,d){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-He(l),a[l]=d}function Ws(a,l){var d=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0<d;){var b=31-He(d),E=1<<b;l[b]=0,g[b]=-1,a[b]=-1,d&=~E}}function xn(a,l){var d=a.entangledLanes|=l;for(a=a.entanglements;d;){var g=31-He(d),b=1<<g;b&l|a[g]&l&&(a[g]|=l),d&=~b}}var Ft=0;function Sr(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Vn,tr,ps,ec,n_,zh=!1,Iu=[],js=null,$s=null,Xs=null,tc=new Map,nc=new Map,qs=[],MR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function i_(a,l){switch(a){case"focusin":case"focusout":js=null;break;case"dragenter":case"dragleave":$s=null;break;case"mouseover":case"mouseout":Xs=null;break;case"pointerover":case"pointerout":tc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(l.pointerId)}}function ic(a,l,d,g,b,E){return a===null||a.nativeEvent!==E?(a={blockedOn:l,domEventName:d,eventSystemFlags:g,nativeEvent:E,targetContainers:[b]},l!==null&&(l=vc(l),l!==null&&tr(l)),a):(a.eventSystemFlags|=g,l=a.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),a)}function TR(a,l,d,g,b){switch(l){case"focusin":return js=ic(js,a,l,d,g,b),!0;case"dragenter":return $s=ic($s,a,l,d,g,b),!0;case"mouseover":return Xs=ic(Xs,a,l,d,g,b),!0;case"pointerover":var E=b.pointerId;return tc.set(E,ic(tc.get(E)||null,a,l,d,g,b)),!0;case"gotpointercapture":return E=b.pointerId,nc.set(E,ic(nc.get(E)||null,a,l,d,g,b)),!0}return!1}function r_(a){var l=Na(a.target);if(l!==null){var d=Qe(l);if(d!==null){if(l=d.tag,l===13){if(l=Et(d),l!==null){a.blockedOn=l,n_(a.priority,function(){ps(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Uu(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var d=Hh(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(d===null){d=a.nativeEvent;var g=new d.constructor(d.type,d);Vt=g,d.target.dispatchEvent(g),Vt=null}else return l=vc(d),l!==null&&tr(l),a.blockedOn=d,!1;l.shift()}return!0}function s_(a,l,d){Uu(a)&&d.delete(l)}function AR(){zh=!1,js!==null&&Uu(js)&&(js=null),$s!==null&&Uu($s)&&($s=null),Xs!==null&&Uu(Xs)&&(Xs=null),tc.forEach(s_),nc.forEach(s_)}function rc(a,l){a.blockedOn===l&&(a.blockedOn=null,zh||(zh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AR)))}function sc(a){function l(b){return rc(b,a)}if(0<Iu.length){rc(Iu[0],a);for(var d=1;d<Iu.length;d++){var g=Iu[d];g.blockedOn===a&&(g.blockedOn=null)}}for(js!==null&&rc(js,a),$s!==null&&rc($s,a),Xs!==null&&rc(Xs,a),tc.forEach(l),nc.forEach(l),d=0;d<qs.length;d++)g=qs[d],g.blockedOn===a&&(g.blockedOn=null);for(;0<qs.length&&(d=qs[0],d.blockedOn===null);)r_(d),d.blockedOn===null&&qs.shift()}var Lo=T.ReactCurrentBatchConfig,Fu=!0;function CR(a,l,d,g){var b=Ft,E=Lo.transition;Lo.transition=null;try{Ft=1,Vh(a,l,d,g)}finally{Ft=b,Lo.transition=E}}function RR(a,l,d,g){var b=Ft,E=Lo.transition;Lo.transition=null;try{Ft=4,Vh(a,l,d,g)}finally{Ft=b,Lo.transition=E}}function Vh(a,l,d,g){if(Fu){var b=Hh(a,l,d,g);if(b===null)sp(a,l,g,Ou,d),i_(a,g);else if(TR(b,a,l,d,g))g.stopPropagation();else if(i_(a,g),l&4&&-1<MR.indexOf(a)){for(;b!==null;){var E=vc(b);if(E!==null&&Vn(E),E=Hh(a,l,d,g),E===null&&sp(a,l,g,Ou,d),E===b)break;b=E}b!==null&&g.stopPropagation()}else sp(a,l,g,null,d)}}var Ou=null;function Hh(a,l,d,g){if(Ou=null,a=ne(g),a=Na(a),a!==null)if(l=Qe(a),l===null)a=null;else if(d=l.tag,d===13){if(a=Et(l),a!==null)return a;a=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Ou=a,null}function a_(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ae()){case pe:return 1;case de:return 4;case ce:case We:return 16;case qe:return 536870912;default:return 16}default:return 16}}var Ys=null,Gh=null,Bu=null;function o_(){if(Bu)return Bu;var a,l=Gh,d=l.length,g,b="value"in Ys?Ys.value:Ys.textContent,E=b.length;for(a=0;a<d&&l[a]===b[a];a++);var k=d-a;for(g=1;g<=k&&l[d-g]===b[E-g];g++);return Bu=b.slice(a,1<g?1-g:void 0)}function zu(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Vu(){return!0}function l_(){return!1}function ji(a){function l(d,g,b,E,k){this._reactName=d,this._targetInst=b,this.type=g,this.nativeEvent=E,this.target=k,this.currentTarget=null;for(var j in a)a.hasOwnProperty(j)&&(d=a[j],this[j]=d?d(E):E[j]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Vu:l_,this.isPropagationStopped=l_,this}return Z(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Vu)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Vu)},persist:function(){},isPersistent:Vu}),l}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wh=ji(Do),ac=Z({},Do,{view:0,detail:0}),PR=ji(ac),jh,$h,oc,Hu=Z({},ac,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qh,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==oc&&(oc&&a.type==="mousemove"?(jh=a.screenX-oc.screenX,$h=a.screenY-oc.screenY):$h=jh=0,oc=a),jh)},movementY:function(a){return"movementY"in a?a.movementY:$h}}),c_=ji(Hu),kR=Z({},Hu,{dataTransfer:0}),LR=ji(kR),DR=Z({},ac,{relatedTarget:0}),Xh=ji(DR),NR=Z({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),IR=ji(NR),UR=Z({},Do,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),FR=ji(UR),OR=Z({},Do,{data:0}),u_=ji(OR),BR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zR={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"},VR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HR(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=VR[a])?!!l[a]:!1}function qh(){return HR}var GR=Z({},ac,{key:function(a){if(a.key){var l=BR[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=zu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?zR[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qh,charCode:function(a){return a.type==="keypress"?zu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?zu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),WR=ji(GR),jR=Z({},Hu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),d_=ji(jR),$R=Z({},ac,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qh}),XR=ji($R),qR=Z({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),YR=ji(qR),KR=Z({},Hu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),ZR=ji(KR),JR=[9,13,27,32],Yh=c&&"CompositionEvent"in window,lc=null;c&&"documentMode"in document&&(lc=document.documentMode);var QR=c&&"TextEvent"in window&&!lc,f_=c&&(!Yh||lc&&8<lc&&11>=lc),h_=" ",p_=!1;function m_(a,l){switch(a){case"keyup":return JR.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function g_(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var No=!1;function eP(a,l){switch(a){case"compositionend":return g_(l);case"keypress":return l.which!==32?null:(p_=!0,h_);case"textInput":return a=l.data,a===h_&&p_?null:a;default:return null}}function tP(a,l){if(No)return a==="compositionend"||!Yh&&m_(a,l)?(a=o_(),Bu=Gh=Ys=null,No=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return f_&&l.locale!=="ko"?null:l.data;default:return null}}var nP={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 v_(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!nP[a.type]:l==="textarea"}function y_(a,l,d,g){_e(g),l=Xu(l,"onChange"),0<l.length&&(d=new Wh("onChange","change",null,d,g),a.push({event:d,listeners:l}))}var cc=null,uc=null;function iP(a){U_(a,0)}function Gu(a){var l=Bo(a);if(pn(l))return a}function rP(a,l){if(a==="change")return l}var __=!1;if(c){var Kh;if(c){var Zh="oninput"in document;if(!Zh){var x_=document.createElement("div");x_.setAttribute("oninput","return;"),Zh=typeof x_.oninput=="function"}Kh=Zh}else Kh=!1;__=Kh&&(!document.documentMode||9<document.documentMode)}function b_(){cc&&(cc.detachEvent("onpropertychange",S_),uc=cc=null)}function S_(a){if(a.propertyName==="value"&&Gu(uc)){var l=[];y_(l,uc,a,ne(a)),ci(iP,l)}}function sP(a,l,d){a==="focusin"?(b_(),cc=l,uc=d,cc.attachEvent("onpropertychange",S_)):a==="focusout"&&b_()}function aP(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Gu(uc)}function oP(a,l){if(a==="click")return Gu(l)}function lP(a,l){if(a==="input"||a==="change")return Gu(l)}function cP(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var wr=typeof Object.is=="function"?Object.is:cP;function dc(a,l){if(wr(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var d=Object.keys(a),g=Object.keys(l);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var b=d[g];if(!u.call(l,b)||!wr(a[b],l[b]))return!1}return!0}function w_(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function E_(a,l){var d=w_(a);a=0;for(var g;d;){if(d.nodeType===3){if(g=a+d.textContent.length,a<=l&&g>=l)return{node:d,offset:l-a};a=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=w_(d)}}function M_(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?M_(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function T_(){for(var a=window,l=ht();l instanceof a.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)a=l.contentWindow;else break;l=ht(a.document)}return l}function Jh(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function uP(a){var l=T_(),d=a.focusedElem,g=a.selectionRange;if(l!==d&&d&&d.ownerDocument&&M_(d.ownerDocument.documentElement,d)){if(g!==null&&Jh(d)){if(l=g.start,a=g.end,a===void 0&&(a=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(a,d.value.length);else if(a=(l=d.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var b=d.textContent.length,E=Math.min(g.start,b);g=g.end===void 0?E:Math.min(g.end,b),!a.extend&&E>g&&(b=g,g=E,E=b),b=E_(d,E);var k=E_(d,g);b&&k&&(a.rangeCount!==1||a.anchorNode!==b.node||a.anchorOffset!==b.offset||a.focusNode!==k.node||a.focusOffset!==k.offset)&&(l=l.createRange(),l.setStart(b.node,b.offset),a.removeAllRanges(),E>g?(a.addRange(l),a.extend(k.node,k.offset)):(l.setEnd(k.node,k.offset),a.addRange(l)))}}for(l=[],a=d;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)a=l[d],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var dP=c&&"documentMode"in document&&11>=document.documentMode,Io=null,Qh=null,fc=null,ep=!1;function A_(a,l,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;ep||Io==null||Io!==ht(g)||(g=Io,"selectionStart"in g&&Jh(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),fc&&dc(fc,g)||(fc=g,g=Xu(Qh,"onSelect"),0<g.length&&(l=new Wh("onSelect","select",null,l,d),a.push({event:l,listeners:g}),l.target=Io)))}function Wu(a,l){var d={};return d[a.toLowerCase()]=l.toLowerCase(),d["Webkit"+a]="webkit"+l,d["Moz"+a]="moz"+l,d}var Uo={animationend:Wu("Animation","AnimationEnd"),animationiteration:Wu("Animation","AnimationIteration"),animationstart:Wu("Animation","AnimationStart"),transitionend:Wu("Transition","TransitionEnd")},tp={},C_={};c&&(C_=document.createElement("div").style,"AnimationEvent"in window||(delete Uo.animationend.animation,delete Uo.animationiteration.animation,delete Uo.animationstart.animation),"TransitionEvent"in window||delete Uo.transitionend.transition);function ju(a){if(tp[a])return tp[a];if(!Uo[a])return a;var l=Uo[a],d;for(d in l)if(l.hasOwnProperty(d)&&d in C_)return tp[a]=l[d];return a}var R_=ju("animationend"),P_=ju("animationiteration"),k_=ju("animationstart"),L_=ju("transitionend"),D_=new Map,N_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ks(a,l){D_.set(a,l),s(l,[a])}for(var np=0;np<N_.length;np++){var ip=N_[np],fP=ip.toLowerCase(),hP=ip[0].toUpperCase()+ip.slice(1);Ks(fP,"on"+hP)}Ks(R_,"onAnimationEnd"),Ks(P_,"onAnimationIteration"),Ks(k_,"onAnimationStart"),Ks("dblclick","onDoubleClick"),Ks("focusin","onFocus"),Ks("focusout","onBlur"),Ks(L_,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hc="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(" "),pP=new Set("cancel close invalid load scroll toggle".split(" ").concat(hc));function I_(a,l,d){var g=a.type||"unknown-event";a.currentTarget=d,yt(g,l,void 0,a),a.currentTarget=null}function U_(a,l){l=(l&4)!==0;for(var d=0;d<a.length;d++){var g=a[d],b=g.event;g=g.listeners;e:{var E=void 0;if(l)for(var k=g.length-1;0<=k;k--){var j=g[k],te=j.instance,ge=j.currentTarget;if(j=j.listener,te!==E&&b.isPropagationStopped())break e;I_(b,j,ge),E=te}else for(k=0;k<g.length;k++){if(j=g[k],te=j.instance,ge=j.currentTarget,j=j.listener,te!==E&&b.isPropagationStopped())break e;I_(b,j,ge),E=te}}}if(Me)throw a=Ie,Me=!1,Ie=null,a}function Cn(a,l){var d=l[dp];d===void 0&&(d=l[dp]=new Set);var g=a+"__bubble";d.has(g)||(F_(l,a,2,!1),d.add(g))}function rp(a,l,d){var g=0;l&&(g|=4),F_(d,a,g,l)}var $u="_reactListening"+Math.random().toString(36).slice(2);function pc(a){if(!a[$u]){a[$u]=!0,i.forEach(function(d){d!=="selectionchange"&&(pP.has(d)||rp(d,!1,a),rp(d,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[$u]||(l[$u]=!0,rp("selectionchange",!1,l))}}function F_(a,l,d,g){switch(a_(l)){case 1:var b=CR;break;case 4:b=RR;break;default:b=Vh}d=b.bind(null,l,d,a),b=void 0,!Gs||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?a.addEventListener(l,d,{capture:!0,passive:b}):a.addEventListener(l,d,!0):b!==void 0?a.addEventListener(l,d,{passive:b}):a.addEventListener(l,d,!1)}function sp(a,l,d,g,b){var E=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var k=g.tag;if(k===3||k===4){var j=g.stateNode.containerInfo;if(j===b||j.nodeType===8&&j.parentNode===b)break;if(k===4)for(k=g.return;k!==null;){var te=k.tag;if((te===3||te===4)&&(te=k.stateNode.containerInfo,te===b||te.nodeType===8&&te.parentNode===b))return;k=k.return}for(;j!==null;){if(k=Na(j),k===null)return;if(te=k.tag,te===5||te===6){g=E=k;continue e}j=j.parentNode}}g=g.return}ci(function(){var ge=E,Ce=ne(d),De=[];e:{var Ae=D_.get(a);if(Ae!==void 0){var nt=Wh,ut=a;switch(a){case"keypress":if(zu(d)===0)break e;case"keydown":case"keyup":nt=WR;break;case"focusin":ut="focus",nt=Xh;break;case"focusout":ut="blur",nt=Xh;break;case"beforeblur":case"afterblur":nt=Xh;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":nt=c_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":nt=LR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":nt=XR;break;case R_:case P_:case k_:nt=IR;break;case L_:nt=YR;break;case"scroll":nt=PR;break;case"wheel":nt=ZR;break;case"copy":case"cut":case"paste":nt=FR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":nt=d_}var gt=(l&4)!==0,Hn=!gt&&a==="scroll",ue=gt?Ae!==null?Ae+"Capture":null:Ae;gt=[];for(var se=ge,fe;se!==null;){fe=se;var ze=fe.stateNode;if(fe.tag===5&&ze!==null&&(fe=ze,ue!==null&&(ze=ii(se,ue),ze!=null&>.push(mc(se,ze,fe)))),Hn)break;se=se.return}0<gt.length&&(Ae=new nt(Ae,ut,null,d,Ce),De.push({event:Ae,listeners:gt}))}}if((l&7)===0){e:{if(Ae=a==="mouseover"||a==="pointerover",nt=a==="mouseout"||a==="pointerout",Ae&&d!==Vt&&(ut=d.relatedTarget||d.fromElement)&&(Na(ut)||ut[ms]))break e;if((nt||Ae)&&(Ae=Ce.window===Ce?Ce:(Ae=Ce.ownerDocument)?Ae.defaultView||Ae.parentWindow:window,nt?(ut=d.relatedTarget||d.toElement,nt=ge,ut=ut?Na(ut):null,ut!==null&&(Hn=Qe(ut),ut!==Hn||ut.tag!==5&&ut.tag!==6)&&(ut=null)):(nt=null,ut=ge),nt!==ut)){if(gt=c_,ze="onMouseLeave",ue="onMouseEnter",se="mouse",(a==="pointerout"||a==="pointerover")&&(gt=d_,ze="onPointerLeave",ue="onPointerEnter",se="pointer"),Hn=nt==null?Ae:Bo(nt),fe=ut==null?Ae:Bo(ut),Ae=new gt(ze,se+"leave",nt,d,Ce),Ae.target=Hn,Ae.relatedTarget=fe,ze=null,Na(Ce)===ge&&(gt=new gt(ue,se+"enter",ut,d,Ce),gt.target=fe,gt.relatedTarget=Hn,ze=gt),Hn=ze,nt&&ut)t:{for(gt=nt,ue=ut,se=0,fe=gt;fe;fe=Fo(fe))se++;for(fe=0,ze=ue;ze;ze=Fo(ze))fe++;for(;0<se-fe;)gt=Fo(gt),se--;for(;0<fe-se;)ue=Fo(ue),fe--;for(;se--;){if(gt===ue||ue!==null&>===ue.alternate)break t;gt=Fo(gt),ue=Fo(ue)}gt=null}else gt=null;nt!==null&&O_(De,Ae,nt,gt,!1),ut!==null&&Hn!==null&&O_(De,Hn,ut,gt,!0)}}e:{if(Ae=ge?Bo(ge):window,nt=Ae.nodeName&&Ae.nodeName.toLowerCase(),nt==="select"||nt==="input"&&Ae.type==="file")var St=rP;else if(v_(Ae))if(__)St=lP;else{St=aP;var Rt=sP}else(nt=Ae.nodeName)&&nt.toLowerCase()==="input"&&(Ae.type==="checkbox"||Ae.type==="radio")&&(St=oP);if(St&&(St=St(a,ge))){y_(De,St,d,Ce);break e}Rt&&Rt(a,Ae,ge),a==="focusout"&&(Rt=Ae._wrapperState)&&Rt.controlled&&Ae.type==="number"&&Sn(Ae,"number",Ae.value)}switch(Rt=ge?Bo(ge):window,a){case"focusin":(v_(Rt)||Rt.contentEditable==="true")&&(Io=Rt,Qh=ge,fc=null);break;case"focusout":fc=Qh=Io=null;break;case"mousedown":ep=!0;break;case"contextmenu":case"mouseup":case"dragend":ep=!1,A_(De,d,Ce);break;case"selectionchange":if(dP)break;case"keydown":case"keyup":A_(De,d,Ce)}var Pt;if(Yh)e:{switch(a){case"compositionstart":var Ot="onCompositionStart";break e;case"compositionend":Ot="onCompositionEnd";break e;case"compositionupdate":Ot="onCompositionUpdate";break e}Ot=void 0}else No?m_(a,d)&&(Ot="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(Ot="onCompositionStart");Ot&&(f_&&d.locale!=="ko"&&(No||Ot!=="onCompositionStart"?Ot==="onCompositionEnd"&&No&&(Pt=o_()):(Ys=Ce,Gh="value"in Ys?Ys.value:Ys.textContent,No=!0)),Rt=Xu(ge,Ot),0<Rt.length&&(Ot=new u_(Ot,a,null,d,Ce),De.push({event:Ot,listeners:Rt}),Pt?Ot.data=Pt:(Pt=g_(d),Pt!==null&&(Ot.data=Pt)))),(Pt=QR?eP(a,d):tP(a,d))&&(ge=Xu(ge,"onBeforeInput"),0<ge.length&&(Ce=new u_("onBeforeInput","beforeinput",null,d,Ce),De.push({event:Ce,listeners:ge}),Ce.data=Pt))}U_(De,l)})}function mc(a,l,d){return{instance:a,listener:l,currentTarget:d}}function Xu(a,l){for(var d=l+"Capture",g=[];a!==null;){var b=a,E=b.stateNode;b.tag===5&&E!==null&&(b=E,E=ii(a,d),E!=null&&g.unshift(mc(a,E,b)),E=ii(a,l),E!=null&&g.push(mc(a,E,b))),a=a.return}return g}function Fo(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function O_(a,l,d,g,b){for(var E=l._reactName,k=[];d!==null&&d!==g;){var j=d,te=j.alternate,ge=j.stateNode;if(te!==null&&te===g)break;j.tag===5&&ge!==null&&(j=ge,b?(te=ii(d,E),te!=null&&k.unshift(mc(d,te,j))):b||(te=ii(d,E),te!=null&&k.push(mc(d,te,j)))),d=d.return}k.length!==0&&a.push({event:l,listeners:k})}var mP=/\r\n?/g,gP=/\u0000|\uFFFD/g;function B_(a){return(typeof a=="string"?a:""+a).replace(mP,`
|
|
6
|
+
`+b[k].replace(" at new "," at ");return a.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",a.displayName)),te}while(1<=k&&0<=j);break}}}finally{_e=!1,Error.prepareStackTrace=d}return(a=a?a.displayName||a.name:"")?ie(a):""}function Ue(a){switch(a.tag){case 5:return ie(a.type);case 16:return ie("Lazy");case 13:return ie("Suspense");case 19:return ie("SuspenseList");case 0:case 2:case 15:return a=Ee(a.type,!1),a;case 11:return a=Ee(a.type.render,!1),a;case 1:return a=Ee(a.type,!0),a;default:return""}}function le(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case U:return"Fragment";case I:return"Portal";case R:return"Profiler";case S:return"StrictMode";case X:return"Suspense";case V:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case F:return(a.displayName||"Context")+".Consumer";case H:return(a._context.displayName||"Context")+".Provider";case W:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case q:return l=a.displayName||null,l!==null?l:le(a.type)||"Memo";case J:l=a._payload,a=a._init;try{return le(a(l))}catch{}}return null}function be(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return le(l);case 8:return l===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Se(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Ne(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function et(a){var l=Ne(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),g=""+a[l];if(!a.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var b=d.get,E=d.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return b.call(this)},set:function(k){g=""+k,E.call(this,k)}}),Object.defineProperty(a,l,{enumerable:d.enumerable}),{getValue:function(){return g},setValue:function(k){g=""+k},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function xt(a){a._valueTracker||(a._valueTracker=et(a))}function pn(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var d=l.getValue(),g="";return a&&(g=Ne(a)?a.checked?"true":"false":a.value),a=g,a!==d?(l.setValue(a),!0):!1}function ht(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ut(a,l){var d=l.checked;return Z({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??a._wrapperState.initialChecked})}function nn(a,l){var d=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;d=Se(l.value!=null?l.value:d),a._wrapperState={initialChecked:g,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Lt(a,l){l=l.checked,l!=null&&A(a,"checked",l,!1)}function an(a,l){Lt(a,l);var d=Se(l.value),g=l.type;if(d!=null)g==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+d):a.value!==""+d&&(a.value=""+d);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?Sn(a,l.type,d):l.hasOwnProperty("defaultValue")&&Sn(a,l.type,Se(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function ee(a,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var g=l.type;if(!(g!=="submit"&&g!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,d||l===a.value||(a.value=l),a.defaultValue=l}d=a.name,d!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,d!==""&&(a.name=d)}function Sn(a,l,d){(l!=="number"||ht(a.ownerDocument)!==a)&&(d==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+d&&(a.defaultValue=""+d))}var At=Array.isArray;function kt(a,l,d,g){if(a=a.options,l){l={};for(var b=0;b<d.length;b++)l["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=l.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&g&&(a[d].defaultSelected=!0)}else{for(d=""+Se(d),l=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,g&&(a[b].defaultSelected=!0);return}l!==null||a[b].disabled||(l=a[b])}l!==null&&(l.selected=!0)}}function it(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function O(a,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(At(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}a._wrapperState={initialValue:Se(d)}}function P(a,l){var d=Se(l.value),g=Se(l.defaultValue);d!=null&&(d=""+d,d!==a.value&&(a.value=d),l.defaultValue==null&&a.defaultValue!==d&&(a.defaultValue=d)),g!=null&&(a.defaultValue=""+g)}function re(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function xe(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function we(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?xe(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var ve,Ke=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,g,b){MSApp.execUnsafeLocalFunction(function(){return a(l,d,g,b)})}:a})(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(ve=ve||document.createElement("div"),ve.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=ve.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function ke(a,l){if(l){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=l;return}}a.textContent=l}var pt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ct=["Webkit","ms","Moz","O"];Object.keys(pt).forEach(function(a){Ct.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),pt[l]=pt[a]})});function Re(a,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||pt.hasOwnProperty(a)&&pt[a]?(""+l).trim():l+"px"}function Be(a,l){a=a.style;for(var d in l)if(l.hasOwnProperty(d)){var g=d.indexOf("--")===0,b=Re(d,l[d],g);d==="float"&&(d="cssFloat"),g?a.setProperty(d,b):a[d]=b}}var Ze=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function rt(a,l){if(l){if(Ze[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function $e(a,l){if(a.indexOf("-")===-1)return typeof l.is=="string";switch(a){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 Vt=null;function ne(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ve=null,Le=null,Xe=null;function Pe(a){if(a=vc(a)){if(typeof Ve!="function")throw Error(n(280));var l=a.stateNode;l&&(l=Ku(l),Ve(a.stateNode,a.type,l))}}function ye(a){Le?Xe?Xe.push(a):Xe=[a]:Le=a}function st(){if(Le){var a=Le,l=Xe;if(Xe=Le=null,Pe(a),l)for(a=0;a<l.length;a++)Pe(l[a])}}function Dt(a,l){return a(l)}function mn(){}var Kt=!1;function ci(a,l,d){if(Kt)return a(l,d);Kt=!0;try{return Dt(a,l,d)}finally{Kt=!1,(Le!==null||Xe!==null)&&(mn(),st())}}function ii(a,l){var d=a.stateNode;if(d===null)return null;var g=Ku(d);if(g===null)return null;d=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var Gs=!1;if(c)try{var br={};Object.defineProperty(br,"passive",{get:function(){Gs=!0}}),window.addEventListener("test",br,br),window.removeEventListener("test",br,br)}catch{Gs=!1}function K(a,l,d,g,b,E,k,j,te){var ge=Array.prototype.slice.call(arguments,3);try{l.apply(d,ge)}catch(Ce){this.onError(Ce)}}var oe=!1,he=null,Me=!1,Ie=null,vt={onError:function(a){oe=!0,he=a}};function tt(a,l,d,g,b,E,k,j,te){oe=!1,he=null,K.apply(vt,arguments)}function yt(a,l,d,g,b,E,k,j,te){if(tt.apply(this,arguments),oe){if(oe){var ge=he;oe=!1,he=null}else throw Error(n(198));Me||(Me=!0,Ie=ge)}}function Qe(a){var l=a,d=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,(l.flags&4098)!==0&&(d=l.return),a=l.return;while(a)}return l.tag===3?d:null}function Et(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function Tt(a){if(Qe(a)!==a)throw Error(n(188))}function bt(a){var l=a.alternate;if(!l){if(l=Qe(a),l===null)throw Error(n(188));return l!==a?null:a}for(var d=a,g=l;;){var b=d.return;if(b===null)break;var E=b.alternate;if(E===null){if(g=b.return,g!==null){d=g;continue}break}if(b.child===E.child){for(E=b.child;E;){if(E===d)return Tt(b),a;if(E===g)return Tt(b),l;E=E.sibling}throw Error(n(188))}if(d.return!==g.return)d=b,g=E;else{for(var k=!1,j=b.child;j;){if(j===d){k=!0,d=b,g=E;break}if(j===g){k=!0,g=b,d=E;break}j=j.sibling}if(!k){for(j=E.child;j;){if(j===d){k=!0,d=E,g=b;break}if(j===g){k=!0,g=E,d=b;break}j=j.sibling}if(!k)throw Error(n(189))}}if(d.alternate!==g)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?a:l}function un(a){return a=bt(a),a!==null?en(a):null}function en(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=en(a);if(l!==null)return l;a=a.sibling}return null}var En=e.unstable_scheduleCallback,Nn=e.unstable_cancelCallback,Kn=e.unstable_shouldYield,gn=e.unstable_requestPaint,L=e.unstable_now,ae=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,ce=e.unstable_NormalPriority,We=e.unstable_LowPriority,qe=e.unstable_IdlePriority,Ge=null,je=null;function ct(a){if(je&&typeof je.onCommitFiberRoot=="function")try{je.onCommitFiberRoot(Ge,a,void 0,(a.current.flags&128)===128)}catch{}}var He=Math.clz32?Math.clz32:Zt,Mt=Math.log,lt=Math.LN2;function Zt(a){return a>>>=0,a===0?32:31-(Mt(a)/lt|0)|0}var Nt=64,vn=4194304;function tn(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function In(a,l){var d=a.pendingLanes;if(d===0)return 0;var g=0,b=a.suspendedLanes,E=a.pingedLanes,k=d&268435455;if(k!==0){var j=k&~b;j!==0?g=tn(j):(E&=k,E!==0&&(g=tn(E)))}else k=d&~b,k!==0?g=tn(k):E!==0&&(g=tn(E));if(g===0)return 0;if(l!==0&&l!==g&&(l&b)===0&&(b=g&-g,E=l&-l,b>=E||b===16&&(E&4194240)!==0))return l;if((g&4)!==0&&(g|=d&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=g;0<l;)d=31-He(l),b=1<<d,g|=a[d],l&=~b;return g}function _t(a,l){switch(a){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mi(a,l){for(var d=a.suspendedLanes,g=a.pingedLanes,b=a.expirationTimes,E=a.pendingLanes;0<E;){var k=31-He(E),j=1<<k,te=b[k];te===-1?((j&d)===0||(j&g)!==0)&&(b[k]=_t(j,l)):te<=l&&(a.expiredLanes|=j),E&=~j}}function rn(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Ni(){var a=Nt;return Nt<<=1,(Nt&4194240)===0&&(Nt=64),a}function Ii(a){for(var l=[],d=0;31>d;d++)l.push(a);return l}function Wi(a,l,d){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-He(l),a[l]=d}function Ws(a,l){var d=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0<d;){var b=31-He(d),E=1<<b;l[b]=0,g[b]=-1,a[b]=-1,d&=~E}}function xn(a,l){var d=a.entangledLanes|=l;for(a=a.entanglements;d;){var g=31-He(d),b=1<<g;b&l|a[g]&l&&(a[g]|=l),d&=~b}}var Ft=0;function Sr(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Vn,tr,ps,ec,n_,zh=!1,Iu=[],js=null,$s=null,Xs=null,tc=new Map,nc=new Map,qs=[],MR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function i_(a,l){switch(a){case"focusin":case"focusout":js=null;break;case"dragenter":case"dragleave":$s=null;break;case"mouseover":case"mouseout":Xs=null;break;case"pointerover":case"pointerout":tc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(l.pointerId)}}function ic(a,l,d,g,b,E){return a===null||a.nativeEvent!==E?(a={blockedOn:l,domEventName:d,eventSystemFlags:g,nativeEvent:E,targetContainers:[b]},l!==null&&(l=vc(l),l!==null&&tr(l)),a):(a.eventSystemFlags|=g,l=a.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),a)}function TR(a,l,d,g,b){switch(l){case"focusin":return js=ic(js,a,l,d,g,b),!0;case"dragenter":return $s=ic($s,a,l,d,g,b),!0;case"mouseover":return Xs=ic(Xs,a,l,d,g,b),!0;case"pointerover":var E=b.pointerId;return tc.set(E,ic(tc.get(E)||null,a,l,d,g,b)),!0;case"gotpointercapture":return E=b.pointerId,nc.set(E,ic(nc.get(E)||null,a,l,d,g,b)),!0}return!1}function r_(a){var l=Na(a.target);if(l!==null){var d=Qe(l);if(d!==null){if(l=d.tag,l===13){if(l=Et(d),l!==null){a.blockedOn=l,n_(a.priority,function(){ps(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Uu(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var d=Hh(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(d===null){d=a.nativeEvent;var g=new d.constructor(d.type,d);Vt=g,d.target.dispatchEvent(g),Vt=null}else return l=vc(d),l!==null&&tr(l),a.blockedOn=d,!1;l.shift()}return!0}function s_(a,l,d){Uu(a)&&d.delete(l)}function AR(){zh=!1,js!==null&&Uu(js)&&(js=null),$s!==null&&Uu($s)&&($s=null),Xs!==null&&Uu(Xs)&&(Xs=null),tc.forEach(s_),nc.forEach(s_)}function rc(a,l){a.blockedOn===l&&(a.blockedOn=null,zh||(zh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AR)))}function sc(a){function l(b){return rc(b,a)}if(0<Iu.length){rc(Iu[0],a);for(var d=1;d<Iu.length;d++){var g=Iu[d];g.blockedOn===a&&(g.blockedOn=null)}}for(js!==null&&rc(js,a),$s!==null&&rc($s,a),Xs!==null&&rc(Xs,a),tc.forEach(l),nc.forEach(l),d=0;d<qs.length;d++)g=qs[d],g.blockedOn===a&&(g.blockedOn=null);for(;0<qs.length&&(d=qs[0],d.blockedOn===null);)r_(d),d.blockedOn===null&&qs.shift()}var Lo=T.ReactCurrentBatchConfig,Fu=!0;function CR(a,l,d,g){var b=Ft,E=Lo.transition;Lo.transition=null;try{Ft=1,Vh(a,l,d,g)}finally{Ft=b,Lo.transition=E}}function RR(a,l,d,g){var b=Ft,E=Lo.transition;Lo.transition=null;try{Ft=4,Vh(a,l,d,g)}finally{Ft=b,Lo.transition=E}}function Vh(a,l,d,g){if(Fu){var b=Hh(a,l,d,g);if(b===null)sp(a,l,g,Ou,d),i_(a,g);else if(TR(b,a,l,d,g))g.stopPropagation();else if(i_(a,g),l&4&&-1<MR.indexOf(a)){for(;b!==null;){var E=vc(b);if(E!==null&&Vn(E),E=Hh(a,l,d,g),E===null&&sp(a,l,g,Ou,d),E===b)break;b=E}b!==null&&g.stopPropagation()}else sp(a,l,g,null,d)}}var Ou=null;function Hh(a,l,d,g){if(Ou=null,a=ne(g),a=Na(a),a!==null)if(l=Qe(a),l===null)a=null;else if(d=l.tag,d===13){if(a=Et(l),a!==null)return a;a=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Ou=a,null}function a_(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ae()){case pe:return 1;case de:return 4;case ce:case We:return 16;case qe:return 536870912;default:return 16}default:return 16}}var Ys=null,Gh=null,Bu=null;function o_(){if(Bu)return Bu;var a,l=Gh,d=l.length,g,b="value"in Ys?Ys.value:Ys.textContent,E=b.length;for(a=0;a<d&&l[a]===b[a];a++);var k=d-a;for(g=1;g<=k&&l[d-g]===b[E-g];g++);return Bu=b.slice(a,1<g?1-g:void 0)}function zu(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Vu(){return!0}function l_(){return!1}function ji(a){function l(d,g,b,E,k){this._reactName=d,this._targetInst=b,this.type=g,this.nativeEvent=E,this.target=k,this.currentTarget=null;for(var j in a)a.hasOwnProperty(j)&&(d=a[j],this[j]=d?d(E):E[j]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Vu:l_,this.isPropagationStopped=l_,this}return Z(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Vu)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Vu)},persist:function(){},isPersistent:Vu}),l}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wh=ji(Do),ac=Z({},Do,{view:0,detail:0}),PR=ji(ac),jh,$h,oc,Hu=Z({},ac,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qh,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==oc&&(oc&&a.type==="mousemove"?(jh=a.screenX-oc.screenX,$h=a.screenY-oc.screenY):$h=jh=0,oc=a),jh)},movementY:function(a){return"movementY"in a?a.movementY:$h}}),c_=ji(Hu),kR=Z({},Hu,{dataTransfer:0}),LR=ji(kR),DR=Z({},ac,{relatedTarget:0}),Xh=ji(DR),NR=Z({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),IR=ji(NR),UR=Z({},Do,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),FR=ji(UR),OR=Z({},Do,{data:0}),u_=ji(OR),BR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zR={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"},VR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HR(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=VR[a])?!!l[a]:!1}function qh(){return HR}var GR=Z({},ac,{key:function(a){if(a.key){var l=BR[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=zu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?zR[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qh,charCode:function(a){return a.type==="keypress"?zu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?zu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),WR=ji(GR),jR=Z({},Hu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),d_=ji(jR),$R=Z({},ac,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qh}),XR=ji($R),qR=Z({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),YR=ji(qR),KR=Z({},Hu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),ZR=ji(KR),JR=[9,13,27,32],Yh=c&&"CompositionEvent"in window,lc=null;c&&"documentMode"in document&&(lc=document.documentMode);var QR=c&&"TextEvent"in window&&!lc,f_=c&&(!Yh||lc&&8<lc&&11>=lc),h_=" ",p_=!1;function m_(a,l){switch(a){case"keyup":return JR.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function g_(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var No=!1;function eP(a,l){switch(a){case"compositionend":return g_(l);case"keypress":return l.which!==32?null:(p_=!0,h_);case"textInput":return a=l.data,a===h_&&p_?null:a;default:return null}}function tP(a,l){if(No)return a==="compositionend"||!Yh&&m_(a,l)?(a=o_(),Bu=Gh=Ys=null,No=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return f_&&l.locale!=="ko"?null:l.data;default:return null}}var nP={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 v_(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!nP[a.type]:l==="textarea"}function y_(a,l,d,g){ye(g),l=Xu(l,"onChange"),0<l.length&&(d=new Wh("onChange","change",null,d,g),a.push({event:d,listeners:l}))}var cc=null,uc=null;function iP(a){U_(a,0)}function Gu(a){var l=Bo(a);if(pn(l))return a}function rP(a,l){if(a==="change")return l}var __=!1;if(c){var Kh;if(c){var Zh="oninput"in document;if(!Zh){var x_=document.createElement("div");x_.setAttribute("oninput","return;"),Zh=typeof x_.oninput=="function"}Kh=Zh}else Kh=!1;__=Kh&&(!document.documentMode||9<document.documentMode)}function b_(){cc&&(cc.detachEvent("onpropertychange",S_),uc=cc=null)}function S_(a){if(a.propertyName==="value"&&Gu(uc)){var l=[];y_(l,uc,a,ne(a)),ci(iP,l)}}function sP(a,l,d){a==="focusin"?(b_(),cc=l,uc=d,cc.attachEvent("onpropertychange",S_)):a==="focusout"&&b_()}function aP(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Gu(uc)}function oP(a,l){if(a==="click")return Gu(l)}function lP(a,l){if(a==="input"||a==="change")return Gu(l)}function cP(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var wr=typeof Object.is=="function"?Object.is:cP;function dc(a,l){if(wr(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var d=Object.keys(a),g=Object.keys(l);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var b=d[g];if(!u.call(l,b)||!wr(a[b],l[b]))return!1}return!0}function w_(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function E_(a,l){var d=w_(a);a=0;for(var g;d;){if(d.nodeType===3){if(g=a+d.textContent.length,a<=l&&g>=l)return{node:d,offset:l-a};a=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=w_(d)}}function M_(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?M_(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function T_(){for(var a=window,l=ht();l instanceof a.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)a=l.contentWindow;else break;l=ht(a.document)}return l}function Jh(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function uP(a){var l=T_(),d=a.focusedElem,g=a.selectionRange;if(l!==d&&d&&d.ownerDocument&&M_(d.ownerDocument.documentElement,d)){if(g!==null&&Jh(d)){if(l=g.start,a=g.end,a===void 0&&(a=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(a,d.value.length);else if(a=(l=d.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var b=d.textContent.length,E=Math.min(g.start,b);g=g.end===void 0?E:Math.min(g.end,b),!a.extend&&E>g&&(b=g,g=E,E=b),b=E_(d,E);var k=E_(d,g);b&&k&&(a.rangeCount!==1||a.anchorNode!==b.node||a.anchorOffset!==b.offset||a.focusNode!==k.node||a.focusOffset!==k.offset)&&(l=l.createRange(),l.setStart(b.node,b.offset),a.removeAllRanges(),E>g?(a.addRange(l),a.extend(k.node,k.offset)):(l.setEnd(k.node,k.offset),a.addRange(l)))}}for(l=[],a=d;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)a=l[d],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var dP=c&&"documentMode"in document&&11>=document.documentMode,Io=null,Qh=null,fc=null,ep=!1;function A_(a,l,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;ep||Io==null||Io!==ht(g)||(g=Io,"selectionStart"in g&&Jh(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),fc&&dc(fc,g)||(fc=g,g=Xu(Qh,"onSelect"),0<g.length&&(l=new Wh("onSelect","select",null,l,d),a.push({event:l,listeners:g}),l.target=Io)))}function Wu(a,l){var d={};return d[a.toLowerCase()]=l.toLowerCase(),d["Webkit"+a]="webkit"+l,d["Moz"+a]="moz"+l,d}var Uo={animationend:Wu("Animation","AnimationEnd"),animationiteration:Wu("Animation","AnimationIteration"),animationstart:Wu("Animation","AnimationStart"),transitionend:Wu("Transition","TransitionEnd")},tp={},C_={};c&&(C_=document.createElement("div").style,"AnimationEvent"in window||(delete Uo.animationend.animation,delete Uo.animationiteration.animation,delete Uo.animationstart.animation),"TransitionEvent"in window||delete Uo.transitionend.transition);function ju(a){if(tp[a])return tp[a];if(!Uo[a])return a;var l=Uo[a],d;for(d in l)if(l.hasOwnProperty(d)&&d in C_)return tp[a]=l[d];return a}var R_=ju("animationend"),P_=ju("animationiteration"),k_=ju("animationstart"),L_=ju("transitionend"),D_=new Map,N_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ks(a,l){D_.set(a,l),s(l,[a])}for(var np=0;np<N_.length;np++){var ip=N_[np],fP=ip.toLowerCase(),hP=ip[0].toUpperCase()+ip.slice(1);Ks(fP,"on"+hP)}Ks(R_,"onAnimationEnd"),Ks(P_,"onAnimationIteration"),Ks(k_,"onAnimationStart"),Ks("dblclick","onDoubleClick"),Ks("focusin","onFocus"),Ks("focusout","onBlur"),Ks(L_,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hc="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(" "),pP=new Set("cancel close invalid load scroll toggle".split(" ").concat(hc));function I_(a,l,d){var g=a.type||"unknown-event";a.currentTarget=d,yt(g,l,void 0,a),a.currentTarget=null}function U_(a,l){l=(l&4)!==0;for(var d=0;d<a.length;d++){var g=a[d],b=g.event;g=g.listeners;e:{var E=void 0;if(l)for(var k=g.length-1;0<=k;k--){var j=g[k],te=j.instance,ge=j.currentTarget;if(j=j.listener,te!==E&&b.isPropagationStopped())break e;I_(b,j,ge),E=te}else for(k=0;k<g.length;k++){if(j=g[k],te=j.instance,ge=j.currentTarget,j=j.listener,te!==E&&b.isPropagationStopped())break e;I_(b,j,ge),E=te}}}if(Me)throw a=Ie,Me=!1,Ie=null,a}function Cn(a,l){var d=l[dp];d===void 0&&(d=l[dp]=new Set);var g=a+"__bubble";d.has(g)||(F_(l,a,2,!1),d.add(g))}function rp(a,l,d){var g=0;l&&(g|=4),F_(d,a,g,l)}var $u="_reactListening"+Math.random().toString(36).slice(2);function pc(a){if(!a[$u]){a[$u]=!0,i.forEach(function(d){d!=="selectionchange"&&(pP.has(d)||rp(d,!1,a),rp(d,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[$u]||(l[$u]=!0,rp("selectionchange",!1,l))}}function F_(a,l,d,g){switch(a_(l)){case 1:var b=CR;break;case 4:b=RR;break;default:b=Vh}d=b.bind(null,l,d,a),b=void 0,!Gs||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?a.addEventListener(l,d,{capture:!0,passive:b}):a.addEventListener(l,d,!0):b!==void 0?a.addEventListener(l,d,{passive:b}):a.addEventListener(l,d,!1)}function sp(a,l,d,g,b){var E=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var k=g.tag;if(k===3||k===4){var j=g.stateNode.containerInfo;if(j===b||j.nodeType===8&&j.parentNode===b)break;if(k===4)for(k=g.return;k!==null;){var te=k.tag;if((te===3||te===4)&&(te=k.stateNode.containerInfo,te===b||te.nodeType===8&&te.parentNode===b))return;k=k.return}for(;j!==null;){if(k=Na(j),k===null)return;if(te=k.tag,te===5||te===6){g=E=k;continue e}j=j.parentNode}}g=g.return}ci(function(){var ge=E,Ce=ne(d),De=[];e:{var Ae=D_.get(a);if(Ae!==void 0){var nt=Wh,ut=a;switch(a){case"keypress":if(zu(d)===0)break e;case"keydown":case"keyup":nt=WR;break;case"focusin":ut="focus",nt=Xh;break;case"focusout":ut="blur",nt=Xh;break;case"beforeblur":case"afterblur":nt=Xh;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":nt=c_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":nt=LR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":nt=XR;break;case R_:case P_:case k_:nt=IR;break;case L_:nt=YR;break;case"scroll":nt=PR;break;case"wheel":nt=ZR;break;case"copy":case"cut":case"paste":nt=FR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":nt=d_}var gt=(l&4)!==0,Hn=!gt&&a==="scroll",ue=gt?Ae!==null?Ae+"Capture":null:Ae;gt=[];for(var se=ge,fe;se!==null;){fe=se;var ze=fe.stateNode;if(fe.tag===5&&ze!==null&&(fe=ze,ue!==null&&(ze=ii(se,ue),ze!=null&>.push(mc(se,ze,fe)))),Hn)break;se=se.return}0<gt.length&&(Ae=new nt(Ae,ut,null,d,Ce),De.push({event:Ae,listeners:gt}))}}if((l&7)===0){e:{if(Ae=a==="mouseover"||a==="pointerover",nt=a==="mouseout"||a==="pointerout",Ae&&d!==Vt&&(ut=d.relatedTarget||d.fromElement)&&(Na(ut)||ut[ms]))break e;if((nt||Ae)&&(Ae=Ce.window===Ce?Ce:(Ae=Ce.ownerDocument)?Ae.defaultView||Ae.parentWindow:window,nt?(ut=d.relatedTarget||d.toElement,nt=ge,ut=ut?Na(ut):null,ut!==null&&(Hn=Qe(ut),ut!==Hn||ut.tag!==5&&ut.tag!==6)&&(ut=null)):(nt=null,ut=ge),nt!==ut)){if(gt=c_,ze="onMouseLeave",ue="onMouseEnter",se="mouse",(a==="pointerout"||a==="pointerover")&&(gt=d_,ze="onPointerLeave",ue="onPointerEnter",se="pointer"),Hn=nt==null?Ae:Bo(nt),fe=ut==null?Ae:Bo(ut),Ae=new gt(ze,se+"leave",nt,d,Ce),Ae.target=Hn,Ae.relatedTarget=fe,ze=null,Na(Ce)===ge&&(gt=new gt(ue,se+"enter",ut,d,Ce),gt.target=fe,gt.relatedTarget=Hn,ze=gt),Hn=ze,nt&&ut)t:{for(gt=nt,ue=ut,se=0,fe=gt;fe;fe=Fo(fe))se++;for(fe=0,ze=ue;ze;ze=Fo(ze))fe++;for(;0<se-fe;)gt=Fo(gt),se--;for(;0<fe-se;)ue=Fo(ue),fe--;for(;se--;){if(gt===ue||ue!==null&>===ue.alternate)break t;gt=Fo(gt),ue=Fo(ue)}gt=null}else gt=null;nt!==null&&O_(De,Ae,nt,gt,!1),ut!==null&&Hn!==null&&O_(De,Hn,ut,gt,!0)}}e:{if(Ae=ge?Bo(ge):window,nt=Ae.nodeName&&Ae.nodeName.toLowerCase(),nt==="select"||nt==="input"&&Ae.type==="file")var St=rP;else if(v_(Ae))if(__)St=lP;else{St=aP;var Rt=sP}else(nt=Ae.nodeName)&&nt.toLowerCase()==="input"&&(Ae.type==="checkbox"||Ae.type==="radio")&&(St=oP);if(St&&(St=St(a,ge))){y_(De,St,d,Ce);break e}Rt&&Rt(a,Ae,ge),a==="focusout"&&(Rt=Ae._wrapperState)&&Rt.controlled&&Ae.type==="number"&&Sn(Ae,"number",Ae.value)}switch(Rt=ge?Bo(ge):window,a){case"focusin":(v_(Rt)||Rt.contentEditable==="true")&&(Io=Rt,Qh=ge,fc=null);break;case"focusout":fc=Qh=Io=null;break;case"mousedown":ep=!0;break;case"contextmenu":case"mouseup":case"dragend":ep=!1,A_(De,d,Ce);break;case"selectionchange":if(dP)break;case"keydown":case"keyup":A_(De,d,Ce)}var Pt;if(Yh)e:{switch(a){case"compositionstart":var Ot="onCompositionStart";break e;case"compositionend":Ot="onCompositionEnd";break e;case"compositionupdate":Ot="onCompositionUpdate";break e}Ot=void 0}else No?m_(a,d)&&(Ot="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(Ot="onCompositionStart");Ot&&(f_&&d.locale!=="ko"&&(No||Ot!=="onCompositionStart"?Ot==="onCompositionEnd"&&No&&(Pt=o_()):(Ys=Ce,Gh="value"in Ys?Ys.value:Ys.textContent,No=!0)),Rt=Xu(ge,Ot),0<Rt.length&&(Ot=new u_(Ot,a,null,d,Ce),De.push({event:Ot,listeners:Rt}),Pt?Ot.data=Pt:(Pt=g_(d),Pt!==null&&(Ot.data=Pt)))),(Pt=QR?eP(a,d):tP(a,d))&&(ge=Xu(ge,"onBeforeInput"),0<ge.length&&(Ce=new u_("onBeforeInput","beforeinput",null,d,Ce),De.push({event:Ce,listeners:ge}),Ce.data=Pt))}U_(De,l)})}function mc(a,l,d){return{instance:a,listener:l,currentTarget:d}}function Xu(a,l){for(var d=l+"Capture",g=[];a!==null;){var b=a,E=b.stateNode;b.tag===5&&E!==null&&(b=E,E=ii(a,d),E!=null&&g.unshift(mc(a,E,b)),E=ii(a,l),E!=null&&g.push(mc(a,E,b))),a=a.return}return g}function Fo(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function O_(a,l,d,g,b){for(var E=l._reactName,k=[];d!==null&&d!==g;){var j=d,te=j.alternate,ge=j.stateNode;if(te!==null&&te===g)break;j.tag===5&&ge!==null&&(j=ge,b?(te=ii(d,E),te!=null&&k.unshift(mc(d,te,j))):b||(te=ii(d,E),te!=null&&k.push(mc(d,te,j)))),d=d.return}k.length!==0&&a.push({event:l,listeners:k})}var mP=/\r\n?/g,gP=/\u0000|\uFFFD/g;function B_(a){return(typeof a=="string"?a:""+a).replace(mP,`
|
|
7
7
|
`).replace(gP,"")}function qu(a,l,d){if(l=B_(l),B_(a)!==l&&d)throw Error(n(425))}function Yu(){}var ap=null,op=null;function lp(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var cp=typeof setTimeout=="function"?setTimeout:void 0,vP=typeof clearTimeout=="function"?clearTimeout:void 0,z_=typeof Promise=="function"?Promise:void 0,yP=typeof queueMicrotask=="function"?queueMicrotask:typeof z_<"u"?function(a){return z_.resolve(null).then(a).catch(_P)}:cp;function _P(a){setTimeout(function(){throw a})}function up(a,l){var d=l,g=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"){if(g===0){a.removeChild(b),sc(l);return}g--}else d!=="$"&&d!=="$?"&&d!=="$!"||g++;d=b}while(d);sc(l)}function Zs(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function V_(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return a;l--}else d==="/$"&&l++}a=a.previousSibling}return null}var Oo=Math.random().toString(36).slice(2),Vr="__reactFiber$"+Oo,gc="__reactProps$"+Oo,ms="__reactContainer$"+Oo,dp="__reactEvents$"+Oo,xP="__reactListeners$"+Oo,bP="__reactHandles$"+Oo;function Na(a){var l=a[Vr];if(l)return l;for(var d=a.parentNode;d;){if(l=d[ms]||d[Vr]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(a=V_(a);a!==null;){if(d=a[Vr])return d;a=V_(a)}return l}a=d,d=a.parentNode}return null}function vc(a){return a=a[Vr]||a[ms],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Bo(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function Ku(a){return a[gc]||null}var fp=[],zo=-1;function Js(a){return{current:a}}function Rn(a){0>zo||(a.current=fp[zo],fp[zo]=null,zo--)}function An(a,l){zo++,fp[zo]=a.current,a.current=l}var Qs={},mi=Js(Qs),Ui=Js(!1),Ia=Qs;function Vo(a,l){var d=a.type.contextTypes;if(!d)return Qs;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===l)return g.__reactInternalMemoizedMaskedChildContext;var b={},E;for(E in d)b[E]=l[E];return g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=b),b}function Fi(a){return a=a.childContextTypes,a!=null}function Zu(){Rn(Ui),Rn(mi)}function H_(a,l,d){if(mi.current!==Qs)throw Error(n(168));An(mi,l),An(Ui,d)}function G_(a,l,d){var g=a.stateNode;if(l=l.childContextTypes,typeof g.getChildContext!="function")return d;g=g.getChildContext();for(var b in g)if(!(b in l))throw Error(n(108,be(a)||"Unknown",b));return Z({},d,g)}function Ju(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Qs,Ia=mi.current,An(mi,a),An(Ui,Ui.current),!0}function W_(a,l,d){var g=a.stateNode;if(!g)throw Error(n(169));d?(a=G_(a,l,Ia),g.__reactInternalMemoizedMergedChildContext=a,Rn(Ui),Rn(mi),An(mi,a)):Rn(Ui),An(Ui,d)}var gs=null,Qu=!1,hp=!1;function j_(a){gs===null?gs=[a]:gs.push(a)}function SP(a){Qu=!0,j_(a)}function ea(){if(!hp&&gs!==null){hp=!0;var a=0,l=Ft;try{var d=gs;for(Ft=1;a<d.length;a++){var g=d[a];do g=g(!0);while(g!==null)}gs=null,Qu=!1}catch(b){throw gs!==null&&(gs=gs.slice(a+1)),En(pe,ea),b}finally{Ft=l,hp=!1}}return null}var Ho=[],Go=0,ed=null,td=0,nr=[],ir=0,Ua=null,vs=1,ys="";function Fa(a,l){Ho[Go++]=td,Ho[Go++]=ed,ed=a,td=l}function $_(a,l,d){nr[ir++]=vs,nr[ir++]=ys,nr[ir++]=Ua,Ua=a;var g=vs;a=ys;var b=32-He(g)-1;g&=~(1<<b),d+=1;var E=32-He(l)+b;if(30<E){var k=b-b%5;E=(g&(1<<k)-1).toString(32),g>>=k,b-=k,vs=1<<32-He(l)+b|d<<b|g,ys=E+a}else vs=1<<E|d<<b|g,ys=a}function pp(a){a.return!==null&&(Fa(a,1),$_(a,1,0))}function mp(a){for(;a===ed;)ed=Ho[--Go],Ho[Go]=null,td=Ho[--Go],Ho[Go]=null;for(;a===Ua;)Ua=nr[--ir],nr[ir]=null,ys=nr[--ir],nr[ir]=null,vs=nr[--ir],nr[ir]=null}var $i=null,Xi=null,Ln=!1,Er=null;function X_(a,l){var d=or(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=a,l=a.deletions,l===null?(a.deletions=[d],a.flags|=16):l.push(d)}function q_(a,l){switch(a.tag){case 5:var d=a.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,$i=a,Xi=Zs(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,$i=a,Xi=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=Ua!==null?{id:vs,overflow:ys}:null,a.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=or(18,null,null,0),d.stateNode=l,d.return=a,a.child=d,$i=a,Xi=null,!0):!1;default:return!1}}function gp(a){return(a.mode&1)!==0&&(a.flags&128)===0}function vp(a){if(Ln){var l=Xi;if(l){var d=l;if(!q_(a,l)){if(gp(a))throw Error(n(418));l=Zs(d.nextSibling);var g=$i;l&&q_(a,l)?X_(g,d):(a.flags=a.flags&-4097|2,Ln=!1,$i=a)}}else{if(gp(a))throw Error(n(418));a.flags=a.flags&-4097|2,Ln=!1,$i=a}}}function Y_(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;$i=a}function nd(a){if(a!==$i)return!1;if(!Ln)return Y_(a),Ln=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!lp(a.type,a.memoizedProps)),l&&(l=Xi)){if(gp(a))throw K_(),Error(n(418));for(;l;)X_(a,l),l=Zs(l.nextSibling)}if(Y_(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"){if(l===0){Xi=Zs(a.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}a=a.nextSibling}Xi=null}}else Xi=$i?Zs(a.stateNode.nextSibling):null;return!0}function K_(){for(var a=Xi;a;)a=Zs(a.nextSibling)}function Wo(){Xi=$i=null,Ln=!1}function yp(a){Er===null?Er=[a]:Er.push(a)}var wP=T.ReactCurrentBatchConfig;function yc(a,l,d){if(a=d.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var g=d.stateNode}if(!g)throw Error(n(147,a));var b=g,E=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===E?l.ref:(l=function(k){var j=b.refs;k===null?delete j[E]:j[E]=k},l._stringRef=E,l)}if(typeof a!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,a))}return a}function id(a,l){throw a=Object.prototype.toString.call(l),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function Z_(a){var l=a._init;return l(a._payload)}function J_(a){function l(ue,se){if(a){var fe=ue.deletions;fe===null?(ue.deletions=[se],ue.flags|=16):fe.push(se)}}function d(ue,se){if(!a)return null;for(;se!==null;)l(ue,se),se=se.sibling;return null}function g(ue,se){for(ue=new Map;se!==null;)se.key!==null?ue.set(se.key,se):ue.set(se.index,se),se=se.sibling;return ue}function b(ue,se){return ue=la(ue,se),ue.index=0,ue.sibling=null,ue}function E(ue,se,fe){return ue.index=fe,a?(fe=ue.alternate,fe!==null?(fe=fe.index,fe<se?(ue.flags|=2,se):fe):(ue.flags|=2,se)):(ue.flags|=1048576,se)}function k(ue){return a&&ue.alternate===null&&(ue.flags|=2),ue}function j(ue,se,fe,ze){return se===null||se.tag!==6?(se=cm(fe,ue.mode,ze),se.return=ue,se):(se=b(se,fe),se.return=ue,se)}function te(ue,se,fe,ze){var St=fe.type;return St===U?Ce(ue,se,fe.props.children,ze,fe.key):se!==null&&(se.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===J&&Z_(St)===se.type)?(ze=b(se,fe.props),ze.ref=yc(ue,se,fe),ze.return=ue,ze):(ze=Ad(fe.type,fe.key,fe.props,null,ue.mode,ze),ze.ref=yc(ue,se,fe),ze.return=ue,ze)}function ge(ue,se,fe,ze){return se===null||se.tag!==4||se.stateNode.containerInfo!==fe.containerInfo||se.stateNode.implementation!==fe.implementation?(se=um(fe,ue.mode,ze),se.return=ue,se):(se=b(se,fe.children||[]),se.return=ue,se)}function Ce(ue,se,fe,ze,St){return se===null||se.tag!==7?(se=ja(fe,ue.mode,ze,St),se.return=ue,se):(se=b(se,fe),se.return=ue,se)}function De(ue,se,fe){if(typeof se=="string"&&se!==""||typeof se=="number")return se=cm(""+se,ue.mode,fe),se.return=ue,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case D:return fe=Ad(se.type,se.key,se.props,null,ue.mode,fe),fe.ref=yc(ue,null,se),fe.return=ue,fe;case I:return se=um(se,ue.mode,fe),se.return=ue,se;case J:var ze=se._init;return De(ue,ze(se._payload),fe)}if(At(se)||Y(se))return se=ja(se,ue.mode,fe,null),se.return=ue,se;id(ue,se)}return null}function Ae(ue,se,fe,ze){var St=se!==null?se.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number")return St!==null?null:j(ue,se,""+fe,ze);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case D:return fe.key===St?te(ue,se,fe,ze):null;case I:return fe.key===St?ge(ue,se,fe,ze):null;case J:return St=fe._init,Ae(ue,se,St(fe._payload),ze)}if(At(fe)||Y(fe))return St!==null?null:Ce(ue,se,fe,ze,null);id(ue,fe)}return null}function nt(ue,se,fe,ze,St){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return ue=ue.get(fe)||null,j(se,ue,""+ze,St);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case D:return ue=ue.get(ze.key===null?fe:ze.key)||null,te(se,ue,ze,St);case I:return ue=ue.get(ze.key===null?fe:ze.key)||null,ge(se,ue,ze,St);case J:var Rt=ze._init;return nt(ue,se,fe,Rt(ze._payload),St)}if(At(ze)||Y(ze))return ue=ue.get(fe)||null,Ce(se,ue,ze,St,null);id(se,ze)}return null}function ut(ue,se,fe,ze){for(var St=null,Rt=null,Pt=se,Ot=se=0,ai=null;Pt!==null&&Ot<fe.length;Ot++){Pt.index>Ot?(ai=Pt,Pt=null):ai=Pt.sibling;var yn=Ae(ue,Pt,fe[Ot],ze);if(yn===null){Pt===null&&(Pt=ai);break}a&&Pt&&yn.alternate===null&&l(ue,Pt),se=E(yn,se,Ot),Rt===null?St=yn:Rt.sibling=yn,Rt=yn,Pt=ai}if(Ot===fe.length)return d(ue,Pt),Ln&&Fa(ue,Ot),St;if(Pt===null){for(;Ot<fe.length;Ot++)Pt=De(ue,fe[Ot],ze),Pt!==null&&(se=E(Pt,se,Ot),Rt===null?St=Pt:Rt.sibling=Pt,Rt=Pt);return Ln&&Fa(ue,Ot),St}for(Pt=g(ue,Pt);Ot<fe.length;Ot++)ai=nt(Pt,ue,Ot,fe[Ot],ze),ai!==null&&(a&&ai.alternate!==null&&Pt.delete(ai.key===null?Ot:ai.key),se=E(ai,se,Ot),Rt===null?St=ai:Rt.sibling=ai,Rt=ai);return a&&Pt.forEach(function(ca){return l(ue,ca)}),Ln&&Fa(ue,Ot),St}function gt(ue,se,fe,ze){var St=Y(fe);if(typeof St!="function")throw Error(n(150));if(fe=St.call(fe),fe==null)throw Error(n(151));for(var Rt=St=null,Pt=se,Ot=se=0,ai=null,yn=fe.next();Pt!==null&&!yn.done;Ot++,yn=fe.next()){Pt.index>Ot?(ai=Pt,Pt=null):ai=Pt.sibling;var ca=Ae(ue,Pt,yn.value,ze);if(ca===null){Pt===null&&(Pt=ai);break}a&&Pt&&ca.alternate===null&&l(ue,Pt),se=E(ca,se,Ot),Rt===null?St=ca:Rt.sibling=ca,Rt=ca,Pt=ai}if(yn.done)return d(ue,Pt),Ln&&Fa(ue,Ot),St;if(Pt===null){for(;!yn.done;Ot++,yn=fe.next())yn=De(ue,yn.value,ze),yn!==null&&(se=E(yn,se,Ot),Rt===null?St=yn:Rt.sibling=yn,Rt=yn);return Ln&&Fa(ue,Ot),St}for(Pt=g(ue,Pt);!yn.done;Ot++,yn=fe.next())yn=nt(Pt,ue,Ot,yn.value,ze),yn!==null&&(a&&yn.alternate!==null&&Pt.delete(yn.key===null?Ot:yn.key),se=E(yn,se,Ot),Rt===null?St=yn:Rt.sibling=yn,Rt=yn);return a&&Pt.forEach(function(n2){return l(ue,n2)}),Ln&&Fa(ue,Ot),St}function Hn(ue,se,fe,ze){if(typeof fe=="object"&&fe!==null&&fe.type===U&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case D:e:{for(var St=fe.key,Rt=se;Rt!==null;){if(Rt.key===St){if(St=fe.type,St===U){if(Rt.tag===7){d(ue,Rt.sibling),se=b(Rt,fe.props.children),se.return=ue,ue=se;break e}}else if(Rt.elementType===St||typeof St=="object"&&St!==null&&St.$$typeof===J&&Z_(St)===Rt.type){d(ue,Rt.sibling),se=b(Rt,fe.props),se.ref=yc(ue,Rt,fe),se.return=ue,ue=se;break e}d(ue,Rt);break}else l(ue,Rt);Rt=Rt.sibling}fe.type===U?(se=ja(fe.props.children,ue.mode,ze,fe.key),se.return=ue,ue=se):(ze=Ad(fe.type,fe.key,fe.props,null,ue.mode,ze),ze.ref=yc(ue,se,fe),ze.return=ue,ue=ze)}return k(ue);case I:e:{for(Rt=fe.key;se!==null;){if(se.key===Rt)if(se.tag===4&&se.stateNode.containerInfo===fe.containerInfo&&se.stateNode.implementation===fe.implementation){d(ue,se.sibling),se=b(se,fe.children||[]),se.return=ue,ue=se;break e}else{d(ue,se);break}else l(ue,se);se=se.sibling}se=um(fe,ue.mode,ze),se.return=ue,ue=se}return k(ue);case J:return Rt=fe._init,Hn(ue,se,Rt(fe._payload),ze)}if(At(fe))return ut(ue,se,fe,ze);if(Y(fe))return gt(ue,se,fe,ze);id(ue,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"?(fe=""+fe,se!==null&&se.tag===6?(d(ue,se.sibling),se=b(se,fe),se.return=ue,ue=se):(d(ue,se),se=cm(fe,ue.mode,ze),se.return=ue,ue=se),k(ue)):d(ue,se)}return Hn}var jo=J_(!0),Q_=J_(!1),rd=Js(null),sd=null,$o=null,_p=null;function xp(){_p=$o=sd=null}function bp(a){var l=rd.current;Rn(rd),a._currentValue=l}function Sp(a,l,d){for(;a!==null;){var g=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),a===d)break;a=a.return}}function Xo(a,l){sd=a,_p=$o=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&l)!==0&&(Oi=!0),a.firstContext=null)}function rr(a){var l=a._currentValue;if(_p!==a)if(a={context:a,memoizedValue:l,next:null},$o===null){if(sd===null)throw Error(n(308));$o=a,sd.dependencies={lanes:0,firstContext:a}}else $o=$o.next=a;return l}var Oa=null;function wp(a){Oa===null?Oa=[a]:Oa.push(a)}function ex(a,l,d,g){var b=l.interleaved;return b===null?(d.next=d,wp(l)):(d.next=b.next,b.next=d),l.interleaved=d,_s(a,g)}function _s(a,l){a.lanes|=l;var d=a.alternate;for(d!==null&&(d.lanes|=l),d=a,a=a.return;a!==null;)a.childLanes|=l,d=a.alternate,d!==null&&(d.childLanes|=l),d=a,a=a.return;return d.tag===3?d.stateNode:null}var ta=!1;function Ep(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tx(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function xs(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function na(a,l,d){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(dn&2)!==0){var b=g.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),g.pending=l,_s(a,d)}return b=g.interleaved,b===null?(l.next=l,wp(g)):(l.next=b.next,b.next=l),g.interleaved=l,_s(a,d)}function ad(a,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var g=l.lanes;g&=a.pendingLanes,d|=g,l.lanes=d,xn(a,d)}}function nx(a,l){var d=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var b=null,E=null;if(d=d.firstBaseUpdate,d!==null){do{var k={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};E===null?b=E=k:E=E.next=k,d=d.next}while(d!==null);E===null?b=E=l:E=E.next=l}else b=E=l;d={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:E,shared:g.shared,effects:g.effects},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=l:a.next=l,d.lastBaseUpdate=l}function od(a,l,d,g){var b=a.updateQueue;ta=!1;var E=b.firstBaseUpdate,k=b.lastBaseUpdate,j=b.shared.pending;if(j!==null){b.shared.pending=null;var te=j,ge=te.next;te.next=null,k===null?E=ge:k.next=ge,k=te;var Ce=a.alternate;Ce!==null&&(Ce=Ce.updateQueue,j=Ce.lastBaseUpdate,j!==k&&(j===null?Ce.firstBaseUpdate=ge:j.next=ge,Ce.lastBaseUpdate=te))}if(E!==null){var De=b.baseState;k=0,Ce=ge=te=null,j=E;do{var Ae=j.lane,nt=j.eventTime;if((g&Ae)===Ae){Ce!==null&&(Ce=Ce.next={eventTime:nt,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var ut=a,gt=j;switch(Ae=l,nt=d,gt.tag){case 1:if(ut=gt.payload,typeof ut=="function"){De=ut.call(nt,De,Ae);break e}De=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=gt.payload,Ae=typeof ut=="function"?ut.call(nt,De,Ae):ut,Ae==null)break e;De=Z({},De,Ae);break e;case 2:ta=!0}}j.callback!==null&&j.lane!==0&&(a.flags|=64,Ae=b.effects,Ae===null?b.effects=[j]:Ae.push(j))}else nt={eventTime:nt,lane:Ae,tag:j.tag,payload:j.payload,callback:j.callback,next:null},Ce===null?(ge=Ce=nt,te=De):Ce=Ce.next=nt,k|=Ae;if(j=j.next,j===null){if(j=b.shared.pending,j===null)break;Ae=j,j=Ae.next,Ae.next=null,b.lastBaseUpdate=Ae,b.shared.pending=null}}while(!0);if(Ce===null&&(te=De),b.baseState=te,b.firstBaseUpdate=ge,b.lastBaseUpdate=Ce,l=b.shared.interleaved,l!==null){b=l;do k|=b.lane,b=b.next;while(b!==l)}else E===null&&(b.shared.lanes=0);Va|=k,a.lanes=k,a.memoizedState=De}}function ix(a,l,d){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var g=a[l],b=g.callback;if(b!==null){if(g.callback=null,g=d,typeof b!="function")throw Error(n(191,b));b.call(g)}}}var _c={},Hr=Js(_c),xc=Js(_c),bc=Js(_c);function Ba(a){if(a===_c)throw Error(n(174));return a}function Mp(a,l){switch(An(bc,l),An(xc,a),An(Hr,_c),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:we(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=we(l,a)}Rn(Hr),An(Hr,l)}function qo(){Rn(Hr),Rn(xc),Rn(bc)}function rx(a){Ba(bc.current);var l=Ba(Hr.current),d=we(l,a.type);l!==d&&(An(xc,a),An(Hr,d))}function Tp(a){xc.current===a&&(Rn(Hr),Rn(xc))}var Un=Js(0);function ld(a){for(var l=a;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Ap=[];function Cp(){for(var a=0;a<Ap.length;a++)Ap[a]._workInProgressVersionPrimary=null;Ap.length=0}var cd=T.ReactCurrentDispatcher,Rp=T.ReactCurrentBatchConfig,za=0,Fn=null,Zn=null,ri=null,ud=!1,Sc=!1,wc=0,EP=0;function gi(){throw Error(n(321))}function Pp(a,l){if(l===null)return!1;for(var d=0;d<l.length&&d<a.length;d++)if(!wr(a[d],l[d]))return!1;return!0}function kp(a,l,d,g,b,E){if(za=E,Fn=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,cd.current=a===null||a.memoizedState===null?CP:RP,a=d(g,b),Sc){E=0;do{if(Sc=!1,wc=0,25<=E)throw Error(n(301));E+=1,ri=Zn=null,l.updateQueue=null,cd.current=PP,a=d(g,b)}while(Sc)}if(cd.current=hd,l=Zn!==null&&Zn.next!==null,za=0,ri=Zn=Fn=null,ud=!1,l)throw Error(n(300));return a}function Lp(){var a=wc!==0;return wc=0,a}function Gr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ri===null?Fn.memoizedState=ri=a:ri=ri.next=a,ri}function sr(){if(Zn===null){var a=Fn.alternate;a=a!==null?a.memoizedState:null}else a=Zn.next;var l=ri===null?Fn.memoizedState:ri.next;if(l!==null)ri=l,Zn=a;else{if(a===null)throw Error(n(310));Zn=a,a={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},ri===null?Fn.memoizedState=ri=a:ri=ri.next=a}return ri}function Ec(a,l){return typeof l=="function"?l(a):l}function Dp(a){var l=sr(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=a;var g=Zn,b=g.baseQueue,E=d.pending;if(E!==null){if(b!==null){var k=b.next;b.next=E.next,E.next=k}g.baseQueue=b=E,d.pending=null}if(b!==null){E=b.next,g=g.baseState;var j=k=null,te=null,ge=E;do{var Ce=ge.lane;if((za&Ce)===Ce)te!==null&&(te=te.next={lane:0,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),g=ge.hasEagerState?ge.eagerState:a(g,ge.action);else{var De={lane:Ce,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null};te===null?(j=te=De,k=g):te=te.next=De,Fn.lanes|=Ce,Va|=Ce}ge=ge.next}while(ge!==null&&ge!==E);te===null?k=g:te.next=j,wr(g,l.memoizedState)||(Oi=!0),l.memoizedState=g,l.baseState=k,l.baseQueue=te,d.lastRenderedState=g}if(a=d.interleaved,a!==null){b=a;do E=b.lane,Fn.lanes|=E,Va|=E,b=b.next;while(b!==a)}else b===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function Np(a){var l=sr(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=a;var g=d.dispatch,b=d.pending,E=l.memoizedState;if(b!==null){d.pending=null;var k=b=b.next;do E=a(E,k.action),k=k.next;while(k!==b);wr(E,l.memoizedState)||(Oi=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),d.lastRenderedState=E}return[E,g]}function sx(){}function ax(a,l){var d=Fn,g=sr(),b=l(),E=!wr(g.memoizedState,b);if(E&&(g.memoizedState=b,Oi=!0),g=g.queue,Ip(cx.bind(null,d,g,a),[a]),g.getSnapshot!==l||E||ri!==null&&ri.memoizedState.tag&1){if(d.flags|=2048,Mc(9,lx.bind(null,d,g,b,l),void 0,null),si===null)throw Error(n(349));(za&30)!==0||ox(d,l,b)}return b}function ox(a,l,d){a.flags|=16384,a={getSnapshot:l,value:d},l=Fn.updateQueue,l===null?(l={lastEffect:null,stores:null},Fn.updateQueue=l,l.stores=[a]):(d=l.stores,d===null?l.stores=[a]:d.push(a))}function lx(a,l,d,g){l.value=d,l.getSnapshot=g,ux(l)&&dx(a)}function cx(a,l,d){return d(function(){ux(l)&&dx(a)})}function ux(a){var l=a.getSnapshot;a=a.value;try{var d=l();return!wr(a,d)}catch{return!0}}function dx(a){var l=_s(a,1);l!==null&&Cr(l,a,1,-1)}function fx(a){var l=Gr();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ec,lastRenderedState:a},l.queue=a,a=a.dispatch=AP.bind(null,Fn,a),[l.memoizedState,a]}function Mc(a,l,d,g){return a={tag:a,create:l,destroy:d,deps:g,next:null},l=Fn.updateQueue,l===null?(l={lastEffect:null,stores:null},Fn.updateQueue=l,l.lastEffect=a.next=a):(d=l.lastEffect,d===null?l.lastEffect=a.next=a:(g=d.next,d.next=a,a.next=g,l.lastEffect=a)),a}function hx(){return sr().memoizedState}function dd(a,l,d,g){var b=Gr();Fn.flags|=a,b.memoizedState=Mc(1|l,d,void 0,g===void 0?null:g)}function fd(a,l,d,g){var b=sr();g=g===void 0?null:g;var E=void 0;if(Zn!==null){var k=Zn.memoizedState;if(E=k.destroy,g!==null&&Pp(g,k.deps)){b.memoizedState=Mc(l,d,E,g);return}}Fn.flags|=a,b.memoizedState=Mc(1|l,d,E,g)}function px(a,l){return dd(8390656,8,a,l)}function Ip(a,l){return fd(2048,8,a,l)}function mx(a,l){return fd(4,2,a,l)}function gx(a,l){return fd(4,4,a,l)}function vx(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function yx(a,l,d){return d=d!=null?d.concat([a]):null,fd(4,4,vx.bind(null,l,a),d)}function Up(){}function _x(a,l){var d=sr();l=l===void 0?null:l;var g=d.memoizedState;return g!==null&&l!==null&&Pp(l,g[1])?g[0]:(d.memoizedState=[a,l],a)}function xx(a,l){var d=sr();l=l===void 0?null:l;var g=d.memoizedState;return g!==null&&l!==null&&Pp(l,g[1])?g[0]:(a=a(),d.memoizedState=[a,l],a)}function bx(a,l,d){return(za&21)===0?(a.baseState&&(a.baseState=!1,Oi=!0),a.memoizedState=d):(wr(d,l)||(d=Ni(),Fn.lanes|=d,Va|=d,a.baseState=!0),l)}function MP(a,l){var d=Ft;Ft=d!==0&&4>d?d:4,a(!0);var g=Rp.transition;Rp.transition={};try{a(!1),l()}finally{Ft=d,Rp.transition=g}}function Sx(){return sr().memoizedState}function TP(a,l,d){var g=aa(a);if(d={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null},wx(a))Ex(l,d);else if(d=ex(a,l,d,g),d!==null){var b=Ai();Cr(d,a,g,b),Mx(d,l,g)}}function AP(a,l,d){var g=aa(a),b={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null};if(wx(a))Ex(l,b);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var k=l.lastRenderedState,j=E(k,d);if(b.hasEagerState=!0,b.eagerState=j,wr(j,k)){var te=l.interleaved;te===null?(b.next=b,wp(l)):(b.next=te.next,te.next=b),l.interleaved=b;return}}catch{}d=ex(a,l,b,g),d!==null&&(b=Ai(),Cr(d,a,g,b),Mx(d,l,g))}}function wx(a){var l=a.alternate;return a===Fn||l!==null&&l===Fn}function Ex(a,l){Sc=ud=!0;var d=a.pending;d===null?l.next=l:(l.next=d.next,d.next=l),a.pending=l}function Mx(a,l,d){if((d&4194240)!==0){var g=l.lanes;g&=a.pendingLanes,d|=g,l.lanes=d,xn(a,d)}}var hd={readContext:rr,useCallback:gi,useContext:gi,useEffect:gi,useImperativeHandle:gi,useInsertionEffect:gi,useLayoutEffect:gi,useMemo:gi,useReducer:gi,useRef:gi,useState:gi,useDebugValue:gi,useDeferredValue:gi,useTransition:gi,useMutableSource:gi,useSyncExternalStore:gi,useId:gi,unstable_isNewReconciler:!1},CP={readContext:rr,useCallback:function(a,l){return Gr().memoizedState=[a,l===void 0?null:l],a},useContext:rr,useEffect:px,useImperativeHandle:function(a,l,d){return d=d!=null?d.concat([a]):null,dd(4194308,4,vx.bind(null,l,a),d)},useLayoutEffect:function(a,l){return dd(4194308,4,a,l)},useInsertionEffect:function(a,l){return dd(4,2,a,l)},useMemo:function(a,l){var d=Gr();return l=l===void 0?null:l,a=a(),d.memoizedState=[a,l],a},useReducer:function(a,l,d){var g=Gr();return l=d!==void 0?d(l):l,g.memoizedState=g.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},g.queue=a,a=a.dispatch=TP.bind(null,Fn,a),[g.memoizedState,a]},useRef:function(a){var l=Gr();return a={current:a},l.memoizedState=a},useState:fx,useDebugValue:Up,useDeferredValue:function(a){return Gr().memoizedState=a},useTransition:function(){var a=fx(!1),l=a[0];return a=MP.bind(null,a[1]),Gr().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,d){var g=Fn,b=Gr();if(Ln){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),si===null)throw Error(n(349));(za&30)!==0||ox(g,l,d)}b.memoizedState=d;var E={value:d,getSnapshot:l};return b.queue=E,px(cx.bind(null,g,E,a),[a]),g.flags|=2048,Mc(9,lx.bind(null,g,E,d,l),void 0,null),d},useId:function(){var a=Gr(),l=si.identifierPrefix;if(Ln){var d=ys,g=vs;d=(g&~(1<<32-He(g)-1)).toString(32)+d,l=":"+l+"R"+d,d=wc++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=EP++,l=":"+l+"r"+d.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},RP={readContext:rr,useCallback:_x,useContext:rr,useEffect:Ip,useImperativeHandle:yx,useInsertionEffect:mx,useLayoutEffect:gx,useMemo:xx,useReducer:Dp,useRef:hx,useState:function(){return Dp(Ec)},useDebugValue:Up,useDeferredValue:function(a){var l=sr();return bx(l,Zn.memoizedState,a)},useTransition:function(){var a=Dp(Ec)[0],l=sr().memoizedState;return[a,l]},useMutableSource:sx,useSyncExternalStore:ax,useId:Sx,unstable_isNewReconciler:!1},PP={readContext:rr,useCallback:_x,useContext:rr,useEffect:Ip,useImperativeHandle:yx,useInsertionEffect:mx,useLayoutEffect:gx,useMemo:xx,useReducer:Np,useRef:hx,useState:function(){return Np(Ec)},useDebugValue:Up,useDeferredValue:function(a){var l=sr();return Zn===null?l.memoizedState=a:bx(l,Zn.memoizedState,a)},useTransition:function(){var a=Np(Ec)[0],l=sr().memoizedState;return[a,l]},useMutableSource:sx,useSyncExternalStore:ax,useId:Sx,unstable_isNewReconciler:!1};function Mr(a,l){if(a&&a.defaultProps){l=Z({},l),a=a.defaultProps;for(var d in a)l[d]===void 0&&(l[d]=a[d]);return l}return l}function Fp(a,l,d,g){l=a.memoizedState,d=d(g,l),d=d==null?l:Z({},l,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var pd={isMounted:function(a){return(a=a._reactInternals)?Qe(a)===a:!1},enqueueSetState:function(a,l,d){a=a._reactInternals;var g=Ai(),b=aa(a),E=xs(g,b);E.payload=l,d!=null&&(E.callback=d),l=na(a,E,b),l!==null&&(Cr(l,a,b,g),ad(l,a,b))},enqueueReplaceState:function(a,l,d){a=a._reactInternals;var g=Ai(),b=aa(a),E=xs(g,b);E.tag=1,E.payload=l,d!=null&&(E.callback=d),l=na(a,E,b),l!==null&&(Cr(l,a,b,g),ad(l,a,b))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var d=Ai(),g=aa(a),b=xs(d,g);b.tag=2,l!=null&&(b.callback=l),l=na(a,b,g),l!==null&&(Cr(l,a,g,d),ad(l,a,g))}};function Tx(a,l,d,g,b,E,k){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,E,k):l.prototype&&l.prototype.isPureReactComponent?!dc(d,g)||!dc(b,E):!0}function Ax(a,l,d){var g=!1,b=Qs,E=l.contextType;return typeof E=="object"&&E!==null?E=rr(E):(b=Fi(l)?Ia:mi.current,g=l.contextTypes,E=(g=g!=null)?Vo(a,b):Qs),l=new l(d,E),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=pd,a.stateNode=l,l._reactInternals=a,g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=E),l}function Cx(a,l,d,g){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,g),l.state!==a&&pd.enqueueReplaceState(l,l.state,null)}function Op(a,l,d,g){var b=a.stateNode;b.props=d,b.state=a.memoizedState,b.refs={},Ep(a);var E=l.contextType;typeof E=="object"&&E!==null?b.context=rr(E):(E=Fi(l)?Ia:mi.current,b.context=Vo(a,E)),b.state=a.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(Fp(a,l,E,d),b.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(l=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),l!==b.state&&pd.enqueueReplaceState(b,b.state,null),od(a,d,b,g),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308)}function Yo(a,l){try{var d="",g=l;do d+=Ue(g),g=g.return;while(g);var b=d}catch(E){b=`
|
|
8
8
|
Error generating stack: `+E.message+`
|
|
9
|
-
`+E.stack}return{value:a,source:l,stack:b,digest:null}}function Bp(a,l,d){return{value:a,source:null,stack:d??null,digest:l??null}}function zp(a,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var kP=typeof WeakMap=="function"?WeakMap:Map;function Rx(a,l,d){d=xs(-1,d),d.tag=3,d.payload={element:null};var g=l.value;return d.callback=function(){bd||(bd=!0,tm=g),zp(a,l)},d}function Px(a,l,d){d=xs(-1,d),d.tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var b=l.value;d.payload=function(){return g(b)},d.callback=function(){zp(a,l)}}var E=a.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(d.callback=function(){zp(a,l),typeof g!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var k=l.stack;this.componentDidCatch(l.value,{componentStack:k!==null?k:""})}),d}function kx(a,l,d){var g=a.pingCache;if(g===null){g=a.pingCache=new kP;var b=new Set;g.set(l,b)}else b=g.get(l),b===void 0&&(b=new Set,g.set(l,b));b.has(d)||(b.add(d),a=jP.bind(null,a,l,d),l.then(a,a))}function Lx(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function Dx(a,l,d,g,b){return(a.mode&1)===0?(a===l?a.flags|=65536:(a.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=xs(-1,1),l.tag=2,na(d,l,1))),d.lanes|=1),a):(a.flags|=65536,a.lanes=b,a)}var LP=T.ReactCurrentOwner,Oi=!1;function Ti(a,l,d,g){l.child=a===null?Q_(l,null,d,g):jo(l,a.child,d,g)}function Nx(a,l,d,g,b){d=d.render;var E=l.ref;return Xo(l,b),g=kp(a,l,d,g,E,b),d=Lp(),a!==null&&!Oi?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~b,bs(a,l,b)):(Ln&&d&&pp(l),l.flags|=1,Ti(a,l,g,b),l.child)}function Ix(a,l,d,g,b){if(a===null){var E=d.type;return typeof E=="function"&&!lm(E)&&E.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=E,Ux(a,l,E,g,b)):(a=Ad(d.type,null,g,l,l.mode,b),a.ref=l.ref,a.return=l,l.child=a)}if(E=a.child,(a.lanes&b)===0){var k=E.memoizedProps;if(d=d.compare,d=d!==null?d:dc,d(k,g)&&a.ref===l.ref)return bs(a,l,b)}return l.flags|=1,a=la(E,g),a.ref=l.ref,a.return=l,l.child=a}function Ux(a,l,d,g,b){if(a!==null){var E=a.memoizedProps;if(dc(E,g)&&a.ref===l.ref)if(Oi=!1,l.pendingProps=g=E,(a.lanes&b)!==0)(a.flags&131072)!==0&&(Oi=!0);else return l.lanes=a.lanes,bs(a,l,b)}return Vp(a,l,d,g,b)}function Fx(a,l,d){var g=l.pendingProps,b=g.children,E=a!==null?a.memoizedState:null;if(g.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},An(Zo,qi),qi|=d;else{if((d&1073741824)===0)return a=E!==null?E.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,An(Zo,qi),qi|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=E!==null?E.baseLanes:d,An(Zo,qi),qi|=g}else E!==null?(g=E.baseLanes|d,l.memoizedState=null):g=d,An(Zo,qi),qi|=g;return Ti(a,l,b,d),l.child}function Ox(a,l){var d=l.ref;(a===null&&d!==null||a!==null&&a.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function Vp(a,l,d,g,b){var E=Fi(d)?Ia:mi.current;return E=Vo(l,E),Xo(l,b),d=kp(a,l,d,g,E,b),g=Lp(),a!==null&&!Oi?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~b,bs(a,l,b)):(Ln&&g&&pp(l),l.flags|=1,Ti(a,l,d,b),l.child)}function Bx(a,l,d,g,b){if(Fi(d)){var E=!0;Ju(l)}else E=!1;if(Xo(l,b),l.stateNode===null)gd(a,l),Ax(l,d,g),Op(l,d,g,b),g=!0;else if(a===null){var k=l.stateNode,j=l.memoizedProps;k.props=j;var te=k.context,ge=d.contextType;typeof ge=="object"&&ge!==null?ge=rr(ge):(ge=Fi(d)?Ia:mi.current,ge=Vo(l,ge));var Ce=d.getDerivedStateFromProps,De=typeof Ce=="function"||typeof k.getSnapshotBeforeUpdate=="function";De||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(j!==g||te!==ge)&&Cx(l,k,g,ge),ta=!1;var Ae=l.memoizedState;k.state=Ae,od(l,g,k,b),te=l.memoizedState,j!==g||Ae!==te||Ui.current||ta?(typeof Ce=="function"&&(Fp(l,d,Ce,g),te=l.memoizedState),(j=ta||Tx(l,d,j,g,Ae,te,ge))?(De||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(l.flags|=4194308)):(typeof k.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=te),k.props=g,k.state=te,k.context=ge,g=j):(typeof k.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{k=l.stateNode,tx(a,l),j=l.memoizedProps,ge=l.type===l.elementType?j:Mr(l.type,j),k.props=ge,De=l.pendingProps,Ae=k.context,te=d.contextType,typeof te=="object"&&te!==null?te=rr(te):(te=Fi(d)?Ia:mi.current,te=Vo(l,te));var nt=d.getDerivedStateFromProps;(Ce=typeof nt=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(j!==De||Ae!==te)&&Cx(l,k,g,te),ta=!1,Ae=l.memoizedState,k.state=Ae,od(l,g,k,b);var ut=l.memoizedState;j!==De||Ae!==ut||Ui.current||ta?(typeof nt=="function"&&(Fp(l,d,nt,g),ut=l.memoizedState),(ge=ta||Tx(l,d,ge,g,Ae,ut,te)||!1)?(Ce||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,ut,te),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,ut,te)),typeof k.componentDidUpdate=="function"&&(l.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof k.componentDidUpdate!="function"||j===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=ut),k.props=g,k.state=ut,k.context=te,g=ge):(typeof k.componentDidUpdate!="function"||j===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=1024),g=!1)}return Hp(a,l,d,g,E,b)}function Hp(a,l,d,g,b,E){Ox(a,l);var k=(l.flags&128)!==0;if(!g&&!k)return b&&W_(l,d,!1),bs(a,l,E);g=l.stateNode,LP.current=l;var j=k&&typeof d.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,a!==null&&k?(l.child=jo(l,a.child,null,E),l.child=jo(l,null,j,E)):Ti(a,l,j,E),l.memoizedState=g.state,b&&W_(l,d,!0),l.child}function zx(a){var l=a.stateNode;l.pendingContext?H_(a,l.pendingContext,l.pendingContext!==l.context):l.context&&H_(a,l.context,!1),Mp(a,l.containerInfo)}function Vx(a,l,d,g,b){return Wo(),yp(b),l.flags|=256,Ti(a,l,d,g),l.child}var Gp={dehydrated:null,treeContext:null,retryLane:0};function Wp(a){return{baseLanes:a,cachePool:null,transitions:null}}function Hx(a,l,d){var g=l.pendingProps,b=Un.current,E=!1,k=(l.flags&128)!==0,j;if((j=k)||(j=a!==null&&a.memoizedState===null?!1:(b&2)!==0),j?(E=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(b|=1),An(Un,b&1),a===null)return vp(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((l.mode&1)===0?l.lanes=1:a.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(k=g.children,a=g.fallback,E?(g=l.mode,E=l.child,k={mode:"hidden",children:k},(g&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=k):E=Cd(k,g,0,null),a=ja(a,g,d,null),E.return=l,a.return=l,E.sibling=a,l.child=E,l.child.memoizedState=Wp(d),l.memoizedState=Gp,a):jp(l,k));if(b=a.memoizedState,b!==null&&(j=b.dehydrated,j!==null))return DP(a,l,k,g,j,b,d);if(E){E=g.fallback,k=l.mode,b=a.child,j=b.sibling;var te={mode:"hidden",children:g.children};return(k&1)===0&&l.child!==b?(g=l.child,g.childLanes=0,g.pendingProps=te,l.deletions=null):(g=la(b,te),g.subtreeFlags=b.subtreeFlags&14680064),j!==null?E=la(j,E):(E=ja(E,k,d,null),E.flags|=2),E.return=l,g.return=l,g.sibling=E,l.child=g,g=E,E=l.child,k=a.child.memoizedState,k=k===null?Wp(d):{baseLanes:k.baseLanes|d,cachePool:null,transitions:k.transitions},E.memoizedState=k,E.childLanes=a.childLanes&~d,l.memoizedState=Gp,g}return E=a.child,a=E.sibling,g=la(E,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=d),g.return=l,g.sibling=null,a!==null&&(d=l.deletions,d===null?(l.deletions=[a],l.flags|=16):d.push(a)),l.child=g,l.memoizedState=null,g}function jp(a,l){return l=Cd({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function md(a,l,d,g){return g!==null&&yp(g),jo(l,a.child,null,d),a=jp(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function DP(a,l,d,g,b,E,k){if(d)return l.flags&256?(l.flags&=-257,g=Bp(Error(n(422))),md(a,l,k,g)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(E=g.fallback,b=l.mode,g=Cd({mode:"visible",children:g.children},b,0,null),E=ja(E,b,k,null),E.flags|=2,g.return=l,E.return=l,g.sibling=E,l.child=g,(l.mode&1)!==0&&jo(l,a.child,null,k),l.child.memoizedState=Wp(k),l.memoizedState=Gp,E);if((l.mode&1)===0)return md(a,l,k,null);if(b.data==="$!"){if(g=b.nextSibling&&b.nextSibling.dataset,g)var j=g.dgst;return g=j,E=Error(n(419)),g=Bp(E,g,void 0),md(a,l,k,g)}if(j=(k&a.childLanes)!==0,Oi||j){if(g=si,g!==null){switch(k&-k){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(g.suspendedLanes|k))!==0?0:b,b!==0&&b!==E.retryLane&&(E.retryLane=b,_s(a,b),Cr(g,a,b,-1))}return om(),g=Bp(Error(n(421))),md(a,l,k,g)}return b.data==="$?"?(l.flags|=128,l.child=a.child,l=$P.bind(null,a),b._reactRetry=l,null):(a=E.treeContext,Xi=Zs(b.nextSibling),$i=l,Ln=!0,Er=null,a!==null&&(nr[ir++]=vs,nr[ir++]=ys,nr[ir++]=Ua,vs=a.id,ys=a.overflow,Ua=l),l=jp(l,g.children),l.flags|=4096,l)}function Gx(a,l,d){a.lanes|=l;var g=a.alternate;g!==null&&(g.lanes|=l),Sp(a.return,l,d)}function $p(a,l,d,g,b){var E=a.memoizedState;E===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:b}:(E.isBackwards=l,E.rendering=null,E.renderingStartTime=0,E.last=g,E.tail=d,E.tailMode=b)}function Wx(a,l,d){var g=l.pendingProps,b=g.revealOrder,E=g.tail;if(Ti(a,l,g.children,d),g=Un.current,(g&2)!==0)g=g&1|2,l.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Gx(a,d,l);else if(a.tag===19)Gx(a,d,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if(An(Un,g),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(d=l.child,b=null;d!==null;)a=d.alternate,a!==null&&ld(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),$p(l,!1,b,d,E);break;case"backwards":for(d=null,b=l.child,l.child=null;b!==null;){if(a=b.alternate,a!==null&&ld(a)===null){l.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}$p(l,!0,d,null,E);break;case"together":$p(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function gd(a,l){(l.mode&1)===0&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function bs(a,l,d){if(a!==null&&(l.dependencies=a.dependencies),Va|=l.lanes,(d&l.childLanes)===0)return null;if(a!==null&&l.child!==a.child)throw Error(n(153));if(l.child!==null){for(a=l.child,d=la(a,a.pendingProps),l.child=d,d.return=l;a.sibling!==null;)a=a.sibling,d=d.sibling=la(a,a.pendingProps),d.return=l;d.sibling=null}return l.child}function NP(a,l,d){switch(l.tag){case 3:zx(l),Wo();break;case 5:rx(l);break;case 1:Fi(l.type)&&Ju(l);break;case 4:Mp(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,b=l.memoizedProps.value;An(rd,g._currentValue),g._currentValue=b;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(An(Un,Un.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?Hx(a,l,d):(An(Un,Un.current&1),a=bs(a,l,d),a!==null?a.sibling:null);An(Un,Un.current&1);break;case 19:if(g=(d&l.childLanes)!==0,(a.flags&128)!==0){if(g)return Wx(a,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),An(Un,Un.current),g)break;return null;case 22:case 23:return l.lanes=0,Fx(a,l,d)}return bs(a,l,d)}var jx,Xp,$x,Xx;jx=function(a,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)a.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Xp=function(){},$x=function(a,l,d,g){var b=a.memoizedProps;if(b!==g){a=l.stateNode,Ba(Hr.current);var E=null;switch(d){case"input":b=Ut(a,b),g=Ut(a,g),E=[];break;case"select":b=Z({},b,{value:void 0}),g=Z({},g,{value:void 0}),E=[];break;case"textarea":b=it(a,b),g=it(a,g),E=[];break;default:typeof b.onClick!="function"&&typeof g.onClick=="function"&&(a.onclick=Yu)}rt(d,g);var k;d=null;for(ge in b)if(!g.hasOwnProperty(ge)&&b.hasOwnProperty(ge)&&b[ge]!=null)if(ge==="style"){var j=b[ge];for(k in j)j.hasOwnProperty(k)&&(d||(d={}),d[k]="")}else ge!=="dangerouslySetInnerHTML"&&ge!=="children"&&ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&ge!=="autoFocus"&&(r.hasOwnProperty(ge)?E||(E=[]):(E=E||[]).push(ge,null));for(ge in g){var te=g[ge];if(j=b?.[ge],g.hasOwnProperty(ge)&&te!==j&&(te!=null||j!=null))if(ge==="style")if(j){for(k in j)!j.hasOwnProperty(k)||te&&te.hasOwnProperty(k)||(d||(d={}),d[k]="");for(k in te)te.hasOwnProperty(k)&&j[k]!==te[k]&&(d||(d={}),d[k]=te[k])}else d||(E||(E=[]),E.push(ge,d)),d=te;else ge==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,j=j?j.__html:void 0,te!=null&&j!==te&&(E=E||[]).push(ge,te)):ge==="children"?typeof te!="string"&&typeof te!="number"||(E=E||[]).push(ge,""+te):ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&(r.hasOwnProperty(ge)?(te!=null&&ge==="onScroll"&&Cn("scroll",a),E||j===te||(E=[])):(E=E||[]).push(ge,te))}d&&(E=E||[]).push("style",d);var ge=E;(l.updateQueue=ge)&&(l.flags|=4)}},Xx=function(a,l,d,g){d!==g&&(l.flags|=4)};function Tc(a,l){if(!Ln)switch(a.tailMode){case"hidden":l=a.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function vi(a){var l=a.alternate!==null&&a.alternate.child===a.child,d=0,g=0;if(l)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags&14680064,g|=b.flags&14680064,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=g,a.childLanes=d,l}function IP(a,l,d){var g=l.pendingProps;switch(mp(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vi(l),null;case 1:return Fi(l.type)&&Zu(),vi(l),null;case 3:return g=l.stateNode,qo(),Rn(Ui),Rn(mi),Cp(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(a===null||a.child===null)&&(nd(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Er!==null&&(rm(Er),Er=null))),Xp(a,l),vi(l),null;case 5:Tp(l);var b=Ba(bc.current);if(d=l.type,a!==null&&l.stateNode!=null)$x(a,l,d,g,b),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(n(166));return vi(l),null}if(a=Ba(Hr.current),nd(l)){g=l.stateNode,d=l.type;var E=l.memoizedProps;switch(g[Vr]=l,g[gc]=E,a=(l.mode&1)!==0,d){case"dialog":Cn("cancel",g),Cn("close",g);break;case"iframe":case"object":case"embed":Cn("load",g);break;case"video":case"audio":for(b=0;b<hc.length;b++)Cn(hc[b],g);break;case"source":Cn("error",g);break;case"img":case"image":case"link":Cn("error",g),Cn("load",g);break;case"details":Cn("toggle",g);break;case"input":nn(g,E),Cn("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!E.multiple},Cn("invalid",g);break;case"textarea":O(g,E),Cn("invalid",g)}rt(d,E),b=null;for(var k in E)if(E.hasOwnProperty(k)){var j=E[k];k==="children"?typeof j=="string"?g.textContent!==j&&(E.suppressHydrationWarning!==!0&&qu(g.textContent,j,a),b=["children",j]):typeof j=="number"&&g.textContent!==""+j&&(E.suppressHydrationWarning!==!0&&qu(g.textContent,j,a),b=["children",""+j]):r.hasOwnProperty(k)&&j!=null&&k==="onScroll"&&Cn("scroll",g)}switch(d){case"input":xt(g),ee(g,E,!0);break;case"textarea":xt(g),re(g);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(g.onclick=Yu)}g=b,l.updateQueue=g,g!==null&&(l.flags|=4)}else{k=b.nodeType===9?b:b.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=xe(d)),a==="http://www.w3.org/1999/xhtml"?d==="script"?(a=k.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=k.createElement(d,{is:g.is}):(a=k.createElement(d),d==="select"&&(k=a,g.multiple?k.multiple=!0:g.size&&(k.size=g.size))):a=k.createElementNS(a,d),a[Vr]=l,a[gc]=g,jx(a,l,!1,!1),l.stateNode=a;e:{switch(k=$e(d,g),d){case"dialog":Cn("cancel",a),Cn("close",a),b=g;break;case"iframe":case"object":case"embed":Cn("load",a),b=g;break;case"video":case"audio":for(b=0;b<hc.length;b++)Cn(hc[b],a);b=g;break;case"source":Cn("error",a),b=g;break;case"img":case"image":case"link":Cn("error",a),Cn("load",a),b=g;break;case"details":Cn("toggle",a),b=g;break;case"input":nn(a,g),b=Ut(a,g),Cn("invalid",a);break;case"option":b=g;break;case"select":a._wrapperState={wasMultiple:!!g.multiple},b=Z({},g,{value:void 0}),Cn("invalid",a);break;case"textarea":O(a,g),b=it(a,g),Cn("invalid",a);break;default:b=g}rt(d,b),j=b;for(E in j)if(j.hasOwnProperty(E)){var te=j[E];E==="style"?Be(a,te):E==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Ke(a,te)):E==="children"?typeof te=="string"?(d!=="textarea"||te!=="")&&ke(a,te):typeof te=="number"&&ke(a,""+te):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(r.hasOwnProperty(E)?te!=null&&E==="onScroll"&&Cn("scroll",a):te!=null&&A(a,E,te,k))}switch(d){case"input":xt(a),ee(a,g,!1);break;case"textarea":xt(a),re(a);break;case"option":g.value!=null&&a.setAttribute("value",""+Se(g.value));break;case"select":a.multiple=!!g.multiple,E=g.value,E!=null?kt(a,!!g.multiple,E,!1):g.defaultValue!=null&&kt(a,!!g.multiple,g.defaultValue,!0);break;default:typeof b.onClick=="function"&&(a.onclick=Yu)}switch(d){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return vi(l),null;case 6:if(a&&l.stateNode!=null)Xx(a,l,a.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(n(166));if(d=Ba(bc.current),Ba(Hr.current),nd(l)){if(g=l.stateNode,d=l.memoizedProps,g[Vr]=l,(E=g.nodeValue!==d)&&(a=$i,a!==null))switch(a.tag){case 3:qu(g.nodeValue,d,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&qu(g.nodeValue,d,(a.mode&1)!==0)}E&&(l.flags|=4)}else g=(d.nodeType===9?d:d.ownerDocument).createTextNode(g),g[Vr]=l,l.stateNode=g}return vi(l),null;case 13:if(Rn(Un),g=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(Ln&&Xi!==null&&(l.mode&1)!==0&&(l.flags&128)===0)K_(),Wo(),l.flags|=98560,E=!1;else if(E=nd(l),g!==null&&g.dehydrated!==null){if(a===null){if(!E)throw Error(n(318));if(E=l.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[Vr]=l}else Wo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;vi(l),E=!1}else Er!==null&&(rm(Er),Er=null),E=!0;if(!E)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(g=g!==null,g!==(a!==null&&a.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(a===null||(Un.current&1)!==0?Jn===0&&(Jn=3):om())),l.updateQueue!==null&&(l.flags|=4),vi(l),null);case 4:return qo(),Xp(a,l),a===null&&pc(l.stateNode.containerInfo),vi(l),null;case 10:return bp(l.type._context),vi(l),null;case 17:return Fi(l.type)&&Zu(),vi(l),null;case 19:if(Rn(Un),E=l.memoizedState,E===null)return vi(l),null;if(g=(l.flags&128)!==0,k=E.rendering,k===null)if(g)Tc(E,!1);else{if(Jn!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(k=ld(a),k!==null){for(l.flags|=128,Tc(E,!1),g=k.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=d,d=l.child;d!==null;)E=d,a=g,E.flags&=14680066,k=E.alternate,k===null?(E.childLanes=0,E.lanes=a,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=k.childLanes,E.lanes=k.lanes,E.child=k.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=k.memoizedProps,E.memoizedState=k.memoizedState,E.updateQueue=k.updateQueue,E.type=k.type,a=k.dependencies,E.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),d=d.sibling;return An(Un,Un.current&1|2),l.child}a=a.sibling}E.tail!==null&&L()>Jo&&(l.flags|=128,g=!0,Tc(E,!1),l.lanes=4194304)}else{if(!g)if(a=ld(k),a!==null){if(l.flags|=128,g=!0,d=a.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),Tc(E,!0),E.tail===null&&E.tailMode==="hidden"&&!k.alternate&&!Ln)return vi(l),null}else 2*L()-E.renderingStartTime>Jo&&d!==1073741824&&(l.flags|=128,g=!0,Tc(E,!1),l.lanes=4194304);E.isBackwards?(k.sibling=l.child,l.child=k):(d=E.last,d!==null?d.sibling=k:l.child=k,E.last=k)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=L(),l.sibling=null,d=Un.current,An(Un,g?d&1|2:d&1),l):(vi(l),null);case 22:case 23:return am(),g=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(l.flags|=8192),g&&(l.mode&1)!==0?(qi&1073741824)!==0&&(vi(l),l.subtreeFlags&6&&(l.flags|=8192)):vi(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function UP(a,l){switch(mp(l),l.tag){case 1:return Fi(l.type)&&Zu(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return qo(),Rn(Ui),Rn(mi),Cp(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 5:return Tp(l),null;case 13:if(Rn(Un),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Wo()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Rn(Un),null;case 4:return qo(),null;case 10:return bp(l.type._context),null;case 22:case 23:return am(),null;case 24:return null;default:return null}}var vd=!1,yi=!1,FP=typeof WeakSet=="function"?WeakSet:Set,at=null;function Ko(a,l){var d=a.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){On(a,l,g)}else d.current=null}function qp(a,l,d){try{d()}catch(g){On(a,l,g)}}var qx=!1;function OP(a,l){if(ap=Fu,a=T_(),Jh(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var b=g.anchorOffset,E=g.focusNode;g=g.focusOffset;try{d.nodeType,E.nodeType}catch{d=null;break e}var k=0,j=-1,te=-1,ge=0,Ce=0,De=a,Ae=null;t:for(;;){for(var nt;De!==d||b!==0&&De.nodeType!==3||(j=k+b),De!==E||g!==0&&De.nodeType!==3||(te=k+g),De.nodeType===3&&(k+=De.nodeValue.length),(nt=De.firstChild)!==null;)Ae=De,De=nt;for(;;){if(De===a)break t;if(Ae===d&&++ge===b&&(j=k),Ae===E&&++Ce===g&&(te=k),(nt=De.nextSibling)!==null)break;De=Ae,Ae=De.parentNode}De=nt}d=j===-1||te===-1?null:{start:j,end:te}}else d=null}d=d||{start:0,end:0}}else d=null;for(op={focusedElem:a,selectionRange:d},Fu=!1,at=l;at!==null;)if(l=at,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,at=a;else for(;at!==null;){l=at;try{var ut=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ut!==null){var gt=ut.memoizedProps,Hn=ut.memoizedState,ue=l.stateNode,se=ue.getSnapshotBeforeUpdate(l.elementType===l.type?gt:Mr(l.type,gt),Hn);ue.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var fe=l.stateNode.containerInfo;fe.nodeType===1?fe.textContent="":fe.nodeType===9&&fe.documentElement&&fe.removeChild(fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ze){On(l,l.return,ze)}if(a=l.sibling,a!==null){a.return=l.return,at=a;break}at=l.return}return ut=qx,qx=!1,ut}function Ac(a,l,d){var g=l.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var b=g=g.next;do{if((b.tag&a)===a){var E=b.destroy;b.destroy=void 0,E!==void 0&&qp(l,d,E)}b=b.next}while(b!==g)}}function yd(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&a)===a){var g=d.create;d.destroy=g()}d=d.next}while(d!==l)}}function Yp(a){var l=a.ref;if(l!==null){var d=a.stateNode;a.tag,a=d,typeof l=="function"?l(a):l.current=a}}function Yx(a){var l=a.alternate;l!==null&&(a.alternate=null,Yx(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[Vr],delete l[gc],delete l[dp],delete l[xP],delete l[bP])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Kx(a){return a.tag===5||a.tag===3||a.tag===4}function Zx(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Kx(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Kp(a,l,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(a,l):d.insertBefore(a,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(a,d)):(l=d,l.appendChild(a)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Yu));else if(g!==4&&(a=a.child,a!==null))for(Kp(a,l,d),a=a.sibling;a!==null;)Kp(a,l,d),a=a.sibling}function Zp(a,l,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,l?d.insertBefore(a,l):d.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(Zp(a,l,d),a=a.sibling;a!==null;)Zp(a,l,d),a=a.sibling}var ui=null,Tr=!1;function ia(a,l,d){for(d=d.child;d!==null;)Jx(a,l,d),d=d.sibling}function Jx(a,l,d){if(je&&typeof je.onCommitFiberUnmount=="function")try{je.onCommitFiberUnmount(Ge,d)}catch{}switch(d.tag){case 5:yi||Ko(d,l);case 6:var g=ui,b=Tr;ui=null,ia(a,l,d),ui=g,Tr=b,ui!==null&&(Tr?(a=ui,d=d.stateNode,a.nodeType===8?a.parentNode.removeChild(d):a.removeChild(d)):ui.removeChild(d.stateNode));break;case 18:ui!==null&&(Tr?(a=ui,d=d.stateNode,a.nodeType===8?up(a.parentNode,d):a.nodeType===1&&up(a,d),sc(a)):up(ui,d.stateNode));break;case 4:g=ui,b=Tr,ui=d.stateNode.containerInfo,Tr=!0,ia(a,l,d),ui=g,Tr=b;break;case 0:case 11:case 14:case 15:if(!yi&&(g=d.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){b=g=g.next;do{var E=b,k=E.destroy;E=E.tag,k!==void 0&&((E&2)!==0||(E&4)!==0)&&qp(d,l,k),b=b.next}while(b!==g)}ia(a,l,d);break;case 1:if(!yi&&(Ko(d,l),g=d.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(j){On(d,l,j)}ia(a,l,d);break;case 21:ia(a,l,d);break;case 22:d.mode&1?(yi=(g=yi)||d.memoizedState!==null,ia(a,l,d),yi=g):ia(a,l,d);break;default:ia(a,l,d)}}function Qx(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var d=a.stateNode;d===null&&(d=a.stateNode=new FP),l.forEach(function(g){var b=XP.bind(null,a,g);d.has(g)||(d.add(g),g.then(b,b))})}}function Ar(a,l){var d=l.deletions;if(d!==null)for(var g=0;g<d.length;g++){var b=d[g];try{var E=a,k=l,j=k;e:for(;j!==null;){switch(j.tag){case 5:ui=j.stateNode,Tr=!1;break e;case 3:ui=j.stateNode.containerInfo,Tr=!0;break e;case 4:ui=j.stateNode.containerInfo,Tr=!0;break e}j=j.return}if(ui===null)throw Error(n(160));Jx(E,k,b),ui=null,Tr=!1;var te=b.alternate;te!==null&&(te.return=null),b.return=null}catch(ge){On(b,l,ge)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)eb(l,a),l=l.sibling}function eb(a,l){var d=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Ar(l,a),Wr(a),g&4){try{Ac(3,a,a.return),yd(3,a)}catch(gt){On(a,a.return,gt)}try{Ac(5,a,a.return)}catch(gt){On(a,a.return,gt)}}break;case 1:Ar(l,a),Wr(a),g&512&&d!==null&&Ko(d,d.return);break;case 5:if(Ar(l,a),Wr(a),g&512&&d!==null&&Ko(d,d.return),a.flags&32){var b=a.stateNode;try{ke(b,"")}catch(gt){On(a,a.return,gt)}}if(g&4&&(b=a.stateNode,b!=null)){var E=a.memoizedProps,k=d!==null?d.memoizedProps:E,j=a.type,te=a.updateQueue;if(a.updateQueue=null,te!==null)try{j==="input"&&E.type==="radio"&&E.name!=null&&Lt(b,E),$e(j,k);var ge=$e(j,E);for(k=0;k<te.length;k+=2){var Ce=te[k],De=te[k+1];Ce==="style"?Be(b,De):Ce==="dangerouslySetInnerHTML"?Ke(b,De):Ce==="children"?ke(b,De):A(b,Ce,De,ge)}switch(j){case"input":an(b,E);break;case"textarea":P(b,E);break;case"select":var Ae=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!E.multiple;var nt=E.value;nt!=null?kt(b,!!E.multiple,nt,!1):Ae!==!!E.multiple&&(E.defaultValue!=null?kt(b,!!E.multiple,E.defaultValue,!0):kt(b,!!E.multiple,E.multiple?[]:"",!1))}b[gc]=E}catch(gt){On(a,a.return,gt)}}break;case 6:if(Ar(l,a),Wr(a),g&4){if(a.stateNode===null)throw Error(n(162));b=a.stateNode,E=a.memoizedProps;try{b.nodeValue=E}catch(gt){On(a,a.return,gt)}}break;case 3:if(Ar(l,a),Wr(a),g&4&&d!==null&&d.memoizedState.isDehydrated)try{sc(l.containerInfo)}catch(gt){On(a,a.return,gt)}break;case 4:Ar(l,a),Wr(a);break;case 13:Ar(l,a),Wr(a),b=a.child,b.flags&8192&&(E=b.memoizedState!==null,b.stateNode.isHidden=E,!E||b.alternate!==null&&b.alternate.memoizedState!==null||(em=L())),g&4&&Qx(a);break;case 22:if(Ce=d!==null&&d.memoizedState!==null,a.mode&1?(yi=(ge=yi)||Ce,Ar(l,a),yi=ge):Ar(l,a),Wr(a),g&8192){if(ge=a.memoizedState!==null,(a.stateNode.isHidden=ge)&&!Ce&&(a.mode&1)!==0)for(at=a,Ce=a.child;Ce!==null;){for(De=at=Ce;at!==null;){switch(Ae=at,nt=Ae.child,Ae.tag){case 0:case 11:case 14:case 15:Ac(4,Ae,Ae.return);break;case 1:Ko(Ae,Ae.return);var ut=Ae.stateNode;if(typeof ut.componentWillUnmount=="function"){g=Ae,d=Ae.return;try{l=g,ut.props=l.memoizedProps,ut.state=l.memoizedState,ut.componentWillUnmount()}catch(gt){On(g,d,gt)}}break;case 5:Ko(Ae,Ae.return);break;case 22:if(Ae.memoizedState!==null){ib(De);continue}}nt!==null?(nt.return=Ae,at=nt):ib(De)}Ce=Ce.sibling}e:for(Ce=null,De=a;;){if(De.tag===5){if(Ce===null){Ce=De;try{b=De.stateNode,ge?(E=b.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(j=De.stateNode,te=De.memoizedProps.style,k=te!=null&&te.hasOwnProperty("display")?te.display:null,j.style.display=Re("display",k))}catch(gt){On(a,a.return,gt)}}}else if(De.tag===6){if(Ce===null)try{De.stateNode.nodeValue=ge?"":De.memoizedProps}catch(gt){On(a,a.return,gt)}}else if((De.tag!==22&&De.tag!==23||De.memoizedState===null||De===a)&&De.child!==null){De.child.return=De,De=De.child;continue}if(De===a)break e;for(;De.sibling===null;){if(De.return===null||De.return===a)break e;Ce===De&&(Ce=null),De=De.return}Ce===De&&(Ce=null),De.sibling.return=De.return,De=De.sibling}}break;case 19:Ar(l,a),Wr(a),g&4&&Qx(a);break;case 21:break;default:Ar(l,a),Wr(a)}}function Wr(a){var l=a.flags;if(l&2){try{e:{for(var d=a.return;d!==null;){if(Kx(d)){var g=d;break e}d=d.return}throw Error(n(160))}switch(g.tag){case 5:var b=g.stateNode;g.flags&32&&(ke(b,""),g.flags&=-33);var E=Zx(a);Zp(a,E,b);break;case 3:case 4:var k=g.stateNode.containerInfo,j=Zx(a);Kp(a,j,k);break;default:throw Error(n(161))}}catch(te){On(a,a.return,te)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function BP(a,l,d){at=a,tb(a)}function tb(a,l,d){for(var g=(a.mode&1)!==0;at!==null;){var b=at,E=b.child;if(b.tag===22&&g){var k=b.memoizedState!==null||vd;if(!k){var j=b.alternate,te=j!==null&&j.memoizedState!==null||yi;j=vd;var ge=yi;if(vd=k,(yi=te)&&!ge)for(at=b;at!==null;)k=at,te=k.child,k.tag===22&&k.memoizedState!==null?rb(b):te!==null?(te.return=k,at=te):rb(b);for(;E!==null;)at=E,tb(E),E=E.sibling;at=b,vd=j,yi=ge}nb(a)}else(b.subtreeFlags&8772)!==0&&E!==null?(E.return=b,at=E):nb(a)}}function nb(a){for(;at!==null;){var l=at;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:yi||yd(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!yi)if(d===null)g.componentDidMount();else{var b=l.elementType===l.type?d.memoizedProps:Mr(l.type,d.memoizedProps);g.componentDidUpdate(b,d.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var E=l.updateQueue;E!==null&&ix(l,E,g);break;case 3:var k=l.updateQueue;if(k!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}ix(l,k,d)}break;case 5:var j=l.stateNode;if(d===null&&l.flags&4){d=j;var te=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&d.focus();break;case"img":te.src&&(d.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ge=l.alternate;if(ge!==null){var Ce=ge.memoizedState;if(Ce!==null){var De=Ce.dehydrated;De!==null&&sc(De)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yi||l.flags&512&&Yp(l)}catch(Ae){On(l,l.return,Ae)}}if(l===a){at=null;break}if(d=l.sibling,d!==null){d.return=l.return,at=d;break}at=l.return}}function ib(a){for(;at!==null;){var l=at;if(l===a){at=null;break}var d=l.sibling;if(d!==null){d.return=l.return,at=d;break}at=l.return}}function rb(a){for(;at!==null;){var l=at;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{yd(4,l)}catch(te){On(l,d,te)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var b=l.return;try{g.componentDidMount()}catch(te){On(l,b,te)}}var E=l.return;try{Yp(l)}catch(te){On(l,E,te)}break;case 5:var k=l.return;try{Yp(l)}catch(te){On(l,k,te)}}}catch(te){On(l,l.return,te)}if(l===a){at=null;break}var j=l.sibling;if(j!==null){j.return=l.return,at=j;break}at=l.return}}var zP=Math.ceil,_d=T.ReactCurrentDispatcher,Jp=T.ReactCurrentOwner,ar=T.ReactCurrentBatchConfig,dn=0,si=null,Wn=null,di=0,qi=0,Zo=Js(0),Jn=0,Cc=null,Va=0,xd=0,Qp=0,Rc=null,Bi=null,em=0,Jo=1/0,Ss=null,bd=!1,tm=null,ra=null,Sd=!1,sa=null,wd=0,Pc=0,nm=null,Ed=-1,Md=0;function Ai(){return(dn&6)!==0?L():Ed!==-1?Ed:Ed=L()}function aa(a){return(a.mode&1)===0?1:(dn&2)!==0&&di!==0?di&-di:wP.transition!==null?(Md===0&&(Md=Ni()),Md):(a=Ft,a!==0||(a=window.event,a=a===void 0?16:a_(a.type)),a)}function Cr(a,l,d,g){if(50<Pc)throw Pc=0,nm=null,Error(n(185));Wi(a,d,g),((dn&2)===0||a!==si)&&(a===si&&((dn&2)===0&&(xd|=d),Jn===4&&oa(a,di)),zi(a,g),d===1&&dn===0&&(l.mode&1)===0&&(Jo=L()+500,Qu&&ea()))}function zi(a,l){var d=a.callbackNode;Mi(a,l);var g=In(a,a===si?di:0);if(g===0)d!==null&&Nn(d),a.callbackNode=null,a.callbackPriority=0;else if(l=g&-g,a.callbackPriority!==l){if(d!=null&&Nn(d),l===1)a.tag===0?SP(ab.bind(null,a)):j_(ab.bind(null,a)),yP(function(){(dn&6)===0&&ea()}),d=null;else{switch(Sr(g)){case 1:d=pe;break;case 4:d=de;break;case 16:d=ce;break;case 536870912:d=qe;break;default:d=ce}d=pb(d,sb.bind(null,a))}a.callbackPriority=l,a.callbackNode=d}}function sb(a,l){if(Ed=-1,Md=0,(dn&6)!==0)throw Error(n(327));var d=a.callbackNode;if(Qo()&&a.callbackNode!==d)return null;var g=In(a,a===si?di:0);if(g===0)return null;if((g&30)!==0||(g&a.expiredLanes)!==0||l)l=Td(a,g);else{l=g;var b=dn;dn|=2;var E=lb();(si!==a||di!==l)&&(Ss=null,Jo=L()+500,Ga(a,l));do try{GP();break}catch(j){ob(a,j)}while(!0);xp(),_d.current=E,dn=b,Wn!==null?l=0:(si=null,di=0,l=Jn)}if(l!==0){if(l===2&&(b=rn(a),b!==0&&(g=b,l=im(a,b))),l===1)throw d=Cc,Ga(a,0),oa(a,g),zi(a,L()),d;if(l===6)oa(a,g);else{if(b=a.current.alternate,(g&30)===0&&!VP(b)&&(l=Td(a,g),l===2&&(E=rn(a),E!==0&&(g=E,l=im(a,E))),l===1))throw d=Cc,Ga(a,0),oa(a,g),zi(a,L()),d;switch(a.finishedWork=b,a.finishedLanes=g,l){case 0:case 1:throw Error(n(345));case 2:Wa(a,Bi,Ss);break;case 3:if(oa(a,g),(g&130023424)===g&&(l=em+500-L(),10<l)){if(In(a,0)!==0)break;if(b=a.suspendedLanes,(b&g)!==g){Ai(),a.pingedLanes|=a.suspendedLanes&b;break}a.timeoutHandle=cp(Wa.bind(null,a,Bi,Ss),l);break}Wa(a,Bi,Ss);break;case 4:if(oa(a,g),(g&4194240)===g)break;for(l=a.eventTimes,b=-1;0<g;){var k=31-He(g);E=1<<k,k=l[k],k>b&&(b=k),g&=~E}if(g=b,g=L()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*zP(g/1960))-g,10<g){a.timeoutHandle=cp(Wa.bind(null,a,Bi,Ss),g);break}Wa(a,Bi,Ss);break;case 5:Wa(a,Bi,Ss);break;default:throw Error(n(329))}}}return zi(a,L()),a.callbackNode===d?sb.bind(null,a):null}function im(a,l){var d=Rc;return a.current.memoizedState.isDehydrated&&(Ga(a,l).flags|=256),a=Td(a,l),a!==2&&(l=Bi,Bi=d,l!==null&&rm(l)),a}function rm(a){Bi===null?Bi=a:Bi.push.apply(Bi,a)}function VP(a){for(var l=a;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var g=0;g<d.length;g++){var b=d[g],E=b.getSnapshot;b=b.value;try{if(!wr(E(),b))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function oa(a,l){for(l&=~Qp,l&=~xd,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var d=31-He(l),g=1<<d;a[d]=-1,l&=~g}}function ab(a){if((dn&6)!==0)throw Error(n(327));Qo();var l=In(a,0);if((l&1)===0)return zi(a,L()),null;var d=Td(a,l);if(a.tag!==0&&d===2){var g=rn(a);g!==0&&(l=g,d=im(a,g))}if(d===1)throw d=Cc,Ga(a,0),oa(a,l),zi(a,L()),d;if(d===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Wa(a,Bi,Ss),zi(a,L()),null}function sm(a,l){var d=dn;dn|=1;try{return a(l)}finally{dn=d,dn===0&&(Jo=L()+500,Qu&&ea())}}function Ha(a){sa!==null&&sa.tag===0&&(dn&6)===0&&Qo();var l=dn;dn|=1;var d=ar.transition,g=Ft;try{if(ar.transition=null,Ft=1,a)return a()}finally{Ft=g,ar.transition=d,dn=l,(dn&6)===0&&ea()}}function am(){qi=Zo.current,Rn(Zo)}function Ga(a,l){a.finishedWork=null,a.finishedLanes=0;var d=a.timeoutHandle;if(d!==-1&&(a.timeoutHandle=-1,vP(d)),Wn!==null)for(d=Wn.return;d!==null;){var g=d;switch(mp(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&Zu();break;case 3:qo(),Rn(Ui),Rn(mi),Cp();break;case 5:Tp(g);break;case 4:qo();break;case 13:Rn(Un);break;case 19:Rn(Un);break;case 10:bp(g.type._context);break;case 22:case 23:am()}d=d.return}if(si=a,Wn=a=la(a.current,null),di=qi=l,Jn=0,Cc=null,Qp=xd=Va=0,Bi=Rc=null,Oa!==null){for(l=0;l<Oa.length;l++)if(d=Oa[l],g=d.interleaved,g!==null){d.interleaved=null;var b=g.next,E=d.pending;if(E!==null){var k=E.next;E.next=b,g.next=k}d.pending=g}Oa=null}return a}function ob(a,l){do{var d=Wn;try{if(xp(),cd.current=hd,ud){for(var g=Fn.memoizedState;g!==null;){var b=g.queue;b!==null&&(b.pending=null),g=g.next}ud=!1}if(za=0,ri=Zn=Fn=null,Sc=!1,wc=0,Jp.current=null,d===null||d.return===null){Jn=1,Cc=l,Wn=null;break}e:{var E=a,k=d.return,j=d,te=l;if(l=di,j.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var ge=te,Ce=j,De=Ce.tag;if((Ce.mode&1)===0&&(De===0||De===11||De===15)){var Ae=Ce.alternate;Ae?(Ce.updateQueue=Ae.updateQueue,Ce.memoizedState=Ae.memoizedState,Ce.lanes=Ae.lanes):(Ce.updateQueue=null,Ce.memoizedState=null)}var nt=Lx(k);if(nt!==null){nt.flags&=-257,Dx(nt,k,j,E,l),nt.mode&1&&kx(E,ge,l),l=nt,te=ge;var ut=l.updateQueue;if(ut===null){var gt=new Set;gt.add(te),l.updateQueue=gt}else ut.add(te);break e}else{if((l&1)===0){kx(E,ge,l),om();break e}te=Error(n(426))}}else if(Ln&&j.mode&1){var Hn=Lx(k);if(Hn!==null){(Hn.flags&65536)===0&&(Hn.flags|=256),Dx(Hn,k,j,E,l),yp(Yo(te,j));break e}}E=te=Yo(te,j),Jn!==4&&(Jn=2),Rc===null?Rc=[E]:Rc.push(E),E=k;do{switch(E.tag){case 3:E.flags|=65536,l&=-l,E.lanes|=l;var ue=Rx(E,te,l);nx(E,ue);break e;case 1:j=te;var se=E.type,fe=E.stateNode;if((E.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||fe!==null&&typeof fe.componentDidCatch=="function"&&(ra===null||!ra.has(fe)))){E.flags|=65536,l&=-l,E.lanes|=l;var ze=Px(E,j,l);nx(E,ze);break e}}E=E.return}while(E!==null)}ub(d)}catch(St){l=St,Wn===d&&d!==null&&(Wn=d=d.return);continue}break}while(!0)}function lb(){var a=_d.current;return _d.current=hd,a===null?hd:a}function om(){(Jn===0||Jn===3||Jn===2)&&(Jn=4),si===null||(Va&268435455)===0&&(xd&268435455)===0||oa(si,di)}function Td(a,l){var d=dn;dn|=2;var g=lb();(si!==a||di!==l)&&(Ss=null,Ga(a,l));do try{HP();break}catch(b){ob(a,b)}while(!0);if(xp(),dn=d,_d.current=g,Wn!==null)throw Error(n(261));return si=null,di=0,Jn}function HP(){for(;Wn!==null;)cb(Wn)}function GP(){for(;Wn!==null&&!Kn();)cb(Wn)}function cb(a){var l=hb(a.alternate,a,qi);a.memoizedProps=a.pendingProps,l===null?ub(a):Wn=l,Jp.current=null}function ub(a){var l=a;do{var d=l.alternate;if(a=l.return,(l.flags&32768)===0){if(d=IP(d,l,qi),d!==null){Wn=d;return}}else{if(d=UP(d,l),d!==null){d.flags&=32767,Wn=d;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Jn=6,Wn=null;return}}if(l=l.sibling,l!==null){Wn=l;return}Wn=l=a}while(l!==null);Jn===0&&(Jn=5)}function Wa(a,l,d){var g=Ft,b=ar.transition;try{ar.transition=null,Ft=1,WP(a,l,d,g)}finally{ar.transition=b,Ft=g}return null}function WP(a,l,d,g){do Qo();while(sa!==null);if((dn&6)!==0)throw Error(n(327));d=a.finishedWork;var b=a.finishedLanes;if(d===null)return null;if(a.finishedWork=null,a.finishedLanes=0,d===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var E=d.lanes|d.childLanes;if(Ws(a,E),a===si&&(Wn=si=null,di=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Sd||(Sd=!0,pb(ce,function(){return Qo(),null})),E=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||E){E=ar.transition,ar.transition=null;var k=Ft;Ft=1;var j=dn;dn|=4,Jp.current=null,OP(a,d),eb(d,a),uP(op),Fu=!!ap,op=ap=null,a.current=d,BP(d),gn(),dn=j,Ft=k,ar.transition=E}else a.current=d;if(Sd&&(Sd=!1,sa=a,wd=b),E=a.pendingLanes,E===0&&(ra=null),ct(d.stateNode),zi(a,L()),l!==null)for(g=a.onRecoverableError,d=0;d<l.length;d++)b=l[d],g(b.value,{componentStack:b.stack,digest:b.digest});if(bd)throw bd=!1,a=tm,tm=null,a;return(wd&1)!==0&&a.tag!==0&&Qo(),E=a.pendingLanes,(E&1)!==0?a===nm?Pc++:(Pc=0,nm=a):Pc=0,ea(),null}function Qo(){if(sa!==null){var a=Sr(wd),l=ar.transition,d=Ft;try{if(ar.transition=null,Ft=16>a?16:a,sa===null)var g=!1;else{if(a=sa,sa=null,wd=0,(dn&6)!==0)throw Error(n(331));var b=dn;for(dn|=4,at=a.current;at!==null;){var E=at,k=E.child;if((at.flags&16)!==0){var j=E.deletions;if(j!==null){for(var te=0;te<j.length;te++){var ge=j[te];for(at=ge;at!==null;){var Ce=at;switch(Ce.tag){case 0:case 11:case 15:Ac(8,Ce,E)}var De=Ce.child;if(De!==null)De.return=Ce,at=De;else for(;at!==null;){Ce=at;var Ae=Ce.sibling,nt=Ce.return;if(Yx(Ce),Ce===ge){at=null;break}if(Ae!==null){Ae.return=nt,at=Ae;break}at=nt}}}var ut=E.alternate;if(ut!==null){var gt=ut.child;if(gt!==null){ut.child=null;do{var Hn=gt.sibling;gt.sibling=null,gt=Hn}while(gt!==null)}}at=E}}if((E.subtreeFlags&2064)!==0&&k!==null)k.return=E,at=k;else e:for(;at!==null;){if(E=at,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:Ac(9,E,E.return)}var ue=E.sibling;if(ue!==null){ue.return=E.return,at=ue;break e}at=E.return}}var se=a.current;for(at=se;at!==null;){k=at;var fe=k.child;if((k.subtreeFlags&2064)!==0&&fe!==null)fe.return=k,at=fe;else e:for(k=se;at!==null;){if(j=at,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:yd(9,j)}}catch(St){On(j,j.return,St)}if(j===k){at=null;break e}var ze=j.sibling;if(ze!==null){ze.return=j.return,at=ze;break e}at=j.return}}if(dn=b,ea(),je&&typeof je.onPostCommitFiberRoot=="function")try{je.onPostCommitFiberRoot(Ge,a)}catch{}g=!0}return g}finally{Ft=d,ar.transition=l}}return!1}function db(a,l,d){l=Yo(d,l),l=Rx(a,l,1),a=na(a,l,1),l=Ai(),a!==null&&(Wi(a,1,l),zi(a,l))}function On(a,l,d){if(a.tag===3)db(a,a,d);else for(;l!==null;){if(l.tag===3){db(l,a,d);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ra===null||!ra.has(g))){a=Yo(d,a),a=Px(l,a,1),l=na(l,a,1),a=Ai(),l!==null&&(Wi(l,1,a),zi(l,a));break}}l=l.return}}function jP(a,l,d){var g=a.pingCache;g!==null&&g.delete(l),l=Ai(),a.pingedLanes|=a.suspendedLanes&d,si===a&&(di&d)===d&&(Jn===4||Jn===3&&(di&130023424)===di&&500>L()-em?Ga(a,0):Qp|=d),zi(a,l)}function fb(a,l){l===0&&((a.mode&1)===0?l=1:(l=vn,vn<<=1,(vn&130023424)===0&&(vn=4194304)));var d=Ai();a=_s(a,l),a!==null&&(Wi(a,l,d),zi(a,d))}function $P(a){var l=a.memoizedState,d=0;l!==null&&(d=l.retryLane),fb(a,d)}function XP(a,l){var d=0;switch(a.tag){case 13:var g=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(l),fb(a,d)}var hb;hb=function(a,l,d){if(a!==null)if(a.memoizedProps!==l.pendingProps||Ui.current)Oi=!0;else{if((a.lanes&d)===0&&(l.flags&128)===0)return Oi=!1,NP(a,l,d);Oi=(a.flags&131072)!==0}else Oi=!1,Ln&&(l.flags&1048576)!==0&&$_(l,td,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;gd(a,l),a=l.pendingProps;var b=Vo(l,mi.current);Xo(l,d),b=kp(null,l,g,a,b,d);var E=Lp();return l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Fi(g)?(E=!0,Ju(l)):E=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Ep(l),b.updater=pd,l.stateNode=b,b._reactInternals=l,Op(l,g,a,d),l=Hp(null,l,g,!0,E,d)):(l.tag=0,Ln&&E&&pp(l),Ti(null,l,b,d),l=l.child),l;case 16:g=l.elementType;e:{switch(gd(a,l),a=l.pendingProps,b=g._init,g=b(g._payload),l.type=g,b=l.tag=YP(g),a=Mr(g,a),b){case 0:l=Vp(null,l,g,a,d);break e;case 1:l=Bx(null,l,g,a,d);break e;case 11:l=Nx(null,l,g,a,d);break e;case 14:l=Ix(null,l,g,Mr(g.type,a),d);break e}throw Error(n(306,g,""))}return l;case 0:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Mr(g,b),Vp(a,l,g,b,d);case 1:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Mr(g,b),Bx(a,l,g,b,d);case 3:e:{if(zx(l),a===null)throw Error(n(387));g=l.pendingProps,E=l.memoizedState,b=E.element,tx(a,l),od(l,g,null,d);var k=l.memoizedState;if(g=k.element,E.isDehydrated)if(E={element:g,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){b=Yo(Error(n(423)),l),l=Vx(a,l,g,d,b);break e}else if(g!==b){b=Yo(Error(n(424)),l),l=Vx(a,l,g,d,b);break e}else for(Xi=Zs(l.stateNode.containerInfo.firstChild),$i=l,Ln=!0,Er=null,d=Q_(l,null,g,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Wo(),g===b){l=bs(a,l,d);break e}Ti(a,l,g,d)}l=l.child}return l;case 5:return rx(l),a===null&&vp(l),g=l.type,b=l.pendingProps,E=a!==null?a.memoizedProps:null,k=b.children,lp(g,b)?k=null:E!==null&&lp(g,E)&&(l.flags|=32),Ox(a,l),Ti(a,l,k,d),l.child;case 6:return a===null&&vp(l),null;case 13:return Hx(a,l,d);case 4:return Mp(l,l.stateNode.containerInfo),g=l.pendingProps,a===null?l.child=jo(l,null,g,d):Ti(a,l,g,d),l.child;case 11:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Mr(g,b),Nx(a,l,g,b,d);case 7:return Ti(a,l,l.pendingProps,d),l.child;case 8:return Ti(a,l,l.pendingProps.children,d),l.child;case 12:return Ti(a,l,l.pendingProps.children,d),l.child;case 10:e:{if(g=l.type._context,b=l.pendingProps,E=l.memoizedProps,k=b.value,An(rd,g._currentValue),g._currentValue=k,E!==null)if(wr(E.value,k)){if(E.children===b.children&&!Ui.current){l=bs(a,l,d);break e}}else for(E=l.child,E!==null&&(E.return=l);E!==null;){var j=E.dependencies;if(j!==null){k=E.child;for(var te=j.firstContext;te!==null;){if(te.context===g){if(E.tag===1){te=xs(-1,d&-d),te.tag=2;var ge=E.updateQueue;if(ge!==null){ge=ge.shared;var Ce=ge.pending;Ce===null?te.next=te:(te.next=Ce.next,Ce.next=te),ge.pending=te}}E.lanes|=d,te=E.alternate,te!==null&&(te.lanes|=d),Sp(E.return,d,l),j.lanes|=d;break}te=te.next}}else if(E.tag===10)k=E.type===l.type?null:E.child;else if(E.tag===18){if(k=E.return,k===null)throw Error(n(341));k.lanes|=d,j=k.alternate,j!==null&&(j.lanes|=d),Sp(k,d,l),k=E.sibling}else k=E.child;if(k!==null)k.return=E;else for(k=E;k!==null;){if(k===l){k=null;break}if(E=k.sibling,E!==null){E.return=k.return,k=E;break}k=k.return}E=k}Ti(a,l,b.children,d),l=l.child}return l;case 9:return b=l.type,g=l.pendingProps.children,Xo(l,d),b=rr(b),g=g(b),l.flags|=1,Ti(a,l,g,d),l.child;case 14:return g=l.type,b=Mr(g,l.pendingProps),b=Mr(g.type,b),Ix(a,l,g,b,d);case 15:return Ux(a,l,l.type,l.pendingProps,d);case 17:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Mr(g,b),gd(a,l),l.tag=1,Fi(g)?(a=!0,Ju(l)):a=!1,Xo(l,d),Ax(l,g,b),Op(l,g,b,d),Hp(null,l,g,!0,a,d);case 19:return Wx(a,l,d);case 22:return Fx(a,l,d)}throw Error(n(156,l.tag))};function pb(a,l){return En(a,l)}function qP(a,l,d,g){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function or(a,l,d,g){return new qP(a,l,d,g)}function lm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function YP(a){if(typeof a=="function")return lm(a)?1:0;if(a!=null){if(a=a.$$typeof,a===W)return 11;if(a===q)return 14}return 2}function la(a,l){var d=a.alternate;return d===null?(d=or(a.tag,l,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=l,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&14680064,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,l=a.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d}function Ad(a,l,d,g,b,E){var k=2;if(g=a,typeof a=="function")lm(a)&&(k=1);else if(typeof a=="string")k=5;else e:switch(a){case U:return ja(d.children,b,E,l);case S:k=8,b|=8;break;case R:return a=or(12,d,l,b|2),a.elementType=R,a.lanes=E,a;case X:return a=or(13,d,l,b),a.elementType=X,a.lanes=E,a;case V:return a=or(19,d,l,b),a.elementType=V,a.lanes=E,a;case Q:return Cd(d,b,E,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case H:k=10;break e;case F:k=9;break e;case W:k=11;break e;case q:k=14;break e;case J:k=16,g=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return l=or(k,d,l,b),l.elementType=a,l.type=g,l.lanes=E,l}function ja(a,l,d,g){return a=or(7,a,g,l),a.lanes=d,a}function Cd(a,l,d,g){return a=or(22,a,g,l),a.elementType=Q,a.lanes=d,a.stateNode={isHidden:!1},a}function cm(a,l,d){return a=or(6,a,null,l),a.lanes=d,a}function um(a,l,d){return l=or(4,a.children!==null?a.children:[],a.key,l),l.lanes=d,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function KP(a,l,d,g,b){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ii(0),this.expirationTimes=Ii(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.identifierPrefix=g,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function dm(a,l,d,g,b,E,k,j,te){return a=new KP(a,l,d,j,te),l===1?(l=1,E===!0&&(l|=8)):l=0,E=or(3,null,null,l),a.current=E,E.stateNode=a,E.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ep(E),a}function ZP(a,l,d){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:g==null?null:""+g,children:a,containerInfo:l,implementation:d}}function mb(a){if(!a)return Qs;a=a._reactInternals;e:{if(Qe(a)!==a||a.tag!==1)throw Error(n(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Fi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(a.tag===1){var d=a.type;if(Fi(d))return G_(a,d,l)}return l}function gb(a,l,d,g,b,E,k,j,te){return a=dm(d,g,!0,a,b,E,k,j,te),a.context=mb(null),d=a.current,g=Ai(),b=aa(d),E=xs(g,b),E.callback=l??null,na(d,E,b),a.current.lanes=b,Wi(a,b,g),zi(a,g),a}function Rd(a,l,d,g){var b=l.current,E=Ai(),k=aa(b);return d=mb(d),l.context===null?l.context=d:l.pendingContext=d,l=xs(E,k),l.payload={element:a},g=g===void 0?null:g,g!==null&&(l.callback=g),a=na(b,l,k),a!==null&&(Cr(a,b,k,E),ad(a,b,k)),k}function Pd(a){return a=a.current,a.child?(a.child.tag===5,a.child.stateNode):null}function vb(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<l?d:l}}function fm(a,l){vb(a,l),(a=a.alternate)&&vb(a,l)}function JP(){return null}var yb=typeof reportError=="function"?reportError:function(a){console.error(a)};function hm(a){this._internalRoot=a}kd.prototype.render=hm.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(n(409));Rd(a,l,null,null)},kd.prototype.unmount=hm.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Ha(function(){Rd(null,a,null,null)}),l[ms]=null}};function kd(a){this._internalRoot=a}kd.prototype.unstable_scheduleHydration=function(a){if(a){var l=ec();a={blockedOn:null,target:a,priority:l};for(var d=0;d<qs.length&&l!==0&&l<qs[d].priority;d++);qs.splice(d,0,a),d===0&&r_(a)}};function pm(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Ld(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function _b(){}function QP(a,l,d,g,b){if(b){if(typeof g=="function"){var E=g;g=function(){var ge=Pd(k);E.call(ge)}}var k=gb(l,g,a,0,null,!1,!1,"",_b);return a._reactRootContainer=k,a[ms]=k.current,pc(a.nodeType===8?a.parentNode:a),Ha(),k}for(;b=a.lastChild;)a.removeChild(b);if(typeof g=="function"){var j=g;g=function(){var ge=Pd(te);j.call(ge)}}var te=dm(a,0,!1,null,null,!1,!1,"",_b);return a._reactRootContainer=te,a[ms]=te.current,pc(a.nodeType===8?a.parentNode:a),Ha(function(){Rd(l,te,d,g)}),te}function Dd(a,l,d,g,b){var E=d._reactRootContainer;if(E){var k=E;if(typeof b=="function"){var j=b;b=function(){var te=Pd(k);j.call(te)}}Rd(l,k,a,b)}else k=QP(d,l,a,b,g);return Pd(k)}Vn=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var d=tn(l.pendingLanes);d!==0&&(xn(l,d|1),zi(l,L()),(dn&6)===0&&(Jo=L()+500,ea()))}break;case 13:Ha(function(){var g=_s(a,1);if(g!==null){var b=Ai();Cr(g,a,1,b)}}),fm(a,1)}},tr=function(a){if(a.tag===13){var l=_s(a,134217728);if(l!==null){var d=Ai();Cr(l,a,134217728,d)}fm(a,134217728)}},ps=function(a){if(a.tag===13){var l=aa(a),d=_s(a,l);if(d!==null){var g=Ai();Cr(d,a,l,g)}fm(a,l)}},ec=function(){return Ft},n_=function(a,l){var d=Ft;try{return Ft=a,l()}finally{Ft=d}},Ve=function(a,l,d){switch(l){case"input":if(an(a,d),l=d.name,d.type==="radio"&&l!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var g=d[l];if(g!==a&&g.form===a.form){var b=Ku(g);if(!b)throw Error(n(90));pn(g),an(g,b)}}}break;case"textarea":P(a,d);break;case"select":l=d.value,l!=null&&kt(a,!!d.multiple,l,!1)}},Dt=sm,mn=Ha;var e2={usingClientEntryPoint:!1,Events:[vc,Bo,Ku,_e,st,sm]},kc={findFiberByHostInstance:Na,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t2={bundleType:kc.bundleType,version:kc.version,rendererPackageName:kc.rendererPackageName,rendererConfig:kc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=un(a),a===null?null:a.stateNode},findFiberByHostInstance:kc.findFiberByHostInstance||JP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nd.isDisabled&&Nd.supportsFiber)try{Ge=Nd.inject(t2),je=Nd}catch{}}return Vi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e2,Vi.createPortal=function(a,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pm(l))throw Error(n(200));return ZP(a,l,null,d)},Vi.createRoot=function(a,l){if(!pm(a))throw Error(n(299));var d=!1,g="",b=yb;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=dm(a,1,!1,null,null,d,!1,g,b),a[ms]=l.current,pc(a.nodeType===8?a.parentNode:a),new hm(l)},Vi.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=un(l),a=a===null?null:a.stateNode,a},Vi.flushSync=function(a){return Ha(a)},Vi.hydrate=function(a,l,d){if(!Ld(l))throw Error(n(200));return Dd(null,a,l,!0,d)},Vi.hydrateRoot=function(a,l,d){if(!pm(a))throw Error(n(405));var g=d!=null&&d.hydratedSources||null,b=!1,E="",k=yb;if(d!=null&&(d.unstable_strictMode===!0&&(b=!0),d.identifierPrefix!==void 0&&(E=d.identifierPrefix),d.onRecoverableError!==void 0&&(k=d.onRecoverableError)),l=gb(l,null,a,1,d??null,b,!1,E,k),a[ms]=l.current,pc(a),g)for(a=0;a<g.length;a++)d=g[a],b=d._getVersion,b=b(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,b]:l.mutableSourceEagerHydrationData.push(d,b);return new kd(l)},Vi.render=function(a,l,d){if(!Ld(l))throw Error(n(200));return Dd(null,a,l,!1,d)},Vi.unmountComponentAtNode=function(a){if(!Ld(a))throw Error(n(40));return a._reactRootContainer?(Ha(function(){Dd(null,null,a,!1,function(){a._reactRootContainer=null,a[ms]=null})}),!0):!1},Vi.unstable_batchedUpdates=sm,Vi.unstable_renderSubtreeIntoContainer=function(a,l,d,g){if(!Ld(d))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Dd(a,l,d,!1,g)},Vi.version="18.3.1-next-f1338f8080-20240426",Vi}var Ab;function L1(){if(Ab)return vm.exports;Ab=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),vm.exports=u2(),vm.exports}var Cb;function d2(){if(Cb)return Id;Cb=1;var t=L1();return Id.createRoot=t.createRoot,Id.hydrateRoot=t.hydrateRoot,Id}var f2=d2();var D1=t=>{throw TypeError(t)},h2=(t,e,n)=>e.has(t)||D1("Cannot "+n),xm=(t,e,n)=>(h2(t,e,"read from private field"),n?n.call(t):e.get(t)),p2=(t,e,n)=>e.has(t)?D1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Rb="popstate";function Pb(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function m2(t={}){function e(i,r){let s=r.state?.masked,{pathname:o,search:c,hash:u}=s||i.location;return lu("",{pathname:o,search:c,hash:u},r.state&&r.state.usr||null,r.state&&r.state.key||"default",s?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:rs(r)}return v2(e,n,null,t)}function Qt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Gn(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function g2(){return Math.random().toString(36).substring(2,10)}function kb(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function lu(t,e,n=null,i,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?zs(e):e,state:n,key:e&&e.key||i||g2(),unstable_mask:r}}function rs({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function zs(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function v2(t,e,n,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,c="POP",u=null,f=h();f==null&&(f=0,o.replaceState({...o.state,idx:f},""));function h(){return(o.state||{idx:null}).idx}function p(){c="POP";let y=h(),x=y==null?null:y-f;f=y,u&&u({action:c,location:w.location,delta:x})}function m(y,x){c="PUSH";let M=Pb(y)?y:lu(w.location,y,x);f=h()+1;let A=kb(M,f),T=w.createHref(M.unstable_mask||M);try{o.pushState(A,"",T)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;r.location.assign(T)}s&&u&&u({action:c,location:w.location,delta:1})}function v(y,x){c="REPLACE";let M=Pb(y)?y:lu(w.location,y,x);f=h();let A=kb(M,f),T=w.createHref(M.unstable_mask||M);o.replaceState(A,"",T),s&&u&&u({action:c,location:w.location,delta:0})}function _(y){return N1(y)}let w={get action(){return c},get location(){return t(r,o)},listen(y){if(u)throw new Error("A history only accepts one active listener");return r.addEventListener(Rb,p),u=y,()=>{r.removeEventListener(Rb,p),u=null}},createHref(y){return e(r,y)},createURL:_,encodeLocation(y){let x=_(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:v,go(y){return o.go(y)}};return w}function N1(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Qt(n,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:rs(t);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=n+i),new URL(i,n)}var Xc,Lb=class{constructor(t){if(p2(this,Xc,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(xm(this,Xc).has(t))return xm(this,Xc).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){xm(this,Xc).set(t,e)}};Xc=new WeakMap;var y2=new Set(["lazy","caseSensitive","path","id","index","children"]);function _2(t){return y2.has(t)}var x2=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function b2(t){return x2.has(t)}function S2(t){return t.index===!0}function cu(t,e,n=[],i={},r=!1){return t.map((s,o)=>{let c=[...n,String(o)],u=typeof s.id=="string"?s.id:c.join("-");if(Qt(s.index!==!0||!s.children,"Cannot specify children on an index route"),Qt(r||!i[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),S2(s)){let f={...s,id:u};return i[u]=Db(f,e(f)),f}else{let f={...s,id:u,children:void 0};return i[u]=Db(f,e(f)),s.children&&(f.children=cu(s.children,e,c,i,r)),f}})}function Db(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function xa(t,e,n="/"){return qc(t,e,n,!1)}function qc(t,e,n,i){let r=typeof e=="string"?zs(e):e,s=mr(r.pathname||"/",n);if(s==null)return null;let o=I1(t);E2(o);let c=null;for(let u=0;c==null&&u<o.length;++u){let f=I2(s);c=D2(o[u],f,i)}return c}function w2(t,e){let{route:n,pathname:i,params:r}=t;return{id:n.id,pathname:i,params:r,data:e[n.id],loaderData:e[n.id],handle:n.handle}}function I1(t,e=[],n=[],i="",r=!1){let s=(o,c,u=r,f)=>{let h={relativePath:f===void 0?o.path||"":f,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(i)&&u)return;Qt(h.relativePath.startsWith(i),`Absolute route path "${h.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(i.length)}let p=Or([i,h.relativePath]),m=n.concat(h);o.children&&o.children.length>0&&(Qt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),I1(o.children,e,m,p,u)),!(o.path==null&&!o.index)&&e.push({path:p,score:k2(p,o.index),routesMeta:m})};return t.forEach((o,c)=>{if(o.path===""||!o.path?.includes("?"))s(o,c);else for(let u of U1(o.path))s(o,c,!0,u)}),e}function U1(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=U1(i.join("/")),c=[];return c.push(...o.map(u=>u===""?s:[s,u].join("/"))),r&&c.push(...o),c.map(u=>t.startsWith("/")&&u===""?"/":u)}function E2(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:L2(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var M2=/^:[\w-]+$/,T2=3,A2=2,C2=1,R2=10,P2=-2,Nb=t=>t==="*";function k2(t,e){let n=t.split("/"),i=n.length;return n.some(Nb)&&(i+=P2),e&&(i+=A2),n.filter(r=>!Nb(r)).reduce((r,s)=>r+(M2.test(s)?T2:s===""?C2:R2),i)}function L2(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function D2(t,e,n=!1){let{routesMeta:i}=t,r={},s="/",o=[];for(let c=0;c<i.length;++c){let u=i[c],f=c===i.length-1,h=s==="/"?e:e.slice(s.length)||"/",p=Gf({path:u.relativePath,caseSensitive:u.caseSensitive,end:f},h),m=u.route;if(!p&&f&&n&&!i[i.length-1].route.index&&(p=Gf({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!p)return null;Object.assign(r,p.params),o.push({params:r,pathname:Or([s,p.pathname]),pathnameBase:O2(Or([s,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(s=Or([s,p.pathnameBase]))}return o}function Gf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=N2(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let s=r[0],o=s.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:i.reduce((f,{paramName:h,isOptional:p},m)=>{if(h==="*"){let _=c[m]||"";o=s.slice(0,s.length-_.length).replace(/(.)\/+$/,"$1")}const v=c[m];return p&&!v?f[h]=void 0:f[h]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:o,pattern:t}}function N2(t,e=!1,n=!0){Gn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,u,f,h)=>{if(i.push({paramName:c,isOptional:u!=null}),u){let p=h.charAt(f+o.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function I2(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Gn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function mr(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}function U2({basename:t,pathname:e}){return e==="/"?t:Or([t,e])}var F1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pv=t=>F1.test(t);function F2(t,e="/"){let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?zs(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=Ib(n.substring(1),"/"):s=Ib(n,e)):s=e,{pathname:s,search:B2(i),hash:z2(r)}}function Ib(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function bm(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function O1(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function kv(t){let e=O1(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function xh(t,e,n,i=!1){let r;typeof t=="string"?r=zs(t):(r={...t},Qt(!r.pathname||!r.pathname.includes("?"),bm("?","pathname","search",r)),Qt(!r.pathname||!r.pathname.includes("#"),bm("#","pathname","hash",r)),Qt(!r.search||!r.search.includes("#"),bm("#","search","hash",r)));let s=t===""||r.pathname==="",o=s?"/":r.pathname,c;if(o==null)c=n;else{let p=e.length-1;if(!i&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),p-=1;r.pathname=m.join("/")}c=p>=0?e[p]:"/"}let u=F2(r,c),f=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||h)&&(u.pathname+="/"),u}var Or=t=>t.join("/").replace(/\/\/+/g,"/"),O2=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),B2=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,z2=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,xu=class{constructor(t,e,n,i=!1){this.status=t,this.statusText=e||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function uu(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function bu(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var B1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function z1(t,e){let n=t;if(typeof n!="string"||!F1.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(B1)try{let s=new URL(window.location.href),o=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=mr(o.pathname,e);o.origin===s.origin&&c!=null?n=c+o.search+o.hash:r=!0}catch{Gn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}var wa=Symbol("Uninstrumented");function V2(t,e){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(r=>r({id:e.id,index:e.index,path:e.path,instrument(s){let o=Object.keys(n);for(let c of o)s[c]&&n[c].push(s[c])}}));let i={};if(typeof e.lazy=="function"&&n.lazy.length>0){let r=El(n.lazy,e.lazy,()=>{});r&&(i.lazy=r)}if(typeof e.lazy=="object"){let r=e.lazy;["middleware","loader","action"].forEach(s=>{let o=r[s],c=n[`lazy.${s}`];if(typeof o=="function"&&c.length>0){let u=El(c,o,()=>{});u&&(i.lazy=Object.assign(i.lazy||{},{[s]:u}))}})}return["loader","action"].forEach(r=>{let s=e[r];if(typeof s=="function"&&n[r].length>0){let o=s[wa]??s,c=El(n[r],o,(...u)=>Ub(u[0]));c&&(r==="loader"&&o.hydrate===!0&&(c.hydrate=!0),c[wa]=o,i[r]=c)}}),e.middleware&&e.middleware.length>0&&n.middleware.length>0&&(i.middleware=e.middleware.map(r=>{let s=r[wa]??r,o=El(n.middleware,s,(...c)=>Ub(c[0]));return o?(o[wa]=s,o):r})),i}function H2(t,e){let n={navigate:[],fetch:[]};if(e.forEach(i=>i({instrument(r){let s=Object.keys(r);for(let o of s)r[o]&&n[o].push(r[o])}})),n.navigate.length>0){let i=t.navigate[wa]??t.navigate,r=El(n.navigate,i,(...s)=>{let[o,c]=s;return{to:typeof o=="number"||typeof o=="string"?o:o?rs(o):".",...Fb(t,c??{})}});r&&(r[wa]=i,t.navigate=r)}if(n.fetch.length>0){let i=t.fetch[wa]??t.fetch,r=El(n.fetch,i,(...s)=>{let[o,,c,u]=s;return{href:c??".",fetcherKey:o,...Fb(t,u??{})}});r&&(r[wa]=i,t.fetch=r)}return t}function El(t,e,n){return t.length===0?null:async(...i)=>{let r=await V1(t,n(...i),()=>e(...i),t.length-1);if(r.type==="error")throw r.value;return r.value}}async function V1(t,e,n,i){let r=t[i],s;if(r){let o,c=async()=>(o?console.error("You cannot call instrumented handlers more than once"):o=V1(t,e,n,i-1),s=await o,Qt(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await r(c,e)}catch(u){console.error("An instrumentation function threw an error:",u)}o||await c(),await o}else try{s={type:"success",value:await n()}}catch(o){s={type:"error",value:o}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Ub(t){let{request:e,context:n,params:i,unstable_pattern:r}=t;return{request:G2(e),params:{...i},unstable_pattern:r,context:W2(n)}}function Fb(t,e){return{currentUrl:rs(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function G2(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function W2(t){if($2(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var j2=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $2(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===j2}var H1=["POST","PUT","PATCH","DELETE"],X2=new Set(H1),q2=["GET",...H1],Y2=new Set(q2),G1=new Set([301,302,303,307,308]),K2=new Set([307,308]),Sm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Z2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Dc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},J2=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),W1="remix-router-transitions",j1=Symbol("ResetLoaderData");function Q2(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";Qt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.hydrationRouteProperties||[],r=t.mapRouteProperties||J2,s=r;if(t.unstable_instrumentations){let K=t.unstable_instrumentations;s=oe=>({...r(oe),...V2(K.map(he=>he.route).filter(Boolean),oe)})}let o={},c=cu(t.routes,s,void 0,o),u,f=t.basename||"/";f.startsWith("/")||(f=`/${f}`);let h=t.dataStrategy||rk,p={...t.future},m=null,v=new Set,_=null,w=null,y=null,x=t.hydrationData!=null,M=xa(c,t.history.location,f),A=!1,T=null,D,I;if(M==null&&!t.patchRoutesOnNavigation){let K=cr(404,{pathname:t.history.location.pathname}),{matches:oe,route:he}=Ud(c);D=!0,I=!D,M=oe,T={[he.id]:K}}else if(M&&!t.hydrationData&&Kt(M,c,t.history.location.pathname).active&&(M=null),M)if(M.some(K=>K.route.lazy))D=!1,I=!D;else if(!M.some(K=>Lv(K.route)))D=!0,I=!D;else{let K=t.hydrationData?t.hydrationData.loaderData:null,oe=t.hydrationData?t.hydrationData.errors:null,he=M;if(oe){let Me=M.findIndex(Ie=>oe[Ie.route.id]!==void 0);he=he.slice(0,Me+1)}I=!1,D=he.every(Me=>{let Ie=$1(Me.route,K,oe);return I=I||Ie.renderFallback,!Ie.shouldLoad})}else{D=!1,I=!D,M=[];let K=Kt(null,c,t.history.location.pathname);K.active&&K.matches&&(A=!0,M=K.matches)}let U,S={historyAction:t.history.action,location:t.history.location,matches:M,initialized:D,renderFallback:I,navigation:Sm,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||T,fetchers:new Map,blockers:new Map},R="POP",H=null,F=!1,W,X=!1,V=new Map,q=null,J=!1,Q=!1,$=new Set,Y=new Map,Z=0,z=-1,ie=new Map,ve=new Set,Ee=new Map,Ue=new Map,le=new Set,be=new Map,Se,Ne=null;function et(){if(m=t.history.listen(({action:K,location:oe,delta:he})=>{if(Se){Se(),Se=void 0;return}Gn(be.size===0||he!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Me=Xe({currentLocation:S.location,nextLocation:oe,historyAction:K});if(Me&&he!=null){let Ie=new Promise(vt=>{Se=vt});t.history.go(he*-1),Le(Me,{state:"blocked",location:oe,proceed(){Le(Me,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),Ie.then(()=>t.history.go(he))},reset(){let vt=new Map(S.blockers);vt.set(Me,Dc),ht({blockers:vt})}}),H?.resolve(),H=null;return}return an(K,oe)}),n){Sk(e,V);let K=()=>wk(e,V);e.addEventListener("pagehide",K),q=()=>e.removeEventListener("pagehide",K)}return S.initialized||an("POP",S.location,{initialHydration:!0}),U}function xt(){m&&m(),q&&q(),v.clear(),W&&W.abort(),S.fetchers.forEach((K,oe)=>Re(oe)),S.blockers.forEach((K,oe)=>Ve(oe))}function pn(K){return v.add(K),()=>v.delete(K)}function ht(K,oe={}){K.matches&&(K.matches=K.matches.map(Ie=>{let vt=o[Ie.route.id],tt=Ie.route;return tt.element!==vt.element||tt.errorElement!==vt.errorElement||tt.hydrateFallbackElement!==vt.hydrateFallbackElement?{...Ie,route:vt}:Ie})),S={...S,...K};let he=[],Me=[];S.fetchers.forEach((Ie,vt)=>{Ie.state==="idle"&&(le.has(vt)?he.push(vt):Me.push(vt))}),le.forEach(Ie=>{!S.fetchers.has(Ie)&&!Y.has(Ie)&&he.push(Ie)}),[...v].forEach(Ie=>Ie(S,{deletedFetchers:he,newErrors:K.errors??null,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),he.forEach(Ie=>Re(Ie)),Me.forEach(Ie=>S.fetchers.delete(Ie))}function Ut(K,oe,{flushSync:he}={}){let Me=S.actionData!=null&&S.navigation.formMethod!=null&&bi(S.navigation.formMethod)&&S.navigation.state==="loading"&&K.state?._isRedirect!==!0,Ie;oe.actionData?Object.keys(oe.actionData).length>0?Ie=oe.actionData:Ie=null:Me?Ie=S.actionData:Ie=null;let vt=oe.loaderData?Xb(S.loaderData,oe.loaderData,oe.matches||[],oe.errors):S.loaderData,tt=S.blockers;tt.size>0&&(tt=new Map(tt),tt.forEach((Tt,bt)=>tt.set(bt,Dc)));let yt=J?!1:mn(K,oe.matches||S.matches),Qe=F===!0||S.navigation.formMethod!=null&&bi(S.navigation.formMethod)&&K.state?._isRedirect!==!0;u&&(c=u,u=void 0),J||R==="POP"||(R==="PUSH"?t.history.push(K,K.state):R==="REPLACE"&&t.history.replace(K,K.state));let Et;if(R==="POP"){let Tt=V.get(S.location.pathname);Tt&&Tt.has(K.pathname)?Et={currentLocation:S.location,nextLocation:K}:V.has(K.pathname)&&(Et={currentLocation:K,nextLocation:S.location})}else if(X){let Tt=V.get(S.location.pathname);Tt?Tt.add(K.pathname):(Tt=new Set([K.pathname]),V.set(S.location.pathname,Tt)),Et={currentLocation:S.location,nextLocation:K}}ht({...oe,actionData:Ie,loaderData:vt,historyAction:R,location:K,initialized:!0,renderFallback:!1,navigation:Sm,revalidation:"idle",restoreScrollPosition:yt,preventScrollReset:Qe,blockers:tt},{viewTransitionOpts:Et,flushSync:he===!0}),R="POP",F=!1,X=!1,J=!1,Q=!1,H?.resolve(),H=null,Ne?.resolve(),Ne=null}async function nn(K,oe){if(H?.resolve(),H=null,typeof K=="number"){H||(H=Zb());let En=H.promise;return t.history.go(K),En}let he=Bg(S.location,S.matches,f,K,oe?.fromRouteId,oe?.relative),{path:Me,submission:Ie,error:vt}=Ob(!1,he,oe),tt;oe?.unstable_mask&&(tt={pathname:"",search:"",hash:"",...typeof oe.unstable_mask=="string"?zs(oe.unstable_mask):{...S.location.unstable_mask,...oe.unstable_mask}});let yt=S.location,Qe=lu(yt,Me,oe&&oe.state,void 0,tt);Qe={...Qe,...t.history.encodeLocation(Qe)};let Et=oe&&oe.replace!=null?oe.replace:void 0,Tt="PUSH";Et===!0?Tt="REPLACE":Et===!1||Ie!=null&&bi(Ie.formMethod)&&Ie.formAction===S.location.pathname+S.location.search&&(Tt="REPLACE");let bt=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,un=(oe&&oe.flushSync)===!0,en=Xe({currentLocation:yt,nextLocation:Qe,historyAction:Tt});if(en){Le(en,{state:"blocked",location:Qe,proceed(){Le(en,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),nn(K,oe)},reset(){let En=new Map(S.blockers);En.set(en,Dc),ht({blockers:En})}});return}await an(Tt,Qe,{submission:Ie,pendingError:vt,preventScrollReset:bt,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:un,callSiteDefaultShouldRevalidate:oe&&oe.unstable_defaultShouldRevalidate})}function Lt(){Ne||(Ne=Zb()),ye(),ht({revalidation:"loading"});let K=Ne.promise;return S.navigation.state==="submitting"?K:S.navigation.state==="idle"?(an(S.historyAction,S.location,{startUninterruptedRevalidation:!0}),K):(an(R||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:X===!0}),K)}async function an(K,oe,he){W&&W.abort(),W=null,R=K,J=(he&&he.startUninterruptedRevalidation)===!0,Dt(S.location,S.matches),F=(he&&he.preventScrollReset)===!0,X=(he&&he.enableViewTransition)===!0;let Me=u||c,Ie=he&&he.overrideNavigation,vt=he?.initialHydration&&S.matches&&S.matches.length>0&&!A?S.matches:xa(Me,oe,f),tt=(he&&he.flushSync)===!0;if(vt&&S.initialized&&!Q&&fk(S.location,oe)&&!(he&&he.submission&&bi(he.submission.formMethod))){Ut(oe,{matches:vt},{flushSync:tt});return}let yt=Kt(vt,Me,oe.pathname);if(yt.active&&yt.matches&&(vt=yt.matches),!vt){let{error:Nn,notFoundMatches:Kn,route:gn}=Pe(oe.pathname);Ut(oe,{matches:Kn,loaderData:{},errors:{[gn.id]:Nn}},{flushSync:tt});return}W=new AbortController;let Qe=_l(t.history,oe,W.signal,he&&he.submission),Et=t.getContext?await t.getContext():new Lb,Tt;if(he&&he.pendingError)Tt=[ba(vt).route.id,{type:"error",error:he.pendingError}];else if(he&&he.submission&&bi(he.submission.formMethod)){let Nn=await ee(Qe,oe,he.submission,vt,Et,yt.active,he&&he.initialHydration===!0,{replace:he.replace,flushSync:tt});if(Nn.shortCircuited)return;if(Nn.pendingActionResult){let[Kn,gn]=Nn.pendingActionResult;if(Ji(gn)&&uu(gn.error)&&gn.error.status===404){W=null,Ut(oe,{matches:Nn.matches,loaderData:{},errors:{[Kn]:gn.error}});return}}vt=Nn.matches||vt,Tt=Nn.pendingActionResult,Ie=wm(oe,he.submission),tt=!1,yt.active=!1,Qe=_l(t.history,Qe.url,Qe.signal)}let{shortCircuited:bt,matches:un,loaderData:en,errors:En}=await Sn(Qe,oe,vt,Et,yt.active,Ie,he&&he.submission,he&&he.fetcherSubmission,he&&he.replace,he&&he.initialHydration===!0,tt,Tt,he&&he.callSiteDefaultShouldRevalidate);bt||(W=null,Ut(oe,{matches:un||vt,...qb(Tt),loaderData:en,errors:En}))}async function ee(K,oe,he,Me,Ie,vt,tt,yt={}){ye();let Qe=xk(oe,he);if(ht({navigation:Qe},{flushSync:yt.flushSync===!0}),vt){let bt=await ci(Me,oe.pathname,K.signal);if(bt.type==="aborted")return{shortCircuited:!0};if(bt.type==="error"){if(bt.partialMatches.length===0){let{matches:en,route:En}=Ud(c);return{matches:en,pendingActionResult:[En.id,{type:"error",error:bt.error}]}}let un=ba(bt.partialMatches).route.id;return{matches:bt.partialMatches,pendingActionResult:[un,{type:"error",error:bt.error}]}}else if(bt.matches)Me=bt.matches;else{let{notFoundMatches:un,error:en,route:En}=Pe(oe.pathname);return{matches:un,pendingActionResult:[En.id,{type:"error",error:en}]}}}let Et,Tt=_f(Me,oe);if(!Tt.route.action&&!Tt.route.lazy)Et={type:"error",error:cr(405,{method:K.method,pathname:oe.pathname,routeId:Tt.route.id})};else{let bt=Rl(s,o,K,Me,Tt,tt?[]:i,Ie),un=await xe(K,bt,Ie,null);if(Et=un[Tt.route.id],!Et){for(let en of Me)if(un[en.route.id]){Et=un[en.route.id];break}}if(K.signal.aborted)return{shortCircuited:!0}}if(ao(Et)){let bt;return yt&&yt.replace!=null?bt=yt.replace:bt=Wb(Et.response.headers.get("Location"),new URL(K.url),f,t.history)===S.location.pathname+S.location.search,await re(K,Et,!0,{submission:he,replace:bt}),{shortCircuited:!0}}if(Ji(Et)){let bt=ba(Me,Tt.route.id);return(yt&&yt.replace)!==!0&&(R="PUSH"),{matches:Me,pendingActionResult:[bt.route.id,Et,Tt.route.id]}}return{matches:Me,pendingActionResult:[Tt.route.id,Et]}}async function Sn(K,oe,he,Me,Ie,vt,tt,yt,Qe,Et,Tt,bt,un){let en=vt||wm(oe,tt),En=tt||yt||Kb(en),Nn=!J&&!Et;if(Ie){if(Nn){let Mt=At(bt);ht({navigation:en,...Mt!==void 0?{actionData:Mt}:{}},{flushSync:Tt})}let He=await ci(he,oe.pathname,K.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:lt,route:Zt}=Ud(c);return{matches:lt,loaderData:{},errors:{[Zt.id]:He.error}}}let Mt=ba(He.partialMatches).route.id;return{matches:He.partialMatches,loaderData:{},errors:{[Mt]:He.error}}}else if(He.matches)he=He.matches;else{let{error:Mt,notFoundMatches:lt,route:Zt}=Pe(oe.pathname);return{matches:lt,loaderData:{},errors:{[Zt.id]:Mt}}}}let Kn=u||c,{dsMatches:gn,revalidatingFetchers:L}=Bb(K,Me,s,o,t.history,S,he,En,oe,Et?[]:i,Et===!0,Q,$,le,Ee,ve,Kn,f,t.patchRoutesOnNavigation!=null,bt,un);if(z=++Z,!t.dataStrategy&&!gn.some(He=>He.shouldLoad)&&!gn.some(He=>He.route.middleware&&He.route.middleware.length>0)&&L.length===0){let He=$e();return Ut(oe,{matches:he,loaderData:{},errors:bt&&Ji(bt[1])?{[bt[0]]:bt[1].error}:null,...qb(bt),...He?{fetchers:new Map(S.fetchers)}:{}},{flushSync:Tt}),{shortCircuited:!0}}if(Nn){let He={};if(!Ie){He.navigation=en;let Mt=At(bt);Mt!==void 0&&(He.actionData=Mt)}L.length>0&&(He.fetchers=kt(L)),ht(He,{flushSync:Tt})}L.forEach(He=>{Ze(He.key),He.controller&&Y.set(He.key,He.controller)});let ae=()=>L.forEach(He=>Ze(He.key));W&&W.signal.addEventListener("abort",ae);let{loaderResults:pe,fetcherResults:de}=await we(gn,L,K,Me);if(K.signal.aborted)return{shortCircuited:!0};W&&W.signal.removeEventListener("abort",ae),L.forEach(He=>Y.delete(He.key));let ce=Fd(pe);if(ce)return await re(K,ce.result,!0,{replace:Qe}),{shortCircuited:!0};if(ce=Fd(de),ce)return ve.add(ce.key),await re(K,ce.result,!0,{replace:Qe}),{shortCircuited:!0};let{loaderData:We,errors:qe}=$b(S,he,pe,bt,L,de);Et&&S.errors&&(qe={...S.errors,...qe});let Ge=$e(),je=Vt(z),ct=Ge||je||L.length>0;return{matches:he,loaderData:We,errors:qe,...ct?{fetchers:new Map(S.fetchers)}:{}}}function At(K){if(K&&!Ji(K[1]))return{[K[0]]:K[1].data};if(S.actionData)return Object.keys(S.actionData).length===0?null:S.actionData}function kt(K){return K.forEach(oe=>{let he=S.fetchers.get(oe.key),Me=Nc(void 0,he?he.data:void 0);S.fetchers.set(oe.key,Me)}),new Map(S.fetchers)}async function it(K,oe,he,Me){Ze(K);let Ie=(Me&&Me.flushSync)===!0,vt=u||c,tt=Bg(S.location,S.matches,f,he,oe,Me?.relative),yt=xa(vt,tt,f),Qe=Kt(yt,vt,tt);if(Qe.active&&Qe.matches&&(yt=Qe.matches),!yt){ke(K,oe,cr(404,{pathname:tt}),{flushSync:Ie});return}let{path:Et,submission:Tt,error:bt}=Ob(!0,tt,Me);if(bt){ke(K,oe,bt,{flushSync:Ie});return}let un=t.getContext?await t.getContext():new Lb,en=(Me&&Me.preventScrollReset)===!0;if(Tt&&bi(Tt.formMethod)){await O(K,oe,Et,yt,un,Qe.active,Ie,en,Tt,Me&&Me.unstable_defaultShouldRevalidate);return}Ee.set(K,{routeId:oe,path:Et}),await P(K,oe,Et,yt,un,Qe.active,Ie,en,Tt)}async function O(K,oe,he,Me,Ie,vt,tt,yt,Qe,Et){ye(),Ee.delete(K);let Tt=S.fetchers.get(K);Ke(K,bk(Qe,Tt),{flushSync:tt});let bt=new AbortController,un=_l(t.history,he,bt.signal,Qe);if(vt){let Nt=await ci(Me,new URL(un.url).pathname,un.signal,K);if(Nt.type==="aborted")return;if(Nt.type==="error"){ke(K,oe,Nt.error,{flushSync:tt});return}else if(Nt.matches)Me=Nt.matches;else{ke(K,oe,cr(404,{pathname:he}),{flushSync:tt});return}}let en=_f(Me,he);if(!en.route.action&&!en.route.lazy){let Nt=cr(405,{method:Qe.formMethod,pathname:he,routeId:oe});ke(K,oe,Nt,{flushSync:tt});return}Y.set(K,bt);let En=Z,Nn=Rl(s,o,un,Me,en,i,Ie),Kn=await xe(un,Nn,Ie,K),gn=Kn[en.route.id];if(!gn){for(let Nt of Nn)if(Kn[Nt.route.id]){gn=Kn[Nt.route.id];break}}if(un.signal.aborted){Y.get(K)===bt&&Y.delete(K);return}if(le.has(K)){if(ao(gn)||Ji(gn)){Ke(K,Rs(void 0));return}}else{if(ao(gn))if(Y.delete(K),z>En){Ke(K,Rs(void 0));return}else return ve.add(K),Ke(K,Nc(Qe)),re(un,gn,!1,{fetcherSubmission:Qe,preventScrollReset:yt});if(Ji(gn)){ke(K,oe,gn.error);return}}let L=S.navigation.location||S.location,ae=_l(t.history,L,bt.signal),pe=u||c,de=S.navigation.state!=="idle"?xa(pe,S.navigation.location,f):S.matches;Qt(de,"Didn't find any matches after fetcher action");let ce=++Z;ie.set(K,ce);let We=Nc(Qe,gn.data);S.fetchers.set(K,We);let{dsMatches:qe,revalidatingFetchers:Ge}=Bb(ae,Ie,s,o,t.history,S,de,Qe,L,i,!1,Q,$,le,Ee,ve,pe,f,t.patchRoutesOnNavigation!=null,[en.route.id,gn],Et);Ge.filter(Nt=>Nt.key!==K).forEach(Nt=>{let vn=Nt.key,tn=S.fetchers.get(vn),In=Nc(void 0,tn?tn.data:void 0);S.fetchers.set(vn,In),Ze(vn),Nt.controller&&Y.set(vn,Nt.controller)}),ht({fetchers:new Map(S.fetchers)});let je=()=>Ge.forEach(Nt=>Ze(Nt.key));bt.signal.addEventListener("abort",je);let{loaderResults:ct,fetcherResults:He}=await we(qe,Ge,ae,Ie);if(bt.signal.aborted)return;if(bt.signal.removeEventListener("abort",je),ie.delete(K),Y.delete(K),Ge.forEach(Nt=>Y.delete(Nt.key)),S.fetchers.has(K)){let Nt=Rs(gn.data);S.fetchers.set(K,Nt)}let Mt=Fd(ct);if(Mt)return re(ae,Mt.result,!1,{preventScrollReset:yt});if(Mt=Fd(He),Mt)return ve.add(Mt.key),re(ae,Mt.result,!1,{preventScrollReset:yt});let{loaderData:lt,errors:Zt}=$b(S,de,ct,void 0,Ge,He);Vt(ce),S.navigation.state==="loading"&&ce>z?(Qt(R,"Expected pending action"),W&&W.abort(),Ut(S.navigation.location,{matches:de,loaderData:lt,errors:Zt,fetchers:new Map(S.fetchers)})):(ht({errors:Zt,loaderData:Xb(S.loaderData,lt,de,Zt),fetchers:new Map(S.fetchers)}),Q=!1)}async function P(K,oe,he,Me,Ie,vt,tt,yt,Qe){let Et=S.fetchers.get(K);Ke(K,Nc(Qe,Et?Et.data:void 0),{flushSync:tt});let Tt=new AbortController,bt=_l(t.history,he,Tt.signal);if(vt){let gn=await ci(Me,new URL(bt.url).pathname,bt.signal,K);if(gn.type==="aborted")return;if(gn.type==="error"){ke(K,oe,gn.error,{flushSync:tt});return}else if(gn.matches)Me=gn.matches;else{ke(K,oe,cr(404,{pathname:he}),{flushSync:tt});return}}let un=_f(Me,he);Y.set(K,Tt);let en=Z,En=Rl(s,o,bt,Me,un,i,Ie),Kn=(await xe(bt,En,Ie,K))[un.route.id];if(Y.get(K)===Tt&&Y.delete(K),!bt.signal.aborted){if(le.has(K)){Ke(K,Rs(void 0));return}if(ao(Kn))if(z>en){Ke(K,Rs(void 0));return}else{ve.add(K),await re(bt,Kn,!1,{preventScrollReset:yt});return}if(Ji(Kn)){ke(K,oe,Kn.error);return}Ke(K,Rs(Kn.data))}}async function re(K,oe,he,{submission:Me,fetcherSubmission:Ie,preventScrollReset:vt,replace:tt}={}){he||(H?.resolve(),H=null),oe.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let yt=oe.response.headers.get("Location");Qt(yt,"Expected a Location header on the redirect Response"),yt=Wb(yt,new URL(K.url),f,t.history);let Qe=lu(S.location,yt,{_isRedirect:!0});if(n){let En=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))En=!0;else if(Pv(yt)){const Nn=N1(yt,!0);En=Nn.origin!==e.location.origin||mr(Nn.pathname,f)==null}if(En){tt?e.location.replace(yt):e.location.assign(yt);return}}W=null;let Et=tt===!0||oe.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Tt,formAction:bt,formEncType:un}=S.navigation;!Me&&!Ie&&Tt&&bt&&un&&(Me=Kb(S.navigation));let en=Me||Ie;if(K2.has(oe.response.status)&&en&&bi(en.formMethod))await an(Et,Qe,{submission:{...en,formAction:yt},preventScrollReset:vt||F,enableViewTransition:he?X:void 0});else{let En=wm(Qe,Me);await an(Et,Qe,{overrideNavigation:En,fetcherSubmission:Ie,preventScrollReset:vt||F,enableViewTransition:he?X:void 0})}}async function xe(K,oe,he,Me){let Ie,vt={};try{Ie=await ak(h,K,oe,Me,he,!1)}catch(tt){return oe.filter(yt=>yt.shouldLoad).forEach(yt=>{vt[yt.route.id]={type:"error",error:tt}}),vt}if(K.signal.aborted)return vt;if(!bi(K.method))for(let tt of oe){if(Ie[tt.route.id]?.type==="error")break;!Ie.hasOwnProperty(tt.route.id)&&!S.loaderData.hasOwnProperty(tt.route.id)&&(!S.errors||!S.errors.hasOwnProperty(tt.route.id))&&tt.shouldCallHandler()&&(Ie[tt.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${tt.route.id}`)})}for(let[tt,yt]of Object.entries(Ie))if(gk(yt)){let Qe=yt.result;vt[tt]={type:"redirect",response:uk(Qe,K,tt,oe,f)}}else vt[tt]=await ck(yt);return vt}async function we(K,oe,he,Me){let Ie=xe(he,K,Me,null),vt=Promise.all(oe.map(async Qe=>{if(Qe.matches&&Qe.match&&Qe.request&&Qe.controller){let Tt=(await xe(Qe.request,Qe.matches,Me,Qe.key))[Qe.match.route.id];return{[Qe.key]:Tt}}else return Promise.resolve({[Qe.key]:{type:"error",error:cr(404,{pathname:Qe.path})}})})),tt=await Ie,yt=(await vt).reduce((Qe,Et)=>Object.assign(Qe,Et),{});return{loaderResults:tt,fetcherResults:yt}}function ye(){Q=!0,Ee.forEach((K,oe)=>{Y.has(oe)&&$.add(oe),Ze(oe)})}function Ke(K,oe,he={}){S.fetchers.set(K,oe),ht({fetchers:new Map(S.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function ke(K,oe,he,Me={}){let Ie=ba(S.matches,oe);Re(K),ht({errors:{[Ie.route.id]:he},fetchers:new Map(S.fetchers)},{flushSync:(Me&&Me.flushSync)===!0})}function pt(K){return Ue.set(K,(Ue.get(K)||0)+1),le.has(K)&&le.delete(K),S.fetchers.get(K)||Z2}function Ct(K,oe){Ze(K,oe?.reason),Ke(K,Rs(null))}function Re(K){let oe=S.fetchers.get(K);Y.has(K)&&!(oe&&oe.state==="loading"&&ie.has(K))&&Ze(K),Ee.delete(K),ie.delete(K),ve.delete(K),le.delete(K),$.delete(K),S.fetchers.delete(K)}function Be(K){let oe=(Ue.get(K)||0)-1;oe<=0?(Ue.delete(K),le.add(K)):Ue.set(K,oe),ht({fetchers:new Map(S.fetchers)})}function Ze(K,oe){let he=Y.get(K);he&&(he.abort(oe),Y.delete(K))}function rt(K){for(let oe of K){let he=pt(oe),Me=Rs(he.data);S.fetchers.set(oe,Me)}}function $e(){let K=[],oe=!1;for(let he of ve){let Me=S.fetchers.get(he);Qt(Me,`Expected fetcher: ${he}`),Me.state==="loading"&&(ve.delete(he),K.push(he),oe=!0)}return rt(K),oe}function Vt(K){let oe=[];for(let[he,Me]of ie)if(Me<K){let Ie=S.fetchers.get(he);Qt(Ie,`Expected fetcher: ${he}`),Ie.state==="loading"&&(Ze(he),ie.delete(he),oe.push(he))}return rt(oe),oe.length>0}function ne(K,oe){let he=S.blockers.get(K)||Dc;return be.get(K)!==oe&&be.set(K,oe),he}function Ve(K){S.blockers.delete(K),be.delete(K)}function Le(K,oe){let he=S.blockers.get(K)||Dc;Qt(he.state==="unblocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="proceeding"||he.state==="blocked"&&oe.state==="unblocked"||he.state==="proceeding"&&oe.state==="unblocked",`Invalid blocker state transition: ${he.state} -> ${oe.state}`);let Me=new Map(S.blockers);Me.set(K,oe),ht({blockers:Me})}function Xe({currentLocation:K,nextLocation:oe,historyAction:he}){if(be.size===0)return;be.size>1&&Gn(!1,"A router only supports one blocker at a time");let Me=Array.from(be.entries()),[Ie,vt]=Me[Me.length-1],tt=S.blockers.get(Ie);if(!(tt&&tt.state==="proceeding")&&vt({currentLocation:K,nextLocation:oe,historyAction:he}))return Ie}function Pe(K){let oe=cr(404,{pathname:K}),he=u||c,{matches:Me,route:Ie}=Ud(he);return{notFoundMatches:Me,route:Ie,error:oe}}function _e(K,oe,he){if(_=K,y=oe,w=he||null,!x&&S.navigation===Sm){x=!0;let Me=mn(S.location,S.matches);Me!=null&&ht({restoreScrollPosition:Me})}return()=>{_=null,y=null,w=null}}function st(K,oe){return w&&w(K,oe.map(Me=>w2(Me,S.loaderData)))||K.key}function Dt(K,oe){if(_&&y){let he=st(K,oe);_[he]=y()}}function mn(K,oe){if(_){let he=st(K,oe),Me=_[he];if(typeof Me=="number")return Me}return null}function Kt(K,oe,he){if(t.patchRoutesOnNavigation)if(K){if(Object.keys(K[0].params).length>0)return{active:!0,matches:qc(oe,he,f,!0)}}else return{active:!0,matches:qc(oe,he,f,!0)||[]};return{active:!1,matches:null}}async function ci(K,oe,he,Me){if(!t.patchRoutesOnNavigation)return{type:"success",matches:K};let Ie=K;for(;;){let vt=u==null,tt=u||c,yt=o;try{await t.patchRoutesOnNavigation({signal:he,path:oe,matches:Ie,fetcherKey:Me,patch:(Tt,bt)=>{he.aborted||zb(Tt,bt,tt,yt,s,!1)}})}catch(Tt){return{type:"error",error:Tt,partialMatches:Ie}}finally{vt&&!he.aborted&&(c=[...c])}if(he.aborted)return{type:"aborted"};let Qe=xa(tt,oe,f),Et=null;if(Qe){if(Object.keys(Qe[0].params).length===0)return{type:"success",matches:Qe};if(Et=qc(tt,oe,f,!0),!(Et&&Ie.length<Et.length&&ii(Ie,Et.slice(0,Ie.length))))return{type:"success",matches:Qe}}if(Et||(Et=qc(tt,oe,f,!0)),!Et||ii(Ie,Et))return{type:"success",matches:null};Ie=Et}}function ii(K,oe){return K.length===oe.length&&K.every((he,Me)=>he.route.id===oe[Me].route.id)}function Gs(K){o={},u=cu(K,s,void 0,o)}function br(K,oe,he=!1){let Me=u==null;zb(K,oe,u||c,o,s,he),Me&&(c=[...c],ht({}))}return U={get basename(){return f},get future(){return p},get state(){return S},get routes(){return c},get window(){return e},initialize:et,subscribe:pn,enableScrollRestoration:_e,navigate:nn,fetch:it,revalidate:Lt,createHref:K=>t.history.createHref(K),encodeLocation:K=>t.history.encodeLocation(K),getFetcher:pt,resetFetcher:Ct,deleteFetcher:Be,dispose:xt,getBlocker:ne,deleteBlocker:Ve,patchRoutes:br,_internalFetchControllers:Y,_internalSetRoutes:Gs,_internalSetStateDoNotUseOrYouWillBreakYourApp(K){ht(K)}},t.unstable_instrumentations&&(U=H2(U,t.unstable_instrumentations.map(K=>K.router).filter(Boolean))),U}function ek(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Bg(t,e,n,i,r,s){let o,c;if(r){o=[];for(let f of e)if(o.push(f),f.route.id===r){c=f;break}}else o=e,c=e[e.length-1];let u=xh(i||".",kv(o),mr(t.pathname,n)||t.pathname,s==="path");if(i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&c){let f=Nv(u.search);if(c.route.index&&!f)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&f){let h=new URLSearchParams(u.search),p=h.getAll("index");h.delete("index"),p.filter(v=>v).forEach(v=>h.append("index",v));let m=h.toString();u.search=m?`?${m}`:""}}return n!=="/"&&(u.pathname=U2({basename:n,pathname:u.pathname})),rs(u)}function Ob(t,e,n){if(!n||!ek(n))return{path:e};if(n.formMethod&&!_k(n.formMethod))return{path:e,error:cr(405,{method:n.formMethod})};let i=()=>({path:e,error:cr(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),o=J1(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!bi(s))return i();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,[v,_])=>`${m}${v}=${_}
|
|
10
|
-
`,""):String(n.body);return{path:e,submission:{formMethod:s,formAction:o,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!bi(s))return i();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:s,formAction:o,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}Qt(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=Vg(n.formData),u=n.formData;else if(n.body instanceof FormData)c=Vg(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=jb(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=jb(c)}catch{return i()}let f={formMethod:s,formAction:o,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(bi(f.formMethod))return{path:e,submission:f};let h=zs(e);return t&&h.search&&Nv(h.search)&&c.append("index",""),h.search=`?${c}`,{path:rs(h),submission:f}}function Bb(t,e,n,i,r,s,o,c,u,f,h,p,m,v,_,w,y,x,M,A,T){let D=A?Ji(A[1])?A[1].error:A[1].data:void 0,I=r.createURL(s.location),U=r.createURL(u),S;if(h&&s.errors){let q=Object.keys(s.errors)[0];S=o.findIndex(J=>J.route.id===q)}else if(A&&Ji(A[1])){let q=A[0];S=o.findIndex(J=>J.route.id===q)-1}let R=A?A[1].statusCode:void 0,H=R&&R>=400,F={currentUrl:I,currentParams:s.matches[0]?.params||{},nextUrl:U,nextParams:o[0].params,...c,actionResult:D,actionStatus:R},W=bu(o),X=o.map((q,J)=>{let{route:Q}=q,$=null;if(S!=null&&J>S)$=!1;else if(Q.lazy)$=!0;else if(!Lv(Q))$=!1;else if(h){let{shouldLoad:ie}=$1(Q,s.loaderData,s.errors);$=ie}else tk(s.loaderData,s.matches[J],q)&&($=!0);if($!==null)return zg(n,i,t,W,q,f,e,$);let Y=!1;typeof T=="boolean"?Y=T:H?Y=!1:(p||I.pathname+I.search===U.pathname+U.search||I.search!==U.search||nk(s.matches[J],q))&&(Y=!0);let Z={...F,defaultShouldRevalidate:Y},z=eu(q,Z);return zg(n,i,t,W,q,f,e,z,Z,T)}),V=[];return _.forEach((q,J)=>{if(h||!o.some(Ee=>Ee.route.id===q.routeId)||v.has(J))return;let Q=s.fetchers.get(J),$=Q&&Q.state!=="idle"&&Q.data===void 0,Y=xa(y,q.path,x);if(!Y){if(M&&$)return;V.push({key:J,routeId:q.routeId,path:q.path,matches:null,match:null,request:null,controller:null});return}if(w.has(J))return;let Z=_f(Y,q.path),z=new AbortController,ie=_l(r,q.path,z.signal),ve=null;if(m.has(J))m.delete(J),ve=Rl(n,i,ie,Y,Z,f,e);else if($)p&&(ve=Rl(n,i,ie,Y,Z,f,e));else{let Ee;typeof T=="boolean"?Ee=T:H?Ee=!1:Ee=p;let Ue={...F,defaultShouldRevalidate:Ee};eu(Z,Ue)&&(ve=Rl(n,i,ie,Y,Z,f,e,Ue))}ve&&V.push({key:J,routeId:q.routeId,path:q.path,matches:ve,match:Z,request:ie,controller:z})}),{dsMatches:X,revalidatingFetchers:V}}function Lv(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function $1(t,e,n){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Lv(t))return{shouldLoad:!1,renderFallback:!1};let i=e!=null&&t.id in e,r=n!=null&&n[t.id]!==void 0;if(!i&&r)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let s=!i&&!r;return{shouldLoad:s,renderFallback:s}}function tk(t,e,n){let i=!e||n.route.id!==e.route.id,r=!t.hasOwnProperty(n.route.id);return i||r}function nk(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function eu(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function zb(t,e,n,i,r,s){let o;if(t){let f=i[t];Qt(f,`No route found to patch children into: routeId = ${t}`),f.children||(f.children=[]),o=f.children}else o=n;let c=[],u=[];if(e.forEach(f=>{let h=o.find(p=>X1(f,p));h?u.push({existingRoute:h,newRoute:f}):c.push(f)}),c.length>0){let f=cu(c,r,[t||"_","patch",String(o?.length||"0")],i);o.push(...f)}if(s&&u.length>0)for(let f=0;f<u.length;f++){let{existingRoute:h,newRoute:p}=u[f],m=h,[v]=cu([p],r,[],{},!0);Object.assign(m,{element:v.element?v.element:m.element,errorElement:v.errorElement?v.errorElement:m.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:m.hydrateFallbackElement})}}function X1(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children?.every((n,i)=>e.children?.some(r=>X1(n,r)))??!1:!1}var Vb=new WeakMap,q1=({key:t,route:e,manifest:n,mapRouteProperties:i})=>{let r=n[e.id];if(Qt(r,"No route found in manifest"),!r.lazy||typeof r.lazy!="object")return;let s=r.lazy[t];if(!s)return;let o=Vb.get(r);o||(o={},Vb.set(r,o));let c=o[t];if(c)return c;let u=(async()=>{let f=_2(t),p=r[t]!==void 0&&t!=="hasErrorBoundary";if(f)Gn(!f,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),o[t]=Promise.resolve();else if(p)Gn(!1,`Route "${r.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let m=await s();m!=null&&(Object.assign(r,{[t]:m}),Object.assign(r,i(r)))}typeof r.lazy=="object"&&(r.lazy[t]=void 0,Object.values(r.lazy).every(m=>m===void 0)&&(r.lazy=void 0))})();return o[t]=u,u},Hb=new WeakMap;function ik(t,e,n,i,r){let s=n[t.id];if(Qt(s,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let h=Hb.get(s);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let p=(async()=>{Qt(typeof t.lazy=="function","No lazy route function found");let m=await t.lazy(),v={};for(let _ in m){let w=m[_];if(w===void 0)continue;let y=b2(_),M=s[_]!==void 0&&_!=="hasErrorBoundary";y?Gn(!y,"Route property "+_+" is not a supported property to be returned from a lazy route function. This property will be ignored."):M?Gn(!M,`Route "${s.id}" has a static property "${_}" defined but its lazy function is also returning a value for this property. The lazy route property "${_}" will be ignored.`):v[_]=w}Object.assign(s,v),Object.assign(s,{...i(s),lazy:void 0})})();return Hb.set(s,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let o=Object.keys(t.lazy),c=[],u;for(let h of o){if(r&&r.includes(h))continue;let p=q1({key:h,route:t,manifest:n,mapRouteProperties:i});p&&(c.push(p),h===e&&(u=p))}let f=c.length>0?Promise.all(c).then(()=>{}):void 0;return f?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:u}}async function Gb(t){let e=t.matches.filter(r=>r.shouldLoad),n={};return(await Promise.all(e.map(r=>r.resolve()))).forEach((r,s)=>{n[e[s].route.id]=r}),n}async function rk(t){return t.matches.some(e=>e.route.middleware)?Y1(t,()=>Gb(t)):Gb(t)}function Y1(t,e){return sk(t,e,i=>{if(yk(i))throw i;return i},pk,n);function n(i,r,s){if(s)return Promise.resolve(Object.assign(s.value,{[r]:{type:"error",result:i}}));{let{matches:o}=t,c=Math.min(Math.max(o.findIndex(f=>f.route.id===r),0),Math.max(o.findIndex(f=>f.shouldCallHandler()),0)),u=ba(o,o[c].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:i}})}}}async function sk(t,e,n,i,r){let{matches:s,request:o,params:c,context:u,unstable_pattern:f}=t,h=s.flatMap(m=>m.route.middleware?m.route.middleware.map(v=>[m.route.id,v]):[]);return await K1({request:o,params:c,context:u,unstable_pattern:f},h,e,n,i,r)}async function K1(t,e,n,i,r,s,o=0){let{request:c}=t;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let u=e[o];if(!u)return await n();let[f,h]=u,p,m=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await K1(t,e,n,i,r,s,o+1)},p.value}catch(v){return p={value:await s(v,f,p)},p.value}};try{let v=await h(t,m),_=v!=null?i(v):void 0;return r(_)?_:p?_??p.value:(p={value:await m()},p.value)}catch(v){return await s(v,f,p)}}function Z1(t,e,n,i,r){let s=q1({key:"middleware",route:i.route,manifest:e,mapRouteProperties:t}),o=ik(i.route,bi(n.method)?"action":"loader",e,t,r);return{middleware:s,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function zg(t,e,n,i,r,s,o,c,u=null,f){let h=!1,p=Z1(t,e,n,r,s);return{...r,_lazyPromises:p,shouldLoad:c,shouldRevalidateArgs:u,shouldCallHandler(m){return h=!0,u?typeof f=="boolean"?eu(r,{...u,defaultShouldRevalidate:f}):typeof m=="boolean"?eu(r,{...u,defaultShouldRevalidate:m}):eu(r,u):c},resolve(m){let{lazy:v,loader:_,middleware:w}=r.route,y=h||c||m&&!bi(n.method)&&(v||_),x=w&&w.length>0&&!_&&!v;return y&&(bi(n.method)||!x)?ok({request:n,unstable_pattern:i,match:r,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:m,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function Rl(t,e,n,i,r,s,o,c=null){return i.map(u=>u.route.id!==r.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Z1(t,e,n,u,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:zg(t,e,n,bu(i),u,s,o,!0,c))}async function ak(t,e,n,i,r,s){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let o={request:e,unstable_pattern:bu(n),params:n[0].params,context:r,matches:n},u=await t({...o,fetcherKey:i,runClientMiddleware:f=>{let h=o;return Y1(h,()=>f({...h,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return u}async function ok({request:t,unstable_pattern:e,match:n,lazyHandlerPromise:i,lazyRoutePromise:r,handlerOverride:s,scopedContext:o}){let c,u,f=bi(t.method),h=f?"action":"loader",p=m=>{let v,_=new Promise((x,M)=>v=M);u=()=>v(),t.signal.addEventListener("abort",u);let w=x=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${n.route.id}]`)):m({request:t,unstable_pattern:e,params:n.params,context:o},...x!==void 0?[x]:[]),y=(async()=>{try{return{type:"data",result:await(s?s(M=>w(M)):w())}}catch(x){return{type:"error",result:x}}})();return Promise.race([y,_])};try{let m=f?n.route.action:n.route.loader;if(i||r)if(m){let v,[_]=await Promise.all([p(m).catch(w=>{v=w}),i,r]);if(v!==void 0)throw v;c=_}else{await i;let v=f?n.route.action:n.route.loader;if(v)[c]=await Promise.all([p(v),r]);else if(h==="action"){let _=new URL(t.url),w=_.pathname+_.search;throw cr(405,{method:t.method,pathname:w,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(m)c=await p(m);else{let v=new URL(t.url),_=v.pathname+v.search;throw cr(404,{pathname:_})}}catch(m){return{type:"error",result:m}}finally{u&&t.signal.removeEventListener("abort",u)}return c}async function lk(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function ck(t){let{result:e,type:n}=t;if(Dv(e)){let i;try{i=await lk(e)}catch(r){return{type:"error",error:r}}return n==="error"?{type:"error",error:new xu(e.status,e.statusText,i),statusCode:e.status,headers:e.headers}:{type:"data",data:i,statusCode:e.status,headers:e.headers}}return n==="error"?Yb(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:hk(e),statusCode:uu(e)?e.status:void 0,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:uu(e)?e.status:void 0}:Yb(e)?{type:"data",data:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function uk(t,e,n,i,r){let s=t.headers.get("Location");if(Qt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Pv(s)){let o=i.slice(0,i.findIndex(c=>c.route.id===n)+1);s=Bg(new URL(e.url),o,r,s),t.headers.set("Location",s)}return t}function Wb(t,e,n,i){let r=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Pv(t)){let s=t,o=s.startsWith("//")?new URL(e.protocol+s):new URL(s);if(r.includes(o.protocol))throw new Error("Invalid redirect location");let c=mr(o.pathname,n)!=null;if(o.origin===e.origin&&c)return o.pathname+o.search+o.hash}try{let s=i.createURL(t);if(r.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return t}function _l(t,e,n,i){let r=t.createURL(J1(e)).toString(),s={signal:n};if(i&&bi(i.formMethod)){let{formMethod:o,formEncType:c}=i;s.method=o.toUpperCase(),c==="application/json"?(s.headers=new Headers({"Content-Type":c}),s.body=JSON.stringify(i.json)):c==="text/plain"?s.body=i.text:c==="application/x-www-form-urlencoded"&&i.formData?s.body=Vg(i.formData):s.body=i.formData}return new Request(r,s)}function Vg(t){let e=new URLSearchParams;for(let[n,i]of t.entries())e.append(n,typeof i=="string"?i:i.name);return e}function jb(t){let e=new FormData;for(let[n,i]of t.entries())e.append(n,i);return e}function dk(t,e,n,i=!1,r=!1){let s={},o=null,c,u=!1,f={},h=n&&Ji(n[1])?n[1].error:void 0;return t.forEach(p=>{if(!(p.route.id in e))return;let m=p.route.id,v=e[m];if(Qt(!ao(v),"Cannot handle redirect results in processLoaderData"),Ji(v)){let _=v.error;if(h!==void 0&&(_=h,h=void 0),o=o||{},r)o[m]=_;else{let w=ba(t,m);o[w.route.id]==null&&(o[w.route.id]=_)}i||(s[m]=j1),u||(u=!0,c=uu(v.error)?v.error.status:500),v.headers&&(f[m]=v.headers)}else s[m]=v.data,v.statusCode&&v.statusCode!==200&&!u&&(c=v.statusCode),v.headers&&(f[m]=v.headers)}),h!==void 0&&n&&(o={[n[0]]:h},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:o,statusCode:c||200,loaderHeaders:f}}function $b(t,e,n,i,r,s){let{loaderData:o,errors:c}=dk(e,n,i);return r.filter(u=>!u.matches||u.matches.some(f=>f.shouldLoad)).forEach(u=>{let{key:f,match:h,controller:p}=u;if(p&&p.signal.aborted)return;let m=s[f];if(Qt(m,"Did not find corresponding fetcher result"),Ji(m)){let v=ba(t.matches,h?.route.id);c&&c[v.route.id]||(c={...c,[v.route.id]:m.error}),t.fetchers.delete(f)}else if(ao(m))Qt(!1,"Unhandled fetcher revalidation redirect");else{let v=Rs(m.data);t.fetchers.set(f,v)}}),{loaderData:o,errors:c}}function Xb(t,e,n,i){let r=Object.entries(e).filter(([,s])=>s!==j1).reduce((s,[o,c])=>(s[o]=c,s),{});for(let s of n){let o=s.route.id;if(!e.hasOwnProperty(o)&&t.hasOwnProperty(o)&&s.route.loader&&(r[o]=t[o]),i&&i.hasOwnProperty(o))break}return r}function qb(t){return t?Ji(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function ba(t,e){return(e?t.slice(0,t.findIndex(i=>i.route.id===e)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function Ud(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function cr(t,{pathname:e,routeId:n,method:i,type:r,message:s}={}){let o="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&e&&n?c=`You made a ${i} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:r==="invalid-body"&&(c="Unable to encode submission body")):t===403?(o="Forbidden",c=`Route "${n}" does not match URL "${e}"`):t===404?(o="Not Found",c=`No route matches URL "${e}"`):t===405&&(o="Method Not Allowed",i&&e&&n?c=`You made a ${i.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:i&&(c=`Invalid request method "${i.toUpperCase()}"`)),new xu(t||500,o,new Error(c),!0)}function Fd(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[i,r]=e[n];if(ao(r))return{key:i,result:r}}}function J1(t){let e=typeof t=="string"?zs(t):t;return rs({...e,hash:""})}function fk(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function hk(t){return new xu(t.init?.status??500,t.init?.statusText??"Internal Server Error",t.data)}function pk(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&mk(n))}function mk(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function gk(t){return Dv(t.result)&&G1.has(t.result.status)}function Ji(t){return t.type==="error"}function ao(t){return(t&&t.type)==="redirect"}function Yb(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Dv(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function vk(t){return G1.has(t)}function yk(t){return Dv(t)&&vk(t.status)&&t.headers.has("Location")}function _k(t){return Y2.has(t.toUpperCase())}function bi(t){return X2.has(t.toUpperCase())}function Nv(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function _f(t,e){let n=typeof e=="string"?zs(e).search:e.search;if(t[t.length-1].route.index&&Nv(n||""))return t[t.length-1];let i=O1(t);return i[i.length-1]}function Kb(t){let{formMethod:e,formAction:n,formEncType:i,text:r,formData:s,json:o}=t;if(!(!e||!n||!i)){if(r!=null)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:void 0,text:r};if(s!=null)return{formMethod:e,formAction:n,formEncType:i,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:o,text:void 0}}}function wm(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function xk(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Nc(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function bk(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Rs(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Sk(t,e){try{let n=t.sessionStorage.getItem(W1);if(n){let i=JSON.parse(n);for(let[r,s]of Object.entries(i||{}))s&&Array.isArray(s)&&e.set(r,new Set(s||[]))}}catch{}}function wk(t,e){if(e.size>0){let n={};for(let[i,r]of e)n[i]=[...r];try{t.sessionStorage.setItem(W1,JSON.stringify(n))}catch(i){Gn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function Zb(){let t,e,n=new Promise((i,r)=>{t=async s=>{i(s);try{await n}catch{}},e=async s=>{r(s);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var Ao=N.createContext(null);Ao.displayName="DataRouter";var Su=N.createContext(null);Su.displayName="DataRouterState";var Q1=N.createContext(!1);function Ek(){return N.useContext(Q1)}var Iv=N.createContext({isTransitioning:!1});Iv.displayName="ViewTransition";var eM=N.createContext(new Map);eM.displayName="Fetchers";var Mk=N.createContext(null);Mk.displayName="Await";var gr=N.createContext(null);gr.displayName="Navigation";var bh=N.createContext(null);bh.displayName="Location";var Vs=N.createContext({outlet:null,matches:[],isDataRoute:!1});Vs.displayName="Route";var Uv=N.createContext(null);Uv.displayName="RouteError";var tM="REACT_ROUTER_ERROR",Tk="REDIRECT",Ak="ROUTE_ERROR_RESPONSE";function Ck(t){if(t.startsWith(`${tM}:${Tk}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function Rk(t){if(t.startsWith(`${tM}:${Ak}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new xu(e.status,e.statusText,e.data)}catch{}}function Pk(t,{relative:e}={}){Qt(wu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=N.useContext(gr),{hash:r,pathname:s,search:o}=Eu(t,{relative:e}),c=s;return n!=="/"&&(c=s==="/"?n:Or([n,s])),i.createHref({pathname:c,search:o,hash:r})}function wu(){return N.useContext(bh)!=null}function vr(){return Qt(wu(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(bh).location}var nM="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function iM(t){N.useContext(gr).static||N.useLayoutEffect(t)}function Fv(){let{isDataRoute:t}=N.useContext(Vs);return t?Gk():kk()}function kk(){Qt(wu(),"useNavigate() may be used only in the context of a <Router> component.");let t=N.useContext(Ao),{basename:e,navigator:n}=N.useContext(gr),{matches:i}=N.useContext(Vs),{pathname:r}=vr(),s=JSON.stringify(kv(i)),o=N.useRef(!1);return iM(()=>{o.current=!0}),N.useCallback((u,f={})=>{if(Gn(o.current,nM),!o.current)return;if(typeof u=="number"){n.go(u);return}let h=xh(u,JSON.parse(s),r,f.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Or([e,h.pathname])),(f.replace?n.replace:n.push)(h,f.state,f)},[e,n,s,r,t])}N.createContext(null);function Eu(t,{relative:e}={}){let{matches:n}=N.useContext(Vs),{pathname:i}=vr(),r=JSON.stringify(kv(n));return N.useMemo(()=>xh(t,JSON.parse(r),i,e==="path"),[t,r,i,e])}function Lk(t,e,n){Qt(wu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=N.useContext(gr),{matches:r}=N.useContext(Vs),s=r[r.length-1],o=s?s.params:{},c=s?s.pathname:"/",u=s?s.pathnameBase:"/",f=s&&s.route;{let y=f&&f.path||"";sM(c,!f||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${y}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
9
|
+
`+E.stack}return{value:a,source:l,stack:b,digest:null}}function Bp(a,l,d){return{value:a,source:null,stack:d??null,digest:l??null}}function zp(a,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var kP=typeof WeakMap=="function"?WeakMap:Map;function Rx(a,l,d){d=xs(-1,d),d.tag=3,d.payload={element:null};var g=l.value;return d.callback=function(){bd||(bd=!0,tm=g),zp(a,l)},d}function Px(a,l,d){d=xs(-1,d),d.tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var b=l.value;d.payload=function(){return g(b)},d.callback=function(){zp(a,l)}}var E=a.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(d.callback=function(){zp(a,l),typeof g!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var k=l.stack;this.componentDidCatch(l.value,{componentStack:k!==null?k:""})}),d}function kx(a,l,d){var g=a.pingCache;if(g===null){g=a.pingCache=new kP;var b=new Set;g.set(l,b)}else b=g.get(l),b===void 0&&(b=new Set,g.set(l,b));b.has(d)||(b.add(d),a=jP.bind(null,a,l,d),l.then(a,a))}function Lx(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function Dx(a,l,d,g,b){return(a.mode&1)===0?(a===l?a.flags|=65536:(a.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=xs(-1,1),l.tag=2,na(d,l,1))),d.lanes|=1),a):(a.flags|=65536,a.lanes=b,a)}var LP=T.ReactCurrentOwner,Oi=!1;function Ti(a,l,d,g){l.child=a===null?Q_(l,null,d,g):jo(l,a.child,d,g)}function Nx(a,l,d,g,b){d=d.render;var E=l.ref;return Xo(l,b),g=kp(a,l,d,g,E,b),d=Lp(),a!==null&&!Oi?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~b,bs(a,l,b)):(Ln&&d&&pp(l),l.flags|=1,Ti(a,l,g,b),l.child)}function Ix(a,l,d,g,b){if(a===null){var E=d.type;return typeof E=="function"&&!lm(E)&&E.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=E,Ux(a,l,E,g,b)):(a=Ad(d.type,null,g,l,l.mode,b),a.ref=l.ref,a.return=l,l.child=a)}if(E=a.child,(a.lanes&b)===0){var k=E.memoizedProps;if(d=d.compare,d=d!==null?d:dc,d(k,g)&&a.ref===l.ref)return bs(a,l,b)}return l.flags|=1,a=la(E,g),a.ref=l.ref,a.return=l,l.child=a}function Ux(a,l,d,g,b){if(a!==null){var E=a.memoizedProps;if(dc(E,g)&&a.ref===l.ref)if(Oi=!1,l.pendingProps=g=E,(a.lanes&b)!==0)(a.flags&131072)!==0&&(Oi=!0);else return l.lanes=a.lanes,bs(a,l,b)}return Vp(a,l,d,g,b)}function Fx(a,l,d){var g=l.pendingProps,b=g.children,E=a!==null?a.memoizedState:null;if(g.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},An(Zo,qi),qi|=d;else{if((d&1073741824)===0)return a=E!==null?E.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,An(Zo,qi),qi|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=E!==null?E.baseLanes:d,An(Zo,qi),qi|=g}else E!==null?(g=E.baseLanes|d,l.memoizedState=null):g=d,An(Zo,qi),qi|=g;return Ti(a,l,b,d),l.child}function Ox(a,l){var d=l.ref;(a===null&&d!==null||a!==null&&a.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function Vp(a,l,d,g,b){var E=Fi(d)?Ia:mi.current;return E=Vo(l,E),Xo(l,b),d=kp(a,l,d,g,E,b),g=Lp(),a!==null&&!Oi?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~b,bs(a,l,b)):(Ln&&g&&pp(l),l.flags|=1,Ti(a,l,d,b),l.child)}function Bx(a,l,d,g,b){if(Fi(d)){var E=!0;Ju(l)}else E=!1;if(Xo(l,b),l.stateNode===null)gd(a,l),Ax(l,d,g),Op(l,d,g,b),g=!0;else if(a===null){var k=l.stateNode,j=l.memoizedProps;k.props=j;var te=k.context,ge=d.contextType;typeof ge=="object"&&ge!==null?ge=rr(ge):(ge=Fi(d)?Ia:mi.current,ge=Vo(l,ge));var Ce=d.getDerivedStateFromProps,De=typeof Ce=="function"||typeof k.getSnapshotBeforeUpdate=="function";De||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(j!==g||te!==ge)&&Cx(l,k,g,ge),ta=!1;var Ae=l.memoizedState;k.state=Ae,od(l,g,k,b),te=l.memoizedState,j!==g||Ae!==te||Ui.current||ta?(typeof Ce=="function"&&(Fp(l,d,Ce,g),te=l.memoizedState),(j=ta||Tx(l,d,j,g,Ae,te,ge))?(De||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(l.flags|=4194308)):(typeof k.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=te),k.props=g,k.state=te,k.context=ge,g=j):(typeof k.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{k=l.stateNode,tx(a,l),j=l.memoizedProps,ge=l.type===l.elementType?j:Mr(l.type,j),k.props=ge,De=l.pendingProps,Ae=k.context,te=d.contextType,typeof te=="object"&&te!==null?te=rr(te):(te=Fi(d)?Ia:mi.current,te=Vo(l,te));var nt=d.getDerivedStateFromProps;(Ce=typeof nt=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(j!==De||Ae!==te)&&Cx(l,k,g,te),ta=!1,Ae=l.memoizedState,k.state=Ae,od(l,g,k,b);var ut=l.memoizedState;j!==De||Ae!==ut||Ui.current||ta?(typeof nt=="function"&&(Fp(l,d,nt,g),ut=l.memoizedState),(ge=ta||Tx(l,d,ge,g,Ae,ut,te)||!1)?(Ce||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,ut,te),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,ut,te)),typeof k.componentDidUpdate=="function"&&(l.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof k.componentDidUpdate!="function"||j===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=ut),k.props=g,k.state=ut,k.context=te,g=ge):(typeof k.componentDidUpdate!="function"||j===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||j===a.memoizedProps&&Ae===a.memoizedState||(l.flags|=1024),g=!1)}return Hp(a,l,d,g,E,b)}function Hp(a,l,d,g,b,E){Ox(a,l);var k=(l.flags&128)!==0;if(!g&&!k)return b&&W_(l,d,!1),bs(a,l,E);g=l.stateNode,LP.current=l;var j=k&&typeof d.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,a!==null&&k?(l.child=jo(l,a.child,null,E),l.child=jo(l,null,j,E)):Ti(a,l,j,E),l.memoizedState=g.state,b&&W_(l,d,!0),l.child}function zx(a){var l=a.stateNode;l.pendingContext?H_(a,l.pendingContext,l.pendingContext!==l.context):l.context&&H_(a,l.context,!1),Mp(a,l.containerInfo)}function Vx(a,l,d,g,b){return Wo(),yp(b),l.flags|=256,Ti(a,l,d,g),l.child}var Gp={dehydrated:null,treeContext:null,retryLane:0};function Wp(a){return{baseLanes:a,cachePool:null,transitions:null}}function Hx(a,l,d){var g=l.pendingProps,b=Un.current,E=!1,k=(l.flags&128)!==0,j;if((j=k)||(j=a!==null&&a.memoizedState===null?!1:(b&2)!==0),j?(E=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(b|=1),An(Un,b&1),a===null)return vp(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((l.mode&1)===0?l.lanes=1:a.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(k=g.children,a=g.fallback,E?(g=l.mode,E=l.child,k={mode:"hidden",children:k},(g&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=k):E=Cd(k,g,0,null),a=ja(a,g,d,null),E.return=l,a.return=l,E.sibling=a,l.child=E,l.child.memoizedState=Wp(d),l.memoizedState=Gp,a):jp(l,k));if(b=a.memoizedState,b!==null&&(j=b.dehydrated,j!==null))return DP(a,l,k,g,j,b,d);if(E){E=g.fallback,k=l.mode,b=a.child,j=b.sibling;var te={mode:"hidden",children:g.children};return(k&1)===0&&l.child!==b?(g=l.child,g.childLanes=0,g.pendingProps=te,l.deletions=null):(g=la(b,te),g.subtreeFlags=b.subtreeFlags&14680064),j!==null?E=la(j,E):(E=ja(E,k,d,null),E.flags|=2),E.return=l,g.return=l,g.sibling=E,l.child=g,g=E,E=l.child,k=a.child.memoizedState,k=k===null?Wp(d):{baseLanes:k.baseLanes|d,cachePool:null,transitions:k.transitions},E.memoizedState=k,E.childLanes=a.childLanes&~d,l.memoizedState=Gp,g}return E=a.child,a=E.sibling,g=la(E,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=d),g.return=l,g.sibling=null,a!==null&&(d=l.deletions,d===null?(l.deletions=[a],l.flags|=16):d.push(a)),l.child=g,l.memoizedState=null,g}function jp(a,l){return l=Cd({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function md(a,l,d,g){return g!==null&&yp(g),jo(l,a.child,null,d),a=jp(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function DP(a,l,d,g,b,E,k){if(d)return l.flags&256?(l.flags&=-257,g=Bp(Error(n(422))),md(a,l,k,g)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(E=g.fallback,b=l.mode,g=Cd({mode:"visible",children:g.children},b,0,null),E=ja(E,b,k,null),E.flags|=2,g.return=l,E.return=l,g.sibling=E,l.child=g,(l.mode&1)!==0&&jo(l,a.child,null,k),l.child.memoizedState=Wp(k),l.memoizedState=Gp,E);if((l.mode&1)===0)return md(a,l,k,null);if(b.data==="$!"){if(g=b.nextSibling&&b.nextSibling.dataset,g)var j=g.dgst;return g=j,E=Error(n(419)),g=Bp(E,g,void 0),md(a,l,k,g)}if(j=(k&a.childLanes)!==0,Oi||j){if(g=si,g!==null){switch(k&-k){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(g.suspendedLanes|k))!==0?0:b,b!==0&&b!==E.retryLane&&(E.retryLane=b,_s(a,b),Cr(g,a,b,-1))}return om(),g=Bp(Error(n(421))),md(a,l,k,g)}return b.data==="$?"?(l.flags|=128,l.child=a.child,l=$P.bind(null,a),b._reactRetry=l,null):(a=E.treeContext,Xi=Zs(b.nextSibling),$i=l,Ln=!0,Er=null,a!==null&&(nr[ir++]=vs,nr[ir++]=ys,nr[ir++]=Ua,vs=a.id,ys=a.overflow,Ua=l),l=jp(l,g.children),l.flags|=4096,l)}function Gx(a,l,d){a.lanes|=l;var g=a.alternate;g!==null&&(g.lanes|=l),Sp(a.return,l,d)}function $p(a,l,d,g,b){var E=a.memoizedState;E===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:b}:(E.isBackwards=l,E.rendering=null,E.renderingStartTime=0,E.last=g,E.tail=d,E.tailMode=b)}function Wx(a,l,d){var g=l.pendingProps,b=g.revealOrder,E=g.tail;if(Ti(a,l,g.children,d),g=Un.current,(g&2)!==0)g=g&1|2,l.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Gx(a,d,l);else if(a.tag===19)Gx(a,d,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if(An(Un,g),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(d=l.child,b=null;d!==null;)a=d.alternate,a!==null&&ld(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),$p(l,!1,b,d,E);break;case"backwards":for(d=null,b=l.child,l.child=null;b!==null;){if(a=b.alternate,a!==null&&ld(a)===null){l.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}$p(l,!0,d,null,E);break;case"together":$p(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function gd(a,l){(l.mode&1)===0&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function bs(a,l,d){if(a!==null&&(l.dependencies=a.dependencies),Va|=l.lanes,(d&l.childLanes)===0)return null;if(a!==null&&l.child!==a.child)throw Error(n(153));if(l.child!==null){for(a=l.child,d=la(a,a.pendingProps),l.child=d,d.return=l;a.sibling!==null;)a=a.sibling,d=d.sibling=la(a,a.pendingProps),d.return=l;d.sibling=null}return l.child}function NP(a,l,d){switch(l.tag){case 3:zx(l),Wo();break;case 5:rx(l);break;case 1:Fi(l.type)&&Ju(l);break;case 4:Mp(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,b=l.memoizedProps.value;An(rd,g._currentValue),g._currentValue=b;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(An(Un,Un.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?Hx(a,l,d):(An(Un,Un.current&1),a=bs(a,l,d),a!==null?a.sibling:null);An(Un,Un.current&1);break;case 19:if(g=(d&l.childLanes)!==0,(a.flags&128)!==0){if(g)return Wx(a,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),An(Un,Un.current),g)break;return null;case 22:case 23:return l.lanes=0,Fx(a,l,d)}return bs(a,l,d)}var jx,Xp,$x,Xx;jx=function(a,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)a.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Xp=function(){},$x=function(a,l,d,g){var b=a.memoizedProps;if(b!==g){a=l.stateNode,Ba(Hr.current);var E=null;switch(d){case"input":b=Ut(a,b),g=Ut(a,g),E=[];break;case"select":b=Z({},b,{value:void 0}),g=Z({},g,{value:void 0}),E=[];break;case"textarea":b=it(a,b),g=it(a,g),E=[];break;default:typeof b.onClick!="function"&&typeof g.onClick=="function"&&(a.onclick=Yu)}rt(d,g);var k;d=null;for(ge in b)if(!g.hasOwnProperty(ge)&&b.hasOwnProperty(ge)&&b[ge]!=null)if(ge==="style"){var j=b[ge];for(k in j)j.hasOwnProperty(k)&&(d||(d={}),d[k]="")}else ge!=="dangerouslySetInnerHTML"&&ge!=="children"&&ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&ge!=="autoFocus"&&(r.hasOwnProperty(ge)?E||(E=[]):(E=E||[]).push(ge,null));for(ge in g){var te=g[ge];if(j=b?.[ge],g.hasOwnProperty(ge)&&te!==j&&(te!=null||j!=null))if(ge==="style")if(j){for(k in j)!j.hasOwnProperty(k)||te&&te.hasOwnProperty(k)||(d||(d={}),d[k]="");for(k in te)te.hasOwnProperty(k)&&j[k]!==te[k]&&(d||(d={}),d[k]=te[k])}else d||(E||(E=[]),E.push(ge,d)),d=te;else ge==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,j=j?j.__html:void 0,te!=null&&j!==te&&(E=E||[]).push(ge,te)):ge==="children"?typeof te!="string"&&typeof te!="number"||(E=E||[]).push(ge,""+te):ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&(r.hasOwnProperty(ge)?(te!=null&&ge==="onScroll"&&Cn("scroll",a),E||j===te||(E=[])):(E=E||[]).push(ge,te))}d&&(E=E||[]).push("style",d);var ge=E;(l.updateQueue=ge)&&(l.flags|=4)}},Xx=function(a,l,d,g){d!==g&&(l.flags|=4)};function Tc(a,l){if(!Ln)switch(a.tailMode){case"hidden":l=a.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function vi(a){var l=a.alternate!==null&&a.alternate.child===a.child,d=0,g=0;if(l)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags&14680064,g|=b.flags&14680064,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=g,a.childLanes=d,l}function IP(a,l,d){var g=l.pendingProps;switch(mp(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vi(l),null;case 1:return Fi(l.type)&&Zu(),vi(l),null;case 3:return g=l.stateNode,qo(),Rn(Ui),Rn(mi),Cp(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(a===null||a.child===null)&&(nd(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Er!==null&&(rm(Er),Er=null))),Xp(a,l),vi(l),null;case 5:Tp(l);var b=Ba(bc.current);if(d=l.type,a!==null&&l.stateNode!=null)$x(a,l,d,g,b),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(n(166));return vi(l),null}if(a=Ba(Hr.current),nd(l)){g=l.stateNode,d=l.type;var E=l.memoizedProps;switch(g[Vr]=l,g[gc]=E,a=(l.mode&1)!==0,d){case"dialog":Cn("cancel",g),Cn("close",g);break;case"iframe":case"object":case"embed":Cn("load",g);break;case"video":case"audio":for(b=0;b<hc.length;b++)Cn(hc[b],g);break;case"source":Cn("error",g);break;case"img":case"image":case"link":Cn("error",g),Cn("load",g);break;case"details":Cn("toggle",g);break;case"input":nn(g,E),Cn("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!E.multiple},Cn("invalid",g);break;case"textarea":O(g,E),Cn("invalid",g)}rt(d,E),b=null;for(var k in E)if(E.hasOwnProperty(k)){var j=E[k];k==="children"?typeof j=="string"?g.textContent!==j&&(E.suppressHydrationWarning!==!0&&qu(g.textContent,j,a),b=["children",j]):typeof j=="number"&&g.textContent!==""+j&&(E.suppressHydrationWarning!==!0&&qu(g.textContent,j,a),b=["children",""+j]):r.hasOwnProperty(k)&&j!=null&&k==="onScroll"&&Cn("scroll",g)}switch(d){case"input":xt(g),ee(g,E,!0);break;case"textarea":xt(g),re(g);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(g.onclick=Yu)}g=b,l.updateQueue=g,g!==null&&(l.flags|=4)}else{k=b.nodeType===9?b:b.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=xe(d)),a==="http://www.w3.org/1999/xhtml"?d==="script"?(a=k.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=k.createElement(d,{is:g.is}):(a=k.createElement(d),d==="select"&&(k=a,g.multiple?k.multiple=!0:g.size&&(k.size=g.size))):a=k.createElementNS(a,d),a[Vr]=l,a[gc]=g,jx(a,l,!1,!1),l.stateNode=a;e:{switch(k=$e(d,g),d){case"dialog":Cn("cancel",a),Cn("close",a),b=g;break;case"iframe":case"object":case"embed":Cn("load",a),b=g;break;case"video":case"audio":for(b=0;b<hc.length;b++)Cn(hc[b],a);b=g;break;case"source":Cn("error",a),b=g;break;case"img":case"image":case"link":Cn("error",a),Cn("load",a),b=g;break;case"details":Cn("toggle",a),b=g;break;case"input":nn(a,g),b=Ut(a,g),Cn("invalid",a);break;case"option":b=g;break;case"select":a._wrapperState={wasMultiple:!!g.multiple},b=Z({},g,{value:void 0}),Cn("invalid",a);break;case"textarea":O(a,g),b=it(a,g),Cn("invalid",a);break;default:b=g}rt(d,b),j=b;for(E in j)if(j.hasOwnProperty(E)){var te=j[E];E==="style"?Be(a,te):E==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Ke(a,te)):E==="children"?typeof te=="string"?(d!=="textarea"||te!=="")&&ke(a,te):typeof te=="number"&&ke(a,""+te):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(r.hasOwnProperty(E)?te!=null&&E==="onScroll"&&Cn("scroll",a):te!=null&&A(a,E,te,k))}switch(d){case"input":xt(a),ee(a,g,!1);break;case"textarea":xt(a),re(a);break;case"option":g.value!=null&&a.setAttribute("value",""+Se(g.value));break;case"select":a.multiple=!!g.multiple,E=g.value,E!=null?kt(a,!!g.multiple,E,!1):g.defaultValue!=null&&kt(a,!!g.multiple,g.defaultValue,!0);break;default:typeof b.onClick=="function"&&(a.onclick=Yu)}switch(d){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return vi(l),null;case 6:if(a&&l.stateNode!=null)Xx(a,l,a.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(n(166));if(d=Ba(bc.current),Ba(Hr.current),nd(l)){if(g=l.stateNode,d=l.memoizedProps,g[Vr]=l,(E=g.nodeValue!==d)&&(a=$i,a!==null))switch(a.tag){case 3:qu(g.nodeValue,d,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&qu(g.nodeValue,d,(a.mode&1)!==0)}E&&(l.flags|=4)}else g=(d.nodeType===9?d:d.ownerDocument).createTextNode(g),g[Vr]=l,l.stateNode=g}return vi(l),null;case 13:if(Rn(Un),g=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(Ln&&Xi!==null&&(l.mode&1)!==0&&(l.flags&128)===0)K_(),Wo(),l.flags|=98560,E=!1;else if(E=nd(l),g!==null&&g.dehydrated!==null){if(a===null){if(!E)throw Error(n(318));if(E=l.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[Vr]=l}else Wo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;vi(l),E=!1}else Er!==null&&(rm(Er),Er=null),E=!0;if(!E)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(g=g!==null,g!==(a!==null&&a.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(a===null||(Un.current&1)!==0?Jn===0&&(Jn=3):om())),l.updateQueue!==null&&(l.flags|=4),vi(l),null);case 4:return qo(),Xp(a,l),a===null&&pc(l.stateNode.containerInfo),vi(l),null;case 10:return bp(l.type._context),vi(l),null;case 17:return Fi(l.type)&&Zu(),vi(l),null;case 19:if(Rn(Un),E=l.memoizedState,E===null)return vi(l),null;if(g=(l.flags&128)!==0,k=E.rendering,k===null)if(g)Tc(E,!1);else{if(Jn!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(k=ld(a),k!==null){for(l.flags|=128,Tc(E,!1),g=k.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=d,d=l.child;d!==null;)E=d,a=g,E.flags&=14680066,k=E.alternate,k===null?(E.childLanes=0,E.lanes=a,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=k.childLanes,E.lanes=k.lanes,E.child=k.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=k.memoizedProps,E.memoizedState=k.memoizedState,E.updateQueue=k.updateQueue,E.type=k.type,a=k.dependencies,E.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),d=d.sibling;return An(Un,Un.current&1|2),l.child}a=a.sibling}E.tail!==null&&L()>Jo&&(l.flags|=128,g=!0,Tc(E,!1),l.lanes=4194304)}else{if(!g)if(a=ld(k),a!==null){if(l.flags|=128,g=!0,d=a.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),Tc(E,!0),E.tail===null&&E.tailMode==="hidden"&&!k.alternate&&!Ln)return vi(l),null}else 2*L()-E.renderingStartTime>Jo&&d!==1073741824&&(l.flags|=128,g=!0,Tc(E,!1),l.lanes=4194304);E.isBackwards?(k.sibling=l.child,l.child=k):(d=E.last,d!==null?d.sibling=k:l.child=k,E.last=k)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=L(),l.sibling=null,d=Un.current,An(Un,g?d&1|2:d&1),l):(vi(l),null);case 22:case 23:return am(),g=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(l.flags|=8192),g&&(l.mode&1)!==0?(qi&1073741824)!==0&&(vi(l),l.subtreeFlags&6&&(l.flags|=8192)):vi(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function UP(a,l){switch(mp(l),l.tag){case 1:return Fi(l.type)&&Zu(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return qo(),Rn(Ui),Rn(mi),Cp(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 5:return Tp(l),null;case 13:if(Rn(Un),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Wo()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Rn(Un),null;case 4:return qo(),null;case 10:return bp(l.type._context),null;case 22:case 23:return am(),null;case 24:return null;default:return null}}var vd=!1,yi=!1,FP=typeof WeakSet=="function"?WeakSet:Set,at=null;function Ko(a,l){var d=a.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){On(a,l,g)}else d.current=null}function qp(a,l,d){try{d()}catch(g){On(a,l,g)}}var qx=!1;function OP(a,l){if(ap=Fu,a=T_(),Jh(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var b=g.anchorOffset,E=g.focusNode;g=g.focusOffset;try{d.nodeType,E.nodeType}catch{d=null;break e}var k=0,j=-1,te=-1,ge=0,Ce=0,De=a,Ae=null;t:for(;;){for(var nt;De!==d||b!==0&&De.nodeType!==3||(j=k+b),De!==E||g!==0&&De.nodeType!==3||(te=k+g),De.nodeType===3&&(k+=De.nodeValue.length),(nt=De.firstChild)!==null;)Ae=De,De=nt;for(;;){if(De===a)break t;if(Ae===d&&++ge===b&&(j=k),Ae===E&&++Ce===g&&(te=k),(nt=De.nextSibling)!==null)break;De=Ae,Ae=De.parentNode}De=nt}d=j===-1||te===-1?null:{start:j,end:te}}else d=null}d=d||{start:0,end:0}}else d=null;for(op={focusedElem:a,selectionRange:d},Fu=!1,at=l;at!==null;)if(l=at,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,at=a;else for(;at!==null;){l=at;try{var ut=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ut!==null){var gt=ut.memoizedProps,Hn=ut.memoizedState,ue=l.stateNode,se=ue.getSnapshotBeforeUpdate(l.elementType===l.type?gt:Mr(l.type,gt),Hn);ue.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var fe=l.stateNode.containerInfo;fe.nodeType===1?fe.textContent="":fe.nodeType===9&&fe.documentElement&&fe.removeChild(fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ze){On(l,l.return,ze)}if(a=l.sibling,a!==null){a.return=l.return,at=a;break}at=l.return}return ut=qx,qx=!1,ut}function Ac(a,l,d){var g=l.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var b=g=g.next;do{if((b.tag&a)===a){var E=b.destroy;b.destroy=void 0,E!==void 0&&qp(l,d,E)}b=b.next}while(b!==g)}}function yd(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&a)===a){var g=d.create;d.destroy=g()}d=d.next}while(d!==l)}}function Yp(a){var l=a.ref;if(l!==null){var d=a.stateNode;a.tag,a=d,typeof l=="function"?l(a):l.current=a}}function Yx(a){var l=a.alternate;l!==null&&(a.alternate=null,Yx(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[Vr],delete l[gc],delete l[dp],delete l[xP],delete l[bP])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Kx(a){return a.tag===5||a.tag===3||a.tag===4}function Zx(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Kx(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Kp(a,l,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(a,l):d.insertBefore(a,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(a,d)):(l=d,l.appendChild(a)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Yu));else if(g!==4&&(a=a.child,a!==null))for(Kp(a,l,d),a=a.sibling;a!==null;)Kp(a,l,d),a=a.sibling}function Zp(a,l,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,l?d.insertBefore(a,l):d.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(Zp(a,l,d),a=a.sibling;a!==null;)Zp(a,l,d),a=a.sibling}var ui=null,Tr=!1;function ia(a,l,d){for(d=d.child;d!==null;)Jx(a,l,d),d=d.sibling}function Jx(a,l,d){if(je&&typeof je.onCommitFiberUnmount=="function")try{je.onCommitFiberUnmount(Ge,d)}catch{}switch(d.tag){case 5:yi||Ko(d,l);case 6:var g=ui,b=Tr;ui=null,ia(a,l,d),ui=g,Tr=b,ui!==null&&(Tr?(a=ui,d=d.stateNode,a.nodeType===8?a.parentNode.removeChild(d):a.removeChild(d)):ui.removeChild(d.stateNode));break;case 18:ui!==null&&(Tr?(a=ui,d=d.stateNode,a.nodeType===8?up(a.parentNode,d):a.nodeType===1&&up(a,d),sc(a)):up(ui,d.stateNode));break;case 4:g=ui,b=Tr,ui=d.stateNode.containerInfo,Tr=!0,ia(a,l,d),ui=g,Tr=b;break;case 0:case 11:case 14:case 15:if(!yi&&(g=d.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){b=g=g.next;do{var E=b,k=E.destroy;E=E.tag,k!==void 0&&((E&2)!==0||(E&4)!==0)&&qp(d,l,k),b=b.next}while(b!==g)}ia(a,l,d);break;case 1:if(!yi&&(Ko(d,l),g=d.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(j){On(d,l,j)}ia(a,l,d);break;case 21:ia(a,l,d);break;case 22:d.mode&1?(yi=(g=yi)||d.memoizedState!==null,ia(a,l,d),yi=g):ia(a,l,d);break;default:ia(a,l,d)}}function Qx(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var d=a.stateNode;d===null&&(d=a.stateNode=new FP),l.forEach(function(g){var b=XP.bind(null,a,g);d.has(g)||(d.add(g),g.then(b,b))})}}function Ar(a,l){var d=l.deletions;if(d!==null)for(var g=0;g<d.length;g++){var b=d[g];try{var E=a,k=l,j=k;e:for(;j!==null;){switch(j.tag){case 5:ui=j.stateNode,Tr=!1;break e;case 3:ui=j.stateNode.containerInfo,Tr=!0;break e;case 4:ui=j.stateNode.containerInfo,Tr=!0;break e}j=j.return}if(ui===null)throw Error(n(160));Jx(E,k,b),ui=null,Tr=!1;var te=b.alternate;te!==null&&(te.return=null),b.return=null}catch(ge){On(b,l,ge)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)eb(l,a),l=l.sibling}function eb(a,l){var d=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Ar(l,a),Wr(a),g&4){try{Ac(3,a,a.return),yd(3,a)}catch(gt){On(a,a.return,gt)}try{Ac(5,a,a.return)}catch(gt){On(a,a.return,gt)}}break;case 1:Ar(l,a),Wr(a),g&512&&d!==null&&Ko(d,d.return);break;case 5:if(Ar(l,a),Wr(a),g&512&&d!==null&&Ko(d,d.return),a.flags&32){var b=a.stateNode;try{ke(b,"")}catch(gt){On(a,a.return,gt)}}if(g&4&&(b=a.stateNode,b!=null)){var E=a.memoizedProps,k=d!==null?d.memoizedProps:E,j=a.type,te=a.updateQueue;if(a.updateQueue=null,te!==null)try{j==="input"&&E.type==="radio"&&E.name!=null&&Lt(b,E),$e(j,k);var ge=$e(j,E);for(k=0;k<te.length;k+=2){var Ce=te[k],De=te[k+1];Ce==="style"?Be(b,De):Ce==="dangerouslySetInnerHTML"?Ke(b,De):Ce==="children"?ke(b,De):A(b,Ce,De,ge)}switch(j){case"input":an(b,E);break;case"textarea":P(b,E);break;case"select":var Ae=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!E.multiple;var nt=E.value;nt!=null?kt(b,!!E.multiple,nt,!1):Ae!==!!E.multiple&&(E.defaultValue!=null?kt(b,!!E.multiple,E.defaultValue,!0):kt(b,!!E.multiple,E.multiple?[]:"",!1))}b[gc]=E}catch(gt){On(a,a.return,gt)}}break;case 6:if(Ar(l,a),Wr(a),g&4){if(a.stateNode===null)throw Error(n(162));b=a.stateNode,E=a.memoizedProps;try{b.nodeValue=E}catch(gt){On(a,a.return,gt)}}break;case 3:if(Ar(l,a),Wr(a),g&4&&d!==null&&d.memoizedState.isDehydrated)try{sc(l.containerInfo)}catch(gt){On(a,a.return,gt)}break;case 4:Ar(l,a),Wr(a);break;case 13:Ar(l,a),Wr(a),b=a.child,b.flags&8192&&(E=b.memoizedState!==null,b.stateNode.isHidden=E,!E||b.alternate!==null&&b.alternate.memoizedState!==null||(em=L())),g&4&&Qx(a);break;case 22:if(Ce=d!==null&&d.memoizedState!==null,a.mode&1?(yi=(ge=yi)||Ce,Ar(l,a),yi=ge):Ar(l,a),Wr(a),g&8192){if(ge=a.memoizedState!==null,(a.stateNode.isHidden=ge)&&!Ce&&(a.mode&1)!==0)for(at=a,Ce=a.child;Ce!==null;){for(De=at=Ce;at!==null;){switch(Ae=at,nt=Ae.child,Ae.tag){case 0:case 11:case 14:case 15:Ac(4,Ae,Ae.return);break;case 1:Ko(Ae,Ae.return);var ut=Ae.stateNode;if(typeof ut.componentWillUnmount=="function"){g=Ae,d=Ae.return;try{l=g,ut.props=l.memoizedProps,ut.state=l.memoizedState,ut.componentWillUnmount()}catch(gt){On(g,d,gt)}}break;case 5:Ko(Ae,Ae.return);break;case 22:if(Ae.memoizedState!==null){ib(De);continue}}nt!==null?(nt.return=Ae,at=nt):ib(De)}Ce=Ce.sibling}e:for(Ce=null,De=a;;){if(De.tag===5){if(Ce===null){Ce=De;try{b=De.stateNode,ge?(E=b.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(j=De.stateNode,te=De.memoizedProps.style,k=te!=null&&te.hasOwnProperty("display")?te.display:null,j.style.display=Re("display",k))}catch(gt){On(a,a.return,gt)}}}else if(De.tag===6){if(Ce===null)try{De.stateNode.nodeValue=ge?"":De.memoizedProps}catch(gt){On(a,a.return,gt)}}else if((De.tag!==22&&De.tag!==23||De.memoizedState===null||De===a)&&De.child!==null){De.child.return=De,De=De.child;continue}if(De===a)break e;for(;De.sibling===null;){if(De.return===null||De.return===a)break e;Ce===De&&(Ce=null),De=De.return}Ce===De&&(Ce=null),De.sibling.return=De.return,De=De.sibling}}break;case 19:Ar(l,a),Wr(a),g&4&&Qx(a);break;case 21:break;default:Ar(l,a),Wr(a)}}function Wr(a){var l=a.flags;if(l&2){try{e:{for(var d=a.return;d!==null;){if(Kx(d)){var g=d;break e}d=d.return}throw Error(n(160))}switch(g.tag){case 5:var b=g.stateNode;g.flags&32&&(ke(b,""),g.flags&=-33);var E=Zx(a);Zp(a,E,b);break;case 3:case 4:var k=g.stateNode.containerInfo,j=Zx(a);Kp(a,j,k);break;default:throw Error(n(161))}}catch(te){On(a,a.return,te)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function BP(a,l,d){at=a,tb(a)}function tb(a,l,d){for(var g=(a.mode&1)!==0;at!==null;){var b=at,E=b.child;if(b.tag===22&&g){var k=b.memoizedState!==null||vd;if(!k){var j=b.alternate,te=j!==null&&j.memoizedState!==null||yi;j=vd;var ge=yi;if(vd=k,(yi=te)&&!ge)for(at=b;at!==null;)k=at,te=k.child,k.tag===22&&k.memoizedState!==null?rb(b):te!==null?(te.return=k,at=te):rb(b);for(;E!==null;)at=E,tb(E),E=E.sibling;at=b,vd=j,yi=ge}nb(a)}else(b.subtreeFlags&8772)!==0&&E!==null?(E.return=b,at=E):nb(a)}}function nb(a){for(;at!==null;){var l=at;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:yi||yd(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!yi)if(d===null)g.componentDidMount();else{var b=l.elementType===l.type?d.memoizedProps:Mr(l.type,d.memoizedProps);g.componentDidUpdate(b,d.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var E=l.updateQueue;E!==null&&ix(l,E,g);break;case 3:var k=l.updateQueue;if(k!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}ix(l,k,d)}break;case 5:var j=l.stateNode;if(d===null&&l.flags&4){d=j;var te=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&d.focus();break;case"img":te.src&&(d.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ge=l.alternate;if(ge!==null){var Ce=ge.memoizedState;if(Ce!==null){var De=Ce.dehydrated;De!==null&&sc(De)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yi||l.flags&512&&Yp(l)}catch(Ae){On(l,l.return,Ae)}}if(l===a){at=null;break}if(d=l.sibling,d!==null){d.return=l.return,at=d;break}at=l.return}}function ib(a){for(;at!==null;){var l=at;if(l===a){at=null;break}var d=l.sibling;if(d!==null){d.return=l.return,at=d;break}at=l.return}}function rb(a){for(;at!==null;){var l=at;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{yd(4,l)}catch(te){On(l,d,te)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var b=l.return;try{g.componentDidMount()}catch(te){On(l,b,te)}}var E=l.return;try{Yp(l)}catch(te){On(l,E,te)}break;case 5:var k=l.return;try{Yp(l)}catch(te){On(l,k,te)}}}catch(te){On(l,l.return,te)}if(l===a){at=null;break}var j=l.sibling;if(j!==null){j.return=l.return,at=j;break}at=l.return}}var zP=Math.ceil,_d=T.ReactCurrentDispatcher,Jp=T.ReactCurrentOwner,ar=T.ReactCurrentBatchConfig,dn=0,si=null,Wn=null,di=0,qi=0,Zo=Js(0),Jn=0,Cc=null,Va=0,xd=0,Qp=0,Rc=null,Bi=null,em=0,Jo=1/0,Ss=null,bd=!1,tm=null,ra=null,Sd=!1,sa=null,wd=0,Pc=0,nm=null,Ed=-1,Md=0;function Ai(){return(dn&6)!==0?L():Ed!==-1?Ed:Ed=L()}function aa(a){return(a.mode&1)===0?1:(dn&2)!==0&&di!==0?di&-di:wP.transition!==null?(Md===0&&(Md=Ni()),Md):(a=Ft,a!==0||(a=window.event,a=a===void 0?16:a_(a.type)),a)}function Cr(a,l,d,g){if(50<Pc)throw Pc=0,nm=null,Error(n(185));Wi(a,d,g),((dn&2)===0||a!==si)&&(a===si&&((dn&2)===0&&(xd|=d),Jn===4&&oa(a,di)),zi(a,g),d===1&&dn===0&&(l.mode&1)===0&&(Jo=L()+500,Qu&&ea()))}function zi(a,l){var d=a.callbackNode;Mi(a,l);var g=In(a,a===si?di:0);if(g===0)d!==null&&Nn(d),a.callbackNode=null,a.callbackPriority=0;else if(l=g&-g,a.callbackPriority!==l){if(d!=null&&Nn(d),l===1)a.tag===0?SP(ab.bind(null,a)):j_(ab.bind(null,a)),yP(function(){(dn&6)===0&&ea()}),d=null;else{switch(Sr(g)){case 1:d=pe;break;case 4:d=de;break;case 16:d=ce;break;case 536870912:d=qe;break;default:d=ce}d=pb(d,sb.bind(null,a))}a.callbackPriority=l,a.callbackNode=d}}function sb(a,l){if(Ed=-1,Md=0,(dn&6)!==0)throw Error(n(327));var d=a.callbackNode;if(Qo()&&a.callbackNode!==d)return null;var g=In(a,a===si?di:0);if(g===0)return null;if((g&30)!==0||(g&a.expiredLanes)!==0||l)l=Td(a,g);else{l=g;var b=dn;dn|=2;var E=lb();(si!==a||di!==l)&&(Ss=null,Jo=L()+500,Ga(a,l));do try{GP();break}catch(j){ob(a,j)}while(!0);xp(),_d.current=E,dn=b,Wn!==null?l=0:(si=null,di=0,l=Jn)}if(l!==0){if(l===2&&(b=rn(a),b!==0&&(g=b,l=im(a,b))),l===1)throw d=Cc,Ga(a,0),oa(a,g),zi(a,L()),d;if(l===6)oa(a,g);else{if(b=a.current.alternate,(g&30)===0&&!VP(b)&&(l=Td(a,g),l===2&&(E=rn(a),E!==0&&(g=E,l=im(a,E))),l===1))throw d=Cc,Ga(a,0),oa(a,g),zi(a,L()),d;switch(a.finishedWork=b,a.finishedLanes=g,l){case 0:case 1:throw Error(n(345));case 2:Wa(a,Bi,Ss);break;case 3:if(oa(a,g),(g&130023424)===g&&(l=em+500-L(),10<l)){if(In(a,0)!==0)break;if(b=a.suspendedLanes,(b&g)!==g){Ai(),a.pingedLanes|=a.suspendedLanes&b;break}a.timeoutHandle=cp(Wa.bind(null,a,Bi,Ss),l);break}Wa(a,Bi,Ss);break;case 4:if(oa(a,g),(g&4194240)===g)break;for(l=a.eventTimes,b=-1;0<g;){var k=31-He(g);E=1<<k,k=l[k],k>b&&(b=k),g&=~E}if(g=b,g=L()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*zP(g/1960))-g,10<g){a.timeoutHandle=cp(Wa.bind(null,a,Bi,Ss),g);break}Wa(a,Bi,Ss);break;case 5:Wa(a,Bi,Ss);break;default:throw Error(n(329))}}}return zi(a,L()),a.callbackNode===d?sb.bind(null,a):null}function im(a,l){var d=Rc;return a.current.memoizedState.isDehydrated&&(Ga(a,l).flags|=256),a=Td(a,l),a!==2&&(l=Bi,Bi=d,l!==null&&rm(l)),a}function rm(a){Bi===null?Bi=a:Bi.push.apply(Bi,a)}function VP(a){for(var l=a;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var g=0;g<d.length;g++){var b=d[g],E=b.getSnapshot;b=b.value;try{if(!wr(E(),b))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function oa(a,l){for(l&=~Qp,l&=~xd,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var d=31-He(l),g=1<<d;a[d]=-1,l&=~g}}function ab(a){if((dn&6)!==0)throw Error(n(327));Qo();var l=In(a,0);if((l&1)===0)return zi(a,L()),null;var d=Td(a,l);if(a.tag!==0&&d===2){var g=rn(a);g!==0&&(l=g,d=im(a,g))}if(d===1)throw d=Cc,Ga(a,0),oa(a,l),zi(a,L()),d;if(d===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Wa(a,Bi,Ss),zi(a,L()),null}function sm(a,l){var d=dn;dn|=1;try{return a(l)}finally{dn=d,dn===0&&(Jo=L()+500,Qu&&ea())}}function Ha(a){sa!==null&&sa.tag===0&&(dn&6)===0&&Qo();var l=dn;dn|=1;var d=ar.transition,g=Ft;try{if(ar.transition=null,Ft=1,a)return a()}finally{Ft=g,ar.transition=d,dn=l,(dn&6)===0&&ea()}}function am(){qi=Zo.current,Rn(Zo)}function Ga(a,l){a.finishedWork=null,a.finishedLanes=0;var d=a.timeoutHandle;if(d!==-1&&(a.timeoutHandle=-1,vP(d)),Wn!==null)for(d=Wn.return;d!==null;){var g=d;switch(mp(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&Zu();break;case 3:qo(),Rn(Ui),Rn(mi),Cp();break;case 5:Tp(g);break;case 4:qo();break;case 13:Rn(Un);break;case 19:Rn(Un);break;case 10:bp(g.type._context);break;case 22:case 23:am()}d=d.return}if(si=a,Wn=a=la(a.current,null),di=qi=l,Jn=0,Cc=null,Qp=xd=Va=0,Bi=Rc=null,Oa!==null){for(l=0;l<Oa.length;l++)if(d=Oa[l],g=d.interleaved,g!==null){d.interleaved=null;var b=g.next,E=d.pending;if(E!==null){var k=E.next;E.next=b,g.next=k}d.pending=g}Oa=null}return a}function ob(a,l){do{var d=Wn;try{if(xp(),cd.current=hd,ud){for(var g=Fn.memoizedState;g!==null;){var b=g.queue;b!==null&&(b.pending=null),g=g.next}ud=!1}if(za=0,ri=Zn=Fn=null,Sc=!1,wc=0,Jp.current=null,d===null||d.return===null){Jn=1,Cc=l,Wn=null;break}e:{var E=a,k=d.return,j=d,te=l;if(l=di,j.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var ge=te,Ce=j,De=Ce.tag;if((Ce.mode&1)===0&&(De===0||De===11||De===15)){var Ae=Ce.alternate;Ae?(Ce.updateQueue=Ae.updateQueue,Ce.memoizedState=Ae.memoizedState,Ce.lanes=Ae.lanes):(Ce.updateQueue=null,Ce.memoizedState=null)}var nt=Lx(k);if(nt!==null){nt.flags&=-257,Dx(nt,k,j,E,l),nt.mode&1&&kx(E,ge,l),l=nt,te=ge;var ut=l.updateQueue;if(ut===null){var gt=new Set;gt.add(te),l.updateQueue=gt}else ut.add(te);break e}else{if((l&1)===0){kx(E,ge,l),om();break e}te=Error(n(426))}}else if(Ln&&j.mode&1){var Hn=Lx(k);if(Hn!==null){(Hn.flags&65536)===0&&(Hn.flags|=256),Dx(Hn,k,j,E,l),yp(Yo(te,j));break e}}E=te=Yo(te,j),Jn!==4&&(Jn=2),Rc===null?Rc=[E]:Rc.push(E),E=k;do{switch(E.tag){case 3:E.flags|=65536,l&=-l,E.lanes|=l;var ue=Rx(E,te,l);nx(E,ue);break e;case 1:j=te;var se=E.type,fe=E.stateNode;if((E.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||fe!==null&&typeof fe.componentDidCatch=="function"&&(ra===null||!ra.has(fe)))){E.flags|=65536,l&=-l,E.lanes|=l;var ze=Px(E,j,l);nx(E,ze);break e}}E=E.return}while(E!==null)}ub(d)}catch(St){l=St,Wn===d&&d!==null&&(Wn=d=d.return);continue}break}while(!0)}function lb(){var a=_d.current;return _d.current=hd,a===null?hd:a}function om(){(Jn===0||Jn===3||Jn===2)&&(Jn=4),si===null||(Va&268435455)===0&&(xd&268435455)===0||oa(si,di)}function Td(a,l){var d=dn;dn|=2;var g=lb();(si!==a||di!==l)&&(Ss=null,Ga(a,l));do try{HP();break}catch(b){ob(a,b)}while(!0);if(xp(),dn=d,_d.current=g,Wn!==null)throw Error(n(261));return si=null,di=0,Jn}function HP(){for(;Wn!==null;)cb(Wn)}function GP(){for(;Wn!==null&&!Kn();)cb(Wn)}function cb(a){var l=hb(a.alternate,a,qi);a.memoizedProps=a.pendingProps,l===null?ub(a):Wn=l,Jp.current=null}function ub(a){var l=a;do{var d=l.alternate;if(a=l.return,(l.flags&32768)===0){if(d=IP(d,l,qi),d!==null){Wn=d;return}}else{if(d=UP(d,l),d!==null){d.flags&=32767,Wn=d;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Jn=6,Wn=null;return}}if(l=l.sibling,l!==null){Wn=l;return}Wn=l=a}while(l!==null);Jn===0&&(Jn=5)}function Wa(a,l,d){var g=Ft,b=ar.transition;try{ar.transition=null,Ft=1,WP(a,l,d,g)}finally{ar.transition=b,Ft=g}return null}function WP(a,l,d,g){do Qo();while(sa!==null);if((dn&6)!==0)throw Error(n(327));d=a.finishedWork;var b=a.finishedLanes;if(d===null)return null;if(a.finishedWork=null,a.finishedLanes=0,d===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var E=d.lanes|d.childLanes;if(Ws(a,E),a===si&&(Wn=si=null,di=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Sd||(Sd=!0,pb(ce,function(){return Qo(),null})),E=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||E){E=ar.transition,ar.transition=null;var k=Ft;Ft=1;var j=dn;dn|=4,Jp.current=null,OP(a,d),eb(d,a),uP(op),Fu=!!ap,op=ap=null,a.current=d,BP(d),gn(),dn=j,Ft=k,ar.transition=E}else a.current=d;if(Sd&&(Sd=!1,sa=a,wd=b),E=a.pendingLanes,E===0&&(ra=null),ct(d.stateNode),zi(a,L()),l!==null)for(g=a.onRecoverableError,d=0;d<l.length;d++)b=l[d],g(b.value,{componentStack:b.stack,digest:b.digest});if(bd)throw bd=!1,a=tm,tm=null,a;return(wd&1)!==0&&a.tag!==0&&Qo(),E=a.pendingLanes,(E&1)!==0?a===nm?Pc++:(Pc=0,nm=a):Pc=0,ea(),null}function Qo(){if(sa!==null){var a=Sr(wd),l=ar.transition,d=Ft;try{if(ar.transition=null,Ft=16>a?16:a,sa===null)var g=!1;else{if(a=sa,sa=null,wd=0,(dn&6)!==0)throw Error(n(331));var b=dn;for(dn|=4,at=a.current;at!==null;){var E=at,k=E.child;if((at.flags&16)!==0){var j=E.deletions;if(j!==null){for(var te=0;te<j.length;te++){var ge=j[te];for(at=ge;at!==null;){var Ce=at;switch(Ce.tag){case 0:case 11:case 15:Ac(8,Ce,E)}var De=Ce.child;if(De!==null)De.return=Ce,at=De;else for(;at!==null;){Ce=at;var Ae=Ce.sibling,nt=Ce.return;if(Yx(Ce),Ce===ge){at=null;break}if(Ae!==null){Ae.return=nt,at=Ae;break}at=nt}}}var ut=E.alternate;if(ut!==null){var gt=ut.child;if(gt!==null){ut.child=null;do{var Hn=gt.sibling;gt.sibling=null,gt=Hn}while(gt!==null)}}at=E}}if((E.subtreeFlags&2064)!==0&&k!==null)k.return=E,at=k;else e:for(;at!==null;){if(E=at,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:Ac(9,E,E.return)}var ue=E.sibling;if(ue!==null){ue.return=E.return,at=ue;break e}at=E.return}}var se=a.current;for(at=se;at!==null;){k=at;var fe=k.child;if((k.subtreeFlags&2064)!==0&&fe!==null)fe.return=k,at=fe;else e:for(k=se;at!==null;){if(j=at,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:yd(9,j)}}catch(St){On(j,j.return,St)}if(j===k){at=null;break e}var ze=j.sibling;if(ze!==null){ze.return=j.return,at=ze;break e}at=j.return}}if(dn=b,ea(),je&&typeof je.onPostCommitFiberRoot=="function")try{je.onPostCommitFiberRoot(Ge,a)}catch{}g=!0}return g}finally{Ft=d,ar.transition=l}}return!1}function db(a,l,d){l=Yo(d,l),l=Rx(a,l,1),a=na(a,l,1),l=Ai(),a!==null&&(Wi(a,1,l),zi(a,l))}function On(a,l,d){if(a.tag===3)db(a,a,d);else for(;l!==null;){if(l.tag===3){db(l,a,d);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ra===null||!ra.has(g))){a=Yo(d,a),a=Px(l,a,1),l=na(l,a,1),a=Ai(),l!==null&&(Wi(l,1,a),zi(l,a));break}}l=l.return}}function jP(a,l,d){var g=a.pingCache;g!==null&&g.delete(l),l=Ai(),a.pingedLanes|=a.suspendedLanes&d,si===a&&(di&d)===d&&(Jn===4||Jn===3&&(di&130023424)===di&&500>L()-em?Ga(a,0):Qp|=d),zi(a,l)}function fb(a,l){l===0&&((a.mode&1)===0?l=1:(l=vn,vn<<=1,(vn&130023424)===0&&(vn=4194304)));var d=Ai();a=_s(a,l),a!==null&&(Wi(a,l,d),zi(a,d))}function $P(a){var l=a.memoizedState,d=0;l!==null&&(d=l.retryLane),fb(a,d)}function XP(a,l){var d=0;switch(a.tag){case 13:var g=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(l),fb(a,d)}var hb;hb=function(a,l,d){if(a!==null)if(a.memoizedProps!==l.pendingProps||Ui.current)Oi=!0;else{if((a.lanes&d)===0&&(l.flags&128)===0)return Oi=!1,NP(a,l,d);Oi=(a.flags&131072)!==0}else Oi=!1,Ln&&(l.flags&1048576)!==0&&$_(l,td,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;gd(a,l),a=l.pendingProps;var b=Vo(l,mi.current);Xo(l,d),b=kp(null,l,g,a,b,d);var E=Lp();return l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Fi(g)?(E=!0,Ju(l)):E=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Ep(l),b.updater=pd,l.stateNode=b,b._reactInternals=l,Op(l,g,a,d),l=Hp(null,l,g,!0,E,d)):(l.tag=0,Ln&&E&&pp(l),Ti(null,l,b,d),l=l.child),l;case 16:g=l.elementType;e:{switch(gd(a,l),a=l.pendingProps,b=g._init,g=b(g._payload),l.type=g,b=l.tag=YP(g),a=Mr(g,a),b){case 0:l=Vp(null,l,g,a,d);break e;case 1:l=Bx(null,l,g,a,d);break e;case 11:l=Nx(null,l,g,a,d);break e;case 14:l=Ix(null,l,g,Mr(g.type,a),d);break e}throw Error(n(306,g,""))}return l;case 0:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Mr(g,b),Vp(a,l,g,b,d);case 1:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Mr(g,b),Bx(a,l,g,b,d);case 3:e:{if(zx(l),a===null)throw Error(n(387));g=l.pendingProps,E=l.memoizedState,b=E.element,tx(a,l),od(l,g,null,d);var k=l.memoizedState;if(g=k.element,E.isDehydrated)if(E={element:g,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){b=Yo(Error(n(423)),l),l=Vx(a,l,g,d,b);break e}else if(g!==b){b=Yo(Error(n(424)),l),l=Vx(a,l,g,d,b);break e}else for(Xi=Zs(l.stateNode.containerInfo.firstChild),$i=l,Ln=!0,Er=null,d=Q_(l,null,g,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Wo(),g===b){l=bs(a,l,d);break e}Ti(a,l,g,d)}l=l.child}return l;case 5:return rx(l),a===null&&vp(l),g=l.type,b=l.pendingProps,E=a!==null?a.memoizedProps:null,k=b.children,lp(g,b)?k=null:E!==null&&lp(g,E)&&(l.flags|=32),Ox(a,l),Ti(a,l,k,d),l.child;case 6:return a===null&&vp(l),null;case 13:return Hx(a,l,d);case 4:return Mp(l,l.stateNode.containerInfo),g=l.pendingProps,a===null?l.child=jo(l,null,g,d):Ti(a,l,g,d),l.child;case 11:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Mr(g,b),Nx(a,l,g,b,d);case 7:return Ti(a,l,l.pendingProps,d),l.child;case 8:return Ti(a,l,l.pendingProps.children,d),l.child;case 12:return Ti(a,l,l.pendingProps.children,d),l.child;case 10:e:{if(g=l.type._context,b=l.pendingProps,E=l.memoizedProps,k=b.value,An(rd,g._currentValue),g._currentValue=k,E!==null)if(wr(E.value,k)){if(E.children===b.children&&!Ui.current){l=bs(a,l,d);break e}}else for(E=l.child,E!==null&&(E.return=l);E!==null;){var j=E.dependencies;if(j!==null){k=E.child;for(var te=j.firstContext;te!==null;){if(te.context===g){if(E.tag===1){te=xs(-1,d&-d),te.tag=2;var ge=E.updateQueue;if(ge!==null){ge=ge.shared;var Ce=ge.pending;Ce===null?te.next=te:(te.next=Ce.next,Ce.next=te),ge.pending=te}}E.lanes|=d,te=E.alternate,te!==null&&(te.lanes|=d),Sp(E.return,d,l),j.lanes|=d;break}te=te.next}}else if(E.tag===10)k=E.type===l.type?null:E.child;else if(E.tag===18){if(k=E.return,k===null)throw Error(n(341));k.lanes|=d,j=k.alternate,j!==null&&(j.lanes|=d),Sp(k,d,l),k=E.sibling}else k=E.child;if(k!==null)k.return=E;else for(k=E;k!==null;){if(k===l){k=null;break}if(E=k.sibling,E!==null){E.return=k.return,k=E;break}k=k.return}E=k}Ti(a,l,b.children,d),l=l.child}return l;case 9:return b=l.type,g=l.pendingProps.children,Xo(l,d),b=rr(b),g=g(b),l.flags|=1,Ti(a,l,g,d),l.child;case 14:return g=l.type,b=Mr(g,l.pendingProps),b=Mr(g.type,b),Ix(a,l,g,b,d);case 15:return Ux(a,l,l.type,l.pendingProps,d);case 17:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Mr(g,b),gd(a,l),l.tag=1,Fi(g)?(a=!0,Ju(l)):a=!1,Xo(l,d),Ax(l,g,b),Op(l,g,b,d),Hp(null,l,g,!0,a,d);case 19:return Wx(a,l,d);case 22:return Fx(a,l,d)}throw Error(n(156,l.tag))};function pb(a,l){return En(a,l)}function qP(a,l,d,g){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function or(a,l,d,g){return new qP(a,l,d,g)}function lm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function YP(a){if(typeof a=="function")return lm(a)?1:0;if(a!=null){if(a=a.$$typeof,a===W)return 11;if(a===q)return 14}return 2}function la(a,l){var d=a.alternate;return d===null?(d=or(a.tag,l,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=l,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&14680064,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,l=a.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d}function Ad(a,l,d,g,b,E){var k=2;if(g=a,typeof a=="function")lm(a)&&(k=1);else if(typeof a=="string")k=5;else e:switch(a){case U:return ja(d.children,b,E,l);case S:k=8,b|=8;break;case R:return a=or(12,d,l,b|2),a.elementType=R,a.lanes=E,a;case X:return a=or(13,d,l,b),a.elementType=X,a.lanes=E,a;case V:return a=or(19,d,l,b),a.elementType=V,a.lanes=E,a;case Q:return Cd(d,b,E,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case H:k=10;break e;case F:k=9;break e;case W:k=11;break e;case q:k=14;break e;case J:k=16,g=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return l=or(k,d,l,b),l.elementType=a,l.type=g,l.lanes=E,l}function ja(a,l,d,g){return a=or(7,a,g,l),a.lanes=d,a}function Cd(a,l,d,g){return a=or(22,a,g,l),a.elementType=Q,a.lanes=d,a.stateNode={isHidden:!1},a}function cm(a,l,d){return a=or(6,a,null,l),a.lanes=d,a}function um(a,l,d){return l=or(4,a.children!==null?a.children:[],a.key,l),l.lanes=d,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function KP(a,l,d,g,b){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ii(0),this.expirationTimes=Ii(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.identifierPrefix=g,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function dm(a,l,d,g,b,E,k,j,te){return a=new KP(a,l,d,j,te),l===1?(l=1,E===!0&&(l|=8)):l=0,E=or(3,null,null,l),a.current=E,E.stateNode=a,E.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ep(E),a}function ZP(a,l,d){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:g==null?null:""+g,children:a,containerInfo:l,implementation:d}}function mb(a){if(!a)return Qs;a=a._reactInternals;e:{if(Qe(a)!==a||a.tag!==1)throw Error(n(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Fi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(a.tag===1){var d=a.type;if(Fi(d))return G_(a,d,l)}return l}function gb(a,l,d,g,b,E,k,j,te){return a=dm(d,g,!0,a,b,E,k,j,te),a.context=mb(null),d=a.current,g=Ai(),b=aa(d),E=xs(g,b),E.callback=l??null,na(d,E,b),a.current.lanes=b,Wi(a,b,g),zi(a,g),a}function Rd(a,l,d,g){var b=l.current,E=Ai(),k=aa(b);return d=mb(d),l.context===null?l.context=d:l.pendingContext=d,l=xs(E,k),l.payload={element:a},g=g===void 0?null:g,g!==null&&(l.callback=g),a=na(b,l,k),a!==null&&(Cr(a,b,k,E),ad(a,b,k)),k}function Pd(a){return a=a.current,a.child?(a.child.tag===5,a.child.stateNode):null}function vb(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<l?d:l}}function fm(a,l){vb(a,l),(a=a.alternate)&&vb(a,l)}function JP(){return null}var yb=typeof reportError=="function"?reportError:function(a){console.error(a)};function hm(a){this._internalRoot=a}kd.prototype.render=hm.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(n(409));Rd(a,l,null,null)},kd.prototype.unmount=hm.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Ha(function(){Rd(null,a,null,null)}),l[ms]=null}};function kd(a){this._internalRoot=a}kd.prototype.unstable_scheduleHydration=function(a){if(a){var l=ec();a={blockedOn:null,target:a,priority:l};for(var d=0;d<qs.length&&l!==0&&l<qs[d].priority;d++);qs.splice(d,0,a),d===0&&r_(a)}};function pm(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Ld(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function _b(){}function QP(a,l,d,g,b){if(b){if(typeof g=="function"){var E=g;g=function(){var ge=Pd(k);E.call(ge)}}var k=gb(l,g,a,0,null,!1,!1,"",_b);return a._reactRootContainer=k,a[ms]=k.current,pc(a.nodeType===8?a.parentNode:a),Ha(),k}for(;b=a.lastChild;)a.removeChild(b);if(typeof g=="function"){var j=g;g=function(){var ge=Pd(te);j.call(ge)}}var te=dm(a,0,!1,null,null,!1,!1,"",_b);return a._reactRootContainer=te,a[ms]=te.current,pc(a.nodeType===8?a.parentNode:a),Ha(function(){Rd(l,te,d,g)}),te}function Dd(a,l,d,g,b){var E=d._reactRootContainer;if(E){var k=E;if(typeof b=="function"){var j=b;b=function(){var te=Pd(k);j.call(te)}}Rd(l,k,a,b)}else k=QP(d,l,a,b,g);return Pd(k)}Vn=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var d=tn(l.pendingLanes);d!==0&&(xn(l,d|1),zi(l,L()),(dn&6)===0&&(Jo=L()+500,ea()))}break;case 13:Ha(function(){var g=_s(a,1);if(g!==null){var b=Ai();Cr(g,a,1,b)}}),fm(a,1)}},tr=function(a){if(a.tag===13){var l=_s(a,134217728);if(l!==null){var d=Ai();Cr(l,a,134217728,d)}fm(a,134217728)}},ps=function(a){if(a.tag===13){var l=aa(a),d=_s(a,l);if(d!==null){var g=Ai();Cr(d,a,l,g)}fm(a,l)}},ec=function(){return Ft},n_=function(a,l){var d=Ft;try{return Ft=a,l()}finally{Ft=d}},Ve=function(a,l,d){switch(l){case"input":if(an(a,d),l=d.name,d.type==="radio"&&l!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var g=d[l];if(g!==a&&g.form===a.form){var b=Ku(g);if(!b)throw Error(n(90));pn(g),an(g,b)}}}break;case"textarea":P(a,d);break;case"select":l=d.value,l!=null&&kt(a,!!d.multiple,l,!1)}},Dt=sm,mn=Ha;var e2={usingClientEntryPoint:!1,Events:[vc,Bo,Ku,ye,st,sm]},kc={findFiberByHostInstance:Na,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t2={bundleType:kc.bundleType,version:kc.version,rendererPackageName:kc.rendererPackageName,rendererConfig:kc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=un(a),a===null?null:a.stateNode},findFiberByHostInstance:kc.findFiberByHostInstance||JP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nd.isDisabled&&Nd.supportsFiber)try{Ge=Nd.inject(t2),je=Nd}catch{}}return Vi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e2,Vi.createPortal=function(a,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pm(l))throw Error(n(200));return ZP(a,l,null,d)},Vi.createRoot=function(a,l){if(!pm(a))throw Error(n(299));var d=!1,g="",b=yb;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=dm(a,1,!1,null,null,d,!1,g,b),a[ms]=l.current,pc(a.nodeType===8?a.parentNode:a),new hm(l)},Vi.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=un(l),a=a===null?null:a.stateNode,a},Vi.flushSync=function(a){return Ha(a)},Vi.hydrate=function(a,l,d){if(!Ld(l))throw Error(n(200));return Dd(null,a,l,!0,d)},Vi.hydrateRoot=function(a,l,d){if(!pm(a))throw Error(n(405));var g=d!=null&&d.hydratedSources||null,b=!1,E="",k=yb;if(d!=null&&(d.unstable_strictMode===!0&&(b=!0),d.identifierPrefix!==void 0&&(E=d.identifierPrefix),d.onRecoverableError!==void 0&&(k=d.onRecoverableError)),l=gb(l,null,a,1,d??null,b,!1,E,k),a[ms]=l.current,pc(a),g)for(a=0;a<g.length;a++)d=g[a],b=d._getVersion,b=b(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,b]:l.mutableSourceEagerHydrationData.push(d,b);return new kd(l)},Vi.render=function(a,l,d){if(!Ld(l))throw Error(n(200));return Dd(null,a,l,!1,d)},Vi.unmountComponentAtNode=function(a){if(!Ld(a))throw Error(n(40));return a._reactRootContainer?(Ha(function(){Dd(null,null,a,!1,function(){a._reactRootContainer=null,a[ms]=null})}),!0):!1},Vi.unstable_batchedUpdates=sm,Vi.unstable_renderSubtreeIntoContainer=function(a,l,d,g){if(!Ld(d))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Dd(a,l,d,!1,g)},Vi.version="18.3.1-next-f1338f8080-20240426",Vi}var Ab;function L1(){if(Ab)return vm.exports;Ab=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),vm.exports=u2(),vm.exports}var Cb;function d2(){if(Cb)return Id;Cb=1;var t=L1();return Id.createRoot=t.createRoot,Id.hydrateRoot=t.hydrateRoot,Id}var f2=d2();var D1=t=>{throw TypeError(t)},h2=(t,e,n)=>e.has(t)||D1("Cannot "+n),xm=(t,e,n)=>(h2(t,e,"read from private field"),n?n.call(t):e.get(t)),p2=(t,e,n)=>e.has(t)?D1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Rb="popstate";function Pb(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function m2(t={}){function e(i,r){let s=r.state?.masked,{pathname:o,search:c,hash:u}=s||i.location;return lu("",{pathname:o,search:c,hash:u},r.state&&r.state.usr||null,r.state&&r.state.key||"default",s?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:rs(r)}return v2(e,n,null,t)}function Qt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Gn(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function g2(){return Math.random().toString(36).substring(2,10)}function kb(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function lu(t,e,n=null,i,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?zs(e):e,state:n,key:e&&e.key||i||g2(),unstable_mask:r}}function rs({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function zs(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function v2(t,e,n,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,o=r.history,c="POP",u=null,f=h();f==null&&(f=0,o.replaceState({...o.state,idx:f},""));function h(){return(o.state||{idx:null}).idx}function p(){c="POP";let y=h(),x=y==null?null:y-f;f=y,u&&u({action:c,location:w.location,delta:x})}function m(y,x){c="PUSH";let M=Pb(y)?y:lu(w.location,y,x);f=h()+1;let A=kb(M,f),T=w.createHref(M.unstable_mask||M);try{o.pushState(A,"",T)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;r.location.assign(T)}s&&u&&u({action:c,location:w.location,delta:1})}function v(y,x){c="REPLACE";let M=Pb(y)?y:lu(w.location,y,x);f=h();let A=kb(M,f),T=w.createHref(M.unstable_mask||M);o.replaceState(A,"",T),s&&u&&u({action:c,location:w.location,delta:0})}function _(y){return N1(y)}let w={get action(){return c},get location(){return t(r,o)},listen(y){if(u)throw new Error("A history only accepts one active listener");return r.addEventListener(Rb,p),u=y,()=>{r.removeEventListener(Rb,p),u=null}},createHref(y){return e(r,y)},createURL:_,encodeLocation(y){let x=_(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:v,go(y){return o.go(y)}};return w}function N1(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Qt(n,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:rs(t);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=n+i),new URL(i,n)}var Xc,Lb=class{constructor(t){if(p2(this,Xc,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(xm(this,Xc).has(t))return xm(this,Xc).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){xm(this,Xc).set(t,e)}};Xc=new WeakMap;var y2=new Set(["lazy","caseSensitive","path","id","index","children"]);function _2(t){return y2.has(t)}var x2=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function b2(t){return x2.has(t)}function S2(t){return t.index===!0}function cu(t,e,n=[],i={},r=!1){return t.map((s,o)=>{let c=[...n,String(o)],u=typeof s.id=="string"?s.id:c.join("-");if(Qt(s.index!==!0||!s.children,"Cannot specify children on an index route"),Qt(r||!i[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),S2(s)){let f={...s,id:u};return i[u]=Db(f,e(f)),f}else{let f={...s,id:u,children:void 0};return i[u]=Db(f,e(f)),s.children&&(f.children=cu(s.children,e,c,i,r)),f}})}function Db(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function xa(t,e,n="/"){return qc(t,e,n,!1)}function qc(t,e,n,i){let r=typeof e=="string"?zs(e):e,s=mr(r.pathname||"/",n);if(s==null)return null;let o=I1(t);E2(o);let c=null;for(let u=0;c==null&&u<o.length;++u){let f=I2(s);c=D2(o[u],f,i)}return c}function w2(t,e){let{route:n,pathname:i,params:r}=t;return{id:n.id,pathname:i,params:r,data:e[n.id],loaderData:e[n.id],handle:n.handle}}function I1(t,e=[],n=[],i="",r=!1){let s=(o,c,u=r,f)=>{let h={relativePath:f===void 0?o.path||"":f,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(i)&&u)return;Qt(h.relativePath.startsWith(i),`Absolute route path "${h.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(i.length)}let p=Or([i,h.relativePath]),m=n.concat(h);o.children&&o.children.length>0&&(Qt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),I1(o.children,e,m,p,u)),!(o.path==null&&!o.index)&&e.push({path:p,score:k2(p,o.index),routesMeta:m})};return t.forEach((o,c)=>{if(o.path===""||!o.path?.includes("?"))s(o,c);else for(let u of U1(o.path))s(o,c,!0,u)}),e}function U1(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let o=U1(i.join("/")),c=[];return c.push(...o.map(u=>u===""?s:[s,u].join("/"))),r&&c.push(...o),c.map(u=>t.startsWith("/")&&u===""?"/":u)}function E2(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:L2(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var M2=/^:[\w-]+$/,T2=3,A2=2,C2=1,R2=10,P2=-2,Nb=t=>t==="*";function k2(t,e){let n=t.split("/"),i=n.length;return n.some(Nb)&&(i+=P2),e&&(i+=A2),n.filter(r=>!Nb(r)).reduce((r,s)=>r+(M2.test(s)?T2:s===""?C2:R2),i)}function L2(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function D2(t,e,n=!1){let{routesMeta:i}=t,r={},s="/",o=[];for(let c=0;c<i.length;++c){let u=i[c],f=c===i.length-1,h=s==="/"?e:e.slice(s.length)||"/",p=Gf({path:u.relativePath,caseSensitive:u.caseSensitive,end:f},h),m=u.route;if(!p&&f&&n&&!i[i.length-1].route.index&&(p=Gf({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!p)return null;Object.assign(r,p.params),o.push({params:r,pathname:Or([s,p.pathname]),pathnameBase:O2(Or([s,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(s=Or([s,p.pathnameBase]))}return o}function Gf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=N2(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let s=r[0],o=s.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:i.reduce((f,{paramName:h,isOptional:p},m)=>{if(h==="*"){let _=c[m]||"";o=s.slice(0,s.length-_.length).replace(/(.)\/+$/,"$1")}const v=c[m];return p&&!v?f[h]=void 0:f[h]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:o,pattern:t}}function N2(t,e=!1,n=!0){Gn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,u,f,h)=>{if(i.push({paramName:c,isOptional:u!=null}),u){let p=h.charAt(f+o.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function I2(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Gn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function mr(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}function U2({basename:t,pathname:e}){return e==="/"?t:Or([t,e])}var F1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pv=t=>F1.test(t);function F2(t,e="/"){let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?zs(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=Ib(n.substring(1),"/"):s=Ib(n,e)):s=e,{pathname:s,search:B2(i),hash:z2(r)}}function Ib(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function bm(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function O1(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function kv(t){let e=O1(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function xh(t,e,n,i=!1){let r;typeof t=="string"?r=zs(t):(r={...t},Qt(!r.pathname||!r.pathname.includes("?"),bm("?","pathname","search",r)),Qt(!r.pathname||!r.pathname.includes("#"),bm("#","pathname","hash",r)),Qt(!r.search||!r.search.includes("#"),bm("#","search","hash",r)));let s=t===""||r.pathname==="",o=s?"/":r.pathname,c;if(o==null)c=n;else{let p=e.length-1;if(!i&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),p-=1;r.pathname=m.join("/")}c=p>=0?e[p]:"/"}let u=F2(r,c),f=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||h)&&(u.pathname+="/"),u}var Or=t=>t.join("/").replace(/\/\/+/g,"/"),O2=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),B2=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,z2=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,xu=class{constructor(t,e,n,i=!1){this.status=t,this.statusText=e||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function uu(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function bu(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var B1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function z1(t,e){let n=t;if(typeof n!="string"||!F1.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(B1)try{let s=new URL(window.location.href),o=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=mr(o.pathname,e);o.origin===s.origin&&c!=null?n=c+o.search+o.hash:r=!0}catch{Gn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}var wa=Symbol("Uninstrumented");function V2(t,e){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(r=>r({id:e.id,index:e.index,path:e.path,instrument(s){let o=Object.keys(n);for(let c of o)s[c]&&n[c].push(s[c])}}));let i={};if(typeof e.lazy=="function"&&n.lazy.length>0){let r=El(n.lazy,e.lazy,()=>{});r&&(i.lazy=r)}if(typeof e.lazy=="object"){let r=e.lazy;["middleware","loader","action"].forEach(s=>{let o=r[s],c=n[`lazy.${s}`];if(typeof o=="function"&&c.length>0){let u=El(c,o,()=>{});u&&(i.lazy=Object.assign(i.lazy||{},{[s]:u}))}})}return["loader","action"].forEach(r=>{let s=e[r];if(typeof s=="function"&&n[r].length>0){let o=s[wa]??s,c=El(n[r],o,(...u)=>Ub(u[0]));c&&(r==="loader"&&o.hydrate===!0&&(c.hydrate=!0),c[wa]=o,i[r]=c)}}),e.middleware&&e.middleware.length>0&&n.middleware.length>0&&(i.middleware=e.middleware.map(r=>{let s=r[wa]??r,o=El(n.middleware,s,(...c)=>Ub(c[0]));return o?(o[wa]=s,o):r})),i}function H2(t,e){let n={navigate:[],fetch:[]};if(e.forEach(i=>i({instrument(r){let s=Object.keys(r);for(let o of s)r[o]&&n[o].push(r[o])}})),n.navigate.length>0){let i=t.navigate[wa]??t.navigate,r=El(n.navigate,i,(...s)=>{let[o,c]=s;return{to:typeof o=="number"||typeof o=="string"?o:o?rs(o):".",...Fb(t,c??{})}});r&&(r[wa]=i,t.navigate=r)}if(n.fetch.length>0){let i=t.fetch[wa]??t.fetch,r=El(n.fetch,i,(...s)=>{let[o,,c,u]=s;return{href:c??".",fetcherKey:o,...Fb(t,u??{})}});r&&(r[wa]=i,t.fetch=r)}return t}function El(t,e,n){return t.length===0?null:async(...i)=>{let r=await V1(t,n(...i),()=>e(...i),t.length-1);if(r.type==="error")throw r.value;return r.value}}async function V1(t,e,n,i){let r=t[i],s;if(r){let o,c=async()=>(o?console.error("You cannot call instrumented handlers more than once"):o=V1(t,e,n,i-1),s=await o,Qt(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await r(c,e)}catch(u){console.error("An instrumentation function threw an error:",u)}o||await c(),await o}else try{s={type:"success",value:await n()}}catch(o){s={type:"error",value:o}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Ub(t){let{request:e,context:n,params:i,unstable_pattern:r}=t;return{request:G2(e),params:{...i},unstable_pattern:r,context:W2(n)}}function Fb(t,e){return{currentUrl:rs(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function G2(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function W2(t){if($2(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var j2=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $2(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===j2}var H1=["POST","PUT","PATCH","DELETE"],X2=new Set(H1),q2=["GET",...H1],Y2=new Set(q2),G1=new Set([301,302,303,307,308]),K2=new Set([307,308]),Sm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Z2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Dc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},J2=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),W1="remix-router-transitions",j1=Symbol("ResetLoaderData");function Q2(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";Qt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.hydrationRouteProperties||[],r=t.mapRouteProperties||J2,s=r;if(t.unstable_instrumentations){let K=t.unstable_instrumentations;s=oe=>({...r(oe),...V2(K.map(he=>he.route).filter(Boolean),oe)})}let o={},c=cu(t.routes,s,void 0,o),u,f=t.basename||"/";f.startsWith("/")||(f=`/${f}`);let h=t.dataStrategy||rk,p={...t.future},m=null,v=new Set,_=null,w=null,y=null,x=t.hydrationData!=null,M=xa(c,t.history.location,f),A=!1,T=null,D,I;if(M==null&&!t.patchRoutesOnNavigation){let K=cr(404,{pathname:t.history.location.pathname}),{matches:oe,route:he}=Ud(c);D=!0,I=!D,M=oe,T={[he.id]:K}}else if(M&&!t.hydrationData&&Kt(M,c,t.history.location.pathname).active&&(M=null),M)if(M.some(K=>K.route.lazy))D=!1,I=!D;else if(!M.some(K=>Lv(K.route)))D=!0,I=!D;else{let K=t.hydrationData?t.hydrationData.loaderData:null,oe=t.hydrationData?t.hydrationData.errors:null,he=M;if(oe){let Me=M.findIndex(Ie=>oe[Ie.route.id]!==void 0);he=he.slice(0,Me+1)}I=!1,D=he.every(Me=>{let Ie=$1(Me.route,K,oe);return I=I||Ie.renderFallback,!Ie.shouldLoad})}else{D=!1,I=!D,M=[];let K=Kt(null,c,t.history.location.pathname);K.active&&K.matches&&(A=!0,M=K.matches)}let U,S={historyAction:t.history.action,location:t.history.location,matches:M,initialized:D,renderFallback:I,navigation:Sm,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||T,fetchers:new Map,blockers:new Map},R="POP",H=null,F=!1,W,X=!1,V=new Map,q=null,J=!1,Q=!1,$=new Set,Y=new Map,Z=0,z=-1,ie=new Map,_e=new Set,Ee=new Map,Ue=new Map,le=new Set,be=new Map,Se,Ne=null;function et(){if(m=t.history.listen(({action:K,location:oe,delta:he})=>{if(Se){Se(),Se=void 0;return}Gn(be.size===0||he!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Me=Xe({currentLocation:S.location,nextLocation:oe,historyAction:K});if(Me&&he!=null){let Ie=new Promise(vt=>{Se=vt});t.history.go(he*-1),Le(Me,{state:"blocked",location:oe,proceed(){Le(Me,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),Ie.then(()=>t.history.go(he))},reset(){let vt=new Map(S.blockers);vt.set(Me,Dc),ht({blockers:vt})}}),H?.resolve(),H=null;return}return an(K,oe)}),n){Sk(e,V);let K=()=>wk(e,V);e.addEventListener("pagehide",K),q=()=>e.removeEventListener("pagehide",K)}return S.initialized||an("POP",S.location,{initialHydration:!0}),U}function xt(){m&&m(),q&&q(),v.clear(),W&&W.abort(),S.fetchers.forEach((K,oe)=>Re(oe)),S.blockers.forEach((K,oe)=>Ve(oe))}function pn(K){return v.add(K),()=>v.delete(K)}function ht(K,oe={}){K.matches&&(K.matches=K.matches.map(Ie=>{let vt=o[Ie.route.id],tt=Ie.route;return tt.element!==vt.element||tt.errorElement!==vt.errorElement||tt.hydrateFallbackElement!==vt.hydrateFallbackElement?{...Ie,route:vt}:Ie})),S={...S,...K};let he=[],Me=[];S.fetchers.forEach((Ie,vt)=>{Ie.state==="idle"&&(le.has(vt)?he.push(vt):Me.push(vt))}),le.forEach(Ie=>{!S.fetchers.has(Ie)&&!Y.has(Ie)&&he.push(Ie)}),[...v].forEach(Ie=>Ie(S,{deletedFetchers:he,newErrors:K.errors??null,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),he.forEach(Ie=>Re(Ie)),Me.forEach(Ie=>S.fetchers.delete(Ie))}function Ut(K,oe,{flushSync:he}={}){let Me=S.actionData!=null&&S.navigation.formMethod!=null&&bi(S.navigation.formMethod)&&S.navigation.state==="loading"&&K.state?._isRedirect!==!0,Ie;oe.actionData?Object.keys(oe.actionData).length>0?Ie=oe.actionData:Ie=null:Me?Ie=S.actionData:Ie=null;let vt=oe.loaderData?Xb(S.loaderData,oe.loaderData,oe.matches||[],oe.errors):S.loaderData,tt=S.blockers;tt.size>0&&(tt=new Map(tt),tt.forEach((Tt,bt)=>tt.set(bt,Dc)));let yt=J?!1:mn(K,oe.matches||S.matches),Qe=F===!0||S.navigation.formMethod!=null&&bi(S.navigation.formMethod)&&K.state?._isRedirect!==!0;u&&(c=u,u=void 0),J||R==="POP"||(R==="PUSH"?t.history.push(K,K.state):R==="REPLACE"&&t.history.replace(K,K.state));let Et;if(R==="POP"){let Tt=V.get(S.location.pathname);Tt&&Tt.has(K.pathname)?Et={currentLocation:S.location,nextLocation:K}:V.has(K.pathname)&&(Et={currentLocation:K,nextLocation:S.location})}else if(X){let Tt=V.get(S.location.pathname);Tt?Tt.add(K.pathname):(Tt=new Set([K.pathname]),V.set(S.location.pathname,Tt)),Et={currentLocation:S.location,nextLocation:K}}ht({...oe,actionData:Ie,loaderData:vt,historyAction:R,location:K,initialized:!0,renderFallback:!1,navigation:Sm,revalidation:"idle",restoreScrollPosition:yt,preventScrollReset:Qe,blockers:tt},{viewTransitionOpts:Et,flushSync:he===!0}),R="POP",F=!1,X=!1,J=!1,Q=!1,H?.resolve(),H=null,Ne?.resolve(),Ne=null}async function nn(K,oe){if(H?.resolve(),H=null,typeof K=="number"){H||(H=Zb());let En=H.promise;return t.history.go(K),En}let he=Bg(S.location,S.matches,f,K,oe?.fromRouteId,oe?.relative),{path:Me,submission:Ie,error:vt}=Ob(!1,he,oe),tt;oe?.unstable_mask&&(tt={pathname:"",search:"",hash:"",...typeof oe.unstable_mask=="string"?zs(oe.unstable_mask):{...S.location.unstable_mask,...oe.unstable_mask}});let yt=S.location,Qe=lu(yt,Me,oe&&oe.state,void 0,tt);Qe={...Qe,...t.history.encodeLocation(Qe)};let Et=oe&&oe.replace!=null?oe.replace:void 0,Tt="PUSH";Et===!0?Tt="REPLACE":Et===!1||Ie!=null&&bi(Ie.formMethod)&&Ie.formAction===S.location.pathname+S.location.search&&(Tt="REPLACE");let bt=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,un=(oe&&oe.flushSync)===!0,en=Xe({currentLocation:yt,nextLocation:Qe,historyAction:Tt});if(en){Le(en,{state:"blocked",location:Qe,proceed(){Le(en,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),nn(K,oe)},reset(){let En=new Map(S.blockers);En.set(en,Dc),ht({blockers:En})}});return}await an(Tt,Qe,{submission:Ie,pendingError:vt,preventScrollReset:bt,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:un,callSiteDefaultShouldRevalidate:oe&&oe.unstable_defaultShouldRevalidate})}function Lt(){Ne||(Ne=Zb()),ve(),ht({revalidation:"loading"});let K=Ne.promise;return S.navigation.state==="submitting"?K:S.navigation.state==="idle"?(an(S.historyAction,S.location,{startUninterruptedRevalidation:!0}),K):(an(R||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:X===!0}),K)}async function an(K,oe,he){W&&W.abort(),W=null,R=K,J=(he&&he.startUninterruptedRevalidation)===!0,Dt(S.location,S.matches),F=(he&&he.preventScrollReset)===!0,X=(he&&he.enableViewTransition)===!0;let Me=u||c,Ie=he&&he.overrideNavigation,vt=he?.initialHydration&&S.matches&&S.matches.length>0&&!A?S.matches:xa(Me,oe,f),tt=(he&&he.flushSync)===!0;if(vt&&S.initialized&&!Q&&fk(S.location,oe)&&!(he&&he.submission&&bi(he.submission.formMethod))){Ut(oe,{matches:vt},{flushSync:tt});return}let yt=Kt(vt,Me,oe.pathname);if(yt.active&&yt.matches&&(vt=yt.matches),!vt){let{error:Nn,notFoundMatches:Kn,route:gn}=Pe(oe.pathname);Ut(oe,{matches:Kn,loaderData:{},errors:{[gn.id]:Nn}},{flushSync:tt});return}W=new AbortController;let Qe=_l(t.history,oe,W.signal,he&&he.submission),Et=t.getContext?await t.getContext():new Lb,Tt;if(he&&he.pendingError)Tt=[ba(vt).route.id,{type:"error",error:he.pendingError}];else if(he&&he.submission&&bi(he.submission.formMethod)){let Nn=await ee(Qe,oe,he.submission,vt,Et,yt.active,he&&he.initialHydration===!0,{replace:he.replace,flushSync:tt});if(Nn.shortCircuited)return;if(Nn.pendingActionResult){let[Kn,gn]=Nn.pendingActionResult;if(Ji(gn)&&uu(gn.error)&&gn.error.status===404){W=null,Ut(oe,{matches:Nn.matches,loaderData:{},errors:{[Kn]:gn.error}});return}}vt=Nn.matches||vt,Tt=Nn.pendingActionResult,Ie=wm(oe,he.submission),tt=!1,yt.active=!1,Qe=_l(t.history,Qe.url,Qe.signal)}let{shortCircuited:bt,matches:un,loaderData:en,errors:En}=await Sn(Qe,oe,vt,Et,yt.active,Ie,he&&he.submission,he&&he.fetcherSubmission,he&&he.replace,he&&he.initialHydration===!0,tt,Tt,he&&he.callSiteDefaultShouldRevalidate);bt||(W=null,Ut(oe,{matches:un||vt,...qb(Tt),loaderData:en,errors:En}))}async function ee(K,oe,he,Me,Ie,vt,tt,yt={}){ve();let Qe=xk(oe,he);if(ht({navigation:Qe},{flushSync:yt.flushSync===!0}),vt){let bt=await ci(Me,oe.pathname,K.signal);if(bt.type==="aborted")return{shortCircuited:!0};if(bt.type==="error"){if(bt.partialMatches.length===0){let{matches:en,route:En}=Ud(c);return{matches:en,pendingActionResult:[En.id,{type:"error",error:bt.error}]}}let un=ba(bt.partialMatches).route.id;return{matches:bt.partialMatches,pendingActionResult:[un,{type:"error",error:bt.error}]}}else if(bt.matches)Me=bt.matches;else{let{notFoundMatches:un,error:en,route:En}=Pe(oe.pathname);return{matches:un,pendingActionResult:[En.id,{type:"error",error:en}]}}}let Et,Tt=_f(Me,oe);if(!Tt.route.action&&!Tt.route.lazy)Et={type:"error",error:cr(405,{method:K.method,pathname:oe.pathname,routeId:Tt.route.id})};else{let bt=Rl(s,o,K,Me,Tt,tt?[]:i,Ie),un=await xe(K,bt,Ie,null);if(Et=un[Tt.route.id],!Et){for(let en of Me)if(un[en.route.id]){Et=un[en.route.id];break}}if(K.signal.aborted)return{shortCircuited:!0}}if(ao(Et)){let bt;return yt&&yt.replace!=null?bt=yt.replace:bt=Wb(Et.response.headers.get("Location"),new URL(K.url),f,t.history)===S.location.pathname+S.location.search,await re(K,Et,!0,{submission:he,replace:bt}),{shortCircuited:!0}}if(Ji(Et)){let bt=ba(Me,Tt.route.id);return(yt&&yt.replace)!==!0&&(R="PUSH"),{matches:Me,pendingActionResult:[bt.route.id,Et,Tt.route.id]}}return{matches:Me,pendingActionResult:[Tt.route.id,Et]}}async function Sn(K,oe,he,Me,Ie,vt,tt,yt,Qe,Et,Tt,bt,un){let en=vt||wm(oe,tt),En=tt||yt||Kb(en),Nn=!J&&!Et;if(Ie){if(Nn){let Mt=At(bt);ht({navigation:en,...Mt!==void 0?{actionData:Mt}:{}},{flushSync:Tt})}let He=await ci(he,oe.pathname,K.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:lt,route:Zt}=Ud(c);return{matches:lt,loaderData:{},errors:{[Zt.id]:He.error}}}let Mt=ba(He.partialMatches).route.id;return{matches:He.partialMatches,loaderData:{},errors:{[Mt]:He.error}}}else if(He.matches)he=He.matches;else{let{error:Mt,notFoundMatches:lt,route:Zt}=Pe(oe.pathname);return{matches:lt,loaderData:{},errors:{[Zt.id]:Mt}}}}let Kn=u||c,{dsMatches:gn,revalidatingFetchers:L}=Bb(K,Me,s,o,t.history,S,he,En,oe,Et?[]:i,Et===!0,Q,$,le,Ee,_e,Kn,f,t.patchRoutesOnNavigation!=null,bt,un);if(z=++Z,!t.dataStrategy&&!gn.some(He=>He.shouldLoad)&&!gn.some(He=>He.route.middleware&&He.route.middleware.length>0)&&L.length===0){let He=$e();return Ut(oe,{matches:he,loaderData:{},errors:bt&&Ji(bt[1])?{[bt[0]]:bt[1].error}:null,...qb(bt),...He?{fetchers:new Map(S.fetchers)}:{}},{flushSync:Tt}),{shortCircuited:!0}}if(Nn){let He={};if(!Ie){He.navigation=en;let Mt=At(bt);Mt!==void 0&&(He.actionData=Mt)}L.length>0&&(He.fetchers=kt(L)),ht(He,{flushSync:Tt})}L.forEach(He=>{Ze(He.key),He.controller&&Y.set(He.key,He.controller)});let ae=()=>L.forEach(He=>Ze(He.key));W&&W.signal.addEventListener("abort",ae);let{loaderResults:pe,fetcherResults:de}=await we(gn,L,K,Me);if(K.signal.aborted)return{shortCircuited:!0};W&&W.signal.removeEventListener("abort",ae),L.forEach(He=>Y.delete(He.key));let ce=Fd(pe);if(ce)return await re(K,ce.result,!0,{replace:Qe}),{shortCircuited:!0};if(ce=Fd(de),ce)return _e.add(ce.key),await re(K,ce.result,!0,{replace:Qe}),{shortCircuited:!0};let{loaderData:We,errors:qe}=$b(S,he,pe,bt,L,de);Et&&S.errors&&(qe={...S.errors,...qe});let Ge=$e(),je=Vt(z),ct=Ge||je||L.length>0;return{matches:he,loaderData:We,errors:qe,...ct?{fetchers:new Map(S.fetchers)}:{}}}function At(K){if(K&&!Ji(K[1]))return{[K[0]]:K[1].data};if(S.actionData)return Object.keys(S.actionData).length===0?null:S.actionData}function kt(K){return K.forEach(oe=>{let he=S.fetchers.get(oe.key),Me=Nc(void 0,he?he.data:void 0);S.fetchers.set(oe.key,Me)}),new Map(S.fetchers)}async function it(K,oe,he,Me){Ze(K);let Ie=(Me&&Me.flushSync)===!0,vt=u||c,tt=Bg(S.location,S.matches,f,he,oe,Me?.relative),yt=xa(vt,tt,f),Qe=Kt(yt,vt,tt);if(Qe.active&&Qe.matches&&(yt=Qe.matches),!yt){ke(K,oe,cr(404,{pathname:tt}),{flushSync:Ie});return}let{path:Et,submission:Tt,error:bt}=Ob(!0,tt,Me);if(bt){ke(K,oe,bt,{flushSync:Ie});return}let un=t.getContext?await t.getContext():new Lb,en=(Me&&Me.preventScrollReset)===!0;if(Tt&&bi(Tt.formMethod)){await O(K,oe,Et,yt,un,Qe.active,Ie,en,Tt,Me&&Me.unstable_defaultShouldRevalidate);return}Ee.set(K,{routeId:oe,path:Et}),await P(K,oe,Et,yt,un,Qe.active,Ie,en,Tt)}async function O(K,oe,he,Me,Ie,vt,tt,yt,Qe,Et){ve(),Ee.delete(K);let Tt=S.fetchers.get(K);Ke(K,bk(Qe,Tt),{flushSync:tt});let bt=new AbortController,un=_l(t.history,he,bt.signal,Qe);if(vt){let Nt=await ci(Me,new URL(un.url).pathname,un.signal,K);if(Nt.type==="aborted")return;if(Nt.type==="error"){ke(K,oe,Nt.error,{flushSync:tt});return}else if(Nt.matches)Me=Nt.matches;else{ke(K,oe,cr(404,{pathname:he}),{flushSync:tt});return}}let en=_f(Me,he);if(!en.route.action&&!en.route.lazy){let Nt=cr(405,{method:Qe.formMethod,pathname:he,routeId:oe});ke(K,oe,Nt,{flushSync:tt});return}Y.set(K,bt);let En=Z,Nn=Rl(s,o,un,Me,en,i,Ie),Kn=await xe(un,Nn,Ie,K),gn=Kn[en.route.id];if(!gn){for(let Nt of Nn)if(Kn[Nt.route.id]){gn=Kn[Nt.route.id];break}}if(un.signal.aborted){Y.get(K)===bt&&Y.delete(K);return}if(le.has(K)){if(ao(gn)||Ji(gn)){Ke(K,Rs(void 0));return}}else{if(ao(gn))if(Y.delete(K),z>En){Ke(K,Rs(void 0));return}else return _e.add(K),Ke(K,Nc(Qe)),re(un,gn,!1,{fetcherSubmission:Qe,preventScrollReset:yt});if(Ji(gn)){ke(K,oe,gn.error);return}}let L=S.navigation.location||S.location,ae=_l(t.history,L,bt.signal),pe=u||c,de=S.navigation.state!=="idle"?xa(pe,S.navigation.location,f):S.matches;Qt(de,"Didn't find any matches after fetcher action");let ce=++Z;ie.set(K,ce);let We=Nc(Qe,gn.data);S.fetchers.set(K,We);let{dsMatches:qe,revalidatingFetchers:Ge}=Bb(ae,Ie,s,o,t.history,S,de,Qe,L,i,!1,Q,$,le,Ee,_e,pe,f,t.patchRoutesOnNavigation!=null,[en.route.id,gn],Et);Ge.filter(Nt=>Nt.key!==K).forEach(Nt=>{let vn=Nt.key,tn=S.fetchers.get(vn),In=Nc(void 0,tn?tn.data:void 0);S.fetchers.set(vn,In),Ze(vn),Nt.controller&&Y.set(vn,Nt.controller)}),ht({fetchers:new Map(S.fetchers)});let je=()=>Ge.forEach(Nt=>Ze(Nt.key));bt.signal.addEventListener("abort",je);let{loaderResults:ct,fetcherResults:He}=await we(qe,Ge,ae,Ie);if(bt.signal.aborted)return;if(bt.signal.removeEventListener("abort",je),ie.delete(K),Y.delete(K),Ge.forEach(Nt=>Y.delete(Nt.key)),S.fetchers.has(K)){let Nt=Rs(gn.data);S.fetchers.set(K,Nt)}let Mt=Fd(ct);if(Mt)return re(ae,Mt.result,!1,{preventScrollReset:yt});if(Mt=Fd(He),Mt)return _e.add(Mt.key),re(ae,Mt.result,!1,{preventScrollReset:yt});let{loaderData:lt,errors:Zt}=$b(S,de,ct,void 0,Ge,He);Vt(ce),S.navigation.state==="loading"&&ce>z?(Qt(R,"Expected pending action"),W&&W.abort(),Ut(S.navigation.location,{matches:de,loaderData:lt,errors:Zt,fetchers:new Map(S.fetchers)})):(ht({errors:Zt,loaderData:Xb(S.loaderData,lt,de,Zt),fetchers:new Map(S.fetchers)}),Q=!1)}async function P(K,oe,he,Me,Ie,vt,tt,yt,Qe){let Et=S.fetchers.get(K);Ke(K,Nc(Qe,Et?Et.data:void 0),{flushSync:tt});let Tt=new AbortController,bt=_l(t.history,he,Tt.signal);if(vt){let gn=await ci(Me,new URL(bt.url).pathname,bt.signal,K);if(gn.type==="aborted")return;if(gn.type==="error"){ke(K,oe,gn.error,{flushSync:tt});return}else if(gn.matches)Me=gn.matches;else{ke(K,oe,cr(404,{pathname:he}),{flushSync:tt});return}}let un=_f(Me,he);Y.set(K,Tt);let en=Z,En=Rl(s,o,bt,Me,un,i,Ie),Kn=(await xe(bt,En,Ie,K))[un.route.id];if(Y.get(K)===Tt&&Y.delete(K),!bt.signal.aborted){if(le.has(K)){Ke(K,Rs(void 0));return}if(ao(Kn))if(z>en){Ke(K,Rs(void 0));return}else{_e.add(K),await re(bt,Kn,!1,{preventScrollReset:yt});return}if(Ji(Kn)){ke(K,oe,Kn.error);return}Ke(K,Rs(Kn.data))}}async function re(K,oe,he,{submission:Me,fetcherSubmission:Ie,preventScrollReset:vt,replace:tt}={}){he||(H?.resolve(),H=null),oe.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let yt=oe.response.headers.get("Location");Qt(yt,"Expected a Location header on the redirect Response"),yt=Wb(yt,new URL(K.url),f,t.history);let Qe=lu(S.location,yt,{_isRedirect:!0});if(n){let En=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))En=!0;else if(Pv(yt)){const Nn=N1(yt,!0);En=Nn.origin!==e.location.origin||mr(Nn.pathname,f)==null}if(En){tt?e.location.replace(yt):e.location.assign(yt);return}}W=null;let Et=tt===!0||oe.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Tt,formAction:bt,formEncType:un}=S.navigation;!Me&&!Ie&&Tt&&bt&&un&&(Me=Kb(S.navigation));let en=Me||Ie;if(K2.has(oe.response.status)&&en&&bi(en.formMethod))await an(Et,Qe,{submission:{...en,formAction:yt},preventScrollReset:vt||F,enableViewTransition:he?X:void 0});else{let En=wm(Qe,Me);await an(Et,Qe,{overrideNavigation:En,fetcherSubmission:Ie,preventScrollReset:vt||F,enableViewTransition:he?X:void 0})}}async function xe(K,oe,he,Me){let Ie,vt={};try{Ie=await ak(h,K,oe,Me,he,!1)}catch(tt){return oe.filter(yt=>yt.shouldLoad).forEach(yt=>{vt[yt.route.id]={type:"error",error:tt}}),vt}if(K.signal.aborted)return vt;if(!bi(K.method))for(let tt of oe){if(Ie[tt.route.id]?.type==="error")break;!Ie.hasOwnProperty(tt.route.id)&&!S.loaderData.hasOwnProperty(tt.route.id)&&(!S.errors||!S.errors.hasOwnProperty(tt.route.id))&&tt.shouldCallHandler()&&(Ie[tt.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${tt.route.id}`)})}for(let[tt,yt]of Object.entries(Ie))if(gk(yt)){let Qe=yt.result;vt[tt]={type:"redirect",response:uk(Qe,K,tt,oe,f)}}else vt[tt]=await ck(yt);return vt}async function we(K,oe,he,Me){let Ie=xe(he,K,Me,null),vt=Promise.all(oe.map(async Qe=>{if(Qe.matches&&Qe.match&&Qe.request&&Qe.controller){let Tt=(await xe(Qe.request,Qe.matches,Me,Qe.key))[Qe.match.route.id];return{[Qe.key]:Tt}}else return Promise.resolve({[Qe.key]:{type:"error",error:cr(404,{pathname:Qe.path})}})})),tt=await Ie,yt=(await vt).reduce((Qe,Et)=>Object.assign(Qe,Et),{});return{loaderResults:tt,fetcherResults:yt}}function ve(){Q=!0,Ee.forEach((K,oe)=>{Y.has(oe)&&$.add(oe),Ze(oe)})}function Ke(K,oe,he={}){S.fetchers.set(K,oe),ht({fetchers:new Map(S.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function ke(K,oe,he,Me={}){let Ie=ba(S.matches,oe);Re(K),ht({errors:{[Ie.route.id]:he},fetchers:new Map(S.fetchers)},{flushSync:(Me&&Me.flushSync)===!0})}function pt(K){return Ue.set(K,(Ue.get(K)||0)+1),le.has(K)&&le.delete(K),S.fetchers.get(K)||Z2}function Ct(K,oe){Ze(K,oe?.reason),Ke(K,Rs(null))}function Re(K){let oe=S.fetchers.get(K);Y.has(K)&&!(oe&&oe.state==="loading"&&ie.has(K))&&Ze(K),Ee.delete(K),ie.delete(K),_e.delete(K),le.delete(K),$.delete(K),S.fetchers.delete(K)}function Be(K){let oe=(Ue.get(K)||0)-1;oe<=0?(Ue.delete(K),le.add(K)):Ue.set(K,oe),ht({fetchers:new Map(S.fetchers)})}function Ze(K,oe){let he=Y.get(K);he&&(he.abort(oe),Y.delete(K))}function rt(K){for(let oe of K){let he=pt(oe),Me=Rs(he.data);S.fetchers.set(oe,Me)}}function $e(){let K=[],oe=!1;for(let he of _e){let Me=S.fetchers.get(he);Qt(Me,`Expected fetcher: ${he}`),Me.state==="loading"&&(_e.delete(he),K.push(he),oe=!0)}return rt(K),oe}function Vt(K){let oe=[];for(let[he,Me]of ie)if(Me<K){let Ie=S.fetchers.get(he);Qt(Ie,`Expected fetcher: ${he}`),Ie.state==="loading"&&(Ze(he),ie.delete(he),oe.push(he))}return rt(oe),oe.length>0}function ne(K,oe){let he=S.blockers.get(K)||Dc;return be.get(K)!==oe&&be.set(K,oe),he}function Ve(K){S.blockers.delete(K),be.delete(K)}function Le(K,oe){let he=S.blockers.get(K)||Dc;Qt(he.state==="unblocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="proceeding"||he.state==="blocked"&&oe.state==="unblocked"||he.state==="proceeding"&&oe.state==="unblocked",`Invalid blocker state transition: ${he.state} -> ${oe.state}`);let Me=new Map(S.blockers);Me.set(K,oe),ht({blockers:Me})}function Xe({currentLocation:K,nextLocation:oe,historyAction:he}){if(be.size===0)return;be.size>1&&Gn(!1,"A router only supports one blocker at a time");let Me=Array.from(be.entries()),[Ie,vt]=Me[Me.length-1],tt=S.blockers.get(Ie);if(!(tt&&tt.state==="proceeding")&&vt({currentLocation:K,nextLocation:oe,historyAction:he}))return Ie}function Pe(K){let oe=cr(404,{pathname:K}),he=u||c,{matches:Me,route:Ie}=Ud(he);return{notFoundMatches:Me,route:Ie,error:oe}}function ye(K,oe,he){if(_=K,y=oe,w=he||null,!x&&S.navigation===Sm){x=!0;let Me=mn(S.location,S.matches);Me!=null&&ht({restoreScrollPosition:Me})}return()=>{_=null,y=null,w=null}}function st(K,oe){return w&&w(K,oe.map(Me=>w2(Me,S.loaderData)))||K.key}function Dt(K,oe){if(_&&y){let he=st(K,oe);_[he]=y()}}function mn(K,oe){if(_){let he=st(K,oe),Me=_[he];if(typeof Me=="number")return Me}return null}function Kt(K,oe,he){if(t.patchRoutesOnNavigation)if(K){if(Object.keys(K[0].params).length>0)return{active:!0,matches:qc(oe,he,f,!0)}}else return{active:!0,matches:qc(oe,he,f,!0)||[]};return{active:!1,matches:null}}async function ci(K,oe,he,Me){if(!t.patchRoutesOnNavigation)return{type:"success",matches:K};let Ie=K;for(;;){let vt=u==null,tt=u||c,yt=o;try{await t.patchRoutesOnNavigation({signal:he,path:oe,matches:Ie,fetcherKey:Me,patch:(Tt,bt)=>{he.aborted||zb(Tt,bt,tt,yt,s,!1)}})}catch(Tt){return{type:"error",error:Tt,partialMatches:Ie}}finally{vt&&!he.aborted&&(c=[...c])}if(he.aborted)return{type:"aborted"};let Qe=xa(tt,oe,f),Et=null;if(Qe){if(Object.keys(Qe[0].params).length===0)return{type:"success",matches:Qe};if(Et=qc(tt,oe,f,!0),!(Et&&Ie.length<Et.length&&ii(Ie,Et.slice(0,Ie.length))))return{type:"success",matches:Qe}}if(Et||(Et=qc(tt,oe,f,!0)),!Et||ii(Ie,Et))return{type:"success",matches:null};Ie=Et}}function ii(K,oe){return K.length===oe.length&&K.every((he,Me)=>he.route.id===oe[Me].route.id)}function Gs(K){o={},u=cu(K,s,void 0,o)}function br(K,oe,he=!1){let Me=u==null;zb(K,oe,u||c,o,s,he),Me&&(c=[...c],ht({}))}return U={get basename(){return f},get future(){return p},get state(){return S},get routes(){return c},get window(){return e},initialize:et,subscribe:pn,enableScrollRestoration:ye,navigate:nn,fetch:it,revalidate:Lt,createHref:K=>t.history.createHref(K),encodeLocation:K=>t.history.encodeLocation(K),getFetcher:pt,resetFetcher:Ct,deleteFetcher:Be,dispose:xt,getBlocker:ne,deleteBlocker:Ve,patchRoutes:br,_internalFetchControllers:Y,_internalSetRoutes:Gs,_internalSetStateDoNotUseOrYouWillBreakYourApp(K){ht(K)}},t.unstable_instrumentations&&(U=H2(U,t.unstable_instrumentations.map(K=>K.router).filter(Boolean))),U}function ek(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Bg(t,e,n,i,r,s){let o,c;if(r){o=[];for(let f of e)if(o.push(f),f.route.id===r){c=f;break}}else o=e,c=e[e.length-1];let u=xh(i||".",kv(o),mr(t.pathname,n)||t.pathname,s==="path");if(i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&c){let f=Nv(u.search);if(c.route.index&&!f)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&f){let h=new URLSearchParams(u.search),p=h.getAll("index");h.delete("index"),p.filter(v=>v).forEach(v=>h.append("index",v));let m=h.toString();u.search=m?`?${m}`:""}}return n!=="/"&&(u.pathname=U2({basename:n,pathname:u.pathname})),rs(u)}function Ob(t,e,n){if(!n||!ek(n))return{path:e};if(n.formMethod&&!_k(n.formMethod))return{path:e,error:cr(405,{method:n.formMethod})};let i=()=>({path:e,error:cr(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),o=J1(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!bi(s))return i();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,[v,_])=>`${m}${v}=${_}
|
|
10
|
+
`,""):String(n.body);return{path:e,submission:{formMethod:s,formAction:o,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!bi(s))return i();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:s,formAction:o,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}Qt(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=Vg(n.formData),u=n.formData;else if(n.body instanceof FormData)c=Vg(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=jb(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=jb(c)}catch{return i()}let f={formMethod:s,formAction:o,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(bi(f.formMethod))return{path:e,submission:f};let h=zs(e);return t&&h.search&&Nv(h.search)&&c.append("index",""),h.search=`?${c}`,{path:rs(h),submission:f}}function Bb(t,e,n,i,r,s,o,c,u,f,h,p,m,v,_,w,y,x,M,A,T){let D=A?Ji(A[1])?A[1].error:A[1].data:void 0,I=r.createURL(s.location),U=r.createURL(u),S;if(h&&s.errors){let q=Object.keys(s.errors)[0];S=o.findIndex(J=>J.route.id===q)}else if(A&&Ji(A[1])){let q=A[0];S=o.findIndex(J=>J.route.id===q)-1}let R=A?A[1].statusCode:void 0,H=R&&R>=400,F={currentUrl:I,currentParams:s.matches[0]?.params||{},nextUrl:U,nextParams:o[0].params,...c,actionResult:D,actionStatus:R},W=bu(o),X=o.map((q,J)=>{let{route:Q}=q,$=null;if(S!=null&&J>S)$=!1;else if(Q.lazy)$=!0;else if(!Lv(Q))$=!1;else if(h){let{shouldLoad:ie}=$1(Q,s.loaderData,s.errors);$=ie}else tk(s.loaderData,s.matches[J],q)&&($=!0);if($!==null)return zg(n,i,t,W,q,f,e,$);let Y=!1;typeof T=="boolean"?Y=T:H?Y=!1:(p||I.pathname+I.search===U.pathname+U.search||I.search!==U.search||nk(s.matches[J],q))&&(Y=!0);let Z={...F,defaultShouldRevalidate:Y},z=eu(q,Z);return zg(n,i,t,W,q,f,e,z,Z,T)}),V=[];return _.forEach((q,J)=>{if(h||!o.some(Ee=>Ee.route.id===q.routeId)||v.has(J))return;let Q=s.fetchers.get(J),$=Q&&Q.state!=="idle"&&Q.data===void 0,Y=xa(y,q.path,x);if(!Y){if(M&&$)return;V.push({key:J,routeId:q.routeId,path:q.path,matches:null,match:null,request:null,controller:null});return}if(w.has(J))return;let Z=_f(Y,q.path),z=new AbortController,ie=_l(r,q.path,z.signal),_e=null;if(m.has(J))m.delete(J),_e=Rl(n,i,ie,Y,Z,f,e);else if($)p&&(_e=Rl(n,i,ie,Y,Z,f,e));else{let Ee;typeof T=="boolean"?Ee=T:H?Ee=!1:Ee=p;let Ue={...F,defaultShouldRevalidate:Ee};eu(Z,Ue)&&(_e=Rl(n,i,ie,Y,Z,f,e,Ue))}_e&&V.push({key:J,routeId:q.routeId,path:q.path,matches:_e,match:Z,request:ie,controller:z})}),{dsMatches:X,revalidatingFetchers:V}}function Lv(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function $1(t,e,n){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Lv(t))return{shouldLoad:!1,renderFallback:!1};let i=e!=null&&t.id in e,r=n!=null&&n[t.id]!==void 0;if(!i&&r)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let s=!i&&!r;return{shouldLoad:s,renderFallback:s}}function tk(t,e,n){let i=!e||n.route.id!==e.route.id,r=!t.hasOwnProperty(n.route.id);return i||r}function nk(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function eu(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function zb(t,e,n,i,r,s){let o;if(t){let f=i[t];Qt(f,`No route found to patch children into: routeId = ${t}`),f.children||(f.children=[]),o=f.children}else o=n;let c=[],u=[];if(e.forEach(f=>{let h=o.find(p=>X1(f,p));h?u.push({existingRoute:h,newRoute:f}):c.push(f)}),c.length>0){let f=cu(c,r,[t||"_","patch",String(o?.length||"0")],i);o.push(...f)}if(s&&u.length>0)for(let f=0;f<u.length;f++){let{existingRoute:h,newRoute:p}=u[f],m=h,[v]=cu([p],r,[],{},!0);Object.assign(m,{element:v.element?v.element:m.element,errorElement:v.errorElement?v.errorElement:m.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:m.hydrateFallbackElement})}}function X1(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children?.every((n,i)=>e.children?.some(r=>X1(n,r)))??!1:!1}var Vb=new WeakMap,q1=({key:t,route:e,manifest:n,mapRouteProperties:i})=>{let r=n[e.id];if(Qt(r,"No route found in manifest"),!r.lazy||typeof r.lazy!="object")return;let s=r.lazy[t];if(!s)return;let o=Vb.get(r);o||(o={},Vb.set(r,o));let c=o[t];if(c)return c;let u=(async()=>{let f=_2(t),p=r[t]!==void 0&&t!=="hasErrorBoundary";if(f)Gn(!f,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),o[t]=Promise.resolve();else if(p)Gn(!1,`Route "${r.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let m=await s();m!=null&&(Object.assign(r,{[t]:m}),Object.assign(r,i(r)))}typeof r.lazy=="object"&&(r.lazy[t]=void 0,Object.values(r.lazy).every(m=>m===void 0)&&(r.lazy=void 0))})();return o[t]=u,u},Hb=new WeakMap;function ik(t,e,n,i,r){let s=n[t.id];if(Qt(s,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let h=Hb.get(s);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let p=(async()=>{Qt(typeof t.lazy=="function","No lazy route function found");let m=await t.lazy(),v={};for(let _ in m){let w=m[_];if(w===void 0)continue;let y=b2(_),M=s[_]!==void 0&&_!=="hasErrorBoundary";y?Gn(!y,"Route property "+_+" is not a supported property to be returned from a lazy route function. This property will be ignored."):M?Gn(!M,`Route "${s.id}" has a static property "${_}" defined but its lazy function is also returning a value for this property. The lazy route property "${_}" will be ignored.`):v[_]=w}Object.assign(s,v),Object.assign(s,{...i(s),lazy:void 0})})();return Hb.set(s,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let o=Object.keys(t.lazy),c=[],u;for(let h of o){if(r&&r.includes(h))continue;let p=q1({key:h,route:t,manifest:n,mapRouteProperties:i});p&&(c.push(p),h===e&&(u=p))}let f=c.length>0?Promise.all(c).then(()=>{}):void 0;return f?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:u}}async function Gb(t){let e=t.matches.filter(r=>r.shouldLoad),n={};return(await Promise.all(e.map(r=>r.resolve()))).forEach((r,s)=>{n[e[s].route.id]=r}),n}async function rk(t){return t.matches.some(e=>e.route.middleware)?Y1(t,()=>Gb(t)):Gb(t)}function Y1(t,e){return sk(t,e,i=>{if(yk(i))throw i;return i},pk,n);function n(i,r,s){if(s)return Promise.resolve(Object.assign(s.value,{[r]:{type:"error",result:i}}));{let{matches:o}=t,c=Math.min(Math.max(o.findIndex(f=>f.route.id===r),0),Math.max(o.findIndex(f=>f.shouldCallHandler()),0)),u=ba(o,o[c].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:i}})}}}async function sk(t,e,n,i,r){let{matches:s,request:o,params:c,context:u,unstable_pattern:f}=t,h=s.flatMap(m=>m.route.middleware?m.route.middleware.map(v=>[m.route.id,v]):[]);return await K1({request:o,params:c,context:u,unstable_pattern:f},h,e,n,i,r)}async function K1(t,e,n,i,r,s,o=0){let{request:c}=t;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let u=e[o];if(!u)return await n();let[f,h]=u,p,m=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await K1(t,e,n,i,r,s,o+1)},p.value}catch(v){return p={value:await s(v,f,p)},p.value}};try{let v=await h(t,m),_=v!=null?i(v):void 0;return r(_)?_:p?_??p.value:(p={value:await m()},p.value)}catch(v){return await s(v,f,p)}}function Z1(t,e,n,i,r){let s=q1({key:"middleware",route:i.route,manifest:e,mapRouteProperties:t}),o=ik(i.route,bi(n.method)?"action":"loader",e,t,r);return{middleware:s,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function zg(t,e,n,i,r,s,o,c,u=null,f){let h=!1,p=Z1(t,e,n,r,s);return{...r,_lazyPromises:p,shouldLoad:c,shouldRevalidateArgs:u,shouldCallHandler(m){return h=!0,u?typeof f=="boolean"?eu(r,{...u,defaultShouldRevalidate:f}):typeof m=="boolean"?eu(r,{...u,defaultShouldRevalidate:m}):eu(r,u):c},resolve(m){let{lazy:v,loader:_,middleware:w}=r.route,y=h||c||m&&!bi(n.method)&&(v||_),x=w&&w.length>0&&!_&&!v;return y&&(bi(n.method)||!x)?ok({request:n,unstable_pattern:i,match:r,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:m,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function Rl(t,e,n,i,r,s,o,c=null){return i.map(u=>u.route.id!==r.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Z1(t,e,n,u,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:zg(t,e,n,bu(i),u,s,o,!0,c))}async function ak(t,e,n,i,r,s){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let o={request:e,unstable_pattern:bu(n),params:n[0].params,context:r,matches:n},u=await t({...o,fetcherKey:i,runClientMiddleware:f=>{let h=o;return Y1(h,()=>f({...h,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return u}async function ok({request:t,unstable_pattern:e,match:n,lazyHandlerPromise:i,lazyRoutePromise:r,handlerOverride:s,scopedContext:o}){let c,u,f=bi(t.method),h=f?"action":"loader",p=m=>{let v,_=new Promise((x,M)=>v=M);u=()=>v(),t.signal.addEventListener("abort",u);let w=x=>typeof m!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${n.route.id}]`)):m({request:t,unstable_pattern:e,params:n.params,context:o},...x!==void 0?[x]:[]),y=(async()=>{try{return{type:"data",result:await(s?s(M=>w(M)):w())}}catch(x){return{type:"error",result:x}}})();return Promise.race([y,_])};try{let m=f?n.route.action:n.route.loader;if(i||r)if(m){let v,[_]=await Promise.all([p(m).catch(w=>{v=w}),i,r]);if(v!==void 0)throw v;c=_}else{await i;let v=f?n.route.action:n.route.loader;if(v)[c]=await Promise.all([p(v),r]);else if(h==="action"){let _=new URL(t.url),w=_.pathname+_.search;throw cr(405,{method:t.method,pathname:w,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(m)c=await p(m);else{let v=new URL(t.url),_=v.pathname+v.search;throw cr(404,{pathname:_})}}catch(m){return{type:"error",result:m}}finally{u&&t.signal.removeEventListener("abort",u)}return c}async function lk(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function ck(t){let{result:e,type:n}=t;if(Dv(e)){let i;try{i=await lk(e)}catch(r){return{type:"error",error:r}}return n==="error"?{type:"error",error:new xu(e.status,e.statusText,i),statusCode:e.status,headers:e.headers}:{type:"data",data:i,statusCode:e.status,headers:e.headers}}return n==="error"?Yb(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:hk(e),statusCode:uu(e)?e.status:void 0,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:uu(e)?e.status:void 0}:Yb(e)?{type:"data",data:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function uk(t,e,n,i,r){let s=t.headers.get("Location");if(Qt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Pv(s)){let o=i.slice(0,i.findIndex(c=>c.route.id===n)+1);s=Bg(new URL(e.url),o,r,s),t.headers.set("Location",s)}return t}function Wb(t,e,n,i){let r=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Pv(t)){let s=t,o=s.startsWith("//")?new URL(e.protocol+s):new URL(s);if(r.includes(o.protocol))throw new Error("Invalid redirect location");let c=mr(o.pathname,n)!=null;if(o.origin===e.origin&&c)return o.pathname+o.search+o.hash}try{let s=i.createURL(t);if(r.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return t}function _l(t,e,n,i){let r=t.createURL(J1(e)).toString(),s={signal:n};if(i&&bi(i.formMethod)){let{formMethod:o,formEncType:c}=i;s.method=o.toUpperCase(),c==="application/json"?(s.headers=new Headers({"Content-Type":c}),s.body=JSON.stringify(i.json)):c==="text/plain"?s.body=i.text:c==="application/x-www-form-urlencoded"&&i.formData?s.body=Vg(i.formData):s.body=i.formData}return new Request(r,s)}function Vg(t){let e=new URLSearchParams;for(let[n,i]of t.entries())e.append(n,typeof i=="string"?i:i.name);return e}function jb(t){let e=new FormData;for(let[n,i]of t.entries())e.append(n,i);return e}function dk(t,e,n,i=!1,r=!1){let s={},o=null,c,u=!1,f={},h=n&&Ji(n[1])?n[1].error:void 0;return t.forEach(p=>{if(!(p.route.id in e))return;let m=p.route.id,v=e[m];if(Qt(!ao(v),"Cannot handle redirect results in processLoaderData"),Ji(v)){let _=v.error;if(h!==void 0&&(_=h,h=void 0),o=o||{},r)o[m]=_;else{let w=ba(t,m);o[w.route.id]==null&&(o[w.route.id]=_)}i||(s[m]=j1),u||(u=!0,c=uu(v.error)?v.error.status:500),v.headers&&(f[m]=v.headers)}else s[m]=v.data,v.statusCode&&v.statusCode!==200&&!u&&(c=v.statusCode),v.headers&&(f[m]=v.headers)}),h!==void 0&&n&&(o={[n[0]]:h},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:o,statusCode:c||200,loaderHeaders:f}}function $b(t,e,n,i,r,s){let{loaderData:o,errors:c}=dk(e,n,i);return r.filter(u=>!u.matches||u.matches.some(f=>f.shouldLoad)).forEach(u=>{let{key:f,match:h,controller:p}=u;if(p&&p.signal.aborted)return;let m=s[f];if(Qt(m,"Did not find corresponding fetcher result"),Ji(m)){let v=ba(t.matches,h?.route.id);c&&c[v.route.id]||(c={...c,[v.route.id]:m.error}),t.fetchers.delete(f)}else if(ao(m))Qt(!1,"Unhandled fetcher revalidation redirect");else{let v=Rs(m.data);t.fetchers.set(f,v)}}),{loaderData:o,errors:c}}function Xb(t,e,n,i){let r=Object.entries(e).filter(([,s])=>s!==j1).reduce((s,[o,c])=>(s[o]=c,s),{});for(let s of n){let o=s.route.id;if(!e.hasOwnProperty(o)&&t.hasOwnProperty(o)&&s.route.loader&&(r[o]=t[o]),i&&i.hasOwnProperty(o))break}return r}function qb(t){return t?Ji(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function ba(t,e){return(e?t.slice(0,t.findIndex(i=>i.route.id===e)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function Ud(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function cr(t,{pathname:e,routeId:n,method:i,type:r,message:s}={}){let o="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(o="Bad Request",i&&e&&n?c=`You made a ${i} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:r==="invalid-body"&&(c="Unable to encode submission body")):t===403?(o="Forbidden",c=`Route "${n}" does not match URL "${e}"`):t===404?(o="Not Found",c=`No route matches URL "${e}"`):t===405&&(o="Method Not Allowed",i&&e&&n?c=`You made a ${i.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:i&&(c=`Invalid request method "${i.toUpperCase()}"`)),new xu(t||500,o,new Error(c),!0)}function Fd(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[i,r]=e[n];if(ao(r))return{key:i,result:r}}}function J1(t){let e=typeof t=="string"?zs(t):t;return rs({...e,hash:""})}function fk(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function hk(t){return new xu(t.init?.status??500,t.init?.statusText??"Internal Server Error",t.data)}function pk(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&mk(n))}function mk(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function gk(t){return Dv(t.result)&&G1.has(t.result.status)}function Ji(t){return t.type==="error"}function ao(t){return(t&&t.type)==="redirect"}function Yb(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Dv(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function vk(t){return G1.has(t)}function yk(t){return Dv(t)&&vk(t.status)&&t.headers.has("Location")}function _k(t){return Y2.has(t.toUpperCase())}function bi(t){return X2.has(t.toUpperCase())}function Nv(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function _f(t,e){let n=typeof e=="string"?zs(e).search:e.search;if(t[t.length-1].route.index&&Nv(n||""))return t[t.length-1];let i=O1(t);return i[i.length-1]}function Kb(t){let{formMethod:e,formAction:n,formEncType:i,text:r,formData:s,json:o}=t;if(!(!e||!n||!i)){if(r!=null)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:void 0,text:r};if(s!=null)return{formMethod:e,formAction:n,formEncType:i,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:o,text:void 0}}}function wm(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function xk(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Nc(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function bk(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Rs(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Sk(t,e){try{let n=t.sessionStorage.getItem(W1);if(n){let i=JSON.parse(n);for(let[r,s]of Object.entries(i||{}))s&&Array.isArray(s)&&e.set(r,new Set(s||[]))}}catch{}}function wk(t,e){if(e.size>0){let n={};for(let[i,r]of e)n[i]=[...r];try{t.sessionStorage.setItem(W1,JSON.stringify(n))}catch(i){Gn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function Zb(){let t,e,n=new Promise((i,r)=>{t=async s=>{i(s);try{await n}catch{}},e=async s=>{r(s);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var Ao=N.createContext(null);Ao.displayName="DataRouter";var Su=N.createContext(null);Su.displayName="DataRouterState";var Q1=N.createContext(!1);function Ek(){return N.useContext(Q1)}var Iv=N.createContext({isTransitioning:!1});Iv.displayName="ViewTransition";var eM=N.createContext(new Map);eM.displayName="Fetchers";var Mk=N.createContext(null);Mk.displayName="Await";var gr=N.createContext(null);gr.displayName="Navigation";var bh=N.createContext(null);bh.displayName="Location";var Vs=N.createContext({outlet:null,matches:[],isDataRoute:!1});Vs.displayName="Route";var Uv=N.createContext(null);Uv.displayName="RouteError";var tM="REACT_ROUTER_ERROR",Tk="REDIRECT",Ak="ROUTE_ERROR_RESPONSE";function Ck(t){if(t.startsWith(`${tM}:${Tk}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function Rk(t){if(t.startsWith(`${tM}:${Ak}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new xu(e.status,e.statusText,e.data)}catch{}}function Pk(t,{relative:e}={}){Qt(wu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=N.useContext(gr),{hash:r,pathname:s,search:o}=Eu(t,{relative:e}),c=s;return n!=="/"&&(c=s==="/"?n:Or([n,s])),i.createHref({pathname:c,search:o,hash:r})}function wu(){return N.useContext(bh)!=null}function vr(){return Qt(wu(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(bh).location}var nM="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function iM(t){N.useContext(gr).static||N.useLayoutEffect(t)}function Fv(){let{isDataRoute:t}=N.useContext(Vs);return t?Gk():kk()}function kk(){Qt(wu(),"useNavigate() may be used only in the context of a <Router> component.");let t=N.useContext(Ao),{basename:e,navigator:n}=N.useContext(gr),{matches:i}=N.useContext(Vs),{pathname:r}=vr(),s=JSON.stringify(kv(i)),o=N.useRef(!1);return iM(()=>{o.current=!0}),N.useCallback((u,f={})=>{if(Gn(o.current,nM),!o.current)return;if(typeof u=="number"){n.go(u);return}let h=xh(u,JSON.parse(s),r,f.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Or([e,h.pathname])),(f.replace?n.replace:n.push)(h,f.state,f)},[e,n,s,r,t])}N.createContext(null);function Eu(t,{relative:e}={}){let{matches:n}=N.useContext(Vs),{pathname:i}=vr(),r=JSON.stringify(kv(n));return N.useMemo(()=>xh(t,JSON.parse(r),i,e==="path"),[t,r,i,e])}function Lk(t,e,n){Qt(wu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=N.useContext(gr),{matches:r}=N.useContext(Vs),s=r[r.length-1],o=s?s.params:{},c=s?s.pathname:"/",u=s?s.pathnameBase:"/",f=s&&s.route;{let y=f&&f.path||"";sM(c,!f||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${y}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
11
|
|
|
12
12
|
Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let h=vr(),p;p=h;let m=p.pathname||"/",v=m;if(u!=="/"){let y=u.replace(/^\//,"").split("/");v="/"+m.replace(/^\//,"").split("/").slice(y.length).join("/")}let _=xa(t,{pathname:v});return Gn(f||_!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Gn(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Fk(_&&_.map(y=>Object.assign({},y,{params:Object.assign({},o,y.params),pathname:Or([u,i.encodeLocation?i.encodeLocation(y.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?u:Or([u,i.encodeLocation?i.encodeLocation(y.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),r,n)}function Dk(){let t=Hk(),e=uu(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:s},"ErrorBoundary")," or"," ",N.createElement("code",{style:s},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},e),n?N.createElement("pre",{style:r},n):null,o)}var Nk=N.createElement(Dk,null),rM=class extends N.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=Rk(t.digest);n&&(t=n)}let e=t!==void 0?N.createElement(Vs.Provider,{value:this.props.routeContext},N.createElement(Uv.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?N.createElement(Ik,{error:t},e):e}};rM.contextType=Q1;var Em=new WeakMap;function Ik({children:t,error:e}){let{basename:n}=N.useContext(gr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=Ck(e.digest);if(i){let r=Em.get(e);if(r)throw r;let s=z1(i.location,n);if(B1&&!Em.get(e))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw Em.set(e,o),o}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function Uk({routeContext:t,match:e,children:n}){let i=N.useContext(Ao);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),N.createElement(Vs.Provider,{value:t},n)}function Fk(t,e=[],n){let i=n?.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let r=t,s=i?.errors;if(s!=null){let h=r.findIndex(p=>p.route.id&&s?.[p.route.id]!==void 0);Qt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,h+1))}let o=!1,c=-1;if(n&&i){o=i.renderFallback;for(let h=0;h<r.length;h++){let p=r[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=h),p.route.id){let{loaderData:m,errors:v}=i,_=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||_){n.isStatic&&(o=!0),c>=0?r=r.slice(0,c+1):r=[r[0]];break}}}}let u=n?.onError,f=i&&u?(h,p)=>{u(h,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:bu(i.matches),errorInfo:p})}:void 0;return r.reduceRight((h,p,m)=>{let v,_=!1,w=null,y=null;i&&(v=s&&p.route.id?s[p.route.id]:void 0,w=p.route.errorElement||Nk,o&&(c<0&&m===0?(sM("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,y=null):c===m&&(_=!0,y=p.route.hydrateFallbackElement||null)));let x=e.concat(r.slice(0,m+1)),M=()=>{let A;return v?A=w:_?A=y:p.route.Component?A=N.createElement(p.route.Component,null):p.route.element?A=p.route.element:A=h,N.createElement(Uk,{match:p,routeContext:{outlet:h,matches:x,isDataRoute:i!=null},children:A})};return i&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?N.createElement(rM,{location:i.location,revalidation:i.revalidation,component:w,error:v,children:M(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:f}):M()},null)}function Ov(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ok(t){let e=N.useContext(Ao);return Qt(e,Ov(t)),e}function Bk(t){let e=N.useContext(Su);return Qt(e,Ov(t)),e}function zk(t){let e=N.useContext(Vs);return Qt(e,Ov(t)),e}function Bv(t){let e=zk(t),n=e.matches[e.matches.length-1];return Qt(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Vk(){return Bv("useRouteId")}function Hk(){let t=N.useContext(Uv),e=Bk("useRouteError"),n=Bv("useRouteError");return t!==void 0?t:e.errors?.[n]}function Gk(){let{router:t}=Ok("useNavigate"),e=Bv("useNavigate"),n=N.useRef(!1);return iM(()=>{n.current=!0}),N.useCallback(async(r,s={})=>{Gn(n.current,nM),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...s}))},[t,e])}var Jb={};function sM(t,e,n){!e&&!Jb[t]&&(Jb[t]=!0,Gn(!1,n))}var Qb={};function eS(t,e){!t&&!Qb[e]&&(Qb[e]=!0,console.warn(e))}var Wk="useOptimistic",tS=k1[Wk],jk=()=>{};function $k(t){return tS?tS(t):[t,jk]}function Xk(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&Gn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:N.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&Gn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:N.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&Gn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:N.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var qk=["HydrateFallback","hydrateFallbackElement"],Yk=class{constructor(){this.status="pending",this.promise=new Promise((t,e)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",e(n))}})}};function Kk({router:t,flushSync:e,onError:n,unstable_useTransitions:i}){i=Ek()||i;let[s,o]=N.useState(t.state),[c,u]=$k(s),[f,h]=N.useState(),[p,m]=N.useState({isTransitioning:!1}),[v,_]=N.useState(),[w,y]=N.useState(),[x,M]=N.useState(),A=N.useRef(new Map),T=N.useCallback((S,{deletedFetchers:R,newErrors:H,flushSync:F,viewTransitionOpts:W})=>{H&&n&&Object.values(H).forEach(V=>n(V,{location:S.location,params:S.matches[0]?.params??{},unstable_pattern:bu(S.matches)})),S.fetchers.forEach((V,q)=>{V.data!==void 0&&A.current.set(q,V.data)}),R.forEach(V=>A.current.delete(V)),eS(F===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let X=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(eS(W==null||X,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!W||!X){e&&F?e(()=>o(S)):i===!1?o(S):N.startTransition(()=>{i===!0&&u(V=>nS(V,S)),o(S)});return}if(e&&F){e(()=>{w&&(v?.resolve(),w.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:W.currentLocation,nextLocation:W.nextLocation})});let V=t.window.document.startViewTransition(()=>{e(()=>o(S))});V.finished.finally(()=>{e(()=>{_(void 0),y(void 0),h(void 0),m({isTransitioning:!1})})}),e(()=>y(V));return}w?(v?.resolve(),w.skipTransition(),M({state:S,currentLocation:W.currentLocation,nextLocation:W.nextLocation})):(h(S),m({isTransitioning:!0,flushSync:!1,currentLocation:W.currentLocation,nextLocation:W.nextLocation}))},[t.window,e,w,v,i,u,n]);N.useLayoutEffect(()=>t.subscribe(T),[t,T]),N.useEffect(()=>{p.isTransitioning&&!p.flushSync&&_(new Yk)},[p]),N.useEffect(()=>{if(v&&f&&t.window){let S=f,R=v.promise,H=t.window.document.startViewTransition(async()=>{i===!1?o(S):N.startTransition(()=>{i===!0&&u(F=>nS(F,S)),o(S)}),await R});H.finished.finally(()=>{_(void 0),y(void 0),h(void 0),m({isTransitioning:!1})}),y(H)}},[f,v,t.window,i,u]),N.useEffect(()=>{v&&f&&c.location.key===f.location.key&&v.resolve()},[v,w,c.location,f]),N.useEffect(()=>{!p.isTransitioning&&x&&(h(x.state),m({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),M(void 0))},[p.isTransitioning,x]);let D=N.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:S=>t.navigate(S),push:(S,R,H)=>t.navigate(S,{state:R,preventScrollReset:H?.preventScrollReset}),replace:(S,R,H)=>t.navigate(S,{replace:!0,state:R,preventScrollReset:H?.preventScrollReset})}),[t]),I=t.basename||"/",U=N.useMemo(()=>({router:t,navigator:D,static:!1,basename:I,onError:n}),[t,D,I,n]);return N.createElement(N.Fragment,null,N.createElement(Ao.Provider,{value:U},N.createElement(Su.Provider,{value:c},N.createElement(eM.Provider,{value:A.current},N.createElement(Iv.Provider,{value:p},N.createElement(Qk,{basename:I,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:i},N.createElement(Zk,{routes:t.routes,future:t.future,state:c,isStatic:!1,onError:n})))))),null)}function nS(t,e){return{...t,navigation:e.navigation.state!=="idle"?e.navigation:t.navigation,revalidation:e.revalidation!=="idle"?e.revalidation:t.revalidation,actionData:e.navigation.state!=="submitting"?e.actionData:t.actionData,fetchers:e.fetchers}}var Zk=N.memo(Jk);function Jk({routes:t,future:e,state:n,isStatic:i,onError:r}){return Lk(t,void 0,{state:n,isStatic:i,onError:r})}function Qk({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:r,static:s=!1,unstable_useTransitions:o}){Qt(!wu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=N.useMemo(()=>({basename:c,navigator:r,static:s,unstable_useTransitions:o,future:{}}),[c,r,s,o]);typeof n=="string"&&(n=zs(n));let{pathname:f="/",search:h="",hash:p="",state:m=null,key:v="default",unstable_mask:_}=n,w=N.useMemo(()=>{let y=mr(f,c);return y==null?null:{location:{pathname:y,search:h,hash:p,state:m,key:v,unstable_mask:_},navigationType:i}},[c,f,h,p,m,v,i,_]);return Gn(w!=null,`<Router basename="${c}"> is not able to match the URL "${f}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:N.createElement(gr.Provider,{value:u},N.createElement(bh.Provider,{children:e,value:w}))}var xf="get",bf="application/x-www-form-urlencoded";function Sh(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function eL(t){return Sh(t)&&t.tagName.toLowerCase()==="button"}function tL(t){return Sh(t)&&t.tagName.toLowerCase()==="form"}function nL(t){return Sh(t)&&t.tagName.toLowerCase()==="input"}function iL(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function rL(t,e){return t.button===0&&(!e||e==="_self")&&!iL(t)}function Hg(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let i=t[n];return e.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function sL(t,e){let n=Hg(t);return e&&e.forEach((i,r)=>{n.has(r)||e.getAll(r).forEach(s=>{n.append(r,s)})}),n}var Od=null;function aL(){if(Od===null)try{new FormData(document.createElement("form"),0),Od=!1}catch{Od=!0}return Od}var oL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mm(t){return t!=null&&!oL.has(t)?(Gn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${bf}"`),null):t}function lL(t,e){let n,i,r,s,o;if(tL(t)){let c=t.getAttribute("action");i=c?mr(c,e):null,n=t.getAttribute("method")||xf,r=Mm(t.getAttribute("enctype"))||bf,s=new FormData(t)}else if(eL(t)||nL(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||c.getAttribute("action");if(i=u?mr(u,e):null,n=t.getAttribute("formmethod")||c.getAttribute("method")||xf,r=Mm(t.getAttribute("formenctype"))||Mm(c.getAttribute("enctype"))||bf,s=new FormData(c,t),!aL()){let{name:f,type:h,value:p}=t;if(h==="image"){let m=f?`${f}.`:"";s.append(`${m}x`,"0"),s.append(`${m}y`,"0")}else f&&s.append(f,p)}}else{if(Sh(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=xf,i=null,r=bf,o=t}return s&&r==="text/plain"&&(o=s,s=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:s,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zv(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function cL(t,e,n,i){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&mr(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function uL(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dL(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function fL(t,e,n){let i=await Promise.all(t.map(async r=>{let s=e.routes[r.route.id];if(s){let o=await uL(s,n);return o.links?o.links():[]}return[]}));return gL(i.flat(1).filter(dL).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function iS(t,e,n,i,r,s){let o=(u,f)=>n[f]?u.route.id!==n[f].route.id:!0,c=(u,f)=>n[f].pathname!==u.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==u.params["*"];return s==="assets"?e.filter((u,f)=>o(u,f)||c(u,f)):s==="data"?e.filter((u,f)=>{let h=i.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(o(u,f)||c(u,f))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function hL(t,e,{includeHydrateFallback:n}={}){return pL(t.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function pL(t){return[...new Set(t)]}function mL(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function gL(t,e){let n=new Set;return new Set(e),t.reduce((i,r)=>{let s=JSON.stringify(mL(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function aM(){let t=N.useContext(Ao);return zv(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function vL(){let t=N.useContext(Su);return zv(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Vv=N.createContext(void 0);Vv.displayName="FrameworkContext";function oM(){let t=N.useContext(Vv);return zv(t,"You must render this element inside a <HydratedRouter> element"),t}function yL(t,e){let n=N.useContext(Vv),[i,r]=N.useState(!1),[s,o]=N.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:f,onMouseLeave:h,onTouchStart:p}=e,m=N.useRef(null);N.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let w=x=>{x.forEach(M=>{o(M.isIntersecting)})},y=new IntersectionObserver(w,{threshold:.5});return m.current&&y.observe(m.current),()=>{y.disconnect()}}},[t]),N.useEffect(()=>{if(i){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[i]);let v=()=>{r(!0)},_=()=>{r(!1),o(!1)};return n?t!=="intent"?[s,m,{}]:[s,m,{onFocus:Ic(c,v),onBlur:Ic(u,_),onMouseEnter:Ic(f,v),onMouseLeave:Ic(h,_),onTouchStart:Ic(p,v)}]:[!1,m,{}]}function Ic(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function _L({page:t,...e}){let{router:n}=aM(),i=N.useMemo(()=>xa(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?N.createElement(bL,{page:t,matches:i,...e}):null}function xL(t){let{manifest:e,routeModules:n}=oM(),[i,r]=N.useState([]);return N.useEffect(()=>{let s=!1;return fL(t,e,n).then(o=>{s||r(o)}),()=>{s=!0}},[t,e,n]),i}function bL({page:t,matches:e,...n}){let i=vr(),{future:r,manifest:s,routeModules:o}=oM(),{basename:c}=aM(),{loaderData:u,matches:f}=vL(),h=N.useMemo(()=>iS(t,e,f,s,i,"data"),[t,e,f,s,i]),p=N.useMemo(()=>iS(t,e,f,s,i,"assets"),[t,e,f,s,i]),m=N.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let w=new Set,y=!1;if(e.forEach(M=>{let A=s.routes[M.route.id];!A||!A.hasLoader||(!h.some(T=>T.route.id===M.route.id)&&M.route.id in u&&o[M.route.id]?.shouldRevalidate||A.hasClientLoader?y=!0:w.add(M.route.id))}),w.size===0)return[];let x=cL(t,c,r.unstable_trailingSlashAwareDataRequests,"data");return y&&w.size>0&&x.searchParams.set("_routes",e.filter(M=>w.has(M.route.id)).map(M=>M.route.id).join(",")),[x.pathname+x.search]},[c,r.unstable_trailingSlashAwareDataRequests,u,i,s,h,e,t,o]),v=N.useMemo(()=>hL(p,s),[p,s]),_=xL(p);return N.createElement(N.Fragment,null,m.map(w=>N.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>N.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),_.map(({key:w,link:y})=>N.createElement("link",{key:w,nonce:n.nonce,...y,crossOrigin:y.crossOrigin??n.crossOrigin})))}function SL(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var wL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wL&&(window.__reactRouterVersion="7.13.1")}catch{}function EL(t,e){return Q2({basename:e?.basename,getContext:e?.getContext,future:e?.future,history:m2({window:e?.window}),hydrationData:ML(),routes:t,mapRouteProperties:Xk,hydrationRouteProperties:qk,dataStrategy:e?.dataStrategy,patchRoutesOnNavigation:e?.patchRoutesOnNavigation,window:e?.window,unstable_instrumentations:e?.unstable_instrumentations}).initialize()}function ML(){let t=window?.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:TL(t.errors)}),t}function TL(t){if(!t)return null;let e=Object.entries(t),n={};for(let[i,r]of e)if(r&&r.__type==="RouteErrorResponse")n[i]=new xu(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type==="Error"){if(r.__subType){let s=window[r.__subType];if(typeof s=="function")try{let o=new s(r.message);o.stack="",n[i]=o}catch{}}if(n[i]==null){let s=new Error(r.message);s.stack="",n[i]=s}}else n[i]=r;return n}var lM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ho=N.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:r,reloadDocument:s,replace:o,unstable_mask:c,state:u,target:f,to:h,preventScrollReset:p,viewTransition:m,unstable_defaultShouldRevalidate:v,..._},w){let{basename:y,navigator:x,unstable_useTransitions:M}=N.useContext(gr),A=typeof h=="string"&&lM.test(h),T=z1(h,y);h=T.to;let D=Pk(h,{relative:r}),I=vr(),U=null;if(c){let q=xh(c,[],I.unstable_mask?I.unstable_mask.pathname:"/",!0);y!=="/"&&(q.pathname=q.pathname==="/"?y:Or([y,q.pathname])),U=x.createHref(q)}let[S,R,H]=yL(i,_),F=PL(h,{replace:o,unstable_mask:c,state:u,target:f,preventScrollReset:p,relative:r,viewTransition:m,unstable_defaultShouldRevalidate:v,unstable_useTransitions:M});function W(q){e&&e(q),q.defaultPrevented||F(q)}let X=!(T.isExternal||s),V=N.createElement("a",{..._,...H,href:(X?U:void 0)||T.absoluteURL||D,onClick:X?W:e,ref:SL(w,R),target:f,"data-discover":!A&&n==="render"?"true":void 0});return S&&!A?N.createElement(N.Fragment,null,V,N.createElement(_L,{page:D})):V});ho.displayName="Link";var AL=N.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:r=!1,style:s,to:o,viewTransition:c,children:u,...f},h){let p=Eu(o,{relative:f.relative}),m=vr(),v=N.useContext(Su),{navigator:_,basename:w}=N.useContext(gr),y=v!=null&&UL(p)&&c===!0,x=_.encodeLocation?_.encodeLocation(p).pathname:p.pathname,M=m.pathname,A=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(M=M.toLowerCase(),A=A?A.toLowerCase():null,x=x.toLowerCase()),A&&w&&(A=mr(A,w)||A);const T=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let D=M===x||!r&&M.startsWith(x)&&M.charAt(T)==="/",I=A!=null&&(A===x||!r&&A.startsWith(x)&&A.charAt(x.length)==="/"),U={isActive:D,isPending:I,isTransitioning:y},S=D?e:void 0,R;typeof i=="function"?R=i(U):R=[i,D?"active":null,I?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let H=typeof s=="function"?s(U):s;return N.createElement(ho,{...f,"aria-current":S,className:R,ref:h,style:H,to:o,viewTransition:c},typeof u=="function"?u(U):u)});AL.displayName="NavLink";var CL=N.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:r,state:s,method:o=xf,action:c,onSubmit:u,relative:f,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m,...v},_)=>{let{unstable_useTransitions:w}=N.useContext(gr),y=NL(),x=IL(c,{relative:f}),M=o.toLowerCase()==="get"?"get":"post",A=typeof c=="string"&&lM.test(c),T=D=>{if(u&&u(D),D.defaultPrevented)return;D.preventDefault();let I=D.nativeEvent.submitter,U=I?.getAttribute("formmethod")||o,S=()=>y(I||D.currentTarget,{fetcherKey:e,method:U,navigate:n,replace:r,state:s,relative:f,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m});w&&n!==!1?N.startTransition(()=>S()):S()};return N.createElement("form",{ref:_,method:M,action:x,onSubmit:i?u:T,...v,"data-discover":!A&&t==="render"?"true":void 0})});CL.displayName="Form";function RL(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cM(t){let e=N.useContext(Ao);return Qt(e,RL(t)),e}function PL(t,{target:e,replace:n,unstable_mask:i,state:r,preventScrollReset:s,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:u,unstable_useTransitions:f}={}){let h=Fv(),p=vr(),m=Eu(t,{relative:o});return N.useCallback(v=>{if(rL(v,e)){v.preventDefault();let _=n!==void 0?n:rs(p)===rs(m),w=()=>h(t,{replace:_,unstable_mask:i,state:r,preventScrollReset:s,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:u});f?N.startTransition(()=>w()):w()}},[p,h,m,n,i,r,e,t,s,o,c,u,f])}function kL(t){Gn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=N.useRef(Hg(t)),n=N.useRef(!1),i=vr(),r=N.useMemo(()=>sL(i.search,n.current?null:e.current),[i.search]),s=Fv(),o=N.useCallback((c,u)=>{const f=Hg(typeof c=="function"?c(new URLSearchParams(r)):c);n.current=!0,s("?"+f,u)},[s,r]);return[r,o]}var LL=0,DL=()=>`__${String(++LL)}__`;function NL(){let{router:t}=cM("useSubmit"),{basename:e}=N.useContext(gr),n=Vk(),i=t.fetch,r=t.navigate;return N.useCallback(async(s,o={})=>{let{action:c,method:u,encType:f,formData:h,body:p}=lL(s,e);if(o.navigate===!1){let m=o.fetcherKey||DL();await i(m,n,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:h,body:p,formMethod:o.method||u,formEncType:o.encType||f,flushSync:o.flushSync})}else await r(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:h,body:p,formMethod:o.method||u,formEncType:o.encType||f,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[i,r,e,n])}function IL(t,{relative:e}={}){let{basename:n}=N.useContext(gr),i=N.useContext(Vs);Qt(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...Eu(t||".",{relative:e})},o=vr();if(t==null){s.search=o.search;let c=new URLSearchParams(s.search),u=c.getAll("index");if(u.some(h=>h==="")){c.delete("index"),u.filter(p=>p).forEach(p=>c.append("index",p));let h=c.toString();s.search=h?`?${h}`:""}}return(!t||t===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Or([n,s.pathname])),rs(s)}function UL(t,{relative:e}={}){let n=N.useContext(Iv);Qt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=cM("useViewTransitionState"),r=Eu(t,{relative:e});if(!n.isTransitioning)return!1;let s=mr(n.currentLocation.pathname,i)||n.currentLocation.pathname,o=mr(n.nextLocation.pathname,i)||n.nextLocation.pathname;return Gf(r.pathname,o)!=null||Gf(r.pathname,s)!=null}var FL=L1();function OL(t){return N.createElement(Kk,{flushSync:FL.flushSync,...t})}var hn;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},t.getValidEnumValues=r=>{const s=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),o={};for(const c of s)o[c]=r[c];return t.objectValues(o)},t.objectValues=r=>t.objectKeys(r).map(function(s){return r[s]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},t.find=(r,s)=>{for(const o of r)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(hn||(hn={}));var rS;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(rS||(rS={}));const ot=hn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_a=t=>{switch(typeof t){case"undefined":return ot.undefined;case"string":return ot.string;case"number":return Number.isNaN(t)?ot.nan:ot.number;case"boolean":return ot.boolean;case"function":return ot.function;case"bigint":return ot.bigint;case"symbol":return ot.symbol;case"object":return Array.isArray(t)?ot.array:t===null?ot.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ot.promise:typeof Map<"u"&&t instanceof Map?ot.map:typeof Set<"u"&&t instanceof Set?ot.set:typeof Date<"u"&&t instanceof Date?ot.date:ot.object;default:return ot.unknown}},Fe=hn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Fs extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},i={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)i._errors.push(n(o));else{let c=i,u=0;for(;u<o.path.length;){const f=o.path[u];u===o.path.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(n(o))):c[f]=c[f]||{_errors:[]},c=c[f],u++}}};return r(this),i}static assert(e){if(!(e instanceof Fs))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,hn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];n[s]=n[s]||[],n[s].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}Fs.create=t=>new Fs(t);const Gg=(t,e)=>{let n;switch(t.code){case Fe.invalid_type:t.received===ot.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Fe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,hn.jsonStringifyReplacer)}`;break;case Fe.unrecognized_keys:n=`Unrecognized key(s) in object: ${hn.joinValues(t.keys,", ")}`;break;case Fe.invalid_union:n="Invalid input";break;case Fe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${hn.joinValues(t.options)}`;break;case Fe.invalid_enum_value:n=`Invalid enum value. Expected ${hn.joinValues(t.options)}, received '${t.received}'`;break;case Fe.invalid_arguments:n="Invalid function arguments";break;case Fe.invalid_return_type:n="Invalid function return type";break;case Fe.invalid_date:n="Invalid date";break;case Fe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:hn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Fe.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Fe.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Fe.custom:n="Invalid input";break;case Fe.invalid_intersection_types:n="Intersection results could not be merged";break;case Fe.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Fe.not_finite:n="Number must be finite";break;default:n=e.defaultError,hn.assertNever(t)}return{message:n}};let BL=Gg;function zL(){return BL}const VL=t=>{const{data:e,path:n,errorMaps:i,issueData:r}=t,s=[...n,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="";const u=i.filter(f=>!!f).slice().reverse();for(const f of u)c=f(o,{data:e,defaultError:c}).message;return{...r,path:s,message:c}};function Je(t,e){const n=zL(),i=VL({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Gg?void 0:Gg].filter(r=>!!r)});t.common.issues.push(i)}class Di{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const r of n){if(r.status==="aborted")return Bt;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const r of n){const s=await r.key,o=await r.value;i.push({key:s,value:o})}return Di.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const r of n){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Bt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}}const Bt=Object.freeze({status:"aborted"}),Yc=t=>({status:"dirty",value:t}),yr=t=>({status:"valid",value:t}),sS=t=>t.status==="aborted",aS=t=>t.status==="dirty",Ll=t=>t.status==="valid",Wf=t=>typeof Promise<"u"&&t instanceof Promise;var wt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(wt||(wt={}));class ss{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const oS=(t,e)=>{if(Ll(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Fs(t.common.issues);return this._error=n,this._error}}};function jt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,c)=>{const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},description:r}}class sn{get description(){return this._def.description}_getType(e){return _a(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:_a(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Di,ctx:{common:e.parent.common,data:e.data,parsedType:_a(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Wf(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){const i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_a(e)},r=this._parseSync({data:e,path:i.path,parent:i});return oS(i,r)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_a(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return Ll(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Ll(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_a(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(Wf(r)?r:Promise.resolve(r));return oS(i,s)}refine(e,n){const i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,s)=>{const o=e(r),c=()=>s.addIssue({code:Fe.custom,...i(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new So({schema:this,typeName:zt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ds.create(this,this._def)}nullable(){return wo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return es.create(this)}promise(){return Kf.create(this,this._def)}or(e){return $f.create([this,e],this._def)}and(e){return Xf.create(this,e,this._def)}transform(e){return new So({...jt(this._def),schema:this,typeName:zt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Zf({...jt(this._def),innerType:this,defaultValue:n,typeName:zt.ZodDefault})}brand(){return new hM({typeName:zt.ZodBranded,type:this,...jt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Jf({...jt(this._def),innerType:this,catchValue:n,typeName:zt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Gv.create(this,e)}readonly(){return Qf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const HL=/^c[^\s-]{8,}$/i,GL=/^[0-9a-z]+$/,WL=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jL=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$L=/^[a-z0-9_-]{21}$/i,XL=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,qL=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,YL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Tm;const ZL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,JL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,QL=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eD=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,uM="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",iD=new RegExp(`^${uM}$`);function dM(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function rD(t){return new RegExp(`^${dM(t)}$`)}function sD(t){let e=`${uM}T${dM(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function aD(t,e){return!!((e==="v4"||!e)&&ZL.test(t)||(e==="v6"||!e)&&QL.test(t))}function oD(t,e){if(!XL.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function lD(t,e){return!!((e==="v4"||!e)&&JL.test(t)||(e==="v6"||!e)&&eD.test(t))}class Zr extends sn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ot.string){const s=this._getOrReturnCtx(e);return Je(s,{code:Fe.invalid_type,expected:ot.string,received:s.parsedType}),Bt}const i=new Di;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,c=e.data.length<s.value;(o||c)&&(r=this._getOrReturnCtx(e,r),o?Je(r,{code:Fe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&Je(r,{code:Fe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")YL.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"email",code:Fe.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Tm||(Tm=new RegExp(KL,"u")),Tm.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"emoji",code:Fe.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")jL.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"uuid",code:Fe.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")$L.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"nanoid",code:Fe.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")HL.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"cuid",code:Fe.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")GL.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"cuid2",code:Fe.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")WL.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"ulid",code:Fe.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),Je(r,{validation:"url",code:Fe.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"regex",code:Fe.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?sD(s).test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?iD.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?rD(s).test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?qL.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"duration",code:Fe.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?aD(e.data,s.version)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"ip",code:Fe.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?oD(e.data,s.alg)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"jwt",code:Fe.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?lD(e.data,s.version)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"cidr",code:Fe.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?tD.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"base64",code:Fe.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?nD.test(e.data)||(r=this._getOrReturnCtx(e,r),Je(r,{validation:"base64url",code:Fe.invalid_string,message:s.message}),i.dirty()):hn.assertNever(s);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:Fe.invalid_string,...wt.errToObj(i)})}_addCheck(e){return new Zr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...wt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...wt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...wt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...wt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...wt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...wt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...wt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...wt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...wt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...wt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...wt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...wt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...wt.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...wt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...wt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...wt.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...wt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...wt.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...wt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...wt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...wt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...wt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...wt.errToObj(n)})}nonempty(e){return this.min(1,wt.errToObj(e))}trim(){return new Zr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Zr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Zr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Zr.create=t=>new Zr({checks:[],typeName:zt.ZodString,coerce:t?.coerce??!1,...jt(t)});function cD(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(t.toFixed(r).replace(".","")),o=Number.parseInt(e.toFixed(r).replace(".",""));return s%o/10**r}class yo extends sn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ot.number){const s=this._getOrReturnCtx(e);return Je(s,{code:Fe.invalid_type,expected:ot.number,received:s.parsedType}),Bt}let i;const r=new Di;for(const s of this._def.checks)s.kind==="int"?hn.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{code:Fe.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Fe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Fe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?cD(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Fe.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),Je(i,{code:Fe.not_finite,message:s.message}),r.dirty()):hn.assertNever(s);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,wt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,wt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,wt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,wt.toString(n))}setLimit(e,n,i,r){return new yo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:wt.toString(r)}]})}_addCheck(e){return new yo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:wt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:wt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:wt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:wt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:wt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:wt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:wt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:wt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:wt.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&hn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}yo.create=t=>new yo({checks:[],typeName:zt.ZodNumber,coerce:t?.coerce||!1,...jt(t)});class _o extends sn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ot.bigint)return this._getInvalidInput(e);let i;const r=new Di;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Fe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Fe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),Je(i,{code:Fe.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):hn.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Je(n,{code:Fe.invalid_type,expected:ot.bigint,received:n.parsedType}),Bt}gte(e,n){return this.setLimit("min",e,!0,wt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,wt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,wt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,wt.toString(n))}setLimit(e,n,i,r){return new _o({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:wt.toString(r)}]})}_addCheck(e){return new _o({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:wt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:wt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:wt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:wt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:wt.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}_o.create=t=>new _o({checks:[],typeName:zt.ZodBigInt,coerce:t?.coerce??!1,...jt(t)});class jf extends sn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ot.boolean){const i=this._getOrReturnCtx(e);return Je(i,{code:Fe.invalid_type,expected:ot.boolean,received:i.parsedType}),Bt}return yr(e.data)}}jf.create=t=>new jf({typeName:zt.ZodBoolean,coerce:t?.coerce||!1,...jt(t)});class Dl extends sn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ot.date){const s=this._getOrReturnCtx(e);return Je(s,{code:Fe.invalid_type,expected:ot.date,received:s.parsedType}),Bt}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return Je(s,{code:Fe.invalid_date}),Bt}const i=new Di;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),Je(r,{code:Fe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):hn.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Dl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:wt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:wt.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Dl.create=t=>new Dl({checks:[],coerce:t?.coerce||!1,typeName:zt.ZodDate,...jt(t)});class lS extends sn{_parse(e){if(this._getType(e)!==ot.symbol){const i=this._getOrReturnCtx(e);return Je(i,{code:Fe.invalid_type,expected:ot.symbol,received:i.parsedType}),Bt}return yr(e.data)}}lS.create=t=>new lS({typeName:zt.ZodSymbol,...jt(t)});class Wg extends sn{_parse(e){if(this._getType(e)!==ot.undefined){const i=this._getOrReturnCtx(e);return Je(i,{code:Fe.invalid_type,expected:ot.undefined,received:i.parsedType}),Bt}return yr(e.data)}}Wg.create=t=>new Wg({typeName:zt.ZodUndefined,...jt(t)});class jg extends sn{_parse(e){if(this._getType(e)!==ot.null){const i=this._getOrReturnCtx(e);return Je(i,{code:Fe.invalid_type,expected:ot.null,received:i.parsedType}),Bt}return yr(e.data)}}jg.create=t=>new jg({typeName:zt.ZodNull,...jt(t)});class cS extends sn{constructor(){super(...arguments),this._any=!0}_parse(e){return yr(e.data)}}cS.create=t=>new cS({typeName:zt.ZodAny,...jt(t)});class $g extends sn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return yr(e.data)}}$g.create=t=>new $g({typeName:zt.ZodUnknown,...jt(t)});class Aa extends sn{_parse(e){const n=this._getOrReturnCtx(e);return Je(n,{code:Fe.invalid_type,expected:ot.never,received:n.parsedType}),Bt}}Aa.create=t=>new Aa({typeName:zt.ZodNever,...jt(t)});class uS extends sn{_parse(e){if(this._getType(e)!==ot.undefined){const i=this._getOrReturnCtx(e);return Je(i,{code:Fe.invalid_type,expected:ot.void,received:i.parsedType}),Bt}return yr(e.data)}}uS.create=t=>new uS({typeName:zt.ZodVoid,...jt(t)});class es extends sn{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==ot.array)return Je(n,{code:Fe.invalid_type,expected:ot.array,received:n.parsedType}),Bt;if(r.exactLength!==null){const o=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(o||c)&&(Je(n,{code:o?Fe.too_big:Fe.too_small,minimum:c?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(Je(n,{code:Fe.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(Je(n,{code:Fe.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>r.type._parseAsync(new ss(n,o,n.path,c)))).then(o=>Di.mergeArray(i,o));const s=[...n.data].map((o,c)=>r.type._parseSync(new ss(n,o,n.path,c)));return Di.mergeArray(i,s)}get element(){return this._def.type}min(e,n){return new es({...this._def,minLength:{value:e,message:wt.toString(n)}})}max(e,n){return new es({...this._def,maxLength:{value:e,message:wt.toString(n)}})}length(e,n){return new es({...this._def,exactLength:{value:e,message:wt.toString(n)}})}nonempty(e){return this.min(1,e)}}es.create=(t,e)=>new es({type:t,minLength:null,maxLength:null,exactLength:null,typeName:zt.ZodArray,...jt(e)});function xl(t){if(t instanceof $n){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=Ds.create(xl(i))}return new $n({...t._def,shape:()=>e})}else return t instanceof es?new es({...t._def,type:xl(t.element)}):t instanceof Ds?Ds.create(xl(t.unwrap())):t instanceof wo?wo.create(xl(t.unwrap())):t instanceof xo?xo.create(t.items.map(e=>xl(e))):t}class $n extends sn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=hn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==ot.object){const f=this._getOrReturnCtx(e);return Je(f,{code:Fe.invalid_type,expected:ot.object,received:f.parsedType}),Bt}const{status:i,ctx:r}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof Aa&&this._def.unknownKeys==="strip"))for(const f in r.data)o.includes(f)||c.push(f);const u=[];for(const f of o){const h=s[f],p=r.data[f];u.push({key:{status:"valid",value:f},value:h._parse(new ss(r,p,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof Aa){const f=this._def.unknownKeys;if(f==="passthrough")for(const h of c)u.push({key:{status:"valid",value:h},value:{status:"valid",value:r.data[h]}});else if(f==="strict")c.length>0&&(Je(r,{code:Fe.unrecognized_keys,keys:c}),i.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const h of c){const p=r.data[h];u.push({key:{status:"valid",value:h},value:f._parse(new ss(r,p,r.path,h)),alwaysSet:h in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const f=[];for(const h of u){const p=await h.key,m=await h.value;f.push({key:p,value:m,alwaysSet:h.alwaysSet})}return f}).then(f=>Di.mergeObjectSync(i,f)):Di.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return wt.errToObj,new $n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{const r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:wt.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new $n({...this._def,unknownKeys:"strip"})}passthrough(){return new $n({...this._def,unknownKeys:"passthrough"})}extend(e){return new $n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:zt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new $n({...this._def,catchall:e})}pick(e){const n={};for(const i of hn.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new $n({...this._def,shape:()=>n})}omit(e){const n={};for(const i of hn.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new $n({...this._def,shape:()=>n})}deepPartial(){return xl(this)}partial(e){const n={};for(const i of hn.objectKeys(this.shape)){const r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new $n({...this._def,shape:()=>n})}required(e){const n={};for(const i of hn.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Ds;)s=s._def.innerType;n[i]=s}return new $n({...this._def,shape:()=>n})}keyof(){return fM(hn.objectKeys(this.shape))}}$n.create=(t,e)=>new $n({shape:()=>t,unknownKeys:"strip",catchall:Aa.create(),typeName:zt.ZodObject,...jt(e)});$n.strictCreate=(t,e)=>new $n({shape:()=>t,unknownKeys:"strict",catchall:Aa.create(),typeName:zt.ZodObject,...jt(e)});$n.lazycreate=(t,e)=>new $n({shape:t,unknownKeys:"strip",catchall:Aa.create(),typeName:zt.ZodObject,...jt(e)});class $f extends sn{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function r(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=s.map(c=>new Fs(c.ctx.common.issues));return Je(n,{code:Fe.invalid_union,unionErrors:o}),Bt}if(n.common.async)return Promise.all(i.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const u of i){const f={...n,common:{...n.common,issues:[]},parent:null},h=u._parseSync({data:n.data,path:n.path,parent:f});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=o.map(u=>new Fs(u));return Je(n,{code:Fe.invalid_union,unionErrors:c}),Bt}}get options(){return this._def.options}}$f.create=(t,e)=>new $f({options:t,typeName:zt.ZodUnion,...jt(e)});const Ps=t=>t instanceof qg?Ps(t.schema):t instanceof So?Ps(t.innerType()):t instanceof Yf?[t.value]:t instanceof bo?t.options:t instanceof Yg?hn.objectValues(t.enum):t instanceof Zf?Ps(t._def.innerType):t instanceof Wg?[void 0]:t instanceof jg?[null]:t instanceof Ds?[void 0,...Ps(t.unwrap())]:t instanceof wo?[null,...Ps(t.unwrap())]:t instanceof hM||t instanceof Qf?Ps(t.unwrap()):t instanceof Jf?Ps(t._def.innerType):[];class Hv extends sn{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ot.object)return Je(n,{code:Fe.invalid_type,expected:ot.object,received:n.parsedType}),Bt;const i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Je(n,{code:Fe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Bt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){const r=new Map;for(const s of n){const o=Ps(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(r.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);r.set(c,s)}}return new Hv({typeName:zt.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...jt(i)})}}function Xg(t,e){const n=_a(t),i=_a(e);if(t===e)return{valid:!0,data:t};if(n===ot.object&&i===ot.object){const r=hn.objectKeys(e),s=hn.objectKeys(t).filter(c=>r.indexOf(c)!==-1),o={...t,...e};for(const c of s){const u=Xg(t[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(n===ot.array&&i===ot.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<t.length;s++){const o=t[s],c=e[s],u=Xg(o,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===ot.date&&i===ot.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Xf extends sn{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),r=(s,o)=>{if(sS(s)||sS(o))return Bt;const c=Xg(s.value,o.value);return c.valid?((aS(s)||aS(o))&&n.dirty(),{status:n.value,value:c.data}):(Je(i,{code:Fe.invalid_intersection_types}),Bt)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Xf.create=(t,e,n)=>new Xf({left:t,right:e,typeName:zt.ZodIntersection,...jt(n)});class xo extends sn{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ot.array)return Je(i,{code:Fe.invalid_type,expected:ot.array,received:i.parsedType}),Bt;if(i.data.length<this._def.items.length)return Je(i,{code:Fe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Bt;!this._def.rest&&i.data.length>this._def.items.length&&(Je(i,{code:Fe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new ss(i,o,i.path,c)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Di.mergeArray(n,o)):Di.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new xo({...this._def,rest:e})}}xo.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xo({items:t,typeName:zt.ZodTuple,rest:null,...jt(e)})};class qf extends sn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ot.object)return Je(i,{code:Fe.invalid_type,expected:ot.object,received:i.parsedType}),Bt;const r=[],s=this._def.keyType,o=this._def.valueType;for(const c in i.data)r.push({key:s._parse(new ss(i,c,i.path,c)),value:o._parse(new ss(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Di.mergeObjectAsync(n,r):Di.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof sn?new qf({keyType:e,valueType:n,typeName:zt.ZodRecord,...jt(i)}):new qf({keyType:Zr.create(),valueType:e,typeName:zt.ZodRecord,...jt(n)})}}class dS extends sn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ot.map)return Je(i,{code:Fe.invalid_type,expected:ot.map,received:i.parsedType}),Bt;const r=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([c,u],f)=>({key:r._parse(new ss(i,c,i.path,[f,"key"])),value:s._parse(new ss(i,u,i.path,[f,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const f=await u.key,h=await u.value;if(f.status==="aborted"||h.status==="aborted")return Bt;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(f.value,h.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of o){const f=u.key,h=u.value;if(f.status==="aborted"||h.status==="aborted")return Bt;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(f.value,h.value)}return{status:n.value,value:c}}}}dS.create=(t,e,n)=>new dS({valueType:e,keyType:t,typeName:zt.ZodMap,...jt(n)});class du extends sn{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==ot.set)return Je(i,{code:Fe.invalid_type,expected:ot.set,received:i.parsedType}),Bt;const r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(Je(i,{code:Fe.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(Je(i,{code:Fe.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const s=this._def.valueType;function o(u){const f=new Set;for(const h of u){if(h.status==="aborted")return Bt;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}const c=[...i.data.values()].map((u,f)=>s._parse(new ss(i,u,i.path,f)));return i.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,n){return new du({...this._def,minSize:{value:e,message:wt.toString(n)}})}max(e,n){return new du({...this._def,maxSize:{value:e,message:wt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}du.create=(t,e)=>new du({valueType:t,minSize:null,maxSize:null,typeName:zt.ZodSet,...jt(e)});class qg extends sn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}qg.create=(t,e)=>new qg({getter:t,typeName:zt.ZodLazy,...jt(e)});class Yf extends sn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Je(n,{received:n.data,code:Fe.invalid_literal,expected:this._def.value}),Bt}return{status:"valid",value:e.data}}get value(){return this._def.value}}Yf.create=(t,e)=>new Yf({value:t,typeName:zt.ZodLiteral,...jt(e)});function fM(t,e){return new bo({values:t,typeName:zt.ZodEnum,...jt(e)})}class bo extends sn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return Je(n,{expected:hn.joinValues(i),received:n.parsedType,code:Fe.invalid_type}),Bt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return Je(n,{received:n.data,code:Fe.invalid_enum_value,options:i}),Bt}return yr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return bo.create(e,{...this._def,...n})}exclude(e,n=this._def){return bo.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}bo.create=fM;class Yg extends sn{_parse(e){const n=hn.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ot.string&&i.parsedType!==ot.number){const r=hn.objectValues(n);return Je(i,{expected:hn.joinValues(r),received:i.parsedType,code:Fe.invalid_type}),Bt}if(this._cache||(this._cache=new Set(hn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=hn.objectValues(n);return Je(i,{received:i.data,code:Fe.invalid_enum_value,options:r}),Bt}return yr(e.data)}get enum(){return this._def.values}}Yg.create=(t,e)=>new Yg({values:t,typeName:zt.ZodNativeEnum,...jt(e)});class Kf extends sn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ot.promise&&n.common.async===!1)return Je(n,{code:Fe.invalid_type,expected:ot.promise,received:n.parsedType}),Bt;const i=n.parsedType===ot.promise?n.data:Promise.resolve(n.data);return yr(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Kf.create=(t,e)=>new Kf({type:t,typeName:zt.ZodPromise,...jt(e)});class So extends sn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===zt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:o=>{Je(i,o),o.fatal?n.abort():n.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return Bt;const u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?Bt:u.status==="dirty"||n.value==="dirty"?Yc(u.value):u});{if(n.value==="aborted")return Bt;const c=this._def.schema._parseSync({data:o,path:i.path,parent:i});return c.status==="aborted"?Bt:c.status==="dirty"||n.value==="dirty"?Yc(c.value):c}}if(r.type==="refinement"){const o=c=>{const u=r.refinement(c,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Bt:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?Bt:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Ll(o))return Bt;const c=r.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>Ll(o)?Promise.resolve(r.transform(o.value,s)).then(c=>({status:n.value,value:c})):Bt);hn.assertNever(r)}}So.create=(t,e,n)=>new So({schema:t,typeName:zt.ZodEffects,effect:e,...jt(n)});So.createWithPreprocess=(t,e,n)=>new So({schema:e,effect:{type:"preprocess",transform:t},typeName:zt.ZodEffects,...jt(n)});class Ds extends sn{_parse(e){return this._getType(e)===ot.undefined?yr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ds.create=(t,e)=>new Ds({innerType:t,typeName:zt.ZodOptional,...jt(e)});class wo extends sn{_parse(e){return this._getType(e)===ot.null?yr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wo.create=(t,e)=>new wo({innerType:t,typeName:zt.ZodNullable,...jt(e)});class Zf extends sn{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===ot.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Zf.create=(t,e)=>new Zf({innerType:t,typeName:zt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...jt(e)});class Jf extends sn{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Wf(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Fs(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Fs(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Jf.create=(t,e)=>new Jf({innerType:t,typeName:zt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...jt(e)});class fS extends sn{_parse(e){if(this._getType(e)!==ot.nan){const i=this._getOrReturnCtx(e);return Je(i,{code:Fe.invalid_type,expected:ot.nan,received:i.parsedType}),Bt}return{status:"valid",value:e.data}}}fS.create=t=>new fS({typeName:zt.ZodNaN,...jt(t)});class hM extends sn{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class Gv extends sn{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Bt:s.status==="dirty"?(n.dirty(),Yc(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Bt:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new Gv({in:e,out:n,typeName:zt.ZodPipeline})}}class Qf extends sn{_parse(e){const n=this._def.innerType._parse(e),i=r=>(Ll(r)&&(r.value=Object.freeze(r.value)),r);return Wf(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}}Qf.create=(t,e)=>new Qf({innerType:t,typeName:zt.ZodReadonly,...jt(e)});var zt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(zt||(zt={}));const C=Zr.create,Te=yo.create;_o.create;const It=jf.create,Wv=Dl.create,Ei=$g.create;Aa.create;const Oe=es.create,G=$n.create,_r=$f.create,pM=Hv.create;Xf.create;xo.create;const Dn=qf.create,Yt=Yf.create,cn=bo.create;Kf.create;Ds.create;wo.create;const Kg={string:(t=>Zr.create({...t,coerce:!0})),number:(t=>yo.create({...t,coerce:!0})),boolean:(t=>jf.create({...t,coerce:!0})),bigint:(t=>_o.create({...t,coerce:!0})),date:(t=>Dl.create({...t,coerce:!0}))};var Xr;(function(t){t.STRING="string",t.DATE="date",t.DATETIME="datetime",t.INTEGER="integer",t.FLOAT="float",t.BOOLEAN="boolean",t.UUID="uuid",t.JSON="json"})(Xr||(Xr={}));const uD=cn(["CASCADE","RESTRICT","NO ACTION"]),dD=cn(["CASCADE","SET NULL","SET DEFAULT","RESTRICT","NO ACTION"]),fD=cn([Xr.STRING,Xr.DATE,Xr.DATETIME,Xr.INTEGER,Xr.FLOAT,Xr.BOOLEAN,Xr.UUID,Xr.JSON]),mM=G({referenceTable:C().min(1,"Target table cannot be empty"),referenceColumn:C().min(1,"Target column cannot be empty"),onDelete:dD,onUpdate:uD}),gM=G({columnName:C().min(1,"Column name cannot be empty").max(64,"Column name must be less than 64 characters"),type:_r([fD,C()]),defaultValue:C().optional(),isPrimaryKey:It().optional(),isNullable:It(),isUnique:It(),foreignKey:mM.optional()}),vM=G({tableName:C().min(1,"Table name cannot be empty").max(64,"Table name must be less than 64 characters"),columns:Oe(gM).min(1,"At least one column is required"),recordCount:Te().optional(),createdAt:C().optional(),updatedAt:C().optional()}),hD=G({functionName:C(),functionDef:C(),kind:C()}),pD=G({tableName:C(),indexName:C(),indexDef:C(),isUnique:It().nullable(),isPrimary:It().nullable()}),mD=G({tableName:C(),policyName:C(),cmd:C(),roles:Oe(C()),qual:C().nullable(),withCheck:C().nullable()}),gD=G({tableName:C(),triggerName:C(),actionTiming:C(),eventManipulation:C(),actionOrientation:C(),actionCondition:C().nullable(),actionStatement:C()});vM.pick({tableName:!0,columns:!0}).extend({rlsEnabled:It().default(!0)});vM.pick({tableName:!0,columns:!0}).extend({message:C(),autoFields:Oe(C()),nextActions:C()});G({addColumns:Oe(gM.omit({foreignKey:!0})).optional(),dropColumns:Oe(C()).optional(),updateColumns:Oe(G({columnName:C(),defaultValue:C().optional(),newColumnName:C().min(1,"New column name cannot be empty").max(64,"New column name must be less than 64 characters").optional()})).optional(),addForeignKeys:Oe(G({columnName:C().min(1,"Column name is required for adding foreign key"),foreignKey:mM})).optional(),dropForeignKeys:Oe(C()).optional(),renameTable:G({newTableName:C().min(1,"New table name cannot be empty").max(64,"New table name must be less than 64 characters")}).optional()});G({message:C(),tableName:C(),operations:Oe(C())});G({message:C(),tableName:C(),nextActions:C()});G({query:C().min(1,"Query is required"),params:Oe(Ei()).optional()});G({rows:Oe(Dn(C(),Ei())),rowCount:Te().nullable(),fields:Oe(G({name:C(),dataTypeID:Te()})).optional()});G({tables:Oe(C()).optional(),format:cn(["sql","json"]).default("sql"),includeData:It().default(!0),includeFunctions:It().default(!1),includeSequences:It().default(!1),includeViews:It().default(!1),rowLimit:Te().int().positive().max(1e4).default(1e3)});const vD=G({timestamp:C(),tables:Dn(C(),G({schema:Oe(G({columnName:C(),dataType:C(),characterMaximumLength:Te().nullable(),isNullable:C(),columnDefault:C().nullable()})),indexes:Oe(G({indexname:C(),indexdef:C(),isUnique:It().nullable(),isPrimary:It().nullable()})),foreignKeys:Oe(G({constraintName:C(),columnName:C(),foreignTableName:C(),foreignColumnName:C(),deleteRule:C().nullable(),updateRule:C().nullable()})),rlsEnabled:It().optional(),policies:Oe(G({policyname:C(),cmd:C(),roles:Oe(C()),qual:C().nullable(),withCheck:C().nullable()})),triggers:Oe(G({triggerName:C(),actionTiming:C(),eventManipulation:C(),actionOrientation:C(),actionCondition:C().nullable(),actionStatement:C(),newTable:C().nullable(),oldTable:C().nullable()})),rows:Oe(Dn(C(),Ei())).optional(),recordCount:Te().optional()})),functions:Oe(G({functionName:C(),functionDef:C(),kind:C()})),sequences:Oe(G({sequenceName:C(),startValue:C(),increment:C(),minValue:C().nullable(),maxValue:C().nullable(),cycle:C()})),views:Oe(G({viewName:C(),definition:C()}))});G({format:cn(["sql","json"]),data:_r([C(),vD]),timestamp:C()});G({truncate:_r([It(),C().transform(t=>{if(t==="true")return!0;if(t==="false")return!1;throw new Error("Invalid boolean string")})]).default(!1)});G({success:It(),message:C(),filename:C(),tables:Oe(C()),rowsImported:Te(),fileSize:Te()});G({table:C().min(1,"Table name is required"),upsertKey:C().optional()});G({success:It(),message:C(),table:C(),rowsAffected:Te(),totalRecords:Te(),filename:C()});G({functions:Oe(hD)});G({indexes:Oe(pD)});G({policies:Oe(mD)});G({triggers:Oe(gD)});const yD=G({id:C(),key:C(),isActive:It(),isReserved:It(),lastUsedAt:C().nullable(),expiresAt:C().nullable(),createdAt:C(),updatedAt:C()});G({secrets:Oe(yD)});G({key:C(),value:C()});G({key:C().regex(/^[A-Z0-9_]+$/,"Use uppercase letters, numbers, and underscores only"),value:C().min(1,"Value is required")});G({success:Yt(!0),message:C(),id:C()});G({success:Yt(!0),message:C()});G({success:Yt(!0),message:C()});const _D=G({key:C(),bucket:C(),size:Te(),mimeType:C().optional(),uploadedAt:C(),url:C()}),xD=G({name:C(),public:It(),createdAt:C()});G({id:C().uuid(),maxFileSizeMb:Te().int().positive(),createdAt:C(),updatedAt:C()});G({bucketName:C().min(1,"Bucket name cannot be empty"),isPublic:It().default(!0)});G({isPublic:It()});G({objects:Oe(_D),pagination:G({offset:Te(),limit:Te(),total:Te()})});G({filename:C().min(1,"Filename cannot be empty"),contentType:C().optional(),size:Te().optional()});G({method:cn(["presigned","direct"]),uploadUrl:C(),fields:Dn(C()).optional(),key:C(),confirmRequired:It(),confirmUrl:C().optional(),expiresAt:Wv().optional()});G({expiresIn:Te().optional().default(3600)});G({method:cn(["presigned","direct"]),url:C(),expiresAt:Wv().optional(),headers:Dn(C()).optional()});G({size:Te(),contentType:C().optional(),etag:C().optional()});G({maxFileSizeMb:Te().int().min(1,"Must be at least 1 MB").max(200,"Must be at most 200 MB")});const wh=C().uuid("Invalid user ID format"),as=C().email("Invalid email format").toLowerCase().trim(),jv=C(),bD=C().min(1,"Name is required").max(100,"Name must be less than 100 characters").trim(),SD=cn(["anon","authenticated","project_admin"]),hS=cn(["code","link"]),yM=G({name:C().optional(),avatar_url:C().url().optional()}).passthrough(),Wl=G({id:wh,email:as,emailVerified:It(),providers:Oe(C()).optional(),createdAt:C(),updatedAt:C(),profile:yM.nullable(),metadata:Dn(Ei()).nullable()}),Eh=cn(["google","github","discord","linkedin","facebook","instagram","tiktok","apple","x","spotify","microsoft"]);G({provider:Eh,redirectUri:C().url().optional()});const $v=G({id:C().uuid(),provider:Eh,clientId:C().optional(),scopes:Oe(C()).optional(),redirectUri:C().optional(),useSharedKey:It(),createdAt:C(),updatedAt:C()}),wD=/^(?:(?:https?:\/\/)(?:(?:\*\.)?[^\s/:?#]+|\[[0-9A-Fa-f:.]+\])(?::\d+)?(?:\/[^\s]*)?|(?!(?:https?|javascript|data|file|vbscript):)[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/[^\s/]+(?:\/[^\s]*)?|\/[^\s]*))$/i,_M=G({id:C().uuid(),requireEmailVerification:It(),passwordMinLength:Te().min(4).max(128),requireNumber:It(),requireLowercase:It(),requireUppercase:It(),requireSpecialChar:It(),verifyEmailMethod:hS,resetPasswordMethod:hS,allowedRedirectUrls:Oe(C().regex(wD,{message:"Invalid URL or wildcard URL"})).optional().nullable(),createdAt:C(),updatedAt:C()});G({sub:wh,email:as,role:SD,iat:Te().optional(),exp:Te().optional()});const xM=C().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Key must contain only lowercase letters, numbers, hyphens, and underscores"),Xv=G({id:C().uuid(),key:xM,name:C().min(1),discoveryEndpoint:C().url(),clientId:C().min(1),createdAt:C(),updatedAt:C()}),ED=G({limit:C().optional(),offset:C().optional()});G({email:as,password:jv,name:bD.optional(),redirectTo:C().url().optional()});G({email:as,password:jv});G({refreshToken:C().min(1,"refreshToken is required")});G({code:C()});ED.extend({search:C().optional()}).optional();G({userIds:Oe(wh).min(1,"At least one user ID is required")});G({profile:Dn(Ei())});G({email:as,redirectTo:C().url().optional()});G({email:as,otp:C().regex(/^\d{6}$/,"OTP code must be a 6-digit numeric code")});G({email:as,redirectTo:C().url().optional()});G({email:as,code:C().regex(/^\d{6}$/,"Reset password code must be a 6-digit numeric code")});G({newPassword:jv,otp:C().min(1,"OTP/token is required")});G({user:Wl.optional(),accessToken:C().nullable(),requireEmailVerification:It().optional(),csrfToken:C().nullable().optional(),refreshToken:C().optional()});G({user:Wl,accessToken:C(),csrfToken:C().nullable().optional(),refreshToken:C().optional()});G({user:Wl,accessToken:C(),csrfToken:C().nullable().optional(),refreshToken:C().optional()});G({accessToken:C(),user:Wl,csrfToken:C().optional(),refreshToken:C().optional()});G({token:C(),expiresAt:C().datetime()});G({message:C()});G({user:Wl});G({id:wh,profile:yM.nullable()});G({data:Oe(Wl),pagination:G({offset:Te(),limit:Te(),total:Te()})});G({message:C(),deletedCount:Te().int().nonnegative()});G({authUrl:C().url()});$v.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:C().optional()});$v.omit({id:!0,provider:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:C().optional()}).partial();const bM=/^[A-Za-z0-9._~-]+$/;G({redirect_uri:C().url().optional(),code_challenge:C().min(43,"Code challenge must be at least 43 characters").max(128,"Code challenge must be at most 128 characters").regex(bM,"Code challenge must be base64url encoded")});G({code:C().min(1,"Exchange code is required"),code_verifier:C().min(43,"Code verifier must be at least 43 characters").max(128,"Code verifier must be at most 128 characters").regex(bM,"Code verifier must be base64url encoded")});G({data:Oe($v),count:Te()});_M.omit({id:!0,createdAt:!0,updatedAt:!0}).partial();const MD=G({oAuthProviders:Oe(Eh),customOAuthProviders:Oe(xM),..._M.omit({id:!0,updatedAt:!0,createdAt:!0,allowedRedirectUrls:!0}).shape});G({error:C(),message:C(),statusCode:Te().int(),nextActions:C().optional()});Xv.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:C().min(1,"Client secret is required")});Xv.omit({id:!0,key:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:C().min(1).optional()}).partial();G({data:Oe(Xv),count:Te()});const SM=cn(["system","user"]),wM=G({id:C().uuid(),pattern:C().min(1),description:C().nullable(),webhookUrls:Oe(C().url()).nullable(),enabled:It(),createdAt:C().datetime(),updatedAt:C().datetime()}),TD=G({id:C().uuid(),eventName:C().min(1),channelId:C().uuid().nullable(),channelName:C().min(1),payload:Dn(C(),Ei()),senderType:SM,senderId:C().uuid().nullable(),wsAudienceCount:Te().int().min(0),whAudienceCount:Te().int().min(0),whDeliveredCount:Te().int().min(0),createdAt:C().datetime()}),AD=G({retentionDays:Te().int().positive().nullable()});G({channel:C().min(1)});G({channel:C().min(1)});G({channel:C().min(1),event:C().min(1),payload:Dn(C(),Ei())});pM("ok",[G({ok:Yt(!0),channel:C().min(1)}),G({ok:Yt(!1),channel:C().min(1),error:G({code:C().min(1),message:C().min(1)})})]);G({channel:C().optional(),code:C().min(1),message:C().min(1)});G({messageId:C().uuid(),channel:C().min(1),eventName:C().min(1),payload:Dn(C(),Ei())});const CD=G({channel:C().optional(),messageId:C().uuid(),senderType:SM,senderId:C().uuid().optional(),timestamp:C().datetime()});G({meta:CD}).passthrough();G({pattern:C().min(1,"Channel pattern is required"),description:C().optional(),webhookUrls:Oe(C().url()).optional(),enabled:It().optional().default(!0)});G({pattern:C().min(1).optional(),description:C().optional(),webhookUrls:Oe(C().url()).optional(),enabled:It().optional()});Oe(wM);G({message:C()});G({channelId:C().uuid().optional(),eventName:C().optional(),limit:Kg.number().int().min(1).max(1e3).optional().default(100),offset:Kg.number().int().min(0).optional().default(0)});Oe(TD);G({channelId:C().uuid().optional(),since:Kg.date().optional()});G({totalMessages:Te().int().min(0),whDeliveryRate:Te().min(0).max(1),topEvents:Oe(G({eventName:C(),count:Te().int().min(0)})),retentionDays:AD.shape.retentionDays});const pS=G({policyName:C(),tableName:C(),command:C(),roles:Oe(C()),using:C().nullable(),withCheck:C().nullable()}),RD=G({subscribe:G({policies:Oe(pS)}),publish:G({policies:Oe(pS)})}),PD=MD,kD=G({tables:Oe(G({tableName:C(),recordCount:Te()})),totalSizeInGB:Te(),hint:C().optional()}),LD=xD.extend({objectCount:Te().optional()}),DD=G({buckets:Oe(LD),totalSizeInGB:Te()}),ND=G({slug:C(),name:C(),description:C().nullable(),status:C()}),ID=G({models:Oe(G({inputModality:Oe(C()),outputModality:Oe(C()),modelId:C()}))}),UD=G({channels:Oe(wM),permissions:RD});G({auth:PD,database:kD,storage:DD,aiIntegration:ID.optional(),functions:Oe(ND),realtime:UD.optional(),version:C().optional()});const FD=G({host:C(),port:Te(),database:C(),user:C(),password:C(),sslmode:C()});G({connectionURL:C(),parameters:FD});G({databasePassword:C()});G({apiKey:C()});G({projectId:C().nullable()});const Nl=cn(["text","image","audio"]),OD=G({inputModality:Oe(Nl).min(1),outputModality:Oe(Nl).min(1),provider:C(),modelId:C(),systemPrompt:C().optional()}),EM=OD.extend({id:C().uuid()});EM.extend({usageStats:G({totalInputTokens:Te(),totalOutputTokens:Te(),totalTokens:Te(),totalImageCount:Te(),totalRequests:Te()}).optional()});const BD=G({configId:C().uuid(),inputTokens:Te().int().optional(),outputTokens:Te().int().optional(),imageCount:Te().int().optional(),imageResolution:C().optional()}),zD=BD.extend({id:C().uuid(),createdAt:Wv(),modelId:C().nullable().optional(),model:C().nullable(),provider:C().nullable(),inputModality:Oe(Nl).nullable(),outputModality:Oe(Nl).nullable()});G({totalInputTokens:Te(),totalOutputTokens:Te(),totalTokens:Te(),totalImageCount:Te(),totalRequests:Te()});const VD=G({type:Yt("text"),text:C()}),HD=G({type:Yt("image_url"),image_url:G({url:C(),detail:cn(["auto","low","high"]).optional()})}),GD=G({type:Yt("input_audio"),input_audio:G({data:C(),format:cn(["wav","mp3","aiff","aac","ogg","flac","m4a"])})}),WD=G({type:Yt("file"),file:G({filename:C(),file_data:C()})}),jD=_r([VD,HD,GD,WD]),$D=G({name:C(),description:C().optional(),parameters:Dn(Ei()).optional()}),XD=G({type:Yt("function"),function:$D}),qD=_r([cn(["auto","none","required"]),G({type:Yt("function"),function:G({name:C()})})]),MM=G({id:C(),type:Yt("function"),function:G({name:C(),arguments:C()})}),YD=G({role:cn(["user","assistant","system","tool"]),content:_r([C(),Oe(jD)]).nullable(),images:Oe(G({url:C()})).optional(),tool_calls:Oe(MM).optional(),tool_call_id:C().optional()}),KD=G({enabled:It(),engine:cn(["native","exa"]).optional(),maxResults:Te().min(1).max(10).optional(),searchPrompt:C().optional()}),ZD=G({enabled:It(),pdf:G({engine:cn(["pdf-text","mistral-ocr","native"]).optional()}).optional()});G({model:C(),messages:Oe(YD),temperature:Te().min(0).max(2).optional(),maxTokens:Te().positive().optional(),topP:Te().min(0).max(1).optional(),stream:It().optional(),webSearch:KD.optional(),fileParser:ZD.optional(),thinking:It().optional(),tools:Oe(XD).optional(),toolChoice:qD.optional(),parallelToolCalls:It().optional()});const JD=G({type:Yt("url_citation"),urlCitation:G({url:C(),title:C().optional(),content:C().optional(),startIndex:Te().optional(),endIndex:Te().optional()})}),QD=G({type:Yt("file"),file:G({filename:C(),parsedContent:C().optional(),metadata:Dn(Ei()).optional()})}),e3=_r([JD,QD]);G({text:C(),tool_calls:Oe(MM).optional(),annotations:Oe(e3).optional(),metadata:G({model:C(),usage:G({promptTokens:Te().optional(),completionTokens:Te().optional(),totalTokens:Te().optional()}).optional()}).optional()});G({model:C(),input:_r([C(),Oe(C())]),encoding_format:cn(["float","base64"]).optional(),dimensions:Te().int().min(0).optional()});const t3=G({object:Yt("embedding"),embedding:_r([Oe(Te()),C()]),index:Te()});G({object:Yt("list"),data:Oe(t3),metadata:G({model:C(),usage:G({promptTokens:Te().optional(),totalTokens:Te().optional()}).optional()}).optional()});G({model:C(),prompt:C(),images:Oe(G({url:C()})).optional()});G({text:C().optional(),images:Oe(G({type:Yt("imageUrl"),imageUrl:C()})),metadata:G({model:C(),usage:G({promptTokens:Te().optional(),completionTokens:Te().optional(),totalTokens:Te().optional()}).optional()}).optional()});G({id:C(),inputModality:Oe(Nl).min(1),outputModality:Oe(Nl).min(1),provider:C(),modelId:C(),inputPrice:Te().min(0).optional(),outputPrice:Te().min(0).optional()});EM.omit({id:!0});G({systemPrompt:C().nullable()});G({records:Oe(zD),total:Te()});G({startDate:C().datetime().optional(),endDate:C().datetime().optional(),limit:C().regex(/^\d+$/).default("50"),offset:C().regex(/^\d+$/).default("0")});G({configId:C().uuid().optional(),startDate:C().datetime().optional(),endDate:C().datetime().optional()});const n3=cn(["byok","cloud","env","unconfigured"]);G({keySource:n3,hasByokKey:It(),maskedKey:C().optional()});G({apiKey:C().min(1,"API key is required")});const TM=G({id:C(),actor:C(),action:C(),module:C(),details:Dn(Ei()).nullable(),ipAddress:C().nullable(),createdAt:C(),updatedAt:C()});G({id:C(),name:C(),token:C()});const i3=G({id:C(),eventMessage:C(),timestamp:C(),body:Dn(C(),Ei()),source:C().optional()});G({source:C(),count:Te(),lastActivity:C()});const r3=G({level:C(),message:C()});G({deploymentId:C(),status:cn(["pending","success","failed"]),logs:Oe(r3),createdAt:C()});G({limit:Te().default(100),offset:Te().default(0),actor:C().optional(),action:C().optional(),module:C().optional(),startDate:C().optional(),endDate:C().optional()});G({data:Oe(TM),pagination:G({limit:Te(),offset:Te(),total:Te()})});G({days:Te().default(7)});G({totalLogs:Te(),uniqueActors:Te(),uniqueModules:Te(),actionsByModule:Dn(Te()),recentActivity:Oe(TM)});G({daysToKeep:Te().default(90)});G({message:C(),deleted:Te()});G({logs:Oe(i3),total:Te()});const AM=G({id:C(),slug:C(),name:C(),description:C().nullable(),code:C(),status:cn(["draft","active","error"]),createdAt:C(),updatedAt:C(),deployedAt:C().nullable()});G({name:C().min(1,"Name is required"),slug:C().regex(/^[a-zA-Z0-9_-]+$/,"Invalid slug format - must be alphanumeric with hyphens or underscores only").optional(),code:C().min(1),description:C().optional(),status:cn(["draft","active"]).optional().default("active")});G({name:C().optional(),code:C().optional(),description:C().optional(),status:cn(["draft","active"]).optional()});G({functions:Oe(AM),runtime:G({status:cn(["running","unavailable"])}),deploymentUrl:C().nullable().optional()});const s3=G({id:C(),status:cn(["success","failed"]),url:C().nullable(),buildLogs:Oe(C()).optional()});G({success:It(),function:AM,deployment:s3.nullable().optional()});const a3=G({type:Yt("APP_ROUTE_CHANGE"),path:C()}),o3=G({type:Yt("AUTH_SUCCESS")}),l3=G({type:Yt("AUTH_ERROR"),message:C()}),c3=G({type:Yt("MCP_CONNECTION_STATUS"),connected:It(),toolName:C(),timestamp:_r([Te(),C()])}),u3=G({type:Yt("SHOW_ONBOARDING_OVERLAY")}),d3=G({type:Yt("SHOW_SETTINGS_OVERLAY")}),f3=G({type:Yt("ONBOARDING_SUCCESS")}),h3=G({type:Yt("NAVIGATE_TO_USAGE")}),p3=G({type:Yt("SHOW_CONTACT_MODAL")}),m3=G({type:Yt("SHOW_CONNECT_OVERLAY")}),g3=G({type:Yt("SHOW_PLAN_MODAL")}),v3=G({type:Yt("AUTHORIZATION_CODE"),code:C()}),y3=G({type:Yt("ROUTE_CHANGE"),path:C()}),_3=G({type:Yt("REQUEST_PROJECT_INFO")}),x3=G({type:Yt("PROJECT_INFO"),name:C(),instanceType:C(),region:C(),latestVersion:C().optional()}),b3=G({type:Yt("REQUEST_INSTANCE_INFO")}),S3=G({type:Yt("INSTANCE_INFO"),currentInstanceType:C(),planName:C(),computeCredits:Te(),currentOrgComputeCost:Te(),instanceTypes:Oe(G({id:C(),name:C(),cpu:C(),ram:C(),pricePerHour:Te(),pricePerMonth:Te()})),projects:Oe(G({name:C(),instanceType:C(),monthlyCost:Te(),isCurrent:It(),status:C()}))}),w3=G({type:Yt("REQUEST_INSTANCE_TYPE_CHANGE"),instanceType:C()}),E3=G({type:Yt("INSTANCE_TYPE_CHANGE_RESULT"),success:It(),instanceType:C().optional(),error:C().optional()});pM("type",[a3,o3,l3,c3,u3,d3,f3,h3,p3,m3,g3,v3,y3,_3,x3,b3,S3,w3,E3]);cn(["db","storage","functions","auth","ai","realtime"]).describe(`
|
|
13
13
|
SDK feature categories:
|
|
@@ -505,7 +505,7 @@ live_sniffer.event.capture,ui,LiveSniffer,LiveSniffer,event,"> CAPTURE: +128 NEU
|
|
|
505
505
|
${M}px !important;
|
|
506
506
|
${A}px !important;
|
|
507
507
|
}
|
|
508
|
-
`),()=>{c.current?.removeAttribute("data-motion-pop-id"),D.contains(T)&&D.removeChild(T)}},[e]),B.jsx(C4,{isPresent:e,childRef:c,sizeRef:u,pop:s,children:s===!1?t:N.cloneElement(t,{ref:p})})}const P4=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o,anchorX:c,anchorY:u,root:f})=>{const h=uy(k4),p=N.useId();let m=!0,v=N.useMemo(()=>(m=!1,{id:p,initial:e,isPresent:n,custom:r,onExitComplete:_=>{h.set(_,!0);for(const w of h.values())if(!w)return;i&&i()},register:_=>(h.set(_,!1),()=>h.delete(_))}),[n,h,i]);return s&&m&&(v={...v}),N.useMemo(()=>{h.forEach((_,w)=>h.set(w,!1))},[n]),N.useEffect(()=>{!n&&!h.size&&i&&i()},[n]),t=B.jsx(R4,{pop:o==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:f,children:t}),B.jsx(Rh.Provider,{value:v,children:t})};function k4(){return new Map}function JA(t=!0){const e=N.useContext(Rh);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,s=N.useId();N.useEffect(()=>{if(t)return r(s)},[t]);const o=N.useCallback(()=>t&&i&&i(s),[s,i,t]);return!n&&i?[!1,o]:[!0]}const Wd=t=>t.key||"";function Hw(t){const e=[];return N.Children.forEach(t,n=>{N.isValidElement(n)&&e.push(n)}),e}const QA=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1,anchorX:c="left",anchorY:u="top",root:f})=>{const[h,p]=JA(o),m=N.useMemo(()=>Hw(t),[t]),v=o&&!h?[]:m.map(Wd),_=N.useRef(!0),w=N.useRef(m),y=uy(()=>new Map),x=N.useRef(new Set),[M,A]=N.useState(m),[T,D]=N.useState(m);MT(()=>{_.current=!1,w.current=m;for(let S=0;S<T.length;S++){const R=Wd(T[S]);v.includes(R)?(y.delete(R),x.current.delete(R)):y.get(R)!==!0&&y.set(R,!1)}},[T,v.length,v.join("-")]);const I=[];if(m!==M){let S=[...m];for(let R=0;R<T.length;R++){const H=T[R],F=Wd(H);v.includes(F)||(S.splice(R,0,H),I.push(H))}return s==="wait"&&I.length&&(S=I),D(Hw(S)),A(m),null}const{forceRender:U}=N.useContext(cy);return B.jsx(B.Fragment,{children:T.map(S=>{const R=Wd(S),H=o&&!h?!1:m===T||v.includes(R),F=()=>{if(x.current.has(R))return;if(y.has(R))x.current.add(R),y.set(R,!0);else return;let W=!0;y.forEach(X=>{X||(W=!1)}),W&&(U?.(),D(w.current),o&&p?.(),i&&i())};return B.jsx(P4,{isPresent:H,initial:!_.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:s,root:f,onExitComplete:H?void 0:F,anchorX:c,anchorY:u,children:S},R)})})},eC=N.createContext({strict:!1}),Gw={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ww=!1;function L4(){if(Ww)return;const t={};for(const e in Gw)t[e]={isEnabled:n=>Gw[e].some(i=>!!n[i])};CA(t),Ww=!0}function tC(){return L4(),gB()}function D4(t){const e=tC();for(const n in t)e[n]={...e[n],...t[n]};CA(e)}const N4=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function fh(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||N4.has(t)}let nC=t=>!fh(t);function I4(t){typeof t=="function"&&(nC=e=>e.startsWith("on")?!fh(e):t(e))}try{I4(require("@emotion/is-prop-valid").default)}catch{}function U4(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||hi(t[r])||(nC(r)||n===!0&&fh(r)||!e&&!fh(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const Dh=N.createContext({});function F4(t,e){if(Lh(t)){const{initial:n,animate:i}=t;return{initial:n===!1||pu(n)?n:void 0,animate:pu(i)?i:void 0}}return t.inherit!==!1?e:{}}function O4(t){const{initial:e,animate:n}=F4(t,N.useContext(Dh));return N.useMemo(()=>({initial:e,animate:n}),[jw(e),jw(n)])}function jw(t){return Array.isArray(t)?t.join(" "):t}const Fy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function iC(t,e,n){for(const i in e)!hi(e[i])&&!IA(i,n)&&(t[i]=e[i])}function B4({transformTemplate:t},e){return N.useMemo(()=>{const n=Fy();return Ny(n,e,t),Object.assign({},n.vars,n.style)},[e])}function z4(t,e){const n=t.style||{},i={};return iC(i,n,t),Object.assign(i,B4(t,e)),i}function V4(t,e){const n={},i=z4(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const rC=()=>({...Fy(),attrs:{}});function H4(t,e,n,i){const r=N.useMemo(()=>{const s=rC();return UA(s,e,OA(i),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};iC(s,t.style,t),r.style={...s,...r.style}}return r}const G4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Oy(t){return typeof t!="string"||t.includes("-")?!1:!!(G4.indexOf(t)>-1||/[A-Z]/u.test(t))}function W4(t,e,n,{latestValues:i},r,s=!1,o){const u=(o??Oy(t)?H4:V4)(e,i,r,t),f=U4(e,typeof t=="string",s),h=t!==N.Fragment?{...f,...u,ref:n}:{},{children:p}=e,m=N.useMemo(()=>hi(p)?p.get():p,[p]);return N.createElement(t,{...h,children:m})}function j4({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:$4(n,i,r,t),renderState:e()}}function $4(t,e,n,i){const r={},s=i(t,{});for(const m in s)r[m]=If(s[m]);let{initial:o,animate:c}=t;const u=Lh(t),f=TA(t);e&&f&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),c===void 0&&(c=e.animate));let h=n?n.initial===!1:!1;h=h||o===!1;const p=h?c:o;if(p&&typeof p!="boolean"&&!kh(p)){const m=Array.isArray(p)?p:[p];for(let v=0;v<m.length;v++){const _=My(t,m[v]);if(_){const{transitionEnd:w,transition:y,...x}=_;for(const M in x){let A=x[M];if(Array.isArray(A)){const T=h?A.length-1:0;A=A[T]}A!==null&&(r[M]=A)}for(const M in w)r[M]=w[M]}}}return r}const sC=t=>(e,n)=>{const i=N.useContext(Dh),r=N.useContext(Rh),s=()=>j4(t,e,i,r);return n?s():uy(s)},X4=sC({scrapeMotionValuesFromProps:Iy,createRenderState:Fy}),q4=sC({scrapeMotionValuesFromProps:BA,createRenderState:rC}),Y4=Symbol.for("motionComponentSymbol");function K4(t,e,n){const i=N.useRef(n);N.useInsertionEffect(()=>{i.current=n});const r=N.useRef(null);return N.useCallback(s=>{s&&t.onMount?.(s);const o=i.current;if(typeof o=="function")if(s){const c=o(s);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(s);else o&&(o.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const aC=N.createContext({});function Sl(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Z4(t,e,n,i,r,s){const{visualElement:o}=N.useContext(Dh),c=N.useContext(eC),u=N.useContext(Rh),f=N.useContext(Uy),h=f.reducedMotion,p=f.skipAnimations,m=N.useRef(null),v=N.useRef(!1);i=i||c.renderer,!m.current&&i&&(m.current=i(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:s}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const _=m.current,w=N.useContext(aC);_&&!_.projection&&r&&(_.type==="html"||_.type==="svg")&&J4(m.current,n,r,w);const y=N.useRef(!1);N.useInsertionEffect(()=>{_&&y.current&&_.update(n,u)});const x=n[hA],M=N.useRef(!!x&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return MT(()=>{v.current=!0,_&&(y.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),M.current&&_.animationState&&_.animationState.animateChanges())}),N.useEffect(()=>{_&&(!M.current&&_.animationState&&_.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),M.current=!1),_.enteringChildren=void 0)}),_}function J4(t,e,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:c,layoutScroll:u,layoutRoot:f,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:oC(t.parent)),t.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||c&&Sl(c),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:u,layoutRoot:f,layoutAnchor:h})}function oC(t){if(t)return t.options.allowProjection!==!1?t.projection:oC(t.parent)}function Xm(t,{forwardMotionProps:e=!1,type:n}={},i,r){i&&D4(i);const s=n?n==="svg":Oy(t),o=s?q4:X4;function c(f,h){let p;const m={...N.useContext(Uy),...f,layoutId:Q4(f)},{isStatic:v}=m,_=O4(f),w=o(f,v);if(!v&&typeof window<"u"){ez();const y=tz(m);p=y.MeasureLayout,_.visualElement=Z4(t,w,m,r,y.ProjectionNode,s)}return B.jsxs(Dh.Provider,{value:_,children:[p&&_.visualElement?B.jsx(p,{visualElement:_.visualElement,...m}):null,W4(t,f,K4(w,_.visualElement,h),w,v,e,s)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=N.forwardRef(c);return u[Y4]=t,u}function Q4({layoutId:t}){const e=N.useContext(cy).id;return e&&t!==void 0?e+"-"+t:t}function ez(t,e){N.useContext(eC).strict}function tz(t){const e=tC(),{drag:n,layout:i}=e;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function nz(t,e){if(typeof Proxy>"u")return Xm;const n=new Map,i=(s,o)=>Xm(s,o,t,e),r=(s,o)=>i(s,o);return new Proxy(r,{get:(s,o)=>o==="create"?i:(n.has(o)||n.set(o,Xm(o,void 0,t,e)),n.get(o))})}const iz=(t,e)=>e.isSVG??Oy(t)?new DB(e):new AB(e,{allowProjection:t!==N.Fragment});class rz extends ka{constructor(e){super(e),e.animationState||(e.animationState=OB(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();kh(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let sz=0;class az extends ka{constructor(){super(...arguments),this.id=sz++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:s,custom:o}=this.node.getProps();if(typeof s=="string"){const c=mo(this.node,s,o);if(c){const{transition:u,transitionEnd:f,...h}=c;for(const p in h)this.node.getValue(p)?.jump(h[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const oz={animation:{Feature:rz},exit:{Feature:az}};function Cu(t){return{point:{x:t.pageX,y:t.pageY}}}const lz=t=>e=>Ry(e)&&t(e,Cu(e));function au(t,e,n,i){return mu(t,e,lz(n),i)}const lC=({current:t})=>t?t.ownerDocument.defaultView:null,$w=(t,e)=>Math.abs(t-e);function cz(t,e){const n=$w(t.x,e.x),i=$w(t.y,e.y);return Math.sqrt(n**2+i**2)}const Xw=new Set(["auto","scroll"]);class cC{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=jd(this.lastRawMoveEventInfo,this.transformPagePoint));const v=qm(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,w=cz(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!w)return;const{point:y}=v,{timestamp:x}=fi;this.history.push({...y,timestamp:x});const{onStart:M,onMove:A}=this.handlers;_||(M&&M(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,v)},this.handlePointerMove=(v,_)=>{this.lastMoveEvent=v,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=jd(_,this.transformPagePoint),Tn.update(this.updatePoint,!0)},this.handlePointerUp=(v,_)=>{this.end();const{onEnd:w,onSessionEnd:y,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=qm(v.type==="pointercancel"?this.lastMoveEventInfo:jd(_,this.transformPagePoint),this.history);this.startEvent&&w&&w(v,M),y&&y(v,M)},!Ry(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=r||window;const u=Cu(e),f=jd(u,this.transformPagePoint),{point:h}=f,{timestamp:p}=fi;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,qm(f,this.history)),this.removeListeners=Mu(au(this.contextWindow,"pointermove",this.handlePointerMove),au(this.contextWindow,"pointerup",this.handlePointerUp),au(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(Xw.has(i.overflowX)||Xw.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-n.x,y:r.y-n.y};s.x===0&&s.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),Tn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ra(this.updatePoint)}}function jd(t,e){return e?{point:e(t.point)}:t}function qw(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qm({point:t},e){return{point:t,delta:qw(t,uC(e)),offset:qw(t,uz(e)),velocity:dz(e,.1)}}function uz(t){return t[0]}function uC(t){return t[t.length-1]}function dz(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=uC(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>Qi(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&r.timestamp-i.timestamp>Qi(e)*2&&(i=t[1]);const s=hr(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function fz(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?Pn(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?Pn(n,t,i.max):Math.min(t,n)),t}function Yw(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function hz(t,{top:e,left:n,bottom:i,right:r}){return{x:Yw(t.x,n,r),y:Yw(t.y,e,i)}}function Kw(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function pz(t,e){return{x:Kw(t.x,e.x),y:Kw(t.y,e.y)}}function mz(t,e){let n=.5;const i=Pi(t),r=Pi(e);return r>i?n=fu(e.min,e.max-i,t.min):i>r&&(n=fu(t.min,t.max-r,e.min)),ls(0,1,n)}function gz(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const k0=.35;function vz(t=k0){return t===!1?t=0:t===!0&&(t=k0),{x:Zw(t,"left","right"),y:Zw(t,"top","bottom")}}function Zw(t,e,n){return{min:Jw(t,e),max:Jw(t,n)}}function Jw(t,e){return typeof t=="number"?t:t[e]||0}const yz=new WeakMap;class _z{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ei(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=p=>{n&&this.snapToCursor(Cu(p).point),this.stopAnimation()},o=(p,m)=>{const{drag:v,dragPropagation:_,onDragStart:w}=this.getProps();if(v&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=XO(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qr(x=>{let M=this.getAxisMotionValue(x).get()||0;if(ts.test(M)){const{projection:A}=this.visualElement;if(A&&A.layout){const T=A.layout.layoutBox[x];T&&(M=Pi(T)*(parseFloat(M)/100))}}this.originPoint[x]=M}),w&&Tn.update(()=>w(p,m),!1,!0),w0(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:_,onDirectionLock:w,onDrag:y}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:x}=m;if(_&&this.currentDirection===null){this.currentDirection=bz(x),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,x),this.updateAxis("y",m.point,x),this.visualElement.render(),y&&Tn.update(()=>y(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new cC(e,{onSessionStart:s,onStart:o,onMove:c,onSessionEnd:u,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:lC(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!i)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:c}=this.getProps();c&&Tn.postRender(()=>c(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!$d(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=fz(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Sl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=hz(i.layoutBox,e):this.constraints=!1,this.elastic=vz(n),r!==this.constraints&&!Sl(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&qr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=gz(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Sl(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=bB(i,r.root,this.visualElement.getTransformPagePoint());let o=pz(r.layout.layoutBox,s);if(n){const c=n(yB(o));this.hasMutatedConstraints=!!c,c&&(o=PA(c))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},f=qr(h=>{if(!$d(h,n,this.currentDirection))return;let p=u&&u[h]||{};(o===!0||o===h)&&(p={min:0,max:0});const m=r?200:1e6,v=r?40:1e7,_={type:"inertia",velocity:i?e[h]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(h,_)});return Promise.all(f).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return w0(this.visualElement,e),i.start(Ey(e,i,0,n,this.visualElement,!1))}stopAnimation(){qr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){qr(n=>{const{drag:i}=this.getProps();if(!$d(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:c}=r.layout.layoutBox[n],u=s.get()||0;s.set(e[n]-Pn(o,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Sl(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};qr(o=>{const c=this.getAxisMotionValue(o);if(c&&this.constraints!==!1){const u=c.get();r[o]=mz({min:u,max:u},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),qr(o=>{if(!$d(o,e,null))return;const c=this.getAxisMotionValue(o),{min:u,max:f}=this.constraints[o];c.set(Pn(u,f,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;yz.set(this.visualElement,this);const e=this.visualElement.current,n=au(e,"pointerdown",f=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=f.target,v=m!==e&&QO(m);h&&p&&!v&&this.start(f)});let i;const r=()=>{const{dragConstraints:f}=this.getProps();Sl(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),i||(i=xz(e,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Tn.read(r);const c=mu(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:h})=>{this.isDragging&&h&&(qr(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=f[p].translate,m.set(m.get()+f[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),o(),u&&u(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=k0,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:c}}}function Qw(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function xz(t,e,n){const i=aw(t,Qw(n)),r=aw(e,Qw(n));return()=>{i(),r()}}function $d(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function bz(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Sz extends ka{constructor(e){super(e),this.removeGroupControls=pr,this.removeListeners=pr,this.controls=new _z(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pr}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ym=t=>(e,n)=>{t&&Tn.update(()=>t(e,n),!1,!0)};class wz extends ka{constructor(){super(...arguments),this.removePointerDownListener=pr}onPointerDown(e){this.session=new cC(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lC(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ym(e),onStart:Ym(n),onMove:Ym(i),onEnd:(s,o)=>{delete this.session,r&&Tn.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=au(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Km=!1;class Ez extends N.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),Km&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Uf.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,{projection:o}=i;return o&&(o.isPresent=s,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Km=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Tn.postRender(()=>{const c=o.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Cy.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;Km=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function dC(t){const[e,n]=JA(),i=N.useContext(cy);return B.jsx(Ez,{...t,layoutGroup:i,switchLayoutGroup:N.useContext(aC),isPresent:e,safeToRemove:n})}const Mz={pan:{Feature:wz},drag:{Feature:Sz,ProjectionNode:ZA,MeasureLayout:dC}};function eE(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Tn.postRender(()=>s(e,Cu(e)))}class Tz extends ka{mount(){const{current:e}=this.node;e&&(this.unmount=YO(e,(n,i)=>(eE(this.node,i,"Start"),r=>eE(this.node,r,"End"))))}unmount(){}}class Az extends ka{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Mu(mu(this.node.current,"focus",()=>this.onFocus()),mu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tE(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Tn.postRender(()=>s(e,Cu(e)))}class Cz extends ka{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=tB(e,(r,s)=>(tE(this.node,s,"Start"),(o,{success:c})=>tE(this.node,o,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const L0=new WeakMap,Zm=new WeakMap,Rz=t=>{const e=L0.get(t.target);e&&e(t)},Pz=t=>{t.forEach(Rz)};function kz({root:t,...e}){const n=t||document;Zm.has(n)||Zm.set(n,{});const i=Zm.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(Pz,{root:t,...e})),i[r]}function Lz(t,e,n){const i=kz(e);return L0.set(t,n),i.observe(t),()=>{L0.delete(t),i.unobserve(t)}}const Dz={some:0,all:1};class Nz extends ka{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Dz[r]},c=u=>{const{isIntersecting:f}=u;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:p}=this.node.getProps(),m=f?h:p;m&&m(u)};this.stopObserver=Lz(this.node.current,o,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Iz(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Iz({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Uz={inView:{Feature:Nz},tap:{Feature:Cz},focus:{Feature:Az},hover:{Feature:Tz}},Fz={layout:{ProjectionNode:ZA,MeasureLayout:dC}},Oz={...oz,...Uz,...Mz,...Fz},go=nz(Oz,iz);function Bz(){!Dy.current&&AA();const[t]=N.useState(lh.current);return t}const fC=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const zz=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Vz=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const nE=t=>{const e=Vz(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Jm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Hz=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Gz=N.createContext({}),Wz=()=>N.useContext(Gz),jz=N.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...c},u)=>{const{size:f=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:v=""}=Wz()??{},_=i??p?Number(n??h)*24/Number(e??f):n??h;return N.createElement("svg",{ref:u,...Jm,width:e??f??Jm.width,height:e??f??Jm.height,stroke:t??m,strokeWidth:_,className:fC("lucide",v,r),...!s&&!Hz(c)&&{"aria-hidden":"true"},...c},[...o.map(([w,y])=>N.createElement(w,y)),...Array.isArray(s)?s:[s]])});const By=(t,e)=>{const n=N.forwardRef(({className:i,...r},s)=>N.createElement(jz,{ref:s,iconNode:e,className:fC(`lucide-${zz(nE(t))}`,`lucide-${t}`,i),...r}));return n.displayName=nE(t),n};const $z=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Xz=By("log-out",$z);const qz=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Yz=By("mail",qz);const Kz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zz=By("x",Kz);function hC(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=hC(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function Jz(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=hC(t))&&(i&&(i+=" "),i+=e);return i}const Qz=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i<t.length;i++)n[i]=t[i];for(let i=0;i<e.length;i++)n[t.length+i]=e[i];return n},e5=(t,e)=>({classGroupId:t,validator:e}),pC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),hh="-",iE=[],t5="arbitrary..",n5=t=>{const e=r5(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return i5(o);const c=o.split(hh),u=c[0]===""&&c.length>1?1:0;return mC(c,u,e)},getConflictingClassGroupIds:(o,c)=>{if(c){const u=i[o],f=n[o];return u?f?Qz(f,u):u:f||iE}return n[o]||iE}}},mC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const f=mC(t,e+1,s);if(f)return f}const o=n.validators;if(o===null)return;const c=e===0?t.join(hh):t.slice(e).join(hh),u=o.length;for(let f=0;f<u;f++){const h=o[f];if(h.validator(c))return h.classGroupId}},i5=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?t5+i:void 0})(),r5=t=>{const{theme:e,classGroups:n}=t;return s5(n,e)},s5=(t,e)=>{const n=pC();for(const i in t){const r=t[i];zy(r,n,i,e)}return n},zy=(t,e,n,i)=>{const r=t.length;for(let s=0;s<r;s++){const o=t[s];a5(o,e,n,i)}},a5=(t,e,n,i)=>{if(typeof t=="string"){o5(t,e,n);return}if(typeof t=="function"){l5(t,e,n,i);return}c5(t,e,n,i)},o5=(t,e,n)=>{const i=t===""?e:gC(e,t);i.classGroupId=n},l5=(t,e,n,i)=>{if(u5(t)){zy(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(e5(n,t))},c5=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o<s;o++){const[c,u]=r[o];zy(u,gC(e,c),n,i)}},gC=(t,e)=>{let n=t;const i=e.split(hh),r=i.length;for(let s=0;s<r;s++){const o=i[s];let c=n.nextPart.get(o);c||(c=pC(),n.nextPart.set(o,c)),n=c}return n},u5=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,d5=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},D0="!",rE=":",f5=[],sE=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),h5=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=r=>{const s=[];let o=0,c=0,u=0,f;const h=r.length;for(let w=0;w<h;w++){const y=r[w];if(o===0&&c===0){if(y===rE){s.push(r.slice(u,w)),u=w+1;continue}if(y==="/"){f=w;continue}}y==="["?o++:y==="]"?o--:y==="("?c++:y===")"&&c--}const p=s.length===0?r:r.slice(u);let m=p,v=!1;p.endsWith(D0)?(m=p.slice(0,-1),v=!0):p.startsWith(D0)&&(m=p.slice(1),v=!0);const _=f&&f>u?f-u:void 0;return sE(s,v,m,_)};if(e){const r=e+rE,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):sE(f5,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},p5=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s<n.length;s++){const o=n[s],c=o[0]==="[",u=e.has(o);c||u?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},m5=t=>({cache:d5(t.cacheSize),parseClassName:h5(t),sortModifiers:p5(t),...n5(t)}),g5=/\s+/,v5=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],c=t.trim().split(g5);let u="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:_,maybePostfixModifierPosition:w}=n(h);if(p){u=h+(u.length>0?" "+u:u);continue}let y=!!w,x=i(y?_.substring(0,w):_);if(!x){if(!y){u=h+(u.length>0?" "+u:u);continue}if(x=i(_),!x){u=h+(u.length>0?" "+u:u);continue}y=!1}const M=m.length===0?"":m.length===1?m[0]:s(m).join(":"),A=v?M+D0:M,T=A+x;if(o.indexOf(T)>-1)continue;o.push(T);const D=r(x,y);for(let I=0;I<D.length;++I){const U=D[I];o.push(A+U)}u=h+(u.length>0?" "+u:u)}return u},y5=(...t)=>{let e=0,n,i,r="";for(;e<t.length;)(n=t[e++])&&(i=vC(n))&&(r&&(r+=" "),r+=i);return r},vC=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=vC(t[i]))&&(n&&(n+=" "),n+=e);return n},_5=(t,...e)=>{let n,i,r,s;const o=u=>{const f=e.reduce((h,p)=>p(h),t());return n=m5(f),i=n.cache.get,r=n.cache.set,s=c,c(u)},c=u=>{const f=i(u);if(f)return f;const h=v5(u,n);return r(u,h),h};return s=o,(...u)=>s(y5(...u))},x5=[],Qn=t=>{const e=n=>n[t]||x5;return e.isThemeGetter=!0,e},yC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_C=/^\((?:(\w[\w-]*):)?(.+)\)$/i,b5=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,S5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,w5=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,E5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,M5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,T5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ua=t=>b5.test(t),Xt=t=>!!t&&!Number.isNaN(Number(t)),da=t=>!!t&&Number.isInteger(Number(t)),Qm=t=>t.endsWith("%")&&Xt(t.slice(0,-1)),ws=t=>S5.test(t),xC=()=>!0,A5=t=>w5.test(t)&&!E5.test(t),Vy=()=>!1,C5=t=>M5.test(t),R5=t=>T5.test(t),P5=t=>!dt(t)&&!mt(t),k5=t=>La(t,wC,Vy),dt=t=>yC.test(t),qa=t=>La(t,EC,A5),aE=t=>La(t,B5,Xt),L5=t=>La(t,TC,xC),D5=t=>La(t,MC,Vy),oE=t=>La(t,bC,Vy),N5=t=>La(t,SC,R5),Xd=t=>La(t,AC,C5),mt=t=>_C.test(t),Oc=t=>Ro(t,EC),I5=t=>Ro(t,MC),lE=t=>Ro(t,bC),U5=t=>Ro(t,wC),F5=t=>Ro(t,SC),qd=t=>Ro(t,AC,!0),O5=t=>Ro(t,TC,!0),La=(t,e,n)=>{const i=yC.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},Ro=(t,e,n=!1)=>{const i=_C.exec(t);return i?i[1]?e(i[1]):n:!1},bC=t=>t==="position"||t==="percentage",SC=t=>t==="image"||t==="url",wC=t=>t==="length"||t==="size"||t==="bg-size",EC=t=>t==="length",B5=t=>t==="number",MC=t=>t==="family-name",TC=t=>t==="number"||t==="weight",AC=t=>t==="shadow",z5=()=>{const t=Qn("color"),e=Qn("font"),n=Qn("text"),i=Qn("font-weight"),r=Qn("tracking"),s=Qn("leading"),o=Qn("breakpoint"),c=Qn("container"),u=Qn("spacing"),f=Qn("radius"),h=Qn("shadow"),p=Qn("inset-shadow"),m=Qn("text-shadow"),v=Qn("drop-shadow"),_=Qn("blur"),w=Qn("perspective"),y=Qn("aspect"),x=Qn("ease"),M=Qn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...T(),mt,dt],I=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],S=()=>[mt,dt,u],R=()=>[ua,"full","auto",...S()],H=()=>[da,"none","subgrid",mt,dt],F=()=>["auto",{span:["full",da,mt,dt]},da,mt,dt],W=()=>[da,"auto",mt,dt],X=()=>["auto","min","max","fr",mt,dt],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...S()],Q=()=>[ua,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],$=()=>[ua,"screen","full","dvw","lvw","svw","min","max","fit",...S()],Y=()=>[ua,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],Z=()=>[t,mt,dt],z=()=>[...T(),lE,oE,{position:[mt,dt]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ve=()=>["auto","cover","contain",U5,k5,{size:[mt,dt]}],Ee=()=>[Qm,Oc,qa],Ue=()=>["","none","full",f,mt,dt],le=()=>["",Xt,Oc,qa],be=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ne=()=>[Xt,Qm,lE,oE],et=()=>["","none",_,mt,dt],xt=()=>["none",Xt,mt,dt],pn=()=>["none",Xt,mt,dt],ht=()=>[Xt,mt,dt],Ut=()=>[ua,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ws],breakpoint:[ws],color:[xC],container:[ws],"drop-shadow":[ws],ease:["in","out","in-out"],font:[P5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ws],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ws],shadow:[ws],spacing:["px",Xt],text:[ws],"text-shadow":[ws],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ua,dt,mt,y]}],container:["container"],columns:[{columns:[Xt,dt,mt,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[da,"auto",mt,dt]}],basis:[{basis:[ua,"full","auto",c,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xt,ua,"auto","initial","none",dt]}],grow:[{grow:["",Xt,mt,dt]}],shrink:[{shrink:["",Xt,mt,dt]}],order:[{order:[da,"first","last","none",mt,dt]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mbs:[{mbs:J()}],mbe:[{mbe:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[c,"screen",...Q()]}],"min-w":[{"min-w":[c,"screen","none",...Q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,Oc,qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,O5,L5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qm,dt]}],"font-family":[{font:[I5,D5,e]}],"font-features":[{"font-features":[dt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,mt,dt]}],"line-clamp":[{"line-clamp":[Xt,"none",mt,aE]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",mt,dt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",mt,dt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xt,"from-font","auto",mt,qa]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[Xt,"auto",mt,dt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",mt,dt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",mt,dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ve()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},da,mt,dt],radial:["",mt,dt],conic:[da,mt,dt]},F5,N5]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:Ee()}],"gradient-via-pos":[{via:Ee()}],"gradient-to-pos":[{to:Ee()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:Ue()}],"rounded-s":[{"rounded-s":Ue()}],"rounded-e":[{"rounded-e":Ue()}],"rounded-t":[{"rounded-t":Ue()}],"rounded-r":[{"rounded-r":Ue()}],"rounded-b":[{"rounded-b":Ue()}],"rounded-l":[{"rounded-l":Ue()}],"rounded-ss":[{"rounded-ss":Ue()}],"rounded-se":[{"rounded-se":Ue()}],"rounded-ee":[{"rounded-ee":Ue()}],"rounded-es":[{"rounded-es":Ue()}],"rounded-tl":[{"rounded-tl":Ue()}],"rounded-tr":[{"rounded-tr":Ue()}],"rounded-br":[{"rounded-br":Ue()}],"rounded-bl":[{"rounded-bl":Ue()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-bs":[{"border-bs":Z()}],"border-color-be":[{"border-be":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xt,mt,dt]}],"outline-w":[{outline:["",Xt,Oc,qa]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",h,qd,Xd]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",p,qd,Xd]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[Xt,qa]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",m,qd,Xd]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[Xt,mt,dt]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[mt,dt]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Xt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ve()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",mt,dt]}],filter:[{filter:["","none",mt,dt]}],blur:[{blur:et()}],brightness:[{brightness:[Xt,mt,dt]}],contrast:[{contrast:[Xt,mt,dt]}],"drop-shadow":[{"drop-shadow":["","none",v,qd,Xd]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",Xt,mt,dt]}],"hue-rotate":[{"hue-rotate":[Xt,mt,dt]}],invert:[{invert:["",Xt,mt,dt]}],saturate:[{saturate:[Xt,mt,dt]}],sepia:[{sepia:["",Xt,mt,dt]}],"backdrop-filter":[{"backdrop-filter":["","none",mt,dt]}],"backdrop-blur":[{"backdrop-blur":et()}],"backdrop-brightness":[{"backdrop-brightness":[Xt,mt,dt]}],"backdrop-contrast":[{"backdrop-contrast":[Xt,mt,dt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xt,mt,dt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xt,mt,dt]}],"backdrop-invert":[{"backdrop-invert":["",Xt,mt,dt]}],"backdrop-opacity":[{"backdrop-opacity":[Xt,mt,dt]}],"backdrop-saturate":[{"backdrop-saturate":[Xt,mt,dt]}],"backdrop-sepia":[{"backdrop-sepia":["",Xt,mt,dt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",mt,dt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xt,"initial",mt,dt]}],ease:[{ease:["linear","initial",x,mt,dt]}],delay:[{delay:[Xt,mt,dt]}],animate:[{animate:["none",M,mt,dt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,mt,dt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:xt()}],"rotate-x":[{"rotate-x":xt()}],"rotate-y":[{"rotate-y":xt()}],"rotate-z":[{"rotate-z":xt()}],scale:[{scale:pn()}],"scale-x":[{"scale-x":pn()}],"scale-y":[{"scale-y":pn()}],"scale-z":[{"scale-z":pn()}],"scale-3d":["scale-3d"],skew:[{skew:ht()}],"skew-x":[{"skew-x":ht()}],"skew-y":[{"skew-y":ht()}],transform:[{transform:[mt,dt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ut()}],"translate-x":[{"translate-x":Ut()}],"translate-y":[{"translate-y":Ut()}],"translate-z":[{"translate-z":Ut()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",mt,dt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",mt,dt]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[Xt,Oc,qa,aE]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},V5=_5(z5);function Si(...t){return V5(Jz(t))}const H5=B.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[B.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),B.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),B.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),B.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),G5=B.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:B.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),W5={google:H5,github:G5},j5={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function $5(t){return j5[t]||String(t||"").replace(/-/g," ")}function X5(){const{isOpen:t,closeLoginModal:e}=ET(),{enabled:n,signedIn:i,refreshUser:r,signInWithPassword:s,signUp:o,signInWithOAuth:c,getPublicAuthConfig:u}=$l(),[f,h]=N.useState("signin"),[p,m]=N.useState(""),[v,_]=N.useState(""),[w,y]=N.useState(""),[x,M]=N.useState(!1),[A,T]=N.useState(null),[D,I]=N.useState(null),[U,S]=N.useState(!1),[R,H]=N.useState(!0),[F,W]=N.useState([]),[X,V]=N.useState(8);N.useEffect(()=>{t&&(T(null),I(null),h("signin"),m(""),_(""),y(""),S(!1))},[t]),N.useEffect(()=>{if(!t||!n){H(!1);return}let $=!0;return(async()=>{const{data:Y,error:Z}=await u();if($){if(Z||!Y)W(["google","github"]);else{const z=Array.isArray(Y.oAuthProviders)?Y.oAuthProviders:[],ie=Array.isArray(Y.customOAuthProviders)?Y.customOAuthProviders:[];W([...z,...ie]),typeof Y.passwordMinLength=="number"&&Y.passwordMinLength>0&&V(Y.passwordMinLength)}H(!1)}})(),()=>{$=!1}},[t,n,u]),N.useEffect(()=>{t&&i&&e()},[t,i,e]);const q=N.useMemo(()=>typeof window>"u"?"":window.location.href,[]),J=N.useCallback(async $=>{T(null),M(!0);try{const{error:Y}=await c($,q);Y&&T(Y.message||String(Y))}finally{M(!1)}},[c,q]),Q=N.useCallback(async $=>{$.preventDefault(),T(null),M(!0);try{if(f==="signup"){const{data:Z,error:z}=await o({email:p.trim(),password:v,name:w.trim()||void 0});if(z){T(z.message||String(z));return}if(Z?.requireEmailVerification){I("Check your email for a verification link."),h("signin");return}await r();return}const{error:Y}=await s({email:p.trim(),password:v});if(Y){T(Y.message||String(Y));return}await r()}finally{M(!1)}},[f,p,v,w,o,s,r]);return N.useEffect(()=>{if(!t)return;const $=Y=>{Y.key==="Escape"&&e()};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[t,e]),n?B.jsx(QA,{children:t&&B.jsxs(go.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[B.jsx(go.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),B.jsxs(go.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:$=>$.stopPropagation(),children:[B.jsx("button",{type:"button",onClick:e,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:B.jsx(Zz,{className:"h-5 w-5"})}),B.jsxs("div",{className:"text-center mb-6",children:[B.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[B.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),B.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),B.jsx("p",{className:"text-sm text-oai-gray-500",children:"Sign in to join the leaderboard"})]}),D&&B.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:D}),A&&B.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:A}),B.jsx("div",{className:"space-y-2.5 mb-5",children:R?B.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):F.map($=>B.jsxs("button",{type:"button",disabled:x,onClick:()=>J($),className:Si("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[W5[$]||null,"Continue with ",$5($)]},$))}),U?B.jsxs(B.Fragment,{children:[B.jsxs("div",{className:"relative mb-5",children:[B.jsx("div",{className:"absolute inset-0 flex items-center",children:B.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),B.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:B.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:"email"})})]}),B.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[B.jsx("button",{type:"button",className:Si("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{h("signin"),T(null)},children:"Sign In"}),B.jsx("button",{type:"button",className:Si("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{h("signup"),T(null)},children:"Sign Up"})]}),B.jsxs("form",{onSubmit:Q,className:"space-y-3",children:[f==="signup"&&B.jsxs("div",{children:[B.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Name"}),B.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:w,onChange:$=>y($.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:"Optional"})]}),B.jsxs("div",{children:[B.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Email"}),B.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:p,onChange:$=>m($.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),B.jsxs("div",{children:[B.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Password"}),B.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?X:void 0,value:v,onChange:$=>_($.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&B.jsxs("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:["At least ",X," characters"]})]}),B.jsx("button",{type:"submit",disabled:x,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:f==="signup"?"Create Account":"Sign In"})]})]}):B.jsxs(B.Fragment,{children:[B.jsxs("div",{className:"relative mb-5",children:[B.jsx("div",{className:"absolute inset-0 flex items-center",children:B.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),B.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:B.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:"or"})})]}),B.jsxs("button",{type:"button",onClick:()=>S(!0),className:Si("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[B.jsx(Yz,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),"Continue with Email"]})]})]})]})}):null}const q5={VITE_INSFORGE_BASE_URL:"https://b46ug8xu.us-east.insforge.app"};function Y5(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const e=typeof import.meta<"u"?q5:void 0;return(e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e?.VITE_INSFORGE_BASE_URL||"").trim()}function a$(){return Co()}function o$(){if(typeof Intl>"u"||!Intl.DateTimeFormat)return null;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function l$(t=new Date){const e=t instanceof Date?t:new Date(t);if(!Number.isFinite(e.getTime()))return 0;const n=e.getTimezoneOffset();return Number.isFinite(n)?-n:0}function CC(t){if(!Number.isFinite(t)||t===0)return"UTC";const e=t>=0?"+":"-",n=Math.abs(t),i=String(Math.floor(n/60)).padStart(2,"0"),r=String(n%60).padStart(2,"0");return`UTC${e}${i}:${r}`}function c$({timeZone:t,offsetMinutes:e}={}){const n=CC(e);return t&&t!=="UTC"?`${t} (${n})`:n}function u$({timeZone:t,offsetMinutes:e}={}){return Number.isFinite(e)?CC(e):t||"UTC"}function d$({timeZone:t,offsetMinutes:e,date:n=new Date}={}){const i=n instanceof Date?n:new Date(n);if(!Number.isFinite(i.getTime()))return"";if(t&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const o=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(i).reduce((h,p)=>(p.type&&p.value&&(h[p.type]=p.value),h),{}),c=o.year,u=o.month,f=o.day;if(c&&u&&f)return`${c}-${u}-${f}`}catch{}if(typeof e=="number"&&Number.isFinite(e)){const r=new Date(i.getTime()+e*6e4);return Z5(r)}return J5(i)}function K5({timeZone:t,offsetMinutes:e,date:n=new Date}={}){const i=n instanceof Date?n:new Date(n);if(!Number.isFinite(i.getTime()))return null;if(t&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const o=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(i).reduce((h,p)=>(p.type&&p.value&&(h[p.type]=p.value),h),{}),c=Number(o.year),u=Number(o.month),f=Number(o.day);if(Number.isFinite(c)&&Number.isFinite(u)&&Number.isFinite(f))return{year:c,month:u,day:f}}catch{}if(typeof e=="number"&&Number.isFinite(e)){const r=new Date(i.getTime()+e*6e4);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate()}}return{year:i.getFullYear(),month:i.getMonth()+1,day:i.getDate()}}function f$({timeZone:t,offsetMinutes:e}={}){return t?`tz:${t}`:typeof e=="number"&&Number.isFinite(e)?`offset:${Math.trunc(e)}`:"utc"}function Z5(t){const e=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),i=String(t.getUTCDate()).padStart(2,"0");return`${e}-${n}-${i}`}function J5(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${i}`}function kn(t){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())).toISOString().slice(0,10)}function fs(t){const e=t instanceof Date?t:new Date(t);if(!Number.isFinite(e.getTime()))return"";const n=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${n}-${i}-${r}`}function Q5(t){if(!t)return null;const e=String(t).trim(),n=e.split("-");if(n.length!==3)return null;const i=Number(n[0]),r=Number(n[1])-1,s=Number(n[2]);if(!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(s))return null;const o=new Date(Date.UTC(i,r,s));return Number.isFinite(o.getTime())&&kn(o)===e?o:null}function eV(t){if(!t)return"";const e=t.year,n=String(t.month).padStart(2,"0"),i=String(t.day).padStart(2,"0");return!e||!n||!i?"":`${e}-${n}-${i}`}function tV(t,{timeZone:e,offsetMinutes:n,now:i}={}){const r=i instanceof Date&&Number.isFinite(i.getTime())?i:new Date,s=K5({timeZone:e,offsetMinutes:n,date:r});if(!s){const u=fs(new Date);return{from:u,to:u}}const o=eV(s),c=Q5(o);if(!c)return{from:o,to:o};if(t==="day")return{from:o,to:o};if(t==="week"){const u=new Date(c),h=(u.getUTCDay()+6)%7;u.setUTCDate(u.getUTCDate()-h);const p=new Date(u);return p.setUTCDate(p.getUTCDate()+6),{from:kn(u),to:kn(p)}}if(t==="month"){const u=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth(),1)),f=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth()+1,0));return{from:kn(u),to:kn(f)}}if(t==="total"){const u=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth()-23,1));return{from:kn(u),to:o}}return tV("week")}function h$(t){if(t==null)return"-";try{if(typeof t=="bigint")return new Intl.NumberFormat().format(t);if(typeof t=="number")return new Intl.NumberFormat().format(t);const e=String(t).trim();return/^[0-9]+$/.test(e)?new Intl.NumberFormat().format(BigInt(e)):e}catch{return String(t)}}function p$(t,{thousandSuffix:e="K",millionSuffix:n="M",billionSuffix:i="B",decimals:r=1}={}){const s=Number(String(t));if(!Number.isFinite(s))return"-";const o=s<0?"-":"",c=Math.abs(s),u=Math.max(0,Math.min(6,Math.floor(r)));if(c<1e3)return`${o}${String(c)}`;const f=(v,_)=>{const w=v.toFixed(u),y=Number(w).toString();return`${o}${y}${_}`},h=(v,_,w)=>{const y=v.toFixed(u),x=Number(y);return w&&x>=1e3?f(x/1e3,w):`${o}${x.toString()}${_}`};if(c>=1e9)return f(c/1e9,i);if(c>=1e6)return h(c/1e6,n,i);const p=c/1e3,m=Number(p.toFixed(u));return m>=1e3?f(m/1e3,n):f(m,e)}function RC(t){const e=Number(String(t));return Number.isFinite(e)?e:null}function m$(t,{decimals:e=2}={}){if(t==null)return"-";const n=String(t).trim();if(!n)return"-";const i=n.match(/^(-?\d+)(?:\.(\d+))?$/);if(!i)return n;const r=i[1],s=i[2]||"";let o=r;try{o=new Intl.NumberFormat().format(BigInt(r))}catch{o=r}const c=Math.max(0,Math.min(6,Math.floor(e))),u=c?s.slice(0,c).padEnd(c,"0"):"",f=r.startsWith("-")?"-":"",h=c?`${o.replace("-","")}.${u}`:o.replace("-","");return`${f}$${h}`}function ph(t){if(typeof t!="string")return null;const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t.trim());if(!e)return null;const n=Number(e[1]),i=Number(e[2])-1,r=Number(e[3]),s=new Date(Date.UTC(n,i,r));return Number.isFinite(s.getTime())&&kn(s)===t.trim()?s:null}function co(t,e){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+e))}function nV(t,e){const n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.floor(n/864e5)}function eg(t,e){if(!Array.isArray(t)||t.length===0)return 0;const n=t.length,i=(n-1)*e,r=Math.floor(i),s=i-r,o=t[r]??t[n-1],c=t[Math.min(n-1,r+1)]??t[n-1];return Math.round(o+(c-o)*s)}function iV(t){return t<=0?0:t>=4?4:t}function PC({weeks:t=52,now:e,weekStartsOn:n="sun"}={}){const i=e instanceof Date&&Number.isFinite(e.getTime())?e:new Date,r=fs(i),s=ph(r)||new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),o=n==="mon"?1:0,c=s.getUTCDay(),u=co(s,-((c-o+7)%7)),f=co(u,-7*(Math.max(1,t)-1));return{from:kn(f),to:r}}function rV({dailyRows:t,weeks:e=52,to:n,weekStartsOn:i="sun"}={}){const r=ph(n)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),{from:s}=PC({weeks:e,now:r,weekStartsOn:i}),o=ph(s)||co(r,-(e*7-1)),c=(()=>{const T=(o.getUTCDay()-(i==="mon"?1:0)+7)%7;return co(o,-T)})(),u=new Map;for(const M of Array.isArray(t)?t:[]){const A=typeof M?.day=="string"?M.day:null;if(!A)continue;const T=RC(M?.billable_total_tokens??M?.total_tokens)??0;u.set(A,Math.max(0,T))}const f=nV(c,r)+1,h=Math.ceil(f/7),p=[];for(let M=0;M<f;M++){const A=co(c,M),T=kn(A),D=u.get(T)??0;D>0&&p.push(D)}p.sort((M,A)=>M-A);const m=eg(p,.5),v=eg(p,.75),_=eg(p,.9);function w(M){return!M||M<=0?0:M<=m?1:M<=v?2:M<=_?3:4}const y=[];for(let M=0;M<h;M++){const A=[];for(let T=0;T<7;T++){const D=M*7+T,I=co(c,D);if(I.getTime()>r.getTime()){A.push(null);continue}const U=kn(I),S=u.get(U)??0;A.push({day:U,value:S,level:iV(w(S))})}y.push(A)}const x=y.length>e?y.slice(y.length-e):y;return{from:s,to:kn(r),weeks:x,thresholds:{t1:m,t2:v,t3:_}}}function sV({dailyRows:t,to:e}={}){const n=ph(e)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),i=new Map;for(const s of Array.isArray(t)?t:[]){const o=typeof s?.day=="string"?s.day:null;if(!o)continue;const c=RC(s?.billable_total_tokens??s?.total_tokens)??0;i.set(o,Math.max(0,c))}let r=0;for(let s=0;s<370;s++){const o=kn(co(n,-s));if((i.get(o)??0)>0){r+=1;continue}break}return r}const Nh={},kC="tokentracker",aV=["victorgpt/tokentracker","spacedriveapp/spacedrive","acme/alpha","acme/beta","neo/nebula","signal/flux","matrix/terminal","orbit/atlas","lumen/core","delta/horizon"],cE=["NEO","TRINITY","MORPHEUS","ORACLE","CYPHER","SWITCH","APOC","TANK","SMITH","SERAPH","NIOBE","MOUSE","DOZER","LINK","BLADE"];function xr(){if(typeof window<"u"){const t=new URLSearchParams(window.location.search),e=String(t.get("mock")||"").toLowerCase();if(e==="0"||e==="false"||e==="off"||e==="no")return!1;if(e==="1"||e==="true"||e==="on"||e==="yes")return!0}if(typeof import.meta<"u"&&Nh){const t="".toLowerCase();if(t==="1"||t==="true")return!0}return!1}function oV(){if(typeof import.meta<"u"&&Nh){const t="".trim();if(t)return t;const e="".trim();if(e)return e}if(typeof window<"u"){const t=new URLSearchParams(window.location.search),e=String(t.get("mock_now")||"").trim();if(e)return e;const n=String(t.get("mock_today")||"").trim();if(n)return n}return""}function lV(t){if(!t)return null;const e=String(t).trim();if(!e)return null;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[i,r,s]=e.split("-").map(Number);if(!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(s))return null;const o=new Date(i,r-1,s,12,0,0);return Number.isFinite(o.getTime())?o:null}const n=new Date(e);return Number.isFinite(n.getTime())?n:null}function g$(){return xr()?lV(oV()):null}function cV(){if(typeof import.meta<"u"&&Nh){const t="".trim();if(t)return t}if(typeof window<"u"){const t=new URLSearchParams(window.location.search),e=String(t.get("mock_seed")||"").trim();if(e)return e}return kC}function uV(){if(typeof import.meta<"u"&&Nh){const t="".trim(),e=Number(t);if(Number.isFinite(e)&&e>0)return Math.floor(e)}if(typeof window<"u"){const t=new URLSearchParams(window.location.search),e=String(t.get("mock_missing")||"").trim(),n=Number(e);if(Number.isFinite(n)&&n>0)return Math.floor(n)}return 0}function Ru(t){return(t==null?cV():String(t)).trim()||kC}function Pu(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}function ki(t){if(typeof t!="string")return null;const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t.trim());if(!e)return null;const n=Number(e[1]),i=Number(e[2])-1,r=Number(e[3]),s=new Date(Date.UTC(n,i,r));return Number.isFinite(s.getTime())&&kn(s)===t.trim()?s:null}function gu(t,e){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+e))}function LC(t,e){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+e,1))}function dV(t){return`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,"0")}`}function Ol({from:t,to:e,seed:n}){const i=ki(fs(new Date))||new Date,r=ki(t)||i,s=ki(e)||r,o=[],c=Ru(n),u=Math.floor((Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate())-Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()))/864e5)+1;for(let f=0;f<u;f+=1){const h=gu(r,f),p=kn(h),m=Pu(`${c}:${p}`),v=m%1e3/1e3,_=.6+.4*Math.sin(f/6*Math.PI*.5),w=h.getUTCDay()===0||h.getUTCDay()===6?.65:1,y=18e3+Math.round(12e3*v),x=Math.max(0,Math.round(y*_*w)),M=Math.round(x*.46),A=Math.round(x*.34),T=Math.round(x*.14),D=Math.max(0,x-M-A-T);o.push({day:p,total_tokens:x,billable_total_tokens:x,input_tokens:M,output_tokens:A,cached_input_tokens:T,reasoning_output_tokens:D,conversation_count:1+m%5})}return o}function fV({day:t,seed:e}){const n=ki(t)||ki(fs(new Date))||new Date,i=kn(n),r=Ru(e),s=Array.from({length:48},(c,u)=>{const f=Math.floor(u/2),h=u%2===0?0:30,m=Pu(`${r}:${i}:${f}:${h}`)%1e3/1e3,v=(f+h/60)/24,_=.4+.6*Math.sin(v*Math.PI*2),w=900+Math.round(700*m),y=Math.max(0,Math.round(w*_)),x=Math.round(y*.46),M=Math.round(y*.34),A=Math.round(y*.14),T=Math.max(0,y-x-M-A);return{hour:`${i}T${String(f).padStart(2,"0")}:${String(h).padStart(2,"0")}:00`,total_tokens:y,billable_total_tokens:y,input_tokens:x,output_tokens:M,cached_input_tokens:A,reasoning_output_tokens:T}}),o=Math.max(0,Math.min(48,uV()));if(o>0){const c=Date.now(),u=s.map((p,m)=>{const v=Date.parse(p.hour);return Number.isFinite(v)&&v<=c?{index:m,ts:v}:null}).filter(Boolean),f=Math.max(0,u.length-o),h=u.slice(f);for(const p of h){const m=s[p.index];m&&(s[p.index]={...m,missing:!0})}}return s}function hV({months:t=24,to:e,seed:n}){const i=ki(e)||ki(fs(new Date))||new Date,r=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1)),s=Ru(n),o=[];for(let c=t-1;c>=0;c-=1){const u=LC(r,-c),f=dV(u),p=Pu(`${s}:${f}`)%1e3/1e3,m=.7+.3*Math.sin(o.length/6*Math.PI*.5),v=36e4+Math.round(2e5*p),_=Math.max(0,Math.round(v*m)),w=Math.round(_*.46),y=Math.round(_*.34),x=Math.round(_*.14),M=Math.max(0,_-w-y-x);o.push({month:f,total_tokens:_,billable_total_tokens:_,input_tokens:w,output_tokens:y,cached_input_tokens:x,reasoning_output_tokens:M})}return o}function Hy(t){return t.reduce((e,n)=>(e.total_tokens+=Number(n.total_tokens||0),e.billable_total_tokens+=Number(n.billable_total_tokens||n.total_tokens||0),e.input_tokens+=Number(n.input_tokens||0),e.output_tokens+=Number(n.output_tokens||0),e.cached_input_tokens+=Number(n.cached_input_tokens||0),e.reasoning_output_tokens+=Number(n.reasoning_output_tokens||0),e.conversation_count+=Number(n.conversation_count||0),e),{total_tokens:0,billable_total_tokens:0,input_tokens:0,output_tokens:0,cached_input_tokens:0,reasoning_output_tokens:0,conversation_count:0})}function pV(t,e=1.75){const n=Number(t||0);return!Number.isFinite(n)||n<=0?"0.000000":(n*e/1e6).toFixed(6)}function uE(t,e){const n=Number.isFinite(e)?e:0;return{total_tokens:Math.max(0,Math.round(t.total_tokens*n)),billable_total_tokens:Math.max(0,Math.round((t.billable_total_tokens??t.total_tokens)*n)),input_tokens:Math.max(0,Math.round(t.input_tokens*n)),output_tokens:Math.max(0,Math.round(t.output_tokens*n)),cached_input_tokens:Math.max(0,Math.round(t.cached_input_tokens*n)),reasoning_output_tokens:Math.max(0,Math.round(t.reasoning_output_tokens*n))}}function N0(t){return{...t,total_cost_usd:pV(t.total_tokens)}}function mV({from:t,to:e,seed:n}={}){const i=Ol({from:t,to:e,seed:n});return{from:t,to:e,data:i}}function gV({day:t,seed:e}={}){const n=ki(t)||new Date,i=kn(n),r=fV({day:i,seed:e});return{day:i,data:r}}function vV({months:t=24,to:e,seed:n}={}){const i=ki(e)||ki(fs(new Date))||new Date,r=kn(i),s=hV({months:t,to:r,seed:n}),o=LC(new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1)),-(t-1));return{from:kn(o),to:r,months:t,data:s}}function yV({from:t,to:e,seed:n,rolling:i=!0}={}){const r=Ol({from:t,to:e,seed:n}),s=Hy(r),o=N0(s),c=i?_V({to:e,seed:n}):null;return{from:t,to:e,days:r.length,totals:o,...c?{rolling:c}:{}}}function _V({to:t,seed:e}={}){const n=ki(t)||ki(fs(new Date))||new Date,i=kn(n),r=kn(gu(n,-6)),s=kn(gu(n,-29)),o=Ol({from:r,to:i,seed:e}),c=Ol({from:s,to:i,seed:e});return{last_7d:dE({rows:o,from:r,to:i}),last_30d:dE({rows:c,from:s,to:i})}}function dE({rows:t,from:e,to:n}={}){const i=Hy(t||[]),r=(t||[]).filter(o=>Number(o.billable_total_tokens??o.total_tokens)>0).length,s=r>0?Math.floor(i.billable_total_tokens/r):0;return{from:e,to:n,totals:{billable_total_tokens:i.billable_total_tokens,conversation_count:i.conversation_count},active_days:r,avg_per_active_day:s}}function xV({seed:t,limit:e=3}={}){const n=Ru(t),i=aV.map((r,s)=>{const c=12e4+Pu(`${n}:${r}`)%9e5,u=s%4*4200,f=Math.max(0,c+u),h=Math.max(0,Math.round(f*.96));return{project_key:r,project_ref:`https://github.com/${r}`,total_tokens:String(f),billable_total_tokens:String(h)}}).sort((r,s)=>Number(s.billable_total_tokens)-Number(r.billable_total_tokens)).slice(0,Math.max(1,Math.min(10,Math.floor(Number(e)||3))));return{generated_at:new Date().toISOString(),entries:i}}function bV(t){const e=ki(fs(new Date))||new Date,n=String(t).trim().toLowerCase()||"week";if(n==="total")return{from:"1970-01-01",to:"9999-12-31"};if(n==="month"){const o=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),c=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+1,0));return{from:kn(o),to:kn(c)}}const i=e.getUTCDay(),r=kn(gu(e,-i)),s=kn(gu(e,-i+6));return{from:r,to:s}}function DC({seed:t,period:e,metric:n,limit:i=20,offset:r=0}={}){const s=Ru(t),o=Math.max(1,Math.min(100,Math.floor(Number(i)||20))),c=Math.max(0,Math.min(1e4,Math.floor(Number(r)||0))),u=String(n||"all").trim().toLowerCase()||"all",f=String(e||"week").trim().toLowerCase()||"week",h=f==="month"||f==="total"||f==="week"?f:"week",{from:p,to:m}=bV(h),v=250,_=v>0?Math.ceil(v/o):0,w=Math.floor(c/o)+1,y=Array.from({length:v},(U,S)=>{const R=S+1,H=`00000000-0000-0000-0000-${String(R).padStart(12,"0")}`,F=cE[R%cE.length],X=18e4+Pu(`${s}:${F}:${R}`)%9e5,V=Math.max(0,X+R*1200),q=Math.floor(V*.28),J=Math.floor(V*.18),Q=Math.floor(V*.12),$=Math.floor(V*.12),Y=Math.floor(V*.1),Z=Math.max(0,V-q-J-Q-$-Y),z=R%7!==0;return{id:R,user_id:H,is_public:z,is_me:!1,display_name:z?F:"Anonymous",avatar_url:null,gpt_tokens:q,claude_tokens:J,gemini_tokens:Q,cursor_tokens:$,opencode_tokens:Y,openclaw_tokens:Z,other_tokens:0,total_tokens:V}}),x=Math.max(0,Math.min(v-1,Math.floor(v*.8)));y[x]&&(y[x].is_me=!0);const M=u==="gpt"||u==="codex"?"gpt_tokens":u==="claude"?"claude_tokens":u==="gemini"?"gemini_tokens":u==="cursor"?"cursor_tokens":u==="opencode"?"opencode_tokens":u==="openclaw"?"openclaw_tokens":"total_tokens",A=y.slice().sort((U,S)=>Number(S[M])-Number(U[M])||U.id-S.id).map((U,S)=>({user_id:U.is_public?U.user_id:null,rank:S+1,is_me:!!U.is_me,display_name:U.display_name,avatar_url:U.avatar_url,gpt_tokens:String(U.gpt_tokens),claude_tokens:String(U.claude_tokens),gemini_tokens:String(U.gemini_tokens),cursor_tokens:String(U.cursor_tokens),opencode_tokens:String(U.opencode_tokens),openclaw_tokens:String(U.openclaw_tokens),other_tokens:String(U.other_tokens??0),total_tokens:String(U.total_tokens),is_public:!!U.is_public})),T=A.find(U=>U?.is_me)||null,D=T?{rank:T.rank,gpt_tokens:T.gpt_tokens,claude_tokens:T.claude_tokens,gemini_tokens:T.gemini_tokens,cursor_tokens:T.cursor_tokens,opencode_tokens:T.opencode_tokens,openclaw_tokens:T.openclaw_tokens,other_tokens:T.other_tokens,total_tokens:T.total_tokens}:{rank:null,gpt_tokens:"0",claude_tokens:"0",gemini_tokens:"0",cursor_tokens:"0",opencode_tokens:"0",openclaw_tokens:"0",other_tokens:"0",total_tokens:"0"},I=A.slice(c,c+o);return{period:h,metric:u,from:p,to:m,generated_at:new Date().toISOString(),page:w,limit:o,offset:c,total_entries:v,total_pages:_,entries:I,me:D}}function SV({weeks:t=52,to:e,weekStartsOn:n="sun",seed:i}={}){const r=PC({weeks:t,now:ki(e)||ki(fs(new Date))||new Date,weekStartsOn:n}),s=Ol({from:r.from,to:r.to,seed:i});return{...rV({dailyRows:s,weeks:t,to:r.to,weekStartsOn:n}),week_starts_on:n,active_days:s.filter(c=>Number(c.billable_total_tokens??c.total_tokens)>0).length,streak_days:sV({dailyRows:s,to:r.to})}}function wV({from:t,to:e,seed:n}={}){const i=Ol({from:t,to:e,seed:n}),r=Hy(i),o=[{source:"codex",weight:.7,models:[{model:"gpt-5.2-codex",model_id:"gpt-5.2-codex",weight:.2},{model:"unknown",model_id:"unknown",weight:.8}]},{source:"claude",weight:.2,models:[{model:"claude-3.5",model_id:"claude-3.5",weight:.3},{model:"unknown",model_id:"unknown",weight:.7}]},{source:"every-code",weight:.1,models:[{model:"unknown",model_id:"unknown",weight:1}]}].map(c=>{const u=uE(r,c.weight),f=c.models.map(h=>{const p=uE(u,h.weight);return{model:h.model,model_id:h.model_id||h.model,totals:N0(p)}});return{source:c.source,totals:N0(u),models:f}});return{from:t,to:e,days:i.length,sources:o,pricing:{model:"mock",pricing_mode:"add",source:"mock",effective_from:fs(new Date),rates_per_million_usd:{input:"1.750000",cached_input:"0.175000",output:"14.000000",reasoning_output:"14.000000"}}}}function NC(t=""){if(typeof t!="string"||t.length===0)return!1;const e=new URLSearchParams(t),n=String(e.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const EV=300*1e3;function Gy(t){return typeof t=="string"&&/^https?:\/\//i.test(t.trim())}async function IC(t){const e=Co();if(!Gy(e)||!t)return;const n=e.replace(/\/$/,""),i=Ah(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};i&&(r.apikey=i);try{await fetch(`${n}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:r,body:"{}"})}catch{}}async function UC(t){const e=Co();if(!Gy(e)||!t)return null;const n=e.replace(/\/$/,""),i=Ah(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};i&&(r.apikey=i);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",o=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:r,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!o.ok)return null;const c=await o.json().catch(()=>null),u=typeof c?.token=="string"?c.token:null,f=typeof c?.device_id=="string"?c.device_id:null;return!u||!f?null:{token:u,deviceId:f,issuedAt:typeof c?.created_at=="string"?c.created_at:new Date().toISOString()}}async function FC(t){const{deviceToken:e,insforgeBaseUrl:n}=t,i={deviceToken:e},r=n||Co();Gy(r)&&(i.insforgeBaseUrl=r.trim());const s=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(i)}),o=await s.json().catch(()=>({}));if(!s.ok){const c=typeof o.error=="string"?o.error:`HTTP ${s.status}`;throw new Error(c)}return o}async function MV(t){const e=vI();if(Date.now()-e<EV)return;const n=await t();if(!n)return;let i=rT();if(!i){const r=await UC(n);if(!r)return;sT(r),i=r}await FC({deviceToken:i.token,insforgeBaseUrl:Co()}),aT(Date.now()),await IC(n)}async function TV(t){const e=await t();if(!e)return;let n=rT();if(!n){const i=await UC(e);if(!i)return;sT(i),n=i}await FC({deviceToken:n.token,insforgeBaseUrl:Co()}),aT(Date.now()),await IC(e)}function AV(t){const e=t.replace(/\/+$/,"")||"/";return e==="/share"||e==="/share.html"||e.startsWith("/share/")}function CV(t){const e=t.replace(/\/+$/,"")||"/";return e==="/login"||e==="/landing"||AV(e)?!1:e==="/"||e==="/dashboard"||e.startsWith("/leaderboard")}function RV(){const t=vr(),e=$l(),n=N.useRef(!1);N.useEffect(()=>{if(!nT()||!CV(t.pathname||"/")||!e.enabled||!e.signedIn||e.loading||!iT())return;let i=!1;const r=window.setTimeout(()=>{(async()=>{if(!(i||n.current)){n.current=!0;try{await MV(()=>e.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{i=!0,window.clearTimeout(r)}},[t.pathname,e.enabled,e.signedIn,e.loading,e.getAccessToken])}function OC(){return typeof navigator>"u"?null:navigator.clipboard||null}function PV(){return typeof window>"u"?null:window.ClipboardItem||null}async function kV(t,{clipboard:e}={}){const n=e??OC();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(t),!0}catch{return!1}}async function v$(t,{clipboard:e}={}){const n=e??OC(),i=PV();if(!t||!n||typeof n.write!="function"||!i)return!1;try{const r=t.type||"image/png",s=t.type&&t.type!==r?t.slice(0,t.size,r):t.type?t:t.slice(0,t.size,r),o=new i({[r]:s});return await n.write([o]),!0}catch{return!1}}function LV(){if(typeof window>"u")return!1;const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||t==="::1"}function DV(){return LV()?"/":"/dashboard"}function NV({prefersReducedMotion:t,screenshotCapture:e}){return!(e||t)}function IV({repo:t="mm7894215/tokentracker"}){const[e,n]=N.useState(null);return N.useEffect(()=>{if(typeof window>"u")return;const i=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=typeof document<"u"&&(document.documentElement?.classList.contains("screenshot-capture")||document.body?.classList.contains("screenshot-capture"));NV({prefersReducedMotion:i,screenshotCapture:r})&&fetch(`https://api.github.com/repos/${t}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&n(s.stargazers_count)}).catch(()=>{})},[t]),B.jsxs("a",{href:`https://github.com/${t}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-2 px-3 py-1.5 rounded-md border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-700 transition-colors no-underline",children:[B.jsx("svg",{height:"16",viewBox:"0 0 16 16",width:"16",className:"shrink-0 fill-oai-gray-700 dark:fill-oai-gray-300",children:B.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),B.jsx("span",{className:"text-xs font-medium text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap",children:"Star"}),e!==null&&B.jsx("span",{className:"text-xs font-semibold text-oai-gray-900 dark:text-oai-white tabular-nums whitespace-nowrap",children:e})]})}const Hs={usageSummary:"tokentracker-usage-summary",usageDaily:"tokentracker-usage-daily",usageHourly:"tokentracker-usage-hourly",usageMonthly:"tokentracker-usage-monthly",usageHeatmap:"tokentracker-usage-heatmap",usageModelBreakdown:"tokentracker-usage-model-breakdown",projectUsageSummary:"tokentracker-project-usage-summary",userStatus:"tokentracker-user-status",localSync:"tokentracker-local-sync"};async function Da(t,e,n){const i=new URL(`/functions/${t}`,window.location.origin);if(e)for(const[s,o]of Object.entries(e))o!=null&&o!==""&&i.searchParams.set(s,String(o));const r=await fetch(i.toString(),{headers:{Accept:"application/json"},cache:"no-store",...n});if(!r.ok){const s=new Error(`Request failed with HTTP ${r.status}`);throw s.status=r.status,s}return r.json()}function Po({timeZone:t,tzOffsetMinutes:e}={}){const n={},i=typeof t=="string"?t.trim():"";return i&&(n.tz=i),Number.isFinite(e)&&(n.tz_offset_minutes=String(Math.trunc(e))),n}function ko({source:t,model:e}={}){const n={},i=typeof t=="string"?t.trim().toLowerCase():"";i&&(n.source=i);const r=typeof e=="string"?e.trim():"";return r&&(n.model=r),n}async function y$({from:t,to:e,source:n,model:i,timeZone:r,tzOffsetMinutes:s,rolling:o=!1,accessToken:c}={}){if(xr())return yV({from:t,to:e,seed:c,rolling:o});const u=Po({timeZone:r,tzOffsetMinutes:s}),f=ko({source:n,model:i}),h=o?{rolling:"1"}:{};return Da(Hs.usageSummary,{from:t,to:e,...f,...u,...h})}async function _$({from:t,to:e,source:n,limit:i,timeZone:r,tzOffsetMinutes:s,accessToken:o}={}){if(xr())return xV({seed:o,limit:i});const c=Po({timeZone:r,tzOffsetMinutes:s}),f={...ko({source:n}),...c};return t&&(f.from=t),e&&(f.to=e),i!=null&&(f.limit=String(i)),Da(Hs.projectUsageSummary,f)}async function ku(t,e={}){const n=Co();if(!n)throw new Error("InsForge base URL not configured");const i=n.replace(/\/$/,""),r=new URL(`${i}/functions/${t}`);if(e.params)for(const[u,f]of Object.entries(e.params))f!=null&&f!==""&&r.searchParams.set(u,String(f));const s={Accept:"application/json","Content-Type":"application/json"},o=Ah();o&&(s.apikey=o),e.accessToken&&(s.Authorization=`Bearer ${e.accessToken}`);const c=await fetch(r.toString(),{method:e.method||"GET",headers:s,...e.body!=null?{body:JSON.stringify(e.body)}:{}});if(!c.ok){const u=new Error(`Request failed with HTTP ${c.status}`);throw u.status=c.status,u}return c.json()}async function x$({accessToken:t,period:e,metric:n,limit:i,offset:r}={}){return xr()?DC({seed:t,period:e,metric:n,limit:i,offset:r}):ku("tokentracker-leaderboard",{accessToken:t,params:{period:e,limit:i,offset:r}})}async function UV({accessToken:t}={}){return ku("tokentracker-public-visibility",{accessToken:t,method:"GET"})}async function fE({accessToken:t,enabled:e,anonymous:n}={}){const i={};return e!==void 0&&(i.enabled=!!e),n!==void 0&&(i.anonymous=!!n),ku("tokentracker-public-visibility",{accessToken:t,method:"POST",body:i})}async function b$({accessToken:t,period:e}={}){return ku("tokentracker-leaderboard-refresh",{accessToken:t,method:"POST",body:e?{period:e}:{}})}async function S$({accessToken:t,userId:e,period:n}={}){if(xr()){const i=DC({seed:t,period:n,metric:"all",limit:250,offset:0}),s=(Array.isArray(i?.entries)?i.entries:[]).find(o=>o?.user_id===e)||null;return{period:i?.period??"week",from:i?.from??null,to:i?.to??null,generated_at:i?.generated_at??new Date().toISOString(),entry:s}}return ku("tokentracker-leaderboard-profile",{accessToken:t,params:{user_id:e,period:n}})}async function w$(t={}){if(xr()){const e=new Date().toISOString();return{user_id:"local-user",created_at:e,pro:{active:!1,sources:[],expires_at:null,partial:!1,as_of:e},subscriptions:{partial:!1,as_of:e,items:[]},install:{partial:!1,as_of:e,has_active_device_token:!1,has_active_device:!1,active_device_tokens:0,active_devices:0,latest_token_activity_at:null,latest_device_seen_at:null}}}return Da(Hs.userStatus)}async function E$({signal:t}={}){const e=await fetch(`/functions/${Hs.localSync}`,{method:"POST",headers:{Accept:"application/json"},cache:"no-store",signal:t}),n=await e.json().catch(()=>({ok:!1,error:`Local sync request failed with HTTP ${e.status}`}));if(!e.ok||n?.ok===!1){const i=n?.error||n?.message||`Local sync request failed with HTTP ${e.status}`,r=new Error(i);throw r.status=e.status,r}return n}async function M$({from:t,to:e,source:n,timeZone:i,tzOffsetMinutes:r,accessToken:s}={}){if(xr())return wV({from:t,to:e,seed:s});const o=Po({timeZone:i,tzOffsetMinutes:r}),c=ko({source:n});return Da(Hs.usageModelBreakdown,{from:t,to:e,...c,...o})}async function T$({from:t,to:e,source:n,model:i,timeZone:r,tzOffsetMinutes:s,accessToken:o}={}){if(xr())return mV({from:t,to:e,seed:o});const c=Po({timeZone:r,tzOffsetMinutes:s}),u=ko({source:n,model:i});return Da(Hs.usageDaily,{from:t,to:e,...u,...c})}async function A$({day:t,source:e,model:n,timeZone:i,tzOffsetMinutes:r,accessToken:s}={}){if(xr())return gV({day:t,seed:s});const o=Po({timeZone:i,tzOffsetMinutes:r}),c=ko({source:e,model:n}),u=t?{day:t,...c,...o}:{...c,...o};return Da(Hs.usageHourly,u)}async function C$({months:t,to:e,source:n,model:i,timeZone:r,tzOffsetMinutes:s,accessToken:o}={}){if(xr())return vV({months:t,to:e,seed:o});const c=Po({timeZone:r,tzOffsetMinutes:s}),u=ko({source:n,model:i});return Da(Hs.usageMonthly,{...t?{months:String(t)}:{},...e?{to:e}:{},...u,...c})}async function R$({weeks:t,to:e,weekStartsOn:n,source:i,model:r,timeZone:s,tzOffsetMinutes:o,accessToken:c}={}){if(xr())return SV({weeks:t,to:e,weekStartsOn:n,seed:c});const u=Po({timeZone:s,tzOffsetMinutes:o}),f=ko({source:i,model:r});return Da(Hs.usageHeatmap,{weeks:String(t),to:e,week_starts_on:n,...f,...u})}function FV(t){if(!t||typeof t!="object")return"";const e=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},i=e.full_name||e.name||n.name||e.user_name||e.preferred_username;return typeof i=="string"&&i.trim()?i.trim():typeof t.email=="string"&&t.email.includes("@")?t.email.split("@")[0].trim()||t.email.trim():typeof t.email=="string"?t.email.trim():""}function OV(t){return!t||typeof t!="object"?"":typeof t.email=="string"?t.email.trim():""}function BV(t){if(!t||typeof t!="object")return null;const e=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},i=e.avatar_url||e.picture||n.avatar_url||t.avatar_url;return typeof i=="string"&&i.trim()?i.trim():null}function hE(t){const e=String(t||"").trim();if(!e)return"?";const n=e.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function zV({checked:t,onChange:e,disabled:n,ariaLabel:i}){return B.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i,onClick:e,disabled:n,className:Si("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 disabled:opacity-50 disabled:cursor-not-allowed",t?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:B.jsx("span",{className:Si("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",t?"translate-x-[18px]":"translate-x-[3px]")})})}function tg({label:t,checked:e,onChange:n,disabled:i}){return B.jsxs("div",{className:"flex items-center justify-between py-2",children:[B.jsx("span",{className:"text-sm text-oai-gray-700 dark:text-oai-gray-300",children:t}),B.jsx(zV,{checked:e,onChange:n,disabled:i,ariaLabel:t})]})}function VV({className:t}){vr();const{enabled:e,loading:n,signedIn:i,user:r,signOut:s,getAccessToken:o}=$l(),{openLoginModal:c}=ET(),[u,f]=N.useState(!1),[h,p]=N.useState(()=>iT()),[m,v]=N.useState(!1),[_,w]=N.useState(!1),[y,x]=N.useState(!1),[M,A]=N.useState(!1),T=N.useRef(null),D=e&&i&&nT(),I=N.useMemo(()=>FV(r),[r]),U=N.useMemo(()=>OV(r),[r]),S=N.useMemo(()=>BV(r),[r]);N.useEffect(()=>{if(!u)return;const X=V=>{T.current&&!T.current.contains(V.target)&&f(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[u]),N.useEffect(()=>{if(!u||!i)return;let X=!0;return x(!0),(async()=>{try{const V=await Lm({getAccessToken:o});if(!X||!V)return;const q=await UV({accessToken:V});if(!X)return;v(!!q?.enabled),w(!!q?.anonymous)}catch{}finally{X&&x(!1)}})(),()=>{X=!1}},[u,i,o]);const R=N.useCallback(async()=>{f(!1),await s()},[s]),H=N.useCallback(async()=>{const X=!h;if(mI(X),p(X),X)try{await TV(()=>o())}catch(V){console.warn("[tokentracker] cloud sync:",V)}},[h,o]),F=N.useCallback(async()=>{if(!M){A(!0);try{const X=await Lm({getAccessToken:o});if(!X)return;const V=!m;await fE({accessToken:X,enabled:V}),v(V)}catch{}finally{A(!1)}}},[m,M,o]),W=N.useCallback(async()=>{if(!M){A(!0);try{const X=await Lm({getAccessToken:o});if(!X)return;const V=!_;await fE({accessToken:X,anonymous:V}),w(V)}catch{}finally{A(!1)}}},[_,M,o]);return e?n?B.jsx("div",{className:Si("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",t),"aria-hidden":!0}):i?B.jsxs("div",{ref:T,className:Si("relative flex shrink-0 items-center",t),children:[B.jsxs("button",{type:"button",onClick:()=>f(X=>!X),className:"flex items-center gap-2 rounded-full pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors","aria-expanded":u,"aria-haspopup":"menu",children:[S?B.jsx("img",{src:S,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer"}):B.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:hE(I)}),B.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:I})]}),B.jsx(QA,{children:u&&B.jsxs(go.div,{className:"absolute right-0 top-full z-[60] mt-2 w-[280px] rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-2xl overflow-hidden",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:[B.jsxs("div",{className:"px-4 py-3 border-b border-oai-gray-200 dark:border-oai-gray-800 flex items-center gap-3",children:[S?B.jsx("img",{src:S,alt:"",width:36,height:36,className:"h-9 w-9 rounded-full object-cover ring-1 ring-oai-gray-200 dark:ring-oai-gray-700",referrerPolicy:"no-referrer"}):B.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white",children:hE(I)}),B.jsxs("div",{className:"min-w-0",children:[B.jsx("div",{className:"text-sm font-medium text-oai-black dark:text-white truncate",children:I}),U&&B.jsx("div",{className:"text-xs text-oai-gray-500 truncate",children:U})]})]}),B.jsxs("div",{className:"px-4 py-2 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[D&&B.jsx(tg,{label:"Cloud Sync",checked:h,onChange:H}),B.jsx(tg,{label:"Public Profile",checked:m,onChange:F,disabled:y||M}),B.jsx(tg,{label:"Anonymous",checked:_,onChange:W,disabled:y||M})]}),B.jsxs("button",{type:"button",onClick:R,className:"flex w-full items-center gap-2 px-4 py-3 text-left text-sm text-oai-gray-500 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors",children:[B.jsx(Xz,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),"Sign Out"]})]})})]}):B.jsx("button",{type:"button",onClick:c,className:Si("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",t),"aria-label":qt("header.auth.sign_in_aria"),children:"Sign In"}):null}const Wy="183",HV=0,pE=1,GV=2,Ff=1,WV=2,Jc=3,Pa=0,Gi=1,ks=2,Ns=0,vo=1,mE=2,gE=3,vE=4,jV=5,ro=100,$V=101,XV=102,qV=103,YV=104,KV=200,ZV=201,JV=202,QV=203,I0=204,U0=205,eH=206,tH=207,nH=208,iH=209,rH=210,sH=211,aH=212,oH=213,lH=214,F0=0,O0=1,B0=2,Bl=3,z0=4,V0=5,H0=6,G0=7,BC=0,cH=1,uH=2,ns=0,zC=1,VC=2,HC=3,GC=4,WC=5,jC=6,$C=7,XC=300,Eo=301,zl=302,ng=303,ig=304,Ih=306,W0=1e3,Ls=1001,j0=1002,pi=1003,dH=1004,Yd=1005,wi=1006,rg=1007,uo=1008,fr=1009,qC=1010,YC=1011,vu=1012,jy=1013,cs=1014,Jr=1015,Os=1016,$y=1017,Xy=1018,yu=1020,KC=35902,ZC=35899,JC=1021,QC=1022,Ur=1023,Bs=1026,fo=1027,eR=1028,qy=1029,Vl=1030,Yy=1031,Ky=1033,Of=33776,Bf=33777,zf=33778,Vf=33779,$0=35840,X0=35841,q0=35842,Y0=35843,K0=36196,Z0=37492,J0=37496,Q0=37488,ev=37489,tv=37490,nv=37491,iv=37808,rv=37809,sv=37810,av=37811,ov=37812,lv=37813,cv=37814,uv=37815,dv=37816,fv=37817,hv=37818,pv=37819,mv=37820,gv=37821,vv=36492,yv=36494,_v=36495,xv=36283,bv=36284,Sv=36285,wv=36286,fH=3200,hH=0,pH=1,Sa="",ur="srgb",Mo="srgb-linear",mh="linear",wn="srgb",sl=7680,yE=519,mH=512,gH=513,vH=514,Zy=515,yH=516,_H=517,Jy=518,xH=519,_E=35044,xE="300 es",Qr=2e3,gh=2001;function bH(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function vh(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function SH(){const t=vh("canvas");return t.style.display="block",t}const bE={};function SE(...t){const e="THREE."+t.shift();console.log(e,...t)}function tR(t){const e=t[0];if(typeof e=="string"&&e.startsWith("TSL:")){const n=t[1];n&&n.isStackTrace?t[0]+=" "+n.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function Ht(...t){t=tR(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.warn(n.getError(e)):console.warn(e,...t)}}function _n(...t){t=tR(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.error(n.getError(e)):console.error(e,...t)}}function yh(...t){const e=t.join(" ");e in bE||(bE[e]=!0,Ht(...t))}function wH(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}const EH={[F0]:O0,[B0]:H0,[z0]:G0,[Bl]:V0,[O0]:F0,[H0]:B0,[G0]:z0,[V0]:Bl};class Zl{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const _i=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],sg=Math.PI/180,Ev=180/Math.PI;function Lu(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(_i[t&255]+_i[t>>8&255]+_i[t>>16&255]+_i[t>>24&255]+"-"+_i[e&255]+_i[e>>8&255]+"-"+_i[e>>16&15|64]+_i[e>>24&255]+"-"+_i[n&63|128]+_i[n>>8&255]+"-"+_i[n>>16&255]+_i[n>>24&255]+_i[i&255]+_i[i>>8&255]+_i[i>>16&255]+_i[i>>24&255]).toLowerCase()}function ln(t,e,n){return Math.max(e,Math.min(n,t))}function MH(t,e){return(t%e+e)%e}function ag(t,e,n){return(1-n)*t+n*e}function Bc(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Hi(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class bn{constructor(e=0,n=0){bn.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+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,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Jl{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,o,c){let u=i[r+0],f=i[r+1],h=i[r+2],p=i[r+3],m=s[o+0],v=s[o+1],_=s[o+2],w=s[o+3];if(p!==w||u!==m||f!==v||h!==_){let y=u*m+f*v+h*_+p*w;y<0&&(m=-m,v=-v,_=-_,w=-w,y=-y);let x=1-c;if(y<.9995){const M=Math.acos(y),A=Math.sin(M);x=Math.sin(x*M)/A,c=Math.sin(c*M)/A,u=u*x+m*c,f=f*x+v*c,h=h*x+_*c,p=p*x+w*c}else{u=u*x+m*c,f=f*x+v*c,h=h*x+_*c,p=p*x+w*c;const M=1/Math.sqrt(u*u+f*f+h*h+p*p);u*=M,f*=M,h*=M,p*=M}}e[n]=u,e[n+1]=f,e[n+2]=h,e[n+3]=p}static multiplyQuaternionsFlat(e,n,i,r,s,o){const c=i[r],u=i[r+1],f=i[r+2],h=i[r+3],p=s[o],m=s[o+1],v=s[o+2],_=s[o+3];return e[n]=c*_+h*p+u*v-f*m,e[n+1]=u*_+h*m+f*p-c*v,e[n+2]=f*_+h*v+c*m-u*p,e[n+3]=h*_-c*p-u*m-f*v,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,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,n=!0){const i=e._x,r=e._y,s=e._z,o=e._order,c=Math.cos,u=Math.sin,f=c(i/2),h=c(r/2),p=c(s/2),m=u(i/2),v=u(r/2),_=u(s/2);switch(o){case"XYZ":this._x=m*h*p+f*v*_,this._y=f*v*p-m*h*_,this._z=f*h*_+m*v*p,this._w=f*h*p-m*v*_;break;case"YXZ":this._x=m*h*p+f*v*_,this._y=f*v*p-m*h*_,this._z=f*h*_-m*v*p,this._w=f*h*p+m*v*_;break;case"ZXY":this._x=m*h*p-f*v*_,this._y=f*v*p+m*h*_,this._z=f*h*_+m*v*p,this._w=f*h*p-m*v*_;break;case"ZYX":this._x=m*h*p-f*v*_,this._y=f*v*p+m*h*_,this._z=f*h*_-m*v*p,this._w=f*h*p+m*v*_;break;case"YZX":this._x=m*h*p+f*v*_,this._y=f*v*p+m*h*_,this._z=f*h*_-m*v*p,this._w=f*h*p-m*v*_;break;case"XZY":this._x=m*h*p-f*v*_,this._y=f*v*p-m*h*_,this._z=f*h*_+m*v*p,this._w=f*h*p+m*v*_;break;default:Ht("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],s=n[8],o=n[1],c=n[5],u=n[9],f=n[2],h=n[6],p=n[10],m=i+c+p;if(m>0){const v=.5/Math.sqrt(m+1);this._w=.25/v,this._x=(h-u)*v,this._y=(s-f)*v,this._z=(o-r)*v}else if(i>c&&i>p){const v=2*Math.sqrt(1+i-c-p);this._w=(h-u)/v,this._x=.25*v,this._y=(r+o)/v,this._z=(s+f)/v}else if(c>p){const v=2*Math.sqrt(1+c-i-p);this._w=(s-f)/v,this._x=(r+o)/v,this._y=.25*v,this._z=(u+h)/v}else{const v=2*Math.sqrt(1+p-i-c);this._w=(o-r)/v,this._x=(s+f)/v,this._y=(u+h)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.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*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ln(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/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,n){const i=e._x,r=e._y,s=e._z,o=e._w,c=n._x,u=n._y,f=n._z,h=n._w;return this._x=i*h+o*c+r*f-s*u,this._y=r*h+o*u+s*c-i*f,this._z=s*h+o*f+i*u-r*c,this._w=o*h-i*c-r*u-s*f,this._onChangeCallback(),this}slerp(e,n){let i=e._x,r=e._y,s=e._z,o=e._w,c=this.dot(e);c<0&&(i=-i,r=-r,s=-s,o=-o,c=-c);let u=1-n;if(c<.9995){const f=Math.acos(c),h=Math.sin(f);u=Math.sin(u*f)/h,n=Math.sin(n*f)/h,this._x=this._x*u+i*n,this._y=this._y*u+r*n,this._z=this._z*u+s*n,this._w=this._w*u+o*n,this._onChangeCallback()}else this._x=this._x*u+i*n,this._y=this._y*u+r*n,this._z=this._z*u+s*n,this._w=this._w*u+o*n,this.normalize();return this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class me{constructor(e=0,n=0,i=0){me.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(wE.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(wE.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,s=e.x,o=e.y,c=e.z,u=e.w,f=2*(o*r-c*i),h=2*(c*n-s*r),p=2*(s*i-o*n);return this.x=n+u*f+o*p-c*h,this.y=i+u*h+c*f-s*p,this.z=r+u*p+s*h-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){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this.z=ln(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this.z=ln(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.z,o=n.x,c=n.y,u=n.z;return this.x=r*u-s*c,this.y=s*o-i*u,this.z=i*c-r*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return og.copy(this).projectOnVector(e),this.sub(og)}reflect(e){return this.sub(og.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+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,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const og=new me,wE=new Jl;class Wt{constructor(e,n,i,r,s,o,c,u,f){Wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,c,u,f)}set(e,n,i,r,s,o,c,u,f){const h=this.elements;return h[0]=e,h[1]=r,h[2]=c,h[3]=n,h[4]=s,h[5]=u,h[6]=i,h[7]=o,h[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],c=i[3],u=i[6],f=i[1],h=i[4],p=i[7],m=i[2],v=i[5],_=i[8],w=r[0],y=r[3],x=r[6],M=r[1],A=r[4],T=r[7],D=r[2],I=r[5],U=r[8];return s[0]=o*w+c*M+u*D,s[3]=o*y+c*A+u*I,s[6]=o*x+c*T+u*U,s[1]=f*w+h*M+p*D,s[4]=f*y+h*A+p*I,s[7]=f*x+h*T+p*U,s[2]=m*w+v*M+_*D,s[5]=m*y+v*A+_*I,s[8]=m*x+v*T+_*U,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],f=e[7],h=e[8];return n*o*h-n*c*f-i*s*h+i*c*u+r*s*f-r*o*u}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],f=e[7],h=e[8],p=h*o-c*f,m=c*u-h*s,v=f*s-o*u,_=n*p+i*m+r*v;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/_;return e[0]=p*w,e[1]=(r*f-h*i)*w,e[2]=(c*i-r*o)*w,e[3]=m*w,e[4]=(h*n-r*u)*w,e[5]=(r*s-c*n)*w,e[6]=v*w,e[7]=(i*u-f*n)*w,e[8]=(o*n-i*s)*w,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,s,o,c){const u=Math.cos(s),f=Math.sin(s);return this.set(i*u,i*f,-i*(u*o+f*c)+o+e,-r*f,r*u,-r*(-f*o+u*c)+c+n,0,0,1),this}scale(e,n){return this.premultiply(lg.makeScale(e,n)),this}rotate(e){return this.premultiply(lg.makeRotation(-e)),this}translate(e,n){return this.premultiply(lg.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const lg=new Wt,EE=new Wt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ME=new Wt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function TH(){const t={enabled:!0,workingColorSpace:Mo,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===wn&&(r.r=Is(r.r),r.g=Is(r.g),r.b=Is(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wn&&(r.r=kl(r.r),r.g=kl(r.g),r.b=kl(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Sa?mh:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].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,s){return yh("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return yh("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Mo]:{primaries:e,whitePoint:i,transfer:mh,toXYZ:EE,fromXYZ:ME,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:ur},outputColorSpaceConfig:{drawingBufferColorSpace:ur}},[ur]:{primaries:e,whitePoint:i,transfer:wn,toXYZ:EE,fromXYZ:ME,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:ur}}}),t}const fn=TH();function Is(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function kl(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let al;class AH{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{al===void 0&&(al=vh("canvas")),al.width=e.width,al.height=e.height;const r=al.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=al}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=vh("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Is(s[o]/255)*255;return i.putImageData(r,0,0),n}else if(e.data){const n=e.data.slice(0);for(let i=0;i<n.length;i++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[i]=Math.floor(Is(n[i]/255)*255):n[i]=Is(n[i]);return{data:n,width:e.width,height:e.height}}else return Ht("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let CH=0;class Qy{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:CH++}),this.uuid=Lu(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):typeof VideoFrame<"u"&&n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,c=r.length;o<c;o++)r[o].isDataTexture?s.push(cg(r[o].image)):s.push(cg(r[o]))}else s=cg(r);i.url=s}return n||(e.images[this.uuid]=i),i}}function cg(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?AH.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(Ht("Texture: Unable to serialize Texture."),{})}let RH=0;const ug=new me;class Li extends Zl{constructor(e=Li.DEFAULT_IMAGE,n=Li.DEFAULT_MAPPING,i=Ls,r=Ls,s=wi,o=uo,c=Ur,u=fr,f=Li.DEFAULT_ANISOTROPY,h=Sa){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:RH++}),this.uuid=Lu(),this.name="",this.source=new Qy(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=f,this.format=c,this.internalFormat=null,this.type=u,this.offset=new bn(0,0),this.repeat=new bn(1,1),this.center=new bn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Wt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,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(ug).x}get height(){return this.source.getSize(ug).y}get depth(){return this.source.getSize(ug).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,n){this.updateRanges.push({start:e,count:n})}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(const n in e){const i=e[n];if(i===void 0){Ht(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Ht(`Texture.setValues(): property '${n}' 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[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const 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),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==XC)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case W0:e.x=e.x-Math.floor(e.x);break;case Ls:e.x=e.x<0?0:1;break;case j0: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 W0:e.y=e.y-Math.floor(e.y);break;case Ls:e.y=e.y<0?0:1;break;case j0: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++}}Li.DEFAULT_IMAGE=null;Li.DEFAULT_MAPPING=XC;Li.DEFAULT_ANISOTROPY=1;class zn{constructor(e=0,n=0,i=0,r=1){zn.prototype.isVector4=!0,this.x=e,this.y=n,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,n,i,r){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*n+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*n+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*n+o[7]*i+o[11]*r+o[15]*s,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);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const u=e.elements,f=u[0],h=u[4],p=u[8],m=u[1],v=u[5],_=u[9],w=u[2],y=u[6],x=u[10];if(Math.abs(h-m)<.01&&Math.abs(p-w)<.01&&Math.abs(_-y)<.01){if(Math.abs(h+m)<.1&&Math.abs(p+w)<.1&&Math.abs(_+y)<.1&&Math.abs(f+v+x-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const A=(f+1)/2,T=(v+1)/2,D=(x+1)/2,I=(h+m)/4,U=(p+w)/4,S=(_+y)/4;return A>T&&A>D?A<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(A),r=I/i,s=U/i):T>D?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=I/r,s=S/r):D<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(D),i=U/s,r=S/s),this.set(i,r,s,n),this}let M=Math.sqrt((y-_)*(y-_)+(p-w)*(p-w)+(m-h)*(m-h));return Math.abs(M)<.001&&(M=1),this.x=(y-_)/M,this.y=(p-w)/M,this.z=(m-h)/M,this.w=Math.acos((f+v+x-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this.z=ln(this.z,e.z,n.z),this.w=ln(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this.z=ln(this.z,e,n),this.w=ln(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class PH extends Zl{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wi,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=n,this.depth=i.depth,this.scissor=new zn(0,0,e,n),this.scissorTest=!1,this.viewport=new zn(0,0,e,n),this.textures=[];const r={width:e,height:n,depth:i.depth},s=new Li(r),o=i.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0,this.textures[c].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={}){const n={minFilter:wi,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(n)}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,n,i=1){if(this.width!==e||this.height!==n||this.depth!==i){this.width=e,this.height=n,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=n,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,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const r=Object.assign({},e.textures[n].image);this.textures[n].source=new Qy(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"})}}class is extends PH{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class nR extends Li{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=pi,this.minFilter=pi,this.wrapR=Ls,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class kH extends Li{constructor(e=null,n=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=pi,this.minFilter=pi,this.wrapR=Ls,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yn{constructor(e,n,i,r,s,o,c,u,f,h,p,m,v,_,w,y){Yn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,c,u,f,h,p,m,v,_,w,y)}set(e,n,i,r,s,o,c,u,f,h,p,m,v,_,w,y){const x=this.elements;return x[0]=e,x[4]=n,x[8]=i,x[12]=r,x[1]=s,x[5]=o,x[9]=c,x[13]=u,x[2]=f,x[6]=h,x[10]=p,x[14]=m,x[3]=v,x[7]=_,x[11]=w,x[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Yn().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,i=e.elements,r=1/ol.setFromMatrixColumn(e,0).length(),s=1/ol.setFromMatrixColumn(e,1).length(),o=1/ol.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),c=Math.sin(i),u=Math.cos(r),f=Math.sin(r),h=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const m=o*h,v=o*p,_=c*h,w=c*p;n[0]=u*h,n[4]=-u*p,n[8]=f,n[1]=v+_*f,n[5]=m-w*f,n[9]=-c*u,n[2]=w-m*f,n[6]=_+v*f,n[10]=o*u}else if(e.order==="YXZ"){const m=u*h,v=u*p,_=f*h,w=f*p;n[0]=m+w*c,n[4]=_*c-v,n[8]=o*f,n[1]=o*p,n[5]=o*h,n[9]=-c,n[2]=v*c-_,n[6]=w+m*c,n[10]=o*u}else if(e.order==="ZXY"){const m=u*h,v=u*p,_=f*h,w=f*p;n[0]=m-w*c,n[4]=-o*p,n[8]=_+v*c,n[1]=v+_*c,n[5]=o*h,n[9]=w-m*c,n[2]=-o*f,n[6]=c,n[10]=o*u}else if(e.order==="ZYX"){const m=o*h,v=o*p,_=c*h,w=c*p;n[0]=u*h,n[4]=_*f-v,n[8]=m*f+w,n[1]=u*p,n[5]=w*f+m,n[9]=v*f-_,n[2]=-f,n[6]=c*u,n[10]=o*u}else if(e.order==="YZX"){const m=o*u,v=o*f,_=c*u,w=c*f;n[0]=u*h,n[4]=w-m*p,n[8]=_*p+v,n[1]=p,n[5]=o*h,n[9]=-c*h,n[2]=-f*h,n[6]=v*p+_,n[10]=m-w*p}else if(e.order==="XZY"){const m=o*u,v=o*f,_=c*u,w=c*f;n[0]=u*h,n[4]=-p,n[8]=f*h,n[1]=m*p+w,n[5]=o*h,n[9]=v*p-_,n[2]=_*p-v,n[6]=c*h,n[10]=w*p+m}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(LH,e,DH)}lookAt(e,n,i){const r=this.elements;return Ki.subVectors(e,n),Ki.lengthSq()===0&&(Ki.z=1),Ki.normalize(),fa.crossVectors(i,Ki),fa.lengthSq()===0&&(Math.abs(i.z)===1?Ki.x+=1e-4:Ki.z+=1e-4,Ki.normalize(),fa.crossVectors(i,Ki)),fa.normalize(),Kd.crossVectors(Ki,fa),r[0]=fa.x,r[4]=Kd.x,r[8]=Ki.x,r[1]=fa.y,r[5]=Kd.y,r[9]=Ki.y,r[2]=fa.z,r[6]=Kd.z,r[10]=Ki.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],c=i[4],u=i[8],f=i[12],h=i[1],p=i[5],m=i[9],v=i[13],_=i[2],w=i[6],y=i[10],x=i[14],M=i[3],A=i[7],T=i[11],D=i[15],I=r[0],U=r[4],S=r[8],R=r[12],H=r[1],F=r[5],W=r[9],X=r[13],V=r[2],q=r[6],J=r[10],Q=r[14],$=r[3],Y=r[7],Z=r[11],z=r[15];return s[0]=o*I+c*H+u*V+f*$,s[4]=o*U+c*F+u*q+f*Y,s[8]=o*S+c*W+u*J+f*Z,s[12]=o*R+c*X+u*Q+f*z,s[1]=h*I+p*H+m*V+v*$,s[5]=h*U+p*F+m*q+v*Y,s[9]=h*S+p*W+m*J+v*Z,s[13]=h*R+p*X+m*Q+v*z,s[2]=_*I+w*H+y*V+x*$,s[6]=_*U+w*F+y*q+x*Y,s[10]=_*S+w*W+y*J+x*Z,s[14]=_*R+w*X+y*Q+x*z,s[3]=M*I+A*H+T*V+D*$,s[7]=M*U+A*F+T*q+D*Y,s[11]=M*S+A*W+T*J+D*Z,s[15]=M*R+A*X+T*Q+D*z,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],o=e[1],c=e[5],u=e[9],f=e[13],h=e[2],p=e[6],m=e[10],v=e[14],_=e[3],w=e[7],y=e[11],x=e[15],M=u*v-f*m,A=c*v-f*p,T=c*m-u*p,D=o*v-f*h,I=o*m-u*h,U=o*p-c*h;return n*(w*M-y*A+x*T)-i*(_*M-y*D+x*I)+r*(_*A-w*D+x*U)-s*(_*T-w*I+y*U)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],f=e[7],h=e[8],p=e[9],m=e[10],v=e[11],_=e[12],w=e[13],y=e[14],x=e[15],M=n*c-i*o,A=n*u-r*o,T=n*f-s*o,D=i*u-r*c,I=i*f-s*c,U=r*f-s*u,S=h*w-p*_,R=h*y-m*_,H=h*x-v*_,F=p*y-m*w,W=p*x-v*w,X=m*x-v*y,V=M*X-A*W+T*F+D*H-I*R+U*S;if(V===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const q=1/V;return e[0]=(c*X-u*W+f*F)*q,e[1]=(r*W-i*X-s*F)*q,e[2]=(w*U-y*I+x*D)*q,e[3]=(m*I-p*U-v*D)*q,e[4]=(u*H-o*X-f*R)*q,e[5]=(n*X-r*H+s*R)*q,e[6]=(y*T-_*U-x*A)*q,e[7]=(h*U-m*T+v*A)*q,e[8]=(o*W-c*H+f*S)*q,e[9]=(i*H-n*W-s*S)*q,e[10]=(_*I-w*T+x*M)*q,e[11]=(p*T-h*I-v*M)*q,e[12]=(c*R-o*F-u*S)*q,e[13]=(n*F-i*R+r*S)*q,e[14]=(w*A-_*D-y*M)*q,e[15]=(h*D-p*A+m*M)*q,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=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(n,i,r))}makeTranslation(e,n,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,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=e.x,c=e.y,u=e.z,f=s*o,h=s*c;return this.set(f*o+i,f*c-r*u,f*u+r*c,0,f*c+r*u,h*c+i,h*u-r*o,0,f*u-r*c,h*u+r*o,s*u*u+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,o=n._y,c=n._z,u=n._w,f=s+s,h=o+o,p=c+c,m=s*f,v=s*h,_=s*p,w=o*h,y=o*p,x=c*p,M=u*f,A=u*h,T=u*p,D=i.x,I=i.y,U=i.z;return r[0]=(1-(w+x))*D,r[1]=(v+T)*D,r[2]=(_-A)*D,r[3]=0,r[4]=(v-T)*I,r[5]=(1-(m+x))*I,r[6]=(y+M)*I,r[7]=0,r[8]=(_+A)*U,r[9]=(y-M)*U,r[10]=(1-(m+w))*U,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),n.identity(),this;let o=ol.set(r[0],r[1],r[2]).length();const c=ol.set(r[4],r[5],r[6]).length(),u=ol.set(r[8],r[9],r[10]).length();s<0&&(o=-o),Pr.copy(this);const f=1/o,h=1/c,p=1/u;return Pr.elements[0]*=f,Pr.elements[1]*=f,Pr.elements[2]*=f,Pr.elements[4]*=h,Pr.elements[5]*=h,Pr.elements[6]*=h,Pr.elements[8]*=p,Pr.elements[9]*=p,Pr.elements[10]*=p,n.setFromRotationMatrix(Pr),i.x=o,i.y=c,i.z=u,this}makePerspective(e,n,i,r,s,o,c=Qr,u=!1){const f=this.elements,h=2*s/(n-e),p=2*s/(i-r),m=(n+e)/(n-e),v=(i+r)/(i-r);let _,w;if(u)_=s/(o-s),w=o*s/(o-s);else if(c===Qr)_=-(o+s)/(o-s),w=-2*o*s/(o-s);else if(c===gh)_=-o/(o-s),w=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return f[0]=h,f[4]=0,f[8]=m,f[12]=0,f[1]=0,f[5]=p,f[9]=v,f[13]=0,f[2]=0,f[6]=0,f[10]=_,f[14]=w,f[3]=0,f[7]=0,f[11]=-1,f[15]=0,this}makeOrthographic(e,n,i,r,s,o,c=Qr,u=!1){const f=this.elements,h=2/(n-e),p=2/(i-r),m=-(n+e)/(n-e),v=-(i+r)/(i-r);let _,w;if(u)_=1/(o-s),w=o/(o-s);else if(c===Qr)_=-2/(o-s),w=-(o+s)/(o-s);else if(c===gh)_=-1/(o-s),w=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return f[0]=h,f[4]=0,f[8]=0,f[12]=m,f[1]=0,f[5]=p,f[9]=0,f[13]=v,f[2]=0,f[6]=0,f[10]=_,f[14]=w,f[3]=0,f[7]=0,f[11]=0,f[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const ol=new me,Pr=new Yn,LH=new me(0,0,0),DH=new me(1,1,1),fa=new me,Kd=new me,Ki=new me,TE=new Yn,AE=new Jl;let To=class iR{constructor(e=0,n=0,i=0,r=iR.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,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,n,i,r=this._order){return this._x=e,this._y=n,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,n=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],c=r[8],u=r[1],f=r[5],h=r[9],p=r[2],m=r[6],v=r[10];switch(n){case"XYZ":this._y=Math.asin(ln(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,f),this._z=0);break;case"YXZ":this._x=Math.asin(-ln(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(c,v),this._z=Math.atan2(u,f)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(ln(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,v),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-ln(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,v),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(ln(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,f),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(c,v));break;case"XZY":this._z=Math.asin(-ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,f),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-h,v),this._y=0);break;default:Ht("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return TE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(TE,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return AE.setFromEuler(this),this.setFromQuaternion(AE,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};To.DEFAULT_ORDER="XYZ";class rR{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}}let NH=0;const CE=new me,ll=new Jl,Es=new Yn,Zd=new me,zc=new me,IH=new me,UH=new Jl,RE=new me(1,0,0),PE=new me(0,1,0),kE=new me(0,0,1),LE={type:"added"},FH={type:"removed"},cl={type:"childadded",child:null},dg={type:"childremoved",child:null};class er extends Zl{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:NH++}),this.uuid=Lu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=er.DEFAULT_UP.clone();const e=new me,n=new To,i=new Jl,r=new me(1,1,1);function s(){i.setFromEuler(n,!1)}function o(){n.setFromQuaternion(i,void 0,!1)}n._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Yn},normalMatrix:{value:new Wt}}),this.matrix=new Yn,this.matrixWorld=new Yn,this.matrixAutoUpdate=er.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new rR,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,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return ll.setFromAxisAngle(e,n),this.quaternion.multiply(ll),this}rotateOnWorldAxis(e,n){return ll.setFromAxisAngle(e,n),this.quaternion.premultiply(ll),this}rotateX(e){return this.rotateOnAxis(RE,e)}rotateY(e){return this.rotateOnAxis(PE,e)}rotateZ(e){return this.rotateOnAxis(kE,e)}translateOnAxis(e,n){return CE.copy(e).applyQuaternion(this.quaternion),this.position.add(CE.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(RE,e)}translateY(e){return this.translateOnAxis(PE,e)}translateZ(e){return this.translateOnAxis(kE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Es.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?Zd.copy(e):Zd.set(e,n,i);const r=this.parent;this.updateWorldMatrix(!0,!1),zc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Es.lookAt(zc,Zd,this.up):Es.lookAt(Zd,zc,this.up),this.quaternion.setFromRotationMatrix(Es),r&&(Es.extractRotation(r.matrixWorld),ll.setFromRotationMatrix(Es),this.quaternion.premultiply(ll.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(_n("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(LE),cl.child=e,this.dispatchEvent(cl),cl.child=null):_n("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}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(FH),dg.child=e,this.dispatchEvent(dg),dg.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Es.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Es.multiply(e.parent.matrixWorld)),e.applyMatrix4(Es),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(LE),cl.child=e,this.dispatchEvent(cl),cl.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,n);if(o!==void 0)return o}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(zc,e,IH),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(zc,UH,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const n=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=n-s[0]*n-s[4]*i-s[8]*r,s[13]+=i-s[1]*n-s[5]*i-s[9]*r,s[14]+=r-s[2]*n-s[6]*i-s[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);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n){const 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)),n===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const 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(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(c=>({...c})),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 s(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const u=c.shapes;if(Array.isArray(u))for(let f=0,h=u.length;f<h;f++){const p=u[f];s(e.shapes,p)}else s(e.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let u=0,f=this.material.length;u<f;u++)c.push(s(e.materials,this.material[u]));r.material=c}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let c=0;c<this.children.length;c++)r.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let c=0;c<this.animations.length;c++){const u=this.animations[c];r.animations.push(s(e.animations,u))}}if(n){const c=o(e.geometries),u=o(e.materials),f=o(e.textures),h=o(e.images),p=o(e.shapes),m=o(e.skeletons),v=o(e.animations),_=o(e.nodes);c.length>0&&(i.geometries=c),u.length>0&&(i.materials=u),f.length>0&&(i.textures=f),h.length>0&&(i.images=h),p.length>0&&(i.shapes=p),m.length>0&&(i.skeletons=m),v.length>0&&(i.animations=v),_.length>0&&(i.nodes=_)}return i.object=r,i;function o(c){const u=[];for(const f in c){const h=c[f];delete h.metadata,u.push(h)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),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)),n===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}er.DEFAULT_UP=new me(0,1,0);er.DEFAULT_MATRIX_AUTO_UPDATE=!0;er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class Jd extends er{constructor(){super(),this.isGroup=!0,this.type="Group"}}const OH={type:"move"};class fg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Jd,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 Jd,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new me,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new me),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Jd,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new me,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new me),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,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,n,i){let r=null,s=null,o=null;const c=this._targetRay,u=this._grip,f=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const w of e.hand.values()){const y=n.getJointPose(w,i),x=this._getHandJoint(f,w);y!==null&&(x.matrix.fromArray(y.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=y.radius),x.visible=y!==null}const h=f.joints["index-finger-tip"],p=f.joints["thumb-tip"],m=h.position.distanceTo(p.position),v=.02,_=.005;f.inputState.pinching&&m>v+_?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&m<=v-_&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));c!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(OH)))}return c!==null&&(c.visible=r!==null),u!==null&&(u.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new Jd;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}const sR={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},ha={h:0,s:0,l:0},Qd={h:0,s:0,l:0};function hg(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class Mn{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ur){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,fn.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=fn.workingColorSpace){return this.r=e,this.g=n,this.b=i,fn.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=fn.workingColorSpace){if(e=MH(e,1),n=ln(n,0,1),i=ln(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;this.r=hg(o,s,e+1/3),this.g=hg(o,s,e),this.b=hg(o,s,e-1/3)}return fn.colorSpaceToWorking(this,r),this}setStyle(e,n=ur){function i(s){s!==void 0&&parseFloat(s)<1&&Ht("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],c=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:Ht("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(s,16),n);Ht("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ur){const i=sR[e.toLowerCase()];return i!==void 0?this.setHex(i,n):Ht("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=Is(e.r),this.g=Is(e.g),this.b=Is(e.b),this}copyLinearToSRGB(e){return this.r=kl(e.r),this.g=kl(e.g),this.b=kl(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ur){return fn.workingToColorSpace(xi.copy(this),e),Math.round(ln(xi.r*255,0,255))*65536+Math.round(ln(xi.g*255,0,255))*256+Math.round(ln(xi.b*255,0,255))}getHexString(e=ur){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=fn.workingColorSpace){fn.workingToColorSpace(xi.copy(this),n);const i=xi.r,r=xi.g,s=xi.b,o=Math.max(i,r,s),c=Math.min(i,r,s);let u,f;const h=(c+o)/2;if(c===o)u=0,f=0;else{const p=o-c;switch(f=h<=.5?p/(o+c):p/(2-o-c),o){case i:u=(r-s)/p+(r<s?6:0);break;case r:u=(s-i)/p+2;break;case s:u=(i-r)/p+4;break}u/=6}return e.h=u,e.s=f,e.l=h,e}getRGB(e,n=fn.workingColorSpace){return fn.workingToColorSpace(xi.copy(this),n),e.r=xi.r,e.g=xi.g,e.b=xi.b,e}getStyle(e=ur){fn.workingToColorSpace(xi.copy(this),e);const n=xi.r,i=xi.g,r=xi.b;return e!==ur?`color(${e} ${n.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,n,i){return this.getHSL(ha),this.setHSL(ha.h+e,ha.s+n,ha.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.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,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,i){return this.r=e.r+(n.r-e.r)*i,this.g=e.g+(n.g-e.g)*i,this.b=e.b+(n.b-e.b)*i,this}lerpHSL(e,n){this.getHSL(ha),e.getHSL(Qd);const i=ag(ha.h,Qd.h,n),r=ag(ha.s,Qd.s,n),s=ag(ha.l,Qd.l,n);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*n+s[3]*i+s[6]*r,this.g=s[1]*n+s[4]*i+s[7]*r,this.b=s[2]*n+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const xi=new Mn;Mn.NAMES=sR;class BH extends er{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 To,this.environmentIntensity=1,this.environmentRotation=new To,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}const kr=new me,Ms=new me,pg=new me,Ts=new me,ul=new me,dl=new me,DE=new me,mg=new me,gg=new me,vg=new me,yg=new zn,_g=new zn,xg=new zn;let Vc=class wl{constructor(e=new me,n=new me,i=new me){this.a=e,this.b=n,this.c=i}static getNormal(e,n,i,r){r.subVectors(i,n),kr.subVectors(e,n),r.cross(kr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){kr.subVectors(r,n),Ms.subVectors(i,n),pg.subVectors(e,n);const o=kr.dot(kr),c=kr.dot(Ms),u=kr.dot(pg),f=Ms.dot(Ms),h=Ms.dot(pg),p=o*f-c*c;if(p===0)return s.set(0,0,0),null;const m=1/p,v=(f*u-c*h)*m,_=(o*h-c*u)*m;return s.set(1-v-_,_,v)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,Ts)===null?!1:Ts.x>=0&&Ts.y>=0&&Ts.x+Ts.y<=1}static getInterpolation(e,n,i,r,s,o,c,u){return this.getBarycoord(e,n,i,r,Ts)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(s,Ts.x),u.addScaledVector(o,Ts.y),u.addScaledVector(c,Ts.z),u)}static getInterpolatedAttribute(e,n,i,r,s,o){return yg.setScalar(0),_g.setScalar(0),xg.setScalar(0),yg.fromBufferAttribute(e,n),_g.fromBufferAttribute(e,i),xg.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(yg,s.x),o.addScaledVector(_g,s.y),o.addScaledVector(xg,s.z),o}static isFrontFacing(e,n,i,r){return kr.subVectors(i,n),Ms.subVectors(e,n),kr.cross(Ms).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),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 kr.subVectors(this.c,this.b),Ms.subVectors(this.a,this.b),kr.cross(Ms).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wl.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return wl.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return wl.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return wl.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wl.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let o,c;ul.subVectors(r,i),dl.subVectors(s,i),mg.subVectors(e,i);const u=ul.dot(mg),f=dl.dot(mg);if(u<=0&&f<=0)return n.copy(i);gg.subVectors(e,r);const h=ul.dot(gg),p=dl.dot(gg);if(h>=0&&p<=h)return n.copy(r);const m=u*p-h*f;if(m<=0&&u>=0&&h<=0)return o=u/(u-h),n.copy(i).addScaledVector(ul,o);vg.subVectors(e,s);const v=ul.dot(vg),_=dl.dot(vg);if(_>=0&&v<=_)return n.copy(s);const w=v*f-u*_;if(w<=0&&f>=0&&_<=0)return c=f/(f-_),n.copy(i).addScaledVector(dl,c);const y=h*_-v*p;if(y<=0&&p-h>=0&&v-_>=0)return DE.subVectors(s,r),c=(p-h)/(p-h+(v-_)),n.copy(r).addScaledVector(DE,c);const x=1/(y+w+m);return o=w*x,c=m*x,n.copy(i).addScaledVector(ul,o).addScaledVector(dl,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};class Du{constructor(e=new me(1/0,1/0,1/0),n=new me(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n+=3)this.expandByPoint(Lr.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(Lr.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=Lr.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}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,n=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,Lr):Lr.fromBufferAttribute(s,o),Lr.applyMatrix4(e.matrixWorld),this.expandByPoint(Lr);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),ef.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),ef.copy(i.boundingBox)),ef.applyMatrix4(e.matrixWorld),this.union(ef)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],n);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,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Lr),Lr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Hc),tf.subVectors(this.max,Hc),fl.subVectors(e.a,Hc),hl.subVectors(e.b,Hc),pl.subVectors(e.c,Hc),pa.subVectors(hl,fl),ma.subVectors(pl,hl),Ya.subVectors(fl,pl);let n=[0,-pa.z,pa.y,0,-ma.z,ma.y,0,-Ya.z,Ya.y,pa.z,0,-pa.x,ma.z,0,-ma.x,Ya.z,0,-Ya.x,-pa.y,pa.x,0,-ma.y,ma.x,0,-Ya.y,Ya.x,0];return!bg(n,fl,hl,pl,tf)||(n=[1,0,0,0,1,0,0,0,1],!bg(n,fl,hl,pl,tf))?!1:(nf.crossVectors(pa,ma),n=[nf.x,nf.y,nf.z],bg(n,fl,hl,pl,tf))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Lr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Lr).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:(As[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),As[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),As[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),As[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),As[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),As[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),As[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),As[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(As),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}}const As=[new me,new me,new me,new me,new me,new me,new me,new me],Lr=new me,ef=new Du,fl=new me,hl=new me,pl=new me,pa=new me,ma=new me,Ya=new me,Hc=new me,tf=new me,nf=new me,Ka=new me;function bg(t,e,n,i,r){for(let s=0,o=t.length-3;s<=o;s+=3){Ka.fromArray(t,s);const c=r.x*Math.abs(Ka.x)+r.y*Math.abs(Ka.y)+r.z*Math.abs(Ka.z),u=e.dot(Ka),f=n.dot(Ka),h=i.dot(Ka);if(Math.max(-Math.max(u,f,h),Math.min(u,f,h))>c)return!1}return!0}const jn=new me,rf=new bn;let zH=0;class zr{constructor(e,n,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:zH++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=_E,this.updateRanges=[],this.gpuType=Jr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=n.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,i=this.count;n<i;n++)rf.fromBufferAttribute(this,n),rf.applyMatrix3(e),this.setXY(n,rf.x,rf.y);else if(this.itemSize===3)for(let n=0,i=this.count;n<i;n++)jn.fromBufferAttribute(this,n),jn.applyMatrix3(e),this.setXYZ(n,jn.x,jn.y,jn.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)jn.fromBufferAttribute(this,n),jn.applyMatrix4(e),this.setXYZ(n,jn.x,jn.y,jn.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)jn.fromBufferAttribute(this,n),jn.applyNormalMatrix(e),this.setXYZ(n,jn.x,jn.y,jn.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)jn.fromBufferAttribute(this,n),jn.transformDirection(e),this.setXYZ(n,jn.x,jn.y,jn.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let i=this.array[e*this.itemSize+n];return this.normalized&&(i=Bc(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=Hi(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Bc(n,this.array)),n}setX(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Bc(n,this.array)),n}setY(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=Bc(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=Bc(n,this.array)),n}setW(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array)),this.array[e+0]=n,this.array[e+1]=i,this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array),r=Hi(r,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,n,i,r,s){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array),r=Hi(r,this.array),s=Hi(s,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==_E&&(e.usage=this.usage),e}}class aR extends zr{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class oR extends zr{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class Us extends zr{constructor(e,n,i){super(new Float32Array(e),n,i)}}const VH=new Du,Gc=new me,Sg=new me;class e_{constructor(e=new me,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):VH.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const i=this.center.distanceToSquared(e);return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Gc.subVectors(e,this.center);const n=Gc.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(Gc,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):(Sg.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Gc.copy(e.center).add(Sg)),this.expandByPoint(Gc.copy(e.center).sub(Sg))),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}}let HH=0;const lr=new Yn,wg=new er,ml=new me,Zi=new Du,Wc=new Du,li=new me;class hs extends Zl{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:HH++}),this.uuid=Lu(),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(bH(e)?oR:aR)(e,1):this.index=e,this}setIndirect(e,n=0){return this.indirect=e,this.indirectOffset=n,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,i=0){this.groups.push({start:e,count:n,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new Wt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const 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 lr.makeRotationFromQuaternion(e),this.applyMatrix4(lr),this}rotateX(e){return lr.makeRotationX(e),this.applyMatrix4(lr),this}rotateY(e){return lr.makeRotationY(e),this.applyMatrix4(lr),this}rotateZ(e){return lr.makeRotationZ(e),this.applyMatrix4(lr),this}translate(e,n,i){return lr.makeTranslation(e,n,i),this.applyMatrix4(lr),this}scale(e,n,i){return lr.makeScale(e,n,i),this.applyMatrix4(lr),this}lookAt(e){return wg.lookAt(e),wg.updateMatrix(),this.applyMatrix4(wg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ml).negate(),this.translate(ml.x,ml.y,ml.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];i.push(o.x,o.y,o.z||0)}this.setAttribute("position",new Us(i,3))}else{const i=Math.min(e.length,n.count);for(let r=0;r<i;r++){const s=e[r];n.setXYZ(r,s.x,s.y,s.z||0)}e.length>n.count&&Ht("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Du);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_n("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new me(-1/0,-1/0,-1/0),new me(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i<r;i++){const s=n[i];Zi.setFromBufferAttribute(s),this.morphTargetsRelative?(li.addVectors(this.boundingBox.min,Zi.min),this.boundingBox.expandByPoint(li),li.addVectors(this.boundingBox.max,Zi.max),this.boundingBox.expandByPoint(li)):(this.boundingBox.expandByPoint(Zi.min),this.boundingBox.expandByPoint(Zi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&_n('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 e_);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_n("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new me,1/0);return}if(e){const i=this.boundingSphere.center;if(Zi.setFromBufferAttribute(e),n)for(let s=0,o=n.length;s<o;s++){const c=n[s];Wc.setFromBufferAttribute(c),this.morphTargetsRelative?(li.addVectors(Zi.min,Wc.min),Zi.expandByPoint(li),li.addVectors(Zi.max,Wc.max),Zi.expandByPoint(li)):(Zi.expandByPoint(Wc.min),Zi.expandByPoint(Wc.max))}Zi.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)li.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(li));if(n)for(let s=0,o=n.length;s<o;s++){const c=n[s],u=this.morphTargetsRelative;for(let f=0,h=c.count;f<h;f++)li.fromBufferAttribute(c,f),u&&(ml.fromBufferAttribute(e,f),li.add(ml)),r=Math.max(r,i.distanceToSquared(li))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&_n('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){_n("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=n.position,r=n.normal,s=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new zr(new Float32Array(4*i.count),4));const o=this.getAttribute("tangent"),c=[],u=[];for(let S=0;S<i.count;S++)c[S]=new me,u[S]=new me;const f=new me,h=new me,p=new me,m=new bn,v=new bn,_=new bn,w=new me,y=new me;function x(S,R,H){f.fromBufferAttribute(i,S),h.fromBufferAttribute(i,R),p.fromBufferAttribute(i,H),m.fromBufferAttribute(s,S),v.fromBufferAttribute(s,R),_.fromBufferAttribute(s,H),h.sub(f),p.sub(f),v.sub(m),_.sub(m);const F=1/(v.x*_.y-_.x*v.y);isFinite(F)&&(w.copy(h).multiplyScalar(_.y).addScaledVector(p,-v.y).multiplyScalar(F),y.copy(p).multiplyScalar(v.x).addScaledVector(h,-_.x).multiplyScalar(F),c[S].add(w),c[R].add(w),c[H].add(w),u[S].add(y),u[R].add(y),u[H].add(y))}let M=this.groups;M.length===0&&(M=[{start:0,count:e.count}]);for(let S=0,R=M.length;S<R;++S){const H=M[S],F=H.start,W=H.count;for(let X=F,V=F+W;X<V;X+=3)x(e.getX(X+0),e.getX(X+1),e.getX(X+2))}const A=new me,T=new me,D=new me,I=new me;function U(S){D.fromBufferAttribute(r,S),I.copy(D);const R=c[S];A.copy(R),A.sub(D.multiplyScalar(D.dot(R))).normalize(),T.crossVectors(I,R);const F=T.dot(u[S])<0?-1:1;o.setXYZW(S,A.x,A.y,A.z,F)}for(let S=0,R=M.length;S<R;++S){const H=M[S],F=H.start,W=H.count;for(let X=F,V=F+W;X<V;X+=3)U(e.getX(X+0)),U(e.getX(X+1)),U(e.getX(X+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new zr(new Float32Array(n.count*3),3),this.setAttribute("normal",i);else for(let m=0,v=i.count;m<v;m++)i.setXYZ(m,0,0,0);const r=new me,s=new me,o=new me,c=new me,u=new me,f=new me,h=new me,p=new me;if(e)for(let m=0,v=e.count;m<v;m+=3){const _=e.getX(m+0),w=e.getX(m+1),y=e.getX(m+2);r.fromBufferAttribute(n,_),s.fromBufferAttribute(n,w),o.fromBufferAttribute(n,y),h.subVectors(o,s),p.subVectors(r,s),h.cross(p),c.fromBufferAttribute(i,_),u.fromBufferAttribute(i,w),f.fromBufferAttribute(i,y),c.add(h),u.add(h),f.add(h),i.setXYZ(_,c.x,c.y,c.z),i.setXYZ(w,u.x,u.y,u.z),i.setXYZ(y,f.x,f.y,f.z)}else for(let m=0,v=n.count;m<v;m+=3)r.fromBufferAttribute(n,m+0),s.fromBufferAttribute(n,m+1),o.fromBufferAttribute(n,m+2),h.subVectors(o,s),p.subVectors(r,s),h.cross(p),i.setXYZ(m+0,h.x,h.y,h.z),i.setXYZ(m+1,h.x,h.y,h.z),i.setXYZ(m+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,i=e.count;n<i;n++)li.fromBufferAttribute(e,n),li.normalize(),e.setXYZ(n,li.x,li.y,li.z)}toNonIndexed(){function e(c,u){const f=c.array,h=c.itemSize,p=c.normalized,m=new f.constructor(u.length*h);let v=0,_=0;for(let w=0,y=u.length;w<y;w++){c.isInterleavedBufferAttribute?v=u[w]*c.data.stride+c.offset:v=u[w]*h;for(let x=0;x<h;x++)m[_++]=f[v++]}return new zr(m,h,p)}if(this.index===null)return Ht("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new hs,i=this.index.array,r=this.attributes;for(const c in r){const u=r[c],f=e(u,i);n.setAttribute(c,f)}const s=this.morphAttributes;for(const c in s){const u=[],f=s[c];for(let h=0,p=f.length;h<p;h++){const m=f[h],v=e(m,i);u.push(v)}n.morphAttributes[c]=u}n.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,u=o.length;c<u;c++){const f=o[c];n.addGroup(f.start,f.count,f.materialIndex)}return n}toJSON(){const 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){const u=this.parameters;for(const f in u)u[f]!==void 0&&(e[f]=u[f]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const u in i){const f=i[u];e.data.attributes[u]=f.toJSON(e.data)}const r={};let s=!1;for(const u in this.morphAttributes){const f=this.morphAttributes[u],h=[];for(let p=0,m=f.length;p<m;p++){const v=f[p];h.push(v.toJSON(e.data))}h.length>0&&(r[u]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere=c.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;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const f in r){const h=r[f];this.setAttribute(f,h.clone(n))}const s=e.morphAttributes;for(const f in s){const h=[],p=s[f];for(let m=0,v=p.length;m<v;m++)h.push(p[m].clone(n));this.morphAttributes[f]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let f=0,h=o.length;f<h;f++){const p=o[f];this.addGroup(p.start,p.count,p.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let GH=0;class Uh extends Zl{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:GH++}),this.uuid=Lu(),this.name="",this.type="Material",this.blending=vo,this.side=Pa,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=I0,this.blendDst=U0,this.blendEquation=ro,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Mn(0,0,0),this.blendAlpha=0,this.depthFunc=Bl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=yE,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=sl,this.stencilZFail=sl,this.stencilZPass=sl,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(const n in e){const i=e[n];if(i===void 0){Ht(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Ht(`Material: '${n}' 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[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.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!==vo&&(i.blending=this.blending),this.side!==Pa&&(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!==I0&&(i.blendSrc=this.blendSrc),this.blendDst!==U0&&(i.blendDst=this.blendDst),this.blendEquation!==ro&&(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!==Bl&&(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!==yE&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==sl&&(i.stencilFail=this.stencilFail),this.stencilZFail!==sl&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==sl&&(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(s){const o=[];for(const c in s){const u=s[c];delete u.metadata,o.push(u)}return o}if(n){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.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++}}const Cs=new me,Eg=new me,sf=new me,ga=new me,Mg=new me,af=new me,Tg=new me;class WH{constructor(e=new me,n=new me(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cs)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Cs.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Cs.copy(this.origin).addScaledVector(this.direction,n),Cs.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){Eg.copy(e).add(n).multiplyScalar(.5),sf.copy(n).sub(e).normalize(),ga.copy(this.origin).sub(Eg);const s=e.distanceTo(n)*.5,o=-this.direction.dot(sf),c=ga.dot(this.direction),u=-ga.dot(sf),f=ga.lengthSq(),h=Math.abs(1-o*o);let p,m,v,_;if(h>0)if(p=o*u-c,m=o*c-u,_=s*h,p>=0)if(m>=-_)if(m<=_){const w=1/h;p*=w,m*=w,v=p*(p+o*m+2*c)+m*(o*p+m+2*u)+f}else m=s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+f;else m=-s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+f;else m<=-_?(p=Math.max(0,-(-o*s+c)),m=p>0?-s:Math.min(Math.max(-s,-u),s),v=-p*p+m*(m+2*u)+f):m<=_?(p=0,m=Math.min(Math.max(-s,-u),s),v=m*(m+2*u)+f):(p=Math.max(0,-(o*s+c)),m=p>0?s:Math.min(Math.max(-s,-u),s),v=-p*p+m*(m+2*u)+f);else m=o>0?-s:s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+f;return i&&i.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(Eg).addScaledVector(sf,m),v}intersectSphere(e,n){Cs.subVectors(e.center,this.origin);const i=Cs.dot(this.direction),r=Cs.dot(Cs)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),c=i-o,u=i+o;return u<0?null:c<0?this.at(u,n):this.at(c,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,o,c,u;const f=1/this.direction.x,h=1/this.direction.y,p=1/this.direction.z,m=this.origin;return f>=0?(i=(e.min.x-m.x)*f,r=(e.max.x-m.x)*f):(i=(e.max.x-m.x)*f,r=(e.min.x-m.x)*f),h>=0?(s=(e.min.y-m.y)*h,o=(e.max.y-m.y)*h):(s=(e.max.y-m.y)*h,o=(e.min.y-m.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),p>=0?(c=(e.min.z-m.z)*p,u=(e.max.z-m.z)*p):(c=(e.max.z-m.z)*p,u=(e.min.z-m.z)*p),i>u||c>r)||((c>i||i!==i)&&(i=c),(u<r||r!==r)&&(r=u),r<0)?null:this.at(i>=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,Cs)!==null}intersectTriangle(e,n,i,r,s){Mg.subVectors(n,e),af.subVectors(i,e),Tg.crossVectors(Mg,af);let o=this.direction.dot(Tg),c;if(o>0){if(r)return null;c=1}else if(o<0)c=-1,o=-o;else return null;ga.subVectors(this.origin,e);const u=c*this.direction.dot(af.crossVectors(ga,af));if(u<0)return null;const f=c*this.direction.dot(Mg.cross(ga));if(f<0||u+f>o)return null;const h=-c*ga.dot(Tg);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class lR extends Uh{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Mn(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 To,this.combine=BC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const NE=new Yn,Za=new WH,of=new e_,IE=new me,lf=new me,cf=new me,uf=new me,Ag=new me,df=new me,UE=new me,ff=new me;let us=class extends er{constructor(e=new hs,n=new lR){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),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(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const c=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=s}}}}getVertexPosition(e,n){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;n.fromBufferAttribute(r,e);const c=this.morphTargetInfluences;if(s&&c){df.set(0,0,0);for(let u=0,f=s.length;u<f;u++){const h=c[u],p=s[u];h!==0&&(Ag.fromBufferAttribute(p,e),o?df.addScaledVector(Ag,h):df.addScaledVector(Ag.sub(n),h))}n.add(df)}return n}raycast(e,n){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),of.copy(i.boundingSphere),of.applyMatrix4(s),Za.copy(e.ray).recast(e.near),!(of.containsPoint(Za.origin)===!1&&(Za.intersectSphere(of,IE)===null||Za.origin.distanceToSquared(IE)>(e.far-e.near)**2))&&(NE.copy(s).invert(),Za.copy(e.ray).applyMatrix4(NE),!(i.boundingBox!==null&&Za.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Za)))}_computeIntersections(e,n,i){let r;const s=this.geometry,o=this.material,c=s.index,u=s.attributes.position,f=s.attributes.uv,h=s.attributes.uv1,p=s.attributes.normal,m=s.groups,v=s.drawRange;if(c!==null)if(Array.isArray(o))for(let _=0,w=m.length;_<w;_++){const y=m[_],x=o[y.materialIndex],M=Math.max(y.start,v.start),A=Math.min(c.count,Math.min(y.start+y.count,v.start+v.count));for(let T=M,D=A;T<D;T+=3){const I=c.getX(T),U=c.getX(T+1),S=c.getX(T+2);r=hf(this,x,e,i,f,h,p,I,U,S),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const _=Math.max(0,v.start),w=Math.min(c.count,v.start+v.count);for(let y=_,x=w;y<x;y+=3){const M=c.getX(y),A=c.getX(y+1),T=c.getX(y+2);r=hf(this,o,e,i,f,h,p,M,A,T),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}else if(u!==void 0)if(Array.isArray(o))for(let _=0,w=m.length;_<w;_++){const y=m[_],x=o[y.materialIndex],M=Math.max(y.start,v.start),A=Math.min(u.count,Math.min(y.start+y.count,v.start+v.count));for(let T=M,D=A;T<D;T+=3){const I=T,U=T+1,S=T+2;r=hf(this,x,e,i,f,h,p,I,U,S),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const _=Math.max(0,v.start),w=Math.min(u.count,v.start+v.count);for(let y=_,x=w;y<x;y+=3){const M=y,A=y+1,T=y+2;r=hf(this,o,e,i,f,h,p,M,A,T),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}}};function jH(t,e,n,i,r,s,o,c){let u;if(e.side===Gi?u=i.intersectTriangle(o,s,r,!0,c):u=i.intersectTriangle(r,s,o,e.side===Pa,c),u===null)return null;ff.copy(c),ff.applyMatrix4(t.matrixWorld);const f=n.ray.origin.distanceTo(ff);return f<n.near||f>n.far?null:{distance:f,point:ff.clone(),object:t}}function hf(t,e,n,i,r,s,o,c,u,f){t.getVertexPosition(c,lf),t.getVertexPosition(u,cf),t.getVertexPosition(f,uf);const h=jH(t,e,n,i,lf,cf,uf,UE);if(h){const p=new me;Vc.getBarycoord(UE,lf,cf,uf,p),r&&(h.uv=Vc.getInterpolatedAttribute(r,c,u,f,p,new bn)),s&&(h.uv1=Vc.getInterpolatedAttribute(s,c,u,f,p,new bn)),o&&(h.normal=Vc.getInterpolatedAttribute(o,c,u,f,p,new me),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const m={a:c,b:u,c:f,normal:new me,materialIndex:0};Vc.getNormal(lf,cf,uf,m.normal),h.face=m,h.barycoord=p}return h}class $H extends Li{constructor(e=null,n=1,i=1,r,s,o,c,u,f=pi,h=pi,p,m){super(null,o,c,u,f,h,r,s,p,m),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Cg=new me,XH=new me,qH=new Wt;class no{constructor(e=new me(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=Cg.subVectors(i,n).cross(XH.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(Cg),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||qH.getNormalMatrix(e),r=this.coplanarPoint(Cg).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ja=new e_,YH=new bn(.5,.5),pf=new me;class cR{constructor(e=new no,n=new no,i=new no,r=new no,s=new no,o=new no){this.planes=[e,n,i,r,s,o]}set(e,n,i,r,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(n),c[2].copy(i),c[3].copy(r),c[4].copy(s),c[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Qr,i=!1){const r=this.planes,s=e.elements,o=s[0],c=s[1],u=s[2],f=s[3],h=s[4],p=s[5],m=s[6],v=s[7],_=s[8],w=s[9],y=s[10],x=s[11],M=s[12],A=s[13],T=s[14],D=s[15];if(r[0].setComponents(f-o,v-h,x-_,D-M).normalize(),r[1].setComponents(f+o,v+h,x+_,D+M).normalize(),r[2].setComponents(f+c,v+p,x+w,D+A).normalize(),r[3].setComponents(f-c,v-p,x-w,D-A).normalize(),i)r[4].setComponents(u,m,y,T).normalize(),r[5].setComponents(f-u,v-m,x-y,D-T).normalize();else if(r[4].setComponents(f-u,v-m,x-y,D-T).normalize(),n===Qr)r[5].setComponents(f+u,v+m,x+y,D+T).normalize();else if(n===gh)r[5].setComponents(u,m,y,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ja.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Ja.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ja)}intersectsSprite(e){Ja.center.set(0,0,0);const n=YH.distanceTo(e.center);return Ja.radius=.7071067811865476+n,Ja.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ja)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const n=this.planes;for(let i=0;i<6;i++){const r=n[i];if(pf.x=r.normal.x>0?e.max.x:e.min.x,pf.y=r.normal.y>0?e.max.y:e.min.y,pf.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(pf)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class uR extends Li{constructor(e=[],n=Eo,i,r,s,o,c,u,f,h){super(e,n,i,r,s,o,c,u,f,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class _u extends Li{constructor(e,n,i=cs,r,s,o,c=pi,u=pi,f,h=Bs,p=1){if(h!==Bs&&h!==fo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:n,depth:p};super(m,r,s,o,c,u,h,i,f),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Qy(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class KH extends _u{constructor(e,n=cs,i=Eo,r,s,o=pi,c=pi,u,f=Bs){const h={width:e,height:e,depth:1},p=[h,h,h,h,h,h];super(e,e,n,i,r,s,o,c,u,f),this.image=p,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class dR extends Li{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Nu extends hs{constructor(e=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const c=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const u=[],f=[],h=[],p=[];let m=0,v=0;_("z","y","x",-1,-1,i,n,e,o,s,0),_("z","y","x",1,-1,i,n,-e,o,s,1),_("x","z","y",1,1,e,i,n,r,o,2),_("x","z","y",1,-1,e,i,-n,r,o,3),_("x","y","z",1,-1,e,n,i,r,s,4),_("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(u),this.setAttribute("position",new Us(f,3)),this.setAttribute("normal",new Us(h,3)),this.setAttribute("uv",new Us(p,2));function _(w,y,x,M,A,T,D,I,U,S,R){const H=T/U,F=D/S,W=T/2,X=D/2,V=I/2,q=U+1,J=S+1;let Q=0,$=0;const Y=new me;for(let Z=0;Z<J;Z++){const z=Z*F-X;for(let ie=0;ie<q;ie++){const ve=ie*H-W;Y[w]=ve*M,Y[y]=z*A,Y[x]=V,f.push(Y.x,Y.y,Y.z),Y[w]=0,Y[y]=0,Y[x]=I>0?1:-1,h.push(Y.x,Y.y,Y.z),p.push(ie/U),p.push(1-Z/S),Q+=1}}for(let Z=0;Z<S;Z++)for(let z=0;z<U;z++){const ie=m+z+q*Z,ve=m+z+q*(Z+1),Ee=m+(z+1)+q*(Z+1),Ue=m+(z+1)+q*Z;u.push(ie,ve,Ue),u.push(ve,Ee,Ue),$+=6}c.addGroup(v,$,R),v+=$,m+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Fh extends hs{constructor(e=1,n=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:i,heightSegments:r};const s=e/2,o=n/2,c=Math.floor(i),u=Math.floor(r),f=c+1,h=u+1,p=e/c,m=n/u,v=[],_=[],w=[],y=[];for(let x=0;x<h;x++){const M=x*m-o;for(let A=0;A<f;A++){const T=A*p-s;_.push(T,-M,0),w.push(0,0,1),y.push(A/c),y.push(1-x/u)}}for(let x=0;x<u;x++)for(let M=0;M<c;M++){const A=M+f*x,T=M+f*(x+1),D=M+1+f*(x+1),I=M+1+f*x;v.push(A,T,I),v.push(T,D,I)}this.setIndex(v),this.setAttribute("position",new Us(_,3)),this.setAttribute("normal",new Us(w,3)),this.setAttribute("uv",new Us(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fh(e.width,e.height,e.widthSegments,e.heightSegments)}}function Hl(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(Ht("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function Ci(t){const e={};for(let n=0;n<t.length;n++){const i=Hl(t[n]);for(const r in i)e[r]=i[r]}return e}function ZH(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function fR(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:fn.workingColorSpace}const JH={clone:Hl,merge:Ci};var QH=`void main() {
|
|
508
|
+
`),()=>{c.current?.removeAttribute("data-motion-pop-id"),D.contains(T)&&D.removeChild(T)}},[e]),B.jsx(C4,{isPresent:e,childRef:c,sizeRef:u,pop:s,children:s===!1?t:N.cloneElement(t,{ref:p})})}const P4=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:o,anchorX:c,anchorY:u,root:f})=>{const h=uy(k4),p=N.useId();let m=!0,v=N.useMemo(()=>(m=!1,{id:p,initial:e,isPresent:n,custom:r,onExitComplete:_=>{h.set(_,!0);for(const w of h.values())if(!w)return;i&&i()},register:_=>(h.set(_,!1),()=>h.delete(_))}),[n,h,i]);return s&&m&&(v={...v}),N.useMemo(()=>{h.forEach((_,w)=>h.set(w,!1))},[n]),N.useEffect(()=>{!n&&!h.size&&i&&i()},[n]),t=B.jsx(R4,{pop:o==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:f,children:t}),B.jsx(Rh.Provider,{value:v,children:t})};function k4(){return new Map}function JA(t=!0){const e=N.useContext(Rh);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=e,s=N.useId();N.useEffect(()=>{if(t)return r(s)},[t]);const o=N.useCallback(()=>t&&i&&i(s),[s,i,t]);return!n&&i?[!1,o]:[!0]}const Wd=t=>t.key||"";function Hw(t){const e=[];return N.Children.forEach(t,n=>{N.isValidElement(n)&&e.push(n)}),e}const QA=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:o=!1,anchorX:c="left",anchorY:u="top",root:f})=>{const[h,p]=JA(o),m=N.useMemo(()=>Hw(t),[t]),v=o&&!h?[]:m.map(Wd),_=N.useRef(!0),w=N.useRef(m),y=uy(()=>new Map),x=N.useRef(new Set),[M,A]=N.useState(m),[T,D]=N.useState(m);MT(()=>{_.current=!1,w.current=m;for(let S=0;S<T.length;S++){const R=Wd(T[S]);v.includes(R)?(y.delete(R),x.current.delete(R)):y.get(R)!==!0&&y.set(R,!1)}},[T,v.length,v.join("-")]);const I=[];if(m!==M){let S=[...m];for(let R=0;R<T.length;R++){const H=T[R],F=Wd(H);v.includes(F)||(S.splice(R,0,H),I.push(H))}return s==="wait"&&I.length&&(S=I),D(Hw(S)),A(m),null}const{forceRender:U}=N.useContext(cy);return B.jsx(B.Fragment,{children:T.map(S=>{const R=Wd(S),H=o&&!h?!1:m===T||v.includes(R),F=()=>{if(x.current.has(R))return;if(y.has(R))x.current.add(R),y.set(R,!0);else return;let W=!0;y.forEach(X=>{X||(W=!1)}),W&&(U?.(),D(w.current),o&&p?.(),i&&i())};return B.jsx(P4,{isPresent:H,initial:!_.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:s,root:f,onExitComplete:H?void 0:F,anchorX:c,anchorY:u,children:S},R)})})},eC=N.createContext({strict:!1}),Gw={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ww=!1;function L4(){if(Ww)return;const t={};for(const e in Gw)t[e]={isEnabled:n=>Gw[e].some(i=>!!n[i])};CA(t),Ww=!0}function tC(){return L4(),gB()}function D4(t){const e=tC();for(const n in t)e[n]={...e[n],...t[n]};CA(e)}const N4=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function fh(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||N4.has(t)}let nC=t=>!fh(t);function I4(t){typeof t=="function"&&(nC=e=>e.startsWith("on")?!fh(e):t(e))}try{I4(require("@emotion/is-prop-valid").default)}catch{}function U4(t,e,n){const i={};for(const r in t)r==="values"&&typeof t.values=="object"||hi(t[r])||(nC(r)||n===!0&&fh(r)||!e&&!fh(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}const Dh=N.createContext({});function F4(t,e){if(Lh(t)){const{initial:n,animate:i}=t;return{initial:n===!1||pu(n)?n:void 0,animate:pu(i)?i:void 0}}return t.inherit!==!1?e:{}}function O4(t){const{initial:e,animate:n}=F4(t,N.useContext(Dh));return N.useMemo(()=>({initial:e,animate:n}),[jw(e),jw(n)])}function jw(t){return Array.isArray(t)?t.join(" "):t}const Fy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function iC(t,e,n){for(const i in e)!hi(e[i])&&!IA(i,n)&&(t[i]=e[i])}function B4({transformTemplate:t},e){return N.useMemo(()=>{const n=Fy();return Ny(n,e,t),Object.assign({},n.vars,n.style)},[e])}function z4(t,e){const n=t.style||{},i={};return iC(i,n,t),Object.assign(i,B4(t,e)),i}function V4(t,e){const n={},i=z4(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const rC=()=>({...Fy(),attrs:{}});function H4(t,e,n,i){const r=N.useMemo(()=>{const s=rC();return UA(s,e,OA(i),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};iC(s,t.style,t),r.style={...s,...r.style}}return r}const G4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Oy(t){return typeof t!="string"||t.includes("-")?!1:!!(G4.indexOf(t)>-1||/[A-Z]/u.test(t))}function W4(t,e,n,{latestValues:i},r,s=!1,o){const u=(o??Oy(t)?H4:V4)(e,i,r,t),f=U4(e,typeof t=="string",s),h=t!==N.Fragment?{...f,...u,ref:n}:{},{children:p}=e,m=N.useMemo(()=>hi(p)?p.get():p,[p]);return N.createElement(t,{...h,children:m})}function j4({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,r){return{latestValues:$4(n,i,r,t),renderState:e()}}function $4(t,e,n,i){const r={},s=i(t,{});for(const m in s)r[m]=If(s[m]);let{initial:o,animate:c}=t;const u=Lh(t),f=TA(t);e&&f&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),c===void 0&&(c=e.animate));let h=n?n.initial===!1:!1;h=h||o===!1;const p=h?c:o;if(p&&typeof p!="boolean"&&!kh(p)){const m=Array.isArray(p)?p:[p];for(let v=0;v<m.length;v++){const _=My(t,m[v]);if(_){const{transitionEnd:w,transition:y,...x}=_;for(const M in x){let A=x[M];if(Array.isArray(A)){const T=h?A.length-1:0;A=A[T]}A!==null&&(r[M]=A)}for(const M in w)r[M]=w[M]}}}return r}const sC=t=>(e,n)=>{const i=N.useContext(Dh),r=N.useContext(Rh),s=()=>j4(t,e,i,r);return n?s():uy(s)},X4=sC({scrapeMotionValuesFromProps:Iy,createRenderState:Fy}),q4=sC({scrapeMotionValuesFromProps:BA,createRenderState:rC}),Y4=Symbol.for("motionComponentSymbol");function K4(t,e,n){const i=N.useRef(n);N.useInsertionEffect(()=>{i.current=n});const r=N.useRef(null);return N.useCallback(s=>{s&&t.onMount?.(s);const o=i.current;if(typeof o=="function")if(s){const c=o(s);typeof c=="function"&&(r.current=c)}else r.current?(r.current(),r.current=null):o(s);else o&&(o.current=s);e&&(s?e.mount(s):e.unmount())},[e])}const aC=N.createContext({});function Sl(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Z4(t,e,n,i,r,s){const{visualElement:o}=N.useContext(Dh),c=N.useContext(eC),u=N.useContext(Rh),f=N.useContext(Uy),h=f.reducedMotion,p=f.skipAnimations,m=N.useRef(null),v=N.useRef(!1);i=i||c.renderer,!m.current&&i&&(m.current=i(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:s}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const _=m.current,w=N.useContext(aC);_&&!_.projection&&r&&(_.type==="html"||_.type==="svg")&&J4(m.current,n,r,w);const y=N.useRef(!1);N.useInsertionEffect(()=>{_&&y.current&&_.update(n,u)});const x=n[hA],M=N.useRef(!!x&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return MT(()=>{v.current=!0,_&&(y.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),M.current&&_.animationState&&_.animationState.animateChanges())}),N.useEffect(()=>{_&&(!M.current&&_.animationState&&_.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),M.current=!1),_.enteringChildren=void 0)}),_}function J4(t,e,n,i){const{layoutId:r,layout:s,drag:o,dragConstraints:c,layoutScroll:u,layoutRoot:f,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:oC(t.parent)),t.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||c&&Sl(c),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:u,layoutRoot:f,layoutAnchor:h})}function oC(t){if(t)return t.options.allowProjection!==!1?t.projection:oC(t.parent)}function Xm(t,{forwardMotionProps:e=!1,type:n}={},i,r){i&&D4(i);const s=n?n==="svg":Oy(t),o=s?q4:X4;function c(f,h){let p;const m={...N.useContext(Uy),...f,layoutId:Q4(f)},{isStatic:v}=m,_=O4(f),w=o(f,v);if(!v&&typeof window<"u"){ez();const y=tz(m);p=y.MeasureLayout,_.visualElement=Z4(t,w,m,r,y.ProjectionNode,s)}return B.jsxs(Dh.Provider,{value:_,children:[p&&_.visualElement?B.jsx(p,{visualElement:_.visualElement,...m}):null,W4(t,f,K4(w,_.visualElement,h),w,v,e,s)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=N.forwardRef(c);return u[Y4]=t,u}function Q4({layoutId:t}){const e=N.useContext(cy).id;return e&&t!==void 0?e+"-"+t:t}function ez(t,e){N.useContext(eC).strict}function tz(t){const e=tC(),{drag:n,layout:i}=e;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function nz(t,e){if(typeof Proxy>"u")return Xm;const n=new Map,i=(s,o)=>Xm(s,o,t,e),r=(s,o)=>i(s,o);return new Proxy(r,{get:(s,o)=>o==="create"?i:(n.has(o)||n.set(o,Xm(o,void 0,t,e)),n.get(o))})}const iz=(t,e)=>e.isSVG??Oy(t)?new DB(e):new AB(e,{allowProjection:t!==N.Fragment});class rz extends ka{constructor(e){super(e),e.animationState||(e.animationState=OB(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();kh(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let sz=0;class az extends ka{constructor(){super(...arguments),this.id=sz++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;if(e&&i===!1){if(this.isExitComplete){const{initial:s,custom:o}=this.node.getProps();if(typeof s=="string"){const c=mo(this.node,s,o);if(c){const{transition:u,transitionEnd:f,...h}=c;for(const p in h)this.node.getValue(p)?.jump(h[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const oz={animation:{Feature:rz},exit:{Feature:az}};function Cu(t){return{point:{x:t.pageX,y:t.pageY}}}const lz=t=>e=>Ry(e)&&t(e,Cu(e));function au(t,e,n,i){return mu(t,e,lz(n),i)}const lC=({current:t})=>t?t.ownerDocument.defaultView:null,$w=(t,e)=>Math.abs(t-e);function cz(t,e){const n=$w(t.x,e.x),i=$w(t.y,e.y);return Math.sqrt(n**2+i**2)}const Xw=new Set(["auto","scroll"]);class cC{constructor(e,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=jd(this.lastRawMoveEventInfo,this.transformPagePoint));const v=qm(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,w=cz(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!w)return;const{point:y}=v,{timestamp:x}=fi;this.history.push({...y,timestamp:x});const{onStart:M,onMove:A}=this.handlers;_||(M&&M(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,v)},this.handlePointerMove=(v,_)=>{this.lastMoveEvent=v,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=jd(_,this.transformPagePoint),Tn.update(this.updatePoint,!0)},this.handlePointerUp=(v,_)=>{this.end();const{onEnd:w,onSessionEnd:y,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=qm(v.type==="pointercancel"?this.lastMoveEventInfo:jd(_,this.transformPagePoint),this.history);this.startEvent&&w&&w(v,M),y&&y(v,M)},!Ry(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=r||window;const u=Cu(e),f=jd(u,this.transformPagePoint),{point:h}=f,{timestamp:p}=fi;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,qm(f,this.history)),this.removeListeners=Mu(au(this.contextWindow,"pointermove",this.handlePointerMove),au(this.contextWindow,"pointerup",this.handlePointerUp),au(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(Xw.has(i.overflowX)||Xw.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},s={x:r.x-n.x,y:r.y-n.y};s.x===0&&s.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(e,r),Tn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ra(this.updatePoint)}}function jd(t,e){return e?{point:e(t.point)}:t}function qw(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qm({point:t},e){return{point:t,delta:qw(t,uC(e)),offset:qw(t,uz(e)),velocity:dz(e,.1)}}function uz(t){return t[0]}function uC(t){return t[t.length-1]}function dz(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const r=uC(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>Qi(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&r.timestamp-i.timestamp>Qi(e)*2&&(i=t[1]);const s=hr(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function fz(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?Pn(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?Pn(n,t,i.max):Math.min(t,n)),t}function Yw(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function hz(t,{top:e,left:n,bottom:i,right:r}){return{x:Yw(t.x,n,r),y:Yw(t.y,e,i)}}function Kw(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function pz(t,e){return{x:Kw(t.x,e.x),y:Kw(t.y,e.y)}}function mz(t,e){let n=.5;const i=Pi(t),r=Pi(e);return r>i?n=fu(e.min,e.max-i,t.min):i>r&&(n=fu(t.min,t.max-r,e.min)),ls(0,1,n)}function gz(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const k0=.35;function vz(t=k0){return t===!1?t=0:t===!0&&(t=k0),{x:Zw(t,"left","right"),y:Zw(t,"top","bottom")}}function Zw(t,e,n){return{min:Jw(t,e),max:Jw(t,n)}}function Jw(t,e){return typeof t=="number"?t:t[e]||0}const yz=new WeakMap;class _z{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ei(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=p=>{n&&this.snapToCursor(Cu(p).point),this.stopAnimation()},o=(p,m)=>{const{drag:v,dragPropagation:_,onDragStart:w}=this.getProps();if(v&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=XO(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qr(x=>{let M=this.getAxisMotionValue(x).get()||0;if(ts.test(M)){const{projection:A}=this.visualElement;if(A&&A.layout){const T=A.layout.layoutBox[x];T&&(M=Pi(T)*(parseFloat(M)/100))}}this.originPoint[x]=M}),w&&Tn.update(()=>w(p,m),!1,!0),w0(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:_,onDirectionLock:w,onDrag:y}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:x}=m;if(_&&this.currentDirection===null){this.currentDirection=bz(x),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,x),this.updateAxis("y",m.point,x),this.visualElement.render(),y&&Tn.update(()=>y(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new cC(e,{onSessionStart:s,onStart:o,onMove:c,onSessionEnd:u,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:lC(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,r=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!r||!i)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:c}=this.getProps();c&&Tn.postRender(()=>c(i,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:r}=this.getProps();if(!i||!$d(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=fz(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Sl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=hz(i.layoutBox,e):this.constraints=!1,this.elastic=vz(n),r!==this.constraints&&!Sl(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&qr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=gz(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Sl(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=bB(i,r.root,this.visualElement.getTransformPagePoint());let o=pz(r.layout.layoutBox,s);if(n){const c=n(yB(o));this.hasMutatedConstraints=!!c,c&&(o=PA(c))}return o}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},f=qr(h=>{if(!$d(h,n,this.currentDirection))return;let p=u&&u[h]||{};(o===!0||o===h)&&(p={min:0,max:0});const m=r?200:1e6,v=r?40:1e7,_={type:"inertia",velocity:i?e[h]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...s,...p};return this.startAxisValueAnimation(h,_)});return Promise.all(f).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return w0(this.visualElement,e),i.start(Ey(e,i,0,n,this.visualElement,!1))}stopAnimation(){qr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){qr(n=>{const{drag:i}=this.getProps();if(!$d(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:c}=r.layout.layoutBox[n],u=s.get()||0;s.set(e[n]-Pn(o,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Sl(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};qr(o=>{const c=this.getAxisMotionValue(o);if(c&&this.constraints!==!1){const u=c.get();r[o]=mz({min:u,max:u},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),qr(o=>{if(!$d(o,e,null))return;const c=this.getAxisMotionValue(o),{min:u,max:f}=this.constraints[o];c.set(Pn(u,f,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;yz.set(this.visualElement,this);const e=this.visualElement.current,n=au(e,"pointerdown",f=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=f.target,v=m!==e&&QO(m);h&&p&&!v&&this.start(f)});let i;const r=()=>{const{dragConstraints:f}=this.getProps();Sl(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),i||(i=xz(e,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Tn.read(r);const c=mu(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:h})=>{this.isDragging&&h&&(qr(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=f[p].translate,m.set(m.get()+f[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),o(),u&&u(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=k0,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:c}}}function Qw(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function xz(t,e,n){const i=aw(t,Qw(n)),r=aw(e,Qw(n));return()=>{i(),r()}}function $d(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function bz(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Sz extends ka{constructor(e){super(e),this.removeGroupControls=pr,this.removeListeners=pr,this.controls=new _z(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pr}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ym=t=>(e,n)=>{t&&Tn.update(()=>t(e,n),!1,!0)};class wz extends ka{constructor(){super(...arguments),this.removePointerDownListener=pr}onPointerDown(e){this.session=new cC(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lC(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ym(e),onStart:Ym(n),onMove:Ym(i),onEnd:(s,o)=>{delete this.session,r&&Tn.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=au(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Km=!1;class Ez extends N.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;s&&(n.group&&n.group.add(s),i&&i.register&&r&&i.register(s),Km&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Uf.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:r,isPresent:s}=this.props,{projection:o}=i;return o&&(o.isPresent=s,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Km=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==s?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Tn.postRender(()=>{const c=o.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:i}=e;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),Cy.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=e;Km=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function dC(t){const[e,n]=JA(),i=N.useContext(cy);return B.jsx(Ez,{...t,layoutGroup:i,switchLayoutGroup:N.useContext(aC),isPresent:e,safeToRemove:n})}const Mz={pan:{Feature:wz},drag:{Feature:Sz,ProjectionNode:ZA,MeasureLayout:dC}};function eE(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,s=i[r];s&&Tn.postRender(()=>s(e,Cu(e)))}class Tz extends ka{mount(){const{current:e}=this.node;e&&(this.unmount=YO(e,(n,i)=>(eE(this.node,i,"Start"),r=>eE(this.node,r,"End"))))}unmount(){}}class Az extends ka{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Mu(mu(this.node.current,"focus",()=>this.onFocus()),mu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tE(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),s=i[r];s&&Tn.postRender(()=>s(e,Cu(e)))}class Cz extends ka{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=tB(e,(r,s)=>(tE(this.node,s,"Start"),(o,{success:c})=>tE(this.node,o,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const L0=new WeakMap,Zm=new WeakMap,Rz=t=>{const e=L0.get(t.target);e&&e(t)},Pz=t=>{t.forEach(Rz)};function kz({root:t,...e}){const n=t||document;Zm.has(n)||Zm.set(n,{});const i=Zm.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(Pz,{root:t,...e})),i[r]}function Lz(t,e,n){const i=kz(e);return L0.set(t,n),i.observe(t),()=>{L0.delete(t),i.unobserve(t)}}const Dz={some:0,all:1};class Nz extends ka{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Dz[r]},c=u=>{const{isIntersecting:f}=u;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:p}=this.node.getProps(),m=f?h:p;m&&m(u)};this.stopObserver=Lz(this.node.current,o,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Iz(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Iz({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Uz={inView:{Feature:Nz},tap:{Feature:Cz},focus:{Feature:Az},hover:{Feature:Tz}},Fz={layout:{ProjectionNode:ZA,MeasureLayout:dC}},Oz={...oz,...Uz,...Mz,...Fz},go=nz(Oz,iz);function Bz(){!Dy.current&&AA();const[t]=N.useState(lh.current);return t}const fC=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const zz=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Vz=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const nE=t=>{const e=Vz(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Jm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Hz=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Gz=N.createContext({}),Wz=()=>N.useContext(Gz),jz=N.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...c},u)=>{const{size:f=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:v=""}=Wz()??{},_=i??p?Number(n??h)*24/Number(e??f):n??h;return N.createElement("svg",{ref:u,...Jm,width:e??f??Jm.width,height:e??f??Jm.height,stroke:t??m,strokeWidth:_,className:fC("lucide",v,r),...!s&&!Hz(c)&&{"aria-hidden":"true"},...c},[...o.map(([w,y])=>N.createElement(w,y)),...Array.isArray(s)?s:[s]])});const By=(t,e)=>{const n=N.forwardRef(({className:i,...r},s)=>N.createElement(jz,{ref:s,iconNode:e,className:fC(`lucide-${zz(nE(t))}`,`lucide-${t}`,i),...r}));return n.displayName=nE(t),n};const $z=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Xz=By("log-out",$z);const qz=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Yz=By("mail",qz);const Kz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zz=By("x",Kz);function hC(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=hC(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function Jz(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=hC(t))&&(i&&(i+=" "),i+=e);return i}const Qz=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i<t.length;i++)n[i]=t[i];for(let i=0;i<e.length;i++)n[t.length+i]=e[i];return n},e5=(t,e)=>({classGroupId:t,validator:e}),pC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),hh="-",iE=[],t5="arbitrary..",n5=t=>{const e=r5(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return i5(o);const c=o.split(hh),u=c[0]===""&&c.length>1?1:0;return mC(c,u,e)},getConflictingClassGroupIds:(o,c)=>{if(c){const u=i[o],f=n[o];return u?f?Qz(f,u):u:f||iE}return n[o]||iE}}},mC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const f=mC(t,e+1,s);if(f)return f}const o=n.validators;if(o===null)return;const c=e===0?t.join(hh):t.slice(e).join(hh),u=o.length;for(let f=0;f<u;f++){const h=o[f];if(h.validator(c))return h.classGroupId}},i5=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?t5+i:void 0})(),r5=t=>{const{theme:e,classGroups:n}=t;return s5(n,e)},s5=(t,e)=>{const n=pC();for(const i in t){const r=t[i];zy(r,n,i,e)}return n},zy=(t,e,n,i)=>{const r=t.length;for(let s=0;s<r;s++){const o=t[s];a5(o,e,n,i)}},a5=(t,e,n,i)=>{if(typeof t=="string"){o5(t,e,n);return}if(typeof t=="function"){l5(t,e,n,i);return}c5(t,e,n,i)},o5=(t,e,n)=>{const i=t===""?e:gC(e,t);i.classGroupId=n},l5=(t,e,n,i)=>{if(u5(t)){zy(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(e5(n,t))},c5=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o<s;o++){const[c,u]=r[o];zy(u,gC(e,c),n,i)}},gC=(t,e)=>{let n=t;const i=e.split(hh),r=i.length;for(let s=0;s<r;s++){const o=i[s];let c=n.nextPart.get(o);c||(c=pC(),n.nextPart.set(o,c)),n=c}return n},u5=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,d5=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},D0="!",rE=":",f5=[],sE=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),h5=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=r=>{const s=[];let o=0,c=0,u=0,f;const h=r.length;for(let w=0;w<h;w++){const y=r[w];if(o===0&&c===0){if(y===rE){s.push(r.slice(u,w)),u=w+1;continue}if(y==="/"){f=w;continue}}y==="["?o++:y==="]"?o--:y==="("?c++:y===")"&&c--}const p=s.length===0?r:r.slice(u);let m=p,v=!1;p.endsWith(D0)?(m=p.slice(0,-1),v=!0):p.startsWith(D0)&&(m=p.slice(1),v=!0);const _=f&&f>u?f-u:void 0;return sE(s,v,m,_)};if(e){const r=e+rE,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):sE(f5,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},p5=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s<n.length;s++){const o=n[s],c=o[0]==="[",u=e.has(o);c||u?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},m5=t=>({cache:d5(t.cacheSize),parseClassName:h5(t),sortModifiers:p5(t),...n5(t)}),g5=/\s+/,v5=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],c=t.trim().split(g5);let u="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:_,maybePostfixModifierPosition:w}=n(h);if(p){u=h+(u.length>0?" "+u:u);continue}let y=!!w,x=i(y?_.substring(0,w):_);if(!x){if(!y){u=h+(u.length>0?" "+u:u);continue}if(x=i(_),!x){u=h+(u.length>0?" "+u:u);continue}y=!1}const M=m.length===0?"":m.length===1?m[0]:s(m).join(":"),A=v?M+D0:M,T=A+x;if(o.indexOf(T)>-1)continue;o.push(T);const D=r(x,y);for(let I=0;I<D.length;++I){const U=D[I];o.push(A+U)}u=h+(u.length>0?" "+u:u)}return u},y5=(...t)=>{let e=0,n,i,r="";for(;e<t.length;)(n=t[e++])&&(i=vC(n))&&(r&&(r+=" "),r+=i);return r},vC=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=vC(t[i]))&&(n&&(n+=" "),n+=e);return n},_5=(t,...e)=>{let n,i,r,s;const o=u=>{const f=e.reduce((h,p)=>p(h),t());return n=m5(f),i=n.cache.get,r=n.cache.set,s=c,c(u)},c=u=>{const f=i(u);if(f)return f;const h=v5(u,n);return r(u,h),h};return s=o,(...u)=>s(y5(...u))},x5=[],Qn=t=>{const e=n=>n[t]||x5;return e.isThemeGetter=!0,e},yC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_C=/^\((?:(\w[\w-]*):)?(.+)\)$/i,b5=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,S5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,w5=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,E5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,M5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,T5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ua=t=>b5.test(t),Xt=t=>!!t&&!Number.isNaN(Number(t)),da=t=>!!t&&Number.isInteger(Number(t)),Qm=t=>t.endsWith("%")&&Xt(t.slice(0,-1)),ws=t=>S5.test(t),xC=()=>!0,A5=t=>w5.test(t)&&!E5.test(t),Vy=()=>!1,C5=t=>M5.test(t),R5=t=>T5.test(t),P5=t=>!dt(t)&&!mt(t),k5=t=>La(t,wC,Vy),dt=t=>yC.test(t),qa=t=>La(t,EC,A5),aE=t=>La(t,B5,Xt),L5=t=>La(t,TC,xC),D5=t=>La(t,MC,Vy),oE=t=>La(t,bC,Vy),N5=t=>La(t,SC,R5),Xd=t=>La(t,AC,C5),mt=t=>_C.test(t),Oc=t=>Ro(t,EC),I5=t=>Ro(t,MC),lE=t=>Ro(t,bC),U5=t=>Ro(t,wC),F5=t=>Ro(t,SC),qd=t=>Ro(t,AC,!0),O5=t=>Ro(t,TC,!0),La=(t,e,n)=>{const i=yC.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},Ro=(t,e,n=!1)=>{const i=_C.exec(t);return i?i[1]?e(i[1]):n:!1},bC=t=>t==="position"||t==="percentage",SC=t=>t==="image"||t==="url",wC=t=>t==="length"||t==="size"||t==="bg-size",EC=t=>t==="length",B5=t=>t==="number",MC=t=>t==="family-name",TC=t=>t==="number"||t==="weight",AC=t=>t==="shadow",z5=()=>{const t=Qn("color"),e=Qn("font"),n=Qn("text"),i=Qn("font-weight"),r=Qn("tracking"),s=Qn("leading"),o=Qn("breakpoint"),c=Qn("container"),u=Qn("spacing"),f=Qn("radius"),h=Qn("shadow"),p=Qn("inset-shadow"),m=Qn("text-shadow"),v=Qn("drop-shadow"),_=Qn("blur"),w=Qn("perspective"),y=Qn("aspect"),x=Qn("ease"),M=Qn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...T(),mt,dt],I=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],S=()=>[mt,dt,u],R=()=>[ua,"full","auto",...S()],H=()=>[da,"none","subgrid",mt,dt],F=()=>["auto",{span:["full",da,mt,dt]},da,mt,dt],W=()=>[da,"auto",mt,dt],X=()=>["auto","min","max","fr",mt,dt],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...S()],Q=()=>[ua,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],$=()=>[ua,"screen","full","dvw","lvw","svw","min","max","fit",...S()],Y=()=>[ua,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],Z=()=>[t,mt,dt],z=()=>[...T(),lE,oE,{position:[mt,dt]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_e=()=>["auto","cover","contain",U5,k5,{size:[mt,dt]}],Ee=()=>[Qm,Oc,qa],Ue=()=>["","none","full",f,mt,dt],le=()=>["",Xt,Oc,qa],be=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ne=()=>[Xt,Qm,lE,oE],et=()=>["","none",_,mt,dt],xt=()=>["none",Xt,mt,dt],pn=()=>["none",Xt,mt,dt],ht=()=>[Xt,mt,dt],Ut=()=>[ua,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ws],breakpoint:[ws],color:[xC],container:[ws],"drop-shadow":[ws],ease:["in","out","in-out"],font:[P5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ws],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ws],shadow:[ws],spacing:["px",Xt],text:[ws],"text-shadow":[ws],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ua,dt,mt,y]}],container:["container"],columns:[{columns:[Xt,dt,mt,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[da,"auto",mt,dt]}],basis:[{basis:[ua,"full","auto",c,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xt,ua,"auto","initial","none",dt]}],grow:[{grow:["",Xt,mt,dt]}],shrink:[{shrink:["",Xt,mt,dt]}],order:[{order:[da,"first","last","none",mt,dt]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mbs:[{mbs:J()}],mbe:[{mbe:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[c,"screen",...Q()]}],"min-w":[{"min-w":[c,"screen","none",...Q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,Oc,qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,O5,L5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qm,dt]}],"font-family":[{font:[I5,D5,e]}],"font-features":[{"font-features":[dt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,mt,dt]}],"line-clamp":[{"line-clamp":[Xt,"none",mt,aE]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",mt,dt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",mt,dt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xt,"from-font","auto",mt,qa]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[Xt,"auto",mt,dt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",mt,dt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",mt,dt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:_e()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},da,mt,dt],radial:["",mt,dt],conic:[da,mt,dt]},F5,N5]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:Ee()}],"gradient-via-pos":[{via:Ee()}],"gradient-to-pos":[{to:Ee()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:Ue()}],"rounded-s":[{"rounded-s":Ue()}],"rounded-e":[{"rounded-e":Ue()}],"rounded-t":[{"rounded-t":Ue()}],"rounded-r":[{"rounded-r":Ue()}],"rounded-b":[{"rounded-b":Ue()}],"rounded-l":[{"rounded-l":Ue()}],"rounded-ss":[{"rounded-ss":Ue()}],"rounded-se":[{"rounded-se":Ue()}],"rounded-ee":[{"rounded-ee":Ue()}],"rounded-es":[{"rounded-es":Ue()}],"rounded-tl":[{"rounded-tl":Ue()}],"rounded-tr":[{"rounded-tr":Ue()}],"rounded-br":[{"rounded-br":Ue()}],"rounded-bl":[{"rounded-bl":Ue()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-bs":[{"border-bs":Z()}],"border-color-be":[{"border-be":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xt,mt,dt]}],"outline-w":[{outline:["",Xt,Oc,qa]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",h,qd,Xd]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",p,qd,Xd]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[Xt,qa]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",m,qd,Xd]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[Xt,mt,dt]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[mt,dt]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Xt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:_e()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",mt,dt]}],filter:[{filter:["","none",mt,dt]}],blur:[{blur:et()}],brightness:[{brightness:[Xt,mt,dt]}],contrast:[{contrast:[Xt,mt,dt]}],"drop-shadow":[{"drop-shadow":["","none",v,qd,Xd]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",Xt,mt,dt]}],"hue-rotate":[{"hue-rotate":[Xt,mt,dt]}],invert:[{invert:["",Xt,mt,dt]}],saturate:[{saturate:[Xt,mt,dt]}],sepia:[{sepia:["",Xt,mt,dt]}],"backdrop-filter":[{"backdrop-filter":["","none",mt,dt]}],"backdrop-blur":[{"backdrop-blur":et()}],"backdrop-brightness":[{"backdrop-brightness":[Xt,mt,dt]}],"backdrop-contrast":[{"backdrop-contrast":[Xt,mt,dt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xt,mt,dt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xt,mt,dt]}],"backdrop-invert":[{"backdrop-invert":["",Xt,mt,dt]}],"backdrop-opacity":[{"backdrop-opacity":[Xt,mt,dt]}],"backdrop-saturate":[{"backdrop-saturate":[Xt,mt,dt]}],"backdrop-sepia":[{"backdrop-sepia":["",Xt,mt,dt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",mt,dt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xt,"initial",mt,dt]}],ease:[{ease:["linear","initial",x,mt,dt]}],delay:[{delay:[Xt,mt,dt]}],animate:[{animate:["none",M,mt,dt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,mt,dt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:xt()}],"rotate-x":[{"rotate-x":xt()}],"rotate-y":[{"rotate-y":xt()}],"rotate-z":[{"rotate-z":xt()}],scale:[{scale:pn()}],"scale-x":[{"scale-x":pn()}],"scale-y":[{"scale-y":pn()}],"scale-z":[{"scale-z":pn()}],"scale-3d":["scale-3d"],skew:[{skew:ht()}],"skew-x":[{"skew-x":ht()}],"skew-y":[{"skew-y":ht()}],transform:[{transform:[mt,dt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ut()}],"translate-x":[{"translate-x":Ut()}],"translate-y":[{"translate-y":Ut()}],"translate-z":[{"translate-z":Ut()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",mt,dt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",mt,dt]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[Xt,Oc,qa,aE]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},V5=_5(z5);function Si(...t){return V5(Jz(t))}const H5=B.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[B.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),B.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),B.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),B.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),G5=B.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:B.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),W5={google:H5,github:G5},j5={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function $5(t){return j5[t]||String(t||"").replace(/-/g," ")}function X5(){const{isOpen:t,closeLoginModal:e}=ET(),{enabled:n,signedIn:i,refreshUser:r,signInWithPassword:s,signUp:o,signInWithOAuth:c,getPublicAuthConfig:u}=$l(),[f,h]=N.useState("signin"),[p,m]=N.useState(""),[v,_]=N.useState(""),[w,y]=N.useState(""),[x,M]=N.useState(!1),[A,T]=N.useState(null),[D,I]=N.useState(null),[U,S]=N.useState(!1),[R,H]=N.useState(!0),[F,W]=N.useState([]),[X,V]=N.useState(8);N.useEffect(()=>{t&&(T(null),I(null),h("signin"),m(""),_(""),y(""),S(!1))},[t]),N.useEffect(()=>{if(!t||!n){H(!1);return}let $=!0;return(async()=>{const{data:Y,error:Z}=await u();if($){if(Z||!Y)W(["google","github"]);else{const z=Array.isArray(Y.oAuthProviders)?Y.oAuthProviders:[],ie=Array.isArray(Y.customOAuthProviders)?Y.customOAuthProviders:[];W([...z,...ie]),typeof Y.passwordMinLength=="number"&&Y.passwordMinLength>0&&V(Y.passwordMinLength)}H(!1)}})(),()=>{$=!1}},[t,n,u]),N.useEffect(()=>{t&&i&&e()},[t,i,e]);const q=N.useMemo(()=>typeof window>"u"?"":window.location.origin+"/",[]),J=N.useCallback(async $=>{T(null),M(!0);try{const{error:Y}=await c($,q);Y&&T(Y.message||String(Y))}finally{M(!1)}},[c,q]),Q=N.useCallback(async $=>{$.preventDefault(),T(null),M(!0);try{if(f==="signup"){const{data:Z,error:z}=await o({email:p.trim(),password:v,name:w.trim()||void 0});if(z){T(z.message||String(z));return}if(Z?.requireEmailVerification){I("Check your email for a verification link."),h("signin");return}await r();return}const{error:Y}=await s({email:p.trim(),password:v});if(Y){T(Y.message||String(Y));return}await r()}finally{M(!1)}},[f,p,v,w,o,s,r]);return N.useEffect(()=>{if(!t)return;const $=Y=>{Y.key==="Escape"&&e()};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[t,e]),n?B.jsx(QA,{children:t&&B.jsxs(go.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[B.jsx(go.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:e,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),B.jsxs(go.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:$=>$.stopPropagation(),children:[B.jsx("button",{type:"button",onClick:e,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:B.jsx(Zz,{className:"h-5 w-5"})}),B.jsxs("div",{className:"text-center mb-6",children:[B.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[B.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),B.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),B.jsx("p",{className:"text-sm text-oai-gray-500",children:"Sign in to join the leaderboard"})]}),D&&B.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:D}),A&&B.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:A}),B.jsx("div",{className:"space-y-2.5 mb-5",children:R?B.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):F.map($=>B.jsxs("button",{type:"button",disabled:x,onClick:()=>J($),className:Si("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[W5[$]||null,"Continue with ",$5($)]},$))}),U?B.jsxs(B.Fragment,{children:[B.jsxs("div",{className:"relative mb-5",children:[B.jsx("div",{className:"absolute inset-0 flex items-center",children:B.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),B.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:B.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:"email"})})]}),B.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[B.jsx("button",{type:"button",className:Si("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{h("signin"),T(null)},children:"Sign In"}),B.jsx("button",{type:"button",className:Si("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{h("signup"),T(null)},children:"Sign Up"})]}),B.jsxs("form",{onSubmit:Q,className:"space-y-3",children:[f==="signup"&&B.jsxs("div",{children:[B.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Name"}),B.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:w,onChange:$=>y($.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:"Optional"})]}),B.jsxs("div",{children:[B.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Email"}),B.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:p,onChange:$=>m($.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),B.jsxs("div",{children:[B.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:"Password"}),B.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?X:void 0,value:v,onChange:$=>_($.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&B.jsxs("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:["At least ",X," characters"]})]}),B.jsx("button",{type:"submit",disabled:x,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:f==="signup"?"Create Account":"Sign In"})]})]}):B.jsxs(B.Fragment,{children:[B.jsxs("div",{className:"relative mb-5",children:[B.jsx("div",{className:"absolute inset-0 flex items-center",children:B.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),B.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:B.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:"or"})})]}),B.jsxs("button",{type:"button",onClick:()=>S(!0),className:Si("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[B.jsx(Yz,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),"Continue with Email"]})]})]})]})}):null}const q5={VITE_INSFORGE_BASE_URL:"https://b46ug8xu.us-east.insforge.app"};function Y5(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const e=typeof import.meta<"u"?q5:void 0;return(e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e?.VITE_INSFORGE_BASE_URL||"").trim()}function a$(){return Co()}function o$(){if(typeof Intl>"u"||!Intl.DateTimeFormat)return null;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function l$(t=new Date){const e=t instanceof Date?t:new Date(t);if(!Number.isFinite(e.getTime()))return 0;const n=e.getTimezoneOffset();return Number.isFinite(n)?-n:0}function CC(t){if(!Number.isFinite(t)||t===0)return"UTC";const e=t>=0?"+":"-",n=Math.abs(t),i=String(Math.floor(n/60)).padStart(2,"0"),r=String(n%60).padStart(2,"0");return`UTC${e}${i}:${r}`}function c$({timeZone:t,offsetMinutes:e}={}){const n=CC(e);return t&&t!=="UTC"?`${t} (${n})`:n}function u$({timeZone:t,offsetMinutes:e}={}){return Number.isFinite(e)?CC(e):t||"UTC"}function d$({timeZone:t,offsetMinutes:e,date:n=new Date}={}){const i=n instanceof Date?n:new Date(n);if(!Number.isFinite(i.getTime()))return"";if(t&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const o=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(i).reduce((h,p)=>(p.type&&p.value&&(h[p.type]=p.value),h),{}),c=o.year,u=o.month,f=o.day;if(c&&u&&f)return`${c}-${u}-${f}`}catch{}if(typeof e=="number"&&Number.isFinite(e)){const r=new Date(i.getTime()+e*6e4);return Z5(r)}return J5(i)}function K5({timeZone:t,offsetMinutes:e,date:n=new Date}={}){const i=n instanceof Date?n:new Date(n);if(!Number.isFinite(i.getTime()))return null;if(t&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const o=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(i).reduce((h,p)=>(p.type&&p.value&&(h[p.type]=p.value),h),{}),c=Number(o.year),u=Number(o.month),f=Number(o.day);if(Number.isFinite(c)&&Number.isFinite(u)&&Number.isFinite(f))return{year:c,month:u,day:f}}catch{}if(typeof e=="number"&&Number.isFinite(e)){const r=new Date(i.getTime()+e*6e4);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate()}}return{year:i.getFullYear(),month:i.getMonth()+1,day:i.getDate()}}function f$({timeZone:t,offsetMinutes:e}={}){return t?`tz:${t}`:typeof e=="number"&&Number.isFinite(e)?`offset:${Math.trunc(e)}`:"utc"}function Z5(t){const e=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),i=String(t.getUTCDate()).padStart(2,"0");return`${e}-${n}-${i}`}function J5(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${i}`}function kn(t){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())).toISOString().slice(0,10)}function fs(t){const e=t instanceof Date?t:new Date(t);if(!Number.isFinite(e.getTime()))return"";const n=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${n}-${i}-${r}`}function Q5(t){if(!t)return null;const e=String(t).trim(),n=e.split("-");if(n.length!==3)return null;const i=Number(n[0]),r=Number(n[1])-1,s=Number(n[2]);if(!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(s))return null;const o=new Date(Date.UTC(i,r,s));return Number.isFinite(o.getTime())&&kn(o)===e?o:null}function eV(t){if(!t)return"";const e=t.year,n=String(t.month).padStart(2,"0"),i=String(t.day).padStart(2,"0");return!e||!n||!i?"":`${e}-${n}-${i}`}function tV(t,{timeZone:e,offsetMinutes:n,now:i}={}){const r=i instanceof Date&&Number.isFinite(i.getTime())?i:new Date,s=K5({timeZone:e,offsetMinutes:n,date:r});if(!s){const u=fs(new Date);return{from:u,to:u}}const o=eV(s),c=Q5(o);if(!c)return{from:o,to:o};if(t==="day")return{from:o,to:o};if(t==="week"){const u=new Date(c),h=(u.getUTCDay()+6)%7;u.setUTCDate(u.getUTCDate()-h);const p=new Date(u);return p.setUTCDate(p.getUTCDate()+6),{from:kn(u),to:kn(p)}}if(t==="month"){const u=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth(),1)),f=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth()+1,0));return{from:kn(u),to:kn(f)}}if(t==="total"){const u=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth()-23,1));return{from:kn(u),to:o}}return tV("week")}function h$(t){if(t==null)return"-";try{if(typeof t=="bigint")return new Intl.NumberFormat().format(t);if(typeof t=="number")return new Intl.NumberFormat().format(t);const e=String(t).trim();return/^[0-9]+$/.test(e)?new Intl.NumberFormat().format(BigInt(e)):e}catch{return String(t)}}function p$(t,{thousandSuffix:e="K",millionSuffix:n="M",billionSuffix:i="B",decimals:r=1}={}){const s=Number(String(t));if(!Number.isFinite(s))return"-";const o=s<0?"-":"",c=Math.abs(s),u=Math.max(0,Math.min(6,Math.floor(r)));if(c<1e3)return`${o}${String(c)}`;const f=(v,_)=>{const w=v.toFixed(u),y=Number(w).toString();return`${o}${y}${_}`},h=(v,_,w)=>{const y=v.toFixed(u),x=Number(y);return w&&x>=1e3?f(x/1e3,w):`${o}${x.toString()}${_}`};if(c>=1e9)return f(c/1e9,i);if(c>=1e6)return h(c/1e6,n,i);const p=c/1e3,m=Number(p.toFixed(u));return m>=1e3?f(m/1e3,n):f(m,e)}function RC(t){const e=Number(String(t));return Number.isFinite(e)?e:null}function m$(t,{decimals:e=2}={}){if(t==null)return"-";const n=String(t).trim();if(!n)return"-";const i=n.match(/^(-?\d+)(?:\.(\d+))?$/);if(!i)return n;const r=i[1],s=i[2]||"";let o=r;try{o=new Intl.NumberFormat().format(BigInt(r))}catch{o=r}const c=Math.max(0,Math.min(6,Math.floor(e))),u=c?s.slice(0,c).padEnd(c,"0"):"",f=r.startsWith("-")?"-":"",h=c?`${o.replace("-","")}.${u}`:o.replace("-","");return`${f}$${h}`}function ph(t){if(typeof t!="string")return null;const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t.trim());if(!e)return null;const n=Number(e[1]),i=Number(e[2])-1,r=Number(e[3]),s=new Date(Date.UTC(n,i,r));return Number.isFinite(s.getTime())&&kn(s)===t.trim()?s:null}function co(t,e){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+e))}function nV(t,e){const n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.floor(n/864e5)}function eg(t,e){if(!Array.isArray(t)||t.length===0)return 0;const n=t.length,i=(n-1)*e,r=Math.floor(i),s=i-r,o=t[r]??t[n-1],c=t[Math.min(n-1,r+1)]??t[n-1];return Math.round(o+(c-o)*s)}function iV(t){return t<=0?0:t>=4?4:t}function PC({weeks:t=52,now:e,weekStartsOn:n="sun"}={}){const i=e instanceof Date&&Number.isFinite(e.getTime())?e:new Date,r=fs(i),s=ph(r)||new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),o=n==="mon"?1:0,c=s.getUTCDay(),u=co(s,-((c-o+7)%7)),f=co(u,-7*(Math.max(1,t)-1));return{from:kn(f),to:r}}function rV({dailyRows:t,weeks:e=52,to:n,weekStartsOn:i="sun"}={}){const r=ph(n)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),{from:s}=PC({weeks:e,now:r,weekStartsOn:i}),o=ph(s)||co(r,-(e*7-1)),c=(()=>{const T=(o.getUTCDay()-(i==="mon"?1:0)+7)%7;return co(o,-T)})(),u=new Map;for(const M of Array.isArray(t)?t:[]){const A=typeof M?.day=="string"?M.day:null;if(!A)continue;const T=RC(M?.billable_total_tokens??M?.total_tokens)??0;u.set(A,Math.max(0,T))}const f=nV(c,r)+1,h=Math.ceil(f/7),p=[];for(let M=0;M<f;M++){const A=co(c,M),T=kn(A),D=u.get(T)??0;D>0&&p.push(D)}p.sort((M,A)=>M-A);const m=eg(p,.5),v=eg(p,.75),_=eg(p,.9);function w(M){return!M||M<=0?0:M<=m?1:M<=v?2:M<=_?3:4}const y=[];for(let M=0;M<h;M++){const A=[];for(let T=0;T<7;T++){const D=M*7+T,I=co(c,D);if(I.getTime()>r.getTime()){A.push(null);continue}const U=kn(I),S=u.get(U)??0;A.push({day:U,value:S,level:iV(w(S))})}y.push(A)}const x=y.length>e?y.slice(y.length-e):y;return{from:s,to:kn(r),weeks:x,thresholds:{t1:m,t2:v,t3:_}}}function sV({dailyRows:t,to:e}={}){const n=ph(e)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),i=new Map;for(const s of Array.isArray(t)?t:[]){const o=typeof s?.day=="string"?s.day:null;if(!o)continue;const c=RC(s?.billable_total_tokens??s?.total_tokens)??0;i.set(o,Math.max(0,c))}let r=0;for(let s=0;s<370;s++){const o=kn(co(n,-s));if((i.get(o)??0)>0){r+=1;continue}break}return r}const Nh={},kC="tokentracker",aV=["victorgpt/tokentracker","spacedriveapp/spacedrive","acme/alpha","acme/beta","neo/nebula","signal/flux","matrix/terminal","orbit/atlas","lumen/core","delta/horizon"],cE=["NEO","TRINITY","MORPHEUS","ORACLE","CYPHER","SWITCH","APOC","TANK","SMITH","SERAPH","NIOBE","MOUSE","DOZER","LINK","BLADE"];function xr(){if(typeof window<"u"){const t=new URLSearchParams(window.location.search),e=String(t.get("mock")||"").toLowerCase();if(e==="0"||e==="false"||e==="off"||e==="no")return!1;if(e==="1"||e==="true"||e==="on"||e==="yes")return!0}if(typeof import.meta<"u"&&Nh){const t="".toLowerCase();if(t==="1"||t==="true")return!0}return!1}function oV(){if(typeof import.meta<"u"&&Nh){const t="".trim();if(t)return t;const e="".trim();if(e)return e}if(typeof window<"u"){const t=new URLSearchParams(window.location.search),e=String(t.get("mock_now")||"").trim();if(e)return e;const n=String(t.get("mock_today")||"").trim();if(n)return n}return""}function lV(t){if(!t)return null;const e=String(t).trim();if(!e)return null;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[i,r,s]=e.split("-").map(Number);if(!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(s))return null;const o=new Date(i,r-1,s,12,0,0);return Number.isFinite(o.getTime())?o:null}const n=new Date(e);return Number.isFinite(n.getTime())?n:null}function g$(){return xr()?lV(oV()):null}function cV(){if(typeof import.meta<"u"&&Nh){const t="".trim();if(t)return t}if(typeof window<"u"){const t=new URLSearchParams(window.location.search),e=String(t.get("mock_seed")||"").trim();if(e)return e}return kC}function uV(){if(typeof import.meta<"u"&&Nh){const t="".trim(),e=Number(t);if(Number.isFinite(e)&&e>0)return Math.floor(e)}if(typeof window<"u"){const t=new URLSearchParams(window.location.search),e=String(t.get("mock_missing")||"").trim(),n=Number(e);if(Number.isFinite(n)&&n>0)return Math.floor(n)}return 0}function Ru(t){return(t==null?cV():String(t)).trim()||kC}function Pu(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return e>>>0}function ki(t){if(typeof t!="string")return null;const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t.trim());if(!e)return null;const n=Number(e[1]),i=Number(e[2])-1,r=Number(e[3]),s=new Date(Date.UTC(n,i,r));return Number.isFinite(s.getTime())&&kn(s)===t.trim()?s:null}function gu(t,e){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()+e))}function LC(t,e){return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+e,1))}function dV(t){return`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,"0")}`}function Ol({from:t,to:e,seed:n}){const i=ki(fs(new Date))||new Date,r=ki(t)||i,s=ki(e)||r,o=[],c=Ru(n),u=Math.floor((Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate())-Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()))/864e5)+1;for(let f=0;f<u;f+=1){const h=gu(r,f),p=kn(h),m=Pu(`${c}:${p}`),v=m%1e3/1e3,_=.6+.4*Math.sin(f/6*Math.PI*.5),w=h.getUTCDay()===0||h.getUTCDay()===6?.65:1,y=18e3+Math.round(12e3*v),x=Math.max(0,Math.round(y*_*w)),M=Math.round(x*.46),A=Math.round(x*.34),T=Math.round(x*.14),D=Math.max(0,x-M-A-T);o.push({day:p,total_tokens:x,billable_total_tokens:x,input_tokens:M,output_tokens:A,cached_input_tokens:T,reasoning_output_tokens:D,conversation_count:1+m%5})}return o}function fV({day:t,seed:e}){const n=ki(t)||ki(fs(new Date))||new Date,i=kn(n),r=Ru(e),s=Array.from({length:48},(c,u)=>{const f=Math.floor(u/2),h=u%2===0?0:30,m=Pu(`${r}:${i}:${f}:${h}`)%1e3/1e3,v=(f+h/60)/24,_=.4+.6*Math.sin(v*Math.PI*2),w=900+Math.round(700*m),y=Math.max(0,Math.round(w*_)),x=Math.round(y*.46),M=Math.round(y*.34),A=Math.round(y*.14),T=Math.max(0,y-x-M-A);return{hour:`${i}T${String(f).padStart(2,"0")}:${String(h).padStart(2,"0")}:00`,total_tokens:y,billable_total_tokens:y,input_tokens:x,output_tokens:M,cached_input_tokens:A,reasoning_output_tokens:T}}),o=Math.max(0,Math.min(48,uV()));if(o>0){const c=Date.now(),u=s.map((p,m)=>{const v=Date.parse(p.hour);return Number.isFinite(v)&&v<=c?{index:m,ts:v}:null}).filter(Boolean),f=Math.max(0,u.length-o),h=u.slice(f);for(const p of h){const m=s[p.index];m&&(s[p.index]={...m,missing:!0})}}return s}function hV({months:t=24,to:e,seed:n}){const i=ki(e)||ki(fs(new Date))||new Date,r=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1)),s=Ru(n),o=[];for(let c=t-1;c>=0;c-=1){const u=LC(r,-c),f=dV(u),p=Pu(`${s}:${f}`)%1e3/1e3,m=.7+.3*Math.sin(o.length/6*Math.PI*.5),v=36e4+Math.round(2e5*p),_=Math.max(0,Math.round(v*m)),w=Math.round(_*.46),y=Math.round(_*.34),x=Math.round(_*.14),M=Math.max(0,_-w-y-x);o.push({month:f,total_tokens:_,billable_total_tokens:_,input_tokens:w,output_tokens:y,cached_input_tokens:x,reasoning_output_tokens:M})}return o}function Hy(t){return t.reduce((e,n)=>(e.total_tokens+=Number(n.total_tokens||0),e.billable_total_tokens+=Number(n.billable_total_tokens||n.total_tokens||0),e.input_tokens+=Number(n.input_tokens||0),e.output_tokens+=Number(n.output_tokens||0),e.cached_input_tokens+=Number(n.cached_input_tokens||0),e.reasoning_output_tokens+=Number(n.reasoning_output_tokens||0),e.conversation_count+=Number(n.conversation_count||0),e),{total_tokens:0,billable_total_tokens:0,input_tokens:0,output_tokens:0,cached_input_tokens:0,reasoning_output_tokens:0,conversation_count:0})}function pV(t,e=1.75){const n=Number(t||0);return!Number.isFinite(n)||n<=0?"0.000000":(n*e/1e6).toFixed(6)}function uE(t,e){const n=Number.isFinite(e)?e:0;return{total_tokens:Math.max(0,Math.round(t.total_tokens*n)),billable_total_tokens:Math.max(0,Math.round((t.billable_total_tokens??t.total_tokens)*n)),input_tokens:Math.max(0,Math.round(t.input_tokens*n)),output_tokens:Math.max(0,Math.round(t.output_tokens*n)),cached_input_tokens:Math.max(0,Math.round(t.cached_input_tokens*n)),reasoning_output_tokens:Math.max(0,Math.round(t.reasoning_output_tokens*n))}}function N0(t){return{...t,total_cost_usd:pV(t.total_tokens)}}function mV({from:t,to:e,seed:n}={}){const i=Ol({from:t,to:e,seed:n});return{from:t,to:e,data:i}}function gV({day:t,seed:e}={}){const n=ki(t)||new Date,i=kn(n),r=fV({day:i,seed:e});return{day:i,data:r}}function vV({months:t=24,to:e,seed:n}={}){const i=ki(e)||ki(fs(new Date))||new Date,r=kn(i),s=hV({months:t,to:r,seed:n}),o=LC(new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1)),-(t-1));return{from:kn(o),to:r,months:t,data:s}}function yV({from:t,to:e,seed:n,rolling:i=!0}={}){const r=Ol({from:t,to:e,seed:n}),s=Hy(r),o=N0(s),c=i?_V({to:e,seed:n}):null;return{from:t,to:e,days:r.length,totals:o,...c?{rolling:c}:{}}}function _V({to:t,seed:e}={}){const n=ki(t)||ki(fs(new Date))||new Date,i=kn(n),r=kn(gu(n,-6)),s=kn(gu(n,-29)),o=Ol({from:r,to:i,seed:e}),c=Ol({from:s,to:i,seed:e});return{last_7d:dE({rows:o,from:r,to:i}),last_30d:dE({rows:c,from:s,to:i})}}function dE({rows:t,from:e,to:n}={}){const i=Hy(t||[]),r=(t||[]).filter(o=>Number(o.billable_total_tokens??o.total_tokens)>0).length,s=r>0?Math.floor(i.billable_total_tokens/r):0;return{from:e,to:n,totals:{billable_total_tokens:i.billable_total_tokens,conversation_count:i.conversation_count},active_days:r,avg_per_active_day:s}}function xV({seed:t,limit:e=3}={}){const n=Ru(t),i=aV.map((r,s)=>{const c=12e4+Pu(`${n}:${r}`)%9e5,u=s%4*4200,f=Math.max(0,c+u),h=Math.max(0,Math.round(f*.96));return{project_key:r,project_ref:`https://github.com/${r}`,total_tokens:String(f),billable_total_tokens:String(h)}}).sort((r,s)=>Number(s.billable_total_tokens)-Number(r.billable_total_tokens)).slice(0,Math.max(1,Math.min(10,Math.floor(Number(e)||3))));return{generated_at:new Date().toISOString(),entries:i}}function bV(t){const e=ki(fs(new Date))||new Date,n=String(t).trim().toLowerCase()||"week";if(n==="total")return{from:"1970-01-01",to:"9999-12-31"};if(n==="month"){const o=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),c=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+1,0));return{from:kn(o),to:kn(c)}}const i=e.getUTCDay(),r=kn(gu(e,-i)),s=kn(gu(e,-i+6));return{from:r,to:s}}function DC({seed:t,period:e,metric:n,limit:i=20,offset:r=0}={}){const s=Ru(t),o=Math.max(1,Math.min(100,Math.floor(Number(i)||20))),c=Math.max(0,Math.min(1e4,Math.floor(Number(r)||0))),u=String(n||"all").trim().toLowerCase()||"all",f=String(e||"week").trim().toLowerCase()||"week",h=f==="month"||f==="total"||f==="week"?f:"week",{from:p,to:m}=bV(h),v=250,_=v>0?Math.ceil(v/o):0,w=Math.floor(c/o)+1,y=Array.from({length:v},(U,S)=>{const R=S+1,H=`00000000-0000-0000-0000-${String(R).padStart(12,"0")}`,F=cE[R%cE.length],X=18e4+Pu(`${s}:${F}:${R}`)%9e5,V=Math.max(0,X+R*1200),q=Math.floor(V*.28),J=Math.floor(V*.18),Q=Math.floor(V*.12),$=Math.floor(V*.12),Y=Math.floor(V*.1),Z=Math.max(0,V-q-J-Q-$-Y),z=R%7!==0;return{id:R,user_id:H,is_public:z,is_me:!1,display_name:z?F:"Anonymous",avatar_url:null,gpt_tokens:q,claude_tokens:J,gemini_tokens:Q,cursor_tokens:$,opencode_tokens:Y,openclaw_tokens:Z,other_tokens:0,total_tokens:V}}),x=Math.max(0,Math.min(v-1,Math.floor(v*.8)));y[x]&&(y[x].is_me=!0);const M=u==="gpt"||u==="codex"?"gpt_tokens":u==="claude"?"claude_tokens":u==="gemini"?"gemini_tokens":u==="cursor"?"cursor_tokens":u==="opencode"?"opencode_tokens":u==="openclaw"?"openclaw_tokens":"total_tokens",A=y.slice().sort((U,S)=>Number(S[M])-Number(U[M])||U.id-S.id).map((U,S)=>({user_id:U.is_public?U.user_id:null,rank:S+1,is_me:!!U.is_me,display_name:U.display_name,avatar_url:U.avatar_url,gpt_tokens:String(U.gpt_tokens),claude_tokens:String(U.claude_tokens),gemini_tokens:String(U.gemini_tokens),cursor_tokens:String(U.cursor_tokens),opencode_tokens:String(U.opencode_tokens),openclaw_tokens:String(U.openclaw_tokens),other_tokens:String(U.other_tokens??0),total_tokens:String(U.total_tokens),is_public:!!U.is_public})),T=A.find(U=>U?.is_me)||null,D=T?{rank:T.rank,gpt_tokens:T.gpt_tokens,claude_tokens:T.claude_tokens,gemini_tokens:T.gemini_tokens,cursor_tokens:T.cursor_tokens,opencode_tokens:T.opencode_tokens,openclaw_tokens:T.openclaw_tokens,other_tokens:T.other_tokens,total_tokens:T.total_tokens}:{rank:null,gpt_tokens:"0",claude_tokens:"0",gemini_tokens:"0",cursor_tokens:"0",opencode_tokens:"0",openclaw_tokens:"0",other_tokens:"0",total_tokens:"0"},I=A.slice(c,c+o);return{period:h,metric:u,from:p,to:m,generated_at:new Date().toISOString(),page:w,limit:o,offset:c,total_entries:v,total_pages:_,entries:I,me:D}}function SV({weeks:t=52,to:e,weekStartsOn:n="sun",seed:i}={}){const r=PC({weeks:t,now:ki(e)||ki(fs(new Date))||new Date,weekStartsOn:n}),s=Ol({from:r.from,to:r.to,seed:i});return{...rV({dailyRows:s,weeks:t,to:r.to,weekStartsOn:n}),week_starts_on:n,active_days:s.filter(c=>Number(c.billable_total_tokens??c.total_tokens)>0).length,streak_days:sV({dailyRows:s,to:r.to})}}function wV({from:t,to:e,seed:n}={}){const i=Ol({from:t,to:e,seed:n}),r=Hy(i),o=[{source:"codex",weight:.7,models:[{model:"gpt-5.2-codex",model_id:"gpt-5.2-codex",weight:.2},{model:"unknown",model_id:"unknown",weight:.8}]},{source:"claude",weight:.2,models:[{model:"claude-3.5",model_id:"claude-3.5",weight:.3},{model:"unknown",model_id:"unknown",weight:.7}]},{source:"every-code",weight:.1,models:[{model:"unknown",model_id:"unknown",weight:1}]}].map(c=>{const u=uE(r,c.weight),f=c.models.map(h=>{const p=uE(u,h.weight);return{model:h.model,model_id:h.model_id||h.model,totals:N0(p)}});return{source:c.source,totals:N0(u),models:f}});return{from:t,to:e,days:i.length,sources:o,pricing:{model:"mock",pricing_mode:"add",source:"mock",effective_from:fs(new Date),rates_per_million_usd:{input:"1.750000",cached_input:"0.175000",output:"14.000000",reasoning_output:"14.000000"}}}}function NC(t=""){if(typeof t!="string"||t.length===0)return!1;const e=new URLSearchParams(t),n=String(e.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const EV=300*1e3;function Gy(t){return typeof t=="string"&&/^https?:\/\//i.test(t.trim())}async function IC(t){const e=Co();if(!Gy(e)||!t)return;const n=e.replace(/\/$/,""),i=Ah(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};i&&(r.apikey=i);try{await fetch(`${n}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:r,body:"{}"})}catch{}}async function UC(t){const e=Co();if(!Gy(e)||!t)return null;const n=e.replace(/\/$/,""),i=Ah(),r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${t}`};i&&(r.apikey=i);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",o=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:r,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!o.ok)return null;const c=await o.json().catch(()=>null),u=typeof c?.token=="string"?c.token:null,f=typeof c?.device_id=="string"?c.device_id:null;return!u||!f?null:{token:u,deviceId:f,issuedAt:typeof c?.created_at=="string"?c.created_at:new Date().toISOString()}}async function FC(t){const{deviceToken:e,insforgeBaseUrl:n}=t,i={deviceToken:e},r=n||Co();Gy(r)&&(i.insforgeBaseUrl=r.trim());const s=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(i)}),o=await s.json().catch(()=>({}));if(!s.ok){const c=typeof o.error=="string"?o.error:`HTTP ${s.status}`;throw new Error(c)}return o}async function MV(t){const e=vI();if(Date.now()-e<EV)return;const n=await t();if(!n)return;let i=rT();if(!i){const r=await UC(n);if(!r)return;sT(r),i=r}await FC({deviceToken:i.token,insforgeBaseUrl:Co()}),aT(Date.now()),await IC(n)}async function TV(t){const e=await t();if(!e)return;let n=rT();if(!n){const i=await UC(e);if(!i)return;sT(i),n=i}await FC({deviceToken:n.token,insforgeBaseUrl:Co()}),aT(Date.now()),await IC(e)}function AV(t){const e=t.replace(/\/+$/,"")||"/";return e==="/share"||e==="/share.html"||e.startsWith("/share/")}function CV(t){const e=t.replace(/\/+$/,"")||"/";return e==="/login"||e==="/landing"||AV(e)?!1:e==="/"||e==="/dashboard"||e.startsWith("/leaderboard")}function RV(){const t=vr(),e=$l(),n=N.useRef(!1);N.useEffect(()=>{if(!nT()||!CV(t.pathname||"/")||!e.enabled||!e.signedIn||e.loading||!iT())return;let i=!1;const r=window.setTimeout(()=>{(async()=>{if(!(i||n.current)){n.current=!0;try{await MV(()=>e.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{i=!0,window.clearTimeout(r)}},[t.pathname,e.enabled,e.signedIn,e.loading,e.getAccessToken])}function OC(){return typeof navigator>"u"?null:navigator.clipboard||null}function PV(){return typeof window>"u"?null:window.ClipboardItem||null}async function kV(t,{clipboard:e}={}){const n=e??OC();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(t),!0}catch{return!1}}async function v$(t,{clipboard:e}={}){const n=e??OC(),i=PV();if(!t||!n||typeof n.write!="function"||!i)return!1;try{const r=t.type||"image/png",s=t.type&&t.type!==r?t.slice(0,t.size,r):t.type?t:t.slice(0,t.size,r),o=new i({[r]:s});return await n.write([o]),!0}catch{return!1}}function LV(){if(typeof window>"u")return!1;const t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||t==="::1"}function DV(){return LV()?"/":"/dashboard"}function NV({prefersReducedMotion:t,screenshotCapture:e}){return!(e||t)}function IV({repo:t="mm7894215/tokentracker"}){const[e,n]=N.useState(null);return N.useEffect(()=>{if(typeof window>"u")return;const i=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=typeof document<"u"&&(document.documentElement?.classList.contains("screenshot-capture")||document.body?.classList.contains("screenshot-capture"));NV({prefersReducedMotion:i,screenshotCapture:r})&&fetch(`https://api.github.com/repos/${t}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&n(s.stargazers_count)}).catch(()=>{})},[t]),B.jsxs("a",{href:`https://github.com/${t}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-2 px-3 py-1.5 rounded-md border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-700 transition-colors no-underline",children:[B.jsx("svg",{height:"16",viewBox:"0 0 16 16",width:"16",className:"shrink-0 fill-oai-gray-700 dark:fill-oai-gray-300",children:B.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),B.jsx("span",{className:"text-xs font-medium text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap",children:"Star"}),e!==null&&B.jsx("span",{className:"text-xs font-semibold text-oai-gray-900 dark:text-oai-white tabular-nums whitespace-nowrap",children:e})]})}const Hs={usageSummary:"tokentracker-usage-summary",usageDaily:"tokentracker-usage-daily",usageHourly:"tokentracker-usage-hourly",usageMonthly:"tokentracker-usage-monthly",usageHeatmap:"tokentracker-usage-heatmap",usageModelBreakdown:"tokentracker-usage-model-breakdown",projectUsageSummary:"tokentracker-project-usage-summary",userStatus:"tokentracker-user-status",localSync:"tokentracker-local-sync"};async function Da(t,e,n){const i=new URL(`/functions/${t}`,window.location.origin);if(e)for(const[s,o]of Object.entries(e))o!=null&&o!==""&&i.searchParams.set(s,String(o));const r=await fetch(i.toString(),{headers:{Accept:"application/json"},cache:"no-store",...n});if(!r.ok){const s=new Error(`Request failed with HTTP ${r.status}`);throw s.status=r.status,s}return r.json()}function Po({timeZone:t,tzOffsetMinutes:e}={}){const n={},i=typeof t=="string"?t.trim():"";return i&&(n.tz=i),Number.isFinite(e)&&(n.tz_offset_minutes=String(Math.trunc(e))),n}function ko({source:t,model:e}={}){const n={},i=typeof t=="string"?t.trim().toLowerCase():"";i&&(n.source=i);const r=typeof e=="string"?e.trim():"";return r&&(n.model=r),n}async function y$({from:t,to:e,source:n,model:i,timeZone:r,tzOffsetMinutes:s,rolling:o=!1,accessToken:c}={}){if(xr())return yV({from:t,to:e,seed:c,rolling:o});const u=Po({timeZone:r,tzOffsetMinutes:s}),f=ko({source:n,model:i}),h=o?{rolling:"1"}:{};return Da(Hs.usageSummary,{from:t,to:e,...f,...u,...h})}async function _$({from:t,to:e,source:n,limit:i,timeZone:r,tzOffsetMinutes:s,accessToken:o}={}){if(xr())return xV({seed:o,limit:i});const c=Po({timeZone:r,tzOffsetMinutes:s}),f={...ko({source:n}),...c};return t&&(f.from=t),e&&(f.to=e),i!=null&&(f.limit=String(i)),Da(Hs.projectUsageSummary,f)}async function ku(t,e={}){const n=Co();if(!n)throw new Error("InsForge base URL not configured");const i=n.replace(/\/$/,""),r=new URL(`${i}/functions/${t}`);if(e.params)for(const[u,f]of Object.entries(e.params))f!=null&&f!==""&&r.searchParams.set(u,String(f));const s={Accept:"application/json","Content-Type":"application/json"},o=Ah();o&&(s.apikey=o),e.accessToken&&(s.Authorization=`Bearer ${e.accessToken}`);const c=await fetch(r.toString(),{method:e.method||"GET",headers:s,...e.body!=null?{body:JSON.stringify(e.body)}:{}});if(!c.ok){const u=new Error(`Request failed with HTTP ${c.status}`);throw u.status=c.status,u}return c.json()}async function x$({accessToken:t,period:e,metric:n,limit:i,offset:r}={}){return xr()?DC({seed:t,period:e,metric:n,limit:i,offset:r}):ku("tokentracker-leaderboard",{accessToken:t,params:{period:e,limit:i,offset:r}})}async function UV({accessToken:t}={}){return ku("tokentracker-public-visibility",{accessToken:t,method:"GET"})}async function fE({accessToken:t,enabled:e,anonymous:n}={}){const i={};return e!==void 0&&(i.enabled=!!e),n!==void 0&&(i.anonymous=!!n),ku("tokentracker-public-visibility",{accessToken:t,method:"POST",body:i})}async function b$({accessToken:t,period:e}={}){return ku("tokentracker-leaderboard-refresh",{accessToken:t,method:"POST",body:e?{period:e}:{}})}async function S$({accessToken:t,userId:e,period:n}={}){if(xr()){const i=DC({seed:t,period:n,metric:"all",limit:250,offset:0}),s=(Array.isArray(i?.entries)?i.entries:[]).find(o=>o?.user_id===e)||null;return{period:i?.period??"week",from:i?.from??null,to:i?.to??null,generated_at:i?.generated_at??new Date().toISOString(),entry:s}}return ku("tokentracker-leaderboard-profile",{accessToken:t,params:{user_id:e,period:n}})}async function w$(t={}){if(xr()){const e=new Date().toISOString();return{user_id:"local-user",created_at:e,pro:{active:!1,sources:[],expires_at:null,partial:!1,as_of:e},subscriptions:{partial:!1,as_of:e,items:[]},install:{partial:!1,as_of:e,has_active_device_token:!1,has_active_device:!1,active_device_tokens:0,active_devices:0,latest_token_activity_at:null,latest_device_seen_at:null}}}return Da(Hs.userStatus)}async function E$({signal:t}={}){const e=await fetch(`/functions/${Hs.localSync}`,{method:"POST",headers:{Accept:"application/json"},cache:"no-store",signal:t}),n=await e.json().catch(()=>({ok:!1,error:`Local sync request failed with HTTP ${e.status}`}));if(!e.ok||n?.ok===!1){const i=n?.error||n?.message||`Local sync request failed with HTTP ${e.status}`,r=new Error(i);throw r.status=e.status,r}return n}async function M$({from:t,to:e,source:n,timeZone:i,tzOffsetMinutes:r,accessToken:s}={}){if(xr())return wV({from:t,to:e,seed:s});const o=Po({timeZone:i,tzOffsetMinutes:r}),c=ko({source:n});return Da(Hs.usageModelBreakdown,{from:t,to:e,...c,...o})}async function T$({from:t,to:e,source:n,model:i,timeZone:r,tzOffsetMinutes:s,accessToken:o}={}){if(xr())return mV({from:t,to:e,seed:o});const c=Po({timeZone:r,tzOffsetMinutes:s}),u=ko({source:n,model:i});return Da(Hs.usageDaily,{from:t,to:e,...u,...c})}async function A$({day:t,source:e,model:n,timeZone:i,tzOffsetMinutes:r,accessToken:s}={}){if(xr())return gV({day:t,seed:s});const o=Po({timeZone:i,tzOffsetMinutes:r}),c=ko({source:e,model:n}),u=t?{day:t,...c,...o}:{...c,...o};return Da(Hs.usageHourly,u)}async function C$({months:t,to:e,source:n,model:i,timeZone:r,tzOffsetMinutes:s,accessToken:o}={}){if(xr())return vV({months:t,to:e,seed:o});const c=Po({timeZone:r,tzOffsetMinutes:s}),u=ko({source:n,model:i});return Da(Hs.usageMonthly,{...t?{months:String(t)}:{},...e?{to:e}:{},...u,...c})}async function R$({weeks:t,to:e,weekStartsOn:n,source:i,model:r,timeZone:s,tzOffsetMinutes:o,accessToken:c}={}){if(xr())return SV({weeks:t,to:e,weekStartsOn:n,seed:c});const u=Po({timeZone:s,tzOffsetMinutes:o}),f=ko({source:i,model:r});return Da(Hs.usageHeatmap,{weeks:String(t),to:e,week_starts_on:n,...f,...u})}function FV(t){if(!t||typeof t!="object")return"";const e=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},i=e.full_name||e.name||n.name||e.user_name||e.preferred_username;return typeof i=="string"&&i.trim()?i.trim():typeof t.email=="string"&&t.email.includes("@")?t.email.split("@")[0].trim()||t.email.trim():typeof t.email=="string"?t.email.trim():""}function OV(t){return!t||typeof t!="object"?"":typeof t.email=="string"?t.email.trim():""}function BV(t){if(!t||typeof t!="object")return null;const e=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},i=e.avatar_url||e.picture||n.avatar_url||t.avatar_url;return typeof i=="string"&&i.trim()?i.trim():null}function hE(t){const e=String(t||"").trim();if(!e)return"?";const n=e.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function zV({checked:t,onChange:e,disabled:n,ariaLabel:i}){return B.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i,onClick:e,disabled:n,className:Si("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 disabled:opacity-50 disabled:cursor-not-allowed",t?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:B.jsx("span",{className:Si("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",t?"translate-x-[18px]":"translate-x-[3px]")})})}function tg({label:t,checked:e,onChange:n,disabled:i}){return B.jsxs("div",{className:"flex items-center justify-between py-2",children:[B.jsx("span",{className:"text-sm text-oai-gray-700 dark:text-oai-gray-300",children:t}),B.jsx(zV,{checked:e,onChange:n,disabled:i,ariaLabel:t})]})}function VV({className:t}){vr();const{enabled:e,loading:n,signedIn:i,user:r,signOut:s,getAccessToken:o}=$l(),{openLoginModal:c}=ET(),[u,f]=N.useState(!1),[h,p]=N.useState(()=>iT()),[m,v]=N.useState(!1),[_,w]=N.useState(!1),[y,x]=N.useState(!1),[M,A]=N.useState(!1),T=N.useRef(null),D=e&&i&&nT(),I=N.useMemo(()=>FV(r),[r]),U=N.useMemo(()=>OV(r),[r]),S=N.useMemo(()=>BV(r),[r]);N.useEffect(()=>{if(!u)return;const X=V=>{T.current&&!T.current.contains(V.target)&&f(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[u]),N.useEffect(()=>{if(!u||!i)return;let X=!0;return x(!0),(async()=>{try{const V=await Lm({getAccessToken:o});if(!X||!V)return;const q=await UV({accessToken:V});if(!X)return;v(!!q?.enabled),w(!!q?.anonymous)}catch{}finally{X&&x(!1)}})(),()=>{X=!1}},[u,i,o]);const R=N.useCallback(async()=>{f(!1),await s()},[s]),H=N.useCallback(async()=>{const X=!h;if(mI(X),p(X),X)try{await TV(()=>o())}catch(V){console.warn("[tokentracker] cloud sync:",V)}},[h,o]),F=N.useCallback(async()=>{if(!M){A(!0);try{const X=await Lm({getAccessToken:o});if(!X)return;const V=!m;await fE({accessToken:X,enabled:V}),v(V)}catch{}finally{A(!1)}}},[m,M,o]),W=N.useCallback(async()=>{if(!M){A(!0);try{const X=await Lm({getAccessToken:o});if(!X)return;const V=!_;await fE({accessToken:X,anonymous:V}),w(V)}catch{}finally{A(!1)}}},[_,M,o]);return e?n?B.jsx("div",{className:Si("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",t),"aria-hidden":!0}):i?B.jsxs("div",{ref:T,className:Si("relative flex shrink-0 items-center",t),children:[B.jsxs("button",{type:"button",onClick:()=>f(X=>!X),className:"flex items-center gap-2 rounded-full pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors","aria-expanded":u,"aria-haspopup":"menu",children:[S?B.jsx("img",{src:S,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer"}):B.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:hE(I)}),B.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:I})]}),B.jsx(QA,{children:u&&B.jsxs(go.div,{className:"absolute right-0 top-full z-[60] mt-2 w-[280px] rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-2xl overflow-hidden",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:[B.jsxs("div",{className:"px-4 py-3 border-b border-oai-gray-200 dark:border-oai-gray-800 flex items-center gap-3",children:[S?B.jsx("img",{src:S,alt:"",width:36,height:36,className:"h-9 w-9 rounded-full object-cover ring-1 ring-oai-gray-200 dark:ring-oai-gray-700",referrerPolicy:"no-referrer"}):B.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white",children:hE(I)}),B.jsxs("div",{className:"min-w-0",children:[B.jsx("div",{className:"text-sm font-medium text-oai-black dark:text-white truncate",children:I}),U&&B.jsx("div",{className:"text-xs text-oai-gray-500 truncate",children:U})]})]}),B.jsxs("div",{className:"px-4 py-2 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[D&&B.jsx(tg,{label:"Cloud Sync",checked:h,onChange:H}),B.jsx(tg,{label:"Public Profile",checked:m,onChange:F,disabled:y||M}),B.jsx(tg,{label:"Anonymous",checked:_,onChange:W,disabled:y||M})]}),B.jsxs("button",{type:"button",onClick:R,className:"flex w-full items-center gap-2 px-4 py-3 text-left text-sm text-oai-gray-500 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors",children:[B.jsx(Xz,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),"Sign Out"]})]})})]}):B.jsx("button",{type:"button",onClick:c,className:Si("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",t),"aria-label":qt("header.auth.sign_in_aria"),children:"Sign In"}):null}const Wy="183",HV=0,pE=1,GV=2,Ff=1,WV=2,Jc=3,Pa=0,Gi=1,ks=2,Ns=0,vo=1,mE=2,gE=3,vE=4,jV=5,ro=100,$V=101,XV=102,qV=103,YV=104,KV=200,ZV=201,JV=202,QV=203,I0=204,U0=205,eH=206,tH=207,nH=208,iH=209,rH=210,sH=211,aH=212,oH=213,lH=214,F0=0,O0=1,B0=2,Bl=3,z0=4,V0=5,H0=6,G0=7,BC=0,cH=1,uH=2,ns=0,zC=1,VC=2,HC=3,GC=4,WC=5,jC=6,$C=7,XC=300,Eo=301,zl=302,ng=303,ig=304,Ih=306,W0=1e3,Ls=1001,j0=1002,pi=1003,dH=1004,Yd=1005,wi=1006,rg=1007,uo=1008,fr=1009,qC=1010,YC=1011,vu=1012,jy=1013,cs=1014,Jr=1015,Os=1016,$y=1017,Xy=1018,yu=1020,KC=35902,ZC=35899,JC=1021,QC=1022,Ur=1023,Bs=1026,fo=1027,eR=1028,qy=1029,Vl=1030,Yy=1031,Ky=1033,Of=33776,Bf=33777,zf=33778,Vf=33779,$0=35840,X0=35841,q0=35842,Y0=35843,K0=36196,Z0=37492,J0=37496,Q0=37488,ev=37489,tv=37490,nv=37491,iv=37808,rv=37809,sv=37810,av=37811,ov=37812,lv=37813,cv=37814,uv=37815,dv=37816,fv=37817,hv=37818,pv=37819,mv=37820,gv=37821,vv=36492,yv=36494,_v=36495,xv=36283,bv=36284,Sv=36285,wv=36286,fH=3200,hH=0,pH=1,Sa="",ur="srgb",Mo="srgb-linear",mh="linear",wn="srgb",sl=7680,yE=519,mH=512,gH=513,vH=514,Zy=515,yH=516,_H=517,Jy=518,xH=519,_E=35044,xE="300 es",Qr=2e3,gh=2001;function bH(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function vh(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function SH(){const t=vh("canvas");return t.style.display="block",t}const bE={};function SE(...t){const e="THREE."+t.shift();console.log(e,...t)}function tR(t){const e=t[0];if(typeof e=="string"&&e.startsWith("TSL:")){const n=t[1];n&&n.isStackTrace?t[0]+=" "+n.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function Ht(...t){t=tR(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.warn(n.getError(e)):console.warn(e,...t)}}function _n(...t){t=tR(t);const e="THREE."+t.shift();{const n=t[0];n&&n.isStackTrace?console.error(n.getError(e)):console.error(e,...t)}}function yh(...t){const e=t.join(" ");e in bE||(bE[e]=!0,Ht(...t))}function wH(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}const EH={[F0]:O0,[B0]:H0,[z0]:G0,[Bl]:V0,[O0]:F0,[H0]:B0,[G0]:z0,[V0]:Bl};class Zl{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=null}}}const _i=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],sg=Math.PI/180,Ev=180/Math.PI;function Lu(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(_i[t&255]+_i[t>>8&255]+_i[t>>16&255]+_i[t>>24&255]+"-"+_i[e&255]+_i[e>>8&255]+"-"+_i[e>>16&15|64]+_i[e>>24&255]+"-"+_i[n&63|128]+_i[n>>8&255]+"-"+_i[n>>16&255]+_i[n>>24&255]+_i[i&255]+_i[i>>8&255]+_i[i>>16&255]+_i[i>>24&255]).toLowerCase()}function ln(t,e,n){return Math.max(e,Math.min(n,t))}function MH(t,e){return(t%e+e)%e}function ag(t,e,n){return(1-n)*t+n*e}function Bc(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Hi(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class bn{constructor(e=0,n=0){bn.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+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,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+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,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Jl{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,o,c){let u=i[r+0],f=i[r+1],h=i[r+2],p=i[r+3],m=s[o+0],v=s[o+1],_=s[o+2],w=s[o+3];if(p!==w||u!==m||f!==v||h!==_){let y=u*m+f*v+h*_+p*w;y<0&&(m=-m,v=-v,_=-_,w=-w,y=-y);let x=1-c;if(y<.9995){const M=Math.acos(y),A=Math.sin(M);x=Math.sin(x*M)/A,c=Math.sin(c*M)/A,u=u*x+m*c,f=f*x+v*c,h=h*x+_*c,p=p*x+w*c}else{u=u*x+m*c,f=f*x+v*c,h=h*x+_*c,p=p*x+w*c;const M=1/Math.sqrt(u*u+f*f+h*h+p*p);u*=M,f*=M,h*=M,p*=M}}e[n]=u,e[n+1]=f,e[n+2]=h,e[n+3]=p}static multiplyQuaternionsFlat(e,n,i,r,s,o){const c=i[r],u=i[r+1],f=i[r+2],h=i[r+3],p=s[o],m=s[o+1],v=s[o+2],_=s[o+3];return e[n]=c*_+h*p+u*v-f*m,e[n+1]=u*_+h*m+f*p-c*v,e[n+2]=f*_+h*v+c*m-u*p,e[n+3]=h*_-c*p-u*m-f*v,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,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,n=!0){const i=e._x,r=e._y,s=e._z,o=e._order,c=Math.cos,u=Math.sin,f=c(i/2),h=c(r/2),p=c(s/2),m=u(i/2),v=u(r/2),_=u(s/2);switch(o){case"XYZ":this._x=m*h*p+f*v*_,this._y=f*v*p-m*h*_,this._z=f*h*_+m*v*p,this._w=f*h*p-m*v*_;break;case"YXZ":this._x=m*h*p+f*v*_,this._y=f*v*p-m*h*_,this._z=f*h*_-m*v*p,this._w=f*h*p+m*v*_;break;case"ZXY":this._x=m*h*p-f*v*_,this._y=f*v*p+m*h*_,this._z=f*h*_+m*v*p,this._w=f*h*p-m*v*_;break;case"ZYX":this._x=m*h*p-f*v*_,this._y=f*v*p+m*h*_,this._z=f*h*_-m*v*p,this._w=f*h*p+m*v*_;break;case"YZX":this._x=m*h*p+f*v*_,this._y=f*v*p+m*h*_,this._z=f*h*_-m*v*p,this._w=f*h*p-m*v*_;break;case"XZY":this._x=m*h*p-f*v*_,this._y=f*v*p-m*h*_,this._z=f*h*_+m*v*p,this._w=f*h*p+m*v*_;break;default:Ht("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],s=n[8],o=n[1],c=n[5],u=n[9],f=n[2],h=n[6],p=n[10],m=i+c+p;if(m>0){const v=.5/Math.sqrt(m+1);this._w=.25/v,this._x=(h-u)*v,this._y=(s-f)*v,this._z=(o-r)*v}else if(i>c&&i>p){const v=2*Math.sqrt(1+i-c-p);this._w=(h-u)/v,this._x=.25*v,this._y=(r+o)/v,this._z=(s+f)/v}else if(c>p){const v=2*Math.sqrt(1+c-i-p);this._w=(s-f)/v,this._x=(r+o)/v,this._y=.25*v,this._z=(u+h)/v}else{const v=2*Math.sqrt(1+p-i-c);this._w=(o-r)/v,this._x=(s+f)/v,this._y=(u+h)/v,this._z=.25*v}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.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*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ln(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/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,n){const i=e._x,r=e._y,s=e._z,o=e._w,c=n._x,u=n._y,f=n._z,h=n._w;return this._x=i*h+o*c+r*f-s*u,this._y=r*h+o*u+s*c-i*f,this._z=s*h+o*f+i*u-r*c,this._w=o*h-i*c-r*u-s*f,this._onChangeCallback(),this}slerp(e,n){let i=e._x,r=e._y,s=e._z,o=e._w,c=this.dot(e);c<0&&(i=-i,r=-r,s=-s,o=-o,c=-c);let u=1-n;if(c<.9995){const f=Math.acos(c),h=Math.sin(f);u=Math.sin(u*f)/h,n=Math.sin(n*f)/h,this._x=this._x*u+i*n,this._y=this._y*u+r*n,this._z=this._z*u+s*n,this._w=this._w*u+o*n,this._onChangeCallback()}else this._x=this._x*u+i*n,this._y=this._y*u+r*n,this._z=this._z*u+s*n,this._w=this._w*u+o*n,this.normalize();return this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class me{constructor(e=0,n=0,i=0){me.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(wE.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(wE.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,s=e.x,o=e.y,c=e.z,u=e.w,f=2*(o*r-c*i),h=2*(c*n-s*r),p=2*(s*i-o*n);return this.x=n+u*f+o*p-c*h,this.y=i+u*h+c*f-s*p,this.z=r+u*p+s*h-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){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this.z=ln(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this.z=ln(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.z,o=n.x,c=n.y,u=n.z;return this.x=r*u-s*c,this.y=s*o-i*u,this.z=i*c-r*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return og.copy(this).projectOnVector(e),this.sub(og)}reflect(e){return this.sub(og.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+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,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const og=new me,wE=new Jl;class Wt{constructor(e,n,i,r,s,o,c,u,f){Wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,c,u,f)}set(e,n,i,r,s,o,c,u,f){const h=this.elements;return h[0]=e,h[1]=r,h[2]=c,h[3]=n,h[4]=s,h[5]=u,h[6]=i,h[7]=o,h[8]=f,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],c=i[3],u=i[6],f=i[1],h=i[4],p=i[7],m=i[2],v=i[5],_=i[8],w=r[0],y=r[3],x=r[6],M=r[1],A=r[4],T=r[7],D=r[2],I=r[5],U=r[8];return s[0]=o*w+c*M+u*D,s[3]=o*y+c*A+u*I,s[6]=o*x+c*T+u*U,s[1]=f*w+h*M+p*D,s[4]=f*y+h*A+p*I,s[7]=f*x+h*T+p*U,s[2]=m*w+v*M+_*D,s[5]=m*y+v*A+_*I,s[8]=m*x+v*T+_*U,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],f=e[7],h=e[8];return n*o*h-n*c*f-i*s*h+i*c*u+r*s*f-r*o*u}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],f=e[7],h=e[8],p=h*o-c*f,m=c*u-h*s,v=f*s-o*u,_=n*p+i*m+r*v;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/_;return e[0]=p*w,e[1]=(r*f-h*i)*w,e[2]=(c*i-r*o)*w,e[3]=m*w,e[4]=(h*n-r*u)*w,e[5]=(r*s-c*n)*w,e[6]=v*w,e[7]=(i*u-f*n)*w,e[8]=(o*n-i*s)*w,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,s,o,c){const u=Math.cos(s),f=Math.sin(s);return this.set(i*u,i*f,-i*(u*o+f*c)+o+e,-r*f,r*u,-r*(-f*o+u*c)+c+n,0,0,1),this}scale(e,n){return this.premultiply(lg.makeScale(e,n)),this}rotate(e){return this.premultiply(lg.makeRotation(-e)),this}translate(e,n){return this.premultiply(lg.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const lg=new Wt,EE=new Wt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ME=new Wt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function TH(){const t={enabled:!0,workingColorSpace:Mo,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===wn&&(r.r=Is(r.r),r.g=Is(r.g),r.b=Is(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wn&&(r.r=kl(r.r),r.g=kl(r.g),r.b=kl(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Sa?mh:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].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,s){return yh("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return yh("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Mo]:{primaries:e,whitePoint:i,transfer:mh,toXYZ:EE,fromXYZ:ME,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:ur},outputColorSpaceConfig:{drawingBufferColorSpace:ur}},[ur]:{primaries:e,whitePoint:i,transfer:wn,toXYZ:EE,fromXYZ:ME,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:ur}}}),t}const fn=TH();function Is(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function kl(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let al;class AH{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{al===void 0&&(al=vh("canvas")),al.width=e.width,al.height=e.height;const r=al.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=al}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=vh("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o<s.length;o++)s[o]=Is(s[o]/255)*255;return i.putImageData(r,0,0),n}else if(e.data){const n=e.data.slice(0);for(let i=0;i<n.length;i++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[i]=Math.floor(Is(n[i]/255)*255):n[i]=Is(n[i]);return{data:n,width:e.width,height:e.height}}else return Ht("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let CH=0;class Qy{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:CH++}),this.uuid=Lu(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):typeof VideoFrame<"u"&&n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let o=0,c=r.length;o<c;o++)r[o].isDataTexture?s.push(cg(r[o].image)):s.push(cg(r[o]))}else s=cg(r);i.url=s}return n||(e.images[this.uuid]=i),i}}function cg(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?AH.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(Ht("Texture: Unable to serialize Texture."),{})}let RH=0;const ug=new me;class Li extends Zl{constructor(e=Li.DEFAULT_IMAGE,n=Li.DEFAULT_MAPPING,i=Ls,r=Ls,s=wi,o=uo,c=Ur,u=fr,f=Li.DEFAULT_ANISOTROPY,h=Sa){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:RH++}),this.uuid=Lu(),this.name="",this.source=new Qy(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=o,this.anisotropy=f,this.format=c,this.internalFormat=null,this.type=u,this.offset=new bn(0,0),this.repeat=new bn(1,1),this.center=new bn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Wt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,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(ug).x}get height(){return this.source.getSize(ug).y}get depth(){return this.source.getSize(ug).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,n){this.updateRanges.push({start:e,count:n})}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(const n in e){const i=e[n];if(i===void 0){Ht(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Ht(`Texture.setValues(): property '${n}' 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[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const 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),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==XC)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case W0:e.x=e.x-Math.floor(e.x);break;case Ls:e.x=e.x<0?0:1;break;case j0: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 W0:e.y=e.y-Math.floor(e.y);break;case Ls:e.y=e.y<0?0:1;break;case j0: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++}}Li.DEFAULT_IMAGE=null;Li.DEFAULT_MAPPING=XC;Li.DEFAULT_ANISOTROPY=1;class zn{constructor(e=0,n=0,i=0,r=1){zn.prototype.isVector4=!0,this.x=e,this.y=n,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,n,i,r){return this.x=e,this.y=n,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,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*n+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*n+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*n+o[7]*i+o[11]*r+o[15]*s,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);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const u=e.elements,f=u[0],h=u[4],p=u[8],m=u[1],v=u[5],_=u[9],w=u[2],y=u[6],x=u[10];if(Math.abs(h-m)<.01&&Math.abs(p-w)<.01&&Math.abs(_-y)<.01){if(Math.abs(h+m)<.1&&Math.abs(p+w)<.1&&Math.abs(_+y)<.1&&Math.abs(f+v+x-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const A=(f+1)/2,T=(v+1)/2,D=(x+1)/2,I=(h+m)/4,U=(p+w)/4,S=(_+y)/4;return A>T&&A>D?A<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(A),r=I/i,s=U/i):T>D?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=I/r,s=S/r):D<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(D),i=U/s,r=S/s),this.set(i,r,s,n),this}let M=Math.sqrt((y-_)*(y-_)+(p-w)*(p-w)+(m-h)*(m-h));return Math.abs(M)<.001&&(M=1),this.x=(y-_)/M,this.y=(p-w)/M,this.z=(m-h)/M,this.w=Math.acos((f+v+x-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=ln(this.x,e.x,n.x),this.y=ln(this.y,e.y,n.y),this.z=ln(this.z,e.z,n.z),this.w=ln(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=ln(this.x,e,n),this.y=ln(this.y,e,n),this.z=ln(this.z,e,n),this.w=ln(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ln(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.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,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class PH extends Zl{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:wi,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=n,this.depth=i.depth,this.scissor=new zn(0,0,e,n),this.scissorTest=!1,this.viewport=new zn(0,0,e,n),this.textures=[];const r={width:e,height:n,depth:i.depth},s=new Li(r),o=i.count;for(let c=0;c<o;c++)this.textures[c]=s.clone(),this.textures[c].isRenderTargetTexture=!0,this.textures[c].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={}){const n={minFilter:wi,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(n)}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,n,i=1){if(this.width!==e||this.height!==n||this.depth!==i){this.width=e,this.height=n,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=n,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,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const r=Object.assign({},e.textures[n].image);this.textures[n].source=new Qy(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"})}}class is extends PH{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class nR extends Li{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=pi,this.minFilter=pi,this.wrapR=Ls,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class kH extends Li{constructor(e=null,n=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=pi,this.minFilter=pi,this.wrapR=Ls,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yn{constructor(e,n,i,r,s,o,c,u,f,h,p,m,v,_,w,y){Yn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,c,u,f,h,p,m,v,_,w,y)}set(e,n,i,r,s,o,c,u,f,h,p,m,v,_,w,y){const x=this.elements;return x[0]=e,x[4]=n,x[8]=i,x[12]=r,x[1]=s,x[5]=o,x[9]=c,x[13]=u,x[2]=f,x[6]=h,x[10]=p,x[14]=m,x[3]=v,x[7]=_,x[11]=w,x[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Yn().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,i=e.elements,r=1/ol.setFromMatrixColumn(e,0).length(),s=1/ol.setFromMatrixColumn(e,1).length(),o=1/ol.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),c=Math.sin(i),u=Math.cos(r),f=Math.sin(r),h=Math.cos(s),p=Math.sin(s);if(e.order==="XYZ"){const m=o*h,v=o*p,_=c*h,w=c*p;n[0]=u*h,n[4]=-u*p,n[8]=f,n[1]=v+_*f,n[5]=m-w*f,n[9]=-c*u,n[2]=w-m*f,n[6]=_+v*f,n[10]=o*u}else if(e.order==="YXZ"){const m=u*h,v=u*p,_=f*h,w=f*p;n[0]=m+w*c,n[4]=_*c-v,n[8]=o*f,n[1]=o*p,n[5]=o*h,n[9]=-c,n[2]=v*c-_,n[6]=w+m*c,n[10]=o*u}else if(e.order==="ZXY"){const m=u*h,v=u*p,_=f*h,w=f*p;n[0]=m-w*c,n[4]=-o*p,n[8]=_+v*c,n[1]=v+_*c,n[5]=o*h,n[9]=w-m*c,n[2]=-o*f,n[6]=c,n[10]=o*u}else if(e.order==="ZYX"){const m=o*h,v=o*p,_=c*h,w=c*p;n[0]=u*h,n[4]=_*f-v,n[8]=m*f+w,n[1]=u*p,n[5]=w*f+m,n[9]=v*f-_,n[2]=-f,n[6]=c*u,n[10]=o*u}else if(e.order==="YZX"){const m=o*u,v=o*f,_=c*u,w=c*f;n[0]=u*h,n[4]=w-m*p,n[8]=_*p+v,n[1]=p,n[5]=o*h,n[9]=-c*h,n[2]=-f*h,n[6]=v*p+_,n[10]=m-w*p}else if(e.order==="XZY"){const m=o*u,v=o*f,_=c*u,w=c*f;n[0]=u*h,n[4]=-p,n[8]=f*h,n[1]=m*p+w,n[5]=o*h,n[9]=v*p-_,n[2]=_*p-v,n[6]=c*h,n[10]=w*p+m}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(LH,e,DH)}lookAt(e,n,i){const r=this.elements;return Ki.subVectors(e,n),Ki.lengthSq()===0&&(Ki.z=1),Ki.normalize(),fa.crossVectors(i,Ki),fa.lengthSq()===0&&(Math.abs(i.z)===1?Ki.x+=1e-4:Ki.z+=1e-4,Ki.normalize(),fa.crossVectors(i,Ki)),fa.normalize(),Kd.crossVectors(Ki,fa),r[0]=fa.x,r[4]=Kd.x,r[8]=Ki.x,r[1]=fa.y,r[5]=Kd.y,r[9]=Ki.y,r[2]=fa.z,r[6]=Kd.z,r[10]=Ki.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],c=i[4],u=i[8],f=i[12],h=i[1],p=i[5],m=i[9],v=i[13],_=i[2],w=i[6],y=i[10],x=i[14],M=i[3],A=i[7],T=i[11],D=i[15],I=r[0],U=r[4],S=r[8],R=r[12],H=r[1],F=r[5],W=r[9],X=r[13],V=r[2],q=r[6],J=r[10],Q=r[14],$=r[3],Y=r[7],Z=r[11],z=r[15];return s[0]=o*I+c*H+u*V+f*$,s[4]=o*U+c*F+u*q+f*Y,s[8]=o*S+c*W+u*J+f*Z,s[12]=o*R+c*X+u*Q+f*z,s[1]=h*I+p*H+m*V+v*$,s[5]=h*U+p*F+m*q+v*Y,s[9]=h*S+p*W+m*J+v*Z,s[13]=h*R+p*X+m*Q+v*z,s[2]=_*I+w*H+y*V+x*$,s[6]=_*U+w*F+y*q+x*Y,s[10]=_*S+w*W+y*J+x*Z,s[14]=_*R+w*X+y*Q+x*z,s[3]=M*I+A*H+T*V+D*$,s[7]=M*U+A*F+T*q+D*Y,s[11]=M*S+A*W+T*J+D*Z,s[15]=M*R+A*X+T*Q+D*z,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],o=e[1],c=e[5],u=e[9],f=e[13],h=e[2],p=e[6],m=e[10],v=e[14],_=e[3],w=e[7],y=e[11],x=e[15],M=u*v-f*m,A=c*v-f*p,T=c*m-u*p,D=o*v-f*h,I=o*m-u*h,U=o*p-c*h;return n*(w*M-y*A+x*T)-i*(_*M-y*D+x*I)+r*(_*A-w*D+x*U)-s*(_*T-w*I+y*U)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],c=e[5],u=e[6],f=e[7],h=e[8],p=e[9],m=e[10],v=e[11],_=e[12],w=e[13],y=e[14],x=e[15],M=n*c-i*o,A=n*u-r*o,T=n*f-s*o,D=i*u-r*c,I=i*f-s*c,U=r*f-s*u,S=h*w-p*_,R=h*y-m*_,H=h*x-v*_,F=p*y-m*w,W=p*x-v*w,X=m*x-v*y,V=M*X-A*W+T*F+D*H-I*R+U*S;if(V===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const q=1/V;return e[0]=(c*X-u*W+f*F)*q,e[1]=(r*W-i*X-s*F)*q,e[2]=(w*U-y*I+x*D)*q,e[3]=(m*I-p*U-v*D)*q,e[4]=(u*H-o*X-f*R)*q,e[5]=(n*X-r*H+s*R)*q,e[6]=(y*T-_*U-x*A)*q,e[7]=(h*U-m*T+v*A)*q,e[8]=(o*W-c*H+f*S)*q,e[9]=(i*H-n*W-s*S)*q,e[10]=(_*I-w*T+x*M)*q,e[11]=(p*T-h*I-v*M)*q,e[12]=(c*R-o*F-u*S)*q,e[13]=(n*F-i*R+r*S)*q,e[14]=(w*A-_*D-y*M)*q,e[15]=(h*D-p*A+m*M)*q,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=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(n,i,r))}makeTranslation(e,n,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,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=e.x,c=e.y,u=e.z,f=s*o,h=s*c;return this.set(f*o+i,f*c-r*u,f*u+r*c,0,f*c+r*u,h*c+i,h*u-r*o,0,f*u-r*c,h*u+r*o,s*u*u+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,o=n._y,c=n._z,u=n._w,f=s+s,h=o+o,p=c+c,m=s*f,v=s*h,_=s*p,w=o*h,y=o*p,x=c*p,M=u*f,A=u*h,T=u*p,D=i.x,I=i.y,U=i.z;return r[0]=(1-(w+x))*D,r[1]=(v+T)*D,r[2]=(_-A)*D,r[3]=0,r[4]=(v-T)*I,r[5]=(1-(m+x))*I,r[6]=(y+M)*I,r[7]=0,r[8]=(_+A)*U,r[9]=(y-M)*U,r[10]=(1-(m+w))*U,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),n.identity(),this;let o=ol.set(r[0],r[1],r[2]).length();const c=ol.set(r[4],r[5],r[6]).length(),u=ol.set(r[8],r[9],r[10]).length();s<0&&(o=-o),Pr.copy(this);const f=1/o,h=1/c,p=1/u;return Pr.elements[0]*=f,Pr.elements[1]*=f,Pr.elements[2]*=f,Pr.elements[4]*=h,Pr.elements[5]*=h,Pr.elements[6]*=h,Pr.elements[8]*=p,Pr.elements[9]*=p,Pr.elements[10]*=p,n.setFromRotationMatrix(Pr),i.x=o,i.y=c,i.z=u,this}makePerspective(e,n,i,r,s,o,c=Qr,u=!1){const f=this.elements,h=2*s/(n-e),p=2*s/(i-r),m=(n+e)/(n-e),v=(i+r)/(i-r);let _,w;if(u)_=s/(o-s),w=o*s/(o-s);else if(c===Qr)_=-(o+s)/(o-s),w=-2*o*s/(o-s);else if(c===gh)_=-o/(o-s),w=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return f[0]=h,f[4]=0,f[8]=m,f[12]=0,f[1]=0,f[5]=p,f[9]=v,f[13]=0,f[2]=0,f[6]=0,f[10]=_,f[14]=w,f[3]=0,f[7]=0,f[11]=-1,f[15]=0,this}makeOrthographic(e,n,i,r,s,o,c=Qr,u=!1){const f=this.elements,h=2/(n-e),p=2/(i-r),m=-(n+e)/(n-e),v=-(i+r)/(i-r);let _,w;if(u)_=1/(o-s),w=o/(o-s);else if(c===Qr)_=-2/(o-s),w=-(o+s)/(o-s);else if(c===gh)_=-1/(o-s),w=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return f[0]=h,f[4]=0,f[8]=0,f[12]=m,f[1]=0,f[5]=p,f[9]=0,f[13]=v,f[2]=0,f[6]=0,f[10]=_,f[14]=w,f[3]=0,f[7]=0,f[11]=0,f[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const ol=new me,Pr=new Yn,LH=new me(0,0,0),DH=new me(1,1,1),fa=new me,Kd=new me,Ki=new me,TE=new Yn,AE=new Jl;let To=class iR{constructor(e=0,n=0,i=0,r=iR.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,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,n,i,r=this._order){return this._x=e,this._y=n,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,n=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],c=r[8],u=r[1],f=r[5],h=r[9],p=r[2],m=r[6],v=r[10];switch(n){case"XYZ":this._y=Math.asin(ln(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(m,f),this._z=0);break;case"YXZ":this._x=Math.asin(-ln(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(c,v),this._z=Math.atan2(u,f)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(ln(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,v),this._z=Math.atan2(-o,f)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-ln(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,v),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,f));break;case"YZX":this._z=Math.asin(ln(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,f),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(c,v));break;case"XZY":this._z=Math.asin(-ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(m,f),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-h,v),this._y=0);break;default:Ht("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return TE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(TE,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return AE.setFromEuler(this),this.setFromQuaternion(AE,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};To.DEFAULT_ORDER="XYZ";class rR{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}}let NH=0;const CE=new me,ll=new Jl,Es=new Yn,Zd=new me,zc=new me,IH=new me,UH=new Jl,RE=new me(1,0,0),PE=new me(0,1,0),kE=new me(0,0,1),LE={type:"added"},FH={type:"removed"},cl={type:"childadded",child:null},dg={type:"childremoved",child:null};class er extends Zl{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:NH++}),this.uuid=Lu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=er.DEFAULT_UP.clone();const e=new me,n=new To,i=new Jl,r=new me(1,1,1);function s(){i.setFromEuler(n,!1)}function o(){n.setFromQuaternion(i,void 0,!1)}n._onChange(s),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Yn},normalMatrix:{value:new Wt}}),this.matrix=new Yn,this.matrixWorld=new Yn,this.matrixAutoUpdate=er.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new rR,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,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return ll.setFromAxisAngle(e,n),this.quaternion.multiply(ll),this}rotateOnWorldAxis(e,n){return ll.setFromAxisAngle(e,n),this.quaternion.premultiply(ll),this}rotateX(e){return this.rotateOnAxis(RE,e)}rotateY(e){return this.rotateOnAxis(PE,e)}rotateZ(e){return this.rotateOnAxis(kE,e)}translateOnAxis(e,n){return CE.copy(e).applyQuaternion(this.quaternion),this.position.add(CE.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(RE,e)}translateY(e){return this.translateOnAxis(PE,e)}translateZ(e){return this.translateOnAxis(kE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Es.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?Zd.copy(e):Zd.set(e,n,i);const r=this.parent;this.updateWorldMatrix(!0,!1),zc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Es.lookAt(zc,Zd,this.up):Es.lookAt(Zd,zc,this.up),this.quaternion.setFromRotationMatrix(Es),r&&(Es.extractRotation(r.matrixWorld),ll.setFromRotationMatrix(Es),this.quaternion.premultiply(ll.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(_n("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(LE),cl.child=e,this.dispatchEvent(cl),cl.child=null):_n("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}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(FH),dg.child=e,this.dispatchEvent(dg),dg.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Es.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Es.multiply(e.parent.matrixWorld)),e.applyMatrix4(Es),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(LE),cl.child=e,this.dispatchEvent(cl),cl.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,r=this.children.length;i<r;i++){const o=this.children[i].getObjectByProperty(e,n);if(o!==void 0)return o}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(zc,e,IH),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(zc,UH,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const n=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=n-s[0]*n-s[4]*i-s[8]*r,s[13]+=i-s[1]*n-s[5]*i-s[9]*r,s[14]+=r-s[2]*n-s[6]*i-s[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);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n){const 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)),n===!0){const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const 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(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(c=>({...c})),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 s(c,u){return c[u.uuid]===void 0&&(c[u.uuid]=u.toJSON(e)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const u=c.shapes;if(Array.isArray(u))for(let f=0,h=u.length;f<h;f++){const p=u[f];s(e.shapes,p)}else s(e.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const c=[];for(let u=0,f=this.material.length;u<f;u++)c.push(s(e.materials,this.material[u]));r.material=c}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let c=0;c<this.children.length;c++)r.children.push(this.children[c].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let c=0;c<this.animations.length;c++){const u=this.animations[c];r.animations.push(s(e.animations,u))}}if(n){const c=o(e.geometries),u=o(e.materials),f=o(e.textures),h=o(e.images),p=o(e.shapes),m=o(e.skeletons),v=o(e.animations),_=o(e.nodes);c.length>0&&(i.geometries=c),u.length>0&&(i.materials=u),f.length>0&&(i.textures=f),h.length>0&&(i.images=h),p.length>0&&(i.shapes=p),m.length>0&&(i.skeletons=m),v.length>0&&(i.animations=v),_.length>0&&(i.nodes=_)}return i.object=r,i;function o(c){const u=[];for(const f in c){const h=c[f];delete h.metadata,u.push(h)}return u}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),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)),n===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}er.DEFAULT_UP=new me(0,1,0);er.DEFAULT_MATRIX_AUTO_UPDATE=!0;er.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class Jd extends er{constructor(){super(),this.isGroup=!0,this.type="Group"}}const OH={type:"move"};class fg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Jd,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 Jd,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new me,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new me),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Jd,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new me,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new me),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,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,n,i){let r=null,s=null,o=null;const c=this._targetRay,u=this._grip,f=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(f&&e.hand){o=!0;for(const w of e.hand.values()){const y=n.getJointPose(w,i),x=this._getHandJoint(f,w);y!==null&&(x.matrix.fromArray(y.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.matrixWorldNeedsUpdate=!0,x.jointRadius=y.radius),x.visible=y!==null}const h=f.joints["index-finger-tip"],p=f.joints["thumb-tip"],m=h.position.distanceTo(p.position),v=.02,_=.005;f.inputState.pinching&&m>v+_?(f.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!f.inputState.pinching&&m<=v-_&&(f.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));c!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(OH)))}return c!==null&&(c.visible=r!==null),u!==null&&(u.visible=s!==null),f!==null&&(f.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new Jd;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}const sR={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},ha={h:0,s:0,l:0},Qd={h:0,s:0,l:0};function hg(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class Mn{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ur){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,fn.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=fn.workingColorSpace){return this.r=e,this.g=n,this.b=i,fn.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=fn.workingColorSpace){if(e=MH(e,1),n=ln(n,0,1),i=ln(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;this.r=hg(o,s,e+1/3),this.g=hg(o,s,e),this.b=hg(o,s,e-1/3)}return fn.colorSpaceToWorking(this,r),this}setStyle(e,n=ur){function i(s){s!==void 0&&parseFloat(s)<1&&Ht("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],c=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:Ht("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(s,16),n);Ht("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ur){const i=sR[e.toLowerCase()];return i!==void 0?this.setHex(i,n):Ht("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=Is(e.r),this.g=Is(e.g),this.b=Is(e.b),this}copyLinearToSRGB(e){return this.r=kl(e.r),this.g=kl(e.g),this.b=kl(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ur){return fn.workingToColorSpace(xi.copy(this),e),Math.round(ln(xi.r*255,0,255))*65536+Math.round(ln(xi.g*255,0,255))*256+Math.round(ln(xi.b*255,0,255))}getHexString(e=ur){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=fn.workingColorSpace){fn.workingToColorSpace(xi.copy(this),n);const i=xi.r,r=xi.g,s=xi.b,o=Math.max(i,r,s),c=Math.min(i,r,s);let u,f;const h=(c+o)/2;if(c===o)u=0,f=0;else{const p=o-c;switch(f=h<=.5?p/(o+c):p/(2-o-c),o){case i:u=(r-s)/p+(r<s?6:0);break;case r:u=(s-i)/p+2;break;case s:u=(i-r)/p+4;break}u/=6}return e.h=u,e.s=f,e.l=h,e}getRGB(e,n=fn.workingColorSpace){return fn.workingToColorSpace(xi.copy(this),n),e.r=xi.r,e.g=xi.g,e.b=xi.b,e}getStyle(e=ur){fn.workingToColorSpace(xi.copy(this),e);const n=xi.r,i=xi.g,r=xi.b;return e!==ur?`color(${e} ${n.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,n,i){return this.getHSL(ha),this.setHSL(ha.h+e,ha.s+n,ha.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.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,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,i){return this.r=e.r+(n.r-e.r)*i,this.g=e.g+(n.g-e.g)*i,this.b=e.b+(n.b-e.b)*i,this}lerpHSL(e,n){this.getHSL(ha),e.getHSL(Qd);const i=ag(ha.h,Qd.h,n),r=ag(ha.s,Qd.s,n),s=ag(ha.l,Qd.l,n);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*n+s[3]*i+s[6]*r,this.g=s[1]*n+s[4]*i+s[7]*r,this.b=s[2]*n+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const xi=new Mn;Mn.NAMES=sR;class BH extends er{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 To,this.environmentIntensity=1,this.environmentRotation=new To,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}const kr=new me,Ms=new me,pg=new me,Ts=new me,ul=new me,dl=new me,DE=new me,mg=new me,gg=new me,vg=new me,yg=new zn,_g=new zn,xg=new zn;let Vc=class wl{constructor(e=new me,n=new me,i=new me){this.a=e,this.b=n,this.c=i}static getNormal(e,n,i,r){r.subVectors(i,n),kr.subVectors(e,n),r.cross(kr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){kr.subVectors(r,n),Ms.subVectors(i,n),pg.subVectors(e,n);const o=kr.dot(kr),c=kr.dot(Ms),u=kr.dot(pg),f=Ms.dot(Ms),h=Ms.dot(pg),p=o*f-c*c;if(p===0)return s.set(0,0,0),null;const m=1/p,v=(f*u-c*h)*m,_=(o*h-c*u)*m;return s.set(1-v-_,_,v)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,Ts)===null?!1:Ts.x>=0&&Ts.y>=0&&Ts.x+Ts.y<=1}static getInterpolation(e,n,i,r,s,o,c,u){return this.getBarycoord(e,n,i,r,Ts)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(s,Ts.x),u.addScaledVector(o,Ts.y),u.addScaledVector(c,Ts.z),u)}static getInterpolatedAttribute(e,n,i,r,s,o){return yg.setScalar(0),_g.setScalar(0),xg.setScalar(0),yg.fromBufferAttribute(e,n),_g.fromBufferAttribute(e,i),xg.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(yg,s.x),o.addScaledVector(_g,s.y),o.addScaledVector(xg,s.z),o}static isFrontFacing(e,n,i,r){return kr.subVectors(i,n),Ms.subVectors(e,n),kr.cross(Ms).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),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 kr.subVectors(this.c,this.b),Ms.subVectors(this.a,this.b),kr.cross(Ms).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wl.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return wl.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return wl.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return wl.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wl.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let o,c;ul.subVectors(r,i),dl.subVectors(s,i),mg.subVectors(e,i);const u=ul.dot(mg),f=dl.dot(mg);if(u<=0&&f<=0)return n.copy(i);gg.subVectors(e,r);const h=ul.dot(gg),p=dl.dot(gg);if(h>=0&&p<=h)return n.copy(r);const m=u*p-h*f;if(m<=0&&u>=0&&h<=0)return o=u/(u-h),n.copy(i).addScaledVector(ul,o);vg.subVectors(e,s);const v=ul.dot(vg),_=dl.dot(vg);if(_>=0&&v<=_)return n.copy(s);const w=v*f-u*_;if(w<=0&&f>=0&&_<=0)return c=f/(f-_),n.copy(i).addScaledVector(dl,c);const y=h*_-v*p;if(y<=0&&p-h>=0&&v-_>=0)return DE.subVectors(s,r),c=(p-h)/(p-h+(v-_)),n.copy(r).addScaledVector(DE,c);const x=1/(y+w+m);return o=w*x,c=m*x,n.copy(i).addScaledVector(ul,o).addScaledVector(dl,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}};class Du{constructor(e=new me(1/0,1/0,1/0),n=new me(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n+=3)this.expandByPoint(Lr.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(Lr.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=Lr.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}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,n=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,c=s.count;o<c;o++)e.isMesh===!0?e.getVertexPosition(o,Lr):Lr.fromBufferAttribute(s,o),Lr.applyMatrix4(e.matrixWorld),this.expandByPoint(Lr);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),ef.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),ef.copy(i.boundingBox)),ef.applyMatrix4(e.matrixWorld),this.union(ef)}const r=e.children;for(let s=0,o=r.length;s<o;s++)this.expandByObject(r[s],n);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,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Lr),Lr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Hc),tf.subVectors(this.max,Hc),fl.subVectors(e.a,Hc),hl.subVectors(e.b,Hc),pl.subVectors(e.c,Hc),pa.subVectors(hl,fl),ma.subVectors(pl,hl),Ya.subVectors(fl,pl);let n=[0,-pa.z,pa.y,0,-ma.z,ma.y,0,-Ya.z,Ya.y,pa.z,0,-pa.x,ma.z,0,-ma.x,Ya.z,0,-Ya.x,-pa.y,pa.x,0,-ma.y,ma.x,0,-Ya.y,Ya.x,0];return!bg(n,fl,hl,pl,tf)||(n=[1,0,0,0,1,0,0,0,1],!bg(n,fl,hl,pl,tf))?!1:(nf.crossVectors(pa,ma),n=[nf.x,nf.y,nf.z],bg(n,fl,hl,pl,tf))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Lr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Lr).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:(As[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),As[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),As[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),As[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),As[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),As[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),As[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),As[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(As),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}}const As=[new me,new me,new me,new me,new me,new me,new me,new me],Lr=new me,ef=new Du,fl=new me,hl=new me,pl=new me,pa=new me,ma=new me,Ya=new me,Hc=new me,tf=new me,nf=new me,Ka=new me;function bg(t,e,n,i,r){for(let s=0,o=t.length-3;s<=o;s+=3){Ka.fromArray(t,s);const c=r.x*Math.abs(Ka.x)+r.y*Math.abs(Ka.y)+r.z*Math.abs(Ka.z),u=e.dot(Ka),f=n.dot(Ka),h=i.dot(Ka);if(Math.max(-Math.max(u,f,h),Math.min(u,f,h))>c)return!1}return!0}const jn=new me,rf=new bn;let zH=0;class zr{constructor(e,n,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:zH++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=_E,this.updateRanges=[],this.gpuType=Jr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=n.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,i=this.count;n<i;n++)rf.fromBufferAttribute(this,n),rf.applyMatrix3(e),this.setXY(n,rf.x,rf.y);else if(this.itemSize===3)for(let n=0,i=this.count;n<i;n++)jn.fromBufferAttribute(this,n),jn.applyMatrix3(e),this.setXYZ(n,jn.x,jn.y,jn.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)jn.fromBufferAttribute(this,n),jn.applyMatrix4(e),this.setXYZ(n,jn.x,jn.y,jn.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)jn.fromBufferAttribute(this,n),jn.applyNormalMatrix(e),this.setXYZ(n,jn.x,jn.y,jn.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)jn.fromBufferAttribute(this,n),jn.transformDirection(e),this.setXYZ(n,jn.x,jn.y,jn.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let i=this.array[e*this.itemSize+n];return this.normalized&&(i=Bc(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=Hi(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Bc(n,this.array)),n}setX(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Bc(n,this.array)),n}setY(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=Bc(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=Bc(n,this.array)),n}setW(e,n){return this.normalized&&(n=Hi(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array)),this.array[e+0]=n,this.array[e+1]=i,this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array),r=Hi(r,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,n,i,r,s){return e*=this.itemSize,this.normalized&&(n=Hi(n,this.array),i=Hi(i,this.array),r=Hi(r,this.array),s=Hi(s,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==_E&&(e.usage=this.usage),e}}class aR extends zr{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class oR extends zr{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class Us extends zr{constructor(e,n,i){super(new Float32Array(e),n,i)}}const VH=new Du,Gc=new me,Sg=new me;class e_{constructor(e=new me,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):VH.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;s<o;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const i=this.center.distanceToSquared(e);return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Gc.subVectors(e,this.center);const n=Gc.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(Gc,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):(Sg.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Gc.copy(e.center).add(Sg)),this.expandByPoint(Gc.copy(e.center).sub(Sg))),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}}let HH=0;const lr=new Yn,wg=new er,ml=new me,Zi=new Du,Wc=new Du,li=new me;class hs extends Zl{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:HH++}),this.uuid=Lu(),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(bH(e)?oR:aR)(e,1):this.index=e,this}setIndirect(e,n=0){return this.indirect=e,this.indirectOffset=n,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,i=0){this.groups.push({start:e,count:n,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new Wt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const 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 lr.makeRotationFromQuaternion(e),this.applyMatrix4(lr),this}rotateX(e){return lr.makeRotationX(e),this.applyMatrix4(lr),this}rotateY(e){return lr.makeRotationY(e),this.applyMatrix4(lr),this}rotateZ(e){return lr.makeRotationZ(e),this.applyMatrix4(lr),this}translate(e,n,i){return lr.makeTranslation(e,n,i),this.applyMatrix4(lr),this}scale(e,n,i){return lr.makeScale(e,n,i),this.applyMatrix4(lr),this}lookAt(e){return wg.lookAt(e),wg.updateMatrix(),this.applyMatrix4(wg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ml).negate(),this.translate(ml.x,ml.y,ml.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];i.push(o.x,o.y,o.z||0)}this.setAttribute("position",new Us(i,3))}else{const i=Math.min(e.length,n.count);for(let r=0;r<i;r++){const s=e[r];n.setXYZ(r,s.x,s.y,s.z||0)}e.length>n.count&&Ht("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Du);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_n("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new me(-1/0,-1/0,-1/0),new me(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i<r;i++){const s=n[i];Zi.setFromBufferAttribute(s),this.morphTargetsRelative?(li.addVectors(this.boundingBox.min,Zi.min),this.boundingBox.expandByPoint(li),li.addVectors(this.boundingBox.max,Zi.max),this.boundingBox.expandByPoint(li)):(this.boundingBox.expandByPoint(Zi.min),this.boundingBox.expandByPoint(Zi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&_n('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 e_);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_n("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new me,1/0);return}if(e){const i=this.boundingSphere.center;if(Zi.setFromBufferAttribute(e),n)for(let s=0,o=n.length;s<o;s++){const c=n[s];Wc.setFromBufferAttribute(c),this.morphTargetsRelative?(li.addVectors(Zi.min,Wc.min),Zi.expandByPoint(li),li.addVectors(Zi.max,Wc.max),Zi.expandByPoint(li)):(Zi.expandByPoint(Wc.min),Zi.expandByPoint(Wc.max))}Zi.getCenter(i);let r=0;for(let s=0,o=e.count;s<o;s++)li.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(li));if(n)for(let s=0,o=n.length;s<o;s++){const c=n[s],u=this.morphTargetsRelative;for(let f=0,h=c.count;f<h;f++)li.fromBufferAttribute(c,f),u&&(ml.fromBufferAttribute(e,f),li.add(ml)),r=Math.max(r,i.distanceToSquared(li))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&_n('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){_n("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=n.position,r=n.normal,s=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new zr(new Float32Array(4*i.count),4));const o=this.getAttribute("tangent"),c=[],u=[];for(let S=0;S<i.count;S++)c[S]=new me,u[S]=new me;const f=new me,h=new me,p=new me,m=new bn,v=new bn,_=new bn,w=new me,y=new me;function x(S,R,H){f.fromBufferAttribute(i,S),h.fromBufferAttribute(i,R),p.fromBufferAttribute(i,H),m.fromBufferAttribute(s,S),v.fromBufferAttribute(s,R),_.fromBufferAttribute(s,H),h.sub(f),p.sub(f),v.sub(m),_.sub(m);const F=1/(v.x*_.y-_.x*v.y);isFinite(F)&&(w.copy(h).multiplyScalar(_.y).addScaledVector(p,-v.y).multiplyScalar(F),y.copy(p).multiplyScalar(v.x).addScaledVector(h,-_.x).multiplyScalar(F),c[S].add(w),c[R].add(w),c[H].add(w),u[S].add(y),u[R].add(y),u[H].add(y))}let M=this.groups;M.length===0&&(M=[{start:0,count:e.count}]);for(let S=0,R=M.length;S<R;++S){const H=M[S],F=H.start,W=H.count;for(let X=F,V=F+W;X<V;X+=3)x(e.getX(X+0),e.getX(X+1),e.getX(X+2))}const A=new me,T=new me,D=new me,I=new me;function U(S){D.fromBufferAttribute(r,S),I.copy(D);const R=c[S];A.copy(R),A.sub(D.multiplyScalar(D.dot(R))).normalize(),T.crossVectors(I,R);const F=T.dot(u[S])<0?-1:1;o.setXYZW(S,A.x,A.y,A.z,F)}for(let S=0,R=M.length;S<R;++S){const H=M[S],F=H.start,W=H.count;for(let X=F,V=F+W;X<V;X+=3)U(e.getX(X+0)),U(e.getX(X+1)),U(e.getX(X+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new zr(new Float32Array(n.count*3),3),this.setAttribute("normal",i);else for(let m=0,v=i.count;m<v;m++)i.setXYZ(m,0,0,0);const r=new me,s=new me,o=new me,c=new me,u=new me,f=new me,h=new me,p=new me;if(e)for(let m=0,v=e.count;m<v;m+=3){const _=e.getX(m+0),w=e.getX(m+1),y=e.getX(m+2);r.fromBufferAttribute(n,_),s.fromBufferAttribute(n,w),o.fromBufferAttribute(n,y),h.subVectors(o,s),p.subVectors(r,s),h.cross(p),c.fromBufferAttribute(i,_),u.fromBufferAttribute(i,w),f.fromBufferAttribute(i,y),c.add(h),u.add(h),f.add(h),i.setXYZ(_,c.x,c.y,c.z),i.setXYZ(w,u.x,u.y,u.z),i.setXYZ(y,f.x,f.y,f.z)}else for(let m=0,v=n.count;m<v;m+=3)r.fromBufferAttribute(n,m+0),s.fromBufferAttribute(n,m+1),o.fromBufferAttribute(n,m+2),h.subVectors(o,s),p.subVectors(r,s),h.cross(p),i.setXYZ(m+0,h.x,h.y,h.z),i.setXYZ(m+1,h.x,h.y,h.z),i.setXYZ(m+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,i=e.count;n<i;n++)li.fromBufferAttribute(e,n),li.normalize(),e.setXYZ(n,li.x,li.y,li.z)}toNonIndexed(){function e(c,u){const f=c.array,h=c.itemSize,p=c.normalized,m=new f.constructor(u.length*h);let v=0,_=0;for(let w=0,y=u.length;w<y;w++){c.isInterleavedBufferAttribute?v=u[w]*c.data.stride+c.offset:v=u[w]*h;for(let x=0;x<h;x++)m[_++]=f[v++]}return new zr(m,h,p)}if(this.index===null)return Ht("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new hs,i=this.index.array,r=this.attributes;for(const c in r){const u=r[c],f=e(u,i);n.setAttribute(c,f)}const s=this.morphAttributes;for(const c in s){const u=[],f=s[c];for(let h=0,p=f.length;h<p;h++){const m=f[h],v=e(m,i);u.push(v)}n.morphAttributes[c]=u}n.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let c=0,u=o.length;c<u;c++){const f=o[c];n.addGroup(f.start,f.count,f.materialIndex)}return n}toJSON(){const 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){const u=this.parameters;for(const f in u)u[f]!==void 0&&(e[f]=u[f]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const u in i){const f=i[u];e.data.attributes[u]=f.toJSON(e.data)}const r={};let s=!1;for(const u in this.morphAttributes){const f=this.morphAttributes[u],h=[];for(let p=0,m=f.length;p<m;p++){const v=f[p];h.push(v.toJSON(e.data))}h.length>0&&(r[u]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere=c.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;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const f in r){const h=r[f];this.setAttribute(f,h.clone(n))}const s=e.morphAttributes;for(const f in s){const h=[],p=s[f];for(let m=0,v=p.length;m<v;m++)h.push(p[m].clone(n));this.morphAttributes[f]=h}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let f=0,h=o.length;f<h;f++){const p=o[f];this.addGroup(p.start,p.count,p.materialIndex)}const c=e.boundingBox;c!==null&&(this.boundingBox=c.clone());const u=e.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let GH=0;class Uh extends Zl{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:GH++}),this.uuid=Lu(),this.name="",this.type="Material",this.blending=vo,this.side=Pa,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=I0,this.blendDst=U0,this.blendEquation=ro,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Mn(0,0,0),this.blendAlpha=0,this.depthFunc=Bl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=yE,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=sl,this.stencilZFail=sl,this.stencilZPass=sl,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(const n in e){const i=e[n];if(i===void 0){Ht(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){Ht(`Material: '${n}' 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[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.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!==vo&&(i.blending=this.blending),this.side!==Pa&&(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!==I0&&(i.blendSrc=this.blendSrc),this.blendDst!==U0&&(i.blendDst=this.blendDst),this.blendEquation!==ro&&(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!==Bl&&(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!==yE&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==sl&&(i.stencilFail=this.stencilFail),this.stencilZFail!==sl&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==sl&&(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(s){const o=[];for(const c in s){const u=s[c];delete u.metadata,o.push(u)}return o}if(n){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.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++}}const Cs=new me,Eg=new me,sf=new me,ga=new me,Mg=new me,af=new me,Tg=new me;class WH{constructor(e=new me,n=new me(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Cs)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Cs.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Cs.copy(this.origin).addScaledVector(this.direction,n),Cs.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){Eg.copy(e).add(n).multiplyScalar(.5),sf.copy(n).sub(e).normalize(),ga.copy(this.origin).sub(Eg);const s=e.distanceTo(n)*.5,o=-this.direction.dot(sf),c=ga.dot(this.direction),u=-ga.dot(sf),f=ga.lengthSq(),h=Math.abs(1-o*o);let p,m,v,_;if(h>0)if(p=o*u-c,m=o*c-u,_=s*h,p>=0)if(m>=-_)if(m<=_){const w=1/h;p*=w,m*=w,v=p*(p+o*m+2*c)+m*(o*p+m+2*u)+f}else m=s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+f;else m=-s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+f;else m<=-_?(p=Math.max(0,-(-o*s+c)),m=p>0?-s:Math.min(Math.max(-s,-u),s),v=-p*p+m*(m+2*u)+f):m<=_?(p=0,m=Math.min(Math.max(-s,-u),s),v=m*(m+2*u)+f):(p=Math.max(0,-(o*s+c)),m=p>0?s:Math.min(Math.max(-s,-u),s),v=-p*p+m*(m+2*u)+f);else m=o>0?-s:s,p=Math.max(0,-(o*m+c)),v=-p*p+m*(m+2*u)+f;return i&&i.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(Eg).addScaledVector(sf,m),v}intersectSphere(e,n){Cs.subVectors(e.center,this.origin);const i=Cs.dot(this.direction),r=Cs.dot(Cs)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),c=i-o,u=i+o;return u<0?null:c<0?this.at(u,n):this.at(c,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,o,c,u;const f=1/this.direction.x,h=1/this.direction.y,p=1/this.direction.z,m=this.origin;return f>=0?(i=(e.min.x-m.x)*f,r=(e.max.x-m.x)*f):(i=(e.max.x-m.x)*f,r=(e.min.x-m.x)*f),h>=0?(s=(e.min.y-m.y)*h,o=(e.max.y-m.y)*h):(s=(e.max.y-m.y)*h,o=(e.min.y-m.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o<r||isNaN(r))&&(r=o),p>=0?(c=(e.min.z-m.z)*p,u=(e.max.z-m.z)*p):(c=(e.max.z-m.z)*p,u=(e.min.z-m.z)*p),i>u||c>r)||((c>i||i!==i)&&(i=c),(u<r||r!==r)&&(r=u),r<0)?null:this.at(i>=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,Cs)!==null}intersectTriangle(e,n,i,r,s){Mg.subVectors(n,e),af.subVectors(i,e),Tg.crossVectors(Mg,af);let o=this.direction.dot(Tg),c;if(o>0){if(r)return null;c=1}else if(o<0)c=-1,o=-o;else return null;ga.subVectors(this.origin,e);const u=c*this.direction.dot(af.crossVectors(ga,af));if(u<0)return null;const f=c*this.direction.dot(Mg.cross(ga));if(f<0||u+f>o)return null;const h=-c*ga.dot(Tg);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class lR extends Uh{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Mn(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 To,this.combine=BC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const NE=new Yn,Za=new WH,of=new e_,IE=new me,lf=new me,cf=new me,uf=new me,Ag=new me,df=new me,UE=new me,ff=new me;let us=class extends er{constructor(e=new hs,n=new lR){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),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(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const c=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[c]=s}}}}getVertexPosition(e,n){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,o=i.morphTargetsRelative;n.fromBufferAttribute(r,e);const c=this.morphTargetInfluences;if(s&&c){df.set(0,0,0);for(let u=0,f=s.length;u<f;u++){const h=c[u],p=s[u];h!==0&&(Ag.fromBufferAttribute(p,e),o?df.addScaledVector(Ag,h):df.addScaledVector(Ag.sub(n),h))}n.add(df)}return n}raycast(e,n){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),of.copy(i.boundingSphere),of.applyMatrix4(s),Za.copy(e.ray).recast(e.near),!(of.containsPoint(Za.origin)===!1&&(Za.intersectSphere(of,IE)===null||Za.origin.distanceToSquared(IE)>(e.far-e.near)**2))&&(NE.copy(s).invert(),Za.copy(e.ray).applyMatrix4(NE),!(i.boundingBox!==null&&Za.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Za)))}_computeIntersections(e,n,i){let r;const s=this.geometry,o=this.material,c=s.index,u=s.attributes.position,f=s.attributes.uv,h=s.attributes.uv1,p=s.attributes.normal,m=s.groups,v=s.drawRange;if(c!==null)if(Array.isArray(o))for(let _=0,w=m.length;_<w;_++){const y=m[_],x=o[y.materialIndex],M=Math.max(y.start,v.start),A=Math.min(c.count,Math.min(y.start+y.count,v.start+v.count));for(let T=M,D=A;T<D;T+=3){const I=c.getX(T),U=c.getX(T+1),S=c.getX(T+2);r=hf(this,x,e,i,f,h,p,I,U,S),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const _=Math.max(0,v.start),w=Math.min(c.count,v.start+v.count);for(let y=_,x=w;y<x;y+=3){const M=c.getX(y),A=c.getX(y+1),T=c.getX(y+2);r=hf(this,o,e,i,f,h,p,M,A,T),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}else if(u!==void 0)if(Array.isArray(o))for(let _=0,w=m.length;_<w;_++){const y=m[_],x=o[y.materialIndex],M=Math.max(y.start,v.start),A=Math.min(u.count,Math.min(y.start+y.count,v.start+v.count));for(let T=M,D=A;T<D;T+=3){const I=T,U=T+1,S=T+2;r=hf(this,x,e,i,f,h,p,I,U,S),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const _=Math.max(0,v.start),w=Math.min(u.count,v.start+v.count);for(let y=_,x=w;y<x;y+=3){const M=y,A=y+1,T=y+2;r=hf(this,o,e,i,f,h,p,M,A,T),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}}};function jH(t,e,n,i,r,s,o,c){let u;if(e.side===Gi?u=i.intersectTriangle(o,s,r,!0,c):u=i.intersectTriangle(r,s,o,e.side===Pa,c),u===null)return null;ff.copy(c),ff.applyMatrix4(t.matrixWorld);const f=n.ray.origin.distanceTo(ff);return f<n.near||f>n.far?null:{distance:f,point:ff.clone(),object:t}}function hf(t,e,n,i,r,s,o,c,u,f){t.getVertexPosition(c,lf),t.getVertexPosition(u,cf),t.getVertexPosition(f,uf);const h=jH(t,e,n,i,lf,cf,uf,UE);if(h){const p=new me;Vc.getBarycoord(UE,lf,cf,uf,p),r&&(h.uv=Vc.getInterpolatedAttribute(r,c,u,f,p,new bn)),s&&(h.uv1=Vc.getInterpolatedAttribute(s,c,u,f,p,new bn)),o&&(h.normal=Vc.getInterpolatedAttribute(o,c,u,f,p,new me),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const m={a:c,b:u,c:f,normal:new me,materialIndex:0};Vc.getNormal(lf,cf,uf,m.normal),h.face=m,h.barycoord=p}return h}class $H extends Li{constructor(e=null,n=1,i=1,r,s,o,c,u,f=pi,h=pi,p,m){super(null,o,c,u,f,h,r,s,p,m),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Cg=new me,XH=new me,qH=new Wt;class no{constructor(e=new me(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=Cg.subVectors(i,n).cross(XH.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(Cg),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||qH.getNormalMatrix(e),r=this.coplanarPoint(Cg).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ja=new e_,YH=new bn(.5,.5),pf=new me;class cR{constructor(e=new no,n=new no,i=new no,r=new no,s=new no,o=new no){this.planes=[e,n,i,r,s,o]}set(e,n,i,r,s,o){const c=this.planes;return c[0].copy(e),c[1].copy(n),c[2].copy(i),c[3].copy(r),c[4].copy(s),c[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Qr,i=!1){const r=this.planes,s=e.elements,o=s[0],c=s[1],u=s[2],f=s[3],h=s[4],p=s[5],m=s[6],v=s[7],_=s[8],w=s[9],y=s[10],x=s[11],M=s[12],A=s[13],T=s[14],D=s[15];if(r[0].setComponents(f-o,v-h,x-_,D-M).normalize(),r[1].setComponents(f+o,v+h,x+_,D+M).normalize(),r[2].setComponents(f+c,v+p,x+w,D+A).normalize(),r[3].setComponents(f-c,v-p,x-w,D-A).normalize(),i)r[4].setComponents(u,m,y,T).normalize(),r[5].setComponents(f-u,v-m,x-y,D-T).normalize();else if(r[4].setComponents(f-u,v-m,x-y,D-T).normalize(),n===Qr)r[5].setComponents(f+u,v+m,x+y,D+T).normalize();else if(n===gh)r[5].setComponents(u,m,y,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ja.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Ja.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ja)}intersectsSprite(e){Ja.center.set(0,0,0);const n=YH.distanceTo(e.center);return Ja.radius=.7071067811865476+n,Ja.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ja)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const n=this.planes;for(let i=0;i<6;i++){const r=n[i];if(pf.x=r.normal.x>0?e.max.x:e.min.x,pf.y=r.normal.y>0?e.max.y:e.min.y,pf.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(pf)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class uR extends Li{constructor(e=[],n=Eo,i,r,s,o,c,u,f,h){super(e,n,i,r,s,o,c,u,f,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class _u extends Li{constructor(e,n,i=cs,r,s,o,c=pi,u=pi,f,h=Bs,p=1){if(h!==Bs&&h!==fo)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const m={width:e,height:n,depth:p};super(m,r,s,o,c,u,h,i,f),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Qy(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class KH extends _u{constructor(e,n=cs,i=Eo,r,s,o=pi,c=pi,u,f=Bs){const h={width:e,height:e,depth:1},p=[h,h,h,h,h,h];super(e,e,n,i,r,s,o,c,u,f),this.image=p,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class dR extends Li{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Nu extends hs{constructor(e=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const c=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const u=[],f=[],h=[],p=[];let m=0,v=0;_("z","y","x",-1,-1,i,n,e,o,s,0),_("z","y","x",1,-1,i,n,-e,o,s,1),_("x","z","y",1,1,e,i,n,r,o,2),_("x","z","y",1,-1,e,i,-n,r,o,3),_("x","y","z",1,-1,e,n,i,r,s,4),_("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(u),this.setAttribute("position",new Us(f,3)),this.setAttribute("normal",new Us(h,3)),this.setAttribute("uv",new Us(p,2));function _(w,y,x,M,A,T,D,I,U,S,R){const H=T/U,F=D/S,W=T/2,X=D/2,V=I/2,q=U+1,J=S+1;let Q=0,$=0;const Y=new me;for(let Z=0;Z<J;Z++){const z=Z*F-X;for(let ie=0;ie<q;ie++){const _e=ie*H-W;Y[w]=_e*M,Y[y]=z*A,Y[x]=V,f.push(Y.x,Y.y,Y.z),Y[w]=0,Y[y]=0,Y[x]=I>0?1:-1,h.push(Y.x,Y.y,Y.z),p.push(ie/U),p.push(1-Z/S),Q+=1}}for(let Z=0;Z<S;Z++)for(let z=0;z<U;z++){const ie=m+z+q*Z,_e=m+z+q*(Z+1),Ee=m+(z+1)+q*(Z+1),Ue=m+(z+1)+q*Z;u.push(ie,_e,Ue),u.push(_e,Ee,Ue),$+=6}c.addGroup(v,$,R),v+=$,m+=Q}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Fh extends hs{constructor(e=1,n=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:i,heightSegments:r};const s=e/2,o=n/2,c=Math.floor(i),u=Math.floor(r),f=c+1,h=u+1,p=e/c,m=n/u,v=[],_=[],w=[],y=[];for(let x=0;x<h;x++){const M=x*m-o;for(let A=0;A<f;A++){const T=A*p-s;_.push(T,-M,0),w.push(0,0,1),y.push(A/c),y.push(1-x/u)}}for(let x=0;x<u;x++)for(let M=0;M<c;M++){const A=M+f*x,T=M+f*(x+1),D=M+1+f*(x+1),I=M+1+f*x;v.push(A,T,I),v.push(T,D,I)}this.setIndex(v),this.setAttribute("position",new Us(_,3)),this.setAttribute("normal",new Us(w,3)),this.setAttribute("uv",new Us(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fh(e.width,e.height,e.widthSegments,e.heightSegments)}}function Hl(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(Ht("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function Ci(t){const e={};for(let n=0;n<t.length;n++){const i=Hl(t[n]);for(const r in i)e[r]=i[r]}return e}function ZH(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function fR(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:fn.workingColorSpace}const JH={clone:Hl,merge:Ci};var QH=`void main() {
|
|
509
509
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
510
510
|
}`,eG=`void main() {
|
|
511
511
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
@@ -4116,7 +4116,7 @@ void main() {
|
|
|
4116
4116
|
#include <tonemapping_fragment>
|
|
4117
4117
|
#include <colorspace_fragment>
|
|
4118
4118
|
#include <fog_fragment>
|
|
4119
|
-
}`,$t={alphahash_fragment:lG,alphahash_pars_fragment:cG,alphamap_fragment:uG,alphamap_pars_fragment:dG,alphatest_fragment:fG,alphatest_pars_fragment:hG,aomap_fragment:pG,aomap_pars_fragment:mG,batching_pars_vertex:gG,batching_vertex:vG,begin_vertex:yG,beginnormal_vertex:_G,bsdfs:xG,iridescence_fragment:bG,bumpmap_pars_fragment:SG,clipping_planes_fragment:wG,clipping_planes_pars_fragment:EG,clipping_planes_pars_vertex:MG,clipping_planes_vertex:TG,color_fragment:AG,color_pars_fragment:CG,color_pars_vertex:RG,color_vertex:PG,common:kG,cube_uv_reflection_fragment:LG,defaultnormal_vertex:DG,displacementmap_pars_vertex:NG,displacementmap_vertex:IG,emissivemap_fragment:UG,emissivemap_pars_fragment:FG,colorspace_fragment:OG,colorspace_pars_fragment:BG,envmap_fragment:zG,envmap_common_pars_fragment:VG,envmap_pars_fragment:HG,envmap_pars_vertex:GG,envmap_physical_pars_fragment:e8,envmap_vertex:WG,fog_vertex:jG,fog_pars_vertex:$G,fog_fragment:XG,fog_pars_fragment:qG,gradientmap_pars_fragment:YG,lightmap_pars_fragment:KG,lights_lambert_fragment:ZG,lights_lambert_pars_fragment:JG,lights_pars_begin:QG,lights_toon_fragment:t8,lights_toon_pars_fragment:n8,lights_phong_fragment:i8,lights_phong_pars_fragment:r8,lights_physical_fragment:s8,lights_physical_pars_fragment:a8,lights_fragment_begin:o8,lights_fragment_maps:l8,lights_fragment_end:c8,logdepthbuf_fragment:u8,logdepthbuf_pars_fragment:d8,logdepthbuf_pars_vertex:f8,logdepthbuf_vertex:h8,map_fragment:p8,map_pars_fragment:m8,map_particle_fragment:g8,map_particle_pars_fragment:v8,metalnessmap_fragment:y8,metalnessmap_pars_fragment:_8,morphinstance_vertex:x8,morphcolor_vertex:b8,morphnormal_vertex:S8,morphtarget_pars_vertex:w8,morphtarget_vertex:E8,normal_fragment_begin:M8,normal_fragment_maps:T8,normal_pars_fragment:A8,normal_pars_vertex:C8,normal_vertex:R8,normalmap_pars_fragment:P8,clearcoat_normal_fragment_begin:k8,clearcoat_normal_fragment_maps:L8,clearcoat_pars_fragment:D8,iridescence_pars_fragment:N8,opaque_fragment:I8,packing:U8,premultiplied_alpha_fragment:F8,project_vertex:O8,dithering_fragment:B8,dithering_pars_fragment:z8,roughnessmap_fragment:V8,roughnessmap_pars_fragment:H8,shadowmap_pars_fragment:G8,shadowmap_pars_vertex:W8,shadowmap_vertex:j8,shadowmask_pars_fragment:$8,skinbase_vertex:X8,skinning_pars_vertex:q8,skinning_vertex:Y8,skinnormal_vertex:K8,specularmap_fragment:Z8,specularmap_pars_fragment:J8,tonemapping_fragment:Q8,tonemapping_pars_fragment:e6,transmission_fragment:t6,transmission_pars_fragment:n6,uv_pars_fragment:i6,uv_pars_vertex:r6,uv_vertex:s6,worldpos_vertex:a6,background_vert:o6,background_frag:l6,backgroundCube_vert:c6,backgroundCube_frag:u6,cube_vert:d6,cube_frag:f6,depth_vert:h6,depth_frag:p6,distance_vert:m6,distance_frag:g6,equirect_vert:v6,equirect_frag:y6,linedashed_vert:_6,linedashed_frag:x6,meshbasic_vert:b6,meshbasic_frag:S6,meshlambert_vert:w6,meshlambert_frag:E6,meshmatcap_vert:M6,meshmatcap_frag:T6,meshnormal_vert:A6,meshnormal_frag:C6,meshphong_vert:R6,meshphong_frag:P6,meshphysical_vert:k6,meshphysical_frag:L6,meshtoon_vert:D6,meshtoon_frag:N6,points_vert:I6,points_frag:U6,shadow_vert:F6,shadow_frag:O6,sprite_vert:B6,sprite_frag:z6},Ye={common:{diffuse:{value:new Mn(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Wt}},envmap:{envMap:{value:null},envMapRotation:{value:new Wt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Wt},normalScale:{value:new bn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Mn(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 Mn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0},uvTransform:{value:new Wt}},sprite:{diffuse:{value:new Mn(16777215)},opacity:{value:1},center:{value:new bn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}}},Kr={basic:{uniforms:Ci([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.fog]),vertexShader:$t.meshbasic_vert,fragmentShader:$t.meshbasic_frag},lambert:{uniforms:Ci([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,Ye.lights,{emissive:{value:new Mn(0)},envMapIntensity:{value:1}}]),vertexShader:$t.meshlambert_vert,fragmentShader:$t.meshlambert_frag},phong:{uniforms:Ci([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,Ye.lights,{emissive:{value:new Mn(0)},specular:{value:new Mn(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:$t.meshphong_vert,fragmentShader:$t.meshphong_frag},standard:{uniforms:Ci([Ye.common,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.roughnessmap,Ye.metalnessmap,Ye.fog,Ye.lights,{emissive:{value:new Mn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:$t.meshphysical_vert,fragmentShader:$t.meshphysical_frag},toon:{uniforms:Ci([Ye.common,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.gradientmap,Ye.fog,Ye.lights,{emissive:{value:new Mn(0)}}]),vertexShader:$t.meshtoon_vert,fragmentShader:$t.meshtoon_frag},matcap:{uniforms:Ci([Ye.common,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,{matcap:{value:null}}]),vertexShader:$t.meshmatcap_vert,fragmentShader:$t.meshmatcap_frag},points:{uniforms:Ci([Ye.points,Ye.fog]),vertexShader:$t.points_vert,fragmentShader:$t.points_frag},dashed:{uniforms:Ci([Ye.common,Ye.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:$t.linedashed_vert,fragmentShader:$t.linedashed_frag},depth:{uniforms:Ci([Ye.common,Ye.displacementmap]),vertexShader:$t.depth_vert,fragmentShader:$t.depth_frag},normal:{uniforms:Ci([Ye.common,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,{opacity:{value:1}}]),vertexShader:$t.meshnormal_vert,fragmentShader:$t.meshnormal_frag},sprite:{uniforms:Ci([Ye.sprite,Ye.fog]),vertexShader:$t.sprite_vert,fragmentShader:$t.sprite_frag},background:{uniforms:{uvTransform:{value:new Wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:$t.background_vert,fragmentShader:$t.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Wt}},vertexShader:$t.backgroundCube_vert,fragmentShader:$t.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:$t.cube_vert,fragmentShader:$t.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:$t.equirect_vert,fragmentShader:$t.equirect_frag},distance:{uniforms:Ci([Ye.common,Ye.displacementmap,{referencePosition:{value:new me},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:$t.distance_vert,fragmentShader:$t.distance_frag},shadow:{uniforms:Ci([Ye.lights,Ye.fog,{color:{value:new Mn(0)},opacity:{value:1}}]),vertexShader:$t.shadow_vert,fragmentShader:$t.shadow_frag}};Kr.physical={uniforms:Ci([Kr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Wt},clearcoatNormalScale:{value:new bn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Wt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Wt},sheen:{value:0},sheenColor:{value:new Mn(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Wt},transmissionSamplerSize:{value:new bn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Wt},attenuationDistance:{value:0},attenuationColor:{value:new Mn(0)},specularColor:{value:new Mn(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Wt},anisotropyVector:{value:new bn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Wt}}]),vertexShader:$t.meshphysical_vert,fragmentShader:$t.meshphysical_frag};const vf={r:0,b:0,g:0},Qa=new To,V6=new Yn;function H6(t,e,n,i,r,s){const o=new Mn(0);let c=r===!0?0:1,u,f,h=null,p=0,m=null;function v(M){let A=M.isScene===!0?M.background:null;if(A&&A.isTexture){const T=M.backgroundBlurriness>0;A=e.get(A,T)}return A}function _(M){let A=!1;const T=v(M);T===null?y(o,c):T&&T.isColor&&(y(T,1),A=!0);const D=t.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,s):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,s),(t.autoClear||A)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function w(M,A){const T=v(A);T&&(T.isCubeTexture||T.mapping===Ih)?(f===void 0&&(f=new us(new Nu(1,1,1),new ds({name:"BackgroundCubeMaterial",uniforms:Hl(Kr.backgroundCube.uniforms),vertexShader:Kr.backgroundCube.vertexShader,fragmentShader:Kr.backgroundCube.fragmentShader,side:Gi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(D,I,U){this.matrixWorld.copyPosition(U.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),Qa.copy(A.backgroundRotation),Qa.x*=-1,Qa.y*=-1,Qa.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(Qa.y*=-1,Qa.z*=-1),f.material.uniforms.envMap.value=T,f.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,f.material.uniforms.backgroundRotation.value.setFromMatrix4(V6.makeRotationFromEuler(Qa)),f.material.toneMapped=fn.getTransfer(T.colorSpace)!==wn,(h!==T||p!==T.version||m!==t.toneMapping)&&(f.material.needsUpdate=!0,h=T,p=T.version,m=t.toneMapping),f.layers.enableAll(),M.unshift(f,f.geometry,f.material,0,0,null)):T&&T.isTexture&&(u===void 0&&(u=new us(new Fh(2,2),new ds({name:"BackgroundMaterial",uniforms:Hl(Kr.background.uniforms),vertexShader:Kr.background.vertexShader,fragmentShader:Kr.background.fragmentShader,side:Pa,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=T,u.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,u.material.toneMapped=fn.getTransfer(T.colorSpace)!==wn,T.matrixAutoUpdate===!0&&T.updateMatrix(),u.material.uniforms.uvTransform.value.copy(T.matrix),(h!==T||p!==T.version||m!==t.toneMapping)&&(u.material.needsUpdate=!0,h=T,p=T.version,m=t.toneMapping),u.layers.enableAll(),M.unshift(u,u.geometry,u.material,0,0,null))}function y(M,A){M.getRGB(vf,fR(t)),n.buffers.color.setClear(vf.r,vf.g,vf.b,A,s)}function x(){f!==void 0&&(f.geometry.dispose(),f.material.dispose(),f=void 0),u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0)}return{getClearColor:function(){return o},setClearColor:function(M,A=1){o.set(M),c=A,y(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(M){c=M,y(o,c)},render:_,addToRenderList:w,dispose:x}}function G6(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=m(null);let s=r,o=!1;function c(F,W,X,V,q){let J=!1;const Q=p(F,V,X,W);s!==Q&&(s=Q,f(s.object)),J=v(F,V,X,q),J&&_(F,V,X,q),q!==null&&e.update(q,t.ELEMENT_ARRAY_BUFFER),(J||o)&&(o=!1,T(F,W,X,V),q!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(q).buffer))}function u(){return t.createVertexArray()}function f(F){return t.bindVertexArray(F)}function h(F){return t.deleteVertexArray(F)}function p(F,W,X,V){const q=V.wireframe===!0;let J=i[W.id];J===void 0&&(J={},i[W.id]=J);const Q=F.isInstancedMesh===!0?F.id:0;let $=J[Q];$===void 0&&($={},J[Q]=$);let Y=$[X.id];Y===void 0&&(Y={},$[X.id]=Y);let Z=Y[q];return Z===void 0&&(Z=m(u()),Y[q]=Z),Z}function m(F){const W=[],X=[],V=[];for(let q=0;q<n;q++)W[q]=0,X[q]=0,V[q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:W,enabledAttributes:X,attributeDivisors:V,object:F,attributes:{},index:null}}function v(F,W,X,V){const q=s.attributes,J=W.attributes;let Q=0;const $=X.getAttributes();for(const Y in $)if($[Y].location>=0){const z=q[Y];let ie=J[Y];if(ie===void 0&&(Y==="instanceMatrix"&&F.instanceMatrix&&(ie=F.instanceMatrix),Y==="instanceColor"&&F.instanceColor&&(ie=F.instanceColor)),z===void 0||z.attribute!==ie||ie&&z.data!==ie.data)return!0;Q++}return s.attributesNum!==Q||s.index!==V}function _(F,W,X,V){const q={},J=W.attributes;let Q=0;const $=X.getAttributes();for(const Y in $)if($[Y].location>=0){let z=J[Y];z===void 0&&(Y==="instanceMatrix"&&F.instanceMatrix&&(z=F.instanceMatrix),Y==="instanceColor"&&F.instanceColor&&(z=F.instanceColor));const ie={};ie.attribute=z,z&&z.data&&(ie.data=z.data),q[Y]=ie,Q++}s.attributes=q,s.attributesNum=Q,s.index=V}function w(){const F=s.newAttributes;for(let W=0,X=F.length;W<X;W++)F[W]=0}function y(F){x(F,0)}function x(F,W){const X=s.newAttributes,V=s.enabledAttributes,q=s.attributeDivisors;X[F]=1,V[F]===0&&(t.enableVertexAttribArray(F),V[F]=1),q[F]!==W&&(t.vertexAttribDivisor(F,W),q[F]=W)}function M(){const F=s.newAttributes,W=s.enabledAttributes;for(let X=0,V=W.length;X<V;X++)W[X]!==F[X]&&(t.disableVertexAttribArray(X),W[X]=0)}function A(F,W,X,V,q,J,Q){Q===!0?t.vertexAttribIPointer(F,W,X,q,J):t.vertexAttribPointer(F,W,X,V,q,J)}function T(F,W,X,V){w();const q=V.attributes,J=X.getAttributes(),Q=W.defaultAttributeValues;for(const $ in J){const Y=J[$];if(Y.location>=0){let Z=q[$];if(Z===void 0&&($==="instanceMatrix"&&F.instanceMatrix&&(Z=F.instanceMatrix),$==="instanceColor"&&F.instanceColor&&(Z=F.instanceColor)),Z!==void 0){const z=Z.normalized,ie=Z.itemSize,ve=e.get(Z);if(ve===void 0)continue;const Ee=ve.buffer,Ue=ve.type,le=ve.bytesPerElement,be=Ue===t.INT||Ue===t.UNSIGNED_INT||Z.gpuType===jy;if(Z.isInterleavedBufferAttribute){const Se=Z.data,Ne=Se.stride,et=Z.offset;if(Se.isInstancedInterleavedBuffer){for(let xt=0;xt<Y.locationSize;xt++)x(Y.location+xt,Se.meshPerAttribute);F.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=Se.meshPerAttribute*Se.count)}else for(let xt=0;xt<Y.locationSize;xt++)y(Y.location+xt);t.bindBuffer(t.ARRAY_BUFFER,Ee);for(let xt=0;xt<Y.locationSize;xt++)A(Y.location+xt,ie/Y.locationSize,Ue,z,Ne*le,(et+ie/Y.locationSize*xt)*le,be)}else{if(Z.isInstancedBufferAttribute){for(let Se=0;Se<Y.locationSize;Se++)x(Y.location+Se,Z.meshPerAttribute);F.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=Z.meshPerAttribute*Z.count)}else for(let Se=0;Se<Y.locationSize;Se++)y(Y.location+Se);t.bindBuffer(t.ARRAY_BUFFER,Ee);for(let Se=0;Se<Y.locationSize;Se++)A(Y.location+Se,ie/Y.locationSize,Ue,z,ie*le,ie/Y.locationSize*Se*le,be)}}else if(Q!==void 0){const z=Q[$];if(z!==void 0)switch(z.length){case 2:t.vertexAttrib2fv(Y.location,z);break;case 3:t.vertexAttrib3fv(Y.location,z);break;case 4:t.vertexAttrib4fv(Y.location,z);break;default:t.vertexAttrib1fv(Y.location,z)}}}}M()}function D(){R();for(const F in i){const W=i[F];for(const X in W){const V=W[X];for(const q in V){const J=V[q];for(const Q in J)h(J[Q].object),delete J[Q];delete V[q]}}delete i[F]}}function I(F){if(i[F.id]===void 0)return;const W=i[F.id];for(const X in W){const V=W[X];for(const q in V){const J=V[q];for(const Q in J)h(J[Q].object),delete J[Q];delete V[q]}}delete i[F.id]}function U(F){for(const W in i){const X=i[W];for(const V in X){const q=X[V];if(q[F.id]===void 0)continue;const J=q[F.id];for(const Q in J)h(J[Q].object),delete J[Q];delete q[F.id]}}}function S(F){for(const W in i){const X=i[W],V=F.isInstancedMesh===!0?F.id:0,q=X[V];if(q!==void 0){for(const J in q){const Q=q[J];for(const $ in Q)h(Q[$].object),delete Q[$];delete q[J]}delete X[V],Object.keys(X).length===0&&delete i[W]}}}function R(){H(),o=!0,s!==r&&(s=r,f(s.object))}function H(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:c,reset:R,resetDefaultState:H,dispose:D,releaseStatesOfGeometry:I,releaseStatesOfObject:S,releaseStatesOfProgram:U,initAttributes:w,enableAttribute:y,disableUnusedAttributes:M}}function W6(t,e,n){let i;function r(f){i=f}function s(f,h){t.drawArrays(i,f,h),n.update(h,i,1)}function o(f,h,p){p!==0&&(t.drawArraysInstanced(i,f,h,p),n.update(h,i,p))}function c(f,h,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,f,0,h,0,p);let v=0;for(let _=0;_<p;_++)v+=h[_];n.update(v,i,1)}function u(f,h,p,m){if(p===0)return;const v=e.get("WEBGL_multi_draw");if(v===null)for(let _=0;_<f.length;_++)o(f[_],h[_],m[_]);else{v.multiDrawArraysInstancedWEBGL(i,f,0,h,0,m,0,p);let _=0;for(let w=0;w<p;w++)_+=h[w]*m[w];n.update(_,i,1)}}this.setMode=r,this.render=s,this.renderInstances=o,this.renderMultiDraw=c,this.renderMultiDrawInstances=u}function j6(t,e,n,i){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const U=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(U.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(U){return!(U!==Ur&&i.convert(U)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function c(U){const S=U===Os&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(U!==fr&&i.convert(U)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&U!==Jr&&!S)}function u(U){if(U==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";U="mediump"}return U==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let f=n.precision!==void 0?n.precision:"highp";const h=u(f);h!==f&&(Ht("WebGLRenderer:",f,"not supported, using",h,"instead."),f=h);const p=n.logarithmicDepthBuffer===!0,m=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),v=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),_=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),w=t.getParameter(t.MAX_TEXTURE_SIZE),y=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),x=t.getParameter(t.MAX_VERTEX_ATTRIBS),M=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),A=t.getParameter(t.MAX_VARYING_VECTORS),T=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),D=t.getParameter(t.MAX_SAMPLES),I=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:u,textureFormatReadable:o,textureTypeReadable:c,precision:f,logarithmicDepthBuffer:p,reversedDepthBuffer:m,maxTextures:v,maxVertexTextures:_,maxTextureSize:w,maxCubemapSize:y,maxAttributes:x,maxVertexUniforms:M,maxVaryings:A,maxFragmentUniforms:T,maxSamples:D,samples:I}}function $6(t){const e=this;let n=null,i=0,r=!1,s=!1;const o=new no,c=new Wt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){const v=p.length!==0||m||i!==0||r;return r=m,i=p.length,v},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,m){n=h(p,m,0)},this.setState=function(p,m,v){const _=p.clippingPlanes,w=p.clipIntersection,y=p.clipShadows,x=t.get(p);if(!r||_===null||_.length===0||s&&!y)s?h(null):f();else{const M=s?0:i,A=M*4;let T=x.clippingState||null;u.value=T,T=h(_,m,A,v);for(let D=0;D!==A;++D)T[D]=n[D];x.clippingState=T,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=M}};function f(){u.value!==n&&(u.value=n,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(p,m,v,_){const w=p!==null?p.length:0;let y=null;if(w!==0){if(y=u.value,_!==!0||y===null){const x=v+w*4,M=m.matrixWorldInverse;c.getNormalMatrix(M),(y===null||y.length<x)&&(y=new Float32Array(x));for(let A=0,T=v;A!==w;++A,T+=4)o.copy(p[A]).applyMatrix4(M,c),o.normal.toArray(y,T),y[T+3]=o.constant}u.value=y,u.needsUpdate=!0}return e.numPlanes=w,e.numIntersection=0,y}}const Ma=4,zE=[.125,.215,.35,.446,.526,.582],so=20,X6=256,jc=new t_,VE=new Mn;let Rg=null,Pg=0,kg=0,Lg=!1;const q6=new me;class HE{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,n=0,i=.1,r=100,s={}){const{size:o=256,position:c=q6}=s;Rg=this._renderer.getRenderTarget(),Pg=this._renderer.getActiveCubeFace(),kg=this._renderer.getActiveMipmapLevel(),Lg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const u=this._allocateTargets();return u.depthBuffer=!0,this._sceneToCubeUV(e,i,r,u,c),n>0&&this._blur(u,0,0,n),this._applyPMREM(u),this._cleanup(u),u}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=jE(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=WE(),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(Rg,Pg,kg),this._renderer.xr.enabled=Lg,e.scissorTest=!1,yl(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===Eo||e.mapping===zl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Rg=this._renderer.getRenderTarget(),Pg=this._renderer.getActiveCubeFace(),kg=this._renderer.getActiveMipmapLevel(),Lg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=n||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,i={magFilter:wi,minFilter:wi,generateMipmaps:!1,type:Os,format:Ur,colorSpace:Mo,depthBuffer:!1},r=GE(e,n,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=GE(e,n,i);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=Y6(s)),this._blurMaterial=Z6(s,e,n),this._ggxMaterial=K6(s,e,n)}return r}_compileMaterial(e){const n=new us(new hs,e);this._renderer.compile(n,jc)}_sceneToCubeUV(e,n,i,r,s){const u=new Ir(90,1,n,i),f=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],p=this._renderer,m=p.autoClear,v=p.toneMapping;p.getClearColor(VE),p.toneMapping=ns,p.autoClear=!1,p.state.buffers.depth.getReversed()&&(p.setRenderTarget(r),p.clearDepth(),p.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new us(new Nu,new lR({name:"PMREM.Background",side:Gi,depthWrite:!1,depthTest:!1})));const w=this._backgroundBox,y=w.material;let x=!1;const M=e.background;M?M.isColor&&(y.color.copy(M),e.background=null,x=!0):(y.color.copy(VE),x=!0);for(let A=0;A<6;A++){const T=A%3;T===0?(u.up.set(0,f[A],0),u.position.set(s.x,s.y,s.z),u.lookAt(s.x+h[A],s.y,s.z)):T===1?(u.up.set(0,0,f[A]),u.position.set(s.x,s.y,s.z),u.lookAt(s.x,s.y+h[A],s.z)):(u.up.set(0,f[A],0),u.position.set(s.x,s.y,s.z),u.lookAt(s.x,s.y,s.z+h[A]));const D=this._cubeSize;yl(r,T*D,A>2?D:0,D,D),p.setRenderTarget(r),x&&p.render(w,u),p.render(e,u)}p.toneMapping=v,p.autoClear=m,e.background=M}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===Eo||e.mapping===zl;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=jE()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=WE());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const c=s.uniforms;c.envMap.value=e;const u=this._cubeSize;yl(n,0,0,3*u,2*u),i.setRenderTarget(n),i.render(o,jc)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;s<r;s++)this._applyGGXFilter(e,s-1,s);n.autoClear=i}_applyGGXFilter(e,n,i){const r=this._renderer,s=this._pingPongRenderTarget,o=this._ggxMaterial,c=this._lodMeshes[i];c.material=o;const u=o.uniforms,f=i/(this._lodMeshes.length-1),h=n/(this._lodMeshes.length-1),p=Math.sqrt(f*f-h*h),m=0+f*1.25,v=p*m,{_lodMax:_}=this,w=this._sizeLods[i],y=3*w*(i>_-Ma?i-_+Ma:0),x=4*(this._cubeSize-w);u.envMap.value=e.texture,u.roughness.value=v,u.mipInt.value=_-n,yl(s,y,x,3*w,2*w),r.setRenderTarget(s),r.render(c,jc),u.envMap.value=s.texture,u.roughness.value=0,u.mipInt.value=_-i,yl(e,y,x,3*w,2*w),r.setRenderTarget(e),r.render(c,jc)}_blur(e,n,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,n,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,n,i,r,s,o,c){const u=this._renderer,f=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&_n("blur direction must be either latitudinal or longitudinal!");const h=3,p=this._lodMeshes[r];p.material=f;const m=f.uniforms,v=this._sizeLods[i]-1,_=isFinite(s)?Math.PI/(2*v):2*Math.PI/(2*so-1),w=s/_,y=isFinite(s)?1+Math.floor(h*w):so;y>so&&Ht(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${so}`);const x=[];let M=0;for(let U=0;U<so;++U){const S=U/w,R=Math.exp(-S*S/2);x.push(R),U===0?M+=R:U<y&&(M+=2*R)}for(let U=0;U<x.length;U++)x[U]=x[U]/M;m.envMap.value=e.texture,m.samples.value=y,m.weights.value=x,m.latitudinal.value=o==="latitudinal",c&&(m.poleAxis.value=c);const{_lodMax:A}=this;m.dTheta.value=_,m.mipInt.value=A-i;const T=this._sizeLods[r],D=3*T*(r>A-Ma?r-A+Ma:0),I=4*(this._cubeSize-T);yl(n,D,I,3*T,2*T),u.setRenderTarget(n),u.render(p,jc)}}function Y6(t){const e=[],n=[],i=[];let r=t;const s=t-Ma+1+zE.length;for(let o=0;o<s;o++){const c=Math.pow(2,r);e.push(c);let u=1/c;o>t-Ma?u=zE[o-t+Ma-1]:o===0&&(u=0),n.push(u);const f=1/(c-2),h=-f,p=1+f,m=[h,h,p,h,p,p,h,h,p,p,h,p],v=6,_=6,w=3,y=2,x=1,M=new Float32Array(w*_*v),A=new Float32Array(y*_*v),T=new Float32Array(x*_*v);for(let I=0;I<v;I++){const U=I%3*2/3-1,S=I>2?0:-1,R=[U,S,0,U+2/3,S,0,U+2/3,S+1,0,U,S,0,U+2/3,S+1,0,U,S+1,0];M.set(R,w*_*I),A.set(m,y*_*I);const H=[I,I,I,I,I,I];T.set(H,x*_*I)}const D=new hs;D.setAttribute("position",new zr(M,w)),D.setAttribute("uv",new zr(A,y)),D.setAttribute("faceIndex",new zr(T,x)),i.push(new us(D,null)),r>Ma&&r--}return{lodMeshes:i,sizeLods:e,sigmas:n}}function GE(t,e,n){const i=new is(t,e,n);return i.texture.mapping=Ih,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function yl(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function K6(t,e,n){return new ds({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:X6,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Oh(),fragmentShader:`
|
|
4119
|
+
}`,$t={alphahash_fragment:lG,alphahash_pars_fragment:cG,alphamap_fragment:uG,alphamap_pars_fragment:dG,alphatest_fragment:fG,alphatest_pars_fragment:hG,aomap_fragment:pG,aomap_pars_fragment:mG,batching_pars_vertex:gG,batching_vertex:vG,begin_vertex:yG,beginnormal_vertex:_G,bsdfs:xG,iridescence_fragment:bG,bumpmap_pars_fragment:SG,clipping_planes_fragment:wG,clipping_planes_pars_fragment:EG,clipping_planes_pars_vertex:MG,clipping_planes_vertex:TG,color_fragment:AG,color_pars_fragment:CG,color_pars_vertex:RG,color_vertex:PG,common:kG,cube_uv_reflection_fragment:LG,defaultnormal_vertex:DG,displacementmap_pars_vertex:NG,displacementmap_vertex:IG,emissivemap_fragment:UG,emissivemap_pars_fragment:FG,colorspace_fragment:OG,colorspace_pars_fragment:BG,envmap_fragment:zG,envmap_common_pars_fragment:VG,envmap_pars_fragment:HG,envmap_pars_vertex:GG,envmap_physical_pars_fragment:e8,envmap_vertex:WG,fog_vertex:jG,fog_pars_vertex:$G,fog_fragment:XG,fog_pars_fragment:qG,gradientmap_pars_fragment:YG,lightmap_pars_fragment:KG,lights_lambert_fragment:ZG,lights_lambert_pars_fragment:JG,lights_pars_begin:QG,lights_toon_fragment:t8,lights_toon_pars_fragment:n8,lights_phong_fragment:i8,lights_phong_pars_fragment:r8,lights_physical_fragment:s8,lights_physical_pars_fragment:a8,lights_fragment_begin:o8,lights_fragment_maps:l8,lights_fragment_end:c8,logdepthbuf_fragment:u8,logdepthbuf_pars_fragment:d8,logdepthbuf_pars_vertex:f8,logdepthbuf_vertex:h8,map_fragment:p8,map_pars_fragment:m8,map_particle_fragment:g8,map_particle_pars_fragment:v8,metalnessmap_fragment:y8,metalnessmap_pars_fragment:_8,morphinstance_vertex:x8,morphcolor_vertex:b8,morphnormal_vertex:S8,morphtarget_pars_vertex:w8,morphtarget_vertex:E8,normal_fragment_begin:M8,normal_fragment_maps:T8,normal_pars_fragment:A8,normal_pars_vertex:C8,normal_vertex:R8,normalmap_pars_fragment:P8,clearcoat_normal_fragment_begin:k8,clearcoat_normal_fragment_maps:L8,clearcoat_pars_fragment:D8,iridescence_pars_fragment:N8,opaque_fragment:I8,packing:U8,premultiplied_alpha_fragment:F8,project_vertex:O8,dithering_fragment:B8,dithering_pars_fragment:z8,roughnessmap_fragment:V8,roughnessmap_pars_fragment:H8,shadowmap_pars_fragment:G8,shadowmap_pars_vertex:W8,shadowmap_vertex:j8,shadowmask_pars_fragment:$8,skinbase_vertex:X8,skinning_pars_vertex:q8,skinning_vertex:Y8,skinnormal_vertex:K8,specularmap_fragment:Z8,specularmap_pars_fragment:J8,tonemapping_fragment:Q8,tonemapping_pars_fragment:e6,transmission_fragment:t6,transmission_pars_fragment:n6,uv_pars_fragment:i6,uv_pars_vertex:r6,uv_vertex:s6,worldpos_vertex:a6,background_vert:o6,background_frag:l6,backgroundCube_vert:c6,backgroundCube_frag:u6,cube_vert:d6,cube_frag:f6,depth_vert:h6,depth_frag:p6,distance_vert:m6,distance_frag:g6,equirect_vert:v6,equirect_frag:y6,linedashed_vert:_6,linedashed_frag:x6,meshbasic_vert:b6,meshbasic_frag:S6,meshlambert_vert:w6,meshlambert_frag:E6,meshmatcap_vert:M6,meshmatcap_frag:T6,meshnormal_vert:A6,meshnormal_frag:C6,meshphong_vert:R6,meshphong_frag:P6,meshphysical_vert:k6,meshphysical_frag:L6,meshtoon_vert:D6,meshtoon_frag:N6,points_vert:I6,points_frag:U6,shadow_vert:F6,shadow_frag:O6,sprite_vert:B6,sprite_frag:z6},Ye={common:{diffuse:{value:new Mn(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Wt}},envmap:{envMap:{value:null},envMapRotation:{value:new Wt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Wt},normalScale:{value:new bn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Mn(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 Mn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0},uvTransform:{value:new Wt}},sprite:{diffuse:{value:new Mn(16777215)},opacity:{value:1},center:{value:new bn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Wt},alphaMap:{value:null},alphaMapTransform:{value:new Wt},alphaTest:{value:0}}},Kr={basic:{uniforms:Ci([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.fog]),vertexShader:$t.meshbasic_vert,fragmentShader:$t.meshbasic_frag},lambert:{uniforms:Ci([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,Ye.lights,{emissive:{value:new Mn(0)},envMapIntensity:{value:1}}]),vertexShader:$t.meshlambert_vert,fragmentShader:$t.meshlambert_frag},phong:{uniforms:Ci([Ye.common,Ye.specularmap,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,Ye.lights,{emissive:{value:new Mn(0)},specular:{value:new Mn(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:$t.meshphong_vert,fragmentShader:$t.meshphong_frag},standard:{uniforms:Ci([Ye.common,Ye.envmap,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.roughnessmap,Ye.metalnessmap,Ye.fog,Ye.lights,{emissive:{value:new Mn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:$t.meshphysical_vert,fragmentShader:$t.meshphysical_frag},toon:{uniforms:Ci([Ye.common,Ye.aomap,Ye.lightmap,Ye.emissivemap,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.gradientmap,Ye.fog,Ye.lights,{emissive:{value:new Mn(0)}}]),vertexShader:$t.meshtoon_vert,fragmentShader:$t.meshtoon_frag},matcap:{uniforms:Ci([Ye.common,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,Ye.fog,{matcap:{value:null}}]),vertexShader:$t.meshmatcap_vert,fragmentShader:$t.meshmatcap_frag},points:{uniforms:Ci([Ye.points,Ye.fog]),vertexShader:$t.points_vert,fragmentShader:$t.points_frag},dashed:{uniforms:Ci([Ye.common,Ye.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:$t.linedashed_vert,fragmentShader:$t.linedashed_frag},depth:{uniforms:Ci([Ye.common,Ye.displacementmap]),vertexShader:$t.depth_vert,fragmentShader:$t.depth_frag},normal:{uniforms:Ci([Ye.common,Ye.bumpmap,Ye.normalmap,Ye.displacementmap,{opacity:{value:1}}]),vertexShader:$t.meshnormal_vert,fragmentShader:$t.meshnormal_frag},sprite:{uniforms:Ci([Ye.sprite,Ye.fog]),vertexShader:$t.sprite_vert,fragmentShader:$t.sprite_frag},background:{uniforms:{uvTransform:{value:new Wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:$t.background_vert,fragmentShader:$t.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Wt}},vertexShader:$t.backgroundCube_vert,fragmentShader:$t.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:$t.cube_vert,fragmentShader:$t.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:$t.equirect_vert,fragmentShader:$t.equirect_frag},distance:{uniforms:Ci([Ye.common,Ye.displacementmap,{referencePosition:{value:new me},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:$t.distance_vert,fragmentShader:$t.distance_frag},shadow:{uniforms:Ci([Ye.lights,Ye.fog,{color:{value:new Mn(0)},opacity:{value:1}}]),vertexShader:$t.shadow_vert,fragmentShader:$t.shadow_frag}};Kr.physical={uniforms:Ci([Kr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Wt},clearcoatNormalScale:{value:new bn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Wt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Wt},sheen:{value:0},sheenColor:{value:new Mn(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Wt},transmissionSamplerSize:{value:new bn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Wt},attenuationDistance:{value:0},attenuationColor:{value:new Mn(0)},specularColor:{value:new Mn(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Wt},anisotropyVector:{value:new bn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Wt}}]),vertexShader:$t.meshphysical_vert,fragmentShader:$t.meshphysical_frag};const vf={r:0,b:0,g:0},Qa=new To,V6=new Yn;function H6(t,e,n,i,r,s){const o=new Mn(0);let c=r===!0?0:1,u,f,h=null,p=0,m=null;function v(M){let A=M.isScene===!0?M.background:null;if(A&&A.isTexture){const T=M.backgroundBlurriness>0;A=e.get(A,T)}return A}function _(M){let A=!1;const T=v(M);T===null?y(o,c):T&&T.isColor&&(y(T,1),A=!0);const D=t.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,s):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,s),(t.autoClear||A)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function w(M,A){const T=v(A);T&&(T.isCubeTexture||T.mapping===Ih)?(f===void 0&&(f=new us(new Nu(1,1,1),new ds({name:"BackgroundCubeMaterial",uniforms:Hl(Kr.backgroundCube.uniforms),vertexShader:Kr.backgroundCube.vertexShader,fragmentShader:Kr.backgroundCube.fragmentShader,side:Gi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),f.geometry.deleteAttribute("normal"),f.geometry.deleteAttribute("uv"),f.onBeforeRender=function(D,I,U){this.matrixWorld.copyPosition(U.matrixWorld)},Object.defineProperty(f.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(f)),Qa.copy(A.backgroundRotation),Qa.x*=-1,Qa.y*=-1,Qa.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(Qa.y*=-1,Qa.z*=-1),f.material.uniforms.envMap.value=T,f.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,f.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,f.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,f.material.uniforms.backgroundRotation.value.setFromMatrix4(V6.makeRotationFromEuler(Qa)),f.material.toneMapped=fn.getTransfer(T.colorSpace)!==wn,(h!==T||p!==T.version||m!==t.toneMapping)&&(f.material.needsUpdate=!0,h=T,p=T.version,m=t.toneMapping),f.layers.enableAll(),M.unshift(f,f.geometry,f.material,0,0,null)):T&&T.isTexture&&(u===void 0&&(u=new us(new Fh(2,2),new ds({name:"BackgroundMaterial",uniforms:Hl(Kr.background.uniforms),vertexShader:Kr.background.vertexShader,fragmentShader:Kr.background.fragmentShader,side:Pa,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=T,u.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,u.material.toneMapped=fn.getTransfer(T.colorSpace)!==wn,T.matrixAutoUpdate===!0&&T.updateMatrix(),u.material.uniforms.uvTransform.value.copy(T.matrix),(h!==T||p!==T.version||m!==t.toneMapping)&&(u.material.needsUpdate=!0,h=T,p=T.version,m=t.toneMapping),u.layers.enableAll(),M.unshift(u,u.geometry,u.material,0,0,null))}function y(M,A){M.getRGB(vf,fR(t)),n.buffers.color.setClear(vf.r,vf.g,vf.b,A,s)}function x(){f!==void 0&&(f.geometry.dispose(),f.material.dispose(),f=void 0),u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0)}return{getClearColor:function(){return o},setClearColor:function(M,A=1){o.set(M),c=A,y(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(M){c=M,y(o,c)},render:_,addToRenderList:w,dispose:x}}function G6(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=m(null);let s=r,o=!1;function c(F,W,X,V,q){let J=!1;const Q=p(F,V,X,W);s!==Q&&(s=Q,f(s.object)),J=v(F,V,X,q),J&&_(F,V,X,q),q!==null&&e.update(q,t.ELEMENT_ARRAY_BUFFER),(J||o)&&(o=!1,T(F,W,X,V),q!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(q).buffer))}function u(){return t.createVertexArray()}function f(F){return t.bindVertexArray(F)}function h(F){return t.deleteVertexArray(F)}function p(F,W,X,V){const q=V.wireframe===!0;let J=i[W.id];J===void 0&&(J={},i[W.id]=J);const Q=F.isInstancedMesh===!0?F.id:0;let $=J[Q];$===void 0&&($={},J[Q]=$);let Y=$[X.id];Y===void 0&&(Y={},$[X.id]=Y);let Z=Y[q];return Z===void 0&&(Z=m(u()),Y[q]=Z),Z}function m(F){const W=[],X=[],V=[];for(let q=0;q<n;q++)W[q]=0,X[q]=0,V[q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:W,enabledAttributes:X,attributeDivisors:V,object:F,attributes:{},index:null}}function v(F,W,X,V){const q=s.attributes,J=W.attributes;let Q=0;const $=X.getAttributes();for(const Y in $)if($[Y].location>=0){const z=q[Y];let ie=J[Y];if(ie===void 0&&(Y==="instanceMatrix"&&F.instanceMatrix&&(ie=F.instanceMatrix),Y==="instanceColor"&&F.instanceColor&&(ie=F.instanceColor)),z===void 0||z.attribute!==ie||ie&&z.data!==ie.data)return!0;Q++}return s.attributesNum!==Q||s.index!==V}function _(F,W,X,V){const q={},J=W.attributes;let Q=0;const $=X.getAttributes();for(const Y in $)if($[Y].location>=0){let z=J[Y];z===void 0&&(Y==="instanceMatrix"&&F.instanceMatrix&&(z=F.instanceMatrix),Y==="instanceColor"&&F.instanceColor&&(z=F.instanceColor));const ie={};ie.attribute=z,z&&z.data&&(ie.data=z.data),q[Y]=ie,Q++}s.attributes=q,s.attributesNum=Q,s.index=V}function w(){const F=s.newAttributes;for(let W=0,X=F.length;W<X;W++)F[W]=0}function y(F){x(F,0)}function x(F,W){const X=s.newAttributes,V=s.enabledAttributes,q=s.attributeDivisors;X[F]=1,V[F]===0&&(t.enableVertexAttribArray(F),V[F]=1),q[F]!==W&&(t.vertexAttribDivisor(F,W),q[F]=W)}function M(){const F=s.newAttributes,W=s.enabledAttributes;for(let X=0,V=W.length;X<V;X++)W[X]!==F[X]&&(t.disableVertexAttribArray(X),W[X]=0)}function A(F,W,X,V,q,J,Q){Q===!0?t.vertexAttribIPointer(F,W,X,q,J):t.vertexAttribPointer(F,W,X,V,q,J)}function T(F,W,X,V){w();const q=V.attributes,J=X.getAttributes(),Q=W.defaultAttributeValues;for(const $ in J){const Y=J[$];if(Y.location>=0){let Z=q[$];if(Z===void 0&&($==="instanceMatrix"&&F.instanceMatrix&&(Z=F.instanceMatrix),$==="instanceColor"&&F.instanceColor&&(Z=F.instanceColor)),Z!==void 0){const z=Z.normalized,ie=Z.itemSize,_e=e.get(Z);if(_e===void 0)continue;const Ee=_e.buffer,Ue=_e.type,le=_e.bytesPerElement,be=Ue===t.INT||Ue===t.UNSIGNED_INT||Z.gpuType===jy;if(Z.isInterleavedBufferAttribute){const Se=Z.data,Ne=Se.stride,et=Z.offset;if(Se.isInstancedInterleavedBuffer){for(let xt=0;xt<Y.locationSize;xt++)x(Y.location+xt,Se.meshPerAttribute);F.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=Se.meshPerAttribute*Se.count)}else for(let xt=0;xt<Y.locationSize;xt++)y(Y.location+xt);t.bindBuffer(t.ARRAY_BUFFER,Ee);for(let xt=0;xt<Y.locationSize;xt++)A(Y.location+xt,ie/Y.locationSize,Ue,z,Ne*le,(et+ie/Y.locationSize*xt)*le,be)}else{if(Z.isInstancedBufferAttribute){for(let Se=0;Se<Y.locationSize;Se++)x(Y.location+Se,Z.meshPerAttribute);F.isInstancedMesh!==!0&&V._maxInstanceCount===void 0&&(V._maxInstanceCount=Z.meshPerAttribute*Z.count)}else for(let Se=0;Se<Y.locationSize;Se++)y(Y.location+Se);t.bindBuffer(t.ARRAY_BUFFER,Ee);for(let Se=0;Se<Y.locationSize;Se++)A(Y.location+Se,ie/Y.locationSize,Ue,z,ie*le,ie/Y.locationSize*Se*le,be)}}else if(Q!==void 0){const z=Q[$];if(z!==void 0)switch(z.length){case 2:t.vertexAttrib2fv(Y.location,z);break;case 3:t.vertexAttrib3fv(Y.location,z);break;case 4:t.vertexAttrib4fv(Y.location,z);break;default:t.vertexAttrib1fv(Y.location,z)}}}}M()}function D(){R();for(const F in i){const W=i[F];for(const X in W){const V=W[X];for(const q in V){const J=V[q];for(const Q in J)h(J[Q].object),delete J[Q];delete V[q]}}delete i[F]}}function I(F){if(i[F.id]===void 0)return;const W=i[F.id];for(const X in W){const V=W[X];for(const q in V){const J=V[q];for(const Q in J)h(J[Q].object),delete J[Q];delete V[q]}}delete i[F.id]}function U(F){for(const W in i){const X=i[W];for(const V in X){const q=X[V];if(q[F.id]===void 0)continue;const J=q[F.id];for(const Q in J)h(J[Q].object),delete J[Q];delete q[F.id]}}}function S(F){for(const W in i){const X=i[W],V=F.isInstancedMesh===!0?F.id:0,q=X[V];if(q!==void 0){for(const J in q){const Q=q[J];for(const $ in Q)h(Q[$].object),delete Q[$];delete q[J]}delete X[V],Object.keys(X).length===0&&delete i[W]}}}function R(){H(),o=!0,s!==r&&(s=r,f(s.object))}function H(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:c,reset:R,resetDefaultState:H,dispose:D,releaseStatesOfGeometry:I,releaseStatesOfObject:S,releaseStatesOfProgram:U,initAttributes:w,enableAttribute:y,disableUnusedAttributes:M}}function W6(t,e,n){let i;function r(f){i=f}function s(f,h){t.drawArrays(i,f,h),n.update(h,i,1)}function o(f,h,p){p!==0&&(t.drawArraysInstanced(i,f,h,p),n.update(h,i,p))}function c(f,h,p){if(p===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,f,0,h,0,p);let v=0;for(let _=0;_<p;_++)v+=h[_];n.update(v,i,1)}function u(f,h,p,m){if(p===0)return;const v=e.get("WEBGL_multi_draw");if(v===null)for(let _=0;_<f.length;_++)o(f[_],h[_],m[_]);else{v.multiDrawArraysInstancedWEBGL(i,f,0,h,0,m,0,p);let _=0;for(let w=0;w<p;w++)_+=h[w]*m[w];n.update(_,i,1)}}this.setMode=r,this.render=s,this.renderInstances=o,this.renderMultiDraw=c,this.renderMultiDrawInstances=u}function j6(t,e,n,i){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const U=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(U.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(U){return!(U!==Ur&&i.convert(U)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function c(U){const S=U===Os&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(U!==fr&&i.convert(U)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&U!==Jr&&!S)}function u(U){if(U==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";U="mediump"}return U==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let f=n.precision!==void 0?n.precision:"highp";const h=u(f);h!==f&&(Ht("WebGLRenderer:",f,"not supported, using",h,"instead."),f=h);const p=n.logarithmicDepthBuffer===!0,m=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),v=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),_=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),w=t.getParameter(t.MAX_TEXTURE_SIZE),y=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),x=t.getParameter(t.MAX_VERTEX_ATTRIBS),M=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),A=t.getParameter(t.MAX_VARYING_VECTORS),T=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),D=t.getParameter(t.MAX_SAMPLES),I=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:u,textureFormatReadable:o,textureTypeReadable:c,precision:f,logarithmicDepthBuffer:p,reversedDepthBuffer:m,maxTextures:v,maxVertexTextures:_,maxTextureSize:w,maxCubemapSize:y,maxAttributes:x,maxVertexUniforms:M,maxVaryings:A,maxFragmentUniforms:T,maxSamples:D,samples:I}}function $6(t){const e=this;let n=null,i=0,r=!1,s=!1;const o=new no,c=new Wt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){const v=p.length!==0||m||i!==0||r;return r=m,i=p.length,v},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,m){n=h(p,m,0)},this.setState=function(p,m,v){const _=p.clippingPlanes,w=p.clipIntersection,y=p.clipShadows,x=t.get(p);if(!r||_===null||_.length===0||s&&!y)s?h(null):f();else{const M=s?0:i,A=M*4;let T=x.clippingState||null;u.value=T,T=h(_,m,A,v);for(let D=0;D!==A;++D)T[D]=n[D];x.clippingState=T,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=M}};function f(){u.value!==n&&(u.value=n,u.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(p,m,v,_){const w=p!==null?p.length:0;let y=null;if(w!==0){if(y=u.value,_!==!0||y===null){const x=v+w*4,M=m.matrixWorldInverse;c.getNormalMatrix(M),(y===null||y.length<x)&&(y=new Float32Array(x));for(let A=0,T=v;A!==w;++A,T+=4)o.copy(p[A]).applyMatrix4(M,c),o.normal.toArray(y,T),y[T+3]=o.constant}u.value=y,u.needsUpdate=!0}return e.numPlanes=w,e.numIntersection=0,y}}const Ma=4,zE=[.125,.215,.35,.446,.526,.582],so=20,X6=256,jc=new t_,VE=new Mn;let Rg=null,Pg=0,kg=0,Lg=!1;const q6=new me;class HE{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,n=0,i=.1,r=100,s={}){const{size:o=256,position:c=q6}=s;Rg=this._renderer.getRenderTarget(),Pg=this._renderer.getActiveCubeFace(),kg=this._renderer.getActiveMipmapLevel(),Lg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const u=this._allocateTargets();return u.depthBuffer=!0,this._sceneToCubeUV(e,i,r,u,c),n>0&&this._blur(u,0,0,n),this._applyPMREM(u),this._cleanup(u),u}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=jE(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=WE(),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(Rg,Pg,kg),this._renderer.xr.enabled=Lg,e.scissorTest=!1,yl(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===Eo||e.mapping===zl?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Rg=this._renderer.getRenderTarget(),Pg=this._renderer.getActiveCubeFace(),kg=this._renderer.getActiveMipmapLevel(),Lg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=n||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,i={magFilter:wi,minFilter:wi,generateMipmaps:!1,type:Os,format:Ur,colorSpace:Mo,depthBuffer:!1},r=GE(e,n,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=GE(e,n,i);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=Y6(s)),this._blurMaterial=Z6(s,e,n),this._ggxMaterial=K6(s,e,n)}return r}_compileMaterial(e){const n=new us(new hs,e);this._renderer.compile(n,jc)}_sceneToCubeUV(e,n,i,r,s){const u=new Ir(90,1,n,i),f=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],p=this._renderer,m=p.autoClear,v=p.toneMapping;p.getClearColor(VE),p.toneMapping=ns,p.autoClear=!1,p.state.buffers.depth.getReversed()&&(p.setRenderTarget(r),p.clearDepth(),p.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new us(new Nu,new lR({name:"PMREM.Background",side:Gi,depthWrite:!1,depthTest:!1})));const w=this._backgroundBox,y=w.material;let x=!1;const M=e.background;M?M.isColor&&(y.color.copy(M),e.background=null,x=!0):(y.color.copy(VE),x=!0);for(let A=0;A<6;A++){const T=A%3;T===0?(u.up.set(0,f[A],0),u.position.set(s.x,s.y,s.z),u.lookAt(s.x+h[A],s.y,s.z)):T===1?(u.up.set(0,0,f[A]),u.position.set(s.x,s.y,s.z),u.lookAt(s.x,s.y+h[A],s.z)):(u.up.set(0,f[A],0),u.position.set(s.x,s.y,s.z),u.lookAt(s.x,s.y,s.z+h[A]));const D=this._cubeSize;yl(r,T*D,A>2?D:0,D,D),p.setRenderTarget(r),x&&p.render(w,u),p.render(e,u)}p.toneMapping=v,p.autoClear=m,e.background=M}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===Eo||e.mapping===zl;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=jE()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=WE());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const c=s.uniforms;c.envMap.value=e;const u=this._cubeSize;yl(n,0,0,3*u,2*u),i.setRenderTarget(n),i.render(o,jc)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;s<r;s++)this._applyGGXFilter(e,s-1,s);n.autoClear=i}_applyGGXFilter(e,n,i){const r=this._renderer,s=this._pingPongRenderTarget,o=this._ggxMaterial,c=this._lodMeshes[i];c.material=o;const u=o.uniforms,f=i/(this._lodMeshes.length-1),h=n/(this._lodMeshes.length-1),p=Math.sqrt(f*f-h*h),m=0+f*1.25,v=p*m,{_lodMax:_}=this,w=this._sizeLods[i],y=3*w*(i>_-Ma?i-_+Ma:0),x=4*(this._cubeSize-w);u.envMap.value=e.texture,u.roughness.value=v,u.mipInt.value=_-n,yl(s,y,x,3*w,2*w),r.setRenderTarget(s),r.render(c,jc),u.envMap.value=s.texture,u.roughness.value=0,u.mipInt.value=_-i,yl(e,y,x,3*w,2*w),r.setRenderTarget(e),r.render(c,jc)}_blur(e,n,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,n,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,n,i,r,s,o,c){const u=this._renderer,f=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&_n("blur direction must be either latitudinal or longitudinal!");const h=3,p=this._lodMeshes[r];p.material=f;const m=f.uniforms,v=this._sizeLods[i]-1,_=isFinite(s)?Math.PI/(2*v):2*Math.PI/(2*so-1),w=s/_,y=isFinite(s)?1+Math.floor(h*w):so;y>so&&Ht(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${so}`);const x=[];let M=0;for(let U=0;U<so;++U){const S=U/w,R=Math.exp(-S*S/2);x.push(R),U===0?M+=R:U<y&&(M+=2*R)}for(let U=0;U<x.length;U++)x[U]=x[U]/M;m.envMap.value=e.texture,m.samples.value=y,m.weights.value=x,m.latitudinal.value=o==="latitudinal",c&&(m.poleAxis.value=c);const{_lodMax:A}=this;m.dTheta.value=_,m.mipInt.value=A-i;const T=this._sizeLods[r],D=3*T*(r>A-Ma?r-A+Ma:0),I=4*(this._cubeSize-T);yl(n,D,I,3*T,2*T),u.setRenderTarget(n),u.render(p,jc)}}function Y6(t){const e=[],n=[],i=[];let r=t;const s=t-Ma+1+zE.length;for(let o=0;o<s;o++){const c=Math.pow(2,r);e.push(c);let u=1/c;o>t-Ma?u=zE[o-t+Ma-1]:o===0&&(u=0),n.push(u);const f=1/(c-2),h=-f,p=1+f,m=[h,h,p,h,p,p,h,h,p,p,h,p],v=6,_=6,w=3,y=2,x=1,M=new Float32Array(w*_*v),A=new Float32Array(y*_*v),T=new Float32Array(x*_*v);for(let I=0;I<v;I++){const U=I%3*2/3-1,S=I>2?0:-1,R=[U,S,0,U+2/3,S,0,U+2/3,S+1,0,U,S,0,U+2/3,S+1,0,U,S+1,0];M.set(R,w*_*I),A.set(m,y*_*I);const H=[I,I,I,I,I,I];T.set(H,x*_*I)}const D=new hs;D.setAttribute("position",new zr(M,w)),D.setAttribute("uv",new zr(A,y)),D.setAttribute("faceIndex",new zr(T,x)),i.push(new us(D,null)),r>Ma&&r--}return{lodMeshes:i,sizeLods:e,sigmas:n}}function GE(t,e,n){const i=new is(t,e,n);return i.texture.mapping=Ih,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function yl(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function K6(t,e,n){return new ds({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:X6,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Oh(),fragmentShader:`
|
|
4120
4120
|
|
|
4121
4121
|
precision highp float;
|
|
4122
4122
|
precision highp int;
|
|
@@ -4502,7 +4502,7 @@ Material Type: `+F.type+`
|
|
|
4502
4502
|
|
|
4503
4503
|
Program Info Log: `+q+`
|
|
4504
4504
|
`+Z+`
|
|
4505
|
-
`+z)}else q!==""?Ht("WebGLProgram: Program Info Log:",q):(J===""||Q==="")&&(Y=!1);Y&&(F.diagnostics={runnable:$,programLog:q,vertexShader:{log:J,prefix:y},fragmentShader:{log:Q,prefix:x}})}r.deleteShader(D),r.deleteShader(I),S=new Hf(r,w),R=oW(r,w)}let S;this.getUniforms=function(){return S===void 0&&U(this),S};let R;this.getAttributes=function(){return R===void 0&&U(this),R};let H=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return H===!1&&(H=r.getProgramParameter(w,Z9)),H},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(w),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=J9++,this.cacheKey=e,this.usedTimes=1,this.program=w,this.vertexShader=D,this.fragmentShader=I,this}let wW=0;class EW{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new MW(e),n.set(e,i)),i}}class MW{constructor(e){this.id=wW++,this.code=e,this.usedTimes=0}}function TW(t,e,n,i,r,s){const o=new rR,c=new EW,u=new Set,f=[],h=new Map,p=i.logarithmicDepthBuffer;let m=i.precision;const v={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 _(S){return u.add(S),S===0?"uv":`uv${S}`}function w(S,R,H,F,W){const X=F.fog,V=W.geometry,q=S.isMeshStandardMaterial||S.isMeshLambertMaterial||S.isMeshPhongMaterial?F.environment:null,J=S.isMeshStandardMaterial||S.isMeshLambertMaterial&&!S.envMap||S.isMeshPhongMaterial&&!S.envMap,Q=e.get(S.envMap||q,J),$=Q&&Q.mapping===Ih?Q.image.height:null,Y=v[S.type];S.precision!==null&&(m=i.getMaxPrecision(S.precision),m!==S.precision&&Ht("WebGLProgram.getParameters:",S.precision,"not supported, using",m,"instead."));const Z=V.morphAttributes.position||V.morphAttributes.normal||V.morphAttributes.color,z=Z!==void 0?Z.length:0;let ie=0;V.morphAttributes.position!==void 0&&(ie=1),V.morphAttributes.normal!==void 0&&(ie=2),V.morphAttributes.color!==void 0&&(ie=3);let ve,Ee,Ue,le;if(Y){const Kt=Kr[Y];ve=Kt.vertexShader,Ee=Kt.fragmentShader}else ve=S.vertexShader,Ee=S.fragmentShader,c.update(S),Ue=c.getVertexShaderID(S),le=c.getFragmentShaderID(S);const be=t.getRenderTarget(),Se=t.state.buffers.depth.getReversed(),Ne=W.isInstancedMesh===!0,et=W.isBatchedMesh===!0,xt=!!S.map,pn=!!S.matcap,ht=!!Q,Ut=!!S.aoMap,nn=!!S.lightMap,Lt=!!S.bumpMap,an=!!S.normalMap,ee=!!S.displacementMap,Sn=!!S.emissiveMap,At=!!S.metalnessMap,kt=!!S.roughnessMap,it=S.anisotropy>0,O=S.clearcoat>0,P=S.dispersion>0,re=S.iridescence>0,xe=S.sheen>0,we=S.transmission>0,ye=it&&!!S.anisotropyMap,Ke=O&&!!S.clearcoatMap,ke=O&&!!S.clearcoatNormalMap,pt=O&&!!S.clearcoatRoughnessMap,Ct=re&&!!S.iridescenceMap,Re=re&&!!S.iridescenceThicknessMap,Be=xe&&!!S.sheenColorMap,Ze=xe&&!!S.sheenRoughnessMap,rt=!!S.specularMap,$e=!!S.specularColorMap,Vt=!!S.specularIntensityMap,ne=we&&!!S.transmissionMap,Ve=we&&!!S.thicknessMap,Le=!!S.gradientMap,Xe=!!S.alphaMap,Pe=S.alphaTest>0,_e=!!S.alphaHash,st=!!S.extensions;let Dt=ns;S.toneMapped&&(be===null||be.isXRRenderTarget===!0)&&(Dt=t.toneMapping);const mn={shaderID:Y,shaderType:S.type,shaderName:S.name,vertexShader:ve,fragmentShader:Ee,defines:S.defines,customVertexShaderID:Ue,customFragmentShaderID:le,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:m,batching:et,batchingColor:et&&W._colorsTexture!==null,instancing:Ne,instancingColor:Ne&&W.instanceColor!==null,instancingMorph:Ne&&W.morphTexture!==null,outputColorSpace:be===null?t.outputColorSpace:be.isXRRenderTarget===!0?be.texture.colorSpace:Mo,alphaToCoverage:!!S.alphaToCoverage,map:xt,matcap:pn,envMap:ht,envMapMode:ht&&Q.mapping,envMapCubeUVHeight:$,aoMap:Ut,lightMap:nn,bumpMap:Lt,normalMap:an,displacementMap:ee,emissiveMap:Sn,normalMapObjectSpace:an&&S.normalMapType===pH,normalMapTangentSpace:an&&S.normalMapType===hH,metalnessMap:At,roughnessMap:kt,anisotropy:it,anisotropyMap:ye,clearcoat:O,clearcoatMap:Ke,clearcoatNormalMap:ke,clearcoatRoughnessMap:pt,dispersion:P,iridescence:re,iridescenceMap:Ct,iridescenceThicknessMap:Re,sheen:xe,sheenColorMap:Be,sheenRoughnessMap:Ze,specularMap:rt,specularColorMap:$e,specularIntensityMap:Vt,transmission:we,transmissionMap:ne,thicknessMap:Ve,gradientMap:Le,opaque:S.transparent===!1&&S.blending===vo&&S.alphaToCoverage===!1,alphaMap:Xe,alphaTest:Pe,alphaHash:_e,combine:S.combine,mapUv:xt&&_(S.map.channel),aoMapUv:Ut&&_(S.aoMap.channel),lightMapUv:nn&&_(S.lightMap.channel),bumpMapUv:Lt&&_(S.bumpMap.channel),normalMapUv:an&&_(S.normalMap.channel),displacementMapUv:ee&&_(S.displacementMap.channel),emissiveMapUv:Sn&&_(S.emissiveMap.channel),metalnessMapUv:At&&_(S.metalnessMap.channel),roughnessMapUv:kt&&_(S.roughnessMap.channel),anisotropyMapUv:ye&&_(S.anisotropyMap.channel),clearcoatMapUv:Ke&&_(S.clearcoatMap.channel),clearcoatNormalMapUv:ke&&_(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pt&&_(S.clearcoatRoughnessMap.channel),iridescenceMapUv:Ct&&_(S.iridescenceMap.channel),iridescenceThicknessMapUv:Re&&_(S.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&_(S.sheenColorMap.channel),sheenRoughnessMapUv:Ze&&_(S.sheenRoughnessMap.channel),specularMapUv:rt&&_(S.specularMap.channel),specularColorMapUv:$e&&_(S.specularColorMap.channel),specularIntensityMapUv:Vt&&_(S.specularIntensityMap.channel),transmissionMapUv:ne&&_(S.transmissionMap.channel),thicknessMapUv:Ve&&_(S.thicknessMap.channel),alphaMapUv:Xe&&_(S.alphaMap.channel),vertexTangents:!!V.attributes.tangent&&(an||it),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!V.attributes.color&&V.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!V.attributes.uv&&(xt||Xe),fog:!!X,useFog:S.fog===!0,fogExp2:!!X&&X.isFogExp2,flatShading:S.wireframe===!1&&(S.flatShading===!0||V.attributes.normal===void 0&&an===!1&&(S.isMeshLambertMaterial||S.isMeshPhongMaterial||S.isMeshStandardMaterial||S.isMeshPhysicalMaterial)),sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:p,reversedDepthBuffer:Se,skinning:W.isSkinnedMesh===!0,morphTargets:V.morphAttributes.position!==void 0,morphNormals:V.morphAttributes.normal!==void 0,morphColors:V.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:ie,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:S.dithering,shadowMapEnabled:t.shadowMap.enabled&&H.length>0,shadowMapType:t.shadowMap.type,toneMapping:Dt,decodeVideoTexture:xt&&S.map.isVideoTexture===!0&&fn.getTransfer(S.map.colorSpace)===wn,decodeVideoTextureEmissive:Sn&&S.emissiveMap.isVideoTexture===!0&&fn.getTransfer(S.emissiveMap.colorSpace)===wn,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===ks,flipSided:S.side===Gi,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:st&&S.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(st&&S.extensions.multiDraw===!0||et)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return mn.vertexUv1s=u.has(1),mn.vertexUv2s=u.has(2),mn.vertexUv3s=u.has(3),u.clear(),mn}function y(S){const R=[];if(S.shaderID?R.push(S.shaderID):(R.push(S.customVertexShaderID),R.push(S.customFragmentShaderID)),S.defines!==void 0)for(const H in S.defines)R.push(H),R.push(S.defines[H]);return S.isRawShaderMaterial===!1&&(x(R,S),M(R,S),R.push(t.outputColorSpace)),R.push(S.customProgramCacheKey),R.join()}function x(S,R){S.push(R.precision),S.push(R.outputColorSpace),S.push(R.envMapMode),S.push(R.envMapCubeUVHeight),S.push(R.mapUv),S.push(R.alphaMapUv),S.push(R.lightMapUv),S.push(R.aoMapUv),S.push(R.bumpMapUv),S.push(R.normalMapUv),S.push(R.displacementMapUv),S.push(R.emissiveMapUv),S.push(R.metalnessMapUv),S.push(R.roughnessMapUv),S.push(R.anisotropyMapUv),S.push(R.clearcoatMapUv),S.push(R.clearcoatNormalMapUv),S.push(R.clearcoatRoughnessMapUv),S.push(R.iridescenceMapUv),S.push(R.iridescenceThicknessMapUv),S.push(R.sheenColorMapUv),S.push(R.sheenRoughnessMapUv),S.push(R.specularMapUv),S.push(R.specularColorMapUv),S.push(R.specularIntensityMapUv),S.push(R.transmissionMapUv),S.push(R.thicknessMapUv),S.push(R.combine),S.push(R.fogExp2),S.push(R.sizeAttenuation),S.push(R.morphTargetsCount),S.push(R.morphAttributeCount),S.push(R.numDirLights),S.push(R.numPointLights),S.push(R.numSpotLights),S.push(R.numSpotLightMaps),S.push(R.numHemiLights),S.push(R.numRectAreaLights),S.push(R.numDirLightShadows),S.push(R.numPointLightShadows),S.push(R.numSpotLightShadows),S.push(R.numSpotLightShadowsWithMaps),S.push(R.numLightProbes),S.push(R.shadowMapType),S.push(R.toneMapping),S.push(R.numClippingPlanes),S.push(R.numClipIntersection),S.push(R.depthPacking)}function M(S,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),S.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),S.push(o.mask)}function A(S){const R=v[S.type];let H;if(R){const F=Kr[R];H=JH.clone(F.uniforms)}else H=S.uniforms;return H}function T(S,R){let H=h.get(R);return H!==void 0?++H.usedTimes:(H=new SW(t,R,S,r),f.push(H),h.set(R,H)),H}function D(S){if(--S.usedTimes===0){const R=f.indexOf(S);f[R]=f[f.length-1],f.pop(),h.delete(S.cacheKey),S.destroy()}}function I(S){c.remove(S)}function U(){c.dispose()}return{getParameters:w,getProgramCacheKey:y,getUniforms:A,acquireProgram:T,releaseProgram:D,releaseShaderCache:I,programs:f,dispose:U}}function AW(){let t=new WeakMap;function e(o){return t.has(o)}function n(o){let c=t.get(o);return c===void 0&&(c={},t.set(o,c)),c}function i(o){t.delete(o)}function r(o,c,u){t.get(o)[c]=u}function s(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:s}}function CW(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.materialVariant!==e.materialVariant?t.materialVariant-e.materialVariant:t.z!==e.z?t.z-e.z:t.id-e.id}function s1(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function a1(){const t=[];let e=0;const n=[],i=[],r=[];function s(){e=0,n.length=0,i.length=0,r.length=0}function o(m){let v=0;return m.isInstancedMesh&&(v+=2),m.isSkinnedMesh&&(v+=1),v}function c(m,v,_,w,y,x){let M=t[e];return M===void 0?(M={id:m.id,object:m,geometry:v,material:_,materialVariant:o(m),groupOrder:w,renderOrder:m.renderOrder,z:y,group:x},t[e]=M):(M.id=m.id,M.object=m,M.geometry=v,M.material=_,M.materialVariant=o(m),M.groupOrder=w,M.renderOrder=m.renderOrder,M.z=y,M.group=x),e++,M}function u(m,v,_,w,y,x){const M=c(m,v,_,w,y,x);_.transmission>0?i.push(M):_.transparent===!0?r.push(M):n.push(M)}function f(m,v,_,w,y,x){const M=c(m,v,_,w,y,x);_.transmission>0?i.unshift(M):_.transparent===!0?r.unshift(M):n.unshift(M)}function h(m,v){n.length>1&&n.sort(m||CW),i.length>1&&i.sort(v||s1),r.length>1&&r.sort(v||s1)}function p(){for(let m=e,v=t.length;m<v;m++){const _=t[m];if(_.id===null)break;_.id=null,_.object=null,_.geometry=null,_.material=null,_.group=null}}return{opaque:n,transmissive:i,transparent:r,init:s,push:u,unshift:f,finish:p,sort:h}}function RW(){let t=new WeakMap;function e(i,r){const s=t.get(i);let o;return s===void 0?(o=new a1,t.set(i,[o])):r>=s.length?(o=new a1,s.push(o)):o=s[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function PW(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new me,color:new Mn};break;case"SpotLight":n={position:new me,direction:new me,color:new Mn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new me,color:new Mn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new me,skyColor:new Mn,groundColor:new Mn};break;case"RectAreaLight":n={color:new Mn,position:new me,halfWidth:new me,halfHeight:new me};break}return t[e.id]=n,n}}}function kW(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new bn};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new bn};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new bn,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let LW=0;function DW(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function NW(t){const e=new PW,n=kW(),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 me);const r=new me,s=new Yn,o=new Yn;function c(f){let h=0,p=0,m=0;for(let R=0;R<9;R++)i.probe[R].set(0,0,0);let v=0,_=0,w=0,y=0,x=0,M=0,A=0,T=0,D=0,I=0,U=0;f.sort(DW);for(let R=0,H=f.length;R<H;R++){const F=f[R],W=F.color,X=F.intensity,V=F.distance;let q=null;if(F.shadow&&F.shadow.map&&(F.shadow.map.texture.format===Vl?q=F.shadow.map.texture:q=F.shadow.map.depthTexture||F.shadow.map.texture),F.isAmbientLight)h+=W.r*X,p+=W.g*X,m+=W.b*X;else if(F.isLightProbe){for(let J=0;J<9;J++)i.probe[J].addScaledVector(F.sh.coefficients[J],X);U++}else if(F.isDirectionalLight){const J=e.get(F);if(J.color.copy(F.color).multiplyScalar(F.intensity),F.castShadow){const Q=F.shadow,$=n.get(F);$.shadowIntensity=Q.intensity,$.shadowBias=Q.bias,$.shadowNormalBias=Q.normalBias,$.shadowRadius=Q.radius,$.shadowMapSize=Q.mapSize,i.directionalShadow[v]=$,i.directionalShadowMap[v]=q,i.directionalShadowMatrix[v]=F.shadow.matrix,M++}i.directional[v]=J,v++}else if(F.isSpotLight){const J=e.get(F);J.position.setFromMatrixPosition(F.matrixWorld),J.color.copy(W).multiplyScalar(X),J.distance=V,J.coneCos=Math.cos(F.angle),J.penumbraCos=Math.cos(F.angle*(1-F.penumbra)),J.decay=F.decay,i.spot[w]=J;const Q=F.shadow;if(F.map&&(i.spotLightMap[D]=F.map,D++,Q.updateMatrices(F),F.castShadow&&I++),i.spotLightMatrix[w]=Q.matrix,F.castShadow){const $=n.get(F);$.shadowIntensity=Q.intensity,$.shadowBias=Q.bias,$.shadowNormalBias=Q.normalBias,$.shadowRadius=Q.radius,$.shadowMapSize=Q.mapSize,i.spotShadow[w]=$,i.spotShadowMap[w]=q,T++}w++}else if(F.isRectAreaLight){const J=e.get(F);J.color.copy(W).multiplyScalar(X),J.halfWidth.set(F.width*.5,0,0),J.halfHeight.set(0,F.height*.5,0),i.rectArea[y]=J,y++}else if(F.isPointLight){const J=e.get(F);if(J.color.copy(F.color).multiplyScalar(F.intensity),J.distance=F.distance,J.decay=F.decay,F.castShadow){const Q=F.shadow,$=n.get(F);$.shadowIntensity=Q.intensity,$.shadowBias=Q.bias,$.shadowNormalBias=Q.normalBias,$.shadowRadius=Q.radius,$.shadowMapSize=Q.mapSize,$.shadowCameraNear=Q.camera.near,$.shadowCameraFar=Q.camera.far,i.pointShadow[_]=$,i.pointShadowMap[_]=q,i.pointShadowMatrix[_]=F.shadow.matrix,A++}i.point[_]=J,_++}else if(F.isHemisphereLight){const J=e.get(F);J.skyColor.copy(F.color).multiplyScalar(X),J.groundColor.copy(F.groundColor).multiplyScalar(X),i.hemi[x]=J,x++}}y>0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ye.LTC_FLOAT_1,i.rectAreaLTC2=Ye.LTC_FLOAT_2):(i.rectAreaLTC1=Ye.LTC_HALF_1,i.rectAreaLTC2=Ye.LTC_HALF_2)),i.ambient[0]=h,i.ambient[1]=p,i.ambient[2]=m;const S=i.hash;(S.directionalLength!==v||S.pointLength!==_||S.spotLength!==w||S.rectAreaLength!==y||S.hemiLength!==x||S.numDirectionalShadows!==M||S.numPointShadows!==A||S.numSpotShadows!==T||S.numSpotMaps!==D||S.numLightProbes!==U)&&(i.directional.length=v,i.spot.length=w,i.rectArea.length=y,i.point.length=_,i.hemi.length=x,i.directionalShadow.length=M,i.directionalShadowMap.length=M,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=T,i.spotShadowMap.length=T,i.directionalShadowMatrix.length=M,i.pointShadowMatrix.length=A,i.spotLightMatrix.length=T+D-I,i.spotLightMap.length=D,i.numSpotLightShadowsWithMaps=I,i.numLightProbes=U,S.directionalLength=v,S.pointLength=_,S.spotLength=w,S.rectAreaLength=y,S.hemiLength=x,S.numDirectionalShadows=M,S.numPointShadows=A,S.numSpotShadows=T,S.numSpotMaps=D,S.numLightProbes=U,i.version=LW++)}function u(f,h){let p=0,m=0,v=0,_=0,w=0;const y=h.matrixWorldInverse;for(let x=0,M=f.length;x<M;x++){const A=f[x];if(A.isDirectionalLight){const T=i.directional[p];T.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(y),p++}else if(A.isSpotLight){const T=i.spot[v];T.position.setFromMatrixPosition(A.matrixWorld),T.position.applyMatrix4(y),T.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(y),v++}else if(A.isRectAreaLight){const T=i.rectArea[_];T.position.setFromMatrixPosition(A.matrixWorld),T.position.applyMatrix4(y),o.identity(),s.copy(A.matrixWorld),s.premultiply(y),o.extractRotation(s),T.halfWidth.set(A.width*.5,0,0),T.halfHeight.set(0,A.height*.5,0),T.halfWidth.applyMatrix4(o),T.halfHeight.applyMatrix4(o),_++}else if(A.isPointLight){const T=i.point[m];T.position.setFromMatrixPosition(A.matrixWorld),T.position.applyMatrix4(y),m++}else if(A.isHemisphereLight){const T=i.hemi[w];T.direction.setFromMatrixPosition(A.matrixWorld),T.direction.transformDirection(y),w++}}}return{setup:c,setupView:u,state:i}}function o1(t){const e=new NW(t),n=[],i=[];function r(h){f.camera=h,n.length=0,i.length=0}function s(h){n.push(h)}function o(h){i.push(h)}function c(){e.setup(n)}function u(h){e.setupView(n,h)}const f={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:f,setupLights:c,setupLightsView:u,pushLight:s,pushShadow:o}}function IW(t){let e=new WeakMap;function n(r,s=0){const o=e.get(r);let c;return o===void 0?(c=new o1(t),e.set(r,[c])):s>=o.length?(c=new o1(t),o.push(c)):c=o[s],c}function i(){e=new WeakMap}return{get:n,dispose:i}}const UW=`void main() {
|
|
4505
|
+
`+z)}else q!==""?Ht("WebGLProgram: Program Info Log:",q):(J===""||Q==="")&&(Y=!1);Y&&(F.diagnostics={runnable:$,programLog:q,vertexShader:{log:J,prefix:y},fragmentShader:{log:Q,prefix:x}})}r.deleteShader(D),r.deleteShader(I),S=new Hf(r,w),R=oW(r,w)}let S;this.getUniforms=function(){return S===void 0&&U(this),S};let R;this.getAttributes=function(){return R===void 0&&U(this),R};let H=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return H===!1&&(H=r.getProgramParameter(w,Z9)),H},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(w),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=J9++,this.cacheKey=e,this.usedTimes=1,this.program=w,this.vertexShader=D,this.fragmentShader=I,this}let wW=0;class EW{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new MW(e),n.set(e,i)),i}}class MW{constructor(e){this.id=wW++,this.code=e,this.usedTimes=0}}function TW(t,e,n,i,r,s){const o=new rR,c=new EW,u=new Set,f=[],h=new Map,p=i.logarithmicDepthBuffer;let m=i.precision;const v={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 _(S){return u.add(S),S===0?"uv":`uv${S}`}function w(S,R,H,F,W){const X=F.fog,V=W.geometry,q=S.isMeshStandardMaterial||S.isMeshLambertMaterial||S.isMeshPhongMaterial?F.environment:null,J=S.isMeshStandardMaterial||S.isMeshLambertMaterial&&!S.envMap||S.isMeshPhongMaterial&&!S.envMap,Q=e.get(S.envMap||q,J),$=Q&&Q.mapping===Ih?Q.image.height:null,Y=v[S.type];S.precision!==null&&(m=i.getMaxPrecision(S.precision),m!==S.precision&&Ht("WebGLProgram.getParameters:",S.precision,"not supported, using",m,"instead."));const Z=V.morphAttributes.position||V.morphAttributes.normal||V.morphAttributes.color,z=Z!==void 0?Z.length:0;let ie=0;V.morphAttributes.position!==void 0&&(ie=1),V.morphAttributes.normal!==void 0&&(ie=2),V.morphAttributes.color!==void 0&&(ie=3);let _e,Ee,Ue,le;if(Y){const Kt=Kr[Y];_e=Kt.vertexShader,Ee=Kt.fragmentShader}else _e=S.vertexShader,Ee=S.fragmentShader,c.update(S),Ue=c.getVertexShaderID(S),le=c.getFragmentShaderID(S);const be=t.getRenderTarget(),Se=t.state.buffers.depth.getReversed(),Ne=W.isInstancedMesh===!0,et=W.isBatchedMesh===!0,xt=!!S.map,pn=!!S.matcap,ht=!!Q,Ut=!!S.aoMap,nn=!!S.lightMap,Lt=!!S.bumpMap,an=!!S.normalMap,ee=!!S.displacementMap,Sn=!!S.emissiveMap,At=!!S.metalnessMap,kt=!!S.roughnessMap,it=S.anisotropy>0,O=S.clearcoat>0,P=S.dispersion>0,re=S.iridescence>0,xe=S.sheen>0,we=S.transmission>0,ve=it&&!!S.anisotropyMap,Ke=O&&!!S.clearcoatMap,ke=O&&!!S.clearcoatNormalMap,pt=O&&!!S.clearcoatRoughnessMap,Ct=re&&!!S.iridescenceMap,Re=re&&!!S.iridescenceThicknessMap,Be=xe&&!!S.sheenColorMap,Ze=xe&&!!S.sheenRoughnessMap,rt=!!S.specularMap,$e=!!S.specularColorMap,Vt=!!S.specularIntensityMap,ne=we&&!!S.transmissionMap,Ve=we&&!!S.thicknessMap,Le=!!S.gradientMap,Xe=!!S.alphaMap,Pe=S.alphaTest>0,ye=!!S.alphaHash,st=!!S.extensions;let Dt=ns;S.toneMapped&&(be===null||be.isXRRenderTarget===!0)&&(Dt=t.toneMapping);const mn={shaderID:Y,shaderType:S.type,shaderName:S.name,vertexShader:_e,fragmentShader:Ee,defines:S.defines,customVertexShaderID:Ue,customFragmentShaderID:le,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:m,batching:et,batchingColor:et&&W._colorsTexture!==null,instancing:Ne,instancingColor:Ne&&W.instanceColor!==null,instancingMorph:Ne&&W.morphTexture!==null,outputColorSpace:be===null?t.outputColorSpace:be.isXRRenderTarget===!0?be.texture.colorSpace:Mo,alphaToCoverage:!!S.alphaToCoverage,map:xt,matcap:pn,envMap:ht,envMapMode:ht&&Q.mapping,envMapCubeUVHeight:$,aoMap:Ut,lightMap:nn,bumpMap:Lt,normalMap:an,displacementMap:ee,emissiveMap:Sn,normalMapObjectSpace:an&&S.normalMapType===pH,normalMapTangentSpace:an&&S.normalMapType===hH,metalnessMap:At,roughnessMap:kt,anisotropy:it,anisotropyMap:ve,clearcoat:O,clearcoatMap:Ke,clearcoatNormalMap:ke,clearcoatRoughnessMap:pt,dispersion:P,iridescence:re,iridescenceMap:Ct,iridescenceThicknessMap:Re,sheen:xe,sheenColorMap:Be,sheenRoughnessMap:Ze,specularMap:rt,specularColorMap:$e,specularIntensityMap:Vt,transmission:we,transmissionMap:ne,thicknessMap:Ve,gradientMap:Le,opaque:S.transparent===!1&&S.blending===vo&&S.alphaToCoverage===!1,alphaMap:Xe,alphaTest:Pe,alphaHash:ye,combine:S.combine,mapUv:xt&&_(S.map.channel),aoMapUv:Ut&&_(S.aoMap.channel),lightMapUv:nn&&_(S.lightMap.channel),bumpMapUv:Lt&&_(S.bumpMap.channel),normalMapUv:an&&_(S.normalMap.channel),displacementMapUv:ee&&_(S.displacementMap.channel),emissiveMapUv:Sn&&_(S.emissiveMap.channel),metalnessMapUv:At&&_(S.metalnessMap.channel),roughnessMapUv:kt&&_(S.roughnessMap.channel),anisotropyMapUv:ve&&_(S.anisotropyMap.channel),clearcoatMapUv:Ke&&_(S.clearcoatMap.channel),clearcoatNormalMapUv:ke&&_(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:pt&&_(S.clearcoatRoughnessMap.channel),iridescenceMapUv:Ct&&_(S.iridescenceMap.channel),iridescenceThicknessMapUv:Re&&_(S.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&_(S.sheenColorMap.channel),sheenRoughnessMapUv:Ze&&_(S.sheenRoughnessMap.channel),specularMapUv:rt&&_(S.specularMap.channel),specularColorMapUv:$e&&_(S.specularColorMap.channel),specularIntensityMapUv:Vt&&_(S.specularIntensityMap.channel),transmissionMapUv:ne&&_(S.transmissionMap.channel),thicknessMapUv:Ve&&_(S.thicknessMap.channel),alphaMapUv:Xe&&_(S.alphaMap.channel),vertexTangents:!!V.attributes.tangent&&(an||it),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!V.attributes.color&&V.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!V.attributes.uv&&(xt||Xe),fog:!!X,useFog:S.fog===!0,fogExp2:!!X&&X.isFogExp2,flatShading:S.wireframe===!1&&(S.flatShading===!0||V.attributes.normal===void 0&&an===!1&&(S.isMeshLambertMaterial||S.isMeshPhongMaterial||S.isMeshStandardMaterial||S.isMeshPhysicalMaterial)),sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:p,reversedDepthBuffer:Se,skinning:W.isSkinnedMesh===!0,morphTargets:V.morphAttributes.position!==void 0,morphNormals:V.morphAttributes.normal!==void 0,morphColors:V.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:ie,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:S.dithering,shadowMapEnabled:t.shadowMap.enabled&&H.length>0,shadowMapType:t.shadowMap.type,toneMapping:Dt,decodeVideoTexture:xt&&S.map.isVideoTexture===!0&&fn.getTransfer(S.map.colorSpace)===wn,decodeVideoTextureEmissive:Sn&&S.emissiveMap.isVideoTexture===!0&&fn.getTransfer(S.emissiveMap.colorSpace)===wn,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===ks,flipSided:S.side===Gi,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:st&&S.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(st&&S.extensions.multiDraw===!0||et)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return mn.vertexUv1s=u.has(1),mn.vertexUv2s=u.has(2),mn.vertexUv3s=u.has(3),u.clear(),mn}function y(S){const R=[];if(S.shaderID?R.push(S.shaderID):(R.push(S.customVertexShaderID),R.push(S.customFragmentShaderID)),S.defines!==void 0)for(const H in S.defines)R.push(H),R.push(S.defines[H]);return S.isRawShaderMaterial===!1&&(x(R,S),M(R,S),R.push(t.outputColorSpace)),R.push(S.customProgramCacheKey),R.join()}function x(S,R){S.push(R.precision),S.push(R.outputColorSpace),S.push(R.envMapMode),S.push(R.envMapCubeUVHeight),S.push(R.mapUv),S.push(R.alphaMapUv),S.push(R.lightMapUv),S.push(R.aoMapUv),S.push(R.bumpMapUv),S.push(R.normalMapUv),S.push(R.displacementMapUv),S.push(R.emissiveMapUv),S.push(R.metalnessMapUv),S.push(R.roughnessMapUv),S.push(R.anisotropyMapUv),S.push(R.clearcoatMapUv),S.push(R.clearcoatNormalMapUv),S.push(R.clearcoatRoughnessMapUv),S.push(R.iridescenceMapUv),S.push(R.iridescenceThicknessMapUv),S.push(R.sheenColorMapUv),S.push(R.sheenRoughnessMapUv),S.push(R.specularMapUv),S.push(R.specularColorMapUv),S.push(R.specularIntensityMapUv),S.push(R.transmissionMapUv),S.push(R.thicknessMapUv),S.push(R.combine),S.push(R.fogExp2),S.push(R.sizeAttenuation),S.push(R.morphTargetsCount),S.push(R.morphAttributeCount),S.push(R.numDirLights),S.push(R.numPointLights),S.push(R.numSpotLights),S.push(R.numSpotLightMaps),S.push(R.numHemiLights),S.push(R.numRectAreaLights),S.push(R.numDirLightShadows),S.push(R.numPointLightShadows),S.push(R.numSpotLightShadows),S.push(R.numSpotLightShadowsWithMaps),S.push(R.numLightProbes),S.push(R.shadowMapType),S.push(R.toneMapping),S.push(R.numClippingPlanes),S.push(R.numClipIntersection),S.push(R.depthPacking)}function M(S,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),S.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),S.push(o.mask)}function A(S){const R=v[S.type];let H;if(R){const F=Kr[R];H=JH.clone(F.uniforms)}else H=S.uniforms;return H}function T(S,R){let H=h.get(R);return H!==void 0?++H.usedTimes:(H=new SW(t,R,S,r),f.push(H),h.set(R,H)),H}function D(S){if(--S.usedTimes===0){const R=f.indexOf(S);f[R]=f[f.length-1],f.pop(),h.delete(S.cacheKey),S.destroy()}}function I(S){c.remove(S)}function U(){c.dispose()}return{getParameters:w,getProgramCacheKey:y,getUniforms:A,acquireProgram:T,releaseProgram:D,releaseShaderCache:I,programs:f,dispose:U}}function AW(){let t=new WeakMap;function e(o){return t.has(o)}function n(o){let c=t.get(o);return c===void 0&&(c={},t.set(o,c)),c}function i(o){t.delete(o)}function r(o,c,u){t.get(o)[c]=u}function s(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:s}}function CW(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.materialVariant!==e.materialVariant?t.materialVariant-e.materialVariant:t.z!==e.z?t.z-e.z:t.id-e.id}function s1(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function a1(){const t=[];let e=0;const n=[],i=[],r=[];function s(){e=0,n.length=0,i.length=0,r.length=0}function o(m){let v=0;return m.isInstancedMesh&&(v+=2),m.isSkinnedMesh&&(v+=1),v}function c(m,v,_,w,y,x){let M=t[e];return M===void 0?(M={id:m.id,object:m,geometry:v,material:_,materialVariant:o(m),groupOrder:w,renderOrder:m.renderOrder,z:y,group:x},t[e]=M):(M.id=m.id,M.object=m,M.geometry=v,M.material=_,M.materialVariant=o(m),M.groupOrder=w,M.renderOrder=m.renderOrder,M.z=y,M.group=x),e++,M}function u(m,v,_,w,y,x){const M=c(m,v,_,w,y,x);_.transmission>0?i.push(M):_.transparent===!0?r.push(M):n.push(M)}function f(m,v,_,w,y,x){const M=c(m,v,_,w,y,x);_.transmission>0?i.unshift(M):_.transparent===!0?r.unshift(M):n.unshift(M)}function h(m,v){n.length>1&&n.sort(m||CW),i.length>1&&i.sort(v||s1),r.length>1&&r.sort(v||s1)}function p(){for(let m=e,v=t.length;m<v;m++){const _=t[m];if(_.id===null)break;_.id=null,_.object=null,_.geometry=null,_.material=null,_.group=null}}return{opaque:n,transmissive:i,transparent:r,init:s,push:u,unshift:f,finish:p,sort:h}}function RW(){let t=new WeakMap;function e(i,r){const s=t.get(i);let o;return s===void 0?(o=new a1,t.set(i,[o])):r>=s.length?(o=new a1,s.push(o)):o=s[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function PW(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new me,color:new Mn};break;case"SpotLight":n={position:new me,direction:new me,color:new Mn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new me,color:new Mn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new me,skyColor:new Mn,groundColor:new Mn};break;case"RectAreaLight":n={color:new Mn,position:new me,halfWidth:new me,halfHeight:new me};break}return t[e.id]=n,n}}}function kW(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new bn};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new bn};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new bn,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let LW=0;function DW(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function NW(t){const e=new PW,n=kW(),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 me);const r=new me,s=new Yn,o=new Yn;function c(f){let h=0,p=0,m=0;for(let R=0;R<9;R++)i.probe[R].set(0,0,0);let v=0,_=0,w=0,y=0,x=0,M=0,A=0,T=0,D=0,I=0,U=0;f.sort(DW);for(let R=0,H=f.length;R<H;R++){const F=f[R],W=F.color,X=F.intensity,V=F.distance;let q=null;if(F.shadow&&F.shadow.map&&(F.shadow.map.texture.format===Vl?q=F.shadow.map.texture:q=F.shadow.map.depthTexture||F.shadow.map.texture),F.isAmbientLight)h+=W.r*X,p+=W.g*X,m+=W.b*X;else if(F.isLightProbe){for(let J=0;J<9;J++)i.probe[J].addScaledVector(F.sh.coefficients[J],X);U++}else if(F.isDirectionalLight){const J=e.get(F);if(J.color.copy(F.color).multiplyScalar(F.intensity),F.castShadow){const Q=F.shadow,$=n.get(F);$.shadowIntensity=Q.intensity,$.shadowBias=Q.bias,$.shadowNormalBias=Q.normalBias,$.shadowRadius=Q.radius,$.shadowMapSize=Q.mapSize,i.directionalShadow[v]=$,i.directionalShadowMap[v]=q,i.directionalShadowMatrix[v]=F.shadow.matrix,M++}i.directional[v]=J,v++}else if(F.isSpotLight){const J=e.get(F);J.position.setFromMatrixPosition(F.matrixWorld),J.color.copy(W).multiplyScalar(X),J.distance=V,J.coneCos=Math.cos(F.angle),J.penumbraCos=Math.cos(F.angle*(1-F.penumbra)),J.decay=F.decay,i.spot[w]=J;const Q=F.shadow;if(F.map&&(i.spotLightMap[D]=F.map,D++,Q.updateMatrices(F),F.castShadow&&I++),i.spotLightMatrix[w]=Q.matrix,F.castShadow){const $=n.get(F);$.shadowIntensity=Q.intensity,$.shadowBias=Q.bias,$.shadowNormalBias=Q.normalBias,$.shadowRadius=Q.radius,$.shadowMapSize=Q.mapSize,i.spotShadow[w]=$,i.spotShadowMap[w]=q,T++}w++}else if(F.isRectAreaLight){const J=e.get(F);J.color.copy(W).multiplyScalar(X),J.halfWidth.set(F.width*.5,0,0),J.halfHeight.set(0,F.height*.5,0),i.rectArea[y]=J,y++}else if(F.isPointLight){const J=e.get(F);if(J.color.copy(F.color).multiplyScalar(F.intensity),J.distance=F.distance,J.decay=F.decay,F.castShadow){const Q=F.shadow,$=n.get(F);$.shadowIntensity=Q.intensity,$.shadowBias=Q.bias,$.shadowNormalBias=Q.normalBias,$.shadowRadius=Q.radius,$.shadowMapSize=Q.mapSize,$.shadowCameraNear=Q.camera.near,$.shadowCameraFar=Q.camera.far,i.pointShadow[_]=$,i.pointShadowMap[_]=q,i.pointShadowMatrix[_]=F.shadow.matrix,A++}i.point[_]=J,_++}else if(F.isHemisphereLight){const J=e.get(F);J.skyColor.copy(F.color).multiplyScalar(X),J.groundColor.copy(F.groundColor).multiplyScalar(X),i.hemi[x]=J,x++}}y>0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Ye.LTC_FLOAT_1,i.rectAreaLTC2=Ye.LTC_FLOAT_2):(i.rectAreaLTC1=Ye.LTC_HALF_1,i.rectAreaLTC2=Ye.LTC_HALF_2)),i.ambient[0]=h,i.ambient[1]=p,i.ambient[2]=m;const S=i.hash;(S.directionalLength!==v||S.pointLength!==_||S.spotLength!==w||S.rectAreaLength!==y||S.hemiLength!==x||S.numDirectionalShadows!==M||S.numPointShadows!==A||S.numSpotShadows!==T||S.numSpotMaps!==D||S.numLightProbes!==U)&&(i.directional.length=v,i.spot.length=w,i.rectArea.length=y,i.point.length=_,i.hemi.length=x,i.directionalShadow.length=M,i.directionalShadowMap.length=M,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=T,i.spotShadowMap.length=T,i.directionalShadowMatrix.length=M,i.pointShadowMatrix.length=A,i.spotLightMatrix.length=T+D-I,i.spotLightMap.length=D,i.numSpotLightShadowsWithMaps=I,i.numLightProbes=U,S.directionalLength=v,S.pointLength=_,S.spotLength=w,S.rectAreaLength=y,S.hemiLength=x,S.numDirectionalShadows=M,S.numPointShadows=A,S.numSpotShadows=T,S.numSpotMaps=D,S.numLightProbes=U,i.version=LW++)}function u(f,h){let p=0,m=0,v=0,_=0,w=0;const y=h.matrixWorldInverse;for(let x=0,M=f.length;x<M;x++){const A=f[x];if(A.isDirectionalLight){const T=i.directional[p];T.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(y),p++}else if(A.isSpotLight){const T=i.spot[v];T.position.setFromMatrixPosition(A.matrixWorld),T.position.applyMatrix4(y),T.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(y),v++}else if(A.isRectAreaLight){const T=i.rectArea[_];T.position.setFromMatrixPosition(A.matrixWorld),T.position.applyMatrix4(y),o.identity(),s.copy(A.matrixWorld),s.premultiply(y),o.extractRotation(s),T.halfWidth.set(A.width*.5,0,0),T.halfHeight.set(0,A.height*.5,0),T.halfWidth.applyMatrix4(o),T.halfHeight.applyMatrix4(o),_++}else if(A.isPointLight){const T=i.point[m];T.position.setFromMatrixPosition(A.matrixWorld),T.position.applyMatrix4(y),m++}else if(A.isHemisphereLight){const T=i.hemi[w];T.direction.setFromMatrixPosition(A.matrixWorld),T.direction.transformDirection(y),w++}}}return{setup:c,setupView:u,state:i}}function o1(t){const e=new NW(t),n=[],i=[];function r(h){f.camera=h,n.length=0,i.length=0}function s(h){n.push(h)}function o(h){i.push(h)}function c(){e.setup(n)}function u(h){e.setupView(n,h)}const f={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:f,setupLights:c,setupLightsView:u,pushLight:s,pushShadow:o}}function IW(t){let e=new WeakMap;function n(r,s=0){const o=e.get(r);let c;return o===void 0?(c=new o1(t),e.set(r,[c])):s>=o.length?(c=new o1(t),o.push(c)):c=o[s],c}function i(){e=new WeakMap}return{get:n,dispose:i}}const UW=`void main() {
|
|
4506
4506
|
gl_Position = vec4( position, 1.0 );
|
|
4507
4507
|
}`,FW=`uniform sampler2D shadow_pass;
|
|
4508
4508
|
uniform vec2 resolution;
|
|
@@ -4529,7 +4529,7 @@ void main() {
|
|
|
4529
4529
|
squared_mean = squared_mean / samples;
|
|
4530
4530
|
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
|
|
4531
4531
|
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
|
|
4532
|
-
}`,OW=[new me(1,0,0),new me(-1,0,0),new me(0,1,0),new me(0,-1,0),new me(0,0,1),new me(0,0,-1)],BW=[new me(0,-1,0),new me(0,-1,0),new me(0,0,1),new me(0,0,-1),new me(0,-1,0),new me(0,-1,0)],l1=new Yn,$c=new me,Ng=new me;function zW(t,e,n){let i=new cR;const r=new bn,s=new bn,o=new zn,c=new tG,u=new nG,f={},h=n.maxTextureSize,p={[Pa]:Gi,[Gi]:Pa,[ks]:ks},m=new ds({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new bn},radius:{value:4}},vertexShader:UW,fragmentShader:FW}),v=m.clone();v.defines.HORIZONTAL_PASS=1;const _=new hs;_.setAttribute("position",new zr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new us(_,m),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ff;let x=this.type;this.render=function(I,U,S){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||I.length===0)return;this.type===WV&&(Ht("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Ff);const R=t.getRenderTarget(),H=t.getActiveCubeFace(),F=t.getActiveMipmapLevel(),W=t.state;W.setBlending(Ns),W.buffers.depth.getReversed()===!0?W.buffers.color.setClear(0,0,0,0):W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const X=x!==this.type;X&&U.traverse(function(V){V.material&&(Array.isArray(V.material)?V.material.forEach(q=>q.needsUpdate=!0):V.material.needsUpdate=!0)});for(let V=0,q=I.length;V<q;V++){const J=I[V],Q=J.shadow;if(Q===void 0){Ht("WebGLShadowMap:",J,"has no shadow.");continue}if(Q.autoUpdate===!1&&Q.needsUpdate===!1)continue;r.copy(Q.mapSize);const $=Q.getFrameExtents();r.multiply($),s.copy(Q.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/$.x),r.x=s.x*$.x,Q.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/$.y),r.y=s.y*$.y,Q.mapSize.y=s.y));const Y=t.state.buffers.depth.getReversed();if(Q.camera._reversedDepth=Y,Q.map===null||X===!0){if(Q.map!==null&&(Q.map.depthTexture!==null&&(Q.map.depthTexture.dispose(),Q.map.depthTexture=null),Q.map.dispose()),this.type===Jc){if(J.isPointLight){Ht("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}Q.map=new is(r.x,r.y,{format:Vl,type:Os,minFilter:wi,magFilter:wi,generateMipmaps:!1}),Q.map.texture.name=J.name+".shadowMap",Q.map.depthTexture=new _u(r.x,r.y,Jr),Q.map.depthTexture.name=J.name+".shadowMapDepth",Q.map.depthTexture.format=Bs,Q.map.depthTexture.compareFunction=null,Q.map.depthTexture.minFilter=pi,Q.map.depthTexture.magFilter=pi}else J.isPointLight?(Q.map=new gR(r.x),Q.map.depthTexture=new KH(r.x,cs)):(Q.map=new is(r.x,r.y),Q.map.depthTexture=new _u(r.x,r.y,cs)),Q.map.depthTexture.name=J.name+".shadowMap",Q.map.depthTexture.format=Bs,this.type===Ff?(Q.map.depthTexture.compareFunction=Y?Jy:Zy,Q.map.depthTexture.minFilter=wi,Q.map.depthTexture.magFilter=wi):(Q.map.depthTexture.compareFunction=null,Q.map.depthTexture.minFilter=pi,Q.map.depthTexture.magFilter=pi);Q.camera.updateProjectionMatrix()}const Z=Q.map.isWebGLCubeRenderTarget?6:1;for(let z=0;z<Z;z++){if(Q.map.isWebGLCubeRenderTarget)t.setRenderTarget(Q.map,z),t.clear();else{z===0&&(t.setRenderTarget(Q.map),t.clear());const ie=Q.getViewport(z);o.set(s.x*ie.x,s.y*ie.y,s.x*ie.z,s.y*ie.w),W.viewport(o)}if(J.isPointLight){const ie=Q.camera,ve=Q.matrix,Ee=J.distance||ie.far;Ee!==ie.far&&(ie.far=Ee,ie.updateProjectionMatrix()),$c.setFromMatrixPosition(J.matrixWorld),ie.position.copy($c),Ng.copy(ie.position),Ng.add(OW[z]),ie.up.copy(BW[z]),ie.lookAt(Ng),ie.updateMatrixWorld(),ve.makeTranslation(-$c.x,-$c.y,-$c.z),l1.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),Q._frustum.setFromProjectionMatrix(l1,ie.coordinateSystem,ie.reversedDepth)}else Q.updateMatrices(J);i=Q.getFrustum(),T(U,S,Q.camera,J,this.type)}Q.isPointLightShadow!==!0&&this.type===Jc&&M(Q,S),Q.needsUpdate=!1}x=this.type,y.needsUpdate=!1,t.setRenderTarget(R,H,F)};function M(I,U){const S=e.update(w);m.defines.VSM_SAMPLES!==I.blurSamples&&(m.defines.VSM_SAMPLES=I.blurSamples,v.defines.VSM_SAMPLES=I.blurSamples,m.needsUpdate=!0,v.needsUpdate=!0),I.mapPass===null&&(I.mapPass=new is(r.x,r.y,{format:Vl,type:Os})),m.uniforms.shadow_pass.value=I.map.depthTexture,m.uniforms.resolution.value=I.mapSize,m.uniforms.radius.value=I.radius,t.setRenderTarget(I.mapPass),t.clear(),t.renderBufferDirect(U,null,S,m,w,null),v.uniforms.shadow_pass.value=I.mapPass.texture,v.uniforms.resolution.value=I.mapSize,v.uniforms.radius.value=I.radius,t.setRenderTarget(I.map),t.clear(),t.renderBufferDirect(U,null,S,v,w,null)}function A(I,U,S,R){let H=null;const F=S.isPointLight===!0?I.customDistanceMaterial:I.customDepthMaterial;if(F!==void 0)H=F;else if(H=S.isPointLight===!0?u:c,t.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){const W=H.uuid,X=U.uuid;let V=f[W];V===void 0&&(V={},f[W]=V);let q=V[X];q===void 0&&(q=H.clone(),V[X]=q,U.addEventListener("dispose",D)),H=q}if(H.visible=U.visible,H.wireframe=U.wireframe,R===Jc?H.side=U.shadowSide!==null?U.shadowSide:U.side:H.side=U.shadowSide!==null?U.shadowSide:p[U.side],H.alphaMap=U.alphaMap,H.alphaTest=U.alphaToCoverage===!0?.5:U.alphaTest,H.map=U.map,H.clipShadows=U.clipShadows,H.clippingPlanes=U.clippingPlanes,H.clipIntersection=U.clipIntersection,H.displacementMap=U.displacementMap,H.displacementScale=U.displacementScale,H.displacementBias=U.displacementBias,H.wireframeLinewidth=U.wireframeLinewidth,H.linewidth=U.linewidth,S.isPointLight===!0&&H.isMeshDistanceMaterial===!0){const W=t.properties.get(H);W.light=S}return H}function T(I,U,S,R,H){if(I.visible===!1)return;if(I.layers.test(U.layers)&&(I.isMesh||I.isLine||I.isPoints)&&(I.castShadow||I.receiveShadow&&H===Jc)&&(!I.frustumCulled||i.intersectsObject(I))){I.modelViewMatrix.multiplyMatrices(S.matrixWorldInverse,I.matrixWorld);const X=e.update(I),V=I.material;if(Array.isArray(V)){const q=X.groups;for(let J=0,Q=q.length;J<Q;J++){const $=q[J],Y=V[$.materialIndex];if(Y&&Y.visible){const Z=A(I,Y,R,H);I.onBeforeShadow(t,I,U,S,X,Z,$),t.renderBufferDirect(S,null,X,Z,I,$),I.onAfterShadow(t,I,U,S,X,Z,$)}}}else if(V.visible){const q=A(I,V,R,H);I.onBeforeShadow(t,I,U,S,X,q,null),t.renderBufferDirect(S,null,X,q,I,null),I.onAfterShadow(t,I,U,S,X,q,null)}}const W=I.children;for(let X=0,V=W.length;X<V;X++)T(W[X],U,S,R,H)}function D(I){I.target.removeEventListener("dispose",D);for(const S in f){const R=f[S],H=I.target.uuid;H in R&&(R[H].dispose(),delete R[H])}}}function VW(t,e){function n(){let ne=!1;const Ve=new zn;let Le=null;const Xe=new zn(0,0,0,0);return{setMask:function(Pe){Le!==Pe&&!ne&&(t.colorMask(Pe,Pe,Pe,Pe),Le=Pe)},setLocked:function(Pe){ne=Pe},setClear:function(Pe,_e,st,Dt,mn){mn===!0&&(Pe*=Dt,_e*=Dt,st*=Dt),Ve.set(Pe,_e,st,Dt),Xe.equals(Ve)===!1&&(t.clearColor(Pe,_e,st,Dt),Xe.copy(Ve))},reset:function(){ne=!1,Le=null,Xe.set(-1,0,0,0)}}}function i(){let ne=!1,Ve=!1,Le=null,Xe=null,Pe=null;return{setReversed:function(_e){if(Ve!==_e){const st=e.get("EXT_clip_control");_e?st.clipControlEXT(st.LOWER_LEFT_EXT,st.ZERO_TO_ONE_EXT):st.clipControlEXT(st.LOWER_LEFT_EXT,st.NEGATIVE_ONE_TO_ONE_EXT),Ve=_e;const Dt=Pe;Pe=null,this.setClear(Dt)}},getReversed:function(){return Ve},setTest:function(_e){_e?be(t.DEPTH_TEST):Se(t.DEPTH_TEST)},setMask:function(_e){Le!==_e&&!ne&&(t.depthMask(_e),Le=_e)},setFunc:function(_e){if(Ve&&(_e=EH[_e]),Xe!==_e){switch(_e){case F0:t.depthFunc(t.NEVER);break;case O0:t.depthFunc(t.ALWAYS);break;case B0:t.depthFunc(t.LESS);break;case Bl:t.depthFunc(t.LEQUAL);break;case z0:t.depthFunc(t.EQUAL);break;case V0:t.depthFunc(t.GEQUAL);break;case H0:t.depthFunc(t.GREATER);break;case G0:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}Xe=_e}},setLocked:function(_e){ne=_e},setClear:function(_e){Pe!==_e&&(Pe=_e,Ve&&(_e=1-_e),t.clearDepth(_e))},reset:function(){ne=!1,Le=null,Xe=null,Pe=null,Ve=!1}}}function r(){let ne=!1,Ve=null,Le=null,Xe=null,Pe=null,_e=null,st=null,Dt=null,mn=null;return{setTest:function(Kt){ne||(Kt?be(t.STENCIL_TEST):Se(t.STENCIL_TEST))},setMask:function(Kt){Ve!==Kt&&!ne&&(t.stencilMask(Kt),Ve=Kt)},setFunc:function(Kt,ci,ii){(Le!==Kt||Xe!==ci||Pe!==ii)&&(t.stencilFunc(Kt,ci,ii),Le=Kt,Xe=ci,Pe=ii)},setOp:function(Kt,ci,ii){(_e!==Kt||st!==ci||Dt!==ii)&&(t.stencilOp(Kt,ci,ii),_e=Kt,st=ci,Dt=ii)},setLocked:function(Kt){ne=Kt},setClear:function(Kt){mn!==Kt&&(t.clearStencil(Kt),mn=Kt)},reset:function(){ne=!1,Ve=null,Le=null,Xe=null,Pe=null,_e=null,st=null,Dt=null,mn=null}}}const s=new n,o=new i,c=new r,u=new WeakMap,f=new WeakMap;let h={},p={},m=new WeakMap,v=[],_=null,w=!1,y=null,x=null,M=null,A=null,T=null,D=null,I=null,U=new Mn(0,0,0),S=0,R=!1,H=null,F=null,W=null,X=null,V=null;const q=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let J=!1,Q=0;const $=t.getParameter(t.VERSION);$.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec($)[1]),J=Q>=1):$.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),J=Q>=2);let Y=null,Z={};const z=t.getParameter(t.SCISSOR_BOX),ie=t.getParameter(t.VIEWPORT),ve=new zn().fromArray(z),Ee=new zn().fromArray(ie);function Ue(ne,Ve,Le,Xe){const Pe=new Uint8Array(4),_e=t.createTexture();t.bindTexture(ne,_e),t.texParameteri(ne,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(ne,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let st=0;st<Le;st++)ne===t.TEXTURE_3D||ne===t.TEXTURE_2D_ARRAY?t.texImage3D(Ve,0,t.RGBA,1,1,Xe,0,t.RGBA,t.UNSIGNED_BYTE,Pe):t.texImage2D(Ve+st,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,Pe);return _e}const le={};le[t.TEXTURE_2D]=Ue(t.TEXTURE_2D,t.TEXTURE_2D,1),le[t.TEXTURE_CUBE_MAP]=Ue(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),le[t.TEXTURE_2D_ARRAY]=Ue(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),le[t.TEXTURE_3D]=Ue(t.TEXTURE_3D,t.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),c.setClear(0),be(t.DEPTH_TEST),o.setFunc(Bl),Lt(!1),an(pE),be(t.CULL_FACE),Ut(Ns);function be(ne){h[ne]!==!0&&(t.enable(ne),h[ne]=!0)}function Se(ne){h[ne]!==!1&&(t.disable(ne),h[ne]=!1)}function Ne(ne,Ve){return p[ne]!==Ve?(t.bindFramebuffer(ne,Ve),p[ne]=Ve,ne===t.DRAW_FRAMEBUFFER&&(p[t.FRAMEBUFFER]=Ve),ne===t.FRAMEBUFFER&&(p[t.DRAW_FRAMEBUFFER]=Ve),!0):!1}function et(ne,Ve){let Le=v,Xe=!1;if(ne){Le=m.get(Ve),Le===void 0&&(Le=[],m.set(Ve,Le));const Pe=ne.textures;if(Le.length!==Pe.length||Le[0]!==t.COLOR_ATTACHMENT0){for(let _e=0,st=Pe.length;_e<st;_e++)Le[_e]=t.COLOR_ATTACHMENT0+_e;Le.length=Pe.length,Xe=!0}}else Le[0]!==t.BACK&&(Le[0]=t.BACK,Xe=!0);Xe&&t.drawBuffers(Le)}function xt(ne){return _!==ne?(t.useProgram(ne),_=ne,!0):!1}const pn={[ro]:t.FUNC_ADD,[$V]:t.FUNC_SUBTRACT,[XV]:t.FUNC_REVERSE_SUBTRACT};pn[qV]=t.MIN,pn[YV]=t.MAX;const ht={[KV]:t.ZERO,[ZV]:t.ONE,[JV]:t.SRC_COLOR,[I0]:t.SRC_ALPHA,[rH]:t.SRC_ALPHA_SATURATE,[nH]:t.DST_COLOR,[eH]:t.DST_ALPHA,[QV]:t.ONE_MINUS_SRC_COLOR,[U0]:t.ONE_MINUS_SRC_ALPHA,[iH]:t.ONE_MINUS_DST_COLOR,[tH]:t.ONE_MINUS_DST_ALPHA,[sH]:t.CONSTANT_COLOR,[aH]:t.ONE_MINUS_CONSTANT_COLOR,[oH]:t.CONSTANT_ALPHA,[lH]:t.ONE_MINUS_CONSTANT_ALPHA};function Ut(ne,Ve,Le,Xe,Pe,_e,st,Dt,mn,Kt){if(ne===Ns){w===!0&&(Se(t.BLEND),w=!1);return}if(w===!1&&(be(t.BLEND),w=!0),ne!==jV){if(ne!==y||Kt!==R){if((x!==ro||T!==ro)&&(t.blendEquation(t.FUNC_ADD),x=ro,T=ro),Kt)switch(ne){case vo:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case mE:t.blendFunc(t.ONE,t.ONE);break;case gE:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case vE:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:_n("WebGLState: Invalid blending: ",ne);break}else switch(ne){case vo:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case mE:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case gE:_n("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case vE:_n("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:_n("WebGLState: Invalid blending: ",ne);break}M=null,A=null,D=null,I=null,U.set(0,0,0),S=0,y=ne,R=Kt}return}Pe=Pe||Ve,_e=_e||Le,st=st||Xe,(Ve!==x||Pe!==T)&&(t.blendEquationSeparate(pn[Ve],pn[Pe]),x=Ve,T=Pe),(Le!==M||Xe!==A||_e!==D||st!==I)&&(t.blendFuncSeparate(ht[Le],ht[Xe],ht[_e],ht[st]),M=Le,A=Xe,D=_e,I=st),(Dt.equals(U)===!1||mn!==S)&&(t.blendColor(Dt.r,Dt.g,Dt.b,mn),U.copy(Dt),S=mn),y=ne,R=!1}function nn(ne,Ve){ne.side===ks?Se(t.CULL_FACE):be(t.CULL_FACE);let Le=ne.side===Gi;Ve&&(Le=!Le),Lt(Le),ne.blending===vo&&ne.transparent===!1?Ut(Ns):Ut(ne.blending,ne.blendEquation,ne.blendSrc,ne.blendDst,ne.blendEquationAlpha,ne.blendSrcAlpha,ne.blendDstAlpha,ne.blendColor,ne.blendAlpha,ne.premultipliedAlpha),o.setFunc(ne.depthFunc),o.setTest(ne.depthTest),o.setMask(ne.depthWrite),s.setMask(ne.colorWrite);const Xe=ne.stencilWrite;c.setTest(Xe),Xe&&(c.setMask(ne.stencilWriteMask),c.setFunc(ne.stencilFunc,ne.stencilRef,ne.stencilFuncMask),c.setOp(ne.stencilFail,ne.stencilZFail,ne.stencilZPass)),Sn(ne.polygonOffset,ne.polygonOffsetFactor,ne.polygonOffsetUnits),ne.alphaToCoverage===!0?be(t.SAMPLE_ALPHA_TO_COVERAGE):Se(t.SAMPLE_ALPHA_TO_COVERAGE)}function Lt(ne){H!==ne&&(ne?t.frontFace(t.CW):t.frontFace(t.CCW),H=ne)}function an(ne){ne!==HV?(be(t.CULL_FACE),ne!==F&&(ne===pE?t.cullFace(t.BACK):ne===GV?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):Se(t.CULL_FACE),F=ne}function ee(ne){ne!==W&&(J&&t.lineWidth(ne),W=ne)}function Sn(ne,Ve,Le){ne?(be(t.POLYGON_OFFSET_FILL),(X!==Ve||V!==Le)&&(X=Ve,V=Le,o.getReversed()&&(Ve=-Ve),t.polygonOffset(Ve,Le))):Se(t.POLYGON_OFFSET_FILL)}function At(ne){ne?be(t.SCISSOR_TEST):Se(t.SCISSOR_TEST)}function kt(ne){ne===void 0&&(ne=t.TEXTURE0+q-1),Y!==ne&&(t.activeTexture(ne),Y=ne)}function it(ne,Ve,Le){Le===void 0&&(Y===null?Le=t.TEXTURE0+q-1:Le=Y);let Xe=Z[Le];Xe===void 0&&(Xe={type:void 0,texture:void 0},Z[Le]=Xe),(Xe.type!==ne||Xe.texture!==Ve)&&(Y!==Le&&(t.activeTexture(Le),Y=Le),t.bindTexture(ne,Ve||le[ne]),Xe.type=ne,Xe.texture=Ve)}function O(){const ne=Z[Y];ne!==void 0&&ne.type!==void 0&&(t.bindTexture(ne.type,null),ne.type=void 0,ne.texture=void 0)}function P(){try{t.compressedTexImage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function re(){try{t.compressedTexImage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function xe(){try{t.texSubImage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function we(){try{t.texSubImage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function ye(){try{t.compressedTexSubImage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function Ke(){try{t.compressedTexSubImage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function ke(){try{t.texStorage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function pt(){try{t.texStorage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function Ct(){try{t.texImage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function Re(){try{t.texImage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function Be(ne){ve.equals(ne)===!1&&(t.scissor(ne.x,ne.y,ne.z,ne.w),ve.copy(ne))}function Ze(ne){Ee.equals(ne)===!1&&(t.viewport(ne.x,ne.y,ne.z,ne.w),Ee.copy(ne))}function rt(ne,Ve){let Le=f.get(Ve);Le===void 0&&(Le=new WeakMap,f.set(Ve,Le));let Xe=Le.get(ne);Xe===void 0&&(Xe=t.getUniformBlockIndex(Ve,ne.name),Le.set(ne,Xe))}function $e(ne,Ve){const Xe=f.get(Ve).get(ne);u.get(Ve)!==Xe&&(t.uniformBlockBinding(Ve,Xe,ne.__bindingPointIndex),u.set(Ve,Xe))}function Vt(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),o.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),h={},Y=null,Z={},p={},m=new WeakMap,v=[],_=null,w=!1,y=null,x=null,M=null,A=null,T=null,D=null,I=null,U=new Mn(0,0,0),S=0,R=!1,H=null,F=null,W=null,X=null,V=null,ve.set(0,0,t.canvas.width,t.canvas.height),Ee.set(0,0,t.canvas.width,t.canvas.height),s.reset(),o.reset(),c.reset()}return{buffers:{color:s,depth:o,stencil:c},enable:be,disable:Se,bindFramebuffer:Ne,drawBuffers:et,useProgram:xt,setBlending:Ut,setMaterial:nn,setFlipSided:Lt,setCullFace:an,setLineWidth:ee,setPolygonOffset:Sn,setScissorTest:At,activeTexture:kt,bindTexture:it,unbindTexture:O,compressedTexImage2D:P,compressedTexImage3D:re,texImage2D:Ct,texImage3D:Re,updateUBOMapping:rt,uniformBlockBinding:$e,texStorage2D:ke,texStorage3D:pt,texSubImage2D:xe,texSubImage3D:we,compressedTexSubImage2D:ye,compressedTexSubImage3D:Ke,scissor:Be,viewport:Ze,reset:Vt}}function HW(t,e,n,i,r,s,o){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new bn,h=new WeakMap;let p;const m=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(O,P){return v?new OffscreenCanvas(O,P):vh("canvas")}function w(O,P,re){let xe=1;const we=it(O);if((we.width>re||we.height>re)&&(xe=re/Math.max(we.width,we.height)),xe<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const ye=Math.floor(xe*we.width),Ke=Math.floor(xe*we.height);p===void 0&&(p=_(ye,Ke));const ke=P?_(ye,Ke):p;return ke.width=ye,ke.height=Ke,ke.getContext("2d").drawImage(O,0,0,ye,Ke),Ht("WebGLRenderer: Texture has been resized from ("+we.width+"x"+we.height+") to ("+ye+"x"+Ke+")."),ke}else return"data"in O&&Ht("WebGLRenderer: Image in DataTexture is too big ("+we.width+"x"+we.height+")."),O;return O}function y(O){return O.generateMipmaps}function x(O){t.generateMipmap(O)}function M(O){return O.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?t.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function A(O,P,re,xe,we=!1){if(O!==null){if(t[O]!==void 0)return t[O];Ht("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let ye=P;if(P===t.RED&&(re===t.FLOAT&&(ye=t.R32F),re===t.HALF_FLOAT&&(ye=t.R16F),re===t.UNSIGNED_BYTE&&(ye=t.R8)),P===t.RED_INTEGER&&(re===t.UNSIGNED_BYTE&&(ye=t.R8UI),re===t.UNSIGNED_SHORT&&(ye=t.R16UI),re===t.UNSIGNED_INT&&(ye=t.R32UI),re===t.BYTE&&(ye=t.R8I),re===t.SHORT&&(ye=t.R16I),re===t.INT&&(ye=t.R32I)),P===t.RG&&(re===t.FLOAT&&(ye=t.RG32F),re===t.HALF_FLOAT&&(ye=t.RG16F),re===t.UNSIGNED_BYTE&&(ye=t.RG8)),P===t.RG_INTEGER&&(re===t.UNSIGNED_BYTE&&(ye=t.RG8UI),re===t.UNSIGNED_SHORT&&(ye=t.RG16UI),re===t.UNSIGNED_INT&&(ye=t.RG32UI),re===t.BYTE&&(ye=t.RG8I),re===t.SHORT&&(ye=t.RG16I),re===t.INT&&(ye=t.RG32I)),P===t.RGB_INTEGER&&(re===t.UNSIGNED_BYTE&&(ye=t.RGB8UI),re===t.UNSIGNED_SHORT&&(ye=t.RGB16UI),re===t.UNSIGNED_INT&&(ye=t.RGB32UI),re===t.BYTE&&(ye=t.RGB8I),re===t.SHORT&&(ye=t.RGB16I),re===t.INT&&(ye=t.RGB32I)),P===t.RGBA_INTEGER&&(re===t.UNSIGNED_BYTE&&(ye=t.RGBA8UI),re===t.UNSIGNED_SHORT&&(ye=t.RGBA16UI),re===t.UNSIGNED_INT&&(ye=t.RGBA32UI),re===t.BYTE&&(ye=t.RGBA8I),re===t.SHORT&&(ye=t.RGBA16I),re===t.INT&&(ye=t.RGBA32I)),P===t.RGB&&(re===t.UNSIGNED_INT_5_9_9_9_REV&&(ye=t.RGB9_E5),re===t.UNSIGNED_INT_10F_11F_11F_REV&&(ye=t.R11F_G11F_B10F)),P===t.RGBA){const Ke=we?mh:fn.getTransfer(xe);re===t.FLOAT&&(ye=t.RGBA32F),re===t.HALF_FLOAT&&(ye=t.RGBA16F),re===t.UNSIGNED_BYTE&&(ye=Ke===wn?t.SRGB8_ALPHA8:t.RGBA8),re===t.UNSIGNED_SHORT_4_4_4_4&&(ye=t.RGBA4),re===t.UNSIGNED_SHORT_5_5_5_1&&(ye=t.RGB5_A1)}return(ye===t.R16F||ye===t.R32F||ye===t.RG16F||ye===t.RG32F||ye===t.RGBA16F||ye===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ye}function T(O,P){let re;return O?P===null||P===cs||P===yu?re=t.DEPTH24_STENCIL8:P===Jr?re=t.DEPTH32F_STENCIL8:P===vu&&(re=t.DEPTH24_STENCIL8,Ht("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):P===null||P===cs||P===yu?re=t.DEPTH_COMPONENT24:P===Jr?re=t.DEPTH_COMPONENT32F:P===vu&&(re=t.DEPTH_COMPONENT16),re}function D(O,P){return y(O)===!0||O.isFramebufferTexture&&O.minFilter!==pi&&O.minFilter!==wi?Math.log2(Math.max(P.width,P.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?P.mipmaps.length:1}function I(O){const P=O.target;P.removeEventListener("dispose",I),S(P),P.isVideoTexture&&h.delete(P)}function U(O){const P=O.target;P.removeEventListener("dispose",U),H(P)}function S(O){const P=i.get(O);if(P.__webglInit===void 0)return;const re=O.source,xe=m.get(re);if(xe){const we=xe[P.__cacheKey];we.usedTimes--,we.usedTimes===0&&R(O),Object.keys(xe).length===0&&m.delete(re)}i.remove(O)}function R(O){const P=i.get(O);t.deleteTexture(P.__webglTexture);const re=O.source,xe=m.get(re);delete xe[P.__cacheKey],o.memory.textures--}function H(O){const P=i.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),i.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let xe=0;xe<6;xe++){if(Array.isArray(P.__webglFramebuffer[xe]))for(let we=0;we<P.__webglFramebuffer[xe].length;we++)t.deleteFramebuffer(P.__webglFramebuffer[xe][we]);else t.deleteFramebuffer(P.__webglFramebuffer[xe]);P.__webglDepthbuffer&&t.deleteRenderbuffer(P.__webglDepthbuffer[xe])}else{if(Array.isArray(P.__webglFramebuffer))for(let xe=0;xe<P.__webglFramebuffer.length;xe++)t.deleteFramebuffer(P.__webglFramebuffer[xe]);else t.deleteFramebuffer(P.__webglFramebuffer);if(P.__webglDepthbuffer&&t.deleteRenderbuffer(P.__webglDepthbuffer),P.__webglMultisampledFramebuffer&&t.deleteFramebuffer(P.__webglMultisampledFramebuffer),P.__webglColorRenderbuffer)for(let xe=0;xe<P.__webglColorRenderbuffer.length;xe++)P.__webglColorRenderbuffer[xe]&&t.deleteRenderbuffer(P.__webglColorRenderbuffer[xe]);P.__webglDepthRenderbuffer&&t.deleteRenderbuffer(P.__webglDepthRenderbuffer)}const re=O.textures;for(let xe=0,we=re.length;xe<we;xe++){const ye=i.get(re[xe]);ye.__webglTexture&&(t.deleteTexture(ye.__webglTexture),o.memory.textures--),i.remove(re[xe])}i.remove(O)}let F=0;function W(){F=0}function X(){const O=F;return O>=r.maxTextures&&Ht("WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+r.maxTextures),F+=1,O}function V(O){const P=[];return P.push(O.wrapS),P.push(O.wrapT),P.push(O.wrapR||0),P.push(O.magFilter),P.push(O.minFilter),P.push(O.anisotropy),P.push(O.internalFormat),P.push(O.format),P.push(O.type),P.push(O.generateMipmaps),P.push(O.premultiplyAlpha),P.push(O.flipY),P.push(O.unpackAlignment),P.push(O.colorSpace),P.join()}function q(O,P){const re=i.get(O);if(O.isVideoTexture&&At(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&re.__version!==O.version){const xe=O.image;if(xe===null)Ht("WebGLRenderer: Texture marked for update but no image data found.");else if(xe.complete===!1)Ht("WebGLRenderer: Texture marked for update but image is incomplete");else{le(re,O,P);return}}else O.isExternalTexture&&(re.__webglTexture=O.sourceTexture?O.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,re.__webglTexture,t.TEXTURE0+P)}function J(O,P){const re=i.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&re.__version!==O.version){le(re,O,P);return}else O.isExternalTexture&&(re.__webglTexture=O.sourceTexture?O.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,re.__webglTexture,t.TEXTURE0+P)}function Q(O,P){const re=i.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&re.__version!==O.version){le(re,O,P);return}n.bindTexture(t.TEXTURE_3D,re.__webglTexture,t.TEXTURE0+P)}function $(O,P){const re=i.get(O);if(O.isCubeDepthTexture!==!0&&O.version>0&&re.__version!==O.version){be(re,O,P);return}n.bindTexture(t.TEXTURE_CUBE_MAP,re.__webglTexture,t.TEXTURE0+P)}const Y={[W0]:t.REPEAT,[Ls]:t.CLAMP_TO_EDGE,[j0]:t.MIRRORED_REPEAT},Z={[pi]:t.NEAREST,[dH]:t.NEAREST_MIPMAP_NEAREST,[Yd]:t.NEAREST_MIPMAP_LINEAR,[wi]:t.LINEAR,[rg]:t.LINEAR_MIPMAP_NEAREST,[uo]:t.LINEAR_MIPMAP_LINEAR},z={[mH]:t.NEVER,[xH]:t.ALWAYS,[gH]:t.LESS,[Zy]:t.LEQUAL,[vH]:t.EQUAL,[Jy]:t.GEQUAL,[yH]:t.GREATER,[_H]:t.NOTEQUAL};function ie(O,P){if(P.type===Jr&&e.has("OES_texture_float_linear")===!1&&(P.magFilter===wi||P.magFilter===rg||P.magFilter===Yd||P.magFilter===uo||P.minFilter===wi||P.minFilter===rg||P.minFilter===Yd||P.minFilter===uo)&&Ht("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(O,t.TEXTURE_WRAP_S,Y[P.wrapS]),t.texParameteri(O,t.TEXTURE_WRAP_T,Y[P.wrapT]),(O===t.TEXTURE_3D||O===t.TEXTURE_2D_ARRAY)&&t.texParameteri(O,t.TEXTURE_WRAP_R,Y[P.wrapR]),t.texParameteri(O,t.TEXTURE_MAG_FILTER,Z[P.magFilter]),t.texParameteri(O,t.TEXTURE_MIN_FILTER,Z[P.minFilter]),P.compareFunction&&(t.texParameteri(O,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(O,t.TEXTURE_COMPARE_FUNC,z[P.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(P.magFilter===pi||P.minFilter!==Yd&&P.minFilter!==uo||P.type===Jr&&e.has("OES_texture_float_linear")===!1)return;if(P.anisotropy>1||i.get(P).__currentAnisotropy){const re=e.get("EXT_texture_filter_anisotropic");t.texParameterf(O,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(P.anisotropy,r.getMaxAnisotropy())),i.get(P).__currentAnisotropy=P.anisotropy}}}function ve(O,P){let re=!1;O.__webglInit===void 0&&(O.__webglInit=!0,P.addEventListener("dispose",I));const xe=P.source;let we=m.get(xe);we===void 0&&(we={},m.set(xe,we));const ye=V(P);if(ye!==O.__cacheKey){we[ye]===void 0&&(we[ye]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,re=!0),we[ye].usedTimes++;const Ke=we[O.__cacheKey];Ke!==void 0&&(we[O.__cacheKey].usedTimes--,Ke.usedTimes===0&&R(P)),O.__cacheKey=ye,O.__webglTexture=we[ye].texture}return re}function Ee(O,P,re){return Math.floor(Math.floor(O/re)/P)}function Ue(O,P,re,xe){const ye=O.updateRanges;if(ye.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,P.width,P.height,re,xe,P.data);else{ye.sort((Re,Be)=>Re.start-Be.start);let Ke=0;for(let Re=1;Re<ye.length;Re++){const Be=ye[Ke],Ze=ye[Re],rt=Be.start+Be.count,$e=Ee(Ze.start,P.width,4),Vt=Ee(Be.start,P.width,4);Ze.start<=rt+1&&$e===Vt&&Ee(Ze.start+Ze.count-1,P.width,4)===$e?Be.count=Math.max(Be.count,Ze.start+Ze.count-Be.start):(++Ke,ye[Ke]=Ze)}ye.length=Ke+1;const ke=t.getParameter(t.UNPACK_ROW_LENGTH),pt=t.getParameter(t.UNPACK_SKIP_PIXELS),Ct=t.getParameter(t.UNPACK_SKIP_ROWS);t.pixelStorei(t.UNPACK_ROW_LENGTH,P.width);for(let Re=0,Be=ye.length;Re<Be;Re++){const Ze=ye[Re],rt=Math.floor(Ze.start/4),$e=Math.ceil(Ze.count/4),Vt=rt%P.width,ne=Math.floor(rt/P.width),Ve=$e,Le=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,Vt),t.pixelStorei(t.UNPACK_SKIP_ROWS,ne),n.texSubImage2D(t.TEXTURE_2D,0,Vt,ne,Ve,Le,re,xe,P.data)}O.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,ke),t.pixelStorei(t.UNPACK_SKIP_PIXELS,pt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Ct)}}function le(O,P,re){let xe=t.TEXTURE_2D;(P.isDataArrayTexture||P.isCompressedArrayTexture)&&(xe=t.TEXTURE_2D_ARRAY),P.isData3DTexture&&(xe=t.TEXTURE_3D);const we=ve(O,P),ye=P.source;n.bindTexture(xe,O.__webglTexture,t.TEXTURE0+re);const Ke=i.get(ye);if(ye.version!==Ke.__version||we===!0){n.activeTexture(t.TEXTURE0+re);const ke=fn.getPrimaries(fn.workingColorSpace),pt=P.colorSpace===Sa?null:fn.getPrimaries(P.colorSpace),Ct=P.colorSpace===Sa||ke===pt?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,P.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,P.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ct);let Re=w(P.image,!1,r.maxTextureSize);Re=kt(P,Re);const Be=s.convert(P.format,P.colorSpace),Ze=s.convert(P.type);let rt=A(P.internalFormat,Be,Ze,P.colorSpace,P.isVideoTexture);ie(xe,P);let $e;const Vt=P.mipmaps,ne=P.isVideoTexture!==!0,Ve=Ke.__version===void 0||we===!0,Le=ye.dataReady,Xe=D(P,Re);if(P.isDepthTexture)rt=T(P.format===fo,P.type),Ve&&(ne?n.texStorage2D(t.TEXTURE_2D,1,rt,Re.width,Re.height):n.texImage2D(t.TEXTURE_2D,0,rt,Re.width,Re.height,0,Be,Ze,null));else if(P.isDataTexture)if(Vt.length>0){ne&&Ve&&n.texStorage2D(t.TEXTURE_2D,Xe,rt,Vt[0].width,Vt[0].height);for(let Pe=0,_e=Vt.length;Pe<_e;Pe++)$e=Vt[Pe],ne?Le&&n.texSubImage2D(t.TEXTURE_2D,Pe,0,0,$e.width,$e.height,Be,Ze,$e.data):n.texImage2D(t.TEXTURE_2D,Pe,rt,$e.width,$e.height,0,Be,Ze,$e.data);P.generateMipmaps=!1}else ne?(Ve&&n.texStorage2D(t.TEXTURE_2D,Xe,rt,Re.width,Re.height),Le&&Ue(P,Re,Be,Ze)):n.texImage2D(t.TEXTURE_2D,0,rt,Re.width,Re.height,0,Be,Ze,Re.data);else if(P.isCompressedTexture)if(P.isCompressedArrayTexture){ne&&Ve&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Xe,rt,Vt[0].width,Vt[0].height,Re.depth);for(let Pe=0,_e=Vt.length;Pe<_e;Pe++)if($e=Vt[Pe],P.format!==Ur)if(Be!==null)if(ne){if(Le)if(P.layerUpdates.size>0){const st=BE($e.width,$e.height,P.format,P.type);for(const Dt of P.layerUpdates){const mn=$e.data.subarray(Dt*st/$e.data.BYTES_PER_ELEMENT,(Dt+1)*st/$e.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Pe,0,0,Dt,$e.width,$e.height,1,Be,mn)}P.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Pe,0,0,0,$e.width,$e.height,Re.depth,Be,$e.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Pe,rt,$e.width,$e.height,Re.depth,0,$e.data,0,0);else Ht("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ne?Le&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Pe,0,0,0,$e.width,$e.height,Re.depth,Be,Ze,$e.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Pe,rt,$e.width,$e.height,Re.depth,0,Be,Ze,$e.data)}else{ne&&Ve&&n.texStorage2D(t.TEXTURE_2D,Xe,rt,Vt[0].width,Vt[0].height);for(let Pe=0,_e=Vt.length;Pe<_e;Pe++)$e=Vt[Pe],P.format!==Ur?Be!==null?ne?Le&&n.compressedTexSubImage2D(t.TEXTURE_2D,Pe,0,0,$e.width,$e.height,Be,$e.data):n.compressedTexImage2D(t.TEXTURE_2D,Pe,rt,$e.width,$e.height,0,$e.data):Ht("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ne?Le&&n.texSubImage2D(t.TEXTURE_2D,Pe,0,0,$e.width,$e.height,Be,Ze,$e.data):n.texImage2D(t.TEXTURE_2D,Pe,rt,$e.width,$e.height,0,Be,Ze,$e.data)}else if(P.isDataArrayTexture)if(ne){if(Ve&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Xe,rt,Re.width,Re.height,Re.depth),Le)if(P.layerUpdates.size>0){const Pe=BE(Re.width,Re.height,P.format,P.type);for(const _e of P.layerUpdates){const st=Re.data.subarray(_e*Pe/Re.data.BYTES_PER_ELEMENT,(_e+1)*Pe/Re.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,_e,Re.width,Re.height,1,Be,Ze,st)}P.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Re.width,Re.height,Re.depth,Be,Ze,Re.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,rt,Re.width,Re.height,Re.depth,0,Be,Ze,Re.data);else if(P.isData3DTexture)ne?(Ve&&n.texStorage3D(t.TEXTURE_3D,Xe,rt,Re.width,Re.height,Re.depth),Le&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Re.width,Re.height,Re.depth,Be,Ze,Re.data)):n.texImage3D(t.TEXTURE_3D,0,rt,Re.width,Re.height,Re.depth,0,Be,Ze,Re.data);else if(P.isFramebufferTexture){if(Ve)if(ne)n.texStorage2D(t.TEXTURE_2D,Xe,rt,Re.width,Re.height);else{let Pe=Re.width,_e=Re.height;for(let st=0;st<Xe;st++)n.texImage2D(t.TEXTURE_2D,st,rt,Pe,_e,0,Be,Ze,null),Pe>>=1,_e>>=1}}else if(Vt.length>0){if(ne&&Ve){const Pe=it(Vt[0]);n.texStorage2D(t.TEXTURE_2D,Xe,rt,Pe.width,Pe.height)}for(let Pe=0,_e=Vt.length;Pe<_e;Pe++)$e=Vt[Pe],ne?Le&&n.texSubImage2D(t.TEXTURE_2D,Pe,0,0,Be,Ze,$e):n.texImage2D(t.TEXTURE_2D,Pe,rt,Be,Ze,$e);P.generateMipmaps=!1}else if(ne){if(Ve){const Pe=it(Re);n.texStorage2D(t.TEXTURE_2D,Xe,rt,Pe.width,Pe.height)}Le&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Be,Ze,Re)}else n.texImage2D(t.TEXTURE_2D,0,rt,Be,Ze,Re);y(P)&&x(xe),Ke.__version=ye.version,P.onUpdate&&P.onUpdate(P)}O.__version=P.version}function be(O,P,re){if(P.image.length!==6)return;const xe=ve(O,P),we=P.source;n.bindTexture(t.TEXTURE_CUBE_MAP,O.__webglTexture,t.TEXTURE0+re);const ye=i.get(we);if(we.version!==ye.__version||xe===!0){n.activeTexture(t.TEXTURE0+re);const Ke=fn.getPrimaries(fn.workingColorSpace),ke=P.colorSpace===Sa?null:fn.getPrimaries(P.colorSpace),pt=P.colorSpace===Sa||Ke===ke?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,P.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,P.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,pt);const Ct=P.isCompressedTexture||P.image[0].isCompressedTexture,Re=P.image[0]&&P.image[0].isDataTexture,Be=[];for(let _e=0;_e<6;_e++)!Ct&&!Re?Be[_e]=w(P.image[_e],!0,r.maxCubemapSize):Be[_e]=Re?P.image[_e].image:P.image[_e],Be[_e]=kt(P,Be[_e]);const Ze=Be[0],rt=s.convert(P.format,P.colorSpace),$e=s.convert(P.type),Vt=A(P.internalFormat,rt,$e,P.colorSpace),ne=P.isVideoTexture!==!0,Ve=ye.__version===void 0||xe===!0,Le=we.dataReady;let Xe=D(P,Ze);ie(t.TEXTURE_CUBE_MAP,P);let Pe;if(Ct){ne&&Ve&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Xe,Vt,Ze.width,Ze.height);for(let _e=0;_e<6;_e++){Pe=Be[_e].mipmaps;for(let st=0;st<Pe.length;st++){const Dt=Pe[st];P.format!==Ur?rt!==null?ne?Le&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,st,0,0,Dt.width,Dt.height,rt,Dt.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,st,Vt,Dt.width,Dt.height,0,Dt.data):Ht("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,st,0,0,Dt.width,Dt.height,rt,$e,Dt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,st,Vt,Dt.width,Dt.height,0,rt,$e,Dt.data)}}}else{if(Pe=P.mipmaps,ne&&Ve){Pe.length>0&&Xe++;const _e=it(Be[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Xe,Vt,_e.width,_e.height)}for(let _e=0;_e<6;_e++)if(Re){ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,Be[_e].width,Be[_e].height,rt,$e,Be[_e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,Vt,Be[_e].width,Be[_e].height,0,rt,$e,Be[_e].data);for(let st=0;st<Pe.length;st++){const mn=Pe[st].image[_e].image;ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,st+1,0,0,mn.width,mn.height,rt,$e,mn.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,st+1,Vt,mn.width,mn.height,0,rt,$e,mn.data)}}else{ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,rt,$e,Be[_e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,Vt,rt,$e,Be[_e]);for(let st=0;st<Pe.length;st++){const Dt=Pe[st];ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,st+1,0,0,rt,$e,Dt.image[_e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,st+1,Vt,rt,$e,Dt.image[_e])}}}y(P)&&x(t.TEXTURE_CUBE_MAP),ye.__version=we.version,P.onUpdate&&P.onUpdate(P)}O.__version=P.version}function Se(O,P,re,xe,we,ye){const Ke=s.convert(re.format,re.colorSpace),ke=s.convert(re.type),pt=A(re.internalFormat,Ke,ke,re.colorSpace),Ct=i.get(P),Re=i.get(re);if(Re.__renderTarget=P,!Ct.__hasExternalTextures){const Be=Math.max(1,P.width>>ye),Ze=Math.max(1,P.height>>ye);we===t.TEXTURE_3D||we===t.TEXTURE_2D_ARRAY?n.texImage3D(we,ye,pt,Be,Ze,P.depth,0,Ke,ke,null):n.texImage2D(we,ye,pt,Be,Ze,0,Ke,ke,null)}n.bindFramebuffer(t.FRAMEBUFFER,O),Sn(P)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,xe,we,Re.__webglTexture,0,ee(P)):(we===t.TEXTURE_2D||we>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&we<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,xe,we,Re.__webglTexture,ye),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ne(O,P,re){if(t.bindRenderbuffer(t.RENDERBUFFER,O),P.depthBuffer){const xe=P.depthTexture,we=xe&&xe.isDepthTexture?xe.type:null,ye=T(P.stencilBuffer,we),Ke=P.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;Sn(P)?c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ee(P),ye,P.width,P.height):re?t.renderbufferStorageMultisample(t.RENDERBUFFER,ee(P),ye,P.width,P.height):t.renderbufferStorage(t.RENDERBUFFER,ye,P.width,P.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ke,t.RENDERBUFFER,O)}else{const xe=P.textures;for(let we=0;we<xe.length;we++){const ye=xe[we],Ke=s.convert(ye.format,ye.colorSpace),ke=s.convert(ye.type),pt=A(ye.internalFormat,Ke,ke,ye.colorSpace);Sn(P)?c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ee(P),pt,P.width,P.height):re?t.renderbufferStorageMultisample(t.RENDERBUFFER,ee(P),pt,P.width,P.height):t.renderbufferStorage(t.RENDERBUFFER,pt,P.width,P.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function et(O,P,re){const xe=P.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(t.FRAMEBUFFER,O),!(P.depthTexture&&P.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const we=i.get(P.depthTexture);if(we.__renderTarget=P,(!we.__webglTexture||P.depthTexture.image.width!==P.width||P.depthTexture.image.height!==P.height)&&(P.depthTexture.image.width=P.width,P.depthTexture.image.height=P.height,P.depthTexture.needsUpdate=!0),xe){if(we.__webglInit===void 0&&(we.__webglInit=!0,P.depthTexture.addEventListener("dispose",I)),we.__webglTexture===void 0){we.__webglTexture=t.createTexture(),n.bindTexture(t.TEXTURE_CUBE_MAP,we.__webglTexture),ie(t.TEXTURE_CUBE_MAP,P.depthTexture);const Ct=s.convert(P.depthTexture.format),Re=s.convert(P.depthTexture.type);let Be;P.depthTexture.format===Bs?Be=t.DEPTH_COMPONENT24:P.depthTexture.format===fo&&(Be=t.DEPTH24_STENCIL8);for(let Ze=0;Ze<6;Ze++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Ze,0,Be,P.width,P.height,0,Ct,Re,null)}}else q(P.depthTexture,0);const ye=we.__webglTexture,Ke=ee(P),ke=xe?t.TEXTURE_CUBE_MAP_POSITIVE_X+re:t.TEXTURE_2D,pt=P.depthTexture.format===fo?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(P.depthTexture.format===Bs)Sn(P)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,pt,ke,ye,0,Ke):t.framebufferTexture2D(t.FRAMEBUFFER,pt,ke,ye,0);else if(P.depthTexture.format===fo)Sn(P)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,pt,ke,ye,0,Ke):t.framebufferTexture2D(t.FRAMEBUFFER,pt,ke,ye,0);else throw new Error("Unknown depthTexture format")}function xt(O){const P=i.get(O),re=O.isWebGLCubeRenderTarget===!0;if(P.__boundDepthTexture!==O.depthTexture){const xe=O.depthTexture;if(P.__depthDisposeCallback&&P.__depthDisposeCallback(),xe){const we=()=>{delete P.__boundDepthTexture,delete P.__depthDisposeCallback,xe.removeEventListener("dispose",we)};xe.addEventListener("dispose",we),P.__depthDisposeCallback=we}P.__boundDepthTexture=xe}if(O.depthTexture&&!P.__autoAllocateDepthBuffer)if(re)for(let xe=0;xe<6;xe++)et(P.__webglFramebuffer[xe],O,xe);else{const xe=O.texture.mipmaps;xe&&xe.length>0?et(P.__webglFramebuffer[0],O,0):et(P.__webglFramebuffer,O,0)}else if(re){P.__webglDepthbuffer=[];for(let xe=0;xe<6;xe++)if(n.bindFramebuffer(t.FRAMEBUFFER,P.__webglFramebuffer[xe]),P.__webglDepthbuffer[xe]===void 0)P.__webglDepthbuffer[xe]=t.createRenderbuffer(),Ne(P.__webglDepthbuffer[xe],O,!1);else{const we=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ye=P.__webglDepthbuffer[xe];t.bindRenderbuffer(t.RENDERBUFFER,ye),t.framebufferRenderbuffer(t.FRAMEBUFFER,we,t.RENDERBUFFER,ye)}}else{const xe=O.texture.mipmaps;if(xe&&xe.length>0?n.bindFramebuffer(t.FRAMEBUFFER,P.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,P.__webglFramebuffer),P.__webglDepthbuffer===void 0)P.__webglDepthbuffer=t.createRenderbuffer(),Ne(P.__webglDepthbuffer,O,!1);else{const we=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ye=P.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,ye),t.framebufferRenderbuffer(t.FRAMEBUFFER,we,t.RENDERBUFFER,ye)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function pn(O,P,re){const xe=i.get(O);P!==void 0&&Se(xe.__webglFramebuffer,O,O.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),re!==void 0&&xt(O)}function ht(O){const P=O.texture,re=i.get(O),xe=i.get(P);O.addEventListener("dispose",U);const we=O.textures,ye=O.isWebGLCubeRenderTarget===!0,Ke=we.length>1;if(Ke||(xe.__webglTexture===void 0&&(xe.__webglTexture=t.createTexture()),xe.__version=P.version,o.memory.textures++),ye){re.__webglFramebuffer=[];for(let ke=0;ke<6;ke++)if(P.mipmaps&&P.mipmaps.length>0){re.__webglFramebuffer[ke]=[];for(let pt=0;pt<P.mipmaps.length;pt++)re.__webglFramebuffer[ke][pt]=t.createFramebuffer()}else re.__webglFramebuffer[ke]=t.createFramebuffer()}else{if(P.mipmaps&&P.mipmaps.length>0){re.__webglFramebuffer=[];for(let ke=0;ke<P.mipmaps.length;ke++)re.__webglFramebuffer[ke]=t.createFramebuffer()}else re.__webglFramebuffer=t.createFramebuffer();if(Ke)for(let ke=0,pt=we.length;ke<pt;ke++){const Ct=i.get(we[ke]);Ct.__webglTexture===void 0&&(Ct.__webglTexture=t.createTexture(),o.memory.textures++)}if(O.samples>0&&Sn(O)===!1){re.__webglMultisampledFramebuffer=t.createFramebuffer(),re.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,re.__webglMultisampledFramebuffer);for(let ke=0;ke<we.length;ke++){const pt=we[ke];re.__webglColorRenderbuffer[ke]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,re.__webglColorRenderbuffer[ke]);const Ct=s.convert(pt.format,pt.colorSpace),Re=s.convert(pt.type),Be=A(pt.internalFormat,Ct,Re,pt.colorSpace,O.isXRRenderTarget===!0),Ze=ee(O);t.renderbufferStorageMultisample(t.RENDERBUFFER,Ze,Be,O.width,O.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+ke,t.RENDERBUFFER,re.__webglColorRenderbuffer[ke])}t.bindRenderbuffer(t.RENDERBUFFER,null),O.depthBuffer&&(re.__webglDepthRenderbuffer=t.createRenderbuffer(),Ne(re.__webglDepthRenderbuffer,O,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(ye){n.bindTexture(t.TEXTURE_CUBE_MAP,xe.__webglTexture),ie(t.TEXTURE_CUBE_MAP,P);for(let ke=0;ke<6;ke++)if(P.mipmaps&&P.mipmaps.length>0)for(let pt=0;pt<P.mipmaps.length;pt++)Se(re.__webglFramebuffer[ke][pt],O,P,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+ke,pt);else Se(re.__webglFramebuffer[ke],O,P,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+ke,0);y(P)&&x(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(Ke){for(let ke=0,pt=we.length;ke<pt;ke++){const Ct=we[ke],Re=i.get(Ct);let Be=t.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(Be=O.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Be,Re.__webglTexture),ie(Be,Ct),Se(re.__webglFramebuffer,O,Ct,t.COLOR_ATTACHMENT0+ke,Be,0),y(Ct)&&x(Be)}n.unbindTexture()}else{let ke=t.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(ke=O.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(ke,xe.__webglTexture),ie(ke,P),P.mipmaps&&P.mipmaps.length>0)for(let pt=0;pt<P.mipmaps.length;pt++)Se(re.__webglFramebuffer[pt],O,P,t.COLOR_ATTACHMENT0,ke,pt);else Se(re.__webglFramebuffer,O,P,t.COLOR_ATTACHMENT0,ke,0);y(P)&&x(ke),n.unbindTexture()}O.depthBuffer&&xt(O)}function Ut(O){const P=O.textures;for(let re=0,xe=P.length;re<xe;re++){const we=P[re];if(y(we)){const ye=M(O),Ke=i.get(we).__webglTexture;n.bindTexture(ye,Ke),x(ye),n.unbindTexture()}}}const nn=[],Lt=[];function an(O){if(O.samples>0){if(Sn(O)===!1){const P=O.textures,re=O.width,xe=O.height;let we=t.COLOR_BUFFER_BIT;const ye=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ke=i.get(O),ke=P.length>1;if(ke)for(let Ct=0;Ct<P.length;Ct++)n.bindFramebuffer(t.FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ct,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,Ke.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ct,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,Ke.__webglMultisampledFramebuffer);const pt=O.texture.mipmaps;pt&&pt.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ke.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ke.__webglFramebuffer);for(let Ct=0;Ct<P.length;Ct++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(we|=t.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(we|=t.STENCIL_BUFFER_BIT)),ke){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,Ke.__webglColorRenderbuffer[Ct]);const Re=i.get(P[Ct]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Re,0)}t.blitFramebuffer(0,0,re,xe,0,0,re,xe,we,t.NEAREST),u===!0&&(nn.length=0,Lt.length=0,nn.push(t.COLOR_ATTACHMENT0+Ct),O.depthBuffer&&O.resolveDepthBuffer===!1&&(nn.push(ye),Lt.push(ye),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,Lt)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,nn))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),ke)for(let Ct=0;Ct<P.length;Ct++){n.bindFramebuffer(t.FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ct,t.RENDERBUFFER,Ke.__webglColorRenderbuffer[Ct]);const Re=i.get(P[Ct]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,Ke.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ct,t.TEXTURE_2D,Re,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ke.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&u){const P=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[P])}}}function ee(O){return Math.min(r.maxSamples,O.samples)}function Sn(O){const P=i.get(O);return O.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&P.__useRenderToTexture!==!1}function At(O){const P=o.render.frame;h.get(O)!==P&&(h.set(O,P),O.update())}function kt(O,P){const re=O.colorSpace,xe=O.format,we=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||re!==Mo&&re!==Sa&&(fn.getTransfer(re)===wn?(xe!==Ur||we!==fr)&&Ht("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):_n("WebGLTextures: Unsupported texture color space:",re)),P}function it(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(f.width=O.naturalWidth||O.width,f.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(f.width=O.displayWidth,f.height=O.displayHeight):(f.width=O.width,f.height=O.height),f}this.allocateTextureUnit=X,this.resetTextureUnits=W,this.setTexture2D=q,this.setTexture2DArray=J,this.setTexture3D=Q,this.setTextureCube=$,this.rebindTextures=pn,this.setupRenderTarget=ht,this.updateRenderTargetMipmap=Ut,this.updateMultisampleRenderTarget=an,this.setupDepthRenderbuffer=xt,this.setupFrameBufferTexture=Se,this.useMultisampledRTT=Sn,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function GW(t,e){function n(i,r=Sa){let s;const o=fn.getTransfer(r);if(i===fr)return t.UNSIGNED_BYTE;if(i===$y)return t.UNSIGNED_SHORT_4_4_4_4;if(i===Xy)return t.UNSIGNED_SHORT_5_5_5_1;if(i===KC)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===ZC)return t.UNSIGNED_INT_10F_11F_11F_REV;if(i===qC)return t.BYTE;if(i===YC)return t.SHORT;if(i===vu)return t.UNSIGNED_SHORT;if(i===jy)return t.INT;if(i===cs)return t.UNSIGNED_INT;if(i===Jr)return t.FLOAT;if(i===Os)return t.HALF_FLOAT;if(i===JC)return t.ALPHA;if(i===QC)return t.RGB;if(i===Ur)return t.RGBA;if(i===Bs)return t.DEPTH_COMPONENT;if(i===fo)return t.DEPTH_STENCIL;if(i===eR)return t.RED;if(i===qy)return t.RED_INTEGER;if(i===Vl)return t.RG;if(i===Yy)return t.RG_INTEGER;if(i===Ky)return t.RGBA_INTEGER;if(i===Of||i===Bf||i===zf||i===Vf)if(o===wn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Of)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Bf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===zf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Vf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Of)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Bf)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===zf)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Vf)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===$0||i===X0||i===q0||i===Y0)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===$0)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===X0)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===q0)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Y0)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===K0||i===Z0||i===J0||i===Q0||i===ev||i===tv||i===nv)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===K0||i===Z0)return o===wn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===J0)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===Q0)return s.COMPRESSED_R11_EAC;if(i===ev)return s.COMPRESSED_SIGNED_R11_EAC;if(i===tv)return s.COMPRESSED_RG11_EAC;if(i===nv)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===iv||i===rv||i===sv||i===av||i===ov||i===lv||i===cv||i===uv||i===dv||i===fv||i===hv||i===pv||i===mv||i===gv)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===iv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===rv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===sv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===av)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===ov)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===lv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===cv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===uv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===dv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===fv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===hv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===pv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===mv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===gv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===vv||i===yv||i===_v)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===vv)return o===wn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===yv)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===_v)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===xv||i===bv||i===Sv||i===wv)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===xv)return s.COMPRESSED_RED_RGTC1_EXT;if(i===bv)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Sv)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===wv)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===yu?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}const WW=`
|
|
4532
|
+
}`,OW=[new me(1,0,0),new me(-1,0,0),new me(0,1,0),new me(0,-1,0),new me(0,0,1),new me(0,0,-1)],BW=[new me(0,-1,0),new me(0,-1,0),new me(0,0,1),new me(0,0,-1),new me(0,-1,0),new me(0,-1,0)],l1=new Yn,$c=new me,Ng=new me;function zW(t,e,n){let i=new cR;const r=new bn,s=new bn,o=new zn,c=new tG,u=new nG,f={},h=n.maxTextureSize,p={[Pa]:Gi,[Gi]:Pa,[ks]:ks},m=new ds({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new bn},radius:{value:4}},vertexShader:UW,fragmentShader:FW}),v=m.clone();v.defines.HORIZONTAL_PASS=1;const _=new hs;_.setAttribute("position",new zr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new us(_,m),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ff;let x=this.type;this.render=function(I,U,S){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||I.length===0)return;this.type===WV&&(Ht("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Ff);const R=t.getRenderTarget(),H=t.getActiveCubeFace(),F=t.getActiveMipmapLevel(),W=t.state;W.setBlending(Ns),W.buffers.depth.getReversed()===!0?W.buffers.color.setClear(0,0,0,0):W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const X=x!==this.type;X&&U.traverse(function(V){V.material&&(Array.isArray(V.material)?V.material.forEach(q=>q.needsUpdate=!0):V.material.needsUpdate=!0)});for(let V=0,q=I.length;V<q;V++){const J=I[V],Q=J.shadow;if(Q===void 0){Ht("WebGLShadowMap:",J,"has no shadow.");continue}if(Q.autoUpdate===!1&&Q.needsUpdate===!1)continue;r.copy(Q.mapSize);const $=Q.getFrameExtents();r.multiply($),s.copy(Q.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/$.x),r.x=s.x*$.x,Q.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/$.y),r.y=s.y*$.y,Q.mapSize.y=s.y));const Y=t.state.buffers.depth.getReversed();if(Q.camera._reversedDepth=Y,Q.map===null||X===!0){if(Q.map!==null&&(Q.map.depthTexture!==null&&(Q.map.depthTexture.dispose(),Q.map.depthTexture=null),Q.map.dispose()),this.type===Jc){if(J.isPointLight){Ht("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}Q.map=new is(r.x,r.y,{format:Vl,type:Os,minFilter:wi,magFilter:wi,generateMipmaps:!1}),Q.map.texture.name=J.name+".shadowMap",Q.map.depthTexture=new _u(r.x,r.y,Jr),Q.map.depthTexture.name=J.name+".shadowMapDepth",Q.map.depthTexture.format=Bs,Q.map.depthTexture.compareFunction=null,Q.map.depthTexture.minFilter=pi,Q.map.depthTexture.magFilter=pi}else J.isPointLight?(Q.map=new gR(r.x),Q.map.depthTexture=new KH(r.x,cs)):(Q.map=new is(r.x,r.y),Q.map.depthTexture=new _u(r.x,r.y,cs)),Q.map.depthTexture.name=J.name+".shadowMap",Q.map.depthTexture.format=Bs,this.type===Ff?(Q.map.depthTexture.compareFunction=Y?Jy:Zy,Q.map.depthTexture.minFilter=wi,Q.map.depthTexture.magFilter=wi):(Q.map.depthTexture.compareFunction=null,Q.map.depthTexture.minFilter=pi,Q.map.depthTexture.magFilter=pi);Q.camera.updateProjectionMatrix()}const Z=Q.map.isWebGLCubeRenderTarget?6:1;for(let z=0;z<Z;z++){if(Q.map.isWebGLCubeRenderTarget)t.setRenderTarget(Q.map,z),t.clear();else{z===0&&(t.setRenderTarget(Q.map),t.clear());const ie=Q.getViewport(z);o.set(s.x*ie.x,s.y*ie.y,s.x*ie.z,s.y*ie.w),W.viewport(o)}if(J.isPointLight){const ie=Q.camera,_e=Q.matrix,Ee=J.distance||ie.far;Ee!==ie.far&&(ie.far=Ee,ie.updateProjectionMatrix()),$c.setFromMatrixPosition(J.matrixWorld),ie.position.copy($c),Ng.copy(ie.position),Ng.add(OW[z]),ie.up.copy(BW[z]),ie.lookAt(Ng),ie.updateMatrixWorld(),_e.makeTranslation(-$c.x,-$c.y,-$c.z),l1.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),Q._frustum.setFromProjectionMatrix(l1,ie.coordinateSystem,ie.reversedDepth)}else Q.updateMatrices(J);i=Q.getFrustum(),T(U,S,Q.camera,J,this.type)}Q.isPointLightShadow!==!0&&this.type===Jc&&M(Q,S),Q.needsUpdate=!1}x=this.type,y.needsUpdate=!1,t.setRenderTarget(R,H,F)};function M(I,U){const S=e.update(w);m.defines.VSM_SAMPLES!==I.blurSamples&&(m.defines.VSM_SAMPLES=I.blurSamples,v.defines.VSM_SAMPLES=I.blurSamples,m.needsUpdate=!0,v.needsUpdate=!0),I.mapPass===null&&(I.mapPass=new is(r.x,r.y,{format:Vl,type:Os})),m.uniforms.shadow_pass.value=I.map.depthTexture,m.uniforms.resolution.value=I.mapSize,m.uniforms.radius.value=I.radius,t.setRenderTarget(I.mapPass),t.clear(),t.renderBufferDirect(U,null,S,m,w,null),v.uniforms.shadow_pass.value=I.mapPass.texture,v.uniforms.resolution.value=I.mapSize,v.uniforms.radius.value=I.radius,t.setRenderTarget(I.map),t.clear(),t.renderBufferDirect(U,null,S,v,w,null)}function A(I,U,S,R){let H=null;const F=S.isPointLight===!0?I.customDistanceMaterial:I.customDepthMaterial;if(F!==void 0)H=F;else if(H=S.isPointLight===!0?u:c,t.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){const W=H.uuid,X=U.uuid;let V=f[W];V===void 0&&(V={},f[W]=V);let q=V[X];q===void 0&&(q=H.clone(),V[X]=q,U.addEventListener("dispose",D)),H=q}if(H.visible=U.visible,H.wireframe=U.wireframe,R===Jc?H.side=U.shadowSide!==null?U.shadowSide:U.side:H.side=U.shadowSide!==null?U.shadowSide:p[U.side],H.alphaMap=U.alphaMap,H.alphaTest=U.alphaToCoverage===!0?.5:U.alphaTest,H.map=U.map,H.clipShadows=U.clipShadows,H.clippingPlanes=U.clippingPlanes,H.clipIntersection=U.clipIntersection,H.displacementMap=U.displacementMap,H.displacementScale=U.displacementScale,H.displacementBias=U.displacementBias,H.wireframeLinewidth=U.wireframeLinewidth,H.linewidth=U.linewidth,S.isPointLight===!0&&H.isMeshDistanceMaterial===!0){const W=t.properties.get(H);W.light=S}return H}function T(I,U,S,R,H){if(I.visible===!1)return;if(I.layers.test(U.layers)&&(I.isMesh||I.isLine||I.isPoints)&&(I.castShadow||I.receiveShadow&&H===Jc)&&(!I.frustumCulled||i.intersectsObject(I))){I.modelViewMatrix.multiplyMatrices(S.matrixWorldInverse,I.matrixWorld);const X=e.update(I),V=I.material;if(Array.isArray(V)){const q=X.groups;for(let J=0,Q=q.length;J<Q;J++){const $=q[J],Y=V[$.materialIndex];if(Y&&Y.visible){const Z=A(I,Y,R,H);I.onBeforeShadow(t,I,U,S,X,Z,$),t.renderBufferDirect(S,null,X,Z,I,$),I.onAfterShadow(t,I,U,S,X,Z,$)}}}else if(V.visible){const q=A(I,V,R,H);I.onBeforeShadow(t,I,U,S,X,q,null),t.renderBufferDirect(S,null,X,q,I,null),I.onAfterShadow(t,I,U,S,X,q,null)}}const W=I.children;for(let X=0,V=W.length;X<V;X++)T(W[X],U,S,R,H)}function D(I){I.target.removeEventListener("dispose",D);for(const S in f){const R=f[S],H=I.target.uuid;H in R&&(R[H].dispose(),delete R[H])}}}function VW(t,e){function n(){let ne=!1;const Ve=new zn;let Le=null;const Xe=new zn(0,0,0,0);return{setMask:function(Pe){Le!==Pe&&!ne&&(t.colorMask(Pe,Pe,Pe,Pe),Le=Pe)},setLocked:function(Pe){ne=Pe},setClear:function(Pe,ye,st,Dt,mn){mn===!0&&(Pe*=Dt,ye*=Dt,st*=Dt),Ve.set(Pe,ye,st,Dt),Xe.equals(Ve)===!1&&(t.clearColor(Pe,ye,st,Dt),Xe.copy(Ve))},reset:function(){ne=!1,Le=null,Xe.set(-1,0,0,0)}}}function i(){let ne=!1,Ve=!1,Le=null,Xe=null,Pe=null;return{setReversed:function(ye){if(Ve!==ye){const st=e.get("EXT_clip_control");ye?st.clipControlEXT(st.LOWER_LEFT_EXT,st.ZERO_TO_ONE_EXT):st.clipControlEXT(st.LOWER_LEFT_EXT,st.NEGATIVE_ONE_TO_ONE_EXT),Ve=ye;const Dt=Pe;Pe=null,this.setClear(Dt)}},getReversed:function(){return Ve},setTest:function(ye){ye?be(t.DEPTH_TEST):Se(t.DEPTH_TEST)},setMask:function(ye){Le!==ye&&!ne&&(t.depthMask(ye),Le=ye)},setFunc:function(ye){if(Ve&&(ye=EH[ye]),Xe!==ye){switch(ye){case F0:t.depthFunc(t.NEVER);break;case O0:t.depthFunc(t.ALWAYS);break;case B0:t.depthFunc(t.LESS);break;case Bl:t.depthFunc(t.LEQUAL);break;case z0:t.depthFunc(t.EQUAL);break;case V0:t.depthFunc(t.GEQUAL);break;case H0:t.depthFunc(t.GREATER);break;case G0:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}Xe=ye}},setLocked:function(ye){ne=ye},setClear:function(ye){Pe!==ye&&(Pe=ye,Ve&&(ye=1-ye),t.clearDepth(ye))},reset:function(){ne=!1,Le=null,Xe=null,Pe=null,Ve=!1}}}function r(){let ne=!1,Ve=null,Le=null,Xe=null,Pe=null,ye=null,st=null,Dt=null,mn=null;return{setTest:function(Kt){ne||(Kt?be(t.STENCIL_TEST):Se(t.STENCIL_TEST))},setMask:function(Kt){Ve!==Kt&&!ne&&(t.stencilMask(Kt),Ve=Kt)},setFunc:function(Kt,ci,ii){(Le!==Kt||Xe!==ci||Pe!==ii)&&(t.stencilFunc(Kt,ci,ii),Le=Kt,Xe=ci,Pe=ii)},setOp:function(Kt,ci,ii){(ye!==Kt||st!==ci||Dt!==ii)&&(t.stencilOp(Kt,ci,ii),ye=Kt,st=ci,Dt=ii)},setLocked:function(Kt){ne=Kt},setClear:function(Kt){mn!==Kt&&(t.clearStencil(Kt),mn=Kt)},reset:function(){ne=!1,Ve=null,Le=null,Xe=null,Pe=null,ye=null,st=null,Dt=null,mn=null}}}const s=new n,o=new i,c=new r,u=new WeakMap,f=new WeakMap;let h={},p={},m=new WeakMap,v=[],_=null,w=!1,y=null,x=null,M=null,A=null,T=null,D=null,I=null,U=new Mn(0,0,0),S=0,R=!1,H=null,F=null,W=null,X=null,V=null;const q=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let J=!1,Q=0;const $=t.getParameter(t.VERSION);$.indexOf("WebGL")!==-1?(Q=parseFloat(/^WebGL (\d)/.exec($)[1]),J=Q>=1):$.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),J=Q>=2);let Y=null,Z={};const z=t.getParameter(t.SCISSOR_BOX),ie=t.getParameter(t.VIEWPORT),_e=new zn().fromArray(z),Ee=new zn().fromArray(ie);function Ue(ne,Ve,Le,Xe){const Pe=new Uint8Array(4),ye=t.createTexture();t.bindTexture(ne,ye),t.texParameteri(ne,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(ne,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let st=0;st<Le;st++)ne===t.TEXTURE_3D||ne===t.TEXTURE_2D_ARRAY?t.texImage3D(Ve,0,t.RGBA,1,1,Xe,0,t.RGBA,t.UNSIGNED_BYTE,Pe):t.texImage2D(Ve+st,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,Pe);return ye}const le={};le[t.TEXTURE_2D]=Ue(t.TEXTURE_2D,t.TEXTURE_2D,1),le[t.TEXTURE_CUBE_MAP]=Ue(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),le[t.TEXTURE_2D_ARRAY]=Ue(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),le[t.TEXTURE_3D]=Ue(t.TEXTURE_3D,t.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),c.setClear(0),be(t.DEPTH_TEST),o.setFunc(Bl),Lt(!1),an(pE),be(t.CULL_FACE),Ut(Ns);function be(ne){h[ne]!==!0&&(t.enable(ne),h[ne]=!0)}function Se(ne){h[ne]!==!1&&(t.disable(ne),h[ne]=!1)}function Ne(ne,Ve){return p[ne]!==Ve?(t.bindFramebuffer(ne,Ve),p[ne]=Ve,ne===t.DRAW_FRAMEBUFFER&&(p[t.FRAMEBUFFER]=Ve),ne===t.FRAMEBUFFER&&(p[t.DRAW_FRAMEBUFFER]=Ve),!0):!1}function et(ne,Ve){let Le=v,Xe=!1;if(ne){Le=m.get(Ve),Le===void 0&&(Le=[],m.set(Ve,Le));const Pe=ne.textures;if(Le.length!==Pe.length||Le[0]!==t.COLOR_ATTACHMENT0){for(let ye=0,st=Pe.length;ye<st;ye++)Le[ye]=t.COLOR_ATTACHMENT0+ye;Le.length=Pe.length,Xe=!0}}else Le[0]!==t.BACK&&(Le[0]=t.BACK,Xe=!0);Xe&&t.drawBuffers(Le)}function xt(ne){return _!==ne?(t.useProgram(ne),_=ne,!0):!1}const pn={[ro]:t.FUNC_ADD,[$V]:t.FUNC_SUBTRACT,[XV]:t.FUNC_REVERSE_SUBTRACT};pn[qV]=t.MIN,pn[YV]=t.MAX;const ht={[KV]:t.ZERO,[ZV]:t.ONE,[JV]:t.SRC_COLOR,[I0]:t.SRC_ALPHA,[rH]:t.SRC_ALPHA_SATURATE,[nH]:t.DST_COLOR,[eH]:t.DST_ALPHA,[QV]:t.ONE_MINUS_SRC_COLOR,[U0]:t.ONE_MINUS_SRC_ALPHA,[iH]:t.ONE_MINUS_DST_COLOR,[tH]:t.ONE_MINUS_DST_ALPHA,[sH]:t.CONSTANT_COLOR,[aH]:t.ONE_MINUS_CONSTANT_COLOR,[oH]:t.CONSTANT_ALPHA,[lH]:t.ONE_MINUS_CONSTANT_ALPHA};function Ut(ne,Ve,Le,Xe,Pe,ye,st,Dt,mn,Kt){if(ne===Ns){w===!0&&(Se(t.BLEND),w=!1);return}if(w===!1&&(be(t.BLEND),w=!0),ne!==jV){if(ne!==y||Kt!==R){if((x!==ro||T!==ro)&&(t.blendEquation(t.FUNC_ADD),x=ro,T=ro),Kt)switch(ne){case vo:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case mE:t.blendFunc(t.ONE,t.ONE);break;case gE:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case vE:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:_n("WebGLState: Invalid blending: ",ne);break}else switch(ne){case vo:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case mE:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case gE:_n("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case vE:_n("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:_n("WebGLState: Invalid blending: ",ne);break}M=null,A=null,D=null,I=null,U.set(0,0,0),S=0,y=ne,R=Kt}return}Pe=Pe||Ve,ye=ye||Le,st=st||Xe,(Ve!==x||Pe!==T)&&(t.blendEquationSeparate(pn[Ve],pn[Pe]),x=Ve,T=Pe),(Le!==M||Xe!==A||ye!==D||st!==I)&&(t.blendFuncSeparate(ht[Le],ht[Xe],ht[ye],ht[st]),M=Le,A=Xe,D=ye,I=st),(Dt.equals(U)===!1||mn!==S)&&(t.blendColor(Dt.r,Dt.g,Dt.b,mn),U.copy(Dt),S=mn),y=ne,R=!1}function nn(ne,Ve){ne.side===ks?Se(t.CULL_FACE):be(t.CULL_FACE);let Le=ne.side===Gi;Ve&&(Le=!Le),Lt(Le),ne.blending===vo&&ne.transparent===!1?Ut(Ns):Ut(ne.blending,ne.blendEquation,ne.blendSrc,ne.blendDst,ne.blendEquationAlpha,ne.blendSrcAlpha,ne.blendDstAlpha,ne.blendColor,ne.blendAlpha,ne.premultipliedAlpha),o.setFunc(ne.depthFunc),o.setTest(ne.depthTest),o.setMask(ne.depthWrite),s.setMask(ne.colorWrite);const Xe=ne.stencilWrite;c.setTest(Xe),Xe&&(c.setMask(ne.stencilWriteMask),c.setFunc(ne.stencilFunc,ne.stencilRef,ne.stencilFuncMask),c.setOp(ne.stencilFail,ne.stencilZFail,ne.stencilZPass)),Sn(ne.polygonOffset,ne.polygonOffsetFactor,ne.polygonOffsetUnits),ne.alphaToCoverage===!0?be(t.SAMPLE_ALPHA_TO_COVERAGE):Se(t.SAMPLE_ALPHA_TO_COVERAGE)}function Lt(ne){H!==ne&&(ne?t.frontFace(t.CW):t.frontFace(t.CCW),H=ne)}function an(ne){ne!==HV?(be(t.CULL_FACE),ne!==F&&(ne===pE?t.cullFace(t.BACK):ne===GV?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):Se(t.CULL_FACE),F=ne}function ee(ne){ne!==W&&(J&&t.lineWidth(ne),W=ne)}function Sn(ne,Ve,Le){ne?(be(t.POLYGON_OFFSET_FILL),(X!==Ve||V!==Le)&&(X=Ve,V=Le,o.getReversed()&&(Ve=-Ve),t.polygonOffset(Ve,Le))):Se(t.POLYGON_OFFSET_FILL)}function At(ne){ne?be(t.SCISSOR_TEST):Se(t.SCISSOR_TEST)}function kt(ne){ne===void 0&&(ne=t.TEXTURE0+q-1),Y!==ne&&(t.activeTexture(ne),Y=ne)}function it(ne,Ve,Le){Le===void 0&&(Y===null?Le=t.TEXTURE0+q-1:Le=Y);let Xe=Z[Le];Xe===void 0&&(Xe={type:void 0,texture:void 0},Z[Le]=Xe),(Xe.type!==ne||Xe.texture!==Ve)&&(Y!==Le&&(t.activeTexture(Le),Y=Le),t.bindTexture(ne,Ve||le[ne]),Xe.type=ne,Xe.texture=Ve)}function O(){const ne=Z[Y];ne!==void 0&&ne.type!==void 0&&(t.bindTexture(ne.type,null),ne.type=void 0,ne.texture=void 0)}function P(){try{t.compressedTexImage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function re(){try{t.compressedTexImage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function xe(){try{t.texSubImage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function we(){try{t.texSubImage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function ve(){try{t.compressedTexSubImage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function Ke(){try{t.compressedTexSubImage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function ke(){try{t.texStorage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function pt(){try{t.texStorage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function Ct(){try{t.texImage2D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function Re(){try{t.texImage3D(...arguments)}catch(ne){_n("WebGLState:",ne)}}function Be(ne){_e.equals(ne)===!1&&(t.scissor(ne.x,ne.y,ne.z,ne.w),_e.copy(ne))}function Ze(ne){Ee.equals(ne)===!1&&(t.viewport(ne.x,ne.y,ne.z,ne.w),Ee.copy(ne))}function rt(ne,Ve){let Le=f.get(Ve);Le===void 0&&(Le=new WeakMap,f.set(Ve,Le));let Xe=Le.get(ne);Xe===void 0&&(Xe=t.getUniformBlockIndex(Ve,ne.name),Le.set(ne,Xe))}function $e(ne,Ve){const Xe=f.get(Ve).get(ne);u.get(Ve)!==Xe&&(t.uniformBlockBinding(Ve,Xe,ne.__bindingPointIndex),u.set(Ve,Xe))}function Vt(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),o.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),h={},Y=null,Z={},p={},m=new WeakMap,v=[],_=null,w=!1,y=null,x=null,M=null,A=null,T=null,D=null,I=null,U=new Mn(0,0,0),S=0,R=!1,H=null,F=null,W=null,X=null,V=null,_e.set(0,0,t.canvas.width,t.canvas.height),Ee.set(0,0,t.canvas.width,t.canvas.height),s.reset(),o.reset(),c.reset()}return{buffers:{color:s,depth:o,stencil:c},enable:be,disable:Se,bindFramebuffer:Ne,drawBuffers:et,useProgram:xt,setBlending:Ut,setMaterial:nn,setFlipSided:Lt,setCullFace:an,setLineWidth:ee,setPolygonOffset:Sn,setScissorTest:At,activeTexture:kt,bindTexture:it,unbindTexture:O,compressedTexImage2D:P,compressedTexImage3D:re,texImage2D:Ct,texImage3D:Re,updateUBOMapping:rt,uniformBlockBinding:$e,texStorage2D:ke,texStorage3D:pt,texSubImage2D:xe,texSubImage3D:we,compressedTexSubImage2D:ve,compressedTexSubImage3D:Ke,scissor:Be,viewport:Ze,reset:Vt}}function HW(t,e,n,i,r,s,o){const c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),f=new bn,h=new WeakMap;let p;const m=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(O,P){return v?new OffscreenCanvas(O,P):vh("canvas")}function w(O,P,re){let xe=1;const we=it(O);if((we.width>re||we.height>re)&&(xe=re/Math.max(we.width,we.height)),xe<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const ve=Math.floor(xe*we.width),Ke=Math.floor(xe*we.height);p===void 0&&(p=_(ve,Ke));const ke=P?_(ve,Ke):p;return ke.width=ve,ke.height=Ke,ke.getContext("2d").drawImage(O,0,0,ve,Ke),Ht("WebGLRenderer: Texture has been resized from ("+we.width+"x"+we.height+") to ("+ve+"x"+Ke+")."),ke}else return"data"in O&&Ht("WebGLRenderer: Image in DataTexture is too big ("+we.width+"x"+we.height+")."),O;return O}function y(O){return O.generateMipmaps}function x(O){t.generateMipmap(O)}function M(O){return O.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?t.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function A(O,P,re,xe,we=!1){if(O!==null){if(t[O]!==void 0)return t[O];Ht("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let ve=P;if(P===t.RED&&(re===t.FLOAT&&(ve=t.R32F),re===t.HALF_FLOAT&&(ve=t.R16F),re===t.UNSIGNED_BYTE&&(ve=t.R8)),P===t.RED_INTEGER&&(re===t.UNSIGNED_BYTE&&(ve=t.R8UI),re===t.UNSIGNED_SHORT&&(ve=t.R16UI),re===t.UNSIGNED_INT&&(ve=t.R32UI),re===t.BYTE&&(ve=t.R8I),re===t.SHORT&&(ve=t.R16I),re===t.INT&&(ve=t.R32I)),P===t.RG&&(re===t.FLOAT&&(ve=t.RG32F),re===t.HALF_FLOAT&&(ve=t.RG16F),re===t.UNSIGNED_BYTE&&(ve=t.RG8)),P===t.RG_INTEGER&&(re===t.UNSIGNED_BYTE&&(ve=t.RG8UI),re===t.UNSIGNED_SHORT&&(ve=t.RG16UI),re===t.UNSIGNED_INT&&(ve=t.RG32UI),re===t.BYTE&&(ve=t.RG8I),re===t.SHORT&&(ve=t.RG16I),re===t.INT&&(ve=t.RG32I)),P===t.RGB_INTEGER&&(re===t.UNSIGNED_BYTE&&(ve=t.RGB8UI),re===t.UNSIGNED_SHORT&&(ve=t.RGB16UI),re===t.UNSIGNED_INT&&(ve=t.RGB32UI),re===t.BYTE&&(ve=t.RGB8I),re===t.SHORT&&(ve=t.RGB16I),re===t.INT&&(ve=t.RGB32I)),P===t.RGBA_INTEGER&&(re===t.UNSIGNED_BYTE&&(ve=t.RGBA8UI),re===t.UNSIGNED_SHORT&&(ve=t.RGBA16UI),re===t.UNSIGNED_INT&&(ve=t.RGBA32UI),re===t.BYTE&&(ve=t.RGBA8I),re===t.SHORT&&(ve=t.RGBA16I),re===t.INT&&(ve=t.RGBA32I)),P===t.RGB&&(re===t.UNSIGNED_INT_5_9_9_9_REV&&(ve=t.RGB9_E5),re===t.UNSIGNED_INT_10F_11F_11F_REV&&(ve=t.R11F_G11F_B10F)),P===t.RGBA){const Ke=we?mh:fn.getTransfer(xe);re===t.FLOAT&&(ve=t.RGBA32F),re===t.HALF_FLOAT&&(ve=t.RGBA16F),re===t.UNSIGNED_BYTE&&(ve=Ke===wn?t.SRGB8_ALPHA8:t.RGBA8),re===t.UNSIGNED_SHORT_4_4_4_4&&(ve=t.RGBA4),re===t.UNSIGNED_SHORT_5_5_5_1&&(ve=t.RGB5_A1)}return(ve===t.R16F||ve===t.R32F||ve===t.RG16F||ve===t.RG32F||ve===t.RGBA16F||ve===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ve}function T(O,P){let re;return O?P===null||P===cs||P===yu?re=t.DEPTH24_STENCIL8:P===Jr?re=t.DEPTH32F_STENCIL8:P===vu&&(re=t.DEPTH24_STENCIL8,Ht("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):P===null||P===cs||P===yu?re=t.DEPTH_COMPONENT24:P===Jr?re=t.DEPTH_COMPONENT32F:P===vu&&(re=t.DEPTH_COMPONENT16),re}function D(O,P){return y(O)===!0||O.isFramebufferTexture&&O.minFilter!==pi&&O.minFilter!==wi?Math.log2(Math.max(P.width,P.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?P.mipmaps.length:1}function I(O){const P=O.target;P.removeEventListener("dispose",I),S(P),P.isVideoTexture&&h.delete(P)}function U(O){const P=O.target;P.removeEventListener("dispose",U),H(P)}function S(O){const P=i.get(O);if(P.__webglInit===void 0)return;const re=O.source,xe=m.get(re);if(xe){const we=xe[P.__cacheKey];we.usedTimes--,we.usedTimes===0&&R(O),Object.keys(xe).length===0&&m.delete(re)}i.remove(O)}function R(O){const P=i.get(O);t.deleteTexture(P.__webglTexture);const re=O.source,xe=m.get(re);delete xe[P.__cacheKey],o.memory.textures--}function H(O){const P=i.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),i.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let xe=0;xe<6;xe++){if(Array.isArray(P.__webglFramebuffer[xe]))for(let we=0;we<P.__webglFramebuffer[xe].length;we++)t.deleteFramebuffer(P.__webglFramebuffer[xe][we]);else t.deleteFramebuffer(P.__webglFramebuffer[xe]);P.__webglDepthbuffer&&t.deleteRenderbuffer(P.__webglDepthbuffer[xe])}else{if(Array.isArray(P.__webglFramebuffer))for(let xe=0;xe<P.__webglFramebuffer.length;xe++)t.deleteFramebuffer(P.__webglFramebuffer[xe]);else t.deleteFramebuffer(P.__webglFramebuffer);if(P.__webglDepthbuffer&&t.deleteRenderbuffer(P.__webglDepthbuffer),P.__webglMultisampledFramebuffer&&t.deleteFramebuffer(P.__webglMultisampledFramebuffer),P.__webglColorRenderbuffer)for(let xe=0;xe<P.__webglColorRenderbuffer.length;xe++)P.__webglColorRenderbuffer[xe]&&t.deleteRenderbuffer(P.__webglColorRenderbuffer[xe]);P.__webglDepthRenderbuffer&&t.deleteRenderbuffer(P.__webglDepthRenderbuffer)}const re=O.textures;for(let xe=0,we=re.length;xe<we;xe++){const ve=i.get(re[xe]);ve.__webglTexture&&(t.deleteTexture(ve.__webglTexture),o.memory.textures--),i.remove(re[xe])}i.remove(O)}let F=0;function W(){F=0}function X(){const O=F;return O>=r.maxTextures&&Ht("WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+r.maxTextures),F+=1,O}function V(O){const P=[];return P.push(O.wrapS),P.push(O.wrapT),P.push(O.wrapR||0),P.push(O.magFilter),P.push(O.minFilter),P.push(O.anisotropy),P.push(O.internalFormat),P.push(O.format),P.push(O.type),P.push(O.generateMipmaps),P.push(O.premultiplyAlpha),P.push(O.flipY),P.push(O.unpackAlignment),P.push(O.colorSpace),P.join()}function q(O,P){const re=i.get(O);if(O.isVideoTexture&&At(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&re.__version!==O.version){const xe=O.image;if(xe===null)Ht("WebGLRenderer: Texture marked for update but no image data found.");else if(xe.complete===!1)Ht("WebGLRenderer: Texture marked for update but image is incomplete");else{le(re,O,P);return}}else O.isExternalTexture&&(re.__webglTexture=O.sourceTexture?O.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,re.__webglTexture,t.TEXTURE0+P)}function J(O,P){const re=i.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&re.__version!==O.version){le(re,O,P);return}else O.isExternalTexture&&(re.__webglTexture=O.sourceTexture?O.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,re.__webglTexture,t.TEXTURE0+P)}function Q(O,P){const re=i.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&re.__version!==O.version){le(re,O,P);return}n.bindTexture(t.TEXTURE_3D,re.__webglTexture,t.TEXTURE0+P)}function $(O,P){const re=i.get(O);if(O.isCubeDepthTexture!==!0&&O.version>0&&re.__version!==O.version){be(re,O,P);return}n.bindTexture(t.TEXTURE_CUBE_MAP,re.__webglTexture,t.TEXTURE0+P)}const Y={[W0]:t.REPEAT,[Ls]:t.CLAMP_TO_EDGE,[j0]:t.MIRRORED_REPEAT},Z={[pi]:t.NEAREST,[dH]:t.NEAREST_MIPMAP_NEAREST,[Yd]:t.NEAREST_MIPMAP_LINEAR,[wi]:t.LINEAR,[rg]:t.LINEAR_MIPMAP_NEAREST,[uo]:t.LINEAR_MIPMAP_LINEAR},z={[mH]:t.NEVER,[xH]:t.ALWAYS,[gH]:t.LESS,[Zy]:t.LEQUAL,[vH]:t.EQUAL,[Jy]:t.GEQUAL,[yH]:t.GREATER,[_H]:t.NOTEQUAL};function ie(O,P){if(P.type===Jr&&e.has("OES_texture_float_linear")===!1&&(P.magFilter===wi||P.magFilter===rg||P.magFilter===Yd||P.magFilter===uo||P.minFilter===wi||P.minFilter===rg||P.minFilter===Yd||P.minFilter===uo)&&Ht("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(O,t.TEXTURE_WRAP_S,Y[P.wrapS]),t.texParameteri(O,t.TEXTURE_WRAP_T,Y[P.wrapT]),(O===t.TEXTURE_3D||O===t.TEXTURE_2D_ARRAY)&&t.texParameteri(O,t.TEXTURE_WRAP_R,Y[P.wrapR]),t.texParameteri(O,t.TEXTURE_MAG_FILTER,Z[P.magFilter]),t.texParameteri(O,t.TEXTURE_MIN_FILTER,Z[P.minFilter]),P.compareFunction&&(t.texParameteri(O,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(O,t.TEXTURE_COMPARE_FUNC,z[P.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(P.magFilter===pi||P.minFilter!==Yd&&P.minFilter!==uo||P.type===Jr&&e.has("OES_texture_float_linear")===!1)return;if(P.anisotropy>1||i.get(P).__currentAnisotropy){const re=e.get("EXT_texture_filter_anisotropic");t.texParameterf(O,re.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(P.anisotropy,r.getMaxAnisotropy())),i.get(P).__currentAnisotropy=P.anisotropy}}}function _e(O,P){let re=!1;O.__webglInit===void 0&&(O.__webglInit=!0,P.addEventListener("dispose",I));const xe=P.source;let we=m.get(xe);we===void 0&&(we={},m.set(xe,we));const ve=V(P);if(ve!==O.__cacheKey){we[ve]===void 0&&(we[ve]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,re=!0),we[ve].usedTimes++;const Ke=we[O.__cacheKey];Ke!==void 0&&(we[O.__cacheKey].usedTimes--,Ke.usedTimes===0&&R(P)),O.__cacheKey=ve,O.__webglTexture=we[ve].texture}return re}function Ee(O,P,re){return Math.floor(Math.floor(O/re)/P)}function Ue(O,P,re,xe){const ve=O.updateRanges;if(ve.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,P.width,P.height,re,xe,P.data);else{ve.sort((Re,Be)=>Re.start-Be.start);let Ke=0;for(let Re=1;Re<ve.length;Re++){const Be=ve[Ke],Ze=ve[Re],rt=Be.start+Be.count,$e=Ee(Ze.start,P.width,4),Vt=Ee(Be.start,P.width,4);Ze.start<=rt+1&&$e===Vt&&Ee(Ze.start+Ze.count-1,P.width,4)===$e?Be.count=Math.max(Be.count,Ze.start+Ze.count-Be.start):(++Ke,ve[Ke]=Ze)}ve.length=Ke+1;const ke=t.getParameter(t.UNPACK_ROW_LENGTH),pt=t.getParameter(t.UNPACK_SKIP_PIXELS),Ct=t.getParameter(t.UNPACK_SKIP_ROWS);t.pixelStorei(t.UNPACK_ROW_LENGTH,P.width);for(let Re=0,Be=ve.length;Re<Be;Re++){const Ze=ve[Re],rt=Math.floor(Ze.start/4),$e=Math.ceil(Ze.count/4),Vt=rt%P.width,ne=Math.floor(rt/P.width),Ve=$e,Le=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,Vt),t.pixelStorei(t.UNPACK_SKIP_ROWS,ne),n.texSubImage2D(t.TEXTURE_2D,0,Vt,ne,Ve,Le,re,xe,P.data)}O.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,ke),t.pixelStorei(t.UNPACK_SKIP_PIXELS,pt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Ct)}}function le(O,P,re){let xe=t.TEXTURE_2D;(P.isDataArrayTexture||P.isCompressedArrayTexture)&&(xe=t.TEXTURE_2D_ARRAY),P.isData3DTexture&&(xe=t.TEXTURE_3D);const we=_e(O,P),ve=P.source;n.bindTexture(xe,O.__webglTexture,t.TEXTURE0+re);const Ke=i.get(ve);if(ve.version!==Ke.__version||we===!0){n.activeTexture(t.TEXTURE0+re);const ke=fn.getPrimaries(fn.workingColorSpace),pt=P.colorSpace===Sa?null:fn.getPrimaries(P.colorSpace),Ct=P.colorSpace===Sa||ke===pt?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,P.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,P.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ct);let Re=w(P.image,!1,r.maxTextureSize);Re=kt(P,Re);const Be=s.convert(P.format,P.colorSpace),Ze=s.convert(P.type);let rt=A(P.internalFormat,Be,Ze,P.colorSpace,P.isVideoTexture);ie(xe,P);let $e;const Vt=P.mipmaps,ne=P.isVideoTexture!==!0,Ve=Ke.__version===void 0||we===!0,Le=ve.dataReady,Xe=D(P,Re);if(P.isDepthTexture)rt=T(P.format===fo,P.type),Ve&&(ne?n.texStorage2D(t.TEXTURE_2D,1,rt,Re.width,Re.height):n.texImage2D(t.TEXTURE_2D,0,rt,Re.width,Re.height,0,Be,Ze,null));else if(P.isDataTexture)if(Vt.length>0){ne&&Ve&&n.texStorage2D(t.TEXTURE_2D,Xe,rt,Vt[0].width,Vt[0].height);for(let Pe=0,ye=Vt.length;Pe<ye;Pe++)$e=Vt[Pe],ne?Le&&n.texSubImage2D(t.TEXTURE_2D,Pe,0,0,$e.width,$e.height,Be,Ze,$e.data):n.texImage2D(t.TEXTURE_2D,Pe,rt,$e.width,$e.height,0,Be,Ze,$e.data);P.generateMipmaps=!1}else ne?(Ve&&n.texStorage2D(t.TEXTURE_2D,Xe,rt,Re.width,Re.height),Le&&Ue(P,Re,Be,Ze)):n.texImage2D(t.TEXTURE_2D,0,rt,Re.width,Re.height,0,Be,Ze,Re.data);else if(P.isCompressedTexture)if(P.isCompressedArrayTexture){ne&&Ve&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Xe,rt,Vt[0].width,Vt[0].height,Re.depth);for(let Pe=0,ye=Vt.length;Pe<ye;Pe++)if($e=Vt[Pe],P.format!==Ur)if(Be!==null)if(ne){if(Le)if(P.layerUpdates.size>0){const st=BE($e.width,$e.height,P.format,P.type);for(const Dt of P.layerUpdates){const mn=$e.data.subarray(Dt*st/$e.data.BYTES_PER_ELEMENT,(Dt+1)*st/$e.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Pe,0,0,Dt,$e.width,$e.height,1,Be,mn)}P.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Pe,0,0,0,$e.width,$e.height,Re.depth,Be,$e.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Pe,rt,$e.width,$e.height,Re.depth,0,$e.data,0,0);else Ht("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ne?Le&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Pe,0,0,0,$e.width,$e.height,Re.depth,Be,Ze,$e.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Pe,rt,$e.width,$e.height,Re.depth,0,Be,Ze,$e.data)}else{ne&&Ve&&n.texStorage2D(t.TEXTURE_2D,Xe,rt,Vt[0].width,Vt[0].height);for(let Pe=0,ye=Vt.length;Pe<ye;Pe++)$e=Vt[Pe],P.format!==Ur?Be!==null?ne?Le&&n.compressedTexSubImage2D(t.TEXTURE_2D,Pe,0,0,$e.width,$e.height,Be,$e.data):n.compressedTexImage2D(t.TEXTURE_2D,Pe,rt,$e.width,$e.height,0,$e.data):Ht("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ne?Le&&n.texSubImage2D(t.TEXTURE_2D,Pe,0,0,$e.width,$e.height,Be,Ze,$e.data):n.texImage2D(t.TEXTURE_2D,Pe,rt,$e.width,$e.height,0,Be,Ze,$e.data)}else if(P.isDataArrayTexture)if(ne){if(Ve&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Xe,rt,Re.width,Re.height,Re.depth),Le)if(P.layerUpdates.size>0){const Pe=BE(Re.width,Re.height,P.format,P.type);for(const ye of P.layerUpdates){const st=Re.data.subarray(ye*Pe/Re.data.BYTES_PER_ELEMENT,(ye+1)*Pe/Re.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,ye,Re.width,Re.height,1,Be,Ze,st)}P.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Re.width,Re.height,Re.depth,Be,Ze,Re.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,rt,Re.width,Re.height,Re.depth,0,Be,Ze,Re.data);else if(P.isData3DTexture)ne?(Ve&&n.texStorage3D(t.TEXTURE_3D,Xe,rt,Re.width,Re.height,Re.depth),Le&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Re.width,Re.height,Re.depth,Be,Ze,Re.data)):n.texImage3D(t.TEXTURE_3D,0,rt,Re.width,Re.height,Re.depth,0,Be,Ze,Re.data);else if(P.isFramebufferTexture){if(Ve)if(ne)n.texStorage2D(t.TEXTURE_2D,Xe,rt,Re.width,Re.height);else{let Pe=Re.width,ye=Re.height;for(let st=0;st<Xe;st++)n.texImage2D(t.TEXTURE_2D,st,rt,Pe,ye,0,Be,Ze,null),Pe>>=1,ye>>=1}}else if(Vt.length>0){if(ne&&Ve){const Pe=it(Vt[0]);n.texStorage2D(t.TEXTURE_2D,Xe,rt,Pe.width,Pe.height)}for(let Pe=0,ye=Vt.length;Pe<ye;Pe++)$e=Vt[Pe],ne?Le&&n.texSubImage2D(t.TEXTURE_2D,Pe,0,0,Be,Ze,$e):n.texImage2D(t.TEXTURE_2D,Pe,rt,Be,Ze,$e);P.generateMipmaps=!1}else if(ne){if(Ve){const Pe=it(Re);n.texStorage2D(t.TEXTURE_2D,Xe,rt,Pe.width,Pe.height)}Le&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Be,Ze,Re)}else n.texImage2D(t.TEXTURE_2D,0,rt,Be,Ze,Re);y(P)&&x(xe),Ke.__version=ve.version,P.onUpdate&&P.onUpdate(P)}O.__version=P.version}function be(O,P,re){if(P.image.length!==6)return;const xe=_e(O,P),we=P.source;n.bindTexture(t.TEXTURE_CUBE_MAP,O.__webglTexture,t.TEXTURE0+re);const ve=i.get(we);if(we.version!==ve.__version||xe===!0){n.activeTexture(t.TEXTURE0+re);const Ke=fn.getPrimaries(fn.workingColorSpace),ke=P.colorSpace===Sa?null:fn.getPrimaries(P.colorSpace),pt=P.colorSpace===Sa||Ke===ke?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,P.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,P.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,pt);const Ct=P.isCompressedTexture||P.image[0].isCompressedTexture,Re=P.image[0]&&P.image[0].isDataTexture,Be=[];for(let ye=0;ye<6;ye++)!Ct&&!Re?Be[ye]=w(P.image[ye],!0,r.maxCubemapSize):Be[ye]=Re?P.image[ye].image:P.image[ye],Be[ye]=kt(P,Be[ye]);const Ze=Be[0],rt=s.convert(P.format,P.colorSpace),$e=s.convert(P.type),Vt=A(P.internalFormat,rt,$e,P.colorSpace),ne=P.isVideoTexture!==!0,Ve=ve.__version===void 0||xe===!0,Le=we.dataReady;let Xe=D(P,Ze);ie(t.TEXTURE_CUBE_MAP,P);let Pe;if(Ct){ne&&Ve&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Xe,Vt,Ze.width,Ze.height);for(let ye=0;ye<6;ye++){Pe=Be[ye].mipmaps;for(let st=0;st<Pe.length;st++){const Dt=Pe[st];P.format!==Ur?rt!==null?ne?Le&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,st,0,0,Dt.width,Dt.height,rt,Dt.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,st,Vt,Dt.width,Dt.height,0,Dt.data):Ht("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,st,0,0,Dt.width,Dt.height,rt,$e,Dt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,st,Vt,Dt.width,Dt.height,0,rt,$e,Dt.data)}}}else{if(Pe=P.mipmaps,ne&&Ve){Pe.length>0&&Xe++;const ye=it(Be[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Xe,Vt,ye.width,ye.height)}for(let ye=0;ye<6;ye++)if(Re){ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,0,0,0,Be[ye].width,Be[ye].height,rt,$e,Be[ye].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,0,Vt,Be[ye].width,Be[ye].height,0,rt,$e,Be[ye].data);for(let st=0;st<Pe.length;st++){const mn=Pe[st].image[ye].image;ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,st+1,0,0,mn.width,mn.height,rt,$e,mn.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,st+1,Vt,mn.width,mn.height,0,rt,$e,mn.data)}}else{ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,0,0,0,rt,$e,Be[ye]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,0,Vt,rt,$e,Be[ye]);for(let st=0;st<Pe.length;st++){const Dt=Pe[st];ne?Le&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,st+1,0,0,rt,$e,Dt.image[ye]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ye,st+1,Vt,rt,$e,Dt.image[ye])}}}y(P)&&x(t.TEXTURE_CUBE_MAP),ve.__version=we.version,P.onUpdate&&P.onUpdate(P)}O.__version=P.version}function Se(O,P,re,xe,we,ve){const Ke=s.convert(re.format,re.colorSpace),ke=s.convert(re.type),pt=A(re.internalFormat,Ke,ke,re.colorSpace),Ct=i.get(P),Re=i.get(re);if(Re.__renderTarget=P,!Ct.__hasExternalTextures){const Be=Math.max(1,P.width>>ve),Ze=Math.max(1,P.height>>ve);we===t.TEXTURE_3D||we===t.TEXTURE_2D_ARRAY?n.texImage3D(we,ve,pt,Be,Ze,P.depth,0,Ke,ke,null):n.texImage2D(we,ve,pt,Be,Ze,0,Ke,ke,null)}n.bindFramebuffer(t.FRAMEBUFFER,O),Sn(P)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,xe,we,Re.__webglTexture,0,ee(P)):(we===t.TEXTURE_2D||we>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&we<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,xe,we,Re.__webglTexture,ve),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ne(O,P,re){if(t.bindRenderbuffer(t.RENDERBUFFER,O),P.depthBuffer){const xe=P.depthTexture,we=xe&&xe.isDepthTexture?xe.type:null,ve=T(P.stencilBuffer,we),Ke=P.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;Sn(P)?c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ee(P),ve,P.width,P.height):re?t.renderbufferStorageMultisample(t.RENDERBUFFER,ee(P),ve,P.width,P.height):t.renderbufferStorage(t.RENDERBUFFER,ve,P.width,P.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ke,t.RENDERBUFFER,O)}else{const xe=P.textures;for(let we=0;we<xe.length;we++){const ve=xe[we],Ke=s.convert(ve.format,ve.colorSpace),ke=s.convert(ve.type),pt=A(ve.internalFormat,Ke,ke,ve.colorSpace);Sn(P)?c.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ee(P),pt,P.width,P.height):re?t.renderbufferStorageMultisample(t.RENDERBUFFER,ee(P),pt,P.width,P.height):t.renderbufferStorage(t.RENDERBUFFER,pt,P.width,P.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function et(O,P,re){const xe=P.isWebGLCubeRenderTarget===!0;if(n.bindFramebuffer(t.FRAMEBUFFER,O),!(P.depthTexture&&P.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const we=i.get(P.depthTexture);if(we.__renderTarget=P,(!we.__webglTexture||P.depthTexture.image.width!==P.width||P.depthTexture.image.height!==P.height)&&(P.depthTexture.image.width=P.width,P.depthTexture.image.height=P.height,P.depthTexture.needsUpdate=!0),xe){if(we.__webglInit===void 0&&(we.__webglInit=!0,P.depthTexture.addEventListener("dispose",I)),we.__webglTexture===void 0){we.__webglTexture=t.createTexture(),n.bindTexture(t.TEXTURE_CUBE_MAP,we.__webglTexture),ie(t.TEXTURE_CUBE_MAP,P.depthTexture);const Ct=s.convert(P.depthTexture.format),Re=s.convert(P.depthTexture.type);let Be;P.depthTexture.format===Bs?Be=t.DEPTH_COMPONENT24:P.depthTexture.format===fo&&(Be=t.DEPTH24_STENCIL8);for(let Ze=0;Ze<6;Ze++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+Ze,0,Be,P.width,P.height,0,Ct,Re,null)}}else q(P.depthTexture,0);const ve=we.__webglTexture,Ke=ee(P),ke=xe?t.TEXTURE_CUBE_MAP_POSITIVE_X+re:t.TEXTURE_2D,pt=P.depthTexture.format===fo?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(P.depthTexture.format===Bs)Sn(P)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,pt,ke,ve,0,Ke):t.framebufferTexture2D(t.FRAMEBUFFER,pt,ke,ve,0);else if(P.depthTexture.format===fo)Sn(P)?c.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,pt,ke,ve,0,Ke):t.framebufferTexture2D(t.FRAMEBUFFER,pt,ke,ve,0);else throw new Error("Unknown depthTexture format")}function xt(O){const P=i.get(O),re=O.isWebGLCubeRenderTarget===!0;if(P.__boundDepthTexture!==O.depthTexture){const xe=O.depthTexture;if(P.__depthDisposeCallback&&P.__depthDisposeCallback(),xe){const we=()=>{delete P.__boundDepthTexture,delete P.__depthDisposeCallback,xe.removeEventListener("dispose",we)};xe.addEventListener("dispose",we),P.__depthDisposeCallback=we}P.__boundDepthTexture=xe}if(O.depthTexture&&!P.__autoAllocateDepthBuffer)if(re)for(let xe=0;xe<6;xe++)et(P.__webglFramebuffer[xe],O,xe);else{const xe=O.texture.mipmaps;xe&&xe.length>0?et(P.__webglFramebuffer[0],O,0):et(P.__webglFramebuffer,O,0)}else if(re){P.__webglDepthbuffer=[];for(let xe=0;xe<6;xe++)if(n.bindFramebuffer(t.FRAMEBUFFER,P.__webglFramebuffer[xe]),P.__webglDepthbuffer[xe]===void 0)P.__webglDepthbuffer[xe]=t.createRenderbuffer(),Ne(P.__webglDepthbuffer[xe],O,!1);else{const we=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ve=P.__webglDepthbuffer[xe];t.bindRenderbuffer(t.RENDERBUFFER,ve),t.framebufferRenderbuffer(t.FRAMEBUFFER,we,t.RENDERBUFFER,ve)}}else{const xe=O.texture.mipmaps;if(xe&&xe.length>0?n.bindFramebuffer(t.FRAMEBUFFER,P.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,P.__webglFramebuffer),P.__webglDepthbuffer===void 0)P.__webglDepthbuffer=t.createRenderbuffer(),Ne(P.__webglDepthbuffer,O,!1);else{const we=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ve=P.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,ve),t.framebufferRenderbuffer(t.FRAMEBUFFER,we,t.RENDERBUFFER,ve)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function pn(O,P,re){const xe=i.get(O);P!==void 0&&Se(xe.__webglFramebuffer,O,O.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),re!==void 0&&xt(O)}function ht(O){const P=O.texture,re=i.get(O),xe=i.get(P);O.addEventListener("dispose",U);const we=O.textures,ve=O.isWebGLCubeRenderTarget===!0,Ke=we.length>1;if(Ke||(xe.__webglTexture===void 0&&(xe.__webglTexture=t.createTexture()),xe.__version=P.version,o.memory.textures++),ve){re.__webglFramebuffer=[];for(let ke=0;ke<6;ke++)if(P.mipmaps&&P.mipmaps.length>0){re.__webglFramebuffer[ke]=[];for(let pt=0;pt<P.mipmaps.length;pt++)re.__webglFramebuffer[ke][pt]=t.createFramebuffer()}else re.__webglFramebuffer[ke]=t.createFramebuffer()}else{if(P.mipmaps&&P.mipmaps.length>0){re.__webglFramebuffer=[];for(let ke=0;ke<P.mipmaps.length;ke++)re.__webglFramebuffer[ke]=t.createFramebuffer()}else re.__webglFramebuffer=t.createFramebuffer();if(Ke)for(let ke=0,pt=we.length;ke<pt;ke++){const Ct=i.get(we[ke]);Ct.__webglTexture===void 0&&(Ct.__webglTexture=t.createTexture(),o.memory.textures++)}if(O.samples>0&&Sn(O)===!1){re.__webglMultisampledFramebuffer=t.createFramebuffer(),re.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,re.__webglMultisampledFramebuffer);for(let ke=0;ke<we.length;ke++){const pt=we[ke];re.__webglColorRenderbuffer[ke]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,re.__webglColorRenderbuffer[ke]);const Ct=s.convert(pt.format,pt.colorSpace),Re=s.convert(pt.type),Be=A(pt.internalFormat,Ct,Re,pt.colorSpace,O.isXRRenderTarget===!0),Ze=ee(O);t.renderbufferStorageMultisample(t.RENDERBUFFER,Ze,Be,O.width,O.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+ke,t.RENDERBUFFER,re.__webglColorRenderbuffer[ke])}t.bindRenderbuffer(t.RENDERBUFFER,null),O.depthBuffer&&(re.__webglDepthRenderbuffer=t.createRenderbuffer(),Ne(re.__webglDepthRenderbuffer,O,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(ve){n.bindTexture(t.TEXTURE_CUBE_MAP,xe.__webglTexture),ie(t.TEXTURE_CUBE_MAP,P);for(let ke=0;ke<6;ke++)if(P.mipmaps&&P.mipmaps.length>0)for(let pt=0;pt<P.mipmaps.length;pt++)Se(re.__webglFramebuffer[ke][pt],O,P,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+ke,pt);else Se(re.__webglFramebuffer[ke],O,P,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+ke,0);y(P)&&x(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(Ke){for(let ke=0,pt=we.length;ke<pt;ke++){const Ct=we[ke],Re=i.get(Ct);let Be=t.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(Be=O.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Be,Re.__webglTexture),ie(Be,Ct),Se(re.__webglFramebuffer,O,Ct,t.COLOR_ATTACHMENT0+ke,Be,0),y(Ct)&&x(Be)}n.unbindTexture()}else{let ke=t.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(ke=O.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(ke,xe.__webglTexture),ie(ke,P),P.mipmaps&&P.mipmaps.length>0)for(let pt=0;pt<P.mipmaps.length;pt++)Se(re.__webglFramebuffer[pt],O,P,t.COLOR_ATTACHMENT0,ke,pt);else Se(re.__webglFramebuffer,O,P,t.COLOR_ATTACHMENT0,ke,0);y(P)&&x(ke),n.unbindTexture()}O.depthBuffer&&xt(O)}function Ut(O){const P=O.textures;for(let re=0,xe=P.length;re<xe;re++){const we=P[re];if(y(we)){const ve=M(O),Ke=i.get(we).__webglTexture;n.bindTexture(ve,Ke),x(ve),n.unbindTexture()}}}const nn=[],Lt=[];function an(O){if(O.samples>0){if(Sn(O)===!1){const P=O.textures,re=O.width,xe=O.height;let we=t.COLOR_BUFFER_BIT;const ve=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ke=i.get(O),ke=P.length>1;if(ke)for(let Ct=0;Ct<P.length;Ct++)n.bindFramebuffer(t.FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ct,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,Ke.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ct,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,Ke.__webglMultisampledFramebuffer);const pt=O.texture.mipmaps;pt&&pt.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ke.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ke.__webglFramebuffer);for(let Ct=0;Ct<P.length;Ct++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(we|=t.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(we|=t.STENCIL_BUFFER_BIT)),ke){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,Ke.__webglColorRenderbuffer[Ct]);const Re=i.get(P[Ct]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Re,0)}t.blitFramebuffer(0,0,re,xe,0,0,re,xe,we,t.NEAREST),u===!0&&(nn.length=0,Lt.length=0,nn.push(t.COLOR_ATTACHMENT0+Ct),O.depthBuffer&&O.resolveDepthBuffer===!1&&(nn.push(ve),Lt.push(ve),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,Lt)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,nn))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),ke)for(let Ct=0;Ct<P.length;Ct++){n.bindFramebuffer(t.FRAMEBUFFER,Ke.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ct,t.RENDERBUFFER,Ke.__webglColorRenderbuffer[Ct]);const Re=i.get(P[Ct]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,Ke.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ct,t.TEXTURE_2D,Re,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ke.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&u){const P=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[P])}}}function ee(O){return Math.min(r.maxSamples,O.samples)}function Sn(O){const P=i.get(O);return O.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&P.__useRenderToTexture!==!1}function At(O){const P=o.render.frame;h.get(O)!==P&&(h.set(O,P),O.update())}function kt(O,P){const re=O.colorSpace,xe=O.format,we=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||re!==Mo&&re!==Sa&&(fn.getTransfer(re)===wn?(xe!==Ur||we!==fr)&&Ht("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):_n("WebGLTextures: Unsupported texture color space:",re)),P}function it(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(f.width=O.naturalWidth||O.width,f.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(f.width=O.displayWidth,f.height=O.displayHeight):(f.width=O.width,f.height=O.height),f}this.allocateTextureUnit=X,this.resetTextureUnits=W,this.setTexture2D=q,this.setTexture2DArray=J,this.setTexture3D=Q,this.setTextureCube=$,this.rebindTextures=pn,this.setupRenderTarget=ht,this.updateRenderTargetMipmap=Ut,this.updateMultisampleRenderTarget=an,this.setupDepthRenderbuffer=xt,this.setupFrameBufferTexture=Se,this.useMultisampledRTT=Sn,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function GW(t,e){function n(i,r=Sa){let s;const o=fn.getTransfer(r);if(i===fr)return t.UNSIGNED_BYTE;if(i===$y)return t.UNSIGNED_SHORT_4_4_4_4;if(i===Xy)return t.UNSIGNED_SHORT_5_5_5_1;if(i===KC)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===ZC)return t.UNSIGNED_INT_10F_11F_11F_REV;if(i===qC)return t.BYTE;if(i===YC)return t.SHORT;if(i===vu)return t.UNSIGNED_SHORT;if(i===jy)return t.INT;if(i===cs)return t.UNSIGNED_INT;if(i===Jr)return t.FLOAT;if(i===Os)return t.HALF_FLOAT;if(i===JC)return t.ALPHA;if(i===QC)return t.RGB;if(i===Ur)return t.RGBA;if(i===Bs)return t.DEPTH_COMPONENT;if(i===fo)return t.DEPTH_STENCIL;if(i===eR)return t.RED;if(i===qy)return t.RED_INTEGER;if(i===Vl)return t.RG;if(i===Yy)return t.RG_INTEGER;if(i===Ky)return t.RGBA_INTEGER;if(i===Of||i===Bf||i===zf||i===Vf)if(o===wn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Of)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Bf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===zf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Vf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Of)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Bf)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===zf)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Vf)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===$0||i===X0||i===q0||i===Y0)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===$0)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===X0)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===q0)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Y0)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===K0||i===Z0||i===J0||i===Q0||i===ev||i===tv||i===nv)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===K0||i===Z0)return o===wn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===J0)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===Q0)return s.COMPRESSED_R11_EAC;if(i===ev)return s.COMPRESSED_SIGNED_R11_EAC;if(i===tv)return s.COMPRESSED_RG11_EAC;if(i===nv)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===iv||i===rv||i===sv||i===av||i===ov||i===lv||i===cv||i===uv||i===dv||i===fv||i===hv||i===pv||i===mv||i===gv)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===iv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===rv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===sv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===av)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===ov)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===lv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===cv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===uv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===dv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===fv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===hv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===pv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===mv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===gv)return o===wn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===vv||i===yv||i===_v)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===vv)return o===wn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===yv)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===_v)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===xv||i===bv||i===Sv||i===wv)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===xv)return s.COMPRESSED_RED_RGTC1_EXT;if(i===bv)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Sv)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===wv)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===yu?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}const WW=`
|
|
4533
4533
|
void main() {
|
|
4534
4534
|
|
|
4535
4535
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -4553,7 +4553,7 @@ void main() {
|
|
|
4553
4553
|
|
|
4554
4554
|
}
|
|
4555
4555
|
|
|
4556
|
-
}`;class $W{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new dR(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new ds({vertexShader:WW,fragmentShader:jW,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new us(new Fh(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class XW extends Zl{constructor(e,n){super();const i=this;let r=null,s=1,o=null,c="local-floor",u=1,f=null,h=null,p=null,m=null,v=null,_=null;const w=typeof XRWebGLBinding<"u",y=new $W,x={},M=n.getContextAttributes();let A=null,T=null;const D=[],I=[],U=new bn;let S=null;const R=new Ir;R.viewport=new zn;const H=new Ir;H.viewport=new zn;const F=[R,H],W=new rG;let X=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let be=D[le];return be===void 0&&(be=new fg,D[le]=be),be.getTargetRaySpace()},this.getControllerGrip=function(le){let be=D[le];return be===void 0&&(be=new fg,D[le]=be),be.getGripSpace()},this.getHand=function(le){let be=D[le];return be===void 0&&(be=new fg,D[le]=be),be.getHandSpace()};function q(le){const be=I.indexOf(le.inputSource);if(be===-1)return;const Se=D[be];Se!==void 0&&(Se.update(le.inputSource,le.frame,f||o),Se.dispatchEvent({type:le.type,data:le.inputSource}))}function J(){r.removeEventListener("select",q),r.removeEventListener("selectstart",q),r.removeEventListener("selectend",q),r.removeEventListener("squeeze",q),r.removeEventListener("squeezestart",q),r.removeEventListener("squeezeend",q),r.removeEventListener("end",J),r.removeEventListener("inputsourceschange",Q);for(let le=0;le<D.length;le++){const be=I[le];be!==null&&(I[le]=null,D[le].disconnect(be))}X=null,V=null,y.reset();for(const le in x)delete x[le];e.setRenderTarget(A),v=null,m=null,p=null,r=null,T=null,Ue.stop(),i.isPresenting=!1,e.setPixelRatio(S),e.setSize(U.width,U.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(le){s=le,i.isPresenting===!0&&Ht("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(le){c=le,i.isPresenting===!0&&Ht("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||o},this.setReferenceSpace=function(le){f=le},this.getBaseLayer=function(){return m!==null?m:v},this.getBinding=function(){return p===null&&w&&(p=new XRWebGLBinding(r,n)),p},this.getFrame=function(){return _},this.getSession=function(){return r},this.setSession=async function(le){if(r=le,r!==null){if(A=e.getRenderTarget(),r.addEventListener("select",q),r.addEventListener("selectstart",q),r.addEventListener("selectend",q),r.addEventListener("squeeze",q),r.addEventListener("squeezestart",q),r.addEventListener("squeezeend",q),r.addEventListener("end",J),r.addEventListener("inputsourceschange",Q),M.xrCompatible!==!0&&await n.makeXRCompatible(),S=e.getPixelRatio(),e.getSize(U),w&&"createProjectionLayer"in XRWebGLBinding.prototype){let Se=null,Ne=null,et=null;M.depth&&(et=M.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,Se=M.stencil?fo:Bs,Ne=M.stencil?yu:cs);const xt={colorFormat:n.RGBA8,depthFormat:et,scaleFactor:s};p=this.getBinding(),m=p.createProjectionLayer(xt),r.updateRenderState({layers:[m]}),e.setPixelRatio(1),e.setSize(m.textureWidth,m.textureHeight,!1),T=new is(m.textureWidth,m.textureHeight,{format:Ur,type:fr,depthTexture:new _u(m.textureWidth,m.textureHeight,Ne,void 0,void 0,void 0,void 0,void 0,void 0,Se),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}else{const Se={antialias:M.antialias,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:s};v=new XRWebGLLayer(r,n,Se),r.updateRenderState({baseLayer:v}),e.setPixelRatio(1),e.setSize(v.framebufferWidth,v.framebufferHeight,!1),T=new is(v.framebufferWidth,v.framebufferHeight,{format:Ur,type:fr,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil,resolveDepthBuffer:v.ignoreDepthValues===!1,resolveStencilBuffer:v.ignoreDepthValues===!1})}T.isXRRenderTarget=!0,this.setFoveation(u),f=null,o=await r.requestReferenceSpace(c),Ue.setContext(r),Ue.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return y.getDepthTexture()};function Q(le){for(let be=0;be<le.removed.length;be++){const Se=le.removed[be],Ne=I.indexOf(Se);Ne>=0&&(I[Ne]=null,D[Ne].disconnect(Se))}for(let be=0;be<le.added.length;be++){const Se=le.added[be];let Ne=I.indexOf(Se);if(Ne===-1){for(let xt=0;xt<D.length;xt++)if(xt>=I.length){I.push(Se),Ne=xt;break}else if(I[xt]===null){I[xt]=Se,Ne=xt;break}if(Ne===-1)break}const et=D[Ne];et&&et.connect(Se)}}const $=new me,Y=new me;function Z(le,be,Se){$.setFromMatrixPosition(be.matrixWorld),Y.setFromMatrixPosition(Se.matrixWorld);const Ne=$.distanceTo(Y),et=be.projectionMatrix.elements,xt=Se.projectionMatrix.elements,pn=et[14]/(et[10]-1),ht=et[14]/(et[10]+1),Ut=(et[9]+1)/et[5],nn=(et[9]-1)/et[5],Lt=(et[8]-1)/et[0],an=(xt[8]+1)/xt[0],ee=pn*Lt,Sn=pn*an,At=Ne/(-Lt+an),kt=At*-Lt;if(be.matrixWorld.decompose(le.position,le.quaternion,le.scale),le.translateX(kt),le.translateZ(At),le.matrixWorld.compose(le.position,le.quaternion,le.scale),le.matrixWorldInverse.copy(le.matrixWorld).invert(),et[10]===-1)le.projectionMatrix.copy(be.projectionMatrix),le.projectionMatrixInverse.copy(be.projectionMatrixInverse);else{const it=pn+At,O=ht+At,P=ee-kt,re=Sn+(Ne-kt),xe=Ut*ht/O*it,we=nn*ht/O*it;le.projectionMatrix.makePerspective(P,re,xe,we,it,O),le.projectionMatrixInverse.copy(le.projectionMatrix).invert()}}function z(le,be){be===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(be.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(r===null)return;let be=le.near,Se=le.far;y.texture!==null&&(y.depthNear>0&&(be=y.depthNear),y.depthFar>0&&(Se=y.depthFar)),W.near=H.near=R.near=be,W.far=H.far=R.far=Se,(X!==W.near||V!==W.far)&&(r.updateRenderState({depthNear:W.near,depthFar:W.far}),X=W.near,V=W.far),W.layers.mask=le.layers.mask|6,R.layers.mask=W.layers.mask&-5,H.layers.mask=W.layers.mask&-3;const Ne=le.parent,et=W.cameras;z(W,Ne);for(let xt=0;xt<et.length;xt++)z(et[xt],Ne);et.length===2?Z(W,R,H):W.projectionMatrix.copy(R.projectionMatrix),ie(le,W,Ne)};function ie(le,be,Se){Se===null?le.matrix.copy(be.matrixWorld):(le.matrix.copy(Se.matrixWorld),le.matrix.invert(),le.matrix.multiply(be.matrixWorld)),le.matrix.decompose(le.position,le.quaternion,le.scale),le.updateMatrixWorld(!0),le.projectionMatrix.copy(be.projectionMatrix),le.projectionMatrixInverse.copy(be.projectionMatrixInverse),le.isPerspectiveCamera&&(le.fov=Ev*2*Math.atan(1/le.projectionMatrix.elements[5]),le.zoom=1)}this.getCamera=function(){return W},this.getFoveation=function(){if(!(m===null&&v===null))return u},this.setFoveation=function(le){u=le,m!==null&&(m.fixedFoveation=le),v!==null&&v.fixedFoveation!==void 0&&(v.fixedFoveation=le)},this.hasDepthSensing=function(){return y.texture!==null},this.getDepthSensingMesh=function(){return y.getMesh(W)},this.getCameraTexture=function(le){return x[le]};let ve=null;function Ee(le,be){if(h=be.getViewerPose(f||o),_=be,h!==null){const Se=h.views;v!==null&&(e.setRenderTargetFramebuffer(T,v.framebuffer),e.setRenderTarget(T));let Ne=!1;Se.length!==W.cameras.length&&(W.cameras.length=0,Ne=!0);for(let ht=0;ht<Se.length;ht++){const Ut=Se[ht];let nn=null;if(v!==null)nn=v.getViewport(Ut);else{const an=p.getViewSubImage(m,Ut);nn=an.viewport,ht===0&&(e.setRenderTargetTextures(T,an.colorTexture,an.depthStencilTexture),e.setRenderTarget(T))}let Lt=F[ht];Lt===void 0&&(Lt=new Ir,Lt.layers.enable(ht),Lt.viewport=new zn,F[ht]=Lt),Lt.matrix.fromArray(Ut.transform.matrix),Lt.matrix.decompose(Lt.position,Lt.quaternion,Lt.scale),Lt.projectionMatrix.fromArray(Ut.projectionMatrix),Lt.projectionMatrixInverse.copy(Lt.projectionMatrix).invert(),Lt.viewport.set(nn.x,nn.y,nn.width,nn.height),ht===0&&(W.matrix.copy(Lt.matrix),W.matrix.decompose(W.position,W.quaternion,W.scale)),Ne===!0&&W.cameras.push(Lt)}const et=r.enabledFeatures;if(et&&et.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&w){p=i.getBinding();const ht=p.getDepthInformation(Se[0]);ht&&ht.isValid&&ht.texture&&y.init(ht,r.renderState)}if(et&&et.includes("camera-access")&&w){e.state.unbindTexture(),p=i.getBinding();for(let ht=0;ht<Se.length;ht++){const Ut=Se[ht].camera;if(Ut){let nn=x[Ut];nn||(nn=new dR,x[Ut]=nn);const Lt=p.getCameraImage(Ut);nn.sourceTexture=Lt}}}}for(let Se=0;Se<D.length;Se++){const Ne=I[Se],et=D[Se];Ne!==null&&et!==void 0&&et.update(Ne,be,f||o)}ve&&ve(le,be),be.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:be}),_=null}const Ue=new mR;Ue.setAnimationLoop(Ee),this.setAnimationLoop=function(le){ve=le},this.dispose=function(){}}}const eo=new To,qW=new Yn;function YW(t,e){function n(y,x){y.matrixAutoUpdate===!0&&y.updateMatrix(),x.value.copy(y.matrix)}function i(y,x){x.color.getRGB(y.fogColor.value,fR(t)),x.isFog?(y.fogNear.value=x.near,y.fogFar.value=x.far):x.isFogExp2&&(y.fogDensity.value=x.density)}function r(y,x,M,A,T){x.isMeshBasicMaterial?s(y,x):x.isMeshLambertMaterial?(s(y,x),x.envMap&&(y.envMapIntensity.value=x.envMapIntensity)):x.isMeshToonMaterial?(s(y,x),p(y,x)):x.isMeshPhongMaterial?(s(y,x),h(y,x),x.envMap&&(y.envMapIntensity.value=x.envMapIntensity)):x.isMeshStandardMaterial?(s(y,x),m(y,x),x.isMeshPhysicalMaterial&&v(y,x,T)):x.isMeshMatcapMaterial?(s(y,x),_(y,x)):x.isMeshDepthMaterial?s(y,x):x.isMeshDistanceMaterial?(s(y,x),w(y,x)):x.isMeshNormalMaterial?s(y,x):x.isLineBasicMaterial?(o(y,x),x.isLineDashedMaterial&&c(y,x)):x.isPointsMaterial?u(y,x,M,A):x.isSpriteMaterial?f(y,x):x.isShadowMaterial?(y.color.value.copy(x.color),y.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function s(y,x){y.opacity.value=x.opacity,x.color&&y.diffuse.value.copy(x.color),x.emissive&&y.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(y.map.value=x.map,n(x.map,y.mapTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,n(x.alphaMap,y.alphaMapTransform)),x.bumpMap&&(y.bumpMap.value=x.bumpMap,n(x.bumpMap,y.bumpMapTransform),y.bumpScale.value=x.bumpScale,x.side===Gi&&(y.bumpScale.value*=-1)),x.normalMap&&(y.normalMap.value=x.normalMap,n(x.normalMap,y.normalMapTransform),y.normalScale.value.copy(x.normalScale),x.side===Gi&&y.normalScale.value.negate()),x.displacementMap&&(y.displacementMap.value=x.displacementMap,n(x.displacementMap,y.displacementMapTransform),y.displacementScale.value=x.displacementScale,y.displacementBias.value=x.displacementBias),x.emissiveMap&&(y.emissiveMap.value=x.emissiveMap,n(x.emissiveMap,y.emissiveMapTransform)),x.specularMap&&(y.specularMap.value=x.specularMap,n(x.specularMap,y.specularMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);const M=e.get(x),A=M.envMap,T=M.envMapRotation;A&&(y.envMap.value=A,eo.copy(T),eo.x*=-1,eo.y*=-1,eo.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(eo.y*=-1,eo.z*=-1),y.envMapRotation.value.setFromMatrix4(qW.makeRotationFromEuler(eo)),y.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=x.reflectivity,y.ior.value=x.ior,y.refractionRatio.value=x.refractionRatio),x.lightMap&&(y.lightMap.value=x.lightMap,y.lightMapIntensity.value=x.lightMapIntensity,n(x.lightMap,y.lightMapTransform)),x.aoMap&&(y.aoMap.value=x.aoMap,y.aoMapIntensity.value=x.aoMapIntensity,n(x.aoMap,y.aoMapTransform))}function o(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,x.map&&(y.map.value=x.map,n(x.map,y.mapTransform))}function c(y,x){y.dashSize.value=x.dashSize,y.totalSize.value=x.dashSize+x.gapSize,y.scale.value=x.scale}function u(y,x,M,A){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.size.value=x.size*M,y.scale.value=A*.5,x.map&&(y.map.value=x.map,n(x.map,y.uvTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,n(x.alphaMap,y.alphaMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest)}function f(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.rotation.value=x.rotation,x.map&&(y.map.value=x.map,n(x.map,y.mapTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,n(x.alphaMap,y.alphaMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest)}function h(y,x){y.specular.value.copy(x.specular),y.shininess.value=Math.max(x.shininess,1e-4)}function p(y,x){x.gradientMap&&(y.gradientMap.value=x.gradientMap)}function m(y,x){y.metalness.value=x.metalness,x.metalnessMap&&(y.metalnessMap.value=x.metalnessMap,n(x.metalnessMap,y.metalnessMapTransform)),y.roughness.value=x.roughness,x.roughnessMap&&(y.roughnessMap.value=x.roughnessMap,n(x.roughnessMap,y.roughnessMapTransform)),x.envMap&&(y.envMapIntensity.value=x.envMapIntensity)}function v(y,x,M){y.ior.value=x.ior,x.sheen>0&&(y.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),y.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(y.sheenColorMap.value=x.sheenColorMap,n(x.sheenColorMap,y.sheenColorMapTransform)),x.sheenRoughnessMap&&(y.sheenRoughnessMap.value=x.sheenRoughnessMap,n(x.sheenRoughnessMap,y.sheenRoughnessMapTransform))),x.clearcoat>0&&(y.clearcoat.value=x.clearcoat,y.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(y.clearcoatMap.value=x.clearcoatMap,n(x.clearcoatMap,y.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,n(x.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(y.clearcoatNormalMap.value=x.clearcoatNormalMap,n(x.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Gi&&y.clearcoatNormalScale.value.negate())),x.dispersion>0&&(y.dispersion.value=x.dispersion),x.iridescence>0&&(y.iridescence.value=x.iridescence,y.iridescenceIOR.value=x.iridescenceIOR,y.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(y.iridescenceMap.value=x.iridescenceMap,n(x.iridescenceMap,y.iridescenceMapTransform)),x.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=x.iridescenceThicknessMap,n(x.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),x.transmission>0&&(y.transmission.value=x.transmission,y.transmissionSamplerMap.value=M.texture,y.transmissionSamplerSize.value.set(M.width,M.height),x.transmissionMap&&(y.transmissionMap.value=x.transmissionMap,n(x.transmissionMap,y.transmissionMapTransform)),y.thickness.value=x.thickness,x.thicknessMap&&(y.thicknessMap.value=x.thicknessMap,n(x.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=x.attenuationDistance,y.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(y.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(y.anisotropyMap.value=x.anisotropyMap,n(x.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=x.specularIntensity,y.specularColor.value.copy(x.specularColor),x.specularColorMap&&(y.specularColorMap.value=x.specularColorMap,n(x.specularColorMap,y.specularColorMapTransform)),x.specularIntensityMap&&(y.specularIntensityMap.value=x.specularIntensityMap,n(x.specularIntensityMap,y.specularIntensityMapTransform))}function _(y,x){x.matcap&&(y.matcap.value=x.matcap)}function w(y,x){const M=e.get(x).light;y.referencePosition.value.setFromMatrixPosition(M.matrixWorld),y.nearDistance.value=M.shadow.camera.near,y.farDistance.value=M.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function KW(t,e,n,i){let r={},s={},o=[];const c=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function u(M,A){const T=A.program;i.uniformBlockBinding(M,T)}function f(M,A){let T=r[M.id];T===void 0&&(_(M),T=h(M),r[M.id]=T,M.addEventListener("dispose",y));const D=A.program;i.updateUBOMapping(M,D);const I=e.render.frame;s[M.id]!==I&&(m(M),s[M.id]=I)}function h(M){const A=p();M.__bindingPointIndex=A;const T=t.createBuffer(),D=M.__size,I=M.usage;return t.bindBuffer(t.UNIFORM_BUFFER,T),t.bufferData(t.UNIFORM_BUFFER,D,I),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,A,T),T}function p(){for(let M=0;M<c;M++)if(o.indexOf(M)===-1)return o.push(M),M;return _n("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(M){const A=r[M.id],T=M.uniforms,D=M.__cache;t.bindBuffer(t.UNIFORM_BUFFER,A);for(let I=0,U=T.length;I<U;I++){const S=Array.isArray(T[I])?T[I]:[T[I]];for(let R=0,H=S.length;R<H;R++){const F=S[R];if(v(F,I,R,D)===!0){const W=F.__offset,X=Array.isArray(F.value)?F.value:[F.value];let V=0;for(let q=0;q<X.length;q++){const J=X[q],Q=w(J);typeof J=="number"||typeof J=="boolean"?(F.__data[0]=J,t.bufferSubData(t.UNIFORM_BUFFER,W+V,F.__data)):J.isMatrix3?(F.__data[0]=J.elements[0],F.__data[1]=J.elements[1],F.__data[2]=J.elements[2],F.__data[3]=0,F.__data[4]=J.elements[3],F.__data[5]=J.elements[4],F.__data[6]=J.elements[5],F.__data[7]=0,F.__data[8]=J.elements[6],F.__data[9]=J.elements[7],F.__data[10]=J.elements[8],F.__data[11]=0):(J.toArray(F.__data,V),V+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,W,F.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function v(M,A,T,D){const I=M.value,U=A+"_"+T;if(D[U]===void 0)return typeof I=="number"||typeof I=="boolean"?D[U]=I:D[U]=I.clone(),!0;{const S=D[U];if(typeof I=="number"||typeof I=="boolean"){if(S!==I)return D[U]=I,!0}else if(S.equals(I)===!1)return S.copy(I),!0}return!1}function _(M){const A=M.uniforms;let T=0;const D=16;for(let U=0,S=A.length;U<S;U++){const R=Array.isArray(A[U])?A[U]:[A[U]];for(let H=0,F=R.length;H<F;H++){const W=R[H],X=Array.isArray(W.value)?W.value:[W.value];for(let V=0,q=X.length;V<q;V++){const J=X[V],Q=w(J),$=T%D,Y=$%Q.boundary,Z=$+Y;T+=Y,Z!==0&&D-Z<Q.storage&&(T+=D-Z),W.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),W.__offset=T,T+=Q.storage}}}const I=T%D;return I>0&&(T+=D-I),M.__size=T,M.__cache={},this}function w(M){const A={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(A.boundary=4,A.storage=4):M.isVector2?(A.boundary=8,A.storage=8):M.isVector3||M.isColor?(A.boundary=16,A.storage=12):M.isVector4?(A.boundary=16,A.storage=16):M.isMatrix3?(A.boundary=48,A.storage=48):M.isMatrix4?(A.boundary=64,A.storage=64):M.isTexture?Ht("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Ht("WebGLRenderer: Unsupported uniform value type.",M),A}function y(M){const A=M.target;A.removeEventListener("dispose",y);const T=o.indexOf(A.__bindingPointIndex);o.splice(T,1),t.deleteBuffer(r[A.id]),delete r[A.id],delete s[A.id]}function x(){for(const M in r)t.deleteBuffer(r[M]);o=[],r={},s={}}return{bind:u,update:f,dispose:x}}const ZW=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]);let $r=null;function JW(){return $r===null&&($r=new $H(ZW,16,16,Vl,Os),$r.name="DFG_LUT",$r.minFilter=wi,$r.magFilter=wi,$r.wrapS=Ls,$r.wrapT=Ls,$r.generateMipmaps=!1,$r.needsUpdate=!0),$r}class QW{constructor(e={}){const{canvas:n=SH(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:c=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:f=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:p=!1,reversedDepthBuffer:m=!1,outputBufferType:v=fr}=e;this.isWebGLRenderer=!0;let _;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");_=i.getContextAttributes().alpha}else _=o;const w=v,y=new Set([Ky,Yy,qy]),x=new Set([fr,cs,vu,yu,$y,Xy]),M=new Uint32Array(4),A=new Int32Array(4);let T=null,D=null;const I=[],U=[];let S=null;this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ns,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const R=this;let H=!1;this._outputColorSpace=ur;let F=0,W=0,X=null,V=-1,q=null;const J=new zn,Q=new zn;let $=null;const Y=new Mn(0);let Z=0,z=n.width,ie=n.height,ve=1,Ee=null,Ue=null;const le=new zn(0,0,z,ie),be=new zn(0,0,z,ie);let Se=!1;const Ne=new cR;let et=!1,xt=!1;const pn=new Yn,ht=new me,Ut=new zn,nn={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Lt=!1;function an(){return X===null?ve:1}let ee=i;function Sn(L,ae){return n.getContext(L,ae)}try{const L={alpha:!0,depth:r,stencil:s,antialias:c,premultipliedAlpha:u,preserveDrawingBuffer:f,powerPreference:h,failIfMajorPerformanceCaveat:p};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Wy}`),n.addEventListener("webglcontextlost",st,!1),n.addEventListener("webglcontextrestored",Dt,!1),n.addEventListener("webglcontextcreationerror",mn,!1),ee===null){const ae="webgl2";if(ee=Sn(ae,L),ee===null)throw Sn(ae)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw _n("WebGLRenderer: "+L.message),L}let At,kt,it,O,P,re,xe,we,ye,Ke,ke,pt,Ct,Re,Be,Ze,rt,$e,Vt,ne,Ve,Le,Xe;function Pe(){At=new Q6(ee),At.init(),Ve=new GW(ee,At),kt=new j6(ee,At,e,Ve),it=new VW(ee,At),kt.reversedDepthBuffer&&m&&it.buffers.depth.setReversed(!0),O=new n9(ee),P=new AW,re=new HW(ee,At,it,P,kt,Ve,O),xe=new J6(R),we=new oG(ee),Le=new G6(ee,we),ye=new e9(ee,we,O,Le),Ke=new r9(ee,ye,we,Le,O),$e=new i9(ee,kt,re),Be=new $6(P),ke=new TW(R,xe,At,kt,Le,Be),pt=new YW(R,P),Ct=new RW,Re=new IW(At),rt=new H6(R,xe,it,Ke,_,u),Ze=new zW(R,Ke,kt),Xe=new KW(ee,O,kt,it),Vt=new W6(ee,At,O),ne=new t9(ee,At,O),O.programs=ke.programs,R.capabilities=kt,R.extensions=At,R.properties=P,R.renderLists=Ct,R.shadowMap=Ze,R.state=it,R.info=O}Pe(),w!==fr&&(S=new a9(w,n.width,n.height,r,s));const _e=new XW(R,ee);this.xr=_e,this.getContext=function(){return ee},this.getContextAttributes=function(){return ee.getContextAttributes()},this.forceContextLoss=function(){const L=At.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=At.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return ve},this.setPixelRatio=function(L){L!==void 0&&(ve=L,this.setSize(z,ie,!1))},this.getSize=function(L){return L.set(z,ie)},this.setSize=function(L,ae,pe=!0){if(_e.isPresenting){Ht("WebGLRenderer: Can't change size while VR device is presenting.");return}z=L,ie=ae,n.width=Math.floor(L*ve),n.height=Math.floor(ae*ve),pe===!0&&(n.style.width=L+"px",n.style.height=ae+"px"),S!==null&&S.setSize(n.width,n.height),this.setViewport(0,0,L,ae)},this.getDrawingBufferSize=function(L){return L.set(z*ve,ie*ve).floor()},this.setDrawingBufferSize=function(L,ae,pe){z=L,ie=ae,ve=pe,n.width=Math.floor(L*pe),n.height=Math.floor(ae*pe),this.setViewport(0,0,L,ae)},this.setEffects=function(L){if(w===fr){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(L){for(let ae=0;ae<L.length;ae++)if(L[ae].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}S.setEffects(L||[])},this.getCurrentViewport=function(L){return L.copy(J)},this.getViewport=function(L){return L.copy(le)},this.setViewport=function(L,ae,pe,de){L.isVector4?le.set(L.x,L.y,L.z,L.w):le.set(L,ae,pe,de),it.viewport(J.copy(le).multiplyScalar(ve).round())},this.getScissor=function(L){return L.copy(be)},this.setScissor=function(L,ae,pe,de){L.isVector4?be.set(L.x,L.y,L.z,L.w):be.set(L,ae,pe,de),it.scissor(Q.copy(be).multiplyScalar(ve).round())},this.getScissorTest=function(){return Se},this.setScissorTest=function(L){it.setScissorTest(Se=L)},this.setOpaqueSort=function(L){Ee=L},this.setTransparentSort=function(L){Ue=L},this.getClearColor=function(L){return L.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor(...arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha(...arguments)},this.clear=function(L=!0,ae=!0,pe=!0){let de=0;if(L){let ce=!1;if(X!==null){const We=X.texture.format;ce=y.has(We)}if(ce){const We=X.texture.type,qe=x.has(We),Ge=rt.getClearColor(),je=rt.getClearAlpha(),ct=Ge.r,He=Ge.g,Mt=Ge.b;qe?(M[0]=ct,M[1]=He,M[2]=Mt,M[3]=je,ee.clearBufferuiv(ee.COLOR,0,M)):(A[0]=ct,A[1]=He,A[2]=Mt,A[3]=je,ee.clearBufferiv(ee.COLOR,0,A))}else de|=ee.COLOR_BUFFER_BIT}ae&&(de|=ee.DEPTH_BUFFER_BIT),pe&&(de|=ee.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),de!==0&&ee.clear(de)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",st,!1),n.removeEventListener("webglcontextrestored",Dt,!1),n.removeEventListener("webglcontextcreationerror",mn,!1),rt.dispose(),Ct.dispose(),Re.dispose(),P.dispose(),xe.dispose(),Ke.dispose(),Le.dispose(),Xe.dispose(),ke.dispose(),_e.dispose(),_e.removeEventListener("sessionstart",oe),_e.removeEventListener("sessionend",he),Me.stop()};function st(L){L.preventDefault(),SE("WebGLRenderer: Context Lost."),H=!0}function Dt(){SE("WebGLRenderer: Context Restored."),H=!1;const L=O.autoReset,ae=Ze.enabled,pe=Ze.autoUpdate,de=Ze.needsUpdate,ce=Ze.type;Pe(),O.autoReset=L,Ze.enabled=ae,Ze.autoUpdate=pe,Ze.needsUpdate=de,Ze.type=ce}function mn(L){_n("WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Kt(L){const ae=L.target;ae.removeEventListener("dispose",Kt),ci(ae)}function ci(L){ii(L),P.remove(L)}function ii(L){const ae=P.get(L).programs;ae!==void 0&&(ae.forEach(function(pe){ke.releaseProgram(pe)}),L.isShaderMaterial&&ke.releaseShaderCache(L))}this.renderBufferDirect=function(L,ae,pe,de,ce,We){ae===null&&(ae=nn);const qe=ce.isMesh&&ce.matrixWorld.determinant()<0,Ge=un(L,ae,pe,de,ce);it.setMaterial(de,qe);let je=pe.index,ct=1;if(de.wireframe===!0){if(je=ye.getWireframeAttribute(pe),je===void 0)return;ct=2}const He=pe.drawRange,Mt=pe.attributes.position;let lt=He.start*ct,Zt=(He.start+He.count)*ct;We!==null&&(lt=Math.max(lt,We.start*ct),Zt=Math.min(Zt,(We.start+We.count)*ct)),je!==null?(lt=Math.max(lt,0),Zt=Math.min(Zt,je.count)):Mt!=null&&(lt=Math.max(lt,0),Zt=Math.min(Zt,Mt.count));const Nt=Zt-lt;if(Nt<0||Nt===1/0)return;Le.setup(ce,de,Ge,pe,je);let vn,tn=Vt;if(je!==null&&(vn=we.get(je),tn=ne,tn.setIndex(vn)),ce.isMesh)de.wireframe===!0?(it.setLineWidth(de.wireframeLinewidth*an()),tn.setMode(ee.LINES)):tn.setMode(ee.TRIANGLES);else if(ce.isLine){let In=de.linewidth;In===void 0&&(In=1),it.setLineWidth(In*an()),ce.isLineSegments?tn.setMode(ee.LINES):ce.isLineLoop?tn.setMode(ee.LINE_LOOP):tn.setMode(ee.LINE_STRIP)}else ce.isPoints?tn.setMode(ee.POINTS):ce.isSprite&&tn.setMode(ee.TRIANGLES);if(ce.isBatchedMesh)if(ce._multiDrawInstances!==null)yh("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),tn.renderMultiDrawInstances(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount,ce._multiDrawInstances);else if(At.get("WEBGL_multi_draw"))tn.renderMultiDraw(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount);else{const In=ce._multiDrawStarts,_t=ce._multiDrawCounts,Mi=ce._multiDrawCount,rn=je?we.get(je).bytesPerElement:1,Ni=P.get(de).currentProgram.getUniforms();for(let Ii=0;Ii<Mi;Ii++)Ni.setValue(ee,"_gl_DrawID",Ii),tn.render(In[Ii]/rn,_t[Ii])}else if(ce.isInstancedMesh)tn.renderInstances(lt,Nt,ce.count);else if(pe.isInstancedBufferGeometry){const In=pe._maxInstanceCount!==void 0?pe._maxInstanceCount:1/0,_t=Math.min(pe.instanceCount,In);tn.renderInstances(lt,Nt,_t)}else tn.render(lt,Nt)};function Gs(L,ae,pe){L.transparent===!0&&L.side===ks&&L.forceSinglePass===!1?(L.side=Gi,L.needsUpdate=!0,Et(L,ae,pe),L.side=Pa,L.needsUpdate=!0,Et(L,ae,pe),L.side=ks):Et(L,ae,pe)}this.compile=function(L,ae,pe=null){pe===null&&(pe=L),D=Re.get(pe),D.init(ae),U.push(D),pe.traverseVisible(function(ce){ce.isLight&&ce.layers.test(ae.layers)&&(D.pushLight(ce),ce.castShadow&&D.pushShadow(ce))}),L!==pe&&L.traverseVisible(function(ce){ce.isLight&&ce.layers.test(ae.layers)&&(D.pushLight(ce),ce.castShadow&&D.pushShadow(ce))}),D.setupLights();const de=new Set;return L.traverse(function(ce){if(!(ce.isMesh||ce.isPoints||ce.isLine||ce.isSprite))return;const We=ce.material;if(We)if(Array.isArray(We))for(let qe=0;qe<We.length;qe++){const Ge=We[qe];Gs(Ge,pe,ce),de.add(Ge)}else Gs(We,pe,ce),de.add(We)}),D=U.pop(),de},this.compileAsync=function(L,ae,pe=null){const de=this.compile(L,ae,pe);return new Promise(ce=>{function We(){if(de.forEach(function(qe){P.get(qe).currentProgram.isReady()&&de.delete(qe)}),de.size===0){ce(L);return}setTimeout(We,10)}At.get("KHR_parallel_shader_compile")!==null?We():setTimeout(We,10)})};let br=null;function K(L){br&&br(L)}function oe(){Me.stop()}function he(){Me.start()}const Me=new mR;Me.setAnimationLoop(K),typeof self<"u"&&Me.setContext(self),this.setAnimationLoop=function(L){br=L,_e.setAnimationLoop(L),L===null?Me.stop():Me.start()},_e.addEventListener("sessionstart",oe),_e.addEventListener("sessionend",he),this.render=function(L,ae){if(ae!==void 0&&ae.isCamera!==!0){_n("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(H===!0)return;const pe=_e.enabled===!0&&_e.isPresenting===!0,de=S!==null&&(X===null||pe)&&S.begin(R,X);if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),ae.parent===null&&ae.matrixWorldAutoUpdate===!0&&ae.updateMatrixWorld(),_e.enabled===!0&&_e.isPresenting===!0&&(S===null||S.isCompositing()===!1)&&(_e.cameraAutoUpdate===!0&&_e.updateCamera(ae),ae=_e.getCamera()),L.isScene===!0&&L.onBeforeRender(R,L,ae,X),D=Re.get(L,U.length),D.init(ae),U.push(D),pn.multiplyMatrices(ae.projectionMatrix,ae.matrixWorldInverse),Ne.setFromProjectionMatrix(pn,Qr,ae.reversedDepth),xt=this.localClippingEnabled,et=Be.init(this.clippingPlanes,xt),T=Ct.get(L,I.length),T.init(),I.push(T),_e.enabled===!0&&_e.isPresenting===!0){const qe=R.xr.getDepthSensingMesh();qe!==null&&Ie(qe,ae,-1/0,R.sortObjects)}Ie(L,ae,0,R.sortObjects),T.finish(),R.sortObjects===!0&&T.sort(Ee,Ue),Lt=_e.enabled===!1||_e.isPresenting===!1||_e.hasDepthSensing()===!1,Lt&&rt.addToRenderList(T,L),this.info.render.frame++,et===!0&&Be.beginShadows();const ce=D.state.shadowsArray;if(Ze.render(ce,L,ae),et===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset(),(de&&S.hasRenderPass())===!1){const qe=T.opaque,Ge=T.transmissive;if(D.setupLights(),ae.isArrayCamera){const je=ae.cameras;if(Ge.length>0)for(let ct=0,He=je.length;ct<He;ct++){const Mt=je[ct];tt(qe,Ge,L,Mt)}Lt&&rt.render(L);for(let ct=0,He=je.length;ct<He;ct++){const Mt=je[ct];vt(T,L,Mt,Mt.viewport)}}else Ge.length>0&&tt(qe,Ge,L,ae),Lt&&rt.render(L),vt(T,L,ae)}X!==null&&W===0&&(re.updateMultisampleRenderTarget(X),re.updateRenderTargetMipmap(X)),de&&S.end(R),L.isScene===!0&&L.onAfterRender(R,L,ae),Le.resetDefaultState(),V=-1,q=null,U.pop(),U.length>0?(D=U[U.length-1],et===!0&&Be.setGlobalState(R.clippingPlanes,D.state.camera)):D=null,I.pop(),I.length>0?T=I[I.length-1]:T=null};function Ie(L,ae,pe,de){if(L.visible===!1)return;if(L.layers.test(ae.layers)){if(L.isGroup)pe=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(ae);else if(L.isLight)D.pushLight(L),L.castShadow&&D.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||Ne.intersectsSprite(L)){de&&Ut.setFromMatrixPosition(L.matrixWorld).applyMatrix4(pn);const qe=Ke.update(L),Ge=L.material;Ge.visible&&T.push(L,qe,Ge,pe,Ut.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||Ne.intersectsObject(L))){const qe=Ke.update(L),Ge=L.material;if(de&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),Ut.copy(L.boundingSphere.center)):(qe.boundingSphere===null&&qe.computeBoundingSphere(),Ut.copy(qe.boundingSphere.center)),Ut.applyMatrix4(L.matrixWorld).applyMatrix4(pn)),Array.isArray(Ge)){const je=qe.groups;for(let ct=0,He=je.length;ct<He;ct++){const Mt=je[ct],lt=Ge[Mt.materialIndex];lt&<.visible&&T.push(L,qe,lt,pe,Ut.z,Mt)}}else Ge.visible&&T.push(L,qe,Ge,pe,Ut.z,null)}}const We=L.children;for(let qe=0,Ge=We.length;qe<Ge;qe++)Ie(We[qe],ae,pe,de)}function vt(L,ae,pe,de){const{opaque:ce,transmissive:We,transparent:qe}=L;D.setupLightsView(pe),et===!0&&Be.setGlobalState(R.clippingPlanes,pe),de&&it.viewport(J.copy(de)),ce.length>0&&yt(ce,ae,pe),We.length>0&&yt(We,ae,pe),qe.length>0&&yt(qe,ae,pe),it.buffers.depth.setTest(!0),it.buffers.depth.setMask(!0),it.buffers.color.setMask(!0),it.setPolygonOffset(!1)}function tt(L,ae,pe,de){if((pe.isScene===!0?pe.overrideMaterial:null)!==null)return;if(D.state.transmissionRenderTarget[de.id]===void 0){const lt=At.has("EXT_color_buffer_half_float")||At.has("EXT_color_buffer_float");D.state.transmissionRenderTarget[de.id]=new is(1,1,{generateMipmaps:!0,type:lt?Os:fr,minFilter:uo,samples:Math.max(4,kt.samples),stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:fn.workingColorSpace})}const We=D.state.transmissionRenderTarget[de.id],qe=de.viewport||J;We.setSize(qe.z*R.transmissionResolutionScale,qe.w*R.transmissionResolutionScale);const Ge=R.getRenderTarget(),je=R.getActiveCubeFace(),ct=R.getActiveMipmapLevel();R.setRenderTarget(We),R.getClearColor(Y),Z=R.getClearAlpha(),Z<1&&R.setClearColor(16777215,.5),R.clear(),Lt&&rt.render(pe);const He=R.toneMapping;R.toneMapping=ns;const Mt=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),D.setupLightsView(de),et===!0&&Be.setGlobalState(R.clippingPlanes,de),yt(L,pe,de),re.updateMultisampleRenderTarget(We),re.updateRenderTargetMipmap(We),At.has("WEBGL_multisampled_render_to_texture")===!1){let lt=!1;for(let Zt=0,Nt=ae.length;Zt<Nt;Zt++){const vn=ae[Zt],{object:tn,geometry:In,material:_t,group:Mi}=vn;if(_t.side===ks&&tn.layers.test(de.layers)){const rn=_t.side;_t.side=Gi,_t.needsUpdate=!0,Qe(tn,pe,de,In,_t,Mi),_t.side=rn,_t.needsUpdate=!0,lt=!0}}lt===!0&&(re.updateMultisampleRenderTarget(We),re.updateRenderTargetMipmap(We))}R.setRenderTarget(Ge,je,ct),R.setClearColor(Y,Z),Mt!==void 0&&(de.viewport=Mt),R.toneMapping=He}function yt(L,ae,pe){const de=ae.isScene===!0?ae.overrideMaterial:null;for(let ce=0,We=L.length;ce<We;ce++){const qe=L[ce],{object:Ge,geometry:je,group:ct}=qe;let He=qe.material;He.allowOverride===!0&&de!==null&&(He=de),Ge.layers.test(pe.layers)&&Qe(Ge,ae,pe,je,He,ct)}}function Qe(L,ae,pe,de,ce,We){L.onBeforeRender(R,ae,pe,de,ce,We),L.modelViewMatrix.multiplyMatrices(pe.matrixWorldInverse,L.matrixWorld),L.normalMatrix.getNormalMatrix(L.modelViewMatrix),ce.onBeforeRender(R,ae,pe,de,L,We),ce.transparent===!0&&ce.side===ks&&ce.forceSinglePass===!1?(ce.side=Gi,ce.needsUpdate=!0,R.renderBufferDirect(pe,ae,de,ce,L,We),ce.side=Pa,ce.needsUpdate=!0,R.renderBufferDirect(pe,ae,de,ce,L,We),ce.side=ks):R.renderBufferDirect(pe,ae,de,ce,L,We),L.onAfterRender(R,ae,pe,de,ce,We)}function Et(L,ae,pe){ae.isScene!==!0&&(ae=nn);const de=P.get(L),ce=D.state.lights,We=D.state.shadowsArray,qe=ce.state.version,Ge=ke.getParameters(L,ce.state,We,ae,pe),je=ke.getProgramCacheKey(Ge);let ct=de.programs;de.environment=L.isMeshStandardMaterial||L.isMeshLambertMaterial||L.isMeshPhongMaterial?ae.environment:null,de.fog=ae.fog;const He=L.isMeshStandardMaterial||L.isMeshLambertMaterial&&!L.envMap||L.isMeshPhongMaterial&&!L.envMap;de.envMap=xe.get(L.envMap||de.environment,He),de.envMapRotation=de.environment!==null&&L.envMap===null?ae.environmentRotation:L.envMapRotation,ct===void 0&&(L.addEventListener("dispose",Kt),ct=new Map,de.programs=ct);let Mt=ct.get(je);if(Mt!==void 0){if(de.currentProgram===Mt&&de.lightsStateVersion===qe)return bt(L,Ge),Mt}else Ge.uniforms=ke.getUniforms(L),L.onBeforeCompile(Ge,R),Mt=ke.acquireProgram(Ge,je),ct.set(je,Mt),de.uniforms=Ge.uniforms;const lt=de.uniforms;return(!L.isShaderMaterial&&!L.isRawShaderMaterial||L.clipping===!0)&&(lt.clippingPlanes=Be.uniform),bt(L,Ge),de.needsLights=En(L),de.lightsStateVersion=qe,de.needsLights&&(lt.ambientLightColor.value=ce.state.ambient,lt.lightProbe.value=ce.state.probe,lt.directionalLights.value=ce.state.directional,lt.directionalLightShadows.value=ce.state.directionalShadow,lt.spotLights.value=ce.state.spot,lt.spotLightShadows.value=ce.state.spotShadow,lt.rectAreaLights.value=ce.state.rectArea,lt.ltc_1.value=ce.state.rectAreaLTC1,lt.ltc_2.value=ce.state.rectAreaLTC2,lt.pointLights.value=ce.state.point,lt.pointLightShadows.value=ce.state.pointShadow,lt.hemisphereLights.value=ce.state.hemi,lt.directionalShadowMatrix.value=ce.state.directionalShadowMatrix,lt.spotLightMatrix.value=ce.state.spotLightMatrix,lt.spotLightMap.value=ce.state.spotLightMap,lt.pointShadowMatrix.value=ce.state.pointShadowMatrix),de.currentProgram=Mt,de.uniformsList=null,Mt}function Tt(L){if(L.uniformsList===null){const ae=L.currentProgram.getUniforms();L.uniformsList=Hf.seqWithValue(ae.seq,L.uniforms)}return L.uniformsList}function bt(L,ae){const pe=P.get(L);pe.outputColorSpace=ae.outputColorSpace,pe.batching=ae.batching,pe.batchingColor=ae.batchingColor,pe.instancing=ae.instancing,pe.instancingColor=ae.instancingColor,pe.instancingMorph=ae.instancingMorph,pe.skinning=ae.skinning,pe.morphTargets=ae.morphTargets,pe.morphNormals=ae.morphNormals,pe.morphColors=ae.morphColors,pe.morphTargetsCount=ae.morphTargetsCount,pe.numClippingPlanes=ae.numClippingPlanes,pe.numIntersection=ae.numClipIntersection,pe.vertexAlphas=ae.vertexAlphas,pe.vertexTangents=ae.vertexTangents,pe.toneMapping=ae.toneMapping}function un(L,ae,pe,de,ce){ae.isScene!==!0&&(ae=nn),re.resetTextureUnits();const We=ae.fog,qe=de.isMeshStandardMaterial||de.isMeshLambertMaterial||de.isMeshPhongMaterial?ae.environment:null,Ge=X===null?R.outputColorSpace:X.isXRRenderTarget===!0?X.texture.colorSpace:Mo,je=de.isMeshStandardMaterial||de.isMeshLambertMaterial&&!de.envMap||de.isMeshPhongMaterial&&!de.envMap,ct=xe.get(de.envMap||qe,je),He=de.vertexColors===!0&&!!pe.attributes.color&&pe.attributes.color.itemSize===4,Mt=!!pe.attributes.tangent&&(!!de.normalMap||de.anisotropy>0),lt=!!pe.morphAttributes.position,Zt=!!pe.morphAttributes.normal,Nt=!!pe.morphAttributes.color;let vn=ns;de.toneMapped&&(X===null||X.isXRRenderTarget===!0)&&(vn=R.toneMapping);const tn=pe.morphAttributes.position||pe.morphAttributes.normal||pe.morphAttributes.color,In=tn!==void 0?tn.length:0,_t=P.get(de),Mi=D.state.lights;if(et===!0&&(xt===!0||L!==q)){const Vn=L===q&&de.id===V;Be.setState(de,L,Vn)}let rn=!1;de.version===_t.__version?(_t.needsLights&&_t.lightsStateVersion!==Mi.state.version||_t.outputColorSpace!==Ge||ce.isBatchedMesh&&_t.batching===!1||!ce.isBatchedMesh&&_t.batching===!0||ce.isBatchedMesh&&_t.batchingColor===!0&&ce.colorTexture===null||ce.isBatchedMesh&&_t.batchingColor===!1&&ce.colorTexture!==null||ce.isInstancedMesh&&_t.instancing===!1||!ce.isInstancedMesh&&_t.instancing===!0||ce.isSkinnedMesh&&_t.skinning===!1||!ce.isSkinnedMesh&&_t.skinning===!0||ce.isInstancedMesh&&_t.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&_t.instancingColor===!1&&ce.instanceColor!==null||ce.isInstancedMesh&&_t.instancingMorph===!0&&ce.morphTexture===null||ce.isInstancedMesh&&_t.instancingMorph===!1&&ce.morphTexture!==null||_t.envMap!==ct||de.fog===!0&&_t.fog!==We||_t.numClippingPlanes!==void 0&&(_t.numClippingPlanes!==Be.numPlanes||_t.numIntersection!==Be.numIntersection)||_t.vertexAlphas!==He||_t.vertexTangents!==Mt||_t.morphTargets!==lt||_t.morphNormals!==Zt||_t.morphColors!==Nt||_t.toneMapping!==vn||_t.morphTargetsCount!==In)&&(rn=!0):(rn=!0,_t.__version=de.version);let Ni=_t.currentProgram;rn===!0&&(Ni=Et(de,ae,ce));let Ii=!1,Wi=!1,Ws=!1;const xn=Ni.getUniforms(),Ft=_t.uniforms;if(it.useProgram(Ni.program)&&(Ii=!0,Wi=!0,Ws=!0),de.id!==V&&(V=de.id,Wi=!0),Ii||q!==L){it.buffers.depth.getReversed()&&L.reversedDepth!==!0&&(L._reversedDepth=!0,L.updateProjectionMatrix()),xn.setValue(ee,"projectionMatrix",L.projectionMatrix),xn.setValue(ee,"viewMatrix",L.matrixWorldInverse);const tr=xn.map.cameraPosition;tr!==void 0&&tr.setValue(ee,ht.setFromMatrixPosition(L.matrixWorld)),kt.logarithmicDepthBuffer&&xn.setValue(ee,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&xn.setValue(ee,"isOrthographic",L.isOrthographicCamera===!0),q!==L&&(q=L,Wi=!0,Ws=!0)}if(_t.needsLights&&(Mi.state.directionalShadowMap.length>0&&xn.setValue(ee,"directionalShadowMap",Mi.state.directionalShadowMap,re),Mi.state.spotShadowMap.length>0&&xn.setValue(ee,"spotShadowMap",Mi.state.spotShadowMap,re),Mi.state.pointShadowMap.length>0&&xn.setValue(ee,"pointShadowMap",Mi.state.pointShadowMap,re)),ce.isSkinnedMesh){xn.setOptional(ee,ce,"bindMatrix"),xn.setOptional(ee,ce,"bindMatrixInverse");const Vn=ce.skeleton;Vn&&(Vn.boneTexture===null&&Vn.computeBoneTexture(),xn.setValue(ee,"boneTexture",Vn.boneTexture,re))}ce.isBatchedMesh&&(xn.setOptional(ee,ce,"batchingTexture"),xn.setValue(ee,"batchingTexture",ce._matricesTexture,re),xn.setOptional(ee,ce,"batchingIdTexture"),xn.setValue(ee,"batchingIdTexture",ce._indirectTexture,re),xn.setOptional(ee,ce,"batchingColorTexture"),ce._colorsTexture!==null&&xn.setValue(ee,"batchingColorTexture",ce._colorsTexture,re));const Sr=pe.morphAttributes;if((Sr.position!==void 0||Sr.normal!==void 0||Sr.color!==void 0)&&$e.update(ce,pe,Ni),(Wi||_t.receiveShadow!==ce.receiveShadow)&&(_t.receiveShadow=ce.receiveShadow,xn.setValue(ee,"receiveShadow",ce.receiveShadow)),(de.isMeshStandardMaterial||de.isMeshLambertMaterial||de.isMeshPhongMaterial)&&de.envMap===null&&ae.environment!==null&&(Ft.envMapIntensity.value=ae.environmentIntensity),Ft.dfgLUT!==void 0&&(Ft.dfgLUT.value=JW()),Wi&&(xn.setValue(ee,"toneMappingExposure",R.toneMappingExposure),_t.needsLights&&en(Ft,Ws),We&&de.fog===!0&&pt.refreshFogUniforms(Ft,We),pt.refreshMaterialUniforms(Ft,de,ve,ie,D.state.transmissionRenderTarget[L.id]),Hf.upload(ee,Tt(_t),Ft,re)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(Hf.upload(ee,Tt(_t),Ft,re),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&xn.setValue(ee,"center",ce.center),xn.setValue(ee,"modelViewMatrix",ce.modelViewMatrix),xn.setValue(ee,"normalMatrix",ce.normalMatrix),xn.setValue(ee,"modelMatrix",ce.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const Vn=de.uniformsGroups;for(let tr=0,ps=Vn.length;tr<ps;tr++){const ec=Vn[tr];Xe.update(ec,Ni),Xe.bind(ec,Ni)}}return Ni}function en(L,ae){L.ambientLightColor.needsUpdate=ae,L.lightProbe.needsUpdate=ae,L.directionalLights.needsUpdate=ae,L.directionalLightShadows.needsUpdate=ae,L.pointLights.needsUpdate=ae,L.pointLightShadows.needsUpdate=ae,L.spotLights.needsUpdate=ae,L.spotLightShadows.needsUpdate=ae,L.rectAreaLights.needsUpdate=ae,L.hemisphereLights.needsUpdate=ae}function En(L){return L.isMeshLambertMaterial||L.isMeshToonMaterial||L.isMeshPhongMaterial||L.isMeshStandardMaterial||L.isShadowMaterial||L.isShaderMaterial&&L.lights===!0}this.getActiveCubeFace=function(){return F},this.getActiveMipmapLevel=function(){return W},this.getRenderTarget=function(){return X},this.setRenderTargetTextures=function(L,ae,pe){const de=P.get(L);de.__autoAllocateDepthBuffer=L.resolveDepthBuffer===!1,de.__autoAllocateDepthBuffer===!1&&(de.__useRenderToTexture=!1),P.get(L.texture).__webglTexture=ae,P.get(L.depthTexture).__webglTexture=de.__autoAllocateDepthBuffer?void 0:pe,de.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(L,ae){const pe=P.get(L);pe.__webglFramebuffer=ae,pe.__useDefaultFramebuffer=ae===void 0};const Nn=ee.createFramebuffer();this.setRenderTarget=function(L,ae=0,pe=0){X=L,F=ae,W=pe;let de=null,ce=!1,We=!1;if(L){const Ge=P.get(L);if(Ge.__useDefaultFramebuffer!==void 0){it.bindFramebuffer(ee.FRAMEBUFFER,Ge.__webglFramebuffer),J.copy(L.viewport),Q.copy(L.scissor),$=L.scissorTest,it.viewport(J),it.scissor(Q),it.setScissorTest($),V=-1;return}else if(Ge.__webglFramebuffer===void 0)re.setupRenderTarget(L);else if(Ge.__hasExternalTextures)re.rebindTextures(L,P.get(L.texture).__webglTexture,P.get(L.depthTexture).__webglTexture);else if(L.depthBuffer){const He=L.depthTexture;if(Ge.__boundDepthTexture!==He){if(He!==null&&P.has(He)&&(L.width!==He.image.width||L.height!==He.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");re.setupDepthRenderbuffer(L)}}const je=L.texture;(je.isData3DTexture||je.isDataArrayTexture||je.isCompressedArrayTexture)&&(We=!0);const ct=P.get(L).__webglFramebuffer;L.isWebGLCubeRenderTarget?(Array.isArray(ct[ae])?de=ct[ae][pe]:de=ct[ae],ce=!0):L.samples>0&&re.useMultisampledRTT(L)===!1?de=P.get(L).__webglMultisampledFramebuffer:Array.isArray(ct)?de=ct[pe]:de=ct,J.copy(L.viewport),Q.copy(L.scissor),$=L.scissorTest}else J.copy(le).multiplyScalar(ve).floor(),Q.copy(be).multiplyScalar(ve).floor(),$=Se;if(pe!==0&&(de=Nn),it.bindFramebuffer(ee.FRAMEBUFFER,de)&&it.drawBuffers(L,de),it.viewport(J),it.scissor(Q),it.setScissorTest($),ce){const Ge=P.get(L.texture);ee.framebufferTexture2D(ee.FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_CUBE_MAP_POSITIVE_X+ae,Ge.__webglTexture,pe)}else if(We){const Ge=ae;for(let je=0;je<L.textures.length;je++){const ct=P.get(L.textures[je]);ee.framebufferTextureLayer(ee.FRAMEBUFFER,ee.COLOR_ATTACHMENT0+je,ct.__webglTexture,pe,Ge)}}else if(L!==null&&pe!==0){const Ge=P.get(L.texture);ee.framebufferTexture2D(ee.FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_2D,Ge.__webglTexture,pe)}V=-1},this.readRenderTargetPixels=function(L,ae,pe,de,ce,We,qe,Ge=0){if(!(L&&L.isWebGLRenderTarget)){_n("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let je=P.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&qe!==void 0&&(je=je[qe]),je){it.bindFramebuffer(ee.FRAMEBUFFER,je);try{const ct=L.textures[Ge],He=ct.format,Mt=ct.type;if(L.textures.length>1&&ee.readBuffer(ee.COLOR_ATTACHMENT0+Ge),!kt.textureFormatReadable(He)){_n("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!kt.textureTypeReadable(Mt)){_n("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ae>=0&&ae<=L.width-de&&pe>=0&&pe<=L.height-ce&&ee.readPixels(ae,pe,de,ce,Ve.convert(He),Ve.convert(Mt),We)}finally{const ct=X!==null?P.get(X).__webglFramebuffer:null;it.bindFramebuffer(ee.FRAMEBUFFER,ct)}}},this.readRenderTargetPixelsAsync=async function(L,ae,pe,de,ce,We,qe,Ge=0){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let je=P.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&qe!==void 0&&(je=je[qe]),je)if(ae>=0&&ae<=L.width-de&&pe>=0&&pe<=L.height-ce){it.bindFramebuffer(ee.FRAMEBUFFER,je);const ct=L.textures[Ge],He=ct.format,Mt=ct.type;if(L.textures.length>1&&ee.readBuffer(ee.COLOR_ATTACHMENT0+Ge),!kt.textureFormatReadable(He))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!kt.textureTypeReadable(Mt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const lt=ee.createBuffer();ee.bindBuffer(ee.PIXEL_PACK_BUFFER,lt),ee.bufferData(ee.PIXEL_PACK_BUFFER,We.byteLength,ee.STREAM_READ),ee.readPixels(ae,pe,de,ce,Ve.convert(He),Ve.convert(Mt),0);const Zt=X!==null?P.get(X).__webglFramebuffer:null;it.bindFramebuffer(ee.FRAMEBUFFER,Zt);const Nt=ee.fenceSync(ee.SYNC_GPU_COMMANDS_COMPLETE,0);return ee.flush(),await wH(ee,Nt,4),ee.bindBuffer(ee.PIXEL_PACK_BUFFER,lt),ee.getBufferSubData(ee.PIXEL_PACK_BUFFER,0,We),ee.deleteBuffer(lt),ee.deleteSync(Nt),We}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(L,ae=null,pe=0){const de=Math.pow(2,-pe),ce=Math.floor(L.image.width*de),We=Math.floor(L.image.height*de),qe=ae!==null?ae.x:0,Ge=ae!==null?ae.y:0;re.setTexture2D(L,0),ee.copyTexSubImage2D(ee.TEXTURE_2D,pe,0,0,qe,Ge,ce,We),it.unbindTexture()};const Kn=ee.createFramebuffer(),gn=ee.createFramebuffer();this.copyTextureToTexture=function(L,ae,pe=null,de=null,ce=0,We=0){let qe,Ge,je,ct,He,Mt,lt,Zt,Nt;const vn=L.isCompressedTexture?L.mipmaps[We]:L.image;if(pe!==null)qe=pe.max.x-pe.min.x,Ge=pe.max.y-pe.min.y,je=pe.isBox3?pe.max.z-pe.min.z:1,ct=pe.min.x,He=pe.min.y,Mt=pe.isBox3?pe.min.z:0;else{const Ft=Math.pow(2,-ce);qe=Math.floor(vn.width*Ft),Ge=Math.floor(vn.height*Ft),L.isDataArrayTexture?je=vn.depth:L.isData3DTexture?je=Math.floor(vn.depth*Ft):je=1,ct=0,He=0,Mt=0}de!==null?(lt=de.x,Zt=de.y,Nt=de.z):(lt=0,Zt=0,Nt=0);const tn=Ve.convert(ae.format),In=Ve.convert(ae.type);let _t;ae.isData3DTexture?(re.setTexture3D(ae,0),_t=ee.TEXTURE_3D):ae.isDataArrayTexture||ae.isCompressedArrayTexture?(re.setTexture2DArray(ae,0),_t=ee.TEXTURE_2D_ARRAY):(re.setTexture2D(ae,0),_t=ee.TEXTURE_2D),ee.pixelStorei(ee.UNPACK_FLIP_Y_WEBGL,ae.flipY),ee.pixelStorei(ee.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ae.premultiplyAlpha),ee.pixelStorei(ee.UNPACK_ALIGNMENT,ae.unpackAlignment);const Mi=ee.getParameter(ee.UNPACK_ROW_LENGTH),rn=ee.getParameter(ee.UNPACK_IMAGE_HEIGHT),Ni=ee.getParameter(ee.UNPACK_SKIP_PIXELS),Ii=ee.getParameter(ee.UNPACK_SKIP_ROWS),Wi=ee.getParameter(ee.UNPACK_SKIP_IMAGES);ee.pixelStorei(ee.UNPACK_ROW_LENGTH,vn.width),ee.pixelStorei(ee.UNPACK_IMAGE_HEIGHT,vn.height),ee.pixelStorei(ee.UNPACK_SKIP_PIXELS,ct),ee.pixelStorei(ee.UNPACK_SKIP_ROWS,He),ee.pixelStorei(ee.UNPACK_SKIP_IMAGES,Mt);const Ws=L.isDataArrayTexture||L.isData3DTexture,xn=ae.isDataArrayTexture||ae.isData3DTexture;if(L.isDepthTexture){const Ft=P.get(L),Sr=P.get(ae),Vn=P.get(Ft.__renderTarget),tr=P.get(Sr.__renderTarget);it.bindFramebuffer(ee.READ_FRAMEBUFFER,Vn.__webglFramebuffer),it.bindFramebuffer(ee.DRAW_FRAMEBUFFER,tr.__webglFramebuffer);for(let ps=0;ps<je;ps++)Ws&&(ee.framebufferTextureLayer(ee.READ_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,P.get(L).__webglTexture,ce,Mt+ps),ee.framebufferTextureLayer(ee.DRAW_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,P.get(ae).__webglTexture,We,Nt+ps)),ee.blitFramebuffer(ct,He,qe,Ge,lt,Zt,qe,Ge,ee.DEPTH_BUFFER_BIT,ee.NEAREST);it.bindFramebuffer(ee.READ_FRAMEBUFFER,null),it.bindFramebuffer(ee.DRAW_FRAMEBUFFER,null)}else if(ce!==0||L.isRenderTargetTexture||P.has(L)){const Ft=P.get(L),Sr=P.get(ae);it.bindFramebuffer(ee.READ_FRAMEBUFFER,Kn),it.bindFramebuffer(ee.DRAW_FRAMEBUFFER,gn);for(let Vn=0;Vn<je;Vn++)Ws?ee.framebufferTextureLayer(ee.READ_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,Ft.__webglTexture,ce,Mt+Vn):ee.framebufferTexture2D(ee.READ_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_2D,Ft.__webglTexture,ce),xn?ee.framebufferTextureLayer(ee.DRAW_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,Sr.__webglTexture,We,Nt+Vn):ee.framebufferTexture2D(ee.DRAW_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_2D,Sr.__webglTexture,We),ce!==0?ee.blitFramebuffer(ct,He,qe,Ge,lt,Zt,qe,Ge,ee.COLOR_BUFFER_BIT,ee.NEAREST):xn?ee.copyTexSubImage3D(_t,We,lt,Zt,Nt+Vn,ct,He,qe,Ge):ee.copyTexSubImage2D(_t,We,lt,Zt,ct,He,qe,Ge);it.bindFramebuffer(ee.READ_FRAMEBUFFER,null),it.bindFramebuffer(ee.DRAW_FRAMEBUFFER,null)}else xn?L.isDataTexture||L.isData3DTexture?ee.texSubImage3D(_t,We,lt,Zt,Nt,qe,Ge,je,tn,In,vn.data):ae.isCompressedArrayTexture?ee.compressedTexSubImage3D(_t,We,lt,Zt,Nt,qe,Ge,je,tn,vn.data):ee.texSubImage3D(_t,We,lt,Zt,Nt,qe,Ge,je,tn,In,vn):L.isDataTexture?ee.texSubImage2D(ee.TEXTURE_2D,We,lt,Zt,qe,Ge,tn,In,vn.data):L.isCompressedTexture?ee.compressedTexSubImage2D(ee.TEXTURE_2D,We,lt,Zt,vn.width,vn.height,tn,vn.data):ee.texSubImage2D(ee.TEXTURE_2D,We,lt,Zt,qe,Ge,tn,In,vn);ee.pixelStorei(ee.UNPACK_ROW_LENGTH,Mi),ee.pixelStorei(ee.UNPACK_IMAGE_HEIGHT,rn),ee.pixelStorei(ee.UNPACK_SKIP_PIXELS,Ni),ee.pixelStorei(ee.UNPACK_SKIP_ROWS,Ii),ee.pixelStorei(ee.UNPACK_SKIP_IMAGES,Wi),We===0&&ae.generateMipmaps&&ee.generateMipmap(_t),it.unbindTexture()},this.initRenderTarget=function(L){P.get(L).__webglFramebuffer===void 0&&re.setupRenderTarget(L)},this.initTexture=function(L){L.isCubeTexture?re.setTextureCube(L,0):L.isData3DTexture?re.setTexture3D(L,0):L.isDataArrayTexture||L.isCompressedArrayTexture?re.setTexture2DArray(L,0):re.setTexture2D(L,0),it.unbindTexture()},this.resetState=function(){F=0,W=0,X=null,it.reset(),Le.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Qr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=fn._getDrawingBufferColorSpace(e),n.unpackColorSpace=fn._getUnpackColorSpace()}}const ej=`
|
|
4556
|
+
}`;class $W{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new dR(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new ds({vertexShader:WW,fragmentShader:jW,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new us(new Fh(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class XW extends Zl{constructor(e,n){super();const i=this;let r=null,s=1,o=null,c="local-floor",u=1,f=null,h=null,p=null,m=null,v=null,_=null;const w=typeof XRWebGLBinding<"u",y=new $W,x={},M=n.getContextAttributes();let A=null,T=null;const D=[],I=[],U=new bn;let S=null;const R=new Ir;R.viewport=new zn;const H=new Ir;H.viewport=new zn;const F=[R,H],W=new rG;let X=null,V=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(le){let be=D[le];return be===void 0&&(be=new fg,D[le]=be),be.getTargetRaySpace()},this.getControllerGrip=function(le){let be=D[le];return be===void 0&&(be=new fg,D[le]=be),be.getGripSpace()},this.getHand=function(le){let be=D[le];return be===void 0&&(be=new fg,D[le]=be),be.getHandSpace()};function q(le){const be=I.indexOf(le.inputSource);if(be===-1)return;const Se=D[be];Se!==void 0&&(Se.update(le.inputSource,le.frame,f||o),Se.dispatchEvent({type:le.type,data:le.inputSource}))}function J(){r.removeEventListener("select",q),r.removeEventListener("selectstart",q),r.removeEventListener("selectend",q),r.removeEventListener("squeeze",q),r.removeEventListener("squeezestart",q),r.removeEventListener("squeezeend",q),r.removeEventListener("end",J),r.removeEventListener("inputsourceschange",Q);for(let le=0;le<D.length;le++){const be=I[le];be!==null&&(I[le]=null,D[le].disconnect(be))}X=null,V=null,y.reset();for(const le in x)delete x[le];e.setRenderTarget(A),v=null,m=null,p=null,r=null,T=null,Ue.stop(),i.isPresenting=!1,e.setPixelRatio(S),e.setSize(U.width,U.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(le){s=le,i.isPresenting===!0&&Ht("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(le){c=le,i.isPresenting===!0&&Ht("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||o},this.setReferenceSpace=function(le){f=le},this.getBaseLayer=function(){return m!==null?m:v},this.getBinding=function(){return p===null&&w&&(p=new XRWebGLBinding(r,n)),p},this.getFrame=function(){return _},this.getSession=function(){return r},this.setSession=async function(le){if(r=le,r!==null){if(A=e.getRenderTarget(),r.addEventListener("select",q),r.addEventListener("selectstart",q),r.addEventListener("selectend",q),r.addEventListener("squeeze",q),r.addEventListener("squeezestart",q),r.addEventListener("squeezeend",q),r.addEventListener("end",J),r.addEventListener("inputsourceschange",Q),M.xrCompatible!==!0&&await n.makeXRCompatible(),S=e.getPixelRatio(),e.getSize(U),w&&"createProjectionLayer"in XRWebGLBinding.prototype){let Se=null,Ne=null,et=null;M.depth&&(et=M.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,Se=M.stencil?fo:Bs,Ne=M.stencil?yu:cs);const xt={colorFormat:n.RGBA8,depthFormat:et,scaleFactor:s};p=this.getBinding(),m=p.createProjectionLayer(xt),r.updateRenderState({layers:[m]}),e.setPixelRatio(1),e.setSize(m.textureWidth,m.textureHeight,!1),T=new is(m.textureWidth,m.textureHeight,{format:Ur,type:fr,depthTexture:new _u(m.textureWidth,m.textureHeight,Ne,void 0,void 0,void 0,void 0,void 0,void 0,Se),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0,resolveDepthBuffer:m.ignoreDepthValues===!1,resolveStencilBuffer:m.ignoreDepthValues===!1})}else{const Se={antialias:M.antialias,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:s};v=new XRWebGLLayer(r,n,Se),r.updateRenderState({baseLayer:v}),e.setPixelRatio(1),e.setSize(v.framebufferWidth,v.framebufferHeight,!1),T=new is(v.framebufferWidth,v.framebufferHeight,{format:Ur,type:fr,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil,resolveDepthBuffer:v.ignoreDepthValues===!1,resolveStencilBuffer:v.ignoreDepthValues===!1})}T.isXRRenderTarget=!0,this.setFoveation(u),f=null,o=await r.requestReferenceSpace(c),Ue.setContext(r),Ue.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return y.getDepthTexture()};function Q(le){for(let be=0;be<le.removed.length;be++){const Se=le.removed[be],Ne=I.indexOf(Se);Ne>=0&&(I[Ne]=null,D[Ne].disconnect(Se))}for(let be=0;be<le.added.length;be++){const Se=le.added[be];let Ne=I.indexOf(Se);if(Ne===-1){for(let xt=0;xt<D.length;xt++)if(xt>=I.length){I.push(Se),Ne=xt;break}else if(I[xt]===null){I[xt]=Se,Ne=xt;break}if(Ne===-1)break}const et=D[Ne];et&&et.connect(Se)}}const $=new me,Y=new me;function Z(le,be,Se){$.setFromMatrixPosition(be.matrixWorld),Y.setFromMatrixPosition(Se.matrixWorld);const Ne=$.distanceTo(Y),et=be.projectionMatrix.elements,xt=Se.projectionMatrix.elements,pn=et[14]/(et[10]-1),ht=et[14]/(et[10]+1),Ut=(et[9]+1)/et[5],nn=(et[9]-1)/et[5],Lt=(et[8]-1)/et[0],an=(xt[8]+1)/xt[0],ee=pn*Lt,Sn=pn*an,At=Ne/(-Lt+an),kt=At*-Lt;if(be.matrixWorld.decompose(le.position,le.quaternion,le.scale),le.translateX(kt),le.translateZ(At),le.matrixWorld.compose(le.position,le.quaternion,le.scale),le.matrixWorldInverse.copy(le.matrixWorld).invert(),et[10]===-1)le.projectionMatrix.copy(be.projectionMatrix),le.projectionMatrixInverse.copy(be.projectionMatrixInverse);else{const it=pn+At,O=ht+At,P=ee-kt,re=Sn+(Ne-kt),xe=Ut*ht/O*it,we=nn*ht/O*it;le.projectionMatrix.makePerspective(P,re,xe,we,it,O),le.projectionMatrixInverse.copy(le.projectionMatrix).invert()}}function z(le,be){be===null?le.matrixWorld.copy(le.matrix):le.matrixWorld.multiplyMatrices(be.matrixWorld,le.matrix),le.matrixWorldInverse.copy(le.matrixWorld).invert()}this.updateCamera=function(le){if(r===null)return;let be=le.near,Se=le.far;y.texture!==null&&(y.depthNear>0&&(be=y.depthNear),y.depthFar>0&&(Se=y.depthFar)),W.near=H.near=R.near=be,W.far=H.far=R.far=Se,(X!==W.near||V!==W.far)&&(r.updateRenderState({depthNear:W.near,depthFar:W.far}),X=W.near,V=W.far),W.layers.mask=le.layers.mask|6,R.layers.mask=W.layers.mask&-5,H.layers.mask=W.layers.mask&-3;const Ne=le.parent,et=W.cameras;z(W,Ne);for(let xt=0;xt<et.length;xt++)z(et[xt],Ne);et.length===2?Z(W,R,H):W.projectionMatrix.copy(R.projectionMatrix),ie(le,W,Ne)};function ie(le,be,Se){Se===null?le.matrix.copy(be.matrixWorld):(le.matrix.copy(Se.matrixWorld),le.matrix.invert(),le.matrix.multiply(be.matrixWorld)),le.matrix.decompose(le.position,le.quaternion,le.scale),le.updateMatrixWorld(!0),le.projectionMatrix.copy(be.projectionMatrix),le.projectionMatrixInverse.copy(be.projectionMatrixInverse),le.isPerspectiveCamera&&(le.fov=Ev*2*Math.atan(1/le.projectionMatrix.elements[5]),le.zoom=1)}this.getCamera=function(){return W},this.getFoveation=function(){if(!(m===null&&v===null))return u},this.setFoveation=function(le){u=le,m!==null&&(m.fixedFoveation=le),v!==null&&v.fixedFoveation!==void 0&&(v.fixedFoveation=le)},this.hasDepthSensing=function(){return y.texture!==null},this.getDepthSensingMesh=function(){return y.getMesh(W)},this.getCameraTexture=function(le){return x[le]};let _e=null;function Ee(le,be){if(h=be.getViewerPose(f||o),_=be,h!==null){const Se=h.views;v!==null&&(e.setRenderTargetFramebuffer(T,v.framebuffer),e.setRenderTarget(T));let Ne=!1;Se.length!==W.cameras.length&&(W.cameras.length=0,Ne=!0);for(let ht=0;ht<Se.length;ht++){const Ut=Se[ht];let nn=null;if(v!==null)nn=v.getViewport(Ut);else{const an=p.getViewSubImage(m,Ut);nn=an.viewport,ht===0&&(e.setRenderTargetTextures(T,an.colorTexture,an.depthStencilTexture),e.setRenderTarget(T))}let Lt=F[ht];Lt===void 0&&(Lt=new Ir,Lt.layers.enable(ht),Lt.viewport=new zn,F[ht]=Lt),Lt.matrix.fromArray(Ut.transform.matrix),Lt.matrix.decompose(Lt.position,Lt.quaternion,Lt.scale),Lt.projectionMatrix.fromArray(Ut.projectionMatrix),Lt.projectionMatrixInverse.copy(Lt.projectionMatrix).invert(),Lt.viewport.set(nn.x,nn.y,nn.width,nn.height),ht===0&&(W.matrix.copy(Lt.matrix),W.matrix.decompose(W.position,W.quaternion,W.scale)),Ne===!0&&W.cameras.push(Lt)}const et=r.enabledFeatures;if(et&&et.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&w){p=i.getBinding();const ht=p.getDepthInformation(Se[0]);ht&&ht.isValid&&ht.texture&&y.init(ht,r.renderState)}if(et&&et.includes("camera-access")&&w){e.state.unbindTexture(),p=i.getBinding();for(let ht=0;ht<Se.length;ht++){const Ut=Se[ht].camera;if(Ut){let nn=x[Ut];nn||(nn=new dR,x[Ut]=nn);const Lt=p.getCameraImage(Ut);nn.sourceTexture=Lt}}}}for(let Se=0;Se<D.length;Se++){const Ne=I[Se],et=D[Se];Ne!==null&&et!==void 0&&et.update(Ne,be,f||o)}_e&&_e(le,be),be.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:be}),_=null}const Ue=new mR;Ue.setAnimationLoop(Ee),this.setAnimationLoop=function(le){_e=le},this.dispose=function(){}}}const eo=new To,qW=new Yn;function YW(t,e){function n(y,x){y.matrixAutoUpdate===!0&&y.updateMatrix(),x.value.copy(y.matrix)}function i(y,x){x.color.getRGB(y.fogColor.value,fR(t)),x.isFog?(y.fogNear.value=x.near,y.fogFar.value=x.far):x.isFogExp2&&(y.fogDensity.value=x.density)}function r(y,x,M,A,T){x.isMeshBasicMaterial?s(y,x):x.isMeshLambertMaterial?(s(y,x),x.envMap&&(y.envMapIntensity.value=x.envMapIntensity)):x.isMeshToonMaterial?(s(y,x),p(y,x)):x.isMeshPhongMaterial?(s(y,x),h(y,x),x.envMap&&(y.envMapIntensity.value=x.envMapIntensity)):x.isMeshStandardMaterial?(s(y,x),m(y,x),x.isMeshPhysicalMaterial&&v(y,x,T)):x.isMeshMatcapMaterial?(s(y,x),_(y,x)):x.isMeshDepthMaterial?s(y,x):x.isMeshDistanceMaterial?(s(y,x),w(y,x)):x.isMeshNormalMaterial?s(y,x):x.isLineBasicMaterial?(o(y,x),x.isLineDashedMaterial&&c(y,x)):x.isPointsMaterial?u(y,x,M,A):x.isSpriteMaterial?f(y,x):x.isShadowMaterial?(y.color.value.copy(x.color),y.opacity.value=x.opacity):x.isShaderMaterial&&(x.uniformsNeedUpdate=!1)}function s(y,x){y.opacity.value=x.opacity,x.color&&y.diffuse.value.copy(x.color),x.emissive&&y.emissive.value.copy(x.emissive).multiplyScalar(x.emissiveIntensity),x.map&&(y.map.value=x.map,n(x.map,y.mapTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,n(x.alphaMap,y.alphaMapTransform)),x.bumpMap&&(y.bumpMap.value=x.bumpMap,n(x.bumpMap,y.bumpMapTransform),y.bumpScale.value=x.bumpScale,x.side===Gi&&(y.bumpScale.value*=-1)),x.normalMap&&(y.normalMap.value=x.normalMap,n(x.normalMap,y.normalMapTransform),y.normalScale.value.copy(x.normalScale),x.side===Gi&&y.normalScale.value.negate()),x.displacementMap&&(y.displacementMap.value=x.displacementMap,n(x.displacementMap,y.displacementMapTransform),y.displacementScale.value=x.displacementScale,y.displacementBias.value=x.displacementBias),x.emissiveMap&&(y.emissiveMap.value=x.emissiveMap,n(x.emissiveMap,y.emissiveMapTransform)),x.specularMap&&(y.specularMap.value=x.specularMap,n(x.specularMap,y.specularMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest);const M=e.get(x),A=M.envMap,T=M.envMapRotation;A&&(y.envMap.value=A,eo.copy(T),eo.x*=-1,eo.y*=-1,eo.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(eo.y*=-1,eo.z*=-1),y.envMapRotation.value.setFromMatrix4(qW.makeRotationFromEuler(eo)),y.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=x.reflectivity,y.ior.value=x.ior,y.refractionRatio.value=x.refractionRatio),x.lightMap&&(y.lightMap.value=x.lightMap,y.lightMapIntensity.value=x.lightMapIntensity,n(x.lightMap,y.lightMapTransform)),x.aoMap&&(y.aoMap.value=x.aoMap,y.aoMapIntensity.value=x.aoMapIntensity,n(x.aoMap,y.aoMapTransform))}function o(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,x.map&&(y.map.value=x.map,n(x.map,y.mapTransform))}function c(y,x){y.dashSize.value=x.dashSize,y.totalSize.value=x.dashSize+x.gapSize,y.scale.value=x.scale}function u(y,x,M,A){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.size.value=x.size*M,y.scale.value=A*.5,x.map&&(y.map.value=x.map,n(x.map,y.uvTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,n(x.alphaMap,y.alphaMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest)}function f(y,x){y.diffuse.value.copy(x.color),y.opacity.value=x.opacity,y.rotation.value=x.rotation,x.map&&(y.map.value=x.map,n(x.map,y.mapTransform)),x.alphaMap&&(y.alphaMap.value=x.alphaMap,n(x.alphaMap,y.alphaMapTransform)),x.alphaTest>0&&(y.alphaTest.value=x.alphaTest)}function h(y,x){y.specular.value.copy(x.specular),y.shininess.value=Math.max(x.shininess,1e-4)}function p(y,x){x.gradientMap&&(y.gradientMap.value=x.gradientMap)}function m(y,x){y.metalness.value=x.metalness,x.metalnessMap&&(y.metalnessMap.value=x.metalnessMap,n(x.metalnessMap,y.metalnessMapTransform)),y.roughness.value=x.roughness,x.roughnessMap&&(y.roughnessMap.value=x.roughnessMap,n(x.roughnessMap,y.roughnessMapTransform)),x.envMap&&(y.envMapIntensity.value=x.envMapIntensity)}function v(y,x,M){y.ior.value=x.ior,x.sheen>0&&(y.sheenColor.value.copy(x.sheenColor).multiplyScalar(x.sheen),y.sheenRoughness.value=x.sheenRoughness,x.sheenColorMap&&(y.sheenColorMap.value=x.sheenColorMap,n(x.sheenColorMap,y.sheenColorMapTransform)),x.sheenRoughnessMap&&(y.sheenRoughnessMap.value=x.sheenRoughnessMap,n(x.sheenRoughnessMap,y.sheenRoughnessMapTransform))),x.clearcoat>0&&(y.clearcoat.value=x.clearcoat,y.clearcoatRoughness.value=x.clearcoatRoughness,x.clearcoatMap&&(y.clearcoatMap.value=x.clearcoatMap,n(x.clearcoatMap,y.clearcoatMapTransform)),x.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=x.clearcoatRoughnessMap,n(x.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),x.clearcoatNormalMap&&(y.clearcoatNormalMap.value=x.clearcoatNormalMap,n(x.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(x.clearcoatNormalScale),x.side===Gi&&y.clearcoatNormalScale.value.negate())),x.dispersion>0&&(y.dispersion.value=x.dispersion),x.iridescence>0&&(y.iridescence.value=x.iridescence,y.iridescenceIOR.value=x.iridescenceIOR,y.iridescenceThicknessMinimum.value=x.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=x.iridescenceThicknessRange[1],x.iridescenceMap&&(y.iridescenceMap.value=x.iridescenceMap,n(x.iridescenceMap,y.iridescenceMapTransform)),x.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=x.iridescenceThicknessMap,n(x.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),x.transmission>0&&(y.transmission.value=x.transmission,y.transmissionSamplerMap.value=M.texture,y.transmissionSamplerSize.value.set(M.width,M.height),x.transmissionMap&&(y.transmissionMap.value=x.transmissionMap,n(x.transmissionMap,y.transmissionMapTransform)),y.thickness.value=x.thickness,x.thicknessMap&&(y.thicknessMap.value=x.thicknessMap,n(x.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=x.attenuationDistance,y.attenuationColor.value.copy(x.attenuationColor)),x.anisotropy>0&&(y.anisotropyVector.value.set(x.anisotropy*Math.cos(x.anisotropyRotation),x.anisotropy*Math.sin(x.anisotropyRotation)),x.anisotropyMap&&(y.anisotropyMap.value=x.anisotropyMap,n(x.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=x.specularIntensity,y.specularColor.value.copy(x.specularColor),x.specularColorMap&&(y.specularColorMap.value=x.specularColorMap,n(x.specularColorMap,y.specularColorMapTransform)),x.specularIntensityMap&&(y.specularIntensityMap.value=x.specularIntensityMap,n(x.specularIntensityMap,y.specularIntensityMapTransform))}function _(y,x){x.matcap&&(y.matcap.value=x.matcap)}function w(y,x){const M=e.get(x).light;y.referencePosition.value.setFromMatrixPosition(M.matrixWorld),y.nearDistance.value=M.shadow.camera.near,y.farDistance.value=M.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function KW(t,e,n,i){let r={},s={},o=[];const c=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function u(M,A){const T=A.program;i.uniformBlockBinding(M,T)}function f(M,A){let T=r[M.id];T===void 0&&(_(M),T=h(M),r[M.id]=T,M.addEventListener("dispose",y));const D=A.program;i.updateUBOMapping(M,D);const I=e.render.frame;s[M.id]!==I&&(m(M),s[M.id]=I)}function h(M){const A=p();M.__bindingPointIndex=A;const T=t.createBuffer(),D=M.__size,I=M.usage;return t.bindBuffer(t.UNIFORM_BUFFER,T),t.bufferData(t.UNIFORM_BUFFER,D,I),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,A,T),T}function p(){for(let M=0;M<c;M++)if(o.indexOf(M)===-1)return o.push(M),M;return _n("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(M){const A=r[M.id],T=M.uniforms,D=M.__cache;t.bindBuffer(t.UNIFORM_BUFFER,A);for(let I=0,U=T.length;I<U;I++){const S=Array.isArray(T[I])?T[I]:[T[I]];for(let R=0,H=S.length;R<H;R++){const F=S[R];if(v(F,I,R,D)===!0){const W=F.__offset,X=Array.isArray(F.value)?F.value:[F.value];let V=0;for(let q=0;q<X.length;q++){const J=X[q],Q=w(J);typeof J=="number"||typeof J=="boolean"?(F.__data[0]=J,t.bufferSubData(t.UNIFORM_BUFFER,W+V,F.__data)):J.isMatrix3?(F.__data[0]=J.elements[0],F.__data[1]=J.elements[1],F.__data[2]=J.elements[2],F.__data[3]=0,F.__data[4]=J.elements[3],F.__data[5]=J.elements[4],F.__data[6]=J.elements[5],F.__data[7]=0,F.__data[8]=J.elements[6],F.__data[9]=J.elements[7],F.__data[10]=J.elements[8],F.__data[11]=0):(J.toArray(F.__data,V),V+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,W,F.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function v(M,A,T,D){const I=M.value,U=A+"_"+T;if(D[U]===void 0)return typeof I=="number"||typeof I=="boolean"?D[U]=I:D[U]=I.clone(),!0;{const S=D[U];if(typeof I=="number"||typeof I=="boolean"){if(S!==I)return D[U]=I,!0}else if(S.equals(I)===!1)return S.copy(I),!0}return!1}function _(M){const A=M.uniforms;let T=0;const D=16;for(let U=0,S=A.length;U<S;U++){const R=Array.isArray(A[U])?A[U]:[A[U]];for(let H=0,F=R.length;H<F;H++){const W=R[H],X=Array.isArray(W.value)?W.value:[W.value];for(let V=0,q=X.length;V<q;V++){const J=X[V],Q=w(J),$=T%D,Y=$%Q.boundary,Z=$+Y;T+=Y,Z!==0&&D-Z<Q.storage&&(T+=D-Z),W.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),W.__offset=T,T+=Q.storage}}}const I=T%D;return I>0&&(T+=D-I),M.__size=T,M.__cache={},this}function w(M){const A={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(A.boundary=4,A.storage=4):M.isVector2?(A.boundary=8,A.storage=8):M.isVector3||M.isColor?(A.boundary=16,A.storage=12):M.isVector4?(A.boundary=16,A.storage=16):M.isMatrix3?(A.boundary=48,A.storage=48):M.isMatrix4?(A.boundary=64,A.storage=64):M.isTexture?Ht("WebGLRenderer: Texture samplers can not be part of an uniforms group."):Ht("WebGLRenderer: Unsupported uniform value type.",M),A}function y(M){const A=M.target;A.removeEventListener("dispose",y);const T=o.indexOf(A.__bindingPointIndex);o.splice(T,1),t.deleteBuffer(r[A.id]),delete r[A.id],delete s[A.id]}function x(){for(const M in r)t.deleteBuffer(r[M]);o=[],r={},s={}}return{bind:u,update:f,dispose:x}}const ZW=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]);let $r=null;function JW(){return $r===null&&($r=new $H(ZW,16,16,Vl,Os),$r.name="DFG_LUT",$r.minFilter=wi,$r.magFilter=wi,$r.wrapS=Ls,$r.wrapT=Ls,$r.generateMipmaps=!1,$r.needsUpdate=!0),$r}class QW{constructor(e={}){const{canvas:n=SH(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:c=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:f=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:p=!1,reversedDepthBuffer:m=!1,outputBufferType:v=fr}=e;this.isWebGLRenderer=!0;let _;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");_=i.getContextAttributes().alpha}else _=o;const w=v,y=new Set([Ky,Yy,qy]),x=new Set([fr,cs,vu,yu,$y,Xy]),M=new Uint32Array(4),A=new Int32Array(4);let T=null,D=null;const I=[],U=[];let S=null;this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ns,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const R=this;let H=!1;this._outputColorSpace=ur;let F=0,W=0,X=null,V=-1,q=null;const J=new zn,Q=new zn;let $=null;const Y=new Mn(0);let Z=0,z=n.width,ie=n.height,_e=1,Ee=null,Ue=null;const le=new zn(0,0,z,ie),be=new zn(0,0,z,ie);let Se=!1;const Ne=new cR;let et=!1,xt=!1;const pn=new Yn,ht=new me,Ut=new zn,nn={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Lt=!1;function an(){return X===null?_e:1}let ee=i;function Sn(L,ae){return n.getContext(L,ae)}try{const L={alpha:!0,depth:r,stencil:s,antialias:c,premultipliedAlpha:u,preserveDrawingBuffer:f,powerPreference:h,failIfMajorPerformanceCaveat:p};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Wy}`),n.addEventListener("webglcontextlost",st,!1),n.addEventListener("webglcontextrestored",Dt,!1),n.addEventListener("webglcontextcreationerror",mn,!1),ee===null){const ae="webgl2";if(ee=Sn(ae,L),ee===null)throw Sn(ae)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(L){throw _n("WebGLRenderer: "+L.message),L}let At,kt,it,O,P,re,xe,we,ve,Ke,ke,pt,Ct,Re,Be,Ze,rt,$e,Vt,ne,Ve,Le,Xe;function Pe(){At=new Q6(ee),At.init(),Ve=new GW(ee,At),kt=new j6(ee,At,e,Ve),it=new VW(ee,At),kt.reversedDepthBuffer&&m&&it.buffers.depth.setReversed(!0),O=new n9(ee),P=new AW,re=new HW(ee,At,it,P,kt,Ve,O),xe=new J6(R),we=new oG(ee),Le=new G6(ee,we),ve=new e9(ee,we,O,Le),Ke=new r9(ee,ve,we,Le,O),$e=new i9(ee,kt,re),Be=new $6(P),ke=new TW(R,xe,At,kt,Le,Be),pt=new YW(R,P),Ct=new RW,Re=new IW(At),rt=new H6(R,xe,it,Ke,_,u),Ze=new zW(R,Ke,kt),Xe=new KW(ee,O,kt,it),Vt=new W6(ee,At,O),ne=new t9(ee,At,O),O.programs=ke.programs,R.capabilities=kt,R.extensions=At,R.properties=P,R.renderLists=Ct,R.shadowMap=Ze,R.state=it,R.info=O}Pe(),w!==fr&&(S=new a9(w,n.width,n.height,r,s));const ye=new XW(R,ee);this.xr=ye,this.getContext=function(){return ee},this.getContextAttributes=function(){return ee.getContextAttributes()},this.forceContextLoss=function(){const L=At.get("WEBGL_lose_context");L&&L.loseContext()},this.forceContextRestore=function(){const L=At.get("WEBGL_lose_context");L&&L.restoreContext()},this.getPixelRatio=function(){return _e},this.setPixelRatio=function(L){L!==void 0&&(_e=L,this.setSize(z,ie,!1))},this.getSize=function(L){return L.set(z,ie)},this.setSize=function(L,ae,pe=!0){if(ye.isPresenting){Ht("WebGLRenderer: Can't change size while VR device is presenting.");return}z=L,ie=ae,n.width=Math.floor(L*_e),n.height=Math.floor(ae*_e),pe===!0&&(n.style.width=L+"px",n.style.height=ae+"px"),S!==null&&S.setSize(n.width,n.height),this.setViewport(0,0,L,ae)},this.getDrawingBufferSize=function(L){return L.set(z*_e,ie*_e).floor()},this.setDrawingBufferSize=function(L,ae,pe){z=L,ie=ae,_e=pe,n.width=Math.floor(L*pe),n.height=Math.floor(ae*pe),this.setViewport(0,0,L,ae)},this.setEffects=function(L){if(w===fr){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(L){for(let ae=0;ae<L.length;ae++)if(L[ae].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}S.setEffects(L||[])},this.getCurrentViewport=function(L){return L.copy(J)},this.getViewport=function(L){return L.copy(le)},this.setViewport=function(L,ae,pe,de){L.isVector4?le.set(L.x,L.y,L.z,L.w):le.set(L,ae,pe,de),it.viewport(J.copy(le).multiplyScalar(_e).round())},this.getScissor=function(L){return L.copy(be)},this.setScissor=function(L,ae,pe,de){L.isVector4?be.set(L.x,L.y,L.z,L.w):be.set(L,ae,pe,de),it.scissor(Q.copy(be).multiplyScalar(_e).round())},this.getScissorTest=function(){return Se},this.setScissorTest=function(L){it.setScissorTest(Se=L)},this.setOpaqueSort=function(L){Ee=L},this.setTransparentSort=function(L){Ue=L},this.getClearColor=function(L){return L.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor(...arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha(...arguments)},this.clear=function(L=!0,ae=!0,pe=!0){let de=0;if(L){let ce=!1;if(X!==null){const We=X.texture.format;ce=y.has(We)}if(ce){const We=X.texture.type,qe=x.has(We),Ge=rt.getClearColor(),je=rt.getClearAlpha(),ct=Ge.r,He=Ge.g,Mt=Ge.b;qe?(M[0]=ct,M[1]=He,M[2]=Mt,M[3]=je,ee.clearBufferuiv(ee.COLOR,0,M)):(A[0]=ct,A[1]=He,A[2]=Mt,A[3]=je,ee.clearBufferiv(ee.COLOR,0,A))}else de|=ee.COLOR_BUFFER_BIT}ae&&(de|=ee.DEPTH_BUFFER_BIT),pe&&(de|=ee.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),de!==0&&ee.clear(de)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",st,!1),n.removeEventListener("webglcontextrestored",Dt,!1),n.removeEventListener("webglcontextcreationerror",mn,!1),rt.dispose(),Ct.dispose(),Re.dispose(),P.dispose(),xe.dispose(),Ke.dispose(),Le.dispose(),Xe.dispose(),ke.dispose(),ye.dispose(),ye.removeEventListener("sessionstart",oe),ye.removeEventListener("sessionend",he),Me.stop()};function st(L){L.preventDefault(),SE("WebGLRenderer: Context Lost."),H=!0}function Dt(){SE("WebGLRenderer: Context Restored."),H=!1;const L=O.autoReset,ae=Ze.enabled,pe=Ze.autoUpdate,de=Ze.needsUpdate,ce=Ze.type;Pe(),O.autoReset=L,Ze.enabled=ae,Ze.autoUpdate=pe,Ze.needsUpdate=de,Ze.type=ce}function mn(L){_n("WebGLRenderer: A WebGL context could not be created. Reason: ",L.statusMessage)}function Kt(L){const ae=L.target;ae.removeEventListener("dispose",Kt),ci(ae)}function ci(L){ii(L),P.remove(L)}function ii(L){const ae=P.get(L).programs;ae!==void 0&&(ae.forEach(function(pe){ke.releaseProgram(pe)}),L.isShaderMaterial&&ke.releaseShaderCache(L))}this.renderBufferDirect=function(L,ae,pe,de,ce,We){ae===null&&(ae=nn);const qe=ce.isMesh&&ce.matrixWorld.determinant()<0,Ge=un(L,ae,pe,de,ce);it.setMaterial(de,qe);let je=pe.index,ct=1;if(de.wireframe===!0){if(je=ve.getWireframeAttribute(pe),je===void 0)return;ct=2}const He=pe.drawRange,Mt=pe.attributes.position;let lt=He.start*ct,Zt=(He.start+He.count)*ct;We!==null&&(lt=Math.max(lt,We.start*ct),Zt=Math.min(Zt,(We.start+We.count)*ct)),je!==null?(lt=Math.max(lt,0),Zt=Math.min(Zt,je.count)):Mt!=null&&(lt=Math.max(lt,0),Zt=Math.min(Zt,Mt.count));const Nt=Zt-lt;if(Nt<0||Nt===1/0)return;Le.setup(ce,de,Ge,pe,je);let vn,tn=Vt;if(je!==null&&(vn=we.get(je),tn=ne,tn.setIndex(vn)),ce.isMesh)de.wireframe===!0?(it.setLineWidth(de.wireframeLinewidth*an()),tn.setMode(ee.LINES)):tn.setMode(ee.TRIANGLES);else if(ce.isLine){let In=de.linewidth;In===void 0&&(In=1),it.setLineWidth(In*an()),ce.isLineSegments?tn.setMode(ee.LINES):ce.isLineLoop?tn.setMode(ee.LINE_LOOP):tn.setMode(ee.LINE_STRIP)}else ce.isPoints?tn.setMode(ee.POINTS):ce.isSprite&&tn.setMode(ee.TRIANGLES);if(ce.isBatchedMesh)if(ce._multiDrawInstances!==null)yh("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),tn.renderMultiDrawInstances(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount,ce._multiDrawInstances);else if(At.get("WEBGL_multi_draw"))tn.renderMultiDraw(ce._multiDrawStarts,ce._multiDrawCounts,ce._multiDrawCount);else{const In=ce._multiDrawStarts,_t=ce._multiDrawCounts,Mi=ce._multiDrawCount,rn=je?we.get(je).bytesPerElement:1,Ni=P.get(de).currentProgram.getUniforms();for(let Ii=0;Ii<Mi;Ii++)Ni.setValue(ee,"_gl_DrawID",Ii),tn.render(In[Ii]/rn,_t[Ii])}else if(ce.isInstancedMesh)tn.renderInstances(lt,Nt,ce.count);else if(pe.isInstancedBufferGeometry){const In=pe._maxInstanceCount!==void 0?pe._maxInstanceCount:1/0,_t=Math.min(pe.instanceCount,In);tn.renderInstances(lt,Nt,_t)}else tn.render(lt,Nt)};function Gs(L,ae,pe){L.transparent===!0&&L.side===ks&&L.forceSinglePass===!1?(L.side=Gi,L.needsUpdate=!0,Et(L,ae,pe),L.side=Pa,L.needsUpdate=!0,Et(L,ae,pe),L.side=ks):Et(L,ae,pe)}this.compile=function(L,ae,pe=null){pe===null&&(pe=L),D=Re.get(pe),D.init(ae),U.push(D),pe.traverseVisible(function(ce){ce.isLight&&ce.layers.test(ae.layers)&&(D.pushLight(ce),ce.castShadow&&D.pushShadow(ce))}),L!==pe&&L.traverseVisible(function(ce){ce.isLight&&ce.layers.test(ae.layers)&&(D.pushLight(ce),ce.castShadow&&D.pushShadow(ce))}),D.setupLights();const de=new Set;return L.traverse(function(ce){if(!(ce.isMesh||ce.isPoints||ce.isLine||ce.isSprite))return;const We=ce.material;if(We)if(Array.isArray(We))for(let qe=0;qe<We.length;qe++){const Ge=We[qe];Gs(Ge,pe,ce),de.add(Ge)}else Gs(We,pe,ce),de.add(We)}),D=U.pop(),de},this.compileAsync=function(L,ae,pe=null){const de=this.compile(L,ae,pe);return new Promise(ce=>{function We(){if(de.forEach(function(qe){P.get(qe).currentProgram.isReady()&&de.delete(qe)}),de.size===0){ce(L);return}setTimeout(We,10)}At.get("KHR_parallel_shader_compile")!==null?We():setTimeout(We,10)})};let br=null;function K(L){br&&br(L)}function oe(){Me.stop()}function he(){Me.start()}const Me=new mR;Me.setAnimationLoop(K),typeof self<"u"&&Me.setContext(self),this.setAnimationLoop=function(L){br=L,ye.setAnimationLoop(L),L===null?Me.stop():Me.start()},ye.addEventListener("sessionstart",oe),ye.addEventListener("sessionend",he),this.render=function(L,ae){if(ae!==void 0&&ae.isCamera!==!0){_n("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(H===!0)return;const pe=ye.enabled===!0&&ye.isPresenting===!0,de=S!==null&&(X===null||pe)&&S.begin(R,X);if(L.matrixWorldAutoUpdate===!0&&L.updateMatrixWorld(),ae.parent===null&&ae.matrixWorldAutoUpdate===!0&&ae.updateMatrixWorld(),ye.enabled===!0&&ye.isPresenting===!0&&(S===null||S.isCompositing()===!1)&&(ye.cameraAutoUpdate===!0&&ye.updateCamera(ae),ae=ye.getCamera()),L.isScene===!0&&L.onBeforeRender(R,L,ae,X),D=Re.get(L,U.length),D.init(ae),U.push(D),pn.multiplyMatrices(ae.projectionMatrix,ae.matrixWorldInverse),Ne.setFromProjectionMatrix(pn,Qr,ae.reversedDepth),xt=this.localClippingEnabled,et=Be.init(this.clippingPlanes,xt),T=Ct.get(L,I.length),T.init(),I.push(T),ye.enabled===!0&&ye.isPresenting===!0){const qe=R.xr.getDepthSensingMesh();qe!==null&&Ie(qe,ae,-1/0,R.sortObjects)}Ie(L,ae,0,R.sortObjects),T.finish(),R.sortObjects===!0&&T.sort(Ee,Ue),Lt=ye.enabled===!1||ye.isPresenting===!1||ye.hasDepthSensing()===!1,Lt&&rt.addToRenderList(T,L),this.info.render.frame++,et===!0&&Be.beginShadows();const ce=D.state.shadowsArray;if(Ze.render(ce,L,ae),et===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset(),(de&&S.hasRenderPass())===!1){const qe=T.opaque,Ge=T.transmissive;if(D.setupLights(),ae.isArrayCamera){const je=ae.cameras;if(Ge.length>0)for(let ct=0,He=je.length;ct<He;ct++){const Mt=je[ct];tt(qe,Ge,L,Mt)}Lt&&rt.render(L);for(let ct=0,He=je.length;ct<He;ct++){const Mt=je[ct];vt(T,L,Mt,Mt.viewport)}}else Ge.length>0&&tt(qe,Ge,L,ae),Lt&&rt.render(L),vt(T,L,ae)}X!==null&&W===0&&(re.updateMultisampleRenderTarget(X),re.updateRenderTargetMipmap(X)),de&&S.end(R),L.isScene===!0&&L.onAfterRender(R,L,ae),Le.resetDefaultState(),V=-1,q=null,U.pop(),U.length>0?(D=U[U.length-1],et===!0&&Be.setGlobalState(R.clippingPlanes,D.state.camera)):D=null,I.pop(),I.length>0?T=I[I.length-1]:T=null};function Ie(L,ae,pe,de){if(L.visible===!1)return;if(L.layers.test(ae.layers)){if(L.isGroup)pe=L.renderOrder;else if(L.isLOD)L.autoUpdate===!0&&L.update(ae);else if(L.isLight)D.pushLight(L),L.castShadow&&D.pushShadow(L);else if(L.isSprite){if(!L.frustumCulled||Ne.intersectsSprite(L)){de&&Ut.setFromMatrixPosition(L.matrixWorld).applyMatrix4(pn);const qe=Ke.update(L),Ge=L.material;Ge.visible&&T.push(L,qe,Ge,pe,Ut.z,null)}}else if((L.isMesh||L.isLine||L.isPoints)&&(!L.frustumCulled||Ne.intersectsObject(L))){const qe=Ke.update(L),Ge=L.material;if(de&&(L.boundingSphere!==void 0?(L.boundingSphere===null&&L.computeBoundingSphere(),Ut.copy(L.boundingSphere.center)):(qe.boundingSphere===null&&qe.computeBoundingSphere(),Ut.copy(qe.boundingSphere.center)),Ut.applyMatrix4(L.matrixWorld).applyMatrix4(pn)),Array.isArray(Ge)){const je=qe.groups;for(let ct=0,He=je.length;ct<He;ct++){const Mt=je[ct],lt=Ge[Mt.materialIndex];lt&<.visible&&T.push(L,qe,lt,pe,Ut.z,Mt)}}else Ge.visible&&T.push(L,qe,Ge,pe,Ut.z,null)}}const We=L.children;for(let qe=0,Ge=We.length;qe<Ge;qe++)Ie(We[qe],ae,pe,de)}function vt(L,ae,pe,de){const{opaque:ce,transmissive:We,transparent:qe}=L;D.setupLightsView(pe),et===!0&&Be.setGlobalState(R.clippingPlanes,pe),de&&it.viewport(J.copy(de)),ce.length>0&&yt(ce,ae,pe),We.length>0&&yt(We,ae,pe),qe.length>0&&yt(qe,ae,pe),it.buffers.depth.setTest(!0),it.buffers.depth.setMask(!0),it.buffers.color.setMask(!0),it.setPolygonOffset(!1)}function tt(L,ae,pe,de){if((pe.isScene===!0?pe.overrideMaterial:null)!==null)return;if(D.state.transmissionRenderTarget[de.id]===void 0){const lt=At.has("EXT_color_buffer_half_float")||At.has("EXT_color_buffer_float");D.state.transmissionRenderTarget[de.id]=new is(1,1,{generateMipmaps:!0,type:lt?Os:fr,minFilter:uo,samples:Math.max(4,kt.samples),stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:fn.workingColorSpace})}const We=D.state.transmissionRenderTarget[de.id],qe=de.viewport||J;We.setSize(qe.z*R.transmissionResolutionScale,qe.w*R.transmissionResolutionScale);const Ge=R.getRenderTarget(),je=R.getActiveCubeFace(),ct=R.getActiveMipmapLevel();R.setRenderTarget(We),R.getClearColor(Y),Z=R.getClearAlpha(),Z<1&&R.setClearColor(16777215,.5),R.clear(),Lt&&rt.render(pe);const He=R.toneMapping;R.toneMapping=ns;const Mt=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),D.setupLightsView(de),et===!0&&Be.setGlobalState(R.clippingPlanes,de),yt(L,pe,de),re.updateMultisampleRenderTarget(We),re.updateRenderTargetMipmap(We),At.has("WEBGL_multisampled_render_to_texture")===!1){let lt=!1;for(let Zt=0,Nt=ae.length;Zt<Nt;Zt++){const vn=ae[Zt],{object:tn,geometry:In,material:_t,group:Mi}=vn;if(_t.side===ks&&tn.layers.test(de.layers)){const rn=_t.side;_t.side=Gi,_t.needsUpdate=!0,Qe(tn,pe,de,In,_t,Mi),_t.side=rn,_t.needsUpdate=!0,lt=!0}}lt===!0&&(re.updateMultisampleRenderTarget(We),re.updateRenderTargetMipmap(We))}R.setRenderTarget(Ge,je,ct),R.setClearColor(Y,Z),Mt!==void 0&&(de.viewport=Mt),R.toneMapping=He}function yt(L,ae,pe){const de=ae.isScene===!0?ae.overrideMaterial:null;for(let ce=0,We=L.length;ce<We;ce++){const qe=L[ce],{object:Ge,geometry:je,group:ct}=qe;let He=qe.material;He.allowOverride===!0&&de!==null&&(He=de),Ge.layers.test(pe.layers)&&Qe(Ge,ae,pe,je,He,ct)}}function Qe(L,ae,pe,de,ce,We){L.onBeforeRender(R,ae,pe,de,ce,We),L.modelViewMatrix.multiplyMatrices(pe.matrixWorldInverse,L.matrixWorld),L.normalMatrix.getNormalMatrix(L.modelViewMatrix),ce.onBeforeRender(R,ae,pe,de,L,We),ce.transparent===!0&&ce.side===ks&&ce.forceSinglePass===!1?(ce.side=Gi,ce.needsUpdate=!0,R.renderBufferDirect(pe,ae,de,ce,L,We),ce.side=Pa,ce.needsUpdate=!0,R.renderBufferDirect(pe,ae,de,ce,L,We),ce.side=ks):R.renderBufferDirect(pe,ae,de,ce,L,We),L.onAfterRender(R,ae,pe,de,ce,We)}function Et(L,ae,pe){ae.isScene!==!0&&(ae=nn);const de=P.get(L),ce=D.state.lights,We=D.state.shadowsArray,qe=ce.state.version,Ge=ke.getParameters(L,ce.state,We,ae,pe),je=ke.getProgramCacheKey(Ge);let ct=de.programs;de.environment=L.isMeshStandardMaterial||L.isMeshLambertMaterial||L.isMeshPhongMaterial?ae.environment:null,de.fog=ae.fog;const He=L.isMeshStandardMaterial||L.isMeshLambertMaterial&&!L.envMap||L.isMeshPhongMaterial&&!L.envMap;de.envMap=xe.get(L.envMap||de.environment,He),de.envMapRotation=de.environment!==null&&L.envMap===null?ae.environmentRotation:L.envMapRotation,ct===void 0&&(L.addEventListener("dispose",Kt),ct=new Map,de.programs=ct);let Mt=ct.get(je);if(Mt!==void 0){if(de.currentProgram===Mt&&de.lightsStateVersion===qe)return bt(L,Ge),Mt}else Ge.uniforms=ke.getUniforms(L),L.onBeforeCompile(Ge,R),Mt=ke.acquireProgram(Ge,je),ct.set(je,Mt),de.uniforms=Ge.uniforms;const lt=de.uniforms;return(!L.isShaderMaterial&&!L.isRawShaderMaterial||L.clipping===!0)&&(lt.clippingPlanes=Be.uniform),bt(L,Ge),de.needsLights=En(L),de.lightsStateVersion=qe,de.needsLights&&(lt.ambientLightColor.value=ce.state.ambient,lt.lightProbe.value=ce.state.probe,lt.directionalLights.value=ce.state.directional,lt.directionalLightShadows.value=ce.state.directionalShadow,lt.spotLights.value=ce.state.spot,lt.spotLightShadows.value=ce.state.spotShadow,lt.rectAreaLights.value=ce.state.rectArea,lt.ltc_1.value=ce.state.rectAreaLTC1,lt.ltc_2.value=ce.state.rectAreaLTC2,lt.pointLights.value=ce.state.point,lt.pointLightShadows.value=ce.state.pointShadow,lt.hemisphereLights.value=ce.state.hemi,lt.directionalShadowMatrix.value=ce.state.directionalShadowMatrix,lt.spotLightMatrix.value=ce.state.spotLightMatrix,lt.spotLightMap.value=ce.state.spotLightMap,lt.pointShadowMatrix.value=ce.state.pointShadowMatrix),de.currentProgram=Mt,de.uniformsList=null,Mt}function Tt(L){if(L.uniformsList===null){const ae=L.currentProgram.getUniforms();L.uniformsList=Hf.seqWithValue(ae.seq,L.uniforms)}return L.uniformsList}function bt(L,ae){const pe=P.get(L);pe.outputColorSpace=ae.outputColorSpace,pe.batching=ae.batching,pe.batchingColor=ae.batchingColor,pe.instancing=ae.instancing,pe.instancingColor=ae.instancingColor,pe.instancingMorph=ae.instancingMorph,pe.skinning=ae.skinning,pe.morphTargets=ae.morphTargets,pe.morphNormals=ae.morphNormals,pe.morphColors=ae.morphColors,pe.morphTargetsCount=ae.morphTargetsCount,pe.numClippingPlanes=ae.numClippingPlanes,pe.numIntersection=ae.numClipIntersection,pe.vertexAlphas=ae.vertexAlphas,pe.vertexTangents=ae.vertexTangents,pe.toneMapping=ae.toneMapping}function un(L,ae,pe,de,ce){ae.isScene!==!0&&(ae=nn),re.resetTextureUnits();const We=ae.fog,qe=de.isMeshStandardMaterial||de.isMeshLambertMaterial||de.isMeshPhongMaterial?ae.environment:null,Ge=X===null?R.outputColorSpace:X.isXRRenderTarget===!0?X.texture.colorSpace:Mo,je=de.isMeshStandardMaterial||de.isMeshLambertMaterial&&!de.envMap||de.isMeshPhongMaterial&&!de.envMap,ct=xe.get(de.envMap||qe,je),He=de.vertexColors===!0&&!!pe.attributes.color&&pe.attributes.color.itemSize===4,Mt=!!pe.attributes.tangent&&(!!de.normalMap||de.anisotropy>0),lt=!!pe.morphAttributes.position,Zt=!!pe.morphAttributes.normal,Nt=!!pe.morphAttributes.color;let vn=ns;de.toneMapped&&(X===null||X.isXRRenderTarget===!0)&&(vn=R.toneMapping);const tn=pe.morphAttributes.position||pe.morphAttributes.normal||pe.morphAttributes.color,In=tn!==void 0?tn.length:0,_t=P.get(de),Mi=D.state.lights;if(et===!0&&(xt===!0||L!==q)){const Vn=L===q&&de.id===V;Be.setState(de,L,Vn)}let rn=!1;de.version===_t.__version?(_t.needsLights&&_t.lightsStateVersion!==Mi.state.version||_t.outputColorSpace!==Ge||ce.isBatchedMesh&&_t.batching===!1||!ce.isBatchedMesh&&_t.batching===!0||ce.isBatchedMesh&&_t.batchingColor===!0&&ce.colorTexture===null||ce.isBatchedMesh&&_t.batchingColor===!1&&ce.colorTexture!==null||ce.isInstancedMesh&&_t.instancing===!1||!ce.isInstancedMesh&&_t.instancing===!0||ce.isSkinnedMesh&&_t.skinning===!1||!ce.isSkinnedMesh&&_t.skinning===!0||ce.isInstancedMesh&&_t.instancingColor===!0&&ce.instanceColor===null||ce.isInstancedMesh&&_t.instancingColor===!1&&ce.instanceColor!==null||ce.isInstancedMesh&&_t.instancingMorph===!0&&ce.morphTexture===null||ce.isInstancedMesh&&_t.instancingMorph===!1&&ce.morphTexture!==null||_t.envMap!==ct||de.fog===!0&&_t.fog!==We||_t.numClippingPlanes!==void 0&&(_t.numClippingPlanes!==Be.numPlanes||_t.numIntersection!==Be.numIntersection)||_t.vertexAlphas!==He||_t.vertexTangents!==Mt||_t.morphTargets!==lt||_t.morphNormals!==Zt||_t.morphColors!==Nt||_t.toneMapping!==vn||_t.morphTargetsCount!==In)&&(rn=!0):(rn=!0,_t.__version=de.version);let Ni=_t.currentProgram;rn===!0&&(Ni=Et(de,ae,ce));let Ii=!1,Wi=!1,Ws=!1;const xn=Ni.getUniforms(),Ft=_t.uniforms;if(it.useProgram(Ni.program)&&(Ii=!0,Wi=!0,Ws=!0),de.id!==V&&(V=de.id,Wi=!0),Ii||q!==L){it.buffers.depth.getReversed()&&L.reversedDepth!==!0&&(L._reversedDepth=!0,L.updateProjectionMatrix()),xn.setValue(ee,"projectionMatrix",L.projectionMatrix),xn.setValue(ee,"viewMatrix",L.matrixWorldInverse);const tr=xn.map.cameraPosition;tr!==void 0&&tr.setValue(ee,ht.setFromMatrixPosition(L.matrixWorld)),kt.logarithmicDepthBuffer&&xn.setValue(ee,"logDepthBufFC",2/(Math.log(L.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&xn.setValue(ee,"isOrthographic",L.isOrthographicCamera===!0),q!==L&&(q=L,Wi=!0,Ws=!0)}if(_t.needsLights&&(Mi.state.directionalShadowMap.length>0&&xn.setValue(ee,"directionalShadowMap",Mi.state.directionalShadowMap,re),Mi.state.spotShadowMap.length>0&&xn.setValue(ee,"spotShadowMap",Mi.state.spotShadowMap,re),Mi.state.pointShadowMap.length>0&&xn.setValue(ee,"pointShadowMap",Mi.state.pointShadowMap,re)),ce.isSkinnedMesh){xn.setOptional(ee,ce,"bindMatrix"),xn.setOptional(ee,ce,"bindMatrixInverse");const Vn=ce.skeleton;Vn&&(Vn.boneTexture===null&&Vn.computeBoneTexture(),xn.setValue(ee,"boneTexture",Vn.boneTexture,re))}ce.isBatchedMesh&&(xn.setOptional(ee,ce,"batchingTexture"),xn.setValue(ee,"batchingTexture",ce._matricesTexture,re),xn.setOptional(ee,ce,"batchingIdTexture"),xn.setValue(ee,"batchingIdTexture",ce._indirectTexture,re),xn.setOptional(ee,ce,"batchingColorTexture"),ce._colorsTexture!==null&&xn.setValue(ee,"batchingColorTexture",ce._colorsTexture,re));const Sr=pe.morphAttributes;if((Sr.position!==void 0||Sr.normal!==void 0||Sr.color!==void 0)&&$e.update(ce,pe,Ni),(Wi||_t.receiveShadow!==ce.receiveShadow)&&(_t.receiveShadow=ce.receiveShadow,xn.setValue(ee,"receiveShadow",ce.receiveShadow)),(de.isMeshStandardMaterial||de.isMeshLambertMaterial||de.isMeshPhongMaterial)&&de.envMap===null&&ae.environment!==null&&(Ft.envMapIntensity.value=ae.environmentIntensity),Ft.dfgLUT!==void 0&&(Ft.dfgLUT.value=JW()),Wi&&(xn.setValue(ee,"toneMappingExposure",R.toneMappingExposure),_t.needsLights&&en(Ft,Ws),We&&de.fog===!0&&pt.refreshFogUniforms(Ft,We),pt.refreshMaterialUniforms(Ft,de,_e,ie,D.state.transmissionRenderTarget[L.id]),Hf.upload(ee,Tt(_t),Ft,re)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(Hf.upload(ee,Tt(_t),Ft,re),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&xn.setValue(ee,"center",ce.center),xn.setValue(ee,"modelViewMatrix",ce.modelViewMatrix),xn.setValue(ee,"normalMatrix",ce.normalMatrix),xn.setValue(ee,"modelMatrix",ce.matrixWorld),de.isShaderMaterial||de.isRawShaderMaterial){const Vn=de.uniformsGroups;for(let tr=0,ps=Vn.length;tr<ps;tr++){const ec=Vn[tr];Xe.update(ec,Ni),Xe.bind(ec,Ni)}}return Ni}function en(L,ae){L.ambientLightColor.needsUpdate=ae,L.lightProbe.needsUpdate=ae,L.directionalLights.needsUpdate=ae,L.directionalLightShadows.needsUpdate=ae,L.pointLights.needsUpdate=ae,L.pointLightShadows.needsUpdate=ae,L.spotLights.needsUpdate=ae,L.spotLightShadows.needsUpdate=ae,L.rectAreaLights.needsUpdate=ae,L.hemisphereLights.needsUpdate=ae}function En(L){return L.isMeshLambertMaterial||L.isMeshToonMaterial||L.isMeshPhongMaterial||L.isMeshStandardMaterial||L.isShadowMaterial||L.isShaderMaterial&&L.lights===!0}this.getActiveCubeFace=function(){return F},this.getActiveMipmapLevel=function(){return W},this.getRenderTarget=function(){return X},this.setRenderTargetTextures=function(L,ae,pe){const de=P.get(L);de.__autoAllocateDepthBuffer=L.resolveDepthBuffer===!1,de.__autoAllocateDepthBuffer===!1&&(de.__useRenderToTexture=!1),P.get(L.texture).__webglTexture=ae,P.get(L.depthTexture).__webglTexture=de.__autoAllocateDepthBuffer?void 0:pe,de.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(L,ae){const pe=P.get(L);pe.__webglFramebuffer=ae,pe.__useDefaultFramebuffer=ae===void 0};const Nn=ee.createFramebuffer();this.setRenderTarget=function(L,ae=0,pe=0){X=L,F=ae,W=pe;let de=null,ce=!1,We=!1;if(L){const Ge=P.get(L);if(Ge.__useDefaultFramebuffer!==void 0){it.bindFramebuffer(ee.FRAMEBUFFER,Ge.__webglFramebuffer),J.copy(L.viewport),Q.copy(L.scissor),$=L.scissorTest,it.viewport(J),it.scissor(Q),it.setScissorTest($),V=-1;return}else if(Ge.__webglFramebuffer===void 0)re.setupRenderTarget(L);else if(Ge.__hasExternalTextures)re.rebindTextures(L,P.get(L.texture).__webglTexture,P.get(L.depthTexture).__webglTexture);else if(L.depthBuffer){const He=L.depthTexture;if(Ge.__boundDepthTexture!==He){if(He!==null&&P.has(He)&&(L.width!==He.image.width||L.height!==He.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");re.setupDepthRenderbuffer(L)}}const je=L.texture;(je.isData3DTexture||je.isDataArrayTexture||je.isCompressedArrayTexture)&&(We=!0);const ct=P.get(L).__webglFramebuffer;L.isWebGLCubeRenderTarget?(Array.isArray(ct[ae])?de=ct[ae][pe]:de=ct[ae],ce=!0):L.samples>0&&re.useMultisampledRTT(L)===!1?de=P.get(L).__webglMultisampledFramebuffer:Array.isArray(ct)?de=ct[pe]:de=ct,J.copy(L.viewport),Q.copy(L.scissor),$=L.scissorTest}else J.copy(le).multiplyScalar(_e).floor(),Q.copy(be).multiplyScalar(_e).floor(),$=Se;if(pe!==0&&(de=Nn),it.bindFramebuffer(ee.FRAMEBUFFER,de)&&it.drawBuffers(L,de),it.viewport(J),it.scissor(Q),it.setScissorTest($),ce){const Ge=P.get(L.texture);ee.framebufferTexture2D(ee.FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_CUBE_MAP_POSITIVE_X+ae,Ge.__webglTexture,pe)}else if(We){const Ge=ae;for(let je=0;je<L.textures.length;je++){const ct=P.get(L.textures[je]);ee.framebufferTextureLayer(ee.FRAMEBUFFER,ee.COLOR_ATTACHMENT0+je,ct.__webglTexture,pe,Ge)}}else if(L!==null&&pe!==0){const Ge=P.get(L.texture);ee.framebufferTexture2D(ee.FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_2D,Ge.__webglTexture,pe)}V=-1},this.readRenderTargetPixels=function(L,ae,pe,de,ce,We,qe,Ge=0){if(!(L&&L.isWebGLRenderTarget)){_n("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let je=P.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&qe!==void 0&&(je=je[qe]),je){it.bindFramebuffer(ee.FRAMEBUFFER,je);try{const ct=L.textures[Ge],He=ct.format,Mt=ct.type;if(L.textures.length>1&&ee.readBuffer(ee.COLOR_ATTACHMENT0+Ge),!kt.textureFormatReadable(He)){_n("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!kt.textureTypeReadable(Mt)){_n("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ae>=0&&ae<=L.width-de&&pe>=0&&pe<=L.height-ce&&ee.readPixels(ae,pe,de,ce,Ve.convert(He),Ve.convert(Mt),We)}finally{const ct=X!==null?P.get(X).__webglFramebuffer:null;it.bindFramebuffer(ee.FRAMEBUFFER,ct)}}},this.readRenderTargetPixelsAsync=async function(L,ae,pe,de,ce,We,qe,Ge=0){if(!(L&&L.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let je=P.get(L).__webglFramebuffer;if(L.isWebGLCubeRenderTarget&&qe!==void 0&&(je=je[qe]),je)if(ae>=0&&ae<=L.width-de&&pe>=0&&pe<=L.height-ce){it.bindFramebuffer(ee.FRAMEBUFFER,je);const ct=L.textures[Ge],He=ct.format,Mt=ct.type;if(L.textures.length>1&&ee.readBuffer(ee.COLOR_ATTACHMENT0+Ge),!kt.textureFormatReadable(He))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!kt.textureTypeReadable(Mt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const lt=ee.createBuffer();ee.bindBuffer(ee.PIXEL_PACK_BUFFER,lt),ee.bufferData(ee.PIXEL_PACK_BUFFER,We.byteLength,ee.STREAM_READ),ee.readPixels(ae,pe,de,ce,Ve.convert(He),Ve.convert(Mt),0);const Zt=X!==null?P.get(X).__webglFramebuffer:null;it.bindFramebuffer(ee.FRAMEBUFFER,Zt);const Nt=ee.fenceSync(ee.SYNC_GPU_COMMANDS_COMPLETE,0);return ee.flush(),await wH(ee,Nt,4),ee.bindBuffer(ee.PIXEL_PACK_BUFFER,lt),ee.getBufferSubData(ee.PIXEL_PACK_BUFFER,0,We),ee.deleteBuffer(lt),ee.deleteSync(Nt),We}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(L,ae=null,pe=0){const de=Math.pow(2,-pe),ce=Math.floor(L.image.width*de),We=Math.floor(L.image.height*de),qe=ae!==null?ae.x:0,Ge=ae!==null?ae.y:0;re.setTexture2D(L,0),ee.copyTexSubImage2D(ee.TEXTURE_2D,pe,0,0,qe,Ge,ce,We),it.unbindTexture()};const Kn=ee.createFramebuffer(),gn=ee.createFramebuffer();this.copyTextureToTexture=function(L,ae,pe=null,de=null,ce=0,We=0){let qe,Ge,je,ct,He,Mt,lt,Zt,Nt;const vn=L.isCompressedTexture?L.mipmaps[We]:L.image;if(pe!==null)qe=pe.max.x-pe.min.x,Ge=pe.max.y-pe.min.y,je=pe.isBox3?pe.max.z-pe.min.z:1,ct=pe.min.x,He=pe.min.y,Mt=pe.isBox3?pe.min.z:0;else{const Ft=Math.pow(2,-ce);qe=Math.floor(vn.width*Ft),Ge=Math.floor(vn.height*Ft),L.isDataArrayTexture?je=vn.depth:L.isData3DTexture?je=Math.floor(vn.depth*Ft):je=1,ct=0,He=0,Mt=0}de!==null?(lt=de.x,Zt=de.y,Nt=de.z):(lt=0,Zt=0,Nt=0);const tn=Ve.convert(ae.format),In=Ve.convert(ae.type);let _t;ae.isData3DTexture?(re.setTexture3D(ae,0),_t=ee.TEXTURE_3D):ae.isDataArrayTexture||ae.isCompressedArrayTexture?(re.setTexture2DArray(ae,0),_t=ee.TEXTURE_2D_ARRAY):(re.setTexture2D(ae,0),_t=ee.TEXTURE_2D),ee.pixelStorei(ee.UNPACK_FLIP_Y_WEBGL,ae.flipY),ee.pixelStorei(ee.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ae.premultiplyAlpha),ee.pixelStorei(ee.UNPACK_ALIGNMENT,ae.unpackAlignment);const Mi=ee.getParameter(ee.UNPACK_ROW_LENGTH),rn=ee.getParameter(ee.UNPACK_IMAGE_HEIGHT),Ni=ee.getParameter(ee.UNPACK_SKIP_PIXELS),Ii=ee.getParameter(ee.UNPACK_SKIP_ROWS),Wi=ee.getParameter(ee.UNPACK_SKIP_IMAGES);ee.pixelStorei(ee.UNPACK_ROW_LENGTH,vn.width),ee.pixelStorei(ee.UNPACK_IMAGE_HEIGHT,vn.height),ee.pixelStorei(ee.UNPACK_SKIP_PIXELS,ct),ee.pixelStorei(ee.UNPACK_SKIP_ROWS,He),ee.pixelStorei(ee.UNPACK_SKIP_IMAGES,Mt);const Ws=L.isDataArrayTexture||L.isData3DTexture,xn=ae.isDataArrayTexture||ae.isData3DTexture;if(L.isDepthTexture){const Ft=P.get(L),Sr=P.get(ae),Vn=P.get(Ft.__renderTarget),tr=P.get(Sr.__renderTarget);it.bindFramebuffer(ee.READ_FRAMEBUFFER,Vn.__webglFramebuffer),it.bindFramebuffer(ee.DRAW_FRAMEBUFFER,tr.__webglFramebuffer);for(let ps=0;ps<je;ps++)Ws&&(ee.framebufferTextureLayer(ee.READ_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,P.get(L).__webglTexture,ce,Mt+ps),ee.framebufferTextureLayer(ee.DRAW_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,P.get(ae).__webglTexture,We,Nt+ps)),ee.blitFramebuffer(ct,He,qe,Ge,lt,Zt,qe,Ge,ee.DEPTH_BUFFER_BIT,ee.NEAREST);it.bindFramebuffer(ee.READ_FRAMEBUFFER,null),it.bindFramebuffer(ee.DRAW_FRAMEBUFFER,null)}else if(ce!==0||L.isRenderTargetTexture||P.has(L)){const Ft=P.get(L),Sr=P.get(ae);it.bindFramebuffer(ee.READ_FRAMEBUFFER,Kn),it.bindFramebuffer(ee.DRAW_FRAMEBUFFER,gn);for(let Vn=0;Vn<je;Vn++)Ws?ee.framebufferTextureLayer(ee.READ_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,Ft.__webglTexture,ce,Mt+Vn):ee.framebufferTexture2D(ee.READ_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_2D,Ft.__webglTexture,ce),xn?ee.framebufferTextureLayer(ee.DRAW_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,Sr.__webglTexture,We,Nt+Vn):ee.framebufferTexture2D(ee.DRAW_FRAMEBUFFER,ee.COLOR_ATTACHMENT0,ee.TEXTURE_2D,Sr.__webglTexture,We),ce!==0?ee.blitFramebuffer(ct,He,qe,Ge,lt,Zt,qe,Ge,ee.COLOR_BUFFER_BIT,ee.NEAREST):xn?ee.copyTexSubImage3D(_t,We,lt,Zt,Nt+Vn,ct,He,qe,Ge):ee.copyTexSubImage2D(_t,We,lt,Zt,ct,He,qe,Ge);it.bindFramebuffer(ee.READ_FRAMEBUFFER,null),it.bindFramebuffer(ee.DRAW_FRAMEBUFFER,null)}else xn?L.isDataTexture||L.isData3DTexture?ee.texSubImage3D(_t,We,lt,Zt,Nt,qe,Ge,je,tn,In,vn.data):ae.isCompressedArrayTexture?ee.compressedTexSubImage3D(_t,We,lt,Zt,Nt,qe,Ge,je,tn,vn.data):ee.texSubImage3D(_t,We,lt,Zt,Nt,qe,Ge,je,tn,In,vn):L.isDataTexture?ee.texSubImage2D(ee.TEXTURE_2D,We,lt,Zt,qe,Ge,tn,In,vn.data):L.isCompressedTexture?ee.compressedTexSubImage2D(ee.TEXTURE_2D,We,lt,Zt,vn.width,vn.height,tn,vn.data):ee.texSubImage2D(ee.TEXTURE_2D,We,lt,Zt,qe,Ge,tn,In,vn);ee.pixelStorei(ee.UNPACK_ROW_LENGTH,Mi),ee.pixelStorei(ee.UNPACK_IMAGE_HEIGHT,rn),ee.pixelStorei(ee.UNPACK_SKIP_PIXELS,Ni),ee.pixelStorei(ee.UNPACK_SKIP_ROWS,Ii),ee.pixelStorei(ee.UNPACK_SKIP_IMAGES,Wi),We===0&&ae.generateMipmaps&&ee.generateMipmap(_t),it.unbindTexture()},this.initRenderTarget=function(L){P.get(L).__webglFramebuffer===void 0&&re.setupRenderTarget(L)},this.initTexture=function(L){L.isCubeTexture?re.setTextureCube(L,0):L.isData3DTexture?re.setTexture3D(L,0):L.isDataArrayTexture||L.isCompressedArrayTexture?re.setTexture2DArray(L,0):re.setTexture2D(L,0),it.unbindTexture()},this.resetState=function(){F=0,W=0,X=null,it.reset(),Le.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Qr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=fn._getDrawingBufferColorSpace(e),n.unpackColorSpace=fn._getUnpackColorSpace()}}const ej=`
|
|
4557
4557
|
precision highp float;
|
|
4558
4558
|
attribute vec3 position;
|
|
4559
4559
|
void main(){
|
|
@@ -4756,7 +4756,7 @@ void main(){
|
|
|
4756
4756
|
// straight (non-premultiplied) alpha output
|
|
4757
4757
|
gl_FragColor=vec4(col,alpha);
|
|
4758
4758
|
}
|
|
4759
|
-
`;function c1(t){let e=t.trim().replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const n=parseInt(e,16)||16777215;return{r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255}}function nj({className:t,style:e,wispDensity:n=1,dpr:i,mouseSmoothTime:r=.06,mouseTiltStrength:s=.01,horizontalBeamOffset:o=0,verticalBeamOffset:c=-.5,flowSpeed:u=.35,verticalSizing:f=2,horizontalSizing:h=.5,fogIntensity:p=.45,fogScale:m=.3,wispSpeed:v=15,wispIntensity:_=5,flowStrength:w=.25,decay:y=1.1,falloffStart:x=1.2,fogFallSpeed:M=.6,color:A="#8a7aff"}){const T=N.useRef(null),D=N.useRef(null),I=N.useRef(!1),U=N.useRef(null),S=N.useRef(!0),R=N.useRef(!1),H=N.useRef(r);return N.useEffect(()=>{H.current=r},[r]),N.useEffect(()=>{const F=T.current;let W;try{W=new QW({antialias:!1,alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch(At){console.warn("LaserFlow: WebGL not supported or context creation failed.",At);return}let V=Math.min(i??(window.devicePixelRatio||1),2);W.setPixelRatio(V),W.outputColorSpace=Mo,W.setClearColor(0,0);const q=W.domElement;q.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block;",F.appendChild(q);const J=new BH,Q=new t_(-1,1,1,-1,0,1),$=new hs;$.setAttribute("position",new zr(new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),3));const Y={iTime:{value:0},iResolution:{value:new me(1,1,1)},iMouse:{value:new zn(0,0,0,0)},uWispDensity:{value:n},uTiltScale:{value:s},uFlowTime:{value:0},uFogTime:{value:0},uBeamXFrac:{value:o},uBeamYFrac:{value:c},uFlowSpeed:{value:u},uVLenFactor:{value:f},uHLenFactor:{value:h},uFogIntensity:{value:p},uFogScale:{value:m},uWSpeed:{value:v},uWIntensity:{value:_},uFlowStrength:{value:w},uDecay:{value:y},uFalloffStart:{value:x},uFogFallSpeed:{value:M},uColor:{value:new me(1,1,1)},uFade:{value:I.current?1:0}};D.current=Y;const{r:Z,g:z,b:ie}=c1(A);Y.uColor.value.set(Z,z,ie);const ve=new hR({vertexShader:ej,fragmentShader:tj,uniforms:Y,transparent:!0,depthTest:!1,depthWrite:!1,blending:vo}),Ee=new us($,ve);Ee.frustumCulled=!1,J.add(Ee);let Ue=0,le=0,be=0;function Se(){const At=F.clientWidth||1,kt=F.clientHeight||1;Math.abs(At-Ue)<1&&Math.abs(kt-le)<1&&Math.abs(V-be)<.01||(Ue=At,le=kt,be=V,W.setPixelRatio(V),W.setSize(At,kt,!1),Y.iResolution.value.set(At*V,kt*V,V),U.current=q.getBoundingClientRect())}let Ne=0;const et=new ResizeObserver(()=>{cancelAnimationFrame(Ne),Ne=requestAnimationFrame(Se)});et.observe(F),Se();const xt=new IntersectionObserver(At=>{S.current=At[0]?.isIntersecting??!0},{threshold:0});xt.observe(F),document.addEventListener("visibilitychange",()=>{R.current=document.hidden},{passive:!0});const pn=new bn(0,0),ht=new bn(0,0);function Ut(At){const kt=U.current;kt&&pn.set((At.clientX-kt.left)*V,(kt.height-(At.clientY-kt.top))*V)}q.addEventListener("pointermove",Ut,{passive:!0}),q.addEventListener("pointerleave",()=>pn.set(0,0),{passive:!0});let nn=0,Lt=I.current?1:0;const an=new sG;let ee=0;function Sn(){if(ee=requestAnimationFrame(Sn),R.current||!S.current)return;const At=an.getElapsedTime(),kt=Math.min(Math.max(At-nn,.001),.033);nn=At,Y.iTime.value=At,Y.uFlowTime.value+=kt,Y.uFogTime.value+=kt,I.current||(Lt=Math.min(1,Lt+kt/1),Y.uFade.value=Lt,Lt>=1&&(I.current=!0));const it=Math.max(.001,H.current);ht.lerp(pn,1-Math.exp(-kt/it)),Y.iMouse.value.set(ht.x,ht.y,0,0),W.render(J,Q)}return Sn(),()=>{cancelAnimationFrame(ee),cancelAnimationFrame(Ne),et.disconnect(),xt.disconnect(),J.clear(),$.dispose(),ve.dispose(),W.dispose(),W.forceContextLoss(),F.contains(q)&&F.removeChild(q)}},[i]),N.useEffect(()=>{const F=D.current;if(!F)return;F.uWispDensity.value=n,F.uTiltScale.value=s,F.uBeamXFrac.value=o,F.uBeamYFrac.value=c,F.uFlowSpeed.value=u,F.uVLenFactor.value=f,F.uHLenFactor.value=h,F.uFogIntensity.value=p,F.uFogScale.value=m,F.uWSpeed.value=v,F.uWIntensity.value=_,F.uFlowStrength.value=w,F.uDecay.value=y,F.uFalloffStart.value=x,F.uFogFallSpeed.value=M;const{r:W,g:X,b:V}=c1(A);F.uColor.value.set(W,X,V)},[n,s,o,c,u,f,h,p,m,v,_,w,y,x,M,A]),B.jsx("div",{ref:T,className:t,style:{position:"relative",overflow:"hidden",...e}})}function ou(t){let e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function Av(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ij(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function u1(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function d1(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function rj(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function sj(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function Ig(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function aj(t,e){let n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)}function oj(t,e){let n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}function f1(t){let e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i}function lj(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function cj(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Cv(t,e){let n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function bR(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function h1(t,e,n){let i=e[0],r=e[1],s=e[2],o=n[0],c=n[1],u=n[2];return t[0]=r*u-s*c,t[1]=s*o-i*u,t[2]=i*c-r*o,t}function uj(t,e,n,i){let r=e[0],s=e[1],o=e[2];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=o+i*(n[2]-o),t}function dj(t,e,n,i,r){const s=Math.exp(-i*r);let o=e[0],c=e[1],u=e[2];return t[0]=n[0]+(o-n[0])*s,t[1]=n[1]+(c-n[1])*s,t[2]=n[2]+(u-n[2])*s,t}function fj(t,e,n){let i=e[0],r=e[1],s=e[2],o=n[3]*i+n[7]*r+n[11]*s+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*s+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*s+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*s+n[14])/o,t}function hj(t,e,n){let i=e[0],r=e[1],s=e[2],o=n[3]*i+n[7]*r+n[11]*s+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*s)/o,t[1]=(n[1]*i+n[5]*r+n[9]*s)/o,t[2]=(n[2]*i+n[6]*r+n[10]*s)/o,t}function pj(t,e,n){let i=e[0],r=e[1],s=e[2];return t[0]=i*n[0]+r*n[3]+s*n[6],t[1]=i*n[1]+r*n[4]+s*n[7],t[2]=i*n[2]+r*n[5]+s*n[8],t}function mj(t,e,n){let i=e[0],r=e[1],s=e[2],o=n[0],c=n[1],u=n[2],f=n[3],h=c*s-u*r,p=u*i-o*s,m=o*r-c*i,v=c*m-u*p,_=u*h-o*m,w=o*p-c*h,y=f*2;return h*=y,p*=y,m*=y,v*=2,_*=2,w*=2,t[0]=i+h+v,t[1]=r+p+_,t[2]=s+m+w,t}const gj=(function(){const t=[0,0,0],e=[0,0,0];return function(n,i){Av(t,n),Av(e,i),Cv(t,t),Cv(e,e);let r=bR(t,e);return r>1?0:r<-1?Math.PI:Math.acos(r)}})();function vj(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}class Fr extends Array{constructor(e=0,n=e,i=e){return super(e,n,i),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(e){this[0]=e}set y(e){this[1]=e}set z(e){this[2]=e}set(e,n=e,i=e){return e.length?this.copy(e):(ij(this,e,n,i),this)}copy(e){return Av(this,e),this}add(e,n){return n?u1(this,e,n):u1(this,this,e),this}sub(e,n){return n?d1(this,e,n):d1(this,this,e),this}multiply(e){return e.length?rj(this,this,e):Ig(this,this,e),this}divide(e){return e.length?sj(this,this,e):Ig(this,this,1/e),this}inverse(e=this){return cj(this,e),this}len(){return ou(this)}distance(e){return e?aj(this,e):ou(this)}squaredLen(){return f1(this)}squaredDistance(e){return e?oj(this,e):f1(this)}negate(e=this){return lj(this,e),this}cross(e,n){return n?h1(this,e,n):h1(this,this,e),this}scale(e){return Ig(this,this,e),this}normalize(){return Cv(this,this),this}dot(e){return bR(this,e)}equals(e){return vj(this,e)}applyMatrix3(e){return pj(this,this,e),this}applyMatrix4(e){return fj(this,this,e),this}scaleRotateMatrix4(e){return hj(this,this,e),this}applyQuaternion(e){return mj(this,this,e),this}angle(e){return gj(this,e)}lerp(e,n){return uj(this,this,e,n),this}smoothLerp(e,n,i){return dj(this,this,e,n,i),this}clone(){return new Fr(this[0],this[1],this[2])}fromArray(e,n=0){return this[0]=e[n],this[1]=e[n+1],this[2]=e[n+2],this}toArray(e=[],n=0){return e[n]=this[0],e[n+1]=this[1],e[n+2]=this[2],e}transformDirection(e){const n=this[0],i=this[1],r=this[2];return this[0]=e[0]*n+e[4]*i+e[8]*r,this[1]=e[1]*n+e[5]*i+e[9]*r,this[2]=e[2]*n+e[6]*i+e[10]*r,this.normalize()}}const p1=new Fr;let yj=1,_j=1,m1=!1;class xj{constructor(e,n={}){e.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=e,this.attributes=n,this.id=yj++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let i in n)this.addAttribute(i,n[i])}addAttribute(e,n){if(this.attributes[e]=n,n.id=_j++,n.size=n.size||1,n.type=n.type||(n.data.constructor===Float32Array?this.gl.FLOAT:n.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),n.target=e==="index"?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,n.normalized=n.normalized||!1,n.stride=n.stride||0,n.offset=n.offset||0,n.count=n.count||(n.stride?n.data.byteLength/n.stride:n.data.length/n.size),n.divisor=n.instanced||0,n.needsUpdate=!1,n.usage=n.usage||this.gl.STATIC_DRAW,n.buffer||this.updateAttribute(n),n.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==n.count*n.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,n.count*n.divisor);this.instancedCount=n.count*n.divisor}else e==="index"?this.drawRange.count=n.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,n.count))}updateAttribute(e){const n=!e.buffer;n&&(e.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==e.buffer&&(this.gl.bindBuffer(e.target,e.buffer),this.glState.boundBuffer=e.buffer),n?this.gl.bufferData(e.target,e.data,e.usage):this.gl.bufferSubData(e.target,0,e.data),e.needsUpdate=!1}setIndex(e){this.addAttribute("index",e)}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}setInstancedCount(e){this.instancedCount=e}createVAO(e){this.VAOs[e.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[e.attributeOrder]),this.bindAttributes(e)}bindAttributes(e){e.attributeLocations.forEach((n,{name:i,type:r})=>{if(!this.attributes[i]){console.warn(`active attribute ${i} not being supplied`);return}const s=this.attributes[i];this.gl.bindBuffer(s.target,s.buffer),this.glState.boundBuffer=s.buffer;let o=1;r===35674&&(o=2),r===35675&&(o=3),r===35676&&(o=4);const c=s.size/o,u=o===1?0:o*o*4,f=o===1?0:o*4;for(let h=0;h<o;h++)this.gl.vertexAttribPointer(n+h,c,s.type,s.normalized,s.stride+u,s.offset+h*f),this.gl.enableVertexAttribArray(n+h),this.gl.renderer.vertexAttribDivisor(n+h,s.divisor)}),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:e,mode:n=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${e.attributeOrder}`&&(this.VAOs[e.attributeOrder]||this.createVAO(e),this.gl.renderer.bindVertexArray(this.VAOs[e.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${e.attributeOrder}`),e.attributeLocations.forEach((r,{name:s})=>{const o=this.attributes[s];o.needsUpdate&&this.updateAttribute(o)});let i=2;this.attributes.index?.type===this.gl.UNSIGNED_INT&&(i=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(n,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*i,this.instancedCount):this.gl.renderer.drawArraysInstanced(n,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(n,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*i):this.gl.drawArrays(n,this.drawRange.start,this.drawRange.count)}getPosition(){const e=this.attributes.position;if(e.data)return e;if(!m1)return console.warn("No position buffer data found to compute bounds"),m1=!0}computeBoundingBox(e){e||(e=this.getPosition());const n=e.data,i=e.size;this.bounds||(this.bounds={min:new Fr,max:new Fr,center:new Fr,scale:new Fr,radius:1/0});const r=this.bounds.min,s=this.bounds.max,o=this.bounds.center,c=this.bounds.scale;r.set(1/0),s.set(-1/0);for(let u=0,f=n.length;u<f;u+=i){const h=n[u],p=n[u+1],m=n[u+2];r.x=Math.min(h,r.x),r.y=Math.min(p,r.y),r.z=Math.min(m,r.z),s.x=Math.max(h,s.x),s.y=Math.max(p,s.y),s.z=Math.max(m,s.z)}c.sub(s,r),o.add(r,s).divide(2)}computeBoundingSphere(e){e||(e=this.getPosition());const n=e.data,i=e.size;this.bounds||this.computeBoundingBox(e);let r=0;for(let s=0,o=n.length;s<o;s+=i)p1.fromArray(n,s),r=Math.max(r,this.bounds.center.squaredDistance(p1));this.bounds.radius=Math.sqrt(r)}remove(){for(let e in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[e]),delete this.VAOs[e];for(let e in this.attributes)this.gl.deleteBuffer(this.attributes[e].buffer),delete this.attributes[e]}}let bj=1;const g1={};class Sj{constructor(e,{vertex:n,fragment:i,uniforms:r={},transparent:s=!1,cullFace:o=e.BACK,frontFace:c=e.CCW,depthTest:u=!0,depthWrite:f=!0,depthFunc:h=e.LEQUAL}={}){e.canvas||console.error("gl not passed as first argument to Program"),this.gl=e,this.uniforms=r,this.id=bj++,n||console.warn("vertex shader not supplied"),i||console.warn("fragment shader not supplied"),this.transparent=s,this.cullFace=o,this.frontFace=c,this.depthTest=u,this.depthWrite=f,this.depthFunc=h,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=e.createShader(e.VERTEX_SHADER),this.fragmentShader=e.createShader(e.FRAGMENT_SHADER),this.program=e.createProgram(),e.attachShader(this.program,this.vertexShader),e.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:n,fragment:i})}setShaders({vertex:e,fragment:n}){if(e&&(this.gl.shaderSource(this.vertexShader,e),this.gl.compileShader(this.vertexShader),this.gl.getShaderInfoLog(this.vertexShader)!==""&&console.warn(`${this.gl.getShaderInfoLog(this.vertexShader)}
|
|
4759
|
+
`;function c1(t){let e=t.trim().replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const n=parseInt(e,16)||16777215;return{r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255}}function nj({className:t,style:e,wispDensity:n=1,dpr:i,mouseSmoothTime:r=.06,mouseTiltStrength:s=.01,horizontalBeamOffset:o=0,verticalBeamOffset:c=-.5,flowSpeed:u=.35,verticalSizing:f=2,horizontalSizing:h=.5,fogIntensity:p=.45,fogScale:m=.3,wispSpeed:v=15,wispIntensity:_=5,flowStrength:w=.25,decay:y=1.1,falloffStart:x=1.2,fogFallSpeed:M=.6,color:A="#8a7aff"}){const T=N.useRef(null),D=N.useRef(null),I=N.useRef(!1),U=N.useRef(null),S=N.useRef(!0),R=N.useRef(!1),H=N.useRef(r);return N.useEffect(()=>{H.current=r},[r]),N.useEffect(()=>{const F=T.current;let W;try{W=new QW({antialias:!1,alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch(At){console.warn("LaserFlow: WebGL not supported or context creation failed.",At);return}let V=Math.min(i??(window.devicePixelRatio||1),2);W.setPixelRatio(V),W.outputColorSpace=Mo,W.setClearColor(0,0);const q=W.domElement;q.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block;",F.appendChild(q);const J=new BH,Q=new t_(-1,1,1,-1,0,1),$=new hs;$.setAttribute("position",new zr(new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),3));const Y={iTime:{value:0},iResolution:{value:new me(1,1,1)},iMouse:{value:new zn(0,0,0,0)},uWispDensity:{value:n},uTiltScale:{value:s},uFlowTime:{value:0},uFogTime:{value:0},uBeamXFrac:{value:o},uBeamYFrac:{value:c},uFlowSpeed:{value:u},uVLenFactor:{value:f},uHLenFactor:{value:h},uFogIntensity:{value:p},uFogScale:{value:m},uWSpeed:{value:v},uWIntensity:{value:_},uFlowStrength:{value:w},uDecay:{value:y},uFalloffStart:{value:x},uFogFallSpeed:{value:M},uColor:{value:new me(1,1,1)},uFade:{value:I.current?1:0}};D.current=Y;const{r:Z,g:z,b:ie}=c1(A);Y.uColor.value.set(Z,z,ie);const _e=new hR({vertexShader:ej,fragmentShader:tj,uniforms:Y,transparent:!0,depthTest:!1,depthWrite:!1,blending:vo}),Ee=new us($,_e);Ee.frustumCulled=!1,J.add(Ee);let Ue=0,le=0,be=0;function Se(){const At=F.clientWidth||1,kt=F.clientHeight||1;Math.abs(At-Ue)<1&&Math.abs(kt-le)<1&&Math.abs(V-be)<.01||(Ue=At,le=kt,be=V,W.setPixelRatio(V),W.setSize(At,kt,!1),Y.iResolution.value.set(At*V,kt*V,V),U.current=q.getBoundingClientRect())}let Ne=0;const et=new ResizeObserver(()=>{cancelAnimationFrame(Ne),Ne=requestAnimationFrame(Se)});et.observe(F),Se();const xt=new IntersectionObserver(At=>{S.current=At[0]?.isIntersecting??!0},{threshold:0});xt.observe(F),document.addEventListener("visibilitychange",()=>{R.current=document.hidden},{passive:!0});const pn=new bn(0,0),ht=new bn(0,0);function Ut(At){const kt=U.current;kt&&pn.set((At.clientX-kt.left)*V,(kt.height-(At.clientY-kt.top))*V)}q.addEventListener("pointermove",Ut,{passive:!0}),q.addEventListener("pointerleave",()=>pn.set(0,0),{passive:!0});let nn=0,Lt=I.current?1:0;const an=new sG;let ee=0;function Sn(){if(ee=requestAnimationFrame(Sn),R.current||!S.current)return;const At=an.getElapsedTime(),kt=Math.min(Math.max(At-nn,.001),.033);nn=At,Y.iTime.value=At,Y.uFlowTime.value+=kt,Y.uFogTime.value+=kt,I.current||(Lt=Math.min(1,Lt+kt/1),Y.uFade.value=Lt,Lt>=1&&(I.current=!0));const it=Math.max(.001,H.current);ht.lerp(pn,1-Math.exp(-kt/it)),Y.iMouse.value.set(ht.x,ht.y,0,0),W.render(J,Q)}return Sn(),()=>{cancelAnimationFrame(ee),cancelAnimationFrame(Ne),et.disconnect(),xt.disconnect(),J.clear(),$.dispose(),_e.dispose(),W.dispose(),W.forceContextLoss(),F.contains(q)&&F.removeChild(q)}},[i]),N.useEffect(()=>{const F=D.current;if(!F)return;F.uWispDensity.value=n,F.uTiltScale.value=s,F.uBeamXFrac.value=o,F.uBeamYFrac.value=c,F.uFlowSpeed.value=u,F.uVLenFactor.value=f,F.uHLenFactor.value=h,F.uFogIntensity.value=p,F.uFogScale.value=m,F.uWSpeed.value=v,F.uWIntensity.value=_,F.uFlowStrength.value=w,F.uDecay.value=y,F.uFalloffStart.value=x,F.uFogFallSpeed.value=M;const{r:W,g:X,b:V}=c1(A);F.uColor.value.set(W,X,V)},[n,s,o,c,u,f,h,p,m,v,_,w,y,x,M,A]),B.jsx("div",{ref:T,className:t,style:{position:"relative",overflow:"hidden",...e}})}function ou(t){let e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function Av(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ij(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function u1(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function d1(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function rj(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function sj(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function Ig(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function aj(t,e){let n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)}function oj(t,e){let n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}function f1(t){let e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i}function lj(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function cj(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Cv(t,e){let n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function bR(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function h1(t,e,n){let i=e[0],r=e[1],s=e[2],o=n[0],c=n[1],u=n[2];return t[0]=r*u-s*c,t[1]=s*o-i*u,t[2]=i*c-r*o,t}function uj(t,e,n,i){let r=e[0],s=e[1],o=e[2];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=o+i*(n[2]-o),t}function dj(t,e,n,i,r){const s=Math.exp(-i*r);let o=e[0],c=e[1],u=e[2];return t[0]=n[0]+(o-n[0])*s,t[1]=n[1]+(c-n[1])*s,t[2]=n[2]+(u-n[2])*s,t}function fj(t,e,n){let i=e[0],r=e[1],s=e[2],o=n[3]*i+n[7]*r+n[11]*s+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*s+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*s+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*s+n[14])/o,t}function hj(t,e,n){let i=e[0],r=e[1],s=e[2],o=n[3]*i+n[7]*r+n[11]*s+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*s)/o,t[1]=(n[1]*i+n[5]*r+n[9]*s)/o,t[2]=(n[2]*i+n[6]*r+n[10]*s)/o,t}function pj(t,e,n){let i=e[0],r=e[1],s=e[2];return t[0]=i*n[0]+r*n[3]+s*n[6],t[1]=i*n[1]+r*n[4]+s*n[7],t[2]=i*n[2]+r*n[5]+s*n[8],t}function mj(t,e,n){let i=e[0],r=e[1],s=e[2],o=n[0],c=n[1],u=n[2],f=n[3],h=c*s-u*r,p=u*i-o*s,m=o*r-c*i,v=c*m-u*p,_=u*h-o*m,w=o*p-c*h,y=f*2;return h*=y,p*=y,m*=y,v*=2,_*=2,w*=2,t[0]=i+h+v,t[1]=r+p+_,t[2]=s+m+w,t}const gj=(function(){const t=[0,0,0],e=[0,0,0];return function(n,i){Av(t,n),Av(e,i),Cv(t,t),Cv(e,e);let r=bR(t,e);return r>1?0:r<-1?Math.PI:Math.acos(r)}})();function vj(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}class Fr extends Array{constructor(e=0,n=e,i=e){return super(e,n,i),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(e){this[0]=e}set y(e){this[1]=e}set z(e){this[2]=e}set(e,n=e,i=e){return e.length?this.copy(e):(ij(this,e,n,i),this)}copy(e){return Av(this,e),this}add(e,n){return n?u1(this,e,n):u1(this,this,e),this}sub(e,n){return n?d1(this,e,n):d1(this,this,e),this}multiply(e){return e.length?rj(this,this,e):Ig(this,this,e),this}divide(e){return e.length?sj(this,this,e):Ig(this,this,1/e),this}inverse(e=this){return cj(this,e),this}len(){return ou(this)}distance(e){return e?aj(this,e):ou(this)}squaredLen(){return f1(this)}squaredDistance(e){return e?oj(this,e):f1(this)}negate(e=this){return lj(this,e),this}cross(e,n){return n?h1(this,e,n):h1(this,this,e),this}scale(e){return Ig(this,this,e),this}normalize(){return Cv(this,this),this}dot(e){return bR(this,e)}equals(e){return vj(this,e)}applyMatrix3(e){return pj(this,this,e),this}applyMatrix4(e){return fj(this,this,e),this}scaleRotateMatrix4(e){return hj(this,this,e),this}applyQuaternion(e){return mj(this,this,e),this}angle(e){return gj(this,e)}lerp(e,n){return uj(this,this,e,n),this}smoothLerp(e,n,i){return dj(this,this,e,n,i),this}clone(){return new Fr(this[0],this[1],this[2])}fromArray(e,n=0){return this[0]=e[n],this[1]=e[n+1],this[2]=e[n+2],this}toArray(e=[],n=0){return e[n]=this[0],e[n+1]=this[1],e[n+2]=this[2],e}transformDirection(e){const n=this[0],i=this[1],r=this[2];return this[0]=e[0]*n+e[4]*i+e[8]*r,this[1]=e[1]*n+e[5]*i+e[9]*r,this[2]=e[2]*n+e[6]*i+e[10]*r,this.normalize()}}const p1=new Fr;let yj=1,_j=1,m1=!1;class xj{constructor(e,n={}){e.canvas||console.error("gl not passed as first argument to Geometry"),this.gl=e,this.attributes=n,this.id=yj++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let i in n)this.addAttribute(i,n[i])}addAttribute(e,n){if(this.attributes[e]=n,n.id=_j++,n.size=n.size||1,n.type=n.type||(n.data.constructor===Float32Array?this.gl.FLOAT:n.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),n.target=e==="index"?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,n.normalized=n.normalized||!1,n.stride=n.stride||0,n.offset=n.offset||0,n.count=n.count||(n.stride?n.data.byteLength/n.stride:n.data.length/n.size),n.divisor=n.instanced||0,n.needsUpdate=!1,n.usage=n.usage||this.gl.STATIC_DRAW,n.buffer||this.updateAttribute(n),n.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==n.count*n.divisor)return console.warn("geometry has multiple instanced buffers of different length"),this.instancedCount=Math.min(this.instancedCount,n.count*n.divisor);this.instancedCount=n.count*n.divisor}else e==="index"?this.drawRange.count=n.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,n.count))}updateAttribute(e){const n=!e.buffer;n&&(e.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==e.buffer&&(this.gl.bindBuffer(e.target,e.buffer),this.glState.boundBuffer=e.buffer),n?this.gl.bufferData(e.target,e.data,e.usage):this.gl.bufferSubData(e.target,0,e.data),e.needsUpdate=!1}setIndex(e){this.addAttribute("index",e)}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}setInstancedCount(e){this.instancedCount=e}createVAO(e){this.VAOs[e.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[e.attributeOrder]),this.bindAttributes(e)}bindAttributes(e){e.attributeLocations.forEach((n,{name:i,type:r})=>{if(!this.attributes[i]){console.warn(`active attribute ${i} not being supplied`);return}const s=this.attributes[i];this.gl.bindBuffer(s.target,s.buffer),this.glState.boundBuffer=s.buffer;let o=1;r===35674&&(o=2),r===35675&&(o=3),r===35676&&(o=4);const c=s.size/o,u=o===1?0:o*o*4,f=o===1?0:o*4;for(let h=0;h<o;h++)this.gl.vertexAttribPointer(n+h,c,s.type,s.normalized,s.stride+u,s.offset+h*f),this.gl.enableVertexAttribArray(n+h),this.gl.renderer.vertexAttribDivisor(n+h,s.divisor)}),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:e,mode:n=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${e.attributeOrder}`&&(this.VAOs[e.attributeOrder]||this.createVAO(e),this.gl.renderer.bindVertexArray(this.VAOs[e.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${e.attributeOrder}`),e.attributeLocations.forEach((r,{name:s})=>{const o=this.attributes[s];o.needsUpdate&&this.updateAttribute(o)});let i=2;this.attributes.index?.type===this.gl.UNSIGNED_INT&&(i=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(n,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*i,this.instancedCount):this.gl.renderer.drawArraysInstanced(n,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(n,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*i):this.gl.drawArrays(n,this.drawRange.start,this.drawRange.count)}getPosition(){const e=this.attributes.position;if(e.data)return e;if(!m1)return console.warn("No position buffer data found to compute bounds"),m1=!0}computeBoundingBox(e){e||(e=this.getPosition());const n=e.data,i=e.size;this.bounds||(this.bounds={min:new Fr,max:new Fr,center:new Fr,scale:new Fr,radius:1/0});const r=this.bounds.min,s=this.bounds.max,o=this.bounds.center,c=this.bounds.scale;r.set(1/0),s.set(-1/0);for(let u=0,f=n.length;u<f;u+=i){const h=n[u],p=n[u+1],m=n[u+2];r.x=Math.min(h,r.x),r.y=Math.min(p,r.y),r.z=Math.min(m,r.z),s.x=Math.max(h,s.x),s.y=Math.max(p,s.y),s.z=Math.max(m,s.z)}c.sub(s,r),o.add(r,s).divide(2)}computeBoundingSphere(e){e||(e=this.getPosition());const n=e.data,i=e.size;this.bounds||this.computeBoundingBox(e);let r=0;for(let s=0,o=n.length;s<o;s+=i)p1.fromArray(n,s),r=Math.max(r,this.bounds.center.squaredDistance(p1));this.bounds.radius=Math.sqrt(r)}remove(){for(let e in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[e]),delete this.VAOs[e];for(let e in this.attributes)this.gl.deleteBuffer(this.attributes[e].buffer),delete this.attributes[e]}}let bj=1;const g1={};class Sj{constructor(e,{vertex:n,fragment:i,uniforms:r={},transparent:s=!1,cullFace:o=e.BACK,frontFace:c=e.CCW,depthTest:u=!0,depthWrite:f=!0,depthFunc:h=e.LEQUAL}={}){e.canvas||console.error("gl not passed as first argument to Program"),this.gl=e,this.uniforms=r,this.id=bj++,n||console.warn("vertex shader not supplied"),i||console.warn("fragment shader not supplied"),this.transparent=s,this.cullFace=o,this.frontFace=c,this.depthTest=u,this.depthWrite=f,this.depthFunc=h,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=e.createShader(e.VERTEX_SHADER),this.fragmentShader=e.createShader(e.FRAGMENT_SHADER),this.program=e.createProgram(),e.attachShader(this.program,this.vertexShader),e.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:n,fragment:i})}setShaders({vertex:e,fragment:n}){if(e&&(this.gl.shaderSource(this.vertexShader,e),this.gl.compileShader(this.vertexShader),this.gl.getShaderInfoLog(this.vertexShader)!==""&&console.warn(`${this.gl.getShaderInfoLog(this.vertexShader)}
|
|
4760
4760
|
Vertex Shader
|
|
4761
4761
|
${v1(e)}`)),n&&(this.gl.shaderSource(this.fragmentShader,n),this.gl.compileShader(this.fragmentShader),this.gl.getShaderInfoLog(this.fragmentShader)!==""&&console.warn(`${this.gl.getShaderInfoLog(this.fragmentShader)}
|
|
4762
4762
|
Fragment Shader
|
|
@@ -4860,4 +4860,4 @@ void main() {
|
|
|
4860
4860
|
vec4 color;
|
|
4861
4861
|
mainImage(color, gl_FragCoord.xy);
|
|
4862
4862
|
gl_FragColor = color;
|
|
4863
|
-
}`;function R7({raysOrigin:t="top-center",raysColor:e="#ffffff",raysSpeed:n=1,lightSpread:i=1,rayLength:r=2,pulsating:s=!1,fadeDistance:o=1,saturation:c=1,followMouse:u=!0,mouseInfluence:f=.1,noiseAmount:h=0,distortion:p=0,className:m=""}){const v=N.useRef(null),_=N.useRef(null),w=N.useRef(null),y=N.useRef({x:.5,y:.5}),x=N.useRef({x:.5,y:.5}),M=N.useRef(null),A=N.useRef(null),T=N.useRef(null),[D,I]=N.useState(!1),U=N.useRef(null);return N.useEffect(()=>{if(v.current)return U.current=new IntersectionObserver(S=>{I(S[0].isIntersecting)},{threshold:.1}),U.current.observe(v.current),()=>{U.current&&(U.current.disconnect(),U.current=null)}},[]),N.useEffect(()=>!D||!v.current?void 0:(T.current&&(T.current(),T.current=null),(async()=>{if(!v.current||(await new Promise(Q=>setTimeout(Q,10)),!v.current))return;const R=new Aj({dpr:Math.min(window.devicePixelRatio,2),alpha:!0});w.current=R;const H=R.gl;for(H.canvas.style.width="100%",H.canvas.style.height="100%";v.current.firstChild;)v.current.removeChild(v.current.firstChild);v.current.appendChild(H.canvas);const F={iTime:{value:0},iResolution:{value:[1,1]},rayPos:{value:[0,0]},rayDir:{value:[0,1]},raysColor:{value:M1(e)},raysSpeed:{value:n},lightSpread:{value:i},rayLength:{value:r},pulsating:{value:s?1:0},fadeDistance:{value:o},saturation:{value:c},mousePos:{value:[.5,.5]},mouseInfluence:{value:f},noiseAmount:{value:h},distortion:{value:p}};_.current=F;const W=new T7(H),X=new Sj(H,{vertex:A7,fragment:C7,uniforms:F}),V=new M7(H,{geometry:W,program:X});A.current=V;const q=()=>{if(!v.current||!R)return;R.dpr=Math.min(window.devicePixelRatio,2);const{clientWidth:Q,clientHeight:$}=v.current;R.setSize(Q,$);const Y=R.dpr,Z=Q*Y,z=$*Y;F.iResolution.value=[Z,z];const{anchor:ie,dir:ve}=T1(t,Z,z);F.rayPos.value=ie,F.rayDir.value=ve},J=Q=>{if(!(!w.current||!_.current||!A.current)){F.iTime.value=Q*.001,u&&f>0&&(x.current.x=x.current.x*.92+y.current.x*(1-.92),x.current.y=x.current.y*.92+y.current.y*(1-.92),F.mousePos.value=[x.current.x,x.current.y]);try{R.render({scene:V}),M.current=requestAnimationFrame(J)}catch($){console.warn("WebGL rendering error:",$)}}};window.addEventListener("resize",q),q(),M.current=requestAnimationFrame(J),T.current=()=>{if(M.current&&(cancelAnimationFrame(M.current),M.current=null),window.removeEventListener("resize",q),R)try{const Q=R.gl.getExtension("WEBGL_lose_context");Q&&Q.loseContext();const $=R.gl.canvas;$&&$.parentNode&&$.parentNode.removeChild($)}catch(Q){console.warn("Error during WebGL cleanup:",Q)}w.current=null,_.current=null,A.current=null}})(),()=>{T.current&&(T.current(),T.current=null)}),[D,t,e,n,i,r,s,o,c,u,f,h,p]),N.useEffect(()=>{if(!_.current||!v.current||!w.current)return;const S=_.current,R=w.current;S.raysColor.value=M1(e),S.raysSpeed.value=n,S.lightSpread.value=i,S.rayLength.value=r,S.pulsating.value=s?1:0,S.fadeDistance.value=o,S.saturation.value=c,S.mouseInfluence.value=f,S.noiseAmount.value=h,S.distortion.value=p;const{clientWidth:H,clientHeight:F}=v.current,W=R.dpr,{anchor:X,dir:V}=T1(t,H*W,F*W);S.rayPos.value=X,S.rayDir.value=V},[e,n,i,t,r,s,o,c,f,h,p]),N.useEffect(()=>{if(!u)return;const S=R=>{if(!v.current)return;const H=v.current.getBoundingClientRect();y.current={x:(R.clientX-H.left)/H.width,y:(R.clientY-H.top)/H.height}};return window.addEventListener("mousemove",S),()=>window.removeEventListener("mousemove",S)},[u]),B.jsx("div",{ref:v,className:`w-full h-full pointer-events-none z-[3] overflow-hidden relative ${m}`.trim()})}function P7({className:t}){return B.jsx("svg",{viewBox:"0 0 384 512",className:t,fill:"currentColor",children:B.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function k7({className:t}){return B.jsx("svg",{viewBox:"0 0 16 16",className:t,fill:"currentColor",children:B.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function L7({className:t}){return B.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[B.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),B.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function D7({className:t}){return B.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:B.jsx("polyline",{points:"20 6 9 17 4 12"})})}const A1="https://github.com/mm7894215/tokentracker",N7="https://github.com/mm7894215/tokentracker/releases/latest";function I7(t="default",e="md",n){const i="inline-flex items-center justify-center rounded font-medium transition-colors duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",r={default:"bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200",ghost:"text-oai-gray-600 hover:text-oai-gray-900 hover:bg-oai-gray-100 active:bg-oai-gray-200 dark:text-oai-gray-400 dark:hover:text-white dark:hover:bg-oai-gray-800 dark:active:bg-oai-gray-700"},s={sm:"h-9 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-12 px-8 text-base"};return Si(i,r[t],s[e],n)}function U7({copy:t,signInUrl:e,signUpUrl:n,installCommand:i,installCopied:r,onCopyInstallCommand:s}){const o=Bz(),[c,u]=N.useState(!1);N.useEffect(()=>{const w=()=>u(window.scrollY>10);return window.addEventListener("scroll",w,{passive:!0}),()=>window.removeEventListener("scroll",w)},[]);const f=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:h,loading:p}=$l(),m=N.useMemo(()=>({codex:t("landing.v2.models.agent.codex"),claude_code:t("landing.v2.models.agent.claude_code"),cursor:t("landing.v2.models.agent.cursor"),gemini:t("landing.v2.models.agent.gemini"),opencode:t("landing.v2.models.agent.opencode"),openclaw:t("landing.v2.models.agent.openclaw")}),[t]),v=N.useMemo(()=>[{id:"codex",icon:"/brand-logos/codex.svg"},{id:"claude_code",icon:"/brand-logos/claude-code.svg"},{id:"cursor",icon:"/brand-logos/cursor.svg"},{id:"gemini",icon:"/brand-logos/gemini.svg"},{id:"opencode",icon:"/brand-logos/opencode.svg"},{id:"openclaw",icon:"/brand-logos/openclaw.svg"}],[]),_=o?{duration:0}:void 0;return B.jsxs("div",{className:"relative min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark",children:[B.jsx("div",{className:"absolute inset-0 z-0 pointer-events-none",style:{height:"100vh"},children:B.jsx(R7,{raysOrigin:"top-center",raysColor:"#b8b3ff",raysSpeed:1,lightSpread:.5,rayLength:3,pulsating:!1,fadeDistance:1,saturation:1,followMouse:!0,mouseInfluence:.1,noiseAmount:0,distortion:0})}),B.jsx("header",{className:Si("sticky top-0 z-50 transition-all duration-300",c?"bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900":"bg-transparent border-b border-transparent"),children:B.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[B.jsxs("div",{className:"flex items-center gap-5",children:[B.jsxs(ho,{to:n||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[B.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),B.jsx("span",{className:"text-sm font-semibold tracking-wide text-white uppercase",children:"Token Tracker"})]}),B.jsx("div",{className:"hidden sm:block",children:B.jsx(IV,{})})]}),f&&B.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:gap-3",children:[B.jsxs(ho,{to:DV(),className:Si(I7(h||p?"default":"ghost","sm"),"no-underline px-5 rounded-full group",h||p?"shadow-sm ring-1 ring-white/10":"ring-1 ring-oai-gray-700"),children:[t("landing.v2.cta.primary"),B.jsx("span",{className:"ml-2 inline-block transition-transform duration-200 group-hover:translate-x-0.5",children:"→"})]}),B.jsx(VV,{})]})]})}),B.jsxs("main",{children:[B.jsx("section",{className:"relative py-16 sm:py-24 lg:py-32 overflow-hidden",children:B.jsxs("div",{className:"relative z-10 mx-auto max-w-7xl px-4 sm:px-6 flex flex-col items-center text-center gap-20 lg:gap-36",children:[B.jsxs(go.div,{initial:o?!1:{opacity:0,y:20},animate:{opacity:1,y:0},transition:_||{duration:.5},className:"w-full max-w-3xl relative z-20",children:[B.jsxs("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-white sm:text-6xl lg:text-[4rem] lg:leading-[1.05]",children:[t("landing.v2.hero.title_line1"),B.jsx("br",{}),B.jsx("span",{className:"bg-gradient-to-b from-white via-oai-gray-200 to-oai-gray-500 bg-clip-text text-transparent font-bold tracking-tight",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.15)"},children:t("landing.v2.hero.title_line2")})]}),B.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.hero.subtagline")}),B.jsxs("div",{className:"mt-8 w-full max-w-lg mx-auto",children:[B.jsxs(go.div,{whileHover:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative inline-block w-full overflow-hidden rounded-2xl",style:{padding:"1.5px 0"},children:[B.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),B.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),B.jsxs("div",{className:"relative z-[1] flex items-center justify-between w-full bg-[#0a0a0a] border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50",children:[B.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[B.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),B.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:i?i.split(" ").map((w,y)=>B.jsxs("span",{className:w==="npx"||w==="tokentracker-cli"?"text-white font-medium":w==="--yes"?"text-oai-gray-500":"text-oai-brand-400",children:[w," "]},y)):null})]}),B.jsx("button",{type:"button",onClick:s,"aria-label":t(r?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:r?B.jsx(D7,{className:"h-4 w-4 text-green-400","aria-hidden":!0}):B.jsx(L7,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]})]}),B.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4",children:[B.jsxs("a",{href:N7,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[B.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:B.jsx(P7,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.v2.install.mac_cta")]}),B.jsxs("a",{href:A1,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[B.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:B.jsx(k7,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.cta.secondary")]})]}),B.jsx("span",{className:"sr-only","aria-live":"polite",children:r?t("landing.install.action.copied"):""})]})]}),B.jsx("div",{className:"relative group w-full",children:B.jsxs(go.div,{initial:o?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:_||{duration:.6,delay:.1},className:"relative w-full",children:[B.jsx("div",{style:{position:"absolute",top:"-256px",left:0,right:0,height:"510px",zIndex:3,pointerEvents:"none"},children:B.jsx(nj,{color:"#8a7aff",wispDensity:2,flowSpeed:.28,verticalSizing:2.2,horizontalSizing:1.22,fogIntensity:4,fogScale:.1,wispSpeed:18,wispIntensity:10,flowStrength:.12,decay:1.1,falloffStart:1.1,fogFallSpeed:.5,horizontalBeamOffset:.22,verticalBeamOffset:0,style:{width:"100%",height:"100%"}})}),B.jsx("div",{className:"relative rounded-xl p-[1px] shadow-2xl bg-gradient-to-b from-[rgba(138,122,255,0.6)] via-[rgba(138,122,255,0.15)] to-[rgba(138,122,255,0.05)]",style:{position:"relative",zIndex:10,boxShadow:"0 20px 60px -10px rgba(138,122,255,0.15), 0 4px 20px rgba(0,0,0,0.4)"},children:B.jsxs("div",{className:"relative rounded-[11px] overflow-hidden bg-oai-gray-950",children:[B.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"180px",background:"linear-gradient(to bottom, rgba(138,122,255,0.35) 0%, rgba(138,122,255,0.12) 40%, transparent 100%)",mixBlendMode:"screen",zIndex:20,pointerEvents:"none"}}),B.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent 0%, rgba(138,122,255,0.9) 30%, rgba(180,168,255,1) 50%, rgba(138,122,255,0.9) 70%, transparent 100%)",zIndex:25,pointerEvents:"none"}}),B.jsx("img",{src:"/dashboard-dark.png",alt:t("landing.screenshot.alt"),className:"block h-auto w-full object-cover",style:{position:"relative",zIndex:10},loading:"eager",decoding:"async"})]})})]})})]})}),B.jsx("section",{className:"border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:B.jsx("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:B.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-8",children:[B.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400 shrink-0",children:t("landing.v2.models.title")}),B.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-6 opacity-60 hover:opacity-100 transition-opacity duration-500 grayscale hover:grayscale-0",children:v.map(w=>B.jsxs("div",{className:"flex items-center gap-2.5 transition-transform hover:-translate-y-0.5 duration-300",children:[B.jsx("img",{src:w.icon,alt:"",width:20,height:20,className:"h-5 w-5 object-contain",loading:"lazy"}),B.jsx("span",{className:"text-sm font-medium text-oai-gray-300",children:m[w.id]})]},w.id))})]})})}),B.jsx("section",{className:"py-20 lg:py-32",children:B.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 grid grid-cols-1 md:grid-cols-2 gap-16 lg:gap-24 items-start",children:[B.jsxs("div",{className:"max-w-md",children:[B.jsx("p",{className:"text-xs font-bold tracking-widest uppercase text-oai-brand-500 mb-4",children:t("landing.v2.compare.kicker")}),B.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl text-balance",children:t("landing.v2.compare.title")}),B.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.compare.subtitle")}),B.jsx("p",{className:"mt-6 text-base leading-relaxed text-oai-gray-500",children:t("landing.v2.distill.body")})]}),B.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-10",children:[B.jsxs("div",{className:"space-y-4",children:[B.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-white border-b border-oai-gray-800 pb-3",children:t("landing.v2.compare.with.title")}),B.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-400",children:[B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p1")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p2")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p3")})]})]})]}),B.jsxs("div",{className:"space-y-4",children:[B.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-500 border-b border-oai-gray-800/50 pb-3",children:t("landing.v2.compare.without.title")}),B.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-500",children:[B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p1")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p2")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p3")})]})]})]})]})]})})]}),B.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:B.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 sm:px-6 text-sm text-oai-gray-400 sm:flex-row",children:[B.jsx("p",{children:t("landing.v2.footer.line")}),B.jsxs("div",{className:"flex items-center gap-6",children:[B.jsx("a",{href:A1,className:"font-medium text-oai-gray-400 hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:t("landing.v2.nav.github")}),f&&B.jsxs(ho,{to:e,className:"font-medium text-oai-brand-500 hover:text-oai-brand-400 transition-colors",children:[t("landing.cta.primary")," →"]})]})]})})]})}function F7({prefersReducedMotion:t,screenshotMode:e}){return!(e||t)}function O7(){return N.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function B7(t=0,e=!0){const[n,i]=N.useState(()=>!e);return N.useEffect(()=>{if(!e){i(!0);return}let r=null,s=null;const o=()=>i(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(o,{timeout:t||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(r=window.setTimeout(o,t),()=>{r!=null&&window.clearTimeout(r)})},[t,e]),n}function z7({signInUrl:t,signUpUrl:e}){const n=qt("landing.handle.special"),i=qt("landing.handle.default");qt("landing.nav.login"),qt("landing.nav.signup");const[r,s]=N.useState(i),o=O7(),c=N.useMemo(()=>typeof window>"u"?!1:NC(window.location.search),[]),u=F7({prefersReducedMotion:o,screenshotMode:c});B7(250,u);const f="tokentracker.dashboard.from_landing.v1";N.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(f,"1")}catch{}},[f]),N.useMemo(()=>qt("landing.handle.placeholder",{handle:n}),[n]),N.useMemo(()=>{const _=qt(r===n?"landing.rank.singularity":"landing.rank.unranked");return qt("landing.rank.expectation",{rank:_})},[r,n]);const h=qt("landing.install.command"),[p,m]=N.useState(!1),v=async()=>{await kV(h)&&(m(!0),window.setTimeout(()=>m(!1),2e3))};return B.jsx(U7,{copy:qt,reduceMotion:o,signInUrl:t,signUpUrl:e,installCommand:h,installCopied:p,onCopyInstallCommand:v})}function V7(t){const e=new URLSearchParams(t).get("next");return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")?"/dashboard":e}const C1={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function R1(t){const e=String(t||"").trim();return C1[e]?C1[e]:e.replace(/-/g," ")}function H7(){const t=Fv(),[e,n]=kL(),{enabled:i,loading:r,signedIn:s,refreshUser:o,signInWithPassword:c,signUp:u,signInWithOAuth:f,getPublicAuthConfig:h}=$l(),p=N.useMemo(()=>V7(e.toString()),[e]),[m,v]=N.useState("signin"),[_,w]=N.useState(""),[y,x]=N.useState(""),[M,A]=N.useState(""),[T,D]=N.useState(!1),[I,U]=N.useState(null),[S,R]=N.useState(null),[H,F]=N.useState(!0),[W,X]=N.useState([]),[V,q]=N.useState([]),[J,Q]=N.useState(8);N.useEffect(()=>{const ve=e.get("insforge_status"),Ee=e.get("insforge_type"),Ue=e.get("insforge_error");ve==="success"&&Ee==="verify_email"?R(qt("login.verify_email_success")):ve==="error"&&Ee==="verify_email"&&Ue&&R(qt("shared.error.prefix",{error:Ue}))},[e]),N.useEffect(()=>{if(!i){F(!1);return}let ve=!0;return(async()=>{const{data:Ee,error:Ue}=await h();ve&&(Ue||!Ee?(X(["google","github"]),q([])):(X(Array.isArray(Ee.oAuthProviders)?Ee.oAuthProviders:[]),q(Array.isArray(Ee.customOAuthProviders)?Ee.customOAuthProviders:[]),typeof Ee.passwordMinLength=="number"&&Ee.passwordMinLength>0&&Q(Ee.passwordMinLength)),F(!1))})(),()=>{ve=!1}},[i,h]),N.useEffect(()=>{!i||r||s&&t(p,{replace:!0})},[i,r,s,t,p]),N.useEffect(()=>{i&&o()},[i,o]);const $=N.useMemo(()=>typeof window>"u"?"":`${window.location.origin}${p}`,[p]),Y=N.useMemo(()=>{if(typeof window>"u")return"";const ve=new URLSearchParams;return ve.set("next",p),`${window.location.origin}/login?${ve.toString()}`},[p]),Z=N.useCallback(async ve=>{ve.preventDefault(),U(null),D(!0);try{if(m==="signup"){const{data:Ue,error:le}=await u({email:_.trim(),password:y,name:M.trim()||void 0,redirectTo:Y});if(le){U(le.message||String(le));return}if(Ue?.requireEmailVerification){R(qt("login.verify_email_pending")),v("signin");return}t(p,{replace:!0});return}const{error:Ee}=await c({email:_.trim(),password:y});if(Ee){U(Ee.message||String(Ee));return}t(p,{replace:!0})}finally{D(!1)}},[m,_,y,M,u,c,t,p,Y]),z=N.useCallback(async ve=>{U(null),D(!0);try{const{error:Ee}=await f(ve,$);Ee&&U(Ee.message||String(Ee))}finally{D(!1)}},[f,$]),ie=N.useCallback(()=>{n(ve=>{const Ee=new URLSearchParams(ve);return Ee.delete("insforge_status"),Ee.delete("insforge_type"),Ee.delete("insforge_error"),Ee},{replace:!0}),R(null)},[n]);return i?B.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[B.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:B.jsx(ho,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:qt("login.back_home")})}),B.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:B.jsxs("div",{className:"w-full max-w-md space-y-8",children:[B.jsxs("div",{className:"text-center",children:[B.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:qt("login.title")}),B.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:qt("login.subtitle")})]}),S?B.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[B.jsx("span",{children:S}),B.jsx("button",{type:"button",onClick:ie,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:qt("login.dismiss")})]}):null,I?B.jsx("p",{className:"text-sm text-red-400",role:"alert",children:qt("shared.error.prefix",{error:I})}):null,B.jsx("div",{className:"space-y-3",children:H?B.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):B.jsxs(B.Fragment,{children:[W.map(ve=>B.jsx("button",{type:"button",disabled:T,onClick:()=>z(ve),className:Si("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:R1(ve)})},ve)),V.map(ve=>B.jsx("button",{type:"button",disabled:T,onClick:()=>z(ve),className:Si("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:R1(ve)})},ve))]})}),B.jsxs("div",{className:"relative",children:[B.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:B.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),B.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:B.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:qt("login.divider")})})]}),B.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[B.jsx("button",{type:"button",className:Si("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signin"),U(null)},children:qt("login.tab.sign_in")}),B.jsx("button",{type:"button",className:Si("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signup"),U(null)},children:qt("login.tab.sign_up")})]}),B.jsxs("form",{onSubmit:Z,className:"space-y-4",children:[m==="signup"?B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.name")}),B.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:M,onChange:ve=>A(ve.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:qt("login.field.name_placeholder")})]}):null,B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.email")}),B.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:_,onChange:ve=>w(ve.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.password")}),B.jsx("input",{id:"login-password",type:"password",autoComplete:m==="signup"?"new-password":"current-password",required:!0,minLength:m==="signup"?J:void 0,value:y,onChange:ve=>x(ve.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),m==="signup"?B.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:qt("login.password_hint",{min:String(J)})}):null]}),B.jsx("button",{type:"submit",disabled:T||r,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:qt(m==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]})})]}):B.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[B.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:B.jsx(ho,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:qt("login.back_home")})}),B.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:B.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:qt("login.cloud_only")})})]})}const G7=Gl.lazy(()=>ry(()=>import("./DashboardPage-DS1P0Mo_.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),W7=Gl.lazy(()=>ry(()=>import("./LeaderboardPage-DrN-vtKo.js"),__vite__mapDeps([2,3,1])).then(t=>({default:t.LeaderboardPage}))),j7=Gl.lazy(()=>ry(()=>import("./LeaderboardProfilePage-CBYJri8H.js"),__vite__mapDeps([4,3,1])).then(t=>({default:t.LeaderboardProfilePage})));function $7(){const t=vr(),e=$l();RV();const n=xr(),i=N.useMemo(()=>typeof window>"u"?!1:NC(window.location.search),[]),r=t?.pathname||"/",s=new URL(window.location.href),o=s.pathname.replace(/\/+$/,"")||"/",u=o.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,f=s.searchParams.get("token")||null,h=u||f,p=o==="/share"||o==="/share.html"||o.startsWith("/share/"),m=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),v=r.replace(/\/+$/,"")||"/",_=v.match(/^\/leaderboard\/u\/([^/]+)$/i),w=_?_[1]:null,y=v==="/leaderboard"||!!w,x=!!(e.enabled&&e.signedIn),M=m||x,A=!1,T=Y5(),D=N.useMemo(()=>!e.enabled||!x?null:{getAccessToken:()=>e.getAccessToken()},[e,x]);let I=m||n||i?"dashboard":"landing";v==="/landing"&&(I="landing"),v==="/dashboard"&&(I="dashboard"),y&&(I="dashboard");const U=w?j7:v==="/leaderboard"?W7:G7,S=B.jsx("div",{className:"min-h-screen bg-[#050505]"});let R=null;return v==="/login"?R=B.jsx(H7,{}):I==="landing"?R=B.jsx(z7,{signInUrl:"/login",signUpUrl:"/login"}):R=B.jsx(N.Suspense,{fallback:S,children:B.jsx(U,{baseUrl:T,auth:D,signedIn:M,sessionSoftExpired:A,signOut:()=>e.enabled?e.signOut():Promise.resolve(),publicMode:p,publicToken:h,userId:w,signInUrl:"/login",signUpUrl:"/login"})}),B.jsx(UU,{children:B.jsx(zU,{children:B.jsxs(VU,{children:[R,B.jsx(X5,{}),B.jsx(UI,{}),B.jsx(XI,{})]})})})}const X7=EL([{path:"*",element:B.jsx($7,{})}]);f2.createRoot(document.getElementById("root")).render(B.jsx(Gl.StrictMode,{children:B.jsx(SI,{children:B.jsx(OL,{router:X7})})}));export{QI as $,RC as A,qt as B,B as C,ly as D,sU as E,xT as F,Rv as G,xU as H,IS as I,oh as J,LS as K,oy as L,Uy as M,r$ as N,bl as O,ay as P,FL as Q,k1 as R,dT as S,EU as T,US as U,Xl as V,mT as W,DS as X,fT as Y,qI as Z,eU as _,hi as a,YI as a0,s0 as a1,pT as a2,t$ as a3,JI as a4,n$ as a5,hT as a6,i$ as a7,VV as a8,ho as a9,a$ as aA,iT as aB,Lm as aC,x$ as aD,Si as aE,IV as aF,DV as aG,TV as aH,b$ as aI,mI as aJ,S$ as aK,FU as aL,NV as aa,Bz as ab,go as ac,pU as ad,Gl as ae,m$ as af,p$ as ag,ET as ah,$l as ai,QA as aj,NC as ak,io as al,w$ as am,o$ as an,l$ as ao,g$ as ap,tV as aq,c$ as ar,u$ as as,E$ as at,h$ as au,ry as av,v$ as aw,kV as ax,vr as ay,Fv as az,MT as b,Ra as c,ew as d,By as e,Tn as f,PC as g,xr as h,FF as i,e$ as j,xI as k,R$ as l,Fl as m,rV as n,sV as o,T$ as p,f$ as q,N as r,_$ as s,A$ as t,uy as u,C$ as v,d$ as w,kn as x,y$ as y,M$ as z};
|
|
4863
|
+
}`;function R7({raysOrigin:t="top-center",raysColor:e="#ffffff",raysSpeed:n=1,lightSpread:i=1,rayLength:r=2,pulsating:s=!1,fadeDistance:o=1,saturation:c=1,followMouse:u=!0,mouseInfluence:f=.1,noiseAmount:h=0,distortion:p=0,className:m=""}){const v=N.useRef(null),_=N.useRef(null),w=N.useRef(null),y=N.useRef({x:.5,y:.5}),x=N.useRef({x:.5,y:.5}),M=N.useRef(null),A=N.useRef(null),T=N.useRef(null),[D,I]=N.useState(!1),U=N.useRef(null);return N.useEffect(()=>{if(v.current)return U.current=new IntersectionObserver(S=>{I(S[0].isIntersecting)},{threshold:.1}),U.current.observe(v.current),()=>{U.current&&(U.current.disconnect(),U.current=null)}},[]),N.useEffect(()=>!D||!v.current?void 0:(T.current&&(T.current(),T.current=null),(async()=>{if(!v.current||(await new Promise(Q=>setTimeout(Q,10)),!v.current))return;const R=new Aj({dpr:Math.min(window.devicePixelRatio,2),alpha:!0});w.current=R;const H=R.gl;for(H.canvas.style.width="100%",H.canvas.style.height="100%";v.current.firstChild;)v.current.removeChild(v.current.firstChild);v.current.appendChild(H.canvas);const F={iTime:{value:0},iResolution:{value:[1,1]},rayPos:{value:[0,0]},rayDir:{value:[0,1]},raysColor:{value:M1(e)},raysSpeed:{value:n},lightSpread:{value:i},rayLength:{value:r},pulsating:{value:s?1:0},fadeDistance:{value:o},saturation:{value:c},mousePos:{value:[.5,.5]},mouseInfluence:{value:f},noiseAmount:{value:h},distortion:{value:p}};_.current=F;const W=new T7(H),X=new Sj(H,{vertex:A7,fragment:C7,uniforms:F}),V=new M7(H,{geometry:W,program:X});A.current=V;const q=()=>{if(!v.current||!R)return;R.dpr=Math.min(window.devicePixelRatio,2);const{clientWidth:Q,clientHeight:$}=v.current;R.setSize(Q,$);const Y=R.dpr,Z=Q*Y,z=$*Y;F.iResolution.value=[Z,z];const{anchor:ie,dir:_e}=T1(t,Z,z);F.rayPos.value=ie,F.rayDir.value=_e},J=Q=>{if(!(!w.current||!_.current||!A.current)){F.iTime.value=Q*.001,u&&f>0&&(x.current.x=x.current.x*.92+y.current.x*(1-.92),x.current.y=x.current.y*.92+y.current.y*(1-.92),F.mousePos.value=[x.current.x,x.current.y]);try{R.render({scene:V}),M.current=requestAnimationFrame(J)}catch($){console.warn("WebGL rendering error:",$)}}};window.addEventListener("resize",q),q(),M.current=requestAnimationFrame(J),T.current=()=>{if(M.current&&(cancelAnimationFrame(M.current),M.current=null),window.removeEventListener("resize",q),R)try{const Q=R.gl.getExtension("WEBGL_lose_context");Q&&Q.loseContext();const $=R.gl.canvas;$&&$.parentNode&&$.parentNode.removeChild($)}catch(Q){console.warn("Error during WebGL cleanup:",Q)}w.current=null,_.current=null,A.current=null}})(),()=>{T.current&&(T.current(),T.current=null)}),[D,t,e,n,i,r,s,o,c,u,f,h,p]),N.useEffect(()=>{if(!_.current||!v.current||!w.current)return;const S=_.current,R=w.current;S.raysColor.value=M1(e),S.raysSpeed.value=n,S.lightSpread.value=i,S.rayLength.value=r,S.pulsating.value=s?1:0,S.fadeDistance.value=o,S.saturation.value=c,S.mouseInfluence.value=f,S.noiseAmount.value=h,S.distortion.value=p;const{clientWidth:H,clientHeight:F}=v.current,W=R.dpr,{anchor:X,dir:V}=T1(t,H*W,F*W);S.rayPos.value=X,S.rayDir.value=V},[e,n,i,t,r,s,o,c,f,h,p]),N.useEffect(()=>{if(!u)return;const S=R=>{if(!v.current)return;const H=v.current.getBoundingClientRect();y.current={x:(R.clientX-H.left)/H.width,y:(R.clientY-H.top)/H.height}};return window.addEventListener("mousemove",S),()=>window.removeEventListener("mousemove",S)},[u]),B.jsx("div",{ref:v,className:`w-full h-full pointer-events-none z-[3] overflow-hidden relative ${m}`.trim()})}function P7({className:t}){return B.jsx("svg",{viewBox:"0 0 384 512",className:t,fill:"currentColor",children:B.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function k7({className:t}){return B.jsx("svg",{viewBox:"0 0 16 16",className:t,fill:"currentColor",children:B.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function L7({className:t}){return B.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[B.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),B.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function D7({className:t}){return B.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:B.jsx("polyline",{points:"20 6 9 17 4 12"})})}const A1="https://github.com/mm7894215/tokentracker",N7="https://github.com/mm7894215/tokentracker/releases/latest";function I7(t="default",e="md",n){const i="inline-flex items-center justify-center rounded font-medium transition-colors duration-200 ease-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",r={default:"bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200",ghost:"text-oai-gray-600 hover:text-oai-gray-900 hover:bg-oai-gray-100 active:bg-oai-gray-200 dark:text-oai-gray-400 dark:hover:text-white dark:hover:bg-oai-gray-800 dark:active:bg-oai-gray-700"},s={sm:"h-9 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-12 px-8 text-base"};return Si(i,r[t],s[e],n)}function U7({copy:t,signInUrl:e,signUpUrl:n,installCommand:i,installCopied:r,onCopyInstallCommand:s}){const o=Bz(),[c,u]=N.useState(!1);N.useEffect(()=>{const w=()=>u(window.scrollY>10);return window.addEventListener("scroll",w,{passive:!0}),()=>window.removeEventListener("scroll",w)},[]);const f=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),{signedIn:h,loading:p}=$l(),m=N.useMemo(()=>({codex:t("landing.v2.models.agent.codex"),claude_code:t("landing.v2.models.agent.claude_code"),cursor:t("landing.v2.models.agent.cursor"),gemini:t("landing.v2.models.agent.gemini"),opencode:t("landing.v2.models.agent.opencode"),openclaw:t("landing.v2.models.agent.openclaw")}),[t]),v=N.useMemo(()=>[{id:"codex",icon:"/brand-logos/codex.svg"},{id:"claude_code",icon:"/brand-logos/claude-code.svg"},{id:"cursor",icon:"/brand-logos/cursor.svg"},{id:"gemini",icon:"/brand-logos/gemini.svg"},{id:"opencode",icon:"/brand-logos/opencode.svg"},{id:"openclaw",icon:"/brand-logos/openclaw.svg"}],[]),_=o?{duration:0}:void 0;return B.jsxs("div",{className:"relative min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark",children:[B.jsx("div",{className:"absolute inset-0 z-0 pointer-events-none",style:{height:"100vh"},children:B.jsx(R7,{raysOrigin:"top-center",raysColor:"#b8b3ff",raysSpeed:1,lightSpread:.5,rayLength:3,pulsating:!1,fadeDistance:1,saturation:1,followMouse:!0,mouseInfluence:.1,noiseAmount:0,distortion:0})}),B.jsx("header",{className:Si("sticky top-0 z-50 transition-all duration-300",c?"bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-900":"bg-transparent border-b border-transparent"),children:B.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[B.jsxs("div",{className:"flex items-center gap-5",children:[B.jsxs(ho,{to:n||"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[B.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),B.jsx("span",{className:"text-sm font-semibold tracking-wide text-white uppercase",children:"Token Tracker"})]}),B.jsx("div",{className:"hidden sm:block",children:B.jsx(IV,{})})]}),f&&B.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:gap-3",children:[B.jsxs(ho,{to:DV(),className:Si(I7(h||p?"default":"ghost","sm"),"no-underline px-5 rounded-full group",h||p?"shadow-sm ring-1 ring-white/10":"ring-1 ring-oai-gray-700"),children:[t("landing.v2.cta.primary"),B.jsx("span",{className:"ml-2 inline-block transition-transform duration-200 group-hover:translate-x-0.5",children:"→"})]}),B.jsx(VV,{})]})]})}),B.jsxs("main",{children:[B.jsx("section",{className:"relative py-16 sm:py-24 lg:py-32 overflow-hidden",children:B.jsxs("div",{className:"relative z-10 mx-auto max-w-7xl px-4 sm:px-6 flex flex-col items-center text-center gap-20 lg:gap-36",children:[B.jsxs(go.div,{initial:o?!1:{opacity:0,y:20},animate:{opacity:1,y:0},transition:_||{duration:.5},className:"w-full max-w-3xl relative z-20",children:[B.jsxs("h1",{className:"text-balance text-5xl font-semibold tracking-tight text-white sm:text-6xl lg:text-[4rem] lg:leading-[1.05]",children:[t("landing.v2.hero.title_line1"),B.jsx("br",{}),B.jsx("span",{className:"bg-gradient-to-b from-white via-oai-gray-200 to-oai-gray-500 bg-clip-text text-transparent font-bold tracking-tight",style:{WebkitTextStroke:"1px rgba(255, 255, 255, 0.15)"},children:t("landing.v2.hero.title_line2")})]}),B.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.hero.subtagline")}),B.jsxs("div",{className:"mt-8 w-full max-w-lg mx-auto",children:[B.jsxs(go.div,{whileHover:{scale:1.01,y:-1},transition:{type:"spring",stiffness:400,damping:25},className:"group relative inline-block w-full overflow-hidden rounded-2xl",style:{padding:"1.5px 0"},children:[B.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 bottom-[-11px] right-[-250%] rounded-full animate-star-movement-bottom z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),B.jsx("div",{className:"absolute w-[300%] h-[50%] opacity-70 top-[-10px] left-[-250%] rounded-full animate-star-movement-top z-0",style:{background:"radial-gradient(circle, #fbdfff, transparent 10%)",animationDuration:"6s"}}),B.jsxs("div",{className:"relative z-[1] flex items-center justify-between w-full bg-[#0a0a0a] border border-oai-gray-800 rounded-2xl p-1.5 pl-5 shadow-2xl shadow-black/50",children:[B.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[B.jsx("span",{className:"text-oai-gray-600 font-mono select-none","aria-hidden":"true",children:"›"}),B.jsx("code",{className:"font-mono text-sm text-oai-gray-200 overflow-x-auto whitespace-nowrap py-2 [scrollbar-width:none]",children:i?i.split(" ").map((w,y)=>B.jsxs("span",{className:w==="npx"||w==="tokentracker-cli"?"text-white font-medium":w==="--yes"?"text-oai-gray-500":"text-oai-brand-400",children:[w," "]},y)):null})]}),B.jsx("button",{type:"button",onClick:s,"aria-label":t(r?"landing.install.action.copied":"landing.install.action.copy"),className:"shrink-0 flex h-9 w-9 items-center justify-center text-oai-gray-200 bg-oai-gray-900 border border-oai-gray-700 rounded-lg hover:bg-oai-gray-800 hover:text-white active:scale-95 transition-all duration-200 shadow-sm",children:r?B.jsx(D7,{className:"h-4 w-4 text-green-400","aria-hidden":!0}):B.jsx(L7,{className:"h-4 w-4 opacity-70","aria-hidden":!0})})]})]}),B.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-x-6 gap-y-4",children:[B.jsxs("a",{href:N7,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[B.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:B.jsx(P7,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.v2.install.mac_cta")]}),B.jsxs("a",{href:A1,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-2 text-sm font-medium text-oai-gray-400 hover:text-white transition-colors",children:[B.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-full bg-oai-gray-800 group-hover:bg-oai-gray-700 transition-colors",children:B.jsx(k7,{className:"h-4 w-4 text-oai-gray-400 group-hover:text-white"})}),t("landing.cta.secondary")]})]}),B.jsx("span",{className:"sr-only","aria-live":"polite",children:r?t("landing.install.action.copied"):""})]})]}),B.jsx("div",{className:"relative group w-full",children:B.jsxs(go.div,{initial:o?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:_||{duration:.6,delay:.1},className:"relative w-full",children:[B.jsx("div",{style:{position:"absolute",top:"-256px",left:0,right:0,height:"510px",zIndex:3,pointerEvents:"none"},children:B.jsx(nj,{color:"#8a7aff",wispDensity:2,flowSpeed:.28,verticalSizing:2.2,horizontalSizing:1.22,fogIntensity:4,fogScale:.1,wispSpeed:18,wispIntensity:10,flowStrength:.12,decay:1.1,falloffStart:1.1,fogFallSpeed:.5,horizontalBeamOffset:.22,verticalBeamOffset:0,style:{width:"100%",height:"100%"}})}),B.jsx("div",{className:"relative rounded-xl p-[1px] shadow-2xl bg-gradient-to-b from-[rgba(138,122,255,0.6)] via-[rgba(138,122,255,0.15)] to-[rgba(138,122,255,0.05)]",style:{position:"relative",zIndex:10,boxShadow:"0 20px 60px -10px rgba(138,122,255,0.15), 0 4px 20px rgba(0,0,0,0.4)"},children:B.jsxs("div",{className:"relative rounded-[11px] overflow-hidden bg-oai-gray-950",children:[B.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"180px",background:"linear-gradient(to bottom, rgba(138,122,255,0.35) 0%, rgba(138,122,255,0.12) 40%, transparent 100%)",mixBlendMode:"screen",zIndex:20,pointerEvents:"none"}}),B.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"1px",background:"linear-gradient(90deg, transparent 0%, rgba(138,122,255,0.9) 30%, rgba(180,168,255,1) 50%, rgba(138,122,255,0.9) 70%, transparent 100%)",zIndex:25,pointerEvents:"none"}}),B.jsx("img",{src:"/dashboard-dark.png",alt:t("landing.screenshot.alt"),className:"block h-auto w-full object-cover",style:{position:"relative",zIndex:10},loading:"eager",decoding:"async"})]})})]})})]})}),B.jsx("section",{className:"border-y border-oai-gray-900 bg-oai-gray-950/50 py-12 lg:py-16",children:B.jsx("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:B.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-8",children:[B.jsx("p",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-400 shrink-0",children:t("landing.v2.models.title")}),B.jsx("div",{className:"flex flex-wrap items-center gap-x-8 gap-y-6 opacity-60 hover:opacity-100 transition-opacity duration-500 grayscale hover:grayscale-0",children:v.map(w=>B.jsxs("div",{className:"flex items-center gap-2.5 transition-transform hover:-translate-y-0.5 duration-300",children:[B.jsx("img",{src:w.icon,alt:"",width:20,height:20,className:"h-5 w-5 object-contain",loading:"lazy"}),B.jsx("span",{className:"text-sm font-medium text-oai-gray-300",children:m[w.id]})]},w.id))})]})})}),B.jsx("section",{className:"py-20 lg:py-32",children:B.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6 grid grid-cols-1 md:grid-cols-2 gap-16 lg:gap-24 items-start",children:[B.jsxs("div",{className:"max-w-md",children:[B.jsx("p",{className:"text-xs font-bold tracking-widest uppercase text-oai-brand-500 mb-4",children:t("landing.v2.compare.kicker")}),B.jsx("h2",{className:"text-3xl font-semibold tracking-tight text-white sm:text-4xl text-balance",children:t("landing.v2.compare.title")}),B.jsx("p",{className:"mt-6 text-lg leading-relaxed text-oai-gray-400",children:t("landing.v2.compare.subtitle")}),B.jsx("p",{className:"mt-6 text-base leading-relaxed text-oai-gray-500",children:t("landing.v2.distill.body")})]}),B.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-10",children:[B.jsxs("div",{className:"space-y-4",children:[B.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-white border-b border-oai-gray-800 pb-3",children:t("landing.v2.compare.with.title")}),B.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-400",children:[B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p1")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p2")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"text-oai-brand-500 shrink-0",children:"✦"}),B.jsx("span",{children:t("landing.v2.compare.with.p3")})]})]})]}),B.jsxs("div",{className:"space-y-4",children:[B.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-oai-gray-500 border-b border-oai-gray-800/50 pb-3",children:t("landing.v2.compare.without.title")}),B.jsxs("ul",{className:"space-y-3 text-sm text-oai-gray-500",children:[B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p1")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p2")})]}),B.jsxs("li",{className:"flex gap-2",children:[B.jsx("span",{className:"opacity-50 shrink-0",children:"✕"}),B.jsx("span",{children:t("landing.v2.compare.without.p3")})]})]})]})]})]})})]}),B.jsx("footer",{className:"border-t border-oai-gray-900 bg-oai-gray-950 py-12",children:B.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center justify-between gap-6 px-4 sm:px-6 text-sm text-oai-gray-400 sm:flex-row",children:[B.jsx("p",{children:t("landing.v2.footer.line")}),B.jsxs("div",{className:"flex items-center gap-6",children:[B.jsx("a",{href:A1,className:"font-medium text-oai-gray-400 hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:t("landing.v2.nav.github")}),f&&B.jsxs(ho,{to:e,className:"font-medium text-oai-brand-500 hover:text-oai-brand-400 transition-colors",children:[t("landing.cta.primary")," →"]})]})]})})]})}function F7({prefersReducedMotion:t,screenshotMode:e}){return!(e||t)}function O7(){return N.useMemo(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,[])}function B7(t=0,e=!0){const[n,i]=N.useState(()=>!e);return N.useEffect(()=>{if(!e){i(!0);return}let r=null,s=null;const o=()=>i(!0);return typeof window<"u"&&"requestIdleCallback"in window?(s=window.requestIdleCallback(o,{timeout:t||200}),()=>{typeof window.cancelIdleCallback=="function"&&s!=null&&window.cancelIdleCallback(s)}):(r=window.setTimeout(o,t),()=>{r!=null&&window.clearTimeout(r)})},[t,e]),n}function z7({signInUrl:t,signUpUrl:e}){const n=qt("landing.handle.special"),i=qt("landing.handle.default");qt("landing.nav.login"),qt("landing.nav.signup");const[r,s]=N.useState(i),o=O7(),c=N.useMemo(()=>typeof window>"u"?!1:NC(window.location.search),[]),u=F7({prefersReducedMotion:o,screenshotMode:c});B7(250,u);const f="tokentracker.dashboard.from_landing.v1";N.useEffect(()=>{if(!(typeof window>"u"))try{window.sessionStorage.setItem(f,"1")}catch{}},[f]),N.useMemo(()=>qt("landing.handle.placeholder",{handle:n}),[n]),N.useMemo(()=>{const _=qt(r===n?"landing.rank.singularity":"landing.rank.unranked");return qt("landing.rank.expectation",{rank:_})},[r,n]);const h=qt("landing.install.command"),[p,m]=N.useState(!1),v=async()=>{await kV(h)&&(m(!0),window.setTimeout(()=>m(!1),2e3))};return B.jsx(U7,{copy:qt,reduceMotion:o,signInUrl:t,signUpUrl:e,installCommand:h,installCopied:p,onCopyInstallCommand:v})}function V7(t){const e=new URLSearchParams(t).get("next");return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")?"/dashboard":e}const C1={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function R1(t){const e=String(t||"").trim();return C1[e]?C1[e]:e.replace(/-/g," ")}function H7(){const t=Fv(),[e,n]=kL(),{enabled:i,loading:r,signedIn:s,refreshUser:o,signInWithPassword:c,signUp:u,signInWithOAuth:f,getPublicAuthConfig:h}=$l(),p=N.useMemo(()=>V7(e.toString()),[e]),[m,v]=N.useState("signin"),[_,w]=N.useState(""),[y,x]=N.useState(""),[M,A]=N.useState(""),[T,D]=N.useState(!1),[I,U]=N.useState(null),[S,R]=N.useState(null),[H,F]=N.useState(!0),[W,X]=N.useState([]),[V,q]=N.useState([]),[J,Q]=N.useState(8);N.useEffect(()=>{const _e=e.get("insforge_status"),Ee=e.get("insforge_type"),Ue=e.get("insforge_error");_e==="success"&&Ee==="verify_email"?R(qt("login.verify_email_success")):_e==="error"&&Ee==="verify_email"&&Ue&&R(qt("shared.error.prefix",{error:Ue}))},[e]),N.useEffect(()=>{if(!i){F(!1);return}let _e=!0;return(async()=>{const{data:Ee,error:Ue}=await h();_e&&(Ue||!Ee?(X(["google","github"]),q([])):(X(Array.isArray(Ee.oAuthProviders)?Ee.oAuthProviders:[]),q(Array.isArray(Ee.customOAuthProviders)?Ee.customOAuthProviders:[]),typeof Ee.passwordMinLength=="number"&&Ee.passwordMinLength>0&&Q(Ee.passwordMinLength)),F(!1))})(),()=>{_e=!1}},[i,h]),N.useEffect(()=>{!i||r||s&&t(p,{replace:!0})},[i,r,s,t,p]),N.useEffect(()=>{i&&o()},[i,o]);const $=N.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),Y=N.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),Z=N.useCallback(async _e=>{_e.preventDefault(),U(null),D(!0);try{if(m==="signup"){const{data:Ue,error:le}=await u({email:_.trim(),password:y,name:M.trim()||void 0,redirectTo:Y});if(le){U(le.message||String(le));return}if(Ue?.requireEmailVerification){R(qt("login.verify_email_pending")),v("signin");return}t(p,{replace:!0});return}const{error:Ee}=await c({email:_.trim(),password:y});if(Ee){U(Ee.message||String(Ee));return}t(p,{replace:!0})}finally{D(!1)}},[m,_,y,M,u,c,t,p,Y]),z=N.useCallback(async _e=>{U(null),D(!0);try{const{error:Ee}=await f(_e,$);Ee&&U(Ee.message||String(Ee))}finally{D(!1)}},[f,$]),ie=N.useCallback(()=>{n(_e=>{const Ee=new URLSearchParams(_e);return Ee.delete("insforge_status"),Ee.delete("insforge_type"),Ee.delete("insforge_error"),Ee},{replace:!0}),R(null)},[n]);return i?B.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[B.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:B.jsx(ho,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:qt("login.back_home")})}),B.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:B.jsxs("div",{className:"w-full max-w-md space-y-8",children:[B.jsxs("div",{className:"text-center",children:[B.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:qt("login.title")}),B.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:qt("login.subtitle")})]}),S?B.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[B.jsx("span",{children:S}),B.jsx("button",{type:"button",onClick:ie,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:qt("login.dismiss")})]}):null,I?B.jsx("p",{className:"text-sm text-red-400",role:"alert",children:qt("shared.error.prefix",{error:I})}):null,B.jsx("div",{className:"space-y-3",children:H?B.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):B.jsxs(B.Fragment,{children:[W.map(_e=>B.jsx("button",{type:"button",disabled:T,onClick:()=>z(_e),className:Si("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:R1(_e)})},_e)),V.map(_e=>B.jsx("button",{type:"button",disabled:T,onClick:()=>z(_e),className:Si("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:qt("login.oauth.continue",{provider:R1(_e)})},_e))]})}),B.jsxs("div",{className:"relative",children:[B.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:B.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),B.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:B.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:qt("login.divider")})})]}),B.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[B.jsx("button",{type:"button",className:Si("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signin"),U(null)},children:qt("login.tab.sign_in")}),B.jsx("button",{type:"button",className:Si("flex-1 py-2 text-sm font-medium rounded-md transition-colors",m==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{v("signup"),U(null)},children:qt("login.tab.sign_up")})]}),B.jsxs("form",{onSubmit:Z,className:"space-y-4",children:[m==="signup"?B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.name")}),B.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:M,onChange:_e=>A(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:qt("login.field.name_placeholder")})]}):null,B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.email")}),B.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:_,onChange:_e=>w(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),B.jsxs("div",{children:[B.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:qt("login.field.password")}),B.jsx("input",{id:"login-password",type:"password",autoComplete:m==="signup"?"new-password":"current-password",required:!0,minLength:m==="signup"?J:void 0,value:y,onChange:_e=>x(_e.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),m==="signup"?B.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:qt("login.password_hint",{min:String(J)})}):null]}),B.jsx("button",{type:"submit",disabled:T||r,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:qt(m==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]})})]}):B.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[B.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:B.jsx(ho,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:qt("login.back_home")})}),B.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:B.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",children:qt("login.cloud_only")})})]})}const G7=Gl.lazy(()=>ry(()=>import("./DashboardPage-DEZCzCqB.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),W7=Gl.lazy(()=>ry(()=>import("./LeaderboardPage-BaHIGvSw.js"),__vite__mapDeps([2,3,1])).then(t=>({default:t.LeaderboardPage}))),j7=Gl.lazy(()=>ry(()=>import("./LeaderboardProfilePage-BCvKUQ4z.js"),__vite__mapDeps([4,3,1])).then(t=>({default:t.LeaderboardProfilePage})));function $7(){const t=vr(),e=$l();RV();const n=xr(),i=N.useMemo(()=>typeof window>"u"?!1:NC(window.location.search),[]),r=t?.pathname||"/",s=new URL(window.location.href),o=s.pathname.replace(/\/+$/,"")||"/",u=o.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,f=s.searchParams.get("token")||null,h=u||f,p=o==="/share"||o==="/share.html"||o.startsWith("/share/"),m=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),v=r.replace(/\/+$/,"")||"/",_=v.match(/^\/leaderboard\/u\/([^/]+)$/i),w=_?_[1]:null,y=v==="/leaderboard"||!!w,x=!!(e.enabled&&e.signedIn),M=m||x,A=!1,T=Y5(),D=N.useMemo(()=>!e.enabled||!x?null:{getAccessToken:()=>e.getAccessToken()},[e,x]);let I=m||n||i?"dashboard":"landing";v==="/landing"&&(I="landing"),v==="/dashboard"&&(I="dashboard"),y&&(I="dashboard");const U=w?j7:v==="/leaderboard"?W7:G7,S=B.jsx("div",{className:"min-h-screen bg-[#050505]"});let R=null;return v==="/login"?R=B.jsx(H7,{}):I==="landing"?R=B.jsx(z7,{signInUrl:"/login",signUpUrl:"/login"}):R=B.jsx(N.Suspense,{fallback:S,children:B.jsx(U,{baseUrl:T,auth:D,signedIn:M,sessionSoftExpired:A,signOut:()=>e.enabled?e.signOut():Promise.resolve(),publicMode:p,publicToken:h,userId:w,signInUrl:"/login",signUpUrl:"/login"})}),B.jsx(UU,{children:B.jsx(zU,{children:B.jsxs(VU,{children:[R,B.jsx(X5,{}),B.jsx(UI,{}),B.jsx(XI,{})]})})})}const X7=EL([{path:"*",element:B.jsx($7,{})}]);f2.createRoot(document.getElementById("root")).render(B.jsx(Gl.StrictMode,{children:B.jsx(SI,{children:B.jsx(OL,{router:X7})})}));export{QI as $,RC as A,qt as B,B as C,ly as D,sU as E,xT as F,Rv as G,xU as H,IS as I,oh as J,LS as K,oy as L,Uy as M,r$ as N,bl as O,ay as P,FL as Q,k1 as R,dT as S,EU as T,US as U,Xl as V,mT as W,DS as X,fT as Y,qI as Z,eU as _,hi as a,YI as a0,s0 as a1,pT as a2,t$ as a3,JI as a4,n$ as a5,hT as a6,i$ as a7,VV as a8,ho as a9,a$ as aA,iT as aB,Lm as aC,x$ as aD,Si as aE,IV as aF,DV as aG,TV as aH,b$ as aI,mI as aJ,S$ as aK,FU as aL,NV as aa,Bz as ab,go as ac,pU as ad,Gl as ae,m$ as af,p$ as ag,ET as ah,$l as ai,QA as aj,NC as ak,io as al,w$ as am,o$ as an,l$ as ao,g$ as ap,tV as aq,c$ as ar,u$ as as,E$ as at,h$ as au,ry as av,v$ as aw,kV as ax,vr as ay,Fv as az,MT as b,Ra as c,ew as d,By as e,Tn as f,PC as g,xr as h,FF as i,e$ as j,xI as k,R$ as l,Fl as m,rV as n,sV as o,T$ as p,f$ as q,N as r,_$ as s,A$ as t,uy as u,C$ as v,d$ as w,kn as x,y$ as y,M$ as z};
|