@shmulikdav/solix 1.3.0 → 1.4.1
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/dist/web/assets/{GalaxyPanel-B1Y8EmJ-.js → GalaxyPanel-D3Z8JKOp.js} +1 -1
- package/dist/web/assets/Scene-DGvQzQki.js +292 -0
- package/dist/web/assets/{TimelineDrawer-D164Rv-U.js → TimelineDrawer-CcNI10xd.js} +1 -1
- package/dist/web/assets/{index-BB6Hys2b.js → index-CMDHR3gR.js} +2 -2
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/assets/Scene-BRE59mDX.js +0 -292
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import{r as M,g as ff,j as T,R as df,O as Un,P as Bn,S as Oo,a as So,V as pf,b as hf,B as mf,N as hu,A as mu,W as vf,C as gf,c as De,d as Me,e as yf,L as xo,f as Sf,U as Sn,T as xf,h as Ef,D as Dn,M as rr,i as ir,k as Uo,Q as Bo,l as wf,m as Mf,n as Zi,o as kn,p as Qo,q as dt,s as Qr,t as Yt,u as nt,v as Tf,w as _f,x as Rf,F as vu,y as Bt,z as Ji,E as Pf,G as qi,H as hr,I as Yo,J as gu,K as yu,X as Cf,Y as cr,Z as If,_ as jn,$ as xe,a0 as Su,a1 as zf,a2 as xu,a3 as $i,a4 as ka,a5 as ko,a6 as Af,a7 as es,a8 as Lo,a9 as pe,aa as jo,ab as Eu,ac as Ln,ad as Df,ae as Nf,af as Of,ag as Uf,ah as Bf,ai as kf,aj as Lf,ak as jf,al as wu,am as Mu,an as Ff,ao as bf}from"./index-CMDHR3gR.js";var Tu={exports:{}},Fn={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-reconciler-constants.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/Fn.ConcurrentRoot=1;Fn.ContinuousEventPriority=4;Fn.DefaultEventPriority=16;Fn.DiscreteEventPriority=1;Fn.IdleEventPriority=536870912;Fn.LegacyRoot=0;Tu.exports=Fn;var fr=Tu.exports;function Hf(n){let i;const l=new Set,o=(y,p)=>{const m=typeof y=="function"?y(i):y;if(m!==i){const E=i;i=p?m:Object.assign({},i,m),l.forEach(x=>x(i,E))}},c=()=>i,f=(y,p=c,m=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let E=p(i);function x(){const P=p(i);if(!m(E,P)){const U=E;y(E=P,U)}}return l.add(x),()=>l.delete(x)},v={setState:o,getState:c,subscribe:(y,p,m)=>p||m?f(y,p,m):(l.add(y),()=>l.delete(y)),destroy:()=>l.clear()};return i=n(o,c,v),v}const Gf=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),La=Gf?M.useEffect:M.useLayoutEffect;function Wf(n){const i=typeof n=="function"?Hf(n):n,l=(o=i.getState,c=Object.is)=>{const[,f]=M.useReducer(O=>O+1,0),d=i.getState(),h=M.useRef(d),v=M.useRef(o),y=M.useRef(c),p=M.useRef(!1),m=M.useRef();m.current===void 0&&(m.current=o(d));let E,x=!1;(h.current!==d||v.current!==o||y.current!==c||p.current)&&(E=o(d),x=!c(m.current,E)),La(()=>{x&&(m.current=E),h.current=d,v.current=o,y.current=c,p.current=!1});const P=M.useRef(d);La(()=>{const O=()=>{try{const C=i.getState(),z=v.current(C);y.current(m.current,z)||(h.current=C,m.current=z,f())}catch{p.current=!0,f()}},R=i.subscribe(O);return i.getState()!==P.current&&O(),R},[]);const U=x?E:m.current;return M.useDebugValue(U),U};return Object.assign(l,i),l[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const o=[l,i];return{next(){const c=o.length<=0;return{value:o.shift(),done:c}}}},l}const Vf=n=>typeof n=="object"&&typeof n.then=="function",Nn=[];function _u(n,i,l=(o,c)=>o===c){if(n===i)return!0;if(!n||!i)return!1;const o=n.length;if(i.length!==o)return!1;for(let c=0;c<o;c++)if(!l(n[c],i[c]))return!1;return!0}function Ru(n,i=null,l=!1,o={}){i===null&&(i=[n]);for(const f of Nn)if(_u(i,f.keys,f.equal)){if(l)return;if(Object.prototype.hasOwnProperty.call(f,"error"))throw f.error;if(Object.prototype.hasOwnProperty.call(f,"response"))return o.lifespan&&o.lifespan>0&&(f.timeout&&clearTimeout(f.timeout),f.timeout=setTimeout(f.remove,o.lifespan)),f.response;if(!l)throw f.promise}const c={keys:i,equal:o.equal,remove:()=>{const f=Nn.indexOf(c);f!==-1&&Nn.splice(f,1)},promise:(Vf(n)?n:n(...i)).then(f=>{c.response=f,o.lifespan&&o.lifespan>0&&(c.timeout=setTimeout(c.remove,o.lifespan))}).catch(f=>c.error=f)};if(Nn.push(c),!l)throw c.promise}const Qf=(n,i,l)=>Ru(n,i,!1,l),Yf=(n,i,l)=>void Ru(n,i,!0,l),Xf=n=>{if(n===void 0||n.length===0)Nn.splice(0,Nn.length);else{const i=Nn.find(l=>_u(n,l.keys,l.equal));i&&i.remove()}};var Pu={exports:{}},Cu={exports:{}},Iu={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/(function(n){function i(B,K){var G=B.length;B.push(K);e:for(;0<G;){var q=G-1>>>1,ae=B[q];if(0<c(ae,K))B[q]=K,B[G]=ae,G=q;else break e}}function l(B){return B.length===0?null:B[0]}function o(B){if(B.length===0)return null;var K=B[0],G=B.pop();if(G!==K){B[0]=G;e:for(var q=0,ae=B.length,ie=ae>>>1;q<ie;){var ze=2*(q+1)-1,we=B[ze],Oe=ze+1,Ke=B[Oe];if(0>c(we,G))Oe<ae&&0>c(Ke,we)?(B[q]=Ke,B[Oe]=G,q=Oe):(B[q]=we,B[ze]=G,q=ze);else if(Oe<ae&&0>c(Ke,G))B[q]=Ke,B[Oe]=G,q=Oe;else break e}}return K}function c(B,K){var G=B.sortIndex-K.sortIndex;return G!==0?G:B.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var v=[],y=[],p=1,m=null,E=3,x=!1,P=!1,U=!1,O=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function z(B){for(var K=l(y);K!==null;){if(K.callback===null)o(y);else if(K.startTime<=B)o(y),K.sortIndex=K.expirationTime,i(v,K);else break;K=l(y)}}function H(B){if(U=!1,z(B),!P)if(l(v)!==null)P=!0,_e(j);else{var K=l(y);K!==null&&Ee(H,K.startTime-B)}}function j(B,K){P=!1,U&&(U=!1,R(X),X=-1),x=!0;var G=E;try{for(z(K),m=l(v);m!==null&&(!(m.expirationTime>K)||B&&!N());){var q=m.callback;if(typeof q=="function"){m.callback=null,E=m.priorityLevel;var ae=q(m.expirationTime<=K);K=n.unstable_now(),typeof ae=="function"?m.callback=ae:m===l(v)&&o(v),z(K)}else o(v);m=l(v)}if(m!==null)var ie=!0;else{var ze=l(y);ze!==null&&Ee(H,ze.startTime-K),ie=!1}return ie}finally{m=null,E=G,x=!1}}var k=!1,re=null,X=-1,V=5,F=-1;function N(){return!(n.unstable_now()-F<V)}function $(){if(re!==null){var B=n.unstable_now();F=B;var K=!0;try{K=re(!0,B)}finally{K?se():(k=!1,re=null)}}else k=!1}var se;if(typeof C=="function")se=function(){C($)};else if(typeof MessageChannel<"u"){var Ne=new MessageChannel,he=Ne.port2;Ne.port1.onmessage=$,se=function(){he.postMessage(null)}}else se=function(){O($,0)};function _e(B){re=B,k||(k=!0,se())}function Ee(B,K){X=O(function(){B(n.unstable_now())},K)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(B){B.callback=null},n.unstable_continueExecution=function(){P||x||(P=!0,_e(j))},n.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<B?Math.floor(1e3/B):5},n.unstable_getCurrentPriorityLevel=function(){return E},n.unstable_getFirstCallbackNode=function(){return l(v)},n.unstable_next=function(B){switch(E){case 1:case 2:case 3:var K=3;break;default:K=E}var G=E;E=K;try{return B()}finally{E=G}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(B,K){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var G=E;E=B;try{return K()}finally{E=G}},n.unstable_scheduleCallback=function(B,K,G){var q=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?q+G:q):G=q,B){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=G+ae,B={id:p++,callback:K,priorityLevel:B,startTime:G,expirationTime:ae,sortIndex:-1},G>q?(B.sortIndex=G,i(y,B),l(v)===null&&B===l(y)&&(U?(R(X),X=-1):U=!0,Ee(H,G-q))):(B.sortIndex=ae,i(v,B),P||x||(P=!0,_e(j))),B},n.unstable_shouldYield=N,n.unstable_wrapCallback=function(B){var K=E;return function(){var G=E;E=K;try{return B.apply(this,arguments)}finally{E=G}}}})(Iu);Cu.exports=Iu;var Fo=Cu.exports;/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react-reconciler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Kf=function(i){var l={},o=M,c=Fo,f=Object.assign;function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,v=Symbol.for("react.element"),y=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),P=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),j=Symbol.iterator;function k(e){return e===null||typeof e!="object"?null:(e=j&&e[j]||e["@@iterator"],typeof e=="function"?e:null)}function re(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case y:return"Portal";case E:return"Profiler";case m:return"StrictMode";case O:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case P:return(e.displayName||"Context")+".Consumer";case x:return(e._context.displayName||"Context")+".Provider";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case C:return t=e.displayName||null,t!==null?t:re(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}function X(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(t);case 8:return t===m?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function V(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function F(e){if(V(e)!==e)throw Error(d(188))}function N(e){var t=e.alternate;if(!t){if(t=V(e),t===null)throw Error(d(188));return t!==e?null:e}for(var r=e,s=t;;){var a=r.return;if(a===null)break;var u=a.alternate;if(u===null){if(s=a.return,s!==null){r=s;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===r)return F(a),e;if(u===s)return F(a),t;u=u.sibling}throw Error(d(188))}if(r.return!==s.return)r=a,s=u;else{for(var g=!1,S=a.child;S;){if(S===r){g=!0,r=a,s=u;break}if(S===s){g=!0,s=a,r=u;break}S=S.sibling}if(!g){for(S=u.child;S;){if(S===r){g=!0,r=u,s=a;break}if(S===s){g=!0,s=u,r=a;break}S=S.sibling}if(!g)throw Error(d(189))}}if(r.alternate!==s)throw Error(d(190))}if(r.tag!==3)throw Error(d(188));return r.stateNode.current===r?e:t}function $(e){return e=N(e),e!==null?se(e):null}function se(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=se(e);if(t!==null)return t;e=e.sibling}return null}function Ne(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){if(e.tag!==4){var t=Ne(e);if(t!==null)return t}e=e.sibling}return null}var he=Array.isArray,_e=i.getPublicInstance,Ee=i.getRootHostContext,B=i.getChildHostContext,K=i.prepareForCommit,G=i.resetAfterCommit,q=i.createInstance,ae=i.appendInitialChild,ie=i.finalizeInitialChildren,ze=i.prepareUpdate,we=i.shouldSetTextContent,Oe=i.createTextInstance,Ke=i.scheduleTimeout,Ze=i.cancelTimeout,ot=i.noTimeout,Ue=i.isPrimaryRenderer,ue=i.supportsMutation,Ge=i.supportsPersistence,Re=i.supportsHydration,kt=i.getInstanceFromNode,nn=i.preparePortalMount,mr=i.getCurrentEventPriority,xt=i.detachDeletedInstance,xn=i.supportsMicrotasks,rn=i.scheduleMicrotask,Lt=i.supportsTestSelectors,vr=i.findFiberRoot,bn=i.getBoundingRect,En=i.getTextContent,ht=i.isHiddenSubtree,gr=i.matchAccessibilityRole,yr=i.setFocusIfFocusable,Et=i.setupIntersectionObserver,Sr=i.appendChild,ss=i.appendChildToContainer,os=i.commitTextUpdate,Zr=i.commitMount,ls=i.commitUpdate,as=i.insertBefore,Jr=i.insertInContainerBefore,xr=i.removeChild,_=i.removeChildFromContainer,b=i.resetTextContent,ne=i.hideInstance,me=i.hideTextInstance,Fe=i.unhideInstance,At=i.unhideTextInstance,jt=i.clearContainer,el=i.cloneInstance,Er=i.createContainerChildSet,wt=i.appendChildToContainerChildSet,Dt=i.finalizeContainerChildren,sn=i.replaceContainerChildren,on=i.cloneHiddenInstance,ln=i.cloneHiddenTextInstance,Hn=i.canHydrateInstance,nc=i.canHydrateTextInstance,rc=i.canHydrateSuspenseInstance,tl=i.isSuspenseInstancePending,us=i.isSuspenseInstanceFallback,ic=i.registerSuspenseInstanceRetry,wr=i.getNextHydratableSibling,sc=i.getFirstHydratableChild,oc=i.getFirstHydratableChildWithinContainer,lc=i.getFirstHydratableChildWithinSuspenseInstance,ac=i.hydrateInstance,uc=i.hydrateTextInstance,cc=i.hydrateSuspenseInstance,fc=i.getNextHydratableInstanceAfterSuspenseInstance,nl=i.commitHydratedContainer,dc=i.commitHydratedSuspenseInstance,pc=i.clearSuspenseBoundary,hc=i.clearSuspenseBoundaryFromContainer,mc=i.shouldDeleteUnhydratedTailInstances,vc=i.didNotMatchHydratedContainerTextInstance,gc=i.didNotMatchHydratedTextInstance,cs;function Mr(e){if(cs===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);cs=t&&t[1]||""}return`
|
|
26
|
+
`+cs+e}var fs=!1;function ds(e,t){if(!e||fs)return"";fs=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(L){var s=L}Reflect.construct(e,[],t)}else{try{t.call()}catch(L){s=L}e.call(t.prototype)}else{try{throw Error()}catch(L){s=L}e()}}catch(L){if(L&&s&&typeof L.stack=="string"){for(var a=L.stack.split(`
|
|
27
|
+
`),u=s.stack.split(`
|
|
28
|
+
`),g=a.length-1,S=u.length-1;1<=g&&0<=S&&a[g]!==u[S];)S--;for(;1<=g&&0<=S;g--,S--)if(a[g]!==u[S]){if(g!==1||S!==1)do if(g--,S--,0>S||a[g]!==u[S]){var D=`
|
|
29
|
+
`+a[g].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=g&&0<=S);break}}}finally{fs=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Mr(e):""}var yc=Object.prototype.hasOwnProperty,ps=[],Gn=-1;function an(e){return{current:e}}function Ie(e){0>Gn||(e.current=ps[Gn],ps[Gn]=null,Gn--)}function Pe(e,t){Gn++,ps[Gn]=e.current,e.current=t}var un={},Je=an(un),lt=an(!1),wn=un;function Wn(e,t){var r=e.type.contextTypes;if(!r)return un;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var a={},u;for(u in r)a[u]=t[u];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function at(e){return e=e.childContextTypes,e!=null}function qr(){Ie(lt),Ie(Je)}function rl(e,t,r){if(Je.current!==un)throw Error(d(168));Pe(Je,t),Pe(lt,r)}function il(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var a in s)if(!(a in t))throw Error(d(108,X(e)||"Unknown",a));return f({},r,s)}function $r(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||un,wn=Je.current,Pe(Je,e),Pe(lt,lt.current),!0}function sl(e,t,r){var s=e.stateNode;if(!s)throw Error(d(169));r?(e=il(e,t,wn),s.__reactInternalMemoizedMergedChildContext=e,Ie(lt),Ie(Je),Pe(Je,e)):Ie(lt),Pe(lt,r)}var Nt=Math.clz32?Math.clz32:Ec,Sc=Math.log,xc=Math.LN2;function Ec(e){return e>>>=0,e===0?32:31-(Sc(e)/xc|0)|0}var ei=64,ti=4194304;function Tr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ni(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,a=e.suspendedLanes,u=e.pingedLanes,g=r&268435455;if(g!==0){var S=g&~a;S!==0?s=Tr(S):(u&=g,u!==0&&(s=Tr(u)))}else g=r&~a,g!==0?s=Tr(g):u!==0&&(s=Tr(u));if(s===0)return 0;if(t!==0&&t!==s&&!(t&a)&&(a=s&-s,u=t&-t,a>=u||a===16&&(u&4194240)!==0))return t;if(s&4&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-Nt(t),a=1<<r,s|=e[r],t&=~a;return s}function wc(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;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 Mc(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes;0<u;){var g=31-Nt(u),S=1<<g,D=a[g];D===-1?(!(S&r)||S&s)&&(a[g]=wc(S,t)):D<=t&&(e.expiredLanes|=S),u&=~S}}function hs(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ms(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function _r(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=r}function Tc(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-Nt(r),u=1<<a;t[a]=0,s[a]=-1,e[a]=-1,r&=~u}}function vs(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-Nt(r),a=1<<s;a&t|e[s]&t&&(e[s]|=t),r&=~a}}var ve=0;function ol(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var gs=c.unstable_scheduleCallback,ll=c.unstable_cancelCallback,_c=c.unstable_shouldYield,Rc=c.unstable_requestPaint,Ve=c.unstable_now,ys=c.unstable_ImmediatePriority,Pc=c.unstable_UserBlockingPriority,Ss=c.unstable_NormalPriority,Cc=c.unstable_IdlePriority,ri=null,Ft=null;function Ic(e){if(Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(ri,e,void 0,(e.current.flags&128)===128)}catch{}}function zc(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:zc,Xt=null,ii=!1,xs=!1;function al(e){Xt===null?Xt=[e]:Xt.push(e)}function Ac(e){ii=!0,al(e)}function Ht(){if(!xs&&Xt!==null){xs=!0;var e=0,t=ve;try{var r=Xt;for(ve=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}Xt=null,ii=!1}catch(a){throw Xt!==null&&(Xt=Xt.slice(e+1)),gs(ys,Ht),a}finally{ve=t,xs=!1}}return null}var Dc=h.ReactCurrentBatchConfig;function si(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var a=r[s];if(!yc.call(t,a)||!bt(e[a],t[a]))return!1}return!0}function Nc(e){switch(e.tag){case 5:return Mr(e.type);case 16:return Mr("Lazy");case 13:return Mr("Suspense");case 19:return Mr("SuspenseList");case 0:case 2:case 15:return e=ds(e.type,!1),e;case 11:return e=ds(e.type.render,!1),e;case 1:return e=ds(e.type,!0),e;default:return""}}function Ot(e,t){if(e&&e.defaultProps){t=f({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var oi=an(null),li=null,Vn=null,Es=null;function ws(){Es=Vn=li=null}function ul(e,t,r){Ue?(Pe(oi,t._currentValue),t._currentValue=r):(Pe(oi,t._currentValue2),t._currentValue2=r)}function Ms(e){var t=oi.current;Ie(oi),Ue?e._currentValue=t:e._currentValue2=t}function Ts(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function Qn(e,t){li=e,Es=Vn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gt=!0),e.firstContext=null)}function Mt(e){var t=Ue?e._currentValue:e._currentValue2;if(Es!==e)if(e={context:e,memoizedValue:t,next:null},Vn===null){if(li===null)throw Error(d(308));Vn=e,li.dependencies={lanes:0,firstContext:e}}else Vn=Vn.next=e;return t}var Gt=null,cn=!1;function _s(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cl(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fn(e,t){var r=e.updateQueue;r!==null&&(r=r.shared,be!==null&&e.mode&1&&!(fe&2)?(e=r.interleaved,e===null?(t.next=t,Gt===null?Gt=[r]:Gt.push(r)):(t.next=e.next,e.next=t),r.interleaved=t):(e=r.pending,e===null?t.next=t:(t.next=e.next,e.next=t),r.pending=t))}function ai(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,vs(e,r)}}function fl(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var a=null,u=null;if(r=r.firstBaseUpdate,r!==null){do{var g={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};u===null?a=u=g:u=u.next=g,r=r.next}while(r!==null);u===null?a=u=t:u=u.next=t}else a=u=t;r={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ui(e,t,r,s){var a=e.updateQueue;cn=!1;var u=a.firstBaseUpdate,g=a.lastBaseUpdate,S=a.shared.pending;if(S!==null){a.shared.pending=null;var D=S,L=D.next;D.next=null,g===null?u=L:g.next=L,g=D;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,S=Y.lastBaseUpdate,S!==g&&(S===null?Y.firstBaseUpdate=L:S.next=L,Y.lastBaseUpdate=D))}if(u!==null){var oe=a.baseState;g=0,Y=L=D=null,S=u;do{var ee=S.lane,Te=S.eventTime;if((s&ee)===ee){Y!==null&&(Y=Y.next={eventTime:Te,lane:0,tag:S.tag,payload:S.payload,callback:S.callback,next:null});e:{var J=e,tt=S;switch(ee=t,Te=r,tt.tag){case 1:if(J=tt.payload,typeof J=="function"){oe=J.call(Te,oe,ee);break e}oe=J;break e;case 3:J.flags=J.flags&-65537|128;case 0:if(J=tt.payload,ee=typeof J=="function"?J.call(Te,oe,ee):J,ee==null)break e;oe=f({},oe,ee);break e;case 2:cn=!0}}S.callback!==null&&S.lane!==0&&(e.flags|=64,ee=a.effects,ee===null?a.effects=[S]:ee.push(S))}else Te={eventTime:Te,lane:ee,tag:S.tag,payload:S.payload,callback:S.callback,next:null},Y===null?(L=Y=Te,D=oe):Y=Y.next=Te,g|=ee;if(S=S.next,S===null){if(S=a.shared.pending,S===null)break;ee=S,S=ee.next,ee.next=null,a.lastBaseUpdate=ee,a.shared.pending=null}}while(!0);if(Y===null&&(D=oe),a.baseState=D,a.firstBaseUpdate=L,a.lastBaseUpdate=Y,t=a.shared.interleaved,t!==null){a=t;do g|=a.lane,a=a.next;while(a!==t)}else u===null&&(a.shared.lanes=0);tr|=g,e.lanes=g,e.memoizedState=oe}}function dl(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],a=s.callback;if(a!==null){if(s.callback=null,s=r,typeof a!="function")throw Error(d(191,a));a.call(s)}}}var pl=new o.Component().refs;function Rs(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:f({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ci={isMounted:function(e){return(e=e._reactInternals)?V(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=st(),a=hn(e),u=Kt(s,a);u.payload=t,r!=null&&(u.callback=r),fn(e,u),t=Ct(e,a,s),t!==null&&ai(t,e,a)},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=st(),a=hn(e),u=Kt(s,a);u.tag=1,u.payload=t,r!=null&&(u.callback=r),fn(e,u),t=Ct(e,a,s),t!==null&&ai(t,e,a)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=st(),s=hn(e),a=Kt(r,s);a.tag=2,t!=null&&(a.callback=t),fn(e,a),t=Ct(e,s,r),t!==null&&ai(t,e,s)}};function hl(e,t,r,s,a,u,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,u,g):t.prototype&&t.prototype.isPureReactComponent?!si(r,s)||!si(a,u):!0}function ml(e,t,r){var s=!1,a=un,u=t.contextType;return typeof u=="object"&&u!==null?u=Mt(u):(a=at(t)?wn:Je.current,s=t.contextTypes,u=(s=s!=null)?Wn(e,a):un),t=new t(r,u),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ci,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=u),t}function vl(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&ci.enqueueReplaceState(t,t.state,null)}function Ps(e,t,r,s){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs=pl,_s(e);var u=t.contextType;typeof u=="object"&&u!==null?a.context=Mt(u):(u=at(t)?wn:Je.current,a.context=Wn(e,u)),a.state=e.memoizedState,u=t.getDerivedStateFromProps,typeof u=="function"&&(Rs(e,t,u,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&ci.enqueueReplaceState(a,a.state,null),ui(e,r,a,s),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}var Yn=[],Xn=0,fi=null,di=0,Tt=[],_t=0,Mn=null,Zt=1,Jt="";function Tn(e,t){Yn[Xn++]=di,Yn[Xn++]=fi,fi=e,di=t}function gl(e,t,r){Tt[_t++]=Zt,Tt[_t++]=Jt,Tt[_t++]=Mn,Mn=e;var s=Zt;e=Jt;var a=32-Nt(s)-1;s&=~(1<<a),r+=1;var u=32-Nt(t)+a;if(30<u){var g=a-a%5;u=(s&(1<<g)-1).toString(32),s>>=g,a-=g,Zt=1<<32-Nt(t)+a|r<<a|s,Jt=u+e}else Zt=1<<u|r<<a|s,Jt=e}function Cs(e){e.return!==null&&(Tn(e,1),gl(e,1,0))}function Is(e){for(;e===fi;)fi=Yn[--Xn],Yn[Xn]=null,di=Yn[--Xn],Yn[Xn]=null;for(;e===Mn;)Mn=Tt[--_t],Tt[_t]=null,Jt=Tt[--_t],Tt[_t]=null,Zt=Tt[--_t],Tt[_t]=null}var mt=null,vt=null,Ae=!1,Rr=!1,Ut=null;function yl(e,t){var r=It(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Sl(e,t){switch(e.tag){case 5:return t=Hn(t,e.type,e.pendingProps),t!==null?(e.stateNode=t,mt=e,vt=sc(t),!0):!1;case 6:return t=nc(t,e.pendingProps),t!==null?(e.stateNode=t,mt=e,vt=null,!0):!1;case 13:if(t=rc(t),t!==null){var r=Mn!==null?{id:Zt,overflow:Jt}:null;return e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=It(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,mt=e,vt=null,!0}return!1;default:return!1}}function zs(e){return(e.mode&1)!==0&&(e.flags&128)===0}function As(e){if(Ae){var t=vt;if(t){var r=t;if(!Sl(e,t)){if(zs(e))throw Error(d(418));t=wr(r);var s=mt;t&&Sl(e,t)?yl(s,r):(e.flags=e.flags&-4097|2,Ae=!1,mt=e)}}else{if(zs(e))throw Error(d(418));e.flags=e.flags&-4097|2,Ae=!1,mt=e}}}function xl(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;mt=e}function Pr(e){if(!Re||e!==mt)return!1;if(!Ae)return xl(e),Ae=!0,!1;if(e.tag!==3&&(e.tag!==5||mc(e.type)&&!we(e.type,e.memoizedProps))){var t=vt;if(t){if(zs(e)){for(e=vt;e;)e=wr(e);throw Error(d(418))}for(;t;)yl(e,t),t=wr(t)}}if(xl(e),e.tag===13){if(!Re)throw Error(d(316));if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));vt=fc(e)}else vt=mt?wr(e.stateNode):null;return!0}function Kn(){Re&&(vt=mt=null,Rr=Ae=!1)}function Ds(e){Ut===null?Ut=[e]:Ut.push(e)}function Cr(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(d(309));var s=r.stateNode}if(!s)throw Error(d(147,e));var a=s,u=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===u?t.ref:(t=function(g){var S=a.refs;S===pl&&(S=a.refs={}),g===null?delete S[u]:S[u]=g},t._stringRef=u,t)}if(typeof e!="string")throw Error(d(284));if(!r._owner)throw Error(d(290,e))}return e}function pi(e,t){throw e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function El(e){var t=e._init;return t(e._payload)}function wl(e){function t(I,w){if(e){var A=I.deletions;A===null?(I.deletions=[w],I.flags|=16):A.push(w)}}function r(I,w){if(!e)return null;for(;w!==null;)t(I,w),w=w.sibling;return null}function s(I,w){for(I=new Map;w!==null;)w.key!==null?I.set(w.key,w):I.set(w.index,w),w=w.sibling;return I}function a(I,w){return I=vn(I,w),I.index=0,I.sibling=null,I}function u(I,w,A){return I.index=A,e?(A=I.alternate,A!==null?(A=A.index,A<w?(I.flags|=2,w):A):(I.flags|=2,w)):(I.flags|=1048576,w)}function g(I){return e&&I.alternate===null&&(I.flags|=2),I}function S(I,w,A,Q){return w===null||w.tag!==6?(w=vo(A,I.mode,Q),w.return=I,w):(w=a(w,A),w.return=I,w)}function D(I,w,A,Q){var Z=A.type;return Z===p?Y(I,w,A.props.children,Q,A.key):w!==null&&(w.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===z&&El(Z)===w.type)?(Q=a(w,A.props),Q.ref=Cr(I,w,A),Q.return=I,Q):(Q=Wi(A.type,A.key,A.props,null,I.mode,Q),Q.ref=Cr(I,w,A),Q.return=I,Q)}function L(I,w,A,Q){return w===null||w.tag!==4||w.stateNode.containerInfo!==A.containerInfo||w.stateNode.implementation!==A.implementation?(w=go(A,I.mode,Q),w.return=I,w):(w=a(w,A.children||[]),w.return=I,w)}function Y(I,w,A,Q,Z){return w===null||w.tag!==7?(w=An(A,I.mode,Q,Z),w.return=I,w):(w=a(w,A),w.return=I,w)}function oe(I,w,A){if(typeof w=="string"&&w!==""||typeof w=="number")return w=vo(""+w,I.mode,A),w.return=I,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case v:return A=Wi(w.type,w.key,w.props,null,I.mode,A),A.ref=Cr(I,null,w),A.return=I,A;case y:return w=go(w,I.mode,A),w.return=I,w;case z:var Q=w._init;return oe(I,Q(w._payload),A)}if(he(w)||k(w))return w=An(w,I.mode,A,null),w.return=I,w;pi(I,w)}return null}function ee(I,w,A,Q){var Z=w!==null?w.key:null;if(typeof A=="string"&&A!==""||typeof A=="number")return Z!==null?null:S(I,w,""+A,Q);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case v:return A.key===Z?D(I,w,A,Q):null;case y:return A.key===Z?L(I,w,A,Q):null;case z:return Z=A._init,ee(I,w,Z(A._payload),Q)}if(he(A)||k(A))return Z!==null?null:Y(I,w,A,Q,null);pi(I,A)}return null}function Te(I,w,A,Q,Z){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return I=I.get(A)||null,S(w,I,""+Q,Z);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return I=I.get(Q.key===null?A:Q.key)||null,D(w,I,Q,Z);case y:return I=I.get(Q.key===null?A:Q.key)||null,L(w,I,Q,Z);case z:var ce=Q._init;return Te(I,w,A,ce(Q._payload),Z)}if(he(Q)||k(Q))return I=I.get(A)||null,Y(w,I,Q,Z,null);pi(w,Q)}return null}function J(I,w,A,Q){for(var Z=null,ce=null,le=w,ge=w=0,Ye=null;le!==null&&ge<A.length;ge++){le.index>ge?(Ye=le,le=null):Ye=le.sibling;var ye=ee(I,le,A[ge],Q);if(ye===null){le===null&&(le=Ye);break}e&&le&&ye.alternate===null&&t(I,le),w=u(ye,w,ge),ce===null?Z=ye:ce.sibling=ye,ce=ye,le=Ye}if(ge===A.length)return r(I,le),Ae&&Tn(I,ge),Z;if(le===null){for(;ge<A.length;ge++)le=oe(I,A[ge],Q),le!==null&&(w=u(le,w,ge),ce===null?Z=le:ce.sibling=le,ce=le);return Ae&&Tn(I,ge),Z}for(le=s(I,le);ge<A.length;ge++)Ye=Te(le,I,ge,A[ge],Q),Ye!==null&&(e&&Ye.alternate!==null&&le.delete(Ye.key===null?ge:Ye.key),w=u(Ye,w,ge),ce===null?Z=Ye:ce.sibling=Ye,ce=Ye);return e&&le.forEach(function(gn){return t(I,gn)}),Ae&&Tn(I,ge),Z}function tt(I,w,A,Q){var Z=k(A);if(typeof Z!="function")throw Error(d(150));if(A=Z.call(A),A==null)throw Error(d(151));for(var ce=Z=null,le=w,ge=w=0,Ye=null,ye=A.next();le!==null&&!ye.done;ge++,ye=A.next()){le.index>ge?(Ye=le,le=null):Ye=le.sibling;var gn=ee(I,le,ye.value,Q);if(gn===null){le===null&&(le=Ye);break}e&&le&&gn.alternate===null&&t(I,le),w=u(gn,w,ge),ce===null?Z=gn:ce.sibling=gn,ce=gn,le=Ye}if(ye.done)return r(I,le),Ae&&Tn(I,ge),Z;if(le===null){for(;!ye.done;ge++,ye=A.next())ye=oe(I,ye.value,Q),ye!==null&&(w=u(ye,w,ge),ce===null?Z=ye:ce.sibling=ye,ce=ye);return Ae&&Tn(I,ge),Z}for(le=s(I,le);!ye.done;ge++,ye=A.next())ye=Te(le,I,ge,ye.value,Q),ye!==null&&(e&&ye.alternate!==null&&le.delete(ye.key===null?ge:ye.key),w=u(ye,w,ge),ce===null?Z=ye:ce.sibling=ye,ce=ye);return e&&le.forEach(function(cf){return t(I,cf)}),Ae&&Tn(I,ge),Z}function zt(I,w,A,Q){if(typeof A=="object"&&A!==null&&A.type===p&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case v:e:{for(var Z=A.key,ce=w;ce!==null;){if(ce.key===Z){if(Z=A.type,Z===p){if(ce.tag===7){r(I,ce.sibling),w=a(ce,A.props.children),w.return=I,I=w;break e}}else if(ce.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===z&&El(Z)===ce.type){r(I,ce.sibling),w=a(ce,A.props),w.ref=Cr(I,ce,A),w.return=I,I=w;break e}r(I,ce);break}else t(I,ce);ce=ce.sibling}A.type===p?(w=An(A.props.children,I.mode,Q,A.key),w.return=I,I=w):(Q=Wi(A.type,A.key,A.props,null,I.mode,Q),Q.ref=Cr(I,w,A),Q.return=I,I=Q)}return g(I);case y:e:{for(ce=A.key;w!==null;){if(w.key===ce)if(w.tag===4&&w.stateNode.containerInfo===A.containerInfo&&w.stateNode.implementation===A.implementation){r(I,w.sibling),w=a(w,A.children||[]),w.return=I,I=w;break e}else{r(I,w);break}else t(I,w);w=w.sibling}w=go(A,I.mode,Q),w.return=I,I=w}return g(I);case z:return ce=A._init,zt(I,w,ce(A._payload),Q)}if(he(A))return J(I,w,A,Q);if(k(A))return tt(I,w,A,Q);pi(I,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,w!==null&&w.tag===6?(r(I,w.sibling),w=a(w,A),w.return=I,I=w):(r(I,w),w=vo(A,I.mode,Q),w.return=I,I=w),g(I)):r(I,w)}return zt}var Zn=wl(!0),Ml=wl(!1),Ir={},Rt=an(Ir),zr=an(Ir),Jn=an(Ir);function Wt(e){if(e===Ir)throw Error(d(174));return e}function Ns(e,t){Pe(Jn,t),Pe(zr,e),Pe(Rt,Ir),e=Ee(t),Ie(Rt),Pe(Rt,e)}function qn(){Ie(Rt),Ie(zr),Ie(Jn)}function Tl(e){var t=Wt(Jn.current),r=Wt(Rt.current);t=B(r,e.type,t),r!==t&&(Pe(zr,e),Pe(Rt,t))}function Os(e){zr.current===e&&(Ie(Rt),Ie(zr))}var Be=an(0);function hi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||tl(r)||us(r)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Us=[];function Bs(){for(var e=0;e<Us.length;e++){var t=Us[e];Ue?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}Us.length=0}var mi=h.ReactCurrentDispatcher,Pt=h.ReactCurrentBatchConfig,$n=0,ke=null,qe=null,Qe=null,vi=!1,Ar=!1,Dr=0,Oc=0;function $e(){throw Error(d(321))}function ks(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!bt(e[r],t[r]))return!1;return!0}function Ls(e,t,r,s,a,u){if($n=u,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,mi.current=e===null||e.memoizedState===null?Lc:jc,e=r(s,a),Ar){u=0;do{if(Ar=!1,Dr=0,25<=u)throw Error(d(301));u+=1,Qe=qe=null,t.updateQueue=null,mi.current=Fc,e=r(s,a)}while(Ar)}if(mi.current=Ei,t=qe!==null&&qe.next!==null,$n=0,Qe=qe=ke=null,vi=!1,t)throw Error(d(300));return e}function js(){var e=Dr!==0;return Dr=0,e}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?ke.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Vt(){if(qe===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=Qe===null?ke.memoizedState:Qe.next;if(t!==null)Qe=t,qe=e;else{if(e===null)throw Error(d(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},Qe===null?ke.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function _n(e,t){return typeof t=="function"?t(e):t}function gi(e){var t=Vt(),r=t.queue;if(r===null)throw Error(d(311));r.lastRenderedReducer=e;var s=qe,a=s.baseQueue,u=r.pending;if(u!==null){if(a!==null){var g=a.next;a.next=u.next,u.next=g}s.baseQueue=a=u,r.pending=null}if(a!==null){u=a.next,s=s.baseState;var S=g=null,D=null,L=u;do{var Y=L.lane;if(($n&Y)===Y)D!==null&&(D=D.next={lane:0,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),s=L.hasEagerState?L.eagerState:e(s,L.action);else{var oe={lane:Y,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null};D===null?(S=D=oe,g=s):D=D.next=oe,ke.lanes|=Y,tr|=Y}L=L.next}while(L!==null&&L!==u);D===null?g=s:D.next=S,bt(s,t.memoizedState)||(gt=!0),t.memoizedState=s,t.baseState=g,t.baseQueue=D,r.lastRenderedState=s}if(e=r.interleaved,e!==null){a=e;do u=a.lane,ke.lanes|=u,tr|=u,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function yi(e){var t=Vt(),r=t.queue;if(r===null)throw Error(d(311));r.lastRenderedReducer=e;var s=r.dispatch,a=r.pending,u=t.memoizedState;if(a!==null){r.pending=null;var g=a=a.next;do u=e(u,g.action),g=g.next;while(g!==a);bt(u,t.memoizedState)||(gt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),r.lastRenderedState=u}return[u,s]}function _l(){}function Rl(e,t){var r=ke,s=Vt(),a=t(),u=!bt(s.memoizedState,a);if(u&&(s.memoizedState=a,gt=!0),s=s.queue,Or(Il.bind(null,r,s,e),[e]),s.getSnapshot!==t||u||Qe!==null&&Qe.memoizedState.tag&1){if(r.flags|=2048,Nr(9,Cl.bind(null,r,s,a,t),void 0,null),be===null)throw Error(d(349));$n&30||Pl(r,t,a)}return a}function Pl(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Cl(e,t,r,s){t.value=r,t.getSnapshot=s,zl(t)&&Ct(e,1,-1)}function Il(e,t,r){return r(function(){zl(t)&&Ct(e,1,-1)})}function zl(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!bt(e,r)}catch{return!0}}function Fs(e){var t=qt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_n,lastRenderedState:e},t.queue=e,e=e.dispatch=kc.bind(null,ke,e),[t.memoizedState,e]}function Nr(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e)),e}function Al(){return Vt().memoizedState}function Si(e,t,r,s){var a=qt();ke.flags|=e,a.memoizedState=Nr(1|t,r,void 0,s===void 0?null:s)}function xi(e,t,r,s){var a=Vt();s=s===void 0?null:s;var u=void 0;if(qe!==null){var g=qe.memoizedState;if(u=g.destroy,s!==null&&ks(s,g.deps)){a.memoizedState=Nr(t,r,u,s);return}}ke.flags|=e,a.memoizedState=Nr(1|t,r,u,s)}function bs(e,t){return Si(8390656,8,e,t)}function Or(e,t){return xi(2048,8,e,t)}function Dl(e,t){return xi(4,2,e,t)}function Nl(e,t){return xi(4,4,e,t)}function Ol(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ul(e,t,r){return r=r!=null?r.concat([e]):null,xi(4,4,Ol.bind(null,t,e),r)}function Hs(){}function Bl(e,t){var r=Vt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&ks(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function kl(e,t){var r=Vt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&ks(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function Uc(e,t){var r=ve;ve=r!==0&&4>r?r:4,e(!0);var s=Pt.transition;Pt.transition={};try{e(!1),t()}finally{ve=r,Pt.transition=s}}function Ll(){return Vt().memoizedState}function Bc(e,t,r){var s=hn(e);r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},jl(e)?Fl(t,r):(bl(e,t,r),r=st(),e=Ct(e,s,r),e!==null&&Hl(e,t,s))}function kc(e,t,r){var s=hn(e),a={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(jl(e))Fl(t,a);else{bl(e,t,a);var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var g=t.lastRenderedState,S=u(g,r);if(a.hasEagerState=!0,a.eagerState=S,bt(S,g))return}catch{}finally{}r=st(),e=Ct(e,s,r),e!==null&&Hl(e,t,s)}}function jl(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Fl(e,t){Ar=vi=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function bl(e,t,r){be!==null&&e.mode&1&&!(fe&2)?(e=t.interleaved,e===null?(r.next=r,Gt===null?Gt=[t]:Gt.push(t)):(r.next=e.next,e.next=r),t.interleaved=r):(e=t.pending,e===null?r.next=r:(r.next=e.next,e.next=r),t.pending=r)}function Hl(e,t,r){if(r&4194240){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,vs(e,r)}}var Ei={readContext:Mt,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},Lc={readContext:Mt,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:bs,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Si(4194308,4,Ol.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Si(4194308,4,e,t)},useInsertionEffect:function(e,t){return Si(4,2,e,t)},useMemo:function(e,t){var r=qt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=qt();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=Bc.bind(null,ke,e),[s.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:Fs,useDebugValue:Hs,useDeferredValue:function(e){var t=Fs(e),r=t[0],s=t[1];return bs(function(){var a=Pt.transition;Pt.transition={};try{s(e)}finally{Pt.transition=a}},[e]),r},useTransition:function(){var e=Fs(!1),t=e[0];return e=Uc.bind(null,e[1]),qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=ke,a=qt();if(Ae){if(r===void 0)throw Error(d(407));r=r()}else{if(r=t(),be===null)throw Error(d(349));$n&30||Pl(s,t,r)}a.memoizedState=r;var u={value:r,getSnapshot:t};return a.queue=u,bs(Il.bind(null,s,u,e),[e]),s.flags|=2048,Nr(9,Cl.bind(null,s,u,r,t),void 0,null),r},useId:function(){var e=qt(),t=be.identifierPrefix;if(Ae){var r=Jt,s=Zt;r=(s&~(1<<32-Nt(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=Dr++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Oc++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},jc={readContext:Mt,useCallback:Bl,useContext:Mt,useEffect:Or,useImperativeHandle:Ul,useInsertionEffect:Dl,useLayoutEffect:Nl,useMemo:kl,useReducer:gi,useRef:Al,useState:function(){return gi(_n)},useDebugValue:Hs,useDeferredValue:function(e){var t=gi(_n),r=t[0],s=t[1];return Or(function(){var a=Pt.transition;Pt.transition={};try{s(e)}finally{Pt.transition=a}},[e]),r},useTransition:function(){var e=gi(_n)[0],t=Vt().memoizedState;return[e,t]},useMutableSource:_l,useSyncExternalStore:Rl,useId:Ll,unstable_isNewReconciler:!1},Fc={readContext:Mt,useCallback:Bl,useContext:Mt,useEffect:Or,useImperativeHandle:Ul,useInsertionEffect:Dl,useLayoutEffect:Nl,useMemo:kl,useReducer:yi,useRef:Al,useState:function(){return yi(_n)},useDebugValue:Hs,useDeferredValue:function(e){var t=yi(_n),r=t[0],s=t[1];return Or(function(){var a=Pt.transition;Pt.transition={};try{s(e)}finally{Pt.transition=a}},[e]),r},useTransition:function(){var e=yi(_n)[0],t=Vt().memoizedState;return[e,t]},useMutableSource:_l,useSyncExternalStore:Rl,useId:Ll,unstable_isNewReconciler:!1};function Gs(e,t){try{var r="",s=t;do r+=Nc(s),s=s.return;while(s);var a=r}catch(u){a=`
|
|
30
|
+
Error generating stack: `+u.message+`
|
|
31
|
+
`+u.stack}return{value:e,source:t,stack:a}}function Ws(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var bc=typeof WeakMap=="function"?WeakMap:Map;function Gl(e,t,r){r=Kt(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){ki||(ki=!0,ao=s),Ws(e,t)},r}function Wl(e,t,r){r=Kt(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var a=t.value;r.payload=function(){return s(a)},r.callback=function(){Ws(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(r.callback=function(){Ws(e,t),typeof s!="function"&&(dn===null?dn=new Set([this]):dn.add(this));var g=t.stack;this.componentDidCatch(t.value,{componentStack:g!==null?g:""})}),r}function Vl(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new bc;var a=new Set;s.set(t,a)}else a=s.get(t),a===void 0&&(a=new Set,s.set(t,a));a.has(r)||(a.add(r),e=tf.bind(null,e,t,r),t.then(e,e))}function Ql(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Yl(e,t,r,s,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Kt(-1,1),t.tag=2,fn(r,t))),r.lanes|=1),e)}function Qt(e){e.flags|=4}function Xl(e,t){if(e!==null&&e.child===t.child)return!0;if(t.flags&16)return!1;for(e=t.child;e!==null;){if(e.flags&12854||e.subtreeFlags&12854)return!1;e=e.sibling}return!0}var Ur,Br,wi,Mi;if(ue)Ur=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)ae(e,r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Br=function(){},wi=function(e,t,r,s,a){if(e=e.memoizedProps,e!==s){var u=t.stateNode,g=Wt(Rt.current);r=ze(u,r,e,s,a,g),(t.updateQueue=r)&&Qt(t)}},Mi=function(e,t,r,s){r!==s&&Qt(t)};else if(Ge){Ur=function(e,t,r,s){for(var a=t.child;a!==null;){if(a.tag===5){var u=a.stateNode;r&&s&&(u=on(u,a.type,a.memoizedProps,a)),ae(e,u)}else if(a.tag===6)u=a.stateNode,r&&s&&(u=ln(u,a.memoizedProps,a)),ae(e,u);else if(a.tag!==4){if(a.tag===22&&a.memoizedState!==null)u=a.child,u!==null&&(u.return=a),Ur(e,a,!0,!0);else if(a.child!==null){a.child.return=a,a=a.child;continue}}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};var Kl=function(e,t,r,s){for(var a=t.child;a!==null;){if(a.tag===5){var u=a.stateNode;r&&s&&(u=on(u,a.type,a.memoizedProps,a)),wt(e,u)}else if(a.tag===6)u=a.stateNode,r&&s&&(u=ln(u,a.memoizedProps,a)),wt(e,u);else if(a.tag!==4){if(a.tag===22&&a.memoizedState!==null)u=a.child,u!==null&&(u.return=a),Kl(e,a,!0,!0);else if(a.child!==null){a.child.return=a,a=a.child;continue}}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};Br=function(e,t){var r=t.stateNode;if(!Xl(e,t)){e=r.containerInfo;var s=Er(e);Kl(s,t,!1,!1),r.pendingChildren=s,Qt(t),Dt(e,s)}},wi=function(e,t,r,s,a){var u=e.stateNode,g=e.memoizedProps;if((e=Xl(e,t))&&g===s)t.stateNode=u;else{var S=t.stateNode,D=Wt(Rt.current),L=null;g!==s&&(L=ze(S,r,g,s,a,D)),e&&L===null?t.stateNode=u:(u=el(u,L,r,g,s,t,e,S),ie(u,r,s,a,D)&&Qt(t),t.stateNode=u,e?Qt(t):Ur(u,t,!1,!1))}},Mi=function(e,t,r,s){r!==s?(e=Wt(Jn.current),r=Wt(Rt.current),t.stateNode=Oe(s,e,r,t),Qt(t)):t.stateNode=e.stateNode}}else Br=function(){},wi=function(){},Mi=function(){};function kr(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,s|=a.subtreeFlags&14680064,s|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,s|=a.subtreeFlags,s|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function Hc(e,t,r){var s=t.pendingProps;switch(Is(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return at(t.type)&&qr(),et(t),null;case 3:return s=t.stateNode,qn(),Ie(lt),Ie(Je),Bs(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Pr(t)?Qt(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ut!==null&&(fo(Ut),Ut=null))),Br(e,t),et(t),null;case 5:Os(t),r=Wt(Jn.current);var a=t.type;if(e!==null&&t.stateNode!=null)wi(e,t,a,s,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(d(166));return et(t),null}if(e=Wt(Rt.current),Pr(t)){if(!Re)throw Error(d(175));e=ac(t.stateNode,t.type,t.memoizedProps,r,e,t,!Rr),t.updateQueue=e,e!==null&&Qt(t)}else{var u=q(a,s,r,e,t);Ur(u,t,!1,!1),t.stateNode=u,ie(u,a,s,r,e)&&Qt(t)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return et(t),null;case 6:if(e&&t.stateNode!=null)Mi(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(d(166));if(e=Wt(Jn.current),r=Wt(Rt.current),Pr(t)){if(!Re)throw Error(d(176));if(e=t.stateNode,s=t.memoizedProps,(r=uc(e,s,t,!Rr))&&(a=mt,a!==null))switch(u=(a.mode&1)!==0,a.tag){case 3:vc(a.stateNode.containerInfo,e,s,u);break;case 5:gc(a.type,a.memoizedProps,a.stateNode,e,s,u)}r&&Qt(t)}else t.stateNode=Oe(s,e,r,t)}return et(t),null;case 13:if(Ie(Be),s=t.memoizedState,Ae&&vt!==null&&t.mode&1&&!(t.flags&128)){for(e=vt;e;)e=wr(e);return Kn(),t.flags|=98560,t}if(s!==null&&s.dehydrated!==null){if(s=Pr(t),e===null){if(!s)throw Error(d(318));if(!Re)throw Error(d(344));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));cc(e,t)}else Kn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;return et(t),null}return Ut!==null&&(fo(Ut),Ut=null),t.flags&128?(t.lanes=r,t):(s=s!==null,r=!1,e===null?Pr(t):r=e.memoizedState!==null,s&&!r&&(t.child.flags|=8192,t.mode&1&&(e===null||Be.current&1?We===0&&(We=3):ho())),t.updateQueue!==null&&(t.flags|=4),et(t),null);case 4:return qn(),Br(e,t),e===null&&nn(t.stateNode.containerInfo),et(t),null;case 10:return Ms(t.type._context),et(t),null;case 17:return at(t.type)&&qr(),et(t),null;case 19:if(Ie(Be),a=t.memoizedState,a===null)return et(t),null;if(s=(t.flags&128)!==0,u=a.rendering,u===null)if(s)kr(a,!1);else{if(We!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(u=hi(e),u!==null){for(t.flags|=128,kr(a,!1),e=u.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=r,s=t.child;s!==null;)r=s,a=e,r.flags&=14680066,u=r.alternate,u===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,a=u.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),s=s.sibling;return Pe(Be,Be.current&1|2),t.child}e=e.sibling}a.tail!==null&&Ve()>lo&&(t.flags|=128,s=!0,kr(a,!1),t.lanes=4194304)}else{if(!s)if(e=hi(u),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),kr(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!Ae)return et(t),null}else 2*Ve()-a.renderingStartTime>lo&&r!==1073741824&&(t.flags|=128,s=!0,kr(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ve(),t.sibling=null,e=Be.current,Pe(Be,s?e&1|2:e&1),t):(et(t),null);case 22:case 23:return po(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?yt&1073741824&&(et(t),ue&&t.subtreeFlags&6&&(t.flags|=8192)):et(t),null;case 24:return null;case 25:return null}throw Error(d(156,t.tag))}var Gc=h.ReactCurrentOwner,gt=!1;function it(e,t,r,s){t.child=e===null?Ml(t,null,r,s):Zn(t,e.child,r,s)}function Zl(e,t,r,s,a){r=r.render;var u=t.ref;return Qn(t,a),s=Ls(e,t,r,s,u,a),r=js(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,$t(e,t,a)):(Ae&&r&&Cs(t),t.flags|=1,it(e,t,s,a),t.child)}function Jl(e,t,r,s,a){if(e===null){var u=r.type;return typeof u=="function"&&!mo(u)&&u.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=u,ql(e,t,u,s,a)):(e=Wi(r.type,null,s,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!(e.lanes&a)){var g=u.memoizedProps;if(r=r.compare,r=r!==null?r:si,r(g,s)&&e.ref===t.ref)return $t(e,t,a)}return t.flags|=1,e=vn(u,s),e.ref=t.ref,e.return=t,t.child=e}function ql(e,t,r,s,a){if(e!==null&&si(e.memoizedProps,s)&&e.ref===t.ref)if(gt=!1,(e.lanes&a)!==0)e.flags&131072&&(gt=!0);else return t.lanes=e.lanes,$t(e,t,a);return Vs(e,t,r,s,a)}function $l(e,t,r){var s=t.pendingProps,a=s.children,u=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null},Pe(er,yt),yt|=r;else if(r&1073741824)t.memoizedState={baseLanes:0,cachePool:null},s=u!==null?u.baseLanes:r,Pe(er,yt),yt|=s;else return e=u!==null?u.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null},t.updateQueue=null,Pe(er,yt),yt|=e,null;else u!==null?(s=u.baseLanes|r,t.memoizedState=null):s=r,Pe(er,yt),yt|=s;return it(e,t,a,r),t.child}function ea(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Vs(e,t,r,s,a){var u=at(r)?wn:Je.current;return u=Wn(t,u),Qn(t,a),r=Ls(e,t,r,s,u,a),s=js(),e!==null&&!gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,$t(e,t,a)):(Ae&&s&&Cs(t),t.flags|=1,it(e,t,r,a),t.child)}function ta(e,t,r,s,a){if(at(r)){var u=!0;$r(t)}else u=!1;if(Qn(t,a),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),ml(t,r,s),Ps(t,r,s,a),s=!0;else if(e===null){var g=t.stateNode,S=t.memoizedProps;g.props=S;var D=g.context,L=r.contextType;typeof L=="object"&&L!==null?L=Mt(L):(L=at(r)?wn:Je.current,L=Wn(t,L));var Y=r.getDerivedStateFromProps,oe=typeof Y=="function"||typeof g.getSnapshotBeforeUpdate=="function";oe||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==s||D!==L)&&vl(t,g,s,L),cn=!1;var ee=t.memoizedState;g.state=ee,ui(t,s,g,a),D=t.memoizedState,S!==s||ee!==D||lt.current||cn?(typeof Y=="function"&&(Rs(t,r,Y,s),D=t.memoizedState),(S=cn||hl(t,r,S,s,ee,D,L))?(oe||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=D),g.props=s,g.state=D,g.context=L,s=S):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{g=t.stateNode,cl(e,t),S=t.memoizedProps,L=t.type===t.elementType?S:Ot(t.type,S),g.props=L,oe=t.pendingProps,ee=g.context,D=r.contextType,typeof D=="object"&&D!==null?D=Mt(D):(D=at(r)?wn:Je.current,D=Wn(t,D));var Te=r.getDerivedStateFromProps;(Y=typeof Te=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==oe||ee!==D)&&vl(t,g,s,D),cn=!1,ee=t.memoizedState,g.state=ee,ui(t,s,g,a);var J=t.memoizedState;S!==oe||ee!==J||lt.current||cn?(typeof Te=="function"&&(Rs(t,r,Te,s),J=t.memoizedState),(L=cn||hl(t,r,L,s,ee,J,D)||!1)?(Y||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(s,J,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(s,J,D)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=J),g.props=s,g.state=J,g.context=D,s=L):(typeof g.componentDidUpdate!="function"||S===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),s=!1)}return Qs(e,t,r,s,u,a)}function Qs(e,t,r,s,a,u){ea(e,t);var g=(t.flags&128)!==0;if(!s&&!g)return a&&sl(t,r,!1),$t(e,t,u);s=t.stateNode,Gc.current=t;var S=g&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&g?(t.child=Zn(t,e.child,null,u),t.child=Zn(t,null,S,u)):it(e,t,S,u),t.memoizedState=s.state,a&&sl(t,r,!0),t.child}function na(e){var t=e.stateNode;t.pendingContext?rl(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rl(e,t.context,!1),Ns(e,t.containerInfo)}function ra(e,t,r,s,a){return Kn(),Ds(a),t.flags|=256,it(e,t,r,s),t.child}var Ti={dehydrated:null,treeContext:null,retryLane:0};function _i(e){return{baseLanes:e,cachePool:null}}function ia(e,t,r){var s=t.pendingProps,a=Be.current,u=!1,g=(t.flags&128)!==0,S;if((S=g)||(S=e!==null&&e.memoizedState===null?!1:(a&2)!==0),S?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Pe(Be,a&1),e===null)return As(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?us(e)?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=s.children,e=s.fallback,u?(s=t.mode,u=t.child,a={mode:"hidden",children:a},!(s&1)&&u!==null?(u.childLanes=0,u.pendingProps=a):u=Vi(a,s,0,null),e=An(e,s,r,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=_i(r),t.memoizedState=Ti,e):Ys(t,a));if(a=e.memoizedState,a!==null){if(S=a.dehydrated,S!==null){if(g)return t.flags&256?(t.flags&=-257,Ri(e,t,r,Error(d(422)))):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=s.fallback,a=t.mode,s=Vi({mode:"visible",children:s.children},a,0,null),u=An(u,a,r,null),u.flags|=2,s.return=t,u.return=t,s.sibling=u,t.child=s,t.mode&1&&Zn(t,e.child,null,r),t.child.memoizedState=_i(r),t.memoizedState=Ti,u);if(!(t.mode&1))t=Ri(e,t,r,null);else if(us(S))t=Ri(e,t,r,Error(d(419)));else if(s=(r&e.childLanes)!==0,gt||s){if(s=be,s!==null){switch(r&-r){case 4:u=2;break;case 16:u=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:u=32;break;case 536870912:u=268435456;break;default:u=0}s=u&(s.suspendedLanes|r)?0:u,s!==0&&s!==a.retryLane&&(a.retryLane=s,Ct(e,s,-1))}ho(),t=Ri(e,t,r,Error(d(421)))}else tl(S)?(t.flags|=128,t.child=e.child,t=nf.bind(null,e),ic(S,t),t=null):(r=a.treeContext,Re&&(vt=lc(S),mt=t,Ae=!0,Ut=null,Rr=!1,r!==null&&(Tt[_t++]=Zt,Tt[_t++]=Jt,Tt[_t++]=Mn,Zt=r.id,Jt=r.overflow,Mn=t)),t=Ys(t,t.pendingProps.children),t.flags|=4096);return t}return u?(s=oa(e,t,s.children,s.fallback,r),u=t.child,a=e.child.memoizedState,u.memoizedState=a===null?_i(r):{baseLanes:a.baseLanes|r,cachePool:null},u.childLanes=e.childLanes&~r,t.memoizedState=Ti,s):(r=sa(e,t,s.children,r),t.memoizedState=null,r)}return u?(s=oa(e,t,s.children,s.fallback,r),u=t.child,a=e.child.memoizedState,u.memoizedState=a===null?_i(r):{baseLanes:a.baseLanes|r,cachePool:null},u.childLanes=e.childLanes&~r,t.memoizedState=Ti,s):(r=sa(e,t,s.children,r),t.memoizedState=null,r)}function Ys(e,t){return t=Vi({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function sa(e,t,r,s){var a=e.child;return e=a.sibling,r=vn(a,{mode:"visible",children:r}),!(t.mode&1)&&(r.lanes=s),r.return=t,r.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=r}function oa(e,t,r,s,a){var u=t.mode;e=e.child;var g=e.sibling,S={mode:"hidden",children:r};return!(u&1)&&t.child!==e?(r=t.child,r.childLanes=0,r.pendingProps=S,t.deletions=null):(r=vn(e,S),r.subtreeFlags=e.subtreeFlags&14680064),g!==null?s=vn(g,s):(s=An(s,u,a,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,s}function Ri(e,t,r,s){return s!==null&&Ds(s),Zn(t,e.child,null,r),e=Ys(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function la(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Ts(e.return,t,r)}function Xs(e,t,r,s,a){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:a}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=s,u.tail=r,u.tailMode=a)}function aa(e,t,r){var s=t.pendingProps,a=s.revealOrder,u=s.tail;if(it(e,t,s.children,r),s=Be.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&la(e,r,t);else if(e.tag===19)la(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(Pe(Be,s),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&hi(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),Xs(t,!1,a,r,u);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&hi(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}Xs(t,!0,r,null,u);break;case"together":Xs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $t(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),tr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,r=vn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=vn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Wc(e,t,r){switch(t.tag){case 3:na(t),Kn();break;case 5:Tl(t);break;case 1:at(t.type)&&$r(t);break;case 4:Ns(t,t.stateNode.containerInfo);break;case 10:ul(t,t.type._context,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Pe(Be,Be.current&1),t.flags|=128,null):r&t.child.childLanes?ia(e,t,r):(Pe(Be,Be.current&1),e=$t(e,t,r),e!==null?e.sibling:null);Pe(Be,Be.current&1);break;case 19:if(s=(r&t.childLanes)!==0,e.flags&128){if(s)return aa(e,t,r);t.flags|=128}var a=t.memoizedState;if(a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Pe(Be,Be.current),s)break;return null;case 22:case 23:return t.lanes=0,$l(e,t,r)}return $t(e,t,r)}function Vc(e,t){switch(Is(t),t.tag){case 1:return at(t.type)&&qr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qn(),Ie(lt),Ie(Je),Bs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Os(t),null;case 13:if(Ie(Be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Be),null;case 4:return qn(),null;case 10:return Ms(t.type._context),null;case 22:case 23:return po(),null;case 24:return null;default:return null}}var Pi=!1,Rn=!1,Qc=typeof WeakSet=="function"?WeakSet:Set,W=null;function Ci(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){ft(e,t,s)}else r.current=null}function Ks(e,t,r){try{r()}catch(s){ft(e,t,s)}}var ua=!1;function Yc(e,t){for(K(e.containerInfo),W=t;W!==null;)if(e=W,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,W=t;else for(;W!==null;){e=W;try{var r=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(r!==null){var s=r.memoizedProps,a=r.memoizedState,u=e.stateNode,g=u.getSnapshotBeforeUpdate(e.elementType===e.type?s:Ot(e.type,s),a);u.__reactInternalSnapshotBeforeUpdate=g}break;case 3:ue&&jt(e.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(d(163))}}catch(S){ft(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,W=t;break}W=e.return}return r=ua,ua=!1,r}function Pn(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&e)===e){var u=a.destroy;a.destroy=void 0,u!==void 0&&Ks(t,r,u)}a=a.next}while(a!==s)}}function Lr(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function Zs(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=_e(r);break;default:e=r}typeof t=="function"?t(e):t.current=e}}function ca(e,t,r){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(ri,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var s=e=e.next;do{var a=s,u=a.destroy;a=a.tag,u!==void 0&&(a&2||a&4)&&Ks(t,r,u),s=s.next}while(s!==e)}break;case 1:if(Ci(t,r),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(g){ft(t,r,g)}break;case 5:Ci(t,r);break;case 4:ue?va(e,t,r):Ge&&Ge&&(t=t.stateNode.containerInfo,r=Er(t),sn(t,r))}}function fa(e,t,r){for(var s=t;;)if(ca(e,s,r),s.child===null||ue&&s.tag===4){if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}else s.child.return=s,s=s.child}function da(e){var t=e.alternate;t!==null&&(e.alternate=null,da(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pa(e){return e.tag===5||e.tag===3||e.tag===4}function ha(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pa(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ma(e){if(ue){e:{for(var t=e.return;t!==null;){if(pa(t))break e;t=t.return}throw Error(d(160))}var r=t;switch(r.tag){case 5:t=r.stateNode,r.flags&32&&(b(t),r.flags&=-33),r=ha(e),qs(e,r,t);break;case 3:case 4:t=r.stateNode.containerInfo,r=ha(e),Js(e,r,t);break;default:throw Error(d(161))}}}function Js(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?Jr(r,e,t):ss(r,e);else if(s!==4&&(e=e.child,e!==null))for(Js(e,t,r),e=e.sibling;e!==null;)Js(e,t,r),e=e.sibling}function qs(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?as(r,e,t):Sr(r,e);else if(s!==4&&(e=e.child,e!==null))for(qs(e,t,r),e=e.sibling;e!==null;)qs(e,t,r),e=e.sibling}function va(e,t,r){for(var s=t,a=!1,u,g;;){if(!a){a=s.return;e:for(;;){if(a===null)throw Error(d(160));switch(u=a.stateNode,a.tag){case 5:g=!1;break e;case 3:u=u.containerInfo,g=!0;break e;case 4:u=u.containerInfo,g=!0;break e}a=a.return}a=!0}if(s.tag===5||s.tag===6)fa(e,s,r),g?_(u,s.stateNode):xr(u,s.stateNode);else if(s.tag===18)g?hc(u,s.stateNode):pc(u,s.stateNode);else if(s.tag===4){if(s.child!==null){u=s.stateNode.containerInfo,g=!0,s.child.return=s,s=s.child;continue}}else if(ca(e,s,r),s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return,s.tag===4&&(a=!1)}s.sibling.return=s.return,s=s.sibling}}function $s(e,t){if(ue){switch(t.tag){case 0:case 11:case 14:case 15:Pn(3,t,t.return),Lr(3,t),Pn(5,t,t.return);return;case 1:return;case 5:var r=t.stateNode;if(r!=null){var s=t.memoizedProps;e=e!==null?e.memoizedProps:s;var a=t.type,u=t.updateQueue;t.updateQueue=null,u!==null&&ls(r,u,a,e,s,t)}return;case 6:if(t.stateNode===null)throw Error(d(162));r=t.memoizedProps,os(t.stateNode,e!==null?e.memoizedProps:r,r);return;case 3:Re&&e!==null&&e.memoizedState.isDehydrated&&nl(t.stateNode.containerInfo);return;case 12:return;case 13:Ii(t);return;case 19:Ii(t);return;case 17:return}throw Error(d(163))}switch(t.tag){case 0:case 11:case 14:case 15:Pn(3,t,t.return),Lr(3,t),Pn(5,t,t.return);return;case 12:return;case 13:Ii(t);return;case 19:Ii(t);return;case 3:Re&&e!==null&&e.memoizedState.isDehydrated&&nl(t.stateNode.containerInfo);break;case 22:case 23:return}e:if(Ge){switch(t.tag){case 1:case 5:case 6:break e;case 3:case 4:t=t.stateNode,sn(t.containerInfo,t.pendingChildren);break e}throw Error(d(163))}}function Ii(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Qc),t.forEach(function(s){var a=rf.bind(null,e,s);r.has(s)||(r.add(s),s.then(a,a))})}}function Xc(e,t){for(W=t;W!==null;){t=W;var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var a=r[s];try{var u=e;ue?va(u,a,t):fa(u,a,t);var g=a.alternate;g!==null&&(g.return=null),a.return=null}catch(Z){ft(a,t,Z)}}if(r=t.child,t.subtreeFlags&12854&&r!==null)r.return=t,W=r;else for(;W!==null;){t=W;try{var S=t.flags;if(S&32&&ue&&b(t.stateNode),S&512){var D=t.alternate;if(D!==null){var L=D.ref;L!==null&&(typeof L=="function"?L(null):L.current=null)}}if(S&8192)switch(t.tag){case 13:if(t.memoizedState!==null){var Y=t.alternate;(Y===null||Y.memoizedState===null)&&(oo=Ve())}break;case 22:var oe=t.memoizedState!==null,ee=t.alternate,Te=ee!==null&&ee.memoizedState!==null;if(r=t,ue){e:if(s=r,a=oe,u=null,ue)for(var J=s;;){if(J.tag===5){if(u===null){u=J;var tt=J.stateNode;a?ne(tt):Fe(J.stateNode,J.memoizedProps)}}else if(J.tag===6){if(u===null){var zt=J.stateNode;a?me(zt):At(zt,J.memoizedProps)}}else if((J.tag!==22&&J.tag!==23||J.memoizedState===null||J===s)&&J.child!==null){J.child.return=J,J=J.child;continue}if(J===s)break;for(;J.sibling===null;){if(J.return===null||J.return===s)break e;u===J&&(u=null),J=J.return}u===J&&(u=null),J.sibling.return=J.return,J=J.sibling}}if(oe&&!Te&&r.mode&1){W=r;for(var I=r.child;I!==null;){for(r=W=I;W!==null;){s=W;var w=s.child;switch(s.tag){case 0:case 11:case 14:case 15:Pn(4,s,s.return);break;case 1:Ci(s,s.return);var A=s.stateNode;if(typeof A.componentWillUnmount=="function"){var Q=s.return;try{A.props=s.memoizedProps,A.state=s.memoizedState,A.componentWillUnmount()}catch(Z){ft(s,Q,Z)}}break;case 5:Ci(s,s.return);break;case 22:if(s.memoizedState!==null){Sa(r);continue}}w!==null?(w.return=s,W=w):Sa(r)}I=I.sibling}}}switch(S&4102){case 2:ma(t),t.flags&=-3;break;case 6:ma(t),t.flags&=-3,$s(t.alternate,t);break;case 4096:t.flags&=-4097;break;case 4100:t.flags&=-4097,$s(t.alternate,t);break;case 4:$s(t.alternate,t)}}catch(Z){ft(t,t.return,Z)}if(r=t.sibling,r!==null){r.return=t.return,W=r;break}W=t.return}}}function Kc(e,t,r){W=e,ga(e)}function ga(e,t,r){for(var s=(e.mode&1)!==0;W!==null;){var a=W,u=a.child;if(a.tag===22&&s){var g=a.memoizedState!==null||Pi;if(!g){var S=a.alternate,D=S!==null&&S.memoizedState!==null||Rn;S=Pi;var L=Rn;if(Pi=g,(Rn=D)&&!L)for(W=a;W!==null;)g=W,D=g.child,g.tag===22&&g.memoizedState!==null?xa(a):D!==null?(D.return=g,W=D):xa(a);for(;u!==null;)W=u,ga(u),u=u.sibling;W=a,Pi=S,Rn=L}ya(e)}else a.subtreeFlags&8772&&u!==null?(u.return=a,W=u):ya(e)}}function ya(e){for(;W!==null;){var t=W;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Rn||Lr(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Rn)if(r===null)s.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Ot(t.type,r.memoizedProps);s.componentDidUpdate(a,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var u=t.updateQueue;u!==null&&dl(t,u,s);break;case 3:var g=t.updateQueue;if(g!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=_e(t.child.stateNode);break;case 1:r=t.child.stateNode}dl(t,g,r)}break;case 5:var S=t.stateNode;r===null&&t.flags&4&&Zr(S,t.type,t.memoizedProps,t);break;case 6:break;case 4:break;case 12:break;case 13:if(Re&&t.memoizedState===null){var D=t.alternate;if(D!==null){var L=D.memoizedState;if(L!==null){var Y=L.dehydrated;Y!==null&&dc(Y)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(d(163))}Rn||t.flags&512&&Zs(t)}catch(oe){ft(t,t.return,oe)}}if(t===e){W=null;break}if(r=t.sibling,r!==null){r.return=t.return,W=r;break}W=t.return}}function Sa(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var r=t.sibling;if(r!==null){r.return=t.return,W=r;break}W=t.return}}function xa(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Lr(4,t)}catch(D){ft(t,r,D)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var a=t.return;try{s.componentDidMount()}catch(D){ft(t,a,D)}}var u=t.return;try{Zs(t)}catch(D){ft(t,u,D)}break;case 5:var g=t.return;try{Zs(t)}catch(D){ft(t,g,D)}}}catch(D){ft(t,t.return,D)}if(t===e){W=null;break}var S=t.sibling;if(S!==null){S.return=t.return,W=S;break}W=t.return}}var zi=0,Ai=1,Di=2,Ni=3,Oi=4;if(typeof Symbol=="function"&&Symbol.for){var jr=Symbol.for;zi=jr("selector.component"),Ai=jr("selector.has_pseudo_class"),Di=jr("selector.role"),Ni=jr("selector.test_id"),Oi=jr("selector.text")}function eo(e){var t=kt(e);if(t!=null){if(typeof t.memoizedProps["data-testname"]!="string")throw Error(d(364));return t}if(e=vr(e),e===null)throw Error(d(362));return e.stateNode.current}function to(e,t){switch(t.$$typeof){case zi:if(e.type===t.value)return!0;break;case Ai:e:{t=t.value,e=[e,0];for(var r=0;r<e.length;){var s=e[r++],a=e[r++],u=t[a];if(s.tag!==5||!ht(s)){for(;u!=null&&to(s,u);)a++,u=t[a];if(a===t.length){t=!0;break e}else for(s=s.child;s!==null;)e.push(s,a),s=s.sibling}}t=!1}return t;case Di:if(e.tag===5&&gr(e.stateNode,t.value))return!0;break;case Oi:if((e.tag===5||e.tag===6)&&(e=En(e),e!==null&&0<=e.indexOf(t.value)))return!0;break;case Ni:if(e.tag===5&&(e=e.memoizedProps["data-testname"],typeof e=="string"&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(d(365))}return!1}function no(e){switch(e.$$typeof){case zi:return"<"+(re(e.value)||"Unknown")+">";case Ai:return":has("+(no(e)||"")+")";case Di:return'[role="'+e.value+'"]';case Oi:return'"'+e.value+'"';case Ni:return'[data-testname="'+e.value+'"]';default:throw Error(d(365))}}function Ea(e,t){var r=[];e=[e,0];for(var s=0;s<e.length;){var a=e[s++],u=e[s++],g=t[u];if(a.tag!==5||!ht(a)){for(;g!=null&&to(a,g);)u++,g=t[u];if(u===t.length)r.push(a);else for(a=a.child;a!==null;)e.push(a,u),a=a.sibling}}return r}function ro(e,t){if(!Lt)throw Error(d(363));e=eo(e),e=Ea(e,t),t=[],e=Array.from(e);for(var r=0;r<e.length;){var s=e[r++];if(s.tag===5)ht(s)||t.push(s.stateNode);else for(s=s.child;s!==null;)e.push(s),s=s.sibling}return t}var Zc=Math.ceil,Ui=h.ReactCurrentDispatcher,io=h.ReactCurrentOwner,Le=h.ReactCurrentBatchConfig,fe=0,be=null,He=null,Xe=0,yt=0,er=an(0),We=0,Fr=null,tr=0,Bi=0,so=0,br=null,ut=null,oo=0,lo=1/0;function nr(){lo=Ve()+500}var ki=!1,ao=null,dn=null,Li=!1,pn=null,ji=0,Hr=0,uo=null,Fi=-1,bi=0;function st(){return fe&6?Ve():Fi!==-1?Fi:Fi=Ve()}function hn(e){return e.mode&1?fe&2&&Xe!==0?Xe&-Xe:Dc.transition!==null?(bi===0&&(e=ei,ei<<=1,!(ei&4194240)&&(ei=64),bi=e),bi):(e=ve,e!==0?e:mr()):1}function Ct(e,t,r){if(50<Hr)throw Hr=0,uo=null,Error(d(185));var s=Hi(e,t);return s===null?null:(_r(s,t,r),(!(fe&2)||s!==be)&&(s===be&&(!(fe&2)&&(Bi|=t),We===4&&mn(s,Xe)),ct(s,r),t===1&&fe===0&&!(e.mode&1)&&(nr(),ii&&Ht())),s)}function Hi(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}function ct(e,t){var r=e.callbackNode;Mc(e,t);var s=ni(e,e===be?Xe:0);if(s===0)r!==null&&ll(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&ll(r),t===1)e.tag===0?Ac(Ma.bind(null,e)):al(Ma.bind(null,e)),xn?rn(function(){fe===0&&Ht()}):gs(ys,Ht),r=null;else{switch(ol(s)){case 1:r=ys;break;case 4:r=Pc;break;case 16:r=Ss;break;case 536870912:r=Cc;break;default:r=Ss}r=Da(r,wa.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function wa(e,t){if(Fi=-1,bi=0,fe&6)throw Error(d(327));var r=e.callbackNode;if(zn()&&e.callbackNode!==r)return null;var s=ni(e,e===be?Xe:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Gi(e,s);else{t=s;var a=fe;fe|=2;var u=Ra();(be!==e||Xe!==t)&&(nr(),Cn(e,t));do try{$c();break}catch(S){_a(e,S)}while(!0);ws(),Ui.current=u,fe=a,He!==null?t=0:(be=null,Xe=0,t=We)}if(t!==0){if(t===2&&(a=hs(e),a!==0&&(s=a,t=co(e,a))),t===1)throw r=Fr,Cn(e,0),mn(e,s),ct(e,Ve()),r;if(t===6)mn(e,s);else{if(a=e.current.alternate,!(s&30)&&!Jc(a)&&(t=Gi(e,s),t===2&&(u=hs(e),u!==0&&(s=u,t=co(e,u))),t===1))throw r=Fr,Cn(e,0),mn(e,s),ct(e,Ve()),r;switch(e.finishedWork=a,e.finishedLanes=s,t){case 0:case 1:throw Error(d(345));case 2:In(e,ut);break;case 3:if(mn(e,s),(s&130023424)===s&&(t=oo+500-Ve(),10<t)){if(ni(e,0)!==0)break;if(a=e.suspendedLanes,(a&s)!==s){st(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ke(In.bind(null,e,ut),t);break}In(e,ut);break;case 4:if(mn(e,s),(s&4194240)===s)break;for(t=e.eventTimes,a=-1;0<s;){var g=31-Nt(s);u=1<<g,g=t[g],g>a&&(a=g),s&=~u}if(s=a,s=Ve()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Zc(s/1960))-s,10<s){e.timeoutHandle=Ke(In.bind(null,e,ut),s);break}In(e,ut);break;case 5:In(e,ut);break;default:throw Error(d(329))}}}return ct(e,Ve()),e.callbackNode===r?wa.bind(null,e):null}function co(e,t){var r=br;return e.current.memoizedState.isDehydrated&&(Cn(e,t).flags|=256),e=Gi(e,t),e!==2&&(t=ut,ut=r,t!==null&&fo(t)),e}function fo(e){ut===null?ut=e:ut.push.apply(ut,e)}function Jc(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var a=r[s],u=a.getSnapshot;a=a.value;try{if(!bt(u(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function mn(e,t){for(t&=~so,t&=~Bi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Nt(t),s=1<<r;e[r]=-1,t&=~s}}function Ma(e){if(fe&6)throw Error(d(327));zn();var t=ni(e,0);if(!(t&1))return ct(e,Ve()),null;var r=Gi(e,t);if(e.tag!==0&&r===2){var s=hs(e);s!==0&&(t=s,r=co(e,s))}if(r===1)throw r=Fr,Cn(e,0),mn(e,t),ct(e,Ve()),r;if(r===6)throw Error(d(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,In(e,ut),ct(e,Ve()),null}function Ta(e){pn!==null&&pn.tag===0&&!(fe&6)&&zn();var t=fe;fe|=1;var r=Le.transition,s=ve;try{if(Le.transition=null,ve=1,e)return e()}finally{ve=s,Le.transition=r,fe=t,!(fe&6)&&Ht()}}function po(){yt=er.current,Ie(er)}function Cn(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==ot&&(e.timeoutHandle=ot,Ze(r)),He!==null)for(r=He.return;r!==null;){var s=r;switch(Is(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&qr();break;case 3:qn(),Ie(lt),Ie(Je),Bs();break;case 5:Os(s);break;case 4:qn();break;case 13:Ie(Be);break;case 19:Ie(Be);break;case 10:Ms(s.type._context);break;case 22:case 23:po()}r=r.return}if(be=e,He=e=vn(e.current,null),Xe=yt=t,We=0,Fr=null,so=Bi=tr=0,ut=br=null,Gt!==null){for(t=0;t<Gt.length;t++)if(r=Gt[t],s=r.interleaved,s!==null){r.interleaved=null;var a=s.next,u=r.pending;if(u!==null){var g=u.next;u.next=a,s.next=g}r.pending=s}Gt=null}return e}function _a(e,t){do{var r=He;try{if(ws(),mi.current=Ei,vi){for(var s=ke.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}vi=!1}if($n=0,Qe=qe=ke=null,Ar=!1,Dr=0,io.current=null,r===null||r.return===null){We=1,Fr=t,He=null;break}e:{var u=e,g=r.return,S=r,D=t;if(t=Xe,S.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){var L=D,Y=S,oe=Y.tag;if(!(Y.mode&1)&&(oe===0||oe===11||oe===15)){var ee=Y.alternate;ee?(Y.updateQueue=ee.updateQueue,Y.memoizedState=ee.memoizedState,Y.lanes=ee.lanes):(Y.updateQueue=null,Y.memoizedState=null)}var Te=Ql(g);if(Te!==null){Te.flags&=-257,Yl(Te,g,S,u,t),Te.mode&1&&Vl(u,L,t),t=Te,D=L;var J=t.updateQueue;if(J===null){var tt=new Set;tt.add(D),t.updateQueue=tt}else J.add(D);break e}else{if(!(t&1)){Vl(u,L,t),ho();break e}D=Error(d(426))}}else if(Ae&&S.mode&1){var zt=Ql(g);if(zt!==null){!(zt.flags&65536)&&(zt.flags|=256),Yl(zt,g,S,u,t),Ds(D);break e}}u=D,We!==4&&(We=2),br===null?br=[u]:br.push(u),D=Gs(D,S),S=g;do{switch(S.tag){case 3:S.flags|=65536,t&=-t,S.lanes|=t;var I=Gl(S,D,t);fl(S,I);break e;case 1:u=D;var w=S.type,A=S.stateNode;if(!(S.flags&128)&&(typeof w.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(dn===null||!dn.has(A)))){S.flags|=65536,t&=-t,S.lanes|=t;var Q=Wl(S,u,t);fl(S,Q);break e}}S=S.return}while(S!==null)}Ca(r)}catch(Z){t=Z,He===r&&r!==null&&(He=r=r.return);continue}break}while(!0)}function Ra(){var e=Ui.current;return Ui.current=Ei,e===null?Ei:e}function ho(){(We===0||We===3||We===2)&&(We=4),be===null||!(tr&268435455)&&!(Bi&268435455)||mn(be,Xe)}function Gi(e,t){var r=fe;fe|=2;var s=Ra();be===e&&Xe===t||Cn(e,t);do try{qc();break}catch(a){_a(e,a)}while(!0);if(ws(),fe=r,Ui.current=s,He!==null)throw Error(d(261));return be=null,Xe=0,We}function qc(){for(;He!==null;)Pa(He)}function $c(){for(;He!==null&&!_c();)Pa(He)}function Pa(e){var t=Aa(e.alternate,e,yt);e.memoizedProps=e.pendingProps,t===null?Ca(e):He=t,io.current=null}function Ca(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Vc(r,t),r!==null){r.flags&=32767,He=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,He=null;return}}else if(r=Hc(r,t,yt),r!==null){He=r;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);We===0&&(We=5)}function In(e,t){var r=ve,s=Le.transition;try{Le.transition=null,ve=1,ef(e,t,r)}finally{Le.transition=s,ve=r}return null}function ef(e,t,r){do zn();while(pn!==null);if(fe&6)throw Error(d(327));var s=e.finishedWork,a=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(d(177));e.callbackNode=null,e.callbackPriority=0;var u=s.lanes|s.childLanes;if(Tc(e,u),e===be&&(He=be=null,Xe=0),!(s.subtreeFlags&2064)&&!(s.flags&2064)||Li||(Li=!0,Da(Ss,function(){return zn(),null})),u=(s.flags&15990)!==0,s.subtreeFlags&15990||u){u=Le.transition,Le.transition=null;var g=ve;ve=1;var S=fe;fe|=4,io.current=null,Yc(e,s),Xc(e,s),G(e.containerInfo),e.current=s,Kc(s),Rc(),fe=S,ve=g,Le.transition=u}else e.current=s;if(Li&&(Li=!1,pn=e,ji=a),u=e.pendingLanes,u===0&&(dn=null),Ic(s.stateNode),ct(e,Ve()),t!==null)for(r=e.onRecoverableError,s=0;s<t.length;s++)r(t[s]);if(ki)throw ki=!1,e=ao,ao=null,e;return ji&1&&e.tag!==0&&zn(),u=e.pendingLanes,u&1?e===uo?Hr++:(Hr=0,uo=e):Hr=0,Ht(),null}function zn(){if(pn!==null){var e=ol(ji),t=Le.transition,r=ve;try{if(Le.transition=null,ve=16>e?16:e,pn===null)var s=!1;else{if(e=pn,pn=null,ji=0,fe&6)throw Error(d(331));var a=fe;for(fe|=4,W=e.current;W!==null;){var u=W,g=u.child;if(W.flags&16){var S=u.deletions;if(S!==null){for(var D=0;D<S.length;D++){var L=S[D];for(W=L;W!==null;){var Y=W;switch(Y.tag){case 0:case 11:case 15:Pn(8,Y,u)}var oe=Y.child;if(oe!==null)oe.return=Y,W=oe;else for(;W!==null;){Y=W;var ee=Y.sibling,Te=Y.return;if(da(Y),Y===L){W=null;break}if(ee!==null){ee.return=Te,W=ee;break}W=Te}}}var J=u.alternate;if(J!==null){var tt=J.child;if(tt!==null){J.child=null;do{var zt=tt.sibling;tt.sibling=null,tt=zt}while(tt!==null)}}W=u}}if(u.subtreeFlags&2064&&g!==null)g.return=u,W=g;else e:for(;W!==null;){if(u=W,u.flags&2048)switch(u.tag){case 0:case 11:case 15:Pn(9,u,u.return)}var I=u.sibling;if(I!==null){I.return=u.return,W=I;break e}W=u.return}}var w=e.current;for(W=w;W!==null;){g=W;var A=g.child;if(g.subtreeFlags&2064&&A!==null)A.return=g,W=A;else e:for(g=w;W!==null;){if(S=W,S.flags&2048)try{switch(S.tag){case 0:case 11:case 15:Lr(9,S)}}catch(Z){ft(S,S.return,Z)}if(S===g){W=null;break e}var Q=S.sibling;if(Q!==null){Q.return=S.return,W=Q;break e}W=S.return}}if(fe=a,Ht(),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(ri,e)}catch{}s=!0}return s}finally{ve=r,Le.transition=t}}return!1}function Ia(e,t,r){t=Gs(r,t),t=Gl(e,t,1),fn(e,t),t=st(),e=Hi(e,1),e!==null&&(_r(e,1,t),ct(e,t))}function ft(e,t,r){if(e.tag===3)Ia(e,e,r);else for(;t!==null;){if(t.tag===3){Ia(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(dn===null||!dn.has(s))){e=Gs(r,e),e=Wl(t,e,1),fn(t,e),e=st(),t=Hi(t,1),t!==null&&(_r(t,1,e),ct(t,e));break}}t=t.return}}function tf(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=st(),e.pingedLanes|=e.suspendedLanes&r,be===e&&(Xe&r)===r&&(We===4||We===3&&(Xe&130023424)===Xe&&500>Ve()-oo?Cn(e,0):so|=r),ct(e,t)}function za(e,t){t===0&&(e.mode&1?(t=ti,ti<<=1,!(ti&130023424)&&(ti=4194304)):t=1);var r=st();e=Hi(e,t),e!==null&&(_r(e,t,r),ct(e,r))}function nf(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),za(e,r)}function rf(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(d(314))}s!==null&&s.delete(t),za(e,r)}var Aa;Aa=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||lt.current)gt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return gt=!1,Wc(e,t,r);gt=!!(e.flags&131072)}else gt=!1,Ae&&t.flags&1048576&&gl(t,di,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var a=Wn(t,Je.current);Qn(t,r),a=Ls(null,t,s,e,a,r);var u=js();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,at(s)?(u=!0,$r(t)):u=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,_s(t),a.updater=ci,t.stateNode=a,a._reactInternals=t,Ps(t,s,e,r),t=Qs(null,t,s,!0,u,r)):(t.tag=0,Ae&&u&&Cs(t),it(null,t,a,r),t=t.child),t;case 16:s=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,a=s._init,s=a(s._payload),t.type=s,a=t.tag=of(s),e=Ot(s,e),a){case 0:t=Vs(null,t,s,e,r);break e;case 1:t=ta(null,t,s,e,r);break e;case 11:t=Zl(null,t,s,e,r);break e;case 14:t=Jl(null,t,s,Ot(s.type,e),r);break e}throw Error(d(306,s,""))}return t;case 0:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:Ot(s,a),Vs(e,t,s,a,r);case 1:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:Ot(s,a),ta(e,t,s,a,r);case 3:e:{if(na(t),e===null)throw Error(d(387));s=t.pendingProps,u=t.memoizedState,a=u.element,cl(e,t),ui(t,s,null,r);var g=t.memoizedState;if(s=g.element,Re&&u.isDehydrated)if(u={element:s,isDehydrated:!1,cache:g.cache,transitions:g.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){a=Error(d(423)),t=ra(e,t,s,r,a);break e}else if(s!==a){a=Error(d(424)),t=ra(e,t,s,r,a);break e}else for(Re&&(vt=oc(t.stateNode.containerInfo),mt=t,Ae=!0,Ut=null,Rr=!1),r=Ml(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Kn(),s===a){t=$t(e,t,r);break e}it(e,t,s,r)}t=t.child}return t;case 5:return Tl(t),e===null&&As(t),s=t.type,a=t.pendingProps,u=e!==null?e.memoizedProps:null,g=a.children,we(s,a)?g=null:u!==null&&we(s,u)&&(t.flags|=32),ea(e,t),it(e,t,g,r),t.child;case 6:return e===null&&As(t),null;case 13:return ia(e,t,r);case 4:return Ns(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Zn(t,null,s,r):it(e,t,s,r),t.child;case 11:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:Ot(s,a),Zl(e,t,s,a,r);case 7:return it(e,t,t.pendingProps,r),t.child;case 8:return it(e,t,t.pendingProps.children,r),t.child;case 12:return it(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,a=t.pendingProps,u=t.memoizedProps,g=a.value,ul(t,s,g),u!==null)if(bt(u.value,g)){if(u.children===a.children&&!lt.current){t=$t(e,t,r);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var S=u.dependencies;if(S!==null){g=u.child;for(var D=S.firstContext;D!==null;){if(D.context===s){if(u.tag===1){D=Kt(-1,r&-r),D.tag=2;var L=u.updateQueue;if(L!==null){L=L.shared;var Y=L.pending;Y===null?D.next=D:(D.next=Y.next,Y.next=D),L.pending=D}}u.lanes|=r,D=u.alternate,D!==null&&(D.lanes|=r),Ts(u.return,r,t),S.lanes|=r;break}D=D.next}}else if(u.tag===10)g=u.type===t.type?null:u.child;else if(u.tag===18){if(g=u.return,g===null)throw Error(d(341));g.lanes|=r,S=g.alternate,S!==null&&(S.lanes|=r),Ts(g,r,t),g=u.sibling}else g=u.child;if(g!==null)g.return=u;else for(g=u;g!==null;){if(g===t){g=null;break}if(u=g.sibling,u!==null){u.return=g.return,g=u;break}g=g.return}u=g}it(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,s=t.pendingProps.children,Qn(t,r),a=Mt(a),s=s(a),t.flags|=1,it(e,t,s,r),t.child;case 14:return s=t.type,a=Ot(s,t.pendingProps),a=Ot(s.type,a),Jl(e,t,s,a,r);case 15:return ql(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:Ot(s,a),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,at(s)?(e=!0,$r(t)):e=!1,Qn(t,r),ml(t,s,a),Ps(t,s,a,r),Qs(null,t,s,!0,e,r);case 19:return aa(e,t,r);case 22:return $l(e,t,r)}throw Error(d(156,t.tag))};function Da(e,t){return gs(e,t)}function sf(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(e,t,r,s){return new sf(e,t,r,s)}function mo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function of(e){if(typeof e=="function")return mo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===U)return 11;if(e===C)return 14}return 2}function vn(e,t){var r=e.alternate;return r===null?(r=It(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Wi(e,t,r,s,a,u){var g=2;if(s=e,typeof e=="function")mo(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case p:return An(r.children,a,u,t);case m:g=8,a|=8;break;case E:return e=It(12,r,t,a|2),e.elementType=E,e.lanes=u,e;case O:return e=It(13,r,t,a),e.elementType=O,e.lanes=u,e;case R:return e=It(19,r,t,a),e.elementType=R,e.lanes=u,e;case H:return Vi(r,a,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x:g=10;break e;case P:g=9;break e;case U:g=11;break e;case C:g=14;break e;case z:g=16,s=null;break e}throw Error(d(130,e==null?e:typeof e,""))}return t=It(g,r,t,a),t.elementType=e,t.type=s,t.lanes=u,t}function An(e,t,r,s){return e=It(7,e,s,t),e.lanes=r,e}function Vi(e,t,r,s){return e=It(22,e,s,t),e.elementType=H,e.lanes=r,e.stateNode={},e}function vo(e,t,r){return e=It(6,e,null,t),e.lanes=r,e}function go(e,t,r){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lf(e,t,r,s,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ot,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ms(0),this.expirationTimes=ms(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ms(0),this.identifierPrefix=s,this.onRecoverableError=a,Re&&(this.mutableSourceEagerHydrationData=null)}function Na(e,t,r,s,a,u,g,S,D){return e=new lf(e,t,r,S,D),t===1?(t=1,u===!0&&(t|=8)):t=0,u=It(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null},_s(u),e}function Oa(e){if(!e)return un;e=e._reactInternals;e:{if(V(e)!==e||e.tag!==1)throw Error(d(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(at(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(d(171))}if(e.tag===1){var r=e.type;if(at(r))return il(e,r,t)}return t}function Ua(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=$(t),e===null?null:e.stateNode}function Ba(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function yo(e,t){Ba(e,t),(e=e.alternate)&&Ba(e,t)}function af(e){return e=$(e),e===null?null:e.stateNode}function uf(){return null}return l.attemptContinuousHydration=function(e){if(e.tag===13){var t=st();Ct(e,134217728,t),yo(e,134217728)}},l.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13){var t=st(),r=hn(e);Ct(e,r,t),yo(e,r)}},l.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Tr(t.pendingLanes);r!==0&&(vs(t,r|1),ct(t,Ve()),!(fe&6)&&(nr(),Ht()))}break;case 13:var s=st();Ta(function(){return Ct(e,1,s)}),yo(e,1)}},l.batchedUpdates=function(e,t){var r=fe;fe|=1;try{return e(t)}finally{fe=r,fe===0&&(nr(),ii&&Ht())}},l.createComponentSelector=function(e){return{$$typeof:zi,value:e}},l.createContainer=function(e,t,r,s,a,u,g){return Na(e,t,!1,null,r,s,a,u,g)},l.createHasPseudoClassSelector=function(e){return{$$typeof:Ai,value:e}},l.createHydrationContainer=function(e,t,r,s,a,u,g,S,D){return e=Na(r,s,!0,e,a,u,g,S,D),e.context=Oa(null),r=e.current,s=st(),a=hn(r),u=Kt(s,a),u.callback=t??null,fn(r,u),e.current.lanes=a,_r(e,a,s),ct(e,s),e},l.createPortal=function(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:y,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}},l.createRoleSelector=function(e){return{$$typeof:Di,value:e}},l.createTestNameSelector=function(e){return{$$typeof:Ni,value:e}},l.createTextSelector=function(e){return{$$typeof:Oi,value:e}},l.deferredUpdates=function(e){var t=ve,r=Le.transition;try{return Le.transition=null,ve=16,e()}finally{ve=t,Le.transition=r}},l.discreteUpdates=function(e,t,r,s,a){var u=ve,g=Le.transition;try{return Le.transition=null,ve=1,e(t,r,s,a)}finally{ve=u,Le.transition=g,fe===0&&nr()}},l.findAllNodes=ro,l.findBoundingRects=function(e,t){if(!Lt)throw Error(d(363));t=ro(e,t),e=[];for(var r=0;r<t.length;r++)e.push(bn(t[r]));for(t=e.length-1;0<t;t--){r=e[t];for(var s=r.x,a=s+r.width,u=r.y,g=u+r.height,S=t-1;0<=S;S--)if(t!==S){var D=e[S],L=D.x,Y=L+D.width,oe=D.y,ee=oe+D.height;if(s>=L&&u>=oe&&a<=Y&&g<=ee){e.splice(t,1);break}else if(s!==L||r.width!==D.width||ee<u||oe>g){if(!(u!==oe||r.height!==D.height||Y<s||L>a)){L>s&&(D.width+=L-s,D.x=s),Y<a&&(D.width=a-L),e.splice(t,1);break}}else{oe>u&&(D.height+=oe-u,D.y=u),ee<g&&(D.height=g-oe),e.splice(t,1);break}}}return e},l.findHostInstance=Ua,l.findHostInstanceWithNoPortals=function(e){return e=N(e),e=e!==null?Ne(e):null,e===null?null:e.stateNode},l.findHostInstanceWithWarning=function(e){return Ua(e)},l.flushControlled=function(e){var t=fe;fe|=1;var r=Le.transition,s=ve;try{Le.transition=null,ve=1,e()}finally{ve=s,Le.transition=r,fe=t,fe===0&&(nr(),Ht())}},l.flushPassiveEffects=zn,l.flushSync=Ta,l.focusWithin=function(e,t){if(!Lt)throw Error(d(363));for(e=eo(e),t=Ea(e,t),t=Array.from(t),e=0;e<t.length;){var r=t[e++];if(!ht(r)){if(r.tag===5&&yr(r.stateNode))return!0;for(r=r.child;r!==null;)t.push(r),r=r.sibling}}return!1},l.getCurrentUpdatePriority=function(){return ve},l.getFindAllNodesFailureDescription=function(e,t){if(!Lt)throw Error(d(363));var r=0,s=[];e=[eo(e),0];for(var a=0;a<e.length;){var u=e[a++],g=e[a++],S=t[g];if((u.tag!==5||!ht(u))&&(to(u,S)&&(s.push(no(S)),g++,g>r&&(r=g)),g<t.length))for(u=u.child;u!==null;)e.push(u,g),u=u.sibling}if(r<t.length){for(e=[];r<t.length;r++)e.push(no(t[r]));return`findAllNodes was able to match part of the selector:
|
|
32
|
+
`+(s.join(" > ")+`
|
|
33
|
+
|
|
34
|
+
No matching component was found for:
|
|
35
|
+
`)+e.join(" > ")}return null},l.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return _e(e.child.stateNode);default:return e.child.stateNode}},l.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:h.ReactCurrentDispatcher,findHostInstanceByFiber:af,findFiberByHostInstance:e.findFiberByHostInstance||uf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{ri=t.inject(e),Ft=t}catch{}e=!!t.checkDCE}}return e},l.isAlreadyRendering=function(){return!1},l.observeVisibleRects=function(e,t,r,s){if(!Lt)throw Error(d(363));e=ro(e,t);var a=Et(e,r,s).disconnect;return{disconnect:function(){a()}}},l.registerMutableSourceForHydration=function(e,t){var r=t._getVersion;r=r(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,r]:e.mutableSourceEagerHydrationData.push(t,r)},l.runWithPriority=function(e,t){var r=ve;try{return ve=e,t()}finally{ve=r}},l.shouldError=function(){return null},l.shouldSuspend=function(){return!1},l.updateContainer=function(e,t,r,s){var a=t.current,u=st(),g=hn(a);return r=Oa(r),t.context===null?t.context=r:t.pendingContext=r,t=Kt(u,g),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),fn(a,t),e=Ct(a,g,u),e!==null&&ai(e,a,g),g},l};Pu.exports=Kf;var Zf=Pu.exports;const Jf=ff(Zf),Xo={},zu=n=>void Object.assign(Xo,n);function qf(n,i){function l(p,{args:m=[],attach:E,...x},P){let U=`${p[0].toUpperCase()}${p.slice(1)}`,O;if(p==="primitive"){if(x.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const R=x.object;O=ar(R,{type:p,root:P,attach:E,primitive:!0})}else{const R=Xo[U];if(!R)throw new Error(`R3F: ${U} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(m))throw new Error("R3F: The args prop must be an array!");O=ar(new R(...m),{type:p,root:P,attach:E,memoizedProps:{args:m}})}return O.__r3f.attach===void 0&&(O.isBufferGeometry?O.__r3f.attach="geometry":O.isMaterial&&(O.__r3f.attach="material")),U!=="inject"&&Mo(O,x),O}function o(p,m){let E=!1;if(m){var x,P;(x=m.__r3f)!=null&&x.attach?wo(p,m,m.__r3f.attach):m.isObject3D&&p.isObject3D&&(p.add(m),E=!0),E||(P=p.__r3f)==null||P.objects.push(m),m.__r3f||ar(m,{}),m.__r3f.parent=p,Ho(m),ur(m)}}function c(p,m,E){let x=!1;if(m){var P,U;if((P=m.__r3f)!=null&&P.attach)wo(p,m,m.__r3f.attach);else if(m.isObject3D&&p.isObject3D){m.parent=p,m.dispatchEvent({type:"added"}),p.dispatchEvent({type:"childadded",child:m});const O=p.children.filter(C=>C!==m),R=O.indexOf(E);p.children=[...O.slice(0,R),m,...O.slice(R)],x=!0}x||(U=p.__r3f)==null||U.objects.push(m),m.__r3f||ar(m,{}),m.__r3f.parent=p,Ho(m),ur(m)}}function f(p,m,E=!1){p&&[...p].forEach(x=>d(m,x,E))}function d(p,m,E){if(m){var x,P,U;if(m.__r3f&&(m.__r3f.parent=null),(x=p.__r3f)!=null&&x.objects&&(p.__r3f.objects=p.__r3f.objects.filter(H=>H!==m)),(P=m.__r3f)!=null&&P.attach)Ga(p,m,m.__r3f.attach);else if(m.isObject3D&&p.isObject3D){var O;p.remove(m),(O=m.__r3f)!=null&&O.root&&od(Ki(m),m)}const C=(U=m.__r3f)==null?void 0:U.primitive,z=!C&&(E===void 0?m.dispose!==null:E);if(!C){var R;f((R=m.__r3f)==null?void 0:R.objects,m,z),f(m.children,m,z)}if(delete m.__r3f,z&&m.dispose&&m.type!=="Scene"){const H=()=>{try{m.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?Fo.unstable_scheduleCallback(Fo.unstable_IdlePriority,H):H()}ur(p)}}function h(p,m,E,x){var P;const U=(P=p.__r3f)==null?void 0:P.parent;if(!U)return;const O=l(m,E,p.__r3f.root);if(p.children){for(const R of p.children)R.__r3f&&o(O,R);p.children=p.children.filter(R=>!R.__r3f)}p.__r3f.objects.forEach(R=>o(O,R)),p.__r3f.objects=[],p.__r3f.autoRemovedBeforeAppend||d(U,p),O.parent&&(O.__r3f.autoRemovedBeforeAppend=!0),o(U,O),O.raycast&&O.__r3f.eventCount&&Ki(O).getState().internal.interaction.push(O),[x,x.alternate].forEach(R=>{R!==null&&(R.stateNode=O,R.ref&&(typeof R.ref=="function"?R.ref(O):R.ref.current=O))})}const v=()=>{};return{reconciler:Jf({createInstance:l,removeChild:d,appendChild:o,appendInitialChild:o,insertBefore:c,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(p,m)=>{if(!m)return;const E=p.getState().scene;E.__r3f&&(E.__r3f.root=p,o(E,m))},removeChildFromContainer:(p,m)=>{m&&d(p.getState().scene,m)},insertInContainerBefore:(p,m,E)=>{if(!m||!E)return;const x=p.getState().scene;x.__r3f&&c(x,m,E)},getRootHostContext:()=>null,getChildHostContext:p=>p,finalizeInitialChildren(p){var m;return!!((m=p==null?void 0:p.__r3f)!=null?m:{}).handlers},prepareUpdate(p,m,E,x){var P;if(((P=p==null?void 0:p.__r3f)!=null?P:{}).primitive&&x.object&&x.object!==p)return[!0];{const{args:O=[],children:R,...C}=x,{args:z=[],children:H,...j}=E;if(!Array.isArray(O))throw new Error("R3F: the args prop must be an array!");if(O.some((re,X)=>re!==z[X]))return[!0];const k=ku(p,C,j,!0);return k.changes.length?[!1,k]:null}},commitUpdate(p,[m,E],x,P,U,O){m?h(p,x,U,O):Mo(p,E)},commitMount(p,m,E,x){var P;const U=(P=p.__r3f)!=null?P:{};p.raycast&&U.handlers&&U.eventCount&&Ki(p).getState().internal.interaction.push(p)},getPublicInstance:p=>p,prepareForCommit:()=>null,preparePortalMount:p=>ar(p.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(p){var m;const{attach:E,parent:x}=(m=p.__r3f)!=null?m:{};E&&x&&Ga(x,p,E),p.isObject3D&&(p.visible=!1),ur(p)},unhideInstance(p,m){var E;const{attach:x,parent:P}=(E=p.__r3f)!=null?E:{};x&&P&&wo(P,p,x),(p.isObject3D&&m.visible==null||m.visible)&&(p.visible=!0),ur(p)},createTextInstance:v,hideTextInstance:v,unhideTextInstance:v,getCurrentEventPriority:()=>i?i():fr.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&Ce.fun(performance.now)?performance.now:Ce.fun(Date.now)?Date.now:()=>0,scheduleTimeout:Ce.fun(setTimeout)?setTimeout:void 0,cancelTimeout:Ce.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Mo}}var ja,Fa;const Eo=n=>"colorSpace"in n||"outputColorSpace"in n,Au=()=>{var n;return(n=Xo.ColorManagement)!=null?n:null},Du=n=>n&&n.isOrthographicCamera,$f=n=>n&&n.hasOwnProperty("current"),Yr=typeof window<"u"&&((ja=window.document)!=null&&ja.createElement||((Fa=window.navigator)==null?void 0:Fa.product)==="ReactNative")?M.useLayoutEffect:M.useEffect;function Nu(n){const i=M.useRef(n);return Yr(()=>void(i.current=n),[n]),i}function ed({set:n}){return Yr(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class Ou extends M.Component{constructor(...i){super(...i),this.state={error:!1}}componentDidCatch(i){this.props.set(i)}render(){return this.state.error?null:this.props.children}}Ou.getDerivedStateFromError=()=>({error:!0});const Uu="__default",ba=new Map,td=n=>n&&!!n.memoized&&!!n.changes;function Bu(n){var i;const l=typeof window<"u"?(i=window.devicePixelRatio)!=null?i:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],l),n[1]):n}const Gr=n=>{var i;return(i=n.__r3f)==null?void 0:i.root.getState()};function Ki(n){let i=n.__r3f.root;for(;i.getState().previousRoot;)i=i.getState().previousRoot;return i}const Ce={obj:n=>n===Object(n)&&!Ce.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,i,{arrays:l="shallow",objects:o="reference",strict:c=!0}={}){if(typeof n!=typeof i||!!n!=!!i)return!1;if(Ce.str(n)||Ce.num(n)||Ce.boo(n))return n===i;const f=Ce.obj(n);if(f&&o==="reference")return n===i;const d=Ce.arr(n);if(d&&l==="reference")return n===i;if((d||f)&&n===i)return!0;let h;for(h in n)if(!(h in i))return!1;if(f&&l==="shallow"&&o==="shallow"){for(h in c?i:n)if(!Ce.equ(n[h],i[h],{strict:c,objects:"reference"}))return!1}else for(h in c?i:n)if(n[h]!==i[h])return!1;if(Ce.und(h)){if(d&&n.length===0&&i.length===0||f&&Object.keys(n).length===0&&Object.keys(i).length===0)return!0;if(n!==i)return!1}return!0}};function nd(n){const i={nodes:{},materials:{}};return n&&n.traverse(l=>{l.name&&(i.nodes[l.name]=l),l.material&&!i.materials[l.material.name]&&(i.materials[l.material.name]=l.material)}),i}function rd(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const i in n)i.dispose==null||i.dispose(),delete n[i]}function ar(n,i){const l=n;return l.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...i},n}function bo(n,i){let l=n;if(i.includes("-")){const o=i.split("-"),c=o.pop();return l=o.reduce((f,d)=>f[d],n),{target:l,key:c}}else return{target:l,key:i}}const Ha=/-\d+$/;function wo(n,i,l){if(Ce.str(l)){if(Ha.test(l)){const f=l.replace(Ha,""),{target:d,key:h}=bo(n,f);Array.isArray(d[h])||(d[h]=[])}const{target:o,key:c}=bo(n,l);i.__r3f.previousAttach=o[c],o[c]=i}else i.__r3f.previousAttach=l(n,i)}function Ga(n,i,l){var o,c;if(Ce.str(l)){const{target:f,key:d}=bo(n,l),h=i.__r3f.previousAttach;h===void 0?delete f[d]:f[d]=h}else(o=i.__r3f)==null||o.previousAttach==null||o.previousAttach(n,i);(c=i.__r3f)==null||delete c.previousAttach}function ku(n,{children:i,key:l,ref:o,...c},{children:f,key:d,ref:h,...v}={},y=!1){const p=n.__r3f,m=Object.entries(c),E=[];if(y){const P=Object.keys(v);for(let U=0;U<P.length;U++)c.hasOwnProperty(P[U])||m.unshift([P[U],Uu+"remove"])}m.forEach(([P,U])=>{var O;if((O=n.__r3f)!=null&&O.primitive&&P==="object"||Ce.equ(U,v[P]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(P))return E.push([P,U,!0,[]]);let R=[];P.includes("-")&&(R=P.split("-")),E.push([P,U,!1,R]);for(const C in c){const z=c[C];C.startsWith(`${P}-`)&&E.push([C,z,!1,C.split("-")])}});const x={...c};return p!=null&&p.memoizedProps&&p!=null&&p.memoizedProps.args&&(x.args=p.memoizedProps.args),p!=null&&p.memoizedProps&&p!=null&&p.memoizedProps.attach&&(x.attach=p.memoizedProps.attach),{memoized:x,changes:E}}function Mo(n,i){var l;const o=n.__r3f,c=o==null?void 0:o.root,f=c==null||c.getState==null?void 0:c.getState(),{memoized:d,changes:h}=td(i)?i:ku(n,i),v=o==null?void 0:o.eventCount;n.__r3f&&(n.__r3f.memoizedProps=d);for(let E=0;E<h.length;E++){let[x,P,U,O]=h[E];if(Eo(n)){const H="srgb",j="srgb-linear";x==="encoding"?(x="colorSpace",P=P===3001?H:j):x==="outputEncoding"&&(x="outputColorSpace",P=P===3001?H:j)}let R=n,C=R[x];if(O.length&&(C=O.reduce((z,H)=>z[H],n),!(C&&C.set))){const[z,...H]=O.reverse();R=H.reverse().reduce((j,k)=>j[k],n),x=z}if(P===Uu+"remove")if(R.constructor){let z=ba.get(R.constructor);z||(z=new R.constructor,ba.set(R.constructor,z)),P=z[x]}else P=0;if(U&&o)P?o.handlers[x]=P:delete o.handlers[x],o.eventCount=Object.keys(o.handlers).length;else if(C&&C.set&&(C.copy||C instanceof xo)){if(Array.isArray(P))C.fromArray?C.fromArray(P):C.set(...P);else if(C.copy&&P&&P.constructor&&C.constructor===P.constructor)C.copy(P);else if(P!==void 0){var y;const z=(y=C)==null?void 0:y.isColor;!z&&C.setScalar?C.setScalar(P):C instanceof xo&&P instanceof xo?C.mask=P.mask:C.set(P),!Au()&&f&&!f.linear&&z&&C.convertSRGBToLinear()}}else{var p;if(R[x]=P,(p=R[x])!=null&&p.isTexture&&R[x].format===Sf&&R[x].type===Sn&&f){const z=R[x];Eo(z)&&Eo(f.gl)?z.colorSpace=f.gl.outputColorSpace:z.encoding=f.gl.outputEncoding}}ur(n)}if(o&&o.parent&&n.raycast&&v!==o.eventCount){const E=Ki(n).getState().internal,x=E.interaction.indexOf(n);x>-1&&E.interaction.splice(x,1),o.eventCount&&E.interaction.push(n)}return!(h.length===1&&h[0][0]==="onUpdate")&&h.length&&(l=n.__r3f)!=null&&l.parent&&Ho(n),n}function ur(n){var i,l;const o=(i=n.__r3f)==null||(l=i.root)==null||l.getState==null?void 0:l.getState();o&&o.internal.frames===0&&o.invalidate()}function Ho(n){n.onUpdate==null||n.onUpdate(n)}function id(n,i){n.manual||(Du(n)?(n.left=i.width/-2,n.right=i.width/2,n.top=i.height/2,n.bottom=i.height/-2):n.aspect=i.width/i.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Qi(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function sd(){var n;const i=typeof self<"u"&&self||typeof window<"u"&&window;if(!i)return fr.DefaultEventPriority;switch((n=i.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return fr.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return fr.ContinuousEventPriority;default:return fr.DefaultEventPriority}}function Lu(n,i,l,o){const c=l.get(i);c&&(l.delete(i),l.size===0&&(n.delete(o),c.target.releasePointerCapture(o)))}function od(n,i){const{internal:l}=n.getState();l.interaction=l.interaction.filter(o=>o!==i),l.initialHits=l.initialHits.filter(o=>o!==i),l.hovered.forEach((o,c)=>{(o.eventObject===i||o.object===i)&&l.hovered.delete(c)}),l.capturedMap.forEach((o,c)=>{Lu(l.capturedMap,i,o,c)})}function ld(n){function i(v){const{internal:y}=n.getState(),p=v.offsetX-y.initialClick[0],m=v.offsetY-y.initialClick[1];return Math.round(Math.sqrt(p*p+m*m))}function l(v){return v.filter(y=>["Move","Over","Enter","Out","Leave"].some(p=>{var m;return(m=y.__r3f)==null?void 0:m.handlers["onPointer"+p]}))}function o(v,y){const p=n.getState(),m=new Set,E=[],x=y?y(p.internal.interaction):p.internal.interaction;for(let R=0;R<x.length;R++){const C=Gr(x[R]);C&&(C.raycaster.camera=void 0)}p.previousRoot||p.events.compute==null||p.events.compute(v,p);function P(R){const C=Gr(R);if(!C||!C.events.enabled||C.raycaster.camera===null)return[];if(C.raycaster.camera===void 0){var z;C.events.compute==null||C.events.compute(v,C,(z=C.previousRoot)==null?void 0:z.getState()),C.raycaster.camera===void 0&&(C.raycaster.camera=null)}return C.raycaster.camera?C.raycaster.intersectObject(R,!0):[]}let U=x.flatMap(P).sort((R,C)=>{const z=Gr(R.object),H=Gr(C.object);return!z||!H?R.distance-C.distance:H.events.priority-z.events.priority||R.distance-C.distance}).filter(R=>{const C=Qi(R);return m.has(C)?!1:(m.add(C),!0)});p.events.filter&&(U=p.events.filter(U,p));for(const R of U){let C=R.object;for(;C;){var O;(O=C.__r3f)!=null&&O.eventCount&&E.push({...R,eventObject:C}),C=C.parent}}if("pointerId"in v&&p.internal.capturedMap.has(v.pointerId))for(let R of p.internal.capturedMap.get(v.pointerId).values())m.has(Qi(R.intersection))||E.push(R.intersection);return E}function c(v,y,p,m){const E=n.getState();if(v.length){const x={stopped:!1};for(const P of v){const U=Gr(P.object)||E,{raycaster:O,pointer:R,camera:C,internal:z}=U,H=new De(R.x,R.y,0).unproject(C),j=F=>{var N,$;return(N=($=z.capturedMap.get(F))==null?void 0:$.has(P.eventObject))!=null?N:!1},k=F=>{const N={intersection:P,target:y.target};z.capturedMap.has(F)?z.capturedMap.get(F).set(P.eventObject,N):z.capturedMap.set(F,new Map([[P.eventObject,N]])),y.target.setPointerCapture(F)},re=F=>{const N=z.capturedMap.get(F);N&&Lu(z.capturedMap,P.eventObject,N,F)};let X={};for(let F in y){let N=y[F];typeof N!="function"&&(X[F]=N)}let V={...P,...X,pointer:R,intersections:v,stopped:x.stopped,delta:p,unprojectedPoint:H,ray:O.ray,camera:C,stopPropagation(){const F="pointerId"in y&&z.capturedMap.get(y.pointerId);if((!F||F.has(P.eventObject))&&(V.stopped=x.stopped=!0,z.hovered.size&&Array.from(z.hovered.values()).find(N=>N.eventObject===P.eventObject))){const N=v.slice(0,v.indexOf(P));f([...N,P])}},target:{hasPointerCapture:j,setPointerCapture:k,releasePointerCapture:re},currentTarget:{hasPointerCapture:j,setPointerCapture:k,releasePointerCapture:re},nativeEvent:y};if(m(V),x.stopped===!0)break}}return v}function f(v){const{internal:y}=n.getState();for(const p of y.hovered.values())if(!v.length||!v.find(m=>m.object===p.object&&m.index===p.index&&m.instanceId===p.instanceId)){const E=p.eventObject.__r3f,x=E==null?void 0:E.handlers;if(y.hovered.delete(Qi(p)),E!=null&&E.eventCount){const P={...p,intersections:v};x.onPointerOut==null||x.onPointerOut(P),x.onPointerLeave==null||x.onPointerLeave(P)}}}function d(v,y){for(let p=0;p<y.length;p++){const m=y[p].__r3f;m==null||m.handlers.onPointerMissed==null||m.handlers.onPointerMissed(v)}}function h(v){switch(v){case"onPointerLeave":case"onPointerCancel":return()=>f([]);case"onLostPointerCapture":return y=>{const{internal:p}=n.getState();"pointerId"in y&&p.capturedMap.has(y.pointerId)&&requestAnimationFrame(()=>{p.capturedMap.has(y.pointerId)&&(p.capturedMap.delete(y.pointerId),f([]))})}}return function(p){const{onPointerMissed:m,internal:E}=n.getState();E.lastEvent.current=p;const x=v==="onPointerMove",P=v==="onClick"||v==="onContextMenu"||v==="onDoubleClick",O=o(p,x?l:void 0),R=P?i(p):0;v==="onPointerDown"&&(E.initialClick=[p.offsetX,p.offsetY],E.initialHits=O.map(z=>z.eventObject)),P&&!O.length&&R<=2&&(d(p,E.interaction),m&&m(p)),x&&f(O);function C(z){const H=z.eventObject,j=H.__r3f,k=j==null?void 0:j.handlers;if(j!=null&&j.eventCount)if(x){if(k.onPointerOver||k.onPointerEnter||k.onPointerOut||k.onPointerLeave){const re=Qi(z),X=E.hovered.get(re);X?X.stopped&&z.stopPropagation():(E.hovered.set(re,z),k.onPointerOver==null||k.onPointerOver(z),k.onPointerEnter==null||k.onPointerEnter(z))}k.onPointerMove==null||k.onPointerMove(z)}else{const re=k[v];re?(!P||E.initialHits.includes(H))&&(d(p,E.interaction.filter(X=>!E.initialHits.includes(X))),re(z)):P&&E.initialHits.includes(H)&&d(p,E.interaction.filter(X=>!E.initialHits.includes(X)))}}c(O,p,R,C)}}return{handlePointer:h}}const ju=n=>!!(n!=null&&n.render),Fu=M.createContext(null),ad=(n,i)=>{const l=Wf((h,v)=>{const y=new De,p=new De,m=new De;function E(R=v().camera,C=p,z=v().size){const{width:H,height:j,top:k,left:re}=z,X=H/j;C.isVector3?m.copy(C):m.set(...C);const V=R.getWorldPosition(y).distanceTo(m);if(Du(R))return{width:H/R.zoom,height:j/R.zoom,top:k,left:re,factor:1,distance:V,aspect:X};{const F=R.fov*Math.PI/180,N=2*Math.tan(F/2)*V,$=N*(H/j);return{width:$,height:N,top:k,left:re,factor:H/$,distance:V,aspect:X}}}let x;const P=R=>h(C=>({performance:{...C.performance,current:R}})),U=new Me;return{set:h,get:v,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(R=1)=>n(v(),R),advance:(R,C)=>i(R,C,v()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new yf,pointer:U,mouse:U,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const R=v();x&&clearTimeout(x),R.performance.current!==R.performance.min&&P(R.performance.min),x=setTimeout(()=>P(v().performance.max),R.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:E},setEvents:R=>h(C=>({...C,events:{...C.events,...R}})),setSize:(R,C,z,H,j)=>{const k=v().camera,re={width:R,height:C,top:H||0,left:j||0,updateStyle:z};h(X=>({size:re,viewport:{...X.viewport,...E(k,p,re)}}))},setDpr:R=>h(C=>{const z=Bu(R);return{viewport:{...C.viewport,dpr:z,initialDpr:C.viewport.initialDpr||z}}}),setFrameloop:(R="always")=>{const C=v().clock;C.stop(),C.elapsedTime=0,R!=="never"&&(C.start(),C.elapsedTime=0),h(()=>({frameloop:R}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:M.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(R,C,z)=>{const H=v().internal;return H.priority=H.priority+(C>0?1:0),H.subscribers.push({ref:R,priority:C,store:z}),H.subscribers=H.subscribers.sort((j,k)=>j.priority-k.priority),()=>{const j=v().internal;j!=null&&j.subscribers&&(j.priority=j.priority-(C>0?1:0),j.subscribers=j.subscribers.filter(k=>k.ref!==R))}}}}}),o=l.getState();let c=o.size,f=o.viewport.dpr,d=o.camera;return l.subscribe(()=>{const{camera:h,size:v,viewport:y,gl:p,set:m}=l.getState();if(v.width!==c.width||v.height!==c.height||y.dpr!==f){var E;c=v,f=y.dpr,id(h,v),p.setPixelRatio(y.dpr);const x=(E=v.updateStyle)!=null?E:typeof HTMLCanvasElement<"u"&&p.domElement instanceof HTMLCanvasElement;p.setSize(v.width,v.height,x)}h!==d&&(d=h,m(x=>({viewport:{...x.viewport,...x.viewport.getCurrentViewport(h)}})))}),l.subscribe(h=>n(h)),l};let Yi,ud=new Set,cd=new Set,fd=new Set;function To(n,i){if(n.size)for(const{callback:l}of n.values())l(i)}function Wr(n,i){switch(n){case"before":return To(ud,i);case"after":return To(cd,i);case"tail":return To(fd,i)}}let _o,Ro;function Po(n,i,l){let o=i.clock.getDelta();for(i.frameloop==="never"&&typeof n=="number"&&(o=n-i.clock.elapsedTime,i.clock.oldTime=i.clock.elapsedTime,i.clock.elapsedTime=n),_o=i.internal.subscribers,Yi=0;Yi<_o.length;Yi++)Ro=_o[Yi],Ro.ref.current(Ro.store.getState(),o,l);return!i.internal.priority&&i.gl.render&&i.gl.render(i.scene,i.camera),i.internal.frames=Math.max(0,i.internal.frames-1),i.frameloop==="always"?1:i.internal.frames}function dd(n){let i=!1,l=!1,o,c,f;function d(y){c=requestAnimationFrame(d),i=!0,o=0,Wr("before",y),l=!0;for(const m of n.values()){var p;f=m.store.getState(),f.internal.active&&(f.frameloop==="always"||f.internal.frames>0)&&!((p=f.gl.xr)!=null&&p.isPresenting)&&(o+=Po(y,f))}if(l=!1,Wr("after",y),o===0)return Wr("tail",y),i=!1,cancelAnimationFrame(c)}function h(y,p=1){var m;if(!y)return n.forEach(E=>h(E.store.getState(),p));(m=y.gl.xr)!=null&&m.isPresenting||!y.internal.active||y.frameloop==="never"||(p>1?y.internal.frames=Math.min(60,y.internal.frames+p):l?y.internal.frames=2:y.internal.frames=1,i||(i=!0,requestAnimationFrame(d)))}function v(y,p=!0,m,E){if(p&&Wr("before",y),m)Po(y,m,E);else for(const x of n.values())Po(y,x.store.getState());p&&Wr("after",y)}return{loop:d,invalidate:h,advance:v}}function bu(){const n=M.useContext(Fu);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function St(n=l=>l,i){return bu()(n,i)}function je(n,i=0){const l=bu(),o=l.getState().internal.subscribe,c=Nu(n);return Yr(()=>o(c,i,l),[i,o,l]),null}const Wa=new WeakMap;function Hu(n,i){return function(l,...o){let c=Wa.get(l);return c||(c=new l,Wa.set(l,c)),n&&n(c),Promise.all(o.map(f=>new Promise((d,h)=>c.load(f,v=>{v.scene&&Object.assign(v,nd(v.scene)),d(v)},i,v=>h(new Error(`Could not load ${f}: ${v==null?void 0:v.message}`))))))}}function en(n,i,l,o){const c=Array.isArray(i)?i:[i],f=Qf(Hu(l,o),[n,...c],{equal:Ce.equ});return Array.isArray(i)?f:f[0]}en.preload=function(n,i,l){const o=Array.isArray(i)?i:[i];return Yf(Hu(l),[n,...o])};en.clear=function(n,i){const l=Array.isArray(i)?i:[i];return Xf([n,...l])};const pr=new Map,{invalidate:Va,advance:Qa}=dd(pr),{reconciler:ts,applyProps:sr}=qf(pr,sd),or={objects:"shallow",strict:!1},pd=(n,i)=>{const l=typeof n=="function"?n(i):n;return ju(l)?l:new vf({powerPreference:"high-performance",canvas:i,antialias:!0,alpha:!0,...n})};function hd(n,i){const l=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(i){const{width:o,height:c,top:f,left:d,updateStyle:h=l}=i;return{width:o,height:c,top:f,left:d,updateStyle:h}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:o,height:c,top:f,left:d}=n.parentElement.getBoundingClientRect();return{width:o,height:c,top:f,left:d,updateStyle:l}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:l};return{width:0,height:0,top:0,left:0}}function md(n){const i=pr.get(n),l=i==null?void 0:i.fiber,o=i==null?void 0:i.store;i&&console.warn("R3F.createRoot should only be called once!");const c=typeof reportError=="function"?reportError:console.error,f=o||ad(Va,Qa),d=l||ts.createContainer(f,fr.ConcurrentRoot,null,!1,null,"",c,null);i||pr.set(n,{fiber:d,store:f});let h,v=!1,y;return{configure(p={}){let{gl:m,size:E,scene:x,events:P,onCreated:U,shadows:O=!1,linear:R=!1,flat:C=!1,legacy:z=!1,orthographic:H=!1,frameloop:j="always",dpr:k=[1,2],performance:re,raycaster:X,camera:V,onPointerMissed:F}=p,N=f.getState(),$=N.gl;N.gl||N.set({gl:$=pd(m,n)});let se=N.raycaster;se||N.set({raycaster:se=new df});const{params:Ne,...he}=X||{};if(Ce.equ(he,se,or)||sr(se,{...he}),Ce.equ(Ne,se.params,or)||sr(se,{params:{...se.params,...Ne}}),!N.camera||N.camera===y&&!Ce.equ(y,V,or)){y=V;const G=V instanceof gf,q=G?V:H?new Un(0,0,0,0,.1,1e3):new Bn(75,0,.1,1e3);G||(q.position.z=5,V&&(sr(q,V),("aspect"in V||"left"in V||"right"in V||"bottom"in V||"top"in V)&&(q.manual=!0,q.updateProjectionMatrix())),!N.camera&&!(V!=null&&V.rotation)&&q.lookAt(0,0,0)),N.set({camera:q}),se.camera=q}if(!N.scene){let G;x!=null&&x.isScene?G=x:(G=new Oo,x&&sr(G,x)),N.set({scene:ar(G)})}if(!N.xr){var _e;const G=(ie,ze)=>{const we=f.getState();we.frameloop!=="never"&&Qa(ie,!0,we,ze)},q=()=>{const ie=f.getState();ie.gl.xr.enabled=ie.gl.xr.isPresenting,ie.gl.xr.setAnimationLoop(ie.gl.xr.isPresenting?G:null),ie.gl.xr.isPresenting||Va(ie)},ae={connect(){const ie=f.getState().gl;ie.xr.addEventListener("sessionstart",q),ie.xr.addEventListener("sessionend",q)},disconnect(){const ie=f.getState().gl;ie.xr.removeEventListener("sessionstart",q),ie.xr.removeEventListener("sessionend",q)}};typeof((_e=$.xr)==null?void 0:_e.addEventListener)=="function"&&ae.connect(),N.set({xr:ae})}if($.shadowMap){const G=$.shadowMap.enabled,q=$.shadowMap.type;if($.shadowMap.enabled=!!O,Ce.boo(O))$.shadowMap.type=So;else if(Ce.str(O)){var Ee;const ae={basic:mf,percentage:hf,soft:So,variance:pf};$.shadowMap.type=(Ee=ae[O])!=null?Ee:So}else Ce.obj(O)&&Object.assign($.shadowMap,O);(G!==$.shadowMap.enabled||q!==$.shadowMap.type)&&($.shadowMap.needsUpdate=!0)}const B=Au();B&&("enabled"in B?B.enabled=!z:"legacyMode"in B&&(B.legacyMode=z)),v||sr($,{outputEncoding:R?3e3:3001,toneMapping:C?hu:mu}),N.legacy!==z&&N.set(()=>({legacy:z})),N.linear!==R&&N.set(()=>({linear:R})),N.flat!==C&&N.set(()=>({flat:C})),m&&!Ce.fun(m)&&!ju(m)&&!Ce.equ(m,$,or)&&sr($,m),P&&!N.events.handlers&&N.set({events:P(f)});const K=hd(n,E);return Ce.equ(K,N.size,or)||N.setSize(K.width,K.height,K.updateStyle,K.top,K.left),k&&N.viewport.dpr!==Bu(k)&&N.setDpr(k),N.frameloop!==j&&N.setFrameloop(j),N.onPointerMissed||N.set({onPointerMissed:F}),re&&!Ce.equ(re,N.performance,or)&&N.set(G=>({performance:{...G.performance,...re}})),h=U,v=!0,this},render(p){return v||this.configure(),ts.updateContainer(T.jsx(vd,{store:f,children:p,onCreated:h,rootElement:n}),d,null,()=>{}),f},unmount(){Gu(n)}}}function vd({store:n,children:i,onCreated:l,rootElement:o}){return Yr(()=>{const c=n.getState();c.set(f=>({internal:{...f.internal,active:!0}})),l&&l(c),n.getState().events.connected||c.events.connect==null||c.events.connect(o)},[]),T.jsx(Fu.Provider,{value:n,children:i})}function Gu(n,i){const l=pr.get(n),o=l==null?void 0:l.fiber;if(o){const c=l==null?void 0:l.store.getState();c&&(c.internal.active=!1),ts.updateContainer(null,o,null,()=>{c&&setTimeout(()=>{try{var f,d,h,v;c.events.disconnect==null||c.events.disconnect(),(f=c.gl)==null||(d=f.renderLists)==null||d.dispose==null||d.dispose(),(h=c.gl)==null||h.forceContextLoss==null||h.forceContextLoss(),(v=c.gl)!=null&&v.xr&&c.xr.disconnect(),rd(c),pr.delete(n)}catch{}},500)})}}ts.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:M.version});const Co={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function gd(n){const{handlePointer:i}=ld(n);return{priority:1,enabled:!0,compute(l,o,c){o.pointer.set(l.offsetX/o.size.width*2-1,-(l.offsetY/o.size.height)*2+1),o.raycaster.setFromCamera(o.pointer,o.camera)},connected:void 0,handlers:Object.keys(Co).reduce((l,o)=>({...l,[o]:i(o)}),{}),update:()=>{var l;const{events:o,internal:c}=n.getState();(l=c.lastEvent)!=null&&l.current&&o.handlers&&o.handlers.onPointerMove(c.lastEvent.current)},connect:l=>{var o;const{set:c,events:f}=n.getState();f.disconnect==null||f.disconnect(),c(d=>({events:{...d.events,connected:l}})),Object.entries((o=f.handlers)!=null?o:[]).forEach(([d,h])=>{const[v,y]=Co[d];l.addEventListener(v,h,{passive:y})})},disconnect:()=>{const{set:l,events:o}=n.getState();if(o.connected){var c;Object.entries((c=o.handlers)!=null?c:[]).forEach(([f,d])=>{if(o&&o.connected instanceof HTMLElement){const[h]=Co[f];o.connected.removeEventListener(h,d)}}),l(f=>({events:{...f.events,connected:void 0}}))}}}}function Ya(n,i){let l;return(...o)=>{window.clearTimeout(l),l=window.setTimeout(()=>n(...o),i)}}function yd({debounce:n,scroll:i,polyfill:l,offsetSize:o}={debounce:0,scroll:!1,offsetSize:!1}){const c=l||(typeof window>"u"?class{}:window.ResizeObserver);if(!c)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[f,d]=M.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),h=M.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:f,orientationHandler:null}),v=n?typeof n=="number"?n:n.scroll:null,y=n?typeof n=="number"?n:n.resize:null,p=M.useRef(!1);M.useEffect(()=>(p.current=!0,()=>void(p.current=!1)));const[m,E,x]=M.useMemo(()=>{const R=()=>{if(!h.current.element)return;const{left:C,top:z,width:H,height:j,bottom:k,right:re,x:X,y:V}=h.current.element.getBoundingClientRect(),F={left:C,top:z,width:H,height:j,bottom:k,right:re,x:X,y:V};h.current.element instanceof HTMLElement&&o&&(F.height=h.current.element.offsetHeight,F.width=h.current.element.offsetWidth),Object.freeze(F),p.current&&!wd(h.current.lastBounds,F)&&d(h.current.lastBounds=F)};return[R,y?Ya(R,y):R,v?Ya(R,v):R]},[d,o,v,y]);function P(){h.current.scrollContainers&&(h.current.scrollContainers.forEach(R=>R.removeEventListener("scroll",x,!0)),h.current.scrollContainers=null),h.current.resizeObserver&&(h.current.resizeObserver.disconnect(),h.current.resizeObserver=null),h.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",h.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",h.current.orientationHandler))}function U(){h.current.element&&(h.current.resizeObserver=new c(x),h.current.resizeObserver.observe(h.current.element),i&&h.current.scrollContainers&&h.current.scrollContainers.forEach(R=>R.addEventListener("scroll",x,{capture:!0,passive:!0})),h.current.orientationHandler=()=>{x()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",h.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",h.current.orientationHandler))}const O=R=>{!R||R===h.current.element||(P(),h.current.element=R,h.current.scrollContainers=Wu(R),U())};return xd(x,!!i),Sd(E),M.useEffect(()=>{P(),U()},[i,x,E]),M.useEffect(()=>P,[]),[O,f,m]}function Sd(n){M.useEffect(()=>{const i=n;return window.addEventListener("resize",i),()=>void window.removeEventListener("resize",i)},[n])}function xd(n,i){M.useEffect(()=>{if(i){const l=n;return window.addEventListener("scroll",l,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",l,!0)}},[n,i])}function Wu(n){const i=[];if(!n||n===document.body)return i;const{overflow:l,overflowX:o,overflowY:c}=window.getComputedStyle(n);return[l,o,c].some(f=>f==="auto"||f==="scroll")&&i.push(n),[...i,...Wu(n.parentElement)]}const Ed=["x","y","top","bottom","left","right","width","height"],wd=(n,i)=>Ed.every(l=>n[l]===i[l]);var Md=Object.defineProperty,Td=Object.defineProperties,_d=Object.getOwnPropertyDescriptors,Xa=Object.getOwnPropertySymbols,Rd=Object.prototype.hasOwnProperty,Pd=Object.prototype.propertyIsEnumerable,Ka=(n,i,l)=>i in n?Md(n,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[i]=l,Za=(n,i)=>{for(var l in i||(i={}))Rd.call(i,l)&&Ka(n,l,i[l]);if(Xa)for(var l of Xa(i))Pd.call(i,l)&&Ka(n,l,i[l]);return n},Cd=(n,i)=>Td(n,_d(i)),Ja,qa;typeof window<"u"&&((Ja=window.document)!=null&&Ja.createElement||((qa=window.navigator)==null?void 0:qa.product)==="ReactNative")?M.useLayoutEffect:M.useEffect;function Vu(n,i,l){if(!n)return;if(l(n)===!0)return n;let o=n.child;for(;o;){const c=Vu(o,i,l);if(c)return c;o=o.sibling}}function Qu(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const $a=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=$a;return}return $a.apply(this,arguments)};const Ko=Qu(M.createContext(null));class Yu extends M.Component{render(){return M.createElement(Ko.Provider,{value:this._reactInternals},this.props.children)}}function Id(){const n=M.useContext(Ko);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const i=M.useId();return M.useMemo(()=>{for(const o of[n,n==null?void 0:n.alternate]){if(!o)continue;const c=Vu(o,!1,f=>{let d=f.memoizedState;for(;d;){if(d.memoizedState===i)return!0;d=d.next}});if(c)return c}},[n,i])}function zd(){const n=Id(),[i]=M.useState(()=>new Map);i.clear();let l=n;for(;l;){if(l.type&&typeof l.type=="object"){const c=l.type._context===void 0&&l.type.Provider===l.type?l.type:l.type._context;c&&c!==Ko&&!i.has(c)&&i.set(c,M.useContext(Qu(c)))}l=l.return}return i}function Ad(){const n=zd();return M.useMemo(()=>Array.from(n.keys()).reduce((i,l)=>o=>M.createElement(i,null,M.createElement(l.Provider,Cd(Za({},o),{value:n.get(l)}))),i=>M.createElement(Yu,Za({},i))),[n])}const Dd=M.forwardRef(function({children:i,fallback:l,resize:o,style:c,gl:f,events:d=gd,eventSource:h,eventPrefix:v,shadows:y,linear:p,flat:m,legacy:E,orthographic:x,frameloop:P,dpr:U,performance:O,raycaster:R,camera:C,scene:z,onPointerMissed:H,onCreated:j,...k},re){M.useMemo(()=>zu(xf),[]);const X=Ad(),[V,F]=yd({scroll:!0,debounce:{scroll:50,resize:0},...o}),N=M.useRef(null),$=M.useRef(null);M.useImperativeHandle(re,()=>N.current);const se=Nu(H),[Ne,he]=M.useState(!1),[_e,Ee]=M.useState(!1);if(Ne)throw Ne;if(_e)throw _e;const B=M.useRef(null);Yr(()=>{const G=N.current;F.width>0&&F.height>0&&G&&(B.current||(B.current=md(G)),B.current.configure({gl:f,events:d,shadows:y,linear:p,flat:m,legacy:E,orthographic:x,frameloop:P,dpr:U,performance:O,raycaster:R,camera:C,scene:z,size:F,onPointerMissed:(...q)=>se.current==null?void 0:se.current(...q),onCreated:q=>{q.events.connect==null||q.events.connect(h?$f(h)?h.current:h:$.current),v&&q.setEvents({compute:(ae,ie)=>{const ze=ae[v+"X"],we=ae[v+"Y"];ie.pointer.set(ze/ie.size.width*2-1,-(we/ie.size.height)*2+1),ie.raycaster.setFromCamera(ie.pointer,ie.camera)}}),j==null||j(q)}}),B.current.render(T.jsx(X,{children:T.jsx(Ou,{set:Ee,children:T.jsx(M.Suspense,{fallback:T.jsx(ed,{set:he}),children:i??null})})})))}),M.useEffect(()=>{const G=N.current;if(G)return()=>Gu(G)},[]);const K=h?"none":"auto";return T.jsx("div",{ref:$,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:K,...c},...k,children:T.jsx("div",{ref:V,style:{width:"100%",height:"100%"},children:T.jsx("canvas",{ref:N,style:{display:"block"},children:l})})})}),Nd=M.forwardRef(function(i,l){return T.jsx(Yu,{children:T.jsx(Dd,{...i,ref:l})})});function ns(){return ns=Object.assign?Object.assign.bind():function(n){for(var i=1;i<arguments.length;i++){var l=arguments[i];for(var o in l)({}).hasOwnProperty.call(l,o)&&(n[o]=l[o])}return n},ns.apply(null,arguments)}const Xr=new De,Zo=new De,Od=new De,eu=new Me;function Ud(n,i,l){const o=Xr.setFromMatrixPosition(n.matrixWorld);o.project(i);const c=l.width/2,f=l.height/2;return[o.x*c+c,-(o.y*f)+f]}function Bd(n,i){const l=Xr.setFromMatrixPosition(n.matrixWorld),o=Zo.setFromMatrixPosition(i.matrixWorld),c=l.sub(o),f=i.getWorldDirection(Od);return c.angleTo(f)>Math.PI/2}function kd(n,i,l,o){const c=Xr.setFromMatrixPosition(n.matrixWorld),f=c.clone();f.project(i),eu.set(f.x,f.y),l.setFromCamera(eu,i);const d=l.intersectObjects(o,!0);if(d.length){const h=d[0].distance;return c.distanceTo(l.ray.origin)<h}return!0}function Ld(n,i){if(i instanceof Un)return i.zoom;if(i instanceof Bn){const l=Xr.setFromMatrixPosition(n.matrixWorld),o=Zo.setFromMatrixPosition(i.matrixWorld),c=i.fov*Math.PI/180,f=l.distanceTo(o);return 1/(2*Math.tan(c/2)*f)}else return 1}function jd(n,i,l){if(i instanceof Bn||i instanceof Un){const o=Xr.setFromMatrixPosition(n.matrixWorld),c=Zo.setFromMatrixPosition(i.matrixWorld),f=o.distanceTo(c),d=(l[1]-l[0])/(i.far-i.near),h=l[1]-d*i.far;return Math.round(d*f+h)}}const Go=n=>Math.abs(n)<1e-10?0:n;function Xu(n,i,l=""){let o="matrix3d(";for(let c=0;c!==16;c++)o+=Go(i[c]*n.elements[c])+(c!==15?",":")");return l+o}const Fd=(n=>i=>Xu(i,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),bd=(n=>(i,l)=>Xu(i,n(l),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function Hd(n){return n&&typeof n=="object"&&"current"in n}const Jo=M.forwardRef(({children:n,eps:i=.001,style:l,className:o,prepend:c,center:f,fullscreen:d,portal:h,distanceFactor:v,sprite:y=!1,transform:p=!1,occlude:m,onOcclude:E,castShadow:x,receiveShadow:P,material:U,geometry:O,zIndexRange:R=[16777271,0],calculatePosition:C=Ud,as:z="div",wrapperClass:H,pointerEvents:j="auto",...k},re)=>{const{gl:X,camera:V,scene:F,size:N,raycaster:$,events:se,viewport:Ne}=St(),[he]=M.useState(()=>document.createElement(z)),_e=M.useRef(),Ee=M.useRef(null),B=M.useRef(0),K=M.useRef([0,0]),G=M.useRef(null),q=M.useRef(null),ae=(h==null?void 0:h.current)||se.connected||X.domElement.parentNode,ie=M.useRef(null),ze=M.useRef(!1),we=M.useMemo(()=>m&&m!=="blending"||Array.isArray(m)&&m.length&&Hd(m[0]),[m]);M.useLayoutEffect(()=>{const Ue=X.domElement;m&&m==="blending"?(Ue.style.zIndex=`${Math.floor(R[0]/2)}`,Ue.style.position="absolute",Ue.style.pointerEvents="none"):(Ue.style.zIndex=null,Ue.style.position=null,Ue.style.pointerEvents=null)},[m]),M.useLayoutEffect(()=>{if(Ee.current){const Ue=_e.current=Ef(he);if(F.updateMatrixWorld(),p)he.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ue=C(Ee.current,V,N);he.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ue[0]}px,${ue[1]}px,0);transform-origin:0 0;`}return ae&&(c?ae.prepend(he):ae.appendChild(he)),()=>{ae&&ae.removeChild(he),Ue.unmount()}}},[ae,p]),M.useLayoutEffect(()=>{H&&(he.className=H)},[H]);const Oe=M.useMemo(()=>p?{position:"absolute",top:0,left:0,width:N.width,height:N.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:f?"translate3d(-50%,-50%,0)":"none",...d&&{top:-N.height/2,left:-N.width/2,width:N.width,height:N.height},...l},[l,f,d,N,p]),Ke=M.useMemo(()=>({position:"absolute",pointerEvents:j}),[j]);M.useLayoutEffect(()=>{if(ze.current=!1,p){var Ue;(Ue=_e.current)==null||Ue.render(M.createElement("div",{ref:G,style:Oe},M.createElement("div",{ref:q,style:Ke},M.createElement("div",{ref:re,className:o,style:l,children:n}))))}else{var ue;(ue=_e.current)==null||ue.render(M.createElement("div",{ref:re,style:Oe,className:o,children:n}))}});const Ze=M.useRef(!0);je(Ue=>{if(Ee.current){V.updateMatrixWorld(),Ee.current.updateWorldMatrix(!0,!1);const ue=p?K.current:C(Ee.current,V,N);if(p||Math.abs(B.current-V.zoom)>i||Math.abs(K.current[0]-ue[0])>i||Math.abs(K.current[1]-ue[1])>i){const Ge=Bd(Ee.current,V);let Re=!1;we&&(Array.isArray(m)?Re=m.map(xt=>xt.current):m!=="blending"&&(Re=[F]));const kt=Ze.current;if(Re){const xt=kd(Ee.current,V,$,Re);Ze.current=xt&&!Ge}else Ze.current=!Ge;kt!==Ze.current&&(E?E(!Ze.current):he.style.display=Ze.current?"block":"none");const nn=Math.floor(R[0]/2),mr=m?we?[R[0],nn]:[nn-1,0]:R;if(he.style.zIndex=`${jd(Ee.current,V,mr)}`,p){const[xt,xn]=[N.width/2,N.height/2],rn=V.projectionMatrix.elements[5]*xn,{isOrthographicCamera:Lt,top:vr,left:bn,bottom:En,right:ht}=V,gr=Fd(V.matrixWorldInverse),yr=Lt?`scale(${rn})translate(${Go(-(ht+bn)/2)}px,${Go((vr+En)/2)}px)`:`translateZ(${rn}px)`;let Et=Ee.current.matrixWorld;y&&(Et=V.matrixWorldInverse.clone().transpose().copyPosition(Et).scale(Ee.current.scale),Et.elements[3]=Et.elements[7]=Et.elements[11]=0,Et.elements[15]=1),he.style.width=N.width+"px",he.style.height=N.height+"px",he.style.perspective=Lt?"":`${rn}px`,G.current&&q.current&&(G.current.style.transform=`${yr}${gr}translate(${xt}px,${xn}px)`,q.current.style.transform=bd(Et,1/((v||10)/400)))}else{const xt=v===void 0?1:Ld(Ee.current,V)*v;he.style.transform=`translate3d(${ue[0]}px,${ue[1]}px,0) scale(${xt})`}K.current=ue,B.current=V.zoom}}if(!we&&ie.current&&!ze.current)if(p){if(G.current){const ue=G.current.children[0];if(ue!=null&&ue.clientWidth&&ue!=null&&ue.clientHeight){const{isOrthographicCamera:Ge}=V;if(Ge||O)k.scale&&(Array.isArray(k.scale)?k.scale instanceof De?ie.current.scale.copy(k.scale.clone().divideScalar(1)):ie.current.scale.set(1/k.scale[0],1/k.scale[1],1/k.scale[2]):ie.current.scale.setScalar(1/k.scale));else{const Re=(v||10)/400,kt=ue.clientWidth*Re,nn=ue.clientHeight*Re;ie.current.scale.set(kt,nn,1)}ze.current=!0}}}else{const ue=he.children[0];if(ue!=null&&ue.clientWidth&&ue!=null&&ue.clientHeight){const Ge=1/Ne.factor,Re=ue.clientWidth*Ge,kt=ue.clientHeight*Ge;ie.current.scale.set(Re,kt,1),ze.current=!0}ie.current.lookAt(Ue.camera.position)}});const ot=M.useMemo(()=>({vertexShader:p?void 0:`
|
|
36
|
+
/*
|
|
37
|
+
This shader is from the THREE's SpriteMaterial.
|
|
38
|
+
We need to turn the backing plane into a Sprite
|
|
39
|
+
(make it always face the camera) if "transfrom"
|
|
40
|
+
is false.
|
|
41
|
+
*/
|
|
42
|
+
#include <common>
|
|
43
|
+
|
|
44
|
+
void main() {
|
|
45
|
+
vec2 center = vec2(0., 1.);
|
|
46
|
+
float rotation = 0.0;
|
|
47
|
+
|
|
48
|
+
// This is somewhat arbitrary, but it seems to work well
|
|
49
|
+
// Need to figure out how to derive this dynamically if it even matters
|
|
50
|
+
float size = 0.03;
|
|
51
|
+
|
|
52
|
+
vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
53
|
+
vec2 scale;
|
|
54
|
+
scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
|
|
55
|
+
scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
|
|
56
|
+
|
|
57
|
+
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
58
|
+
if ( isPerspective ) scale *= - mvPosition.z;
|
|
59
|
+
|
|
60
|
+
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
|
|
61
|
+
vec2 rotatedPosition;
|
|
62
|
+
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
|
|
63
|
+
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
|
|
64
|
+
mvPosition.xy += rotatedPosition;
|
|
65
|
+
|
|
66
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
67
|
+
}
|
|
68
|
+
`,fragmentShader:`
|
|
69
|
+
void main() {
|
|
70
|
+
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
71
|
+
}
|
|
72
|
+
`}),[p]);return M.createElement("group",ns({},k,{ref:Ee}),m&&!we&&M.createElement("mesh",{castShadow:x,receiveShadow:P,ref:ie},O||M.createElement("planeGeometry",null),U||M.createElement("shaderMaterial",{side:Dn,vertexShader:ot.vertexShader,fragmentShader:ot.fragmentShader})))});let Vr;function Gd(){var n;if(Vr!==void 0)return Vr;try{let i;const l=document.createElement("canvas");return Vr=!!(window.WebGL2RenderingContext&&(i=l.getContext("webgl2"))),i&&((n=i.getExtension("WEBGL_lose_context"))==null||n.loseContext()),Vr}catch{return Vr=!1}}var Wd=Object.defineProperty,Vd=(n,i,l)=>i in n?Wd(n,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[i]=l,Qd=(n,i,l)=>(Vd(n,i+"",l),l);class Yd{constructor(){Qd(this,"_listeners")}addEventListener(i,l){this._listeners===void 0&&(this._listeners={});const o=this._listeners;o[i]===void 0&&(o[i]=[]),o[i].indexOf(l)===-1&&o[i].push(l)}hasEventListener(i,l){if(this._listeners===void 0)return!1;const o=this._listeners;return o[i]!==void 0&&o[i].indexOf(l)!==-1}removeEventListener(i,l){if(this._listeners===void 0)return;const c=this._listeners[i];if(c!==void 0){const f=c.indexOf(l);f!==-1&&c.splice(f,1)}}dispatchEvent(i){if(this._listeners===void 0)return;const o=this._listeners[i.type];if(o!==void 0){i.target=this;const c=o.slice(0);for(let f=0,d=c.length;f<d;f++)c[f].call(this,i);i.target=null}}}var Xd=Object.defineProperty,Kd=(n,i,l)=>i in n?Xd(n,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[i]=l,te=(n,i,l)=>(Kd(n,typeof i!="symbol"?i+"":i,l),l);const Xi=new wf,tu=new Mf,Zd=Math.cos(70*(Math.PI/180)),nu=(n,i)=>(n%i+i)%i;let Jd=class extends Yd{constructor(i,l){super(),te(this,"object"),te(this,"domElement"),te(this,"enabled",!0),te(this,"target",new De),te(this,"minDistance",0),te(this,"maxDistance",1/0),te(this,"minZoom",0),te(this,"maxZoom",1/0),te(this,"minPolarAngle",0),te(this,"maxPolarAngle",Math.PI),te(this,"minAzimuthAngle",-1/0),te(this,"maxAzimuthAngle",1/0),te(this,"enableDamping",!1),te(this,"dampingFactor",.05),te(this,"enableZoom",!0),te(this,"zoomSpeed",1),te(this,"enableRotate",!0),te(this,"rotateSpeed",1),te(this,"enablePan",!0),te(this,"panSpeed",1),te(this,"screenSpacePanning",!0),te(this,"keyPanSpeed",7),te(this,"zoomToCursor",!1),te(this,"autoRotate",!1),te(this,"autoRotateSpeed",2),te(this,"reverseOrbit",!1),te(this,"reverseHorizontalOrbit",!1),te(this,"reverseVerticalOrbit",!1),te(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),te(this,"mouseButtons",{LEFT:rr.ROTATE,MIDDLE:rr.DOLLY,RIGHT:rr.PAN}),te(this,"touches",{ONE:ir.ROTATE,TWO:ir.DOLLY_PAN}),te(this,"target0"),te(this,"position0"),te(this,"zoom0"),te(this,"_domElementKeyEvents",null),te(this,"getPolarAngle"),te(this,"getAzimuthalAngle"),te(this,"setPolarAngle"),te(this,"setAzimuthalAngle"),te(this,"getDistance"),te(this,"getZoomScale"),te(this,"listenToKeyEvents"),te(this,"stopListenToKeyEvents"),te(this,"saveState"),te(this,"reset"),te(this,"update"),te(this,"connect"),te(this,"dispose"),te(this,"dollyIn"),te(this,"dollyOut"),te(this,"getScale"),te(this,"setScale"),this.object=i,this.domElement=l,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>p.phi,this.getAzimuthalAngle=()=>p.theta,this.setPolarAngle=_=>{let b=nu(_,2*Math.PI),ne=p.phi;ne<0&&(ne+=2*Math.PI),b<0&&(b+=2*Math.PI);let me=Math.abs(b-ne);2*Math.PI-me<me&&(b<ne?b+=2*Math.PI:ne+=2*Math.PI),m.phi=b-ne,o.update()},this.setAzimuthalAngle=_=>{let b=nu(_,2*Math.PI),ne=p.theta;ne<0&&(ne+=2*Math.PI),b<0&&(b+=2*Math.PI);let me=Math.abs(b-ne);2*Math.PI-me<me&&(b<ne?b+=2*Math.PI:ne+=2*Math.PI),m.theta=b-ne,o.update()},this.getDistance=()=>o.object.position.distanceTo(o.target),this.listenToKeyEvents=_=>{_.addEventListener("keydown",Sr),this._domElementKeyEvents=_},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",Sr),this._domElementKeyEvents=null},this.saveState=()=>{o.target0.copy(o.target),o.position0.copy(o.object.position),o.zoom0=o.object.zoom},this.reset=()=>{o.target.copy(o.target0),o.object.position.copy(o.position0),o.object.zoom=o.zoom0,o.object.updateProjectionMatrix(),o.dispatchEvent(c),o.update(),v=h.NONE},this.update=(()=>{const _=new De,b=new De(0,1,0),ne=new Bo().setFromUnitVectors(i.up,b),me=ne.clone().invert(),Fe=new De,At=new Bo,jt=2*Math.PI;return function(){const Er=o.object.position;ne.setFromUnitVectors(i.up,b),me.copy(ne).invert(),_.copy(Er).sub(o.target),_.applyQuaternion(ne),p.setFromVector3(_),o.autoRotate&&v===h.NONE&&Ne($()),o.enableDamping?(p.theta+=m.theta*o.dampingFactor,p.phi+=m.phi*o.dampingFactor):(p.theta+=m.theta,p.phi+=m.phi);let wt=o.minAzimuthAngle,Dt=o.maxAzimuthAngle;isFinite(wt)&&isFinite(Dt)&&(wt<-Math.PI?wt+=jt:wt>Math.PI&&(wt-=jt),Dt<-Math.PI?Dt+=jt:Dt>Math.PI&&(Dt-=jt),wt<=Dt?p.theta=Math.max(wt,Math.min(Dt,p.theta)):p.theta=p.theta>(wt+Dt)/2?Math.max(wt,p.theta):Math.min(Dt,p.theta)),p.phi=Math.max(o.minPolarAngle,Math.min(o.maxPolarAngle,p.phi)),p.makeSafe(),o.enableDamping===!0?o.target.addScaledVector(x,o.dampingFactor):o.target.add(x),o.zoomToCursor&&V||o.object.isOrthographicCamera?p.radius=ie(p.radius):p.radius=ie(p.radius*E),_.setFromSpherical(p),_.applyQuaternion(me),Er.copy(o.target).add(_),o.object.matrixAutoUpdate||o.object.updateMatrix(),o.object.lookAt(o.target),o.enableDamping===!0?(m.theta*=1-o.dampingFactor,m.phi*=1-o.dampingFactor,x.multiplyScalar(1-o.dampingFactor)):(m.set(0,0,0),x.set(0,0,0));let sn=!1;if(o.zoomToCursor&&V){let on=null;if(o.object instanceof Bn&&o.object.isPerspectiveCamera){const ln=_.length();on=ie(ln*E);const Hn=ln-on;o.object.position.addScaledVector(re,Hn),o.object.updateMatrixWorld()}else if(o.object.isOrthographicCamera){const ln=new De(X.x,X.y,0);ln.unproject(o.object),o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom/E)),o.object.updateProjectionMatrix(),sn=!0;const Hn=new De(X.x,X.y,0);Hn.unproject(o.object),o.object.position.sub(Hn).add(ln),o.object.updateMatrixWorld(),on=_.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),o.zoomToCursor=!1;on!==null&&(o.screenSpacePanning?o.target.set(0,0,-1).transformDirection(o.object.matrix).multiplyScalar(on).add(o.object.position):(Xi.origin.copy(o.object.position),Xi.direction.set(0,0,-1).transformDirection(o.object.matrix),Math.abs(o.object.up.dot(Xi.direction))<Zd?i.lookAt(o.target):(tu.setFromNormalAndCoplanarPoint(o.object.up,o.target),Xi.intersectPlane(tu,o.target))))}else o.object instanceof Un&&o.object.isOrthographicCamera&&(sn=E!==1,sn&&(o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom/E)),o.object.updateProjectionMatrix()));return E=1,V=!1,sn||Fe.distanceToSquared(o.object.position)>y||8*(1-At.dot(o.object.quaternion))>y?(o.dispatchEvent(c),Fe.copy(o.object.position),At.copy(o.object.quaternion),sn=!1,!0):!1}})(),this.connect=_=>{o.domElement=_,o.domElement.style.touchAction="none",o.domElement.addEventListener("contextmenu",Zr),o.domElement.addEventListener("pointerdown",bn),o.domElement.addEventListener("pointercancel",ht),o.domElement.addEventListener("wheel",Et)},this.dispose=()=>{var _,b,ne,me,Fe,At;o.domElement&&(o.domElement.style.touchAction="auto"),(_=o.domElement)==null||_.removeEventListener("contextmenu",Zr),(b=o.domElement)==null||b.removeEventListener("pointerdown",bn),(ne=o.domElement)==null||ne.removeEventListener("pointercancel",ht),(me=o.domElement)==null||me.removeEventListener("wheel",Et),(Fe=o.domElement)==null||Fe.ownerDocument.removeEventListener("pointermove",En),(At=o.domElement)==null||At.ownerDocument.removeEventListener("pointerup",ht),o._domElementKeyEvents!==null&&o._domElementKeyEvents.removeEventListener("keydown",Sr)};const o=this,c={type:"change"},f={type:"start"},d={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let v=h.NONE;const y=1e-6,p=new Uo,m=new Uo;let E=1;const x=new De,P=new Me,U=new Me,O=new Me,R=new Me,C=new Me,z=new Me,H=new Me,j=new Me,k=new Me,re=new De,X=new Me;let V=!1;const F=[],N={};function $(){return 2*Math.PI/60/60*o.autoRotateSpeed}function se(){return Math.pow(.95,o.zoomSpeed)}function Ne(_){o.reverseOrbit||o.reverseHorizontalOrbit?m.theta+=_:m.theta-=_}function he(_){o.reverseOrbit||o.reverseVerticalOrbit?m.phi+=_:m.phi-=_}const _e=(()=>{const _=new De;return function(ne,me){_.setFromMatrixColumn(me,0),_.multiplyScalar(-ne),x.add(_)}})(),Ee=(()=>{const _=new De;return function(ne,me){o.screenSpacePanning===!0?_.setFromMatrixColumn(me,1):(_.setFromMatrixColumn(me,0),_.crossVectors(o.object.up,_)),_.multiplyScalar(ne),x.add(_)}})(),B=(()=>{const _=new De;return function(ne,me){const Fe=o.domElement;if(Fe&&o.object instanceof Bn&&o.object.isPerspectiveCamera){const At=o.object.position;_.copy(At).sub(o.target);let jt=_.length();jt*=Math.tan(o.object.fov/2*Math.PI/180),_e(2*ne*jt/Fe.clientHeight,o.object.matrix),Ee(2*me*jt/Fe.clientHeight,o.object.matrix)}else Fe&&o.object instanceof Un&&o.object.isOrthographicCamera?(_e(ne*(o.object.right-o.object.left)/o.object.zoom/Fe.clientWidth,o.object.matrix),Ee(me*(o.object.top-o.object.bottom)/o.object.zoom/Fe.clientHeight,o.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),o.enablePan=!1)}})();function K(_){o.object instanceof Bn&&o.object.isPerspectiveCamera||o.object instanceof Un&&o.object.isOrthographicCamera?E=_:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),o.enableZoom=!1)}function G(_){K(E/_)}function q(_){K(E*_)}function ae(_){if(!o.zoomToCursor||!o.domElement)return;V=!0;const b=o.domElement.getBoundingClientRect(),ne=_.clientX-b.left,me=_.clientY-b.top,Fe=b.width,At=b.height;X.x=ne/Fe*2-1,X.y=-(me/At)*2+1,re.set(X.x,X.y,1).unproject(o.object).sub(o.object.position).normalize()}function ie(_){return Math.max(o.minDistance,Math.min(o.maxDistance,_))}function ze(_){P.set(_.clientX,_.clientY)}function we(_){ae(_),H.set(_.clientX,_.clientY)}function Oe(_){R.set(_.clientX,_.clientY)}function Ke(_){U.set(_.clientX,_.clientY),O.subVectors(U,P).multiplyScalar(o.rotateSpeed);const b=o.domElement;b&&(Ne(2*Math.PI*O.x/b.clientHeight),he(2*Math.PI*O.y/b.clientHeight)),P.copy(U),o.update()}function Ze(_){j.set(_.clientX,_.clientY),k.subVectors(j,H),k.y>0?G(se()):k.y<0&&q(se()),H.copy(j),o.update()}function ot(_){C.set(_.clientX,_.clientY),z.subVectors(C,R).multiplyScalar(o.panSpeed),B(z.x,z.y),R.copy(C),o.update()}function Ue(_){ae(_),_.deltaY<0?q(se()):_.deltaY>0&&G(se()),o.update()}function ue(_){let b=!1;switch(_.code){case o.keys.UP:B(0,o.keyPanSpeed),b=!0;break;case o.keys.BOTTOM:B(0,-o.keyPanSpeed),b=!0;break;case o.keys.LEFT:B(o.keyPanSpeed,0),b=!0;break;case o.keys.RIGHT:B(-o.keyPanSpeed,0),b=!0;break}b&&(_.preventDefault(),o.update())}function Ge(){if(F.length==1)P.set(F[0].pageX,F[0].pageY);else{const _=.5*(F[0].pageX+F[1].pageX),b=.5*(F[0].pageY+F[1].pageY);P.set(_,b)}}function Re(){if(F.length==1)R.set(F[0].pageX,F[0].pageY);else{const _=.5*(F[0].pageX+F[1].pageX),b=.5*(F[0].pageY+F[1].pageY);R.set(_,b)}}function kt(){const _=F[0].pageX-F[1].pageX,b=F[0].pageY-F[1].pageY,ne=Math.sqrt(_*_+b*b);H.set(0,ne)}function nn(){o.enableZoom&&kt(),o.enablePan&&Re()}function mr(){o.enableZoom&&kt(),o.enableRotate&&Ge()}function xt(_){if(F.length==1)U.set(_.pageX,_.pageY);else{const ne=xr(_),me=.5*(_.pageX+ne.x),Fe=.5*(_.pageY+ne.y);U.set(me,Fe)}O.subVectors(U,P).multiplyScalar(o.rotateSpeed);const b=o.domElement;b&&(Ne(2*Math.PI*O.x/b.clientHeight),he(2*Math.PI*O.y/b.clientHeight)),P.copy(U)}function xn(_){if(F.length==1)C.set(_.pageX,_.pageY);else{const b=xr(_),ne=.5*(_.pageX+b.x),me=.5*(_.pageY+b.y);C.set(ne,me)}z.subVectors(C,R).multiplyScalar(o.panSpeed),B(z.x,z.y),R.copy(C)}function rn(_){const b=xr(_),ne=_.pageX-b.x,me=_.pageY-b.y,Fe=Math.sqrt(ne*ne+me*me);j.set(0,Fe),k.set(0,Math.pow(j.y/H.y,o.zoomSpeed)),G(k.y),H.copy(j)}function Lt(_){o.enableZoom&&rn(_),o.enablePan&&xn(_)}function vr(_){o.enableZoom&&rn(_),o.enableRotate&&xt(_)}function bn(_){var b,ne;o.enabled!==!1&&(F.length===0&&((b=o.domElement)==null||b.ownerDocument.addEventListener("pointermove",En),(ne=o.domElement)==null||ne.ownerDocument.addEventListener("pointerup",ht)),ls(_),_.pointerType==="touch"?ss(_):gr(_))}function En(_){o.enabled!==!1&&(_.pointerType==="touch"?os(_):yr(_))}function ht(_){var b,ne,me;as(_),F.length===0&&((b=o.domElement)==null||b.releasePointerCapture(_.pointerId),(ne=o.domElement)==null||ne.ownerDocument.removeEventListener("pointermove",En),(me=o.domElement)==null||me.ownerDocument.removeEventListener("pointerup",ht)),o.dispatchEvent(d),v=h.NONE}function gr(_){let b;switch(_.button){case 0:b=o.mouseButtons.LEFT;break;case 1:b=o.mouseButtons.MIDDLE;break;case 2:b=o.mouseButtons.RIGHT;break;default:b=-1}switch(b){case rr.DOLLY:if(o.enableZoom===!1)return;we(_),v=h.DOLLY;break;case rr.ROTATE:if(_.ctrlKey||_.metaKey||_.shiftKey){if(o.enablePan===!1)return;Oe(_),v=h.PAN}else{if(o.enableRotate===!1)return;ze(_),v=h.ROTATE}break;case rr.PAN:if(_.ctrlKey||_.metaKey||_.shiftKey){if(o.enableRotate===!1)return;ze(_),v=h.ROTATE}else{if(o.enablePan===!1)return;Oe(_),v=h.PAN}break;default:v=h.NONE}v!==h.NONE&&o.dispatchEvent(f)}function yr(_){if(o.enabled!==!1)switch(v){case h.ROTATE:if(o.enableRotate===!1)return;Ke(_);break;case h.DOLLY:if(o.enableZoom===!1)return;Ze(_);break;case h.PAN:if(o.enablePan===!1)return;ot(_);break}}function Et(_){o.enabled===!1||o.enableZoom===!1||v!==h.NONE&&v!==h.ROTATE||(_.preventDefault(),o.dispatchEvent(f),Ue(_),o.dispatchEvent(d))}function Sr(_){o.enabled===!1||o.enablePan===!1||ue(_)}function ss(_){switch(Jr(_),F.length){case 1:switch(o.touches.ONE){case ir.ROTATE:if(o.enableRotate===!1)return;Ge(),v=h.TOUCH_ROTATE;break;case ir.PAN:if(o.enablePan===!1)return;Re(),v=h.TOUCH_PAN;break;default:v=h.NONE}break;case 2:switch(o.touches.TWO){case ir.DOLLY_PAN:if(o.enableZoom===!1&&o.enablePan===!1)return;nn(),v=h.TOUCH_DOLLY_PAN;break;case ir.DOLLY_ROTATE:if(o.enableZoom===!1&&o.enableRotate===!1)return;mr(),v=h.TOUCH_DOLLY_ROTATE;break;default:v=h.NONE}break;default:v=h.NONE}v!==h.NONE&&o.dispatchEvent(f)}function os(_){switch(Jr(_),v){case h.TOUCH_ROTATE:if(o.enableRotate===!1)return;xt(_),o.update();break;case h.TOUCH_PAN:if(o.enablePan===!1)return;xn(_),o.update();break;case h.TOUCH_DOLLY_PAN:if(o.enableZoom===!1&&o.enablePan===!1)return;Lt(_),o.update();break;case h.TOUCH_DOLLY_ROTATE:if(o.enableZoom===!1&&o.enableRotate===!1)return;vr(_),o.update();break;default:v=h.NONE}}function Zr(_){o.enabled!==!1&&_.preventDefault()}function ls(_){F.push(_)}function as(_){delete N[_.pointerId];for(let b=0;b<F.length;b++)if(F[b].pointerId==_.pointerId){F.splice(b,1);return}}function Jr(_){let b=N[_.pointerId];b===void 0&&(b=new Me,N[_.pointerId]=b),b.set(_.pageX,_.pageY)}function xr(_){const b=_.pointerId===F[0].pointerId?F[1]:F[0];return N[b.pointerId]}this.dollyIn=(_=se())=>{q(_),o.update()},this.dollyOut=(_=se())=>{G(_),o.update()},this.getScale=()=>E,this.setScale=_=>{K(_),o.update()},this.getZoomScale=()=>se(),l!==void 0&&this.connect(l),this.update()}};const Io=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function qo(n,i){const l=St(f=>f.gl),o=en(kn,Io(n)?Object.values(n):n);return M.useLayoutEffect(()=>{i==null||i(o)},[i]),M.useEffect(()=>{if("initTexture"in l){let f=[];Array.isArray(o)?f=o:o instanceof Zi?f=[o]:Io(o)&&(f=Object.values(o)),f.forEach(d=>{d instanceof Zi&&l.initTexture(d)})}},[l,o]),M.useMemo(()=>{if(Io(n)){const f={};let d=0;for(const h in n)f[h]=o[d++];return f}else return o},[n,o])}qo.preload=n=>en.preload(kn,n);qo.clear=n=>en.clear(kn,n);const qd=()=>parseInt(Qo.replace(/\D+/g,"")),$d=qd(),ep=M.forwardRef(({makeDefault:n,camera:i,regress:l,domElement:o,enableDamping:c=!0,keyEvents:f=!1,onChange:d,onStart:h,onEnd:v,...y},p)=>{const m=St(k=>k.invalidate),E=St(k=>k.camera),x=St(k=>k.gl),P=St(k=>k.events),U=St(k=>k.setEvents),O=St(k=>k.set),R=St(k=>k.get),C=St(k=>k.performance),z=i||E,H=o||P.connected||x.domElement,j=M.useMemo(()=>new Jd(z),[z]);return je(()=>{j.enabled&&j.update()},-1),M.useEffect(()=>(f&&j.connect(f===!0?H:f),j.connect(H),()=>void j.dispose()),[f,H,l,j,m]),M.useEffect(()=>{const k=V=>{m(),l&&C.regress(),d&&d(V)},re=V=>{h&&h(V)},X=V=>{v&&v(V)};return j.addEventListener("change",k),j.addEventListener("start",re),j.addEventListener("end",X),()=>{j.removeEventListener("start",re),j.removeEventListener("end",X),j.removeEventListener("change",k)}},[d,h,v,j,m,U]),M.useEffect(()=>{if(n){const k=R().controls;return O({controls:j}),()=>O({controls:k})}},[n,j]),M.createElement("primitive",ns({ref:p,object:j,enableDamping:c},y))});class tp extends Yt{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
|
|
73
|
+
uniform float time;
|
|
74
|
+
attribute float size;
|
|
75
|
+
varying vec3 vColor;
|
|
76
|
+
void main() {
|
|
77
|
+
vColor = color;
|
|
78
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 0.5);
|
|
79
|
+
gl_PointSize = size * (30.0 / -mvPosition.z) * (3.0 + sin(time + 100.0));
|
|
80
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
81
|
+
}`,fragmentShader:`
|
|
82
|
+
uniform sampler2D pointTexture;
|
|
83
|
+
uniform float fade;
|
|
84
|
+
varying vec3 vColor;
|
|
85
|
+
void main() {
|
|
86
|
+
float opacity = 1.0;
|
|
87
|
+
if (fade == 1.0) {
|
|
88
|
+
float d = distance(gl_PointCoord, vec2(0.5, 0.5));
|
|
89
|
+
opacity = 1.0 / (1.0 + exp(16.0 * (d - 0.25)));
|
|
90
|
+
}
|
|
91
|
+
gl_FragColor = vec4(vColor, opacity);
|
|
92
|
+
|
|
93
|
+
#include <tonemapping_fragment>
|
|
94
|
+
#include <${$d>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
95
|
+
}`})}}const np=n=>new De().setFromSpherical(new Uo(n,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),rp=M.forwardRef(({radius:n=100,depth:i=50,count:l=5e3,saturation:o=0,factor:c=4,fade:f=!1,speed:d=1},h)=>{const v=M.useRef(),[y,p,m]=M.useMemo(()=>{const x=[],P=[],U=Array.from({length:l},()=>(.5+.5*Math.random())*c),O=new dt;let R=n+i;const C=i/l;for(let z=0;z<l;z++)R-=C*Math.random(),x.push(...np(R).toArray()),O.setHSL(z/l,o,.9),P.push(O.r,O.g,O.b);return[new Float32Array(x),new Float32Array(P),new Float32Array(U)]},[l,i,c,n,o]);je(x=>v.current&&(v.current.uniforms.time.value=x.clock.elapsedTime*d));const[E]=M.useState(()=>new tp);return M.createElement("points",{ref:h},M.createElement("bufferGeometry",null,M.createElement("bufferAttribute",{attach:"attributes-position",args:[y,3]}),M.createElement("bufferAttribute",{attach:"attributes-color",args:[p,3]}),M.createElement("bufferAttribute",{attach:"attributes-size",args:[m,1]})),M.createElement("primitive",{ref:v,object:E,attach:"material",blending:Qr,"uniforms-fade-value":f,depthWrite:!1,transparent:!0,vertexColors:!0}))});/**
|
|
96
|
+
* postprocessing v6.39.1 build Fri Apr 17 2026
|
|
97
|
+
* https://github.com/pmndrs/postprocessing
|
|
98
|
+
* Copyright 2015-2026 Raoul van Rüschen
|
|
99
|
+
* @license Zlib
|
|
100
|
+
*/var ip=(()=>{const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),i=new Float32Array([0,0,2,0,0,2]),l=new xu;return l.setAttribute("position",new $i(n,3)),l.setAttribute("uv",new $i(i,2)),l})(),pt=class Wo{static get fullscreenGeometry(){return ip}constructor(i="Pass",l=new Oo,o=new Un){this.name=i,this.renderer=null,this.scene=l,this.camera=o,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthBlit=!1,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(i){if(this.rtt===i){const l=this.fullscreenMaterial;l!==null&&(l.needsUpdate=!0),this.rtt=!i}}set mainScene(i){}set mainCamera(i){}setRenderer(i){this.renderer=i}isEnabled(){return this.enabled}setEnabled(i){this.enabled=i}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(i){let l=this.screen;l!==null?l.material=i:(l=new Cf(Wo.fullscreenGeometry,i),l.frustumCulled=!1,this.scene===null&&(this.scene=new Oo),this.scene.add(l),this.screen=l)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(i){this.fullscreenMaterial=i}getDepthTexture(){return null}setDepthTexture(i,l=hr){}render(i,l,o,c,f){throw new Error("Render method not implemented!")}setSize(i,l){}initialize(i,l,o){}dispose(){for(const i of Object.keys(this)){const l=this[i];(l instanceof Bt||l instanceof Su||l instanceof Zi||l instanceof Wo)&&this[i].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},sp=class extends pt{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,i,l,o,c){const f=n.state.buffers.stencil;f.setLocked(!1),f.setTest(!1)}},op=`#ifdef COLOR_WRITE
|
|
101
|
+
#include <common>
|
|
102
|
+
#include <dithering_pars_fragment>
|
|
103
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
104
|
+
uniform mediump sampler2D inputBuffer;
|
|
105
|
+
#else
|
|
106
|
+
uniform lowp sampler2D inputBuffer;
|
|
107
|
+
#endif
|
|
108
|
+
#endif
|
|
109
|
+
#ifdef DEPTH_WRITE
|
|
110
|
+
#include <packing>
|
|
111
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
112
|
+
uniform highp sampler2D depthBuffer;
|
|
113
|
+
#else
|
|
114
|
+
uniform mediump sampler2D depthBuffer;
|
|
115
|
+
#endif
|
|
116
|
+
float readDepth(const in vec2 uv){
|
|
117
|
+
#if DEPTH_PACKING == 3201
|
|
118
|
+
return unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
119
|
+
#else
|
|
120
|
+
return texture2D(depthBuffer,uv).r;
|
|
121
|
+
#endif
|
|
122
|
+
}
|
|
123
|
+
#endif
|
|
124
|
+
#ifdef USE_WEIGHTS
|
|
125
|
+
uniform vec4 channelWeights;
|
|
126
|
+
#endif
|
|
127
|
+
uniform float opacity;varying vec2 vUv;void main(){
|
|
128
|
+
#ifdef COLOR_WRITE
|
|
129
|
+
vec4 texel=texture2D(inputBuffer,vUv);
|
|
130
|
+
#ifdef USE_WEIGHTS
|
|
131
|
+
texel*=channelWeights;
|
|
132
|
+
#endif
|
|
133
|
+
gl_FragColor=opacity*texel;
|
|
134
|
+
#ifdef COLOR_SPACE_CONVERSION
|
|
135
|
+
#include <colorspace_fragment>
|
|
136
|
+
#endif
|
|
137
|
+
#include <dithering_fragment>
|
|
138
|
+
#else
|
|
139
|
+
gl_FragColor=vec4(0.0);
|
|
140
|
+
#endif
|
|
141
|
+
#ifdef DEPTH_WRITE
|
|
142
|
+
gl_FragDepth=readDepth(vUv);
|
|
143
|
+
#endif
|
|
144
|
+
}`,Ku="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",Zu=class extends Yt{constructor(){super({name:"CopyMaterial",defines:{COLOR_SPACE_CONVERSION:"1",DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new xe(null),depthBuffer:new xe(null),channelWeights:new xe(null),opacity:new xe(1)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:op,vertexShader:Ku}),this.depthFunc=zf}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(n){const i=n!==null;this.colorWrite!==i&&(i?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=i,this.needsUpdate=!0),this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){const i=n!==null;this.depthWrite!==i&&(i?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=i,this.depthWrite=i,this.needsUpdate=!0),this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}get colorSpaceConversion(){return this.defines.COLOR_SPACE_CONVERSION!==void 0}set colorSpaceConversion(n){this.colorSpaceConversion!==n&&(n?this.defines.COLOR_SPACE_CONVERSION=!0:delete this.defines.COLOR_SPACE_CONVERSION,this.needsUpdate=!0)}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(n){n!==null?(this.defines.USE_WEIGHTS="1",this.uniforms.channelWeights.value=n):delete this.defines.USE_WEIGHTS,this.needsUpdate=!0}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},lp=class extends pt{constructor(n,i=!0){super("CopyPass"),this.fullscreenMaterial=new Zu,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new Bt(1,1,{minFilter:Ji,magFilter:Ji,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=i}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,i,l,o,c){this.fullscreenMaterial.inputBuffer=i.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,i){this.autoResize&&this.renderTarget.setSize(n,i)}initialize(n,i,l){l!==void 0&&(this.renderTarget.texture.type=l,l!==Sn?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n!==null&&n.outputColorSpace===nt&&(this.renderTarget.texture.colorSpace=nt))}},ru=new dt,Ju=class extends pt{constructor(n=!0,i=!0,l=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=i,this.stencil=l,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,i,l){this.color=n,this.depth=i,this.stencil=l}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,i,l,o,c){const f=this.overrideClearColor,d=this.overrideClearAlpha,h=n.getClearAlpha(),v=f!==null,y=d>=0;v?(n.getClearColor(ru),n.setClearColor(f,y?d:h)):y&&n.setClearAlpha(d),n.setRenderTarget(this.renderToScreen?null:i),n.clear(this.color,this.depth,this.stencil),v?n.setClearColor(ru,h):y&&n.setClearAlpha(h)}},ap=class extends pt{constructor(n,i){super("MaskPass",n,i),this.needsSwap=!1,this.clearPass=new Ju(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,i,l,o,c){const f=n.getContext(),d=n.state.buffers,h=this.scene,v=this.camera,y=this.clearPass,p=this.inverted?0:1,m=1-p;d.color.setMask(!1),d.depth.setMask(!1),d.color.setLocked(!0),d.depth.setLocked(!0),d.stencil.setTest(!0),d.stencil.setOp(f.REPLACE,f.REPLACE,f.REPLACE),d.stencil.setFunc(f.ALWAYS,p,4294967295),d.stencil.setClear(m),d.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?y.render(n,null):(y.render(n,i),y.render(n,l))),this.renderToScreen?(n.setRenderTarget(null),n.render(h,v)):(n.setRenderTarget(i),n.render(h,v),n.setRenderTarget(l),n.render(h,v)),d.color.setLocked(!1),d.depth.setLocked(!1),d.stencil.setLocked(!1),d.stencil.setFunc(f.EQUAL,1,4294967295),d.stencil.setOp(f.KEEP,f.KEEP,f.KEEP),d.stencil.setLocked(!0)}},zo=1/1e3,up=1e3,cp=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*zo}get fixedDelta(){return this._fixedDelta*zo}set fixedDelta(n){this._fixedDelta=n*up}get elapsed(){return this._elapsed*zo}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},fp=class{constructor(i=null,{depthBuffer:l=!0,stencilBuffer:o=!1,multisampling:c=0,frameBufferType:f}={}){this.renderer=null,this.inputBuffer=this.createBuffer(l,o,f,c),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new lp,this.depthTexture=null,this.depthRenderTarget=null,this.passes=[],this.timer=new cp,this.autoRenderToScreen=!0,this.setRenderer(i)}get multisampling(){return this.inputBuffer.samples}set multisampling(i){const l=this.inputBuffer,o=this.multisampling;o>0&&i>0?(this.inputBuffer.samples=i,this.outputBuffer.samples=i,this.inputBuffer.dispose(),this.outputBuffer.dispose()):o!==i&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(l.depthBuffer,l.stencilBuffer,l.texture.type,i),this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(i){if(this.renderer=i,i!==null){const l=i.getSize(new Me),o=i.getContext().getContextAttributes().alpha,c=this.inputBuffer.texture.type;c===Sn&&i.outputColorSpace===nt&&(this.inputBuffer.texture.colorSpace=nt,this.outputBuffer.texture.colorSpace=nt,this.inputBuffer.dispose(),this.outputBuffer.dispose()),i.autoClear=!1,this.setSize(l.width,l.height);for(const f of this.passes)f.initialize(i,o,c)}}replaceRenderer(i,l=!0){const o=this.renderer,c=o.domElement.parentNode;return this.setRenderer(i),l&&c!==null&&(c.removeChild(o.domElement),c.appendChild(i.domElement)),o}createDepthTexture(){const i=this.inputBuffer,l=new Tf;this.depthTexture=l,i.stencilBuffer?(l.format=_f,l.type=Rf):l.type=vu;const o=l.clone();return o.name="EffectComposer.StableDepth",this.depthRenderTarget=new Bt(i.width,i.height,{depthBuffer:!0,stencilBuffer:i.stencilBuffer,depthTexture:o}),o}blitDepthBuffer(i){const l=this.renderer,o=this.depthRenderTarget,c=l.properties,f=l.getContext();l.setRenderTarget(o);const d=c.get(i).__webglFramebuffer,h=c.get(o).__webglFramebuffer,v=i.stencilBuffer?f.DEPTH_BUFFER_BIT|f.STENCIL_BUFFER_BIT:f.DEPTH_BUFFER_BIT;f.bindFramebuffer(f.READ_FRAMEBUFFER,d),f.bindFramebuffer(f.DRAW_FRAMEBUFFER,h),f.blitFramebuffer(0,0,i.width,i.height,0,0,o.width,o.height,v,f.NEAREST),f.bindFramebuffer(f.READ_FRAMEBUFFER,null),f.bindFramebuffer(f.DRAW_FRAMEBUFFER,null),l.setRenderTarget(null)}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.depthRenderTarget.dispose(),this.depthRenderTarget=null,this.inputBuffer.depthTexture=null,this.outputBuffer.depthTexture=null;for(const i of this.passes)i.setDepthTexture(null)}}createBuffer(i,l,o,c){const f=this.renderer,d=f===null?new Me:f.getDrawingBufferSize(new Me),h={minFilter:Ji,magFilter:Ji,stencilBuffer:l,depthBuffer:i,type:o},v=new Bt(d.width,d.height,h);return c>0&&(v.samples=c),o===Sn&&f!==null&&f.outputColorSpace===nt&&(v.texture.colorSpace=nt),v.texture.name="EffectComposer.Buffer",v.texture.generateMipmaps=!1,v}setMainScene(i){for(const l of this.passes)l.mainScene=i}setMainCamera(i){for(const l of this.passes)l.mainCamera=i}addPass(i,l){const o=this.passes,c=this.renderer,f=c.getDrawingBufferSize(new Me),d=c.getContext().getContextAttributes().alpha,h=this.inputBuffer.texture.type;if(i.renderer=c,i.setSize(f.width,f.height),i.initialize(c,d,h),this.autoRenderToScreen&&(o.length>0&&(o[o.length-1].renderToScreen=!1),i.renderToScreen&&(this.autoRenderToScreen=!1)),l!==void 0?o.splice(l,0,i):o.push(i),this.autoRenderToScreen&&(o[o.length-1].renderToScreen=!0),i.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const v=this.createDepthTexture();for(i of o)i.setDepthTexture(v)}else{const v=this.depthRenderTarget.depthTexture;i.setDepthTexture(v)}}removePass(i){const l=this.passes,o=l.indexOf(i);if(o!==-1&&l.splice(o,1).length>0){if(this.depthTexture!==null){const d=(v,y)=>v||y.needsDepthTexture;if(!l.reduce(d,!1)){const v=this.depthRenderTarget.depthTexture;i.getDepthTexture()===v&&i.setDepthTexture(null),this.deleteDepthTexture()}}this.autoRenderToScreen&&o===l.length&&(i.renderToScreen=!1,l.length>0&&(l[l.length-1].renderToScreen=!0))}}removeAllPasses(){const i=this.passes;this.deleteDepthTexture(),i.length>0&&(this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!1),this.passes=[])}render(i){const l=this.renderer,o=this.copyPass;let c=this.inputBuffer,f=this.outputBuffer,d,h=!1;i===void 0&&(this.timer.update(),i=this.timer.getDelta());for(const v of this.passes)if(v.enabled){if(c.depthTexture=this.depthTexture,f.depthTexture=null,v.render(l,c,f,i,h),v.needsDepthBlit&&this.depthRenderTarget!==null&&this.blitDepthBuffer(c),v.needsSwap){if(h){o.renderToScreen=v.renderToScreen;const y=l.getContext(),p=l.state.buffers.stencil;p.setFunc(y.NOTEQUAL,1,4294967295),o.render(l,c,f,i,h),p.setFunc(y.EQUAL,1,4294967295)}d=c,c=f,f=d}v instanceof ap?h=!0:v instanceof sp&&(h=!1)}}setSize(i,l,o){const c=this.renderer,f=c.getSize(new Me);(i===void 0||l===void 0)&&(i=f.width,l=f.height),(f.width!==i||f.height!==l)&&c.setSize(i,l,o);const d=c.getDrawingBufferSize(new Me);this.inputBuffer.setSize(d.width,d.height),this.outputBuffer.setSize(d.width,d.height),this.depthRenderTarget!==null&&this.depthRenderTarget.setSize(d.width,d.height);for(const h of this.passes)h.setSize(d.width,d.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const i of this.passes)i.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),pt.fullscreenGeometry.dispose()}},tn={NONE:0,DEPTH:1,CONVOLUTION:2},Se={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},dp=class{constructor(){this.shaderParts=new Map([[Se.FRAGMENT_HEAD,null],[Se.FRAGMENT_MAIN_UV,null],[Se.FRAGMENT_MAIN_IMAGE,null],[Se.VERTEX_HEAD,null],[Se.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=tn.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=gu}},Ao=!1,iu=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=i=>{if(i.isMesh){let l;if(i.material.flatShading)switch(i.material.side){case Dn:l=this.materialsFlatShadedDoubleSide;break;case cr:l=this.materialsFlatShadedBackSide;break;default:l=this.materialsFlatShaded;break}else switch(i.material.side){case Dn:l=this.materialsDoubleSide;break;case cr:l=this.materialsBackSide;break;default:l=this.materials;break}this.originalMaterials.set(i,i.material),i.isSkinnedMesh?i.material=l[2]:i.isInstancedMesh?i.material=l[1]:i.material=l[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof Yt))return n.clone();const i=n.uniforms,l=new Map;for(const c in i){const f=i[c].value;f.isRenderTargetTexture&&(i[c].value=null,l.set(c,f))}const o=n.clone();for(const c of l)i[c[0]].value=c[1],o.uniforms[c[0]].value=c[1];return o}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const i=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const l of i)l.uniforms=Object.assign({},n.uniforms),l.side=If;i[2].skinning=!0,this.materialsBackSide=i.map(l=>{const o=this.cloneMaterial(l);return o.uniforms=Object.assign({},n.uniforms),o.side=cr,o}),this.materialsDoubleSide=i.map(l=>{const o=this.cloneMaterial(l);return o.uniforms=Object.assign({},n.uniforms),o.side=Dn,o}),this.materialsFlatShaded=i.map(l=>{const o=this.cloneMaterial(l);return o.uniforms=Object.assign({},n.uniforms),o.flatShading=!0,o}),this.materialsFlatShadedBackSide=i.map(l=>{const o=this.cloneMaterial(l);return o.uniforms=Object.assign({},n.uniforms),o.flatShading=!0,o.side=cr,o}),this.materialsFlatShadedDoubleSide=i.map(l=>{const o=this.cloneMaterial(l);return o.uniforms=Object.assign({},n.uniforms),o.flatShading=!0,o.side=Dn,o})}}render(n,i,l){const o=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,Ao){const c=this.originalMaterials;this.meshCount=0,i.traverse(this.replaceMaterial),n.render(i,l);for(const f of c)f[0].material=f[1];this.meshCount!==c.size&&c.clear()}else{const c=i.overrideMaterial;i.overrideMaterial=this.material,n.render(i,l),i.overrideMaterial=c}n.shadowMap.enabled=o}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const i of n)i.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Ao}static set workaroundEnabled(n){Ao=n}},yn=-1,rt=class extends Yo{constructor(n=null,i=yn,l=yn,o=1){super(),n!==null&&this.addEventListener("change",()=>n.setSize(this.baseSize.width,this.baseSize.height)),this.baseSize=new Me(1,1),this.preferredSize=new Me(i,l),this.target=this.preferredSize,this.s=o,this.effectiveSize=new Me,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,i=this.preferredSize,l=this.effectiveSize,o=this.scale;i.width!==yn?l.width=i.width:i.height!==yn?l.width=Math.round(i.height*(n.width/Math.max(n.height,1))):l.width=Math.round(n.width*o),i.height!==yn?l.height=i.height:i.width!==yn?l.height=Math.round(i.width/Math.max(n.width/Math.max(n.height,1),1)):l.height=Math.round(n.height*o)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(yn),this.dispatchEvent({type:"change"}))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,i){(this.baseSize.width!==n||this.baseSize.height!==i)&&(this.baseSize.set(n,i),this.dispatchEvent({type:"change"}))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,i){(this.preferredSize.width!==n||this.preferredSize.height!==i)&&(this.preferredSize.set(n,i),this.dispatchEvent({type:"change"}))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"})}static get AUTO_SIZE(){return yn}},de={ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},pp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",hp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,src.a*opacity);}",mp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=(dst.rgb+src.rgb)*0.5;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",vp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.xy,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",gp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/max(b,1e-9))),vec3(1.0),step(1.0,a));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",yp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Sp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",xp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=abs(dst.rgb-src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Ep="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb/max(src.rgb,1e-9);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",wp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-2.0*dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Mp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb,1.0);vec3 b=min(src.rgb,1.0);vec3 c=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Tp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=step(1.0,dst.rgb+src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",_p="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.x,a.yz));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Rp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Pp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=src.rgb*max(1.0-dst.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Cp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Ip="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",zp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb+src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Ap="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(2.0*src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Dp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.xy,b.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Np="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Op="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-abs(1.0-dst.rgb-src.rgb),0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Up="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,opacity);}",Bp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=2.0*src.rgb*dst.rgb;vec3 b=1.0-2.0*(1.0-src.rgb)*(1.0-dst.rgb);vec3 c=mix(a,b,step(0.5,dst.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",kp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 c=mix(mix(src2,dst.rgb,step(0.5*dst.rgb,src.rgb)),max(src2-1.0,vec3(0.0)),step(dst.rgb,src2-1.0));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Lp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb*dst.rgb/max(1.0-src.rgb,1e-9),1.0);vec3 c=mix(a,src.rgb,step(1.0,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",jp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.x,b.y,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Fp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-min(dst.rgb*src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",bp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 d=dst.rgb+(src2-1.0);vec3 w=step(0.5,src.rgb);vec3 a=dst.rgb-(1.0-src2)*dst.rgb*(1.0-dst.rgb);vec3 b=mix(d*(sqrt(dst.rgb)-dst.rgb),d*dst.rgb*((16.0*dst.rgb-12.0)*dst.rgb+3.0),w*(1.0-step(0.25,dst.rgb)));vec3 c=mix(a,b,w);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Hp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return src;}",Gp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Wp="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=mix(max(1.0-min((1.0-dst.rgb)/(2.0*src.rgb),1.0),0.0),min(dst.rgb/(2.0*(1.0-src.rgb)),1.0),step(0.5,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Vp=new Map([[de.ADD,pp],[de.ALPHA,hp],[de.AVERAGE,mp],[de.COLOR,vp],[de.COLOR_BURN,gp],[de.COLOR_DODGE,yp],[de.DARKEN,Sp],[de.DIFFERENCE,xp],[de.DIVIDE,Ep],[de.DST,null],[de.EXCLUSION,wp],[de.HARD_LIGHT,Mp],[de.HARD_MIX,Tp],[de.HUE,_p],[de.INVERT,Rp],[de.INVERT_RGB,Pp],[de.LIGHTEN,Cp],[de.LINEAR_BURN,Ip],[de.LINEAR_DODGE,zp],[de.LINEAR_LIGHT,Ap],[de.LUMINOSITY,Dp],[de.MULTIPLY,Np],[de.NEGATION,Op],[de.NORMAL,Up],[de.OVERLAY,Bp],[de.PIN_LIGHT,kp],[de.REFLECT,Lp],[de.SATURATION,jp],[de.SCREEN,Fp],[de.SOFT_LIGHT,bp],[de.SRC,Hp],[de.SUBTRACT,Gp],[de.VIVID_LIGHT,Wp]]),Qp=class extends Yo{constructor(n,i=1){super(),this._blendFunction=n,this.opacity=new xe(i)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return Vp.get(this.blendFunction)}},Vo=class extends Yo{constructor(n,i,{attributes:l=tn.NONE,blendFunction:o=de.NORMAL,defines:c=new Map,uniforms:f=new Map,extensions:d=null,vertexShader:h=null}={}){super(),this.name=n,this.renderer=null,this.attributes=l,this.fragmentShader=i,this.vertexShader=h,this.defines=c,this.uniforms=f,this.extensions=d,this.blendMode=new Qp(o),this.blendMode.addEventListener("change",v=>this.setChanged()),this._inputColorSpace=gu,this._outputColorSpace=yu}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(n){this._inputColorSpace=n,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(n){this._outputColorSpace=n,this.setChanged()}set mainScene(n){}set mainCamera(n){}getName(){return this.name}setRenderer(n){this.renderer=n}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(n){this.attributes=n,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(n){this.fragmentShader=n,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(n){this.vertexShader=n,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(n,i=hr){}update(n,i,l){}setSize(n,i){}initialize(n,i,l){}dispose(){for(const n of Object.keys(this)){const i=this[n];(i instanceof Bt||i instanceof Su||i instanceof Zi||i instanceof pt)&&this[n].dispose()}}},$o={MEDIUM:2,LARGE:3},Yp=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
145
|
+
uniform mediump sampler2D inputBuffer;
|
|
146
|
+
#else
|
|
147
|
+
uniform lowp sampler2D inputBuffer;
|
|
148
|
+
#endif
|
|
149
|
+
varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;
|
|
150
|
+
#include <colorspace_fragment>
|
|
151
|
+
}`,Xp="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",Kp=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],Zp=class extends Yt{constructor(n=new ka){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new xe(null),texelSize:new xe(new ka),scale:new xe(1),kernel:new xe(0)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Yp,vertexShader:Xp}),this.setTexelSize(n.x,n.y),this.kernelSize=$o.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return Kp[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,i){this.uniforms.texelSize.value.set(n,i,n*.5,i*.5)}setSize(n,i){const l=1/n,o=1/i;this.uniforms.texelSize.value.set(l,o,l*.5,o*.5)}},Jp=class extends pt{constructor({kernelSize:n=$o.MEDIUM,resolutionScale:i=.5,width:l=rt.AUTO_SIZE,height:o=rt.AUTO_SIZE,resolutionX:c=l,resolutionY:f=o}={}){super("KawaseBlurPass"),this.renderTargetA=new Bt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const d=this.resolution=new rt(this,c,f,i);d.addEventListener("change",h=>this.setSize(d.baseWidth,d.baseHeight)),this._blurMaterial=new Zp,this._blurMaterial.kernelSize=n,this.copyMaterial=new Zu}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,i,l,o,c){const f=this.scene,d=this.camera,h=this.renderTargetA,v=this.renderTargetB,y=this.blurMaterial,p=y.kernelSequence;let m=i;this.fullscreenMaterial=y;for(let E=0,x=p.length;E<x;++E){const P=E&1?v:h;y.kernel=p[E],y.inputBuffer=m.texture,n.setRenderTarget(P),n.render(f,d),m=P}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=m.texture,n.setRenderTarget(this.renderToScreen?null:l),n.render(f,d)}setSize(n,i){const l=this.resolution;l.setBaseSize(n,i);const o=l.width,c=l.height;this.renderTargetA.setSize(o,c),this.renderTargetB.setSize(o,c),this.blurMaterial.setSize(n,i)}initialize(n,i,l){l!==void 0&&(this.renderTargetA.texture.type=l,this.renderTargetB.texture.type=l,l!==Sn?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):n!==null&&n.outputColorSpace===nt&&(this.renderTargetA.texture.colorSpace=nt,this.renderTargetB.texture.colorSpace=nt))}static get AUTO_SIZE(){return rt.AUTO_SIZE}},qp=`#include <common>
|
|
152
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
153
|
+
uniform mediump sampler2D inputBuffer;
|
|
154
|
+
#else
|
|
155
|
+
uniform lowp sampler2D inputBuffer;
|
|
156
|
+
#endif
|
|
157
|
+
#ifdef RANGE
|
|
158
|
+
uniform vec2 range;
|
|
159
|
+
#elif defined(THRESHOLD)
|
|
160
|
+
uniform float threshold;uniform float smoothing;
|
|
161
|
+
#endif
|
|
162
|
+
varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0;
|
|
163
|
+
#ifdef RANGE
|
|
164
|
+
float low=step(range.x,l);float high=step(l,range.y);mask=low*high;
|
|
165
|
+
#elif defined(THRESHOLD)
|
|
166
|
+
mask=smoothstep(threshold,threshold+smoothing,l);
|
|
167
|
+
#endif
|
|
168
|
+
#ifdef COLOR
|
|
169
|
+
gl_FragColor=texel*mask;
|
|
170
|
+
#else
|
|
171
|
+
gl_FragColor=vec4(l*mask);
|
|
172
|
+
#endif
|
|
173
|
+
}`,$p=class extends Yt{constructor(n=!1,i=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:Qo.replace(/\D+/g,"")},uniforms:{inputBuffer:new xe(null),threshold:new xe(0),smoothing:new xe(1),range:new xe(null)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:qp,vertexShader:Ku}),this.colorOutput=n,this.luminanceRange=i}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},eh=class extends pt{constructor({renderTarget:n,luminanceRange:i,colorOutput:l,resolutionScale:o=1,width:c=rt.AUTO_SIZE,height:f=rt.AUTO_SIZE,resolutionX:d=c,resolutionY:h=f}={}){super("LuminancePass"),this.fullscreenMaterial=new $p(l,i),this.needsSwap=!1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new Bt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const v=this.resolution=new rt(this,d,h,o);v.addEventListener("change",y=>this.setSize(v.baseWidth,v.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,i,l,o,c){const f=this.fullscreenMaterial;f.inputBuffer=i.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,i){const l=this.resolution;l.setBaseSize(n,i),this.renderTarget.setSize(l.width,l.height)}initialize(n,i,l){l!==void 0&&l!==Sn&&(this.renderTarget.texture.type=l,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},th=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
174
|
+
uniform mediump sampler2D inputBuffer;
|
|
175
|
+
#else
|
|
176
|
+
uniform lowp sampler2D inputBuffer;
|
|
177
|
+
#endif
|
|
178
|
+
#define WEIGHT_INNER 0.125
|
|
179
|
+
#define WEIGHT_OUTER 0.05556
|
|
180
|
+
varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c;
|
|
181
|
+
#include <colorspace_fragment>
|
|
182
|
+
}`,nh="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",rh=class extends Yt{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new xe(null),texelSize:new xe(new Me)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:th,vertexShader:nh})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setSize(n,i){this.uniforms.texelSize.value.set(1/n,1/i)}},ih=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
183
|
+
uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer;
|
|
184
|
+
#else
|
|
185
|
+
uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer;
|
|
186
|
+
#endif
|
|
187
|
+
uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius);
|
|
188
|
+
#include <colorspace_fragment>
|
|
189
|
+
}`,sh="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",oh=class extends Yt{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new xe(null),supportBuffer:new xe(null),texelSize:new xe(new Me),radius:new xe(.85)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ih,vertexShader:sh})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,i){this.uniforms.texelSize.value.set(1/n,1/i)}},lh=class extends pt{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new Bt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new rh,this.upsamplingMaterial=new oh,this.resolution=new Me}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const i=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let l=0;l<n;++l){const o=i.clone();o.texture.name="Downsampling.Mipmap"+l,this.downsamplingMipmaps.push(o)}this.upsamplingMipmaps.push(i);for(let l=1,o=n-1;l<o;++l){const c=i.clone();c.texture.name="Upsampling.Mipmap"+l,this.upsamplingMipmaps.push(c)}this.setSize(this.resolution.x,this.resolution.y)}}get radius(){return this.upsamplingMaterial.radius}set radius(n){this.upsamplingMaterial.radius=n}render(n,i,l,o,c){const{scene:f,camera:d}=this,{downsamplingMaterial:h,upsamplingMaterial:v}=this,{downsamplingMipmaps:y,upsamplingMipmaps:p}=this;let m=i;this.fullscreenMaterial=h;for(let E=0,x=y.length;E<x;++E){const P=y[E];h.setSize(m.width,m.height),h.inputBuffer=m.texture,n.setRenderTarget(P),n.render(f,d),m=P}this.fullscreenMaterial=v;for(let E=p.length-1;E>=0;--E){const x=p[E];v.setSize(m.width,m.height),v.inputBuffer=m.texture,v.supportBuffer=y[E].texture,n.setRenderTarget(x),n.render(f,d),m=x}}setSize(n,i){const l=this.resolution;l.set(n,i);let o=l.width,c=l.height;for(let f=0,d=this.downsamplingMipmaps.length;f<d;++f)o=Math.round(o*.5),c=Math.round(c*.5),this.downsamplingMipmaps[f].setSize(o,c),f<this.upsamplingMipmaps.length&&this.upsamplingMipmaps[f].setSize(o,c)}initialize(n,i,l){if(l!==void 0){const o=this.downsamplingMipmaps.concat(this.upsamplingMipmaps);for(const c of o)c.texture.type=l;if(l!==Sn)this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1";else if(n!==null&&n.outputColorSpace===nt)for(const c of o)c.texture.colorSpace=nt}}dispose(){super.dispose();for(const n of this.downsamplingMipmaps.concat(this.upsamplingMipmaps))n.dispose()}},ah=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
190
|
+
uniform mediump sampler2D map;
|
|
191
|
+
#else
|
|
192
|
+
uniform lowp sampler2D map;
|
|
193
|
+
#endif
|
|
194
|
+
uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,uh=class extends Vo{constructor({blendFunction:n=de.SCREEN,luminanceThreshold:i=1,luminanceSmoothing:l=.03,mipmapBlur:o=!0,intensity:c=1,radius:f=.85,levels:d=8,kernelSize:h=$o.LARGE,resolutionScale:v=.5,width:y=rt.AUTO_SIZE,height:p=rt.AUTO_SIZE,resolutionX:m=y,resolutionY:E=p}={}){super("BloomEffect",ah,{blendFunction:n,uniforms:new Map([["map",new xe(null)],["intensity",new xe(c)]])}),this.renderTarget=new Bt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new Jp({kernelSize:h}),this.luminancePass=new eh({colorOutput:!0}),this.luminanceMaterial.threshold=i,this.luminanceMaterial.smoothing=l,this.mipmapBlurPass=new lh,this.mipmapBlurPass.enabled=o,this.mipmapBlurPass.radius=f,this.mipmapBlurPass.levels=d,this.uniforms.get("map").value=o?this.mipmapBlurPass.texture:this.renderTarget.texture;const x=this.resolution=new rt(this,m,E,v);x.addEventListener("change",P=>this.setSize(x.baseWidth,x.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,i,l){const o=this.renderTarget,c=this.luminancePass;c.enabled?(c.render(n,i),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,c.renderTarget):this.blurPass.render(n,c.renderTarget,o)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,i):this.blurPass.render(n,i,o)}setSize(n,i){const l=this.resolution;l.setBaseSize(n,i),this.renderTarget.setSize(l.width,l.height),this.blurPass.resolution.copy(l),this.luminancePass.setSize(n,i),this.mipmapBlurPass.setSize(n,i)}initialize(n,i,l){this.blurPass.initialize(n,i,l),this.luminancePass.initialize(n,i,l),this.mipmapBlurPass.initialize(n,i,l),l!==void 0&&(this.renderTarget.texture.type=l,n!==null&&n.outputColorSpace===nt&&(this.renderTarget.texture.colorSpace=nt))}},qu=class extends pt{constructor(n,i,l=null){super("RenderPass",n,i),this.needsSwap=!1,this.needsDepthBlit=!0,this.clearPass=new Ju,this.overrideMaterialManager=l===null?null:new iu(l),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const i=this.overrideMaterialManager;n!==null?i!==null?i.setMaterial(n):this.overrideMaterialManager=new iu(n):i!==null&&(i.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,i,l,o,c){const f=this.scene,d=this.camera,h=this.selection,v=d.layers.mask,y=f.background,p=n.shadowMap.autoUpdate,m=this.renderToScreen?null:i;h!==null&&d.layers.set(h.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(f.background=null),this.clearPass.enabled&&this.clearPass.render(n,i),n.setRenderTarget(m),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,f,d):n.render(f,d),d.layers.mask=v,f.background=y,n.shadowMap.autoUpdate=p}},ch=`#include <packing>
|
|
195
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
196
|
+
uniform highp sampler2D depthBuffer;
|
|
197
|
+
#else
|
|
198
|
+
uniform mediump sampler2D depthBuffer;
|
|
199
|
+
#endif
|
|
200
|
+
#ifdef DOWNSAMPLE_NORMALS
|
|
201
|
+
uniform lowp sampler2D normalBuffer;
|
|
202
|
+
#endif
|
|
203
|
+
varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){
|
|
204
|
+
#if DEPTH_PACKING == 3201
|
|
205
|
+
return unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
206
|
+
#else
|
|
207
|
+
return texture2D(depthBuffer,uv).r;
|
|
208
|
+
#endif
|
|
209
|
+
}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]<maxDistance){remaining[j++]=i;}else{rejected[k++]=i;}}for(;j<3;++j){remaining[j]=rejected[--k];}vec3 s=vec3(samples[remaining[0]],samples[remaining[1]],samples[remaining[2]]);c=(s.x+s.y+s.z)/3.0;distances[0]=abs(c-s.x);distances[1]=abs(c-s.y);distances[2]=abs(c-s.z);float minDistance=min(distances[0],min(distances[1],distances[2]));for(i=0;i<3;++i){if(distances[i]==minDistance){break;}}return remaining[i];}void main(){float d[4];d[0]=readDepth(vUv0);d[1]=readDepth(vUv1);d[2]=readDepth(vUv2);d[3]=readDepth(vUv3);int index=findBestDepth(d);
|
|
210
|
+
#ifdef DOWNSAMPLE_NORMALS
|
|
211
|
+
vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1).rgb;n[2]=texture2D(normalBuffer,vUv2).rgb;n[3]=texture2D(normalBuffer,vUv3).rgb;
|
|
212
|
+
#else
|
|
213
|
+
vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0);
|
|
214
|
+
#endif
|
|
215
|
+
gl_FragColor=vec4(n[index],d[index]);}`,fh="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",dh=class extends Yt{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new xe(null),normalBuffer:new xe(null),texelSize:new xe(new Me)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:ch,vertexShader:fh})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,i=hr){this.depthBuffer=n,this.depthPacking=i}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,i){this.uniforms.texelSize.value.set(n,i)}setSize(n,i){this.uniforms.texelSize.value.set(1/n,1/i)}},ph=class extends pt{constructor({normalBuffer:n=null,resolutionScale:i=.5,width:l=rt.AUTO_SIZE,height:o=rt.AUTO_SIZE,resolutionX:c=l,resolutionY:f=o}={}){super("DepthDownsamplingPass");const d=new dh;d.normalBuffer=n,this.fullscreenMaterial=d,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Bt(1,1,{minFilter:qi,magFilter:qi,depthBuffer:!1,type:vu}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const h=this.resolution=new rt(this,c,f,i);h.addEventListener("change",v=>this.setSize(h.baseWidth,h.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,i=hr){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=i}render(n,i,l,o,c){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,i){const l=this.resolution;l.setBaseSize(n,i),this.renderTarget.setSize(l.width,l.height),this.fullscreenMaterial.setSize(n,i)}initialize(n,i,l){const o=n.getContext();if(!(o.getExtension("EXT_color_buffer_float")||o.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},hh=`#include <common>
|
|
216
|
+
#include <packing>
|
|
217
|
+
#include <dithering_pars_fragment>
|
|
218
|
+
#define packFloatToRGBA(v) packDepthToRGBA(v)
|
|
219
|
+
#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)
|
|
220
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
221
|
+
uniform mediump sampler2D inputBuffer;
|
|
222
|
+
#else
|
|
223
|
+
uniform lowp sampler2D inputBuffer;
|
|
224
|
+
#endif
|
|
225
|
+
#if DEPTH_PACKING == 3201
|
|
226
|
+
uniform lowp sampler2D depthBuffer;
|
|
227
|
+
#elif defined(GL_FRAGMENT_PRECISION_HIGH)
|
|
228
|
+
uniform highp sampler2D depthBuffer;
|
|
229
|
+
#else
|
|
230
|
+
uniform mediump sampler2D depthBuffer;
|
|
231
|
+
#endif
|
|
232
|
+
uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){
|
|
233
|
+
#if DEPTH_PACKING == 3201
|
|
234
|
+
float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
235
|
+
#else
|
|
236
|
+
float depth=texture2D(depthBuffer,uv).r;
|
|
237
|
+
#endif
|
|
238
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
239
|
+
float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
|
|
240
|
+
#elif defined(USE_REVERSED_DEPTH_BUFFER)
|
|
241
|
+
depth=1.0-depth;
|
|
242
|
+
#endif
|
|
243
|
+
return depth;}float getViewZ(const in float depth){
|
|
244
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
245
|
+
return perspectiveDepthToViewZ(depth,cameraNear,cameraFar);
|
|
246
|
+
#else
|
|
247
|
+
return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
|
|
248
|
+
#endif
|
|
249
|
+
}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0;
|
|
250
|
+
#ifdef ENCODE_OUTPUT
|
|
251
|
+
#include <colorspace_fragment>
|
|
252
|
+
#endif
|
|
253
|
+
#include <dithering_fragment>
|
|
254
|
+
}`,mh="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",vh=class extends Yt{constructor(n,i,l,o,c=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:Qo.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new xe(null),depthBuffer:new xe(null),resolution:new xe(new Me),texelSize:new xe(new Me),cameraNear:new xe(.3),cameraFar:new xe(1e3),aspect:new xe(1),time:new xe(0)},blending:jn,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:c}),n&&this.setShaderParts(n),i&&this.setDefines(i),l&&this.setUniforms(l),this.copyCameraSettings(o)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,i=hr){this.depthBuffer=n,this.depthPacking=i}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=hh.replace(Se.FRAGMENT_HEAD,n.get(Se.FRAGMENT_HEAD)||"").replace(Se.FRAGMENT_MAIN_UV,n.get(Se.FRAGMENT_MAIN_UV)||"").replace(Se.FRAGMENT_MAIN_IMAGE,n.get(Se.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=mh.replace(Se.VERTEX_HEAD,n.get(Se.VERTEX_HEAD)||"").replace(Se.VERTEX_MAIN_SUPPORT,n.get(Se.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(n){for(const i of n.entries())this.defines[i[0]]=i[1];return this.needsUpdate=!0,this}setUniforms(n){for(const i of n.entries())this.uniforms[i[0]]=i[1];return this}setExtensions(n){this.extensions={};for(const i of n)this.extensions[i]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof Bn?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,i){const l=this.uniforms;l.resolution.value.set(n,i),l.texelSize.value.set(1/n,1/i),l.aspect.value=n/i}static get Section(){return Se}};function su(n,i,l){for(const o of i){const c="$1"+n+o.charAt(0).toUpperCase()+o.slice(1),f=new RegExp("([^\\.])(\\b"+o+"\\b)","g");for(const d of l.entries())d[1]!==null&&l.set(d[0],d[1].replace(f,c))}}function gh(n,i,l){let o=i.getFragmentShader(),c=i.getVertexShader();const f=o!==void 0&&/mainImage/.test(o),d=o!==void 0&&/mainUv/.test(o);if(l.attributes|=i.getAttributes(),o===void 0)throw new Error(`Missing fragment shader (${i.name})`);if(d&&l.attributes&tn.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${i.name})`);if(!f&&!d)throw new Error(`Could not find mainImage or mainUv function (${i.name})`);{const h=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,v=l.shaderParts;let y=v.get(Se.FRAGMENT_HEAD)||"",p=v.get(Se.FRAGMENT_MAIN_UV)||"",m=v.get(Se.FRAGMENT_MAIN_IMAGE)||"",E=v.get(Se.VERTEX_HEAD)||"",x=v.get(Se.VERTEX_MAIN_SUPPORT)||"";const P=new Set,U=new Set;if(d&&(p+=` ${n}MainUv(UV);
|
|
255
|
+
`,l.uvTransformation=!0),c!==null&&/mainSupport/.test(c)){const C=/mainSupport *\([\w\s]*?uv\s*?\)/.test(c);x+=` ${n}MainSupport(`,x+=C?`vUv);
|
|
256
|
+
`:`);
|
|
257
|
+
`;for(const z of c.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const H of z[1].split(/\s*,\s*/))l.varyings.add(H),P.add(H),U.add(H);for(const z of c.matchAll(h))U.add(z[1])}for(const C of o.matchAll(h))U.add(C[1]);for(const C of i.defines.keys())U.add(C.replace(/\([\w\s,]*\)/g,""));for(const C of i.uniforms.keys())U.add(C);U.delete("while"),U.delete("for"),U.delete("if"),i.uniforms.forEach((C,z)=>l.uniforms.set(n+z.charAt(0).toUpperCase()+z.slice(1),C)),i.defines.forEach((C,z)=>l.defines.set(n+z.charAt(0).toUpperCase()+z.slice(1),C));const O=new Map([["fragment",o],["vertex",c]]);su(n,U,l.defines),su(n,U,O),o=O.get("fragment"),c=O.get("vertex");const R=i.blendMode;if(l.blendModes.set(R.blendFunction,R),f){i.inputColorSpace!==null&&i.inputColorSpace!==l.colorSpace&&(m+=i.inputColorSpace===nt?`color0 = sRGBTransferOETF(color0);
|
|
258
|
+
`:`color0 = sRGBToLinear(color0);
|
|
259
|
+
`),i.outputColorSpace!==yu?l.colorSpace=i.outputColorSpace:i.inputColorSpace!==null&&(l.colorSpace=i.inputColorSpace);const C=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;m+=`${n}MainImage(color0, UV, `,l.attributes&tn.DEPTH&&C.test(o)&&(m+="depth, ",l.readDepth=!0),m+=`color1);
|
|
260
|
+
`;const z=n+"BlendOpacity";l.uniforms.set(z,R.opacity),m+=`color0 = blend${R.blendFunction}(color0, color1, ${z});
|
|
261
|
+
|
|
262
|
+
`,y+=`uniform float ${z};
|
|
263
|
+
|
|
264
|
+
`}if(y+=o+`
|
|
265
|
+
`,c!==null&&(E+=c+`
|
|
266
|
+
`),v.set(Se.FRAGMENT_HEAD,y),v.set(Se.FRAGMENT_MAIN_UV,p),v.set(Se.FRAGMENT_MAIN_IMAGE,m),v.set(Se.VERTEX_HEAD,E),v.set(Se.VERTEX_MAIN_SUPPORT,x),i.extensions!==null)for(const C of i.extensions)l.extensions.add(C)}}var yh=class extends pt{constructor(n,...i){super("EffectPass"),this.fullscreenMaterial=new vh(null,null,null,n),this.listener=l=>this.handleEvent(l),this.effects=[],this.setEffects(i),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const i of this.effects)i.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const i of this.effects)i.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const i=this.fullscreenMaterial;i.dithering=n,i.needsUpdate=!0}setEffects(n){for(const i of this.effects)i.removeEventListener("change",this.listener);this.effects=n.sort((i,l)=>l.attributes-i.attributes);for(const i of this.effects)i.addEventListener("change",this.listener)}updateMaterial(){const n=new dp;let i=0;for(const d of this.effects)if(d.blendMode.blendFunction===de.DST)n.attributes|=d.getAttributes()&tn.DEPTH;else{if(n.attributes&d.getAttributes()&tn.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${d.name})`);gh("e"+i++,d,n)}let l=n.shaderParts.get(Se.FRAGMENT_HEAD),o=n.shaderParts.get(Se.FRAGMENT_MAIN_IMAGE),c=n.shaderParts.get(Se.FRAGMENT_MAIN_UV);const f=/\bblend\b/g;for(const d of n.blendModes.values())l+=d.getShaderCode().replace(f,`blend${d.blendFunction}`)+`
|
|
267
|
+
`;n.attributes&tn.DEPTH?(n.readDepth&&(o=`float depth = readDepth(UV);
|
|
268
|
+
|
|
269
|
+
`+o),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===nt&&(o+=`color0 = sRGBToLinear(color0);
|
|
270
|
+
`),n.uvTransformation?(c=`vec2 transformedUv = vUv;
|
|
271
|
+
`+c,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(Se.FRAGMENT_HEAD,l),n.shaderParts.set(Se.FRAGMENT_MAIN_IMAGE,o),n.shaderParts.set(Se.FRAGMENT_MAIN_UV,c);for(const[d,h]of n.shaderParts)h!==null&&n.shaderParts.set(d,h.trim().replace(/^#/,`
|
|
272
|
+
#`));this.skipRendering=i===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,i=hr){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=i;for(const l of this.effects)l.setDepthTexture(n,i)}render(n,i,l,o,c){for(const f of this.effects)f.update(n,i,o);if(!this.skipRendering||this.renderToScreen){const f=this.fullscreenMaterial;f.inputBuffer=i.texture,f.time+=o*this.timeScale,n.setRenderTarget(this.renderToScreen?null:l),n.render(this.scene,this.camera)}}setSize(n,i){this.fullscreenMaterial.setSize(n,i);for(const l of this.effects)l.setSize(n,i)}initialize(n,i,l){this.renderer=n;for(const o of this.effects)o.initialize(n,i,l);this.updateMaterial(),l!==void 0&&l!==Sn&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},Sh=class extends pt{constructor(n,i,{renderTarget:l,resolutionScale:o=1,width:c=rt.AUTO_SIZE,height:f=rt.AUTO_SIZE,resolutionX:d=c,resolutionY:h=f}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new qu(n,i,new Pf);const v=this.renderPass;v.ignoreBackground=!0,v.skipShadowMapUpdate=!0;const y=v.getClearPass();y.overrideClearColor=new dt(7829503),y.overrideClearAlpha=1,this.renderTarget=l,this.renderTarget===void 0&&(this.renderTarget=new Bt(1,1,{minFilter:qi,magFilter:qi}),this.renderTarget.texture.name="NormalPass.Target");const p=this.resolution=new rt(this,d,h,o);p.addEventListener("change",m=>this.setSize(p.baseWidth,p.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,i,l,o,c){const f=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,f,f)}setSize(n,i){const l=this.resolution;l.setBaseSize(n,i),this.renderTarget.setSize(l.width,l.height)}};const xh=M.createContext(null),ou=n=>(n.getAttributes()&tn.CONVOLUTION)===tn.CONVOLUTION,Eh=ko.memo(M.forwardRef(({children:n,camera:i,scene:l,resolutionScale:o,enabled:c=!0,renderPriority:f=1,autoClear:d=!0,depthBuffer:h,enableNormalPass:v,stencilBuffer:y,multisampling:p=8,frameBufferType:m=Af},E)=>{const{gl:x,scene:P,camera:U,size:O}=St(),R=l||P,C=i||U,[z,H,j]=M.useMemo(()=>{const X=Gd(),V=new fp(x,{depthBuffer:h,stencilBuffer:y,multisampling:p>0&&X?p:0,frameBufferType:m});V.addPass(new qu(R,C));let F=null,N=null;return v&&(N=new Sh(R,C),N.enabled=!1,V.addPass(N),o!==void 0&&X&&(F=new ph({normalBuffer:N.texture,resolutionScale:o}),F.enabled=!1,V.addPass(F))),[V,N,F]},[C,x,h,y,p,m,R,v,o]);M.useEffect(()=>z==null?void 0:z.setSize(O.width,O.height),[z,O]),je((X,V)=>{if(c){const F=x.autoClear;x.autoClear=d,y&&!d&&x.clearStencil(),z.render(V),x.autoClear=F}},c?f:0);const k=M.useRef(null);M.useLayoutEffect(()=>{var X;const V=[],F=(X=k.current)==null?void 0:X.__r3f;if(F&&z){const N=F.objects;for(let $=0;$<N.length;$++){const se=N[$];if(se instanceof Vo){const Ne=[se];if(!ou(se)){let _e=null;for(;(_e=N[$+1])instanceof Vo&&!ou(_e);)Ne.push(_e),$++}const he=new yh(C,...Ne);V.push(he)}else se instanceof pt&&V.push(se)}for(const $ of V)z==null||z.addPass($);H&&(H.enabled=!0),j&&(j.enabled=!0)}return()=>{for(const N of V)z==null||z.removePass(N);H&&(H.enabled=!1),j&&(j.enabled=!1)}},[z,n,C,H,j]),M.useEffect(()=>{const X=x.toneMapping;return x.toneMapping=hu,()=>{x.toneMapping=X}},[x]);const re=M.useMemo(()=>({composer:z,normalPass:H,downSamplingPass:j,resolutionScale:o,camera:C,scene:R}),[z,H,j,o,C,R]);return M.useImperativeHandle(E,()=>z,[z]),T.jsx(xh.Provider,{value:re,children:T.jsx("group",{ref:k,children:n})})}));let wh=0;const lu=new WeakMap,Mh=(n,i)=>ko.forwardRef(function({blendFunction:o=i==null?void 0:i.blendFunction,opacity:c=i==null?void 0:i.opacity,...f},d){let h=lu.get(n);if(!h){const p=`@react-three/postprocessing/${n.name}-${wh++}`;zu({[p]:n}),lu.set(n,h=p)}const v=St(p=>p.camera),y=ko.useMemo(()=>{var p,m;return[...(p=i==null?void 0:i.args)!=null?p:[],...(m=f.args)!=null?m:[{...i,...f}]]},[JSON.stringify(f)]);return T.jsx(h,{camera:v,"blendMode-blendFunction":o,"blendMode-opacity-value":c,...f,ref:d,args:y})}),Th=Mh(uh,{blendFunction:de.ADD}),_h="/textures/sun.jpg",dr=1.4;function Rh(){return T.jsxs("group",{children:[T.jsx("pointLight",{position:[0,0,0],intensity:18,distance:70,decay:2,color:"#ffd486"}),T.jsx(M.Suspense,{fallback:T.jsx(Ch,{}),children:T.jsx(Ph,{})}),T.jsx(Ih,{}),T.jsx(Ah,{})]})}function Ph(){const n=M.useRef(null),i=en(kn,_h);return i.wrapS=es,i.wrapT=es,je((l,o)=>{pe.getState().motionEnabled&&n.current&&(n.current.rotation.y+=o*.05)}),T.jsxs("mesh",{ref:n,children:[T.jsx("sphereGeometry",{args:[dr,64,64]}),T.jsx("meshBasicMaterial",{map:i,toneMapped:!1})]})}function Ch(){return T.jsxs("mesh",{children:[T.jsx("sphereGeometry",{args:[dr,48,48]}),T.jsx("meshBasicMaterial",{color:"#fde68a"})]})}function Ih(){const n=M.useRef(null),i=M.useRef(null);return je(()=>{const l=performance.now()*.001;if(n.current){const o=1+Math.sin(l*1.3)*.04;n.current.scale.set(o,o,o)}if(i.current){const o=1+Math.sin(l*.6+1)*.025;i.current.scale.set(o,o,o)}}),T.jsxs(T.Fragment,{children:[T.jsxs("mesh",{ref:n,children:[T.jsx("sphereGeometry",{args:[dr*1.08,32,32]}),T.jsx("meshBasicMaterial",{color:"#fff7c2",transparent:!0,opacity:.22,toneMapped:!1})]}),T.jsxs("mesh",{children:[T.jsx("sphereGeometry",{args:[dr*1.22,32,32]}),T.jsx("meshBasicMaterial",{color:"#ffae3c",transparent:!0,opacity:.1,toneMapped:!1})]}),T.jsxs("mesh",{ref:i,children:[T.jsx("sphereGeometry",{args:[dr*1.5,32,32]}),T.jsx("meshBasicMaterial",{color:"#f97316",transparent:!0,opacity:.04,toneMapped:!1})]})]})}function zh(){if(typeof document>"u")return null;const n=128,i=document.createElement("canvas");i.width=n,i.height=n;const l=i.getContext("2d");if(!l)return null;const o=l.createLinearGradient(0,n,0,0);return o.addColorStop(0,"rgba(255,250,210,1)"),o.addColorStop(.3,"rgba(255,170,40,0.85)"),o.addColorStop(.7,"rgba(220,80,20,0.4)"),o.addColorStop(1,"rgba(120,30,0,0)"),l.fillStyle=o,l.beginPath(),l.moveTo(n*.15,n),l.quadraticCurveTo(n*.5,n*.5,n*.85,n),l.lineTo(n*.5,0),l.closePath(),l.fill(),new Lo(i)}function Ah(){const n=M.useMemo(()=>Array.from({length:8},(o,c)=>{const f=c/8*Math.PI*2+(Math.random()-.5)*.4,d=(Math.random()-.5)*1,h=dr*1.02;return{pos:[h*Math.cos(d)*Math.cos(f),h*Math.sin(d),h*Math.cos(d)*Math.sin(f)],size:.5+Math.random()*.45,phase:Math.random()*Math.PI*2,baseOpacity:.45+Math.random()*.3}}),[]),i=M.useMemo(()=>zh(),[]),l=M.useRef([]);return je(()=>{const o=performance.now()*.001;l.current.forEach((c,f)=>{if(!c)return;const d=n[f],h=.85+Math.sin(o*1.4+d.phase)*.25;c.scale.set(d.size*h,d.size*h*1.4,1);const v=c.material;v.opacity=d.baseOpacity*(.7+Math.sin(o*1.7+d.phase)*.3)})}),i?T.jsx(T.Fragment,{children:n.map((o,c)=>T.jsx("sprite",{ref:f=>{l.current[c]=f},position:o.pos,children:T.jsx("spriteMaterial",{map:i,transparent:!0,depthWrite:!1,blending:Qr,opacity:o.baseOpacity,toneMapped:!1})},c))}):T.jsx(T.Fragment,{})}const au=[[1,.95,.85],[.95,.9,.85],[1,.97,.9],[.92,.88,.82],[1,.95,.85],[1,.95,.85],[1,.78,.45],[1,.7,.4],[.7,.85,1],[.6,.8,1]];function Dh({count:n=1100}){const i=M.useRef(null),l=M.useMemo(()=>{const o=new Float32Array(n*3),c=new Float32Array(n*3),f=220;for(let h=0;h<n;h++){const v=Math.random(),y=Math.random(),p=v*Math.PI*2,m=Math.acos(2*y-1),E=f*(.6+Math.random()*.4);o[h*3]=E*Math.sin(m)*Math.cos(p),o[h*3+1]=E*Math.sin(m)*Math.sin(p),o[h*3+2]=E*Math.cos(m);const x=au[Math.floor(Math.random()*au.length)];c[h*3]=x[0],c[h*3+1]=x[1],c[h*3+2]=x[2]}const d=new xu;return d.setAttribute("position",new $i(o,3)),d.setAttribute("color",new $i(c,3)),d},[n]);return je((o,c)=>{pe.getState().motionEnabled&&i.current&&(i.current.rotation.y+=c*.005,i.current.rotation.x+=c*.002)}),T.jsx("points",{ref:i,geometry:l,children:T.jsx("pointsMaterial",{vertexColors:!0,size:.5,sizeAttenuation:!0,transparent:!0,opacity:.55})})}const Nh=6,Oh=2.4;function Kr(n){return Nh+n*Oh}const Uh=1.4,Bh=.6;function kh(n){return Uh+n*Bh}function Lh(n,i){const l=.18-i*.012,o=Math.max(.05,l);return n?o*1.6:o}function jh(){return .7}function is(n,i,l){const o=Do(l||i),c=(Do(i)%.6-.3)*(l?1:0);return o+c+n*.05}function Do(n){let i=2166136261;for(let l=0;l<n.length;l++)i=(i^n.charCodeAt(l))>>>0,i=Math.imul(i,16777619);return i%360/360*Math.PI*2}function Fh({session:n,index:i,speed:l}){const o=M.useRef(null),c=M.useRef(null),f=M.useRef(null),d=M.useMemo(()=>kh(i),[i]),h=M.useMemo(()=>i*1.4,[i]),v=M.useMemo(()=>new dt(jo(n.model)).multiplyScalar(.7),[n.model]),y=M.useRef(h);return je((p,m)=>{const E=pe.getState().motionEnabled;E&&(y.current+=m*l);const x=y.current;if(o.current&&o.current.position.set(Math.cos(x)*d,Math.sin(x*.6)*.2,Math.sin(x)*d),c.current&&E&&(c.current.rotation.y+=m*.6),f.current){const P=Eu(n.status);f.current.emissive.lerp(new dt(P.color),.08),f.current.emissiveIntensity=Ln.lerp(f.current.emissiveIntensity,P.intensity*.7,.06)}}),T.jsx("group",{ref:o,children:T.jsxs("mesh",{ref:c,children:[T.jsx("sphereGeometry",{args:[.18,16,16]}),T.jsx("meshStandardMaterial",{ref:f,color:v,emissive:v,emissiveIntensity:.2,roughness:.7})]})})}function $u({radius:n,color:i,intensity:l=1,power:o=3}){const c=M.useMemo(()=>new Yt({uniforms:{uColor:{value:new dt(i)},uIntensity:{value:l},uPower:{value:o}},transparent:!0,depthWrite:!1,side:cr,vertexShader:`
|
|
273
|
+
varying vec3 vNormal;
|
|
274
|
+
varying vec3 vViewDir;
|
|
275
|
+
void main() {
|
|
276
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
277
|
+
vNormal = normalize(normalMatrix * normal);
|
|
278
|
+
vViewDir = normalize(-mvPosition.xyz);
|
|
279
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
280
|
+
}
|
|
281
|
+
`,fragmentShader:`
|
|
282
|
+
uniform vec3 uColor;
|
|
283
|
+
uniform float uIntensity;
|
|
284
|
+
uniform float uPower;
|
|
285
|
+
varying vec3 vNormal;
|
|
286
|
+
varying vec3 vViewDir;
|
|
287
|
+
void main() {
|
|
288
|
+
// Back-side render: dot(normal, view) is positive at the silhouette.
|
|
289
|
+
float fres = pow(max(0.0, dot(vNormal, vViewDir)), uPower);
|
|
290
|
+
gl_FragColor = vec4(uColor * uIntensity, fres);
|
|
291
|
+
}
|
|
292
|
+
`}),[i,l,o]);return T.jsxs("mesh",{children:[T.jsx("sphereGeometry",{args:[n*1.18,32,32]}),T.jsx("primitive",{object:c,attach:"material"})]})}function bh({session:n}){const i=M.useRef(null),l=M.useRef(null),o=M.useRef(null),c=M.useRef(null),f=M.useRef(null),d=M.useMemo(()=>is(n.orbitSlot,n.id,n.projectId),[n.orbitSlot,n.id]),h=M.useMemo(()=>Kr(n.orbitSlot),[n.orbitSlot]),v=pe(N=>Df(N,n.id)),y=pe(N=>N.selectSession),p=pe(N=>N.selectAdvisor),m=pe(N=>n.advisorRole?Object.values(N.advisors).find($=>$.id===n.advisorRole)??null:null),x=pe(N=>N.selectedSessionId)===n.id,P=n.kind==="advisor",U=pe(N=>n.currentMissionId?N.missions[n.currentMissionId]:void 0),O=pe(N=>Object.values(N.pendingPermissions).filter($=>$.sessionId===n.id).length),R=M.useMemo(()=>Nf(n,U,O),[n,U,O]),C=R.score,z=.4+C/100*.8,H=M.useMemo(()=>new dt(P&&m?m.color:jo(n.model)),[P,m,n.model]),j=M.useRef(d),k=M.useRef(1);je((N,$)=>{const se=pe.getState(),Ne=se.motionEnabled,he=!!(se.selectedSessionId||se.selectedAdvisorId||se.selectedSkillId),_e=se.selectedSessionId===n.id||P&&se.selectedAdvisorId===n.advisorRole,Ee=he&&!_e?.25:1;k.current=Ln.lerp(k.current,Ee,.08);const B=k.current,K=Lh(n.status==="active",n.orbitSlot);Ne&&(j.current+=$*K*.3);const G=j.current,q=Math.cos(G)*h,ae=Math.sin(G)*h,ie=Math.sin(G*.5)*.4;i.current&&i.current.position.set(q,ie,ae);const ze=N.clock.getElapsedTime();if(l.current){Ne&&(l.current.rotation.y+=$*.4);const we=.55+n.contextUsagePct/100*.5,Oe=l.current.scale.x,Ke=Ln.lerp(Oe,we,.04);l.current.scale.set(Ke,Ke,Ke)}if(f.current){const we=Eu(n.status),Oe=new dt(we.color);f.current.emissive.lerp(Oe,.08),f.current.emissiveIntensity=Ln.lerp(f.current.emissiveIntensity,we.intensity*B,.06),f.current.opacity=B,f.current.transparent=B<.99}if(o.current){const we=n.contextUsagePct>=90,Oe=n.contextUsagePct>=80&&!we;if(n.status==="awaiting_permission"||n.status==="awaiting_input"||we||Oe){let Ze=.8,ot="#f59e0b";n.status==="awaiting_permission"?(Ze=1.5,ot="#ef4444"):n.status==="awaiting_input"?(Ze=.8,ot="#f59e0b"):we?(Ze=1.2,ot="#dc2626"):Oe&&(Ze=.6,ot="#fb923c");const Ue=.5+.5*Math.sin(ze*Math.PI*2*Ze),ue=o.current.material;ue.color.set(ot),ue.opacity=(.25+Ue*.5)*B,o.current.visible=!0;const Ge=1.4+Ue*.5;o.current.scale.set(Ge,Ge,Ge)}else o.current.visible=!1}c.current&&(c.current.visible=n.status==="plan_review",c.current.rotation.z+=$*.3)});const re=N=>{N.stopPropagation(),y(n.id),P&&m&&p(m.id)},X=.55,V=M.useMemo(()=>uu(n.id,18)*(Math.PI/180),[n.id]),F=M.useMemo(()=>uu(n.id+"-z",12)*(Math.PI/180),[n.id]);return T.jsxs("group",{ref:i,children:[T.jsx("group",{rotation:[V,0,F],children:T.jsxs("mesh",{ref:l,onClick:re,castShadow:!0,children:[T.jsx("sphereGeometry",{args:[X,32,32]}),T.jsx("meshStandardMaterial",{ref:f,color:H,emissive:H,emissiveIntensity:.06,roughness:.78,metalness:.12})]})}),T.jsx($u,{radius:X,color:P&&m?m.color:jo(n.model),intensity:z*(n.status==="active"?1.2:.9)}),T.jsxs("mesh",{ref:o,visible:!1,children:[T.jsx("sphereGeometry",{args:[X*1.4,24,24]}),T.jsx("meshBasicMaterial",{color:"#ef4444",transparent:!0,opacity:.4})]}),T.jsxs("mesh",{ref:c,visible:!1,rotation:[Math.PI/2.4,0,0],children:[T.jsx("ringGeometry",{args:[X*1.4,X*2,64]}),T.jsx("meshBasicMaterial",{color:"#a78bfa",transparent:!0,opacity:.5,side:2})]}),P&&T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[X*1.25,X*1.35,64]}),T.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.7,side:2})]}),v.map((N,$)=>T.jsx(Fh,{session:N,index:$,speed:jh()},N.id)),T.jsx(Jo,{center:!0,distanceFactor:10,style:{pointerEvents:"none",userSelect:"none"},position:[0,X+.4,0],children:T.jsxs("div",{className:`px-2 py-1 rounded text-[10px] whitespace-nowrap border ${x?"bg-solix-accent/20 border-solix-accent text-white":P?"bg-amber-500/10 border-amber-300/50 text-amber-100":"bg-black/50 border-white/10 text-slate-200"}`,children:[T.jsxs("div",{className:"font-semibold flex items-center gap-1",children:[P&&m&&T.jsx("span",{style:{color:m.color},children:m.glyph}),T.jsx("span",{children:n.name??(P&&m?`${m.codename} (pinned)`:n.id.slice(0,8))})]}),T.jsxs("div",{className:"opacity-70",title:Of[n.status]??void 0,children:[String(n.model)," · ",Uf(n.status),n.wrapperSocketPath&&T.jsx("span",{className:"ml-1.5 text-[9px] uppercase tracking-wide text-solix-accent",title:"Wrapped by `solix run` — UI prompts route to this terminal",children:"· wrapped"})]}),T.jsxs("div",{className:"opacity-70",title:R.reasons.length?R.reasons.join(" · "):"Stable, low context, no pending decisions",children:[T.jsx("span",{style:{color:Bf(C)},children:"♥"})," ","health ",C,R.reasons[0]&&T.jsxs("span",{className:"opacity-80",children:[" · ",R.reasons[0]]})]})]})})]})}function uu(n,i){let l=0;for(let c=0;c<n.length;c++)l=l*31+n.charCodeAt(c)|0;return((l>>>0)%1e3/1e3-.5)*i}function Hh({orbitSlot:n}){const i=Kr(n);return T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[i-.02,i+.02,128]}),T.jsx("meshBasicMaterial",{color:"#1e293b",transparent:!0,opacity:.35,side:2})]})}const Gh=1800;function Wh(n){switch(n){case"Bash":return"#94a3b8";case"Read":return"#60a5fa";case"Write":return"#34d399";case"Edit":case"MultiEdit":return"#fbbf24";case"Task":return"#a78bfa";default:return"#cbd5e1"}}function Vh({toolCallId:n,startX:i,startZ:l,color:o,receivedAt:c}){const f=M.useRef(null),d=M.useRef(null),h=M.useMemo(()=>{const v=Math.hypot(i,l)||1,y=i/v,p=l/v;return{nx:y,nz:p}},[i,l]);return je(()=>{const v=Date.now()-c,y=Math.min(1,v/Gh);if(f.current){const p=Ln.lerp(0,12,y);f.current.position.set(i+h.nx*p,Math.sin(y*Math.PI)*1.4,l+h.nz*p)}if(d.current){const p=d.current.material;p.opacity=1-y}}),T.jsx("group",{ref:f,children:T.jsxs("mesh",{ref:d,children:[T.jsx("sphereGeometry",{args:[.08,8,8]}),T.jsx("meshBasicMaterial",{color:o,transparent:!0,opacity:.9})]})})}function Qh(){const n=pe(l=>l.playback.active?l.playback.derivedToolCalls:l.recentToolCalls),i=pe(l=>l.playback.active?l.playback.derivedSessions:l.sessions);return T.jsx("group",{children:n.map(l=>{const o=i[l.sessionId];if(!o)return null;const c=Kr(o.orbitSlot),f=is(o.orbitSlot,o.id,o.projectId),d=(Date.now()-l.startedAt)/1e3,v=f+d*.18*.3,y=Math.cos(v)*c,p=Math.sin(v)*c;return T.jsx(Vh,{toolCallId:l.id,startX:y,startZ:p,color:Wh(l.tool),receivedAt:l.receivedAt},l.id)})})}const rs=3.3,On=.34,Yh={saturn:{body:"/textures/saturn.jpg",ring:"/textures/saturn_ring.png",ringInner:1.5,ringOuter:2.4,axialTilt:.45},mars:{body:"/textures/mars.jpg",axialTilt:.4},earth:{body:"/textures/earth.jpg",cloud:"/textures/earth_clouds.png",axialTilt:.41},jupiter:{body:"/textures/jupiter.jpg",axialTilt:.05},moon:{body:"/textures/moon.jpg",axialTilt:.1}};function Xh({advisor:n,index:i,total:l}){const o=M.useRef(null),c=M.useMemo(()=>i/Math.max(1,l)*Math.PI*2,[i,l]),f=pe(m=>m.selectAdvisor),d=pe(m=>m.selectedAdvisorId===n.id),h=M.useRef(c);je((m,E)=>{pe.getState().motionEnabled&&(h.current+=E*.18);const x=h.current;o.current&&o.current.position.set(Math.cos(x)*rs,0,Math.sin(x)*rs)});const v=M.useRef(1);je(()=>{const m=pe.getState(),E=!!(m.selectedSessionId||m.selectedAdvisorId||m.selectedSkillId),x=m.selectedAdvisorId===n.id||n.pinnedSessionId&&m.selectedSessionId===n.pinnedSessionId,P=E&&!x?.25:1;v.current=Ln.lerp(v.current,P,.08)});const y=m=>{m.stopPropagation(),f(n.id)},p=n.texturePack?Yh[n.texturePack]:void 0;return T.jsxs("group",{ref:o,children:[p?T.jsx(M.Suspense,{fallback:T.jsx(cu,{advisor:n,onClick:y,dimRef:v}),children:T.jsx(Kh,{advisor:n,pack:p,onClick:y,dimRef:v})}):T.jsx(cu,{advisor:n,onClick:y,dimRef:v}),T.jsx($u,{radius:On,color:n.color,intensity:n.pinned?1.4:.7,power:3.5}),T.jsx(Jo,{center:!0,distanceFactor:9,style:{pointerEvents:"none",userSelect:"none"},position:[0,On+.32,0],children:T.jsxs("div",{className:`px-1.5 py-0.5 rounded text-[9px] whitespace-nowrap border ${d?"bg-amber-400/20 border-amber-300 text-amber-100":"bg-black/60 border-white/10 text-amber-100/80"}`,children:[T.jsx("span",{className:"mr-1",children:n.glyph}),n.codename,n.pinned&&T.jsx("span",{className:"ml-1 text-amber-300",children:"●"})]})})]})}function Kh({advisor:n,pack:i,onClick:l,dimRef:o}){const c=M.useRef(null),f=M.useRef(null),d=M.useRef(null),h=M.useRef(null),v=M.useRef(null),y=M.useRef(null),p=en(kn,i.body),m=en(kn,i.cloud??"/textures/sun.jpg"),E=en(kn,i.ring??"/textures/sun.jpg");p.wrapS=es,p.wrapT=es,je((O,R)=>{pe.getState().motionEnabled&&(c.current&&(c.current.rotation.y+=R*.18),f.current&&(f.current.rotation.y+=R*.25),d.current&&(d.current.rotation.z+=R*.05));const z=o.current;h.current&&(h.current.opacity=z,h.current.transparent=z<.99),v.current&&(v.current.opacity=.55*z),y.current&&(y.current.opacity=.85*z)});const x=i.axialTilt??0,P=(i.ringInner??1.5)*On,U=(i.ringOuter??2.4)*On;return T.jsxs("group",{rotation:[x,0,0],children:[T.jsxs("mesh",{ref:c,onClick:l,children:[T.jsx("sphereGeometry",{args:[On,48,48]}),T.jsx("meshStandardMaterial",{ref:h,map:p,roughness:.85,metalness:.05,emissive:new dt(n.color),emissiveIntensity:n.pinned?.25:.1,transparent:!0,opacity:1})]}),i.cloud&&T.jsxs("mesh",{ref:f,children:[T.jsx("sphereGeometry",{args:[On*1.02,48,48]}),T.jsx("meshStandardMaterial",{ref:v,map:m,transparent:!0,opacity:.55,depthWrite:!1,roughness:1})]}),i.ring&&T.jsxs("mesh",{ref:d,rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[P,U,96]}),T.jsx("meshStandardMaterial",{ref:y,map:E,transparent:!0,opacity:.85,side:Dn,depthWrite:!1,roughness:1})]})]})}function cu({advisor:n,onClick:i,dimRef:l}){const o=M.useRef(null),c=M.useRef(null),f=M.useMemo(()=>new dt(n.color),[n.color]);return je((d,h)=>{if(pe.getState().motionEnabled&&o.current&&(o.current.rotation.y+=h*.4),c.current){const y=l.current,p=n.pinned?.6:.22;c.current.emissiveIntensity=Ln.lerp(c.current.emissiveIntensity,p*y,.05),c.current.opacity=y,c.current.transparent=y<.99}}),T.jsxs("mesh",{ref:o,onClick:i,children:[T.jsx("sphereGeometry",{args:[On,24,24]}),T.jsx("meshStandardMaterial",{ref:c,color:f,emissive:f,emissiveIntensity:.22,roughness:.55,metalness:.4,transparent:!0,opacity:1})]})}function Zh(){const n=pe(kf);return n.length?T.jsxs("group",{children:[T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[rs-.03,rs+.03,128]}),T.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.12,side:Dn})]}),n.map((i,l)=>T.jsx(Xh,{advisor:i,index:l,total:n.length},i.id))]}):null}const Jh=22,qh=1.6,$h=.2;function em(n){switch(n){case"anthropic":return new dt("#94a3b8");case"solix":return new dt("#a855f7");case"user":return new dt("#06b6d4");default:return new dt("#cbd5e1")}}const lr=new jf;function tm(){const n=pe(Lf),i=pe(v=>v.selectSkill),l=pe(v=>v.selectedSkillId),o=M.useRef(null),c=M.useMemo(()=>n.map((v,y)=>{const p=y/Math.max(1,n.length)*Math.PI*2,m=(v.id.charCodeAt(0)??0)%13/13-.5,E=Jh+m*qh,x=Math.sin(p*1.7+(v.id.charCodeAt(1)??0))*.3+Math.tan($h)*Math.sin(p)*.4,P=.18+v.id.length%5*.04,U=new Bo;return U.setFromAxisAngle(new De(1,.4,.1).normalize(),p*1.3),{angle:p,radius:E,y:x,size:P,rot:U,color:em(v.source),skill:v}}),[n]),f=M.useRef(0),d=M.useRef(0);if(je((v,y)=>{if(!o.current||!c.length)return;pe.getState().motionEnabled&&(f.current+=y*.04,d.current+=y*.8);const m=f.current,E=d.current;for(let x=0;x<c.length;x++){const P=c[x],U=P.angle+m;lr.position.set(Math.cos(U)*P.radius,P.y,Math.sin(U)*P.radius),lr.quaternion.copy(P.rot),lr.rotateY(E+x);const R=l===P.skill.id?P.size*1.6:P.size;lr.scale.set(R,R,R),lr.updateMatrix(),o.current.setMatrixAt(x,lr.matrix),o.current.setColorAt(x,P.color)}o.current.instanceMatrix.needsUpdate=!0,o.current.instanceColor&&(o.current.instanceColor.needsUpdate=!0)}),!c.length)return null;const h=v=>{v.stopPropagation();const y=v.instanceId;if(typeof y!="number")return;const p=c[y];p&&i(p.skill.id)};return T.jsxs("instancedMesh",{ref:o,args:[void 0,void 0,c.length],onClick:h,children:[T.jsx("icosahedronGeometry",{args:[1,0]}),T.jsx("meshStandardMaterial",{roughness:.85,metalness:.05})]})}function nm(){const n=pe(c=>c.projects),i=pe(wu),l=pe(Mu),o=M.useMemo(()=>{const c=[...i,...l],f=new Map;for(const d of c){const h=n[d.projectId];if(!h)continue;const v=f.get(h.id);v?v.sessions.push(d):f.set(h.id,{project:h,sessions:[d]})}return[...f.values()]},[i,l,n]);return o.length<2?T.jsx(T.Fragment,{}):T.jsx(T.Fragment,{children:o.map(({project:c,sessions:f})=>{const d=f.reduce((m,E)=>Math.max(m,E.orbitSlot),0),h=is(d,f[0].id,c.id),v=Kr(d)+1.2,y=Math.cos(h)*v,p=Math.sin(h)*v;return T.jsx(Jo,{position:[y,1.6,p],center:!0,distanceFactor:14,style:{pointerEvents:"none",userSelect:"none"},children:T.jsxs("div",{className:"px-2 py-1 rounded text-[9px] uppercase tracking-widest border border-solix-accent/30 bg-black/50 text-solix-accent/80 whitespace-nowrap",children:[c.name,T.jsxs("span",{className:"ml-1.5 text-slate-500",children:["· ",f.length]})]})},c.id)})})}const No=[{position:[-160,70,-110],size:240,hue:.92,saturation:.75,rotationSpeed:.008,driftAxis:[0,1,0]},{position:[150,-50,-130],size:280,hue:.74,saturation:.78,rotationSpeed:-.006,driftAxis:[1,0,0]},{position:[-30,-20,-260],size:360,hue:.5,saturation:.7,rotationSpeed:.004,driftAxis:[0,1,1]},{position:[60,130,-180],size:200,hue:.95,saturation:.85,rotationSpeed:.011,driftAxis:[1,.4,0]},{position:[200,80,-240],size:290,hue:.62,saturation:.7,rotationSpeed:-.005,driftAxis:[.5,1,0]},{position:[-130,-90,-200],size:220,hue:.08,saturation:.55,rotationSpeed:.007,driftAxis:[0,0,1]}];function rm(n,i){const o=document.createElement("canvas");o.width=256,o.height=256;const c=o.getContext("2d");if(!c)return new Lo(o);const f=n*360,d=`hsla(${f}, ${Math.round(i*100)}%, 60%, 0.85)`,h=`hsla(${f}, ${Math.round(i*100)}%, 45%, 0.35)`,v=`hsla(${f}, ${Math.round(i*100)}%, 25%, 0)`,y=c.createRadialGradient(256/2,256/2,0,256/2,256/2,256/2);y.addColorStop(0,d),y.addColorStop(.45,h),y.addColorStop(1,v),c.fillStyle=y,c.fillRect(0,0,256,256),c.globalCompositeOperation="destination-in";for(let m=0;m<60;m++){const E=Math.random()*256,x=Math.random()*256,P=30+Math.random()*70,U=.4+Math.random()*.6,O=c.createRadialGradient(E,x,0,E,x,P);O.addColorStop(0,`rgba(255,255,255,${U})`),O.addColorStop(1,"rgba(255,255,255,0)"),c.fillStyle=O,c.fillRect(0,0,256,256)}const p=new Lo(o);return p.needsUpdate=!0,p}function im(){const n=M.useRef(null),i=M.useRef([]),l=M.useMemo(()=>No.map(o=>typeof document>"u"?null:rm(o.hue,o.saturation)),[]);return je((o,c)=>{pe.getState().motionEnabled&&i.current.forEach((f,d)=>{if(!f)return;const h=No[d];f.material.rotation+=c*h.rotationSpeed;const v=performance.now()*1e-4;f.position.x=h.position[0]+Math.sin(v*(d+1))*6,f.position.y=h.position[1]+Math.cos(v*(d+1))*4})}),T.jsx("group",{ref:n,children:No.map((o,c)=>{const f=l[c];return f?T.jsx("sprite",{ref:d=>{i.current[c]=d},position:o.position,scale:[o.size,o.size,1],children:T.jsx("spriteMaterial",{map:f,transparent:!0,depthWrite:!1,blending:Qr,opacity:.55,toneMapped:!1})},c):null})})}const fu=3,du=12e3,sm=24e3,ec=1500;let om=1;function pu(n){const i=Math.random(),l=Math.random(),o=i*Math.PI*2,c=Math.acos(2*l-1);return new De(n*Math.sin(c)*Math.cos(o),n*Math.sin(c)*Math.sin(o),n*Math.cos(c))}function lm(){const[n,i]=M.useState([]);return M.useEffect(()=>{let l=!1,o=null;const c=()=>{if(l)return;const f=du+Math.random()*(sm-du);o=setTimeout(()=>{if(l)return;if(!pe.getState().motionEnabled){c();return}const d=pu(180),h=pu(1).multiplyScalar(60).add(d).normalize().multiplyScalar(180);i(v=>{const y=[...v,{id:om++,start:d,end:h,spawnedAt:performance.now()}];return y.length>fu?y.slice(y.length-fu):y}),c()},f)};return c(),()=>{l=!0,o&&clearTimeout(o)}},[]),je(()=>{const l=performance.now();i(o=>{const c=o.filter(f=>l-f.spawnedAt<ec+200);return c.length===o.length?o:c})}),T.jsx(T.Fragment,{children:n.map(l=>T.jsx(am,{spec:l},l.id))})}function am({spec:n}){const i=M.useRef(null),l=M.useRef(null);return je(()=>{const o=(performance.now()-n.spawnedAt)/ec;if(o>1)return;const c=o*o*(3-2*o),f=new De().lerpVectors(n.start,n.end,c);if(i.current){i.current.position.copy(f);const d=i.current.material;d.opacity=(1-o)*1}if(l.current){const d=Math.max(0,o-.08),h=new De().lerpVectors(n.start,n.end,d);l.current.position.copy(h),l.current.lookAt(f);const v=l.current.material;v.opacity=(1-o)*.5}}),T.jsxs(T.Fragment,{children:[T.jsxs("mesh",{ref:i,position:n.start,children:[T.jsx("sphereGeometry",{args:[1.4,8,8]}),T.jsx("meshBasicMaterial",{color:"#fff5cf",transparent:!0,opacity:0,toneMapped:!1,blending:Qr,depthWrite:!1})]}),T.jsxs("mesh",{ref:l,position:n.start,children:[T.jsx("coneGeometry",{args:[.8,14,6,1,!0]}),T.jsx("meshBasicMaterial",{color:"#fff5cf",transparent:!0,opacity:0,toneMapped:!1,blending:Qr,depthWrite:!1})]})]})}const tc=600,um=2.4;let cm=1;function fm(){const[n,i]=M.useState([]),l=M.useRef(null);return M.useEffect(()=>pe.subscribe(c=>{const f=c.selectedSessionId,d=l.current;if(f===d||(l.current=f,!f))return;const h=c.sessions[f];if(!h)return;const v=Kr(h.orbitSlot),y=is(h.orbitSlot,h.id,h.projectId),p=Math.cos(y)*v,m=Math.sin(y)*v;i(E=>[...E,{id:cm++,position:[p,0,m],spawnedAt:performance.now()}])}),[]),je(()=>{const o=performance.now();i(c=>{const f=c.filter(d=>o-d.spawnedAt<tc+50);return f.length===c.length?c:f})}),T.jsx(T.Fragment,{children:n.map(o=>T.jsx(dm,{spec:o},o.id))})}function dm({spec:n}){const i=M.useRef(null);return je(()=>{if(!i.current)return;const l=(performance.now()-n.spawnedAt)/tc;if(l>1){i.current.visible=!1;return}const c=(1-Math.pow(1-l,2))*um;i.current.scale.set(c,c,c);const f=i.current.material;f.opacity=(1-l)*.65}),T.jsxs("mesh",{ref:i,position:n.position,rotation:[-Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[.92,1,48]}),T.jsx("meshBasicMaterial",{color:"#a5b4fc",transparent:!0,opacity:.65,toneMapped:!1,depthWrite:!1})]})}const pm="/textures/milky_way.jpg";function Sm(){const n=pe(wu),i=pe(Mu),l=pe(h=>h.selectSession),o=pe(h=>h.selectAdvisor),c=pe(h=>h.selectSkill),f=[...n,...i],d=Array.from(new Set(f.map(h=>h.orbitSlot))).sort((h,v)=>h-v);return T.jsxs(Nd,{shadows:!1,camera:{position:[16,9,32],fov:55,near:.1,far:600},gl:{toneMapping:mu,toneMappingExposure:.85},onPointerMissed:()=>{l(null),o(null),c(null)},children:[T.jsx("color",{attach:"background",args:["#05060c"]}),T.jsx("fog",{attach:"fog",args:["#0a0d1f",140,500]}),T.jsx("ambientLight",{intensity:.12}),T.jsx(M.Suspense,{fallback:T.jsx(rp,{radius:180,depth:80,count:6e3,factor:4,saturation:.4,fade:!0,speed:0}),children:T.jsx(hm,{})}),T.jsx(im,{}),T.jsx(Dh,{}),T.jsx(lm,{}),T.jsx(Rh,{}),T.jsx(Zh,{}),T.jsx(tm,{}),d.map(h=>T.jsx(Hh,{orbitSlot:h},h)),f.map(h=>T.jsx(bh,{session:h},h.id)),T.jsx(Qh,{}),T.jsx(fm,{}),T.jsx(nm,{}),T.jsx(mm,{}),T.jsx(Eh,{multisampling:4,children:T.jsx(Th,{intensity:.85,luminanceThreshold:.7,luminanceSmoothing:.2,mipmapBlur:!0,radius:.55})})]})}function hm(){const n=M.useRef(null),i=qo(pm);return T.jsxs("mesh",{ref:n,scale:[-1,1,1],children:[T.jsx("sphereGeometry",{args:[400,48,32]}),T.jsx("meshBasicMaterial",{map:i,side:cr,toneMapped:!1})]})}function mm(){const n=M.useRef(null),{camera:i}=St();return M.useEffect(()=>(Ff(n.current,i),()=>bf()),[i]),T.jsx(ep,{ref:n,makeDefault:!0,enablePan:!0,enableZoom:!0,enableRotate:!0,minDistance:6,maxDistance:140,target:[0,0,0]})}export{Sm as Scene};
|