@shmulikdav/solix 1.5.0 → 1.8.0
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/agents/cinder.md +20 -0
- package/dist/agents/delta.md +20 -0
- package/dist/agents/ledger.md +20 -0
- package/dist/agents/manifest.json +52 -0
- package/dist/agents/spire.md +20 -0
- package/dist/hooks/pre-tool-bash.sh +53 -9
- package/dist/hooks/pre-tool-file.sh +52 -9
- package/dist/hooks/pre-tool-task.sh +54 -9
- package/dist/index.js +815 -49
- package/dist/web/assets/CrewPanel-BZW5L0xR.js +1 -0
- package/dist/web/assets/{GalaxyPanel-CsENB_VZ.js → GalaxyPanel-CCsddWgL.js} +1 -1
- package/dist/web/assets/Scene-D9_dLZUf.js +700 -0
- package/dist/web/assets/{TimelineDrawer-DsGkgssp.js → TimelineDrawer-xRdQJcuf.js} +1 -1
- package/dist/web/assets/index-Df150VgL.js +3900 -0
- package/dist/web/assets/index-V4rr9htx.css +1 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/assets/Scene-DrvagUWn.js +0 -292
- package/dist/web/assets/index-2P2elsQX.js +0 -3900
- package/dist/web/assets/index-BxR0uU1p.css +0 -1
|
@@ -0,0 +1,700 @@
|
|
|
1
|
+
import{r as w,g as Vf,j as S,R as Qf,O as Wn,P as Vn,S as Jo,a as Oo,V as Yf,b as Xf,B as Kf,N as Wu,A as Vu,W as Zf,C as qf,c as ve,d as Te,e as Jf,L as Bo,f as $f,U as An,T as ed,h as td,D as Rn,i as Ss,M as dr,k as pr,l as $o,Q as el,m as nd,n as rd,I as id,F as su,o as tl,p as Sr,q as sd,s as fl,t as Qu,u as Ht,v as ou,w as lu,x as Yu,y as zn,z as od,E as ld,G as Cn,H as st,J as fs,K as Qn,X as ri,Y as it,Z as ad,_ as ud,$ as cd,a0 as Xu,a1 as Ft,a2 as ds,a3 as fd,a4 as ps,a5 as Tr,a6 as dl,a7 as Ku,a8 as Zu,a9 as xr,aa as dd,ab as Xn,ac as _e,ad as qu,ae as pd,af as Ju,ag as hs,ah as nl,ai as hd,aj as ms,ak as rl,al as ce,am as il,an as $u,ao as md,ap as vd,aq as gd,ar as yd,as as Sd,at as xd,au as Ed,av as wd,aw as Md,ax as _d,ay as pl,az as hl,aA as Td,aB as Pd,aC as Rd,aD as Cd}from"./index-Df150VgL.js";var ec={exports:{}},Kn={};/**
|
|
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
|
+
*/Kn.ConcurrentRoot=1;Kn.ContinuousEventPriority=4;Kn.DefaultEventPriority=16;Kn.DiscreteEventPriority=1;Kn.IdleEventPriority=536870912;Kn.LegacyRoot=0;ec.exports=Kn;var Er=ec.exports;function Ad(n){let i;const l=new Set,o=(y,h)=>{const m=typeof y=="function"?y(i):y;if(m!==i){const x=i;i=h?m:Object.assign({},i,m),l.forEach(E=>E(i,x))}},c=()=>i,f=(y,h=c,m=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let x=h(i);function E(){const T=h(i);if(!m(x,T)){const O=x;y(x=T,O)}}return l.add(E),()=>l.delete(E)},v={setState:o,getState:c,subscribe:(y,h,m)=>h||m?f(y,h,m):(l.add(y),()=>l.delete(y)),destroy:()=>l.clear()};return i=n(o,c,v),v}const zd=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),au=zd?w.useEffect:w.useLayoutEffect;function Id(n){const i=typeof n=="function"?Ad(n):n,l=(o=i.getState,c=Object.is)=>{const[,f]=w.useReducer(D=>D+1,0),d=i.getState(),p=w.useRef(d),v=w.useRef(o),y=w.useRef(c),h=w.useRef(!1),m=w.useRef();m.current===void 0&&(m.current=o(d));let x,E=!1;(p.current!==d||v.current!==o||y.current!==c||h.current)&&(x=o(d),E=!c(m.current,x)),au(()=>{E&&(m.current=x),p.current=d,v.current=o,y.current=c,h.current=!1});const T=w.useRef(d);au(()=>{const D=()=>{try{const A=i.getState(),C=v.current(A);y.current(m.current,C)||(p.current=A,m.current=C,f())}catch{h.current=!0,f()}},P=i.subscribe(D);return i.getState()!==T.current&&D(),P},[]);const O=E?x:m.current;return w.useDebugValue(O),O};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 Ud=n=>typeof n=="object"&&typeof n.then=="function",Gn=[];function tc(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 nc(n,i=null,l=!1,o={}){i===null&&(i=[n]);for(const f of Gn)if(tc(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=Gn.indexOf(c);f!==-1&&Gn.splice(f,1)},promise:(Ud(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(Gn.push(c),!l)throw c.promise}const Dd=(n,i,l)=>nc(n,i,!1,l),Od=(n,i,l)=>void nc(n,i,!0,l),Bd=n=>{if(n===void 0||n.length===0)Gn.splice(0,Gn.length);else{const i=Gn.find(l=>tc(n,l.keys,l.equal));i&&i.remove()}};var rc={exports:{}},ic={exports:{}},sc={};/**
|
|
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 J=G-1>>>1,se=b[J];if(0<c(se,K))b[J]=K,b[G]=se,G=J;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 J=0,se=b.length,oe=se>>>1;J<oe;){var Ce=2*(J+1)-1,Le=b[Ce],We=Ce+1,vt=b[We];if(0>c(Le,G))We<se&&0>c(vt,Le)?(b[J]=vt,b[We]=G,J=We):(b[J]=Le,b[Ce]=G,J=Ce);else if(We<se&&0>c(vt,G))b[J]=vt,b[We]=G,J=We;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,p=d.now();n.unstable_now=function(){return d.now()-p}}var v=[],y=[],h=1,m=null,x=3,E=!1,T=!1,O=!1,D=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(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 N(b){if(O=!1,C(b),!T)if(l(v)!==null)T=!0,me(k);else{var K=l(y);K!==null&&ge(N,K.startTime-b)}}function k(b,K){T=!1,O&&(O=!1,P(Y),Y=-1),E=!0;var G=x;try{for(C(K),m=l(v);m!==null&&(!(m.expirationTime>K)||b&&!B());){var J=m.callback;if(typeof J=="function"){m.callback=null,x=m.priorityLevel;var se=J(m.expirationTime<=K);K=n.unstable_now(),typeof se=="function"?m.callback=se:m===l(v)&&o(v),C(K)}else o(v);m=l(v)}if(m!==null)var oe=!0;else{var Ce=l(y);Ce!==null&&ge(N,Ce.startTime-K),oe=!1}return oe}finally{m=null,x=G,E=!1}}var L=!1,re=null,Y=-1,V=5,F=-1;function B(){return!(n.unstable_now()-F<V)}function ie(){if(re!==null){var b=n.unstable_now();F=b;var K=!0;try{K=re(!0,b)}finally{K?de():(L=!1,re=null)}}else L=!1}var de;if(typeof A=="function")de=function(){A(ie)};else if(typeof MessageChannel<"u"){var Be=new MessageChannel,$=Be.port2;Be.port1.onmessage=ie,de=function(){$.postMessage(null)}}else de=function(){D(ie,0)};function me(b){re=b,L||(L=!0,de())}function ge(b,K){Y=D(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(){T||E||(T=!0,me(k))},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 x},n.unstable_getFirstCallbackNode=function(){return l(v)},n.unstable_next=function(b){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var G=x;x=K;try{return b()}finally{x=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=x;x=b;try{return K()}finally{x=G}},n.unstable_scheduleCallback=function(b,K,G){var J=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?J+G:J):G=J,b){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=G+se,b={id:h++,callback:K,priorityLevel:b,startTime:G,expirationTime:se,sortIndex:-1},G>J?(b.sortIndex=G,i(y,b),l(v)===null&&b===l(y)&&(O?(P(Y),Y=-1):O=!0,ge(N,G-J))):(b.sortIndex=se,i(v,b),T||E||(T=!0,me(k))),b},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(b){var K=x;return function(){var G=x;x=K;try{return b.apply(this,arguments)}finally{x=G}}}})(sc);ic.exports=sc;var sl=ic.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 Nd=function(i){var l={},o=w,c=sl,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 p=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,v=Symbol.for("react.element"),y=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),k=Symbol.iterator;function L(e){return e===null||typeof e!="object"?null:(e=k&&e[k]||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 h:return"Fragment";case y:return"Portal";case x:return"Profiler";case m:return"StrictMode";case D:return"Suspense";case P:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:return(e.displayName||"Context")+".Consumer";case E:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A:return t=e.displayName||null,t!==null?t:re(e.type)||"Memo";case C:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}function Y(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 B(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,M=a.child;M;){if(M===r){g=!0,r=a,s=u;break}if(M===s){g=!0,s=a,r=u;break}M=M.sibling}if(!g){for(M=u.child;M;){if(M===r){g=!0,r=u,s=a;break}if(M===s){g=!0,s=u,r=a;break}M=M.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 ie(e){return e=B(e),e!==null?de(e):null}function de(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=de(e);if(t!==null)return t;e=e.sibling}return null}function Be(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){if(e.tag!==4){var t=Be(e);if(t!==null)return t}e=e.sibling}return null}var $=Array.isArray,me=i.getPublicInstance,ge=i.getRootHostContext,b=i.getChildHostContext,K=i.prepareForCommit,G=i.resetAfterCommit,J=i.createInstance,se=i.appendInitialChild,oe=i.finalizeInitialChildren,Ce=i.prepareUpdate,Le=i.shouldSetTextContent,We=i.createTextInstance,vt=i.scheduleTimeout,Mt=i.cancelTimeout,Xe=i.noTimeout,Pe=i.isPrimaryRenderer,le=i.supportsMutation,be=i.supportsPersistence,Se=i.supportsHydration,gt=i.getInstanceFromNode,Bt=i.preparePortalMount,tn=i.getCurrentEventPriority,_t=i.detachDeletedInstance,In=i.supportsMicrotasks,dn=i.scheduleMicrotask,Gt=i.supportsTestSelectors,Rr=i.findFiberRoot,Zn=i.getBoundingRect,Un=i.getTextContent,yt=i.isHiddenSubtree,Cr=i.matchAccessibilityRole,Ar=i.setFocusIfFocusable,Tt=i.setupIntersectionObserver,zr=i.appendChild,xs=i.appendChildToContainer,Es=i.commitTextUpdate,ai=i.commitMount,ws=i.commitUpdate,Ms=i.insertBefore,ui=i.insertInContainerBefore,Ir=i.removeChild,R=i.removeChildFromContainer,H=i.resetTextContent,ne=i.hideInstance,ye=i.hideTextInstance,ke=i.unhideInstance,Nt=i.unhideTextInstance,Wt=i.clearContainer,wl=i.cloneInstance,Ur=i.createContainerChildSet,Pt=i.appendChildToContainerChildSet,Lt=i.finalizeContainerChildren,pn=i.replaceContainerChildren,hn=i.cloneHiddenInstance,mn=i.cloneHiddenTextInstance,qn=i.canHydrateInstance,Nc=i.canHydrateTextInstance,Lc=i.canHydrateSuspenseInstance,Ml=i.isSuspenseInstancePending,_s=i.isSuspenseInstanceFallback,bc=i.registerSuspenseInstanceRetry,Dr=i.getNextHydratableSibling,jc=i.getFirstHydratableChild,kc=i.getFirstHydratableChildWithinContainer,Fc=i.getFirstHydratableChildWithinSuspenseInstance,Hc=i.hydrateInstance,Gc=i.hydrateTextInstance,Wc=i.hydrateSuspenseInstance,Vc=i.getNextHydratableInstanceAfterSuspenseInstance,_l=i.commitHydratedContainer,Qc=i.commitHydratedSuspenseInstance,Yc=i.clearSuspenseBoundary,Xc=i.clearSuspenseBoundaryFromContainer,Kc=i.shouldDeleteUnhydratedTailInstances,Zc=i.didNotMatchHydratedContainerTextInstance,qc=i.didNotMatchHydratedTextInstance,Ts;function Or(e){if(Ts===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ts=t&&t[1]||""}return`
|
|
26
|
+
`+Ts+e}var Ps=!1;function Rs(e,t){if(!e||Ps)return"";Ps=!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(j){var s=j}Reflect.construct(e,[],t)}else{try{t.call()}catch(j){s=j}e.call(t.prototype)}else{try{throw Error()}catch(j){s=j}e()}}catch(j){if(j&&s&&typeof j.stack=="string"){for(var a=j.stack.split(`
|
|
27
|
+
`),u=s.stack.split(`
|
|
28
|
+
`),g=a.length-1,M=u.length-1;1<=g&&0<=M&&a[g]!==u[M];)M--;for(;1<=g&&0<=M;g--,M--)if(a[g]!==u[M]){if(g!==1||M!==1)do if(g--,M--,0>M||a[g]!==u[M]){var U=`
|
|
29
|
+
`+a[g].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),U}while(1<=g&&0<=M);break}}}finally{Ps=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Or(e):""}var Jc=Object.prototype.hasOwnProperty,Cs=[],Jn=-1;function vn(e){return{current:e}}function Ie(e){0>Jn||(e.current=Cs[Jn],Cs[Jn]=null,Jn--)}function Ae(e,t){Jn++,Cs[Jn]=e.current,e.current=t}var gn={},$e=vn(gn),ut=vn(!1),Dn=gn;function $n(e,t){var r=e.type.contextTypes;if(!r)return gn;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 ct(e){return e=e.childContextTypes,e!=null}function ci(){Ie(ut),Ie($e)}function Tl(e,t,r){if($e.current!==gn)throw Error(d(168));Ae($e,t),Ae(ut,r)}function Pl(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,Y(e)||"Unknown",a));return f({},r,s)}function fi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||gn,Dn=$e.current,Ae($e,e),Ae(ut,ut.current),!0}function Rl(e,t,r){var s=e.stateNode;if(!s)throw Error(d(169));r?(e=Pl(e,t,Dn),s.__reactInternalMemoizedMergedChildContext=e,Ie(ut),Ie($e),Ae($e,e)):Ie(ut),Ae(ut,r)}var bt=Math.clz32?Math.clz32:tf,$c=Math.log,ef=Math.LN2;function tf(e){return e>>>=0,e===0?32:31-($c(e)/ef|0)|0}var di=64,pi=4194304;function Br(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 hi(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 M=g&~a;M!==0?s=Br(M):(u&=g,u!==0&&(s=Br(u)))}else g=r&~a,g!==0?s=Br(g):u!==0&&(s=Br(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-bt(t),a=1<<r,s|=e[r],t&=~a;return s}function nf(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 rf(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes;0<u;){var g=31-bt(u),M=1<<g,U=a[g];U===-1?(!(M&r)||M&s)&&(a[g]=nf(M,t)):U<=t&&(e.expiredLanes|=M),u&=~M}}function As(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zs(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Nr(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bt(t),e[t]=r}function sf(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-bt(r),u=1<<a;t[a]=0,s[a]=-1,e[a]=-1,r&=~u}}function Is(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-bt(r),a=1<<s;a&t|e[s]&t&&(e[s]|=t),r&=~a}}var xe=0;function Cl(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Us=c.unstable_scheduleCallback,Al=c.unstable_cancelCallback,of=c.unstable_shouldYield,lf=c.unstable_requestPaint,Ve=c.unstable_now,Ds=c.unstable_ImmediatePriority,af=c.unstable_UserBlockingPriority,Os=c.unstable_NormalPriority,uf=c.unstable_IdlePriority,mi=null,Vt=null;function cf(e){if(Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(mi,e,void 0,(e.current.flags&128)===128)}catch{}}function ff(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qt=typeof Object.is=="function"?Object.is:ff,nn=null,vi=!1,Bs=!1;function zl(e){nn===null?nn=[e]:nn.push(e)}function df(e){vi=!0,zl(e)}function Yt(){if(!Bs&&nn!==null){Bs=!0;var e=0,t=xe;try{var r=nn;for(xe=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}nn=null,vi=!1}catch(a){throw nn!==null&&(nn=nn.slice(e+1)),Us(Ds,Yt),a}finally{xe=t,Bs=!1}}return null}var pf=p.ReactCurrentBatchConfig;function gi(e,t){if(Qt(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(!Jc.call(t,a)||!Qt(e[a],t[a]))return!1}return!0}function hf(e){switch(e.tag){case 5:return Or(e.type);case 16:return Or("Lazy");case 13:return Or("Suspense");case 19:return Or("SuspenseList");case 0:case 2:case 15:return e=Rs(e.type,!1),e;case 11:return e=Rs(e.type.render,!1),e;case 1:return e=Rs(e.type,!0),e;default:return""}}function jt(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 yi=vn(null),Si=null,er=null,Ns=null;function Ls(){Ns=er=Si=null}function Il(e,t,r){Pe?(Ae(yi,t._currentValue),t._currentValue=r):(Ae(yi,t._currentValue2),t._currentValue2=r)}function bs(e){var t=yi.current;Ie(yi),Pe?e._currentValue=t:e._currentValue2=t}function js(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 tr(e,t){Si=e,Ns=er=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Et=!0),e.firstContext=null)}function Rt(e){var t=Pe?e._currentValue:e._currentValue2;if(Ns!==e)if(e={context:e,memoizedValue:t,next:null},er===null){if(Si===null)throw Error(d(308));er=e,Si.dependencies={lanes:0,firstContext:e}}else er=er.next=e;return t}var Xt=null,yn=!1;function ks(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ul(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 rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Sn(e,t){var r=e.updateQueue;r!==null&&(r=r.shared,Fe!==null&&e.mode&1&&!(pe&2)?(e=r.interleaved,e===null?(t.next=t,Xt===null?Xt=[r]:Xt.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 xi(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,Is(e,r)}}function Dl(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 Ei(e,t,r,s){var a=e.updateQueue;yn=!1;var u=a.firstBaseUpdate,g=a.lastBaseUpdate,M=a.shared.pending;if(M!==null){a.shared.pending=null;var U=M,j=U.next;U.next=null,g===null?u=j:g.next=j,g=U;var X=e.alternate;X!==null&&(X=X.updateQueue,M=X.lastBaseUpdate,M!==g&&(M===null?X.firstBaseUpdate=j:M.next=j,X.lastBaseUpdate=U))}if(u!==null){var ae=a.baseState;g=0,X=j=U=null,M=u;do{var ee=M.lane,Re=M.eventTime;if((s&ee)===ee){X!==null&&(X=X.next={eventTime:Re,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var q=e,rt=M;switch(ee=t,Re=r,rt.tag){case 1:if(q=rt.payload,typeof q=="function"){ae=q.call(Re,ae,ee);break e}ae=q;break e;case 3:q.flags=q.flags&-65537|128;case 0:if(q=rt.payload,ee=typeof q=="function"?q.call(Re,ae,ee):q,ee==null)break e;ae=f({},ae,ee);break e;case 2:yn=!0}}M.callback!==null&&M.lane!==0&&(e.flags|=64,ee=a.effects,ee===null?a.effects=[M]:ee.push(M))}else Re={eventTime:Re,lane:ee,tag:M.tag,payload:M.payload,callback:M.callback,next:null},X===null?(j=X=Re,U=ae):X=X.next=Re,g|=ee;if(M=M.next,M===null){if(M=a.shared.pending,M===null)break;ee=M,M=ee.next,ee.next=null,a.lastBaseUpdate=ee,a.shared.pending=null}}while(!0);if(X===null&&(U=ae),a.baseState=U,a.firstBaseUpdate=j,a.lastBaseUpdate=X,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);cr|=g,e.lanes=g,e.memoizedState=ae}}function Ol(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 Bl=new o.Component().refs;function Fs(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 wi={isMounted:function(e){return(e=e._reactInternals)?V(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=at(),a=wn(e),u=rn(s,a);u.payload=t,r!=null&&(u.callback=r),Sn(e,u),t=Ut(e,a,s),t!==null&&xi(t,e,a)},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=at(),a=wn(e),u=rn(s,a);u.tag=1,u.payload=t,r!=null&&(u.callback=r),Sn(e,u),t=Ut(e,a,s),t!==null&&xi(t,e,a)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=at(),s=wn(e),a=rn(r,s);a.tag=2,t!=null&&(a.callback=t),Sn(e,a),t=Ut(e,s,r),t!==null&&xi(t,e,s)}};function Nl(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?!gi(r,s)||!gi(a,u):!0}function Ll(e,t,r){var s=!1,a=gn,u=t.contextType;return typeof u=="object"&&u!==null?u=Rt(u):(a=ct(t)?Dn:$e.current,s=t.contextTypes,u=(s=s!=null)?$n(e,a):gn),t=new t(r,u),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wi,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=u),t}function bl(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&&wi.enqueueReplaceState(t,t.state,null)}function Hs(e,t,r,s){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs=Bl,ks(e);var u=t.contextType;typeof u=="object"&&u!==null?a.context=Rt(u):(u=ct(t)?Dn:$e.current,a.context=$n(e,u)),a.state=e.memoizedState,u=t.getDerivedStateFromProps,typeof u=="function"&&(Fs(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&&wi.enqueueReplaceState(a,a.state,null),Ei(e,r,a,s),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}var nr=[],rr=0,Mi=null,_i=0,Ct=[],At=0,On=null,sn=1,on="";function Bn(e,t){nr[rr++]=_i,nr[rr++]=Mi,Mi=e,_i=t}function jl(e,t,r){Ct[At++]=sn,Ct[At++]=on,Ct[At++]=On,On=e;var s=sn;e=on;var a=32-bt(s)-1;s&=~(1<<a),r+=1;var u=32-bt(t)+a;if(30<u){var g=a-a%5;u=(s&(1<<g)-1).toString(32),s>>=g,a-=g,sn=1<<32-bt(t)+a|r<<a|s,on=u+e}else sn=1<<u|r<<a|s,on=e}function Gs(e){e.return!==null&&(Bn(e,1),jl(e,1,0))}function Ws(e){for(;e===Mi;)Mi=nr[--rr],nr[rr]=null,_i=nr[--rr],nr[rr]=null;for(;e===On;)On=Ct[--At],Ct[At]=null,on=Ct[--At],Ct[At]=null,sn=Ct[--At],Ct[At]=null}var St=null,xt=null,Ue=!1,Lr=!1,kt=null;function kl(e,t){var r=Dt(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 Fl(e,t){switch(e.tag){case 5:return t=qn(t,e.type,e.pendingProps),t!==null?(e.stateNode=t,St=e,xt=jc(t),!0):!1;case 6:return t=Nc(t,e.pendingProps),t!==null?(e.stateNode=t,St=e,xt=null,!0):!1;case 13:if(t=Lc(t),t!==null){var r=On!==null?{id:sn,overflow:on}:null;return e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Dt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,St=e,xt=null,!0}return!1;default:return!1}}function Vs(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qs(e){if(Ue){var t=xt;if(t){var r=t;if(!Fl(e,t)){if(Vs(e))throw Error(d(418));t=Dr(r);var s=St;t&&Fl(e,t)?kl(s,r):(e.flags=e.flags&-4097|2,Ue=!1,St=e)}}else{if(Vs(e))throw Error(d(418));e.flags=e.flags&-4097|2,Ue=!1,St=e}}}function Hl(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;St=e}function br(e){if(!Se||e!==St)return!1;if(!Ue)return Hl(e),Ue=!0,!1;if(e.tag!==3&&(e.tag!==5||Kc(e.type)&&!Le(e.type,e.memoizedProps))){var t=xt;if(t){if(Vs(e)){for(e=xt;e;)e=Dr(e);throw Error(d(418))}for(;t;)kl(e,t),t=Dr(t)}}if(Hl(e),e.tag===13){if(!Se)throw Error(d(316));if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));xt=Vc(e)}else xt=St?Dr(e.stateNode):null;return!0}function ir(){Se&&(xt=St=null,Lr=Ue=!1)}function Ys(e){kt===null?kt=[e]:kt.push(e)}function jr(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 M=a.refs;M===Bl&&(M=a.refs={}),g===null?delete M[u]:M[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 Ti(e,t){throw e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Gl(e){var t=e._init;return t(e._payload)}function Wl(e){function t(z,_){if(e){var I=z.deletions;I===null?(z.deletions=[_],z.flags|=16):I.push(_)}}function r(z,_){if(!e)return null;for(;_!==null;)t(z,_),_=_.sibling;return null}function s(z,_){for(z=new Map;_!==null;)_.key!==null?z.set(_.key,_):z.set(_.index,_),_=_.sibling;return z}function a(z,_){return z=_n(z,_),z.index=0,z.sibling=null,z}function u(z,_,I){return z.index=I,e?(I=z.alternate,I!==null?(I=I.index,I<_?(z.flags|=2,_):I):(z.flags|=2,_)):(z.flags|=1048576,_)}function g(z){return e&&z.alternate===null&&(z.flags|=2),z}function M(z,_,I,Q){return _===null||_.tag!==6?(_=Io(I,z.mode,Q),_.return=z,_):(_=a(_,I),_.return=z,_)}function U(z,_,I,Q){var Z=I.type;return Z===h?X(z,_,I.props.children,Q,I.key):_!==null&&(_.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===C&&Gl(Z)===_.type)?(Q=a(_,I.props),Q.ref=jr(z,_,I),Q.return=z,Q):(Q=ns(I.type,I.key,I.props,null,z.mode,Q),Q.ref=jr(z,_,I),Q.return=z,Q)}function j(z,_,I,Q){return _===null||_.tag!==4||_.stateNode.containerInfo!==I.containerInfo||_.stateNode.implementation!==I.implementation?(_=Uo(I,z.mode,Q),_.return=z,_):(_=a(_,I.children||[]),_.return=z,_)}function X(z,_,I,Q,Z){return _===null||_.tag!==7?(_=Hn(I,z.mode,Q,Z),_.return=z,_):(_=a(_,I),_.return=z,_)}function ae(z,_,I){if(typeof _=="string"&&_!==""||typeof _=="number")return _=Io(""+_,z.mode,I),_.return=z,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case v:return I=ns(_.type,_.key,_.props,null,z.mode,I),I.ref=jr(z,null,_),I.return=z,I;case y:return _=Uo(_,z.mode,I),_.return=z,_;case C:var Q=_._init;return ae(z,Q(_._payload),I)}if($(_)||L(_))return _=Hn(_,z.mode,I,null),_.return=z,_;Ti(z,_)}return null}function ee(z,_,I,Q){var Z=_!==null?_.key:null;if(typeof I=="string"&&I!==""||typeof I=="number")return Z!==null?null:M(z,_,""+I,Q);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case v:return I.key===Z?U(z,_,I,Q):null;case y:return I.key===Z?j(z,_,I,Q):null;case C:return Z=I._init,ee(z,_,Z(I._payload),Q)}if($(I)||L(I))return Z!==null?null:X(z,_,I,Q,null);Ti(z,I)}return null}function Re(z,_,I,Q,Z){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return z=z.get(I)||null,M(_,z,""+Q,Z);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return z=z.get(Q.key===null?I:Q.key)||null,U(_,z,Q,Z);case y:return z=z.get(Q.key===null?I:Q.key)||null,j(_,z,Q,Z);case C:var fe=Q._init;return Re(z,_,I,fe(Q._payload),Z)}if($(Q)||L(Q))return z=z.get(I)||null,X(_,z,Q,Z,null);Ti(_,Q)}return null}function q(z,_,I,Q){for(var Z=null,fe=null,ue=_,Ee=_=0,Ye=null;ue!==null&&Ee<I.length;Ee++){ue.index>Ee?(Ye=ue,ue=null):Ye=ue.sibling;var we=ee(z,ue,I[Ee],Q);if(we===null){ue===null&&(ue=Ye);break}e&&ue&&we.alternate===null&&t(z,ue),_=u(we,_,Ee),fe===null?Z=we:fe.sibling=we,fe=we,ue=Ye}if(Ee===I.length)return r(z,ue),Ue&&Bn(z,Ee),Z;if(ue===null){for(;Ee<I.length;Ee++)ue=ae(z,I[Ee],Q),ue!==null&&(_=u(ue,_,Ee),fe===null?Z=ue:fe.sibling=ue,fe=ue);return Ue&&Bn(z,Ee),Z}for(ue=s(z,ue);Ee<I.length;Ee++)Ye=Re(ue,z,Ee,I[Ee],Q),Ye!==null&&(e&&Ye.alternate!==null&&ue.delete(Ye.key===null?Ee:Ye.key),_=u(Ye,_,Ee),fe===null?Z=Ye:fe.sibling=Ye,fe=Ye);return e&&ue.forEach(function(Tn){return t(z,Tn)}),Ue&&Bn(z,Ee),Z}function rt(z,_,I,Q){var Z=L(I);if(typeof Z!="function")throw Error(d(150));if(I=Z.call(I),I==null)throw Error(d(151));for(var fe=Z=null,ue=_,Ee=_=0,Ye=null,we=I.next();ue!==null&&!we.done;Ee++,we=I.next()){ue.index>Ee?(Ye=ue,ue=null):Ye=ue.sibling;var Tn=ee(z,ue,we.value,Q);if(Tn===null){ue===null&&(ue=Ye);break}e&&ue&&Tn.alternate===null&&t(z,ue),_=u(Tn,_,Ee),fe===null?Z=Tn:fe.sibling=Tn,fe=Tn,ue=Ye}if(we.done)return r(z,ue),Ue&&Bn(z,Ee),Z;if(ue===null){for(;!we.done;Ee++,we=I.next())we=ae(z,we.value,Q),we!==null&&(_=u(we,_,Ee),fe===null?Z=we:fe.sibling=we,fe=we);return Ue&&Bn(z,Ee),Z}for(ue=s(z,ue);!we.done;Ee++,we=I.next())we=Re(ue,z,Ee,we.value,Q),we!==null&&(e&&we.alternate!==null&&ue.delete(we.key===null?Ee:we.key),_=u(we,_,Ee),fe===null?Z=we:fe.sibling=we,fe=we);return e&&ue.forEach(function(Wf){return t(z,Wf)}),Ue&&Bn(z,Ee),Z}function Ot(z,_,I,Q){if(typeof I=="object"&&I!==null&&I.type===h&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case v:e:{for(var Z=I.key,fe=_;fe!==null;){if(fe.key===Z){if(Z=I.type,Z===h){if(fe.tag===7){r(z,fe.sibling),_=a(fe,I.props.children),_.return=z,z=_;break e}}else if(fe.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===C&&Gl(Z)===fe.type){r(z,fe.sibling),_=a(fe,I.props),_.ref=jr(z,fe,I),_.return=z,z=_;break e}r(z,fe);break}else t(z,fe);fe=fe.sibling}I.type===h?(_=Hn(I.props.children,z.mode,Q,I.key),_.return=z,z=_):(Q=ns(I.type,I.key,I.props,null,z.mode,Q),Q.ref=jr(z,_,I),Q.return=z,z=Q)}return g(z);case y:e:{for(fe=I.key;_!==null;){if(_.key===fe)if(_.tag===4&&_.stateNode.containerInfo===I.containerInfo&&_.stateNode.implementation===I.implementation){r(z,_.sibling),_=a(_,I.children||[]),_.return=z,z=_;break e}else{r(z,_);break}else t(z,_);_=_.sibling}_=Uo(I,z.mode,Q),_.return=z,z=_}return g(z);case C:return fe=I._init,Ot(z,_,fe(I._payload),Q)}if($(I))return q(z,_,I,Q);if(L(I))return rt(z,_,I,Q);Ti(z,I)}return typeof I=="string"&&I!==""||typeof I=="number"?(I=""+I,_!==null&&_.tag===6?(r(z,_.sibling),_=a(_,I),_.return=z,z=_):(r(z,_),_=Io(I,z.mode,Q),_.return=z,z=_),g(z)):r(z,_)}return Ot}var sr=Wl(!0),Vl=Wl(!1),kr={},zt=vn(kr),Fr=vn(kr),or=vn(kr);function Kt(e){if(e===kr)throw Error(d(174));return e}function Xs(e,t){Ae(or,t),Ae(Fr,e),Ae(zt,kr),e=ge(t),Ie(zt),Ae(zt,e)}function lr(){Ie(zt),Ie(Fr),Ie(or)}function Ql(e){var t=Kt(or.current),r=Kt(zt.current);t=b(r,e.type,t),r!==t&&(Ae(Fr,e),Ae(zt,t))}function Ks(e){Fr.current===e&&(Ie(zt),Ie(Fr))}var De=vn(0);function Pi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Ml(r)||_s(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 Zs=[];function qs(){for(var e=0;e<Zs.length;e++){var t=Zs[e];Pe?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}Zs.length=0}var Ri=p.ReactCurrentDispatcher,It=p.ReactCurrentBatchConfig,ar=0,Ne=null,et=null,Qe=null,Ci=!1,Hr=!1,Gr=0,mf=0;function tt(){throw Error(d(321))}function Js(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Qt(e[r],t[r]))return!1;return!0}function $s(e,t,r,s,a,u){if(ar=u,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ri.current=e===null||e.memoizedState===null?Sf:xf,e=r(s,a),Hr){u=0;do{if(Hr=!1,Gr=0,25<=u)throw Error(d(301));u+=1,Qe=et=null,t.updateQueue=null,Ri.current=Ef,e=r(s,a)}while(Hr)}if(Ri.current=Di,t=et!==null&&et.next!==null,ar=0,Qe=et=Ne=null,Ci=!1,t)throw Error(d(300));return e}function eo(){var e=Gr!==0;return Gr=0,e}function ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?Ne.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Zt(){if(et===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=Qe===null?Ne.memoizedState:Qe.next;if(t!==null)Qe=t,et=e;else{if(e===null)throw Error(d(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},Qe===null?Ne.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function Nn(e,t){return typeof t=="function"?t(e):t}function Ai(e){var t=Zt(),r=t.queue;if(r===null)throw Error(d(311));r.lastRenderedReducer=e;var s=et,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 M=g=null,U=null,j=u;do{var X=j.lane;if((ar&X)===X)U!==null&&(U=U.next={lane:0,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),s=j.hasEagerState?j.eagerState:e(s,j.action);else{var ae={lane:X,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null};U===null?(M=U=ae,g=s):U=U.next=ae,Ne.lanes|=X,cr|=X}j=j.next}while(j!==null&&j!==u);U===null?g=s:U.next=M,Qt(s,t.memoizedState)||(Et=!0),t.memoizedState=s,t.baseState=g,t.baseQueue=U,r.lastRenderedState=s}if(e=r.interleaved,e!==null){a=e;do u=a.lane,Ne.lanes|=u,cr|=u,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function zi(e){var t=Zt(),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);Qt(u,t.memoizedState)||(Et=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),r.lastRenderedState=u}return[u,s]}function Yl(){}function Xl(e,t){var r=Ne,s=Zt(),a=t(),u=!Qt(s.memoizedState,a);if(u&&(s.memoizedState=a,Et=!0),s=s.queue,Vr(ql.bind(null,r,s,e),[e]),s.getSnapshot!==t||u||Qe!==null&&Qe.memoizedState.tag&1){if(r.flags|=2048,Wr(9,Zl.bind(null,r,s,a,t),void 0,null),Fe===null)throw Error(d(349));ar&30||Kl(r,t,a)}return a}function Kl(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Zl(e,t,r,s){t.value=r,t.getSnapshot=s,Jl(t)&&Ut(e,1,-1)}function ql(e,t,r){return r(function(){Jl(t)&&Ut(e,1,-1)})}function Jl(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Qt(e,r)}catch{return!0}}function to(e){var t=ln();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Nn,lastRenderedState:e},t.queue=e,e=e.dispatch=yf.bind(null,Ne,e),[t.memoizedState,e]}function Wr(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.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 $l(){return Zt().memoizedState}function Ii(e,t,r,s){var a=ln();Ne.flags|=e,a.memoizedState=Wr(1|t,r,void 0,s===void 0?null:s)}function Ui(e,t,r,s){var a=Zt();s=s===void 0?null:s;var u=void 0;if(et!==null){var g=et.memoizedState;if(u=g.destroy,s!==null&&Js(s,g.deps)){a.memoizedState=Wr(t,r,u,s);return}}Ne.flags|=e,a.memoizedState=Wr(1|t,r,u,s)}function no(e,t){return Ii(8390656,8,e,t)}function Vr(e,t){return Ui(2048,8,e,t)}function ea(e,t){return Ui(4,2,e,t)}function ta(e,t){return Ui(4,4,e,t)}function na(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 ra(e,t,r){return r=r!=null?r.concat([e]):null,Ui(4,4,na.bind(null,t,e),r)}function ro(){}function ia(e,t){var r=Zt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Js(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function sa(e,t){var r=Zt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Js(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function vf(e,t){var r=xe;xe=r!==0&&4>r?r:4,e(!0);var s=It.transition;It.transition={};try{e(!1),t()}finally{xe=r,It.transition=s}}function oa(){return Zt().memoizedState}function gf(e,t,r){var s=wn(e);r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},la(e)?aa(t,r):(ua(e,t,r),r=at(),e=Ut(e,s,r),e!==null&&ca(e,t,s))}function yf(e,t,r){var s=wn(e),a={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(la(e))aa(t,a);else{ua(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,M=u(g,r);if(a.hasEagerState=!0,a.eagerState=M,Qt(M,g))return}catch{}finally{}r=at(),e=Ut(e,s,r),e!==null&&ca(e,t,s)}}function la(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function aa(e,t){Hr=Ci=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ua(e,t,r){Fe!==null&&e.mode&1&&!(pe&2)?(e=t.interleaved,e===null?(r.next=r,Xt===null?Xt=[t]:Xt.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 ca(e,t,r){if(r&4194240){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Is(e,r)}}var Di={readContext:Rt,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useInsertionEffect:tt,useLayoutEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useMutableSource:tt,useSyncExternalStore:tt,useId:tt,unstable_isNewReconciler:!1},Sf={readContext:Rt,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:no,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ii(4194308,4,na.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ii(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ii(4,2,e,t)},useMemo:function(e,t){var r=ln();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=ln();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=gf.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:to,useDebugValue:ro,useDeferredValue:function(e){var t=to(e),r=t[0],s=t[1];return no(function(){var a=It.transition;It.transition={};try{s(e)}finally{It.transition=a}},[e]),r},useTransition:function(){var e=to(!1),t=e[0];return e=vf.bind(null,e[1]),ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=Ne,a=ln();if(Ue){if(r===void 0)throw Error(d(407));r=r()}else{if(r=t(),Fe===null)throw Error(d(349));ar&30||Kl(s,t,r)}a.memoizedState=r;var u={value:r,getSnapshot:t};return a.queue=u,no(ql.bind(null,s,u,e),[e]),s.flags|=2048,Wr(9,Zl.bind(null,s,u,r,t),void 0,null),r},useId:function(){var e=ln(),t=Fe.identifierPrefix;if(Ue){var r=on,s=sn;r=(s&~(1<<32-bt(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=Gr++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=mf++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xf={readContext:Rt,useCallback:ia,useContext:Rt,useEffect:Vr,useImperativeHandle:ra,useInsertionEffect:ea,useLayoutEffect:ta,useMemo:sa,useReducer:Ai,useRef:$l,useState:function(){return Ai(Nn)},useDebugValue:ro,useDeferredValue:function(e){var t=Ai(Nn),r=t[0],s=t[1];return Vr(function(){var a=It.transition;It.transition={};try{s(e)}finally{It.transition=a}},[e]),r},useTransition:function(){var e=Ai(Nn)[0],t=Zt().memoizedState;return[e,t]},useMutableSource:Yl,useSyncExternalStore:Xl,useId:oa,unstable_isNewReconciler:!1},Ef={readContext:Rt,useCallback:ia,useContext:Rt,useEffect:Vr,useImperativeHandle:ra,useInsertionEffect:ea,useLayoutEffect:ta,useMemo:sa,useReducer:zi,useRef:$l,useState:function(){return zi(Nn)},useDebugValue:ro,useDeferredValue:function(e){var t=zi(Nn),r=t[0],s=t[1];return Vr(function(){var a=It.transition;It.transition={};try{s(e)}finally{It.transition=a}},[e]),r},useTransition:function(){var e=zi(Nn)[0],t=Zt().memoizedState;return[e,t]},useMutableSource:Yl,useSyncExternalStore:Xl,useId:oa,unstable_isNewReconciler:!1};function io(e,t){try{var r="",s=t;do r+=hf(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 so(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var wf=typeof WeakMap=="function"?WeakMap:Map;function fa(e,t,r){r=rn(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){Ki||(Ki=!0,_o=s),so(e,t)},r}function da(e,t,r){r=rn(-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(){so(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(r.callback=function(){so(e,t),typeof s!="function"&&(xn===null?xn=new Set([this]):xn.add(this));var g=t.stack;this.componentDidCatch(t.value,{componentStack:g!==null?g:""})}),r}function pa(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new wf;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=Nf.bind(null,e,t,r),t.then(e,e))}function ha(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 ma(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=rn(-1,1),t.tag=2,Sn(r,t))),r.lanes|=1),e)}function qt(e){e.flags|=4}function va(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 Qr,Yr,Oi,Bi;if(le)Qr=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)se(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}},Yr=function(){},Oi=function(e,t,r,s,a){if(e=e.memoizedProps,e!==s){var u=t.stateNode,g=Kt(zt.current);r=Ce(u,r,e,s,a,g),(t.updateQueue=r)&&qt(t)}},Bi=function(e,t,r,s){r!==s&&qt(t)};else if(be){Qr=function(e,t,r,s){for(var a=t.child;a!==null;){if(a.tag===5){var u=a.stateNode;r&&s&&(u=hn(u,a.type,a.memoizedProps,a)),se(e,u)}else if(a.tag===6)u=a.stateNode,r&&s&&(u=mn(u,a.memoizedProps,a)),se(e,u);else if(a.tag!==4){if(a.tag===22&&a.memoizedState!==null)u=a.child,u!==null&&(u.return=a),Qr(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 ga=function(e,t,r,s){for(var a=t.child;a!==null;){if(a.tag===5){var u=a.stateNode;r&&s&&(u=hn(u,a.type,a.memoizedProps,a)),Pt(e,u)}else if(a.tag===6)u=a.stateNode,r&&s&&(u=mn(u,a.memoizedProps,a)),Pt(e,u);else if(a.tag!==4){if(a.tag===22&&a.memoizedState!==null)u=a.child,u!==null&&(u.return=a),ga(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}};Yr=function(e,t){var r=t.stateNode;if(!va(e,t)){e=r.containerInfo;var s=Ur(e);ga(s,t,!1,!1),r.pendingChildren=s,qt(t),Lt(e,s)}},Oi=function(e,t,r,s,a){var u=e.stateNode,g=e.memoizedProps;if((e=va(e,t))&&g===s)t.stateNode=u;else{var M=t.stateNode,U=Kt(zt.current),j=null;g!==s&&(j=Ce(M,r,g,s,a,U)),e&&j===null?t.stateNode=u:(u=wl(u,j,r,g,s,t,e,M),oe(u,r,s,a,U)&&qt(t),t.stateNode=u,e?qt(t):Qr(u,t,!1,!1))}},Bi=function(e,t,r,s){r!==s?(e=Kt(or.current),r=Kt(zt.current),t.stateNode=We(s,e,r,t),qt(t)):t.stateNode=e.stateNode}}else Yr=function(){},Oi=function(){},Bi=function(){};function Xr(e,t){if(!Ue)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 nt(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 Mf(e,t,r){var s=t.pendingProps;switch(Ws(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(t),null;case 1:return ct(t.type)&&ci(),nt(t),null;case 3:return s=t.stateNode,lr(),Ie(ut),Ie($e),qs(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(br(t)?qt(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,kt!==null&&(Ro(kt),kt=null))),Yr(e,t),nt(t),null;case 5:Ks(t),r=Kt(or.current);var a=t.type;if(e!==null&&t.stateNode!=null)Oi(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 nt(t),null}if(e=Kt(zt.current),br(t)){if(!Se)throw Error(d(175));e=Hc(t.stateNode,t.type,t.memoizedProps,r,e,t,!Lr),t.updateQueue=e,e!==null&&qt(t)}else{var u=J(a,s,r,e,t);Qr(u,t,!1,!1),t.stateNode=u,oe(u,a,s,r,e)&&qt(t)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return nt(t),null;case 6:if(e&&t.stateNode!=null)Bi(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(d(166));if(e=Kt(or.current),r=Kt(zt.current),br(t)){if(!Se)throw Error(d(176));if(e=t.stateNode,s=t.memoizedProps,(r=Gc(e,s,t,!Lr))&&(a=St,a!==null))switch(u=(a.mode&1)!==0,a.tag){case 3:Zc(a.stateNode.containerInfo,e,s,u);break;case 5:qc(a.type,a.memoizedProps,a.stateNode,e,s,u)}r&&qt(t)}else t.stateNode=We(s,e,r,t)}return nt(t),null;case 13:if(Ie(De),s=t.memoizedState,Ue&&xt!==null&&t.mode&1&&!(t.flags&128)){for(e=xt;e;)e=Dr(e);return ir(),t.flags|=98560,t}if(s!==null&&s.dehydrated!==null){if(s=br(t),e===null){if(!s)throw Error(d(318));if(!Se)throw Error(d(344));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));Wc(e,t)}else ir(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;return nt(t),null}return kt!==null&&(Ro(kt),kt=null),t.flags&128?(t.lanes=r,t):(s=s!==null,r=!1,e===null?br(t):r=e.memoizedState!==null,s&&!r&&(t.child.flags|=8192,t.mode&1&&(e===null||De.current&1?Ge===0&&(Ge=3):Ao())),t.updateQueue!==null&&(t.flags|=4),nt(t),null);case 4:return lr(),Yr(e,t),e===null&&Bt(t.stateNode.containerInfo),nt(t),null;case 10:return bs(t.type._context),nt(t),null;case 17:return ct(t.type)&&ci(),nt(t),null;case 19:if(Ie(De),a=t.memoizedState,a===null)return nt(t),null;if(s=(t.flags&128)!==0,u=a.rendering,u===null)if(s)Xr(a,!1);else{if(Ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(u=Pi(e),u!==null){for(t.flags|=128,Xr(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 Ae(De,De.current&1|2),t.child}e=e.sibling}a.tail!==null&&Ve()>Mo&&(t.flags|=128,s=!0,Xr(a,!1),t.lanes=4194304)}else{if(!s)if(e=Pi(u),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),Xr(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!Ue)return nt(t),null}else 2*Ve()-a.renderingStartTime>Mo&&r!==1073741824&&(t.flags|=128,s=!0,Xr(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=De.current,Ae(De,s?e&1|2:e&1),t):(nt(t),null);case 22:case 23:return Co(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?wt&1073741824&&(nt(t),le&&t.subtreeFlags&6&&(t.flags|=8192)):nt(t),null;case 24:return null;case 25:return null}throw Error(d(156,t.tag))}var _f=p.ReactCurrentOwner,Et=!1;function lt(e,t,r,s){t.child=e===null?Vl(t,null,r,s):sr(t,e.child,r,s)}function ya(e,t,r,s,a){r=r.render;var u=t.ref;return tr(t,a),s=$s(e,t,r,s,u,a),r=eo(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,an(e,t,a)):(Ue&&r&&Gs(t),t.flags|=1,lt(e,t,s,a),t.child)}function Sa(e,t,r,s,a){if(e===null){var u=r.type;return typeof u=="function"&&!zo(u)&&u.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=u,xa(e,t,u,s,a)):(e=ns(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:gi,r(g,s)&&e.ref===t.ref)return an(e,t,a)}return t.flags|=1,e=_n(u,s),e.ref=t.ref,e.return=t,t.child=e}function xa(e,t,r,s,a){if(e!==null&&gi(e.memoizedProps,s)&&e.ref===t.ref)if(Et=!1,(e.lanes&a)!==0)e.flags&131072&&(Et=!0);else return t.lanes=e.lanes,an(e,t,a);return oo(e,t,r,s,a)}function Ea(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},Ae(ur,wt),wt|=r;else if(r&1073741824)t.memoizedState={baseLanes:0,cachePool:null},s=u!==null?u.baseLanes:r,Ae(ur,wt),wt|=s;else return e=u!==null?u.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null},t.updateQueue=null,Ae(ur,wt),wt|=e,null;else u!==null?(s=u.baseLanes|r,t.memoizedState=null):s=r,Ae(ur,wt),wt|=s;return lt(e,t,a,r),t.child}function wa(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function oo(e,t,r,s,a){var u=ct(r)?Dn:$e.current;return u=$n(t,u),tr(t,a),r=$s(e,t,r,s,u,a),s=eo(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,an(e,t,a)):(Ue&&s&&Gs(t),t.flags|=1,lt(e,t,r,a),t.child)}function Ma(e,t,r,s,a){if(ct(r)){var u=!0;fi(t)}else u=!1;if(tr(t,a),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),Ll(t,r,s),Hs(t,r,s,a),s=!0;else if(e===null){var g=t.stateNode,M=t.memoizedProps;g.props=M;var U=g.context,j=r.contextType;typeof j=="object"&&j!==null?j=Rt(j):(j=ct(r)?Dn:$e.current,j=$n(t,j));var X=r.getDerivedStateFromProps,ae=typeof X=="function"||typeof g.getSnapshotBeforeUpdate=="function";ae||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(M!==s||U!==j)&&bl(t,g,s,j),yn=!1;var ee=t.memoizedState;g.state=ee,Ei(t,s,g,a),U=t.memoizedState,M!==s||ee!==U||ut.current||yn?(typeof X=="function"&&(Fs(t,r,X,s),U=t.memoizedState),(M=yn||Nl(t,r,M,s,ee,U,j))?(ae||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=U),g.props=s,g.state=U,g.context=j,s=M):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{g=t.stateNode,Ul(e,t),M=t.memoizedProps,j=t.type===t.elementType?M:jt(t.type,M),g.props=j,ae=t.pendingProps,ee=g.context,U=r.contextType,typeof U=="object"&&U!==null?U=Rt(U):(U=ct(r)?Dn:$e.current,U=$n(t,U));var Re=r.getDerivedStateFromProps;(X=typeof Re=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(M!==ae||ee!==U)&&bl(t,g,s,U),yn=!1,ee=t.memoizedState,g.state=ee,Ei(t,s,g,a);var q=t.memoizedState;M!==ae||ee!==q||ut.current||yn?(typeof Re=="function"&&(Fs(t,r,Re,s),q=t.memoizedState),(j=yn||Nl(t,r,j,s,ee,q,U)||!1)?(X||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(s,q,U),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(s,q,U)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||M===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=q),g.props=s,g.state=q,g.context=U,s=j):(typeof g.componentDidUpdate!="function"||M===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),s=!1)}return lo(e,t,r,s,u,a)}function lo(e,t,r,s,a,u){wa(e,t);var g=(t.flags&128)!==0;if(!s&&!g)return a&&Rl(t,r,!1),an(e,t,u);s=t.stateNode,_f.current=t;var M=g&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&g?(t.child=sr(t,e.child,null,u),t.child=sr(t,null,M,u)):lt(e,t,M,u),t.memoizedState=s.state,a&&Rl(t,r,!0),t.child}function _a(e){var t=e.stateNode;t.pendingContext?Tl(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Tl(e,t.context,!1),Xs(e,t.containerInfo)}function Ta(e,t,r,s,a){return ir(),Ys(a),t.flags|=256,lt(e,t,r,s),t.child}var Ni={dehydrated:null,treeContext:null,retryLane:0};function Li(e){return{baseLanes:e,cachePool:null}}function Pa(e,t,r){var s=t.pendingProps,a=De.current,u=!1,g=(t.flags&128)!==0,M;if((M=g)||(M=e!==null&&e.memoizedState===null?!1:(a&2)!==0),M?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Ae(De,a&1),e===null)return Qs(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?_s(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=rs(a,s,0,null),e=Hn(e,s,r,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=Li(r),t.memoizedState=Ni,e):ao(t,a));if(a=e.memoizedState,a!==null){if(M=a.dehydrated,M!==null){if(g)return t.flags&256?(t.flags&=-257,bi(e,t,r,Error(d(422)))):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=s.fallback,a=t.mode,s=rs({mode:"visible",children:s.children},a,0,null),u=Hn(u,a,r,null),u.flags|=2,s.return=t,u.return=t,s.sibling=u,t.child=s,t.mode&1&&sr(t,e.child,null,r),t.child.memoizedState=Li(r),t.memoizedState=Ni,u);if(!(t.mode&1))t=bi(e,t,r,null);else if(_s(M))t=bi(e,t,r,Error(d(419)));else if(s=(r&e.childLanes)!==0,Et||s){if(s=Fe,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,Ut(e,s,-1))}Ao(),t=bi(e,t,r,Error(d(421)))}else Ml(M)?(t.flags|=128,t.child=e.child,t=Lf.bind(null,e),bc(M,t),t=null):(r=a.treeContext,Se&&(xt=Fc(M),St=t,Ue=!0,kt=null,Lr=!1,r!==null&&(Ct[At++]=sn,Ct[At++]=on,Ct[At++]=On,sn=r.id,on=r.overflow,On=t)),t=ao(t,t.pendingProps.children),t.flags|=4096);return t}return u?(s=Ca(e,t,s.children,s.fallback,r),u=t.child,a=e.child.memoizedState,u.memoizedState=a===null?Li(r):{baseLanes:a.baseLanes|r,cachePool:null},u.childLanes=e.childLanes&~r,t.memoizedState=Ni,s):(r=Ra(e,t,s.children,r),t.memoizedState=null,r)}return u?(s=Ca(e,t,s.children,s.fallback,r),u=t.child,a=e.child.memoizedState,u.memoizedState=a===null?Li(r):{baseLanes:a.baseLanes|r,cachePool:null},u.childLanes=e.childLanes&~r,t.memoizedState=Ni,s):(r=Ra(e,t,s.children,r),t.memoizedState=null,r)}function ao(e,t){return t=rs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ra(e,t,r,s){var a=e.child;return e=a.sibling,r=_n(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 Ca(e,t,r,s,a){var u=t.mode;e=e.child;var g=e.sibling,M={mode:"hidden",children:r};return!(u&1)&&t.child!==e?(r=t.child,r.childLanes=0,r.pendingProps=M,t.deletions=null):(r=_n(e,M),r.subtreeFlags=e.subtreeFlags&14680064),g!==null?s=_n(g,s):(s=Hn(s,u,a,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,s}function bi(e,t,r,s){return s!==null&&Ys(s),sr(t,e.child,null,r),e=ao(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Aa(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),js(e.return,t,r)}function uo(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 za(e,t,r){var s=t.pendingProps,a=s.revealOrder,u=s.tail;if(lt(e,t,s.children,r),s=De.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&&Aa(e,r,t);else if(e.tag===19)Aa(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(Ae(De,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&&Pi(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),uo(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&&Pi(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}uo(t,!0,r,null,u);break;case"together":uo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function an(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),cr|=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=_n(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=_n(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Tf(e,t,r){switch(t.tag){case 3:_a(t),ir();break;case 5:Ql(t);break;case 1:ct(t.type)&&fi(t);break;case 4:Xs(t,t.stateNode.containerInfo);break;case 10:Il(t,t.type._context,t.memoizedProps.value);break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ae(De,De.current&1),t.flags|=128,null):r&t.child.childLanes?Pa(e,t,r):(Ae(De,De.current&1),e=an(e,t,r),e!==null?e.sibling:null);Ae(De,De.current&1);break;case 19:if(s=(r&t.childLanes)!==0,e.flags&128){if(s)return za(e,t,r);t.flags|=128}var a=t.memoizedState;if(a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ae(De,De.current),s)break;return null;case 22:case 23:return t.lanes=0,Ea(e,t,r)}return an(e,t,r)}function Pf(e,t){switch(Ws(t),t.tag){case 1:return ct(t.type)&&ci(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lr(),Ie(ut),Ie($e),qs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ks(t),null;case 13:if(Ie(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));ir()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(De),null;case 4:return lr(),null;case 10:return bs(t.type._context),null;case 22:case 23:return Co(),null;case 24:return null;default:return null}}var ji=!1,Ln=!1,Rf=typeof WeakSet=="function"?WeakSet:Set,W=null;function ki(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){pt(e,t,s)}else r.current=null}function co(e,t,r){try{r()}catch(s){pt(e,t,s)}}var Ia=!1;function Cf(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:jt(e.type,s),a);u.__reactInternalSnapshotBeforeUpdate=g}break;case 3:le&&Wt(e.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(d(163))}}catch(M){pt(e,e.return,M)}if(t=e.sibling,t!==null){t.return=e.return,W=t;break}W=e.return}return r=Ia,Ia=!1,r}function bn(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&&co(t,r,u)}a=a.next}while(a!==s)}}function Kr(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 fo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=me(r);break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Ua(e,t,r){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(mi,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)&&co(t,r,u),s=s.next}while(s!==e)}break;case 1:if(ki(t,r),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(g){pt(t,r,g)}break;case 5:ki(t,r);break;case 4:le?ba(e,t,r):be&&be&&(t=t.stateNode.containerInfo,r=Ur(t),pn(t,r))}}function Da(e,t,r){for(var s=t;;)if(Ua(e,s,r),s.child===null||le&&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 Oa(e){var t=e.alternate;t!==null&&(e.alternate=null,Oa(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ba(e){return e.tag===5||e.tag===3||e.tag===4}function Na(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ba(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 La(e){if(le){e:{for(var t=e.return;t!==null;){if(Ba(t))break e;t=t.return}throw Error(d(160))}var r=t;switch(r.tag){case 5:t=r.stateNode,r.flags&32&&(H(t),r.flags&=-33),r=Na(e),ho(e,r,t);break;case 3:case 4:t=r.stateNode.containerInfo,r=Na(e),po(e,r,t);break;default:throw Error(d(161))}}}function po(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?ui(r,e,t):xs(r,e);else if(s!==4&&(e=e.child,e!==null))for(po(e,t,r),e=e.sibling;e!==null;)po(e,t,r),e=e.sibling}function ho(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?Ms(r,e,t):zr(r,e);else if(s!==4&&(e=e.child,e!==null))for(ho(e,t,r),e=e.sibling;e!==null;)ho(e,t,r),e=e.sibling}function ba(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)Da(e,s,r),g?R(u,s.stateNode):Ir(u,s.stateNode);else if(s.tag===18)g?Xc(u,s.stateNode):Yc(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(Ua(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 mo(e,t){if(le){switch(t.tag){case 0:case 11:case 14:case 15:bn(3,t,t.return),Kr(3,t),bn(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&&ws(r,u,a,e,s,t)}return;case 6:if(t.stateNode===null)throw Error(d(162));r=t.memoizedProps,Es(t.stateNode,e!==null?e.memoizedProps:r,r);return;case 3:Se&&e!==null&&e.memoizedState.isDehydrated&&_l(t.stateNode.containerInfo);return;case 12:return;case 13:Fi(t);return;case 19:Fi(t);return;case 17:return}throw Error(d(163))}switch(t.tag){case 0:case 11:case 14:case 15:bn(3,t,t.return),Kr(3,t),bn(5,t,t.return);return;case 12:return;case 13:Fi(t);return;case 19:Fi(t);return;case 3:Se&&e!==null&&e.memoizedState.isDehydrated&&_l(t.stateNode.containerInfo);break;case 22:case 23:return}e:if(be){switch(t.tag){case 1:case 5:case 6:break e;case 3:case 4:t=t.stateNode,pn(t.containerInfo,t.pendingChildren);break e}throw Error(d(163))}}function Fi(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Rf),t.forEach(function(s){var a=bf.bind(null,e,s);r.has(s)||(r.add(s),s.then(a,a))})}}function Af(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;le?ba(u,a,t):Da(u,a,t);var g=a.alternate;g!==null&&(g.return=null),a.return=null}catch(Z){pt(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 M=t.flags;if(M&32&&le&&H(t.stateNode),M&512){var U=t.alternate;if(U!==null){var j=U.ref;j!==null&&(typeof j=="function"?j(null):j.current=null)}}if(M&8192)switch(t.tag){case 13:if(t.memoizedState!==null){var X=t.alternate;(X===null||X.memoizedState===null)&&(wo=Ve())}break;case 22:var ae=t.memoizedState!==null,ee=t.alternate,Re=ee!==null&&ee.memoizedState!==null;if(r=t,le){e:if(s=r,a=ae,u=null,le)for(var q=s;;){if(q.tag===5){if(u===null){u=q;var rt=q.stateNode;a?ne(rt):ke(q.stateNode,q.memoizedProps)}}else if(q.tag===6){if(u===null){var Ot=q.stateNode;a?ye(Ot):Nt(Ot,q.memoizedProps)}}else if((q.tag!==22&&q.tag!==23||q.memoizedState===null||q===s)&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===s)break;for(;q.sibling===null;){if(q.return===null||q.return===s)break e;u===q&&(u=null),q=q.return}u===q&&(u=null),q.sibling.return=q.return,q=q.sibling}}if(ae&&!Re&&r.mode&1){W=r;for(var z=r.child;z!==null;){for(r=W=z;W!==null;){s=W;var _=s.child;switch(s.tag){case 0:case 11:case 14:case 15:bn(4,s,s.return);break;case 1:ki(s,s.return);var I=s.stateNode;if(typeof I.componentWillUnmount=="function"){var Q=s.return;try{I.props=s.memoizedProps,I.state=s.memoizedState,I.componentWillUnmount()}catch(Z){pt(s,Q,Z)}}break;case 5:ki(s,s.return);break;case 22:if(s.memoizedState!==null){Fa(r);continue}}_!==null?(_.return=s,W=_):Fa(r)}z=z.sibling}}}switch(M&4102){case 2:La(t),t.flags&=-3;break;case 6:La(t),t.flags&=-3,mo(t.alternate,t);break;case 4096:t.flags&=-4097;break;case 4100:t.flags&=-4097,mo(t.alternate,t);break;case 4:mo(t.alternate,t)}}catch(Z){pt(t,t.return,Z)}if(r=t.sibling,r!==null){r.return=t.return,W=r;break}W=t.return}}}function zf(e,t,r){W=e,ja(e)}function ja(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||ji;if(!g){var M=a.alternate,U=M!==null&&M.memoizedState!==null||Ln;M=ji;var j=Ln;if(ji=g,(Ln=U)&&!j)for(W=a;W!==null;)g=W,U=g.child,g.tag===22&&g.memoizedState!==null?Ha(a):U!==null?(U.return=g,W=U):Ha(a);for(;u!==null;)W=u,ja(u),u=u.sibling;W=a,ji=M,Ln=j}ka(e)}else a.subtreeFlags&8772&&u!==null?(u.return=a,W=u):ka(e)}}function ka(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:Ln||Kr(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Ln)if(r===null)s.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:jt(t.type,r.memoizedProps);s.componentDidUpdate(a,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var u=t.updateQueue;u!==null&&Ol(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=me(t.child.stateNode);break;case 1:r=t.child.stateNode}Ol(t,g,r)}break;case 5:var M=t.stateNode;r===null&&t.flags&4&&ai(M,t.type,t.memoizedProps,t);break;case 6:break;case 4:break;case 12:break;case 13:if(Se&&t.memoizedState===null){var U=t.alternate;if(U!==null){var j=U.memoizedState;if(j!==null){var X=j.dehydrated;X!==null&&Qc(X)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(d(163))}Ln||t.flags&512&&fo(t)}catch(ae){pt(t,t.return,ae)}}if(t===e){W=null;break}if(r=t.sibling,r!==null){r.return=t.return,W=r;break}W=t.return}}function Fa(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 Ha(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Kr(4,t)}catch(U){pt(t,r,U)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var a=t.return;try{s.componentDidMount()}catch(U){pt(t,a,U)}}var u=t.return;try{fo(t)}catch(U){pt(t,u,U)}break;case 5:var g=t.return;try{fo(t)}catch(U){pt(t,g,U)}}}catch(U){pt(t,t.return,U)}if(t===e){W=null;break}var M=t.sibling;if(M!==null){M.return=t.return,W=M;break}W=t.return}}var Hi=0,Gi=1,Wi=2,Vi=3,Qi=4;if(typeof Symbol=="function"&&Symbol.for){var Zr=Symbol.for;Hi=Zr("selector.component"),Gi=Zr("selector.has_pseudo_class"),Wi=Zr("selector.role"),Vi=Zr("selector.test_id"),Qi=Zr("selector.text")}function vo(e){var t=gt(e);if(t!=null){if(typeof t.memoizedProps["data-testname"]!="string")throw Error(d(364));return t}if(e=Rr(e),e===null)throw Error(d(362));return e.stateNode.current}function go(e,t){switch(t.$$typeof){case Hi:if(e.type===t.value)return!0;break;case Gi: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||!yt(s)){for(;u!=null&&go(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 Wi:if(e.tag===5&&Cr(e.stateNode,t.value))return!0;break;case Qi:if((e.tag===5||e.tag===6)&&(e=Un(e),e!==null&&0<=e.indexOf(t.value)))return!0;break;case Vi: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 yo(e){switch(e.$$typeof){case Hi:return"<"+(re(e.value)||"Unknown")+">";case Gi:return":has("+(yo(e)||"")+")";case Wi:return'[role="'+e.value+'"]';case Qi:return'"'+e.value+'"';case Vi:return'[data-testname="'+e.value+'"]';default:throw Error(d(365))}}function Ga(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||!yt(a)){for(;g!=null&&go(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 So(e,t){if(!Gt)throw Error(d(363));e=vo(e),e=Ga(e,t),t=[],e=Array.from(e);for(var r=0;r<e.length;){var s=e[r++];if(s.tag===5)yt(s)||t.push(s.stateNode);else for(s=s.child;s!==null;)e.push(s),s=s.sibling}return t}var If=Math.ceil,Yi=p.ReactCurrentDispatcher,xo=p.ReactCurrentOwner,je=p.ReactCurrentBatchConfig,pe=0,Fe=null,He=null,Ke=0,wt=0,ur=vn(0),Ge=0,qr=null,cr=0,Xi=0,Eo=0,Jr=null,ft=null,wo=0,Mo=1/0;function fr(){Mo=Ve()+500}var Ki=!1,_o=null,xn=null,Zi=!1,En=null,qi=0,$r=0,To=null,Ji=-1,$i=0;function at(){return pe&6?Ve():Ji!==-1?Ji:Ji=Ve()}function wn(e){return e.mode&1?pe&2&&Ke!==0?Ke&-Ke:pf.transition!==null?($i===0&&(e=di,di<<=1,!(di&4194240)&&(di=64),$i=e),$i):(e=xe,e!==0?e:tn()):1}function Ut(e,t,r){if(50<$r)throw $r=0,To=null,Error(d(185));var s=es(e,t);return s===null?null:(Nr(s,t,r),(!(pe&2)||s!==Fe)&&(s===Fe&&(!(pe&2)&&(Xi|=t),Ge===4&&Mn(s,Ke)),dt(s,r),t===1&&pe===0&&!(e.mode&1)&&(fr(),vi&&Yt())),s)}function es(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 dt(e,t){var r=e.callbackNode;rf(e,t);var s=hi(e,e===Fe?Ke:0);if(s===0)r!==null&&Al(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&Al(r),t===1)e.tag===0?df(Va.bind(null,e)):zl(Va.bind(null,e)),In?dn(function(){pe===0&&Yt()}):Us(Ds,Yt),r=null;else{switch(Cl(s)){case 1:r=Ds;break;case 4:r=af;break;case 16:r=Os;break;case 536870912:r=uf;break;default:r=Os}r=eu(r,Wa.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Wa(e,t){if(Ji=-1,$i=0,pe&6)throw Error(d(327));var r=e.callbackNode;if(Fn()&&e.callbackNode!==r)return null;var s=hi(e,e===Fe?Ke:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=ts(e,s);else{t=s;var a=pe;pe|=2;var u=Xa();(Fe!==e||Ke!==t)&&(fr(),jn(e,t));do try{Of();break}catch(M){Ya(e,M)}while(!0);Ls(),Yi.current=u,pe=a,He!==null?t=0:(Fe=null,Ke=0,t=Ge)}if(t!==0){if(t===2&&(a=As(e),a!==0&&(s=a,t=Po(e,a))),t===1)throw r=qr,jn(e,0),Mn(e,s),dt(e,Ve()),r;if(t===6)Mn(e,s);else{if(a=e.current.alternate,!(s&30)&&!Uf(a)&&(t=ts(e,s),t===2&&(u=As(e),u!==0&&(s=u,t=Po(e,u))),t===1))throw r=qr,jn(e,0),Mn(e,s),dt(e,Ve()),r;switch(e.finishedWork=a,e.finishedLanes=s,t){case 0:case 1:throw Error(d(345));case 2:kn(e,ft);break;case 3:if(Mn(e,s),(s&130023424)===s&&(t=wo+500-Ve(),10<t)){if(hi(e,0)!==0)break;if(a=e.suspendedLanes,(a&s)!==s){at(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=vt(kn.bind(null,e,ft),t);break}kn(e,ft);break;case 4:if(Mn(e,s),(s&4194240)===s)break;for(t=e.eventTimes,a=-1;0<s;){var g=31-bt(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*If(s/1960))-s,10<s){e.timeoutHandle=vt(kn.bind(null,e,ft),s);break}kn(e,ft);break;case 5:kn(e,ft);break;default:throw Error(d(329))}}}return dt(e,Ve()),e.callbackNode===r?Wa.bind(null,e):null}function Po(e,t){var r=Jr;return e.current.memoizedState.isDehydrated&&(jn(e,t).flags|=256),e=ts(e,t),e!==2&&(t=ft,ft=r,t!==null&&Ro(t)),e}function Ro(e){ft===null?ft=e:ft.push.apply(ft,e)}function Uf(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(!Qt(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&=~Eo,t&=~Xi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-bt(t),s=1<<r;e[r]=-1,t&=~s}}function Va(e){if(pe&6)throw Error(d(327));Fn();var t=hi(e,0);if(!(t&1))return dt(e,Ve()),null;var r=ts(e,t);if(e.tag!==0&&r===2){var s=As(e);s!==0&&(t=s,r=Po(e,s))}if(r===1)throw r=qr,jn(e,0),Mn(e,t),dt(e,Ve()),r;if(r===6)throw Error(d(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,kn(e,ft),dt(e,Ve()),null}function Qa(e){En!==null&&En.tag===0&&!(pe&6)&&Fn();var t=pe;pe|=1;var r=je.transition,s=xe;try{if(je.transition=null,xe=1,e)return e()}finally{xe=s,je.transition=r,pe=t,!(pe&6)&&Yt()}}function Co(){wt=ur.current,Ie(ur)}function jn(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==Xe&&(e.timeoutHandle=Xe,Mt(r)),He!==null)for(r=He.return;r!==null;){var s=r;switch(Ws(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&ci();break;case 3:lr(),Ie(ut),Ie($e),qs();break;case 5:Ks(s);break;case 4:lr();break;case 13:Ie(De);break;case 19:Ie(De);break;case 10:bs(s.type._context);break;case 22:case 23:Co()}r=r.return}if(Fe=e,He=e=_n(e.current,null),Ke=wt=t,Ge=0,qr=null,Eo=Xi=cr=0,ft=Jr=null,Xt!==null){for(t=0;t<Xt.length;t++)if(r=Xt[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}Xt=null}return e}function Ya(e,t){do{var r=He;try{if(Ls(),Ri.current=Di,Ci){for(var s=Ne.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}Ci=!1}if(ar=0,Qe=et=Ne=null,Hr=!1,Gr=0,xo.current=null,r===null||r.return===null){Ge=1,qr=t,He=null;break}e:{var u=e,g=r.return,M=r,U=t;if(t=Ke,M.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var j=U,X=M,ae=X.tag;if(!(X.mode&1)&&(ae===0||ae===11||ae===15)){var ee=X.alternate;ee?(X.updateQueue=ee.updateQueue,X.memoizedState=ee.memoizedState,X.lanes=ee.lanes):(X.updateQueue=null,X.memoizedState=null)}var Re=ha(g);if(Re!==null){Re.flags&=-257,ma(Re,g,M,u,t),Re.mode&1&&pa(u,j,t),t=Re,U=j;var q=t.updateQueue;if(q===null){var rt=new Set;rt.add(U),t.updateQueue=rt}else q.add(U);break e}else{if(!(t&1)){pa(u,j,t),Ao();break e}U=Error(d(426))}}else if(Ue&&M.mode&1){var Ot=ha(g);if(Ot!==null){!(Ot.flags&65536)&&(Ot.flags|=256),ma(Ot,g,M,u,t),Ys(U);break e}}u=U,Ge!==4&&(Ge=2),Jr===null?Jr=[u]:Jr.push(u),U=io(U,M),M=g;do{switch(M.tag){case 3:M.flags|=65536,t&=-t,M.lanes|=t;var z=fa(M,U,t);Dl(M,z);break e;case 1:u=U;var _=M.type,I=M.stateNode;if(!(M.flags&128)&&(typeof _.getDerivedStateFromError=="function"||I!==null&&typeof I.componentDidCatch=="function"&&(xn===null||!xn.has(I)))){M.flags|=65536,t&=-t,M.lanes|=t;var Q=da(M,u,t);Dl(M,Q);break e}}M=M.return}while(M!==null)}Za(r)}catch(Z){t=Z,He===r&&r!==null&&(He=r=r.return);continue}break}while(!0)}function Xa(){var e=Yi.current;return Yi.current=Di,e===null?Di:e}function Ao(){(Ge===0||Ge===3||Ge===2)&&(Ge=4),Fe===null||!(cr&268435455)&&!(Xi&268435455)||Mn(Fe,Ke)}function ts(e,t){var r=pe;pe|=2;var s=Xa();Fe===e&&Ke===t||jn(e,t);do try{Df();break}catch(a){Ya(e,a)}while(!0);if(Ls(),pe=r,Yi.current=s,He!==null)throw Error(d(261));return Fe=null,Ke=0,Ge}function Df(){for(;He!==null;)Ka(He)}function Of(){for(;He!==null&&!of();)Ka(He)}function Ka(e){var t=$a(e.alternate,e,wt);e.memoizedProps=e.pendingProps,t===null?Za(e):He=t,xo.current=null}function Za(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Pf(r,t),r!==null){r.flags&=32767,He=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ge=6,He=null;return}}else if(r=Mf(r,t,wt),r!==null){He=r;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);Ge===0&&(Ge=5)}function kn(e,t){var r=xe,s=je.transition;try{je.transition=null,xe=1,Bf(e,t,r)}finally{je.transition=s,xe=r}return null}function Bf(e,t,r){do Fn();while(En!==null);if(pe&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(sf(e,u),e===Fe&&(He=Fe=null,Ke=0),!(s.subtreeFlags&2064)&&!(s.flags&2064)||Zi||(Zi=!0,eu(Os,function(){return Fn(),null})),u=(s.flags&15990)!==0,s.subtreeFlags&15990||u){u=je.transition,je.transition=null;var g=xe;xe=1;var M=pe;pe|=4,xo.current=null,Cf(e,s),Af(e,s),G(e.containerInfo),e.current=s,zf(s),lf(),pe=M,xe=g,je.transition=u}else e.current=s;if(Zi&&(Zi=!1,En=e,qi=a),u=e.pendingLanes,u===0&&(xn=null),cf(s.stateNode),dt(e,Ve()),t!==null)for(r=e.onRecoverableError,s=0;s<t.length;s++)r(t[s]);if(Ki)throw Ki=!1,e=_o,_o=null,e;return qi&1&&e.tag!==0&&Fn(),u=e.pendingLanes,u&1?e===To?$r++:($r=0,To=e):$r=0,Yt(),null}function Fn(){if(En!==null){var e=Cl(qi),t=je.transition,r=xe;try{if(je.transition=null,xe=16>e?16:e,En===null)var s=!1;else{if(e=En,En=null,qi=0,pe&6)throw Error(d(331));var a=pe;for(pe|=4,W=e.current;W!==null;){var u=W,g=u.child;if(W.flags&16){var M=u.deletions;if(M!==null){for(var U=0;U<M.length;U++){var j=M[U];for(W=j;W!==null;){var X=W;switch(X.tag){case 0:case 11:case 15:bn(8,X,u)}var ae=X.child;if(ae!==null)ae.return=X,W=ae;else for(;W!==null;){X=W;var ee=X.sibling,Re=X.return;if(Oa(X),X===j){W=null;break}if(ee!==null){ee.return=Re,W=ee;break}W=Re}}}var q=u.alternate;if(q!==null){var rt=q.child;if(rt!==null){q.child=null;do{var Ot=rt.sibling;rt.sibling=null,rt=Ot}while(rt!==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:bn(9,u,u.return)}var z=u.sibling;if(z!==null){z.return=u.return,W=z;break e}W=u.return}}var _=e.current;for(W=_;W!==null;){g=W;var I=g.child;if(g.subtreeFlags&2064&&I!==null)I.return=g,W=I;else e:for(g=_;W!==null;){if(M=W,M.flags&2048)try{switch(M.tag){case 0:case 11:case 15:Kr(9,M)}}catch(Z){pt(M,M.return,Z)}if(M===g){W=null;break e}var Q=M.sibling;if(Q!==null){Q.return=M.return,W=Q;break e}W=M.return}}if(pe=a,Yt(),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(mi,e)}catch{}s=!0}return s}finally{xe=r,je.transition=t}}return!1}function qa(e,t,r){t=io(r,t),t=fa(e,t,1),Sn(e,t),t=at(),e=es(e,1),e!==null&&(Nr(e,1,t),dt(e,t))}function pt(e,t,r){if(e.tag===3)qa(e,e,r);else for(;t!==null;){if(t.tag===3){qa(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(xn===null||!xn.has(s))){e=io(r,e),e=da(t,e,1),Sn(t,e),e=at(),t=es(t,1),t!==null&&(Nr(t,1,e),dt(t,e));break}}t=t.return}}function Nf(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=at(),e.pingedLanes|=e.suspendedLanes&r,Fe===e&&(Ke&r)===r&&(Ge===4||Ge===3&&(Ke&130023424)===Ke&&500>Ve()-wo?jn(e,0):Eo|=r),dt(e,t)}function Ja(e,t){t===0&&(e.mode&1?(t=pi,pi<<=1,!(pi&130023424)&&(pi=4194304)):t=1);var r=at();e=es(e,t),e!==null&&(Nr(e,t,r),dt(e,r))}function Lf(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ja(e,r)}function bf(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),Ja(e,r)}var $a;$a=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ut.current)Et=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Et=!1,Tf(e,t,r);Et=!!(e.flags&131072)}else Et=!1,Ue&&t.flags&1048576&&jl(t,_i,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=$n(t,$e.current);tr(t,r),a=$s(null,t,s,e,a,r);var u=eo();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,ct(s)?(u=!0,fi(t)):u=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ks(t),a.updater=wi,t.stateNode=a,a._reactInternals=t,Hs(t,s,e,r),t=lo(null,t,s,!0,u,r)):(t.tag=0,Ue&&u&&Gs(t),lt(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=kf(s),e=jt(s,e),a){case 0:t=oo(null,t,s,e,r);break e;case 1:t=Ma(null,t,s,e,r);break e;case 11:t=ya(null,t,s,e,r);break e;case 14:t=Sa(null,t,s,jt(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:jt(s,a),oo(e,t,s,a,r);case 1:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:jt(s,a),Ma(e,t,s,a,r);case 3:e:{if(_a(t),e===null)throw Error(d(387));s=t.pendingProps,u=t.memoizedState,a=u.element,Ul(e,t),Ei(t,s,null,r);var g=t.memoizedState;if(s=g.element,Se&&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=Ta(e,t,s,r,a);break e}else if(s!==a){a=Error(d(424)),t=Ta(e,t,s,r,a);break e}else for(Se&&(xt=kc(t.stateNode.containerInfo),St=t,Ue=!0,kt=null,Lr=!1),r=Vl(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ir(),s===a){t=an(e,t,r);break e}lt(e,t,s,r)}t=t.child}return t;case 5:return Ql(t),e===null&&Qs(t),s=t.type,a=t.pendingProps,u=e!==null?e.memoizedProps:null,g=a.children,Le(s,a)?g=null:u!==null&&Le(s,u)&&(t.flags|=32),wa(e,t),lt(e,t,g,r),t.child;case 6:return e===null&&Qs(t),null;case 13:return Pa(e,t,r);case 4:return Xs(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=sr(t,null,s,r):lt(e,t,s,r),t.child;case 11:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:jt(s,a),ya(e,t,s,a,r);case 7:return lt(e,t,t.pendingProps,r),t.child;case 8:return lt(e,t,t.pendingProps.children,r),t.child;case 12:return lt(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,Il(t,s,g),u!==null)if(Qt(u.value,g)){if(u.children===a.children&&!ut.current){t=an(e,t,r);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var M=u.dependencies;if(M!==null){g=u.child;for(var U=M.firstContext;U!==null;){if(U.context===s){if(u.tag===1){U=rn(-1,r&-r),U.tag=2;var j=u.updateQueue;if(j!==null){j=j.shared;var X=j.pending;X===null?U.next=U:(U.next=X.next,X.next=U),j.pending=U}}u.lanes|=r,U=u.alternate,U!==null&&(U.lanes|=r),js(u.return,r,t),M.lanes|=r;break}U=U.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,M=g.alternate,M!==null&&(M.lanes|=r),js(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}lt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,s=t.pendingProps.children,tr(t,r),a=Rt(a),s=s(a),t.flags|=1,lt(e,t,s,r),t.child;case 14:return s=t.type,a=jt(s,t.pendingProps),a=jt(s.type,a),Sa(e,t,s,a,r);case 15:return xa(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:jt(s,a),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ct(s)?(e=!0,fi(t)):e=!1,tr(t,r),Ll(t,s,a),Hs(t,s,a,r),lo(null,t,s,!0,e,r);case 19:return za(e,t,r);case 22:return Ea(e,t,r)}throw Error(d(156,t.tag))};function eu(e,t){return Us(e,t)}function jf(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 Dt(e,t,r,s){return new jf(e,t,r,s)}function zo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kf(e){if(typeof e=="function")return zo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===O)return 11;if(e===A)return 14}return 2}function _n(e,t){var r=e.alternate;return r===null?(r=Dt(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 ns(e,t,r,s,a,u){var g=2;if(s=e,typeof e=="function")zo(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case h:return Hn(r.children,a,u,t);case m:g=8,a|=8;break;case x:return e=Dt(12,r,t,a|2),e.elementType=x,e.lanes=u,e;case D:return e=Dt(13,r,t,a),e.elementType=D,e.lanes=u,e;case P:return e=Dt(19,r,t,a),e.elementType=P,e.lanes=u,e;case N:return rs(r,a,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:g=10;break e;case T:g=9;break e;case O:g=11;break e;case A:g=14;break e;case C:g=16,s=null;break e}throw Error(d(130,e==null?e:typeof e,""))}return t=Dt(g,r,t,a),t.elementType=e,t.type=s,t.lanes=u,t}function Hn(e,t,r,s){return e=Dt(7,e,s,t),e.lanes=r,e}function rs(e,t,r,s){return e=Dt(22,e,s,t),e.elementType=N,e.lanes=r,e.stateNode={},e}function Io(e,t,r){return e=Dt(6,e,null,t),e.lanes=r,e}function Uo(e,t,r){return t=Dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ff(e,t,r,s,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Xe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zs(0),this.expirationTimes=zs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zs(0),this.identifierPrefix=s,this.onRecoverableError=a,Se&&(this.mutableSourceEagerHydrationData=null)}function tu(e,t,r,s,a,u,g,M,U){return e=new Ff(e,t,r,M,U),t===1?(t=1,u===!0&&(t|=8)):t=0,u=Dt(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null},ks(u),e}function nu(e){if(!e)return gn;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(ct(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(ct(r))return Pl(e,r,t)}return t}function ru(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=ie(t),e===null?null:e.stateNode}function iu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Do(e,t){iu(e,t),(e=e.alternate)&&iu(e,t)}function Hf(e){return e=ie(e),e===null?null:e.stateNode}function Gf(){return null}return l.attemptContinuousHydration=function(e){if(e.tag===13){var t=at();Ut(e,134217728,t),Do(e,134217728)}},l.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13){var t=at(),r=wn(e);Ut(e,r,t),Do(e,r)}},l.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Br(t.pendingLanes);r!==0&&(Is(t,r|1),dt(t,Ve()),!(pe&6)&&(fr(),Yt()))}break;case 13:var s=at();Qa(function(){return Ut(e,1,s)}),Do(e,1)}},l.batchedUpdates=function(e,t){var r=pe;pe|=1;try{return e(t)}finally{pe=r,pe===0&&(fr(),vi&&Yt())}},l.createComponentSelector=function(e){return{$$typeof:Hi,value:e}},l.createContainer=function(e,t,r,s,a,u,g){return tu(e,t,!1,null,r,s,a,u,g)},l.createHasPseudoClassSelector=function(e){return{$$typeof:Gi,value:e}},l.createHydrationContainer=function(e,t,r,s,a,u,g,M,U){return e=tu(r,s,!0,e,a,u,g,M,U),e.context=nu(null),r=e.current,s=at(),a=wn(r),u=rn(s,a),u.callback=t??null,Sn(r,u),e.current.lanes=a,Nr(e,a,s),dt(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:Wi,value:e}},l.createTestNameSelector=function(e){return{$$typeof:Vi,value:e}},l.createTextSelector=function(e){return{$$typeof:Qi,value:e}},l.deferredUpdates=function(e){var t=xe,r=je.transition;try{return je.transition=null,xe=16,e()}finally{xe=t,je.transition=r}},l.discreteUpdates=function(e,t,r,s,a){var u=xe,g=je.transition;try{return je.transition=null,xe=1,e(t,r,s,a)}finally{xe=u,je.transition=g,pe===0&&fr()}},l.findAllNodes=So,l.findBoundingRects=function(e,t){if(!Gt)throw Error(d(363));t=So(e,t),e=[];for(var r=0;r<t.length;r++)e.push(Zn(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,M=t-1;0<=M;M--)if(t!==M){var U=e[M],j=U.x,X=j+U.width,ae=U.y,ee=ae+U.height;if(s>=j&&u>=ae&&a<=X&&g<=ee){e.splice(t,1);break}else if(s!==j||r.width!==U.width||ee<u||ae>g){if(!(u!==ae||r.height!==U.height||X<s||j>a)){j>s&&(U.width+=j-s,U.x=s),X<a&&(U.width=a-j),e.splice(t,1);break}}else{ae>u&&(U.height+=ae-u,U.y=u),ee<g&&(U.height=g-ae),e.splice(t,1);break}}}return e},l.findHostInstance=ru,l.findHostInstanceWithNoPortals=function(e){return e=B(e),e=e!==null?Be(e):null,e===null?null:e.stateNode},l.findHostInstanceWithWarning=function(e){return ru(e)},l.flushControlled=function(e){var t=pe;pe|=1;var r=je.transition,s=xe;try{je.transition=null,xe=1,e()}finally{xe=s,je.transition=r,pe=t,pe===0&&(fr(),Yt())}},l.flushPassiveEffects=Fn,l.flushSync=Qa,l.focusWithin=function(e,t){if(!Gt)throw Error(d(363));for(e=vo(e),t=Ga(e,t),t=Array.from(t),e=0;e<t.length;){var r=t[e++];if(!yt(r)){if(r.tag===5&&Ar(r.stateNode))return!0;for(r=r.child;r!==null;)t.push(r),r=r.sibling}}return!1},l.getCurrentUpdatePriority=function(){return xe},l.getFindAllNodesFailureDescription=function(e,t){if(!Gt)throw Error(d(363));var r=0,s=[];e=[vo(e),0];for(var a=0;a<e.length;){var u=e[a++],g=e[a++],M=t[g];if((u.tag!==5||!yt(u))&&(go(u,M)&&(s.push(yo(M)),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(yo(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 me(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:p.ReactCurrentDispatcher,findHostInstanceByFiber:Hf,findFiberByHostInstance:e.findFiberByHostInstance||Gf,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{mi=t.inject(e),Vt=t}catch{}e=!!t.checkDCE}}return e},l.isAlreadyRendering=function(){return!1},l.observeVisibleRects=function(e,t,r,s){if(!Gt)throw Error(d(363));e=So(e,t);var a=Tt(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=xe;try{return xe=e,t()}finally{xe=r}},l.shouldError=function(){return null},l.shouldSuspend=function(){return!1},l.updateContainer=function(e,t,r,s){var a=t.current,u=at(),g=wn(a);return r=nu(r),t.context===null?t.context=r:t.pendingContext=r,t=rn(u,g),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),Sn(a,t),e=Ut(a,g,u),e!==null&&xi(e,a,g),g},l};rc.exports=Nd;var Ld=rc.exports;const bd=Vf(Ld),ml={},oc=n=>void Object.assign(ml,n);function jd(n,i){function l(h,{args:m=[],attach:x,...E},T){let O=`${h[0].toUpperCase()}${h.slice(1)}`,D;if(h==="primitive"){if(E.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const P=E.object;D=gr(P,{type:h,root:T,attach:x,primitive:!0})}else{const P=ml[O];if(!P)throw new Error(`R3F: ${O} 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!");D=gr(new P(...m),{type:h,root:T,attach:x,memoizedProps:{args:m}})}return D.__r3f.attach===void 0&&(D.isBufferGeometry?D.__r3f.attach="geometry":D.isMaterial&&(D.__r3f.attach="material")),O!=="inject"&&bo(D,E),D}function o(h,m){let x=!1;if(m){var E,T;(E=m.__r3f)!=null&&E.attach?Lo(h,m,m.__r3f.attach):m.isObject3D&&h.isObject3D&&(h.add(m),x=!0),x||(T=h.__r3f)==null||T.objects.push(m),m.__r3f||gr(m,{}),m.__r3f.parent=h,ll(m),yr(m)}}function c(h,m,x){let E=!1;if(m){var T,O;if((T=m.__r3f)!=null&&T.attach)Lo(h,m,m.__r3f.attach);else if(m.isObject3D&&h.isObject3D){m.parent=h,m.dispatchEvent({type:"added"}),h.dispatchEvent({type:"childadded",child:m});const D=h.children.filter(A=>A!==m),P=D.indexOf(x);h.children=[...D.slice(0,P),m,...D.slice(P)],E=!0}E||(O=h.__r3f)==null||O.objects.push(m),m.__r3f||gr(m,{}),m.__r3f.parent=h,ll(m),yr(m)}}function f(h,m,x=!1){h&&[...h].forEach(E=>d(m,E,x))}function d(h,m,x){if(m){var E,T,O;if(m.__r3f&&(m.__r3f.parent=null),(E=h.__r3f)!=null&&E.objects&&(h.__r3f.objects=h.__r3f.objects.filter(N=>N!==m)),(T=m.__r3f)!=null&&T.attach)pu(h,m,m.__r3f.attach);else if(m.isObject3D&&h.isObject3D){var D;h.remove(m),(D=m.__r3f)!=null&&D.root&&Yd(cs(m),m)}const A=(O=m.__r3f)==null?void 0:O.primitive,C=!A&&(x===void 0?m.dispose!==null:x);if(!A){var P;f((P=m.__r3f)==null?void 0:P.objects,m,C),f(m.children,m,C)}if(delete m.__r3f,C&&m.dispose&&m.type!=="Scene"){const N=()=>{try{m.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?sl.unstable_scheduleCallback(sl.unstable_IdlePriority,N):N()}yr(h)}}function p(h,m,x,E){var T;const O=(T=h.__r3f)==null?void 0:T.parent;if(!O)return;const D=l(m,x,h.__r3f.root);if(h.children){for(const P of h.children)P.__r3f&&o(D,P);h.children=h.children.filter(P=>!P.__r3f)}h.__r3f.objects.forEach(P=>o(D,P)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||d(O,h),D.parent&&(D.__r3f.autoRemovedBeforeAppend=!0),o(O,D),D.raycast&&D.__r3f.eventCount&&cs(D).getState().internal.interaction.push(D),[E,E.alternate].forEach(P=>{P!==null&&(P.stateNode=D,P.ref&&(typeof P.ref=="function"?P.ref(D):P.ref.current=D))})}const v=()=>{};return{reconciler:bd({createInstance:l,removeChild:d,appendChild:o,appendInitialChild:o,insertBefore:c,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,m)=>{if(!m)return;const x=h.getState().scene;x.__r3f&&(x.__r3f.root=h,o(x,m))},removeChildFromContainer:(h,m)=>{m&&d(h.getState().scene,m)},insertInContainerBefore:(h,m,x)=>{if(!m||!x)return;const E=h.getState().scene;E.__r3f&&c(E,m,x)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var m;return!!((m=h==null?void 0:h.__r3f)!=null?m:{}).handlers},prepareUpdate(h,m,x,E){var T;if(((T=h==null?void 0:h.__r3f)!=null?T:{}).primitive&&E.object&&E.object!==h)return[!0];{const{args:D=[],children:P,...A}=E,{args:C=[],children:N,...k}=x;if(!Array.isArray(D))throw new Error("R3F: the args prop must be an array!");if(D.some((re,Y)=>re!==C[Y]))return[!0];const L=pc(h,A,k,!0);return L.changes.length?[!1,L]:null}},commitUpdate(h,[m,x],E,T,O,D){m?p(h,E,O,D):bo(h,x)},commitMount(h,m,x,E){var T;const O=(T=h.__r3f)!=null?T:{};h.raycast&&O.handlers&&O.eventCount&&cs(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>gr(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var m;const{attach:x,parent:E}=(m=h.__r3f)!=null?m:{};x&&E&&pu(E,h,x),h.isObject3D&&(h.visible=!1),yr(h)},unhideInstance(h,m){var x;const{attach:E,parent:T}=(x=h.__r3f)!=null?x:{};E&&T&&Lo(T,h,E),(h.isObject3D&&m.visible==null||m.visible)&&(h.visible=!0),yr(h)},createTextInstance:v,hideTextInstance:v,unhideTextInstance:v,getCurrentEventPriority:()=>i?i():Er.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&ze.fun(performance.now)?performance.now:ze.fun(Date.now)?Date.now:()=>0,scheduleTimeout:ze.fun(setTimeout)?setTimeout:void 0,cancelTimeout:ze.fun(clearTimeout)?clearTimeout:void 0}),applyProps:bo}}var uu,cu;const No=n=>"colorSpace"in n||"outputColorSpace"in n,lc=()=>{var n;return(n=ml.ColorManagement)!=null?n:null},ac=n=>n&&n.isOrthographicCamera,kd=n=>n&&n.hasOwnProperty("current"),ii=typeof window<"u"&&((uu=window.document)!=null&&uu.createElement||((cu=window.navigator)==null?void 0:cu.product)==="ReactNative")?w.useLayoutEffect:w.useEffect;function uc(n){const i=w.useRef(n);return ii(()=>void(i.current=n),[n]),i}function Fd({set:n}){return ii(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class cc extends w.Component{constructor(...i){super(...i),this.state={error:!1}}componentDidCatch(i){this.props.set(i)}render(){return this.state.error?null:this.props.children}}cc.getDerivedStateFromError=()=>({error:!0});const fc="__default",fu=new Map,Hd=n=>n&&!!n.memoized&&!!n.changes;function dc(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 ei=n=>{var i;return(i=n.__r3f)==null?void 0:i.root.getState()};function cs(n){let i=n.__r3f.root;for(;i.getState().previousRoot;)i=i.getState().previousRoot;return i}const ze={obj:n=>n===Object(n)&&!ze.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(ze.str(n)||ze.num(n)||ze.boo(n))return n===i;const f=ze.obj(n);if(f&&o==="reference")return n===i;const d=ze.arr(n);if(d&&l==="reference")return n===i;if((d||f)&&n===i)return!0;let p;for(p in n)if(!(p in i))return!1;if(f&&l==="shallow"&&o==="shallow"){for(p in c?i:n)if(!ze.equ(n[p],i[p],{strict:c,objects:"reference"}))return!1}else for(p in c?i:n)if(n[p]!==i[p])return!1;if(ze.und(p)){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 Gd(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 Wd(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const i in n)i.dispose==null||i.dispose(),delete n[i]}function gr(n,i){const l=n;return l.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...i},n}function ol(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 du=/-\d+$/;function Lo(n,i,l){if(ze.str(l)){if(du.test(l)){const f=l.replace(du,""),{target:d,key:p}=ol(n,f);Array.isArray(d[p])||(d[p]=[])}const{target:o,key:c}=ol(n,l);i.__r3f.previousAttach=o[c],o[c]=i}else i.__r3f.previousAttach=l(n,i)}function pu(n,i,l){var o,c;if(ze.str(l)){const{target:f,key:d}=ol(n,l),p=i.__r3f.previousAttach;p===void 0?delete f[d]:f[d]=p}else(o=i.__r3f)==null||o.previousAttach==null||o.previousAttach(n,i);(c=i.__r3f)==null||delete c.previousAttach}function pc(n,{children:i,key:l,ref:o,...c},{children:f,key:d,ref:p,...v}={},y=!1){const h=n.__r3f,m=Object.entries(c),x=[];if(y){const T=Object.keys(v);for(let O=0;O<T.length;O++)c.hasOwnProperty(T[O])||m.unshift([T[O],fc+"remove"])}m.forEach(([T,O])=>{var D;if((D=n.__r3f)!=null&&D.primitive&&T==="object"||ze.equ(O,v[T]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(T))return x.push([T,O,!0,[]]);let P=[];T.includes("-")&&(P=T.split("-")),x.push([T,O,!1,P]);for(const A in c){const C=c[A];A.startsWith(`${T}-`)&&x.push([A,C,!1,A.split("-")])}});const E={...c};return h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.args&&(E.args=h.memoizedProps.args),h!=null&&h.memoizedProps&&h!=null&&h.memoizedProps.attach&&(E.attach=h.memoizedProps.attach),{memoized:E,changes:x}}function bo(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:p}=Hd(i)?i:pc(n,i),v=o==null?void 0:o.eventCount;n.__r3f&&(n.__r3f.memoizedProps=d);for(let x=0;x<p.length;x++){let[E,T,O,D]=p[x];if(No(n)){const N="srgb",k="srgb-linear";E==="encoding"?(E="colorSpace",T=T===3001?N:k):E==="outputEncoding"&&(E="outputColorSpace",T=T===3001?N:k)}let P=n,A=P[E];if(D.length&&(A=D.reduce((C,N)=>C[N],n),!(A&&A.set))){const[C,...N]=D.reverse();P=N.reverse().reduce((k,L)=>k[L],n),E=C}if(T===fc+"remove")if(P.constructor){let C=fu.get(P.constructor);C||(C=new P.constructor,fu.set(P.constructor,C)),T=C[E]}else T=0;if(O&&o)T?o.handlers[E]=T:delete o.handlers[E],o.eventCount=Object.keys(o.handlers).length;else if(A&&A.set&&(A.copy||A instanceof Bo)){if(Array.isArray(T))A.fromArray?A.fromArray(T):A.set(...T);else if(A.copy&&T&&T.constructor&&A.constructor===T.constructor)A.copy(T);else if(T!==void 0){var y;const C=(y=A)==null?void 0:y.isColor;!C&&A.setScalar?A.setScalar(T):A instanceof Bo&&T instanceof Bo?A.mask=T.mask:A.set(T),!lc()&&f&&!f.linear&&C&&A.convertSRGBToLinear()}}else{var h;if(P[E]=T,(h=P[E])!=null&&h.isTexture&&P[E].format===$f&&P[E].type===An&&f){const C=P[E];No(C)&&No(f.gl)?C.colorSpace=f.gl.outputColorSpace:C.encoding=f.gl.outputEncoding}}yr(n)}if(o&&o.parent&&n.raycast&&v!==o.eventCount){const x=cs(n).getState().internal,E=x.interaction.indexOf(n);E>-1&&x.interaction.splice(E,1),o.eventCount&&x.interaction.push(n)}return!(p.length===1&&p[0][0]==="onUpdate")&&p.length&&(l=n.__r3f)!=null&&l.parent&&ll(n),n}function yr(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 ll(n){n.onUpdate==null||n.onUpdate(n)}function Vd(n,i){n.manual||(ac(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 is(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function Qd(){var n;const i=typeof self<"u"&&self||typeof window<"u"&&window;if(!i)return Er.DefaultEventPriority;switch((n=i.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Er.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Er.ContinuousEventPriority;default:return Er.DefaultEventPriority}}function hc(n,i,l,o){const c=l.get(i);c&&(l.delete(i),l.size===0&&(n.delete(o),c.target.releasePointerCapture(o)))}function Yd(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)=>{hc(l.capturedMap,i,o,c)})}function Xd(n){function i(v){const{internal:y}=n.getState(),h=v.offsetX-y.initialClick[0],m=v.offsetY-y.initialClick[1];return Math.round(Math.sqrt(h*h+m*m))}function l(v){return v.filter(y=>["Move","Over","Enter","Out","Leave"].some(h=>{var m;return(m=y.__r3f)==null?void 0:m.handlers["onPointer"+h]}))}function o(v,y){const h=n.getState(),m=new Set,x=[],E=y?y(h.internal.interaction):h.internal.interaction;for(let P=0;P<E.length;P++){const A=ei(E[P]);A&&(A.raycaster.camera=void 0)}h.previousRoot||h.events.compute==null||h.events.compute(v,h);function T(P){const A=ei(P);if(!A||!A.events.enabled||A.raycaster.camera===null)return[];if(A.raycaster.camera===void 0){var C;A.events.compute==null||A.events.compute(v,A,(C=A.previousRoot)==null?void 0:C.getState()),A.raycaster.camera===void 0&&(A.raycaster.camera=null)}return A.raycaster.camera?A.raycaster.intersectObject(P,!0):[]}let O=E.flatMap(T).sort((P,A)=>{const C=ei(P.object),N=ei(A.object);return!C||!N?P.distance-A.distance:N.events.priority-C.events.priority||P.distance-A.distance}).filter(P=>{const A=is(P);return m.has(A)?!1:(m.add(A),!0)});h.events.filter&&(O=h.events.filter(O,h));for(const P of O){let A=P.object;for(;A;){var D;(D=A.__r3f)!=null&&D.eventCount&&x.push({...P,eventObject:A}),A=A.parent}}if("pointerId"in v&&h.internal.capturedMap.has(v.pointerId))for(let P of h.internal.capturedMap.get(v.pointerId).values())m.has(is(P.intersection))||x.push(P.intersection);return x}function c(v,y,h,m){const x=n.getState();if(v.length){const E={stopped:!1};for(const T of v){const O=ei(T.object)||x,{raycaster:D,pointer:P,camera:A,internal:C}=O,N=new ve(P.x,P.y,0).unproject(A),k=F=>{var B,ie;return(B=(ie=C.capturedMap.get(F))==null?void 0:ie.has(T.eventObject))!=null?B:!1},L=F=>{const B={intersection:T,target:y.target};C.capturedMap.has(F)?C.capturedMap.get(F).set(T.eventObject,B):C.capturedMap.set(F,new Map([[T.eventObject,B]])),y.target.setPointerCapture(F)},re=F=>{const B=C.capturedMap.get(F);B&&hc(C.capturedMap,T.eventObject,B,F)};let Y={};for(let F in y){let B=y[F];typeof B!="function"&&(Y[F]=B)}let V={...T,...Y,pointer:P,intersections:v,stopped:E.stopped,delta:h,unprojectedPoint:N,ray:D.ray,camera:A,stopPropagation(){const F="pointerId"in y&&C.capturedMap.get(y.pointerId);if((!F||F.has(T.eventObject))&&(V.stopped=E.stopped=!0,C.hovered.size&&Array.from(C.hovered.values()).find(B=>B.eventObject===T.eventObject))){const B=v.slice(0,v.indexOf(T));f([...B,T])}},target:{hasPointerCapture:k,setPointerCapture:L,releasePointerCapture:re},currentTarget:{hasPointerCapture:k,setPointerCapture:L,releasePointerCapture:re},nativeEvent:y};if(m(V),E.stopped===!0)break}}return v}function f(v){const{internal:y}=n.getState();for(const h of y.hovered.values())if(!v.length||!v.find(m=>m.object===h.object&&m.index===h.index&&m.instanceId===h.instanceId)){const x=h.eventObject.__r3f,E=x==null?void 0:x.handlers;if(y.hovered.delete(is(h)),x!=null&&x.eventCount){const T={...h,intersections:v};E.onPointerOut==null||E.onPointerOut(T),E.onPointerLeave==null||E.onPointerLeave(T)}}}function d(v,y){for(let h=0;h<y.length;h++){const m=y[h].__r3f;m==null||m.handlers.onPointerMissed==null||m.handlers.onPointerMissed(v)}}function p(v){switch(v){case"onPointerLeave":case"onPointerCancel":return()=>f([]);case"onLostPointerCapture":return y=>{const{internal:h}=n.getState();"pointerId"in y&&h.capturedMap.has(y.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(y.pointerId)&&(h.capturedMap.delete(y.pointerId),f([]))})}}return function(h){const{onPointerMissed:m,internal:x}=n.getState();x.lastEvent.current=h;const E=v==="onPointerMove",T=v==="onClick"||v==="onContextMenu"||v==="onDoubleClick",D=o(h,E?l:void 0),P=T?i(h):0;v==="onPointerDown"&&(x.initialClick=[h.offsetX,h.offsetY],x.initialHits=D.map(C=>C.eventObject)),T&&!D.length&&P<=2&&(d(h,x.interaction),m&&m(h)),E&&f(D);function A(C){const N=C.eventObject,k=N.__r3f,L=k==null?void 0:k.handlers;if(k!=null&&k.eventCount)if(E){if(L.onPointerOver||L.onPointerEnter||L.onPointerOut||L.onPointerLeave){const re=is(C),Y=x.hovered.get(re);Y?Y.stopped&&C.stopPropagation():(x.hovered.set(re,C),L.onPointerOver==null||L.onPointerOver(C),L.onPointerEnter==null||L.onPointerEnter(C))}L.onPointerMove==null||L.onPointerMove(C)}else{const re=L[v];re?(!T||x.initialHits.includes(N))&&(d(h,x.interaction.filter(Y=>!x.initialHits.includes(Y))),re(C)):T&&x.initialHits.includes(N)&&d(h,x.interaction.filter(Y=>!x.initialHits.includes(Y)))}}c(D,h,P,A)}}return{handlePointer:p}}const mc=n=>!!(n!=null&&n.render),vc=w.createContext(null),Kd=(n,i)=>{const l=Id((p,v)=>{const y=new ve,h=new ve,m=new ve;function x(P=v().camera,A=h,C=v().size){const{width:N,height:k,top:L,left:re}=C,Y=N/k;A.isVector3?m.copy(A):m.set(...A);const V=P.getWorldPosition(y).distanceTo(m);if(ac(P))return{width:N/P.zoom,height:k/P.zoom,top:L,left:re,factor:1,distance:V,aspect:Y};{const F=P.fov*Math.PI/180,B=2*Math.tan(F/2)*V,ie=B*(N/k);return{width:ie,height:B,top:L,left:re,factor:N/ie,distance:V,aspect:Y}}}let E;const T=P=>p(A=>({performance:{...A.performance,current:P}})),O=new Te;return{set:p,get:v,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(P=1)=>n(v(),P),advance:(P,A)=>i(P,A,v()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Jf,pointer:O,mouse:O,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const P=v();E&&clearTimeout(E),P.performance.current!==P.performance.min&&T(P.performance.min),E=setTimeout(()=>T(v().performance.max),P.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:x},setEvents:P=>p(A=>({...A,events:{...A.events,...P}})),setSize:(P,A,C,N,k)=>{const L=v().camera,re={width:P,height:A,top:N||0,left:k||0,updateStyle:C};p(Y=>({size:re,viewport:{...Y.viewport,...x(L,h,re)}}))},setDpr:P=>p(A=>{const C=dc(P);return{viewport:{...A.viewport,dpr:C,initialDpr:A.viewport.initialDpr||C}}}),setFrameloop:(P="always")=>{const A=v().clock;A.stop(),A.elapsedTime=0,P!=="never"&&(A.start(),A.elapsedTime=0),p(()=>({frameloop:P}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:w.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(P,A,C)=>{const N=v().internal;return N.priority=N.priority+(A>0?1:0),N.subscribers.push({ref:P,priority:A,store:C}),N.subscribers=N.subscribers.sort((k,L)=>k.priority-L.priority),()=>{const k=v().internal;k!=null&&k.subscribers&&(k.priority=k.priority-(A>0?1:0),k.subscribers=k.subscribers.filter(L=>L.ref!==P))}}}}}),o=l.getState();let c=o.size,f=o.viewport.dpr,d=o.camera;return l.subscribe(()=>{const{camera:p,size:v,viewport:y,gl:h,set:m}=l.getState();if(v.width!==c.width||v.height!==c.height||y.dpr!==f){var x;c=v,f=y.dpr,Vd(p,v),h.setPixelRatio(y.dpr);const E=(x=v.updateStyle)!=null?x:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(v.width,v.height,E)}p!==d&&(d=p,m(E=>({viewport:{...E.viewport,...E.viewport.getCurrentViewport(p)}})))}),l.subscribe(p=>n(p)),l};let ss,Zd=new Set,qd=new Set,Jd=new Set;function jo(n,i){if(n.size)for(const{callback:l}of n.values())l(i)}function ti(n,i){switch(n){case"before":return jo(Zd,i);case"after":return jo(qd,i);case"tail":return jo(Jd,i)}}let ko,Fo;function Ho(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),ko=i.internal.subscribers,ss=0;ss<ko.length;ss++)Fo=ko[ss],Fo.ref.current(Fo.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 $d(n){let i=!1,l=!1,o,c,f;function d(y){c=requestAnimationFrame(d),i=!0,o=0,ti("before",y),l=!0;for(const m of n.values()){var h;f=m.store.getState(),f.internal.active&&(f.frameloop==="always"||f.internal.frames>0)&&!((h=f.gl.xr)!=null&&h.isPresenting)&&(o+=Ho(y,f))}if(l=!1,ti("after",y),o===0)return ti("tail",y),i=!1,cancelAnimationFrame(c)}function p(y,h=1){var m;if(!y)return n.forEach(x=>p(x.store.getState(),h));(m=y.gl.xr)!=null&&m.isPresenting||!y.internal.active||y.frameloop==="never"||(h>1?y.internal.frames=Math.min(60,y.internal.frames+h):l?y.internal.frames=2:y.internal.frames=1,i||(i=!0,requestAnimationFrame(d)))}function v(y,h=!0,m,x){if(h&&ti("before",y),m)Ho(y,m,x);else for(const E of n.values())Ho(y,E.store.getState());h&&ti("after",y)}return{loop:d,invalidate:p,advance:v}}function gc(){const n=w.useContext(vc);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function ht(n=l=>l,i){return gc()(n,i)}function Oe(n,i=0){const l=gc(),o=l.getState().internal.subscribe,c=uc(n);return ii(()=>o(c,i,l),[i,o,l]),null}const hu=new WeakMap;function yc(n,i){return function(l,...o){let c=hu.get(l);return c||(c=new l,hu.set(l,c)),n&&n(c),Promise.all(o.map(f=>new Promise((d,p)=>c.load(f,v=>{v.scene&&Object.assign(v,Gd(v.scene)),d(v)},i,v=>p(new Error(`Could not load ${f}: ${v==null?void 0:v.message}`))))))}}function cn(n,i,l,o){const c=Array.isArray(i)?i:[i],f=Dd(yc(l,o),[n,...c],{equal:ze.equ});return Array.isArray(i)?f:f[0]}cn.preload=function(n,i,l){const o=Array.isArray(i)?i:[i];return Od(yc(l),[n,...o])};cn.clear=function(n,i){const l=Array.isArray(i)?i:[i];return Bd([n,...l])};const Mr=new Map,{invalidate:mu,advance:vu}=$d(Mr),{reconciler:vs,applyProps:hr}=jd(Mr,Qd),mr={objects:"shallow",strict:!1},ep=(n,i)=>{const l=typeof n=="function"?n(i):n;return mc(l)?l:new Zf({powerPreference:"high-performance",canvas:i,antialias:!0,alpha:!0,...n})};function tp(n,i){const l=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(i){const{width:o,height:c,top:f,left:d,updateStyle:p=l}=i;return{width:o,height:c,top:f,left:d,updateStyle:p}}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 np(n){const i=Mr.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||Kd(mu,vu),d=l||vs.createContainer(f,Er.ConcurrentRoot,null,!1,null,"",c,null);i||Mr.set(n,{fiber:d,store:f});let p,v=!1,y;return{configure(h={}){let{gl:m,size:x,scene:E,events:T,onCreated:O,shadows:D=!1,linear:P=!1,flat:A=!1,legacy:C=!1,orthographic:N=!1,frameloop:k="always",dpr:L=[1,2],performance:re,raycaster:Y,camera:V,onPointerMissed:F}=h,B=f.getState(),ie=B.gl;B.gl||B.set({gl:ie=ep(m,n)});let de=B.raycaster;de||B.set({raycaster:de=new Qf});const{params:Be,...$}=Y||{};if(ze.equ($,de,mr)||hr(de,{...$}),ze.equ(Be,de.params,mr)||hr(de,{params:{...de.params,...Be}}),!B.camera||B.camera===y&&!ze.equ(y,V,mr)){y=V;const G=V instanceof qf,J=G?V:N?new Wn(0,0,0,0,.1,1e3):new Vn(75,0,.1,1e3);G||(J.position.z=5,V&&(hr(J,V),("aspect"in V||"left"in V||"right"in V||"bottom"in V||"top"in V)&&(J.manual=!0,J.updateProjectionMatrix())),!B.camera&&!(V!=null&&V.rotation)&&J.lookAt(0,0,0)),B.set({camera:J}),de.camera=J}if(!B.scene){let G;E!=null&&E.isScene?G=E:(G=new Jo,E&&hr(G,E)),B.set({scene:gr(G)})}if(!B.xr){var me;const G=(oe,Ce)=>{const Le=f.getState();Le.frameloop!=="never"&&vu(oe,!0,Le,Ce)},J=()=>{const oe=f.getState();oe.gl.xr.enabled=oe.gl.xr.isPresenting,oe.gl.xr.setAnimationLoop(oe.gl.xr.isPresenting?G:null),oe.gl.xr.isPresenting||mu(oe)},se={connect(){const oe=f.getState().gl;oe.xr.addEventListener("sessionstart",J),oe.xr.addEventListener("sessionend",J)},disconnect(){const oe=f.getState().gl;oe.xr.removeEventListener("sessionstart",J),oe.xr.removeEventListener("sessionend",J)}};typeof((me=ie.xr)==null?void 0:me.addEventListener)=="function"&&se.connect(),B.set({xr:se})}if(ie.shadowMap){const G=ie.shadowMap.enabled,J=ie.shadowMap.type;if(ie.shadowMap.enabled=!!D,ze.boo(D))ie.shadowMap.type=Oo;else if(ze.str(D)){var ge;const se={basic:Kf,percentage:Xf,soft:Oo,variance:Yf};ie.shadowMap.type=(ge=se[D])!=null?ge:Oo}else ze.obj(D)&&Object.assign(ie.shadowMap,D);(G!==ie.shadowMap.enabled||J!==ie.shadowMap.type)&&(ie.shadowMap.needsUpdate=!0)}const b=lc();b&&("enabled"in b?b.enabled=!C:"legacyMode"in b&&(b.legacyMode=C)),v||hr(ie,{outputEncoding:P?3e3:3001,toneMapping:A?Wu:Vu}),B.legacy!==C&&B.set(()=>({legacy:C})),B.linear!==P&&B.set(()=>({linear:P})),B.flat!==A&&B.set(()=>({flat:A})),m&&!ze.fun(m)&&!mc(m)&&!ze.equ(m,ie,mr)&&hr(ie,m),T&&!B.events.handlers&&B.set({events:T(f)});const K=tp(n,x);return ze.equ(K,B.size,mr)||B.setSize(K.width,K.height,K.updateStyle,K.top,K.left),L&&B.viewport.dpr!==dc(L)&&B.setDpr(L),B.frameloop!==k&&B.setFrameloop(k),B.onPointerMissed||B.set({onPointerMissed:F}),re&&!ze.equ(re,B.performance,mr)&&B.set(G=>({performance:{...G.performance,...re}})),p=O,v=!0,this},render(h){return v||this.configure(),vs.updateContainer(S.jsx(rp,{store:f,children:h,onCreated:p,rootElement:n}),d,null,()=>{}),f},unmount(){Sc(n)}}}function rp({store:n,children:i,onCreated:l,rootElement:o}){return ii(()=>{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)},[]),S.jsx(vc.Provider,{value:n,children:i})}function Sc(n,i){const l=Mr.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),vs.updateContainer(null,o,null,()=>{c&&setTimeout(()=>{try{var f,d,p,v;c.events.disconnect==null||c.events.disconnect(),(f=c.gl)==null||(d=f.renderLists)==null||d.dispose==null||d.dispose(),(p=c.gl)==null||p.forceContextLoss==null||p.forceContextLoss(),(v=c.gl)!=null&&v.xr&&c.xr.disconnect(),Wd(c),Mr.delete(n)}catch{}},500)})}}vs.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:w.version});const Go={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 ip(n){const{handlePointer:i}=Xd(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(Go).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,p])=>{const[v,y]=Go[d];l.addEventListener(v,p,{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[p]=Go[f];o.connected.removeEventListener(p,d)}}),l(f=>({events:{...f.events,connected:void 0}}))}}}}function gu(n,i){let l;return(...o)=>{window.clearTimeout(l),l=window.setTimeout(()=>n(...o),i)}}function sp({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]=w.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),p=w.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,h=w.useRef(!1);w.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[m,x,E]=w.useMemo(()=>{const P=()=>{if(!p.current.element)return;const{left:A,top:C,width:N,height:k,bottom:L,right:re,x:Y,y:V}=p.current.element.getBoundingClientRect(),F={left:A,top:C,width:N,height:k,bottom:L,right:re,x:Y,y:V};p.current.element instanceof HTMLElement&&o&&(F.height=p.current.element.offsetHeight,F.width=p.current.element.offsetWidth),Object.freeze(F),h.current&&!up(p.current.lastBounds,F)&&d(p.current.lastBounds=F)};return[P,y?gu(P,y):P,v?gu(P,v):P]},[d,o,v,y]);function T(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(P=>P.removeEventListener("scroll",E,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function O(){p.current.element&&(p.current.resizeObserver=new c(E),p.current.resizeObserver.observe(p.current.element),i&&p.current.scrollContainers&&p.current.scrollContainers.forEach(P=>P.addEventListener("scroll",E,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{E()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}const D=P=>{!P||P===p.current.element||(T(),p.current.element=P,p.current.scrollContainers=xc(P),O())};return lp(E,!!i),op(x),w.useEffect(()=>{T(),O()},[i,E,x]),w.useEffect(()=>T,[]),[D,f,m]}function op(n){w.useEffect(()=>{const i=n;return window.addEventListener("resize",i),()=>void window.removeEventListener("resize",i)},[n])}function lp(n,i){w.useEffect(()=>{if(i){const l=n;return window.addEventListener("scroll",l,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",l,!0)}},[n,i])}function xc(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,...xc(n.parentElement)]}const ap=["x","y","top","bottom","left","right","width","height"],up=(n,i)=>ap.every(l=>n[l]===i[l]);var cp=Object.defineProperty,fp=Object.defineProperties,dp=Object.getOwnPropertyDescriptors,yu=Object.getOwnPropertySymbols,pp=Object.prototype.hasOwnProperty,hp=Object.prototype.propertyIsEnumerable,Su=(n,i,l)=>i in n?cp(n,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[i]=l,xu=(n,i)=>{for(var l in i||(i={}))pp.call(i,l)&&Su(n,l,i[l]);if(yu)for(var l of yu(i))hp.call(i,l)&&Su(n,l,i[l]);return n},mp=(n,i)=>fp(n,dp(i)),Eu,wu;typeof window<"u"&&((Eu=window.document)!=null&&Eu.createElement||((wu=window.navigator)==null?void 0:wu.product)==="ReactNative")?w.useLayoutEffect:w.useEffect;function Ec(n,i,l){if(!n)return;if(l(n)===!0)return n;let o=n.child;for(;o;){const c=Ec(o,i,l);if(c)return c;o=o.sibling}}function wc(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const Mu=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=Mu;return}return Mu.apply(this,arguments)};const vl=wc(w.createContext(null));class Mc extends w.Component{render(){return w.createElement(vl.Provider,{value:this._reactInternals},this.props.children)}}function vp(){const n=w.useContext(vl);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const i=w.useId();return w.useMemo(()=>{for(const o of[n,n==null?void 0:n.alternate]){if(!o)continue;const c=Ec(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 gp(){const n=vp(),[i]=w.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!==vl&&!i.has(c)&&i.set(c,w.useContext(wc(c)))}l=l.return}return i}function yp(){const n=gp();return w.useMemo(()=>Array.from(n.keys()).reduce((i,l)=>o=>w.createElement(i,null,w.createElement(l.Provider,mp(xu({},o),{value:n.get(l)}))),i=>w.createElement(Mc,xu({},i))),[n])}const Sp=w.forwardRef(function({children:i,fallback:l,resize:o,style:c,gl:f,events:d=ip,eventSource:p,eventPrefix:v,shadows:y,linear:h,flat:m,legacy:x,orthographic:E,frameloop:T,dpr:O,performance:D,raycaster:P,camera:A,scene:C,onPointerMissed:N,onCreated:k,...L},re){w.useMemo(()=>oc(ed),[]);const Y=yp(),[V,F]=sp({scroll:!0,debounce:{scroll:50,resize:0},...o}),B=w.useRef(null),ie=w.useRef(null);w.useImperativeHandle(re,()=>B.current);const de=uc(N),[Be,$]=w.useState(!1),[me,ge]=w.useState(!1);if(Be)throw Be;if(me)throw me;const b=w.useRef(null);ii(()=>{const G=B.current;F.width>0&&F.height>0&&G&&(b.current||(b.current=np(G)),b.current.configure({gl:f,events:d,shadows:y,linear:h,flat:m,legacy:x,orthographic:E,frameloop:T,dpr:O,performance:D,raycaster:P,camera:A,scene:C,size:F,onPointerMissed:(...J)=>de.current==null?void 0:de.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(p?kd(p)?p.current:p:ie.current),v&&J.setEvents({compute:(se,oe)=>{const Ce=se[v+"X"],Le=se[v+"Y"];oe.pointer.set(Ce/oe.size.width*2-1,-(Le/oe.size.height)*2+1),oe.raycaster.setFromCamera(oe.pointer,oe.camera)}}),k==null||k(J)}}),b.current.render(S.jsx(Y,{children:S.jsx(cc,{set:ge,children:S.jsx(w.Suspense,{fallback:S.jsx(Fd,{set:$}),children:i??null})})})))}),w.useEffect(()=>{const G=B.current;if(G)return()=>Sc(G)},[]);const K=p?"none":"auto";return S.jsx("div",{ref:ie,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:K,...c},...L,children:S.jsx("div",{ref:V,style:{width:"100%",height:"100%"},children:S.jsx("canvas",{ref:B,style:{display:"block"},children:l})})})}),xp=w.forwardRef(function(i,l){return S.jsx(Mc,{children:S.jsx(Sp,{...i,ref:l})})});function _r(){return _r=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},_r.apply(null,arguments)}const si=new ve,gl=new ve,Ep=new ve,_u=new Te;function wp(n,i,l){const o=si.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 Mp(n,i){const l=si.setFromMatrixPosition(n.matrixWorld),o=gl.setFromMatrixPosition(i.matrixWorld),c=l.sub(o),f=i.getWorldDirection(Ep);return c.angleTo(f)>Math.PI/2}function _p(n,i,l,o){const c=si.setFromMatrixPosition(n.matrixWorld),f=c.clone();f.project(i),_u.set(f.x,f.y),l.setFromCamera(_u,i);const d=l.intersectObjects(o,!0);if(d.length){const p=d[0].distance;return c.distanceTo(l.ray.origin)<p}return!0}function Tp(n,i){if(i instanceof Wn)return i.zoom;if(i instanceof Vn){const l=si.setFromMatrixPosition(n.matrixWorld),o=gl.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 Pp(n,i,l){if(i instanceof Vn||i instanceof Wn){const o=si.setFromMatrixPosition(n.matrixWorld),c=gl.setFromMatrixPosition(i.matrixWorld),f=o.distanceTo(c),d=(l[1]-l[0])/(i.far-i.near),p=l[1]-d*i.far;return Math.round(d*f+p)}}const al=n=>Math.abs(n)<1e-10?0:n;function _c(n,i,l=""){let o="matrix3d(";for(let c=0;c!==16;c++)o+=al(i[c]*n.elements[c])+(c!==15?",":")");return l+o}const Rp=(n=>i=>_c(i,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Cp=(n=>(i,l)=>_c(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 Ap(n){return n&&typeof n=="object"&&"current"in n}const oi=w.forwardRef(({children:n,eps:i=.001,style:l,className:o,prepend:c,center:f,fullscreen:d,portal:p,distanceFactor:v,sprite:y=!1,transform:h=!1,occlude:m,onOcclude:x,castShadow:E,receiveShadow:T,material:O,geometry:D,zIndexRange:P=[16777271,0],calculatePosition:A=wp,as:C="div",wrapperClass:N,pointerEvents:k="auto",...L},re)=>{const{gl:Y,camera:V,scene:F,size:B,raycaster:ie,events:de,viewport:Be}=ht(),[$]=w.useState(()=>document.createElement(C)),me=w.useRef(),ge=w.useRef(null),b=w.useRef(0),K=w.useRef([0,0]),G=w.useRef(null),J=w.useRef(null),se=(p==null?void 0:p.current)||de.connected||Y.domElement.parentNode,oe=w.useRef(null),Ce=w.useRef(!1),Le=w.useMemo(()=>m&&m!=="blending"||Array.isArray(m)&&m.length&&Ap(m[0]),[m]);w.useLayoutEffect(()=>{const Pe=Y.domElement;m&&m==="blending"?(Pe.style.zIndex=`${Math.floor(P[0]/2)}`,Pe.style.position="absolute",Pe.style.pointerEvents="none"):(Pe.style.zIndex=null,Pe.style.position=null,Pe.style.pointerEvents=null)},[m]),w.useLayoutEffect(()=>{if(ge.current){const Pe=me.current=td($);if(F.updateMatrixWorld(),h)$.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const le=A(ge.current,V,B);$.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${le[0]}px,${le[1]}px,0);transform-origin:0 0;`}return se&&(c?se.prepend($):se.appendChild($)),()=>{se&&se.removeChild($),Pe.unmount()}}},[se,h]),w.useLayoutEffect(()=>{N&&($.className=N)},[N]);const We=w.useMemo(()=>h?{position:"absolute",top:0,left:0,width:B.width,height:B.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:f?"translate3d(-50%,-50%,0)":"none",...d&&{top:-B.height/2,left:-B.width/2,width:B.width,height:B.height},...l},[l,f,d,B,h]),vt=w.useMemo(()=>({position:"absolute",pointerEvents:k}),[k]);w.useLayoutEffect(()=>{if(Ce.current=!1,h){var Pe;(Pe=me.current)==null||Pe.render(w.createElement("div",{ref:G,style:We},w.createElement("div",{ref:J,style:vt},w.createElement("div",{ref:re,className:o,style:l,children:n}))))}else{var le;(le=me.current)==null||le.render(w.createElement("div",{ref:re,style:We,className:o,children:n}))}});const Mt=w.useRef(!0);Oe(Pe=>{if(ge.current){V.updateMatrixWorld(),ge.current.updateWorldMatrix(!0,!1);const le=h?K.current:A(ge.current,V,B);if(h||Math.abs(b.current-V.zoom)>i||Math.abs(K.current[0]-le[0])>i||Math.abs(K.current[1]-le[1])>i){const be=Mp(ge.current,V);let Se=!1;Le&&(Array.isArray(m)?Se=m.map(_t=>_t.current):m!=="blending"&&(Se=[F]));const gt=Mt.current;if(Se){const _t=_p(ge.current,V,ie,Se);Mt.current=_t&&!be}else Mt.current=!be;gt!==Mt.current&&(x?x(!Mt.current):$.style.display=Mt.current?"block":"none");const Bt=Math.floor(P[0]/2),tn=m?Le?[P[0],Bt]:[Bt-1,0]:P;if($.style.zIndex=`${Pp(ge.current,V,tn)}`,h){const[_t,In]=[B.width/2,B.height/2],dn=V.projectionMatrix.elements[5]*In,{isOrthographicCamera:Gt,top:Rr,left:Zn,bottom:Un,right:yt}=V,Cr=Rp(V.matrixWorldInverse),Ar=Gt?`scale(${dn})translate(${al(-(yt+Zn)/2)}px,${al((Rr+Un)/2)}px)`:`translateZ(${dn}px)`;let Tt=ge.current.matrixWorld;y&&(Tt=V.matrixWorldInverse.clone().transpose().copyPosition(Tt).scale(ge.current.scale),Tt.elements[3]=Tt.elements[7]=Tt.elements[11]=0,Tt.elements[15]=1),$.style.width=B.width+"px",$.style.height=B.height+"px",$.style.perspective=Gt?"":`${dn}px`,G.current&&J.current&&(G.current.style.transform=`${Ar}${Cr}translate(${_t}px,${In}px)`,J.current.style.transform=Cp(Tt,1/((v||10)/400)))}else{const _t=v===void 0?1:Tp(ge.current,V)*v;$.style.transform=`translate3d(${le[0]}px,${le[1]}px,0) scale(${_t})`}K.current=le,b.current=V.zoom}}if(!Le&&oe.current&&!Ce.current)if(h){if(G.current){const le=G.current.children[0];if(le!=null&&le.clientWidth&&le!=null&&le.clientHeight){const{isOrthographicCamera:be}=V;if(be||D)L.scale&&(Array.isArray(L.scale)?L.scale instanceof ve?oe.current.scale.copy(L.scale.clone().divideScalar(1)):oe.current.scale.set(1/L.scale[0],1/L.scale[1],1/L.scale[2]):oe.current.scale.setScalar(1/L.scale));else{const Se=(v||10)/400,gt=le.clientWidth*Se,Bt=le.clientHeight*Se;oe.current.scale.set(gt,Bt,1)}Ce.current=!0}}}else{const le=$.children[0];if(le!=null&&le.clientWidth&&le!=null&&le.clientHeight){const be=1/Be.factor,Se=le.clientWidth*be,gt=le.clientHeight*be;oe.current.scale.set(Se,gt,1),Ce.current=!0}oe.current.lookAt(Pe.camera.position)}});const Xe=w.useMemo(()=>({vertexShader:h?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
|
+
`}),[h]);return w.createElement("group",_r({},L,{ref:ge}),m&&!Le&&w.createElement("mesh",{castShadow:E,receiveShadow:T,ref:oe},D||w.createElement("planeGeometry",null),O||w.createElement("shaderMaterial",{side:Rn,vertexShader:Xe.vertexShader,fragmentShader:Xe.fragmentShader})))});let ni;function zp(){var n;if(ni!==void 0)return ni;try{let i;const l=document.createElement("canvas");return ni=!!(window.WebGL2RenderingContext&&(i=l.getContext("webgl2"))),i&&((n=i.getExtension("WEBGL_lose_context"))==null||n.loseContext()),ni}catch{return ni=!1}}const Tc=parseInt(Ss.replace(/\D+/g,"")),Pc=Tc>=125?"uv1":"uv2";var Ip=Object.defineProperty,Up=(n,i,l)=>i in n?Ip(n,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[i]=l,Dp=(n,i,l)=>(Up(n,i+"",l),l);class Op{constructor(){Dp(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 Bp=Object.defineProperty,Np=(n,i,l)=>i in n?Bp(n,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[i]=l,te=(n,i,l)=>(Np(n,typeof i!="symbol"?i+"":i,l),l);const os=new nd,Tu=new rd,Lp=Math.cos(70*(Math.PI/180)),Pu=(n,i)=>(n%i+i)%i;let bp=class extends Op{constructor(i,l){super(),te(this,"object"),te(this,"domElement"),te(this,"enabled",!0),te(this,"target",new ve),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:dr.ROTATE,MIDDLE:dr.DOLLY,RIGHT:dr.PAN}),te(this,"touches",{ONE:pr.ROTATE,TWO:pr.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=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=R=>{let H=Pu(R,2*Math.PI),ne=h.phi;ne<0&&(ne+=2*Math.PI),H<0&&(H+=2*Math.PI);let ye=Math.abs(H-ne);2*Math.PI-ye<ye&&(H<ne?H+=2*Math.PI:ne+=2*Math.PI),m.phi=H-ne,o.update()},this.setAzimuthalAngle=R=>{let H=Pu(R,2*Math.PI),ne=h.theta;ne<0&&(ne+=2*Math.PI),H<0&&(H+=2*Math.PI);let ye=Math.abs(H-ne);2*Math.PI-ye<ye&&(H<ne?H+=2*Math.PI:ne+=2*Math.PI),m.theta=H-ne,o.update()},this.getDistance=()=>o.object.position.distanceTo(o.target),this.listenToKeyEvents=R=>{R.addEventListener("keydown",zr),this._domElementKeyEvents=R},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",zr),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=p.NONE},this.update=(()=>{const R=new ve,H=new ve(0,1,0),ne=new el().setFromUnitVectors(i.up,H),ye=ne.clone().invert(),ke=new ve,Nt=new el,Wt=2*Math.PI;return function(){const Ur=o.object.position;ne.setFromUnitVectors(i.up,H),ye.copy(ne).invert(),R.copy(Ur).sub(o.target),R.applyQuaternion(ne),h.setFromVector3(R),o.autoRotate&&v===p.NONE&&Be(ie()),o.enableDamping?(h.theta+=m.theta*o.dampingFactor,h.phi+=m.phi*o.dampingFactor):(h.theta+=m.theta,h.phi+=m.phi);let Pt=o.minAzimuthAngle,Lt=o.maxAzimuthAngle;isFinite(Pt)&&isFinite(Lt)&&(Pt<-Math.PI?Pt+=Wt:Pt>Math.PI&&(Pt-=Wt),Lt<-Math.PI?Lt+=Wt:Lt>Math.PI&&(Lt-=Wt),Pt<=Lt?h.theta=Math.max(Pt,Math.min(Lt,h.theta)):h.theta=h.theta>(Pt+Lt)/2?Math.max(Pt,h.theta):Math.min(Lt,h.theta)),h.phi=Math.max(o.minPolarAngle,Math.min(o.maxPolarAngle,h.phi)),h.makeSafe(),o.enableDamping===!0?o.target.addScaledVector(E,o.dampingFactor):o.target.add(E),o.zoomToCursor&&V||o.object.isOrthographicCamera?h.radius=oe(h.radius):h.radius=oe(h.radius*x),R.setFromSpherical(h),R.applyQuaternion(ye),Ur.copy(o.target).add(R),o.object.matrixAutoUpdate||o.object.updateMatrix(),o.object.lookAt(o.target),o.enableDamping===!0?(m.theta*=1-o.dampingFactor,m.phi*=1-o.dampingFactor,E.multiplyScalar(1-o.dampingFactor)):(m.set(0,0,0),E.set(0,0,0));let pn=!1;if(o.zoomToCursor&&V){let hn=null;if(o.object instanceof Vn&&o.object.isPerspectiveCamera){const mn=R.length();hn=oe(mn*x);const qn=mn-hn;o.object.position.addScaledVector(re,qn),o.object.updateMatrixWorld()}else if(o.object.isOrthographicCamera){const mn=new ve(Y.x,Y.y,0);mn.unproject(o.object),o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom/x)),o.object.updateProjectionMatrix(),pn=!0;const qn=new ve(Y.x,Y.y,0);qn.unproject(o.object),o.object.position.sub(qn).add(mn),o.object.updateMatrixWorld(),hn=R.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),o.zoomToCursor=!1;hn!==null&&(o.screenSpacePanning?o.target.set(0,0,-1).transformDirection(o.object.matrix).multiplyScalar(hn).add(o.object.position):(os.origin.copy(o.object.position),os.direction.set(0,0,-1).transformDirection(o.object.matrix),Math.abs(o.object.up.dot(os.direction))<Lp?i.lookAt(o.target):(Tu.setFromNormalAndCoplanarPoint(o.object.up,o.target),os.intersectPlane(Tu,o.target))))}else o.object instanceof Wn&&o.object.isOrthographicCamera&&(pn=x!==1,pn&&(o.object.zoom=Math.max(o.minZoom,Math.min(o.maxZoom,o.object.zoom/x)),o.object.updateProjectionMatrix()));return x=1,V=!1,pn||ke.distanceToSquared(o.object.position)>y||8*(1-Nt.dot(o.object.quaternion))>y?(o.dispatchEvent(c),ke.copy(o.object.position),Nt.copy(o.object.quaternion),pn=!1,!0):!1}})(),this.connect=R=>{o.domElement=R,o.domElement.style.touchAction="none",o.domElement.addEventListener("contextmenu",ai),o.domElement.addEventListener("pointerdown",Zn),o.domElement.addEventListener("pointercancel",yt),o.domElement.addEventListener("wheel",Tt)},this.dispose=()=>{var R,H,ne,ye,ke,Nt;o.domElement&&(o.domElement.style.touchAction="auto"),(R=o.domElement)==null||R.removeEventListener("contextmenu",ai),(H=o.domElement)==null||H.removeEventListener("pointerdown",Zn),(ne=o.domElement)==null||ne.removeEventListener("pointercancel",yt),(ye=o.domElement)==null||ye.removeEventListener("wheel",Tt),(ke=o.domElement)==null||ke.ownerDocument.removeEventListener("pointermove",Un),(Nt=o.domElement)==null||Nt.ownerDocument.removeEventListener("pointerup",yt),o._domElementKeyEvents!==null&&o._domElementKeyEvents.removeEventListener("keydown",zr)};const o=this,c={type:"change"},f={type:"start"},d={type:"end"},p={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let v=p.NONE;const y=1e-6,h=new $o,m=new $o;let x=1;const E=new ve,T=new Te,O=new Te,D=new Te,P=new Te,A=new Te,C=new Te,N=new Te,k=new Te,L=new Te,re=new ve,Y=new Te;let V=!1;const F=[],B={};function ie(){return 2*Math.PI/60/60*o.autoRotateSpeed}function de(){return Math.pow(.95,o.zoomSpeed)}function Be(R){o.reverseOrbit||o.reverseHorizontalOrbit?m.theta+=R:m.theta-=R}function $(R){o.reverseOrbit||o.reverseVerticalOrbit?m.phi+=R:m.phi-=R}const me=(()=>{const R=new ve;return function(ne,ye){R.setFromMatrixColumn(ye,0),R.multiplyScalar(-ne),E.add(R)}})(),ge=(()=>{const R=new ve;return function(ne,ye){o.screenSpacePanning===!0?R.setFromMatrixColumn(ye,1):(R.setFromMatrixColumn(ye,0),R.crossVectors(o.object.up,R)),R.multiplyScalar(ne),E.add(R)}})(),b=(()=>{const R=new ve;return function(ne,ye){const ke=o.domElement;if(ke&&o.object instanceof Vn&&o.object.isPerspectiveCamera){const Nt=o.object.position;R.copy(Nt).sub(o.target);let Wt=R.length();Wt*=Math.tan(o.object.fov/2*Math.PI/180),me(2*ne*Wt/ke.clientHeight,o.object.matrix),ge(2*ye*Wt/ke.clientHeight,o.object.matrix)}else ke&&o.object instanceof Wn&&o.object.isOrthographicCamera?(me(ne*(o.object.right-o.object.left)/o.object.zoom/ke.clientWidth,o.object.matrix),ge(ye*(o.object.top-o.object.bottom)/o.object.zoom/ke.clientHeight,o.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),o.enablePan=!1)}})();function K(R){o.object instanceof Vn&&o.object.isPerspectiveCamera||o.object instanceof Wn&&o.object.isOrthographicCamera?x=R:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),o.enableZoom=!1)}function G(R){K(x/R)}function J(R){K(x*R)}function se(R){if(!o.zoomToCursor||!o.domElement)return;V=!0;const H=o.domElement.getBoundingClientRect(),ne=R.clientX-H.left,ye=R.clientY-H.top,ke=H.width,Nt=H.height;Y.x=ne/ke*2-1,Y.y=-(ye/Nt)*2+1,re.set(Y.x,Y.y,1).unproject(o.object).sub(o.object.position).normalize()}function oe(R){return Math.max(o.minDistance,Math.min(o.maxDistance,R))}function Ce(R){T.set(R.clientX,R.clientY)}function Le(R){se(R),N.set(R.clientX,R.clientY)}function We(R){P.set(R.clientX,R.clientY)}function vt(R){O.set(R.clientX,R.clientY),D.subVectors(O,T).multiplyScalar(o.rotateSpeed);const H=o.domElement;H&&(Be(2*Math.PI*D.x/H.clientHeight),$(2*Math.PI*D.y/H.clientHeight)),T.copy(O),o.update()}function Mt(R){k.set(R.clientX,R.clientY),L.subVectors(k,N),L.y>0?G(de()):L.y<0&&J(de()),N.copy(k),o.update()}function Xe(R){A.set(R.clientX,R.clientY),C.subVectors(A,P).multiplyScalar(o.panSpeed),b(C.x,C.y),P.copy(A),o.update()}function Pe(R){se(R),R.deltaY<0?J(de()):R.deltaY>0&&G(de()),o.update()}function le(R){let H=!1;switch(R.code){case o.keys.UP:b(0,o.keyPanSpeed),H=!0;break;case o.keys.BOTTOM:b(0,-o.keyPanSpeed),H=!0;break;case o.keys.LEFT:b(o.keyPanSpeed,0),H=!0;break;case o.keys.RIGHT:b(-o.keyPanSpeed,0),H=!0;break}H&&(R.preventDefault(),o.update())}function be(){if(F.length==1)T.set(F[0].pageX,F[0].pageY);else{const R=.5*(F[0].pageX+F[1].pageX),H=.5*(F[0].pageY+F[1].pageY);T.set(R,H)}}function Se(){if(F.length==1)P.set(F[0].pageX,F[0].pageY);else{const R=.5*(F[0].pageX+F[1].pageX),H=.5*(F[0].pageY+F[1].pageY);P.set(R,H)}}function gt(){const R=F[0].pageX-F[1].pageX,H=F[0].pageY-F[1].pageY,ne=Math.sqrt(R*R+H*H);N.set(0,ne)}function Bt(){o.enableZoom&>(),o.enablePan&&Se()}function tn(){o.enableZoom&>(),o.enableRotate&&be()}function _t(R){if(F.length==1)O.set(R.pageX,R.pageY);else{const ne=Ir(R),ye=.5*(R.pageX+ne.x),ke=.5*(R.pageY+ne.y);O.set(ye,ke)}D.subVectors(O,T).multiplyScalar(o.rotateSpeed);const H=o.domElement;H&&(Be(2*Math.PI*D.x/H.clientHeight),$(2*Math.PI*D.y/H.clientHeight)),T.copy(O)}function In(R){if(F.length==1)A.set(R.pageX,R.pageY);else{const H=Ir(R),ne=.5*(R.pageX+H.x),ye=.5*(R.pageY+H.y);A.set(ne,ye)}C.subVectors(A,P).multiplyScalar(o.panSpeed),b(C.x,C.y),P.copy(A)}function dn(R){const H=Ir(R),ne=R.pageX-H.x,ye=R.pageY-H.y,ke=Math.sqrt(ne*ne+ye*ye);k.set(0,ke),L.set(0,Math.pow(k.y/N.y,o.zoomSpeed)),G(L.y),N.copy(k)}function Gt(R){o.enableZoom&&dn(R),o.enablePan&&In(R)}function Rr(R){o.enableZoom&&dn(R),o.enableRotate&&_t(R)}function Zn(R){var H,ne;o.enabled!==!1&&(F.length===0&&((H=o.domElement)==null||H.ownerDocument.addEventListener("pointermove",Un),(ne=o.domElement)==null||ne.ownerDocument.addEventListener("pointerup",yt)),ws(R),R.pointerType==="touch"?xs(R):Cr(R))}function Un(R){o.enabled!==!1&&(R.pointerType==="touch"?Es(R):Ar(R))}function yt(R){var H,ne,ye;Ms(R),F.length===0&&((H=o.domElement)==null||H.releasePointerCapture(R.pointerId),(ne=o.domElement)==null||ne.ownerDocument.removeEventListener("pointermove",Un),(ye=o.domElement)==null||ye.ownerDocument.removeEventListener("pointerup",yt)),o.dispatchEvent(d),v=p.NONE}function Cr(R){let H;switch(R.button){case 0:H=o.mouseButtons.LEFT;break;case 1:H=o.mouseButtons.MIDDLE;break;case 2:H=o.mouseButtons.RIGHT;break;default:H=-1}switch(H){case dr.DOLLY:if(o.enableZoom===!1)return;Le(R),v=p.DOLLY;break;case dr.ROTATE:if(R.ctrlKey||R.metaKey||R.shiftKey){if(o.enablePan===!1)return;We(R),v=p.PAN}else{if(o.enableRotate===!1)return;Ce(R),v=p.ROTATE}break;case dr.PAN:if(R.ctrlKey||R.metaKey||R.shiftKey){if(o.enableRotate===!1)return;Ce(R),v=p.ROTATE}else{if(o.enablePan===!1)return;We(R),v=p.PAN}break;default:v=p.NONE}v!==p.NONE&&o.dispatchEvent(f)}function Ar(R){if(o.enabled!==!1)switch(v){case p.ROTATE:if(o.enableRotate===!1)return;vt(R);break;case p.DOLLY:if(o.enableZoom===!1)return;Mt(R);break;case p.PAN:if(o.enablePan===!1)return;Xe(R);break}}function Tt(R){o.enabled===!1||o.enableZoom===!1||v!==p.NONE&&v!==p.ROTATE||(R.preventDefault(),o.dispatchEvent(f),Pe(R),o.dispatchEvent(d))}function zr(R){o.enabled===!1||o.enablePan===!1||le(R)}function xs(R){switch(ui(R),F.length){case 1:switch(o.touches.ONE){case pr.ROTATE:if(o.enableRotate===!1)return;be(),v=p.TOUCH_ROTATE;break;case pr.PAN:if(o.enablePan===!1)return;Se(),v=p.TOUCH_PAN;break;default:v=p.NONE}break;case 2:switch(o.touches.TWO){case pr.DOLLY_PAN:if(o.enableZoom===!1&&o.enablePan===!1)return;Bt(),v=p.TOUCH_DOLLY_PAN;break;case pr.DOLLY_ROTATE:if(o.enableZoom===!1&&o.enableRotate===!1)return;tn(),v=p.TOUCH_DOLLY_ROTATE;break;default:v=p.NONE}break;default:v=p.NONE}v!==p.NONE&&o.dispatchEvent(f)}function Es(R){switch(ui(R),v){case p.TOUCH_ROTATE:if(o.enableRotate===!1)return;_t(R),o.update();break;case p.TOUCH_PAN:if(o.enablePan===!1)return;In(R),o.update();break;case p.TOUCH_DOLLY_PAN:if(o.enableZoom===!1&&o.enablePan===!1)return;Gt(R),o.update();break;case p.TOUCH_DOLLY_ROTATE:if(o.enableZoom===!1&&o.enableRotate===!1)return;Rr(R),o.update();break;default:v=p.NONE}}function ai(R){o.enabled!==!1&&R.preventDefault()}function ws(R){F.push(R)}function Ms(R){delete B[R.pointerId];for(let H=0;H<F.length;H++)if(F[H].pointerId==R.pointerId){F.splice(H,1);return}}function ui(R){let H=B[R.pointerId];H===void 0&&(H=new Te,B[R.pointerId]=H),H.set(R.pageX,R.pageY)}function Ir(R){const H=R.pointerId===F[0].pointerId?F[1]:F[0];return B[H.pointerId]}this.dollyIn=(R=de())=>{J(R),o.update()},this.dollyOut=(R=de())=>{G(R),o.update()},this.getScale=()=>x,this.setScale=R=>{K(R),o.update()},this.getZoomScale=()=>de(),l!==void 0&&this.connect(l),this.update()}};const Ru=new fl,ls=new ve;class yl extends id{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const i=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],l=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new su(i,3)),this.setAttribute("uv",new su(l,2))}applyMatrix4(i){const l=this.attributes.instanceStart,o=this.attributes.instanceEnd;return l!==void 0&&(l.applyMatrix4(i),o.applyMatrix4(i),l.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(i){let l;i instanceof Float32Array?l=i:Array.isArray(i)&&(l=new Float32Array(i));const o=new tl(l,6,1);return this.setAttribute("instanceStart",new Sr(o,3,0)),this.setAttribute("instanceEnd",new Sr(o,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(i,l=3){let o;i instanceof Float32Array?o=i:Array.isArray(i)&&(o=new Float32Array(i));const c=new tl(o,l*2,1);return this.setAttribute("instanceColorStart",new Sr(c,l,0)),this.setAttribute("instanceColorEnd",new Sr(c,l,l)),this}fromWireframeGeometry(i){return this.setPositions(i.attributes.position.array),this}fromEdgesGeometry(i){return this.setPositions(i.attributes.position.array),this}fromMesh(i){return this.fromWireframeGeometry(new sd(i.geometry)),this}fromLineSegments(i){const l=i.geometry;return this.setPositions(l.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new fl);const i=this.attributes.instanceStart,l=this.attributes.instanceEnd;i!==void 0&&l!==void 0&&(this.boundingBox.setFromBufferAttribute(i),Ru.setFromBufferAttribute(l),this.boundingBox.union(Ru))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Qu),this.boundingBox===null&&this.computeBoundingBox();const i=this.attributes.instanceStart,l=this.attributes.instanceEnd;if(i!==void 0&&l!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let c=0;for(let f=0,d=i.count;f<d;f++)ls.fromBufferAttribute(i,f),c=Math.max(c,o.distanceToSquared(ls)),ls.fromBufferAttribute(l,f),c=Math.max(c,o.distanceToSquared(ls));this.boundingSphere.radius=Math.sqrt(c),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(i){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(i)}}class Rc extends yl{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(i){const l=i.length-3,o=new Float32Array(2*l);for(let c=0;c<l;c+=3)o[2*c]=i[c],o[2*c+1]=i[c+1],o[2*c+2]=i[c+2],o[2*c+3]=i[c+3],o[2*c+4]=i[c+4],o[2*c+5]=i[c+5];return super.setPositions(o),this}setColors(i,l=3){const o=i.length-l,c=new Float32Array(2*o);if(l===3)for(let f=0;f<o;f+=l)c[2*f]=i[f],c[2*f+1]=i[f+1],c[2*f+2]=i[f+2],c[2*f+3]=i[f+3],c[2*f+4]=i[f+4],c[2*f+5]=i[f+5];else for(let f=0;f<o;f+=l)c[2*f]=i[f],c[2*f+1]=i[f+1],c[2*f+2]=i[f+2],c[2*f+3]=i[f+3],c[2*f+4]=i[f+4],c[2*f+5]=i[f+5],c[2*f+6]=i[f+6],c[2*f+7]=i[f+7];return super.setColors(c,l),this}fromLine(i){const l=i.geometry;return this.setPositions(l.attributes.position.array),this}}class Sl extends Ht{constructor(i){super({type:"LineMaterial",uniforms:ou.clone(ou.merge([lu.common,lu.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Te(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
|
|
73
|
+
#include <common>
|
|
74
|
+
#include <fog_pars_vertex>
|
|
75
|
+
#include <logdepthbuf_pars_vertex>
|
|
76
|
+
#include <clipping_planes_pars_vertex>
|
|
77
|
+
|
|
78
|
+
uniform float linewidth;
|
|
79
|
+
uniform vec2 resolution;
|
|
80
|
+
|
|
81
|
+
attribute vec3 instanceStart;
|
|
82
|
+
attribute vec3 instanceEnd;
|
|
83
|
+
|
|
84
|
+
#ifdef USE_COLOR
|
|
85
|
+
#ifdef USE_LINE_COLOR_ALPHA
|
|
86
|
+
varying vec4 vLineColor;
|
|
87
|
+
attribute vec4 instanceColorStart;
|
|
88
|
+
attribute vec4 instanceColorEnd;
|
|
89
|
+
#else
|
|
90
|
+
varying vec3 vLineColor;
|
|
91
|
+
attribute vec3 instanceColorStart;
|
|
92
|
+
attribute vec3 instanceColorEnd;
|
|
93
|
+
#endif
|
|
94
|
+
#endif
|
|
95
|
+
|
|
96
|
+
#ifdef WORLD_UNITS
|
|
97
|
+
|
|
98
|
+
varying vec4 worldPos;
|
|
99
|
+
varying vec3 worldStart;
|
|
100
|
+
varying vec3 worldEnd;
|
|
101
|
+
|
|
102
|
+
#ifdef USE_DASH
|
|
103
|
+
|
|
104
|
+
varying vec2 vUv;
|
|
105
|
+
|
|
106
|
+
#endif
|
|
107
|
+
|
|
108
|
+
#else
|
|
109
|
+
|
|
110
|
+
varying vec2 vUv;
|
|
111
|
+
|
|
112
|
+
#endif
|
|
113
|
+
|
|
114
|
+
#ifdef USE_DASH
|
|
115
|
+
|
|
116
|
+
uniform float dashScale;
|
|
117
|
+
attribute float instanceDistanceStart;
|
|
118
|
+
attribute float instanceDistanceEnd;
|
|
119
|
+
varying float vLineDistance;
|
|
120
|
+
|
|
121
|
+
#endif
|
|
122
|
+
|
|
123
|
+
void trimSegment( const in vec4 start, inout vec4 end ) {
|
|
124
|
+
|
|
125
|
+
// trim end segment so it terminates between the camera plane and the near plane
|
|
126
|
+
|
|
127
|
+
// conservative estimate of the near plane
|
|
128
|
+
float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
|
|
129
|
+
float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
|
|
130
|
+
float nearEstimate = - 0.5 * b / a;
|
|
131
|
+
|
|
132
|
+
float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
|
|
133
|
+
|
|
134
|
+
end.xyz = mix( start.xyz, end.xyz, alpha );
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
void main() {
|
|
139
|
+
|
|
140
|
+
#ifdef USE_COLOR
|
|
141
|
+
|
|
142
|
+
vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
|
|
143
|
+
|
|
144
|
+
#endif
|
|
145
|
+
|
|
146
|
+
#ifdef USE_DASH
|
|
147
|
+
|
|
148
|
+
vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
|
|
149
|
+
vUv = uv;
|
|
150
|
+
|
|
151
|
+
#endif
|
|
152
|
+
|
|
153
|
+
float aspect = resolution.x / resolution.y;
|
|
154
|
+
|
|
155
|
+
// camera space
|
|
156
|
+
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
|
|
157
|
+
vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
|
|
158
|
+
|
|
159
|
+
#ifdef WORLD_UNITS
|
|
160
|
+
|
|
161
|
+
worldStart = start.xyz;
|
|
162
|
+
worldEnd = end.xyz;
|
|
163
|
+
|
|
164
|
+
#else
|
|
165
|
+
|
|
166
|
+
vUv = uv;
|
|
167
|
+
|
|
168
|
+
#endif
|
|
169
|
+
|
|
170
|
+
// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
|
|
171
|
+
// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
|
|
172
|
+
// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
|
|
173
|
+
// perhaps there is a more elegant solution -- WestLangley
|
|
174
|
+
|
|
175
|
+
bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
|
|
176
|
+
|
|
177
|
+
if ( perspective ) {
|
|
178
|
+
|
|
179
|
+
if ( start.z < 0.0 && end.z >= 0.0 ) {
|
|
180
|
+
|
|
181
|
+
trimSegment( start, end );
|
|
182
|
+
|
|
183
|
+
} else if ( end.z < 0.0 && start.z >= 0.0 ) {
|
|
184
|
+
|
|
185
|
+
trimSegment( end, start );
|
|
186
|
+
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// clip space
|
|
192
|
+
vec4 clipStart = projectionMatrix * start;
|
|
193
|
+
vec4 clipEnd = projectionMatrix * end;
|
|
194
|
+
|
|
195
|
+
// ndc space
|
|
196
|
+
vec3 ndcStart = clipStart.xyz / clipStart.w;
|
|
197
|
+
vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
|
|
198
|
+
|
|
199
|
+
// direction
|
|
200
|
+
vec2 dir = ndcEnd.xy - ndcStart.xy;
|
|
201
|
+
|
|
202
|
+
// account for clip-space aspect ratio
|
|
203
|
+
dir.x *= aspect;
|
|
204
|
+
dir = normalize( dir );
|
|
205
|
+
|
|
206
|
+
#ifdef WORLD_UNITS
|
|
207
|
+
|
|
208
|
+
// get the offset direction as perpendicular to the view vector
|
|
209
|
+
vec3 worldDir = normalize( end.xyz - start.xyz );
|
|
210
|
+
vec3 offset;
|
|
211
|
+
if ( position.y < 0.5 ) {
|
|
212
|
+
|
|
213
|
+
offset = normalize( cross( start.xyz, worldDir ) );
|
|
214
|
+
|
|
215
|
+
} else {
|
|
216
|
+
|
|
217
|
+
offset = normalize( cross( end.xyz, worldDir ) );
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// sign flip
|
|
222
|
+
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
223
|
+
|
|
224
|
+
float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );
|
|
225
|
+
|
|
226
|
+
// don't extend the line if we're rendering dashes because we
|
|
227
|
+
// won't be rendering the endcaps
|
|
228
|
+
#ifndef USE_DASH
|
|
229
|
+
|
|
230
|
+
// extend the line bounds to encompass endcaps
|
|
231
|
+
start.xyz += - worldDir * linewidth * 0.5;
|
|
232
|
+
end.xyz += worldDir * linewidth * 0.5;
|
|
233
|
+
|
|
234
|
+
// shift the position of the quad so it hugs the forward edge of the line
|
|
235
|
+
offset.xy -= dir * forwardOffset;
|
|
236
|
+
offset.z += 0.5;
|
|
237
|
+
|
|
238
|
+
#endif
|
|
239
|
+
|
|
240
|
+
// endcaps
|
|
241
|
+
if ( position.y > 1.0 || position.y < 0.0 ) {
|
|
242
|
+
|
|
243
|
+
offset.xy += dir * 2.0 * forwardOffset;
|
|
244
|
+
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// adjust for linewidth
|
|
248
|
+
offset *= linewidth * 0.5;
|
|
249
|
+
|
|
250
|
+
// set the world position
|
|
251
|
+
worldPos = ( position.y < 0.5 ) ? start : end;
|
|
252
|
+
worldPos.xyz += offset;
|
|
253
|
+
|
|
254
|
+
// project the worldpos
|
|
255
|
+
vec4 clip = projectionMatrix * worldPos;
|
|
256
|
+
|
|
257
|
+
// shift the depth of the projected points so the line
|
|
258
|
+
// segments overlap neatly
|
|
259
|
+
vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
|
|
260
|
+
clip.z = clipPose.z * clip.w;
|
|
261
|
+
|
|
262
|
+
#else
|
|
263
|
+
|
|
264
|
+
vec2 offset = vec2( dir.y, - dir.x );
|
|
265
|
+
// undo aspect ratio adjustment
|
|
266
|
+
dir.x /= aspect;
|
|
267
|
+
offset.x /= aspect;
|
|
268
|
+
|
|
269
|
+
// sign flip
|
|
270
|
+
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
271
|
+
|
|
272
|
+
// endcaps
|
|
273
|
+
if ( position.y < 0.0 ) {
|
|
274
|
+
|
|
275
|
+
offset += - dir;
|
|
276
|
+
|
|
277
|
+
} else if ( position.y > 1.0 ) {
|
|
278
|
+
|
|
279
|
+
offset += dir;
|
|
280
|
+
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// adjust for linewidth
|
|
284
|
+
offset *= linewidth;
|
|
285
|
+
|
|
286
|
+
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
|
|
287
|
+
offset /= resolution.y;
|
|
288
|
+
|
|
289
|
+
// select end
|
|
290
|
+
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
|
|
291
|
+
|
|
292
|
+
// back to clip space
|
|
293
|
+
offset *= clip.w;
|
|
294
|
+
|
|
295
|
+
clip.xy += offset;
|
|
296
|
+
|
|
297
|
+
#endif
|
|
298
|
+
|
|
299
|
+
gl_Position = clip;
|
|
300
|
+
|
|
301
|
+
vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
|
|
302
|
+
|
|
303
|
+
#include <logdepthbuf_vertex>
|
|
304
|
+
#include <clipping_planes_vertex>
|
|
305
|
+
#include <fog_vertex>
|
|
306
|
+
|
|
307
|
+
}
|
|
308
|
+
`,fragmentShader:`
|
|
309
|
+
uniform vec3 diffuse;
|
|
310
|
+
uniform float opacity;
|
|
311
|
+
uniform float linewidth;
|
|
312
|
+
|
|
313
|
+
#ifdef USE_DASH
|
|
314
|
+
|
|
315
|
+
uniform float dashOffset;
|
|
316
|
+
uniform float dashSize;
|
|
317
|
+
uniform float gapSize;
|
|
318
|
+
|
|
319
|
+
#endif
|
|
320
|
+
|
|
321
|
+
varying float vLineDistance;
|
|
322
|
+
|
|
323
|
+
#ifdef WORLD_UNITS
|
|
324
|
+
|
|
325
|
+
varying vec4 worldPos;
|
|
326
|
+
varying vec3 worldStart;
|
|
327
|
+
varying vec3 worldEnd;
|
|
328
|
+
|
|
329
|
+
#ifdef USE_DASH
|
|
330
|
+
|
|
331
|
+
varying vec2 vUv;
|
|
332
|
+
|
|
333
|
+
#endif
|
|
334
|
+
|
|
335
|
+
#else
|
|
336
|
+
|
|
337
|
+
varying vec2 vUv;
|
|
338
|
+
|
|
339
|
+
#endif
|
|
340
|
+
|
|
341
|
+
#include <common>
|
|
342
|
+
#include <fog_pars_fragment>
|
|
343
|
+
#include <logdepthbuf_pars_fragment>
|
|
344
|
+
#include <clipping_planes_pars_fragment>
|
|
345
|
+
|
|
346
|
+
#ifdef USE_COLOR
|
|
347
|
+
#ifdef USE_LINE_COLOR_ALPHA
|
|
348
|
+
varying vec4 vLineColor;
|
|
349
|
+
#else
|
|
350
|
+
varying vec3 vLineColor;
|
|
351
|
+
#endif
|
|
352
|
+
#endif
|
|
353
|
+
|
|
354
|
+
vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
|
|
355
|
+
|
|
356
|
+
float mua;
|
|
357
|
+
float mub;
|
|
358
|
+
|
|
359
|
+
vec3 p13 = p1 - p3;
|
|
360
|
+
vec3 p43 = p4 - p3;
|
|
361
|
+
|
|
362
|
+
vec3 p21 = p2 - p1;
|
|
363
|
+
|
|
364
|
+
float d1343 = dot( p13, p43 );
|
|
365
|
+
float d4321 = dot( p43, p21 );
|
|
366
|
+
float d1321 = dot( p13, p21 );
|
|
367
|
+
float d4343 = dot( p43, p43 );
|
|
368
|
+
float d2121 = dot( p21, p21 );
|
|
369
|
+
|
|
370
|
+
float denom = d2121 * d4343 - d4321 * d4321;
|
|
371
|
+
|
|
372
|
+
float numer = d1343 * d4321 - d1321 * d4343;
|
|
373
|
+
|
|
374
|
+
mua = numer / denom;
|
|
375
|
+
mua = clamp( mua, 0.0, 1.0 );
|
|
376
|
+
mub = ( d1343 + d4321 * ( mua ) ) / d4343;
|
|
377
|
+
mub = clamp( mub, 0.0, 1.0 );
|
|
378
|
+
|
|
379
|
+
return vec2( mua, mub );
|
|
380
|
+
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
void main() {
|
|
384
|
+
|
|
385
|
+
#include <clipping_planes_fragment>
|
|
386
|
+
|
|
387
|
+
#ifdef USE_DASH
|
|
388
|
+
|
|
389
|
+
if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
|
|
390
|
+
|
|
391
|
+
if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
|
|
392
|
+
|
|
393
|
+
#endif
|
|
394
|
+
|
|
395
|
+
float alpha = opacity;
|
|
396
|
+
|
|
397
|
+
#ifdef WORLD_UNITS
|
|
398
|
+
|
|
399
|
+
// Find the closest points on the view ray and the line segment
|
|
400
|
+
vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
|
|
401
|
+
vec3 lineDir = worldEnd - worldStart;
|
|
402
|
+
vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
|
|
403
|
+
|
|
404
|
+
vec3 p1 = worldStart + lineDir * params.x;
|
|
405
|
+
vec3 p2 = rayEnd * params.y;
|
|
406
|
+
vec3 delta = p1 - p2;
|
|
407
|
+
float len = length( delta );
|
|
408
|
+
float norm = len / linewidth;
|
|
409
|
+
|
|
410
|
+
#ifndef USE_DASH
|
|
411
|
+
|
|
412
|
+
#ifdef USE_ALPHA_TO_COVERAGE
|
|
413
|
+
|
|
414
|
+
float dnorm = fwidth( norm );
|
|
415
|
+
alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
|
|
416
|
+
|
|
417
|
+
#else
|
|
418
|
+
|
|
419
|
+
if ( norm > 0.5 ) {
|
|
420
|
+
|
|
421
|
+
discard;
|
|
422
|
+
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
#endif
|
|
426
|
+
|
|
427
|
+
#endif
|
|
428
|
+
|
|
429
|
+
#else
|
|
430
|
+
|
|
431
|
+
#ifdef USE_ALPHA_TO_COVERAGE
|
|
432
|
+
|
|
433
|
+
// artifacts appear on some hardware if a derivative is taken within a conditional
|
|
434
|
+
float a = vUv.x;
|
|
435
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
436
|
+
float len2 = a * a + b * b;
|
|
437
|
+
float dlen = fwidth( len2 );
|
|
438
|
+
|
|
439
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
440
|
+
|
|
441
|
+
alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
|
|
442
|
+
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
#else
|
|
446
|
+
|
|
447
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
448
|
+
|
|
449
|
+
float a = vUv.x;
|
|
450
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
451
|
+
float len2 = a * a + b * b;
|
|
452
|
+
|
|
453
|
+
if ( len2 > 1.0 ) discard;
|
|
454
|
+
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
#endif
|
|
458
|
+
|
|
459
|
+
#endif
|
|
460
|
+
|
|
461
|
+
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
462
|
+
#ifdef USE_COLOR
|
|
463
|
+
#ifdef USE_LINE_COLOR_ALPHA
|
|
464
|
+
diffuseColor *= vLineColor;
|
|
465
|
+
#else
|
|
466
|
+
diffuseColor.rgb *= vLineColor;
|
|
467
|
+
#endif
|
|
468
|
+
#endif
|
|
469
|
+
|
|
470
|
+
#include <logdepthbuf_fragment>
|
|
471
|
+
|
|
472
|
+
gl_FragColor = diffuseColor;
|
|
473
|
+
|
|
474
|
+
#include <tonemapping_fragment>
|
|
475
|
+
#include <${Tc>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
476
|
+
#include <fog_fragment>
|
|
477
|
+
#include <premultiplied_alpha_fragment>
|
|
478
|
+
|
|
479
|
+
}
|
|
480
|
+
`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(l){this.uniforms.diffuse.value=l}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(l){l===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(l){this.uniforms.linewidth.value=l}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(l){!!l!="USE_DASH"in this.defines&&(this.needsUpdate=!0),l===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(l){this.uniforms.dashScale.value=l}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(l){this.uniforms.dashSize.value=l}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(l){this.uniforms.dashOffset.value=l}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(l){this.uniforms.gapSize.value=l}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(l){this.uniforms.opacity.value=l}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(l){this.uniforms.resolution.value.copy(l)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(l){!!l!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),l===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(i)}}const Wo=new zn,Cu=new ve,Au=new ve,Ze=new zn,qe=new zn,Jt=new zn,Vo=new ve,Qo=new ld,Je=new od,zu=new ve,as=new fl,us=new Qu,$t=new zn;let en,Yn;function Iu(n,i,l){return $t.set(0,0,-i,1).applyMatrix4(n.projectionMatrix),$t.multiplyScalar(1/$t.w),$t.x=Yn/l.width,$t.y=Yn/l.height,$t.applyMatrix4(n.projectionMatrixInverse),$t.multiplyScalar(1/$t.w),Math.abs(Math.max($t.x,$t.y))}function jp(n,i){const l=n.matrixWorld,o=n.geometry,c=o.attributes.instanceStart,f=o.attributes.instanceEnd,d=Math.min(o.instanceCount,c.count);for(let p=0,v=d;p<v;p++){Je.start.fromBufferAttribute(c,p),Je.end.fromBufferAttribute(f,p),Je.applyMatrix4(l);const y=new ve,h=new ve;en.distanceSqToSegment(Je.start,Je.end,h,y),h.distanceTo(y)<Yn*.5&&i.push({point:h,pointOnLine:y,distance:en.origin.distanceTo(h),object:n,face:null,faceIndex:p,uv:null,[Pc]:null})}}function kp(n,i,l){const o=i.projectionMatrix,f=n.material.resolution,d=n.matrixWorld,p=n.geometry,v=p.attributes.instanceStart,y=p.attributes.instanceEnd,h=Math.min(p.instanceCount,v.count),m=-i.near;en.at(1,Jt),Jt.w=1,Jt.applyMatrix4(i.matrixWorldInverse),Jt.applyMatrix4(o),Jt.multiplyScalar(1/Jt.w),Jt.x*=f.x/2,Jt.y*=f.y/2,Jt.z=0,Vo.copy(Jt),Qo.multiplyMatrices(i.matrixWorldInverse,d);for(let x=0,E=h;x<E;x++){if(Ze.fromBufferAttribute(v,x),qe.fromBufferAttribute(y,x),Ze.w=1,qe.w=1,Ze.applyMatrix4(Qo),qe.applyMatrix4(Qo),Ze.z>m&&qe.z>m)continue;if(Ze.z>m){const C=Ze.z-qe.z,N=(Ze.z-m)/C;Ze.lerp(qe,N)}else if(qe.z>m){const C=qe.z-Ze.z,N=(qe.z-m)/C;qe.lerp(Ze,N)}Ze.applyMatrix4(o),qe.applyMatrix4(o),Ze.multiplyScalar(1/Ze.w),qe.multiplyScalar(1/qe.w),Ze.x*=f.x/2,Ze.y*=f.y/2,qe.x*=f.x/2,qe.y*=f.y/2,Je.start.copy(Ze),Je.start.z=0,Je.end.copy(qe),Je.end.z=0;const O=Je.closestPointToPointParameter(Vo,!0);Je.at(O,zu);const D=Cn.lerp(Ze.z,qe.z,O),P=D>=-1&&D<=1,A=Vo.distanceTo(zu)<Yn*.5;if(P&&A){Je.start.fromBufferAttribute(v,x),Je.end.fromBufferAttribute(y,x),Je.start.applyMatrix4(d),Je.end.applyMatrix4(d);const C=new ve,N=new ve;en.distanceSqToSegment(Je.start,Je.end,N,C),l.push({point:N,pointOnLine:C,distance:en.origin.distanceTo(N),object:n,face:null,faceIndex:x,uv:null,[Pc]:null})}}}class Cc extends Yu{constructor(i=new yl,l=new Sl({color:Math.random()*16777215})){super(i,l),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const i=this.geometry,l=i.attributes.instanceStart,o=i.attributes.instanceEnd,c=new Float32Array(2*l.count);for(let d=0,p=0,v=l.count;d<v;d++,p+=2)Cu.fromBufferAttribute(l,d),Au.fromBufferAttribute(o,d),c[p]=p===0?0:c[p-1],c[p+1]=c[p]+Cu.distanceTo(Au);const f=new tl(c,2,1);return i.setAttribute("instanceDistanceStart",new Sr(f,1,0)),i.setAttribute("instanceDistanceEnd",new Sr(f,1,1)),this}raycast(i,l){const o=this.material.worldUnits,c=i.camera;c===null&&!o&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const f=i.params.Line2!==void 0&&i.params.Line2.threshold||0;en=i.ray;const d=this.matrixWorld,p=this.geometry,v=this.material;Yn=v.linewidth+f,p.boundingSphere===null&&p.computeBoundingSphere(),us.copy(p.boundingSphere).applyMatrix4(d);let y;if(o)y=Yn*.5;else{const m=Math.max(c.near,us.distanceToPoint(en.origin));y=Iu(c,m,v.resolution)}if(us.radius+=y,en.intersectsSphere(us)===!1)return;p.boundingBox===null&&p.computeBoundingBox(),as.copy(p.boundingBox).applyMatrix4(d);let h;if(o)h=Yn*.5;else{const m=Math.max(c.near,as.distanceToPoint(en.origin));h=Iu(c,m,v.resolution)}as.expandByScalar(h),en.intersectsBox(as)!==!1&&(o?jp(this,l):kp(this,c,l))}onBeforeRender(i){const l=this.material.uniforms;l&&l.resolution&&(i.getViewport(Wo),this.material.uniforms.resolution.value.set(Wo.z,Wo.w))}}class Fp extends Cc{constructor(i=new Rc,l=new Sl({color:Math.random()*16777215})){super(i,l),this.isLine2=!0,this.type="Line2"}}const Hp=w.forwardRef(function({points:i,color:l=16777215,vertexColors:o,linewidth:c,lineWidth:f,segments:d,dashed:p,...v},y){var h,m;const x=ht(P=>P.size),E=w.useMemo(()=>d?new Cc:new Fp,[d]),[T]=w.useState(()=>new Sl),O=(o==null||(h=o[0])==null?void 0:h.length)===4?4:3,D=w.useMemo(()=>{const P=d?new yl:new Rc,A=i.map(C=>{const N=Array.isArray(C);return C instanceof ve||C instanceof zn?[C.x,C.y,C.z]:C instanceof Te?[C.x,C.y,0]:N&&C.length===3?[C[0],C[1],C[2]]:N&&C.length===2?[C[0],C[1],0]:C});if(P.setPositions(A.flat()),o){l=16777215;const C=o.map(N=>N instanceof st?N.toArray():N);P.setColors(C.flat(),O)}return P},[i,d,o,O]);return w.useLayoutEffect(()=>{E.computeLineDistances()},[i,E]),w.useLayoutEffect(()=>{p?T.defines.USE_DASH="":delete T.defines.USE_DASH,T.needsUpdate=!0},[p,T]),w.useEffect(()=>()=>{D.dispose(),T.dispose()},[D]),w.createElement("primitive",_r({object:E,ref:y},v),w.createElement("primitive",{object:D,attach:"geometry"}),w.createElement("primitive",_r({object:T,attach:"material",color:l,vertexColors:!!o,resolution:[x.width,x.height],linewidth:(m=c??f)!==null&&m!==void 0?m:1,dashed:p,transparent:O===4},v)))}),Yo=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function xl(n,i){const l=ht(f=>f.gl),o=cn(Qn,Yo(n)?Object.values(n):n);return w.useLayoutEffect(()=>{i==null||i(o)},[i]),w.useEffect(()=>{if("initTexture"in l){let f=[];Array.isArray(o)?f=o:o instanceof fs?f=[o]:Yo(o)&&(f=Object.values(o)),f.forEach(d=>{d instanceof fs&&l.initTexture(d)})}},[l,o]),w.useMemo(()=>{if(Yo(n)){const f={};let d=0;for(const p in n)f[p]=o[d++];return f}else return o},[n,o])}xl.preload=n=>cn.preload(Qn,n);xl.clear=n=>cn.clear(Qn,n);const Gp=()=>parseInt(Ss.replace(/\D+/g,"")),Wp=Gp(),Vp=w.forwardRef(({makeDefault:n,camera:i,regress:l,domElement:o,enableDamping:c=!0,keyEvents:f=!1,onChange:d,onStart:p,onEnd:v,...y},h)=>{const m=ht(L=>L.invalidate),x=ht(L=>L.camera),E=ht(L=>L.gl),T=ht(L=>L.events),O=ht(L=>L.setEvents),D=ht(L=>L.set),P=ht(L=>L.get),A=ht(L=>L.performance),C=i||x,N=o||T.connected||E.domElement,k=w.useMemo(()=>new bp(C),[C]);return Oe(()=>{k.enabled&&k.update()},-1),w.useEffect(()=>(f&&k.connect(f===!0?N:f),k.connect(N),()=>void k.dispose()),[f,N,l,k,m]),w.useEffect(()=>{const L=V=>{m(),l&&A.regress(),d&&d(V)},re=V=>{p&&p(V)},Y=V=>{v&&v(V)};return k.addEventListener("change",L),k.addEventListener("start",re),k.addEventListener("end",Y),()=>{k.removeEventListener("start",re),k.removeEventListener("end",Y),k.removeEventListener("change",L)}},[d,p,v,k,m,O]),w.useEffect(()=>{if(n){const L=P().controls;return D({controls:k}),()=>D({controls:L})}},[n,k]),w.createElement("primitive",_r({ref:h,object:k,enableDamping:c},y))});class Qp extends Ht{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
|
|
481
|
+
uniform float time;
|
|
482
|
+
attribute float size;
|
|
483
|
+
varying vec3 vColor;
|
|
484
|
+
void main() {
|
|
485
|
+
vColor = color;
|
|
486
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 0.5);
|
|
487
|
+
gl_PointSize = size * (30.0 / -mvPosition.z) * (3.0 + sin(time + 100.0));
|
|
488
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
489
|
+
}`,fragmentShader:`
|
|
490
|
+
uniform sampler2D pointTexture;
|
|
491
|
+
uniform float fade;
|
|
492
|
+
varying vec3 vColor;
|
|
493
|
+
void main() {
|
|
494
|
+
float opacity = 1.0;
|
|
495
|
+
if (fade == 1.0) {
|
|
496
|
+
float d = distance(gl_PointCoord, vec2(0.5, 0.5));
|
|
497
|
+
opacity = 1.0 / (1.0 + exp(16.0 * (d - 0.25)));
|
|
498
|
+
}
|
|
499
|
+
gl_FragColor = vec4(vColor, opacity);
|
|
500
|
+
|
|
501
|
+
#include <tonemapping_fragment>
|
|
502
|
+
#include <${Wp>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
503
|
+
}`})}}const Yp=n=>new ve().setFromSpherical(new $o(n,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),Xp=w.forwardRef(({radius:n=100,depth:i=50,count:l=5e3,saturation:o=0,factor:c=4,fade:f=!1,speed:d=1},p)=>{const v=w.useRef(),[y,h,m]=w.useMemo(()=>{const E=[],T=[],O=Array.from({length:l},()=>(.5+.5*Math.random())*c),D=new st;let P=n+i;const A=i/l;for(let C=0;C<l;C++)P-=A*Math.random(),E.push(...Yp(P).toArray()),D.setHSL(C/l,o,.9),T.push(D.r,D.g,D.b);return[new Float32Array(E),new Float32Array(T),new Float32Array(O)]},[l,i,c,n,o]);Oe(E=>v.current&&(v.current.uniforms.time.value=E.clock.elapsedTime*d));const[x]=w.useState(()=>new Qp);return w.createElement("points",{ref:p},w.createElement("bufferGeometry",null,w.createElement("bufferAttribute",{attach:"attributes-position",args:[y,3]}),w.createElement("bufferAttribute",{attach:"attributes-color",args:[h,3]}),w.createElement("bufferAttribute",{attach:"attributes-size",args:[m,1]})),w.createElement("primitive",{ref:v,object:x,attach:"material",blending:ri,"uniforms-fade-value":f,depthWrite:!1,transparent:!0,vertexColors:!0}))});/**
|
|
504
|
+
* postprocessing v6.39.1 build Fri Apr 17 2026
|
|
505
|
+
* https://github.com/pmndrs/postprocessing
|
|
506
|
+
* Copyright 2015-2026 Raoul van Rüschen
|
|
507
|
+
* @license Zlib
|
|
508
|
+
*/var Kp=(()=>{const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),i=new Float32Array([0,0,2,0,0,2]),l=new Ju;return l.setAttribute("position",new hs(n,3)),l.setAttribute("uv",new hs(i,2)),l})(),mt=class ul{static get fullscreenGeometry(){return Kp}constructor(i="Pass",l=new Jo,o=new Wn){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 Yu(ul.fullscreenGeometry,i),l.frustumCulled=!1,this.scene===null&&(this.scene=new Jo),this.scene.add(l),this.screen=l)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(i){this.fullscreenMaterial=i}getDepthTexture(){return null}setDepthTexture(i,l=Tr){}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 Ft||l instanceof qu||l instanceof fs||l instanceof ul)&&this[i].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},Zp=class extends mt{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)}},qp=`#ifdef COLOR_WRITE
|
|
509
|
+
#include <common>
|
|
510
|
+
#include <dithering_pars_fragment>
|
|
511
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
512
|
+
uniform mediump sampler2D inputBuffer;
|
|
513
|
+
#else
|
|
514
|
+
uniform lowp sampler2D inputBuffer;
|
|
515
|
+
#endif
|
|
516
|
+
#endif
|
|
517
|
+
#ifdef DEPTH_WRITE
|
|
518
|
+
#include <packing>
|
|
519
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
520
|
+
uniform highp sampler2D depthBuffer;
|
|
521
|
+
#else
|
|
522
|
+
uniform mediump sampler2D depthBuffer;
|
|
523
|
+
#endif
|
|
524
|
+
float readDepth(const in vec2 uv){
|
|
525
|
+
#if DEPTH_PACKING == 3201
|
|
526
|
+
return unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
527
|
+
#else
|
|
528
|
+
return texture2D(depthBuffer,uv).r;
|
|
529
|
+
#endif
|
|
530
|
+
}
|
|
531
|
+
#endif
|
|
532
|
+
#ifdef USE_WEIGHTS
|
|
533
|
+
uniform vec4 channelWeights;
|
|
534
|
+
#endif
|
|
535
|
+
uniform float opacity;varying vec2 vUv;void main(){
|
|
536
|
+
#ifdef COLOR_WRITE
|
|
537
|
+
vec4 texel=texture2D(inputBuffer,vUv);
|
|
538
|
+
#ifdef USE_WEIGHTS
|
|
539
|
+
texel*=channelWeights;
|
|
540
|
+
#endif
|
|
541
|
+
gl_FragColor=opacity*texel;
|
|
542
|
+
#ifdef COLOR_SPACE_CONVERSION
|
|
543
|
+
#include <colorspace_fragment>
|
|
544
|
+
#endif
|
|
545
|
+
#include <dithering_fragment>
|
|
546
|
+
#else
|
|
547
|
+
gl_FragColor=vec4(0.0);
|
|
548
|
+
#endif
|
|
549
|
+
#ifdef DEPTH_WRITE
|
|
550
|
+
gl_FragDepth=readDepth(vUv);
|
|
551
|
+
#endif
|
|
552
|
+
}`,Ac="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",zc=class extends Ht{constructor(){super({name:"CopyMaterial",defines:{COLOR_SPACE_CONVERSION:"1",DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new _e(null),depthBuffer:new _e(null),channelWeights:new _e(null),opacity:new _e(1)},blending:Xn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:qp,vertexShader:Ac}),this.depthFunc=pd}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}},Jp=class extends mt{constructor(n,i=!0){super("CopyPass"),this.fullscreenMaterial=new zc,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new Ft(1,1,{minFilter:ds,magFilter:ds,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!==An?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":n!==null&&n.outputColorSpace===it&&(this.renderTarget.texture.colorSpace=it))}},Uu=new st,Ic=class extends mt{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,p=n.getClearAlpha(),v=f!==null,y=d>=0;v?(n.getClearColor(Uu),n.setClearColor(f,y?d:p)):y&&n.setClearAlpha(d),n.setRenderTarget(this.renderToScreen?null:i),n.clear(this.color,this.depth,this.stencil),v?n.setClearColor(Uu,p):y&&n.setClearAlpha(p)}},$p=class extends mt{constructor(n,i){super("MaskPass",n,i),this.needsSwap=!1,this.clearPass=new Ic(!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,p=this.scene,v=this.camera,y=this.clearPass,h=this.inverted?0:1,m=1-h;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,h,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(p,v)):(n.setRenderTarget(i),n.render(p,v),n.setRenderTarget(l),n.render(p,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)}},Xo=1/1e3,eh=1e3,th=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*Xo}get fixedDelta(){return this._fixedDelta*Xo}set fixedDelta(n){this._fixedDelta=n*eh}get elapsed(){return this._elapsed*Xo}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}},nh=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 Jp,this.depthTexture=null,this.depthRenderTarget=null,this.passes=[],this.timer=new th,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 Te),o=i.getContext().getContextAttributes().alpha,c=this.inputBuffer.texture.type;c===An&&i.outputColorSpace===it&&(this.inputBuffer.texture.colorSpace=it,this.outputBuffer.texture.colorSpace=it,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 ad;this.depthTexture=l,i.stencilBuffer?(l.format=ud,l.type=cd):l.type=Xu;const o=l.clone();return o.name="EffectComposer.StableDepth",this.depthRenderTarget=new Ft(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,p=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,p),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 Te:f.getDrawingBufferSize(new Te),p={minFilter:ds,magFilter:ds,stencilBuffer:l,depthBuffer:i,type:o},v=new Ft(d.width,d.height,p);return c>0&&(v.samples=c),o===An&&f!==null&&f.outputColorSpace===it&&(v.texture.colorSpace=it),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 Te),d=c.getContext().getContextAttributes().alpha,p=this.inputBuffer.texture.type;if(i.renderer=c,i.setSize(f.width,f.height),i.initialize(c,d,p),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,p=!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,p),v.needsDepthBlit&&this.depthRenderTarget!==null&&this.blitDepthBuffer(c),v.needsSwap){if(p){o.renderToScreen=v.renderToScreen;const y=l.getContext(),h=l.state.buffers.stencil;h.setFunc(y.NOTEQUAL,1,4294967295),o.render(l,c,f,i,p),h.setFunc(y.EQUAL,1,4294967295)}d=c,c=f,f=d}v instanceof $p?p=!0:v instanceof Zp&&(p=!1)}}setSize(i,l,o){const c=this.renderer,f=c.getSize(new Te);(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 Te);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 p of this.passes)p.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(),mt.fullscreenGeometry.dispose()}},fn={NONE:0,DEPTH:1,CONVOLUTION:2},Me={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"},rh=class{constructor(){this.shaderParts=new Map([[Me.FRAGMENT_HEAD,null],[Me.FRAGMENT_MAIN_UV,null],[Me.FRAGMENT_MAIN_IMAGE,null],[Me.VERTEX_HEAD,null],[Me.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=fn.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Ku}},Ko=!1,Du=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 Rn:l=this.materialsFlatShadedDoubleSide;break;case xr:l=this.materialsFlatShadedBackSide;break;default:l=this.materialsFlatShaded;break}else switch(i.material.side){case Rn:l=this.materialsDoubleSide;break;case xr: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 Ht))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=dd;i[2].skinning=!0,this.materialsBackSide=i.map(l=>{const o=this.cloneMaterial(l);return o.uniforms=Object.assign({},n.uniforms),o.side=xr,o}),this.materialsDoubleSide=i.map(l=>{const o=this.cloneMaterial(l);return o.uniforms=Object.assign({},n.uniforms),o.side=Rn,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=xr,o}),this.materialsFlatShadedDoubleSide=i.map(l=>{const o=this.cloneMaterial(l);return o.uniforms=Object.assign({},n.uniforms),o.flatShading=!0,o.side=Rn,o})}}render(n,i,l){const o=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,Ko){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 Ko}static set workaroundEnabled(n){Ko=n}},Pn=-1,ot=class extends dl{constructor(n=null,i=Pn,l=Pn,o=1){super(),n!==null&&this.addEventListener("change",()=>n.setSize(this.baseSize.width,this.baseSize.height)),this.baseSize=new Te(1,1),this.preferredSize=new Te(i,l),this.target=this.preferredSize,this.s=o,this.effectiveSize=new Te,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,i=this.preferredSize,l=this.effectiveSize,o=this.scale;i.width!==Pn?l.width=i.width:i.height!==Pn?l.width=Math.round(i.height*(n.width/Math.max(n.height,1))):l.width=Math.round(n.width*o),i.height!==Pn?l.height=i.height:i.width!==Pn?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(Pn),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 Pn}},he={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},ih="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);}",sh="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,src.a*opacity);}",oh="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);}",lh="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);}",ah="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);}",uh="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);}",ch="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);}",fh="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);}",dh="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);}",ph="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);}",hh="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);}",mh="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);}",vh="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);}",gh="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);}",yh="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);}",Sh="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);}",xh="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);}",Eh="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);}",wh="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);}",Mh="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);}",_h="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);}",Th="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);}",Ph="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,opacity);}",Rh="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);}",Ch="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);}",Ah="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);}",zh="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);}",Ih="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);}",Uh="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);}",Dh="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return src;}",Oh="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);}",Bh="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);}",Nh=new Map([[he.ADD,ih],[he.ALPHA,sh],[he.AVERAGE,oh],[he.COLOR,lh],[he.COLOR_BURN,ah],[he.COLOR_DODGE,uh],[he.DARKEN,ch],[he.DIFFERENCE,fh],[he.DIVIDE,dh],[he.DST,null],[he.EXCLUSION,ph],[he.HARD_LIGHT,hh],[he.HARD_MIX,mh],[he.HUE,vh],[he.INVERT,gh],[he.INVERT_RGB,yh],[he.LIGHTEN,Sh],[he.LINEAR_BURN,xh],[he.LINEAR_DODGE,Eh],[he.LINEAR_LIGHT,wh],[he.LUMINOSITY,Mh],[he.MULTIPLY,_h],[he.NEGATION,Th],[he.NORMAL,Ph],[he.OVERLAY,Rh],[he.PIN_LIGHT,Ch],[he.REFLECT,Ah],[he.SATURATION,zh],[he.SCREEN,Ih],[he.SOFT_LIGHT,Uh],[he.SRC,Dh],[he.SUBTRACT,Oh],[he.VIVID_LIGHT,Bh]]),Lh=class extends dl{constructor(n,i=1){super(),this._blendFunction=n,this.opacity=new _e(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 Nh.get(this.blendFunction)}},cl=class extends dl{constructor(n,i,{attributes:l=fn.NONE,blendFunction:o=he.NORMAL,defines:c=new Map,uniforms:f=new Map,extensions:d=null,vertexShader:p=null}={}){super(),this.name=n,this.renderer=null,this.attributes=l,this.fragmentShader=i,this.vertexShader=p,this.defines=c,this.uniforms=f,this.extensions=d,this.blendMode=new Lh(o),this.blendMode.addEventListener("change",v=>this.setChanged()),this._inputColorSpace=Ku,this._outputColorSpace=Zu}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=Tr){}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 Ft||i instanceof qu||i instanceof fs||i instanceof mt)&&this[n].dispose()}}},El={MEDIUM:2,LARGE:3},bh=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
553
|
+
uniform mediump sampler2D inputBuffer;
|
|
554
|
+
#else
|
|
555
|
+
uniform lowp sampler2D inputBuffer;
|
|
556
|
+
#endif
|
|
557
|
+
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;
|
|
558
|
+
#include <colorspace_fragment>
|
|
559
|
+
}`,jh="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);}",kh=[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])],Fh=class extends Ht{constructor(n=new zn){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new _e(null),texelSize:new _e(new zn),scale:new _e(1),kernel:new _e(0)},blending:Xn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:bh,vertexShader:jh}),this.setTexelSize(n.x,n.y),this.kernelSize=El.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return kh[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)}},Hh=class extends mt{constructor({kernelSize:n=El.MEDIUM,resolutionScale:i=.5,width:l=ot.AUTO_SIZE,height:o=ot.AUTO_SIZE,resolutionX:c=l,resolutionY:f=o}={}){super("KawaseBlurPass"),this.renderTargetA=new Ft(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 ot(this,c,f,i);d.addEventListener("change",p=>this.setSize(d.baseWidth,d.baseHeight)),this._blurMaterial=new Fh,this._blurMaterial.kernelSize=n,this.copyMaterial=new zc}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,p=this.renderTargetA,v=this.renderTargetB,y=this.blurMaterial,h=y.kernelSequence;let m=i;this.fullscreenMaterial=y;for(let x=0,E=h.length;x<E;++x){const T=x&1?v:p;y.kernel=h[x],y.inputBuffer=m.texture,n.setRenderTarget(T),n.render(f,d),m=T}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!==An?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):n!==null&&n.outputColorSpace===it&&(this.renderTargetA.texture.colorSpace=it,this.renderTargetB.texture.colorSpace=it))}static get AUTO_SIZE(){return ot.AUTO_SIZE}},Gh=`#include <common>
|
|
560
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
561
|
+
uniform mediump sampler2D inputBuffer;
|
|
562
|
+
#else
|
|
563
|
+
uniform lowp sampler2D inputBuffer;
|
|
564
|
+
#endif
|
|
565
|
+
#ifdef RANGE
|
|
566
|
+
uniform vec2 range;
|
|
567
|
+
#elif defined(THRESHOLD)
|
|
568
|
+
uniform float threshold;uniform float smoothing;
|
|
569
|
+
#endif
|
|
570
|
+
varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0;
|
|
571
|
+
#ifdef RANGE
|
|
572
|
+
float low=step(range.x,l);float high=step(l,range.y);mask=low*high;
|
|
573
|
+
#elif defined(THRESHOLD)
|
|
574
|
+
mask=smoothstep(threshold,threshold+smoothing,l);
|
|
575
|
+
#endif
|
|
576
|
+
#ifdef COLOR
|
|
577
|
+
gl_FragColor=texel*mask;
|
|
578
|
+
#else
|
|
579
|
+
gl_FragColor=vec4(l*mask);
|
|
580
|
+
#endif
|
|
581
|
+
}`,Wh=class extends Ht{constructor(n=!1,i=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:Ss.replace(/\D+/g,"")},uniforms:{inputBuffer:new _e(null),threshold:new _e(0),smoothing:new _e(1),range:new _e(null)},blending:Xn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Gh,vertexShader:Ac}),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}},Vh=class extends mt{constructor({renderTarget:n,luminanceRange:i,colorOutput:l,resolutionScale:o=1,width:c=ot.AUTO_SIZE,height:f=ot.AUTO_SIZE,resolutionX:d=c,resolutionY:p=f}={}){super("LuminancePass"),this.fullscreenMaterial=new Wh(l,i),this.needsSwap=!1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new Ft(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const v=this.resolution=new ot(this,d,p,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!==An&&(this.renderTarget.texture.type=l,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},Qh=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
582
|
+
uniform mediump sampler2D inputBuffer;
|
|
583
|
+
#else
|
|
584
|
+
uniform lowp sampler2D inputBuffer;
|
|
585
|
+
#endif
|
|
586
|
+
#define WEIGHT_INNER 0.125
|
|
587
|
+
#define WEIGHT_OUTER 0.05556
|
|
588
|
+
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;
|
|
589
|
+
#include <colorspace_fragment>
|
|
590
|
+
}`,Yh="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);}",Xh=class extends Ht{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new _e(null),texelSize:new _e(new Te)},blending:Xn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Qh,vertexShader:Yh})}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setSize(n,i){this.uniforms.texelSize.value.set(1/n,1/i)}},Kh=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
591
|
+
uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer;
|
|
592
|
+
#else
|
|
593
|
+
uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer;
|
|
594
|
+
#endif
|
|
595
|
+
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);
|
|
596
|
+
#include <colorspace_fragment>
|
|
597
|
+
}`,Zh="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);}",qh=class extends Ht{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new _e(null),supportBuffer:new _e(null),texelSize:new _e(new Te),radius:new _e(.85)},blending:Xn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Kh,vertexShader:Zh})}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)}},Jh=class extends mt{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new Ft(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new Xh,this.upsamplingMaterial=new qh,this.resolution=new Te}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:p,upsamplingMaterial:v}=this,{downsamplingMipmaps:y,upsamplingMipmaps:h}=this;let m=i;this.fullscreenMaterial=p;for(let x=0,E=y.length;x<E;++x){const T=y[x];p.setSize(m.width,m.height),p.inputBuffer=m.texture,n.setRenderTarget(T),n.render(f,d),m=T}this.fullscreenMaterial=v;for(let x=h.length-1;x>=0;--x){const E=h[x];v.setSize(m.width,m.height),v.inputBuffer=m.texture,v.supportBuffer=y[x].texture,n.setRenderTarget(E),n.render(f,d),m=E}}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!==An)this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1";else if(n!==null&&n.outputColorSpace===it)for(const c of o)c.texture.colorSpace=it}}dispose(){super.dispose();for(const n of this.downsamplingMipmaps.concat(this.upsamplingMipmaps))n.dispose()}},$h=`#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
598
|
+
uniform mediump sampler2D map;
|
|
599
|
+
#else
|
|
600
|
+
uniform lowp sampler2D map;
|
|
601
|
+
#endif
|
|
602
|
+
uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,em=class extends cl{constructor({blendFunction:n=he.SCREEN,luminanceThreshold:i=1,luminanceSmoothing:l=.03,mipmapBlur:o=!0,intensity:c=1,radius:f=.85,levels:d=8,kernelSize:p=El.LARGE,resolutionScale:v=.5,width:y=ot.AUTO_SIZE,height:h=ot.AUTO_SIZE,resolutionX:m=y,resolutionY:x=h}={}){super("BloomEffect",$h,{blendFunction:n,uniforms:new Map([["map",new _e(null)],["intensity",new _e(c)]])}),this.renderTarget=new Ft(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new Hh({kernelSize:p}),this.luminancePass=new Vh({colorOutput:!0}),this.luminanceMaterial.threshold=i,this.luminanceMaterial.smoothing=l,this.mipmapBlurPass=new Jh,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 E=this.resolution=new ot(this,m,x,v);E.addEventListener("change",T=>this.setSize(E.baseWidth,E.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===it&&(this.renderTarget.texture.colorSpace=it))}},Uc=class extends mt{constructor(n,i,l=null){super("RenderPass",n,i),this.needsSwap=!1,this.needsDepthBlit=!0,this.clearPass=new Ic,this.overrideMaterialManager=l===null?null:new Du(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 Du(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,p=this.selection,v=d.layers.mask,y=f.background,h=n.shadowMap.autoUpdate,m=this.renderToScreen?null:i;p!==null&&d.layers.set(p.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=h}},tm=`#include <packing>
|
|
603
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
604
|
+
uniform highp sampler2D depthBuffer;
|
|
605
|
+
#else
|
|
606
|
+
uniform mediump sampler2D depthBuffer;
|
|
607
|
+
#endif
|
|
608
|
+
#ifdef DOWNSAMPLE_NORMALS
|
|
609
|
+
uniform lowp sampler2D normalBuffer;
|
|
610
|
+
#endif
|
|
611
|
+
varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){
|
|
612
|
+
#if DEPTH_PACKING == 3201
|
|
613
|
+
return unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
614
|
+
#else
|
|
615
|
+
return texture2D(depthBuffer,uv).r;
|
|
616
|
+
#endif
|
|
617
|
+
}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);
|
|
618
|
+
#ifdef DOWNSAMPLE_NORMALS
|
|
619
|
+
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;
|
|
620
|
+
#else
|
|
621
|
+
vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0);
|
|
622
|
+
#endif
|
|
623
|
+
gl_FragColor=vec4(n[index],d[index]);}`,nm="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);}",rm=class extends Ht{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new _e(null),normalBuffer:new _e(null),texelSize:new _e(new Te)},blending:Xn,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:tm,vertexShader:nm})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,i=Tr){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)}},im=class extends mt{constructor({normalBuffer:n=null,resolutionScale:i=.5,width:l=ot.AUTO_SIZE,height:o=ot.AUTO_SIZE,resolutionX:c=l,resolutionY:f=o}={}){super("DepthDownsamplingPass");const d=new rm;d.normalBuffer=n,this.fullscreenMaterial=d,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Ft(1,1,{minFilter:ps,magFilter:ps,depthBuffer:!1,type:Xu}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const p=this.resolution=new ot(this,c,f,i);p.addEventListener("change",v=>this.setSize(p.baseWidth,p.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,i=Tr){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.")}},sm=`#include <common>
|
|
624
|
+
#include <packing>
|
|
625
|
+
#include <dithering_pars_fragment>
|
|
626
|
+
#define packFloatToRGBA(v) packDepthToRGBA(v)
|
|
627
|
+
#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)
|
|
628
|
+
#ifdef FRAMEBUFFER_PRECISION_HIGH
|
|
629
|
+
uniform mediump sampler2D inputBuffer;
|
|
630
|
+
#else
|
|
631
|
+
uniform lowp sampler2D inputBuffer;
|
|
632
|
+
#endif
|
|
633
|
+
#if DEPTH_PACKING == 3201
|
|
634
|
+
uniform lowp sampler2D depthBuffer;
|
|
635
|
+
#elif defined(GL_FRAGMENT_PRECISION_HIGH)
|
|
636
|
+
uniform highp sampler2D depthBuffer;
|
|
637
|
+
#else
|
|
638
|
+
uniform mediump sampler2D depthBuffer;
|
|
639
|
+
#endif
|
|
640
|
+
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){
|
|
641
|
+
#if DEPTH_PACKING == 3201
|
|
642
|
+
float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
|
|
643
|
+
#else
|
|
644
|
+
float depth=texture2D(depthBuffer,uv).r;
|
|
645
|
+
#endif
|
|
646
|
+
#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
|
|
647
|
+
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;
|
|
648
|
+
#elif defined(USE_REVERSED_DEPTH_BUFFER)
|
|
649
|
+
depth=1.0-depth;
|
|
650
|
+
#endif
|
|
651
|
+
return depth;}float getViewZ(const in float depth){
|
|
652
|
+
#ifdef PERSPECTIVE_CAMERA
|
|
653
|
+
return perspectiveDepthToViewZ(depth,cameraNear,cameraFar);
|
|
654
|
+
#else
|
|
655
|
+
return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
|
|
656
|
+
#endif
|
|
657
|
+
}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;
|
|
658
|
+
#ifdef ENCODE_OUTPUT
|
|
659
|
+
#include <colorspace_fragment>
|
|
660
|
+
#endif
|
|
661
|
+
#include <dithering_fragment>
|
|
662
|
+
}`,om="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);}",lm=class extends Ht{constructor(n,i,l,o,c=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:Ss.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new _e(null),depthBuffer:new _e(null),resolution:new _e(new Te),texelSize:new _e(new Te),cameraNear:new _e(.3),cameraFar:new _e(1e3),aspect:new _e(1),time:new _e(0)},blending:Xn,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=Tr){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=sm.replace(Me.FRAGMENT_HEAD,n.get(Me.FRAGMENT_HEAD)||"").replace(Me.FRAGMENT_MAIN_UV,n.get(Me.FRAGMENT_MAIN_UV)||"").replace(Me.FRAGMENT_MAIN_IMAGE,n.get(Me.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=om.replace(Me.VERTEX_HEAD,n.get(Me.VERTEX_HEAD)||"").replace(Me.VERTEX_MAIN_SUPPORT,n.get(Me.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 Vn?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 Me}};function Ou(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 am(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&fn.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 p=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,v=l.shaderParts;let y=v.get(Me.FRAGMENT_HEAD)||"",h=v.get(Me.FRAGMENT_MAIN_UV)||"",m=v.get(Me.FRAGMENT_MAIN_IMAGE)||"",x=v.get(Me.VERTEX_HEAD)||"",E=v.get(Me.VERTEX_MAIN_SUPPORT)||"";const T=new Set,O=new Set;if(d&&(h+=` ${n}MainUv(UV);
|
|
663
|
+
`,l.uvTransformation=!0),c!==null&&/mainSupport/.test(c)){const A=/mainSupport *\([\w\s]*?uv\s*?\)/.test(c);E+=` ${n}MainSupport(`,E+=A?`vUv);
|
|
664
|
+
`:`);
|
|
665
|
+
`;for(const C of c.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const N of C[1].split(/\s*,\s*/))l.varyings.add(N),T.add(N),O.add(N);for(const C of c.matchAll(p))O.add(C[1])}for(const A of o.matchAll(p))O.add(A[1]);for(const A of i.defines.keys())O.add(A.replace(/\([\w\s,]*\)/g,""));for(const A of i.uniforms.keys())O.add(A);O.delete("while"),O.delete("for"),O.delete("if"),i.uniforms.forEach((A,C)=>l.uniforms.set(n+C.charAt(0).toUpperCase()+C.slice(1),A)),i.defines.forEach((A,C)=>l.defines.set(n+C.charAt(0).toUpperCase()+C.slice(1),A));const D=new Map([["fragment",o],["vertex",c]]);Ou(n,O,l.defines),Ou(n,O,D),o=D.get("fragment"),c=D.get("vertex");const P=i.blendMode;if(l.blendModes.set(P.blendFunction,P),f){i.inputColorSpace!==null&&i.inputColorSpace!==l.colorSpace&&(m+=i.inputColorSpace===it?`color0 = sRGBTransferOETF(color0);
|
|
666
|
+
`:`color0 = sRGBToLinear(color0);
|
|
667
|
+
`),i.outputColorSpace!==Zu?l.colorSpace=i.outputColorSpace:i.inputColorSpace!==null&&(l.colorSpace=i.inputColorSpace);const A=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;m+=`${n}MainImage(color0, UV, `,l.attributes&fn.DEPTH&&A.test(o)&&(m+="depth, ",l.readDepth=!0),m+=`color1);
|
|
668
|
+
`;const C=n+"BlendOpacity";l.uniforms.set(C,P.opacity),m+=`color0 = blend${P.blendFunction}(color0, color1, ${C});
|
|
669
|
+
|
|
670
|
+
`,y+=`uniform float ${C};
|
|
671
|
+
|
|
672
|
+
`}if(y+=o+`
|
|
673
|
+
`,c!==null&&(x+=c+`
|
|
674
|
+
`),v.set(Me.FRAGMENT_HEAD,y),v.set(Me.FRAGMENT_MAIN_UV,h),v.set(Me.FRAGMENT_MAIN_IMAGE,m),v.set(Me.VERTEX_HEAD,x),v.set(Me.VERTEX_MAIN_SUPPORT,E),i.extensions!==null)for(const A of i.extensions)l.extensions.add(A)}}var um=class extends mt{constructor(n,...i){super("EffectPass"),this.fullscreenMaterial=new lm(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 rh;let i=0;for(const d of this.effects)if(d.blendMode.blendFunction===he.DST)n.attributes|=d.getAttributes()&fn.DEPTH;else{if(n.attributes&d.getAttributes()&fn.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${d.name})`);am("e"+i++,d,n)}let l=n.shaderParts.get(Me.FRAGMENT_HEAD),o=n.shaderParts.get(Me.FRAGMENT_MAIN_IMAGE),c=n.shaderParts.get(Me.FRAGMENT_MAIN_UV);const f=/\bblend\b/g;for(const d of n.blendModes.values())l+=d.getShaderCode().replace(f,`blend${d.blendFunction}`)+`
|
|
675
|
+
`;n.attributes&fn.DEPTH?(n.readDepth&&(o=`float depth = readDepth(UV);
|
|
676
|
+
|
|
677
|
+
`+o),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===it&&(o+=`color0 = sRGBToLinear(color0);
|
|
678
|
+
`),n.uvTransformation?(c=`vec2 transformedUv = vUv;
|
|
679
|
+
`+c,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(Me.FRAGMENT_HEAD,l),n.shaderParts.set(Me.FRAGMENT_MAIN_IMAGE,o),n.shaderParts.set(Me.FRAGMENT_MAIN_UV,c);for(const[d,p]of n.shaderParts)p!==null&&n.shaderParts.set(d,p.trim().replace(/^#/,`
|
|
680
|
+
#`));this.skipRendering=i===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,i=Tr){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!==An&&(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}}},cm=class extends mt{constructor(n,i,{renderTarget:l,resolutionScale:o=1,width:c=ot.AUTO_SIZE,height:f=ot.AUTO_SIZE,resolutionX:d=c,resolutionY:p=f}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new Uc(n,i,new fd);const v=this.renderPass;v.ignoreBackground=!0,v.skipShadowMapUpdate=!0;const y=v.getClearPass();y.overrideClearColor=new st(7829503),y.overrideClearAlpha=1,this.renderTarget=l,this.renderTarget===void 0&&(this.renderTarget=new Ft(1,1,{minFilter:ps,magFilter:ps}),this.renderTarget.texture.name="NormalPass.Target");const h=this.resolution=new ot(this,d,p,o);h.addEventListener("change",m=>this.setSize(h.baseWidth,h.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 fm=w.createContext(null),Bu=n=>(n.getAttributes()&fn.CONVOLUTION)===fn.CONVOLUTION,dm=nl.memo(w.forwardRef(({children:n,camera:i,scene:l,resolutionScale:o,enabled:c=!0,renderPriority:f=1,autoClear:d=!0,depthBuffer:p,enableNormalPass:v,stencilBuffer:y,multisampling:h=8,frameBufferType:m=hd},x)=>{const{gl:E,scene:T,camera:O,size:D}=ht(),P=l||T,A=i||O,[C,N,k]=w.useMemo(()=>{const Y=zp(),V=new nh(E,{depthBuffer:p,stencilBuffer:y,multisampling:h>0&&Y?h:0,frameBufferType:m});V.addPass(new Uc(P,A));let F=null,B=null;return v&&(B=new cm(P,A),B.enabled=!1,V.addPass(B),o!==void 0&&Y&&(F=new im({normalBuffer:B.texture,resolutionScale:o}),F.enabled=!1,V.addPass(F))),[V,B,F]},[A,E,p,y,h,m,P,v,o]);w.useEffect(()=>C==null?void 0:C.setSize(D.width,D.height),[C,D]),Oe((Y,V)=>{if(c){const F=E.autoClear;E.autoClear=d,y&&!d&&E.clearStencil(),C.render(V),E.autoClear=F}},c?f:0);const L=w.useRef(null);w.useLayoutEffect(()=>{var Y;const V=[],F=(Y=L.current)==null?void 0:Y.__r3f;if(F&&C){const B=F.objects;for(let ie=0;ie<B.length;ie++){const de=B[ie];if(de instanceof cl){const Be=[de];if(!Bu(de)){let me=null;for(;(me=B[ie+1])instanceof cl&&!Bu(me);)Be.push(me),ie++}const $=new um(A,...Be);V.push($)}else de instanceof mt&&V.push(de)}for(const ie of V)C==null||C.addPass(ie);N&&(N.enabled=!0),k&&(k.enabled=!0)}return()=>{for(const B of V)C==null||C.removePass(B);N&&(N.enabled=!1),k&&(k.enabled=!1)}},[C,n,A,N,k]),w.useEffect(()=>{const Y=E.toneMapping;return E.toneMapping=Wu,()=>{E.toneMapping=Y}},[E]);const re=w.useMemo(()=>({composer:C,normalPass:N,downSamplingPass:k,resolutionScale:o,camera:A,scene:P}),[C,N,k,o,A,P]);return w.useImperativeHandle(x,()=>C,[C]),S.jsx(fm.Provider,{value:re,children:S.jsx("group",{ref:L,children:n})})}));let pm=0;const Nu=new WeakMap,hm=(n,i)=>nl.forwardRef(function({blendFunction:o=i==null?void 0:i.blendFunction,opacity:c=i==null?void 0:i.opacity,...f},d){let p=Nu.get(n);if(!p){const h=`@react-three/postprocessing/${n.name}-${pm++}`;oc({[h]:n}),Nu.set(n,p=h)}const v=ht(h=>h.camera),y=nl.useMemo(()=>{var h,m;return[...(h=i==null?void 0:i.args)!=null?h:[],...(m=f.args)!=null?m:[{...i,...f}]]},[JSON.stringify(f)]);return S.jsx(p,{camera:v,"blendMode-blendFunction":o,"blendMode-opacity-value":c,...f,ref:d,args:y})}),mm=hm(em,{blendFunction:he.ADD}),vm="/textures/sun.jpg",wr=1.4;function gm(){return S.jsxs("group",{children:[S.jsx("pointLight",{position:[0,0,0],intensity:18,distance:70,decay:2,color:"#ffd486"}),S.jsx(w.Suspense,{fallback:S.jsx(Sm,{}),children:S.jsx(ym,{})}),S.jsx(xm,{}),S.jsx(wm,{})]})}function ym(){const n=w.useRef(null),i=cn(Qn,vm);return i.wrapS=ms,i.wrapT=ms,Oe((l,o)=>{ce.getState().motionEnabled&&n.current&&(n.current.rotation.y+=o*.05)}),S.jsxs("mesh",{ref:n,children:[S.jsx("sphereGeometry",{args:[wr,64,64]}),S.jsx("meshBasicMaterial",{map:i,toneMapped:!1})]})}function Sm(){return S.jsxs("mesh",{children:[S.jsx("sphereGeometry",{args:[wr,48,48]}),S.jsx("meshBasicMaterial",{color:"#fde68a"})]})}function xm(){const n=w.useRef(null),i=w.useRef(null);return Oe(()=>{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)}}),S.jsxs(S.Fragment,{children:[S.jsxs("mesh",{ref:n,children:[S.jsx("sphereGeometry",{args:[wr*1.08,32,32]}),S.jsx("meshBasicMaterial",{color:"#fff7c2",transparent:!0,opacity:.22,toneMapped:!1})]}),S.jsxs("mesh",{children:[S.jsx("sphereGeometry",{args:[wr*1.22,32,32]}),S.jsx("meshBasicMaterial",{color:"#ffae3c",transparent:!0,opacity:.1,toneMapped:!1})]}),S.jsxs("mesh",{ref:i,children:[S.jsx("sphereGeometry",{args:[wr*1.5,32,32]}),S.jsx("meshBasicMaterial",{color:"#f97316",transparent:!0,opacity:.04,toneMapped:!1})]})]})}function Em(){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 rl(i)}function wm(){const n=w.useMemo(()=>Array.from({length:8},(o,c)=>{const f=c/8*Math.PI*2+(Math.random()-.5)*.4,d=(Math.random()-.5)*1,p=wr*1.02;return{pos:[p*Math.cos(d)*Math.cos(f),p*Math.sin(d),p*Math.cos(d)*Math.sin(f)],size:.5+Math.random()*.45,phase:Math.random()*Math.PI*2,baseOpacity:.45+Math.random()*.3}}),[]),i=w.useMemo(()=>Em(),[]),l=w.useRef([]);return Oe(()=>{const o=performance.now()*.001;l.current.forEach((c,f)=>{if(!c)return;const d=n[f],p=.85+Math.sin(o*1.4+d.phase)*.25;c.scale.set(d.size*p,d.size*p*1.4,1);const v=c.material;v.opacity=d.baseOpacity*(.7+Math.sin(o*1.7+d.phase)*.3)})}),i?S.jsx(S.Fragment,{children:n.map((o,c)=>S.jsx("sprite",{ref:f=>{l.current[c]=f},position:o.pos,children:S.jsx("spriteMaterial",{map:i,transparent:!0,depthWrite:!1,blending:ri,opacity:o.baseOpacity,toneMapped:!1})},c))}):S.jsx(S.Fragment,{})}const Lu=[[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 Mm({count:n=1100}){const i=w.useRef(null),l=w.useMemo(()=>{const o=new Float32Array(n*3),c=new Float32Array(n*3),f=220;for(let p=0;p<n;p++){const v=Math.random(),y=Math.random(),h=v*Math.PI*2,m=Math.acos(2*y-1),x=f*(.6+Math.random()*.4);o[p*3]=x*Math.sin(m)*Math.cos(h),o[p*3+1]=x*Math.sin(m)*Math.sin(h),o[p*3+2]=x*Math.cos(m);const E=Lu[Math.floor(Math.random()*Lu.length)];c[p*3]=E[0],c[p*3+1]=E[1],c[p*3+2]=E[2]}const d=new Ju;return d.setAttribute("position",new hs(o,3)),d.setAttribute("color",new hs(c,3)),d},[n]);return Oe((o,c)=>{ce.getState().motionEnabled&&i.current&&(i.current.rotation.y+=c*.005,i.current.rotation.x+=c*.002)}),S.jsx("points",{ref:i,geometry:l,children:S.jsx("pointsMaterial",{vertexColors:!0,size:.5,sizeAttenuation:!0,transparent:!0,opacity:.55})})}const _m=6,Tm=2.4;function Pr(n){return _m+n*Tm}const Pm=1.4,Rm=.6;function Cm(n){return Pm+n*Rm}function Am(n,i){const l=.18-i*.012,o=Math.max(.05,l);return n?o*1.6:o}function zm(){return .7}function li(n,i,l){const o=Zo(l||i),c=(Zo(i)%.6-.3)*(l?1:0);return o+c+n*.05}function Zo(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 Im({session:n,index:i,speed:l}){const o=w.useRef(null),c=w.useRef(null),f=w.useRef(null),d=w.useMemo(()=>Cm(i),[i]),p=w.useMemo(()=>i*1.4,[i]),v=w.useMemo(()=>new st(il(n.model)).multiplyScalar(.7),[n.model]),y=w.useRef(p);return Oe((h,m)=>{const x=ce.getState().motionEnabled;x&&(y.current+=m*l);const E=y.current;if(o.current&&o.current.position.set(Math.cos(E)*d,Math.sin(E*.6)*.2,Math.sin(E)*d),c.current&&x&&(c.current.rotation.y+=m*.6),f.current){const T=$u(n.status);f.current.emissive.lerp(new st(T.color),.08),f.current.emissiveIntensity=Cn.lerp(f.current.emissiveIntensity,T.intensity*.7,.06)}}),S.jsx("group",{ref:o,children:S.jsxs("mesh",{ref:c,children:[S.jsx("sphereGeometry",{args:[.18,16,16]}),S.jsx("meshStandardMaterial",{ref:f,color:v,emissive:v,emissiveIntensity:.2,roughness:.7})]})})}function Dc({radius:n,color:i,intensity:l=1,power:o=3}){const c=w.useMemo(()=>new Ht({uniforms:{uColor:{value:new st(i)},uIntensity:{value:l},uPower:{value:o}},transparent:!0,depthWrite:!1,side:xr,vertexShader:`
|
|
681
|
+
varying vec3 vNormal;
|
|
682
|
+
varying vec3 vViewDir;
|
|
683
|
+
void main() {
|
|
684
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
685
|
+
vNormal = normalize(normalMatrix * normal);
|
|
686
|
+
vViewDir = normalize(-mvPosition.xyz);
|
|
687
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
688
|
+
}
|
|
689
|
+
`,fragmentShader:`
|
|
690
|
+
uniform vec3 uColor;
|
|
691
|
+
uniform float uIntensity;
|
|
692
|
+
uniform float uPower;
|
|
693
|
+
varying vec3 vNormal;
|
|
694
|
+
varying vec3 vViewDir;
|
|
695
|
+
void main() {
|
|
696
|
+
// Back-side render: dot(normal, view) is positive at the silhouette.
|
|
697
|
+
float fres = pow(max(0.0, dot(vNormal, vViewDir)), uPower);
|
|
698
|
+
gl_FragColor = vec4(uColor * uIntensity, fres);
|
|
699
|
+
}
|
|
700
|
+
`}),[i,l,o]);return S.jsxs("mesh",{children:[S.jsx("sphereGeometry",{args:[n*1.18,32,32]}),S.jsx("primitive",{object:c,attach:"material"})]})}function Um({session:n}){const i=w.useRef(null),l=w.useRef(null),o=w.useRef(null),c=w.useRef(null),f=w.useRef(null),d=w.useMemo(()=>li(n.orbitSlot,n.id,n.projectId),[n.orbitSlot,n.id]),p=w.useMemo(()=>Pr(n.orbitSlot),[n.orbitSlot]),v=ce($=>md($,n.id)),y=ce($=>$.selectSession),h=ce($=>$.selectAdvisor),m=ce($=>n.advisorRole?Object.values($.advisors).find(me=>me.id===n.advisorRole)??null:null),E=ce($=>$.selectedSessionId)===n.id,T=n.kind==="advisor",O=ce($=>n.currentMissionId?$.missions[n.currentMissionId]:void 0),D=ce($=>Object.values($.pendingPermissions).filter(me=>me.sessionId===n.id).length),P=w.useMemo(()=>vd(n,O,D),[n,O,D]),A=P.score,C=.4+A/100*.8,N=w.useMemo(()=>new st(T&&m?m.color:il(n.model)),[T,m,n.model]),k=w.useRef(d),L=w.useRef(1);Oe(($,me)=>{const ge=ce.getState(),b=ge.motionEnabled,K=!!(ge.selectedSessionId||ge.selectedAdvisorId||ge.selectedSkillId),G=ge.selectedSessionId===n.id||T&&ge.selectedAdvisorId===n.advisorRole,J=K&&!G?.25:1;L.current=Cn.lerp(L.current,J,.08);const se=L.current,oe=Am(n.status==="active",n.orbitSlot);b&&(k.current+=me*oe*.3);const Ce=k.current,Le=Math.cos(Ce)*p,We=Math.sin(Ce)*p,vt=Math.sin(Ce*.5)*.4;i.current&&i.current.position.set(Le,vt,We);const Mt=$.clock.getElapsedTime();if(l.current){b&&(l.current.rotation.y+=me*.4);const Xe=.55+n.contextUsagePct/100*.5,Pe=l.current.scale.x,le=Cn.lerp(Pe,Xe,.04);l.current.scale.set(le,le,le)}if(f.current){const Xe=$u(n.status),Pe=new st(Xe.color);f.current.emissive.lerp(Pe,.08),f.current.emissiveIntensity=Cn.lerp(f.current.emissiveIntensity,Xe.intensity*se,.06),f.current.opacity=se,f.current.transparent=se<.99}if(o.current){const Xe=n.contextUsagePct>=90,Pe=n.contextUsagePct>=80&&!Xe;if(n.status==="awaiting_permission"||n.status==="awaiting_input"||Xe||Pe){let be=.8,Se="#f59e0b";n.status==="awaiting_permission"?(be=1.5,Se="#ef4444"):n.status==="awaiting_input"?(be=.8,Se="#f59e0b"):Xe?(be=1.2,Se="#dc2626"):Pe&&(be=.6,Se="#fb923c");const gt=.5+.5*Math.sin(Mt*Math.PI*2*be),Bt=o.current.material;Bt.color.set(Se),Bt.opacity=(.25+gt*.5)*se,o.current.visible=!0;const tn=1.4+gt*.5;o.current.scale.set(tn,tn,tn)}else o.current.visible=!1}c.current&&(c.current.visible=n.status==="plan_review",c.current.rotation.z+=me*.3)});const re=$=>{$.stopPropagation(),y(n.id),T&&m&&h(m.id)},Y=.55,V=w.useMemo(()=>bu(n.id,18)*(Math.PI/180),[n.id]),F=w.useMemo(()=>bu(n.id+"-z",12)*(Math.PI/180),[n.id]),B=n.budgetUsd!=null&&n.budgetUsd>0,ie=B?Math.min(100,n.costUsd/n.budgetUsd*100):0,de=Math.round(ie),Be=w.useMemo(()=>Math.max(1e-4,de/100)*Math.PI*2,[de]);return S.jsxs("group",{ref:i,children:[S.jsx("group",{rotation:[V,0,F],children:S.jsxs("mesh",{ref:l,onClick:re,castShadow:!0,children:[S.jsx("sphereGeometry",{args:[Y,32,32]}),S.jsx("meshStandardMaterial",{ref:f,color:N,emissive:N,emissiveIntensity:.06,roughness:.78,metalness:.12})]})}),S.jsx(Dc,{radius:Y,color:T&&m?m.color:il(n.model),intensity:C*(n.status==="active"?1.2:.9)}),S.jsxs("mesh",{ref:o,visible:!1,children:[S.jsx("sphereGeometry",{args:[Y*1.4,24,24]}),S.jsx("meshBasicMaterial",{color:"#ef4444",transparent:!0,opacity:.4})]}),S.jsxs("mesh",{ref:c,visible:!1,rotation:[Math.PI/2.4,0,0],children:[S.jsx("ringGeometry",{args:[Y*1.4,Y*2,64]}),S.jsx("meshBasicMaterial",{color:"#a78bfa",transparent:!0,opacity:.5,side:2})]}),T&&S.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[S.jsx("ringGeometry",{args:[Y*1.25,Y*1.35,64]}),S.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.7,side:2})]}),B&&S.jsxs("group",{rotation:[Math.PI/2,0,0],children:[S.jsxs("mesh",{children:[S.jsx("ringGeometry",{args:[Y*2.05,Y*2.3,64]}),S.jsx("meshBasicMaterial",{color:"#1e293b",transparent:!0,opacity:.35,side:2})]}),S.jsxs("mesh",{children:[S.jsx("ringGeometry",{args:[Y*2.05,Y*2.3,64,1,Math.PI/2,Be]}),S.jsx("meshBasicMaterial",{color:gd(ie),transparent:!0,opacity:.9,side:2})]})]}),v.map(($,me)=>S.jsx(Im,{session:$,index:me,speed:zm()},$.id)),S.jsx(oi,{center:!0,distanceFactor:10,style:{pointerEvents:"none",userSelect:"none"},position:[0,Y+.4,0],children:S.jsxs("div",{className:`px-2 py-1 rounded text-[10px] whitespace-nowrap border ${E?"bg-solix-accent/20 border-solix-accent text-white":T?"bg-amber-500/10 border-amber-300/50 text-amber-100":"bg-black/50 border-white/10 text-slate-200"}`,children:[S.jsxs("div",{className:"font-semibold flex items-center gap-1",children:[T&&m&&S.jsx("span",{style:{color:m.color},children:m.glyph}),S.jsx("span",{children:n.name??(T&&m?`${m.codename} (pinned)`:n.id.slice(0,8))})]}),S.jsxs("div",{className:"opacity-70",title:yd[n.status]??void 0,children:[String(n.model)," · ",Sd(n.status),n.origin==="agentview"&&S.jsx("span",{className:"ml-1.5 text-[9px] uppercase tracking-wide text-cyan-300",title:"Background session managed by Anthropic's Agent View",children:"· agent"}),n.wrapperSocketPath&&S.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"})]}),n.agentViewSummary&&S.jsx("div",{className:"opacity-80 italic text-[10px] max-w-[200px] truncate",title:n.agentViewSummary,children:n.agentViewSummary}),S.jsxs("div",{className:"opacity-70",title:P.reasons.length?P.reasons.join(" · "):"Stable, low context, no pending decisions",children:[S.jsx("span",{style:{color:xd(A)},children:"♥"})," ","health ",A,P.reasons[0]&&S.jsxs("span",{className:"opacity-80",children:[" · ",P.reasons[0]]})]})]})})]})}function bu(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 Dm({orbitSlot:n}){const i=Pr(n);return S.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[S.jsx("ringGeometry",{args:[i-.02,i+.02,128]}),S.jsx("meshBasicMaterial",{color:"#1e293b",transparent:!0,opacity:.35,side:2})]})}const Om=1800;function Bm(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 Nm({toolCallId:n,startX:i,startZ:l,color:o,receivedAt:c}){const f=w.useRef(null),d=w.useRef(null),p=w.useMemo(()=>{const v=Math.hypot(i,l)||1,y=i/v,h=l/v;return{nx:y,nz:h}},[i,l]);return Oe(()=>{const v=Date.now()-c,y=Math.min(1,v/Om);if(f.current){const h=Cn.lerp(0,12,y);f.current.position.set(i+p.nx*h,Math.sin(y*Math.PI)*1.4,l+p.nz*h)}if(d.current){const h=d.current.material;h.opacity=1-y}}),S.jsx("group",{ref:f,children:S.jsxs("mesh",{ref:d,children:[S.jsx("sphereGeometry",{args:[.08,8,8]}),S.jsx("meshBasicMaterial",{color:o,transparent:!0,opacity:.9})]})})}function Lm(){const n=ce(l=>l.playback.active?l.playback.derivedToolCalls:l.recentToolCalls),i=ce(l=>l.playback.active?l.playback.derivedSessions:l.sessions);return S.jsx("group",{children:n.map(l=>{const o=i[l.sessionId];if(!o)return null;const c=Pr(o.orbitSlot),f=li(o.orbitSlot,o.id,o.projectId),d=(Date.now()-l.startedAt)/1e3,v=f+d*.18*.3,y=Math.cos(v)*c,h=Math.sin(v)*c;return S.jsx(Nm,{toolCallId:l.id,startX:y,startZ:h,color:Bm(l.tool),receivedAt:l.receivedAt},l.id)})})}const gs=3.3,ys=4.3,un=.34,bm={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 jm({advisor:n,index:i,total:l}){const o=w.useRef(null),c=w.useMemo(()=>i/Math.max(1,l)*Math.PI*2,[i,l]),f=ce(m=>m.selectAdvisor),d=ce(m=>m.selectedAdvisorId===n.id),p=w.useRef(c);Oe((m,x)=>{ce.getState().motionEnabled&&(p.current+=x*.18);const E=p.current;o.current&&o.current.position.set(Math.cos(E)*gs,0,Math.sin(E)*gs)});const v=w.useRef(1);Oe(()=>{const m=ce.getState(),x=!!(m.selectedSessionId||m.selectedAdvisorId||m.selectedSkillId),E=m.selectedAdvisorId===n.id||n.pinnedSessionId&&m.selectedSessionId===n.pinnedSessionId,T=x&&!E?.25:1;v.current=Cn.lerp(v.current,T,.08)});const y=m=>{m.stopPropagation(),f(n.id)},h=n.texturePack?bm[n.texturePack]:void 0;return S.jsxs("group",{ref:o,children:[h?S.jsx(w.Suspense,{fallback:S.jsx(ju,{advisor:n,onClick:y,dimRef:v}),children:S.jsx(km,{advisor:n,pack:h,onClick:y,dimRef:v})}):S.jsx(ju,{advisor:n,onClick:y,dimRef:v}),S.jsx(Dc,{radius:un,color:n.color,intensity:n.pinned?1.4:.7,power:3.5}),S.jsx(oi,{center:!0,distanceFactor:9,style:{pointerEvents:"none",userSelect:"none"},position:[0,un+.32,0],children:S.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:[S.jsx("span",{className:"mr-1",children:n.glyph}),n.codename,n.pinned&&S.jsx("span",{className:"ml-1 text-amber-300",children:"●"})]})})]})}function km({advisor:n,pack:i,onClick:l,dimRef:o}){const c=w.useRef(null),f=w.useRef(null),d=w.useRef(null),p=w.useRef(null),v=w.useRef(null),y=w.useRef(null),h=cn(Qn,i.body),m=cn(Qn,i.cloud??"/textures/sun.jpg"),x=cn(Qn,i.ring??"/textures/sun.jpg");h.wrapS=ms,h.wrapT=ms,Oe((D,P)=>{ce.getState().motionEnabled&&(c.current&&(c.current.rotation.y+=P*.18),f.current&&(f.current.rotation.y+=P*.25),d.current&&(d.current.rotation.z+=P*.05));const C=o.current;p.current&&(p.current.opacity=C,p.current.transparent=C<.99),v.current&&(v.current.opacity=.55*C),y.current&&(y.current.opacity=.85*C)});const E=i.axialTilt??0,T=(i.ringInner??1.5)*un,O=(i.ringOuter??2.4)*un;return S.jsxs("group",{rotation:[E,0,0],children:[S.jsxs("mesh",{ref:c,onClick:l,children:[S.jsx("sphereGeometry",{args:[un,48,48]}),S.jsx("meshStandardMaterial",{ref:p,map:h,roughness:.85,metalness:.05,emissive:new st(n.color),emissiveIntensity:n.pinned?.25:.1,transparent:!0,opacity:1})]}),i.cloud&&S.jsxs("mesh",{ref:f,children:[S.jsx("sphereGeometry",{args:[un*1.02,48,48]}),S.jsx("meshStandardMaterial",{ref:v,map:m,transparent:!0,opacity:.55,depthWrite:!1,roughness:1})]}),i.ring&&S.jsxs("mesh",{ref:d,rotation:[Math.PI/2,0,0],children:[S.jsx("ringGeometry",{args:[T,O,96]}),S.jsx("meshStandardMaterial",{ref:y,map:x,transparent:!0,opacity:.85,side:Rn,depthWrite:!1,roughness:1})]})]})}function ju({advisor:n,onClick:i,dimRef:l}){const o=w.useRef(null),c=w.useRef(null),f=w.useMemo(()=>new st(n.color),[n.color]);return Oe((d,p)=>{if(ce.getState().motionEnabled&&o.current&&(o.current.rotation.y+=p*.4),c.current){const y=l.current,h=n.pinned?.6:.22;c.current.emissiveIntensity=Cn.lerp(c.current.emissiveIntensity,h*y,.05),c.current.opacity=y,c.current.transparent=y<.99}}),S.jsxs("mesh",{ref:o,onClick:i,children:[S.jsx("sphereGeometry",{args:[un,24,24]}),S.jsx("meshStandardMaterial",{ref:c,color:f,emissive:f,emissiveIntensity:.22,roughness:.55,metalness:.4,transparent:!0,opacity:1})]})}function Fm({advisor:n,index:i,total:l}){const o=w.useRef(null),c=w.useRef(null),f=w.useMemo(()=>i/Math.max(1,l)*Math.PI*2,[i,l]),d=w.useRef(f),p=ce(m=>m.selectAdvisor),v=ce(m=>m.selectedAdvisorId===n.id),y=w.useMemo(()=>new st(n.color),[n.color]);Oe((m,x)=>{ce.getState().motionEnabled&&(d.current+=x*.1);const E=d.current;if(o.current&&o.current.position.set(Math.cos(E)*ys,0,Math.sin(E)*ys),c.current){const T=m.clock.getElapsedTime(),O=.5+.5*Math.sin(T*1.1+f);c.current.opacity=(v?.6:.28)+O*.12}});const h=m=>{m.stopPropagation(),p(n.id)};return S.jsxs("group",{ref:o,children:[S.jsxs("mesh",{onClick:h,children:[S.jsx("sphereGeometry",{args:[un*.8,20,20]}),S.jsx("meshStandardMaterial",{ref:c,color:y,emissive:y,emissiveIntensity:.15,roughness:.7,metalness:.2,transparent:!0,opacity:.3,wireframe:!0})]}),S.jsx(oi,{center:!0,distanceFactor:9,style:{pointerEvents:"none",userSelect:"none"},position:[0,un+.28,0],children:S.jsxs("div",{className:`px-1.5 py-0.5 rounded text-[9px] whitespace-nowrap border ${v?"bg-cyan-400/20 border-cyan-300 text-cyan-100":"bg-black/40 border-white/10 text-slate-400"}`,children:[S.jsx("span",{className:"mr-1",children:n.glyph}),n.codename,S.jsx("span",{className:"ml-1 opacity-60",children:"· opt-in"})]})})]})}function Hm(){const n=ce(Ed),i=ce(wd);return!n.length&&!i.length?null:S.jsxs("group",{children:[n.length>0&&S.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[S.jsx("ringGeometry",{args:[gs-.03,gs+.03,128]}),S.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.12,side:Rn})]}),i.length>0&&S.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[S.jsx("ringGeometry",{args:[ys-.02,ys+.02,128]}),S.jsx("meshBasicMaterial",{color:"#475569",transparent:!0,opacity:.1,side:Rn})]}),n.map((l,o)=>S.jsx(jm,{advisor:l,index:o,total:n.length},l.id)),i.map((l,o)=>S.jsx(Fm,{advisor:l,index:o,total:i.length},l.id))]})}const Gm=22,Wm=1.6,Vm=.2;function Qm(n){switch(n){case"anthropic":return new st("#94a3b8");case"solix":return new st("#a855f7");case"user":return new st("#06b6d4");default:return new st("#cbd5e1")}}const vr=new _d;function Ym(){const n=ce(Md),i=ce(v=>v.selectSkill),l=ce(v=>v.selectedSkillId),o=w.useRef(null),c=w.useMemo(()=>n.map((v,y)=>{const h=y/Math.max(1,n.length)*Math.PI*2,m=(v.id.charCodeAt(0)??0)%13/13-.5,x=Gm+m*Wm,E=Math.sin(h*1.7+(v.id.charCodeAt(1)??0))*.3+Math.tan(Vm)*Math.sin(h)*.4,T=.18+v.id.length%5*.04,O=new el;return O.setFromAxisAngle(new ve(1,.4,.1).normalize(),h*1.3),{angle:h,radius:x,y:E,size:T,rot:O,color:Qm(v.source),skill:v}}),[n]),f=w.useRef(0),d=w.useRef(0);if(Oe((v,y)=>{if(!o.current||!c.length)return;ce.getState().motionEnabled&&(f.current+=y*.04,d.current+=y*.8);const m=f.current,x=d.current;for(let E=0;E<c.length;E++){const T=c[E],O=T.angle+m;vr.position.set(Math.cos(O)*T.radius,T.y,Math.sin(O)*T.radius),vr.quaternion.copy(T.rot),vr.rotateY(x+E);const P=l===T.skill.id?T.size*1.6:T.size;vr.scale.set(P,P,P),vr.updateMatrix(),o.current.setMatrixAt(E,vr.matrix),o.current.setColorAt(E,T.color)}o.current.instanceMatrix.needsUpdate=!0,o.current.instanceColor&&(o.current.instanceColor.needsUpdate=!0)}),!c.length)return null;const p=v=>{v.stopPropagation();const y=v.instanceId;if(typeof y!="number")return;const h=c[y];h&&i(h.skill.id)};return S.jsxs("instancedMesh",{ref:o,args:[void 0,void 0,c.length],onClick:p,children:[S.jsx("icosahedronGeometry",{args:[1,0]}),S.jsx("meshStandardMaterial",{roughness:.85,metalness:.05})]})}function Xm(){const n=ce(c=>c.projects),i=ce(pl),l=ce(hl),o=w.useMemo(()=>{const c=[...i,...l],f=new Map;for(const d of c){const p=n[d.projectId];if(!p)continue;const v=f.get(p.id);v?v.sessions.push(d):f.set(p.id,{project:p,sessions:[d]})}return[...f.values()]},[i,l,n]);return o.length<2?S.jsx(S.Fragment,{}):S.jsx(S.Fragment,{children:o.map(({project:c,sessions:f})=>{const d=f.reduce((m,x)=>Math.max(m,x.orbitSlot),0),p=li(d,f[0].id,c.id),v=Pr(d)+1.2,y=Math.cos(p)*v,h=Math.sin(p)*v;return S.jsx(oi,{position:[y,1.6,h],center:!0,distanceFactor:14,style:{pointerEvents:"none",userSelect:"none"},children:S.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,S.jsxs("span",{className:"ml-1.5 text-slate-500",children:["· ",f.length]})]})},c.id)})})}const qo=[{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 Km(n,i){const o=document.createElement("canvas");o.width=256,o.height=256;const c=o.getContext("2d");if(!c)return new rl(o);const f=n*360,d=`hsla(${f}, ${Math.round(i*100)}%, 60%, 0.85)`,p=`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,p),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 x=Math.random()*256,E=Math.random()*256,T=30+Math.random()*70,O=.4+Math.random()*.6,D=c.createRadialGradient(x,E,0,x,E,T);D.addColorStop(0,`rgba(255,255,255,${O})`),D.addColorStop(1,"rgba(255,255,255,0)"),c.fillStyle=D,c.fillRect(0,0,256,256)}const h=new rl(o);return h.needsUpdate=!0,h}function Zm(){const n=w.useRef(null),i=w.useRef([]),l=w.useMemo(()=>qo.map(o=>typeof document>"u"?null:Km(o.hue,o.saturation)),[]);return Oe((o,c)=>{ce.getState().motionEnabled&&i.current.forEach((f,d)=>{if(!f)return;const p=qo[d];f.material.rotation+=c*p.rotationSpeed;const v=performance.now()*1e-4;f.position.x=p.position[0]+Math.sin(v*(d+1))*6,f.position.y=p.position[1]+Math.cos(v*(d+1))*4})}),S.jsx("group",{ref:n,children:qo.map((o,c)=>{const f=l[c];return f?S.jsx("sprite",{ref:d=>{i.current[c]=d},position:o.position,scale:[o.size,o.size,1],children:S.jsx("spriteMaterial",{map:f,transparent:!0,depthWrite:!1,blending:ri,opacity:.55,toneMapped:!1})},c):null})})}const ku=3,Fu=12e3,qm=24e3,Oc=1500;let Jm=1;function Hu(n){const i=Math.random(),l=Math.random(),o=i*Math.PI*2,c=Math.acos(2*l-1);return new ve(n*Math.sin(c)*Math.cos(o),n*Math.sin(c)*Math.sin(o),n*Math.cos(c))}function $m(){const[n,i]=w.useState([]);return w.useEffect(()=>{let l=!1,o=null;const c=()=>{if(l)return;const f=Fu+Math.random()*(qm-Fu);o=setTimeout(()=>{if(l)return;if(!ce.getState().motionEnabled){c();return}const d=Hu(180),p=Hu(1).multiplyScalar(60).add(d).normalize().multiplyScalar(180);i(v=>{const y=[...v,{id:Jm++,start:d,end:p,spawnedAt:performance.now()}];return y.length>ku?y.slice(y.length-ku):y}),c()},f)};return c(),()=>{l=!0,o&&clearTimeout(o)}},[]),Oe(()=>{const l=performance.now();i(o=>{const c=o.filter(f=>l-f.spawnedAt<Oc+200);return c.length===o.length?o:c})}),S.jsx(S.Fragment,{children:n.map(l=>S.jsx(ev,{spec:l},l.id))})}function ev({spec:n}){const i=w.useRef(null),l=w.useRef(null);return Oe(()=>{const o=(performance.now()-n.spawnedAt)/Oc;if(o>1)return;const c=o*o*(3-2*o),f=new ve().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),p=new ve().lerpVectors(n.start,n.end,d);l.current.position.copy(p),l.current.lookAt(f);const v=l.current.material;v.opacity=(1-o)*.5}}),S.jsxs(S.Fragment,{children:[S.jsxs("mesh",{ref:i,position:n.start,children:[S.jsx("sphereGeometry",{args:[1.4,8,8]}),S.jsx("meshBasicMaterial",{color:"#fff5cf",transparent:!0,opacity:0,toneMapped:!1,blending:ri,depthWrite:!1})]}),S.jsxs("mesh",{ref:l,position:n.start,children:[S.jsx("coneGeometry",{args:[.8,14,6,1,!0]}),S.jsx("meshBasicMaterial",{color:"#fff5cf",transparent:!0,opacity:0,toneMapped:!1,blending:ri,depthWrite:!1})]})]})}const Bc=600,tv=2.4;let nv=1;function rv(){const[n,i]=w.useState([]),l=w.useRef(null);return w.useEffect(()=>ce.subscribe(c=>{const f=c.selectedSessionId,d=l.current;if(f===d||(l.current=f,!f))return;const p=c.sessions[f];if(!p)return;const v=Pr(p.orbitSlot),y=li(p.orbitSlot,p.id,p.projectId),h=Math.cos(y)*v,m=Math.sin(y)*v;i(x=>[...x,{id:nv++,position:[h,0,m],spawnedAt:performance.now()}])}),[]),Oe(()=>{const o=performance.now();i(c=>{const f=c.filter(d=>o-d.spawnedAt<Bc+50);return f.length===c.length?c:f})}),S.jsx(S.Fragment,{children:n.map(o=>S.jsx(iv,{spec:o},o.id))})}function iv({spec:n}){const i=w.useRef(null);return Oe(()=>{if(!i.current)return;const l=(performance.now()-n.spawnedAt)/Bc;if(l>1){i.current.visible=!1;return}const c=(1-Math.pow(1-l,2))*tv;i.current.scale.set(c,c,c);const f=i.current.material;f.opacity=(1-l)*.65}),S.jsxs("mesh",{ref:i,position:n.position,rotation:[-Math.PI/2,0,0],children:[S.jsx("ringGeometry",{args:[.92,1,48]}),S.jsx("meshBasicMaterial",{color:"#a5b4fc",transparent:!0,opacity:.65,toneMapped:!1,depthWrite:!1})]})}const Gu=17;function sv(){const n=ce(Td);return n.length?S.jsx("group",{children:n.map((i,l)=>{const o=l/n.length*Math.PI*2,c=Math.cos(o)*Gu,f=Math.sin(o)*Gu;return S.jsx(ov,{schedule:i,position:[c,0,f]},i.id)})}):null}function ov({schedule:n,position:i}){const l=w.useRef(null);Oe(c=>{const f=c.clock.getElapsedTime(),d=.5+.5*Math.sin(f*Math.PI*2*1.4),p=l.current;if(p){const v=.5+d*.35;p.scale.set(v,v,v);const y=p.material;y.opacity=.45+d*.45}});const o=lv(n.nextRunAt);return S.jsxs("group",{position:i,children:[S.jsxs("mesh",{ref:l,children:[S.jsx("sphereGeometry",{args:[.35,16,16]}),S.jsx("meshBasicMaterial",{color:"#22d3ee",transparent:!0,opacity:.7})]}),S.jsx(oi,{center:!0,distanceFactor:14,style:{pointerEvents:"none",userSelect:"none"},position:[0,.7,0],children:S.jsxs("div",{className:"px-2 py-1 rounded text-[10px] whitespace-nowrap border bg-black/50 border-cyan-300/40 text-cyan-100",children:[S.jsxs("div",{className:"font-semibold flex items-center gap-1",children:[S.jsx("span",{children:"✷"}),S.jsx("span",{children:n.name??n.prompt.slice(0,24)})]}),S.jsxs("div",{className:"opacity-70",children:["every ",n.cron," · next ",o]})]})})]})}function lv(n){const i=n-Date.now();if(i<=0)return"now";const l=Math.round(i/6e4);if(l<60)return`${l}m`;const o=Math.round(l/60);return o<24?`${o}h`:`${Math.round(o/24)}d`}function av(n){const i=li(n.orbitSlot,n.id,n.projectId),l=Pr(n.orbitSlot);return[Math.cos(i)*l,Math.sin(i*.5)*.4,Math.sin(i)*l]}function uv(){const n=ce(pl),i=ce(hl),l=ce(Pd),o=w.useMemo(()=>{if(!l.length)return[];const c=[...n,...i];return l.map(f=>{const d=c.filter(p=>p.currentGoalId===f.id).map(av);return{id:f.id,color:f.color,points:d}}).filter(f=>f.points.length>=2)},[n,i,l]);return o.length?S.jsx("group",{children:o.map(c=>S.jsx(Hp,{points:c.points,color:c.color,lineWidth:1,transparent:!0,opacity:.35,dashed:!1},c.id))}):null}const cv="/textures/milky_way.jpg";function vv(){const n=ce(pl),i=ce(hl),l=ce(p=>p.selectSession),o=ce(p=>p.selectAdvisor),c=ce(p=>p.selectSkill),f=[...n,...i],d=Array.from(new Set(f.map(p=>p.orbitSlot))).sort((p,v)=>p-v);return S.jsxs(xp,{shadows:!1,camera:{position:[16,9,32],fov:55,near:.1,far:600},gl:{toneMapping:Vu,toneMappingExposure:.85},onPointerMissed:()=>{l(null),o(null),c(null)},children:[S.jsx("color",{attach:"background",args:["#05060c"]}),S.jsx("fog",{attach:"fog",args:["#0a0d1f",140,500]}),S.jsx("ambientLight",{intensity:.12}),S.jsx(w.Suspense,{fallback:S.jsx(Xp,{radius:180,depth:80,count:6e3,factor:4,saturation:.4,fade:!0,speed:0}),children:S.jsx(fv,{})}),S.jsx(Zm,{}),S.jsx(Mm,{}),S.jsx($m,{}),S.jsx(gm,{}),S.jsx(Hm,{}),S.jsx(Ym,{}),d.map(p=>S.jsx(Dm,{orbitSlot:p},p)),f.map(p=>S.jsx(Um,{session:p},p.id)),S.jsx(Lm,{}),S.jsx(rv,{}),S.jsx(uv,{}),S.jsx(sv,{}),S.jsx(Xm,{}),S.jsx(dv,{}),S.jsx(dm,{multisampling:4,children:S.jsx(mm,{intensity:.85,luminanceThreshold:.7,luminanceSmoothing:.2,mipmapBlur:!0,radius:.55})})]})}function fv(){const n=w.useRef(null),i=xl(cv);return S.jsxs("mesh",{ref:n,scale:[-1,1,1],children:[S.jsx("sphereGeometry",{args:[400,48,32]}),S.jsx("meshBasicMaterial",{map:i,side:xr,toneMapped:!1})]})}function dv(){const n=w.useRef(null),{camera:i}=ht();return w.useEffect(()=>(Rd(n.current,i),()=>Cd()),[i]),S.jsx(Vp,{ref:n,makeDefault:!0,enablePan:!0,enableZoom:!0,enableRotate:!0,minDistance:6,maxDistance:140,target:[0,0,0]})}export{vv as Scene};
|