1import{a as Uh,r as j,R as No,g as Uc}from"./vendor-DCFBENKy.js";import{R as Gd,O as Ur,P as oi,S as Nc,a as Ll,V as Nh,b as bh,B as kh,N as Jh,A as zh,W as Hd,C as jh,c as $,d as at,e as Kh,L as Gl,f as Qi,U as da,T as Qh,D as va,g as Od,h as Xh,i as mc,j as Ud,k as Yi,l as bc,m as pa,M as Zi,n as Wh,I as Yh,E as Zh,o as wi,p as Si,q as Nf,Q as ha,r as Vh,s as ya,t as kc,u as Gs,F as Nr,v as tr,w as er,x as qh,y as $h,z as em,G as Mn,H as tm,J as nm,K as Nd,X as Ba,Y as rm,Z as ai,_ as im,$ as bd,a0 as sm,a1 as om,a2 as am,a3 as yn,a4 as lm,a5 as Ac,a6 as cm,a7 as hr,a8 as um,a9 as Hl,aa as fm,ab as kd,ac as bi,ad as dm,ae as Jd,af as pm,ag as hm,ah as mm,ai as Am,aj as gm,ak as Ol,al as Jc,am as vm,an as ym,ao as Bm,ap as Cm,aq as zd,ar as ri,as as qn,at as bf,au as kf,av as Jf,aw as gc,ax as Em,ay as qt,az as Ca,aA as jd,aB as Bn,aC as mr,aD as ki,aE as wm,aF as Sm,aG as zf,aH as vc,aI as Mm,aJ as jf,aK as Vi,aL as $n,aM as xm,aN as Ds,aO as Kd,aP as Qd,aQ as ma,aR as Tm,aS as yc,aT as _m,aU as Im,aV as Rm,aW as Fm,aX as Pm,aY as Kf,aZ as Dm,a_ as Lm,a$ as Gm,b0 as Hm,b1 as Om,b2 as Um}from"./three-Dv4K_qkO.js";import{F as Nm,u as bm}from"./konva-L1CHpTsF.js";import{j as zt}from"./ui-DKb32DiD.js";const km="modulepreload",Jm=function(s){return"/"+s},Qf={},iy=function(n,r,i){let o=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.allSettled(r.map(f=>{if(f=Jm(f),f in Qf)return;Qf[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const h=document.createElement("link");if(h.rel=m?"stylesheet":km,m||(h.as="script"),h.crossOrigin="",h.href=f,d&&h.setAttribute("nonce",d),document.head.appendChild(h),m)return new Promise((g,y)=>{h.addEventListener("load",g),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return o.then(l=>{for(const d of l||[])d.status==="rejected"&&c(d.reason);return n().catch(c)})};var Xd,Xf=Uh;Xd=Xf.createRoot,Xf.hydrateRoot;var Wd={exports:{}},Yd={};/** 2 * @license React 3 * use-sync-external-store-shim.production.js 4 * 5 * Copyright (c) Meta Platforms, Inc. and 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 */var Xi=j;function zm(s,n){return s===n&&(s!==0||1/s===1/n)||s!==s&&n!==n}var jm=typeof Object.is=="function"?Object.is:zm,Km=Xi.useState,Qm=Xi.useEffect,Xm=Xi.useLayoutEffect,Wm=Xi.useDebugValue;function Ym(s,n){var r=n(),i=Km({inst:{value:r,getSnapshot:n}}),o=i[0].inst,c=i[1];return Xm(function(){o.value=r,o.getSnapshot=n,Ul(o)&&c({inst:o})},[s,r,n]),Qm(function(){return Ul(o)&&c({inst:o}),s(function(){Ul(o)&&c({inst:o})})},[s]),Wm(r),r}function Ul(s){var n=s.getSnapshot;s=s.value;try{var r=n();return!jm(s,r)}catch{return!0}}function Zm(s,n){return n()}var Vm=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Zm:Ym;Yd.useSyncExternalStore=Xi.useSyncExternalStore!==void 0?Xi.useSyncExternalStore:Vm;Wd.exports=Yd;var qm=Wd.exports;const Wf=s=>{let n;const r=new Set,i=(m,p)=>{const h=typeof m=="function"?m(n):m;if(!Object.is(h,n)){const g=n;n=p??(typeof h!="object"||h===null)?h:Object.assign({},n,h),r.forEach(y=>y(n,g))}},o=()=>n,d={setState:i,getState:o,getInitialState:()=>f,subscribe:m=>(r.add(m),()=>r.delete(m))},f=n=s(i,o,d);return d},$m=s=>s?Wf(s):Wf,eA=s=>s;function tA(s,n=eA){const r=No.useSyncExternalStore(s.subscribe,No.useCallback(()=>n(s.getState()),[s,n]),No.useCallback(()=>n(s.getInitialState()),[s,n]));return No.useDebugValue(r),r}const Yf=s=>{const n=$m(s),r=i=>tA(n,i);return Object.assign(r,n),r},sy=s=>s?Yf(s):Yf;function nA(s,n){let r;try{r=s()}catch{return}return{getItem:o=>{var c;const l=f=>f===null?null:JSON.parse(f,void 0),d=(c=r.getItem(o))!=null?c:null;return d instanceof Promise?d.then(l):l(d)},setItem:(o,c)=>r.setItem(o,JSON.stringify(c,void 0)),removeItem:o=>r.removeItem(o)}}const Bc=s=>n=>{try{const r=s(n);return r instanceof Promise?r:{then(i){return Bc(i)(r)},catch(i){return this}}}catch(r){return{then(i){return this},catch(i){return Bc(i)(r)}}}},rA=(s,n)=>(r,i,o)=>{let c={storage:nA(()=>localStorage),partialize:T=>T,version:0,merge:(T,S)=>({...S,...T}),...n},l=!1;const d=new Set,f=new Set;let m=c.storage;if(!m)return s((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${c.name}', the given storage is currently unavailable.`),r(...T)},i,o);const p=()=>{const T=c.partialize({...i()});return m.setItem(c.name,{state:T,version:c.version})},h=o.setState;o.setState=(T,S)=>(h(T,S),p());const g=s((...T)=>(r(...T),p()),i,o);o.getInitialState=()=>g;let y;const C=()=>{var T,S;if(!m)return;l=!1,d.forEach(w=>{var M;return w((M=i())!=null?M:g)});const E=((S=c.onRehydrateStorage)==null?void 0:S.call(c,(T=i())!=null?T:g))||void 0;return Bc(m.getItem.bind(m))(c.name).then(w=>
vendor: 29,878 bytes, lines 9-37
9{if(w)if(typeof w.version=="number"&&w.version!==c.version){if(c.migrate){const M=c.migrate(w.state,w.version);return M instanceof Promise?M.then(I=>[!0,I]):[!0,M]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var M;const[I,_]=w;if(y=c.merge(_,(M=i())!=null?M:g),r(y,!0),I)return p()}).then(()=>{E==null||E(y,void 0),y=i(),l=!0,f.forEach(w=>w(y))}).catch(w=>{E==null||E(void 0,w)})};return o.persist={setOptions:T=>{c={...c,...T},T.storage&&(m=T.storage)},clearStorage:()=>{m==null||m.removeItem(c.name)},getOptions:()=>c,rehydrate:()=>C(),hasHydrated:()=>l,onHydrate:T=>(d.add(T),()=>{d.delete(T)}),onFinishHydration:T=>(f.add(T),()=>{f.delete(T)})},c.skipHydration||C(),y||g},oy=rA;var Zd={exports:{}},ci={};/** 10 * @license React 11 * react-reconciler-constants.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 */ci.ConcurrentRoot=1;ci.ContinuousEventPriority=4;ci.DefaultEventPriority=16;ci.DiscreteEventPriority=1;ci.IdleEventPriority=536870912;ci.LegacyRoot=0;Zd.exports=ci;var Ji=Zd.exports;function iA(s){let n;const r=new Set,i=(m,p)=>{const h=typeof m=="function"?m(n):m;if(h!==n){const g=n;n=p?h:Object.assign({},n,h),r.forEach(y=>y(n,g))}},o=()=>n,c=(m,p=o,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let g=p(n);function y(){const C=p(n);if(!h(g,C)){const T=g;m(g=C,T)}}return r.add(y),()=>r.delete(y)},f={setState:i,getState:o,subscribe:(m,p,h)=>p||h?c(m,p,h):(r.add(m),()=>r.delete(m)),destroy:()=>r.clear()};return n=s(i,o,f),f}const sA=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Zf=sA?j.useEffect:j.useLayoutEffect;function Vd(s){const n=typeof s=="function"?iA(s):s,r=(i=n.getState,o=Object.is)=>{const[,c]=j.useReducer(S=>S+1,0),l=n.getState(),d=j.useRef(l),f=j.useRef(i),m=j.useRef(o),p=j.useRef(!1),h=j.useRef();h.current===void 0&&(h.current=i(l));let g,y=!1;(d.current!==l||f.current!==i||m.current!==o||p.current)&&(g=i(l),y=!o(h.current,g)),Zf(()=>{y&&(h.current=g),d.current=l,f.current=i,m.current=o,p.current=!1});const C=j.useRef(l);Zf(()=>{const S=()=>{try{const w=n.getState(),M=f.current(w);m.current(h.current,M)||(d.current=w,h.current=M,c())}catch{p.current=!0,c()}},E=n.subscribe(S);return n.getState()!==C.current&&S(),E},[]);const T=y?g:h.current;return j.useDebugValue(T),T};return Object.assign(r,n),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[r,n];return{next(){const o=i.length<=0;return{value:i.shift(),done:o}}}},r}const oA=s=>typeof s=="object"&&typeof s.then=="function",ii=[];function qd(s,n,r=(i,o)=>i===o){if(s===n)return!0;if(!s||!n)return!1;const i=s.length;if(n.length!==i)return!1;for(let o=0;o<i;o++)if(!r(s[o],n[o]))return!1;return!0}function $d(s,n=null,r=!1,i={}){n===null&&(n=[s]);for(const c of ii)if(qd(n,c.keys,c.equal)){if(r)return;if(Object.prototype.hasOwnProperty.call(c,"error"))throw c.error;if(Object.prototype.hasOwnProperty.call(c,"response"))return i.lifespan&&i.lifespan>0&&(c.timeout&&clearTimeout(c.timeout),c.timeout=setTimeout(c.remove,i.lifespan)),c.response;if(!r)throw c.promise}const o={keys:n,equal:i.equal,remove:()=>{const c=ii.indexOf(o);c!==-1&&ii.splice(c,1)},promise:(oA(s)?s:s(...n)).then(c=>{o.response=c,i.lifespan&&i.lifespan>0&&(o.timeout=setTimeout(o.remove,i.lifespan))}).catch(c=>o.error=c)};if(ii.push(o),!r)throw o.promise}const aA=(s,n,r)=>$d(s,n,!1,r),lA=(s,n,r)=>void $d(s,n,!0,r),cA=s=>{if(s===void 0||s.length===0)ii.splice(0,ii.length);else{const n=ii.find(r=>qd(s,r.keys,r.equal));n&&n.remove()}};var ep={exports:{}},tp={exports:{}},np={};/** 18 * @license React 19 * scheduler.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 */(function(s){function n(V,fe){var q=V.length;V.push(fe);e:for(;0<q;){var ge=q-1>>>1,he=V[ge];if(0<o(he,fe))V[ge]=fe,V[q]=he,q=ge;else break e}}function r(V){return V.length===0?null:V[0]}function i(V){if(V.length===0)return null;var fe=V[0],q=V.pop();if(q!==fe){V[0]=q;e:for(var ge=0,he=V.length,ve=he>>>1;ge<ve;){var ze=2*(ge+1)-1,nt=V[ze],Te=ze+1,pt=V[Te];if(0>o(nt,q))Te<he&&0>o(pt,nt)?(V[ge]=pt,V[Te]=q,ge=Te):(V[ge]=nt,V[ze]=q,ge=ze);else if(Te<he&&0>o(pt,q))V[ge]=pt,V[Te]=q,ge=Te;else break e}}return fe}function o(V,fe){var q=V.sortIndex-fe.sortIndex;return q!==0?q:V.id-fe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;s.unstable_now=function(){return c.now()}}else{var l=Date,d=l.now();s.unstable_now=function(){return l.now()-d}}var f=[],m=[],p=1,h=null,g=3,y=!1,C=!1,T=!1,S=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(V){for(var fe=r(m);fe!==null;){if(fe.callback===null)i(m);else if(fe.startTime<=V)i(m),fe.sortIndex=fe.expirationTime,n(f,fe);else break;fe=r(m)}}function I(V){if(T=!1,M(V),!C)if(r(f)!==null)C=!0,ue(_);else{var fe=r(m);fe!==null&&Me(I,fe.startTime-V)}}function _(V,fe){C=!1,T&&(T=!1,E(P),P=-1),y=!0;var q=g;try{for(M(fe),h=r(f);h!==null&&(!(h.expirationTime>fe)||V&&!b());){var ge=h.callback;if(typeof ge=="function"){h.callback=null,g=h.priorityLevel;var he=ge(h.expirationTime<=fe);fe=s.unstable_now(),typeof he=="function"?h.callback=he:h===r(f)&&i(f),M(fe)}else i(f);h=r(f)}if(h!==null)var ve=!0;else{var ze=r(m);ze!==null&&Me(I,ze.startTime-fe),ve=!1}return ve}finally{h=null,g=q,y=!1}}var F=!1,G=null,P=-1,D=5,O=-1;function b(){return!(s.unstable_now()-O<D)}function k(){if(G!==null){var V=s.unstable_now();O=V;var fe=!0;try{fe=G(!0,V)}finally{fe?Y():(F=!1,G=null)}}else F=!1}var Y;if(typeof w=="function")Y=function(){w(k)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,se=Z.port2;Z.port1.onmessage=k,Y=function(){se.postMessage(null)}}else Y=function(){S(k,0)};function ue(V){G=V,F||(F=!0,Y())}function Me(V,fe){P=S(function(){V(s.unstable_now())},fe)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(V){V.callback=null},s.unstable_continueExecution=function(){C||y||(C=!0,ue(_))},s.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<V?Math.floor(1e3/V):5},s.unstable_getCurrentPriorityLevel=function(){return g},s.unstable_getFirstCallbackNode=function(){return r(f)},s.unstable_next=function(V){switch(g){case 1:case 2:case 3:var fe=3;break;default:fe=g}var q=g;g=fe;try{return V()}finally{g=q}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(V,fe){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var q=g;g=V;try{return fe()}finally{g=q}},s.unstable_scheduleCallback=function(V,fe,q){var ge=s.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?ge+q:ge):q=ge,V){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=q+he,V={id:p++,callback:fe,priorityLevel:V,startTime:q,expirationTime:he,sortIndex:-1},q>ge?(V.sortIndex=q,n(m,V),r(f)===null&&V===r(m)&&(T?(E(P),P=-1):T=!0,Me(I,q-ge))):(V.sortIndex=he,n(f,V),C||y||(C=!0,ue(_))),V},s.unstable_shouldYield=b,s.unstable_wrapCallback=function(V){var fe=g;return function(){var q=g;g=fe;try{return V.apply(this,arguments)}finally{g=q}}}})(np);tp.exports=np;var Cc=tp.exports;/** 26 * @license React 27 * react-reconciler.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var uA=function(n){var r={},i=j,o=Cc,c=Object.assign;function l(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);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 d=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),m=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),C=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),_=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=_&&e[_]||e["@@iterator"],typeof e=="function"?e:null)}function G(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case m:return"Portal";case g:return"Profiler";case h:return"StrictMode";case S:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case y:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case w:return t=e.displayName||null,t!==null?t:G(e.type)||"Memo";case M:t=e._payload,e=e._init;try{return G(e(t))}catch{}}return null}function P(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 G(t);case 8:return t===h?"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 D(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function O(e){if(D(e)!==e)throw Error(l(188))}function b(e){var t=e.alternate;if(!t){if(t=D(e),t===null)throw Error(l(188));return t!==e?null:e}for(var a=e,u=t;;){var A=a.return;if(A===null)break;var v=A.alternate;if(v===null){if(u=A.return,u!==null){a=u;continue}break}if(A.child===v.child){for(v=A.child;v;){if(v===a)return O(A),e;if(v===u)return O(A),t;v=v.sibling}throw Error(l(188))}if(a.return!==u.return)a=A,u=v;else{for(var R=!1,H=A.child;H;){if(H===a){R=!0,a=A,u=v;break}if(H===u){R=!0,u=A,a=v;break}H=H.sibling}if(!R){for(H=v.child;H;){if(H===a){R=!0,a=v,u=A;break}if(H===u){R=!0,u=v,a=A;break}H=H.sibling}if(!R)throw Error(l(189))}}if(a.alternate!==u)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?e:t}function k(e){return e=b(e),e!==null?Y(e):null}function Y(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Y(e);if(t!==null)return t;e=e.sibling}return null}function Z(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){if(e.tag!==4){var t=Z(e);if(t!==null)return t}e=e.sibling}return null}var se=Array.isArray,ue=n.getPublicInstance,Me=n.getRootHostContext,V=n.getChildHostContext,fe=n.prepareForCommit,q=n.resetAfterCommit,ge=n.createInstance,he=n.appendInitialChild,ve=n.finalizeInitialChildren,ze=n.prepareUpdate,nt=n.shouldSetTextContent,Te=n.createTextInstance,pt=n.scheduleTimeout,mt=n.cancelTimeout,Gn=n.noTimeout,ut=n.isPrimaryRenderer,Fe=n.supportsMutation,Tt=n.supportsPersistence,Ye=n.supportsHydration,$t=n.getInstanceFromNode,_n=n.preparePortalMount,kr=n.getCurrentEventPriority,Kt=n.detachDeletedInstance,nr=n.supportsMicrotasks,Hn=n.scheduleMicrotask,an=n.supportsTestSelectors,Jr=n.findFiberRoot,vr=n.getBoundingRect,On=n.getTextContent,Nt=n.isHiddenSubtree,rr=n.matchAccessibilityRole,zr=n.setFocusIfFocusable,Qt=n.setupIntersectionObserver,yr=n.appendChild,Br=n.appendChildToContainer,es=n.commitTextUpdate,ui=n.commitMount,ts=n.commitUpdate,ir=n.insertBefore,Bt=n.insertInContainerBefore,Cr=n.removeChild,N=n.removeChildFromContainer,te=n.resetTextContent,me=n.hideInstance,Ne=n.hideTextInstance,ie=n.unhideInstance,_t=n.unhideTextInstance,ln=n.clearContainer,js=n.cloneInstance,jr=n.createContainerChildSet,Xt=n.appendChildToContainerChildSet,en=n.finalizeContainerChildren,Un=n.replaceContainerChildren,Nn=n.cloneHiddenInstance,bn=n.cloneHiddenTextInstance,Er=n.canHydrateInstance,Ta=n.canHydrateTextInstance,_a=n.canHydrateSuspenseInstance,Kr=n.isSuspenseInstancePending,ns=n.isSuspenseInstanceFallback,Qr=n.registerSuspenseInstanceRetry,In=n.getNextHydratableSibling,Oe=n.getFirstHydratableChild,Ks=n.getFirstHydratableChildWithinContainer,Ia=n.getFirstHydratableChildWithinSuspenseInstance,B=n.hydrateInstance,x=n.hydrateTextInstance,L=n.hydrateSuspenseInstance,z=n.getNextHydratableInstanceAfterSuspenseInstance,Q=n.commitHydratedContainer,X=n.commitHydratedSuspenseInstance,ne=n.clearSuspenseBoundary,ee=n.clearSuspenseBoundaryFromContainer,le=n.shouldDeleteUnhydratedTailInstances,ae=n.didNotMatchHydratedContainerTextInstance,ce=n.didNotMatchHydratedTextInstance,oe;function Ze(e){if(oe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||""}return` 34`+oe+e}var ye=!1;function Ce(e,t){if(!e||ye)return"";ye=!0;var a=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(re){var u=re}Reflect.construct(e,[],t)}else{try{t.call()}catch(re){u=re}e.call(t.prototype)}else{try{throw Error()}catch(re){u=re}e()}}catch(re){if(re&&u&&typeof re.stack=="string"){for(var A=re.stack.split(` 35`),v=u.stack.split(` 36`),R=A.length-1,H=v.length-1;1<=R&&0<=H&&A[R]!==v[H];)H--;for(;1<=R&&0<=H;R--,H--)if(A[R]!==v[H]){if(R!==1||H!==1)do if(R--,H--,0>H||A[R]!==v[H]){var W=` 37`+A[R].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=R&&0<=H);break}}}finally{ye=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Ze(e):""}var _e=Object.prototype.hasOwnProperty,Pe=[],Je=-1;function be(e){return{current:e}}function xe(e){0>Je||(e.current=Pe[Je],Pe[Je]=null,Je--)}function De(e,t){Je++,Pe[Je]=e.current,e.current=t}var ke={},qe=be(ke),Le=be(!1),et=ke;function Lt(e,t){var a=e.type.contextTypes;if(!a)return ke;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===t)return u.__reactInternalMemoizedMaskedChildContext;var A={},v;for(v in a)A[v]=t[v];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=A),A}function At(e){return e=e.childContextTypes,e!=null}function It(){xe(Le),xe(qe)}function We(e,t,a){if(qe.current!==ke)throw Error(l(168));De(qe,t),De(Le,a)}function Ct(e,t,a){var u=e.stateNode;if(t=t.childContextTypes,typeof u.getChildContext!="function")return a;u=u.getChildContext();for(var A in u)if(!(A in t))throw Error(l(108,P(e)||"Unknown",A));return c({},a,u)}function Ve(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ke,et=qe.current,De(qe,e),De(Le,Le.current),!0}function je(e,t,a){var u=e.stateNode;if(!u)throw Error(l(169));a?(e=Ct(e,t,et),u.__reactInternalMemoizedMergedChildContext=e,xe(Le),xe(qe),De(qe,e)):xe(Le),De(Le,a)}var st=Math.clz32?Math.clz32:kn,sr=Math.log,bt=Math.LN2;function kn(e){return e>>>=0,e===0?32:31-(sr(e)/bt|0)|0}var Qs=64,Xs=4194304;function rs(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 Ws(e,t){var a=e.pendingLanes;if(a===0)return 0;var u=0,A=e.suspendedLanes,v=e.pingedLanes,R=a&268435455;if(R!==0){var H=R&~A;H!==0?u=rs(H):(v&=R,v!==0&&(u=rs(v)))}else R=a&~A,R!==0?u=rs(R):v!==0&&(u=rs(v));if(u===0)return 0;if(t!==0&&t!==u&&!(t&A)&&(A=u&-u,v=t&-t,A>=v||A===16&&(v&4194240)!==0))return t;if(u&4&&(u|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=u;0<t;)a=31-st(t),A=1<<a,u|=e[a],t&=~A;return u}function Zp(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 Vp(e,t){for(var a=e.suspendedLanes,u=e.pingedLanes,A=e.expirationTimes,v=e.pendingLanes;0<v;){var R=31-st(v),H=1<<R,W=A[R];W===-1?(!(H&a)||H&u)&&(A[R]=Zp(H,t)):W<=t&&(e.expiredLanes|=H),v&=~H}}function Ra(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fa(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function is(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-st(t),e[t]=a}function qp(e,t){var a=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 u=e.eventTimes;for(e=e.expirationTimes;0<a;){var A=31-st(a),v=1<<A;t[A]=0,u[A]=-1,e[A]=-1,a&=~v}}function Pa(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var u=31-st(a),A=1<<u;A&t|e[u]&t&&(e[u]|=t),a&=~A}}var Ke=0;function au(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Da=o.unstable_scheduleCallback,lu=o.unstable_cancelCallback,$p=o.unstable_shouldYield,eh=o.unstable_requestPaint,St=o.unstable_now,La=o.unstable_ImmediatePriority,th=o.unstable_UserBlockingPriority,Ga=o.unstable_NormalPriority,nh=o.unstable_IdlePriority,Ys=null,Jn=null;function rh(e){if(Jn&&typeof Jn.onCommitFiberRoot=="function")try{Jn.onCommitFiberRoot(Ys,e,void 0,(e.current.flags&128)===128)}catch{}}function ih(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zn=typeof Object.is=="function"?Object.is:ih,or=null,Zs=!1,Ha=!1;function cu(e){or===null?or=[e]:or.push(e)}function sh(e){Zs=!0,cu(e)}function jn(){if(!Ha&&or!==null){Ha=!0;var e=0,t=Ke;try{var a=or;for(Ke=1;e<a.length;e++){var u=a[e];do u=u(!0);while(u!==null)}or=null,Zs=!1}catch(A){throw or!==null&&(or=or.slice(e+1)),Da(La,jn),A}finally{Ke=t,Ha=!1}}return null}var oh=d.ReactCurrentBatchConfig;function Vs(e,t){if(zn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),u=Object.keys(t);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var A=a[u];if(!_e.call(t,A)||!zn(e[A],t[A]))return!1}return!0}function ah(e){switch(e.tag){case 5:return Ze(e.type);case 16:return Ze("Lazy");case 13:return Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 2:case 15:return e=Ce(e.type,!1),e;case 11:return e=Ce(e.type.render,!1),e;case 1:return e=Ce(e.type,!0),e;default:return""}}function Rn(e,t){if(e&&e.defaultProps){t=c({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}var qs=be(null),$s=null,fi=null,Oa=null;function Ua(){Oa=fi=$s=null}function uu(e,t,a){ut?(De(qs,t._currentValue),t._currentValue=a):(De(qs,t._currentValue2),t._currentValue2=a)}function Na(e){var t=qs.current;xe(qs),ut?e._currentValue=t:e._currentValue2=t}function ba(e,t,a){for(;e!==null;){var u=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,u!==null&&(u.childLanes|=t)):u!==null&&(u.childLanes&t)!==t&&(u.childLanes|=t),e===a)break;e=e.return}}function di(e,t){$s=e,Oa=fi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rn=!0),e.firstContext=null)}function cn(e){var t=ut?e._currentValue:e._currentValue2;if(Oa!==e)if(e={context:e,memoizedValue:t,next:null},fi===null){if($s===null)throw Error(l(308));fi=e,$s.dependencies={lanes:0,firstContext:e}}else fi=fi.next=e;return t}var Kn=null,wr=!1;function ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fu(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 ar(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Sr(e,t){var a=e.updateQueue;a!==null&&(a=a.shared,gt!==null&&e.mode&1&&!(He&2)?(e=a.interleaved,e===null?(t.next=t,Kn===null?Kn=[a]:Kn.push(a)):(t.next=e.next,e.next=t),a.interleaved=t):(e=a.pending,e===null?t.next=t:(t.next=e.next,e.next=t),a.pending=t))}function eo(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var u=t.lanes;u&=e.pendingLanes,a|=u,t.lanes=a,Pa(e,a)}}function du(e,t){var a=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var A=null,v=null;if(a=a.firstBaseUpdate,a!==null){do{var R={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};v===null?A=v=R:v=v.next=R,a=a.next}while(a!==null);v===null?A=v=t:v=v.next=t}else A=v=t;a={baseState:u.baseState,firstBaseUpdate:A,lastBaseUpdate:v,shared:u.shared,effects:u.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function to(e,t,a,u){var A=e.updateQueue;wr=!1;var v=A.firstBaseUpdate,R=A.lastBaseUpdate,H=A.shared.pending;if(H!==null){A.shared.pending=null;var W=H,re=W.next;W.next=null,R===null?v=re:R.next=re,R=W;var Ae=e.alternate;Ae!==null&&(Ae=Ae.updateQueue,H=Ae.lastBaseUpdate,H!==R&&(H===null?Ae.firstBaseUpdate=re:H.next=re,Ae.lastBaseUpdate=W))}if(v!==null){var Ie=A.baseState;R=0,Ae=re=W=null,H=v;do{var we=H.lane,$e=H.eventTime;if((u&we)===we){Ae!==null&&(Ae=Ae.next={eventTime:$e,lane:0,tag:H.tag,payload:H.payload,callback:H.callback,next:null});e:{var Ee=e,Ut=H;switch(we=t,$e=a,Ut.tag){case 1:if(Ee=Ut.payload,typeof Ee=="function"){Ie=Ee.call($e,Ie,we);break e}Ie=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Ut.payload,we=typeof Ee=="function"?Ee.call($e,Ie,we):Ee,we==null)break e;Ie=c({},Ie,we);break e;case 2:wr=!0}}H.callback!==null&&H.lane!==0&&(e.flags|=64,we=A.effects,we===null?A.effects=[H]:we.push(H))}else $e={eventTime:$e,lane:we,tag:H.tag,payload:H.payload,callback:H.callback,next:null},Ae===null?(re=Ae=$e,W=Ie):Ae=Ae.next=$e,R|=we;if(H=H.next,H===null){if(H=A.shared.pending,H===null)break;we=H,H=we.next,we.next=null,A.lastBaseUpdate=we,A.shared.pending=null}}while(!0);if(Ae===null&&(W=Ie),A.baseState=W,A.firstBaseUpdate=re,A.lastBaseUpdate=Ae,t=A.shared.interleaved,t!==null){A=t;do R|=A.lane,A=A.next;while(A!==t)}else v===null&&(A.shared.lanes=0);Ci|=R,e.lanes=R,e.memoizedState=Ie}}function pu(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var u=e[t],A=u.callback;if(A!==null){if(u.callback=null,u=a,typeof A!="function")throw Error(l(191,A));A.call(u)}}}var hu=new i.Component().refs;function Ja(e,t,a,u){t=e.memoizedState,a=a(u,t),a=a==null?t:c({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var no={isMounted:function(e){return(e=e._reactInternals)?D(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var u=Jt(),A=Tr(e),v=ar(u,A);v.payload=t,a!=null&&(v.callback=a),Sr(e,v),t=hn(e,A,u),t!==null&&eo(t,e,A)},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var u=Jt(),A=Tr(e),v=ar(u,A);v.tag=1,v.payload=t,a!=null&&(v.callback=a),Sr(e,v),t=hn(e,A,u),t!==null&&eo(t,e,A)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Jt(),u=Tr(e),A=ar(a,u);A.tag=2,t!=null&&(A.callback=t),Sr(e,A),t=hn(e,u,a),t!==null&&eo(t,e,u)}};function mu(e,t,a,u,A,v,R){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,v,R):t.prototype&&t.prototype.isPureReactComponent?!Vs(a,u)||!Vs(A,v):!0}function Au(e,t,a){var u=!1,A=ke,v=t.contextType;return typeof v=="object"&&v!==null?v=cn(v):(A=At(t)?et:qe.current,u=t.contextTypes,v=(u=u!=null)?Lt(e,A):ke),t=new t(a,v),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=no,e.stateNode=t,t._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=A,e.__reactInternalMemoizedMaskedChildContext=v),t}function gu(e,t,a,u){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,u),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,u),t.state!==e&&no.enqueueReplaceState(t,t.state,null)}function za(e,t,a,u){var A=e.stateNode;A.props=a,A.state=e.memoizedState,A.refs=hu,ka(e);var v=t.contextType;typeof v=="object"&&v!==null?A.context=cn(v):(v=At(t)?et:qe.current,A.context=Lt(e,v)),A.state=e.memoizedState,v=t.getDerivedStateFromProps,typeof v=="function"&&(Ja(e,t,v,a),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&&no.enqueueReplaceState(A,A.state,null),to(e,a,A,u),A.state=e.memoizedState),typeof A.componentDidMount=="function"&&(e.flags|=4194308)}var pi=[],hi=0,ro=null,io=0,un=[],fn=0,Xr=null,lr=1,cr="";function Wr(e,t){pi[hi++]=io,pi[hi++]=ro,ro=e,io=t}function vu(e,t,a){un[fn++]=lr,un[fn++]=cr,un[fn++]=Xr,Xr=e;var u=lr;e=cr;var A=32-st(u)-1;u&=~(1<<A),a+=1;var v=32-st(t)+A;if(30<v){var R=A-A%5;v=(u&(1<<R)-1).toString(32),u>>=R,A-=R,lr=1<<32-st(t)+A|a<<A|u,cr=v+e}else lr=1<<v|a<<A|u,cr=e}function ja(e){e.return!==null&&(Wr(e,1),vu(e,1,0))}function Ka(e){for(;e===ro;)ro=pi[--hi],pi[hi]=null,io=pi[--hi],pi[hi]=null;for(;e===Xr;)Xr=un[--fn],un[fn]=null,cr=un[--fn],un[fn]=null,lr=un[--fn],un[fn]=null}var tn=null,nn=null,ot=!1,ss=!1,Fn=null;function yu(e,t){var a=mn(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function Bu(e,t){switch(e.tag){case 5:return t=Er(t,e.type,e.pendingProps),t!==null?(e.stateNode=t,tn=e,nn=Oe(t),!0):!1;case 6:return t=Ta(t,e.pendingProps),t!==null?(e.stateNode=t,tn=e,nn=null,!0):!1;case 13:if(t=_a(t),t!==null){var a=Xr!==null?{id:lr,overflow:cr}:null;return e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=mn(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,tn=e,nn=null,!0}return!1;default:return!1}}function Qa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xa(e){if(ot){var t=nn;if(t){var a=t;if(!Bu(e,t)){if(Qa(e))throw Error(l(418));t=In(a);var u=tn;t&&Bu(e,t)?yu(u,a):(e.flags=e.flags&-4097|2,ot=!1,tn=e)}}else{if(Qa(e))throw Error(l(418));e.flags=e.flags&-4097|2,ot=!1,tn=e}}}function Cu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;tn=e}function os(e){if(!Ye||e!==tn)return!1;if(!ot)return Cu(e),ot=!0,!1;if(e.tag!==3&&(e.tag!==5||le(e.type)&&!nt(e.type,e.memoizedProps))){var t=nn;if(t){if(Qa(e)){for(e=nn;e;)e=In(e);throw Error(l(418))}for(;t;)yu(e,t),t=In(t)}}if(Cu(e),e.tag===13){if(!Ye)throw Error(l(316));if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));nn=z(e)}else nn=tn?In(e.stateNode):null;return!0}function mi(){Ye&&(nn=tn=null,ss=ot=!1)}function Wa(e){Fn===null?Fn=[e]:Fn.push(e)}function as(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(l(309));var u=a.stateNode}if(!u)throw Error(l(147,e));var A=u,v=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===v?t.ref:(t=function(R){var H=A.refs;H===hu&&(H=A.refs={}),R===null?delete H[v]:H[v]=R},t._stringRef=v,t)}if(typeof e!="string")throw Error(l(284));if(!a._owner)throw Error(l(290,e))}return e}function so(e,t){throw e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Eu(e){var t=e._init;return t(e._payload)}function wu(e){function t(J,U){if(e){var K=J.deletions;K===null?(J.deletions=[U],J.flags|=16):K.push(U)}}function a(J,U){if(!e)return null;for(;U!==null;)t(J,U),U=U.sibling;return null}function u(J,U){for(J=new Map;U!==null;)U.key!==null?J.set(U.key,U):J.set(U.index,U),U=U.sibling;return J}function A(J,U){return J=Ir(J,U),J.index=0,J.sibling=null,J}function v(J,U,K){return J.index=K,e?(K=J.alternate,K!==null?(K=K.index,K<U?(J.flags|=2,U):K):(J.flags|=2,U)):(J.flags|=1048576,U)}function R(J){return e&&J.alternate===null&&(J.flags|=2),J}function H(J,U,K,pe){return U===null||U.tag!==6?(U=Fl(K,J.mode,pe),U.return=J,U):(U=A(U,K),U.return=J,U)}function W(J,U,K,pe){var Be=K.type;
vendor: 1,482 bytes, line 37
37return Be===p?Ae(J,U,K.props.children,pe,K.key):U!==null&&(U.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===M&&Eu(Be)===U.type)?(pe=A(U,K.props),pe.ref=as(J,U,K),pe.return=J,pe):(pe=Oo(K.type,K.key,K.props,null,J.mode,pe),pe.ref=as(J,U,K),pe.return=J,pe)}function re(J,U,K,pe){return U===null||U.tag!==4||U.stateNode.containerInfo!==K.containerInfo||U.stateNode.implementation!==K.implementation?(U=Pl(K,J.mode,pe),U.return=J,U):(U=A(U,K.children||[]),U.return=J,U)}function Ae(J,U,K,pe,Be){return U===null||U.tag!==7?(U=ti(K,J.mode,pe,Be),U.return=J,U):(U=A(U,K),U.return=J,U)}function Ie(J,U,K){if(typeof U=="string"&&U!==""||typeof U=="number")return U=Fl(""+U,J.mode,K),U.return=J,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case f:return K=Oo(U.type,U.key,U.props,null,J.mode,K),K.ref=as(J,null,U),K.return=J,K;case m:return U=Pl(U,J.mode,K),U.return=J,U;case M:var pe=U._init;return Ie(J,pe(U._payload),K)}if(se(U)||F(U))return U=ti(U,J.mode,K,null),U.return=J,U;so(J,U)}return null}function we(J,U,K,pe){var Be=U!==null?U.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return Be!==null?null:H(J,U,""+K,pe);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case f:return K.key===Be?W(J,U,K,pe):null;case m:return K.key===Be?re(J,U,K,pe):null;case M:return Be=K._init,we(J,U,Be(K._payload),pe)}if(se(K)||F(K))return Be!==null?null:Ae(J,U,K,pe,null);so(J,K)}return null}function $e(J,U,K,pe,Be){if(typeof pe=="string"&&pe!==""||typeof pe
vendor: 92,844 bytes, lines 37-43
37=="number")return J=J.get(K)||null,H(U,J,""+pe,Be);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case f:return J=J.get(pe.key===null?K:pe.key)||null,W(U,J,pe,Be);case m:return J=J.get(pe.key===null?K:pe.key)||null,re(U,J,pe,Be);case M:var Ge=pe._init;return $e(J,U,K,Ge(pe._payload),Be)}if(se(pe)||F(pe))return J=J.get(K)||null,Ae(U,J,pe,Be,null);so(U,pe)}return null}function Ee(J,U,K,pe){for(var Be=null,Ge=null,Re=U,Qe=U=0,xt=null;Re!==null&&Qe<K.length;Qe++){Re.index>Qe?(xt=Re,Re=null):xt=Re.sibling;var Xe=we(J,Re,K[Qe],pe);if(Xe===null){Re===null&&(Re=xt);break}e&&Re&&Xe.alternate===null&&t(J,Re),U=v(Xe,U,Qe),Ge===null?Be=Xe:Ge.sibling=Xe,Ge=Xe,Re=xt}if(Qe===K.length)return a(J,Re),ot&&Wr(J,Qe),Be;if(Re===null){for(;Qe<K.length;Qe++)Re=Ie(J,K[Qe],pe),Re!==null&&(U=v(Re,U,Qe),Ge===null?Be=Re:Ge.sibling=Re,Ge=Re);return ot&&Wr(J,Qe),Be}for(Re=u(J,Re);Qe<K.length;Qe++)xt=$e(Re,J,Qe,K[Qe],pe),xt!==null&&(e&&xt.alternate!==null&&Re.delete(xt.key===null?Qe:xt.key),U=v(xt,U,Qe),Ge===null?Be=xt:Ge.sibling=xt,Ge=xt);return e&&Re.forEach(function(Rr){return t(J,Rr)}),ot&&Wr(J,Qe),Be}function Ut(J,U,K,pe){var Be=F(K);if(typeof Be!="function")throw Error(l(150));if(K=Be.call(K),K==null)throw Error(l(151));for(var Ge=Be=null,Re=U,Qe=U=0,xt=null,Xe=K.next();Re!==null&&!Xe.done;Qe++,Xe=K.next()){Re.index>Qe?(xt=Re,Re=null):xt=Re.sibling;var Rr=we(J,Re,Xe.value,pe);if(Rr===null){Re===null&&(Re=xt);break}e&&Re&&Rr.alternate===null&&t(J,Re),U=v(Rr,U,Qe),Ge===null?Be=Rr:Ge.sibling=Rr,Ge=Rr,Re=xt}if(Xe.done)return a(J,Re),ot&&Wr(J,Qe),Be;if(Re===null){for(;!Xe.done;Qe++,Xe=K.next())Xe=Ie(J,Xe.value,pe),Xe!==null&&(U=v(Xe,U,Qe),Ge===null?Be=Xe:Ge.sibling=Xe,Ge=Xe);return ot&&Wr(J,Qe),Be}for(Re=u(J,Re);!Xe.done;Qe++,Xe=K.next())Xe=$e(Re,J,Qe,Xe.value,pe),Xe!==null&&(e&&Xe.alternate!==null&&Re.delete(Xe.key===null?Qe:Xe.key),U=v(Xe,U,Qe),Ge===null?Be=Xe:Ge.sibling=Xe,Ge=Xe);return e&&Re.forEach(function(Oh){return t(J,Oh)}),ot&&Wr(J,Qe),Be}function An(J,U,K,pe){if(typeof K=="object"&&K!==null&&K.type===p&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case f:e:{for(var Be=K.key,Ge=U;Ge!==null;){if(Ge.key===Be){if(Be=K.type,Be===p){if(Ge.tag===7){a(J,Ge.sibling),U=A(Ge,K.props.children),U.return=J,J=U;break e}}else if(Ge.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===M&&Eu(Be)===Ge.type){a(J,Ge.sibling),U=A(Ge,K.props),U.ref=as(J,Ge,K),U.return=J,J=U;break e}a(J,Ge);break}else t(J,Ge);Ge=Ge.sibling}K.type===p?(U=ti(K.props.children,J.mode,pe,K.key),U.return=J,J=U):(pe=Oo(K.type,K.key,K.props,null,J.mode,pe),pe.ref=as(J,U,K),pe.return=J,J=pe)}return R(J);case m:e:{for(Ge=K.key;U!==null;){if(U.key===Ge)if(U.tag===4&&U.stateNode.containerInfo===K.containerInfo&&U.stateNode.implementation===K.implementation){a(J,U.sibling),U=A(U,K.children||[]),U.return=J,J=U;break e}else{a(J,U);break}else t(J,U);U=U.sibling}U=Pl(K,J.mode,pe),U.return=J,J=U}return R(J);case M:return Ge=K._init,An(J,U,Ge(K._payload),pe)}if(se(K))return Ee(J,U,K,pe);if(F(K))return Ut(J,U,K,pe);so(J,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,U!==null&&U.tag===6?(a(J,U.sibling),U=A(U,K),U.return=J,J=U):(a(J,U),U=Fl(K,J.mode,pe),U.return=J,J=U),R(J)):a(J,U)}return An}var Ai=wu(!0),Su=wu(!1),ls={},dn=be(ls),cs=be(ls),gi=be(ls);function Qn(e){if(e===ls)throw Error(l(174));return e}function Ya(e,t){De(gi,t),De(cs,e),De(dn,ls),e=Me(t),xe(dn),De(dn,e)}function vi(){xe(dn),xe(cs),xe(gi)}function Mu(e){var t=Qn(gi.current),a=Qn(dn.current);t=V(a,e.type,t),a!==t&&(De(cs,e),De(dn,t))}function Za(e){cs.current===e&&(xe(dn),xe(cs))}var lt=be(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Kr(a)||ns(a)))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 Va=[];function qa(){for(var e=0;e<Va.length;e++){var t=Va[e];ut?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}Va.length=0}var ao=d.ReactCurrentDispatcher,pn=d.ReactCurrentBatchConfig,yi=0,ft=null,Gt=null,Mt=null,lo=!1,us=!1,fs=0,lh=0;function Ht(){throw Error(l(321))}function $a(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!zn(e[a],t[a]))return!1;return!0}function el(e,t,a,u,A,v){if(yi=v,ft=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ao.current=e===null||e.memoizedState===null?dh:ph,e=a(u,A),us){v=0;do{if(us=!1,fs=0,25<=v)throw Error(l(301));v+=1,Mt=Gt=null,t.updateQueue=null,ao.current=hh,e=a(u,A)}while(us)}if(ao.current=ho,t=Gt!==null&&Gt.next!==null,yi=0,Mt=Gt=ft=null,lo=!1,t)throw Error(l(300));return e}function tl(){var e=fs!==0;return fs=0,e}function ur(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ft.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function Xn(){if(Gt===null){var e=ft.alternate;e=e!==null?e.memoizedState:null}else e=Gt.next;var t=Mt===null?ft.memoizedState:Mt.next;if(t!==null)Mt=t,Gt=e;else{if(e===null)throw Error(l(310));Gt=e,e={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Mt===null?ft.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Yr(e,t){return typeof t=="function"?t(e):t}function co(e){var t=Xn(),a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var u=Gt,A=u.baseQueue,v=a.pending;if(v!==null){if(A!==null){var R=A.next;A.next=v.next,v.next=R}u.baseQueue=A=v,a.pending=null}if(A!==null){v=A.next,u=u.baseState;var H=R=null,W=null,re=v;do{var Ae=re.lane;if((yi&Ae)===Ae)W!==null&&(W=W.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),u=re.hasEagerState?re.eagerState:e(u,re.action);else{var Ie={lane:Ae,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};W===null?(H=W=Ie,R=u):W=W.next=Ie,ft.lanes|=Ae,Ci|=Ae}re=re.next}while(re!==null&&re!==v);W===null?R=u:W.next=H,zn(u,t.memoizedState)||(rn=!0),t.memoizedState=u,t.baseState=R,t.baseQueue=W,a.lastRenderedState=u}if(e=a.interleaved,e!==null){A=e;do v=A.lane,ft.lanes|=v,Ci|=v,A=A.next;while(A!==e)}else A===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function uo(e){var t=Xn(),a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var u=a.dispatch,A=a.pending,v=t.memoizedState;if(A!==null){a.pending=null;var R=A=A.next;do v=e(v,R.action),R=R.next;while(R!==A);zn(v,t.memoizedState)||(rn=!0),t.memoizedState=v,t.baseQueue===null&&(t.baseState=v),a.lastRenderedState=v}return[v,u]}function xu(){}function Tu(e,t){var a=ft,u=Xn(),A=t(),v=!zn(u.memoizedState,A);if(v&&(u.memoizedState=A,rn=!0),u=u.queue,ps(Ru.bind(null,a,u,e),[e]),u.getSnapshot!==t||v||Mt!==null&&Mt.memoizedState.tag&1){if(a.flags|=2048,ds(9,Iu.bind(null,a,u,A,t),void 0,null),gt===null)throw Error(l(349));yi&30||_u(a,t,A)}return A}function _u(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ft.updateQueue,t===null?(t={lastEffect:null,stores:null},ft.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Iu(e,t,a,u){t.value=a,t.getSnapshot=u,Fu(t)&&hn(e,1,-1)}function Ru(e,t,a){return a(function(){Fu(t)&&hn(e,1,-1)})}function Fu(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!zn(e,a)}catch{return!0}}function nl(e){var t=ur();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:e},t.queue=e,e=e.dispatch=fh.bind(null,ft,e),[t.memoizedState,e]}function ds(e,t,a,u){return e={tag:e,create:t,destroy:a,deps:u,next:null},t=ft.updateQueue,t===null?(t={lastEffect:null,stores:null},ft.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(u=a.next,a.next=e,e.next=u,t.lastEffect=e)),e}function Pu(){return Xn().memoizedState}function fo(e,t,a,u){var A=ur();ft.flags|=e,A.memoizedState=ds(1|t,a,void 0,u===void 0?null:u)}function po(e,t,a,u){var A=Xn();u=u===void 0?null:u;var v=void 0;if(Gt!==null){var R=Gt.memoizedState;if(v=R.destroy,u!==null&&$a(u,R.deps)){A.memoizedState=ds(t,a,v,u);return}}ft.flags|=e,A.memoizedState=ds(1|t,a,v,u)}function rl(e,t){return fo(8390656,8,e,t)}function ps(e,t){return po(2048,8,e,t)}function Du(e,t){return po(4,2,e,t)}function Lu(e,t){return po(4,4,e,t)}function Gu(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 Hu(e,t,a){return a=a!=null?a.concat([e]):null,po(4,4,Gu.bind(null,t,e),a)}function il(){}function Ou(e,t){var a=Xn();t=t===void 0?null:t;var u=a.memoizedState;return u!==null&&t!==null&&$a(t,u[1])?u[0]:(a.memoizedState=[e,t],e)}function Uu(e,t){var a=Xn();t=t===void 0?null:t;var u=a.memoizedState;return u!==null&&t!==null&&$a(t,u[1])?u[0]:(e=e(),a.memoizedState=[e,t],e)}function ch(e,t){var a=Ke;Ke=a!==0&&4>a?a:4,e(!0);var u=pn.transition;pn.transition={};try{e(!1),t()}finally{Ke=a,pn.transition=u}}function Nu(){return Xn().memoizedState}function uh(e,t,a){var u=Tr(e);a={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null},bu(e)?ku(t,a):(Ju(e,t,a),a=Jt(),e=hn(e,u,a),e!==null&&zu(e,t,u))}function fh(e,t,a){var u=Tr(e),A={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null};if(bu(e))ku(t,A);else{Ju(e,t,A);var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=t.lastRenderedReducer,v!==null))try{var R=t.lastRenderedState,H=v(R,a);if(A.hasEagerState=!0,A.eagerState=H,zn(H,R))return}catch{}finally{}a=Jt(),e=hn(e,u,a),e!==null&&zu(e,t,u)}}function bu(e){var t=e.alternate;return e===ft||t!==null&&t===ft}function ku(e,t){us=lo=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Ju(e,t,a){gt!==null&&e.mode&1&&!(He&2)?(e=t.interleaved,e===null?(a.next=a,Kn===null?Kn=[t]:Kn.push(t)):(a.next=e.next,e.next=a),t.interleaved=a):(e=t.pending,e===null?a.next=a:(a.next=e.next,e.next=a),t.pending=a)}function zu(e,t,a){if(a&4194240){var u=t.lanes;u&=e.pendingLanes,a|=u,t.lanes=a,Pa(e,a)}}var ho={readContext:cn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},dh={readContext:cn,useCallback:function(e,t){return ur().memoizedState=[e,t===void 0?null:t],e},useContext:cn,useEffect:rl,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,fo(4194308,4,Gu.bind(null,t,e),a)},useLayoutEffect:function(e,t){return fo(4194308,4,e,t)},useInsertionEffect:function(e,t){return fo(4,2,e,t)},useMemo:function(e,t){var a=ur();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var u=ur();return t=a!==void 0?a(t):t,u.memoizedState=u.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},u.queue=e,e=e.dispatch=uh.bind(null,ft,e),[u.memoizedState,e]},useRef:function(e){var t=ur();return e={current:e},t.memoizedState=e},useState:nl,useDebugValue:il,useDeferredValue:function(e){var t=nl(e),a=t[0],u=t[1];return rl(function(){var A=pn.transition;pn.transition={};try{u(e)}finally{pn.transition=A}},[e]),a},useTransition:function(){var e=nl(!1),t=e[0];return e=ch.bind(null,e[1]),ur().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var u=ft,A=ur();if(ot){if(a===void 0)throw Error(l(407));a=a()}else{if(a=t(),gt===null)throw Error(l(349));yi&30||_u(u,t,a)}A.memoizedState=a;var v={value:a,getSnapshot:t};return A.queue=v,rl(Ru.bind(null,u,v,e),[e]),u.flags|=2048,ds(9,Iu.bind(null,u,v,a,t),void 0,null),a},useId:function(){var e=ur(),t=gt.identifierPrefix;if(ot){var a=cr,u=lr;a=(u&~(1<<32-st(u)-1)).toString(32)+a,t=":"+t+"R"+a,a=fs++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=lh++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ph={readContext:cn,useCallback:Ou,useContext:cn,useEffect:ps,useImperativeHandle:Hu,useInsertionEffect:Du,useLayoutEffect:Lu,useMemo:Uu,useReducer:co,useRef:Pu,useState:function(){return co(Yr)},useDebugValue:il,useDeferredValue:function(e){var t=co(Yr),a=t[0],u=t[1];return ps(function(){var A=pn.transition;pn.transition={};try{u(e)}finally{pn.transition=A}},[e]),a},useTransition:function(){var e=co(Yr)[0],t=Xn().memoizedState;return[e,t]},useMutableSource:xu,useSyncExternalStore:Tu,useId:Nu,unstable_isNewReconciler:!1},hh={readContext:cn,useCallback:Ou,useContext:cn,useEffect:ps,useImperativeHandle:Hu,useInsertionEffect:Du,useLayoutEffect:Lu,useMemo:Uu,useReducer:uo,useRef:Pu,useState:function(){return uo(Yr)},useDebugValue:il,useDeferredValue:function(e){var t=uo(Yr),a=t[0],u=t[1];return ps(function(){var A=pn.transition;pn.transition={};try{u(e)}finally{pn.transition=A}},[e]),a},useTransition:function(){var e=uo(Yr)[0],t=Xn().memoizedState;return[e,t]},useMutableSource:xu,useSyncExternalStore:Tu,useId:Nu,unstable_isNewReconciler:!1};function sl(e,t){try{var a="",u=t;do a+=ah(u),u=u.return;while(u);var A=a}catch(v){A=` 38Error generating stack: `+v.message+` 39`+v.stack}return{value:e,source:t,stack:A}}function ol(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var mh=typeof WeakMap=="function"?WeakMap:Map;function ju(e,t,a){a=ar(-1,a),a.tag=3,a.payload={element:null};var u=t.value;return a.callback=function(){Ro||(Ro=!0,Sl=u),ol(e,t)},a}function Ku(e,t,a){a=ar(-1,a),a.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var A=t.value;a.payload=function(){return u(A)},a.callback=function(){ol(e,t)}}var v=e.stateNode;return v!==null&&typeof v.componentDidCatch=="function"&&(a.callback=function(){ol(e,t),typeof u!="function"&&(Mr===null?Mr=new Set([this]):Mr.add(this));var R=t.stack;this.componentDidCatch(t.value,{componentStack:R!==null?R:""})}),a}function Qu(e,t,a){var u=e.pingCache;if(u===null){u=e.pingCache=new mh;var A=new Set;u.set(t,A)}else A=u.get(t),A===void 0&&(A=new Set,u.set(t,A));A.has(a)||(A.add(a),e=Ih.bind(null,e,t,a),t.then(e,e))}function Xu(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 Wu(e,t,a,u,A){return e.mode&1?(e.flags|=65536,e.lanes=A,e):(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=ar(-1,1),t.tag=2,Sr(a,t))),a.lanes|=1),e)}function Wn(e){e.flags|=4}function Yu(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 hs,ms,mo,Ao;if(Fe)hs=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)he(e,a.stateNode);else if(a.tag!==4&&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}},ms=function(){},mo=function(e,t,a,u,A){if(e=e.memoizedProps,e!==u){var v=t.stateNode,R=Qn(dn.current);a=ze(v,a,e,u,A,R),(t.updateQueue=a)&&Wn(t)}},Ao=function(e,t,a,u){a!==u&&Wn(t)};else if(Tt){hs=function(e,t,a,u){for(var A=t.child;A!==null;){if(A.tag===5){var v=A.stateNode;a&&u&&(v=Nn(v,A.type,A.memoizedProps,A)),he(e,v)}else if(A.tag===6)v=A.stateNode,a&&u&&(v=bn(v,A.memoizedProps,A)),he(e,v);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)v=A.child,v!==null&&(v.return=A),hs(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 Zu=function(e,t,a,u){for(var A=t.child;A!==null;){if(A.tag===5){var v=A.stateNode;a&&u&&(v=Nn(v,A.type,A.memoizedProps,A)),Xt(e,v)}else if(A.tag===6)v=A.stateNode,a&&u&&(v=bn(v,A.memoizedProps,A)),Xt(e,v);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)v=A.child,v!==null&&(v.return=A),Zu(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}};ms=function(e,t){var a=t.stateNode;if(!Yu(e,t)){e=a.containerInfo;var u=jr(e);Zu(u,t,!1,!1),a.pendingChildren=u,Wn(t),en(e,u)}},mo=function(e,t,a,u,A){var v=e.stateNode,R=e.memoizedProps;if((e=Yu(e,t))&&R===u)t.stateNode=v;else{var H=t.stateNode,W=Qn(dn.current),re=null;R!==u&&(re=ze(H,a,R,u,A,W)),e&&re===null?t.stateNode=v:(v=js(v,re,a,R,u,t,e,H),ve(v,a,u,A,W)&&Wn(t),t.stateNode=v,e?Wn(t):hs(v,t,!1,!1))}},Ao=function(e,t,a,u){a!==u?(e=Qn(gi.current),a=Qn(dn.current),t.stateNode=Te(u,e,a,t),Wn(t)):t.stateNode=e.stateNode}}else ms=function(){},mo=function(){},Ao=function(){};function As(e,t){if(!ot)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function Ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,u=0;if(t)for(var A=e.child;A!==null;)a|=A.lanes|A.childLanes,u|=A.subtreeFlags&14680064,u|=A.flags&14680064,A.return=e,A=A.sibling;else for(A=e.child;A!==null;)a|=A.lanes|A.childLanes,u|=A.subtreeFlags,u|=A.flags,A.return=e,A=A.sibling;return e.subtreeFlags|=u,e.childLanes=a,t}function Ah(e,t,a){var u=t.pendingProps;switch(Ka(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(t),null;case 1:return At(t.type)&&It(),Ot(t),null;case 3:return u=t.stateNode,vi(),xe(Le),xe(qe),qa(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(os(t)?Wn(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Fn!==null&&(Tl(Fn),Fn=null))),ms(e,t),Ot(t),null;case 5:Za(t),a=Qn(gi.current);var A=t.type;if(e!==null&&t.stateNode!=null)mo(e,t,A,u,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!u){if(t.stateNode===null)throw Error(l(166));return Ot(t),null}if(e=Qn(dn.current),os(t)){if(!Ye)throw Error(l(175));e=B(t.stateNode,t.type,t.memoizedProps,a,e,t,!ss),t.updateQueue=e,e!==null&&Wn(t)}else{var v=ge(A,u,a,e,t);hs(v,t,!1,!1),t.stateNode=v,ve(v,A,u,a,e)&&Wn(t)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ot(t),null;case 6:if(e&&t.stateNode!=null)Ao(e,t,e.memoizedProps,u);else{if(typeof u!="string"&&t.stateNode===null)throw Error(l(166));if(e=Qn(gi.current),a=Qn(dn.current),os(t)){if(!Ye)throw Error(l(176));if(e=t.stateNode,u=t.memoizedProps,(a=x(e,u,t,!ss))&&(A=tn,A!==null))switch(v=(A.mode&1)!==0,A.tag){case 3:ae(A.stateNode.containerInfo,e,u,v);break;case 5:ce(A.type,A.memoizedProps,A.stateNode,e,u,v)}a&&Wn(t)}else t.stateNode=Te(u,e,a,t)}return Ot(t),null;case 13:if(xe(lt),u=t.memoizedState,ot&&nn!==null&&t.mode&1&&!(t.flags&128)){for(e=nn;e;)e=In(e);return mi(),t.flags|=98560,t}if(u!==null&&u.dehydrated!==null){if(u=os(t),e===null){if(!u)throw Error(l(318));if(!Ye)throw Error(l(344));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));L(e,t)}else mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;return Ot(t),null}return Fn!==null&&(Tl(Fn),Fn=null),t.flags&128?(t.lanes=a,t):(u=u!==null,a=!1,e===null?os(t):a=e.memoizedState!==null,u&&!a&&(t.child.flags|=8192,t.mode&1&&(e===null||lt.current&1?Et===0&&(Et=3):Il())),t.updateQueue!==null&&(t.flags|=4),Ot(t),null);case 4:return vi(),ms(e,t),e===null&&_n(t.stateNode.containerInfo),Ot(t),null;case 10:return Na(t.type._context),Ot(t),null;case 17:return At(t.type)&&It(),Ot(t),null;case 19:if(xe(lt),A=t.memoizedState,A===null)return Ot(t),null;if(u=(t.flags&128)!==0,v=A.rendering,v===null)if(u)As(A,!1);else{if(Et!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(v=oo(e),v!==null){for(t.flags|=128,As(A,!1),e=v.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=a,u=t.child;u!==null;)a=u,A=e,a.flags&=14680066,v=a.alternate,v===null?(a.childLanes=0,a.lanes=A,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=v.childLanes,a.lanes=v.lanes,a.child=v.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=v.memoizedProps,a.memoizedState=v.memoizedState,a.updateQueue=v.updateQueue,a.type=v.type,A=v.dependencies,a.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),u=u.sibling;return De(lt,lt.current&1|2),t.child}e=e.sibling}A.tail!==null&&St()>wl&&(t.flags|=128,u=!0,As(A,!1),t.lanes=4194304)}else{if(!u)if(e=oo(v),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),As(A,!0),A.tail===null&&A.tailMode==="hidden"&&!v.alternate&&!ot)return Ot(t),null}else 2*St()-A.renderingStartTime>wl&&a!==1073741824&&(t.flags|=128,u=!0,As(A,!1),t.lanes=4194304);A.isBackwards?(v.sibling=t.child,t.child=v):(e=A.last,e!==null?e.sibling=v:t.child=v,A.last=v)}return A.tail!==null?(t=A.tail,A.rendering=t,A.tail=t.sibling,A.renderingStartTime=St(),t.sibling=null,e=lt.current,De(lt,u?e&1|2:e&1),t):(Ot(t),null);case 22:case 23:return _l(),u=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(t.flags|=8192),u&&t.mode&1?sn&1073741824&&(Ot(t),Fe&&t.subtreeFlags&6&&(t.flags|=8192)):Ot(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}var gh=d.ReactCurrentOwner,rn=!1;function kt(e,t,a,u){t.child=e===null?Su(t,null,a,u):Ai(t,e.child,a,u)}function Vu(e,t,a,u,A){a=a.render;var v=t.ref;return di(t,A),u=el(e,t,a,u,v,A),a=tl(),e!==null&&!rn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~A,fr(e,t,A)):(ot&&a&&ja(t),t.flags|=1,kt(e,t,u,A),t.child)}function qu(e,t,a,u,A){if(e===null){var v=a.type;return typeof v=="function"&&!Rl(v)&&v.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=v,$u(e,t,v,u,A)):(e=Oo(a.type,null,u,t,t.mode,A),e.ref=t.ref,e.return=t,t.child=e)}if(v=e.child,!(e.lanes&A)){var R=v.memoizedProps;if(a=a.compare,a=a!==null?a:Vs,a(R,u)&&e.ref===t.ref)return fr(e,t,A)}return t.flags|=1,e=Ir(v,u),e.ref=t.ref,e.return=t,t.child=e}function $u(e,t,a,u,A){if(e!==null&&Vs(e.memoizedProps,u)&&e.ref===t.ref)if(rn=!1,(e.lanes&A)!==0)e.flags&131072&&(rn=!0);else return t.lanes=e.lanes,fr(e,t,A);return al(e,t,a,u,A)}function ef(e,t,a){var u=t.pendingProps,A=u.children,v=e!==null?e.memoizedState:null;if(u.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null},De(Bi,sn),sn|=a;else if(a&1073741824)t.memoizedState={baseLanes:0,cachePool:null},u=v!==null?v.baseLanes:a,De(Bi,sn),sn|=u;else return e=v!==null?v.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null},t.updateQueue=null,De(Bi,sn),sn|=e,null;else v!==null?(u=v.baseLanes|a,t.memoizedState=null):u=a,De(Bi,sn),sn|=u;return kt(e,t,A,a),t.child}function tf(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function al(e,t,a,u,A){var v=At(a)?et:qe.current;return v=Lt(t,v),di(t,A),a=el(e,t,a,u,v,A),u=tl(),e!==null&&!rn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~A,fr(e,t,A)):(ot&&u&&ja(t),t.flags|=1,kt(e,t,a,A),t.child)}function nf(e,t,a,u,A){if(At(a)){var v=!0;Ve(t)}else v=!1;if(di(t,A),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),Au(t,a,u),za(t,a,u,A),u=!0;else if(e===null){var R=t.stateNode,H=t.memoizedProps;R.props=H;var W=R.context,re=a.contextType;typeof re=="object"&&re!==null?re=cn(re):(re=At(a)?et:qe.current,re=Lt(t,re));var Ae=a.getDerivedStateFromProps,Ie=typeof Ae=="function"||typeof R.getSnapshotBeforeUpdate=="function";Ie||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(H!==u||W!==re)&&gu(t,R,u,re),wr=!1;var we=t.memoizedState;R.state=we,to(t,u,R,A),W=t.memoizedState,H!==u||we!==W||Le.current||wr?(typeof Ae=="function"&&(Ja(t,a,Ae,u),W=t.memoizedState),(H=wr||mu(t,a,H,u,we,W,re))?(Ie||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(t.flags|=4194308)):(typeof R.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=u,t.memoizedState=W),R.props=u,R.state=W,R.context=re,u=H):(typeof R.componentDidMount=="function"&&(t.flags|=4194308),u=!1)}else{R=t.stateNode,fu(e,t),H=t.memoizedProps,re=t.type===t.elementType?H:Rn(t.type,H),R.props=re,Ie=t.pendingProps,we=R.context,W=a.contextType,typeof W=="object"&&W!==null?W=cn(W):(W=At(a)?et:qe.current,W=Lt(t,W));var $e=a.getDerivedStateFromProps;(Ae=typeof $e=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(H!==Ie||we!==W)&&gu(t,R,u,W),wr=!1,we=t.memoizedState,R.state=we,to(t,u,R,A);var Ee=t.memoizedState;H!==Ie||we!==Ee||Le.current||wr?(typeof $e=="function"&&(Ja(t,a,$e,u),Ee=t.memoizedState),(re=wr||mu(t,a,re,u,we,Ee,W)||!1)?(Ae||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(u,Ee,W),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(u,Ee,W)),typeof R.componentDidUpdate=="function"&&(t.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof R.componentDidUpdate!="function"||H===e.memoizedProps&&we===e.memoizedState||(t.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||H===e.memoizedProps&&we===e.memoizedState||(t.flags|=1024),t.memoizedProps=u,t.memoizedState=Ee),R.props=u,R.state=Ee,R.context=W,u=re):(typeof R.componentDidUpdate!="function"||H===e.memoizedProps&&we===e.memoizedState||(t.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||H===e.memoizedProps&&we===e.memoizedState||(t.flags|=1024),u=!1)}return ll(e,t,a,u,v,A)}function ll(e,t,a,u,A,v){tf(e,t);var R=(t.flags&128)!==0;if(!u&&!R)return A&&je(t,a,!1),fr(e,t,v);u=t.stateNode,gh.current=t;var H=R&&typeof a.getDerivedStateFromError!="function"?null:u.render();return t.flags|=1,e!==null&&R?(t.child=Ai(t,e.child,null,v),t.child=Ai(t,null,H,v)):kt(e,t,H,v),t.memoizedState=u.state,A&&je(t,a,!0),t.child}function rf(e){var t=e.stateNode;t.pendingContext?We(e,t.pendingContext,t.pendingContext!==t.context):t.context&&We(e,t.context,!1),Ya(e,t.containerInfo)}function sf(e,t,a,u,A){return mi(),Wa(A),t.flags|=256,kt(e,t,a,u),t.child}var go={dehydrated:null,treeContext:null,retryLane:0};function vo(e){return{baseLanes:e,cachePool:null}}function of(e,t,a){var u=t.pendingProps,A=lt.current,v=!1,R=(t.flags&128)!==0,H;if((H=R)||(H=e!==null&&e.memoizedState===null?!1:(A&2)!==0),H?(v=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(A|=1),De(lt,A&1),e===null)return Xa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?ns(e)?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(A=u.children,e=u.fallback,v?(u=t.mode,v=t.child,A={mode:"hidden",children:A},!(u&1)&&v!==null?(v.childLanes=0,v.pendingProps=A):v=Uo(A,u,0,null),e=ti(e,u,a,null),v.return=t,e.return=t,v.sibling=e,t.child=v,t.child.memoizedState=vo(a),t.memoizedState=go,e):cl(t,A));if(A=e.memoizedState,A!==null){if(H=A.dehydrated,H!==null){if(R)return t.flags&256?(t.flags&=-257,yo(e,t,a,Error(l(422)))):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(v=u.fallback,A=t.mode,u=Uo({mode:"visible",children:u.children},A,0,null),v=ti(v,A,a,null),v.flags|=2,u.return=t,v.return=t,u.sibling=v,t.child=u,t.mode&1&&Ai(t,e.child,null,a),t.child.memoizedState=vo(a),t.memoizedState=go,v);if(!(t.mode&1))t=yo(e,t,a,null);else if(ns(H))t=yo(e,t,a,Error(l(419)));else if(u=(a&e.childLanes)!==0,rn||u){if(u=gt,u!==null){switch(a&-a){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}u=v&(u.suspendedLanes|a)?0:v,u!==0&&u!==A.retryLane&&(A.retryLane=u,hn(e,u,-1))}Il(),t=yo(e,t,a,Error(l(421)))}else Kr(H)?(t.flags|=128,t.child=e.child,t=Rh.bind(null,e),Qr(H,t),t=null):(a=A.treeContext,Ye&&(nn=Ia(H),tn=t,ot=!0,Fn=null,ss=!1,a!==null&&(un[fn++]=lr,un[fn++]=cr,un[fn++]=Xr,lr=a.id,cr=a.overflow,Xr=t)),t=cl(t,t.pendingProps.children),t.flags|=4096);return t}return v?(u=lf(e,t,u.children,u.fallback,a),v=t.child,A=e.child.memoizedState,v.memoizedState=A===null?vo(a):{baseLanes:A.baseLanes|a,cachePool:null},v.childLanes=e.childLanes&~a,t.memoizedState=go,u):(a=af(e,t,u.children,a),t.memoizedState=null,a)}return v?(u=lf(e,t,u.children,u.fallback,a),v=t.child,A=e.child.memoizedState,v.memoizedState=A===null?vo(a):{baseLanes:A.baseLanes|a,cachePool:null},v.childLanes=e.childLanes&~a,t.memoizedState=go,u):(a=af(e,t,u.children,a),t.memoizedState=null,a)}function cl(e,t){return t=Uo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function af(e,t,a,u){var A=e.child;return e=A.sibling,a=Ir(A,{mode:"visible",children:a}),!(t.mode&1)&&(a.lanes=u),a.return=t,a.sibling=null,e!==null&&(u=t.deletions,u===null?(t.deletions=[e],t.flags|=16):u.push(e)),t.child=a}function lf(e,t,a,u,A){var v=t.mode;e=e.child;var R=e.sibling,H={mode:"hidden",children:a};return!(v&1)&&t.child!==e?(a=t.child,a.childLanes=0,a.pendingProps=H,t.deletions=null):(a=Ir(e,H),a.subtreeFlags=e.subtreeFlags&14680064),R!==null?u=Ir(R,u):(u=ti(u,v,A,null),u.flags|=2),u.return=t,a.return=t,a.sibling=u,t.child=a,u}function yo(e,t,a,u){return u!==null&&Wa(u),Ai(t,e.child,null,a),e=cl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cf(e,t,a){e.lanes|=t;var u=e.alternate;u!==null&&(u.lanes|=t),ba(e.return,t,a)}function ul(e,t,a,u,A){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:A}:(v.isBackwards=t,v.rendering=null,v.renderingStartTime=0,v.last=u,v.tail=a,v.tailMode=A)}function uf(e,t,a){var u=t.pendingProps,A=u.revealOrder,v=u.tail;if(kt(e,t,u.children,a),u=lt.current,u&2)u=u&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&&cf(e,a,t);else if(e.tag===19)cf(e,a,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}u&=1}if(De(lt,u),!(t.mode&1))t.memoizedState=null;else switch(A){case"forwards":for(a=t.child,A=null;a!==null;)e=a.alternate,e!==null&&oo(e)===null&&(A=a),a=a.sibling;a=A,a===null?(A=t.child,t.child=null):(A=a.sibling,a.sibling=null),ul(t,!1,A,a,v);break;case"backwards":for(a=null,A=t.child,t.child=null;A!==null;){if(e=A.alternate,e!==null&&oo(e)===null){t.child=A;break}e=A.sibling,A.sibling=a,a=A,A=e}ul(t,!0,a,null,v);break;case"together":ul(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ci|=t.lanes,!(a&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,a=Ir(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ir(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function vh(e,t,a){switch(t.tag){case 3:rf(t),mi();break;case 5:Mu(t);break;case 1:At(t.type)&&Ve(t);break;case 4:Ya(t,t.stateNode.containerInfo);break;case 10:uu(t,t.type._context,t.memoizedProps.value);break;case 13:var u=t.memoizedState;if(u!==null)return u.dehydrated!==null?(De(lt,lt.current&1),t.flags|=128,null):a&t.child.childLanes?of(e,t,a):(De(lt,lt.current&1),e=fr(e,t,a),e!==null?e.sibling:null);De(lt,lt.current&1);break;case 19:if(u=(a&t.childLanes)!==0,e.flags&128){if(u)return uf(e,t,a);t.flags|=128}var A=t.memoizedState;if(A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),De(lt,lt.current),u)break;return null;case 22:case 23:return t.lanes=0,ef(e,t,a)}return fr(e,t,a)}function yh(e,t){switch(Ka(t),t.tag){case 1:return At(t.type)&&It(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vi(),xe(Le),xe(qe),qa(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Za(t),null;case 13:if(xe(lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(lt),null;case 4:return vi(),null;case 10:return Na(t.type._context),null;case 22:case 23:return _l(),null;case 24:return null;default:return null}}var Bo=!1,Zr=!1,Bh=typeof WeakSet=="function"?WeakSet:Set,de=null;function Co(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(u){Zt(e,t,u)}else a.current=null}function fl(e,t,a){try{a()}catch(u){Zt(e,t,u)}}var ff=!1;function Ch(e,t){for(fe(e.containerInfo),de=t;de!==null;)if(e=de,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,de=t;else for(;de!==null;){e=de;try{var a=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(a!==null){var u=a.memoizedProps,A=a.memoizedState,v=e.stateNode,R=v.getSnapshotBeforeUpdate(e.elementType===e.type?u:Rn(e.type,u),A);v.__reactInternalSnapshotBeforeUpdate=R}break;case 3:Fe&&ln(e.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(H){Zt(e,e.return,H)}if(t=e.sibling,t!==null){t.return=e.return,de=t;break}de=e.return}return a=ff,ff=!1,a}function Vr(e,t,a){var u=t.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var A=u=u.next;do{if((A.tag&e)===e){var v=A.destroy;A.destroy=void 0,v!==void 0&&fl(t,a,v)}A=A.next}while(A!==u)}}function gs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var u=a.create;a.destroy=u()}a=a.next}while(a!==t)}}function dl(e){var t=e.ref;if(t!==null){var a=e.stateNode;switch(e.tag){case 5:e=ue(a);break;default:e=a}typeof t=="function"?t(e):t.current=e}}function df(e,t,a){if(Jn&&typeof Jn.onCommitFiberUnmount=="function")try{Jn.onCommitFiberUnmount(Ys,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 u=e=e.next;do{var A=u,v=A.destroy;A=A.tag,v!==void 0&&(A&2||A&4)&&fl(t,a,v),u=u.next}while(u!==e)}break;case 1:if(Co(t,a),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(R){Zt(t,a,R)}break;case 5:Co(t,a);break;case 4:Fe?vf(e,t,a):Tt&&Tt&&(t=t.stateNode.containerInfo,a=jr(t),Un(t,a))}}function pf(e,t,a){for(var u=t;;)if(df(e,u,a),u.child===null||Fe&&u.tag===4){if(u===t)break;for(;u.sibling===null;){if(u.return===null||u.return===t)return;u=u.return}u.sibling.return=u.return,u=u.sibling}else u.child.return=u,u=u.child}function hf(e){var t=e.alternate;t!==null&&(e.alternate=null,hf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Kt(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 mf(e){return e.tag===5||e.tag===3||e.tag===4}function Af(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mf(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 gf(e){if(Fe){e:{for(var t=e.return;t!==null;){if(mf(t))break e;t=t.return}throw Error(l(160))}var a=t;switch(a.tag){case 5:t=a.stateNode,a.flags&32&&(te(t),a.flags&=-33),a=Af(e),hl(e,a,t);break;case 3:case 4:t=a.stateNode.containerInfo,a=Af(e),pl(e,a,t);break;default:throw Error(l(161))}}}function pl(e,t,a){var u=e.tag;if(u===5||u===6)e=e.stateNode,t?Bt(a,e,t):Br(a,e);else if(u!==4&&(e=e.child,e!==null))for(pl(e,t,a),e=e.sibling;e!==null;)pl(e,t,a),e=e.sibling}function hl(e,t,a){var u=e.tag;if(u===5||u===6)e=e.stateNode,t?ir(a,e,t):yr(a,e);else if(u!==4&&(e=e.child,e!==null))for(hl(e,t,a),e=e.sibling;e!==null;)hl(e,t,a),e=e.sibling}function vf(e,t,a){for(var u=t,A=!1,v,R;;){if(!A){A=u.return;e:for(;;){if(A===null)throw Error(l(160));switch(v=A.stateNode,A.tag){case 5:R=!1;break e;case 3:v=v.containerInfo,R=!0;break e;case 4:v=v.containerInfo,R=!0;break e}A=A.return}A=!0}if(u.tag===5||u.tag===6)pf(e,u,a),R?N(v,u.stateNode):Cr(v,u.stateNode);else if(u.tag===18)R?ee(v,u.stateNode):ne(v,u.stateNode);else if(u.tag===4){if(u.child!==null){v=u.stateNode.containerInfo,R=!0,u.child.return=u,u=u.child;continue}}else if(df(e,u,a),u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break;for(;u.sibling===null;){if(u.return===null||u.return===t)return;u=u.return,u.tag===4&&(A=!1)}u.sibling.return=u.return,u=u.sibling}}function ml(e,t){if(Fe){switch(t.tag){case 0:case 11:case 14:case 15:Vr(3,t,t.return),gs(3,t),Vr(5,t,t.return);return;case 1:return;case 5:var a=t.stateNode;if(a!=null){var u=t.memoizedProps;e=e!==null?e.memoizedProps:u;var A=t.type,v=t.updateQueue;t.updateQueue=null,v!==null&&ts(a,v,A,e,u,t)}return;case 6:if(t.stateNode===null)throw Error(l(162));a=t.memoizedProps,es(t.stateNode,e!==null?e.memoizedProps:a,a);return;case 3:Ye&&e!==null&&e.memoizedState.isDehydrated&&Q(t.stateNode.containerInfo);return;case 12:return;case 13:Eo(t);return;case 19:Eo(t);return;case 17:return}throw Error(l(163))}switch(t.tag){case 0:case 11:case 14:case 15:Vr(3,t,t.return),gs(3,t),Vr(5,t,t.return);return;case 12:return;case 13:Eo(t);return;case 19:Eo(t);return;case 3:Ye&&e!==null&&e.memoizedState.isDehydrated&&Q(t.stateNode.containerInfo);break;case 22:case 23:return}e:if(Tt){switch(t.tag){case 1:case 5:case 6:break e;case 3:case 4:t=t.stateNode,Un(t.containerInfo,t.pendingChildren);break e}throw Error(l(163))}}function Eo(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new Bh),t.forEach(function(u){var A=Fh.bind(null,e,u);a.has(u)||(a.add(u),u.then(A,A))})}}function Eh(e,t){for(de=t;de!==null;){t=de;var a=t.deletions;if(a!==null)for(var u=0;u<a.length;u++){var A=a[u];try{var v=e;Fe?vf(v,A,t):pf(v,A,t);var R=A.alternate;R!==null&&(R.return=null),A.return=null}catch(Be){Zt(A,t,Be)}}if(a=t.child,t.subtreeFlags&12854&&a!==null)a.return=t,de=a;else for(;de!==null;){t=de;try{var H=t.flags;if(H&32&&Fe&&te(t.stateNode),H&512){var W=t.alternate;if(W!==null){var re=W.ref;re!==null&&(typeof re=="function"?re(null):re.current=null)}}if(H&8192)switch(t.tag){case 13:if(t.memoizedState!==null){var Ae=t.alternate;(Ae===null||Ae.memoizedState===null)&&(El=St())}break;case 22:var Ie=t.memoizedState!==null,we=t.alternate,$e=we!==null&&we.memoizedState!==null;if(a=t,Fe){e:if(u=a,A=Ie,v=null,Fe)for(var Ee=u;;){if(Ee.tag===5){if(v===null){v=Ee;var Ut=Ee.stateNode;A?me(Ut):ie(Ee.stateNode,Ee.memoizedProps)}}else if(Ee.tag===6){if(v===null){var An=Ee.stateNode;A?Ne(An):_t(An,Ee.memoizedProps)}}else if((Ee.tag!==22&&Ee.tag!==23||Ee.memoizedState===null||Ee===u)&&Ee.child!==null){Ee.child.return=Ee,Ee=Ee.child;continue}if(Ee===u)break;for(;Ee.sibling===null;){if(Ee.return===null||Ee.return===u)break e;v===Ee&&(v=null),Ee=Ee.return}v===Ee&&(v=null),Ee.sibling.return=Ee.return,Ee=Ee.sibling}}if(Ie&&!$e&&a.mode&1){de=a;for(var J=a.child;J!==null;){for(a=de=J;de!==null;){u=de;var U=u.child;switch(u.tag){case 0:case 11:case 14:case 15:Vr(4,u,u.return);break;case 1:Co(u,u.return);var K=u.stateNode;if(typeof K.componentWillUnmount=="function"){var pe=u.return;try{K.props=u.memoizedProps,K.state=u.memoizedState,K.componentWillUnmount()}catch(Be){Zt(u,pe,Be)}}break;case 5:Co(u,u.return);break;case 22:if(u.memoizedState!==null){Cf(a);continue}}U!==null?(U.return=u,de=U):Cf(a)}J=J.sibling}}}switch(H&4102){case 2:gf(t),t.flags&=-3;break;case 6:gf(t),t.flags&=-3,ml(t.alternate,t);break;case 4096:t.flags&=-4097;break;case 4100:t.flags&=-4097,ml(t.alternate,t);break;case 4:ml(t.alternate,t)}}catch(Be){Zt(t,t.return,Be)}if(a=t.sibling,a!==null){a.return=t.return,de=a;break}de=t.return}}}function wh(e,t,a){de=e,yf(e)}function yf(e,t,a){for(var u=(e.mode&1)!==0;de!==null;){var A=de,v=A.child;if(A.tag===22&&u){var R=A.memoizedState!==null||Bo;if(!R){var H=A.alternate,W=H!==null&&H.memoizedState!==null||Zr;H=Bo;var re=Zr;if(Bo=R,(Zr=W)&&!re)for(de=A;de!==null;)R=de,W=R.child,R.tag===22&&R.memoizedState!==null?Ef(A):W!==null?(W.return=R,de=W):Ef(A);for(;v!==null;)de=v,yf(v),v=v.sibling;de=A,Bo=H,Zr=re}Bf(e)}else A.subtreeFlags&8772&&v!==null?(v.return=A,de=v):Bf(e)}}function Bf(e){for(;de!==null;){var t=de;if(t.flags&8772){var a=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Zr||gs(5,t);break;case 1:var u=t.stateNode;if(t.flags&4&&!Zr)if(a===null)u.componentDidMount();else{var A=t.elementType===t.type?a.memoizedProps:Rn(t.type,a.memoizedProps);u.componentDidUpdate(A,a.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var v=t.updateQueue;v!==null&&pu(t,v,u);break;case 3:var R=t.updateQueue;if(R!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=ue(t.child.stateNode);break;case 1:a=t.child.stateNode}pu(t,R,a)}break;case 5:var H=t.stateNode;a===null&&t.flags&4&&ui(H,t.type,t.memoizedProps,t);break;case 6:break;case 4:break;case 12:break;case 13:if(Ye&&t.memoizedState===null){var W=t.alternate;if(W!==null){var re=W.memoizedState;if(re!==null){var Ae=re.dehydrated;Ae!==null&&X(Ae)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(l(163))}Zr||t.flags&512&&dl(t)}catch(Ie){Zt(t,t.return,Ie)}}if(t===e){de=null;break}if(a=t.sibling,a!==null){a.return=t.return,de=a;break}de=t.return}}function Cf(e){for(;de!==null;){var t=de;if(t===e){de=null;break}var a=t.sibling;if(a!==null){a.return=t.return,de=a;break}de=t.return}}function Ef(e){for(;de!==null;){var t=de;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{gs(4,t)}catch(W){Zt(t,a,W)}break;case 1:var u=t.stateNode;if(typeof u.componentDidMount=="function"){var A=t.return;try{u.componentDidMount()}catch(W){Zt(t,A,W)}}var v=t.return;try{dl(t)}catch(W){Zt(t,v,W)}break;case 5:var R=t.return;try{dl(t)}catch(W){Zt(t,R,W)}}}catch(W){Zt(t,t.return,W)}if(t===e){de=null;break}var H=t.sibling;if(H!==null){H.return=t.return,de=H;break}de=t.return}}var wo=0,So=1,Mo=2,xo=3,To=4;if(typeof Symbol=="function"&&Symbol.for){var vs=Symbol.for;wo=vs("selector.component"),So=vs("selector.has_pseudo_class"),Mo=vs("selector.role"),xo=vs("selector.test_id"),To=vs("selector.text")}function Al(e){var t=$t(e);if(t!=null){if(typeof t.memoizedProps["data-testname"]!="string")throw Error(l(364));return t}if(e=Jr(e),e===null)throw Error(l(362));return e.stateNode.current}function gl(e,t){switch(t.$$typeof){case wo:if(e.type===t.value)return!0;break;case So:e:{t=t.value,e=[e,0];for(var a=0;a<e.length;){var u=e[a++],A=e[a++],v=t[A];if(u.tag!==5||!Nt(u)){for(;v!=null&&gl(u,v);)A++,v=t[A];if(A===t.length){t=!0;break e}else for(u=u.child;u!==null;)e.push(u,A),u=u.sibling}}t=!1}return t;case Mo:if(e.tag===5&&rr(e.stateNode,t.value))return!0;break;case To:if((e.tag===5||e.tag===6)&&(e=On(e),e!==null&&0<=e.indexOf(t.value)))return!0;break;case xo:if(e.tag===5&&(e=e.memoizedProps["data-testname"],typeof e=="string"&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(l(365))}return!1}function vl(e){switch(e.$$typeof){case wo:return"<"+(G(e.value)||"Unknown")+">";case So:return":has("+(vl(e)||"")+")";case Mo:return'[role="'+e.value+'"]';case To:return'"'+e.value+'"';case xo:return'[data-testname="'+e.value+'"]';default:throw Error(l(365))}}function wf(e,t){var a=[];e=[e,0];for(var u=0;u<e.length;){var A=e[u++],v=e[u++],R=t[v];if(A.tag!==5||!Nt(A)){for(;R!=null&&gl(A,R);)v++,R=t[v];if(v===t.length)a.push(A);else for(A=A.child;A!==null;)e.push(A,v),A=A.sibling}}return a}function yl(e,t){if(!an)throw Error(l(363));e=Al(e),e=wf(e,t),t=[],e=Array.from(e);for(var a=0;a<e.length;){var u=e[a++];if(u.tag===5)Nt(u)||t.push(u.stateNode);else for(u=u.child;u!==null;)e.push(u),u=u.sibling}return t}var Sh=Math.ceil,_o=d.ReactCurrentDispatcher,Bl=d.ReactCurrentOwner,ht=d.ReactCurrentBatchConfig,He=0,gt=null,vt=null,Rt=0,sn=0,Bi=be(0),Et=0,ys=null,Ci=0,Io=0,Cl=0,Bs=null,Wt=null,El=0,wl=1/0;function Ei(){wl=St()+500}var Ro=!1,Sl=null,Mr=null,Fo=!1,xr=null,Po=0,Cs=0,Ml=null,Do=-1,Lo=0;function Jt(){return He&6?St():Do!==-1?Do:Do=St()}function Tr(e){return e.mode&1?He&2&&Rt!==0?Rt&-Rt:oh.transition!==null?(Lo===0&&(e=Qs,Qs<<=1,!(Qs&4194240)&&(Qs=64),Lo=e),Lo):(e=Ke,e!==0?e:kr()):1}function hn(e,t,a){if(50<Cs)throw Cs=0,Ml=null,Error(l(185));var u=Go(e,t);return u===null?null:(is(u,t,a),(!(He&2)||u!==gt)&&(u===gt&&(!(He&2)&&(Io|=t),Et===4&&_r(u,Rt)),Yt(u,a),t===1&&He===0&&!(e.mode&1)&&(Ei(),Zs&&jn())),u)}function Go(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}function Yt(e,t){var a=e.callbackNode;Vp(e,t);var u=Ws(e,e===gt?Rt:0);if(u===0)a!==null&&lu(a),e.callbackNode=null,e.callbackPriority=0;else if(t=u&-u,e.callbackPriority!==t){if(a!=null&&lu(a),t===1)e.tag===0?sh(Mf.bind(null,e)):cu(Mf.bind(null,e)),nr?Hn(function(){He===0&&jn()}):Da(La,jn),a=null;else{switch(au(u)){case 1:a=La;break;case 4:a=th;break;case 16:a=Ga;break;case 536870912:a=nh;break;default:a=Ga}a=Lf(a,Sf.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function Sf(e,t){if(Do=-1,Lo=0,He&6)throw Error(l(327));var a=e.callbackNode;if(ei()&&e.callbackNode!==a)return null;var u=Ws(e,e===gt?Rt:0);if(u===0)return null;if(u&30||u&e.expiredLanes||t)t=Ho(e,u);else{t=u;var A=He;He|=2;var v=_f();(gt!==e||Rt!==t)&&(Ei(),qr(e,t));do try{Th();break}catch(H){Tf(e,H)}while(!0);Ua(),_o.current=v,He=A,vt!==null?t=0:(gt=null,Rt=0,t=Et)}if(t!==0){if(t===2&&(A=Ra(e),A!==0&&(u=A,t=xl(e,A))),t===1)throw a=ys,qr(e,0),_r(e,u),Yt(e,St()),a;if(t===6)_r(e,u);else{if(A=e.current.alternate,!(u&30)&&!Mh(A)&&(t=Ho(e,u),t===2&&(v=Ra(e),v!==0&&(u=v,t=xl(e,v))),t===1))throw a=ys,qr(e,0),_r(e,u),Yt(e,St()),a;switch(e.finishedWork=A,e.finishedLanes=u,t){case 0:case 1:throw Error(l(345));case 2:$r(e,Wt);break;case 3:if(_r(e,u),(u&130023424)===u&&(t=El+500-St(),10<t)){if(Ws(e,0)!==0)break;if(A=e.suspendedLanes,(A&u)!==u){Jt(),e.pingedLanes|=e.suspendedLanes&A;break}e.timeoutHandle=pt($r.bind(null,e,Wt),t);break}$r(e,Wt);break;case 4:if(_r(e,u),(u&4194240)===u)break;for(t=e.eventTimes,A=-1;0<u;){var R=31-st(u);v=1<<R,R=t[R],R>A&&(A=R),u&=~v}if(u=A,u=St()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Sh(u/1960))-u,10<u){e.timeoutHandle=pt($r.bind(null,e,Wt),u);break}$r(e,Wt);break;case 5:$r(e,Wt);break;default:throw Error(l(329))}}}return Yt(e,St()),e.callbackNode===a?Sf.bind(null,e):null}function xl(e,t){var a=Bs;return e.current.memoizedState.isDehydrated&&(qr(e,t).flags|=256),e=Ho(e,t),e!==2&&(t=Wt,Wt=a,t!==null&&Tl(t)),e}function Tl(e){Wt===null?Wt=e:Wt.push.apply(Wt,e)}function Mh(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var u=0;u<a.length;u++){var A=a[u],v=A.getSnapshot;A=A.value;try{if(!zn(v(),A))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 _r(e,t){for(t&=~Cl,t&=~Io,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-st(t),u=1<<a;e[a]=-1,t&=~u}}function Mf(e){if(He&6)throw Error(l(327));ei();var t=Ws(e,0);if(!(t&1))return Yt(e,St()),null;var a=Ho(e,t);if(e.tag!==0&&a===2){var u=Ra(e);u!==0&&(t=u,a=xl(e,u))}if(a===1)throw a=ys,qr(e,0),_r(e,t),Yt(e,St()),a;if(a===6)throw Error(l(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,$r(e,Wt),Yt(e,St()),null}function xf(e){xr!==null&&xr.tag===0&&!(He&6)&&ei();var t=He;He|=1;var a=ht.transition,u=Ke;try{if(ht.transition=null,Ke=1,e)return e()}finally{Ke=u,ht.transition=a,He=t,!(He&6)&&jn()}}function _l(){sn=Bi.current,xe(Bi)}function qr(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==Gn&&(e.timeoutHandle=Gn,mt(a)),vt!==null)for(a=vt.return;a!==null;){var u=a;switch(Ka(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&It();break;case 3:vi(),xe(Le),xe(qe),qa();break;case 5:Za(u);break;case 4:vi();break;case 13:xe(lt);break;case 19:xe(lt);break;case 10:Na(u.type._context);break;case 22:case 23:_l()}a=a.return}if(gt=e,vt=e=Ir(e.current,null),Rt=sn=t,Et=0,ys=null,Cl=Io=Ci=0,Wt=Bs=null,Kn!==null){for(t=0;t<Kn.length;t++)if(a=Kn[t],u=a.interleaved,u!==null){a.interleaved=null;var A=u.next,v=a.pending;if(v!==null){var R=v.next;v.next=A,u.next=R}a.pending=u}Kn=null}return e}function Tf(e,t){do{var a=vt;try{if(Ua(),ao.current=ho,lo){for(var u=ft.memoizedState;u!==null;){var A=u.queue;A!==null&&(A.pending=null),u=u.next}lo=!1}if(yi=0,Mt=Gt=ft=null,us=!1,fs=0,Bl.current=null,a===null||a.return===null){Et=1,ys=t,vt=null;break}e:{var v=e,R=a.return,H=a,W=t;if(t=Rt,H.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var re=W,Ae=H,Ie=Ae.tag;if(!(Ae.mode&1)&&(Ie===0||Ie===11||Ie===15)){var we=Ae.alternate;we?(Ae.updateQueue=we.updateQueue,Ae.memoizedState=we.memoizedState,Ae.lanes=we.lanes):(Ae.updateQueue=null,Ae.memoizedState=null)}var $e=Xu(R);if($e!==null){$e.flags&=-257,Wu($e,R,H,v,t),$e.mode&1&&Qu(v,re,t),t=$e,W=re;var Ee=t.updateQueue;if(Ee===null){var Ut=new Set;Ut.add(W),t.updateQueue=Ut}else Ee.add(W);break e}else{if(!(t&1)){Qu(v,re,t),Il();break e}W=Error(l(426))}}else if(ot&&H.mode&1){var An=Xu(R);if(An!==null){!(An.flags&65536)&&(An.flags|=256),Wu(An,R,H,v,t),Wa(W);break e}}v=W,Et!==4&&(Et=2),Bs===null?Bs=[v]:Bs.push(v),W=sl(W,H),H=R;do{switch(H.tag){case 3:H.flags|=65536,t&=-t,H.lanes|=t;var J=ju(H,W,t);du(H,J);break e;case 1:v=W;var U=H.type,K=H.stateNode;if(!(H.flags&128)&&(typeof U.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(Mr===null||!Mr.has(K)))){H.flags|=65536,t&=-t,H.lanes|=t;var pe=Ku(H,v,t);du(H,pe);break e}}H=H.return}while(H!==null)}Rf(a)}catch(Be){t=Be,vt===a&&a!==null&&(vt=a=a.return);continue}break}while(!0)}function _f(){var e=_o.current;return _o.current=ho,e===null?ho:e}function Il(){(Et===0||Et===3||Et===2)&&(Et=4),gt===null||!(Ci&268435455)&&!(Io&268435455)||_r(gt,Rt)}function Ho(e,t){var a=He;He|=2;var u=_f();gt===e&&Rt===t||qr(e,t);do try{xh();break}catch(A){Tf(e,A)}while(!0);if(Ua(),He=a,_o.current=u,vt!==null)throw Error(l(261));return gt=null,Rt=0,Et}function xh(){for(;vt!==null;)If(vt)}function Th(){for(;vt!==null&&!$p();)If(vt)}function If(e){var t=Df(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?Rf(e):vt=t,Bl.current=null}function Rf(e){var t=e;do{var a=t.alternate;if(e=t.return,t.flags&32768){if(a=yh(a,t),a!==null){a.flags&=32767,vt=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Et=6,vt=null;return}}else if(a=Ah(a,t,sn),a!==null){vt=a;return}if(t=t.sibling,t!==null){vt=t;return}vt=t=e}while(t!==null);Et===0&&(Et=5)}function $r(e,t){var a=Ke,u=ht.transition;try{ht.transition=null,Ke=1,_h(e,t,a)}finally{ht.transition=u,Ke=a}return null}function _h(e,t,a){do ei();while(xr!==null);if(He&6)throw Error(l(327));var u=e.finishedWork,A=e.finishedLanes;if(u===null)return null;if(e.finishedWork=null,e.finishedLanes=0,u===e.current)throw Error(l(177));e.callbackNode=null,e.callbackPriority=0;var v=u.lanes|u.childLanes;if(qp(e,v),e===gt&&(vt=gt=null,Rt=0),!(u.subtreeFlags&2064)&&!(u.flags&2064)||Fo||(Fo=!0,Lf(Ga,function(){return ei(),null})),v=(u.flags&15990)!==0,u.subtreeFlags&15990||v){v=ht.transition,ht.transition=null;var R=Ke;Ke=1;var H=He;He|=4,Bl.current=null,Ch(e,u),Eh(e,u),q(e.containerInfo),e.current=u,wh(u),eh(),He=H,Ke=R,ht.transition=v}else e.current=u;if(Fo&&(Fo=!1,xr=e,Po=A),v=e.pendingLanes,v===0&&(Mr=null),rh(u.stateNode),Yt(e,St()),t!==null)for(a=e.onRecoverableError,u=0;u<t.length;u++)a(t[u]);if(Ro)throw Ro=!1,e=Sl,Sl=null,e;return Po&1&&e.tag!==0&&ei(),v=e.pendingLanes,v&1?e===Ml?Cs++:(Cs=0,Ml=e):Cs=0,jn(),null}function ei(){if(xr!==null){var e=au(Po),t=ht.transition,a=Ke;try{if(ht.transition=null,Ke=16>e?16:e,xr===null)var u=!1;else{if(e=xr,xr=null,Po=0,He&6)throw Error(l(331));var A=He;for(He|=4,de=e.current;de!==null;){var v=de,R=v.child;if(de.flags&16){var H=v.deletions;if(H!==null){for(var W=0;W<H.length;W++){var re=H[W];for(de=re;de!==null;){var Ae=de;switch(Ae.tag){case 0:case 11:case 15:Vr(8,Ae,v)}var Ie=Ae.child;if(Ie!==null)Ie.return=Ae,de=Ie;else for(;de!==null;){Ae=de;var we=Ae.sibling,$e=Ae.return;if(hf(Ae),Ae===re){de=null;break}if(we!==null){we.return=$e,de=we;break}de=$e}}}var Ee=v.alternate;if(Ee!==null){var Ut=Ee.child;if(Ut!==null){Ee.child=null;do{var An=Ut.sibling;Ut.sibling=null,Ut=An}while(Ut!==null)}}de=v}}if(v.subtreeFlags&2064&&R!==null)R.return=v,de=R;else e:for(;de!==null;){if(v=de,v.flags&2048)switch(v.tag){case 0:case 11:case 15:Vr(9,v,v.return)}var J=v.sibling;if(J!==null){J.return=v.return,de=J;break e}de=v.return}}var U=e.current;for(de=U;de!==null;){R=de;var K=R.child;if(R.subtreeFlags&2064&&K!==null)K.return=R,de=K;else e:for(R=U;de!==null;){if(H=de,H.flags&2048)try{switch(H.tag){case 0:case 11:case 15:gs(9,H)}}catch(Be){Zt(H,H.return,Be)}if(H===R){de=null;break e}var pe=H.sibling;if(pe!==null){pe.return=H.return,de=pe;break e}de=H.return}}if(He=A,jn(),Jn&&typeof Jn.onPostCommitFiberRoot=="function")try{Jn.onPostCommitFiberRoot(Ys,e)}catch{}u=!0}return u}finally{Ke=a,ht.transition=t}}return!1}function Ff(e,t,a){t=sl(a,t),t=ju(e,t,1),Sr(e,t),t=Jt(),e=Go(e,1),e!==null&&(is(e,1,t),Yt(e,t))}function Zt(e,t,a){if(e.tag===3)Ff(e,e,a);else for(;t!==null;){if(t.tag===3){Ff(t,e,a);break}else if(t.tag===1){var u=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Mr===null||!Mr.has(u))){e=sl(a,e),e=Ku(t,e,1),Sr(t,e),e=Jt(),t=Go(t,1),t!==null&&(is(t,1,e),Yt(t,e));break}}t=t.return}}function Ih(e,t,a){var u=e.pingCache;u!==null&&u.delete(t),t=Jt(),e.pingedLanes|=e.suspendedLanes&a,gt===e&&(Rt&a)===a&&(Et===4||Et===3&&(Rt&130023424)===Rt&&500>St()-El?qr(e,0):Cl|=a),Yt(e,t)}function Pf(e,t){t===0&&(e.mode&1?(t=Xs,Xs<<=1,!(Xs&130023424)&&(Xs=4194304)):t=1);var a=Jt();e=Go(e,t),e!==null&&(is(e,t,a),Yt(e,a))}function Rh(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Pf(e,a)}function Fh(e,t){var a=0;switch(e.tag){case 13:var u=e.stateNode,A=e.memoizedState;A!==null&&(a=A.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(l(314))}u!==null&&u.delete(t),Pf(e,a)}var Df;Df=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Le.current)rn=!0;else{if(!(e.lanes&a)&&!(t.flags&128))return rn=!1,vh(e,t,a);rn=!!(e.flags&131072)}else rn=!1,ot&&t.flags&1048576&&vu(t,io,t.index);switch(t.lanes=0,t.tag){case 2:var u=t.type;e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps;var A=Lt(t,qe.current);di(t,a),A=el(null,t,u,e,A,a);var v=tl();return t.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,At(u)?(v=!0,Ve(t)):v=!1,t.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,ka(t),A.updater=no,t.stateNode=A,A._reactInternals=t,za(t,u,e,a),t=ll(null,t,u,!0,v,a)):(t.tag=0,ot&&v&&ja(t),kt(null,t,A,a),t=t.child),t;case 16:u=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,A=u._init,u=A(u._payload),t.type=u,A=t.tag=Dh(u),e=Rn(u,e),A){case 0:t=al(null,t,u,e,a);break e;case 1:t=nf(null,t,u,e,a);break e;case 11:t=Vu(null,t,u,e,a);break e;case 14:t=qu(null,t,u,Rn(u.type,e),a);break e}throw Error(l(306,u,""))}return t;case 0:return u=t.type,A=t.pendingProps,A=t.elementType===u?A:Rn(u,A),al(e,t,u,A,a);case 1:return u=t.type,A=t.pendingProps,A=t.elementType===u?A:Rn(u,A),nf(e,t,u,A,a);case 3:e:{if(rf(t),e===null)throw Error(l(387));u=t.pendingProps,v=t.memoizedState,A=v.element,fu(e,t),to(t,u,null,a);var R=t.memoizedState;if(u=R.element,Ye&&v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:R.cache,transitions:R.transitions},t.updateQueue.baseState=v,t.memoizedState=v,t.flags&256){A=Error(l(423)),t=sf(e,t,u,a,A);break e}else if(u!==A){A=Error(l(424)),t=sf(e,t,u,a,A);break e}else for(Ye&&(nn=Ks(t.stateNode.containerInfo),tn=t,ot=!0,Fn=null,ss=!1),a=Su(t,null,u,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(mi(),u===A){t=fr(e,t,a);break e}kt(e,t,u,a)}t=t.child}return t;case 5:return Mu(t),e===null&&Xa(t),u=t.type,A=t.pendingProps,v=e!==null?e.memoizedProps:null,R=A.children,nt(u,A)?R=null:v!==null&&nt(u,v)&&(t.flags|=32),tf(e,t),kt(e,t,R,a),t.child;case 6:return e===null&&Xa(t),null;case 13:return of(e,t,a);case 4:return Ya(t,t.stateNode.containerInfo),u=t.pendingProps,e===null?t.child=Ai(t,null,u,a):kt(e,t,u,a),t.child;case 11:return u=t.type,A=t.pendingProps,A=t.elementType===u?A:Rn(u,A),Vu(e,t,u,A,a);case 7:return kt(e,t,t.pendingProps,a),t.child;case 8:return kt(e,t,t.pendingProps.children,a),t.child;case 12:return kt(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(u=t.type._context,A=t.pendingProps,v=t.memoizedProps,R=A.value,uu(t,u,R),v!==null)if(zn(v.value,R)){if(v.children===A.children&&!Le.current){t=fr(e,t,a);break e}}else for(v=t.child,v!==null&&(v.return=t);v!==null;){var H=v.dependencies;if(H!==null){R=v.child;for(var W=H.firstContext;W!==null;){if(W.context===u){if(v.tag===1){W=ar(-1,a&-a),W.tag=2;var re=v.updateQueue;if(re!==null){re=re.shared;var Ae=re.pending;Ae===null?W.next=W:(W.next=Ae.next,Ae.next=W),re.pending=W}}v.lanes|=a,W=v.alternate,W!==null&&(W.lanes|=a),ba(v.return,a,t),H.lanes|=a;break}W=W.next}}else if(v.tag===10)R=v.type===t.type?null:v.child;else if(v.tag===18){if(R=v.return,R===null)throw Error(l(341));R.lanes|=a,H=R.alternate,H!==null&&(H.lanes|=a),ba(R,a,t),R=v.sibling}else R=v.child;if(R!==null)R.return=v;else for(R=v;R!==null;){if(R===t){R=null;break}if(v=R.sibling,v!==null){v.return=R.return,R=v;break}R=R.return}v=R}kt(e,t,A.children,a),t=t.child}return t;case 9:return A=t.type,u=t.pendingProps.children,di(t,a),A=cn(A),u=u(A),t.flags|=1,kt(e,t,u,a),t.child;case 14:return u=t.type,A=Rn(u,t.pendingProps),A=Rn(u.type,A),qu(e,t,u,A,a);case 15:return $u(e,t,t.type,t.pendingProps,a);case 17:return u=t.type,A=t.pendingProps,A=t.elementType===u?A:Rn(u,A),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,At(u)?(e=!0,Ve(t)):e=!1,di(t,a),Au(t,u,A),za(t,u,A,a),ll(null,t,u,!0,e,a);case 19:return uf(e,t,a);case 22:return ef(e,t,a)}throw Error(l(156,t.tag))};function Lf(e,t){return Da(e,t)}function Ph(e,t,a,u){this.tag=e,this.key=a,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=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,a,u){return new Ph(e,t,a,u)}function Rl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dh(e){if(typeof e=="function")return Rl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===T)return 11;if(e===w)return 14}return 2}function Ir(e,t){var a=e.alternate;return a===null?(a=mn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function Oo(e,t,a,u,A,v){var R=2;if(u=e,typeof e=="function")Rl(e)&&(R=1);else if(typeof e=="string")R=5;else e:switch(e){case p:return ti(a.children,A,v,t);case h:R=8,A|=8;break;case g:return e=mn(12,a,t,A|2),e.elementType=g,e.lanes=v,e;case S:return e=mn(13,a,t,A),e.elementType=S,e.lanes=v,e;case E:return e=mn(19,a,t,A),e.elementType=E,e.lanes=v,e;case I:return Uo(a,A,v,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y:R=10;break e;case C:R=9;break e;case T:R=11;break e;case w:R=14;break e;case M:R=16,u=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=mn(R,a,t,A),t.elementType=e,t.type=u,t.lanes=v,t}function ti(e,t,a,u){return e=mn(7,e,u,t),e.lanes=a,e}function Uo(e,t,a,u){return e=mn(22,e,u,t),e.elementType=I,e.lanes=a,e.stateNode={},e}function Fl(e,t,a){return e=mn(6,e,null,t),e.lanes=a,e}function Pl(e,t,a){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lh(e,t,a,u,A){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Gn,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fa(0),this.expirationTimes=Fa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fa(0),this.identifierPrefix=u,this.onRecoverableError=A,Ye&&(this.mutableSourceEagerHydrationData=null)}function Gf(e,t,a,u,A,v,R,H,W){return e=new Lh(e,t,a,H,W),t===1?(t=1,v===!0&&(t|=8)):t=0,v=mn(3,null,null,t),e.current=v,v.stateNode=e,v.memoizedState={element:u,isDehydrated:a,cache:null,transitions:null},ka(v),e}function Hf(e){if(!e)return ke;e=e._reactInternals;e:{if(D(e)!==e||e.tag!==1)throw Error(l(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(At(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(l(171))}if(e.tag===1){var a=e.type;if(At(a))return Ct(e,a,t)}return t}function Of(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=k(t),e===null?null:e.stateNode}function Uf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Dl(e,t){Uf(e,t),(e=e.alternate)&&Uf(e,t)}function Gh(e){return e=k(e),e===null?null:e.stateNode}function Hh(){return null}return r.attemptContinuousHydration=function(e){if(e.tag===13){var t=Jt();hn(e,134217728,t),Dl(e,134217728)}},r.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13){var t=Jt(),a=Tr(e);hn(e,a,t),Dl(e,a)}},r.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=rs(t.pendingLanes);a!==0&&(Pa(t,a|1),Yt(t,St()),!(He&6)&&(Ei(),jn()))}break;case 13:var u=Jt();xf(function(){return hn(e,1,u)}),Dl(e,1)}},r.batchedUpdates=function(e,t){var a=He;He|=1;try{return e(t)}finally{He=a,He===0&&(Ei(),Zs&&jn())}},r.createComponentSelector=function(e){return{$$typeof:wo,value:e}},r.createContainer=function(e,t,a,u,A,v,R){return Gf(e,t,!1,null,a,u,A,v,R)},r.createHasPseudoClassSelector=function(e){return{$$typeof:So,value:e}},r.createHydrationContainer=function(e,t,a,u,A,v,R,H,W){return e=Gf(a,u,!0,e,A,v,R,H,W),e.context=Hf(null),a=e.current,u=Jt(),A=Tr(a),v=ar(u,A),v.callback=t??null,Sr(a,v),e.current.lanes=A,is(e,A,u),Yt(e,u),e},r.createPortal=function(e,t,a){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:u==null?null:""+u,children:e,containerInfo:t,implementation:a}},r.createRoleSelector=function(e){return{$$typeof:Mo,value:e}},r.createTestNameSelector=function(e){return{$$typeof:xo,value:e}},r.createTextSelector=function(e){return{$$typeof:To,value:e}},r.deferredUpdates=function(e){var t=Ke,a=ht.transition;try{return ht.transition=null,Ke=16,e()}finally{Ke=t,ht.transition=a}},r.discreteUpdates=function(e,t,a,u,A){var v=Ke,R=ht.transition;try{return ht.transition=null,Ke=1,e(t,a,u,A)}finally{Ke=v,ht.transition=R,He===0&&Ei()}},r.findAllNodes=yl,r.findBoundingRects=function(e,t){if(!an)throw Error(l(363));t=yl(e,t),e=[];for(var a=0;a<t.length;a++)e.push(vr(t[a]));for(t=e.length-1;0<t;t--){a=e[t];for(var u=a.x,A=u+a.width,v=a.y,R=v+a.height,H=t-1;0<=H;H--)if(t!==H){var W=e[H],re=W.x,Ae=re+W.width,Ie=W.y,we=Ie+W.height;if(u>=re&&v>=Ie&&A<=Ae&&R<=we){e.splice(t,1);break}else if(u!==re||a.width!==W.width||we<v||Ie>R){if(!(v!==Ie||a.height!==W.height||Ae<u||re>A)){re>u&&(W.width+=re-u,W.x=u),Ae<A&&(W.width=A-re),e.splice(t,1);break}}else{Ie>v&&(W.height+=Ie-v,W.y=v),we<R&&(W.height=R-Ie),e.splice(t,1);break}}}return e},r.findHostInstance=Of,r.findHostInstanceWithNoPortals=function(e){return e=b(e),e=e!==null?Z(e):null,e===null?null:e.stateNode},r.findHostInstanceWithWarning=function(e){return Of(e)},r.flushControlled=function(e){var t=He;He|=1;var a=ht.transition,u=Ke;try{ht.transition=null,Ke=1,e()}finally{Ke=u,ht.transition=a,He=t,He===0&&(Ei(),jn())}},r.flushPassiveEffects=ei,r.flushSync=xf,r.focusWithin=function(e,t){if(!an)throw Error(l(363));for(e=Al(e),t=wf(e,t),t=Array.from(t),e=0;e<t.length;){var a=t[e++];if(!Nt(a)){if(a.tag===5&&zr(a.stateNode))return!0;for(a=a.child;a!==null;)t.push(a),a=a.sibling}}return!1},r.getCurrentUpdatePriority=function(){return Ke},r.getFindAllNodesFailureDescription=function(e,t){if(!an)throw Error(l(363));var a=0,u=[];e=[Al(e),0];for(var A=0;A<e.length;){var v=e[A++],R=e[A++],H=t[R];if((v.tag!==5||!Nt(v))&&(gl(v,H)&&(u.push(vl(H)),R++,R>a&&(a=R)),R<t.length))for(v=v.child;v!==null;)e.push(v,R),v=v.sibling}if(a<t.length){for(e=[];a<t.length;a++)e.push(vl(t[a]));return`findAllNodes was able to match part of the selector: 40 `+(u.join(" > ")+` 41 42No matching component was found for: 43 `)+e.join(" > ")}return null},r.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return ue(e.child.stateNode);default:return e.child.stateNode}},r.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:d.ReactCurrentDispatcher,findHostInstanceByFiber:Gh,findFiberByHostInstance:e.findFiberByHostInstance||Hh,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{Ys=t.inject(e),Jn=t}catch{}e=!!t.checkDCE}}return e},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(e,t,a,u){if(!an)throw Error(l(363));e=yl(e,t);var A=Qt(e,a,u).disconnect;return{disconnect:function(){A()}}},r.registerMutableSourceForHydration=function(e,t){var a=t._getVersion;a=a(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,a]:e.mutableSourceEagerHydrationData.push(t,a)},r.runWithPriority=function(e,t){var a=Ke;try{return Ke=e,t()}finally{Ke=a}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(e,t,a,u){var A=t.current,v=Jt(),R=Tr(A);return a=Hf(a),t.context===null?t.context=a:t.pendingContext=a,t=ar(v,R),t.payload={element:e},u=u===void 0?null:u,u!==null&&(t.callback=u),Sr(A,t),e=hn(A,R,v),e!==null&&eo(e,A,R),R},r};ep.exports=uA;var fA=ep.exports;const dA=Uc(fA),zc={},jc=s=>void Object.assign(zc,s);function pA(s,n){function r(p,{args:h=[],attach:g,...y},C){let T=`${p[0].toUpperCase()}${p.slice(1)}`,S;if(p==="primitive"){if(y.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const E=y.object;S=Ui(E,{type:p,root:C,attach:g,primitive:!0})}else{const E=zc[T];if(!E)throw new Error(`R3F: ${T} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");S=Ui(new E(...h),{type:p,root:C,attach:g,memoizedProps:{args:h}})}return S.__r3f.attach===void 0&&(S.isBufferGeometry?S.__r3f.attach="geometry":S.isMaterial&&(S.__r3f.attach="material")),T!=="inject"&&kl(S,y),S}function i(p,h){let g=!1;if(h){var y,C;(y=h.__r3f)!=null&&y.attach?bl(p,h,h.__r3f.attach):h.isObject3D&&p.isObject3D&&(p.add(h),g=!0),g||(C=p.__r3f)==null||C.objects.push(h),h.__r3f||Ui(h,{}),h.__r3f.parent=p,wc(h),Ni(h)}}function o(p,h,g){let y=!1;if(h){var C,T;if((C=h.__r3f)!=null&&C.attach)bl(p,h,h.__r3f.attach);else if(h.isObject3D&&p.isObject3D){h.parent=p,h.dispatchEvent({type:"added"}),p.dispatchEvent({type:"childadded",child:h});const S=p.children.filter(w=>w!==h),E=S.indexOf(g);p.children=[...S.slice(0,E),h,...S.slice(E)],y=!0}y||(T=p.__r3f)==null||T.objects.push(h),h.__r3f||Ui(h,{}),h.__r3f.parent=p,wc(h),Ni(h)}}function c(p,h,g=!1){p&&[...p].forEach(y=>l(h,y,g))}function l(p,h,g){if(h){var y,C,T;if(h.__r3f&&(h.__r3f.parent=null),(y=p.__r3f)!=null&&y.objects&&(p.__r3f.objects=p.__r3f.objects.filter(I=>I!==h)),(C=h.__r3f)!=null&&C.attach)td(p,h,h.__r3f.attach);else if(h.isObject3D&&p.isObject3D){var S;p.remove(h),(S=h.__r3f)!=null&&S.root&&BA(ua(h),h)}const w=(T=h.__r3f)==null?void 0:T.primitive,M=!w&&(g===void 0?h.dispose!==null:g);if(!w){var E;c((E=h.__r3f)==null?void 0:E.objects,h,M),c(h.children,h,M)}if(delete h.__r3f,M&&h.dispose&&h.type!=="Scene"){const I=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?Cc.unstable_scheduleCallback(Cc.unstable_IdlePriority,I):I()}Ni(p)}}function d(p,h,g,y){var C;const T=(C=p.__r3f)==null?void 0:C.parent;if(!T)return;const S=r(h,g,p.__r3f.root);if(p.children){for(const E of p.children)E.__r3f&&i(S,E);p.children=p.children.filter(E=>!E.__r3f)}p.__r3f.objects.forEach(E=>i(S,E)),p.__r3f.objects=[],p.__r3f.autoRemovedBeforeAppend||l(T,p),S.parent&&(S.__r3f.autoRemovedBeforeAppend=!0),i(T,S),S.raycast&&S.__r3f.eventCount&&ua(S).getState().internal.interaction.push(S),[y,y.alternate].forEach(E=>{E!==null&&(E.stateNode=S,E.ref&&(typeof E.ref=="function"?E.ref(S):E.ref.current=S))})}const f=()=>{};return{reconciler:dA({createInstance:r,removeChild:l,appendChild:i,appendInitialChild:i,insertBefore:o,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(p,h)=>{if(!h)return;const g=p.getState().scene;g.__r3f&&(g.__r3f.root=p,i(g,h))},removeChildFromContainer:(p,h)=>{h&&l(p.getState().scene,h)},insertInContainerBefore:(p,h,g)=>{if(!h||!g)return;const y=p.getState().scene;y.__r3f&&o(y,h,g)},getRootHostContext:()=>null,getChildHostContext:p=>p,finalizeInitialChildren(p){var h;return!!((h=p==null?void 0:p.__r3f)!=null?h:{}).handlers},prepareUpdate(p,h,g,y){var C;if(((C=p==null?void 0:p.__r3f)!=null?C:{}).primitive&&y.object&&y.object!==p)return[!0];{const{args:S=[],children:E,...w}=y,{args:M=[],children:I,..._}=g;if(!Array.isArray(S))throw new Error("R3F: the args prop must be an array!");if(S.some((G,P)=>G!==M[P]))return[!0];const F=cp(p,w,_,!0);return F.changes.length?[!1,F]:null}},commitUpdate(p,[h,g],y,C,T,S){h?d(p,y,T,S):kl(p,g)},commitMount(p,h,g,y){var C;const T=(C=p.__r3f)!=null?C:{};p.raycast&&T.handlers&&T.eventCount&&ua(p).getState().internal.interaction.push(p)},getPublicInstance:p=>p,prepareForCommit:()=>null,preparePortalMount:p=>Ui(p.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(p){var h;const{attach:g,parent:y}=(h=p.__r3f)!=null?h:{};g&&y&&td(y,p,g),p.isObject3D&&(p.visible=!1),Ni(p)},unhideInstance(p,h){var g;const{attach:y,parent:C}=(g=p.__r3f)!=null?g:{};y&&C&&bl(C,p,y),(p.isObject3D&&h.visible==null||h.visible)&&(p.visible=!0),Ni(p)},createTextInstance:f,hideTextInstance:f,unhideTextInstance:f,getCurrentEventPriority:()=>n?n():Ji.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&tt.fun(performance.now)?performance.now:tt.fun(Date.now)?Date.now:()=>0,scheduleTimeout:tt.fun(setTimeout)?setTimeout:void 0,cancelTimeout:tt.fun(clearTimeout)?clearTimeout:void 0}),applyProps:kl}}var Vf,qf;const Nl=s=>"colorSpace"in s||"outputColorSpace"in s,rp=()=>{var s;return(s=zc.ColorManagement)!=null?s:null},ip=s=>s&&s.isOrthographicCamera,hA=s=>s&&s.hasOwnProperty("current"),ks=typeof window<"u"&&((Vf=window.document)!=null&&Vf.createElement||((qf=window.navigator)==null?void 0:qf.product)==="ReactNative")?j.useLayoutEffect:j.useEffect;function sp(s){const n=j.useRef(s);return ks(()=>void(n.current=s),[s]),n}function mA({set:s}){return ks(()=>(s(new Promise(()=>null)),()=>s(!1)),[s]),null}class op extends j.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}}op.getDerivedStateFromError=()=>({error:!0});const ap="__default",$f=new Map,AA=s=>s&&!!s.memoized&&!!s.changes;function lp(s){var n;const r=typeof window<"u"?(n=window.devicePixelRatio)!=null?n:2:1;return Array.isArray(s)?Math.min(Math.max(s[0],r),s[1]):s}const Es=s=>{var n;return(n=s.__r3f)==null?void 0:n.root.getState()};function ua(s){let n=s.__r3f.root;for(;n.getState().previousRoot;)n=n.getState().previousRoot;return n}const tt={obj:s=>s===Object(s)&&!tt.arr(s)&&typeof s!="function",fun:s=>typeof s=="function",str:s=>typeof s=="string",num:s=>typeof s=="number",boo:s=>typeof s=="boolean",und:s=>s===void 0,arr:s=>Array.isArray(s),equ(s,n,{arrays:r="shallow",objects:i="reference",strict:o=!0}={}){if(typeof s!=typeof n||!!s!=!!n)return!1;if(tt.str(s)||tt.num(s)||tt.boo(s))return s===n;const c=tt.obj(s);if(c&&i==="reference")return s===n;const l=tt.arr(s);if(l&&r==="reference")return s===n;if((l||c)&&s===n)return!0;let d;for(d in s)if(!(d in n))return!1;if(c&&r==="shallow"&&i==="shallow"){for(d in o?n:s)if(!tt.equ(s[d],n[d],{strict:o,objects:"reference"}))return!1}else for(d in o?n:s)if(s[d]!==n[d])return!1;if(tt.und(d)){if(l&&s.length===0&&n.length===0||c&&Object.keys(s).length===0&&Object.keys(n).length===0)return!0;if(s!==n)return!1}return!0}};function gA(s){const n={nodes:{},materials:{}};return s&&s.traverse(r=>{r.name&&(n.nodes[r.name]=r),r.material&&!n.materials[r.material.name]&&(n.materials[r.material.name]=r.material)}),n}function vA(s){s.dispose&&s.type!=="Scene"&&s.dispose();for(const n in s)n.dispose==null||n.dispose(),delete s[n]}function Ui(s,n){const r=s;return r.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...n},s}function Ec(s,n){let r=s;if(n.includes("-")){const i=n.split("-"),o=i.pop();return r=i.reduce((c,l)=>c[l],s),{target:r,key:o}}else return{target:r,key:n}}const ed=/-\d+$/;function bl(s,n,r){if(tt.str(r)){if(ed.test(r)){const c=r.replace(ed,""),{target:l,key:d}=Ec(s,c);Array.isArray(l[d])||(l[d]=[])}const{target:i,key:o}=Ec(s,r);n.__r3f.previousAttach=i[o],i[o]=n}else n.__r3f.previousAttach=r(s,n)}function td(s,n,r){var i,o;if(tt.str(r)){const{target:c,key:l}=Ec(s,r),d=n.__r3f.previousAttach;d===void 0?delete c[l]:c[l]=d}else(i=n.__r3f)==null||i.previousAttach==null||i.previousAttach(s,n);(o=n.__r3f)==null||delete o.previousAttach}function cp(s,{children:n,key:r,ref:i,...o},{children:c,key:l,ref:d,...f}={},m=!1){const p=s.__r3f,h=Object.entries(o),g=[];if(m){const C=Object.keys(f);for(let T=0;T<C.length;T++)o.hasOwnProperty(C[T])||h.unshift([C[T],ap+"remove"])}h.forEach(([C,T])=>{var S;if((S=s.__r3f)!=null&&S.primitive&&C==="object"||tt.equ(T,f[C]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(C))return g.push([C,T,!0,[]]);let E=[];C.includes("-")&&(E=C.split("-")),g.push([C,T,!1,E]);for(const w in o){const M=o[w];w.startsWith(`${C}-`)&&g.push([w,M,!1,w.split("-")])}});const y={...o};return p!=null&&p.memoizedProps&&p!=null&&p.memoizedProps.args&&(y.args=p.memoizedProps.args),p!=null&&p.memoizedProps&&p!=null&&p.memoizedProps.attach&&(y.attach=p.memoizedProps.attach),{memoized:y,changes:g}}function kl(s,n){var r;const i=s.__r3f,o=i==null?void 0:i.root,c=o==null||o.getState==null?void 0:o.getState(),{memoized:l,changes:d}=AA(n)?n:cp(s,n),f=i==null?void 0:i.eventCount;s.__r3f&&(s.__r3f.memoizedProps=l);for(let g=0;g<d.length;g++){let[y,C,T,S]=d[g];if(Nl(s)){const I="srgb",_="srgb-linear";y==="encoding"?(y="colorSpace",C=C===3001?I:_):y==="outputEncoding"&&(y="outputColorSpace",C=C===3001?I:_)}let E=s,w=E[y];if(S.length&&(w=S.reduce((M,I)=>M[I],s),!(w&&w.set))){const[M,...I]=S.reverse();E=I.reverse().reduce((_,F)=>_[F],s),y=M}if(C===ap+"remove")if(E.constructor){let M=$f.get(E.constructor);M||(M=new E.constructor,$f.set(E.constructor,M)),C=M[y]}else C=0;if(T&&i)C?i.handlers[y]=C:delete i.handlers[y],i.eventCount=Object.keys(i.handlers).length;else if(w&&w.set&&(w.copy||w instanceof Gl)){if(Array.isArray(C))w.fromArray?w.fromArray(C):w.set(...C);else if(w.copy&&C&&C.constructor&&w.constructor===C.constructor)w.copy(C);else if(C!==void 0){var m;const M=(m=w)==null?void 0:m.isColor;!M&&w.setScalar?w.setScalar(C):w instanceof Gl&&C instanceof Gl?w.mask=C.mask:w.set(C),!rp()&&c&&!c.linear&&M&&w.convertSRGBToLinear()}}else{var p;if(E[y]=C,(p=E[y])!=null&&p.isTexture&&E[y].format===Qi&&E[y].type===da&&c){const M=E[y];Nl(M)&&Nl(c.gl)?M.colorSpace=c.gl.outputColorSpace:M.encoding=c.gl.outputEncoding}}Ni(s)}if(i&&i.parent&&s.raycast&&f!==i.eventCount){const g=ua(s).getState().internal,y=g.interaction.indexOf(s);y>-1&&g.interaction.splice(y,1),i.eventCount&&g.interaction.push(s)}return!(d.length===1&&d[0][0]==="onUpdate")&&d.length&&(r=s.__r3f)!=null&&r.parent&&wc(s),s}function Ni(s){var n,r;const i=(n=s.__r3f)==null||(r=n.root)==null||r.getState==null?void 0:r.getState();i&&i.internal.frames===0&&i.invalidate()}function wc(s){s.onUpdate==null||s.onUpdate(s)}function up(s,n){s.manual||(ip(s)?(s.left=n.width/-2,s.right=n.width/2,s.top=n.height/2,s.bottom=n.height/-2):s.aspect=n.width/n.height,s.updateProjectionMatrix(),s.updateMatrixWorld())}function bo(s){return(s.eventObject||s.object).uuid+"/"+s.index+s.instanceId}function yA(){var s;const n=typeof self<"u"&&self||typeof window<"u"&&window;if(!n)return Ji.DefaultEventPriority;switch((s=n.event)==null?void 0:s.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ji.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ji.ContinuousEventPriority;default:return Ji.DefaultEventPriority}}function fp(s,n,r,i){const o=r.get(n);o&&(r.delete(n),r.size===0&&(s.delete(i),o.target.releasePointerCapture(i)))}function BA(s,n){const{internal:r}=s.getState();r.interaction=r.interaction.filter(i=>i!==n),r.initialHits=r.initialHits.filter(i=>i!==n),r.hovered.forEach((i,o)=>{(i.eventObject===n||i.object===n)&&r.hovered.delete(o)}),r.capturedMap.forEach((i,o)=>{fp(r.capturedMap,n,i,o)})}function CA(s){function n(f){const{internal:m}=s.getState(),p=f.offsetX-m.initialClick[0],h=f.offsetY-m.initialClick[1];return Math.round(Math.sqrt(p*p+h*h))}function r(f){return f.filter(m=>["Move","Over","Enter","Out","Leave"].some(p=>{var h;return(h=m.__r3f)==null?void 0:h.handlers["onPointer"+p]}))}function i(f,m){const p=s.getState(),h=new Set,g=[],y=m?m(p.internal.interaction):p.internal.interaction;for(let E=0;E<y.length;E++){const w=Es(y[E]);w&&(w.raycaster.camera=void 0)}p.previousRoot||p.events.compute==null||p.events.compute(f,p);function C(E){const w=Es(E);if(!w||!w.events.enabled||w.raycaster.camera===null)return[];if(w.raycaster.camera===void 0){var M;w.events.compute==null||w.events.compute(f,w,(M=w.previousRoot)==null?void 0:M.getState()),w.raycaster.camera===void 0&&(w.raycaster.camera=null)}return w.raycaster.camera?w.raycaster.intersectObject(E,!0):[]}let T=y.flatMap(C).sort((E,w)=>{const M=Es(E.object),I=Es(w.object);return!M||!I?E.distance-w.distance:I.events.priority-M.events.priority||E.distance-w.distance}).filter(E=>{const w=bo(E);return h.has(w)?!1:(h.add(w),!0)});p.events.filter&&(T=p.events.filter(T,p));for(const E of T){let w=E.object;for(;w;){var S;(S=w.__r3f)!=null&&S.eventCount&&g.push({...E,eventObject:w}),w=w.parent}}if("pointerId"in f&&p.internal.capturedMap.has(f.pointerId))for(let E of p.internal.capturedMap.get(f.pointerId).values())h.has(bo(E.intersection))||g.push(E.intersection);return g}function o(f,m,p,h){const g=s.getState();if(f.length){const y={stopped:!1};for(const C of f){const T=Es(C.object)||g,{raycaster:S,pointer:E,camera:w,internal:M}=T,I=new $(E.x,E.y,0).unproject(w),_=O=>{var b,k;return(b=(k=M.capturedMap.get(O))==null?void 0:k.has(C.eventObject))!=null?b:!1},F=O=>{const b={intersection:C,target:m.target};M.capturedMap.has(O)?M.capturedMap.get(O).set(C.eventObject,b):M.capturedMap.set(O,new Map([[C.eventObject,b]])),m.target.setPointerCapture(O)},G=O=>{const b=M.capturedMap.get(O);b&&fp(M.capturedMap,C.eventObject,b,O)};let P={};for(let O in m){let b=m[O];typeof b!="function"&&(P[O]=b)}let D={...C,...P,pointer:E,intersections:f,stopped:y.stopped,delta:p,unprojectedPoint:I,ray:S.ray,camera:w,stopPropagation(){const O="pointerId"in m&&M.capturedMap.get(m.pointerId);if((!O||O.has(C.eventObject))&&(D.stopped=y.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(b=>b.eventObject===C.eventObject))){const b=f.slice(0,f.indexOf(C));c([...b,C])}},target:{hasPointerCapture:_,setPointerCapture:F,releasePointerCapture:G},currentTarget:{hasPointerCapture:_,setPointerCapture:F,releasePointerCapture:G},nativeEvent:m};if(h(D),y.stopped===!0)break}}return f}function c(f){const{internal:m}=s.getState();for(const p of m.hovered.values())if(!f.length||!f.find(h=>h.object===p.object&&h.index===p.index&&h.instanceId===p.instanceId)){const g=p.eventObject.__r3f,y=g==null?void 0:g.handlers;if(m.hovered.delete(bo(p)),g!=null&&g.eventCount){const C={...p,intersections:f};y.onPointerOut==null||y.onPointerOut(C),y.onPointerLeave==null||y.onPointerLeave(C)}}}function l(f,m){for(let p=0;p<m.length;p++){const h=m[p].__r3f;h==null||h.handlers.onPointerMissed==null||h.handlers.onPointerMissed(f)}}function d(f){switch(f){case"onPointerLeave":case"onPointerCancel":return()=>c([]);case"onLostPointerCapture":return m=>{const{internal:p}=s.getState();"pointerId"in m&&p.capturedMap.has(m.pointerId)&&requestAnimationFrame(()=>{p.capturedMap.has(m.pointerId)&&(p.capturedMap.delete(m.pointerId),c([]))})}}return function(p){const{onPointerMissed:h,internal:g}=s.getState();g.lastEvent.current=p;const y=f==="onPointerMove",C=f==="onClick"||f==="onContextMenu"||f==="onDoubleClick",S=i(p,y?r:void 0),E=C?n(p):0;f==="onPointerDown"&&(g.initialClick=[p.offsetX,p.offsetY],g.initialHits=S.map(M=>M.eventObject)),C&&!S.length&&E<=2&&(l(p,g.interaction),h&&h(p)),y&&c(S);function w(M){const I=M.eventObject,_=I.__r3f,F=_==null?void 0:_.handlers;if(_!=null&&_.eventCount)if(y){if(F.onPointerOver||F.onPointerEnter||F.onPointerOut||F.onPointerLeave){const G=bo(M),P=g.hovered.get(G);P?P.stopped&&M.stopPropagation():(g.hovered.set(G,M),F.onPointerOver==null||F.onPointerOver(M),F.onPointerEnter==null||F.onPointerEnter(M))}F.onPointerMove==null||F.onPointerMove(M)}else{const G=F[f];G?(!C||g.initialHits.includes(I))&&(l(p,g.interaction.filter(P=>!g.initialHits.includes(P))),G(M)):C&&g.initialHits.includes(I)&&l(p,g.interaction.filter(P=>!g.initialHits.includes(P)))}}o(S,p,E,w)}}return{handlePointer:d}}const EA=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],dp=s=>!!(s!=null&&s.render),Kc=j.createContext(null),wA=(s,n)=>{const r=Vd((d,f)=>{const m=new $,p=new $,h=new $;function g(E=f().camera,w=p,M=f().size){const{width:I,height:_,top:F,left:G}=M,P=I/_;w.isVector3?h.copy(w):h.set(...w);const D=E.getWorldPosition(m).distanceTo(h);if(ip(E))return{width:I/E.zoom,height:_/E.zoom,top:F,left:G,factor:1,distance:D,aspect:P};{const O=E.fov*Math.PI/180,b=2*Math.tan(O/2)*D,k=b*(I/_);return{width:k,height:b,top:F,left:G,factor:I/k,distance:D,aspect:P}}}let y;const C=E=>d(w=>({performance:{...w.performance,current:E}})),T=new at;return{set:d,get:f,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(E=1)=>s(f(),E),advance:(E,w)=>n(E,w,f()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Kh,pointer:T,mouse:T,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const E=f();y&&clearTimeout(y),E.performance.current!==E.performance.min&&C(E.performance.min),y=setTimeout(()=>C(f().performance.max),E.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:g},setEvents:E=>d(w=>({...w,events:{...w.events,...E}})),setSize:(E,w,M,I,_)=>{const F=f().camera,G={width:E,height:w,top:I||0,left:_||0,updateStyle:M};d(P=>({size:G,viewport:{...P.viewport,...g(F,p,G)}}))},setDpr:E=>d(w=>{const M=lp(E);return{viewport:{...w.viewport,dpr:M,initialDpr:w.viewport.initialDpr||M}}}),setFrameloop:(E="always")=>{const w=f().clock;w.stop(),w.elapsedTime=0,E!=="never"&&(w.start(),w.elapsedTime=0),d(()=>({frameloop:E}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:j.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(E,w,M)=>{const I=f().internal;return I.priority=I.priority+(w>0?1:0),I.subscribers.push({ref:E,priority:w,store:M}),I.subscribers=I.subscribers.sort((_,F)=>_.priority-F.priority),()=>{const _=f().internal;_!=null&&_.subscribers&&(_.priority=_.priority-(w>0?1:0),_.subscribers=_.subscribers.filter(F=>F.ref!==E))}}}}}),i=r.getState();let o=i.size,c=i.viewport.dpr,l=i.camera;return r.subscribe(()=>{const{camera:d,size:f,viewport:m,gl:p,set:h}=r.getState();if(f.width!==o.width||f.height!==o.height||m.dpr!==c){var g;o=f,c=m.dpr,up(d,f),p.setPixelRatio(m.dpr);const y=(g=f.updateStyle)!=null?g:typeof HTMLCanvasElement<"u"&&p.domElement instanceof HTMLCanvasElement;p.setSize(f.width,f.height,y)}d!==l&&(l=d,h(y=>({viewport:{...y.viewport,...y.viewport.getCurrentViewport(d)}})))}),r.subscribe(d=>s(d)),r};let ko,SA=new Set,MA=new Set,xA=new Set;function Jl(s,n){if(s.size)for(const{callback:r}of s.values())r(n)}function ws(s,n){switch(s){case"before":return Jl(SA,n);case"after":return Jl(MA,n);case"tail":return Jl(xA,n)}}let zl,jl;function Kl(s,n,r){let i=n.clock.getDelta();for(n.frameloop==="never"&&typeof s=="number"&&(i=s-n.clock.elapsedTime,n.clock.oldTime=n.clock.elapsedTime,n.clock.elapsedTime=s),zl=n.internal.subscribers,ko=0;ko<zl.length;ko++)jl=zl[ko],jl.ref.current(jl.store.getState(),i,r);return!n.internal.priority&&n.gl.render&&n.gl.render(n.scene,n.camera),n.internal.frames=Math.max(0,n.internal.frames-1),n.frameloop==="always"?1:n.internal.frames}function TA(s){let n=!1,r=!1,i,o,c;function l(m){o=requestAnimationFrame(l),n=!0,i=0,ws("before",m),r=!0;for(const h of s.values()){var p;c=h.store.getState(),c.internal.active&&(c.frameloop==="always"||c.internal.frames>0)&&!((p=c.gl.xr)!=null&&p.isPresenting)&&(i+=Kl(m,c))}if(r=!1,ws("after",m),i===0)return ws("tail",m),n=!1,cancelAnimationFrame(o)}function d(m,p=1){var h;if(!m)return s.forEach(g=>d(g.store.getState(),p));(h=m.gl.xr)!=null&&h.isPresenting||!m.internal.active||m.frameloop==="never"||(p>1?m.internal.frames=Math.min(60,m.internal.frames+p):r?m.internal.frames=2:m.internal.frames=1,n||(n=!0,requestAnimationFrame(l)))}function f(m,p=!0,h,g){if(p&&ws("before",m),h)Kl(m,h,g);else for(const y of s.values())Kl(m,y.store.getState());p&&ws("after",m)}return{loop:l,invalidate:d,advance:f}}function Qc(){const s=j.useContext(Kc);if(!s)throw new Error("R3F: Hooks can only be used within the Canvas component!");return s}function ct(s=r=>r,n){return Qc()(s,n)}function Ea(s,n=0){const r=Qc(),i=r.getState().internal.subscribe,o=sp(s);return ks(()=>i(o,n,r),[n,i,r]),null}const nd=new WeakMap;function pp(s,n){return function(r,...i){let o=nd.get(r);return o||(o=new r,nd.set(r,o)),s&&s(o),Promise.all(i.map(c=>new Promise((l,d)=>o.load(c,f=>{f.scene&&Object.assign(f,gA(f.scene)),l(f)},n,f=>d(new Error(`Could not load ${c}: ${f==null?void 0:f.message}`))))))}}function xn(s,n,r,i){const o=Array.isArray(n)?n:[n],c=aA(pp(r,i),[s,...o],{equal:tt.equ});return Array.isArray(n)?c:c[0]}xn.preload=function(s,n,r){const i=Array.isArray(n)?n:[n];return lA(pp(r),[s,...i])};xn.clear=function(s,n){const r=Array.isArray(n)?n:[n];return cA([s,...r])};const Wi=new Map,{invalidate:rd,advance:id}=TA(Wi),{reconciler:Ns,applyProps:Lr}=pA(Wi,yA),Mi={objects:"shallow",strict:!1},_A=(s,n)=>{const r=typeof s=="function"?s(n):s;return dp(r)?r:new Hd({powerPreference:"high-performance",canvas:n,antialias:!0,alpha:!0,...s})};function IA(s,n){const r=typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement;if(n){const{width:i,height:o,top:c,left:l,updateStyle:d=r}=n;return{width:i,height:o,top:c,left:l,updateStyle:d}}else if(typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement&&s.parentElement){const{width:i,height:o,top:c,left:l}=s.parentElement.getBoundingClientRect();return{width:i,height:o,top:c,left:l,updateStyle:r}}else if(typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas)return{width:s.width,height:s.height,top:0,left:0,updateStyle:r};return{width:0,height:0,top:0,left:0}}function RA(s){const n=Wi.get(s),r=n==null?void 0:n.fiber,i=n==null?void 0:n.store;n&&console.warn("R3F.createRoot should only be called once!");const o=typeof reportError=="function"?reportError:console.error,c=i||wA(rd,id),l=r||Ns.createContainer(c,Ji.ConcurrentRoot,null,!1,null,"",o,null);n||Wi.set(s,{fiber:l,store:c});let d,f=!1,m;return{configure(p={}){let{gl:h,size:g,scene:y,events:C,onCreated:T,shadows:S=!1,linear:E=!1,flat:w=!1,legacy:M=!1,orthographic:I=!1,frameloop:_="always",dpr:F=[1,2],performance:G,raycaster:P,camera:D,onPointerMissed:O}=p,b=c.getState(),k=b.gl;b.gl||b.set({gl:k=_A(h,s)});let Y=b.raycaster;Y||b.set({raycaster:Y=new Gd});const{params:Z,...se}=P||{};if(tt.equ(se,Y,Mi)||Lr(Y,{...se}),tt.equ(Z,Y.params,Mi)||Lr(Y,{params:{...Y.params,...Z}}),!b.camera||b.camera===m&&!tt.equ(m,D,Mi)){m=D;const q=D instanceof jh,ge=q?D:I?new Ur(0,0,0,0,.1,1e3):new oi(75,0,.1,1e3);q||(ge.position.z=5,D&&(Lr(ge,D),("aspect"in D||"left"in D||"right"in D||"bottom"in D||"top"in D)&&(ge.manual=!0,ge.updateProjectionMatrix())),!b.camera&&!(D!=null&&D.rotation)&&ge.lookAt(0,0,0)),b.set({camera:ge}),Y.camera=ge}if(!b.scene){let q;y!=null&&y.isScene?q=y:(q=new Nc,y&&Lr(q,y)),b.set({scene:Ui(q)})}if(!b.xr){var ue;const q=(ve,ze)=>{const nt=c.getState();nt.frameloop!=="never"&&id(ve,!0,nt,ze)},ge=()=>{const ve=c.getState();ve.gl.xr.enabled=ve.gl.xr.isPresenting,ve.gl.xr.setAnimationLoop(ve.gl.xr.isPresenting?q:null),ve.gl.xr.isPresenting||rd(ve)},he={connect(){const ve=c.getState().gl;ve.xr.addEventListener("sessionstart",ge),ve.xr.addEventListener("sessionend",ge)},disconnect(){const ve=c.getState().gl;ve.xr.removeEventListener("sessionstart",ge),ve.xr.removeEventListener("sessionend",ge)}};typeof((ue=k.xr)==null?void 0:ue.addEventListener)=="function"&&he.connect(),b.set({xr:he})}if(k.shadowMap){const q=k.shadowMap.enabled,ge=k.shadowMap.type;if(k.shadowMap.enabled=!!S,tt.boo(S))k.shadowMap.type=Ll;else if(tt.str(S)){var Me;const he={basic:kh,percentage:bh,soft:Ll,variance:Nh};k.shadowMap.type=(Me=he[S])!=null?Me:Ll}else tt.obj(S)&&Object.assign(k.shadowMap,S);(q!==k.shadowMap.enabled||ge!==k.shadowMap.type)&&(k.shadowMap.needsUpdate=!0)}const V=rp();V&&("enabled"in V?V.enabled=!M:"legacyMode"in V&&(V.legacyMode=M)),f||Lr(k,{outputEncoding:E?3e3:3001,toneMapping:w?Jh:zh}),b.legacy!==M&&b.set(()=>({legacy:M})),b.linear!==E&&b.set(()=>({linear:E})),b.flat!==w&&b.set(()=>({flat:w})),h&&!tt.fun(h)&&!dp(h)&&!tt.equ(h,k,Mi)&&Lr(k,h),C&&!b.events.handlers&&b.set({events:C(c)});const fe=IA(s,g);return tt.equ(fe,b.size,Mi)||b.setSize(fe.width,fe.height,fe.updateStyle,fe.top,fe.left),F&&b.viewport.dpr!==lp(F)&&b.setDpr(F),b.frameloop!==_&&b.setFrameloop(_),b.onPointerMissed||b.set({onPointerMissed:O}),G&&!tt.equ(G,b.performance,Mi)&&b.set(q=>({performance:{...q.performance,...G}})),d=T,f=!0,this},render(p){return f||this.configure(),Ns.updateContainer(zt.jsx(FA,{store:c,children:p,onCreated:d,rootElement:s}),l,null,()=>{}),c},unmount(){hp(s)}}}function FA({store:s,children:n,onCreated:r,rootElement:i}){return ks(()=>
43{const o=s.getState();o.set(c=>({internal:{...c.internal,active:!0}})),r&&r(o),s.getState().events.connected||o.events.connect==null||o.events.connect(i)},[]),zt.jsx(Kc.Provider,{value:s,children:n})}function hp(s,n){const r=Wi.get(s),i=r==null?void 0:r.fiber;if(i){const o=r==null?void 0:r.store.getState();o&&(o.internal.active=!1),Ns.updateContainer(null,i,null,()=>{o&&setTimeout(()=>{try{var c,l,d,f;o.events.disconnect==null||o.events.disconnect(),(c=o.gl)==null||(l=c.renderLists)==null||l.dispose==null||l.dispose(),(d=o.gl)==null||d.forceContextLoss==null||d.forceContextLoss(),(f=o.gl)!=null&&f.xr&&o.xr.disconnect(),vA(o),Wi.delete(s)}catch{}},500)})}}function PA(s,n,r){return zt.jsx(DA,{children:s,container:n,state:r},n.uuid)}function DA({state:s={},children:n,container:r}){const{events:i,size:o,...c}=s,l=Qc(),[d]=j.useState(()=>new Gd),[f]=j.useState(()=>new at),m=j.useCallback((h,g)=>{const y={...h};Object.keys(h).forEach(T=>{(EA.includes(T)||h[T]!==g[T]&&g[T])&&delete y[T]});let C;if(g&&o){const T=g.camera;C=h.viewport.getCurrentViewport(T,new $,o),T!==h.camera&&up(T,o)}return{...y,scene:r,raycaster:d,pointer:f,mouse:f,previousRoot:l,events:{...h.events,...g==null?void 0:g.events,...i},size:{...h.size,...o},viewport:{...h.viewport,...C},...c}},[s]),[p]=j.useState(()=>{const h=l.getState();return Vd((y,C)=>({...h,scene:r,raycaster:d,pointer:f,mouse:f,previousRoot:l,events:{...h.events,...i},size:{...h.size,...o},...c,set:y,get:C,setEvents:T=>y(S=>({...S,events:{...S.events,...T}}))}))});return j.useEffect(()=>{const h=l.subscribe(g=>p.setState(y=>m(g,y)));return()=>{h()}},[m]),j.useEffect(()=>{p.setState(h=>m(l.getState(),h))},[m]),j.useEffect(()=>()=>{p.destroy()},[]),zt.jsx(zt.Fragment,{children:Ns.createPortal(zt.jsx(Kc.Provider,{value:p,children:n}),p,null)})}Ns.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:j.version});const Ql={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 LA(s){const{handlePointer:n}=CA(s);return{priority:1,enabled:!0,compute(r,i,o){i.pointer.set(r.offsetX/i.size.width*2-1,-(r.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(Ql).reduce((r,i)=>({...r,[i]:n(i)}),{}),update:()=>{var r;const{events:i,internal:o}=s.getState();(r=o.lastEvent)!=null&&r.current&&i.handlers&&i.handlers.onPointerMove(o.lastEvent.current)},connect:r=>{var i;const{set:o,events:c}=s.getState();c.disconnect==null||c.disconnect(),o(l=>({events:{...l.events,connected:r}})),Object.entries((i=c.handlers)!=null?i:[]).forEach(([l,d])=>{const[f,m]=Ql[l];r.addEventListener(f,d,{passive:m})})},disconnect:()=>{const{set:r,events:i}=s.getState();if(i.connected){var o;Object.entries((o=i.handlers)!=null?o:[]).forEach(([c,l])=>{if(i&&i.connected instanceof HTMLElement){const[d]=Ql[c];i.connected.removeEventListener(d,l)}}),r(c=>({events:{...c.events,connected:void 0}}))}}}}function sd(s,n){let r;return(...i)=>{window.clearTimeout(r),r=window.setTimeout(()=>s(...i),n)}}function GA({debounce:s,scroll:n,polyfill:r,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const o=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!o)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[c,l]=j.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),d=j.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:c,orientationHandler:null}),f=s?typeof s=="number"?s:s.scroll:null,m=s?typeof s=="number"?s:s.resize:null,p=j.useRef(!1);j.useEffect(()=>(p.current=!0,()=>void(p.current=!1)));const[h,g,y]=j.useMemo(()=>{const E=()=>{if(!d.current.element)return;const{left:w,top:M,width:I,height:_,bottom:F,right:G,x:P,y:D}=d.current.element.getBoundingClientRect(),O={left:w,top:M,width:I,height:_,bottom:F,right:G,x:P,y:D};d.current.element instanceof HTMLElement&&i&&(O.height=d.current.element.offsetHeight,O.width=d.current.element.offsetWidth),Object.freeze(O),p.current&&!NA(d.current.lastBounds,O)&&l(d.current.lastBounds=O)};return[E,m?sd(E,m):E,f?sd(E,f):E]},[l,i,f,m]);
43function C(){d.current.scrollContainers&&(d.current.scrollContainers.forEach(E=>E.removeEventListener("scroll",y,!0)),d.current.scrollContainers=null),d.current.resizeObserver&&(d.current.resizeObserver.disconnect(),d.current.resizeObserver=null),d.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",d.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",d.current.orientationHandler))}function T(){d.current.element&&(d.current.resizeObserver=new o(y),d.current.resizeObserver.observe(d.current.element),n&&d.current.scrollContainers&&d.current.scrollContainers.forEach(E=>E.addEventListener("scroll",y,{capture:!0,passive:!0})),d.current.orientationHandler=()=>{y()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",d.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",d.current.orientationHandler))}const S=E=>{!E||E===d.current.element||(C(),d.current.element=E,d.current.scrollContainers=mp(E),T())};return OA(y,!!n),HA(g),j.useEffect(()=>{C(),T()},[n,y,g]),j.useEffect(()=>C,[]),[S,c,h]}function HA(s){j.useEffect(()=>{const n=s;return window.addEventListener("resize",n),()=>void window.removeEventListener("resize",n)},[s])}function OA(s,n){j.useEffect(()=>{if(n){const r=s;return window.addEventListener("scroll",r,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",r,!0)}},[s,n])}function mp(s){const n=[];if(!s||s===document.body)return n;const{overflow:r,overflowX:i,overflowY:o}=window.getComputedStyle(s);return[r,i,o].some(c=>c==="auto"||c==="scroll")&&n.push(s),[...n,...mp(s.parentElement)]}const UA=["x","y","top","bottom","left","right","width","height"],NA=(s,n)=>UA.every(r=>s[r]===n[r]),bA=j.forwardRef(function({children:n,fallback:r,resize:i,style:o,gl:c,events:l=LA,eventSource:d,eventPrefix:f,shadows:m,linear:p,flat:h,legacy:g,orthographic:y,frameloop:C,dpr:T,performance:S,raycaster:E,camera:w,scene:M,onPointerMissed:I,onCreated:_,...F},G){j.useMemo(()=>jc(Qh),[]);const P=bm(),[D,O]=GA({scroll:!0,debounce:{scroll:50,resize:0},...i}),b=j.useRef(null),k=j.useRef(null);j.useImperativeHandle(G,()=>b.current);const Y=sp(I),[Z,se]=j.useState(!1),[ue,Me]=j.useState(!1);if(Z)throw Z;if(ue)throw ue;const V=j.useRef(null);ks(()=>{const q=b.current;O.width>0&&O.height>0&&q&&(V.current||(V.current=RA(q)),V.current.configure({gl:c,events:l,shadows:m,linear:p,flat:h,legacy:g,orthographic:y,frameloop:C,dpr:T,performance:S,raycaster:E,camera:w,scene:M,size:O,onPointerMissed:(...ge)=>Y.current==null?void 0:Y.current(...ge),onCreated:ge=>{ge.events.connect==null||ge.events.connect(d?hA(d)?d.current:d:k.current),f&&ge.setEvents({compute:(he,ve)=>{const ze=he[f+"X"],nt=he[f+"Y"];ve.pointer.set(ze/ve.size.width*2-1,-(nt/ve.size.height)*2+1),ve.raycaster.setFromCamera(ve.pointer,ve.camera)}}),_==null||_(ge)}}),V.current.render(zt.jsx(P,{children:zt.jsx(op,{set:Me,children:zt.jsx(j.Suspense,{fallback:zt.jsx(mA,{set:se}),children:n??null})})})))}),j.useEffect(()=>{const q=b.current;if(q)return()=>hp(q)},[]);const fe=d?"none":"auto";return zt.jsx("div",{ref:k,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:fe,...o},...F,children:zt.jsx("div",{ref:D,style:{width:"100%",height:"100%"},children:zt.jsx("canvas",{ref:b,style:{display:"block"},children:r})})})}),ay=j.forwardRef(function(n,r){return zt.jsx(Nm,{children:zt.jsx(bA,{...n,ref:r})})});function Tn(){return Tn=Object.assign?Object.assign.bind():function(s){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)({}).hasOwnProperty.call(r,i)&&(s[i]=r[i])}return s},Tn.apply(null,arguments)}const Js=new $,Xc=new $,kA=new $,od=new at;function JA(s,n,r){const i=Js.setFromMatrixPosition(s.matrixWorld);i.project(n);const o=r.width/2,c=r.height/2;return[i.x*o+o,-(i.y*c)+c]}function zA(s,n){const r=Js.setFromMatrixPosition(s.matrixWorld),i=Xc.setFromMatrixPosition(n.matrixWorld),o=r.sub(i),c=n.getWorldDirection(kA);return o.angleTo(c)>Math.PI/2}function jA(s,n,r,i){const o=Js.setFromMatrixPosition(s.matrixWorld),c=o.clone();c.project(n),od.set(c.x,c.y),r.setFromCamera(od,n);const l=r.intersectObjects(i,!0);if(l.length){const d=l[0].distance;return o.distanceTo(r.ray.origin)<d}return!0}
vendor: 16,760 bytes, lines 43-201
43function KA(s,n){if(n instanceof Ur)return n.zoom;if(n instanceof oi){const r=Js.setFromMatrixPosition(s.matrixWorld),i=Xc.setFromMatrixPosition(n.matrixWorld),o=n.fov*Math.PI/180,c=r.distanceTo(i);return 1/(2*Math.tan(o/2)*c)}else return 1}function QA(s,n,r){if(n instanceof oi||n instanceof Ur){const i=Js.setFromMatrixPosition(s.matrixWorld),o=Xc.setFromMatrixPosition(n.matrixWorld),c=i.distanceTo(o),l=(r[1]-r[0])/(n.far-n.near),d=r[1]-l*n.far;return Math.round(l*c+d)}}const Sc=s=>Math.abs(s)<1e-10?0:s;function Ap(s,n,r=""){let i="matrix3d(";for(let o=0;o!==16;o++)i+=Sc(n[o]*s.elements[o])+(o!==15?",":")");return r+i}const XA=(s=>n=>Ap(n,s))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),WA=(s=>(n,r)=>Ap(n,s(r),"translate(-50%,-50%)"))(s=>[1/s,1/s,1/s,1,-1/s,-1/s,-1/s,-1,1/s,1/s,1/s,1,1,1,1,1]);function YA(s){return s&&typeof s=="object"&&"current"in s}const ly=j.forwardRef(({children:s,eps:n=.001,style:r,className:i,prepend:o,center:c,fullscreen:l,portal:d,distanceFactor:f,sprite:m=!1,transform:p=!1,occlude:h,onOcclude:g,castShadow:y,receiveShadow:C,material:T,geometry:S,zIndexRange:E=[16777271,0],calculatePosition:w=JA,as:M="div",wrapperClass:I,pointerEvents:_="auto",...F},G)=>{const{gl:P,camera:D,scene:O,size:b,raycaster:k,events:Y,viewport:Z}=ct(),[se]=j.useState(()=>document.createElement(M)),ue=j.useRef(),Me=j.useRef(null),V=j.useRef(0),fe=j.useRef([0,0]),q=j.useRef(null),ge=j.useRef(null),he=(d==null?void 0:d.current)||Y.connected||P.domElement.parentNode,ve=j.useRef(null),ze=j.useRef(!1),nt=j.useMemo(()=>h&&h!=="blending"||Array.isArray(h)&&h.length&&YA(h[0]),[h]);j.useLayoutEffect(()=>{const ut=P.domElement;h&&h==="blending"?(ut.style.zIndex=`${Math.floor(E[0]/2)}`,ut.style.position="absolute",ut.style.pointerEvents="none"):(ut.style.zIndex=null,ut.style.position=null,ut.style.pointerEvents=null)},[h]),j.useLayoutEffect(()=>{if(Me.current){const ut=ue.current=Xd(se);if(O.updateMatrixWorld(),p)se.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Fe=w(Me.current,D,b);se.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Fe[0]}px,${Fe[1]}px,0);transform-origin:0 0;`}return he&&(o?he.prepend(se):he.appendChild(se)),()=>{he&&he.removeChild(se),ut.unmount()}}},[he,p]),j.useLayoutEffect(()=>{I&&(se.className=I)},[I]);const Te=j.useMemo(()=>p?{position:"absolute",top:0,left:0,width:b.width,height:b.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:c?"translate3d(-50%,-50%,0)":"none",...l&&{top:-b.height/2,left:-b.width/2,width:b.width,height:b.height},...r},[r,c,l,b,p]),pt=j.useMemo(()=>({position:"absolute",pointerEvents:_}),[_]);j.useLayoutEffect(()=>{if(ze.current=!1,p){var ut;(ut=ue.current)==null||ut.render(j.createElement("div",{ref:q,style:Te},j.createElement("div",{ref:ge,style:pt},j.createElement("div",{ref:G,className:i,style:r,children:s}))))}else{var Fe;(Fe=ue.current)==null||Fe.render(j.createElement("div",{ref:G,style:Te,className:i,children:s}))}});const mt=j.useRef(!0);Ea(ut=>{if(Me.current){D.updateMatrixWorld(),Me.current.updateWorldMatrix(!0,!1);const Fe=p?fe.current:w(Me.current,D,b);if(p||Math.abs(V.current-D.zoom)>n||Math.abs(fe.current[0]-Fe[0])>n||Math.abs(fe.current[1]-Fe[1])>n){const Tt=zA(Me.current,D);let Ye=!1;nt&&(Array.isArray(h)?Ye=h.map(Kt=>Kt.current):h!=="blending"&&(Ye=[O]));const $t=mt.current;if(Ye){const Kt=jA(Me.current,D,k,Ye);mt.current=Kt&&!Tt}else mt.current=!Tt;$t!==mt.current&&(g?g(!mt.current):se.style.display=mt.current?"block":"none");const _n=Math.floor(E[0]/2),kr=h?nt?[E[0],_n]:[_n-1,0]:E;if(se.style.zIndex=`${QA(Me.current,D,kr)}`,p){const[Kt,nr]=[b.width/2,b.height/2],Hn=D.projectionMatrix.elements[5]*nr,{isOrthographicCamera:an,top:Jr,left:vr,bottom:On,right:Nt}=D,rr=XA(D.matrixWorldInverse),zr=an?`scale(${Hn})translate(${Sc(-(Nt+vr)/2)}px,${Sc((Jr+On)/2)}px)`:`translateZ(${Hn}px)`;let Qt=Me.current.matrixWorld;m&&(Qt=D.matrixWorldInverse.clone().transpose().copyPosition(Qt).scale(Me.current.scale),Qt.elements[3]=Qt.elements[7]=Qt.elements[11]=0,Qt.elements[15]=1),se.style.width=b.width+"px",se.style.height=b.height+"px",se.style.perspective=an?"":`${Hn}px`,q.current&&ge.current&&(q.current.style.transform=`${zr}${rr}translate(${Kt}px,${nr}px)`,ge.current.style.transform=WA(Qt,1/((f||10)/400)))}else{const Kt=f===void 0?1:KA(Me.current,D)*f;se.style.transform=`translate3d(${Fe[0]}px,${Fe[1]}px,0) scale(${Kt})`}fe.current=Fe,V.current=D.zoom}}if(!nt&&ve.current&&!ze.current)if(p){if(q.current){const Fe=q.current.children[0];if(Fe!=null&&Fe.clientWidth&&Fe!=null&&Fe.clientHeight){const{isOrthographicCamera:Tt}=D;if(Tt||S)F.scale&&(Array.isArray(F.scale)?F.scale instanceof $?ve.current.scale.copy(F.scale.clone().divideScalar(1)):ve.current.scale.set(1/F.scale[0],1/F.scale[1],1/F.scale[2]):ve.current.scale.setScalar(1/F.scale));else{const Ye=(f||10)/400,$t=Fe.clientWidth*Ye,_n=Fe.clientHeight*Ye;ve.current.scale.set($t,_n,1)}ze.current=!0}}}else{const Fe=se.children[0];if(Fe!=null&&Fe.clientWidth&&Fe!=null&&Fe.clientHeight){const Tt=1/Z.factor,Ye=Fe.clientWidth*Tt,$t=Fe.clientHeight*Tt;ve.current.scale.set(Ye,$t,1),ze.current=!0}ve.current.lookAt(ut.camera.position)}});const Gn=j.useMemo(()=>({vertexShader:p?void 0:` 44 /* 45 This shader is from the THREE's SpriteMaterial. 46 We need to turn the backing plane into a Sprite 47 (make it always face the camera) if "transfrom" 48 is false. 49 */ 50 #include <common> 51 52 void main() { 53 vec2 center = vec2(0., 1.); 54 float rotation = 0.0; 55 56 // This is somewhat arbitrary, but it seems to work well 57 // Need to figure out how to derive this dynamically if it even matters 58 float size = 0.03; 59 60 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 61 vec2 scale; 62 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 63 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 64 65 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 66 if ( isPerspective ) scale *= - mvPosition.z; 67 68 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; 69 vec2 rotatedPosition; 70 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 71 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 72 mvPosition.xy += rotatedPosition; 73 74 gl_Position = projectionMatrix * mvPosition; 75 } 76 `,fragmentShader:` 77 void main() { 78 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 79 } 80 `}),[p]);return j.createElement("group",Tn({},F,{ref:Me}),h&&!nt&&j.createElement("mesh",{castShadow:y,receiveShadow:C,ref:ve},S||j.createElement("planeGeometry",null),T||j.createElement("shaderMaterial",{side:va,vertexShader:Gn.vertexShader,fragmentShader:Gn.fragmentShader})))}),qi=parseInt(Od.replace(/\D+/g,"")),gp=qi>=125?"uv1":"uv2";function ad(s,n){if(n===Xh)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),s;if(n===mc||n===Ud){let r=s.getIndex();if(r===null){const l=[],d=s.getAttribute("position");if(d!==void 0){for(let f=0;f<d.count;f++)l.push(f);s.setIndex(l),r=s.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),s}const i=r.count-2,o=[];if(r)if(n===mc)for(let l=1;l<=i;l++)o.push(r.getX(0)),o.push(r.getX(l)),o.push(r.getX(l+1));else for(let l=0;l<i;l++)l%2===0?(o.push(r.getX(l)),o.push(r.getX(l+1)),o.push(r.getX(l+2))):(o.push(r.getX(l+2)),o.push(r.getX(l+1)),o.push(r.getX(l)));o.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const c=s.clone();return c.setIndex(o),c.clearGroups(),c}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",n),s}var vn=Uint8Array,Hr=Uint16Array,Mc=Uint32Array,vp=new vn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),yp=new vn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ZA=new vn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bp=function(s,n){for(var r=new Hr(31),i=0;i<31;++i)r[i]=n+=1<<s[i-1];for(var o=new Mc(r[30]),i=1;i<30;++i)for(var c=r[i];c<r[i+1];++c)o[c]=c-r[i]<<5|i;return[r,o]},Cp=Bp(vp,2),Ep=Cp[0],VA=Cp[1];Ep[28]=258,VA[258]=28;var qA=Bp(yp,0),$A=qA[0],xc=new Hr(32768);for(var rt=0;rt<32768;++rt){var Fr=(rt&43690)>>>1|(rt&21845)<<1;Fr=(Fr&52428)>>>2|(Fr&13107)<<2,Fr=(Fr&61680)>>>4|(Fr&3855)<<4,xc[rt]=((Fr&65280)>>>8|(Fr&255)<<8)>>>1}var Hs=function(s,n,r){for(var i=s.length,o=0,c=new Hr(n);o<i;++o)++c[s[o]-1];var l=new Hr(n);for(o=0;o<n;++o)l[o]=l[o-1]+c[o-1]<<1;var d;if(r){d=new Hr(1<<n);var f=15-n;for(o=0;o<i;++o)if(s[o])for(var m=o<<4|s[o],p=n-s[o],h=l[s[o]-1]++<<p,g=h|(1<<p)-1;h<=g;++h)d[xc[h]>>>f]=m}else for(d=new Hr(i),o=0;o<i;++o)s[o]&&(d[o]=xc[l[s[o]-1]++]>>>15-s[o]);return d},zs=new vn(288);for(var rt=0;rt<144;++rt)zs[rt]=8;for(var rt=144;rt<256;++rt)zs[rt]=9;for(var rt=256;rt<280;++rt)zs[rt]=7;for(var rt=280;rt<288;++rt)zs[rt]=8;var wp=new vn(32);for(var rt=0;rt<32;++rt)wp[rt]=5;var eg=Hs(zs,9,1),tg=Hs(wp,5,1),Xl=function(s){for(var n=s[0],r=1;r<s.length;++r)s[r]>n&&(n=s[r]);return n},Pn=function(s,n,r){var i=n/8|0;return(s[i]|s[i+1]<<8)>>(n&7)&r},Wl=function(s,n){var r=n/8|0;return(s[r]|s[r+1]<<8|s[r+2]<<16)>>(n&7)},ng=function(s){return(s/8|0)+(s&7&&1)},rg=function(s,n,r){(r==null||r>s.length)&&(r=s.length);var i=new(s instanceof Hr?Hr:s instanceof Mc?Mc:vn)(r-n);return i.set(s.subarray(n,r)),i},ig=function(s,n,r){var i=s.length;if(!i||r&&!r.l&&i<5)return n||new vn(0);var o=!n||r,c=!r||r.i;r||(r={}),n||(n=new vn(i*3));var l=function(Te){var pt=n.length;if(Te>pt){var mt=new vn(Math.max(pt*2,Te));mt.set(n),n=mt}},d=r.f||0,f=r.p||0,m=r.b||0,p=r.l,h=r.d,g=r.m,y=r.n,C=i*8;do{if(!p){r.f=d=Pn(s,f,1);var T=Pn(s,f+1,3);if(f+=3,T)if(T==1)p=eg,h=tg,g=9,y=5;else if(T==2){var M=Pn(s,f,31)+257,I=Pn(s,f+10,15)+4,_=M+Pn(s,f+5,31)+1;f+=14;for(var F=new vn(_),G=new vn(19),P=0;P<I;++P)G[ZA[P]]=Pn(s,f+P*3,7);f+=I*3;for(var D=Xl(G),O=(1<<D)-1,b=Hs(G,D,1),P=0;P<_;){var k=b[Pn(s,f,O)];f+=k&15;var S=k>>>4;if(S<16)F[P++]=S;else{var Y=0,Z=0;for(S==16?(Z=3+Pn(s,f,3),f+=2,Y=F[P-1]):S==17?(Z=3+Pn(s,f,7),f+=3):S==18&&(Z=11+Pn(s,f,127),f+=7);Z--;)F[P++]=Y}}var se=F.subarray(0,M),ue=F.subarray(M);g=Xl(se),y=Xl(ue),p=Hs(se,g,1),h=Hs(ue,y,1)}else throw"invalid block type";else{var S=ng(f)+4,E=s[S-4]|s[S-3]<<8,w=S+E;if(w>i){if(c)throw"unexpected EOF";break}o&&l(m+E),n.set(s.subarray(S,w),m),r.b=m+=E,r.p=f=w*8;continue}if(f>C){if(c)throw"unexpected EOF";break}}o&&l(m+131072);for(var Me=(1<<g)-1,V=(1<<y)-1,fe=f;;fe=f){var Y=p[Wl(s,f)&Me],q=Y>>>4;if(f+=Y&15,f>C){if(c)throw"unexpected EOF";break}if(!Y)throw"invalid length/literal";if(q<256)n[m++]=q;else if(q==256){fe=f,p=null;break}else{var ge=q-254;if(q>264){var P=q-257,he=vp[P];ge=Pn(s,f,(1<<he)-1)+Ep[P],f+=he}var ve=h[Wl(s,f)&V],ze=ve>>>4;if(!ve)throw"invalid distance";f+=ve&15;var ue=$A[ze];if(ze>3){var he=yp[ze];ue+=Wl(s,f)&(1<<he)-1,f+=he}if(f>C){if(c)throw"unexpected EOF";break}o&&l(m+131072);for(var nt=m+ge;m<nt;m+=4)n[m]=n[m-ue],n[m+1]=n[m+1-ue],n[m+2]=n[m+2-ue],n[m+3]=n[m+3-ue];m=nt}}r.l=p,r.p=fe,r.b=m,p&&(d=1,r.m=g,r.d=h,r.n=y)}while(!d);return m==n.length?n:rg(n,0,m)},sg=new vn(0),og=function(s){if((s[0]&15)!=8||s[0]>>>4>7||(s[0]<<8|s[1])%31)throw"invalid zlib data";if(s[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Jo(s,n){return ig((og(s),s.subarray(2,-4)),n)}var ag=typeof TextDecoder<"u"&&new TextDecoder,lg=0;try{ag.decode(sg,{stream:!0}),lg=1}catch{}var cg=Object.defineProperty,ug=(s,n,r)=>n in s?cg(s,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[n]=r,ld=(s,n,r)=>(ug(s,typeof n!="symbol"?n+"":n,r),r);const fg=(()=>{const s={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new $},up:{value:new $(0,1,0)}},vertexShader:` 81 uniform vec3 sunPosition; 82 uniform float rayleigh; 83 uniform float turbidity; 84 uniform float mieCoefficient; 85 uniform vec3 up; 86 87 varying vec3 vWorldPosition; 88 varying vec3 vSunDirection; 89 varying float vSunfade; 90 varying vec3 vBetaR; 91 varying vec3 vBetaM; 92 varying float vSunE; 93 94 // constants for atmospheric scattering 95 const float e = 2.71828182845904523536028747135266249775724709369995957; 96 const float pi = 3.141592653589793238462643383279502884197169; 97 98 // wavelength of used primaries, according to preetham 99 const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); 100 // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: 101 // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) 102 const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); 103 104 // mie stuff 105 // K coefficient for the primaries 106 const float v = 4.0; 107 const vec3 K = vec3( 0.686, 0.678, 0.666 ); 108 // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K 109 const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); 110 111 // earth shadow hack 112 // cutoffAngle = pi / 1.95; 113 const float cutoffAngle = 1.6110731556870734; 114 const float steepness = 1.5; 115 const float EE = 1000.0; 116 117 float sunIntensity( float zenithAngleCos ) { 118 zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); 119 return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); 120 } 121 122 vec3 totalMie( float T ) { 123 float c = ( 0.2 * T ) * 10E-18; 124 return 0.434 * c * MieConst; 125 } 126 127 void main() { 128 129 vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); 130 vWorldPosition = worldPosition.xyz; 131 132 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 133 gl_Position.z = gl_Position.w; // set z to camera.far 134 135 vSunDirection = normalize( sunPosition ); 136 137 vSunE = sunIntensity( dot( vSunDirection, up ) ); 138 139 vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); 140 141 float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); 142 143 // extinction (absorbtion + out scattering) 144 // rayleigh coefficients 145 vBetaR = totalRayleigh * rayleighCoefficient; 146 147 // mie coefficients 148 vBetaM = totalMie( turbidity ) * mieCoefficient; 149 150 } 151 `,fragmentShader:` 152 varying vec3 vWorldPosition; 153 varying vec3 vSunDirection; 154 varying float vSunfade; 155 varying vec3 vBetaR; 156 varying vec3 vBetaM; 157 varying float vSunE; 158 159 uniform float mieDirectionalG; 160 uniform vec3 up; 161 162 const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 ); 163 164 // constants for atmospheric scattering 165 const float pi = 3.141592653589793238462643383279502884197169; 166 167 const float n = 1.0003; // refractive index of air 168 const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius) 169 170 // optical length at zenith for molecules 171 const float rayleighZenithLength = 8.4E3; 172 const float mieZenithLength = 1.25E3; 173 // 66 arc seconds -> degrees, and the cosine of that 174 const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; 175 176 // 3.0 / ( 16.0 * pi ) 177 const float THREE_OVER_SIXTEENPI = 0.05968310365946075; 178 // 1.0 / ( 4.0 * pi ) 179 const float ONE_OVER_FOURPI = 0.07957747154594767; 180 181 float rayleighPhase( float cosTheta ) { 182 return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); 183 } 184 185 float hgPhase( float cosTheta, float g ) { 186 float g2 = pow( g, 2.0 ); 187 float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); 188 return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); 189 } 190 191 void main() { 192 193 vec3 direction = normalize( vWorldPosition - cameraPos ); 194 195 // optical length 196 // cutoff angle at 90 to avoid singularity in next formula. 197 float zenithAngle = acos( max( 0.0, dot( up, direction ) ) ); 198 float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); 199 float sR = rayleighZenithLength * inverse; 200 float sM = mieZenithLength * inverse; 201
202 // combined extinction factor 203 vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); 204 205 // in scattering 206 float cosTheta = dot( direction, vSunDirection ); 207 208 float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); 209 vec3 betaRTheta = vBetaR * rPhase; 210 211 float mPhase = hgPhase( cosTheta, mieDirectionalG ); 212 vec3 betaMTheta = vBetaM * mPhase; 213 214 vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); 215 Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); 216 217 // nightsky 218 float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] 219 float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] 220 vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); 221 vec3 L0 = vec3( 0.1 ) * Fex; 222 223 // composition + solar disc 224 float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); 225 L0 += ( vSunE * 19000.0 * Fex ) * sundisk; 226 227 vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); 228 229 vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); 230 231 gl_FragColor = vec4( retColor, 1.0 ); 232 233 #include <tonemapping_fragment> 234 #include <${qi>=154?"colorspace_fragment":"encodings_fragment"}> 235 236 } 237 `},n=new Yi({name:"SkyShader",fragmentShader:s.fragmentShader,vertexShader:s.vertexShader,uniforms:pa.clone(s.uniforms),side:bc,depthWrite:!1});class r extends Zi{constructor(){super(new Wh(1,1,1),n)}}return ld(r,"SkyShader",s),ld(r,"material",n),r})(),dg=s=>s&&s.isCubeTexture;class pg extends Zi{constructor(n,r){var i,o;const c=dg(n),d=((o=c?(i=n.image[0])==null?void 0:i.width:n.image.width)!=null?o:1024)/4,f=Math.floor(Math.log2(d)),m=Math.pow(2,f),p=3*Math.max(m,16*7),h=4*m,g=[c?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/p}`,`#define CUBEUV_TEXEL_HEIGHT ${1/h}`,`#define CUBEUV_MAX_MIP ${f}.0`],y=` 238 varying vec3 vWorldPosition; 239 void main() 240 { 241 vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) ); 242 vWorldPosition = worldPosition.xyz; 243 244 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 245 } 246 `,C=g.join(` 247`)+` 248 #define ENVMAP_TYPE_CUBE_UV 249 varying vec3 vWorldPosition; 250 uniform float radius; 251 uniform float height; 252 uniform float angle; 253 #ifdef ENVMAP_TYPE_CUBE 254 uniform samplerCube map; 255 #else 256 uniform sampler2D map; 257 #endif 258 // From: https://www.shadertoy.com/view/4tsBD7 259 float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) 260 { 261 float d = dot ( rd, n ); 262 263 if( d > 0.0 ) { return 1e6; } 264 265 vec3 o = ro - c; 266 float t = - dot( n, o ) / d; 267 vec3 q = o + rd * t; 268 269 return ( dot( q, q ) < r * r ) ? t : 1e6; 270 } 271 // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm 272 float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) 273 { 274 vec3 oc = ro - ce; 275 float b = dot( oc, rd ); 276 float c = dot( oc, oc ) - ra * ra; 277 float h = b * b - c; 278 279 if( h < 0.0 ) { return -1.0; } 280 281 h = sqrt( h ); 282 283 return - b + h; 284 } 285 vec3 project() 286 { 287 vec3 p = normalize( vWorldPosition ); 288 vec3 camPos = cameraPosition; 289 camPos.y -= height; 290 float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius ); 291 if( intersection > 0.0 ) { 292 293 vec3 h = vec3( 0.0, - height, 0.0 ); 294 float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius ); 295 p = ( camPos + min( intersection, intersection2 ) * p ) / radius; 296 } else { 297 p = vec3( 0.0, 1.0, 0.0 ); 298 } 299 return p; 300 } 301 #include <common> 302 #include <cube_uv_reflection_fragment> 303 void main() 304 { 305 vec3 projectedWorldPosition = project(); 306 307 #ifdef ENVMAP_TYPE_CUBE 308 vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb; 309 #else 310 vec3 direction = normalize( projectedWorldPosition ); 311 vec2 uv = equirectUv( direction ); 312 vec3 outcolor = texture2D( map, uv ).rgb; 313 #endif 314 gl_FragColor = vec4( outcolor, 1.0 ); 315 #include <tonemapping_fragment> 316 #include <${qi>=154?"colorspace_fragment":"encodings_fragment"}> 317 } 318 `,T={map:{value:n},height:{value:(r==null?void 0:r.height)||15},radius:{value:(r==null?void 0:r.radius)||100}},S=new Yh(1,16),E=new Yi({uniforms:T,fragmentShader:C,vertexShader:y,side:va});super(S,E)}set radius(n){this.material.uniforms.radius.value=n}get radius(){return this.material.uniforms.radius.value}set height(n){this.material.uniforms.height.value=n}get height(){return this.material.uniforms.height.value}}var hg=Object.defineProperty,mg=(s,n,r)=>
318n in s?hg(s,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[n]=r,Ag=(s,n,r)=>(mg(s,n+"",r),r);class Sp{constructor(){Ag(this,"_listeners")}addEventListener(n,r){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[n]===void 0&&(i[n]=[]),i[n].indexOf(r)===-1&&i[n].push(r)}hasEventListener(n,r){if(this._listeners===void 0)return!1;const i=this._listeners;return i[n]!==void 0&&i[n].indexOf(r)!==-1}removeEventListener(n,r){if(this._listeners===void 0)return;const o=this._listeners[n];if(o!==void 0){const c=o.indexOf(r);c!==-1&&o.splice(c,1)}}dispatchEvent(n){if(this._listeners===void 0)return;const i=this._listeners[n.type];if(i!==void 0){n.target=this;const o=i.slice(0);for(let c=0,l=o.length;c<l;c++)o[c].call(this,n);n.target=null}}}var gg=Object.defineProperty,vg=(s,n,r)=>n in s?gg(s,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[n]=r,wt=(s,n,r)=>(vg(s,typeof n!="symbol"?n+"":n,r),r);const xi=new Zh(0,0,0,"YXZ"),Ti=new $,yg={type:"change"},Bg={type:"lock"},Cg={type:"unlock"},cd=.002,ud=Math.PI/2;let Eg=class extends Sp{constructor(n,r){super(),wt(this,"camera"),wt(this,"domElement"),wt(this,"isLocked"),wt(this,"minPolarAngle"),wt(this,"maxPolarAngle"),wt(this,"pointerSpeed"),wt(this,"onMouseMove",i=>{!this.domElement||this.isLocked===!1||(xi.setFromQuaternion(this.camera.quaternion),xi.y-=i.movementX*cd*this.pointerSpeed,xi.x-=i.movementY*cd*this.pointerSpeed,xi.x=Math.max(ud-this.maxPolarAngle,Math.min(ud-this.minPolarAngle,xi.x)),this.camera.quaternion.setFromEuler(xi),this.dispatchEvent(yg))}),wt(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(Bg),this.isLocked=!0):(this.dispatchEvent(Cg),this.isLocked=!1))}),wt(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),wt(this,"connect",i=>{this.domElement=i||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),wt(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),wt(this,"dispose",()=>{this.disconnect()}),wt(this,"getObject",()=>this.camera),wt(this,"direction",new $(0,0,-1)),wt(this,"getDirection",i=>i.copy(this.direction).applyQuaternion(this.camera.quaternion)),wt(this,"moveForward",i=>{Ti.setFromMatrixColumn(this.camera.matrix,0),Ti.crossVectors(this.camera.up,Ti),this.camera.position.addScaledVector(Ti,i)}),wt(this,"moveRight",i=>{Ti.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(Ti,i)}),wt(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),wt(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=n,this.domElement=r,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,r&&this.connect(r)}};var wg=Object.defineProperty,Sg=(s,n,r)=>n in s?wg(s,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[n]=r,Se=(s,n,r)=>(Sg(s,typeof n!="symbol"?n+"":n,r),r);const zo=new Vh,fd=new ya,Mg=Math.cos(70*(Math.PI/180)),dd=(s,n)=>(s%n+n)%n;let xg=class extends Sp{constructor(n,r){super(),Se(this,"object"),Se(this,"domElement"),Se(this,"enabled",!0),Se(this,"target",new $),Se(this,"minDistance",0),Se(this,"maxDistance",1/0),Se(this,"minZoom",0),Se(this,"maxZoom",1/0),Se(this,"minPolarAngle",0),Se(this,"maxPolarAngle",Math.PI),Se(this,"minAzimuthAngle",-1/0),Se(this,"maxAzimuthAngle",1/0),Se(this,"enableDamping",!1),Se(this,"dampingFactor",.05),Se(this,"enableZoom",!0),Se(this,"zoomSpeed",1),Se(this,"enableRotate",!0),Se(this,"rotateSpeed",1),Se(this,"enablePan",!0),Se(this,"panSpeed",1),Se(this,"screenSpacePanning",!0),Se(this,"keyPanSpeed",7),Se(this,"zoomToCursor",!1),Se(this,"autoRotate",!1),Se(this,"autoRotateSpeed",2),Se(this,"reverseOrbit",!1),Se(this,"reverseHorizontalOrbit",!1),Se(this,"reverseVerticalOrbit",!1),Se(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Se(this,"mouseButtons",{LEFT:wi.ROTATE,MIDDLE:wi.DOLLY,RIGHT:wi.PAN}),Se(this,"touches",{ONE:Si.ROTATE,TWO:Si.DOLLY_PAN}),Se(this,"target0"),Se(this,"position0"),Se(this,"zoom0"),Se(this,"_domElementKeyEvents",null),Se(this,"getPolarAngle"),Se(this,"getAzimuthalAngle"),Se(this,"setPolarAngle"),Se(this,"setAzimuthalAngle"),Se(this,"getDistance"),Se(this,"getZoomScale"),Se(this,"listenToKeyEvents"),Se(this,"stopListenToKeyEvents"),Se(this,"saveState"),Se(this,"reset"),Se(this,"update"),Se(this,"connect"),Se(this,"dispose"),Se(this,"dollyIn"),Se(this,"dollyOut"),Se(this,"getScale"),Se(this,"setScale"),this.object=n,this.domElement=r,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>p.phi,this.getAzimuthalAngle=()=>p.theta,this.setPolarAngle=N=>{let te=dd(N,2*Math.PI),me=p.phi;me<0&&(me+=2*Math.PI),te<0&&(te+=2*Math.PI);let Ne=Math.abs(te-me);2*Math.PI-Ne<Ne&&(te<me?te+=2*Math.PI:me+=2*Math.PI),h.phi=te-me,i.update()},this.setAzimuthalAngle=N=>{let te=dd(N,2*Math.PI),me=p.theta;me<0&&(me+=2*Math.PI),te<0&&(te+=2*Math.PI);let Ne=Math.abs(te-me);2*Math.PI-Ne<Ne&&(te<me?te+=2*Math.PI:me+=2*Math.PI),h.theta=te-me,i.update()},this.getDistance=()=>i.object.position.distanceTo(i.target),this.listenToKeyEvents=N=>{N.addEventListener("keydown",yr),this._domElementKeyEvents=N},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",yr),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(o),i.update(),f=d.NONE},this.update=(()=>{const N=new $,te=new $(0,1,0),me=new ha().setFromUnitVectors(n.up,te),Ne=me.clone().invert(),ie=new $,_t=new ha,ln=2*Math.PI;return function(){const jr=i.object.position;me.setFromUnitVectors(n.up,te),Ne.copy(me).invert(),N.copy(jr).sub(i.target),N.applyQuaternion(me),p.setFromVector3(N),i.autoRotate&&f===d.NONE&&Z(k()),i.enableDamping?(p.theta+=h.theta*i.dampingFactor,p.phi+=h.phi*i.dampingFactor):(p.theta+=h.theta,p.phi+=h.phi);let Xt=i.minAzimuthAngle,en=i.maxAzimuthAngle;isFinite(Xt)&&isFinite(en)&&(Xt<-Math.PI?Xt+=ln:Xt>Math.PI&&(Xt-=ln),en<-Math.PI?en+=ln:en>Math.PI&&(en-=ln),Xt<=en?p.theta=Math.max(Xt,Math.min(en,p.theta)):p.theta=p.theta>
318(Xt+en)/2?Math.max(Xt,p.theta):Math.min(en,p.theta)),p.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,p.phi)),p.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(y,i.dampingFactor):i.target.add(y),i.zoomToCursor&&D||i.object.isOrthographicCamera?p.radius=ve(p.radius):p.radius=ve(p.radius*g),N.setFromSpherical(p),N.applyQuaternion(Ne),jr.copy(i.target).add(N),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(h.theta*=1-i.dampingFactor,h.phi*=1-i.dampingFactor,y.multiplyScalar(1-i.dampingFactor)):(h.set(0,0,0),y.set(0,0,0));let Un=!1;if(i.zoomToCursor&&D){let Nn=null;if(i.object instanceof oi&&i.object.isPerspectiveCamera){const bn=N.length();Nn=ve(bn*g);const Er=bn-Nn;i.object.position.addScaledVector(G,Er),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const bn=new $(P.x,P.y,0);bn.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/g)),i.object.updateProjectionMatrix(),Un=!0;const Er=new $(P.x,P.y,0);Er.unproject(i.object),i.object.position.sub(Er).add(bn),i.object.updateMatrixWorld(),Nn=N.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Nn!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Nn).add(i.object.position):(zo.origin.copy(i.object.position),zo.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(zo.direction))<Mg?n.lookAt(i.target):(fd.setFromNormalAndCoplanarPoint(i.object.up,i.target),zo.intersectPlane(fd,i.target))))}else i.object instanceof Ur&&i.object.isOrthographicCamera&&(Un=g!==1,Un&&(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/g)),i.object.updateProjectionMatrix()));return g=1,D=!1,Un||ie.distanceToSquared(i.object.position)>m||8*(1-_t.dot(i.object.quaternion))>m?(i.dispatchEvent(o),ie.copy(i.object.position),_t.copy(i.object.quaternion),Un=!1,!0):!1}})(),this.connect=N=>{i.domElement=N,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",ui),i.domElement.addEventListener("pointerdown",vr),i.domElement.addEventListener("pointercancel",Nt),i.domElement.addEventListener("wheel",Qt)},this.dispose=()=>{var N,te,me,Ne,ie,_t;i.domElement&&(i.domElement.style.touchAction="auto"),(N=i.domElement)==null||N.removeEventListener("contextmenu",ui),(te=i.domElement)==null||te.removeEventListener("pointerdown",vr),(me=i.domElement)==null||me.removeEventListener("pointercancel",Nt),(Ne=i.domElement)==null||Ne.removeEventListener("wheel",Qt),(ie=i.domElement)==null||ie.ownerDocument.removeEventListener("pointermove",On),(_t=i.domElement)==null||_t.ownerDocument.removeEventListener("pointerup",Nt),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",yr)};const i=this,o={type:"change"},c={type:"start"},l={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let f=d.NONE;const m=1e-6,p=new Nf,h=new Nf;let g=1;const y=new $,C=new at,T=new at,S=new at,E=new at,w=new at,M=new at,I=new at,_=new at,F=new at,G=new $,P=new at;let D=!1;const O=[],b={};function k(){return 2*Math.PI/60/60*i.autoRotateSpeed}function Y(){return Math.pow(.95,i.zoomSpeed)}function Z(N){i.reverseOrbit||i.reverseHorizontalOrbit?h.theta+=N:h.theta-=N}function se(N){i.reverseOrbit||i.reverseVerticalOrbit?h.phi+=N:h.phi-=N}const ue=(()=>{const N=new $;return function(me,Ne){N.setFromMatrixColumn(Ne,0),N.multiplyScalar(-me),y.add(N)}})(),Me=(()=>{const N=new $;return function(me,Ne){i.screenSpacePanning===!0?N.setFromMatrixColumn(Ne,1):(N.setFromMatrixColumn(Ne,0),N.crossVectors(i.object.up,N)),N.multiplyScalar(me),y.add(N)}})(),V=(()=>{const N=new $;return function(me,Ne){const ie=i.domElement;if(ie&&i.object instanceof oi&&i.object.isPerspectiveCamera){const _t=i.object.position;N.copy(_t).sub(i.target);let ln=N.length();ln*=Math.tan(i.object.fov/2*Math.PI/180),ue(2*me*ln/ie.clientHeight,i.object.matrix),Me(2*Ne*ln/ie.clientHeight,i.object.matrix)}else ie&&i.object instanceof Ur&&i.object.isOrthographicCamera?(ue(me*(i.object.right-i.object.left)/i.object.zoom/ie.clientWidth,i.object.matrix),Me(Ne*(i.object.top-i.object.bottom)/i.object.zoom/ie.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function fe(N){i.object instanceof oi&&i.object.isPerspectiveCamera||i.object instanceof Ur&&i.object.isOrthographicCamera?g=N:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function q(N){fe(g/N)}function ge(N){fe(g*N)}function he(N){if(!i.zoomToCursor||!i.domElement)return;D=!0;const te=i.domElement.getBoundingClientRect(),me=N.clientX-te.left,Ne=N.clientY-te.top,ie=te.width,_t=te.height;P.x=me/ie*2-1,P.y=-(Ne/_t)*2+1,G.set(P.x,P.y,1).unproject(i.object).sub(i.object.position).normalize()}function ve(N){return Math.max(i.minDistance,Math.min(i.maxDistance,N))}function ze(N){C.set(N.clientX,N.clientY)}function nt(N){he(N),I.set(N.clientX,N.clientY)}function Te(N){E.set(N.clientX,N.clientY)}function pt(N){T.set(N.clientX,N.clientY),S.subVectors(T,C).multiplyScalar(i.rotateSpeed);const te=i.domElement;te&&(Z(2*Math.PI*S.x/te.clientHeight),se(2*Math.PI*S.y/te.clientHeight)),C.copy(T),i.update()}function mt(N){_.set(N.clientX,N.clientY),F.subVectors(_,I),F.y>0?q(Y()):F.y<0&&ge(Y()),I.copy(_),i.update()}
318function Gn(N){w.set(N.clientX,N.clientY),M.subVectors(w,E).multiplyScalar(i.panSpeed),V(M.x,M.y),E.copy(w),i.update()}function ut(N){he(N),N.deltaY<0?ge(Y()):N.deltaY>0&&q(Y()),i.update()}function Fe(N){let te=!1;switch(N.code){case i.keys.UP:V(0,i.keyPanSpeed),te=!0;break;case i.keys.BOTTOM:V(0,-i.keyPanSpeed),te=!0;break;case i.keys.LEFT:V(i.keyPanSpeed,0),te=!0;break;case i.keys.RIGHT:V(-i.keyPanSpeed,0),te=!0;break}te&&(N.preventDefault(),i.update())}function Tt(){if(O.length==1)C.set(O[0].pageX,O[0].pageY);else{const N=.5*(O[0].pageX+O[1].pageX),te=.5*(O[0].pageY+O[1].pageY);C.set(N,te)}}function Ye(){if(O.length==1)E.set(O[0].pageX,O[0].pageY);else{const N=.5*(O[0].pageX+O[1].pageX),te=.5*(O[0].pageY+O[1].pageY);E.set(N,te)}}function $t(){const N=O[0].pageX-O[1].pageX,te=O[0].pageY-O[1].pageY,me=Math.sqrt(N*N+te*te);I.set(0,me)}function _n(){i.enableZoom&&$t(),i.enablePan&&Ye()}function kr(){i.enableZoom&&$t(),i.enableRotate&&Tt()}function Kt(N){if(O.length==1)T.set(N.pageX,N.pageY);else{const me=Cr(N),Ne=.5*(N.pageX+me.x),ie=.5*(N.pageY+me.y);T.set(Ne,ie)}S.subVectors(T,C).multiplyScalar(i.rotateSpeed);const te=i.domElement;te&&(Z(2*Math.PI*S.x/te.clientHeight),se(2*Math.PI*S.y/te.clientHeight)),C.copy(T)}function nr(N){if(O.length==1)w.set(N.pageX,N.pageY);else{const te=Cr(N),me=.5*(N.pageX+te.x),Ne=.5*(N.pageY+te.y);w.set(me,Ne)}M.subVectors(w,E).multiplyScalar(i.panSpeed),V(M.x,M.y),E.copy(w)}function Hn(N){const te=Cr(N),me=N.pageX-te.x,Ne=N.pageY-te.y,ie=Math.sqrt(me*me+Ne*Ne);_.set(0,ie),F.set(0,Math.pow(_.y/I.y,i.zoomSpeed)),q(F.y),I.copy(_)}function an(N){i.enableZoom&&Hn(N),i.enablePan&&nr(N)}function Jr(N){i.enableZoom&&Hn(N),i.enableRotate&&Kt(N)}function vr(N){var te,me;i.enabled!==!1&&(O.length===0&&((te=i.domElement)==null||te.ownerDocument.addEventListener("pointermove",On),(me=i.domElement)==null||me.ownerDocument.addEventListener("pointerup",Nt)),ts(N),N.pointerType==="touch"?Br(N):rr(N))}function On(N){i.enabled!==!1&&(N.pointerType==="touch"?es(N):zr(N))}function Nt(N){var te,me,Ne;ir(N),O.length===0&&((te=i.domElement)==null||te.releasePointerCapture(N.pointerId),(me=i.domElement)==null||me.ownerDocument.removeEventListener("pointermove",On),(Ne=i.domElement)==null||Ne.ownerDocument.removeEventListener("pointerup",Nt)),i.dispatchEvent(l),f=d.NONE}function rr(N){let te;switch(N.button){case 0:te=i.mouseButtons.LEFT;break;case 1:te=i.mouseButtons.MIDDLE;break;case 2:te=i.mouseButtons.RIGHT;break;default:te=-1}switch(te){case wi.DOLLY:if(i.enableZoom===!1)return;nt(N),f=d.DOLLY;break;case wi.ROTATE:if(N.ctrlKey||N.metaKey||N.shiftKey){if(i.enablePan===!1)return;Te(N),f=d.PAN}else{if(i.enableRotate===!1)return;ze(N),f=d.ROTATE}break;case wi.PAN:if(N.ctrlKey||N.metaKey||N.shiftKey){if(i.enableRotate===!1)return;ze(N),f=d.ROTATE}else{if(i.enablePan===!1)return;Te(N),f=d.PAN}break;default:f=d.NONE}f!==d.NONE&&i.dispatchEvent(c)}function zr(N){if(i.enabled!==!1)switch(f){case d.ROTATE:if(i.enableRotate===!1)return;pt(N);break;case d.DOLLY:if(i.enableZoom===!1)return;mt(N);break;case d.PAN:if(i.enablePan===!1)return;Gn(N);break}}function Qt(N){i.enabled===!1||i.enableZoom===!1||f!==d.NONE&&f!==d.ROTATE||(N.preventDefault(),i.dispatchEvent(c),ut(N),i.dispatchEvent(l))}function yr(N){i.enabled===!1||i.enablePan===!1||Fe(N)}function Br(N){switch(Bt(N),O.length){case 1:switch(i.touches.ONE){case Si.ROTATE:if(i.enableRotate===!1)return;Tt(),f=d.TOUCH_ROTATE;break;case Si.PAN:if(i.enablePan===!1)return;Ye(),f=d.TOUCH_PAN;break;default:f=d.NONE}break;case 2:switch(i.touches.TWO){case Si.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;_n(),f=d.TOUCH_DOLLY_PAN;break;case Si.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;kr(),f=d.TOUCH_DOLLY_ROTATE;break;default:f=d.NONE}break;default:f=d.NONE}f!==d.NONE&&i.dispatchEvent(c)}function es(N){switch(Bt(N),f){case d.TOUCH_ROTATE:if(i.enableRotate===!1)return;Kt(N),i.update();break;case d.TOUCH_PAN:if(i.enablePan===!1)return;nr(N),i.update();break;case d.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;an(N),i.update();break;case d.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Jr(N),i.update();break;default:f=d.NONE}}function ui(N){i.enabled!==!1&&N.preventDefault()}function ts(N){O.push(N)}function ir(N){delete b[N.pointerId];for(let te=0;te<O.length;te++)if(O[te].pointerId==N.pointerId){O.splice(te,1);return}}function Bt(N){let te=b[N.pointerId];te===void 0&&(te=new at,b[N.pointerId]=te),te.set(N.pageX,N.pageY)}function Cr(N){const te=N.pointerId===O[0].pointerId?O[1]:O[0];return b[te.pointerId]}this.dollyIn=(N=Y())=>
vendor: 6,801 bytes, line 318
318{ge(N),i.update()},this.dollyOut=(N=Y())=>{q(N),i.update()},this.getScale=()=>g,this.setScale=N=>{fe(N),i.update()},this.getZoomScale=()=>Y(),r!==void 0&&this.connect(r),this.update()}};function Aa(s){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);let n="";for(let r=0,i=s.length;r<i;r++)n+=String.fromCharCode(s[r]);try{return decodeURIComponent(escape(n))}catch{return n}}const si="srgb",Ar="srgb-linear",pd=3001,Tg=3e3;class Wc extends kc{constructor(n){super(n),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(r){return new Pg(r)}),this.register(function(r){return new Dg(r)}),this.register(function(r){return new Jg(r)}),this.register(function(r){return new zg(r)}),this.register(function(r){return new jg(r)}),this.register(function(r){return new Gg(r)}),this.register(function(r){return new Hg(r)}),this.register(function(r){return new Og(r)}),this.register(function(r){return new Ug(r)}),this.register(function(r){return new Fg(r)}),this.register(function(r){return new Ng(r)}),this.register(function(r){return new Lg(r)}),this.register(function(r){return new kg(r)}),this.register(function(r){return new bg(r)}),this.register(function(r){return new Ig(r)}),this.register(function(r){return new Kg(r)}),this.register(function(r){return new Qg(r)})}load(n,r,i,o){const c=this;let l;if(this.resourcePath!=="")l=this.resourcePath;else if(this.path!==""){const m=Gs.extractUrlBase(n);l=Gs.resolveURL(m,this.path)}else l=Gs.extractUrlBase(n);this.manager.itemStart(n);const d=function(m){o?o(m):console.error(m),c.manager.itemError(n),c.manager.itemEnd(n)},f=new Nr(this.manager);f.setPath(this.path),f.setResponseType("arraybuffer"),f.setRequestHeader(this.requestHeader),f.setWithCredentials(this.withCredentials),f.load(n,function(m){try{c.parse(m,l,function(p){r(p),c.manager.itemEnd(n)},d)}catch(p){d(p)}},i,d)}setDRACOLoader(n){return this.dracoLoader=n,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(n){return this.ktx2Loader=n,this}setMeshoptDecoder(n){return this.meshoptDecoder=n,this}register(n){return this.pluginCallbacks.indexOf(n)===-1&&this.pluginCallbacks.push(n),this}unregister(n){return this.pluginCallbacks.indexOf(n)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(n),1),this}parse(n,r,i,o){let c;const l={},d={};if(typeof n=="string")c=JSON.parse(n);else if(n instanceof ArrayBuffer)if(Aa(new Uint8Array(n.slice(0,4)))===Mp){try{l[Ue.KHR_BINARY_GLTF]=new Xg(n)}catch(p){o&&o(p);return}c=JSON.parse(l[Ue.KHR_BINARY_GLTF].content)}else c=JSON.parse(Aa(new Uint8Array(n)));else c=n;if(c.asset===void 0||c.asset.version[0]<2){o&&o(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const f=new ov(c,{path:r||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});f.fileLoader.setRequestHeader(this.requestHeader);for(let m=0;m<this.pluginCallbacks.length;m++){const p=this.pluginCallbacks[m](f);p.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),d[p.name]=p,l[p.name]=!0}if(c.extensionsUsed)for(let m=0;m<c.extensionsUsed.length;++m){const p=c.extensionsUsed[m],h=c.extensionsRequired||[];switch(p){case Ue.KHR_MATERIALS_UNLIT:l[p]=new Rg;break;case Ue.KHR_DRACO_MESH_COMPRESSION:l[p]=new Wg(c,this.dracoLoader);break;case Ue.KHR_TEXTURE_TRANSFORM:l[p]=new Yg;break;case Ue.KHR_MESH_QUANTIZATION:l[p]=new Zg;break;default:h.indexOf(p)>=0&&d[p]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+p+'".')}}f.setExtensions(l),f.setPlugins(d),f.parse(i,o)}parseAsync(n,r){const i=this;return new Promise(function(o,c){i.parse(n,r,o,c)})}}function _g(){let s={};return{get:function(n){return s[n]},add:function(n,r){s[n]=r},remove:function(n){delete s[n]},removeAll:function(){s={}}}}const Ue={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Ig{constructor(n){this.parser=n,this.name=Ue.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const n=this.parser,r=this.parser.json.nodes||[];for(let i=0,o=r.length;i<o;i++){const c=r[i];c.extensions&&c.extensions[this.name]&&c.extensions[this.name].light!==void 0&&n._addNodeRef(this.cache,c.extensions[this.name].light)}}_loadLight(n){const r=this.parser,i="light:"+n;let o=r.cache.get(i);if(o)return o;const c=r.json,f=((c.extensions&&c.extensions[this.name]||{}).lights||[])[n];let m;const p=new er(16777215);f.color!==void 0&&p.setRGB(f.color[0],f.color[1],f.color[2],Ar);const h=f.range!==void 0?f.range:0;switch(f.type){case"directional":m=new em(p),m.target.position.set(0,0,-1),m.add(m.target);break;case"point":m=new $h(p),m.distance=h;break;case"spot":m=new qh(p),m.distance=h,f.spot=f.spot||{},f.spot.innerConeAngle=f.spot.innerConeAngle!==void 0?f.spot.innerConeAngle:0,f.spot.outerConeAngle=f.spot.outerConeAngle!==void 0?f.spot.outerConeAngle:Math.PI/4,m.angle=f.spot.outerConeAngle,m.penumbra=1-f.spot.innerConeAngle/f.spot.outerConeAngle,m.target.position.set(0,0,-1),m.add(m.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+f.type)}return m.position.set(0,0,0),m.decay=2,pr(m,f),f.intensity!==void 0&&(m.intensity=f.intensity),m.name=r.createUniqueName(f.name||"light_"+n),o=Promise.resolve(m),r.cache.add(i,o),o}getDependency(n,r){if(n==="light")return this._loadLight(r)}createNodeAttachment(n){const r=this,i=this.parser,c=i.json.nodes[n],d=(c.extensions&&c.extensions[this.name]||{}).light;return d===void 0?null:this._loadLight(d).then(function(f){return i._getNodeRef(r.cache,d,f)})}}class Rg{constructor(){this.name=Ue.KHR_MATERIALS_UNLIT}getMaterialType(){return bi}extendParams(n,r,i){const o=[];
vendor: 7,314 bytes, line 318
318n.color=new er(1,1,1),n.opacity=1;const c=r.pbrMetallicRoughness;if(c){if(Array.isArray(c.baseColorFactor)){const l=c.baseColorFactor;n.color.setRGB(l[0],l[1],l[2],Ar),n.opacity=l[3]}c.baseColorTexture!==void 0&&o.push(i.assignTexture(n,"map",c.baseColorTexture,si))}return Promise.all(o)}}class Fg{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(n,r){const o=this.parser.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=o.extensions[this.name].emissiveStrength;return c!==void 0&&(r.emissiveIntensity=c),Promise.resolve()}}class Pg{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_CLEARCOAT}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const i=this.parser,o=i.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=[],l=o.extensions[this.name];if(l.clearcoatFactor!==void 0&&(r.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&c.push(i.assignTexture(r,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(r.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&c.push(i.assignTexture(r,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(c.push(i.assignTexture(r,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const d=l.clearcoatNormalTexture.scale;r.clearcoatNormalScale=new at(d,d)}return Promise.all(c)}}class Dg{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_DISPERSION}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const o=this.parser.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=o.extensions[this.name];return r.dispersion=c.dispersion!==void 0?c.dispersion:0,Promise.resolve()}}class Lg{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_IRIDESCENCE}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const i=this.parser,o=i.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=[],l=o.extensions[this.name];return l.iridescenceFactor!==void 0&&(r.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&c.push(i.assignTexture(r,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(r.iridescenceIOR=l.iridescenceIor),r.iridescenceThicknessRange===void 0&&(r.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(r.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(r.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&c.push(i.assignTexture(r,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(c)}}class Gg{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_SHEEN}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const i=this.parser,o=i.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=[];r.sheenColor=new er(0,0,0),r.sheenRoughness=0,r.sheen=1;const l=o.extensions[this.name];if(l.sheenColorFactor!==void 0){const d=l.sheenColorFactor;r.sheenColor.setRGB(d[0],d[1],d[2],Ar)}return l.sheenRoughnessFactor!==void 0&&(r.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&c.push(i.assignTexture(r,"sheenColorMap",l.sheenColorTexture,si)),l.sheenRoughnessTexture!==void 0&&c.push(i.assignTexture(r,"sheenRoughnessMap",l.sheenRoughnessTexture)),Promise.all(c)}}class Hg{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_TRANSMISSION}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const i=this.parser,o=i.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=[],l=o.extensions[this.name];return l.transmissionFactor!==void 0&&(r.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&c.push(i.assignTexture(r,"transmissionMap",l.transmissionTexture)),Promise.all(c)}}class Og{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_VOLUME}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const i=this.parser,o=i.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=[],l=o.extensions[this.name];r.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&c.push(i.assignTexture(r,"thicknessMap",l.thicknessTexture)),r.attenuationDistance=l.attenuationDistance||1/0;const d=l.attenuationColor||[1,1,1];return r.attenuationColor=new er().setRGB(d[0],d[1],d[2],Ar),Promise.all(c)}}class Ug{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_IOR}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const o=this.parser.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=o.extensions[this.name];return r.ior=c.ior!==void 0?c.ior:1.5,Promise.resolve()}}class Ng{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_SPECULAR}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const i=this.parser,o=i.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=[],l=o.extensions[this.name];r.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&c.push(i.assignTexture(r,"specularIntensityMap",l.specularTexture));const d=l.specularColorFactor||[1,1,1];return r.specularColor=new er().setRGB(d[0],d[1],d[2],Ar),l.specularColorTexture!==void 0&&c.push(i.assignTexture(r,"specularColorMap",l.specularColorTexture,si)),Promise.all(c)}}class bg{constructor(n){this.parser=n,this.name=Ue.EXT_MATERIALS_BUMP}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const i=this.parser,o=i.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=[],l=o.extensions[this.name];return r.bumpScale=l.bumpFactor!==void 0?l.bumpFactor:1,l.bumpTexture!==void 0&&c.push(i.assignTexture(r,"bumpMap",l.bumpTexture)),Promise.all(c)}}class kg{constructor(n){this.parser=n,this.name=Ue.KHR_MATERIALS_ANISOTROPY}getMaterialType(n){const i=this.parser.json.materials[n];return!i.extensions||!i.extensions[this.name]?null:tr}extendMaterialParams(n,r){const i=this.parser,o=i.json.materials[n];if(!o.extensions||!o.extensions[this.name])return Promise.resolve();const c=[],l=o.extensions[this.name];return l.anisotropyStrength!==void 0&&(r.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(r.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&c.push(i.assignTexture(r,"anisotropyMap",l.anisotropyTexture)),Promise.all(c)}}
vendor: 28,429 bytes, line 318
318class Jg{constructor(n){this.parser=n,this.name=Ue.KHR_TEXTURE_BASISU}loadTexture(n){const r=this.parser,i=r.json,o=i.textures[n];if(!o.extensions||!o.extensions[this.name])return null;const c=o.extensions[this.name],l=r.options.ktx2Loader;if(!l){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return r.loadTextureImage(n,c.source,l)}}class zg{constructor(n){this.parser=n,this.name=Ue.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(n){const r=this.name,i=this.parser,o=i.json,c=o.textures[n];if(!c.extensions||!c.extensions[r])return null;const l=c.extensions[r],d=o.images[l.source];let f=i.textureLoader;if(d.uri){const m=i.options.manager.getHandler(d.uri);m!==null&&(f=m)}return this.detectSupport().then(function(m){if(m)return i.loadTextureImage(n,l.source,f);if(o.extensionsRequired&&o.extensionsRequired.indexOf(r)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(n)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(n){const r=new Image;r.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",r.onload=r.onerror=function(){n(r.height===1)}})),this.isSupported}}class jg{constructor(n){this.parser=n,this.name=Ue.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(n){const r=this.name,i=this.parser,o=i.json,c=o.textures[n];if(!c.extensions||!c.extensions[r])return null;const l=c.extensions[r],d=o.images[l.source];let f=i.textureLoader;if(d.uri){const m=i.options.manager.getHandler(d.uri);m!==null&&(f=m)}return this.detectSupport().then(function(m){if(m)return i.loadTextureImage(n,l.source,f);if(o.extensionsRequired&&o.extensionsRequired.indexOf(r)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(n)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(n){const r=new Image;r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",r.onload=r.onerror=function(){n(r.height===1)}})),this.isSupported}}class Kg{constructor(n){this.name=Ue.EXT_MESHOPT_COMPRESSION,this.parser=n}loadBufferView(n){const r=this.parser.json,i=r.bufferViews[n];if(i.extensions&&i.extensions[this.name]){const o=i.extensions[this.name],c=this.parser.getDependency("buffer",o.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.supported){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return c.then(function(d){const f=o.byteOffset||0,m=o.byteLength||0,p=o.count,h=o.byteStride,g=new Uint8Array(d,f,m);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(p,h,g,o.mode,o.filter).then(function(y){return y.buffer}):l.ready.then(function(){const y=new ArrayBuffer(p*h);return l.decodeGltfBuffer(new Uint8Array(y),p,h,g,o.mode,o.filter),y})})}else return null}}class Qg{constructor(n){this.name=Ue.EXT_MESH_GPU_INSTANCING,this.parser=n}createNodeMesh(n){const r=this.parser.json,i=r.nodes[n];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const o=r.meshes[i.mesh];for(const m of o.primitives)if(m.mode!==gn.TRIANGLES&&m.mode!==gn.TRIANGLE_STRIP&&m.mode!==gn.TRIANGLE_FAN&&m.mode!==void 0)return null;const l=i.extensions[this.name].attributes,d=[],f={};for(const m in l)d.push(this.parser.getDependency("accessor",l[m]).then(p=>(f[m]=p,f[m])));return d.length<1?null:(d.push(this.parser.createNodeMesh(n)),Promise.all(d).then(m=>{const p=m.pop(),h=p.isGroup?p.children:[p],g=m[0].count,y=[];for(const C of h){const T=new Mn,S=new $,E=new ha,w=new $(1,1,1),M=new tm(C.geometry,C.material,g);for(let I=0;I<g;I++)f.TRANSLATION&&S.fromBufferAttribute(f.TRANSLATION,I),f.ROTATION&&E.fromBufferAttribute(f.ROTATION,I),f.SCALE&&w.fromBufferAttribute(f.SCALE,I),M.setMatrixAt(I,T.compose(S,E,w));for(const I in f)if(I==="_COLOR_0"){const _=f[I];M.instanceColor=new nm(_.array,_.itemSize,_.normalized)}else I!=="TRANSLATION"&&I!=="ROTATION"&&I!=="SCALE"&&C.geometry.setAttribute(I,f[I]);Nd.prototype.copy.call(M,C),this.parser.assignFinalMaterial(M),y.push(M)}return p.isGroup?(p.clear(),p.add(...y),p):y[0]}))}}const Mp="glTF",Ss=12,hd={JSON:1313821514,BIN:5130562};class Xg{constructor(n){this.name=Ue.KHR_BINARY_GLTF,this.content=null,this.body=null;const r=new DataView(n,0,Ss);if(this.header={magic:Aa(new Uint8Array(n.slice(0,4))),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==Mp)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Ss,o=new DataView(n,Ss);let c=0;for(;c<i;){const l=o.getUint32(c,!0);c+=4;const d=o.getUint32(c,!0);if(c+=4,d===hd.JSON){const f=new Uint8Array(n,Ss+c,l);this.content=Aa(f)}else if(d===hd.BIN){const f=Ss+c;this.body=n.slice(f,f+l)}c+=l}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Wg{constructor(n,r){if(!r)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Ue.KHR_DRACO_MESH_COMPRESSION,this.json=n,this.dracoLoader=r,this.dracoLoader.preload()}decodePrimitive(n,r){const i=this.json,o=this.dracoLoader,c=n.extensions[this.name].bufferView,l=n.extensions[this.name].attributes,d={},f={},m={};for(const p in l){const h=Tc[p]||p.toLowerCase();d[h]=l[p]}for(const p in n.attributes){const h=Tc[p]||p.toLowerCase();if(l[p]!==void 0){const g=i.accessors[n.attributes[p]],y=ji[g.componentType];m[h]=y.name,f[h]=g.normalized===!0}}return r.getDependency("bufferView",c).then(function(p){return new Promise(function(h,g){o.decodeDracoFile(p,function(y){for(const C in y.attributes){const T=y.attributes[C],S=f[C];S!==void 0&&(T.normalized=S)}h(y)},d,m,Ar,g)})})}}class Yg{constructor(){this.name=Ue.KHR_TEXTURE_TRANSFORM}extendTexture(n,r){return(r.texCoord===void 0||r.texCoord===n.channel)&&r.offset===void 0&&r.rotation===void 0&&r.scale===void 0||(n=n.clone(),r.texCoord!==void 0&&(n.channel=r.texCoord),r.offset!==void 0&&n.offset.fromArray(r.offset),r.rotation!==void 0&&(n.rotation=r.rotation),r.scale!==void 0&&n.repeat.fromArray(r.scale),n.needsUpdate=!0),n}}class Zg{constructor(){this.name=Ue.KHR_MESH_QUANTIZATION}}class xp extends Em{constructor(n,r,i,o){super(n,r,i,o)}copySampleValue_(n){const r=this.resultBuffer,i=this.sampleValues,o=this.valueSize,c=n*o*3+o;for(let l=0;l!==o;l++)r[l]=i[c+l];return r}interpolate_(n,r,i,o){const c=this.resultBuffer,l=this.sampleValues,d=this.valueSize,f=d*2,m=d*3,p=o-r,h=(i-r)/p,g=h*h,y=g*h,C=n*m,T=C-m,S=-2*y+3*g,E=y-g,w=1-S,M=E-g+h;for(let I=0;I!==d;I++){const _=l[T+I+d],F=l[T+I+f]*p,G=l[C+I+d],P=l[C+I]*p;c[I]=w*_+M*F+S*G+E*P}return c}}const Vg=new ha;class qg extends xp{interpolate_(n,r,i,o){const c=super.interpolate_(n,r,i,o);return Vg.fromArray(c).normalize().toArray(c),c}}const gn={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ji={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},md={9728:lm,9729:yn,9984:am,9985:om,9986:sm,9987:bd},Ad={33071:hr,33648:cm,10497:Ac},Yl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Tc={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...qi>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Pr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},$g={CUBICSPLINE:void 0,LINEAR:zd,STEP:Cm},Zl={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ev(s){return s.DefaultMaterial===void 0&&(s.DefaultMaterial=new kd({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:gc})),s.DefaultMaterial}function ni(s,n,r){for(const i in r.extensions)s[i]===void 0&&(n.userData.gltfExtensions=n.userData.gltfExtensions||{},n.userData.gltfExtensions[i]=r.extensions[i])}function pr(s,n){n.extras!==void 0&&(typeof n.extras=="object"?Object.assign(s.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function tv(s,n,r){let i=!1,o=!1,c=!1;for(let m=0,p=n.length;m<p;m++){const h=n[m];if(h.POSITION!==void 0&&(i=!0),h.NORMAL!==void 0&&(o=!0),h.COLOR_0!==void 0&&(c=!0),i&&o&&c)break}if(!i&&!o&&!c)return Promise.resolve(s);const l=[],d=[],f=[];for(let m=0,p=n.length;m<p;m++){const h=n[m];if(i){const g=h.POSITION!==void 0?r.getDependency("accessor",h.POSITION):s.attributes.position;l.push(g)}if(o){const g=h.NORMAL!==void 0?r.getDependency("accessor",h.NORMAL):s.attributes.normal;d.push(g)}if(c){const g=h.COLOR_0!==void 0?r.getDependency("accessor",h.COLOR_0):s.attributes.color;f.push(g)}}return Promise.all([Promise.all(l),Promise.all(d),Promise.all(f)]).then(function(m){const p=m[0],h=m[1],g=m[2];return i&&(s.morphAttributes.position=p),o&&(s.morphAttributes.normal=h),c&&(s.morphAttributes.color=g),s.morphTargetsRelative=!0,s})}function nv(s,n){if(s.updateMorphTargets(),n.weights!==void 0)for(let r=0,i=n.weights.length;r<i;r++)s.morphTargetInfluences[r]=n.weights[r];if(n.extras&&Array.isArray(n.extras.targetNames)){const r=n.extras.targetNames;if(s.morphTargetInfluences.length===r.length){s.morphTargetDictionary={};for(let i=0,o=r.length;i<o;i++)s.morphTargetDictionary[r[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function rv(s){let n;const r=s.extensions&&s.extensions[Ue.KHR_DRACO_MESH_COMPRESSION];if(r?n="draco:"+r.bufferView+":"+r.indices+":"+Vl(r.attributes):n=s.indices+":"+Vl(s.attributes)+":"+s.mode,s.targets!==void 0)for(let i=0,o=s.targets.length;i<o;i++)n+=":"+Vl(s.targets[i]);return n}function Vl(s){let n="";const r=Object.keys(s).sort();for(let i=0,o=r.length;i<o;i++)n+=r[i]+":"+s[r[i]]+";";return n}function _c(s){switch(s){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function iv(s){return s.search(/\.jpe?g($|\?)/i)>0||s.search(/^data\:image\/jpeg/)===0?"image/jpeg":s.search(/\.webp($|\?)/i)>0||s.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const sv=new Mn;class ov{constructor(n={},r={}){this.json=n,this.extensions={},this.plugins={},this.options=r,this.cache=new _g,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,o=!1,c=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,o=navigator.userAgent.indexOf("Firefox")>-1,c=o?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||o&&c<98?this.textureLoader=new Ba(this.options.manager):this.textureLoader=new rm(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Nr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(n){this.extensions=n}setPlugins(n){this.plugins=n}parse(n,r){const i=this,o=this.json,c=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(l){const d={scene:l[0][o.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:o.asset,parser:i,userData:{}};return ni(c,d,o),pr(d,o),Promise.all(i._invokeAll(function(f){return f.afterRoot&&f.afterRoot(d)})).then(function(){for(const f of d.scenes)f.updateMatrixWorld();n(d)})}).catch(r)}_markDefs(){const n=this.json.nodes||[],r=this.json.skins||[],i=this.json.meshes||[];for(let o=0,c=r.length;o<c;o++){const l=r[o].joints;for(let d=0,f=l.length;d<f;d++)n[l[d]].isBone=!0}for(let o=0,c=n.length;o<c;o++){const l=n[o];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(i[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.camera)}}_addNodeRef(n,r){r!==void 0&&(n.refs[r]===void 0&&(n.refs[r]=n.uses[r]=0),n.refs[r]++)}_getNodeRef(n,r,i){if(n.refs[r]<=1)return i;const o=i.clone(),c=(l,d)=>{const f=this.associations.get(l);f!=null&&this.associations.set(d,f);for(const[m,p]of l.children.entries())c(p,d.children[m])};return c(i,o),o.name+="_instance_"+n.uses[r]++,o}_invokeOne(n){const r=Object.values(this.plugins);r.push(this);for(let i=0;i<r.length;i++){const o=n(r[i]);if(o)return o}return null}_invokeAll(n){const r=Object.values(this.plugins);r.unshift(this);const i=[];for(let o=0;o<r.length;o++){const c=n(r[o]);c&&i.push(c)}return i}getDependency(n,r){const i=n+":"+r;let o=this.cache.get(i);if(!o){switch(n){case"scene":o=this.loadScene(r);break;case"node":o=this._invokeOne(function(c){return c.loadNode&&c.loadNode(r)});break;case"mesh":o=this._invokeOne(function(c){return c.loadMesh&&c.loadMesh(r)});break;case"accessor":o=this.loadAccessor(r);break;case"bufferView":o=this._invokeOne(function(c){return c.loadBufferView&&c.loadBufferView(r)});break;case"buffer":o=this.loadBuffer(r);break;case"material":o=this._invokeOne(function(c){return c.loadMaterial&&c.loadMaterial(r)});break;case"texture":o=this._invokeOne(function(c){return c.loadTexture&&c.loadTexture(r)});break;case"skin":o=this.loadSkin(r);break;case"animation":o=this._invokeOne(function(c){return c.loadAnimation&&c.loadAnimation(r)});break;case"camera":o=this.loadCamera(r);break;default:if(o=this._invokeOne(function(c){return c!=this&&c.getDependency&&c.getDependency(n,r)}),!o)throw new Error("Unknown type: "+n);break}this.cache.add(i,o)}return o}getDependencies(n){let r=this.cache.get(n);if(!r){const i=this,o=this.json[n+(n==="mesh"?"es":"s")]||[];r=Promise.all(o.map(function(c,l){return i.getDependency(n,l)})),this.cache.add(n,r)}return r}loadBuffer(n){const r=this.json.buffers[n],i=this.fileLoader;if(r.type&&r.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+r.type+" buffer type is not supported.");if(r.uri===void 0&&n===0)return Promise.resolve(this.extensions[Ue.KHR_BINARY_GLTF].body);const o=this.options;return new Promise(function(c,l){i.load(Gs.resolveURL(r.uri,o.path),c,void 0,function(){l(new Error('THREE.GLTFLoader: Failed to load buffer "'+r.uri+'".'))})})}loadBufferView(n){const r=this.json.bufferViews[n];return this.getDependency("buffer",r.buffer).then(function(i){const o=r.byteLength||0,c=r.byteOffset||0;return i.slice(c,c+o)})}loadAccessor(n){const r=this,i=this.json,o=this.json.accessors[n];if(o.bufferView===void 0&&o.sparse===void 0){const l=Yl[o.type],d=ji[o.componentType],f=o.normalized===!0,m=new d(o.count*l);return Promise.resolve(new ai(m,l,f))}const c=[];return o.bufferView!==void 0?c.push(this.getDependency("bufferView",o.bufferView)):c.push(null),o.sparse!==void 0&&(c.push(this.getDependency("bufferView",o.sparse.indices.bufferView)),c.push(this.getDependency("bufferView",o.sparse.values.bufferView))),Promise.all(c).then(function(l){const d=l[0],f=Yl[o.type],m=ji[o.componentType],p=m.BYTES_PER_ELEMENT,h=p*f,g=o.byteOffset||0,y=o.bufferView!==void 0?i.bufferViews[o.bufferView].byteStride:void 0,C=o.normalized===!0;let T,S;if(y&&y!==h){const E=Math.floor(g/y),w="InterleavedBuffer:"+o.bufferView+":"+o.componentType+":"+E+":"+o.count;let M=r.cache.get(w);M||(T=new m(d,E*y,o.count*y/p),M=new im(T,y/p),r.cache.add(w,M)),S=new ri(M,f,g%y/p,C)}else d===null?T=new m(o.count*f):T=new m(d,g,o.count*f),S=new ai(T,f,C);if(o.sparse!==void 0){const E=Yl.SCALAR,w=ji[o.sparse.indices.componentType],M=o.sparse.indices.byteOffset||0,I=o.sparse.values.byteOffset||0,_=new w(l[1],M,o.sparse.count*E),F=new m(l[2],I,o.sparse.count*f);d!==null&&(S=new ai(S.array.slice(),S.itemSize,S.normalized));for(let G=0,P=_.length;G<P;G++){const D=_[G];if(S.setX(D,F[G*f]),f>=2&&S.setY(D,F[G*f+1]),f>=3&&S.setZ(D,F[G*f+2]),f>=4&&S.setW(D,F[G*f+3]),f>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return S})}loadTexture(n){const r=this.json,i=this.options,c=r.textures[n].source,l=r.images[c];let d=this.textureLoader;if(l.uri){const f=i.manager.getHandler(l.uri);f!==null&&(d=f)}return this.loadTextureImage(n,c,d)}loadTextureImage(n,r,i){const o=this,c=this.json,l=c.textures[n],d=c.images[r],f=(d.uri||d.bufferView)+":"+l.sampler;if(this.textureCache[f])return this.textureCache[f];const m=this.loadImageSource(r,i).then(function(p){p.flipY=!1,p.name=l.name||d.name||"",p.name===""&&typeof d.uri=="string"&&d.uri.startsWith("data:image/")===!1&&(p.name=d.uri);const g=(c.samplers||{})[l.sampler]||{};return p.magFilter=md[g.magFilter]||yn,p.minFilter=md[g.minFilter]||bd,p.wrapS=Ad[g.wrapS]||Ac,p.wrapT=Ad[g.wrapT]||Ac,o.associations.set(p,{textures:n}),p}).catch(function(){return null});return this.textureCache[f]=m,m}loadImageSource(n,r){const i=this,o=this.json,c=this.options;if(this.sourceCache[n]!==void 0)return this.sourceCache[n].then(h=>h.clone());const l=o.images[n],d=self.URL||self.webkitURL;let f=l.uri||"",m=!1;if(l.bufferView!==void 0)f=i.getDependency("bufferView",l.bufferView).then(function(h){m=!0;const g=new Blob([h],{type:l.mimeType});return f=d.createObjectURL(g),f});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+n+" is missing URI and bufferView");const p=Promise.resolve(f).then(function(h){return new Promise(function(g,y){let C=g;r.isImageBitmapLoader===!0&&(C=function(T){const S=new qn(T);S.needsUpdate=!0,g(S)}),r.load(Gs.resolveURL(h,c.path),C,void 0,y)})}).then(function(h){return m===!0&&d.revokeObjectURL(f),pr(h,l),h.userData.mimeType=l.mimeType||iv(l.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",f),h});return this.sourceCache[n]=p,p}assignTexture(n,r,i,o){const c=this;return this.getDependency("texture",i.index).then(function(l){if(!l)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(l=l.clone(),l.channel=i.texCoord),c.extensions[Ue.KHR_TEXTURE_TRANSFORM]){const d=i.extensions!==void 0?i.extensions[Ue.KHR_TEXTURE_TRANSFORM]:void 0;if(d){const f=c.associations.get(l);l=c.extensions[Ue.KHR_TEXTURE_TRANSFORM].extendTexture(l,d),c.associations.set(l,f)}}return o!==void 0&&(typeof o=="number"&&(o=o===pd?si:Ar),"colorSpace"in l?l.colorSpace=o:l.encoding=o===si?pd:Tg),n[r]=l,l})}assignFinalMaterial(n){const r=n.geometry;let i=n.material;const o=r.attributes.tangent===void 0,c=r.attributes.color!==void 0,l=r.attributes.normal===void 0;if(n.isPoints){const d="PointsMaterial:"+i.uuid;let f=this.cache.get(d);f||(f=new um,Hl.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(d,f)),i=f}else if(n.isLine){const d="LineBasicMaterial:"+i.uuid;let f=this.cache.get(d);f||(f=new fm,Hl.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,this.cache.add(d,f)),i=f}if(o||c||l){let d="ClonedMaterial:"+i.uuid+":";o&&(d+="derivative-tangents:"),c&&(d+="vertex-colors:"),l&&(d+="flat-shading:");let f=this.cache.get(d);f||(f=i.clone(),c&&(f.vertexColors=!0),l&&(f.flatShading=!0),o&&(f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(d,f),this.associations.set(f,this.associations.get(i))),i=f}n.material=i}getMaterialType(){return kd}loadMaterial(n){const r=this,i=this.json,o=this.extensions,c=i.materials[n];let l;const d={},f=c.extensions||{},m=[];if(f[Ue.KHR_MATERIALS_UNLIT]){const h=o[Ue.KHR_MATERIALS_UNLIT];l=h.getMaterialType(),m.push(h.extendParams(d,c,r))}else{const h=c.pbrMetallicRoughness||{};if(d.color=new er(1,1,1),d.opacity=1,Array.isArray(h.baseColorFactor)){const g=h.baseColorFactor;d.color.setRGB(g[0],g[1],g[2],Ar),d.opacity=g[3]}h.baseColorTexture!==void 0&&m.push(r.assignTexture(d,"map",h.baseColorTexture,si)),d.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,d.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(m.push(r.assignTexture(d,"metalnessMap",h.metallicRoughnessTexture)),m.push(r.assignTexture(d,"roughnessMap",h.metallicRoughnessTexture))),l=this._invokeOne(function(g){return g.getMaterialType&&g.getMaterialType(n)}),m.push(Promise.all(this._invokeAll(function(g){return g.extendMaterialParams&&g.extendMaterialParams(n,d)})))}c.doubleSided===!0&&(d.side=va);const p=c.alphaMode||Zl.OPAQUE;if(p===Zl.BLEND?(d.transparent=!0,d.depthWrite=!1):(d.transparent=!1,p===Zl.MASK&&(d.alphaTest=c.alphaCutoff!==void 0?c.alphaCutoff:.5)),c.normalTexture!==void 0&&l!==bi&&(m.push(r.assignTexture(d,"normalMap",c.normalTexture)),d.normalScale=new at(1,1),c.normalTexture.scale!==void 0)){const h=c.normalTexture.scale;d.normalScale.set(h,h)}if(c.occlusionTexture!==void 0&&l!==bi&&(m.push(r.assignTexture(d,"aoMap",c.occlusionTexture)),c.occlusionTexture.strength!==void 0&&(d.aoMapIntensity=c.occlusionTexture.strength)),c.emissiveFactor!==void 0&&l!==bi){const h=c.emissiveFactor;d.emissive=new er().setRGB(h[0],h[1],h[2],Ar)}return c.emissiveTexture!==void 0&&l!==bi&&m.push(r.assignTexture(d,"emissiveMap",c.emissiveTexture,si)),Promise.all(m).then(function(){const h=new l(d);return c.name&&(h.name=c.name),pr(h,c),r.associations.set(h,{materials:n}),c.extensions&&ni(o,h,c),h})}createUniqueName(n){const r=dm.sanitizeNodeName(n||"");return r in this.nodeNamesUsed?r+"_"+ ++this.nodeNamesUsed[r]:(this.nodeNamesUsed[r]=0,r)}loadGeometries(n){const r=this,i=this.extensions,o=this.primitiveCache;function c(d){return i[Ue.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(d,r).then(function(f){return gd(f,d,r)})}const l=[];for(let d=0,f=n.length;d<f;d++){const m=n[d],p=rv(m),h=o[p];if(h)l.push(h.promise);else{let g;m.extensions&&m.extensions[Ue.KHR_DRACO_MESH_COMPRESSION]?g=c(m):g=gd(new Jd,m,r),o[p]={primitive:m,promise:g},l.push(g)}}return Promise.all(l)}loadMesh(n){const r=this,i=this.json,o=this.extensions,c=i.meshes[n],l=c.primitives,d=[];for(let f=0,m=l.length;f<m;f++){const p=l[f].material===void 0?ev(this.cache):this.getDependency("material",l[f].material);d.push(p)}return d.push(r.loadGeometries(l)),Promise.all(d).then(function(f){const m=f.slice(0,f.length-1),p=f[f.length-1],h=[];for(let y=0,C=p.length;y<C;y++){const T=p[y],S=l[y];let E;const w=m[y];if(S.mode===gn.TRIANGLES||S.mode===gn.TRIANGLE_STRIP||S.mode===gn.TRIANGLE_FAN||S.mode===void 0)E=c.isSkinnedMesh===!0?new pm(T,w):new Zi(T,w),E.isSkinnedMesh===!0&&E.normalizeSkinWeights(),S.mode===gn.TRIANGLE_STRIP?E.geometry=ad(E.geometry,Ud):S.mode===gn.TRIANGLE_FAN&&(E.geometry=ad(E.geometry,mc));else if(S.mode===gn.LINES)E=new hm(T,w);else if(S.mode===gn.LINE_STRIP)E=new mm(T,w);else if(S.mode===gn.LINE_LOOP)E=new Am(T,w);else if(S.mode===gn.POINTS)E=new gm(T,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+S.mode);Object.keys(E.geometry.morphAttributes).length>0&&nv(E,c),E.name=r.createUniqueName(c.name||"mesh_"+n),pr(E,c),S.extensions&&ni(o,E,S),r.assignFinalMaterial(E),h.push(E)}for(let y=0,C=h.length;y<C;y++)r.associations.set(h[y],{meshes:n,primitives:y});if(h.length===1)return c.extensions&&ni(o,h[0],c),h[0];const g=new Ol;c.extensions&&ni(o,g,c),r.associations.set(g,{meshes:n});for(let y=0,C=h.length;y<C;y++)g.add(h[y]);return g})}loadCamera(n){let r;const i=this.json.cameras[n],o=i[i.type];if(!o){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?r=new oi(Jc.radToDeg(o.yfov),o.aspectRatio||1,o.znear||1,o.zfar||2e6):i.type==="orthographic"&&(r=new Ur(-o.xmag,o.xmag,o.ymag,-o.ymag,o.znear,o.zfar)),i.name&&(r.name=this.createUniqueName(i.name)),pr(r,i),Promise.resolve(r)}loadSkin(n){const r=this.json.skins[n],i=[];for(let o=0,c=r.joints.length;o<c;o++)i.push(this._loadNodeShallow(r.joints[o]));return r.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",r.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(o){const c=o.pop(),l=o,d=[],f=[];for(let m=0,p=l.length;m<p;m++){const h=l[m];if(h){d.push(h);const g=new Mn;c!==null&&g.fromArray(c.array,m*16),f.push(g)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',r.joints[m])}return new vm(d,f)})}loadAnimation(n){const r=this.json,i=this,o=r.animations[n],c=o.name?o.name:"animation_"+n,l=[],d=[],f=[],m=[],p=[];for(let h=0,g=o.channels.length;h<g;h++){const y=o.channels[h],C=o.samplers[y.sampler],T=y.target,S=T.node,E=o.parameters!==void 0?o.parameters[C.input]:C.input,w=o.parameters!==void 0?o.parameters[C.output]:C.output;T.node!==void 0&&(l.push(this.getDependency("node",S)),d.push(this.getDependency("accessor",E)),f.push(this.getDependency("accessor",w)),m.push(C),p.push(T))}return Promise.all([Promise.all(l),Promise.all(d),Promise.all(f),Promise.all(m),Promise.all(p)]).then(function(h){const g=h[0],y=h[1],C=h[2],T=h[3],S=h[4],E=[];for(let w=0,M=g.length;w<M;w++){const I=g[w],_=y[w],F=C[w],G=T[w],P=S[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const D=i._createAnimationTracks(I,_,F,G,P);if(D)for(let O=0;O<D.length;O++)E.push(D[O])}return new ym(c,void 0,E)})}createNodeMesh(n){const r=this.json,i=this,o=r.nodes[n];return o.mesh===void 0?null:i.getDependency("mesh",o.mesh).then(function(c){const l=i._getNodeRef(i.meshCache,o.mesh,c);return o.weights!==void 0&&l.traverse(function(d){if(d.isMesh)for(let f=0,m=o.weights.length;f<m;f++)d.morphTargetInfluences[f]=o.weights[f]}),l})}loadNode(n){const r=this.json,i=this,o=r.nodes[n],c=i._loadNodeShallow(n),l=[],d=o.children||[];for(let m=0,p=d.length;m<p;m++)l.push(i.getDependency("node",d[m]));const f=o.skin===void 0?Promise.resolve(null):i.getDependency("skin",o.skin);return Promise.all([c,Promise.all(l),f]).then(function(m){const p=m[0],h=m[1],g=m[2];g!==null&&p.traverse(function(y){y.isSkinnedMesh&&y.bind(g,sv)});for(let y=0,C=h.length;y<C;y++)p.add(h[y]);return p})}_loadNodeShallow(n){const r=this.json,i=this.extensions,o=this;if(this.nodeCache[n]!==void 0)return this.nodeCache[n];const c=r.nodes[n],l=c.name?o.createUniqueName(c.name):"",d=[],f=o._invokeOne(function(m){return m.createNodeMesh&&m.createNodeMesh(n)});return f&&d.push(f),c.camera!==void 0&&d.push(o.getDependency("camera",c.camera).then(function(m){return o._getNodeRef(o.cameraCache,c.camera,m)})),o._invokeAll(function(m){return m.createNodeAttachment&&m.createNodeAttachment(n)}).forEach(function(m){d.push(m)}),this.nodeCache[n]=Promise.all(d).then(function(m){let p;if(c.isBone===!0?p=new Bm:m.length>1?p=new Ol:m.length===1?p=m[0]:p=new Nd,p!==m[0])for(let h=0,g=m.length;h<g;h++)p.add(m[h]);if(c.name&&(p.userData.name=c.name,p.name=l),pr(p,c),c.extensions&&ni(i,p,c),c.matrix!==void 0){const h=new Mn;h.fromArray(c.matrix),p.applyMatrix4(h)}else c.translation!==void 0&&p.position.fromArray(c.translation),c.rotation!==void 0&&p.quaternion.fromArray(c.rotation),c.scale!==void 0&&p.scale.fromArray(c.scale);return o.associations.has(p)||o.associations.set(p,{}),o.associations.get(p).nodes=n,p}),this.nodeCache[n]}loadScene(n){const r=this.extensions,i=this.json.scenes[n],o=this,c=new Ol;i.name&&(c.name=o.createUniqueName(i.name)),pr(c,i),i.extensions&&ni(r,c,i);const l=i.nodes||[],d=[];for(let f=0,m=l.length;f<m;f++)d.push(o.getDependency("node",l[f]));return Promise.all(d).then(function(f){for(let p=0,h=f.length;p<h;p++)c.add(f[p]);const m=p=>{const h=new Map;for(const[g,y]of o.associations)(g instanceof Hl||g instanceof qn)&&h.set(g,y);return p.traverse(g=>{const y=o.associations.get(g);y!=null&&h.set(g,y)}),h};return o.associations=m(c),c})}_createAnimationTracks(n,r,i,o,c){const l=[],d=n.name?n.name:n.uuid,f=[];Pr[c.path]===Pr.weights?n.traverse(function(g){g.morphTargetInfluences&&f.push(g.name?g.n
vendor: 5,003 bytes, lines 318-322
318ame:g.uuid)}):f.push(d);let m;switch(Pr[c.path]){case Pr.weights:m=kf;break;case Pr.rotation:m=Jf;break;case Pr.position:case Pr.scale:m=bf;break;default:switch(i.itemSize){case 1:m=kf;break;case 2:case 3:default:m=bf;break}break}const p=o.interpolation!==void 0?$g[o.interpolation]:zd,h=this._getArrayFromAccessor(i);for(let g=0,y=f.length;g<y;g++){const C=new m(f[g]+"."+Pr[c.path],r.array,h,p);o.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(C),l.push(C)}return l}_getArrayFromAccessor(n){let r=n.array;if(n.normalized){const i=_c(r.constructor),o=new Float32Array(r.length);for(let c=0,l=r.length;c<l;c++)o[c]=r[c]*i;r=o}return r}_createCubicSplineTrackInterpolant(n){n.createInterpolant=function(i){const o=this instanceof Jf?qg:xp;return new o(this.times,this.values,this.getValueSize()/3,i)},n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function av(s,n,r){const i=n.attributes,o=new qt;if(i.POSITION!==void 0){const d=r.json.accessors[i.POSITION],f=d.min,m=d.max;if(f!==void 0&&m!==void 0){if(o.set(new $(f[0],f[1],f[2]),new $(m[0],m[1],m[2])),d.normalized){const p=_c(ji[d.componentType]);o.min.multiplyScalar(p),o.max.multiplyScalar(p)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const c=n.targets;if(c!==void 0){const d=new $,f=new $;for(let m=0,p=c.length;m<p;m++){const h=c[m];if(h.POSITION!==void 0){const g=r.json.accessors[h.POSITION],y=g.min,C=g.max;if(y!==void 0&&C!==void 0){if(f.setX(Math.max(Math.abs(y[0]),Math.abs(C[0]))),f.setY(Math.max(Math.abs(y[1]),Math.abs(C[1]))),f.setZ(Math.max(Math.abs(y[2]),Math.abs(C[2]))),g.normalized){const T=_c(ji[g.componentType]);f.multiplyScalar(T)}d.max(f)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}o.expandByVector(d)}s.boundingBox=o;const l=new Ca;o.getCenter(l.center),l.radius=o.min.distanceTo(o.max)/2,s.boundingSphere=l}function gd(s,n,r){const i=n.attributes,o=[];function c(l,d){return r.getDependency("accessor",l).then(function(f){s.setAttribute(d,f)})}for(const l in i){const d=Tc[l]||l.toLowerCase();d in s.attributes||o.push(c(i[l],d))}if(n.indices!==void 0&&!s.index){const l=r.getDependency("accessor",n.indices).then(function(d){s.setIndex(d)});o.push(l)}return pr(s,n),av(s,n,r),Promise.all(o).then(function(){return n.targets!==void 0?tv(s,n.targets,r):s})}class lv extends jd{constructor(n){super(n),this.type=Bn}parse(n){const l=function(P,D){switch(P){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(D||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(D||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(D||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(D||""))}},p=` 319`,h=function(P,D,O){D=D||1024;let k=P.pos,Y=-1,Z=0,se="",ue=String.fromCharCode.apply(null,new Uint16Array(P.subarray(k,k+128)));for(;0>(Y=ue.indexOf(p))&&Z<D&&k<P.byteLength;)se+=ue,Z+=ue.length,k+=128,ue+=String.fromCharCode.apply(null,new Uint16Array(P.subarray(k,k+128)));return-1<Y?(P.pos+=Z+Y+1,se+ue.slice(0,Y)):!1},g=function(P){const D=/^#\?(\S+)/,O=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,b=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,k=/^\s*FORMAT=(\S+)\s*$/,Y=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,Z={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let se,ue;for((P.pos>=P.byteLength||!(se=h(P)))&&l(1,"no header found"),(ue=se.match(D))||l(3,"bad initial token"),Z.valid|=1,Z.programtype=ue[1],Z.string+=se+` 320`;se=h(P),se!==!1;){if(Z.string+=se+` 321`,se.charAt(0)==="#"){Z.comments+=se+` 322`;continue}if((ue=se.match(O))&&(Z.gamma=parseFloat(ue[1])),(ue=se.match(b))&&(Z.exposure=parseFloat(ue[1])),(ue=se.match(k))&&(Z.valid|=2,Z.format=ue[1]),(ue=se.match(Y))&&(Z.valid|=4,Z.height=parseInt(ue[1],10),Z.width=parseInt(ue[2],10)),Z.valid&2&&Z.valid&4)break}return Z.valid&2||l(3,"missing format specifier"),Z.valid&4||l(3,"missing image size specifier"),Z},y=function(P,D,O){const b=D;if(b<8||b>32767||P[0]!==2||P[1]!==2||P[2]&128)return new Uint8Array(P);b!==(P[2]<<8|P[3])&&l(3,"wrong scanline width");const k=new Uint8Array(4*D*O);k.length||l(4,"unable to allocate buffer space");let Y=0,Z=0;const se=4*b,ue=new Uint8Array(4),Me=new Uint8Array(se);let V=O;for(;V>0&&Z<P.byteLength;){Z+4>P.byteLength&&l(1),ue[0]=P[Z++],ue[1]=P[Z++],ue[2]=P[Z++],ue[3]=P[Z++],(ue[0]!=2||ue[1]!=2||(ue[2]<<8|ue[3])!=b)&&l(3,"bad rgbe scanline format");let fe=0,q;for(;fe<se&&Z<P.byteLength;){q=P[Z++];const he=q>128;if(he&&(q-=128),(q===0||fe+q>se)&&l(3,"bad scanline data"),he){const ve=P[Z++];for(let ze=0;ze<q;ze++)Me[fe++]=ve}else Me.set(P.subarray(Z,Z+q),fe),fe+=q,Z+=q}const ge=b;for(let he=0;he<ge;he++){let ve=0;k[Y]=Me[he+ve],ve+=b,k[Y+1]=Me[he+ve],ve+=b,k[Y+2]=Me[he+ve],ve+=b,k[Y+3]=Me[he+ve],Y+=4}V--}return k},C=function(P,D,O,b){const k=P[D+3],Y=Math.pow(2,k-128)/255;O[b+0]=P[D+0]*Y,O[b+1]=P[D+1]*Y,O[b+2]=P[D+2]*Y,O[b+3]=1},T=function(P,D,O,b){const k=P[D+3],Y=Math.pow(2,k-128)/255;
vendor: 23,614 bytes, lines 322-323
322O[b+0]=ki.toHalfFloat(Math.min(P[D+0]*Y,65504)),O[b+1]=ki.toHalfFloat(Math.min(P[D+1]*Y,65504)),O[b+2]=ki.toHalfFloat(Math.min(P[D+2]*Y,65504)),O[b+3]=ki.toHalfFloat(1)},S=new Uint8Array(n);S.pos=0;const E=g(S),w=E.width,M=E.height,I=y(S.subarray(S.pos),w,M);let _,F,G;switch(this.type){case mr:G=I.length/4;const P=new Float32Array(G*4);for(let O=0;O<G;O++)C(I,O*4,P,O*4);_=P,F=mr;break;case Bn:G=I.length/4;const D=new Uint16Array(G*4);for(let O=0;O<G;O++)T(I,O*4,D,O*4);_=D,F=Bn;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:w,height:M,data:_,header:E.string,gamma:E.gamma,exposure:E.exposure,type:F}}setDataType(n){return this.type=n,this}load(n,r,i,o){function c(l,d){switch(l.type){case mr:case Bn:"colorSpace"in l?l.colorSpace="srgb-linear":l.encoding=3e3,l.minFilter=yn,l.magFilter=yn,l.generateMipmaps=!1,l.flipY=!0;break}r&&r(l,d)}return super.load(n,c,i,o)}}const Ms=qi>=152;class cv extends jd{constructor(n){super(n),this.type=Bn}parse(n){const D=Math.pow(2.7182818,2.2);function O(B,x){for(var L=0,z=0;z<65536;++z)(z==0||B[z>>3]&1<<(z&7))&&(x[L++]=z);for(var Q=L-1;L<65536;)x[L++]=0;return Q}function b(B){for(var x=0;x<16384;x++)B[x]={},B[x].len=0,B[x].lit=0,B[x].p=null}const k={l:0,c:0,lc:0};function Y(B,x,L,z,Q){for(;L<B;)x=x<<8|Cr(z,Q),L+=8;L-=B,k.l=x>>L&(1<<B)-1,k.c=x,k.lc=L}const Z=new Array(59);function se(B){for(var x=0;x<=58;++x)Z[x]=0;for(var x=0;x<65537;++x)Z[B[x]]+=1;for(var L=0,x=58;x>0;--x){var z=L+Z[x]>>1;Z[x]=L,L=z}for(var x=0;x<65537;++x){var Q=B[x];Q>0&&(B[x]=Q|Z[Q]++<<6)}}function ue(B,x,L,z,Q,X,ne){for(var ee=L,le=0,ae=0;Q<=X;Q++){if(ee.value-L.value>z)return!1;Y(6,le,ae,B,ee);var ce=k.l;if(le=k.c,ae=k.lc,ne[Q]=ce,ce==63){if(ee.value-L.value>z)throw"Something wrong with hufUnpackEncTable";Y(8,le,ae,B,ee);var oe=k.l+6;if(le=k.c,ae=k.lc,Q+oe>X+1)throw"Something wrong with hufUnpackEncTable";for(;oe--;)ne[Q++]=0;Q--}else if(ce>=59){var oe=ce-59+2;if(Q+oe>X+1)throw"Something wrong with hufUnpackEncTable";for(;oe--;)ne[Q++]=0;Q--}}se(ne)}function Me(B){return B&63}function V(B){return B>>6}function fe(B,x,L,z){for(;x<=L;x++){var Q=V(B[x]),X=Me(B[x]);if(Q>>X)throw"Invalid table entry";if(X>14){var ne=z[Q>>X-14];if(ne.len)throw"Invalid table entry";if(ne.lit++,ne.p){var ee=ne.p;ne.p=new Array(ne.lit);for(var le=0;le<ne.lit-1;++le)ne.p[le]=ee[le]}else ne.p=new Array(1);ne.p[ne.lit-1]=x}else if(X)for(var ae=0,le=1<<14-X;le>0;le--){var ne=z[(Q<<14-X)+ae];if(ne.len||ne.p)throw"Invalid table entry";ne.len=X,ne.lit=x,ae++}}return!0}const q={c:0,lc:0};function ge(B,x,L,z){B=B<<8|Cr(L,z),x+=8,q.c=B,q.lc=x}const he={c:0,lc:0};function ve(B,x,L,z,Q,X,ne,ee,le,ae){if(B==x){z<8&&(ge(L,z,Q,ne),L=q.c,z=q.lc),z-=8;var ce=L>>z,ce=new Uint8Array([ce])[0];if(le.value+ce>ae)return!1;for(var oe=ee[le.value-1];ce-- >0;)ee[le.value++]=oe}else if(le.value<ae)ee[le.value++]=B;else return!1;he.c=L,he.lc=z}function ze(B){return B&65535}function nt(B){var x=ze(B);return x>32767?x-65536:x}const Te={a:0,b:0};function pt(B,x){var L=nt(B),z=nt(x),Q=z,X=L+(Q&1)+(Q>>1),ne=X,ee=X-Q;Te.a=ne,Te.b=ee}function mt(B,x){var L=ze(B),z=ze(x),Q=L-(z>>1)&65535,X=z+Q-32768&65535;Te.a=X,Te.b=Q}function Gn(B,x,L,z,Q,X,ne){for(var ee=ne<16384,le=L>Q?Q:L,ae=1,ce;ae<=le;)ae<<=1;for(ae>>=1,ce=ae,ae>>=1;ae>=1;){for(var oe=0,Ze=oe+X*(Q-ce),ye=X*ae,Ce=X*ce,_e=z*ae,Pe=z*ce,Je,be,xe,De;oe<=Ze;oe+=Ce){for(var ke=oe,qe=oe+z*(L-ce);ke<=qe;ke+=Pe){var Le=ke+_e,et=ke+ye,Lt=et+_e;ee?(pt(B[ke+x],B[et+x]),Je=Te.a,xe=Te.b,pt(B[Le+x],B[Lt+x]),be=Te.a,De=Te.b,pt(Je,be),B[ke+x]=Te.a,B[Le+x]=Te.b,pt(xe,De),B[et+x]=Te.a,B[Lt+x]=Te.b):(mt(B[ke+x],B[et+x]),Je=Te.a,xe=Te.b,mt(B[Le+x],B[Lt+x]),be=Te.a,De=Te.b,mt(Je,be),B[ke+x]=Te.a,B[Le+x]=Te.b,mt(xe,De),B[et+x]=Te.a,B[Lt+x]=Te.b)}if(L&ae){var et=ke+ye;ee?pt(B[ke+x],B[et+x]):mt(B[ke+x],B[et+x]),Je=Te.a,B[et+x]=Te.b,B[ke+x]=Je}}if(Q&ae)for(var ke=oe,qe=oe+z*(L-ce);ke<=qe;ke+=Pe){var Le=ke+_e;ee?pt(B[ke+x],B[Le+x]):mt(B[ke+x],B[Le+x]),Je=Te.a,B[Le+x]=Te.b,B[ke+x]=Je}ce=ae,ae>>=1}return oe}function ut(B,x,L,z,Q,X,ne,ee,le,ae){for(var ce=0,oe=0,Ze=ee,ye=Math.trunc(Q.value+(X+7)/8);Q.value<ye;)for(ge(ce,oe,L,Q),ce=q.c,oe=q.lc;oe>=14;){var Ce=ce>>oe-14&16383,_e=x[Ce];if(_e.len)oe-=_e.len,ve(_e.lit,ne,ce,oe,L,z,Q,le,ae,Ze),ce=he.c,oe=he.lc;else{if(!_e.p)throw"hufDecode issues";var Pe;for(Pe=0;Pe<_e.lit;Pe++){for(var Je=Me(B[_e.p[Pe]]);oe<Je&&Q.value<ye;)ge(ce,oe,L,Q),ce=q.c,oe=q.lc;if(oe>=Je&&V(B[_e.p[Pe]])==(ce>>oe-Je&(1<<Je)-1)){oe-=Je,ve(_e.p[Pe],ne,ce,oe,L,z,Q,le,ae,Ze),ce=he.c,oe=he.lc;break}}if(Pe==_e.lit)throw"hufDecode issues"}}var be=8-X&7;for(ce>>=be,oe-=be;oe>0;){var _e=x[ce<<14-oe&16383];if(_e.len)oe-=_e.len,ve(_e.lit,ne,ce,oe,L,z,Q,le,ae,Ze),ce=he.c,oe=he.lc;else throw"hufDecode issues"}return!0}function Fe(B,x,L,z,Q,X){var ne={value:0},ee=L.value,le=Bt(x,L),ae=Bt(x,L);L.value+=4;var ce=Bt(x,L);if(L.value+=4,le<0||le>=65537||ae<0||ae>=65537)throw"Something wrong with HUF_ENCSIZE";var oe=new Array(65537),Ze=new Array(16384);b(Ze);var ye=z-(L.value-ee);if(ue(B,x,L,ye,le,ae,oe),ce>8*(z-(L.value-ee)))throw"Something wrong with hufUncompress";fe(oe,le,ae,Ze),ut(oe,Ze,B,x,L,ce,ae,X,Q,ne)}function Tt(B,x,L){for(var z=0;z<L;++z)x[z]=B[x[z]]}function Ye(B){for(var x=1;x<B.length;x++){var L=B[x-1]+B[x]-128;B[x]=L}}function $t(B,x){for(var L=0,z=Math.floor((B.length+1)/2),Q=0,X=B.length-1;!(Q>X||(x[Q++]=B[L++],Q>X));)x[Q++]=B[z++]}function _n(B){for(var x=B.byteLength,L=new Array,z=0,Q=new DataView(B);x>0;){var X=Q.getInt8(z++);if(X<0){var ne=-X;x-=ne+1;for(var ee=0;ee<ne;ee++)L.push(Q.getUint8(z++))}else{var ne=X;x-=2;for(var le=Q.getUint8(z++),ee=0;ee<ne+1;ee++)L.push(le)}}return L}function kr(B,x,L,z,Q,X){var Le=new DataView(X.buffer),ne=L[B.idx[0]].width,ee=L[B.idx[0]].height,le=3,ae=Math.floor(ne/8),ce=Math.ceil(ne/8),oe=Math.ceil(ee/8),Ze=ne-(ce-1)*8,ye=ee-(oe-1)*8,Ce={value:0},_e=new Array(le),Pe=new Array(le),Je=new Array(le),be=new Array(le),xe=new Array(le);for(let We=0;We<le;++We)xe[We]=x[B.idx[We]],_e[We]=We<1?0:_e[We-1]+ce*oe,Pe[We]=new Float32Array(64),Je[We]=new Uint16Array(64),be[We]=new Uint16Array(ce*64);for(let We=0;We<oe;++We){var De=8;We==oe-1&&(De=ye);var ke=8;for(let Ve=0;Ve<ce;++Ve){Ve==ce-1&&(ke=Ze);for(let je=0;je<le;++je)Je[je].fill(0),Je[je][0]=Q[_e[je]++],Kt(Ce,z,Je[je]),nr(Je[je],Pe[je]),Hn(Pe[je]);an(Pe);for(let je=0;je<le;++je)Jr(Pe[je],be[je],Ve*64)}let Ct=0;for(let Ve=0;Ve<le;++Ve){const je=L[B.idx[Ve]].type;for(let st=8*We;st<8*We+De;++st){Ct=xe[Ve][st];for(let sr=0;sr<ae;++sr){const bt=sr*64+(st&7)*8;Le.setUint16(Ct+0*2*je,be[Ve][bt+0],!0),Le.setUint16(Ct+1*2*je,be[Ve][bt+1],!0),Le.setUint16(Ct+2*2*je,be[Ve][bt+2],!0),Le.setUint16(Ct+3*2*je,be[Ve][bt+3],!0),Le.setUint16(Ct+4*2*je,be[Ve][bt+4],!0),Le.setUint16(Ct+5*2*je,be[Ve][bt+5],!0),Le.setUint16(Ct+6*2*je,be[Ve][bt+6],!0),Le.setUint16(Ct+7*2*je,be[Ve][bt+7],!0),Ct+=8*2*je}}if(ae!=ce)for(let st=8*We;st<8*We+De;++st){const sr=xe[Ve][st]+8*ae*2*je,bt=ae*64+(st&7)*8;for(let kn=0;kn<ke;++kn)Le.setUint16(sr+kn*2*je,be[Ve][bt+kn],!0)}}}for(var qe=new Uint16Array(ne),Le=new DataView(X.buffer),et=0;et<le;++et){L[B.idx[et]].decoded=!0;var Lt=L[B.idx[et]].type;if(L[et].type==2)for(var At=0;At<ee;++At){const We=xe[et][At];for(var It=0;It<ne;++It)qe[It]=Le.getUint16(We+It*2*Lt,!0);for(var It=0;It<ne;++It)Le.setFloat32(We+It*2*Lt,ie(qe[It]),!0)}}}function Kt(B,x,L){for(var z,Q=1;Q<64;)z=x[B.value],z==65280?Q=64:z>>8==255?Q+=z&255:(L[Q]=z,Q++),B.value++}function nr(B,x){x[0]=ie(B[0]),x[1]=ie(B[1]),x[2]=ie(B[5]),x[3]=ie(B[6]),x[4]=ie(B[14]),x[5]=ie(B[15]),x[6]=ie(B[27]),x[7]=ie(B[28]),x[8]=ie(B[2]),x[9]=ie(B[4]),x[10]=ie(B[7]),x[11]=ie(B[13]),x[12]=ie(B[16]),x[13]=ie(B[26]),x[14]=ie(B[29]),x[15]=ie(B[42]),x[16]=ie(B[3]),x[17]=ie(B[8]),x[18]=ie(B[12]),x[19]=ie(B[17]),x[20]=ie(B[25]),x[21]=ie(B[30]),x[22]=ie(B[41]),x[23]=ie(B[43]),x[24]=ie(B[9]),x[25]=ie(B[11]),x[26]=ie(B[18]),x[27]=ie(B[24]),x[28]=ie(B[31]),x[29]=ie(B[40]),x[30]=ie(B[44]),x[31]=ie(B[53]),x[32]=ie(B[10]),x[33]=ie(B[19]),x[34]=ie(B[23]),x[35]=ie(B[32]),x[36]=ie(B[39]),x[37]=ie(B[45]),x[38]=ie(B[52]),x[39]=ie(B[54]),x[40]=ie(B[20]),x[41]=ie(B[22]),x[42]=ie(B[33]),x[43]=ie(B[38]),x[44]=ie(B[46]),x[45]=ie(B[51]),x[46]=ie(B[55]),x[47]=ie(B[60]),x[48]=ie(B[21]),x[49]=ie(B[34]),x[50]=ie(B[37]),x[51]=ie(B[47]),x[52]=ie(B[50]),x[53]=ie(B[56]),x[54]=ie(B[59]),x[55]=ie(B[61]),x[56]=ie(B[35]),x[57]=ie(B[36]),x[58]=ie(B[48]),x[59]=ie(B[49]),x[60]=ie(B[57]),x[61]=ie(B[58]),x[62]=ie(B[62]),x[63]=ie(B[63])}function Hn(B){const x=.5*Math.cos(.7853975),L=.5*Math.cos(3.14159/16),z=.5*Math.cos(3.14159/8),Q=.5*Math.cos(3*3.14159/16),X=.5*Math.cos(5*3.14159/16),ne=.5*Math.cos(3*3.14159/8),ee=.5*Math.cos(7*3.14159/16);for(var le=new Array(4),ae=new Array(4),ce=new Array(4),oe=new Array(4),Ze=0;Ze<8;++Ze){var ye=Ze*8;le[0]=z*B[ye+2],le[1]=ne*B[ye+2],le[2]=z*B[ye+6],le[3]=ne*B[ye+6],ae[0]=L*B[ye+1]+Q*B[ye+3]+X*B[ye+5]+ee*B[ye+7],ae[1]=Q*B[ye+1]-ee*B[ye+3]-L*B[ye+5]-X*B[ye+7],ae[2]=X*B[ye+1]-L*B[ye+3]+ee*B[ye+5]+Q*B[ye+7],ae[3]=ee*B[ye+1]-X*B[ye+3]+Q*B[ye+5]-L*B[ye+7],ce[0]=x*(B[ye+0]+B[ye+4]),ce[3]=x*(B[ye+0]-B[ye+4]),ce[1]=le[0]+le[3],ce[2]=le[1]-le[2],oe[0]=ce[0]+ce[1],oe[1]=ce[3]+ce[2],oe[2]=ce[3]-ce[2],oe[3]=ce[0]-ce[1],B[ye+0]=oe[0]+ae[0],B[ye+1]=oe[1]+ae[1],B[ye+2]=oe[2]+ae[2],B[ye+3]=oe[3]+ae[3],B[ye+4]=oe[3]-ae[3],B[ye+5]=oe[2]-ae[2],B[ye+6]=oe[1]-ae[1],B[ye+7]=oe[0]-ae[0]}for(var Ce=0;Ce<8;++Ce)le[0]=z*B[16+Ce],le[1]=ne*B[16+Ce],le[2]=z*B[48+Ce],le[3]=ne*B[48+Ce],ae[0]=L*B[8+Ce]+Q*B[24+Ce]+X*B[40+Ce]+ee*B[56+Ce],ae[1]=Q*B[8+Ce]-ee*B[24+Ce]-L*B[40+Ce]-X*B[56+Ce],ae[2]=X*B[8+Ce]-L*B[24+Ce]+ee*B[40+Ce]+Q*B[56+Ce],ae[3]=ee*B[8+Ce]-X*B[24+Ce]+Q*B[40+Ce]-L*B[56+Ce],ce[0]=x*(B[Ce]+B[32+Ce]),ce[3]=x*(B[Ce]-B[32+Ce]),ce[1]=le[0]+le[3],ce[2]=le[1]-le[2],oe[0]=ce[0]+ce[1],oe[1]=ce[3]+ce[2],oe[2]=ce[3]-ce[2],oe[3]=ce[0]-ce[1],B[0+Ce]=oe[0]+ae[0],B[8+Ce]=oe[1]+ae[1],B[16+Ce]=oe[2]+ae[2],B[24+Ce]=oe[3]+ae[3],B[32+Ce]=oe[3]-ae[3],B[40+Ce]=oe[2]-ae[2],B[48+Ce]=oe[1]-ae[1],B[56+Ce]=oe[0]-ae[0]}function an(B){for(var x=0;x<64;++x){var L=B[0][x],z=B[1][x],Q=B[2][x];B[0][x]=L+1.5747*Q,B[1][x]=L-.1873*z-.4682*Q,B[2][x]=L+1.8556*z}}function Jr(B,x,L){for(var z=0;z<64;++z)x[L+z]=ki.toHalfFloat(vr(B[z]))}function vr(B){return B<=1?Math.sign(B)*Math.pow(Math.abs(B),2.2):Math.sign(B)*Math.pow(D,Math.abs(B)-1)}function On(B){return new DataView(B.array.buffer,B.offset.value,B.size)}function Nt(B){var x=B.viewer.buffer.slice(B.offset.value,B.offset.value+B.size),L=new Uint8Array(_n(x)),z=new Uint8Array(L.length);return Ye(L),$t(L,z),new DataView(z.buffer)}function rr(B){var x=B.array.slice(B.offset.value,B.offset.value+B.size),L=Jo(x),z=new Uint8Array(L.length);return Ye(L),$t(L,z),new DataView(z.buffer)}function zr(B){for(var x=B.viewer,L={value:B.offset.value},z=new Uint16Array(B.width*B.scanlineBlockSize*(B.channels*B.type)),Q=new Uint8Array(8192),X=0,ne=new Array(B.channels),ee=0;ee<B.channels;ee++)ne[ee]={},ne[ee].start=X,ne[ee].end=ne[ee].start,ne[ee].nx=B.width,ne[ee].ny=B.lines,ne[ee].size=B.type,X+=ne[ee].nx*ne[ee].ny*ne[ee].size;var le=_t(x,L),ae=_t(x,L);if(ae>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(le<=ae)for(var ee=0;ee<ae-le+1;ee++)Q[ee+le]=N(x,L);var ce=new Uint16Array(65536),oe=O(Q,ce),Ze=Bt(x,L);Fe(B.array,x,L,Ze,z,X);for(var ee=0;ee<B.channels;++ee)for(var ye=ne[ee],Ce=0;Ce<ne[ee].size;++Ce)Gn(z,ye.start+Ce,ye.nx,ye.size,ye.ny,ye.nx*ye.size,oe);Tt(ce,z,X);for(var _e=0,Pe=new Uint8Array(z.buffer.byteLength),Je=0;Je<B.lines;Je++)for(var be=0;be<B.channels;be++){var ye=ne[be],xe=ye.nx*ye.size,De=new Uint8Array(z.buffer,ye.end*2,xe*2);Pe.set(De,_e),_e+=xe*2,ye.end+=xe}return new DataView(Pe.buffer)}function Qt(B){var x=B.array.slice(B.offset.value,B.offset.value+B.size),L=Jo(x);const z=B.lines*B.channels*B.width,Q=B.type==1?new Uint16Array(z):new Uint32Array(z);let X=0,ne=0;const ee=new Array(4);for(let le=0;le<B.lines;le++)for(let ae=0;ae<B.channels;ae++){let ce=0;switch(B.type){case 1:ee[0]=X,ee[1]=ee[0]+B.width,X=ee[1]+B.width;for(let oe=0;oe<B.width;++oe){const Ze=L[ee[0]++]<<8|L[ee[1]++];ce+=Ze,Q[ne]=ce,ne++}break;case 2:ee[0]=X,ee[1]=ee[0]+B.width,ee[2]=ee[1]+B.width,X=ee[2]+B.width;for(let oe=0;oe<B.width;++oe){const Ze=L[ee[0]++]<<24|L[ee[1]++]<<16|L[ee[2]++]<<8;ce+=Ze,Q[ne]=ce,ne++}break}}return new DataView(Q.buffer)}function yr(B){var x=B.viewer,L={value:B.offset.value},z=new Uint8Array(B.width*B.lines*(B.channels*B.type*2)),Q={version:te(x,L),unknownUncompressedSize:te(x,L),unknownCompressedSize:te(x,L),acCompressedSize:te(x,L),dcCompressedSize:te(x,L),rleCompressedSize:te(x,L),rleUncompressedSize:te(x,L),rleRawSize:te(x,L),totalAcUncompressedCount:te(x,L),totalDcUncompressedCount:te(x,L),acCompression:te(x,L)};if(Q.version<2)throw"EXRLoader.parse: "+In.compression+" version "+Q.version+" is unsupported";for(var X=new Array,ne=_t(x,L)-2;ne>0;){var ee=Br(x.buffer,L),le=N(x,L),ae=le>>2&3,ce=(le>>4)-1,oe=new Int8Array([ce])[0],Ze=N(x,L);X.push({name:ee,index:oe,type:Ze,compression:ae}),ne-=ee.length+3}for(var ye=In.channels,Ce=new Array(B.channels),_e=0;_e<B.channels;++_e){var Pe=Ce[_e]={},Je=ye[_e];Pe.name=Je.name,Pe.compression=0,Pe.decoded=!1,Pe.type=Je.pixelType,Pe.pLinear=Je.pLinear,Pe.width=B.width,Pe.height=B.lines}for(var be={idx:new Array(3)},xe=0;xe<B.channels;++xe)for(var Pe=Ce[xe],_e=0;_e<X.length;++_e){var De=X[_e];Pe.name==De.name&&(Pe.compression=De.compression,De.index>=0&&(be.idx[De.index]=xe),Pe.offset=xe)}if(Q.acCompressedSize>0)switch(Q.acCompression){case 0:var Le=new Uint16Array(Q.totalAcUncompressedCount);Fe(B.array,x,L,Q.acCompressedSize,Le,Q.totalAcUncompressedCount);break;case 1:var ke=B.array.slice(L.value,L.value+Q.totalAcUncompressedCount),qe=Jo(ke),Le=new Uint16Array(qe.buffer);L.value+=Q.totalAcUncompressedCount;break}if(Q.dcCompressedSize>0){var et={array:B.array,offset:L,size:Q.dcCompressedSize},Lt=new Uint16Array(rr(et).buffer);L.value+=Q.dcCompressedSize}if(Q.rleRawSize>0){var ke=B.array.slice(L.value,L.value+Q.rleCompressedSize),qe=Jo(ke),At=_n(qe.buffer);L.value+=Q.rleCompressedSize}for(var It=0,We=new Array(Ce.length),_e=0;_e<We.length;++_e)We[_e]=new Array;for(var Ct=0;Ct<B.lines;++Ct)for(var Ve=0;Ve<Ce.length;++Ve)We[Ve].push(It),It+=Ce[Ve].width*B.type*2;kr(be,We,Ce,Le,Lt,z);for(var _e=0;_e<Ce.length;++_e){var Pe=Ce[_e];if(!Pe.decoded)switch(Pe.compression){case 2:for(var je=0,st=0,Ct=0;Ct<B.lines;++Ct){for(var sr=We[_e][je],bt=0;bt<Pe.width;++bt){for(var kn=0;kn<2*Pe.type;++kn)z[sr++]=At[st+kn*Pe.width*Pe.height];st++}je++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(z.buffer)}function Br(B,x){for(var L=new Uint8Array(B),z=0;L[x.value+z]!=0;)z+=1;var Q=new TextDecoder().decode(L.slice(x.value,x.value+z));return x.value=x.value+z+1,Q}function es(B,x,L){var z=new TextDecoder().decode(new Uint8Array(B).slice(x.value,x.value+L));return x.value=x.value+L,z}function ui(B,x){var L=ir(B,x),z=Bt(B,x);return[L,z]}function ts(B,x){var L=Bt(B,x),z=Bt(B,x);return[L,z]}function ir(B,x){var L=B.getInt32(x.value,!0);return x.value=x.value+4,L}function Bt(B,x){var L=B.getUint32(x.value,!0);return x.value=x.value+4,L}function Cr(B,x){var L=B[x.value];return x.value=x.value+1,L}function N(B,x){var L=B.getUint8(x.value);return x.value=x.value+1,L}const te=function(B,x){let L;return"getBigInt64"in DataView.prototype?L=Number(B.getBigInt64(x.value,!0)):L=B.getUint32(x.value+4,!0)+Number(B.getUint32(x.value,!0)<<32),x.value+=8,L};function me(B,x){var L=B.getFloat32(x.value,!0);return x.value+=4,L}function Ne(B,x){return ki.toHalfFloat(me(B,x))}function ie(B){var x=(B&31744)>>10,L=B&1023;return(B>>15?-1:1)*(x?x===31?L?NaN:1/0:Math.pow(2,x-15)*(1+L/1024):6103515625e-14*(L/1024))}function _t(B,x){var L=B.getUint16(x.value,!0);return x.value+=2,L}function ln(B,x){return ie(_t(B,x))}function js(B,x,L,z){for(var Q=L.value,X=[];L.value<Q+z-1;){var ne=Br(x,L),ee=ir(B,L),le=N(B,L);L.value+=3;var ae=ir(B,L),ce=ir(B,L);X.push({name:ne,pixelType:ee,pLinear:le,xSampling:ae,ySampling:ce})}return L.value+=1,X}function jr(B,x){var L=me(B,x),z=me(B,x),Q=me(B,x),X=me(B,x),ne=me(B,x),ee=me(B,x),le=me(B,x),ae=me(B,x);return{redX:L,redY:z,greenX:Q,greenY:X,blueX:ne,blueY:ee,whiteX:le,whiteY:ae}}function Xt(B,x){var L=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],z=N(B,x);return L[z]}function en(B,x){var L=Bt(B,x),z=Bt(B,x),Q=Bt(B,x),X=Bt(B,x);return{xMin:L,yMin:z,xMax:Q,yMax:X}}function Un(B,x){var L=["INCREASING_Y"],z=N(B,x);return L[z]}function Nn(B,x){var L=me(B,x),z=me(B,x);return[L,z]}function bn(B,x){var L=me(B,x),z=me(B,x),Q=me(B,x);return[L,z,Q]}function Er(B,x,L,z,Q){if(z==="string"||z==="stringvector"||z==="iccProfile")return es(x,L,Q);if(z==="chlist")return js(B,x,L,Q);if(z==="chromaticities")return jr(B,L);if(z==="compression")return Xt(B,L);if(z==="box2i")return en(B,L);if(z==="lineOrder")return Un(B,L);if(z==="float")return me(B,L);if(z==="v2f")return Nn(B,L);if(z==="v3f")return bn(B,L);if(z==="int")return ir(B,L);if(z==="rational")return ui(B,L);if(z==="timecode")return ts(B,L);if(z==="preview")return L.value+=Q,"skipped";L.value+=Q}function Ta(B,x,L){const z={};if(B.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";z.version=B.getUint8(4);const Q=B.getUint8(5);z.spec={singleTile:!!(Q&2),longName:!!(Q&4),deepFormat:!!(Q&8),multiPart:!!(Q&16)},L.value=8;for(var X=!0;X;){var ne=Br(x,L);if(ne==0)X=!1;else{var ee=Br(x,L),le=Bt(B,L),ae=Er(B,x,L,ee,le);ae===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${ee}'.`):z[ne]=ae}}if(Q&-5)throw console.error("EXRHeader:",z),"THREE.EXRLoader: provided file is currently unsupported.";return z}function _a(B,x,L,z,Q){const X={size:0,viewer:x,array:L,offset:z,width:B.dataWindow.xMax-B.dataWindow.xMin+1,height:B.dataWindow.yMax-B.dataWindow.yMin+1,channels:B.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:B.channels[0].pixelType,uncompress:null,getter:null,format:null,[Ms?"colorSpace":"encoding"]:null};switch(B.compression){case"NO_COMPRESSION":X.lines=1,X.uncompress=On;break;case"RLE_COMPRESSION":X.lines=1,X.uncompress=Nt;break;case"ZIPS_COMPRESSION":X.lines=1,X.uncompress=rr;break;case"ZIP_COMPRESSION":X.lines=16,X.uncompress=rr;break;case"PIZ_COMPRESSION":X.lines=32,X.uncompress=zr;break;case"PXR24_COMPRESSION":X.lines=16,X.uncompress=Qt;break;case"DWAA_COMPRESSION":X.lines=32,X.uncompress=yr;break;case"DWAB_COMPRESSION":X.lines=256,X.uncompress=yr;break;default:throw"EXRLoader.parse: "+B.compression+" is unsupported"}if(X.scanlineBlockSize=X.lines,X.type==1)switch(Q){case mr:X.getter=ln,X.inputSize=2;break;case Bn:X.getter=_t,X.inputSize=2;break}else if(X.type==2)switch(Q){case mr:X.getter=me,X.inputSize=4;break;case Bn:X.getter=Ne,X.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+X.type+" for "+B.compression+".";X.blockCount=(B.dataWindow.yMax+1)/X.scanlineBlockSize;for(var ne=0;ne<X.blockCount;ne++)te(x,z);X.outputChannels=X.channels==3?4:X.channels;const ee=X.width*X.height*X.outputChannels;switch(Q){case mr:X.byteArray=new Float32Array(ee),X.channels<X.outputChannels&&X.byteArray.fill(1,0,ee);break;case Bn:X.byteArray=new Uint16Array(ee),X.channels<X.outputChannels&&X.byteArray.fill(15360,0,ee);break;default:console.error("THREE.EXRLoader: unsupported type: ",Q);break}return X.bytesPerLine=X.width*X.inputSize*X.channels,X.outputChannels==4?X.format=Qi:X.format=wm,Ms?X.colorSpace="srgb-linear":X.encoding=3e3,X}const Kr=new DataView(n),ns=new Uint8Array(n),Qr={value:0},In=Ta(Kr,n,Qr),Oe=_a(In,Kr,ns,Qr,this.type),Ks={value:0},Ia={R:0,G:1,B:2,A:3,Y:0};for(let B=0;B<Oe.height/Oe.scanlineBlockSize;B++){const x=Bt(Kr,Qr);Oe.size=Bt(Kr,Qr),Oe.lines=x+Oe.scanlineBlockSize>Oe.height?Oe.height-x:Oe.scanlineBlockSize;const z=Oe.size<Oe.lines*Oe.bytesPerLine?Oe.uncompress(Oe):On(Oe);Qr.value+=Oe.size;for(let Q=0;Q<Oe.scanlineBlockSize;Q++){const X=Q+B*Oe.scanlineBlockSize;if(X>=Oe.height)break;for(let ne=0;ne<Oe.channels;ne++){const ee=Ia[In.channels[ne].name];for(let le=0;le<Oe.width;le++){Ks.value=(Q*(Oe.channels*Oe.width)+ne*Oe.width+le)*Oe.inputSize;const ae=(Oe.height-1-X)*(Oe.width*Oe.outputChannels)+le*Oe.outputChannels+ee;Oe.byteArray[ae]=Oe.getter(z,Ks)}}}}return{header:In,width:Oe.width,height:Oe.height,data:Oe.byteArray,format:Oe.format,[Ms?"colorSpace":"encoding"]:Oe[Ms?"colorSpace":"encoding"],type:this.type}}setDataType(n){return this.type=n,this}load(n,r,i,o){function c(l,d){Ms?l.colorSpace=d.colorSpace:l.encoding=d.encoding,l.minFilter=yn,l.magFilter=yn,l.generateMipmaps=!1,l.flipY=!1,r&&r(l,d)}return super.load(n,c,i,o)}}const ql=new WeakMap;class uv extends kc{constructor(n){super(n),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(n){return this.decoderPath=n,this}setDecoderConfig(n){return this.decoderConfig=n,this}setWorkerLimit(n){return this.workerLimit=n,this}load(n,r,i,o){const c=new Nr(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(this.withCredentials),c.load(n,l=>{const d={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(l,d).then(r).catch(o)},i,o)}decodeDracoFile(n,r,i,o){const c={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:o||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(n,c).then(r)}decodeGeometry(n,r){for(const f in r.attributeTypes){const m=r.attributeTypes[f];m.BYTES_PER_ELEMENT!==void 0&&(r.attributeTypes[f]=m.name)}const i=JSON.stringify(r);if(ql.has(n)){const f=ql.get(n);if(f.key===i)return f.promise;if(n.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let o;const c=this.workerNextTaskID++,l=n.byteLength,d=this._getWorker(c,l).then(f=>(o=f,new Promise((m,p)=>{o._callbacks[c]={resolve:m,reject:p},o.postMessage({type:"decode",id:c,taskConfig:r,buffer:n},[n])}))).then(f=>this._createGeometry(f.geometry));return d.catch(()=>!0).then(()=>{o&&c&&this._releaseTask(o,c)}),ql.set(n,{key:i,promise:d}),d}_createGeometry(n){const r=new Jd;n.index&&r.setIndex(new ai(n.index.array,1));for(let i=0;i<n.attributes.length;i++){const o=n.attributes[i],c=o.name,l=o.array,d=o.itemSize;r.setAttribute(c,new ai(l,d))}return r}_loadLibrary(n,r){const i=new Nr(this.manager);return i.setPath(this.decoderPath),i.setResponseType(r),i.setWithCredentials(this.withCredentials),new Promise((o,c)=>{i.load(n,o,void 0,c)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const n=typeof WebAssembly!="object"||this.decoderConfig.type==="js",r=[];return n?r.push(this._loadLibrary("draco_decoder.js","text")):(r.push(this._loadLibrary("draco_wasm_wrapper.js","text")),r.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(r).then(i=>{const o=i[0];n||(this.decoderConfig.wasmBinary=i[1]);const c=fv.toString(),l=["/* draco decoder */",o,"","/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(` 323`);this.workerSourceURL=URL.createObjectURL(new Blob([l]))}),this.decoderPending}_getWorker(n,r){return this._initDecoder().then(()=>
323{if(this.workerPool.length<this.workerLimit){const o=new Worker(this.workerSourceURL);o._callbacks={},o._taskCosts={},o._taskLoad=0,o.postMessage({type:"init",decoderConfig:this.decoderConfig}),o.onmessage=function(c){const l=c.data;switch(l.type){case"decode":o._callbacks[l.id].resolve(l);break;case"error":o._callbacks[l.id].reject(l);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+l.type+'"')}},this.workerPool.push(o)}else this.workerPool.sort(function(o,c){return o._taskLoad>c._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[n]=r,i._taskLoad+=r,i})}_releaseTask(n,r){n._taskLoad-=n._taskCosts[r],delete n._callbacks[r],delete n._taskCosts[r]}debug(){this.workerPool.map(n=>n._taskLoad)}dispose(){for(let n=0;n<this.workerPool.length;++n)this.workerPool[n].terminate();return this.workerPool.length=0,this}}function fv(){let s,n;onmessage=function(l){const d=l.data;switch(d.type){case"init":s=d.decoderConfig,n=new Promise(function(p){s.onModuleLoaded=function(h){p({draco:h})},DracoDecoderModule(s)});break;case"decode":const f=d.buffer,m=d.taskConfig;n.then(p=>{const h=p.draco,g=new h.Decoder,y=new h.DecoderBuffer;y.Init(new Int8Array(f),f.byteLength);try{const C=r(h,g,y,m),T=C.attributes.map(S=>S.array.buffer);C.index&&T.push(C.index.array.buffer),self.postMessage({type:"decode",id:d.id,geometry:C},T)}catch(C){console.error(C),self.postMessage({type:"error",id:d.id,error:C.message})}finally{h.destroy(y),h.destroy(g)}});break}};function r(l,d,f,m){const p=m.attributeIDs,h=m.attributeTypes;let g,y;const C=d.GetEncodedGeometryType(f);if(C===l.TRIANGULAR_MESH)g=new l.Mesh,y=d.DecodeBufferToMesh(f,g);else if(C===l.POINT_CLOUD)g=new l.PointCloud,y=d.DecodeBufferToPointCloud(f,g);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!y.ok()||g.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+y.error_msg());const T={index:null,attributes:[]};for(const S in p){const E=self[h[S]];let w,M;if(m.useUniqueIDs)M=p[S],w=d.GetAttributeByUniqueId(g,M);else{if(M=d.GetAttributeId(g,l[p[S]]),M===-1)continue;w=d.GetAttribute(g,M)}T.attributes.push(o(l,d,g,S,E,w))}return C===l.TRIANGULAR_MESH&&(T.index=i(l,d,g)),l.destroy(g),T}function i(l,d,f){const p=f.num_faces()*3,h=p*4,g=l._malloc(h);d.GetTrianglesUInt32Array(f,h,g);const y=new Uint32Array(l.HEAPF32.buffer,g,p).slice();return l._free(g),{array:y,itemSize:1}}function o(l,d,f,m,p,h){const g=h.num_components(),C=f.num_points()*g,T=C*p.BYTES_PER_ELEMENT,S=c(l,p),E=l._malloc(T);d.GetAttributeDataArrayForAllPoints(f,h,S,T,E);const w=new p(l.HEAPF32.buffer,E,C).slice();return l._free(E),{name:m,array:w,itemSize:g}}function c(l,d){switch(d){case Float32Array:return l.DT_FLOAT32;case Int8Array:return l.DT_INT8;case Int16Array:return l.DT_INT16;case Int32Array:return l.DT_INT32;case Uint8Array:return l.DT_UINT8;case Uint16Array:return l.DT_UINT16;case Uint32Array:return l.DT_UINT32}}}const vd=new qt,jo=new $;class Yc extends Sm{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const n=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],r=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new zf(n,3)),this.setAttribute("uv",new zf(r,2))}applyMatrix4(n){const r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(n),i.applyMatrix4(n),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(n){let r;n instanceof Float32Array?r=n:Array.isArray(n)&&(r=new Float32Array(n));const i=new vc(r,6,1);return this.setAttribute("instanceStart",new ri(i,3,0)),this.setAttribute("instanceEnd",new ri(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(n,r=3){let i;n instanceof Float32Array?i=n:Array.isArray(n)&&(i=new Float32Array(n));const o=new vc(i,r*2,1);return this.setAttribute("instanceColorStart",new ri(o,r,0)),this.setAttribute("instanceColorEnd",new ri(o,r,r)),this}fromWireframeGeometry(n){return this.setPositions(n.attributes.position.array),this}fromEdgesGeometry(n){return this.setPositions(n.attributes.position.array),this}fromMesh(n){return this.fromWireframeGeometry(new Mm(n.geometry)),this}fromLineSegments(n){const r=n.geometry;return this.setPositions(r.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qt);const n=this.attributes.instanceStart,r=this.attributes.instanceEnd;n!==void 0&&r!==void 0&&(this.boundingBox.setFromBufferAttribute(n),vd.setFromBufferAttribute(r),this.boundingBox.union(vd))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ca
323),this.boundingBox===null&&this.computeBoundingBox();const n=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(n!==void 0&&r!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let o=0;for(let c=0,l=n.count;c<l;c++)jo.fromBufferAttribute(n,c),o=Math.max(o,i.distanceToSquared(jo)),jo.fromBufferAttribute(r,c),o=Math.max(o,i.distanceToSquared(jo));this.boundingSphere.radius=Math.sqrt(o),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(n){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(n)}}class Tp extends Yc{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(n){const r=n.length-3,i=new Float32Array(2*r);for(let o=0;o<r;o+=3)i[2*o]=n[o],i[2*o+1]=n[o+1],i[2*o+2]=n[o+2],i[2*o+3]=n[o+3],i[2*o+4]=n[o+4],i[2*o+5]=n[o+5];return super.setPositions(i),this}setColors(n,r=3){const i=n.length-r,o=new Float32Array(2*i);if(r===3)for(let c=0;c<i;c+=r)o[2*c]=n[c],o[2*c+1]=n[c+1],o[2*c+2]=n[c+2],o[2*c+3]=n[c+3],o[2*c+4]=n[c+4],o[2*c+5]=n[c+5];else for(let c=0;c<i;c+=r)o[2*c]=n[c],o[2*c+1]=n[c+1],o[2*c+2]=n[c+2],o[2*c+3]=n[c+3],o[2*c+4]=n[c+4],o[2*c+5]=n[c+5],o[2*c+6]=n[c+6],o[2*c+7]=n[c+7];return super.setColors(o,r),this}fromLine(n){const r=n.geometry;return this.setPositions(r.attributes.position.array),this}}class Zc extends Yi{constructor(n){super({type:"LineMaterial",uniforms:pa.clone(pa.merge([jf.common,jf.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new at(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:` 324 #include <common> 325 #include <fog_pars_vertex> 326 #include <logdepthbuf_pars_vertex> 327 #include <clipping_planes_pars_vertex> 328 329 uniform float linewidth; 330 uniform vec2 resolution; 331 332 attribute vec3 instanceStart; 333 attribute vec3 instanceEnd; 334 335 #ifdef USE_COLOR 336 #ifdef USE_LINE_COLOR_ALPHA 337 varying vec4 vLineColor; 338 attribute vec4 instanceColorStart; 339 attribute vec4 instanceColorEnd; 340 #else 341 varying vec3 vLineColor; 342 attribute vec3 instanceColorStart; 343 attribute vec3 instanceColorEnd; 344 #endif 345 #endif 346 347 #ifdef WORLD_UNITS 348 349 varying vec4 worldPos; 350 varying vec3 worldStart; 351 varying vec3 worldEnd; 352 353 #ifdef USE_DASH 354 355 varying vec2 vUv; 356 357 #endif 358 359 #else 360 361 varying vec2 vUv; 362 363 #endif 364 365 #ifdef USE_DASH 366 367 uniform float dashScale; 368 attribute float instanceDistanceStart; 369 attribute float instanceDistanceEnd; 370 varying float vLineDistance; 371 372 #endif 373 374 void trimSegment( const in vec4 start, inout vec4 end ) { 375 376 // trim end segment so it terminates between the camera plane and the near plane 377 378 // conservative estimate of the near plane 379 float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column 380 float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column 381 float nearEstimate = - 0.5 * b / a; 382 383 float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); 384 385 end.xyz = mix( start.xyz, end.xyz, alpha ); 386 387 } 388 389 void main() { 390 391 #ifdef USE_COLOR 392 393 vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; 394 395 #endif 396 397 #ifdef USE_DASH 398 399 vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; 400 vUv = uv; 401 402 #endif 403 404 float aspect = resolution.x / resolution.y; 405 406 // camera space 407 vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); 408 vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); 409 410 #ifdef WORLD_UNITS 411 412 worldStart = start.xyz; 413 worldEnd = end.xyz; 414 415 #else 416 417 vUv = uv; 418 419 #endif 420 421 // special case for perspective projection, and segments that terminate either in, or behind, the camera plane 422 // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space 423 // but we need to perform ndc-space calculations in the shader, so we must address this issue directly 424 // perhaps there is a more elegant solution -- WestLangley 425 426 bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column 427 428 if ( perspective ) { 429 430 if ( start.z < 0.0 && end.z >= 0.0 ) { 431 432 trimSegment( start, end ); 433 434 } else if ( end.z < 0.0 && start.z >= 0.0 ) { 435 436 trimSegment( end, start ); 437 438 } 439 440 } 441 442 // clip space 443 vec4 clipStart = projectionMatrix * start; 444 vec4 clipEnd = projectionMatrix * end; 445 446 // ndc space 447 vec3 ndcStart = clipStart.xyz / clipStart.w; 448 vec3 ndcEnd = clipEnd.xyz / clipEnd.w; 449 450 // direction 451 vec2 dir = ndcEnd.xy - ndcStart.xy; 452 453 // account for clip-space aspect ratio 454 dir.x *= aspect; 455 dir = normalize( dir ); 456 457 #ifdef WORLD_UNITS 458 459 // get the offset direction as perpendicular to the view vector
460 vec3 worldDir = normalize( end.xyz - start.xyz ); 461 vec3 offset; 462 if ( position.y < 0.5 ) { 463 464 offset = normalize( cross( start.xyz, worldDir ) ); 465 466 } else { 467 468 offset = normalize( cross( end.xyz, worldDir ) ); 469 470 } 471 472 // sign flip 473 if ( position.x < 0.0 ) offset *= - 1.0; 474 475 float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) ); 476 477 // don't extend the line if we're rendering dashes because we 478 // won't be rendering the endcaps 479 #ifndef USE_DASH 480 481 // extend the line bounds to encompass endcaps 482 start.xyz += - worldDir * linewidth * 0.5; 483 end.xyz += worldDir * linewidth * 0.5; 484 485 // shift the position of the quad so it hugs the forward edge of the line 486 offset.xy -= dir * forwardOffset; 487 offset.z += 0.5; 488 489 #endif 490 491 // endcaps 492 if ( position.y > 1.0 || position.y < 0.0 ) { 493 494 offset.xy += dir * 2.0 * forwardOffset; 495 496 } 497 498 // adjust for linewidth 499 offset *= linewidth * 0.5; 500 501 // set the world position 502 worldPos = ( position.y < 0.5 ) ? start : end; 503 worldPos.xyz += offset; 504 505 // project the worldpos 506 vec4 clip = projectionMatrix * worldPos; 507 508 // shift the depth of the projected points so the line 509 // segments overlap neatly 510 vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; 511 clip.z = clipPose.z * clip.w; 512 513 #else 514 515 vec2 offset = vec2( dir.y, - dir.x ); 516 // undo aspect ratio adjustment 517 dir.x /= aspect; 518 offset.x /= aspect; 519 520 // sign flip 521 if ( position.x < 0.0 ) offset *= - 1.0; 522 523 // endcaps 524 if ( position.y < 0.0 ) { 525 526 offset += - dir; 527 528 } else if ( position.y > 1.0 ) { 529 530 offset += dir; 531 532 } 533 534 // adjust for linewidth 535 offset *= linewidth; 536 537 // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... 538 offset /= resolution.y; 539 540 // select end 541 vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; 542 543 // back to clip space 544 offset *= clip.w; 545 546 clip.xy += offset; 547 548 #endif 549 550 gl_Position = clip; 551 552 vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation 553 554 #include <logdepthbuf_vertex> 555 #include <clipping_planes_vertex> 556 #include <fog_vertex> 557 558 } 559 `,fragmentShader:` 560 uniform vec3 diffuse; 561 uniform float opacity; 562 uniform float linewidth; 563 564 #ifdef USE_DASH 565 566 uniform float dashOffset; 567 uniform float dashSize; 568 uniform float gapSize; 569 570 #endif 571 572 varying float vLineDistance; 573 574 #ifdef WORLD_UNITS 575 576 varying vec4 worldPos; 577 varying vec3 worldStart; 578 varying vec3 worldEnd; 579 580 #ifdef USE_DASH 581 582 varying vec2 vUv; 583 584 #endif 585 586 #else 587 588 varying vec2 vUv; 589 590 #endif 591 592 #include <common> 593 #include <fog_pars_fragment> 594 #include <logdepthbuf_pars_fragment> 595 #include <clipping_planes_pars_fragment> 596 597 #ifdef USE_COLOR 598 #ifdef USE_LINE_COLOR_ALPHA 599 varying vec4 vLineColor; 600 #else 601 varying vec3 vLineColor; 602 #endif 603 #endif 604 605 vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { 606 607 float mua; 608 float mub; 609 610 vec3 p13 = p1 - p3; 611 vec3 p43 = p4 - p3; 612 613 vec3 p21 = p2 - p1; 614 615 float d1343 = dot( p13, p43 ); 616 float d4321 = dot( p43, p21 );
617 float d1321 = dot( p13, p21 ); 618 float d4343 = dot( p43, p43 ); 619 float d2121 = dot( p21, p21 ); 620 621 float denom = d2121 * d4343 - d4321 * d4321; 622 623 float numer = d1343 * d4321 - d1321 * d4343; 624 625 mua = numer / denom; 626 mua = clamp( mua, 0.0, 1.0 ); 627 mub = ( d1343 + d4321 * ( mua ) ) / d4343; 628 mub = clamp( mub, 0.0, 1.0 ); 629 630 return vec2( mua, mub ); 631 632 } 633 634 void main() { 635 636 #include <clipping_planes_fragment> 637 638 #ifdef USE_DASH 639 640 if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps 641 642 if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX 643 644 #endif 645 646 float alpha = opacity; 647 648 #ifdef WORLD_UNITS 649 650 // Find the closest points on the view ray and the line segment 651 vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; 652 vec3 lineDir = worldEnd - worldStart; 653 vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); 654 655 vec3 p1 = worldStart + lineDir * params.x; 656 vec3 p2 = rayEnd * params.y; 657 vec3 delta = p1 - p2; 658 float len = length( delta ); 659 float norm = len / linewidth; 660 661 #ifndef USE_DASH 662 663 #ifdef USE_ALPHA_TO_COVERAGE 664 665 float dnorm = fwidth( norm ); 666 alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); 667 668 #else 669 670 if ( norm > 0.5 ) { 671 672 discard; 673 674 } 675 676 #endif 677 678 #endif 679 680 #else 681 682 #ifdef USE_ALPHA_TO_COVERAGE 683 684 // artifacts appear on some hardware if a derivative is taken within a conditional 685 float a = vUv.x; 686 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 687 float len2 = a * a + b * b; 688 float dlen = fwidth( len2 ); 689 690 if ( abs( vUv.y ) > 1.0 ) { 691 692 alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); 693 694 } 695 696 #else 697 698 if ( abs( vUv.y ) > 1.0 ) { 699 700 float a = vUv.x; 701 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 702 float len2 = a * a + b * b; 703 704 if ( len2 > 1.0 ) discard; 705 706 } 707 708 #endif 709 710 #endif 711 712 vec4 diffuseColor = vec4( diffuse, alpha ); 713 #ifdef USE_COLOR 714 #ifdef USE_LINE_COLOR_ALPHA 715 diffuseColor *= vLineColor; 716 #else 717 diffuseColor.rgb *= vLineColor; 718 #endif 719 #endif 720 721 #include <logdepthbuf_fragment> 722 723 gl_FragColor = diffuseColor; 724 725 #include <tonemapping_fragment> 726 #include <${qi>=154?"colorspace_fragment":"encodings_fragment"}> 727 #include <fog_fragment> 728 #include <premultiplied_alpha_fragment> 729 730 } 731 `,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(r){this.uniforms.diffuse.value=r}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(r){r===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(r){this.uniforms.linewidth.value=r}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(r){!!r!="USE_DASH"in this.defines&&(this.needsUpdate=!0),r===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(r){this.uniforms.dashScale.value=r}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(r){this.uniforms.dashSize.value=r}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(r){this.uniforms.dashOffset.value=r}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(r){this.uniforms.gapSize.value=r}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(r){this.uniforms.opacity.value=r}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(r){this.uniforms.resolution.value.copy(r)}}
731,alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(r){!!r!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),r===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(n)}}const $l=new Vi,yd=new $,Bd=new $,Ft=new Vi,Pt=new Vi,Yn=new Vi,ec=new $,tc=new Mn,Dt=new $n,Cd=new $,Ko=new qt,Qo=new Ca,Zn=new Vi;let Vn,li;function Ed(s,n,r){return Zn.set(0,0,-n,1).applyMatrix4(s.projectionMatrix),Zn.multiplyScalar(1/Zn.w),Zn.x=li/r.width,Zn.y=li/r.height,Zn.applyMatrix4(s.projectionMatrixInverse),Zn.multiplyScalar(1/Zn.w),Math.abs(Math.max(Zn.x,Zn.y))}function dv(s,n){const r=s.matrixWorld,i=s.geometry,o=i.attributes.instanceStart,c=i.attributes.instanceEnd,l=Math.min(i.instanceCount,o.count);for(let d=0,f=l;d<f;d++){Dt.start.fromBufferAttribute(o,d),Dt.end.fromBufferAttribute(c,d),Dt.applyMatrix4(r);const m=new $,p=new $;Vn.distanceSqToSegment(Dt.start,Dt.end,p,m),p.distanceTo(m)<li*.5&&n.push({point:p,pointOnLine:m,distance:Vn.origin.distanceTo(p),object:s,face:null,faceIndex:d,uv:null,[gp]:null})}}function pv(s,n,r){const i=n.projectionMatrix,c=s.material.resolution,l=s.matrixWorld,d=s.geometry,f=d.attributes.instanceStart,m=d.attributes.instanceEnd,p=Math.min(d.instanceCount,f.count),h=-n.near;Vn.at(1,Yn),Yn.w=1,Yn.applyMatrix4(n.matrixWorldInverse),Yn.applyMatrix4(i),Yn.multiplyScalar(1/Yn.w),Yn.x*=c.x/2,Yn.y*=c.y/2,Yn.z=0,ec.copy(Yn),tc.multiplyMatrices(n.matrixWorldInverse,l);for(let g=0,y=p;g<y;g++){if(Ft.fromBufferAttribute(f,g),Pt.fromBufferAttribute(m,g),Ft.w=1,Pt.w=1,Ft.applyMatrix4(tc),Pt.applyMatrix4(tc),Ft.z>h&&Pt.z>h)continue;if(Ft.z>h){const M=Ft.z-Pt.z,I=(Ft.z-h)/M;Ft.lerp(Pt,I)}else if(Pt.z>h){const M=Pt.z-Ft.z,I=(Pt.z-h)/M;Pt.lerp(Ft,I)}Ft.applyMatrix4(i),Pt.applyMatrix4(i),Ft.multiplyScalar(1/Ft.w),Pt.multiplyScalar(1/Pt.w),Ft.x*=c.x/2,Ft.y*=c.y/2,Pt.x*=c.x/2,Pt.y*=c.y/2,Dt.start.copy(Ft),Dt.start.z=0,Dt.end.copy(Pt),Dt.end.z=0;const T=Dt.closestPointToPointParameter(ec,!0);Dt.at(T,Cd);const S=Jc.lerp(Ft.z,Pt.z,T),E=S>=-1&&S<=1,w=ec.distanceTo(Cd)<li*.5;if(E&&w){Dt.start.fromBufferAttribute(f,g),Dt.end.fromBufferAttribute(m,g),Dt.start.applyMatrix4(l),Dt.end.applyMatrix4(l);const M=new $,I=new $;Vn.distanceSqToSegment(Dt.start,Dt.end,I,M),r.push({point:I,pointOnLine:M,distance:Vn.origin.distanceTo(I),object:s,face:null,faceIndex:g,uv:null,[gp]:null})}}}class _p extends Zi{constructor(n=new Yc,r=new Zc({color:Math.random()*16777215})){super(n,r),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const n=this.geometry,r=n.attributes.instanceStart,i=n.attributes.instanceEnd,o=new Float32Array(2*r.count);for(let l=0,d=0,f=r.count;l<f;l++,d+=2)yd.fromBufferAttribute(r,l),Bd.fromBufferAttribute(i,l),o[d]=d===0?0:o[d-1],o[d+1]=o[d]+yd.distanceTo(Bd);const c=new vc(o,2,1);return n.setAttribute("instanceDistanceStart",new ri(c,1,0)),n.setAttribute("instanceDistanceEnd",new ri(c,1,1)),this}raycast(n,r){const i=this.material.worldUnits,o=n.camera;o===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const c=n.params.Line2!==void 0&&n.params.Line2.threshold||0;Vn=n.ray;const l=this.matrixWorld,d=this.geometry,f=this.material;li=f.linewidth+c,d.boundingSphere===null&&d.computeBoundingSphere(),Qo.copy(d.boundingSphere).applyMatrix4(l);let m;if(i)m=li*.5;else{const h=Math.max(o.near,Qo.distanceToPoint(Vn.origin));m=Ed(o,h,f.resolution)}if(Qo.radius+=m,Vn.intersectsSphere(Qo)===!1)return;d.boundingBox===null&&d.computeBoundingBox(),Ko.copy(d.boundingBox).applyMatrix4(l);let p;if(i)p=li*.5;else{const h=Math.max(o.near,Ko.distanceToPoint(Vn.origin));p=Ed(o,h,f.resolution)}Ko.expandByScalar(p),Vn.intersectsBox(Ko)!==!1&&(i?dv(this,r):pv(this,o,r))}onBeforeRender(n){const r=this.material.uniforms;r&&r.resolution&&(n.getViewport($l),this.material.uniforms.resolution.value.set($l.z,$l.w))}}class hv extends _p{constructor(n=new Tp,r=new Zc({color:Math.random()*16777215})){super(n,r),this.isLine2=!0,this.type="Line2"}}let Xo;const nc=()=>
731{if(Xo)return Xo;const s="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",n="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",r=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let o=s;WebAssembly.validate(r)&&(o=n);let c;const l=WebAssembly.instantiate(d(o),{}).then(h=>{c=h.instance,c.exports.__wasm_call_ctors()});function d(h){const g=new Uint8Array(h.length);for(let C=0;C<h.length;
731++C){const T=h.charCodeAt(C);g[C]=T>96?T-71:T>64?T-65:T>47?T+4:T>46?63:62}let y=0;for(let C=0;C<h.length;++C)g[y++]=g[C]<60?i[g[C]]:(g[C]-60)*64+g[++C];return g.buffer.slice(0,y)}function f(h,g,y,C,T,S){const E=c.exports.sbrk,w=y+3&-4,M=E(w*C),I=E(T.length),_=new Uint8Array(c.exports.memory.buffer);_.set(T,I);const F=h(M,y,C,I,T.length);if(F===0&&S&&S(M,w,C),g.set(_.subarray(M,M+y*C)),E(M-E(0)),F!==0)throw new Error(`Malformed buffer data: ${F}`)}const m={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},p={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return Xo={ready:l,supported:!0,decodeVertexBuffer(h,g,y,C,T){f(c.exports.meshopt_decodeVertexBuffer,h,g,y,C,c.exports[m[T]])},decodeIndexBuffer(h,g,y,C){f(c.exports.meshopt_decodeIndexBuffer,h,g,y,C)},decodeIndexSequence(h,g,y,C){f(c.exports.meshopt_decodeIndexSequence,h,g,y,C)},decodeGltfBuffer(h,g,y,C,T,S){f(c.exports[p[T]],h,g,y,C,c.exports[m[S]])}},Xo},mv=j.forwardRef(function({points:n,color:r=16777215,vertexColors:i,linewidth:o,lineWidth:c,segments:l,dashed:d,...f},m){var p,h;const g=ct(E=>E.size),y=j.useMemo(()=>l?new _p:new hv,[l]),[C]=j.useState(()=>new Zc),T=(i==null||(p=i[0])==null?void 0:p.length)===4?4:3,S=j.useMemo(()=>{const E=l?new Yc:new Tp,w=n.map(M=>{const I=Array.isArray(M);return M instanceof $||M instanceof Vi?[M.x,M.y,M.z]:M instanceof at?[M.x,M.y,0]:I&&M.length===3?[M[0],M[1],M[2]]:I&&M.length===2?[M[0],M[1],0]:M});if(E.setPositions(w.flat()),i){r=16777215;const M=i.map(I=>I instanceof er?I.toArray():I);E.setColors(M.flat(),T)}return E},[n,l,i,T]);return j.useLayoutEffect(()=>{y.computeLineDistances()},[n,y]),j.useLayoutEffect(()=>{d?C.defines.USE_DASH="":delete C.defines.USE_DASH,C.needsUpdate=!0},[d,C]),j.useEffect(()=>()=>{S.dispose(),C.dispose()},[S]),j.createElement("primitive",Tn({object:y,ref:m},f),j.createElement("primitive",{object:S,attach:"geometry"}),j.createElement("primitive",Tn({object:C,attach:"material",color:r,vertexColors:!!i,resolution:[g.width,g.height],linewidth:(h=o??c)!==null&&h!==void 0?h:1,dashed:d,transparent:T===4},f)))});function Av(s,n,r,i){const o=class extends Yi{constructor(l={}){const d=Object.entries(s);super({uniforms:d.reduce((f,[m,p])=>{const h=pa.clone({[m]:{value:p}});return{...f,...h}},{}),vertexShader:n,fragmentShader:r}),this.key="",d.forEach(([f])=>Object.defineProperty(this,f,{get:()=>this.uniforms[f].value,set:m=>this.uniforms[f].value=m})),Object.assign(this,l)}};return o.key=Jc.generateUUID(),o}const rc=s=>s===Object(s)&&!Array.isArray(s)&&typeof s!="function";function Ip(s,n){const r=ct(c=>c.gl),i=xn(Ba,rc(s)?Object.values(s):s);return j.useLayoutEffect(()=>{n==null||n(i)},[n]),j.useEffect(()=>{if("initTexture"in r){let c=[];Array.isArray(i)?c=i:i instanceof qn?c=[i]:rc(i)&&(c=Object.values(i)),c.forEach(l=>{l instanceof qn&&r.initTexture(l)})}},[r,i]),j.useMemo(()=>{if(rc(s)){const c={};let l=0;for(const d in s)c[d]=i[l++];return c}else return i},[s,i])}Ip.preload=s=>xn.preload(Ba,s);Ip.clear=s=>xn.clear(Ba,s);const gv=()=>parseInt(Od.replace(/\D+/g,"")),vv=gv(),dy=j.forwardRef(({threshold:s=15,geometry:n,...r},i)=>{const o=j.useRef(null);j.useImperativeHandle(i,()=>o.current,[]);const c=j.useMemo(()=>[0,0,0,1,0,0],[]),l=j.useRef(),d=j.useRef();return j.useLayoutEffect(()=>{const f=o.current.parent,m=n??(f==null?void 0:f.geometry);if(!m||l.current===m&&d.current===s)return;l.current=m,d.current=s;const h=new xm(m,s).attributes.position.array;o.current.geometry.setPositions(h),o.current.geometry.attributes.instanceStart.needsUpdate=!0,o.current.geometry.attributes.instanceEnd.needsUpdate=!0,o.current.computeLineDistances()}),j.createElement(mv,Tn({segments:!0,points:c,ref:o,raycast:()=>null},r))});let Wo=null,Rp="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function Fp(s=!0,n=!0,r){return i=>{r&&r(i),s&&(Wo||(Wo=new uv),Wo.setDecoderPath(typeof s=="string"?s:Rp),i.setDRACOLoader(Wo)),n&&i.setMeshoptDecoder(typeof nc=="function"?nc():nc)}}const Vc=(s,n,r,i)=>xn(Wc,s,Fp(n,r,i));Vc.preload=(s,n,r,i)=>xn.preload(Wc,s,Fp(n,r,i));Vc.clear=s=>xn.clear(Wc,s);Vc.setDecoderPath=s=>{Rp=s};const py=j.forwardRef(({makeDefault:s,camera:n,regress:r,domElement:i,enableDamping:o=!0,keyEvents:c=!1,onChange:l,onStart:d,onEnd:f,...m},p)=>{const h=ct(F=>F.invalidate),g=ct(F=>F.camera),y=ct(F=>F.gl),C=ct(F=>F.events),T=ct(F=>F.setEvents),S=ct(F=>F.set),E=ct(F=>F.get),w=ct(F=>F.performance),M=n||g,I=i||C.connected||y.domElement,_=j.useMemo(()=>new xg(M),[M]);return Ea(()=>
731{_.enabled&&_.update()},-1),j.useEffect(()=>(c&&_.connect(c===!0?I:c),_.connect(I),()=>void _.dispose()),[c,I,r,_,h]),j.useEffect(()=>{const F=D=>{h(),r&&w.regress(),l&&l(D)},G=D=>{d&&d(D)},P=D=>{f&&f(D)};return _.addEventListener("change",F),_.addEventListener("start",G),_.addEventListener("end",P),()=>{_.removeEventListener("start",G),_.removeEventListener("end",P),_.removeEventListener("change",F)}},[l,d,f,_,h,T]),j.useEffect(()=>{if(s){const F=E().controls;return S({controls:_}),()=>S({controls:F})}},[s,_]),j.createElement("primitive",Tn({ref:p,object:_,enableDamping:o},m))}),hy=j.forwardRef(({domElement:s,selector:n,onChange:r,onLock:i,onUnlock:o,enabled:c=!0,makeDefault:l,...d},f)=>{const{camera:m,...p}=d,h=ct(_=>_.setEvents),g=ct(_=>_.gl),y=ct(_=>_.camera),C=ct(_=>_.invalidate),T=ct(_=>_.events),S=ct(_=>_.get),E=ct(_=>_.set),w=m||y,M=s||T.connected||g.domElement,I=j.useMemo(()=>new Eg(w),[w]);return j.useEffect(()=>{if(c){I.connect(M);const _=S().events.compute;return h({compute(F,G){const P=G.size.width/2,D=G.size.height/2;G.pointer.set(P/G.size.width*2-1,-(D/G.size.height)*2+1),G.raycaster.setFromCamera(G.pointer,G.camera)}}),()=>{I.disconnect(),h({compute:_})}}},[c,I]),j.useEffect(()=>{const _=P=>{C(),r&&r(P)};I.addEventListener("change",_),i&&I.addEventListener("lock",i),o&&I.addEventListener("unlock",o);const F=()=>I.lock(),G=n?Array.from(document.querySelectorAll(n)):[document];return G.forEach(P=>P&&P.addEventListener("click",F)),()=>{I.removeEventListener("change",_),i&&I.removeEventListener("lock",i),o&&I.removeEventListener("unlock",o),G.forEach(P=>P?P.removeEventListener("click",F):void 0)}},[r,i,o,n,I,C]),j.useEffect(()=>{if(l){const _=S().controls;return E({controls:I}),()=>E({controls:_})}},[l,I]),j.createElement("primitive",Tn({ref:f,object:I},p))}),yv=Av({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new er,sectionColor:new er,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new $,worldPlanePosition:new $},` 732 varying vec3 localPosition; 733 varying vec4 worldPosition; 734 735 uniform vec3 worldCamProjPosition; 736 uniform vec3 worldPlanePosition; 737 uniform float fadeDistance; 738 uniform bool infiniteGrid; 739 uniform bool followCamera; 740 741 void main() { 742 localPosition = position.xzy; 743 if (infiniteGrid) localPosition *= 1.0 + fadeDistance; 744
745 worldPosition = modelMatrix * vec4(localPosition, 1.0); 746 if (followCamera) { 747 worldPosition.xyz += (worldCamProjPosition - worldPlanePosition); 748 localPosition = (inverse(modelMatrix) * worldPosition).xyz; 749 } 750 751 gl_Position = projectionMatrix * viewMatrix * worldPosition; 752 } 753 `,` 754 varying vec3 localPosition; 755 varying vec4 worldPosition; 756 757 uniform vec3 worldCamProjPosition; 758 uniform float cellSize; 759 uniform float sectionSize; 760 uniform vec3 cellColor; 761 uniform vec3 sectionColor; 762 uniform float fadeDistance; 763 uniform float fadeStrength; 764 uniform float fadeFrom; 765 uniform float cellThickness; 766 uniform float sectionThickness; 767 768 float getGrid(float size, float thickness) { 769 vec2 r = localPosition.xz / size; 770 vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r); 771 float line = min(grid.x, grid.y) + 1.0 - thickness; 772 return 1.0 - min(line, 1.0); 773 } 774 775 void main() { 776 float g1 = getGrid(cellSize, cellThickness); 777 float g2 = getGrid(sectionSize, sectionThickness); 778 779 vec3 from = worldCamProjPosition*vec3(fadeFrom); 780 float dist = distance(from, worldPosition.xyz); 781 float d = 1.0 - min(dist / fadeDistance, 1.0); 782 vec3 color = mix(cellColor, sectionColor, min(1.0, sectionThickness * g2)); 783 784 gl_FragColor = vec4(color, (g1 + g2) * pow(d, fadeStrength)); 785 gl_FragColor.a = mix(0.75 * gl_FragColor.a, gl_FragColor.a, g2); 786 if (gl_FragColor.a <= 0.0) discard; 787 788 #include <tonemapping_fragment> 789 #include <${vv>=154?"colorspace_fragment":"encodings_fragment"}> 790 } 791 `),my=j.forwardRef(({args:s,cellColor:n="#000000",sectionColor:r="#2080ff",cellSize:i=.5,sectionSize:o=1,followCamera:c=!1,infiniteGrid:l=!1,fadeDistance:d=100,fadeStrength:f=1,fadeFrom:m=1,cellThickness:p=.5,sectionThickness:h=1,side:g=bc,...y},C)=>{jc({GridMaterial:yv});const T=j.useRef(null);j.useImperativeHandle(C,()=>T.current,[]);const S=new ya,E=new $(0,1,0),w=new $(0,0,0);Ea(_=>{S.setFromNormalAndCoplanarPoint(E,w).applyMatrix4(T.current.matrixWorld);const F=T.current.material,G=F.uniforms.worldCamProjPosition,P=F.uniforms.worldPlanePosition;S.projectPoint(_.camera.position,G.value),P.value.set(0,0,0).applyMatrix4(T.current.matrixWorld)});const M={cellSize:i,sectionSize:o,cellColor:n,sectionColor:r,cellThickness:p,sectionThickness:h},I={fadeDistance:d,fadeStrength:f,fadeFrom:m,infiniteGrid:l,followCamera:c};return j.createElement("mesh",Tn({ref:T,frustumCulled:!1},y),j.createElement("gridMaterial",Tn({transparent:!0,"extensions-derivatives":!0,side:g},M,I)),j.createElement("planeGeometry",{args:s}))}),Pp=0,Bv=1,Cv=2,wd=2,ic=1.25,Sd=1,Os=6*4+4+4,wa=65535,Ev=Math.pow(2,-24),sc=Symbol("SKIP_GENERATION");function wv(s){return s.index?s.index.count:s.attributes.position.count}function $i(s){return wv(s)/3}function Sv(s,n=ArrayBuffer){return s>65535?new Uint32Array(new n(4*s)):new Uint16Array(new n(2*s))}function Mv(s,n){if(!s.index){const r=s.attributes.position.count,i=n.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,o=Sv(r,i);s.setIndex(new ai(o,1));for(let c=0;c<r;c++)o[c]=c}}function Dp(s,n){const r=$i(s),i=n||s.drawRange,o=i.start/3,c=(i.start+i.count)/3,l=Math.max(0,o),d=Math.min(r,c)-l;return[{offset:Math.floor(l),count:Math.floor(d)}]}function Lp(s,n){if(!s.groups||!s.groups.length)return Dp(s,n);const r=[],i=new Set,o=n||s.drawRange,c=o.start/3,l=(o.start+o.count)/3;for(const f of s.groups){const m=f.start/3,p=(f.start+f.count)/3;i.add(Math.max(c,m)),i.add(Math.min(l,p))}const d=Array.from(i.values()).sort((f,m)=>f-m);for(let f=0;f<d.length-1;f++){const m=d[f],p=d[f+1];r.push({offset:Math.floor(m),count:Math.floor(p-m)})}return r}function xv(s,n){const r=$i(s),i=Lp(s,n).sort((l,d)=>l.offset-d.offset),o=i[i.length-1];o.count=Math.min(r-o.offset,o.count);let c=0;return i.forEach(({count:l})=>c+=l),r!==c}function oc(s,n,r,i,o){let c=1/0,l=1/0,d=1/0,f=-1/0,m=-1/0,p=-1/0,h=1/0,g=1/0,y=1/0,C=-1/0,T=-1/0,S=-1/0;for(let E=n*6,w=(n+r)*6;E<w;E+=6){const M=s[E+0],I=s[E+1],_=M-I,F=M+I;_<c&&(c=_),F>f&&(f=F),M<h&&(h=M),M>C&&(C=M);const G=s[E+2],P=s[E+3],D=G-P,O=G+P;D<l&&(l=D),O>m&&(m=O),G<g&&(g=G),G>T&&(T=G);const b=s[E+4],k=s[E+5],Y=b-k,Z=b+k;Y<d&&(d=Y),Z>p&&(p=Z),b<y&&(y=b),b>S&&(S=b)}i[0]=c,i[1]=l,i[2]=d,i[3]=f,i[4]=m,i[5]=p,o[0]=h,o[1]=g,o[2]=y,o[3]=C,o[4]=T,o[5]=S}function Tv(s,n=null,r=null,i=null){const o=s.attributes.position,c=s.index?
791s.index.array:null,l=$i(s),d=o.normalized;let f;n===null?(f=new Float32Array(l*6*4),r=0,i=l):(f=n,r=r||0,i=i||l);const m=o.array,p=o.offset||0;let h=3;o.isInterleavedBufferAttribute&&(h=o.data.stride);const g=["getX","getY","getZ"];for(let y=r;y<r+i;y++){const C=y*3,T=y*6;let S=C+0,E=C+1,w=C+2;c&&(S=c[S],E=c[E],w=c[w]),d||(S=S*h+p,E=E*h+p,w=w*h+p);for(let M=0;M<3;M++){let I,_,F;d?(I=o[g[M]](S),_=o[g[M]](E),F=o[g[M]](w)):(I=m[S+M],_=m[E+M],F=m[w+M]);let G=I;_<G&&(G=_),F<G&&(G=F);let P=I;_>P&&(P=_),F>P&&(P=F);const D=(P-G)/2,O=M*2;f[T+O+0]=G+D,f[T+O+1]=D+(Math.abs(G)+D)*Ev}}return f}function dt(s,n,r){return r.min.x=n[s],r.min.y=n[s+1],r.min.z=n[s+2],r.max.x=n[s+3],r.max.y=n[s+4],r.max.z=n[s+5],r}function Md(s){let n=-1,r=-1/0;for(let i=0;i<3;i++){const o=s[i+3]-s[i];o>r&&(r=o,n=i)}return n}function xd(s,n){n.set(s)}function Td(s,n,r){let i,o;for(let c=0;c<3;c++){const l=c+3;i=s[c],o=n[c],r[c]=i<o?i:o,i=s[l],o=n[l],r[l]=i>o?i:o}}function Yo(s,n,r){for(let i=0;i<3;i++){const o=n[s+2*i],c=n[s+2*i+1],l=o-c,d=o+c;l<r[i]&&(r[i]=l),d>r[i+3]&&(r[i+3]=d)}}function xs(s){const n=s[3]-s[0],r=s[4]-s[1],i=s[5]-s[2];return 2*(n*r+r*i+i*n)}const dr=32,_v=(s,n)=>s.candidate-n.candidate,Dr=new Array(dr).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Zo=new Float32Array(6);function Iv(s,n,r,i,o,c){let l=-1,d=0;if(c===Pp)l=Md(n),l!==-1&&(d=(n[l]+n[l+3])/2);else if(c===Bv)l=Md(s),l!==-1&&(d=Rv(r,i,o,l));else if(c===Cv){const f=xs(s);let m=ic*o;const p=i*6,h=(i+o)*6;for(let g=0;g<3;g++){const y=n[g],S=(n[g+3]-y)/dr;if(o<dr/4){const E=[...Dr];E.length=o;let w=0;for(let I=p;I<h;I+=6,w++){const _=E[w];_.candidate=r[I+2*g],_.count=0;const{bounds:F,leftCacheBounds:G,rightCacheBounds:P}=_;for(let D=0;D<3;D++)P[D]=1/0,P[D+3]=-1/0,G[D]=1/0,G[D+3]=-1/0,F[D]=1/0,F[D+3]=-1/0;Yo(I,r,F)}E.sort(_v);let M=o;for(let I=0;I<M;I++){const _=E[I];for(;I+1<M&&E[I+1].candidate===_.candidate;)E.splice(I+1,1),M--}for(let I=p;I<h;I+=6){const _=r[I+2*g];for(let F=0;F<M;F++){const G=E[F];_>=G.candidate?Yo(I,r,G.rightCacheBounds):(Yo(I,r,G.leftCacheBounds),G.count++)}}for(let I=0;I<M;I++){const _=E[I],F=_.count,G=o-_.count,P=_.leftCacheBounds,D=_.rightCacheBounds;let O=0;F!==0&&(O=xs(P)/f);let b=0;G!==0&&(b=xs(D)/f);const k=Sd+ic*(O*F+b*G);k<m&&(l=g,m=k,d=_.candidate)}}else{for(let M=0;M<dr;M++){const I=Dr[M];I.count=0,I.candidate=y+S+M*S;const _=I.bounds;for(let F=0;F<3;F++)_[F]=1/0,_[F+3]=-1/0}for(let M=p;M<h;M+=6){let F=~~((r[M+2*g]-y)/S);F>=dr&&(F=dr-1);const G=Dr[F];G.count++,Yo(M,r,G.bounds)}const E=Dr[dr-1];xd(E.bounds,E.rightCacheBounds);for(let M=dr-2;M>=0;M--){const I=Dr[M],_=Dr[M+1];Td(I.bounds,_.rightCacheBounds,I.rightCacheBounds)}let w=0;for(let M=0;M<dr-1;M++){const I=Dr[M],_=I.count,F=I.bounds,P=Dr[M+1].rightCacheBounds;_!==0&&(w===0?xd(F,Zo):Td(F,Zo,Zo)),w+=_;let D=0,O=0;w!==0&&(D=xs(Zo)/f);const b=o-w;b!==0&&(O=xs(P)/f);const k=Sd+ic*(D*w+O*b);k<m&&(l=g,m=k,d=I.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${c} used.`);return{axis:l,pos:d}}function Rv(s,n,r,i){let o=0;for(let c=n,l=n+r;c<l;c++)o+=s[c*6+i*2];return o/r}class ac{constructor(){this.boundingData=new Float32Array(6)}}function Fv(s,n,r,i,o,c){let l=i,d=i+o-1;const f=c.pos,m=c.axis*2;for(;;){for(;l<=d&&r[l*6+m]<f;)l++;for(;l<=d&&r[d*6+m]>=f;)d--;if(l<d){for(let p=0;p<3;p++){let h=n[l*3+p];n[l*3+p]=n[d*3+p],n[d*3+p]=h}for(let p=0;p<6;p++){let h=r[l*6+p];r[l*6+p]=r[d*6+p],r[d*6+p]=h}l++,d--}else return l}}function Pv(s,n,r,i,o,c){let l=i,d=i+o-1;const f=c.pos,m=c.axis*2;for(;;){for(;l<=d&&r[l*6+m]<f;)l++;for(;l<=d&&r[d*6+m]>=f;)d--;if(l<d){let p=s[l];s[l]=s[d],s[d]=p;for(let h=0;h<6;h++){let g=r[l*6+h];r[l*6+h]=r[d*6+h],r[d*6+h]=g}l++,d--}else return l}}function Vt(s,n){return n[s+15]===65535}function on(s,n){return n[s+6]}function Cn(s,n){return n[s+14]}function En(s){return s+8}function wn(s,n){return n[s+6]}function Gp(s,n){return n[s+7]}let Hp,Ls,fa,Op;const Dv=Math.pow(2,32);function Ic(s){return"count"in s?1:1+Ic(s.left)+Ic(s.right)}function Lv(s,n,r){return Hp=new Float32Array(r),Ls=new Uint32Array(r),fa=new Uint16Array(r),Op=new Uint8Array(r),Rc(s,n)}function Rc(s,n){const r=s/4,i=s/2,o="count"in n,c=n.boundingData;for(let l=0;l<6;l++)Hp[r+l]=c[l];if(o)if(n.buffer){const l=n.buffer;Op.set(new Uint8Array(l),s);for(let d=s,f=s+l.byteLength;d<f;d+=Os){const m=d/2;Vt(m,fa)||(Ls[d/4+6]+=r)}return s+l.byteLength}else{const l=n.offset,d=n.count;return Ls[r+6]=l,fa[i+14]=d,fa[i+15]=wa,s+Os}else{const l=n.left,d=n.right,f=n.splitAxis;let m;if(m=Rc(s+Os,l),m/4>Dv)throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return Ls[r+6]=m/4,m=Rc(m,d),Ls[r+7]=f,m}}
791function Gv(s,n){const r=(s.index?s.index.count:s.attributes.position.count)/3,i=r>2**16,o=i?4:2,c=n?new SharedArrayBuffer(r*o):new ArrayBuffer(r*o),l=i?new Uint32Array(c):new Uint16Array(c);for(let d=0,f=l.length;d<f;d++)l[d]=d;return l}function Hv(s,n,r,i,o){const{maxDepth:c,verbose:l,maxLeafTris:d,strategy:f,onProgress:m,indirect:p}=o,h=s._indirectBuffer,g=s.geometry,y=g.index?g.index.array:null,C=p?Pv:Fv,T=$i(g),S=new Float32Array(6);let E=!1;const w=new ac;return oc(n,r,i,w.boundingData,S),I(w,r,i,S),w;function M(_){m&&m(_/T)}function I(_,F,G,P=null,D=0){if(!E&&D>=c&&(E=!0,l&&(console.warn(`MeshBVH: Max depth of ${c} reached when generating BVH. Consider increasing maxDepth.`),console.warn(g))),G<=d||D>=c)return M(F+G),_.offset=F,_.count=G,_;const O=Iv(_.boundingData,P,n,F,G,f);if(O.axis===-1)return M(F+G),_.offset=F,_.count=G,_;const b=C(h,y,n,F,G,O);if(b===F||b===F+G)M(F+G),_.offset=F,_.count=G;else{_.splitAxis=O.axis;const k=new ac,Y=F,Z=b-F;_.left=k,oc(n,Y,Z,k.boundingData,S),I(k,Y,Z,S,D+1);const se=new ac,ue=b,Me=G-Z;_.right=se,oc(n,ue,Me,se.boundingData,S),I(se,ue,Me,S,D+1)}return _}}function Ov(s,n){const r=s.geometry;n.indirect&&(s._indirectBuffer=Gv(r,n.useSharedArrayBuffer),xv(r,n.range)&&!n.verbose&&console.warn('MeshBVH: Provided geometry contains groups or a range that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),s._indirectBuffer||Mv(r,n);const i=n.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,o=Tv(r),c=n.indirect?Dp(r,n.range):Lp(r,n.range);s._roots=c.map(l=>{const d=Hv(s,o,l.offset,l.count,n),f=Ic(d),m=new i(Os*f);return Lv(0,d,m),m})}class gr{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(n,r){let i=1/0,o=-1/0;for(let c=0,l=n.length;c<l;c++){const f=n[c][r];i=f<i?f:i,o=f>o?f:o}this.min=i,this.max=o}setFromPoints(n,r){let i=1/0,o=-1/0;for(let c=0,l=r.length;c<l;c++){const d=r[c],f=n.dot(d);i=f<i?f:i,o=f>o?f:o}this.min=i,this.max=o}isSeparated(n){return this.min>n.max||n.min>this.max}}gr.prototype.setFromBox=function(){const s=new $;return function(r,i){const o=i.min,c=i.max;let l=1/0,d=-1/0;for(let f=0;f<=1;f++)for(let m=0;m<=1;m++)for(let p=0;p<=1;p++){s.x=o.x*f+c.x*(1-f),s.y=o.y*m+c.y*(1-m),s.z=o.z*p+c.z*(1-p);const h=r.dot(s);l=Math.min(h,l),d=Math.max(h,d)}this.min=l,this.max=d}}();const Uv=function(){const s=new $,n=new $,r=new $;return function(o,c,l){const d=o.start,f=s,m=c.start,p=n;r.subVectors(d,m),s.subVectors(o.end,o.start),n.subVectors(c.end,c.start);const h=r.dot(p),g=p.dot(f),y=p.dot(p),C=r.dot(f),S=f.dot(f)*y-g*g;let E,w;S!==0?E=(h*g-C*y)/S:E=0,w=(h+E*g)/y,l.x=E,l.y=w}}(),qc=function(){const s=new at,n=new $,r=new $;return function(o,c,l,d){Uv(o,c,s);let f=s.x,m=s.y;if(f>=0&&f<=1&&m>=0&&m<=1){o.at(f,l),c.at(m,d);return}else if(f>=0&&f<=1){m<0?c.at(0,d):c.at(1,d),o.closestPointToPoint(d,!0,l);return}else if(m>=0&&m<=1){f<0?o.at(0,l):o.at(1,l),c.closestPointToPoint(l,!0,d);return}else{let p;f<0?p=o.start:p=o.end;let h;m<0?h=c.start:h=c.end;const g=n,y=r;if(o.closestPointToPoint(h,!0,n),c.closestPointToPoint(p,!0,r),g.distanceToSquared(h)<=y.distanceToSquared(p)){l.copy(g),d.copy(h);return}else{l.copy(p),d.copy(y);return}}}}(),Nv=function(){const s=new $,n=new $,r=new ya,i=new $n;return function(c,l){const{radius:d,center:f}=c,{a:m,b:p,c:h}=l;if(i.start=m,i.end=p,i.closestPointToPoint(f,!0,s).distanceTo(f)<=d||(i.start=m,i.end=h,i.closestPointToPoint(f,!0,s).distanceTo(f)<=d)||(i.start=p,i.end=h,i.closestPointToPoint(f,!0,s).distanceTo(f)<=d))return!0;const T=l.getPlane(r);if(Math.abs(T.distanceToPoint(f))<=d){const E=T.projectPoint(f,n);if(l.containsPoint(E))return!0}return!1}}(),bv=1e-15;function lc(s){return Math.abs(s)<bv}class Ln extends Ds{constructor(...n){super(...n),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new $),this.satBounds=new Array(4).fill().map(()=>new gr),this.points=[this.a,this.b,this.c],this.sphere=new Ca,this.plane=new ya,this.needsUpdate=!0}intersectsSphere(n){return Nv(n,this)}update(){const n=this.a,r=this.b,i=this.c,o=this.points,c=this.satAxes,l=this.satBounds,d=c[0],f=l[0];this.getNormal(d),f.setFromPoints(d,o);const m=c[1],p=l[1];m.subVectors(n,r),p.setFromPoints(m,o);const h=c[2],g=l[2];h.subVectors(r,i),g.setFromPoints(h,o);const y=c[3],C=l[3];y.subVectors(i,n),C.setFromPoints(y,o),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(d,n),this.needsUpdate=!1}}Ln.prototype.closestPointToSegment=function(){const s=new $,n=new $,r=new $n;return function(o,c=null,l=null){const{start:d,end:f}=o,m=this.points;let p,h=1/0;for(let g=0;g<3;g++){const y=(g+1)%3;r.start.copy(m[g]),r.end.copy(m[y]),qc(r,o,s,n),p=s.distanceToSquared(n),p<h&&(h=p,c&&c.copy(s),l&&l.copy(n))}return this.closestPointToPoint(d,s),p=d.distanceToSquared(s),p<h&&(h=p,c&&c.copy(s),l&&l.copy(d)),this.closestPointToPoint(f,s),p=f.distanceToSquared(s),p<h&&(h=p,c&&c.copy(s),l&&l.copy(f)),Math.sqrt(h)}}();Ln.prototype.intersectsTriangle=function(){const s=new Ln,n=new Array(3),r=new Array(3),i=new gr,o=new gr,c=new $,l=new $,d=new $,f=new $,m=new $,p=new $n,h=new $n,g=new $n,y=new $;function C(T,S,E){const w=T.points;let M=0,I=-1;for(let _=0;_<3;_++){const{start:F,end:G}=p;F.copy(w[_]),G.copy(w[(_+1)%3]),p.delta(l);const P=lc(S.distanceToPoint(F));if(lc(S.normal.dot(l))&&P){E.copy(p),M=2;break}const D=S.intersectLine(p,y);if(!D&&P&&y.copy(F),(D||P)&&!lc(y.distanceTo(G))){if(M<=1)(M===1?E.start:E.end).copy(y),P&&(I=M);else if(M>=2){(I===1?E.start:E.end).copy(y),M=2;break}if(M++,M===2&&I===-1)break}}return M}return function(S,E=null,w=!1){this.needsUpdate&&this.update(),S.isExtendedTriangle?S.needsUpdate&&S.update():(s.
791copy(S),s.update(),S=s);const M=this.plane,I=S.plane;if(Math.abs(M.normal.dot(I.normal))>1-1e-10){const _=this.satBounds,F=this.satAxes;r[0]=S.a,r[1]=S.b,r[2]=S.c;for(let D=0;D<4;D++){const O=_[D],b=F[D];if(i.setFromPoints(b,r),O.isSeparated(i))return!1}const G=S.satBounds,P=S.satAxes;n[0]=this.a,n[1]=this.b,n[2]=this.c;for(let D=0;D<4;D++){const O=G[D],b=P[D];if(i.setFromPoints(b,n),O.isSeparated(i))return!1}for(let D=0;D<4;D++){const O=F[D];for(let b=0;b<4;b++){const k=P[b];if(c.crossVectors(O,k),i.setFromPoints(c,n),o.setFromPoints(c,r),i.isSeparated(o))return!1}}return E&&(w||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),E.start.set(0,0,0),E.end.set(0,0,0)),!0}else{const _=C(this,I,h);if(_===1&&S.containsPoint(h.end))return E&&(E.start.copy(h.end),E.end.copy(h.end)),!0;if(_!==2)return!1;const F=C(S,M,g);if(F===1&&this.containsPoint(g.end))return E&&(E.start.copy(g.end),E.end.copy(g.end)),!0;if(F!==2)return!1;if(h.delta(d),g.delta(f),d.dot(f)<0){let Y=g.start;g.start=g.end,g.end=Y}const G=h.start.dot(d),P=h.end.dot(d),D=g.start.dot(d),O=g.end.dot(d),b=P<D,k=G<O;return G!==O&&D!==P&&b===k?!1:(E&&(m.subVectors(h.start,g.start),m.dot(d)>0?E.start.copy(h.start):E.start.copy(g.start),m.subVectors(h.end,g.end),m.dot(d)<0?E.end.copy(h.end):E.end.copy(g.end)),!0)}}}();Ln.prototype.distanceToPoint=function(){const s=new $;return function(r){return this.closestPointToPoint(r,s),r.distanceTo(s)}}();Ln.prototype.distanceToTriangle=function(){const s=new $,n=new $,r=["a","b","c"],i=new $n,o=new $n;return function(l,d=null,f=null){const m=d||f?i:null;if(this.intersectsTriangle(l,m))return(d||f)&&(d&&m.getCenter(d),f&&m.getCenter(f)),0;let p=1/0;for(let h=0;h<3;h++){let g;const y=r[h],C=l[y];this.closestPointToPoint(C,s),g=C.distanceToSquared(s),g<p&&(p=g,d&&d.copy(s),f&&f.copy(C));const T=this[y];l.closestPointToPoint(T,s),g=T.distanceToSquared(s),g<p&&(p=g,d&&d.copy(T),f&&f.copy(s))}for(let h=0;h<3;h++){const g=r[h],y=r[(h+1)%3];i.set(this[g],this[y]);for(let C=0;C<3;C++){const T=r[C],S=r[(C+1)%3];o.set(l[T],l[S]),qc(i,o,s,n);const E=s.distanceToSquared(n);E<p&&(p=E,d&&d.copy(s),f&&f.copy(n))}}return Math.sqrt(p)}}();class jt{constructor(n,r,i){this.isOrientedBox=!0,this.min=new $,this.max=new $,this.matrix=new Mn,this.invMatrix=new Mn,this.points=new Array(8).fill().map(()=>new $),this.satAxes=new Array(3).fill().map(()=>new $),this.satBounds=new Array(3).fill().map(()=>new gr),this.alignedSatBounds=new Array(3).fill().map(()=>new gr),this.needsUpdate=!1,n&&this.min.copy(n),r&&this.max.copy(r),i&&this.matrix.copy(i)}set(n,r,i){this.min.copy(n),this.max.copy(r),this.matrix.copy(i),this.needsUpdate=!0}copy(n){this.min.copy(n.min),this.max.copy(n.max),this.matrix.copy(n.matrix),this.needsUpdate=!0}}jt.prototype.update=function(){return function(){const n=this.matrix,r=this.min,i=this.max,o=this.points;for(let m=0;m<=1;m++)for(let p=0;p<=1;p++)for(let h=0;h<=1;h++){const g=1*m|2*p|4*h,y=o[g];y.x=m?i.x:r.x,y.y=p?i.y:r.y,y.z=h?i.z:r.z,y.applyMatrix4(n)}const c=this.satBounds,l=this.satAxes,d=o[0];for(let m=0;m<3;m++){const p=l[m],h=c[m],g=1<<m,y=o[g];p.subVectors(d,y),h.setFromPoints(p,o)}const f=this.alignedSatBounds;f[0].setFromPointsField(o,"x"),f[1].setFromPointsField(o,"y"),f[2].setFromPointsField(o,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}();jt.prototype.intersectsBox=function(){const s=new gr;return function(r){this.needsUpdate&&this.update();const i=r.min,o=r.max,c=this.satBounds,l=this.satAxes,d=this.alignedSatBounds;if(s.min=i.x,s.max=o.x,d[0].isSeparated(s)||(s.min=i.y,s.max=o.y,d[1].isSeparated(s))||(s.min=i.z,s.max=o.z,d[2].isSeparated(s)))return!1;for(let f=0;f<3;f++){const m=l[f],p=c[f];if(s.setFromBox(m,r),p.isSeparated(s))return!1}return!0}}();jt.prototype.intersectsTriangle=function(){const s=new Ln,n=new Array(3),r=new gr,i=new gr,o=new $;return function(l){this.needsUpdate&&this.update(),l.isExtendedTriangle?l.needsUpdate&&l.update():(s.copy(l),s.update(),l=s);const d=this.satBounds,f=this.satAxes;n[0]=l.a,n[1]=l.b,n[2]=l.c;for(let g=0;g<3;g++){const y=d[g],C=f[g];if(r.setFromPoints(C,n),y.isSeparated(r))return!1}const m=l.satBounds,p=l.satAxes,h=this.points;for(let g=0;g<3;g++){const y=m[g],C=p[g];if(r.setFromPoints(C,h),y.isSeparated(r))return!1}for(let g=0;g<3;g++){const y=f[g];for(let C=0;C<4;C++){const T=p[C];if(o.crossVectors(y,T),r.setFromPoints(o,n),i.setFromPoints(o,h),r.isSeparated(i))return!1}}return!0}}();jt.prototype.closestPointToPoint=function(){return function(n,r){return this.needsUpdate&&this.update(),r.copy(n).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix
vendor: 13,511 bytes, line 791
791),r}}();jt.prototype.distanceToPoint=function(){const s=new $;return function(r){return this.closestPointToPoint(r,s),r.distanceTo(s)}}();jt.prototype.distanceToBox=function(){const s=["x","y","z"],n=new Array(12).fill().map(()=>new $n),r=new Array(12).fill().map(()=>new $n),i=new $,o=new $;return function(l,d=0,f=null,m=null){if(this.needsUpdate&&this.update(),this.intersectsBox(l))return(f||m)&&(l.getCenter(o),this.closestPointToPoint(o,i),l.closestPointToPoint(i,o),f&&f.copy(i),m&&m.copy(o)),0;const p=d*d,h=l.min,g=l.max,y=this.points;let C=1/0;for(let S=0;S<8;S++){const E=y[S];o.copy(E).clamp(h,g);const w=E.distanceToSquared(o);if(w<C&&(C=w,f&&f.copy(E),m&&m.copy(o),w<p))return Math.sqrt(w)}let T=0;for(let S=0;S<3;S++)for(let E=0;E<=1;E++)for(let w=0;w<=1;w++){const M=(S+1)%3,I=(S+2)%3,_=E<<M|w<<I,F=1<<S|E<<M|w<<I,G=y[_],P=y[F];n[T].set(G,P);const O=s[S],b=s[M],k=s[I],Y=r[T],Z=Y.start,se=Y.end;Z[O]=h[O],Z[b]=E?h[b]:g[b],Z[k]=w?h[k]:g[b],se[O]=g[O],se[b]=E?h[b]:g[b],se[k]=w?h[k]:g[b],T++}for(let S=0;S<=1;S++)for(let E=0;E<=1;E++)for(let w=0;w<=1;w++){o.x=S?g.x:h.x,o.y=E?g.y:h.y,o.z=w?g.z:h.z,this.closestPointToPoint(o,i);const M=o.distanceToSquared(i);if(M<C&&(C=M,f&&f.copy(i),m&&m.copy(o),M<p))return Math.sqrt(M)}for(let S=0;S<12;S++){const E=n[S];for(let w=0;w<12;w++){const M=r[w];qc(E,M,i,o);const I=i.distanceToSquared(o);if(I<C&&(C=I,f&&f.copy(i),m&&m.copy(o),I<p))return Math.sqrt(I)}}return Math.sqrt(C)}}();class $c{constructor(n){this._getNewPrimitive=n,this._primitives=[]}getPrimitive(){const n=this._primitives;return n.length===0?this._getNewPrimitive():n.pop()}releasePrimitive(n){this._primitives.push(n)}}class kv extends $c{constructor(){super(()=>new Ln)}}const Sn=new kv;class Jv{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const n=[];let r=null;this.setBuffer=i=>{r&&n.push(r),r=i,this.float32Array=new Float32Array(i),this.uint16Array=new Uint16Array(i),this.uint32Array=new Uint32Array(i)},this.clearBuffer=()=>{r=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,n.length!==0&&this.setBuffer(n.pop())}}}const it=new Jv;let Or,zi;const _i=[],Vo=new $c(()=>new qt);function zv(s,n,r,i,o,c){Or=Vo.getPrimitive(),zi=Vo.getPrimitive(),_i.push(Or,zi),it.setBuffer(s._roots[n]);const l=Fc(0,s.geometry,r,i,o,c);it.clearBuffer(),Vo.releasePrimitive(Or),Vo.releasePrimitive(zi),_i.pop(),_i.pop();const d=_i.length;return d>0&&(zi=_i[d-1],Or=_i[d-2]),l}function Fc(s,n,r,i,o=null,c=0,l=0){const{float32Array:d,uint16Array:f,uint32Array:m}=it;let p=s*2;if(Vt(p,f)){const g=on(s,m),y=Cn(p,f);return dt(s,d,Or),i(g,y,!1,l,c+s,Or)}else{let O=function(k){const{uint16Array:Y,uint32Array:Z}=it;let se=k*2;for(;!Vt(se,Y);)k=En(k),se=k*2;return on(k,Z)},b=function(k){const{uint16Array:Y,uint32Array:Z}=it;let se=k*2;for(;!Vt(se,Y);)k=wn(k,Z),se=k*2;return on(k,Z)+Cn(se,Y)};const g=En(s),y=wn(s,m);let C=g,T=y,S,E,w,M;if(o&&(w=Or,M=zi,dt(C,d,w),dt(T,d,M),S=o(w),E=o(M),E<S)){C=y,T=g;const k=S;S=E,E=k,w=M}w||(w=Or,dt(C,d,w));const I=Vt(C*2,f),_=r(w,I,S,l+1,c+C);let F;if(_===wd){const k=O(C),Z=b(C)-k;F=i(k,Z,!0,l+1,c+C,w)}else F=_&&Fc(C,n,r,i,o,c,l+1);if(F)return!0;M=zi,dt(T,d,M);const G=Vt(T*2,f),P=r(M,G,E,l+1,c+T);let D;if(P===wd){const k=O(T),Z=b(T)-k;D=i(k,Z,!0,l+1,c+T,M)}else D=P&&Fc(T,n,r,i,o,c,l+1);return!!D}}const Ts=new $,cc=new $;function jv(s,n,r={},i=0,o=1/0){const c=i*i,l=o*o;let d=1/0,f=null;if(s.shapecast({boundsTraverseOrder:p=>(Ts.copy(n).clamp(p.min,p.max),Ts.distanceToSquared(n)),intersectsBounds:(p,h,g)=>g<d&&g<l,intersectsTriangle:(p,h)=>{p.closestPointToPoint(n,Ts);const g=n.distanceToSquared(Ts);return g<d&&(cc.copy(Ts),d=g,f=h),g<c}}),d===1/0)return null;const m=Math.sqrt(d);return r.point?r.point.copy(cc):r.point=cc.clone(),r.distance=m,r.faceIndex=f,r}const Ii=new $,Ri=new $,Fi=new $,qo=new at,$o=new at,ea=new at,_d=new $,Id=new $,Rd=new $,ta=new $;function Kv(s,n,r,i,o,c,l,d){let f;if(c===bc?f=s.intersectTriangle(i,r,n,!0,o):f=s.intersectTriangle(n,r,i,c!==va,o),f===null)return null;const m=s.origin.distanceTo(o);return m<l||m>d?null:{distance:m,point:o.clone()}}function Qv(s,n,r,i,o,c,l,d,f,m,p){Ii.fromBufferAttribute(n,c),Ri.fromBufferAttribute(n,l),Fi.fromBufferAttribute(n,d);const h=Kv(s,Ii,Ri,Fi,ta,f,m,p);if(h){i&&(qo.fromBufferAttribute(i,c),$o.fromBufferAttribute(i,l),ea.fromBufferAttribute(i,d),h.uv=Ds.getInterpolation(ta,Ii,Ri,Fi,qo,$o,ea,new at)),o&&(qo.fromBufferAttribute(o,c),$o.fromBufferAttribute(o,l),ea.fromBufferAttribute(o,d),h.uv1=Ds.getInterpolation(ta,Ii,Ri,Fi,qo,$o,ea,new at)),r&&(_d.fromBufferAttribute(r,c),Id.fromBufferAttribute(r,l),Rd.fromBufferAttribute(r,d),h.normal=Ds.getInterpolation(ta,Ii,Ri,Fi,_d,Id,Rd,new $),h.normal.dot(s.direction)>0&&h.normal.multiplyScalar(-1));const g={a:c,b:l,c:d,normal:new $,materialIndex:0};Ds.getNormal(Ii,Ri,Fi,g.normal),h.face=g,h.faceIndex=c}return h}function Sa(s,n,r,i,o,c,l){const d=i*3;let f=d+0,m=d+1,p=d+2;const h=s.index;s.index&&(f=h.getX(f),m=h.getX(m),p=h.getX(p));const{position:g,normal:y,uv:C,uv1:T}=s.attributes,S=Qv(r,g,y,C,T,f,m,p,n,c,l);return S?(S.faceIndex=i,o&&o.push(S),S):null}function yt(s,n,r,i){const o=s.a,c=s.b,l=s.c;let d=n,f=n+1,m=n+2;r&&(d=r.getX(d),f=r.getX(f),m=r.getX(m)),o.x=i.getX(d),o.y=i.getY(d),o.z=i.getZ(d),c.x=i.getX(f),c.y=i.getY(f),c.z=i.getZ(f),l.x=i.getX(m),l.y=i.getY(m),l.z=i.getZ(m)}function Xv(s,n,r,i,o,c,l,d){const{geometry:f,_indirectBuffer:m}=s;for(let p=i,h=i+o;p<h;p++)Sa(f,n,r,p,c,l,d)}function Wv(s,n,r,i,o,c,l){const{geometry:d,_indirectBuffer:f}=s;let m=1/0,p=null;for(let h=i,g=i+o;h<g;h++){let y;y=Sa(d,n,r,h,null,c,l),y&&y.distance<m&&(p=y,m=y.distance)}return p}function Yv(s,n,r,i,o,c,l){const{geometry:d}=r,{index:f}=d,m=d.attributes.position;for(let p=s,h=n+s;p<h;p++){let g;if(g=p,yt(l,g*3,f,m),l.needsUpdate=!0,i(l,g,o,c))return!0}return!1}function Zv(s,n=null){n&&Array.isArray(n)&&(n=new Set(n));const r=s.geometry,i=r.index?r.index.array:null,o=r.attributes.position;let c,l,d,f,m=0;const p=s._roots;for(let g=0,y=p.length;g<y;g++)c=p[g],l=new Uint32Array(c),d=new Uint16Array(c),f=new Float32Array(c),h(0,m),m+=c.byteLength;function h(g,y,C=!1){const T=g*2;if(d[T+15]===wa){const E=l[g+6],w=d[T+14];let M=1/0,I=1/0,_=1/0,F=-1/0,G=-1/0,P=-1/0;for(let D=3*E,O=3*(E+w);D<O;D++){let b=i[D];const k=o.getX(b),Y=o.getY(b),Z=o.getZ(b);k<M&&(M=k),k>F&&(F=k),Y<I&&(I=Y),Y>G&&(G=Y),Z<_&&(_=Z),Z>P&&(P=Z)}return f[g+0]!==M||f[g+1]!==I||f[g+2]!==_||f[g+3]!==F||f[g+4]!==G||f[g+5]!==P?(f[g+0]=M,f[g+1]=I,f[g+2]=_,f[g+3]=F,f[g+4]=G,f[g+5]=P,!0):!1}else{const E=g+8,w=l[g+6],M=E+y,I=w+y;let _=C,F=!1,G=!1;n?_||(F=n.has(M),G=n.has(I),_=!F&&!G):(F=!0,G=!0);const P=_||F,D=_||G;let O=!1;P&&(O=h(E,y,_));let b=!1;D&&(b=h(w,y,_));const k=O||b;if(k)for(let Y=0;Y<3;Y++){const Z=E+Y,se=w+Y,ue=f[Z],Me=f[Z+3],V=f[se],fe=f[se+3];f[g+Y]=ue<V?ue:V,f[g+Y+3]=Me>fe?Me:fe}return k}}}function br(s,n,r,i,o){let c,l,d,f,m,p;const h=1/r.direction.x,g=1/r.direction.y,y=1/r.direction.z,C=r.origin.x,T=r.origin.y,S=r.origin.z;let E=n[s],w=n[s+3],M=n[s+1],I=n[s+3+1],_=n[s+2],F=n[s+3+2];return h>=0?(c=(E-C)*h,l=(w-C)*h):(c=(w-C)*h,l=(E-C)*h),g>=0?(d=(M-T)*g,f=(I-T)*g):(d=(I-T)*g,f=(M-T)*g),c>f||d>l||((d>c||isNaN(c))&&(c=d),(f<l||isNaN(l))&&(l=f),y>=0?(m=(_-S)*y,p=(F-S)*y):(m=(F-S)*y,p=(_-S)*y),c>p||m>l)?!1:((m>c||c!==c)&&(c=m),(p<l||l!==l)&&(l=p),c<=o&&l>=i)}function Vv(s,n,r,i,o,c,l,d){const{geometry:f,_indirectBuffer:m}=s;for(let p=i,h=i+o;p<h;p++){let g=m?m[p]:p;Sa(f,n,r,g,c,l,d)}}function qv(s,n,r,i,o,c,l){const{geometry:d,_indirectBuffer:f}=s;let m=1/0,p=null;for(let h=i,g=i+o;h<g;h++){let y;y=Sa(d,n,r,f?f[h]:h,null,c,l),y&&y.distance<m&&(p=y,m=y.distance)}return p}function $v(s,n,r,i,o,c,l){const{geometry:d}=r,{index:f}=d,m=d.attributes.position;for(let p=s,h=n+s;p<h;p++){let g;if(g=r.resolveTriangleIndex(p),yt(l,g*3,f,m),l.needsUpdate=!0,i(l,g,o,c))return!0}return!1}function e0(s,n,r,i,o,c,l){it.setBuffer(s._roots[n]),Pc(0,s,r,i,o,c,l),it.clearBuffer()}function Pc(s,n,r,i,o,c,l){const{float32Array:d,uint16Array:f,uint32Array:m}=it,p=s*2;if(Vt(p,f)){const g=on(s,m),y=Cn(p,f);Xv(n,r,i,g,y,o,c,l)}else{const g=En(s);br(g,d,i,c,l)&&Pc(g,n,r,i,o,c,l);const y=wn(s,m);br(y,d,i,c,l)&&Pc(y,n,r,i,o,c,l)}}const t0=["x","y","z"];function n0(s,n,r,i,o,c){it.setBuffer(s._roots[n]);const l=Dc(0,s,r,i,o,c);return it.clearBuffer(),l}function Dc(s,n,r,i,o,c){const{float32Array:l,uint16Array:d,uint32Array:f}=it;let m=s*2;if(Vt(m,d)){const h=on(s,f),g=Cn(m,d);return Wv(n,r,i,h,g,o,c)}else{const h=Gp(s,f),g=t0[h],C=i.direction[g]>=0;let T,S;C?(T=En(s),S=wn(s,f)):(T=wn(s,f),S=En(s));const w=br(T,l,i,o,c)?Dc(T,n,r,i,o,c):null;if(w){const _=w.point[g];if(C?_<=l[S+h]:_>=l[S+h+3])return w}const I=br(S,l,i,o,c)?Dc(S,n,r,i,o,c):null;return w&&I?w.distance<=I.distance?w:I:w||I||null}}const na=new qt,Pi=new Ln,Di=new Ln,_s=new Mn,Fd=new jt,ra=new jt;function r0(s,n,r,i){it.setBuffer(s._roots[n]);const o=Lc(0,s,r,i);return it.clearBuffer(),o}function Lc(s,n,r,i,o=null){const{float32Array:c,uint16Array:l,uint32Array:d}=it;let f=s*2;if(o===null&&(r.boundingBox||r.computeBoundingBox(),Fd.set(r.boundingBox.min,r.boundingBox.max,i),o=Fd),Vt(f,l)){const p=n.geometry,h=p.index,g=p.attributes.position,y=r.index,C=r.attributes.position,T=on(s,d),S=Cn(f,l);if(_s.copy(i).invert(),r.boundsTree)return dt(s,c,ra),ra.matrix.copy(_s),ra.needsUpdate=!0,r.boundsTree.shapecast({intersectsBounds:w=>ra.intersectsBox(w),intersectsTriangle:w=>{w.a.applyMatrix4(i),w.b.applyMatrix4(i),w.c.applyMatrix4(i),w.needsUpdate=!0;for(let M=T*3,I=(S+T)*3;M<I;M+=3)if(yt(Di,M,h,g),Di.needsUpdate=!0,w.intersectsTriangle(Di))return!0;return!1}});for(let E=T*3,w=(S+T)*3;E<w;E+=3){yt(Pi,E,h,g),Pi.a.applyMatrix4(_s),Pi.b.applyMatrix4(_s),Pi.c.applyMatrix4(_s),Pi.needsUpdate=!0;for(let M=0,I=y.count;M<I;M+=3)if(yt(Di,M,y,C),Di.needsUpdate=!0,Pi.intersectsTriangle(Di))return!0}}else{const p=s+8,h=d[s+6];return dt(p,c,na),!!(o.intersectsBox(na)&&Lc(p,n,r,i,o)||(dt(h,c,na),o.intersectsBox(na)&&Lc(h,n,r,i,o)))}}const ia=new Mn,uc=new jt,Is=new jt,i0=new $,s0=new $,o0=new $,a0=new $;function l0(s,n,r,i={},o={},c=0,l=1/0){n.boundingBox||n.computeBoundingBox(),uc.set(n.boundingBox.min,n.boundingBox.max,r),uc.needsUpdate=!0;const d=s.geometry,f=d.attributes.position,m=d.index,p=n.attributes.position,h=n.index,g=Sn.getPrimitive(),y=Sn.getPrimitive();let C=i0,T=s0,S=null,E=null;o&&(S=o0,E=a0);let w=1/0,M=null,I=null;return ia.copy(r).invert(),Is.matrix.copy(ia),s.shapecast({boundsTraverseOrder:_=>uc.distanceToBox(_),intersectsBounds:(_,F,G)=>G<w&&G<l?(F&&(Is.min.copy(_.min),Is.max.copy(_.max),Is.needsUpdate=!0),!0):!1,intersectsRange:(_,F)=>{if(n.boundsTree)return n.boundsTree.shapecast({boundsTraverseOrder:P=>Is.distanceToBox(P),intersectsBounds:(P,D,O)=>O<w&&O<l,intersectsRange:(P,D)=>{for(let O=P,b=P+D;O<b;O++){yt(y,3*O,h,p),y.a.applyMatrix4(r),y.b.applyMatrix4(r),y.c.applyMatrix4(r),y.needsUpdate=!0;for(let k=_,Y=_+F;k<Y;k++){yt(g,3*k,m,f),g.needsUpdate=!0;const Z=g.distanceToTriangle(y,C,S);if(Z<w&&(T.copy(C),E&&E.copy(S),w=Z,M=k,I=O),Z<c)return!0}}}});{const G=$i(n);for(let P=0,D=G;P<D;P++){yt(y,3*P,h,p),y.a.applyMatrix4(r),y.b.applyMatrix4(r),y.c.applyMatrix4(r),y.needsUpdate=!0;for(let O=_,b=_+F;O<b;O++){yt(g,3*O,m,f),g.needsUpdate=!0;const k=g.distanceToTriangle(y,C,S);if(k<w&&(T.copy(C),E&&E.copy(S),w=k,M=O,I=P),k<c)return!0}}}}}),Sn.releasePrimitive(g),Sn.releasePrimitive(y),w===1/0?null:(i.point?i.point.copy(T):i.point=T.clone(),i.distance=w,i.faceIndex=M,o&&(o.point?o.point.copy(E):o.point=E.clone(),o.point.applyMatrix4(ia),T.applyMatrix4(ia),o.distance=T.sub(o.point).length(),o.faceIndex=I),i)}function c0(s,n=null){n&&Array.isArray(n)&&(n=new Set(n));const r=s.geometry,i=r.index?r.index.array:null,o=r.attributes.position;let c,l,d,f,m=0;const p=s._roots;for(let g=0,y=p.length;g<y;g++)c=p[g],l=new Uint32Array(c),d=new Uint16Array(c),f=new Float32Array(c),h(0,m),m+=c.byteLength;function h(g,y,C=!1){const T=g*2;if(d[T+15]===wa){const E=l[g+6],w=d[T+14];let M=1/0,I=1/0,_=1/0,F=-1/0,G=-1/0,P=-1/0;for(let D=E,O=E+w;D<O;D++){const b=3*s.resolveTriangleIndex(D);for(let k=0;k<3;k++){let Y=b+k;Y=i?i[Y]:Y;const Z=o.getX(Y),se=o.getY(Y),ue=o.getZ(Y);Z<M&&(M=Z),Z>F&&(F=Z),se<I&&(I=se),se>G&&(G=se),ue<_&&(_=ue),ue>P&&(P=ue)}}return f[g+0]!==M||f[g+1]!==I||f[g+2]!==_||f[g+3]!==F||f[g+4]!==G||f[g+5]!==P?(f[g+0]=M,f[g+1]=I,f[g+2]=_,f[g+3]=F,f[g+4]=G,f[g+5]=P,!0):!1}else{const E=g+8,w=l[g+6],M=E+y,I=w+y;let _=C,F=!1,G=!1;n?_||(F=n.has(M),G=n.has(I),_=!F&&!G):(F=!0,G=!0);const P=_||F,D=_||G;let O=!1;P&&(O=h(E,y,_));let b=!1;D&&(b=h(w,y,_));const k=O||b;if(k)for(let Y=0;Y<3;Y++){const Z=E+Y,se=w+Y,ue=f[Z],Me=f[Z+3],V=f[se],fe=f[se+3];f[g+Y]=ue<V?ue:V,f[g+Y+3]=Me>fe?Me:fe}return k}}}function u0(s,n,r,i,o,c,l){it.setBuffer(s._roots[n]),Gc(0,s,r,i,o,c,l),it.clearBuffer()}function Gc(s,n,r,i,o,c,l){const{float32Array:d,uint16Array:f,uint32Array:m}=it,p=s*2;if(Vt(p,f)){const g=on(s,m),y=Cn(p,f);Vv(n,r,i,g,y,o,c,l)}else{const g=En(s);br(g,d,i,c,l)&&Gc(g,n,r,i,o,c,l);const y=wn(s,m);br(y,d,i,c,l)&&Gc(y,n,r,i,o,c,l)}}const f0=["x","y","z"];function d0(s,n,r,i,o,c){it.setBuffer(s._roots[n]);const l=Hc(0,s,r,i,o,c);return it.clearBuffer(),l}function Hc(s,n,r,i,o,c){const{float32Array:l,uint16Array:d,uint32Array:f}=it;let m=s*2;if(Vt(m,d)){const h=on(s,f),g=Cn(m,d);return qv(n,r,i,h,g,o,c)}else{const h=Gp(s,f),g=f0[h],C=i.direction[g]>=0;let T,S;C?(T=En(s),S=wn(s,f)):(T=wn(s,f),S=En(s));const w=br(T,l,i,o,c)?Hc(T,n,r,i,o,c):null;if(w){const _=w.point[g];if(C?_<=l[S+h]:_>=l[S+h+3])return w}const I=br(S,l,i,o,c)?Hc(S,n,r,i,o,c):null;
791return w&&I?w.distance<=I.distance?w:I:w||I||null}}const sa=new qt,Li=new Ln,Gi=new Ln,Rs=new Mn,Pd=new jt,oa=new jt;function p0(s,n,r,i){it.setBuffer(s._roots[n]);const o=Oc(0,s,r,i);return it.clearBuffer(),o}function Oc(s,n,r,i,o=null){const{float32Array:c,uint16Array:l,uint32Array:d}=it;let f=s*2;if(o===null&&(r.boundingBox||r.computeBoundingBox(),Pd.set(r.boundingBox.min,r.boundingBox.max,i),o=Pd),Vt(f,l)){const p=n.geometry,h=p.index,g=p.attributes.position,y=r.index,C=r.attributes.position,T=on(s,d),S=Cn(f,l);if(Rs.copy(i).invert(),r.boundsTree)return dt(s,c,oa),oa.matrix.copy(Rs),oa.needsUpdate=!0,r.boundsTree.shapecast({intersectsBounds:w=>oa.intersectsBox(w),intersectsTriangle:w=>{w.a.applyMatrix4(i),w.b.applyMatrix4(i),w.c.applyMatrix4(i),w.needsUpdate=!0;for(let M=T,I=S+T;M<I;M++)if(yt(Gi,3*n.resolveTriangleIndex(M),h,g),Gi.needsUpdate=!0,w.intersectsTriangle(Gi))return!0;return!1}});for(let E=T,w=S+T;E<w;E++){const M=n.resolveTriangleIndex(E);yt(Li,3*M,h,g),Li.a.applyMatrix4(Rs),Li.b.applyMatrix4(Rs),Li.c.applyMatrix4(Rs),Li.needsUpdate=!0;for(let I=0,_=y.count;I<_;I+=3)if(yt(Gi,I,y,C),Gi.needsUpdate=!0,Li.intersectsTriangle(Gi))return!0}}else{const p=s+8,h=d[s+6];return dt(p,c,sa),!!(o.intersectsBox(sa)&&Oc(p,n,r,i,o)||(dt(h,c,sa),o.intersectsBox(sa)&&Oc(h,n,r,i,o)))}}const aa=new Mn,fc=new jt,Fs=new jt,h0=new $,m0=new $,A0=new $,g0=new $;function v0(s,n,r,i={},o={},c=0,l=1/0){n.boundingBox||n.computeBoundingBox(),fc.set(n.boundingBox.min,n.boundingBox.max,r),fc.needsUpdate=!0;const d=s.geometry,f=d.attributes.position,m=d.index,p=n.attributes.position,h=n.index,g=Sn.getPrimitive(),y=Sn.getPrimitive();let C=h0,T=m0,S=null,E=null;o&&(S=A0,E=g0);let w=1/0,M=null,I=null;return aa.copy(r).invert(),Fs.matrix.copy(aa),s.shapecast({boundsTraverseOrder:_=>fc.distanceToBox(_),intersectsBounds:(_,F,G)=>G<w&&G<l?(F&&(Fs.min.copy(_.min),Fs.max.copy(_.max),Fs.needsUpdate=!0),!0):!1,intersectsRange:(_,F)=>{if(n.boundsTree){const G=n.boundsTree;return G.shapecast({boundsTraverseOrder:P=>Fs.distanceToBox(P),intersectsBounds:(P,D,O)=>O<w&&O<l,intersectsRange:(P,D)=>{for(let O=P,b=P+D;O<b;O++){const k=G.resolveTriangleIndex(O);yt(y,3*k,h,p),y.a.applyMatrix4(r),y.b.applyMatrix4(r),y.c.applyMatrix4(r),y.needsUpdate=!0;for(let Y=_,Z=_+F;Y<Z;Y++){const se=s.resolveTriangleIndex(Y);yt(g,3*se,m,f),g.needsUpdate=!0;const ue=g.distanceToTriangle(y,C,S);if(ue<w&&(T.copy(C),E&&E.copy(S),w=ue,M=Y,I=O),ue<c)return!0}}}})}else{const G=$i(n);for(let P=0,D=G;P<D;P++){yt(y,3*P,h,p),y.a.applyMatrix4(r),y.b.applyMatrix4(r),y.c.applyMatrix4(r),y.needsUpdate=!0;for(let O=_,b=_+F;O<b;O++){const k=s.resolveTriangleIndex(O);yt(g,3*k,m,f),g.needsUpdate=!0;const Y=g.distanceToTriangle(y,C,S);if(Y<w&&(T.copy(C),E&&E.copy(S),w=Y,M=O,I=P),Y<c)return!0}}}}}),Sn.releasePrimitive(g),Sn.releasePrimitive(y),w===1/0?null:(i.point?i.point.copy(T):i.point=T.clone(),i.distance=w,i.faceIndex=M,o&&(o.point?o.point.copy(E):o.point=E.clone(),o.point.applyMatrix4(aa),T.applyMatrix4(aa),o.distance=T.sub(o.point).length(),o.faceIndex=I),i)}function y0(){return typeof SharedArrayBuffer<"u"}const Us=new it.constructor,ga=new it.constructor,Gr=new $c(()=>new qt),Hi=new qt,Oi=new qt,dc=new qt,pc=new qt;let hc=!1;function B0(s,n,r,i){if(hc)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");hc=!0;const o=s._roots,c=n._roots;let l,d=0,f=0;const m=new Mn().copy(r).invert();for(let p=0,h=o.length;p<h;p++){Us.setBuffer(o[p]),f=0;const g=Gr.getPrimitive();dt(0,Us.float32Array,g),g.applyMatrix4(m);for(let y=0,C=c.length;y<C&&(ga.setBuffer(c[y]),l=Dn(0,0,r,m,i,d,f,0,0,g),ga.clearBuffer(),f+=c[y].length,!l);y++);if(Gr.releasePrimitive(g),Us.clearBuffer(),d+=o[p].length,l)break}return hc=!1,l}function Dn(s,n,r,i,o,c=0,l=0,d=0,f=0,m=null,p=!1){let h,g;p?(h=ga,g=Us):(h=Us,g=ga);const y=h.float32Array,C=h.uint32Array,T=h.uint16Array,S=g.float32Array,E=g.uint32Array,w=g.uint16Array,M=s*2,I=n*2,_=Vt(M,T),F=Vt(I,w);let G=!1;if(F&&_)p?G=o(on(n,E),Cn(n*2,w),on(s,C),Cn(s*2,T),f,l+n,d,c+s):G=o(on(s,C),Cn(s*2,T),on(n,E),Cn(n*2,w),d,c+s,f,l+n);else if(F){const P=Gr.getPrimitive();
791dt(n,S,P),P.applyMatrix4(r);const D=En(s),O=wn(s,C);dt(D,y,Hi),dt(O,y,Oi);const b=P.intersectsBox(Hi),k=P.intersectsBox(Oi);G=b&&Dn(n,D,i,r,o,l,c,f,d+1,P,!p)||k&&Dn(n,O,i,r,o,l,c,f,d+1,P,!p),Gr.releasePrimitive(P)}else{const P=En(n),D=wn(n,E);dt(P,S,dc),dt(D,S,pc);const O=m.intersectsBox(dc),b=m.intersectsBox(pc);if(O&&b)G=Dn(s,P,r,i,o,c,l,d,f+1,m,p)||Dn(s,D,r,i,o,c,l,d,f+1,m,p);else if(O)if(_)G=Dn(s,P,r,i,o,c,l,d,f+1,m,p);else{const k=Gr.getPrimitive();k.copy(dc).applyMatrix4(r);const Y=En(s),Z=wn(s,C);dt(Y,y,Hi),dt(Z,y,Oi);const se=k.intersectsBox(Hi),ue=k.intersectsBox(Oi);G=se&&Dn(P,Y,i,r,o,l,c,f,d+1,k,!p)||ue&&Dn(P,Z,i,r,o,l,c,f,d+1,k,!p),Gr.releasePrimitive(k)}else if(b)if(_)G=Dn(s,D,r,i,o,c,l,d,f+1,m,p);else{const k=Gr.getPrimitive();k.copy(pc).applyMatrix4(r);const Y=En(s),Z=wn(s,C);dt(Y,y,Hi),dt(Z,y,Oi);const se=k.intersectsBox(Hi),ue=k.intersectsBox(Oi);G=se&&Dn(D,Y,i,r,o,l,c,f,d+1,k,!p)||ue&&Dn(D,Z,i,r,o,l,c,f,d+1,k,!p),Gr.releasePrimitive(k)}}return G}const la=new jt,Dd=new qt,C0={strategy:Pp,maxDepth:40,maxLeafTris:10,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,verbose:!0,range:null};class Up{static serialize(n,r={}){r={cloneBuffers:!0,...r};const i=n.geometry,o=n._roots,c=n._indirectBuffer,l=i.getIndex();let d;return r.cloneBuffers?d={roots:o.map(f=>f.slice()),index:l?l.array.slice():null,indirectBuffer:c?c.slice():null}:d={roots:o,index:l?l.array:null,indirectBuffer:c},d}static deserialize(n,r,i={}){i={setIndex:!0,indirect:!!n.indirectBuffer,...i};const{index:o,roots:c,indirectBuffer:l}=n,d=new Up(r,{...i,[sc]:!0});if(d._roots=c,d._indirectBuffer=l||null,i.setIndex){const f=r.getIndex();if(f===null){const m=new ai(n.index,1,!1);r.setIndex(m)}else f.array!==o&&(f.array.set(o),f.needsUpdate=!0)}return d}get indirect(){return!!this._indirectBuffer}constructor(n,r={}){if(n.isBufferGeometry){if(n.index&&n.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(r=Object.assign({...C0,[sc]:!1},r),r.useSharedArrayBuffer&&!y0())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=n,this._roots=null,this._indirectBuffer=null,r[sc]||(Ov(this,r),!n.boundingBox&&r.setBoundingBox&&(n.boundingBox=this.getBoundingBox(new qt))),this.resolveTriangleIndex=r.indirect?i=>this._indirectBuffer[i]:i=>i}refit(n=null){return(this.indirect?c0:Zv)(this,n)}traverse(n,r=0){const i=this._roots[r],o=new Uint32Array(i),c=new Uint16Array(i);l(0);function l(d,f=0){const m=d*2,p=c[m+15]===wa;if(p){const h=o[d+6],g=c[m+14];n(f,p,new Float32Array(i,d*4,6),h,g)}else{const h=d+Os/4,g=o[d+6],y=o[d+7];n(f,p,new Float32Array(i,d*4,6),y)||(l(h,f+1),l(g,f+1))}}}raycast(n,r=gc,i=0,o=1/0){const c=this._roots,l=this.geometry,d=[],f=r.isMaterial,m=Array.isArray(r),p=l.groups,h=f?r.side:r,g=this.indirect?u0:e0;for(let y=0,C=c.length;y<C;y++){const T=m?r[p[y].materialIndex].side:h,S=d.length;if(g(this,y,T,n,d,i,o),m){const E=p[y].materialIndex;for(let w=S,M=d.length;w<M;w++)d[w].face.materialIndex=E}}return d}raycastFirst(n,r=gc,i=0,o=1/0){const c=this._roots,l=this.geometry,d=r.isMaterial,f=Array.isArray(r);let m=null;const p=l.groups,h=d?r.side:r,g=this.indirect?d0:n0;for(let y=0,C=c.length;y<C;y++){const T=f?r[p[y].materialIndex].side:h,S=g(this,y,T,n,i,o);S!=null&&(m==null||S.distance<m.distance)&&(m=S,f&&(S.face.materialIndex=p[y].materialIndex))}return m}intersectsGeometry(n,r){let i=!1;const o=this._roots,c=this.indirect?p0:r0;for(let l=0,d=o.length;l<d&&(i=c(this,l,n,r),!i);l++);return i}shapecast(n){const r=Sn.getPrimitive(),i=this.indirect?$v:Yv;let{boundsTraverseOrder:o,intersectsBounds:c,intersectsRange:l,intersectsTriangle:d}=n;if(l&&d){const h=l;l=(g,y,C,T,S)=>h(g,y,C,T,S)?!0:i(g,y,this,d,C,T,r)}else l||(d?l=(h,g,y,C)=>i(h,g,this,d,y,C,r):l=(h,g,y)=>y);let f=!1,m=0;const p=this._roots;for(let h=0,g=p.length;h<g;h++){const y=p[h];if(f=zv(this,h,c,l,o,m),f)break;m+=y.byteLength}return Sn.releasePrimitive(r),f}bvhcast(n,r,i){let{intersectsRanges:o,intersectsTriangles:c}
791=i;const l=Sn.getPrimitive(),d=this.geometry.index,f=this.geometry.attributes.position,m=this.indirect?C=>{const T=this.resolveTriangleIndex(C);yt(l,T*3,d,f)}:C=>{yt(l,C*3,d,f)},p=Sn.getPrimitive(),h=n.geometry.index,g=n.geometry.attributes.position,y=n.indirect?C=>{const T=n.resolveTriangleIndex(C);yt(p,T*3,h,g)}:C=>{yt(p,C*3,h,g)};if(c){const C=(T,S,E,w,M,I,_,F)=>{for(let G=E,P=E+w;G<P;G++){y(G),p.a.applyMatrix4(r),p.b.applyMatrix4(r),p.c.applyMatrix4(r),p.needsUpdate=!0;for(let D=T,O=T+S;D<O;D++)if(m(D),l.needsUpdate=!0,c(l,p,D,G,M,I,_,F))return!0}return!1};if(o){const T=o;o=function(S,E,w,M,I,_,F,G){return T(S,E,w,M,I,_,F,G)?!0:C(S,E,w,M,I,_,F,G)}}else o=C}return B0(this,n,r,o)}intersectsBox(n,r){return la.set(n.min,n.max,r),la.needsUpdate=!0,this.shapecast({intersectsBounds:i=>la.intersectsBox(i),intersectsTriangle:i=>la.intersectsTriangle(i)})}intersectsSphere(n){return this.shapecast({intersectsBounds:r=>n.intersectsBox(r),intersectsTriangle:r=>r.intersectsSphere(n)})}closestPointToGeometry(n,r,i={},o={},c=0,l=1/0){return(this.indirect?v0:l0)(this,n,r,i,o,c,l)}closestPointToPoint(n,r={},i=0,o=1/0){return jv(this,n,r,i,o)}getBoundingBox(n){return n.makeEmpty(),this._roots.forEach(i=>{dt(0,new Float32Array(i),Dd),n.union(Dd)}),n}}var Np={exports:{}},E0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",w0=E0,S0=w0;function bp(){}function kp(){}kp.resetWarningCache=bp;var M0=function(){function s(i,o,c,l,d,f){if(f!==S0){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}s.isRequired=s;function n(){return s}var r={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:n,element:s,elementType:s,instanceOf:n,node:s,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:kp,resetWarningCache:bp};return r.PropTypes=r,r};Np.exports=M0();var x0=Np.exports;const Ay=Uc(x0),T0=3e3,_0=3001,Jp=(s,n,r)=>{let i;switch(s){case da:i=new Uint8ClampedArray(n*r*4);break;case Bn:i=new Uint16Array(n*r*4);break;case Fm:i=new Uint32Array(n*r*4);break;case Rm:i=new Int8Array(n*r*4);break;case Im:i=new Int16Array(n*r*4);break;case _m:i=new Int32Array(n*r*4);break;case mr:i=new Float32Array(n*r*4);break;default:throw new Error("Unsupported data type")}return i};let ca;const I0=(s,n,r,i)=>{if(ca!==void 0)return ca;const o=new Qd(1,1,i);n.setRenderTarget(o);const c=new Zi(new Kd,new bi({color:16777215}));n.render(c,r),n.setRenderTarget(null);const l=Jp(s,o.width,o.height);return n.readRenderTargetPixels(o,0,0,o.width,o.height,l),o.dispose(),c.geometry.dispose(),c.material.dispose(),ca=l[0]!==0,ca};class eu{constructor(n){var r,i,o,c,l,d,f,m,p,h,g,y,C,T,S,E;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(M){throw this._renderer.setRenderTarget(null),M}this._renderer.setRenderTarget(null)},this._width=n.width,this._height=n.height,this._type=n.type,this._colorSpace
vendor: 12,555 bytes, lines 791-824
791=n.colorSpace;const w={format:Qi,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((r=n.renderTargetOptions)===null||r===void 0?void 0:r.anisotropy)!==void 0?(i=n.renderTargetOptions)===null||i===void 0?void 0:i.anisotropy:1,generateMipmaps:((o=n.renderTargetOptions)===null||o===void 0?void 0:o.generateMipmaps)!==void 0?(c=n.renderTargetOptions)===null||c===void 0?void 0:c.generateMipmaps:!1,magFilter:((l=n.renderTargetOptions)===null||l===void 0?void 0:l.magFilter)!==void 0?(d=n.renderTargetOptions)===null||d===void 0?void 0:d.magFilter:yn,minFilter:((f=n.renderTargetOptions)===null||f===void 0?void 0:f.minFilter)!==void 0?(m=n.renderTargetOptions)===null||m===void 0?void 0:m.minFilter:yn,samples:((p=n.renderTargetOptions)===null||p===void 0?void 0:p.samples)!==void 0?(h=n.renderTargetOptions)===null||h===void 0?void 0:h.samples:void 0,wrapS:((g=n.renderTargetOptions)===null||g===void 0?void 0:g.wrapS)!==void 0?(y=n.renderTargetOptions)===null||y===void 0?void 0:y.wrapS:hr,wrapT:((C=n.renderTargetOptions)===null||C===void 0?void 0:C.wrapT)!==void 0?(T=n.renderTargetOptions)===null||T===void 0?void 0:T.wrapT:hr};if(this._material=n.material,n.renderer?this._renderer=n.renderer:(this._renderer=eu.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Nc,this._camera=new Ur,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!I0(this._type,this._renderer,this._camera,w)){let M;switch(this._type){case Bn:M=this._renderer.extensions.has("EXT_color_buffer_float")?mr:void 0;break}M!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${mr}`),this._type=M):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Zi(new Kd,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new Qd(this.width,this.height,w),this._renderTarget.texture.mapping=((S=n.renderTargetOptions)===null||S===void 0?void 0:S.mapping)!==void 0?(E=n.renderTargetOptions)===null||E===void 0?void 0:E.mapping:ma}static instantiateRenderer(){const n=new Hd;return n.setSize(128,128),n}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const n=Jp(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,n),n}toDataTexture(n){const r=new Tm(this.toArray(),this.width,this.height,Qi,this._type,(n==null?void 0:n.mapping)||ma,(n==null?void 0:n.wrapS)||hr,(n==null?void 0:n.wrapT)||hr,(n==null?void 0:n.magFilter)||yn,(n==null?void 0:n.minFilter)||yn,(n==null?void 0:n.anisotropy)||1,yc);return r.generateMipmaps=(n==null?void 0:n.generateMipmaps)!==void 0?n==null?void 0:n.generateMipmaps:!1,r}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(n){this.disposeOnDemandRenderer(),n&&this.renderTarget.dispose(),this.material instanceof Yi&&Object.values(this.material.uniforms).forEach(r=>{r.value instanceof qn&&r.value.dispose()}),Object.values(this.material).forEach(r=>{r instanceof qn&&r.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(n){this._width=n,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(n){this._height=n,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(n){this._renderTarget=n,this._width=n.width,this._height=n.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}const R0=` 792varying vec2 vUv; 793 794void main() { 795 vUv = uv; 796 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 797} 798`,F0=` 799// min half float value 800#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 ) 801// max half float value 802#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 ) 803 804uniform sampler2D sdr; 805uniform sampler2D gainMap; 806uniform vec3 gamma; 807uniform vec3 offsetHdr; 808uniform vec3 offsetSdr; 809uniform vec3 gainMapMin; 810uniform vec3 gainMapMax; 811uniform float weightFactor; 812 813varying vec2 vUv; 814 815void main() { 816 vec3 rgb = texture2D( sdr, vUv ).rgb; 817 vec3 recovery = texture2D( gainMap, vUv ).rgb; 818 vec3 logRecovery = pow( recovery, gamma ); 819 vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery; 820 vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr; 821 vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor )); 822 gl_FragColor = vec4( clampedHdrColor , 1.0 ); 823} 824`;class P0 extends Yi{constructor({gamma:n,offsetHdr:r,offsetSdr:i,gainMapMin:o,gainMapMax:c,maxDisplayBoost:l,hdrCapacityMin:d,hdrCapacityMax:f,sdr:m,gainMap:p}){super({name:"GainMapDecoderMaterial",vertexShader:R0,fragmentShader:F0,uniforms:{sdr:{value:m},gainMap:{value:p},gamma:{value:new $(1/n[0],1/n[1],1/n[2])},offsetHdr:{value:new $().fromArray(r)},offsetSdr:{value:new $().fromArray(i)},gainMapMin:{value:new $().fromArray(o)},gainMapMax:{value:new $().fromArray(c)},weightFactor:{value:(Math.log2(l)-d)/(f-d)}},blending:Lm,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=l,this._hdrCapacityMin=d,this._hdrCapacityMax=f,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(n){this.uniforms.sdr.value=n}get gainMap(){return this.uniforms.gainMap.value}set gainMap(n){this.uniforms.gainMap.value=n}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(n){this.uniforms.offsetHdr.value.fromArray(n)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(n){this.uniforms.offsetSdr.value.fromArray(n)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(n){this.uniforms.gainMapMin.value.fromArray(n)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(n){this.uniforms.gainMapMax.value.fromArray(n)}get gamma(){const n=this.uniforms.gamma.value;return[1/n.x,1/n.y,1/n.z]}set gamma(n){const r=this.uniforms.gamma.value;r.x=1/n[0],r.y=1/n[1],r.z=1/n[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(n){this._hdrCapacityMin=n,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(n){this._hdrCapacityMax=n,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(n){this._maxDisplayBoost=Math.max(1,Math.min(65504,n)),this.calculateWeight()}calculateWeight(){const n=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,n))}}class zp extends Error{}class jp extends Error{}const Ps=(s,n,r)=>{const i=new RegExp(`${n}="([^"]*)"`,"i").exec(s);if(i)return i[1];const o=new RegExp(`<${n}[^>]*>([\\s\\S]*?)</${n}>`,"i").exec(s);if(o){const c=o[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return c&&c.length===3?c.map(l=>l.replace(/<\/?rdf:li>/g,"")):o[1].trim()}if(r!==void 0)return r;throw new Error(`Can't find ${n} in gainmap metadata`)},D0=s=>{let n;typeof TextDecoder<"u"?n=new TextDecoder().decode(s):n=s.toString();let r=n.indexOf("<x:xmpmeta");for(;r!==-1;){const i=n.indexOf("x:xmpmeta>",r),o=n.slice(r,i+10);try{const c=Ps(o,"hdrgm:GainMapMin","0"),l=Ps(o,"hdrgm:GainMapMax"),d=Ps(o,"hdrgm:Gamma","1"),f=Ps(o,"hdrgm:OffsetSDR","0.015625"),m=Ps(o,"hdrgm:OffsetHDR","0.015625"),p=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(o),h=p?p[1]:"0",g=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(o);if(!g)throw new Error("Incomplete gainmap metadata");const y=g[1];return{gainMapMin:Array.isArray(c)?c.map(C=>parseFloat(C)):[parseFloat(c),parseFloat(c),parseFloat(c)],gainMapMax:Array.isArray(l)?l.map(C=>parseFloat(C)):[parseFloat(l),parseFloat(l),parseFloat(l)],gamma:Array.isArray(d)?d.map(C=>parseFloat(C)):[parseFloat(d),parseFloat(d),parseFloat(d)],offsetSdr:Array.isArray(f)?f.map(C=>parseFloat(C)):[parseFloat(f),parseFloat(f),parseFloat(f)],offsetHdr:Array.isArray(m)?m.map(C=>parseFloat(C)):[parseFloat(m),parseFloat(m),parseFloat(m)],hdrCapacityMin:parseFloat(h),hdrCapacityMax:parseFloat(y)}}catch{}r=n.indexOf("<x:xmpmeta",i)}};class L0{constructor(n){this.options={debug:n&&n.debug!==void 0?n.debug:!1,extractFII:n&&n.extractFII!==void 0?n.extractFII:!0,extractNonFII:n&&n.extractNonFII!==void 0?n.extractNonFII:!0}}extract(n){return new Promise((r,i)=>{const o=this.options.debug,c=new DataView(n.buffer);if(c.getUint16(0)!==65496){i(new Error("Not a valid jpeg"));return}const l=c.byteLength;let d=2,f=0,m;for(;d<l;){if(++f>250){i(new Error(`Found no marker after ${f} loops ðµ`));return}if(c.getUint8(d)!==255){i(new Error(`Not a valid marker at offset 0x${d.toString(16)}, found: 0x${c.getUint8(d).toString(16)}`));return}if(m=c.getUint8(d+1),o&&`${m.toString(16)}`,m===226){const p=d+4;if(c.getUint32(p)===1297106432){const h=p+4;let g;if(c.getUint16(h)===18761)g=!1;else if(c.getUint16(h)===19789)g=!0;else{i(new Error("No valid endianness marker found in TIFF header"));return}if(c.getUint16(h+2,!g)!==42){i(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const y=c.getUint32(h+4,!g);if(y<8){i(new Error("Not valid TIFF data! (First offset less than 8)"));return}const C=h+y,T=c.getUint16(C,!g),S=C+2;let E=0;for(let _=S;_<S+12*T;_+=12)c.getUint16(_,!g)===45057&&(E=c.getUint32(_+8,!g));const M=C+2+T*12+4,I=[];for(let _=M;_<M+E*16;_+=16){const F={MPType:c.getUint32(_,!g),size:c.getUint32(_+4,!g),dataOffset:c.getUint32(_+8,!g),dependantImages:c.getUint32(_+12,!g),start:-1,end:-1,isFII:!1};F.dataOffset?(F.start=h+F.dataOffset,F.isFII=!1):(F.start=0,F.isFII=!0),F.end=F.start+F.size,I.push(F)}if(this.options.extractNonFII&&I.length){const _=new Blob([c]),F=[];for(const G of I){if(G.isFII&&!this.options.extractFII)continue;const P=_.slice(G.start,G.end+1,"image/jpeg");F.push(P)}r(F)}}}d+=2+c.getUint16(d+2)}})}}const G0=async s=>{const n=D0(s);if(!n)throw new jp("Gain map XMP metadata not found");const i=await new L0({extractFII:!0,extractNonFII:!0}).extract(s);if(i.length!==2)throw new zp("Gain map recovery image not found");return{sdr:new Uint8Array(await i[0].arrayBuffer()),gainMap:new Uint8Array(await i[1].arrayBuffer()),metadata:n}},Ld=s=>new Promise((n,r)=>{const i=document.createElement("img");i.onload=()=>{n(i)},i.onerror=o=>{r(o)},i.src=URL.createObjectURL(s)});class Kp extends kc{constructor(n,r){super(r),n&&(this._renderer=n),this._internalLoadingManager=new Pm}setRenderer(n){return this._renderer=n,this}setRenderTargetOptions(n){return this._renderTargetOptions=n,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const n=new P0({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new qn,sdr:new qn});return new eu({width:16,height:16,type:Bn,colorSpace:yc,material:n,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(n,r,i,o){const c=o?new Blob([o],{type:"image/jpeg"}):void 0,l=new Blob([i],{type:"image/jpeg"});let d,f,m=!1;if(typeof createImageBitmap>"u"){const g=await Promise.all([c?Ld(c):Promise.resolve(void 0),Ld(l)]);f=g[0],d=g[1],m=!0}else{const g=await Promise.all([c?createImageBitmap(c,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(l,{imageOrientation:"flipY"})]);f=g[0],d=g[1]}const p=new qn(f||new ImageData(2,2),ma,hr,hr,yn,Kf,Qi,da,1,yc);p.flipY=m,p.needsUpdate=!0;const h=new qn(d,ma,hr,hr,yn,Kf,Qi,da,1,Dm);h.flipY=m,h.needsUpdate=!0,n.width=d.width,n.height=d.height,n.material.gainMap=p,n.material.sdr=h,n.material.gainMapMin=r.gainMapMin,n.material.gainMapMax=r.gainMapMax,n.material.offsetHdr=r.offsetHdr,n.material.offsetSdr=r.offsetSdr,n.material.gamma=r.gamma,n.material.hdrCapacityMin=r.hdrCapacityMin,n.material.hdrCapacityMax=r.hdrCapacityMax,n.material.maxDisplayBoost=Math.pow(2,r.hdrCapacityMax),n.material.needsUpdate=!0,n.render()}}class H0 extends Kp{load([n,r,i],o,c,l){const d=this.prepareQuadRenderer();let f,m,p;const h=async()=>
vendor: 1,170 bytes, line 824
824{if(f&&m&&p){try{await this.render(d,p,f,m)}catch(D){this.manager.itemError(n),this.manager.itemError(r),this.manager.itemError(i),typeof l=="function"&&l(D),d.disposeOnDemandRenderer();return}typeof o=="function"&&o(d),this.manager.itemEnd(n),this.manager.itemEnd(r),this.manager.itemEnd(i),d.disposeOnDemandRenderer()}};let g=!0,y=0,C=0,T=!0,S=0,E=0,w=!0,M=0,I=0;const _=()=>{if(typeof c=="function"){const D=y+S+M,O=C+E+I,b=g&&T&&w;c(new ProgressEvent("progress",{lengthComputable:b,loaded:O,total:D}))}};this.manager.itemStart(n),this.manager.itemStart(r),this.manager.itemStart(i);const F=new Nr(this._internalLoadingManager);F.setResponseType("arraybuffer"),F.setRequestHeader(this.requestHeader),F.setPath(this.path),F.setWithCredentials(this.withCredentials),F.load(n,async D=>{if(typeof D=="string")throw new Error("Invalid sdr buffer");f=D,await h()},D=>{g=D.lengthComputable,C=D.loaded,y=D.total,_()},D=>{this.manager.itemError(n),typeof l=="function"&&l(D)});const G=new Nr(this._internalLoadingManager);G.setResponseType("arraybuffer"),G.setRequestHeader(this.requestHeader),G.setPath(this.path),G.setWithCredentials(this.withCredentials),G.load(r,async D=>
824{if(typeof D=="string")throw new Error("Invalid gainmap buffer");m=D,await h()},D=>{T=D.lengthComputable,E=D.loaded,S=D.total,_()},D=>{this.manager.itemError(r),typeof l=="function"&&l(D)});const P=new Nr(this._internalLoadingManager);return P.setRequestHeader(this.requestHeader),P.setPath(this.path),P.setWithCredentials(this.withCredentials),P.load(i,async D=>{if(typeof D!="string")throw new Error("Invalid metadata string");p=JSON.parse(D),await h()},D=>{w=D.lengthComputable,I=D.loaded,M=D.total,_()},D=>{this.manager.itemError(i),typeof l=="function"&&l(D)}),d}}class O0 extends Kp{load(n,r,i,o){const c=this.prepareQuadRenderer(),l=new Nr(this._internalLoadingManager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(this.withCredentials),this.manager.itemStart(n),l.load(n,async d=>{if(typeof d=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const f=new Uint8Array(d);let m,p,h;try{const g=await G0(f);m=g.sdr,p=g.gainMap,h=g.metadata}catch(g){if(g instanceof jp||g instanceof zp)console.warn(`Failure to reconstruct an HDR image from ${n}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),h={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},m=f;else throw g}try{await this.render(c,h,m,p)}catch(g){this.manager.itemError(n),typeof o=="function"&&o(g),c.disposeOnDemandRenderer();return}typeof r=="function"&&r(c),this.manager.itemEnd(n),c.disposeOnDemandRenderer()},i,d=>{this.manager.itemError(n),typeof o=="function"&&o(d)}),c}}const bs={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},Qp="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",Ki=s=>Array.isArray(s),tu=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function Ma({files:s=tu,path:n="",preset:r=void 0,encoding:i=void 0,extensions:o}={}){let c=null,l=!1;r&&(nu(r),s=bs[r],n=Qp),l=Ki(s);const{extension:d,isCubemap:f}=ru(s);if(c=iu(d),!c)throw new Error("useEnvironment: Unrecognized file extension: "+s);const m=ct(y=>y.gl);j.useLayoutEffect(()=>{if(d!=="webp"&&d!=="jpg"&&d!=="jpeg")return;function y(){xn.clear(c,l?[s]:s)}m.domElement.addEventListener("webglcontextlost",y,{once:!0})},[s,m.domElement]);const p=xn(c,l?[s]:s,y=>{(d==="webp"||d==="jpg"||d==="jpeg")&&y.setRenderer(m),y.setPath==null||y.setPath(n),o&&o(y)});let h=l?p[0]:p;if(d==="jpg"||d==="jpeg"||d==="webp"){var g;h=(g=h.renderTarget)==null?void 0:g.texture}return h.mapping=f?Gm:Hm,"colorSpace"in h?h.colorSpace=i??f?"srgb":"srgb-linear":h.encoding=i??f?_0:T0,h}const U0={files:tu,path:"",preset:void 0,extensions:void 0};Ma.preload=s=>{const n={...U0,...s};let{files:r,path:i=""}=n;
824const{preset:o,extensions:c}=n;o&&(nu(o),r=bs[o],i=Qp);const{extension:l}=ru(r);if(l==="webp"||l==="jpg"||l==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const d=iu(l);if(!d)throw new Error("useEnvironment: Unrecognized file extension: "+r);xn.preload(d,Ki(r)?[r]:r,f=>{f.setPath==null||f.setPath(i),c&&c(f)})};const N0={files:tu,preset:void 0};Ma.clear=s=>{const n={...N0,...s};let{files:r}=n;const{preset:i}=n;i&&(nu(i),r=bs[i]);const{extension:o}=ru(r),c=iu(o);if(!c)throw new Error("useEnvironment: Unrecognized file extension: "+r);xn.clear(c,Ki(r)?[r]:r)};function nu(s){if(!(s in bs))throw new Error("Preset must be one of: "+Object.keys(bs).join(", "))}function ru(s){var n;const r=Ki(s)&&s.length===6,i=Ki(s)&&s.length===3&&s.some(l=>l.endsWith("json")),o=Ki(s)?s[0]:s;return{extension:r?"cube":i?"webp":o.startsWith("data:application/exr")?"exr":o.startsWith("data:application/hdr")?"hdr":o.startsWith("data:image/jpeg")?"jpg":(n=o.split(".").pop())==null||(n=n.split("?"))==null||(n=n.shift())==null?void 0:n.toLowerCase(),isCubemap:r,isGainmap:i}}function iu(s){return s==="cube"?Om:s==="hdr"?lv:s==="exr"?cv:s==="jpg"||s==="jpeg"?O0:s==="webp"?H0:null}const b0=s=>s.current&&s.current.isScene,k0=s=>b0(s)?s.current:s;function su(s,n,r,i,o={}){var c,l,d,f;o={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...o};const m=k0(n||r),p=m.background,h=m.environment,g={backgroundBlurriness:m.backgroundBlurriness,backgroundIntensity:m.backgroundIntensity,backgroundRotation:(c=(l=m.backgroundRotation)==null||l.clone==null?void 0:l.clone())!==null&&c!==void 0?c:[0,0,0],environmentIntensity:m.environmentIntensity,environmentRotation:(d=(f=m.environmentRotation)==null||f.clone==null?void 0:f.clone())!==null&&d!==void 0?d:[0,0,0]};return s!=="only"&&(m.environment=i),s&&(m.background=i),Lr(m,o),()=>{s!=="only"&&(m.environment=h),s&&(m.background=p),Lr(m,g)}}function ou({scene:s,background:n=!1,map:r,...i}){const o=ct(c=>c.scene);return j.useLayoutEffect(()=>{if(r)return su(n,s,o,r,i)}),null}function Xp({background:s=!1,scene:n,blur:r,backgroundBlurriness:i,backgroundIntensity:o,backgroundRotation:c,environmentIntensity:l,environmentRotation:d,...f}){const m=Ma(f),p=ct(h=>h.scene);return j.useLayoutEffect(()=>su(s,n,p,m,{backgroundBlurriness:r??i,backgroundIntensity:o,backgroundRotation:c,environmentIntensity:l,environmentRotation:d})),j.useEffect(()=>()=>{m.dispose()},[m]),null}function J0({children:s,near:n=.1,far:r=1e3,resolution:i=256,frames:o=1,map:c,background:l=!1,blur:d,backgroundBlurriness:f,backgroundIntensity:m,backgroundRotation:p,environmentIntensity:h,environmentRotation:g,scene:y,files:C,path:T,preset:S=void 0,extensions:E}){const w=ct(P=>P.gl),M=ct(P=>P.scene),I=j.useRef(null),[_]=j.useState(()=>new Nc),F=j.useMemo(()=>{const P=new Um(i);return P.texture.type=Bn,P},[i]);j.useEffect(()=>()=>{F.dispose()},[F]),j.useLayoutEffect(()=>{if(o===1){const P=w.autoClear;w.autoClear=!0,I.current.update(w,_),w.autoClear=P}return su(l,y,M,F.texture,{backgroundBlurriness:d??f,backgroundIntensity:m,backgroundRotation:p,environmentIntensity:h,environmentRotation:g})},[s,_,F.texture,y,M,l,o,w]);let G=1;return Ea(()=>{if(o===1/0||G<o){const P=w.autoClear;w.autoClear=!0,I.current.update(w,_),w.autoClear=P,G++}}),j.createElement(j.Fragment,null,PA(j.createElement(j.Fragment,null,s,j.createElement("cubeCamera",{ref:I,args:[n,r,F]}),C||S?j.createElement(Xp,{background:!0,files:C,preset:S,path:T,extensions:E}):c?j.createElement(ou,{background:!0,map:c,extensions:E}):null),_))}function z0(s){var n,r,i,o;const c=Ma(s),l=s.map||c;j.useMemo(()=>jc({GroundProjectedEnvImpl:pg}),[]),j.useEffect(()=>()=>{c.dispose()},[c]);const d=j.useMemo(()=>[l],[l]),f=(n=s.ground)==null?void 0:n.height,m=(r=s.ground)==null?void 0:r.radius,p=(i=(o=s.ground)==null?void 0:o.scale)!==null&&i!==void 0?i:1e3;return j.createElement(j.Fragment,null,j.createElement(ou,Tn({},s,{map:l})),j.createElement("groundProjectedEnvImpl",{args:d,scale:p,height:f,radius:m}))}function gy(s){return s.ground?j.createElement(z0,s):s.map?j.createElement(ou,s):s.children?j.createElement(J0,s):j.createElement(Xp,s)}function j0(s,n,r=new $){const i=Math.PI*(s-.5),o=2*Math.PI*(n-.5);return r.x=Math.cos(o),r.y=Math.sin(i),r.z=Math.sin(o),r}const vy=j.forwardRef(({inclination:s=.6,azimuth:n=.1,distance:r=1e3,mieCoefficient:i=.005,mieDirectionalG:o=.8,rayleigh:c=.5,turbidity:l=10,sunPosition:d=j0(s,n),...f},m)=>{const p=j.useMemo(()=>new $().setScalar(r),[r]),[h]=j.useState(()=>new fg);return j.createElement("primitive",Tn({object:h,ref:m,"material-uniforms-mieCoefficient-value":i,"material-uniforms-mieDirectionalG-value":o,"material-uniforms-rayleigh-value":c,"material-uniforms-sunPosition-value":d,"material-uniforms-turbidity-value":l,scale:p},f))});var Wp={exports:{}},Yp={};/** 825 * @license React 826 * use-sync-external-store-shim/with-selector.production.js 827 * 828 * Copyright (c) Meta Platforms, Inc. and affiliates. 829 * 830 * This source code is licensed under the MIT license found in the 831 * LICENSE file in the root directory of this source tree. 832 */var xa=j,K0=qm;function Q0(s,n){return s===n&&(s!==0||1/s===1/n)||s!==s&&n!==n}var X0=typeof Object.is=="function"?Object.is:Q0,W0=K0.useSyncExternalStore,Y0=xa.useRef,Z0=xa.useEffect,V0=xa.useMemo,q0=xa.useDebugValue;Yp.useSyncExternalStoreWithSelector=function(s,n,r,i,o){var c=Y0(null);if(c.current===null){var l={hasValue:!1,value:null};c.current=l}
832else l=c.current;c=V0(function(){function f(y){if(!m){if(m=!0,p=y,y=i(y),o!==void 0&&l.hasValue){var C=l.value;if(o(C,y))return h=C}return h=y}if(C=h,X0(p,y))return C;var T=i(y);return o!==void 0&&o(C,T)?(p=y,C):(p=y,h=T)}var m=!1,p,h,g=r===void 0?null:r;return[function(){return f(n())},g===null?void 0:function(){return f(g())}]},[n,r,i,o]);var d=W0(s,c[0],c[1]);return Z0(function(){l.hasValue=!0,l.value=d},[d]),q0(d),d};Wp.exports=Yp;var $0=Wp.exports;const yy=Uc($0);export{ay as C,dy as E,my as G,ly as H,mv as L,Up as M,py as O,Ay as P,vy as S,iy as _,Xd as a,ct as b,sy as c,xn as d,yy as e,Ea as f,Ip as g,gy as h,fg as i,hy as j,$m as k,tA as l,Pp as m,oy as p,qm as s,Vc as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.