PageSourceSearch

https://legalgame.manus.space/assets/index-agU6DIWm.js

js legalgame.manus.space collected 2026-10-03 05:03:04 UTC 1,375,800 bytes, 474 lines download raw bytes

vendor: 15,966 bytes, lines 1-18
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dds.pure-C58BkMLi.js","assets/cubemapToSphericalPolynomial-CkQ9kjoa.js","assets/ddsTextureLoader-B_-9FgK9.js","assets/envTextureLoader-CGqBklsT.js","assets/layer.fragment-BXZ75Fz4.js","assets/helperFunctions-C1RyWx_I.js","assets/layer.fragment-C87fhhxb.js","assets/helperFunctions-B3jhHVhD.js"])))=>i.map(i=>d[i]);
2function tP(i,e){for(var t=0;t<e.length;t++){const s=e[t];if(typeof s!="string"&&!Array.isArray(s)){for(const n in s)if(n!=="default"&&!(n in i)){const a=Object.getOwnPropertyDescriptor(s,n);a&&Object.defineProperty(i,n,a.get?a:{enumerable:!0,get:()=>s[n]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function t(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(n){if(n.ep)return;n.ep=!0;const a=t(n);fetch(n.href,a)}})();function eE(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var I_={exports:{}},Ul={};/**
3 * @license React
4 * react-jsx-runtime.production.js
5 *
6 * Copyright (c) Meta Platforms, Inc. and affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var av;function sP(){if(av)return Ul;av=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(s,n,a){var l=null;if(a!==void 0&&(l=""+a),n.key!==void 0&&(l=""+n.key),"key"in n){a={};for(var u in n)u!=="key"&&(a[u]=n[u])}else a=n;return n=a.ref,{$$typeof:i,type:s,key:l,ref:n!==void 0?n:null,props:a}}return Ul.Fragment=e,Ul.jsx=t,Ul.jsxs=t,Ul}var ov;function iP(){return ov||(ov=1,I_.exports=sP()),I_.exports}var _=iP(),F_={exports:{}},ht={};/**
11 * @license React
12 * react.production.js
13 *
14 * Copyright (c) Meta Platforms, Inc. and affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var lv;function nP(){if(lv)return ht;lv=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function v(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,T={};function E(L,B,X){this.props=L,this.context=B,this.refs=T,this.updater=X||R}E.prototype.isReactComponent={},E.prototype.setState=function(L,B){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,B,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function A(){}A.prototype=E.prototype;function D(L,B,X){this.props=L,this.context=B,this.refs=T,this.updater=X||R}var M=D.prototype=new A;M.constructor=D,x(M,E.prototype),M.isPureReactComponent=!0;var k=Array.isArray;function U(){}var N={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function q(L,B,X){var Q=X.ref;return{$$typeof:i,type:L,key:B,ref:Q!==void 0?Q:null,props:X}}function re(L,B){return q(L.type,B,L.props)}function ce(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function ae(L){var B={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(X){return B[X]})}var fe=/\/+/g;function _e(L,B){return typeof L=="object"&&L!==null&&L.key!=null?ae(""+L.key):B.toString(36)}function Te(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(U,U):(L.status="pending",L.then(function(B){L.status==="pending"&&(L.status="fulfilled",L.value=B)},function(B){L.status==="pending"&&(L.status="rejected",L.reason=B)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function z(L,B,X,Q,F){var $=typeof L;($==="undefined"||$==="boolean")&&(L=null);var he=!1;if(L===null)he=!0;else switch($){case"bigint":case"string":case"number":he=!0;break;case"object":switch(L.$$typeof){case i:case e:he=!0;break;case m:return he=L._init,z(he(L._payload),B,X,Q,F)}}if(he)return F=F(L),he=Q===""?"."+_e(L,0):Q,k(F)?(X="",he!=null&&(X=he.replace(fe,"$&/")+"/"),z(F,B,X,"",function(G){return G})):F!=null&&(ce(F)&&(F=re(F,X+(F.key==null||L&&L.key===F.key?"":(""+F.key).replace(fe,"$&/")+"/")+he)),B.push(F)),1;he=0;var Ae=Q===""?".":Q+":";if(k(L))for(var Oe=0;Oe<L.length;Oe++)Q=L[Oe],$=Ae+_e(Q,Oe),he+=z(Q,B,X,$,F);else if(Oe=v(L),typeof Oe=="function")for(L=Oe.call(L),Oe=0;!(Q=L.next()).done;)Q=Q.value,$=Ae+_e(Q,Oe++),he+=z(Q,B,X,$,F);else if($==="object"){if(typeof L.then=="function")return z(Te(L),B,X,Q,F);throw B=String(L),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return he}function J(L,B,X){if(L==null)return L;var Q=[],F=0;return z(L,Q,"","",function($){return B.call(X,$,F++)}),Q}function Y(L){if(L._status===-1){var B=L._result;B=B(),B.then(function(X){(L._status===0||L._status===-1)&&(L._status=1,L._result=X)},function(X){(L._status===0||L._status===-1)&&(L._status=2,L._result=X)}),L._status===-1&&(L._status=0,L._result=B)}if(L._status===1)return L._result.default;throw L._result}var V=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},ge={map:J,forEach:function(L,B,X){J(L,function(){B.apply(this,arguments)},X)},count:function(L){var B=0;return J(L,function(){B++}),B},toArray:function(L){return J(L,function(B){return B})||[]},only:function(L){if(!ce(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return ht.Activity=p,ht.Children=ge,ht.Component=E,ht.Fragment=t,ht.Profiler=n,ht.PureComponent=D,ht.StrictMode=s,ht.Suspense=h,ht.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,ht.__COMPILER_RUNTIME={__proto__:null,c:function(L){return N.H.useMemoCache(L)}},ht.cache=function(L){return function(){return L.apply(null,arguments)}},ht.cacheSignal=function(){return null},ht.cloneElement=function(L,B,X){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Q=x({},L.props),F=L.key;if(B!=null)for($ in B.key!==void 0&&(F=""+B.key),B)!H.call(B,$)||$==="key"||$==="__self"||$==="__source"||$==="ref"&&B.ref===void 0||(Q[$]=B[$]);var $=arguments.length-2;if($===1)Q.children=X;else if(1<$){for(var he=Array($),Ae=0;Ae<$;Ae++)he[Ae]=arguments[Ae+2];Q.children=he}return q(L.type,F,Q)},ht.createContext=function(L){return L={$$typeof:l,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:a,_context:L},L},ht.createElement=function(L,B,X){var Q,F={},$=null;if(B!=null)for(Q in B.key!==void 0&&($=""+B.key),B)H.call(B,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(F[Q]=B[Q]);var he=arguments.length-2;if(he===1)F.children=X;else if(1<he){for(var Ae=Array(he),Oe=0;Oe<he;Oe++)Ae[Oe]=arguments[Oe+2];F.children=Ae}if(L&&L.defaultProps)for(Q in he=L.defaultProps,he)F[Q]===void 0&&(F[Q]=he[Q]);return q(L,$,F)},ht.createRef=function(){return{current:null}},ht.forwardRef=function(L){return{$$typeof:u,render:L}},ht.isValidElement=ce,ht.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:Y}},ht.memo=function(L,B){return{$$typeof:f,type:L,compare:B===void 0?null:B}},ht.startTransition=function(L){var B=N.T,X={};N.T=X;try{var Q=L(),F=N.S;F!==null&&F(X,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(U,V)}catch($){V($)}finally{B!==null&&X.types!==null&&(B.types=X.types),N.T=B}},ht.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},ht.use=function(L){return N.H.use(L)},ht.useActionState=function(L,B,X){return N.H.useActionState(L,B,X)},ht.useCallback=function(L,B){return N.H.useCallback(L,B)},ht.useContext=function(L){return N.H.useContext(L)},ht.useDebugValue=function(){},ht.useDeferredValue=function(L,B){return N.H.useDeferredValue(L,B)},ht.useEffect=function(L,B){return N.H.useEffect(L,B)},ht.useEffectEvent=function(L){return N.H.useEffectEvent(L)},ht.useId=function(){return N.H.useId()},ht.useImperativeHandle=function(L,B,X){return N.H.useImperativeHandle(L,B,X)},ht.useInsertionEffect=function(L,B){return N.H.useInsertionEffect(L,B)},ht.useLayoutEffect=function(L,B){return N.H.useLayoutEffect(L,B)},ht.useMemo=function(L,B){return N.H.useMemo(L,B)},ht.useOptimistic=function(L,B){return N.H.useOptimistic(L,B)},ht.useReducer=function(L,B,X){return N.H.useReducer(L,B,X)},ht.useRef=function(L){return N.H.useRef(L)},ht.useState=function(L){return N.H.useState(L)},ht.useSyncExternalStore=function(L,B,X){return N.H.useSyncExternalStore(L,B,X)},ht.useTransition=function(){return N.H.useTransition()},ht.version="19.2.1",ht}var cv;function qh(){return cv||(cv=1,F_.exports=nP()),F_.exports}var C=qh();const Fe=eE(C),Wh=tP({__proto__:null,default:Fe},[C]),tE=C.createContext(void 0),bc=i=>{const e=C.useContext(tE);if(i)return i;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},rP=({client:i,children:e})=>(C.useEffect(()=>(i.mount(),()=>{i.unmount()}),[i]),_.jsx(tE.Provider,{value:i,children:e})),aP={setTimeout:(i,e)=>setTimeout(i,e),clearTimeout:i=>clearTimeout(i),setInterval:(i,e)=>setInterval(i,e),clearInterval:i=>clearInterval(i)};var oP=class{#t=aP;#e=!1;setTimeoutProvider(i){this.#t=i}setTimeout(i,e){return this.#t.setTimeout(i,e)}clearTimeout(i){this.#t.clearTimeout(i)}setInterval(i,e){return this.#t.setInterval(i,e)}clearInterval(i){this.#t.clearInterval(i)}};const ba=new oP;function lP(i){setTimeout(i,0)}const cP=typeof window>"u"||"Deno"in globalThis;function Xs(){}function uP(i,e){return typeof i=="function"?i(e):i}function sE(i){return typeof i=="number"&&i>=0&&i!==1/0}function iE(i,e){return Math.max(i+(e||0)-Date.now(),0)}function xs(i,e){return typeof i=="function"?i(e):i}function uv(i,e){const{type:t="all",exact:s,fetchStatus:n,predicate:a,queryKey:l,stale:u}=i;if(l){if(s){if(e.queryHash!==om(l,e.options))return!1}else if(!Lo(e.queryKey,l))return!1}if(t!=="all"){const h=e.isActive();if(t==="active"&&!h||t==="inactive"&&h)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||n&&n!==e.state.fetchStatus||a&&!a(e))}function hv(i,e){const{exact:t,status:s,predicate:n,mutationKey:a}=i;if(a){if(!e.options.mutationKey)return!1;if(t){if(Hr(e.options.mutationKey)!==Hr(a))return!1}else if(!Lo(e.options.mutationKey,a))return!1}return!(s&&e.state.status!==s||n&&!n(e))}function om(i,e){return(e?.queryKeyHashFn||Hr)(i)}function Hr(i){return JSON.stringify(i,(e,t)=>pp(t)?Object.keys(t).sort().reduce((s,n)=>(s[n]=t[n],s),{}):t)}function Lo(i,e){if(i===e)return!0;if(typeof i!=typeof e)return!1;if(i&&e&&typeof i=="object"&&typeof e=="object"){if(Array.isArray(i)&&Array.isArray(e)){for(let s=0;s<e.length;s++)if(!Lo(i[s],e[s]))return!1;return!0}const t=Object.keys(e);for(const s of t)if(!Lo(i[s],e[s]))return!1;return!0}return!1}const hP=Object.prototype.hasOwnProperty;function lm(i,e,t=0){if(i===e)return i;if(t>500)return e;const s=dv(i)&&dv(e);if(!s&&!(pp(i)&&pp(e)))return e;const n=(s?i:Object.keys(i)).length,a=s?e:Object.keys(e),l=a.length,u=s?new Array(l):{};let h=0;for(let f=0;f<l;f++){const m=s?f:a[f],p=i[m],b=e[m];if(p===b){u[m]=p,(s?f<n:hP.call(i,m))&&h++;continue}if(p===null||b===null||typeof p!="object"||typeof b!="object"){u[m]=b;continue}const v=lm(p,b,t+1);u[m]=v,v===p&&h++}return n===l&&h===n?i:u}function ql(i,e){if(!e||Object.keys(i).length!==Object.keys(e).length)return!1;for(const t in i)if(i[t]!==e[t])return!1;return!0}function dv(i){return Array.isArray(i)&&i.length===Object.keys(i).length}function pp(i){if(!fv(i))return!1;const e=i.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!fv(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(i)!==Object.prototype)}function fv(i){return Object.prototype.toString.call(i)==="[object Object]"}function dP(i){return new Promise(e=>{ba.setTimeout(e,i)})}function mp(i,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(i,e):t.structuralSharing!==!1?lm(i,e):e}function fP(i,e,t=0){const s=[...i,e];return t&&s.length>t?s.slice(1):s}function _P(i,e,t=0){const s=[e,...i];return t&&s.length>t?s.slice(0,-1):s}const Fi=Symbol();function nE(i,e){return!i.queryFn&&e?.initialPromise?()=>e.initialPromise:!i.queryFn||i.queryFn===Fi?()=>Promise.reject(new Error(`Missing queryFn: '${i.queryHash}'`)):i.queryFn}function cm(i,e){return typeof i=="function"?i(...e):!!i}function pP(i,e,t){let s=!1,n;return Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(n??=e(),s||(s=!0,n.aborted?t():n.addEventListener("abort",t,{once:!0})),n)}),i}let mP=()=>cP;const um=()=>mP();var wa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(i){return this.listeners.add(i),this.onSubscribe(),()=>{this.listeners.delete(i),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gP=class extends wa{#t;#e;#s;constructor(){super(),this.#s=i=>{if(typeof window<"u"&&window.addEventListener){const e=()=>i();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(i){this.#s=i,this.#e?.(),this.#e=i(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(i){this.#t!==i&&(this.#t=i,this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(e=>{e(i)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}};const hm=new gP,yP=lP;function bP(){let i=[],e=0,t=u=>{u()},s=u=>{u()},n=yP;const a=u=>{e?i.push(u):n(()=>{t(u)})},l=()=>{const u=i;i=[],u.length&&n(()=>{s(()=>{u.forEach(h=>{t(h)})})})};return{batch:u=>{let h;e++;try{h=u()}finally{e--,e||l()}return h},batchCalls:u=>(...h)=>{a(()=>{u(...h)})},schedule:a,setNotifyFunction:u=>{t=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{n=u}}}const vs=bP();var xP=class extends wa{#t=!0;#e;#s;constructor(){super(),this.#s=i=>{if(typeof window<"u"&&window.addEventListener){const e=()=>i(!0),t=()=>i(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(i){this.#s=i,this.#e?.(),this.#e=i(this.setOnline.bind(this))}
18setOnline(i){this.#t!==i&&(this.#t=i,this.listeners.forEach(e=>{e(i)}))}isOnline(){return this.#t}};const Rh=new xP;function vP(i){return Math.min(1e3*2**i,3e4)}function rE(i){return(i??"online")==="online"?Rh.isOnline():!0}var gp=class extends Error{constructor(i){super("CancelledError"),this.revert=i?.revert,this.silent=i?.silent}};function aE(i){let e=!1,t=0,s,n="pending",a,l;const u=new Promise((A,D)=>{a=A,l=D});u.catch(Xs);const h=()=>n!=="pending",f=A=>{if(!h()){const D=new gp(A);x(D),i.onCancel?.(D)}},m=()=>{e=!0},p=()=>{e=!1},b=()=>hm.isFocused()&&(i.networkMode==="always"||Rh.isOnline())&&i.canRun(),v=()=>rE(i.networkMode)&&i.canRun(),R=A=>{h()||(s?.(),n="resolved",a(A))},x=A=>{h()||(s?.(),n="rejected",l(A))},T=()=>new Promise(A=>{s=D=>{(h()||b())&&A(D)},i.onPause?.()}).then(()=>{s=void 0,h()||i.onContinue?.()}),E=()=>{if(h())return;let A;const D=t===0?i.initialPromise:void 0;try{A=D??i.fn()}catch(M){A=Promise.reject(M)}Promise.resolve(A).then(R).catch(M=>{if(h())return;const k=i.retry??(um()?0:3),U=i.retryDelay??vP,N=typeof U=="function"?U(t,M):U,H=k===!0||typeof k=="number"&&t<k||typeof k=="function"&&k(t,M);if(e||!H){x(M);return}t++,i.onFail?.(t,M),dP(N).then(()=>b()?void 0:T()).then(()=>{e?x(M):E()})})};return{promise:u,status:()=>n,cancel:f,continue:()=>(s?.(),u),cancelRetry:m,continueRetry:p,canStart:v,start:()=>(v()?E():T().then(E),u)}}var oE=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sE(this.gcTime)&&(this.#t=ba.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(i){this.gcTime=Math.max(this.gcTime||0,i??(um()?1/0:3e5))}clearGcTimeout(){this.#t!==void 0&&(ba.clearTimeout(this.#t),this.#t=void 0)}};function RP(i){return{onFetch:(e,t)=>{const s=e.options,n=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],l=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},h=0;const f=async()=>{let m=!1;const p=R=>{pP(R,()=>e.signal,()=>m=!0)},b=nE(e.options,e.fetchOptions),v=async(R,x,T)=>{if(m)return Promise.reject(e.signal.reason);if(x==null&&R.pages.length)return Promise.resolve(R);const A=(()=>{const U={client:e.client,queryKey:e.queryKey,pageParam:x,direction:T?"backward":"forward",meta:e.options.meta};return p(U),U})(),D=await b(A),{maxPages:M}=e.options,k=T?_P:fP;return{pages:k(R.pages,D,M),pageParams:k(R.pageParams,x,M)}};if(n&&a.length){const R=n==="backward",x=R?lE:yp,T={pages:a,pageParams:l};u=await v(T,x(s,T),R)}else{const R=i??a.length;do{const x=h===0?l[0]??s.initialPageParam:yp(s,u);if(h>0&&x==null)break;u=await v(u,x),h++}while(h<R)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t):e.fetchFn=f}}}function yp(i,{pages:e,pageParams:t}){const s=e.length-1;return e.length>0?i.getNextPageParam(e[s],e,t[s],t):void 0}function lE(i,{pages:e,pageParams:t}){return e.length>0?i.getPreviousPageParam?.(e[0],e,t[0],t):void 0}function TP(i,e){return e?yp(i,e)!=null:!1}function EP(i,e){return!e||!i.getPreviousPageParam?!1:lE(i,e)!=null}var SP=class extends oE{#t;#e;#s;#i;#n;#r;#a;#l;constructor(i){super(),this.#l=!1,this.#a=i.defaultOptions,this.setOptions(i.options),this.observers=[],this.#n=i.client,this.#i=this.#n.getQueryCache(),this.queryKey=i.queryKey,this.queryHash=i.queryHash,this.#e=pv(this.options),this.state=i.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#r?.promise}setOptions(i){if(this.options={...this.#a,...i},i?._type&&(this.#t=i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=pv(this.options);e.data!==void 0&&(this.setState(_v(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(i,e){const t=mp(this.state.data,i,this.options);return this.#o({data:t,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),t}setState(i){this.#o({type:"setState",state:i})}cancel(i){const e=this.#r?.promise;return this.#r?.cancel(i),e?e.then(Xs).catch(Xs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>xs(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdate
vendor: 4,710 bytes, line 18
18Count>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>xs(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!iE(this.state.dataUpdatedAt,i)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){const e=this.observers.indexOf(i);e!==-1&&(this.observers.splice(e,1),this.observers.length||(this.#r&&(this.#l||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(i,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(i&&this.setOptions(i),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const t=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#l=!0,t.signal)})},n=()=>{const h=nE(this.options,e),m=(()=>{const p={client:this.#n,queryKey:this.queryKey,meta:this.meta};return s(p),p})();return this.#l=!1,this.options.persister?this.options.persister(h,m,this):h(m)},l=(()=>{const h={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#n,state:this.state,fetchFn:n};return s(h),h})();(this.#t==="infinite"?RP(this.options.pages):this.options.behavior)?.onFetch(l,this),this.#s=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#o({type:"fetch",meta:l.fetchOptions?.meta});const u=this.#r=aE({initialPromise:e?.initialPromise,fn:l.fetchFn,onCancel:h=>{h instanceof gp&&h.revert&&this.setState({...this.#s,fetchStatus:"idle"}),t.abort()},onFail:(h,f)=>{this.#o({type:"failed",failureCount:h,error:f})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const h=await u.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#i.config.onSuccess?.(h,this),this.#i.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof gp){if(h.silent)return this.#r.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#o({type:"error",error:h}),this.#i.config.onError?.(h,this),this.#i.config.onSettled?.(this.state.data,h,this),h}finally{this.#r===u&&(this.#r=void 0),this.scheduleGc()}}#o(i){const e=t=>{switch(i.type){case"failed":return{...t,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...cE(t.data,this.options),fetchMeta:i.meta??null};case"success":const s={...t,..._v(i.data,i.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#s=i.manual?s:void 0,s;case"error":const n=i.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...i.state}}};this.state=e(this.state),vs.batch(()=>{this.observers.slice().forEach(t=>{t.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:i})})}};function cE(i,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rE(e.networkMode)?"fetching":"paused",...i===void 0&&{error:null,status:"pending"}}}function _v(i,e){return{data:i,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pv(i){const e=typeof i.initialData=="function"?i.initialData():i.initialData,t=e!==void 0,s=t?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?s??Date.now():0,error:null,errorUpdate
18Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var xc=class extends wa{#t;#e=void 0;#s=void 0;#i=void 0;#n;#r;#a;#l;#o;#f;#c;#u;#h;#_=new Set;constructor(i,e){super(),this.options=e,this.#t=i,this.#a=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),mv(this.#e,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bp(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bp(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#v(),this.#e.removeObserver(this)}setOptions(i){const e=this.options,t=this.#e;if(this.options=this.#t.defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xs(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#R(),this.#e.setOptions(this.options),e._defaulted&&!ql(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&gv(this.#e,t,this.options,e)&&this.#d(),this.updateResult(),s&&(this.#e!==t||xs(this.options.enabled,this.#e)!==xs(e.enabled,this.#e)||xs(this.options.staleTime,this.#e)!==xs(e.staleTime,this.#e))&&this.#m();const n=this.#g();s&&(this.#e!==t||xs(this.options.enabled,this.#e)!==xs(e.enabled,this.#e)||n!==this.#h)&&this.#y(n)}getOptimisticResult(i){const e=this.#t.getQueryCache().build(this.#t,i),t=this.createResult(e,i);return ql(this.getCurrentResult(),t)||(this.#i=t,this.#r=this.options,this.#n=this.#e.state),t}getCurrentResult(){return this.#i}trackResult(i,e){return new Proxy(i,{get:(t,s)=>(this.trackProp(s),e?.(s),Reflect.get(t,s))})}trackProp(i){this.#_.add(i)}getCurrentQuery(){return this.#e}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const e=this.#t.defaultQueryOptions(i),t=this.#t.getQueryCache().build(this.#t,e);let s=()=>{},n;const a=new Promise(l=>{n=l,s=this.#t.getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===t.queryHash&&t.state.data!==void 0&&(s(),l(this.createResult(t,e)))})});return Promise.race([t.fetch().then(()=>{const l=this.createResult(t,e);return n?.(l),l}).finally(()=>{s()}),a])}fetch(i){return this.#d({...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(i){this.#R();let e=this.#e.fetch(this.options,i);return i?.throwOnError||(e=e.catch(Xs)),e}#p(i){return!um()&&xs(this.options.enabled,this.#e)!==!1&&sE(i)}#m(){this.#x();const i=xs(this.options.staleTime,this.#e);if(this.#i.isStale||!this.#p(i))return;const e=iE(this.#i.dataUpdatedAt,i)+1;this.#c=ba.setTimeout(()=>{this.#i.isStale||this.updateResult()},e)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(i){this.#v(),this.#h=i,!(this.#h===0||!this.#p(this.#h))&&(this.#u=ba.setInterval(()=>{(this.options.refetchIntervalInBackground||hm.isFocused())&&this.#d()},this.#h))}#b(){this.#m(),this.#y(this.#g())}#x(){this.#c!==void 0&&(ba.clearTimeout(this.#c),this.#c=void 0)}#v(){this.#u!==void 0&&(ba.clearInterval(this.#u),this.#u=void 0)}createResult(i,e){const t=this.#e,s=this.options,n=this.#i,a=this.#n,l=this.#r,u=i!==t?i.state:this.#s,{state:h}=i;let f={...h},m=!1,p;if(e._optimisticResults){const k=this.hasListeners(),U=!k&&mv(i,e),N=k&&gv(i,t,e,s);(U||N)&&(f={...f,...cE(h.data,i.options)}),e._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:R}=f;p=f.data;let x=!1;if(e.placeholderData!==void 0&&p===void 0&&R==="pending"){let k;n?.isPlaceholderData&&e.placeholderData===l?.placeholderData?(k=n.data,x=!0):k=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,k!==void 0&&(R="success",p=mp(n?.data,k,e),m=!0)}if(e.select&&p!==void 0&&!x)if(n&&p===a?.data&&e.select===this.#l)p=this.#o;else try{this.#l=e.select,p=e.select(p),p=mp(n?.data,p,e),this.#o=p,this.#a=null}catch(k){this.#a=k}else p===void 0&&(this.#a=null);this.#a&&(b=this.#a,p=this.#o,v=Date.now(),R="error",m=!1);const T=f.fetchStatus==="fetching",E=R==="pending",A=R==="error",D=E&&T,M=p!==void 0;return{status:R,fetchStatus:f.fetchStatus,isPending:E,isSuccess:R==="success",isError:A,isInitialLoading:D,isLoading:D,data:p,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdate
18Count:f.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:T,isRefetching:T&&!E,isLoadingError:A&&!M,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:A&&M,isStale:dm(i,e),refetch:this.refetch,isEnabled:xs(e.enabled,i)!==!1}}updateResult(){const i=this.#i,e=this.createResult(this.#e,this.options);if(this.#n=this.#e.state,this.#r=this.options,this.#n.data!==void 0&&(this.#f=this.#e),ql(e,i))return;this.#i=e;const s=(()=>{if(!i)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!this.#_.size)return!0;const l=new Set(a??this.#_);return this.options.throwOnError&&l.add("error"),Object.keys(this.#i).some(u=>{const h=u;return this.#i[h]!==i[h]&&l.has(h)})})();vs.batch(()=>{s&&this.listeners.forEach(n=>{n(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}#R(){const i=this.#t.getQueryCache().build(this.#t,this.options);if(i===this.#e)return;const e=this.#e;this.#e=i,this.#s=i.state,this.hasListeners()&&(e?.removeObserver(this),i.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}};function CP(i,e){return xs(e.enabled,i)!==!1&&i.state.data===void 0&&!(i.state.status==="error"&&xs(e.retryOnMount,i)===!1)}function mv(i,e){return CP(i,e)||i.state.data!==void 0&&bp(i,e,e.refetchOnMount)}function bp(i,e,t){if(xs(e.enabled,i)!==!1&&xs(e.staleTime,i)!=="static"){const s=typeof t=="function"?t(i):t;return s==="always"||s!==!1&&dm(i,e)}return!1}function gv(i,e,t,s){return(i!==e||xs(s.enabled,i)===!1)&&(!t.suspense||i.state.status!=="error")&&dm(i,t)}function dm(i,e){return xs(e.enabled,i)!==!1&&i.isStaleByTime(xs(e.staleTime,i))}var uE=class extends xc{constructor(i,e){super(i,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(i){i._type="infinite",super.setOptions(i)}getOptimisticResult(i){return i._type="infinite",super.getOptimisticResult(i)}fetchNextPage(i){return this.fetch({...i,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(i){return this.fetch({...i,meta:{fetchMore:{direction:"backward"}}})}createResult(i,e){const{state:t}=i,s=super.createResult(i,e),{isFetching:n,isRefetching:a,isError:l,isRefetchError:u}=s,h=t.fetchMeta?.fetchMore?.direction,f=l&&h==="forward",m=n&&h==="forward",p=l&&h==="backward",b=n&&h==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:TP(e,t.data),hasPreviousPage:EP(e,t.data),isFetchNextPageError:f,isFetchingNextPage:m,isFetchPreviousPageError:p,isFetchingPreviousPage:b,isRefetchError:u&&!f&&!p,isRefetching:a&&!m&&!b}}},AP=class extends oE{#t;#e;#s;#i;constructor(i){super(),this.#t=i.client,this.mutationId=i.mutationId,this.#s=i.mutationCache,this.#e=[],this.state=i.state||hE(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){this.#e.includes(i)||(this.#e.push(i),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){this.#e=this.#e.filter(e=>e!==i),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(i){const e=()=>{this.#n({type:"continue"})},t={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey},s=this.#i=aE({fn:()=>this.options.mutationFn?this.options.mutationFn(i,t):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#n({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#n({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>
vendor: 2,934 bytes, line 18
18this.#s.canRun(this)}),n=this.state.status==="pending",a=!s.canStart();try{if(n)e();else{this.#n({type:"pending",variables:i,isPaused:a}),this.#s.config.onMutate&&await this.#s.config.onMutate(i,this,t);const u=await this.options.onMutate?.(i,t);u!==this.state.context&&this.#n({type:"pending",context:u,variables:i,isPaused:a})}const l=await s.start();return await this.#s.config.onSuccess?.(l,i,this.state.context,this,t),await this.options.onSuccess?.(l,i,this.state.context,t),await this.#s.config.onSettled?.(l,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(l,null,i,this.state.context,t),this.#n({type:"success",data:l}),l}catch(l){try{await this.#s.config.onError?.(l,i,this.state.context,this,t)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,i,this.state.context,t)}catch(u){Promise.reject(u)}try{await this.#s.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,t)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,i,this.state.context,t)}catch(u){Promise.reject(u)}throw this.#n({type:"error",error:l}),l}finally{this.#i===s&&(this.#i=void 0),this.#s.runNext(this)}}#n(i){const e=t=>{switch(i.type){case"failed":return{...t,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...t,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:i.error,failureCount:t.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=e(this.state),vs.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(i)}),this.#s.notify({mutation:this,type:"updated",action:i})})}};function hE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var MP=class extends wa{#t;#e;#s;constructor(i={}){super(),this.config=i,this.#t=new Set,this.#e=new Map,this.#s=0}build(i,e,t){const s=new AP({client:i,mutationCache:this,mutationId:++this.#s,options:i.defaultMutationOptions(e),state:t});return this.add(s),s}add(i){this.#t.add(i);const e=qu(i);if(typeof e=="string"){const t=this.#e.get(e);t?t.push(i):this.#e.set(e,[i])}this.notify({type:"added",mutation:i})}remove(i){if(this.#t.delete(i)){const e=qu(i);if(typeof e=="string"){const t=this.#e.get(e);if(t)if(t.length>1){const s=t.indexOf(i);s!==-1&&t.splice(s,1)}else t[0]===i&&this.#e.delete(e)}}this.notify({type:"removed",mutation:i})}canRun(i){const e=qu(i);if(typeof e=="string"){const t=this.#e.get(e)?.find(s=>s.state.status==="pending");return!t||t===i}else return!0}runNext(i){const e=qu(i);return typeof e=="string"?this.#e.get(e)?.find(t=>
18t!==i&&t.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){vs.batch(()=>{this.#t.forEach(i=>{this.notify({type:"removed",mutation:i})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(i){const e={exact:!0,...i};return this.getAll().find(t=>hv(e,t))}findAll(i={}){return this.getAll().filter(e=>hv(i,e))}notify(i){vs.batch(()=>{this.listeners.forEach(e=>{e(i)})})}resumePausedMutations(){const i=this.getAll().filter(e=>e.state.isPaused);return vs.batch(()=>Promise.all(i.map(e=>e.continue().catch(Xs))))}};function qu(i){return i.options.scope?.id}var wP=class extends wa{#t;#e=void 0;#s;#i;constructor(e,t){super(),this.#t=e,this.setOptions(t),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#t.defaultMutationOptions(e),ql(this.options,t)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),t?.mutationKey&&this.options.mutationKey&&Hr(t.mutationKey)!==Hr(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#s&&(this.#s.addObserver(this),this.#n())}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#r(e)}getCurrentResult(){return this.#e}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#r()}mutate(e,t){return this.#i=t,this.#s?.removeObserver(this),this.#s=this.#t.getMutationCache().build(this.#t,this.options),this.#s.addObserver(this),this.#s.execute(e)}#n(){const e=this.#s?.state??hE();this.#e={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#r(e){vs.batch(()=>{if(this.#i&&this.hasListeners()){const t=this.#e.variables,s=this.#e.context,n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#i.onSuccess?.(e.data,t,s,n)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(e.data,null,t,s,n)}catch(a){Promise.reject(a)}}else if(e?.type==="error"){try{this.#i.onError?.(e.error,t,s,n)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,e.error,t,s,n)}catch(a){Promise.reject(a)}}}this.listeners.forEach(t=>{t(this.#e)})})}};function yv(i,e){const t=new Set(e);return i.filter(s=>!t.has(s))}var PP=class extends wa{#t;#e;#s;#i;#n;#r;#a;#l;#o;#f=[];constructor(i,e,t){super(),this.#t=i,this.#i=t,this.#s=[],this.#n=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(i=>{i.subscribe(e=>{this.#d(i,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(i=>{i.destroy()})}setQueries(i,e){this.#s=i,this.#i=e,vs.batch(()=>{const t=this.#n,s=this.#_(this.#s);s.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=s.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),l=t.length!==n.length,u=n.some((m,p)=>m!==t[p]),h=l||u,f=h?!0:a.some((m,p)=>{const b=this.#e[p];return!b||!ql(m,b)});!h&&!f||(h&&(this.#f=s,this.#n=n),this.#e=a,this.hasListeners()&&(h&&(yv(t,n).forEach(m=>{m.destroy()}),yv(n,t).forEach(m=>{m.subscribe(p=>{this.#d(m,p)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#n.map(i=>i.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(i,e){const t=this.#_(i),s=t.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=t.map(a=>a.defaultedQueryOptions.queryHash);return[s,a=>this.#u(a??s,e,n),()=>this.#c(s,t)]}#c(i,e){const t=new Set;return e.map((s,n)=>{const a=i[n];return s.defaultedQueryOptions.notifyOnChangeProps?a:s.observer.trackResult(a,l=>{t.has(l)||(t.add(l),e.forEach(u=>{u.observer.trackProp(l)}))})})}#u(i,e,t){if(e){const s=this.#o,n=t!==void 0&&s!==void 0&&(s.length!==t.length||t.some((a,l)=>a!==s[l]));return(this.#e!==this.#l||n||e!==this.#a)&&(this.#a=e,this.#l=this.#e,t!==void 0&&(this.#o=t),this.#r=lm(this.#r,e(i))),this.#r}return i}#h(){return!this.#i?.combine||this.#n.some((i,e)=>i.options.suspense&&this.#e[e]?.data===void 0)}#_(i){const e=new Map;
18this.#n.forEach(s=>{const n=s.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(s):e.set(n,[s])});const t=[];return i.forEach(s=>{const n=this.#t.defaultQueryOptions(s),a=e.get(n.queryHash)?.shift()??new xc(this.#t,n);t.push({defaultedQueryOptions:n,observer:a})}),t}#d(i,e){const t=this.#n.indexOf(i);t!==-1&&(this.#e=this.#e.slice(),this.#e[t]=e,this.#p())}#p(){if(this.hasListeners()){const i=this.#h(),e=this.#r,t=i?e:this.#u(this.#c(this.#e,this.#f),this.#i?.combine);(i||e!==t)&&vs.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},OP=class extends wa{#t;constructor(i={}){super(),this.config=i,this.#t=new Map}build(i,e,t){const s=e.queryKey,n=e.queryHash??om(s,e);let a=this.get(n);return a||(a=new SP({client:i,queryKey:s,queryHash:n,options:i.defaultQueryOptions(e),state:t,defaultOptions:i.getQueryDefaults(s)}),this.add(a)),a}add(i){this.#t.has(i.queryHash)||(this.#t.set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const e=this.#t.get(i.queryHash);e&&(i.destroy(),e===i&&this.#t.delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){vs.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return this.#t.get(i)}getAll(){return[...this.#t.values()]}find(i){const e={exact:!0,...i};return this.getAll().find(t=>uv(e,t))}findAll(i={}){const e=this.getAll();return Object.keys(i).length>0?e.filter(t=>uv(i,t)):e}notify(i){vs.batch(()=>{this.listeners.forEach(e=>{e(i)})})}onFocus(){vs.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){vs.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},DP=class{#t;#e;#s;#i;#n;#r;#a;#l;constructor(i={}){this.#t=i.queryCache||new OP,this.#e=i.mutationCache||new MP,this.#s=i.defaultOptions||{},this.#i=new Map,this.#n=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#a=hm.subscribe(async i=>{i&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#l=Rh.subscribe(async i=>{i&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#a?.(),this.#a=void 0,this.#l?.(),this.#l=void 0)}isFetching(i){return this.#t.findAll({...i,fetchStatus:"fetching"}).length}isMutating(i){return this.#e.findAll({...i,status:"pending"}).length}getQueryData(i){const e=this.defaultQueryOptions({queryKey:i});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(i){const e=this.defaultQueryOptions(i),t=this.#t.build(this,e),s=t.state.data;return s===void 0?this.fetchQuery(i):(i.revalidateIfStale&&t.isStaleByTime(xs(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(i){return this.#t.findAll(i).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(i,e,t){const s=this.defaultQueryOptions({queryKey:i}),n=this.#t.get(s.queryHash)?.state.data,a=uP(e,n);if(a!==void 0)return this.#t.build(this,s).setData(a,{...t,manual:!0})}setQueriesData(i,e,t){return vs.batch(()=>this.#t.findAll(i).map(({queryKey:s})=>[s,this.setQueryData(s,e,t)]))}getQueryState(i){const e=this.defaultQueryOptions({queryKey:i});return this.#t.get(e.queryHash)?.state}removeQueries(i){const e=this.#t;vs.batch(()=>{e.findAll(i).forEach(t=>{e.remove(t)})})}resetQueries(i,e){const t=this.#t;return vs.batch(()=>{const s=t.findAll(i),n=new Set(s);return s.forEach(a=>{a.reset()}),this.refetchQueries({type:"active",predicate:a=>n.has(a)},e)})}cancelQueries(i,e={}){const t={revert:!0,...e},s=vs.batch(()=>this.#t.findAll(i).map(n=>n.cancel(t)));return Promise.all(s).then(Xs).catch(Xs)}invalidateQueries(i,e={}){return vs.batch(()=>(this.#t.findAll(i).forEach(t=>{t.invalidate()}),i?.refetchType==="none"?Promise.resolve():this.refetchQueries({...i,type:i?.refetchType??i?.type??"active"},e)))}refetchQueries(i,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},s=vs.batch(()=>this.#t.findAll(i).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,t);return t.throwOnError||(a=a.catch(Xs)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Xs)}async query(i){const e=this.defaultQueryOptions(i);e.retry===void 0&&(e.retry=!1);const t=this.#t.build(this,e),s=t.isStaleByTime(xs(e.staleTime,t))?await t.fetch(e):t.state.data,n=e.select;return n?n(s):s}fetchQuery(i){const e=this.defaultQueryOptions(i);e.retry===void 0&&(e.retry=!1);const t=this.#t.build(this,e);return t.isStaleByTime(xs(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(i){return this.fetchQuery(i).then(Xs).catch(Xs)}infiniteQuery(i){return i._type="infinite",this.query(i)}fetchInfiniteQuery(i){return i._type="infinite",this.fetchQuery(i)}prefetchInfiniteQuery(i){return this.fetchInfiniteQuery(i).then(Xs).catch(Xs)}ensureInfiniteQueryData(i){return i._type="infinite",this.ensureQueryData(i)}resumePausedMutations(){return Rh.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#s}setDefaultOptions(i){this.#s=i}setQueryDefaults(i,e){this.#i.set(Hr(i),{queryKey:i,defaultOptions:e})}getQueryDefaults(i){const e=[...this.#i.values()],t={};return e.forEach(s=>{Lo(i,s.queryKey)&&Object.assign(t,s.defaultOptions)}),t}setMutationDefaults(i,e){this.#n.set(Hr(i),{mutationKey:i,defaultOptions:e})}getMutationDefaults(i){const e=[...this.#n.values()],t={};return e.forEach(s=>{Lo(i,s.mutationKey)&&Object.assign(t,s.defaultOptions)}),t}defaultQueryOptions(i){if(i._defaulted)return i;const e={...this.#s.queries,...this.getQueryDefaults(i.queryKey),...i,_defaulted:!0};return e.queryHash||(e.queryHash=om(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Fi&&(e.enabled=!1),e}defaultMutationOptions(i){return i?._defaulted?i:{...this.#s.mutations,...i?.mutationKey&&this.getMutationDefaults(i.mutationKey),...i,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}};const dE=C.createContext(!1),fE=()=>C.useContext(dE);dE.Provider;function IP(){let i=!1;return{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i}}const FP=C.createContext(IP()),_E=()=>C.useContext(FP),pE=(i,e,t)=>{const s=t?.state.error&&typeof i.throwOnError=="function"?cm(i.throwOnError,[t.state.error,t]):i.throwOnError;(i.suspense||s)&&(e.isReset()||(i.retryOnMount=!1))},mE=i=>{C.useEffect(()=>{i.clearReset()},[i])},gE=({result:i,errorResetBoundary:e,throwOnError:t,query:s,suspense:n})=>i.isError&&!e.isReset()&&!i.isFetching&&s&&(n&&i.data===void 0||cm(t,[i.error,s])),fm=(i,e)=>e.state.data===void 0,yE=i=>{if(i.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),s=i.staleTime;i.staleTime=typeof s=="function"?(...n)=>t(s(...n)):t(s),typeof i.gcTime=="number"&&(i.gcTime=Math.max(i.gcTime,1e3))}},xp=(i,e)=>i?.suspense&&e.isPending,bE=(i,e,t)=>e.fetchOptimistic(i).catch(()=>{t.clearReset()});function xE({queries:i,...e},t){const s=bc(t),n=fE(),a=_E(),l=e.subscribed!==!1,u=C.useMemo(()=>i.map(x=>{const T=s.defaultQueryOptions(x);return T._optimisticResults=n?"isRestoring":l?"optimistic":void 0,T}),[i,s,n,l]);u.forEach(x=>{yE(x);const T=s.getQueryCache().get(x.queryHash);pE(x,a,T)}),mE(a);const[h]=C.useState(()=>new PP(s,u,e)),[f,m,p]=h.getOptimisticResult(u,e.combine),b=!n&&l;C.useSyncExternalStore(C.useCallback(x=>b?h.subscribe(vs.batchCalls(x)):Xs,[h,b]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),C.useEffect(()=>{h.setQueries(u,e)},[u,e,h]);const v=f.some((x,T)=>xp(u[T],x))?f.flatMap((x,T)=>{const E=u[T];if(E&&xp(E,x)){const A=new xc(s,E);return bE(E,A,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const R=f.find((x,T)=>{const E=u[T];return E&&gE({result:x,errorResetBoundary:a,throwOnError:E.throwOnError,query:s.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(R)throw R.error;return m(p())}function Yh(i,e,t){const s=fE(),n=_E(),a=bc(t),l=a.defaultQueryOptions(i),u=a.getQueryCache().get(l.queryHash),h=i.subscribed!==!1;l._optimisticResults=s?"isRestoring":h?"optimistic":void 0,yE(l),pE(l,n,u),mE(n);const[f]=C.useState(()=>new e(a,l)),m=f.getOptimisticResult(l),p=!s&&h;
18if(C.useSyncExternalStore(C.useCallback(b=>{const v=p?f.subscribe(vs.batchCalls(b)):Xs;return f.updateResult(),v},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),C.useEffect(()=>{f.setOptions(l)},[l,f]),xp(l,m))throw bE(l,f,n);if(gE({result:m,errorResetBoundary:n,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw m.error;return l.notifyOnChangeProps?m:f.trackResult(m)}function kP(i,e){return Yh(i,xc,e)}function LP(i,e){return Yh({...i,enabled:!0,suspense:!0,throwOnError:fm,placeholderData:void 0},xc,e)}function BP(i,e){return Yh({...i,enabled:!0,suspense:!0,throwOnError:fm,placeholderData:void 0},uE,e)}function NP(i,e){return xE({...i,queries:i.queries.map(t=>({...t,suspense:!0,throwOnError:fm,enabled:!0,placeholderData:void 0}))},e)}function UP(i,e){const t=bc(e);t.getQueryState(i.queryKey)||t.query(i).catch(Xs)}function jP(i,e){const t=bc(e);t.getQueryState(i.queryKey)||t.infiniteQuery(i).catch(Xs)}function GP(i,e){const t=bc(e),[s]=C.useState(()=>new wP(t,i));C.useEffect(()=>{s.setOptions(i)},[s,i]);const n=C.useSyncExternalStore(C.useCallback(l=>s.subscribe(vs.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=C.useCallback((...l)=>{s.mutate(l[0],l[1]).catch(Xs)},[s]);if(n.error&&cm(s.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}function zP(i,e){return Yh(i,uE,e)}function Ca(i){return!!i&&!Array.isArray(i)&&typeof i=="object"}function HP(){return Object.create(null)}const VP=typeof Symbol=="function"&&!!Symbol.asyncIterator;function vE(i){return VP&&Ca(i)&&Symbol.asyncIterator in i}var XP=Object.create,RE=Object.defineProperty,qP=Object.getOwnPropertyDescriptor,TE=Object.getOwnPropertyNames,WP=Object.getPrototypeOf,YP=Object.prototype.hasOwnProperty,vc=(i,e)=>function(){return e||(0,i[TE(i)[0]])((e={exports:{}}).exports,e),e.exports},KP=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=TE(e),a=0,l=n.length,u;a<l;a++)u=n[a],!YP.call(i,u)&&u!==t&&RE(i,u,{get:(h=>e[h]).bind(null,u),enumerable:!(s=qP(e,u))||s.enumerable});return i},Kh=(i,e,t)=>(t=i!=null?XP(WP(i)):{},KP(RE(t,"default",{value:i,enumerable:!0}),i));const EE=()=>{},bv=i=>{Object.freeze&&Object.freeze(i)};function SE(i,e,t){var s;const n=e.join(".");return(s=t[n])!==null&&s!==void 0||(t[n]=new Proxy(EE,{get(a,l){if(!(typeof l!="string"||l==="then"))return SE(i,[...e,l],t)},apply(a,l,u){const h=e[e.length-1];if(h==="valueOf"||h==="toString"||h==="toJSON")return`tRPC.proxy(${e.slice(0,-1).join(".")})`;let f={args:u,path:e};
18return h==="call"?f={args:u.length>=2?[u[1]]:[],path:e.slice(0,-1)}:h==="apply"&&(f={args:u.length>=2?u[1]:[],path:e.slice(0,-1)}),bv(f.args),bv(f.path),i(f)}})),t[n]}const Zh=i=>SE(i,[],HP()),_m=i=>new Proxy(EE,{get(e,t){if(t!=="then")return i(t)}});var CE=vc({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(i,e){function t(s){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}}),ZP=vc({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(i,e){var t=CE().default;function s(n,a){if(t(n)!="object"||!n)return n;var l=n[Symbol.toPrimitive];if(l!==void 0){var u=l.call(n,a||"default");if(t(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(n)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),QP=vc({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(i,e){var t=CE().default,s=ZP();function n(a){var l=s(a,"string");return t(l)=="symbol"?l:l+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),AE=vc({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(i,e){var t=QP();function s(n,a,l){return(a=t(a))in n?Object.defineProperty(n,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[a]=l,n}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),pm=vc({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(i,e){var t=AE();function s(a,l){var u=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(a,f).enumerable})),u.push.apply(u,h)}return u}function n(a){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){t(a,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(u,h))})}return a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});Kh(pm());Kh(AE());var Wu=Kh(pm());function $P(i,e){if("error"in i){const s=e.deserialize(i.error);return{ok:!1,error:(0,Wu.default)((0,Wu.default)({},i),{},{error:s})}}return{ok:!0,result:(0,Wu.default)((0,Wu.default)({},i.result),(!i.result.type||i.result.type==="data")&&{type:"data",data:e.deserialize(i.result.data)})}}var k_=class extends Error{constructor(){super("Unable to transform response from server")}};function JP(i,e){let t;try{t=$P(i,e)}catch{throw new k_}if(!t.ok&&(!Ca(t.error.error)||typeof t.error.error.code!="number"))throw new k_;if(t.ok&&!Ca(t.result))throw new k_;return t}Kh(pm());function Qh(i){const e={subscribe(t){let s=null,n=!1,a=!1,l=!1;function u(){if(s===null){l=!0;return}a||(a=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=i({next(h){var f;n||(f=t.next)===null||f===void 0||f.call(t,h)},error(h){var f;n||(n=!0,(f=t.error)===null||f===void 0||f.call(t,h),u())},complete(){var h;n||(n=!0,(h=t.complete)===null||h===void 0||h.call(t),u())}}),l&&u(),{unsubscribe:u}},pipe(...t){return t.reduce(eO,e)}};return e}function eO(i,e){return e(i)}function tO(i){const e=new AbortController;return new Promise((s,n)=>{let a=!1;function l(){a||(a=!0,u.unsubscribe())}e.signal.addEventListener("abort",()=>{n(e.signal.reason)});const u=i.subscribe({next(h){a=!0,s(h),l()},error(h){n(h)},complete(){e.abort(),l()}})})}var sO=Object.create,ME=Object.defineProperty,iO=Object.getOwnPropertyDescriptor,wE=Object.getOwnPropertyNames,nO=Object.getPrototypeOf,rO=Object.prototype.hasOwnProperty,Yr=(i,e)=>function(){return e||(0,i[wE(i)[0]])((e={exports:{}}).exports,e),e.exports},aO=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=wE(e),a=0,l=n.length,u;a<l;a++)u=n[a],!rO.call(i,u)&&u!==t&&ME(i,u,{get:(h=>e[h]).bind(null,u),enumerable:!(s=iO(e,u))||s.enumerable});return i},Pa=(i,e,t)=>(t=i!=null?sO(nO(i)):{},aO(e||!i||!i.__esModule?ME(t,"default",{value:i,enumerable:!0}):t,i)),oO=Yr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(i,e){function t(s,n){if
18(s==null)return{};var a={};for(var l in s)if({}.hasOwnProperty.call(s,l)){if(n.includes(l))continue;a[l]=s[l]}return a}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}}),lO=Yr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(i,e){var t=oO();function s(n,a){if(n==null)return{};var l,u,h=t(n,a);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(n);for(u=0;u<f.length;u++)l=f[u],a.includes(l)||{}.propertyIsEnumerable.call(n,l)&&(h[l]=n[l])}return h}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),PE=Yr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(i,e){function t(s){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}}),cO=Yr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(i,e){var t=PE().default;function s(n,a){if(t(n)!="object"||!n)return n;var l=n[Symbol.toPrimitive];if(l!==void 0){var u=l.call(n,a||"default");if(t(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(n)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),uO=Yr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(i,e){var t=PE().default,s=cO();function n(a){var l=s(a,"string");return t(l)=="symbol"?l:l+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),hO=Yr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(i,e){var t=uO();function s(n,a,l){return(a=t(a))in n?Object.defineProperty(n,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[a]=l,n}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Rc=Yr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(i,e){var t=hO();function s(a,l){var u=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(a,f).enumerable})),u.push.apply(u,h)}return u}function n(a){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){t(a,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(u,h))})}return a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),dO=Pa(lO(),1),xv=Pa(Rc(),1);const fO=["cursor","direction"];function bn(i,e,t){const s=i.flatMap(n=>n.split("."));if(!e&&(!t||t==="any"))return s.length?[s]:[];if(t==="infinite"&&Ca(e)&&("direction"in e||"cursor"in e)){const{cursor:n,direction:a}=e,l=(0,dO.default)(e,fO);return[s,{input:l,type:"infinite"}]}return[s,(0,xv.default)((0,xv.default)({},typeof e<"u"&&e!==Fi&&{input:e}),t&&t!=="any"&&{type:t})]}function dh(i){return bn(i,void 0,"any")}var _O=Object.create,OE=Object.defineProperty,pO=Object.getOwnPropertyDescriptor,DE=Object.getOwnPropertyNames,mO=Object.getPrototypeOf,gO=Object.prototype.hasOwnProperty,On=(i,e)=>function(){return e||(0,i[DE(i)[0]])((e={exports:{}}).exports,e),e.exports},yO=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=DE(e),a=0,l=n.length,u;a<l;a++)u=n[a],!gO.call(i,u)&&u!==t&&OE(i,u,{get:(h=>e[h]).bind(null,u),enumerable:!(s=pO(e,u))||s.enumerable});return i},ws=(i,e,t)=>(t=i!=null?_O(mO(i)):{},yO(e||!i||!i.__esModule?OE(t,"default",{value:i,enumerable:!0}):t,i)),IE=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(i,e){function t(s){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}}),bO=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(i,e){var t=IE().default;function s(n,a){if(t(n)!="object"||!n)return n;var l=n[Symbol.toPrimitive];if(l!==void 0){var u=l.call(n,a||"default");if(t(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}
18return(a==="string"?String:Number)(n)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),xO=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(i,e){var t=IE().default,s=bO();function n(a){var l=s(a,"string");return t(l)=="symbol"?l:l+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Oa=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(i,e){var t=xO();function s(n,a,l){return(a=t(a))in n?Object.defineProperty(n,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[a]=l,n}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),ln=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(i,e){var t=Oa();function s(a,l){var u=Object.keys(a);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(a);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(a,f).enumerable})),u.push.apply(u,h)}return u}function n(a){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){t(a,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(u,h))})}return a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});function vO(i){return e=>{let t=0,s=null;const n=[];function a(){s||(s=e.subscribe({next(u){for(const f of n){var h;(h=f.next)===null||h===void 0||h.call(f,u)}},error(u){for(const f of n){var h;(h=f.error)===null||h===void 0||h.call(f,u)}},complete(){for(const h of n){var u;(u=h.complete)===null||u===void 0||u.call(h)}}}))}function l(){if(t===0&&s){const u=s;s=null,u.unsubscribe()}}return Qh(u=>(t++,n.push(u),a(),{unsubscribe(){t--,l();const h=n.findIndex(f=>f===u);h>-1&&n.splice(h,1)}}))}}function RO(i){let e=i;const t=[],s=l=>{e!==void 0&&l.next(e),t.push(l)},n=l=>{t.splice(t.indexOf(l),1)},a=Qh(l=>(s(l),()=>{n(l)}));return a.next=l=>{if(e!==l){e=l;for(const u of t)u.next(l)}},a.get=()=>e,a}function TO(i){return Qh(e=>{function t(n=0,a=i.op){const l=i.links[n];if(!l)throw new Error("No more links to execute - did you forget to add an ending link?");return l({op:a,next(h){return t(n+1,h)}})}return t().subscribe(e)})}var Yu=ws(Oa(),1),xo=ws(ln(),1);function EO(i){return i instanceof Bo}function SO(i){return Ca(i)&&Ca(i.error)&&typeof i.error.code=="number"&&typeof i.error.message=="string"}function CO(i,e){return typeof i=="string"?i:Ca(i)&&typeof i.message=="string"?i.message:e}
18var Bo=class fh extends Error{constructor(e,t){var s,n;const a=t?.cause;super(e,{cause:a}),(0,Yu.default)(this,"cause",void 0),(0,Yu.default)(this,"shape",void 0),(0,Yu.default)(this,"data",void 0),(0,Yu.default)(this,"meta",void 0),this.meta=t?.meta,this.cause=a,this.shape=t==null||(s=t.result)===null||s===void 0?void 0:s.error,this.data=t==null||(n=t.result)===null||n===void 0?void 0:n.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,fh.prototype)}static from(e,t={}){const s=e;return EO(s)?(t.meta&&(s.meta=(0,xo.default)((0,xo.default)({},s.meta),t.meta)),s):SO(s)?new fh(s.error.message,(0,xo.default)((0,xo.default)({},t),{},{result:s,cause:t.cause})):new fh(CO(s,"Unknown error"),(0,xo.default)((0,xo.default)({},t),{},{cause:s}))}};function AO(i){const e=i;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:t=>t,deserialize:t=>t},output:{serialize:t=>t,deserialize:t=>t}}}const vv=i=>typeof i=="function";function MO(i){if(i)return i;if(typeof window<"u"&&vv(window.fetch))return window.fetch;if(typeof globalThis<"u"&&vv(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Wl=ws(ln());function wO(i){return{url:i.url.toString(),fetch:i.fetch,transformer:AO(i.transformer),methodOverride:i.methodOverride}}function PO(i){const e={};for(let t=0;t<i.length;t++){const s=i[t];e[t]=s}return e}const OO={query:"GET",mutation:"POST",subscription:"PATCH"};function FE(i){return"input"in i?i.transformer.input.serialize(i.input):PO(i.inputs.map(e=>i.transformer.input.serialize(e)))}const kE=i=>{const e=i.url.split("?");let s=e[0].replace(/\/$/,"")+"/"+i.path;const n=[];if(e[1]&&n.push(e[1]),"inputs"in i&&n.push("batch=1"),i.type==="query"||i.type==="subscription"){const a=FE(i);a!==void 0&&i.methodOverride!=="POST"&&n.push(`input=${encodeURIComponent(JSON.stringify(a))}`)}return n.length&&(s+="?"+n.join("&")),s},DO=i=>{if(i.type==="query"&&i.methodOverride!=="POST")return;const e=FE(i);return e!==void 0?JSON.stringify(e):void 0},IO=i=>BO((0,Wl.default)((0,Wl.default)({},i),{},{contentTypeHeader:"application/json",getUrl:kE,getBody:DO}));var FO=class extends Error{constructor(){const i="AbortError";super(i),this.name=i,this.message=i}};const kO=i=>{var e;if(i?.aborted)throw(e=i.throwIfAborted)===null||e===void 0||e.call(i),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new FO};async function LO(i){var e,t;kO(i.signal);const s=i.getUrl(i),n=i.getBody(i),a=(e=i.methodOverride)!==null&&e!==void 0?e:OO[i.type],l=await(async()=>{const h=await i.headers();return Symbol.iterator in h?Object.fromEntries(h):h})(),u=(0,Wl.default)((0,Wl.default)((0,Wl.default)({},i.contentTypeHeader&&a!=="GET"?{"content-type":i.contentTypeHeader}:{}),i.trpcAcceptHeader?{[(t=i.trpcAcceptHeaderKey)!==null&&t!==void 0?t:"trpc-accept"]:i.trpcAcceptHeader}:void 0),l);return MO(i.fetch)(s,{method:a,signal:i.signal,body:n,headers:u})}async function BO(i){const e={},t=await LO(i);e.response=t;const s=await t.json();return e.responseJSON=s,{json:s,meta:e}}ws(ln(),1);const Rv=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Tv(i){let e=null,t=null;const s=()=>{clearTimeout(t),t=null,e=null};function n(u){const h=[[]];let f=0;for(;;){const b=u[f];if(!b)break;const v=h[h.length-1];if(b.aborted){var m;(m=b.reject)===null||m===void 0||m.call(b,new Error("Aborted")),f++;continue}if(i.validate(v.concat(b).map(x=>x.key))){v.push(b),f++;continue}if(v.length===0){var p;(p=b.reject)===null||p===void 0||p.call(b,new Error("Input is too big for a single dispatch")),f++;continue}h.push([])}return h}function a(){const u=n(e);s();for(const h of u){if(!h.length)continue;const f={items:h};for(const p of h)p.batch=f;i.fetch(f.items.map(p=>p.key)).then(async p=>{await Promise.all(p.map(async(v,R)=>{const x=f.items[R];try{var T;const A=await Promise.resolve(v);(T=x.resolve)===null||T===void 0||T.call(x,A)}catch(A){var E;(E=x.reject)===null||E===void 0||E.call(x,A)}x.batch=null,x.reject=null,x.resolve=null}));for(const v of f.items){var b;(b=v.reject)===null||b===void 0||b.call(v,new Error("Missing result")),v.batch=null}}).catch(p=>{for(const v of f.items){var b;(b=v.reject)===null||b===void 0||b.call(v,p),v.batch=null}})}}function l(u){var h;const f={aborted:!1,key:u,batch:null,resolve:Rv,reject:Rv},m=new Promise((p,b)=>{var v;f.reject=b,f.resolve=p,(v=e)!==null&&v!==void 0||(e=[]),e.push(f)});
18return(h=t)!==null&&h!==void 0||(t=setTimeout(a)),m}return{load:l}}function NO(...i){const e=new AbortController,t=i.length;let s=0;const n=()=>{++s===t&&e.abort()};for(const a of i)a?.aborted?n():a?.addEventListener("abort",n,{once:!0});return e.signal}var Ku=ws(ln(),1);function UO(i){var e,t;const s=wO(i),n=(e=i.maxURLLength)!==null&&e!==void 0?e:1/0,a=(t=i.maxItems)!==null&&t!==void 0?t:1/0;return()=>{const l=m=>({validate(p){if(n===1/0&&a===1/0)return!0;if(p.length>a)return!1;const b=p.map(x=>x.path).join(","),v=p.map(x=>x.input);return kE((0,Ku.default)((0,Ku.default)({},s),{},{type:m,path:b,inputs:v,signal:null})).length<=n},async fetch(p){const b=p.map(A=>A.path).join(","),v=p.map(A=>A.input),R=NO(...p.map(A=>A.signal)),x=await IO((0,Ku.default)((0,Ku.default)({},s),{},{path:b,inputs:v,type:m,headers(){return i.headers?typeof i.headers=="function"?i.headers({opList:p}):i.headers:{}},signal:R}));return(Array.isArray(x.json)?x.json:p.map(()=>x.json)).map(A=>({meta:x.meta,json:A}))}}),u=Tv(l("query")),h=Tv(l("mutation")),f={query:u,mutation:h};return({op:m})=>Qh(p=>{/* istanbul ignore if -- @preserve */if(m.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const v=f[m.type].load(m);let R;return v.then(x=>{R=x;const T=JP(x.json,s.transformer.output);if(!T.ok){p.error(Bo.from(T.error,{meta:x.meta}));return}p.next({context:x.meta,result:T.result}),p.complete()}).catch(x=>{p.error(Bo.from(x,{meta:R?.meta}))}),()=>{}})}}ws(ln(),1);const LE=(i,...e)=>typeof i=="function"?i(...e):i;ws(Oa(),1);function jO(){let i,e;return{promise:new Promise((s,n)=>{i=s,e=n}),resolve:i,reject:e}}async function GO(i){const e=await LE(i.url);if(!i.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function zO(i,e){const t={method:"connectionParams",data:await LE(i)};return e.encode(t)}ws(Oa(),1);var Br=ws(Oa(),1);function HO(i){const{promise:e,resolve:t,reject:s}=jO();return i.addEventListener("open",()=>{i.removeEventListener("error",s),t()}),i.addEventListener("error",s),e}function VO(i,{intervalMs:e,pongTimeoutMs:t}){let s,n;function a(){s=setTimeout(()=>{i.send("PING"),n=setTimeout(()=>{i.close()},t)},e)}function l(){clearTimeout(s),a()}function u(){clearTimeout(n),l()}i.addEventListener("open",a),i.addEventListener("message",({data:h})=>{clearTimeout(s),a(),h==="PONG"&&u()}),i.addEventListener("close",()=>{clearTimeout(s),clearTimeout(n)})}var XO=class vp{constructor(e){var t;if((0,Br.default)(this,"id",++vp.connectCount),(0,Br.default)(this,"WebSocketPonyfill",void 0),(0,Br.default)(this,"urlOptions",void 0),(0,Br.default)(this,"keepAliveOpts",void 0),(0,Br.default)(this,"encoder",void 0),(0,Br.default)(this,"wsObservable",RO(null)),(0,Br.default)(this,"openPromise",null),this.WebSocketPonyfill=(t=e.WebSocketPonyfill)!==null&&t!==void 0?t:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++vp.connectCount;const t=GO(e.urlOptions).then(s=>new e.WebSocketPonyfill(s));e.openPromise=t.then(async s=>{e.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:n}){n==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&VO(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await HO(s),e.urlOptions.connectionParams&&s.send(await zO(e.urlOptions.connectionParams,e.encoder))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var t;(t=e.ws)===null||t===void 0||t.close()}}};(0,Br.default)(XO,"connectCount",0);ws(Oa(),1);ws(ln(),1);var L_=ws(Oa(),1),Ev=ws(ln(),1),$h=class{constructor(i){(0,L_.default)(this,"links",void 0),(0,L_.default)(this,"runtime",void 0),(0,L_.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=i.links.map(e=>e(this.runtime))}$request(i){var e;return TO({links:this.links,op:(0,Ev.default)((0,Ev.default)({},i),{},{context:(e=i.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(vO())}async requestAsPromise(i){var e=this;try{const t=e.$request(i);return(await tO(t)).result.data}catch(t){throw Bo.from(t)}}query(i,e,t){return this.requestAsPromise({type:"query",path:i,input:e,context:t?.context,signal:t?.signal})}mutation(i,e,t){return this.requestAsPromise({type:"mutation",path:i,input:e,context:t?.context,signal:t?.signal})}subscription(i,e,t){return this.$request({type:"subscription",path:i,input:e,context:t.context,signal:t.signal}).subscribe({next(n){switch(n.result.type){case"state":{var a;(a=t.onConnectionStateChange)===null||a===void 0||a.call(t,n.result);break}case"started":{var l;(l=t.onStarted)===null||l===void 0||l.call(t,{context:n.context});break}case"stopped":{var u;(u=t.onStopped)===null||u===void 0||u.call(t);break}case"data":case void 0:{var h;(h=t.onData)===null||h===void 0||h.call(t,n.result.data);break}}},error(n){var a;(a=t.onError)===null||a===void 0||a.call(t,n)},complete(){var n;(n=t.onComplete)===null||n===void 0||n.call(t)}})}};const BE=Symbol.for("trpc_untypedClient"),qO={query:"query",mutate:"mutation",subscribe:"subscription"},WO=i=>qO[i];function NE(i){const e=Zh(({path:t,args:s})=>{const n=[...t],a=WO(n.pop()),l=n.join(".");return i[a](l,...s)});return _m(t=>t===BE?i:e[t])}function YO(i){const e=new $h(i);return NE(e)}function mm(i){return i[BE]}ws(ln(),1);ws(ln(),1);var KO=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(i,e){function t(n){var a,l,u,h=2;for(typeof Symbol<"u"&&(l=Symbol.asyncIterator,u=Symbol.iterator);h--;){if(l&&(a=n[l])!=null)return a.call(n);if(u&&(a=n[u])!=null)return new s(a.call(n));l="@@asyncIterator",u="@@iterator"}throw new TypeError("Object is not async iterable")}function s(n){function a(l){if(Object(l)!==l)return Promise.reject(new TypeError(l+" is not an object."));var u=l.done;return Promise.resolve(l.value).then(function(h){return{value:h,done:u}})}return s=function(u){this.s=u,this.n=u.next},s.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(u){var h=this.s.return;return h===void 0?Promise.resolve({value:u,done:!0}):a(h.apply(this.s,arguments))},throw:function(u){var h=this.s.return;return h===void 0?Promise.reject(u):a(h.apply(this.s,arguments))}},new s(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}});ws(KO(),1);ws(ln(),1);var ZO=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(i,e){function t(){var s=typeof SuppressedError=="function"?SuppressedError:function(u,h){var f=Error();return f.name="SuppressedError",f.error=u,f.suppressed=h,f},n={},a=[];function l(u,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(u)var f=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(f===void 0&&(f=h[Symbol.dispose||Symbol.for("Symbol.dispose")],u))var m=f;if(typeof f!="function")throw new TypeError("Object is not disposable.");m&&(f=function(){try{m.call(h)}catch(b){return Promise.reject(b)}}),a.push({v:h,d:f,a:u})}else u&&a.push({d:h,a:u});return h}return{e:n,u:l.bind(null,!1),a:l.bind(null,!0),d:function(){var h,f=this.e,m=0;function p(){for(;h=a.pop();)try{if(!h.a&&m===1)return m=0,a.push(h),Promise.resolve().then(p);if(h.d){var v=h.d.call(h.v);if(h.a)return m|=2,Promise.resolve(v).then(p,b)}else m|=1}catch(R){return b(R)}
18if(m===1)return f!==n?Promise.reject(f):Promise.resolve();if(f!==n)throw f}function b(v){return f=f!==n?new s(v,f):v,p()}return p()}}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}}),UE=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(i,e){function t(s,n){this.v=s,this.k=n}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}}),QO=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(i,e){var t=UE();function s(n){return new t(n,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),$O=On({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(i,e){var t=UE();function s(a){return function(){return new n(a.apply(this,arguments))}}function n(a){var l,u;function h(m,p){try{var b=a[m](p),v=b.value,R=v instanceof t;Promise.resolve(R?v.v:v).then(function(x){if(R){var T=m==="return"?"return":"next";if(!v.k||x.done)return h(T,x);x=a[T](x).value}f(b.done?"return":"normal",x)},function(x){h("throw",x)})}catch(x){f("throw",x)}}function f(m,p){switch(m){case"return":l.resolve({value:p,done:!0});break;case"throw":l.reject(p);break;default:l.resolve({value:p,done:!1})}(l=l.next)?h(l.key,l.arg):u=null}this._invoke=function(m,p){return new Promise(function(b,v){var R={key:m,arg:p,resolve:b,reject:v,next:null};u?u=u.next=R:(l=u=R,h(m,p))})},typeof a.return!="function"&&(this.return=void 0)}n.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},n.prototype.next=function(a){return this._invoke("next",a)},n.prototype.throw=function(a){return this._invoke("throw",a)},n.prototype.return=function(a){return this._invoke("return",a)},e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}});ws(ZO(),1);ws(QO(),1);ws($O(),1);ws(ln(),1);function JO(i){return Zh(({path:e,args:t})=>{var s;const n=[...e],a=n.pop();if(a==="useMutation")return i[a](n,...t);if(a==="_def")return{path:n};const[l,...u]=t,h=(s=u[0])!==null&&s!==void 0?s:{};return i[a](n,l,h)})}var B_;const eD=["client","ssrContext","ssrState","abortOnUnmount"],tD=(B_=C.createContext)===null||B_===void 0?void 0:B_.call(Wh,null),sD=i=>{switch(i){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function iD(i){return Zh(e=>{const t=[...e.path],s=t.pop(),n=[...e.args],a=n.shift(),l=sD(s),u=bn(t,a,l);return{infiniteQueryOptions:()=>i.infiniteQueryOptions(t,u,n[0]),queryOptions:()=>i.queryOptions(t,u,...n),fetch:()=>i.fetchQuery(u,...n),fetchInfinite:()=>i.fetchInfiniteQuery(u,n[0]),prefetch:()=>i.prefetchQuery(u,...n),prefetchInfinite:()=>i.prefetchInfiniteQuery(u,n[0]),ensureData:()=>i.ensureQueryData(u,...n),invalidate:()=>i.invalidateQueries(u,...n),reset:()=>i.resetQueries(u,...n),refetch:()=>i.refetchQueries(u,...n),cancel:()=>i.cancelQuery(u,...n),setData:()=>{i.setQueryData(u,n[0],n[1])},setQueriesData:()=>i.setQueriesData(u,n[0],n[1],n[2]),setInfiniteData:()=>{i.setInfiniteQueryData(u,n[0],n[1])},getData:()=>i.getQueryData(u),getInfiniteData:()=>i.getInfiniteQueryData(u),setMutationDefaults:()=>i.setMutationDefaults(dh(t),a),getMutationDefaults:()=>i.getMutationDefaults(dh(t)),isMutating:()=>i.isMutating({mutationKey:dh(t)})}[s]()})}function nD(i){const e=NE(i.client),t=iD(i);return _m(s=>{const n=s;return n==="client"?e:eD.includes(n)?i[n]:t[s]})}var rD=Pa(Rc(),1);function Sv(i){const e=i instanceof $h?i:mm(i);return Zh(t=>{const s=t.path,n=s.join("."),[a,l]=t.args;return(0,rD.default)({queryKey:bn(s,a,"query"),queryFn:()=>e.query(n,a,l?.trpc)},l)})}var N_=Pa(Rc(),1);function ni(i,e,t){var s;const n=i[0];let a=(s=i[1])===null||s===void 0?void 0:s.input;if(t){var l;a=(0,N_.default)((0,N_.default)((0,N_.default)({},(l=a)!==null&&l!==void 0?l:{}),t.pageParam?{cursor:t.pageParam}:{}),{},{direction:t.direction})}return[n.join("."),a,e?.trpc]}var aD=Yr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(i,e){function t(n){var a,l,u,h=2;for(typeof Symbol<"u"&&(l=Symbol.asyncIterator,u=Symbol.iterator);h--;){if(l&&(a=n[l])!=null)return a.call(n);if(u&&(a=n[u])!=null)return new s(a.call(n));l="@@asyncIterator",u="@@iterator"}throw new TypeError("Object is not async iterable")}function s(n){function a(l){if(Object(l)!==l)return Promise.reject(new TypeError(l+" is not an object."));var u=l.done;return Promise.resolve(l.value).then(function(h){return{value:h,done:u}})}return s=function(u){this.s=u,this.n=u.next},s.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(u){var h=this.s.return;return h===void 0?Promise.resolve({value:u,done:!0}):a(h.apply(this.s,arguments))},throw:function(u){var h=this.s.return;return h===void 0?Promise.reject(u):a(h.apply(this.s,arguments))}},new s(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}}
18),oD=Pa(aD(),1);function Rp(i){return{path:i.path.join(".")}}function jl(i){const e=Rp(i);return C.useMemo(()=>e,[e])}async function jE(i,e,t){const n=e.getQueryCache().build(e,{queryKey:t});n.setState({data:[],status:"success"});const a=[];var l=!1,u=!1,h;try{for(var f=(0,oD.default)(i),m;l=!(m=await f.next()).done;l=!1){const p=m.value;a.push(p),n.setState({data:[...a]})}}catch(p){u=!0,h=p}finally{try{l&&f.return!=null&&await f.return()}finally{if(u)throw h}}return a}var Bt=Pa(Rc(),1);function lD(i){const{client:e,queryClient:t}=i,s=e instanceof $h?e:mm(e);return{infiniteQueryOptions:(n,a,l)=>{var u,h;const f=((u=a[1])===null||u===void 0?void 0:u.input)===Fi,m=async p=>{var b;const v=(0,Bt.default)((0,Bt.default)({},l),{},{trpc:(0,Bt.default)((0,Bt.default)({},l?.trpc),!(l==null||(b=l.trpc)===null||b===void 0)&&b.abortOnUnmount?{signal:p.signal}:{signal:null})});return await s.query(...ni(a,v,{direction:p.direction,pageParam:p.pageParam}))};return Object.assign((0,Bt.default)((0,Bt.default)({},l),{},{initialData:l?.initialData,queryKey:a,queryFn:f?Fi:m,initialPageParam:(h=l?.initialCursor)!==null&&h!==void 0?h:null}),{trpc:Rp({path:n})})},queryOptions:(n,a,l)=>{var u;const h=((u=a[1])===null||u===void 0?void 0:u.input)===Fi,f=async m=>{var p;const b=(0,Bt.default)((0,Bt.default)({},l),{},{trpc:(0,Bt.default)((0,Bt.default)({},l?.trpc),!(l==null||(p=l.trpc)===null||p===void 0)&&p.abortOnUnmount?{signal:m.signal}:{signal:null})}),v=await s.query(...ni(a,b));return vE(v)?jE(v,t,a):v};return Object.assign((0,Bt.default)((0,Bt.default)({},l),{},{initialData:l?.initialData,queryKey:a,queryFn:h?Fi:f}),{trpc:Rp({path:n})})},fetchQuery:(n,a)=>t.fetchQuery((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n,queryFn:()=>s.query(...ni(n,a))})),fetchInfiniteQuery:(n,a)=>{var l;return t.fetchInfiniteQuery((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n,queryFn:({pageParam:u,direction:h})=>s.query(...ni(n,a,{pageParam:u,direction:h})),initialPageParam:(l=a?.initialCursor)!==null&&l!==void 0?l:null}))},prefetchQuery:(n,a)=>t.prefetchQuery((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n,queryFn:()=>s.query(...ni(n,a))})),prefetchInfiniteQuery:(n,a)=>{var l;return t.prefetchInfiniteQuery((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n,queryFn:({pageParam:u,direction:h})=>s.query(...ni(n,a,{pageParam:u,direction:h})),initialPageParam:(l=a?.initialCursor)!==null&&l!==void 0?l:null}))},ensureQueryData:(n,a)=>t.ensureQueryData((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n,queryFn:()=>s.query(...ni(n,a))})),invalidateQueries:(n,a,l)=>t.invalidateQueries((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n}),l),resetQueries:(n,a,l)=>t.resetQueries((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n}),l),refetchQueries:(n,a,l)=>t.refetchQueries((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n}),l),cancelQuery:(n,a)=>t.cancelQueries({queryKey:n},a),setQueryData:(n,a,l)=>t.setQueryData(n,a,l),setQueriesData:(n,a,l,u)=>t.setQueriesData((0,Bt.default)((0,Bt.default)({},a),{},{queryKey:n}),l,u),getQueryData:n=>t.getQueryData(n),setInfiniteQueryData:(n,a,l)=>t.setQueryData(n,a,l),getInfiniteQueryData:n=>t.getQueryData(n),setMutationDefaults:(n,a)=>{const l=n[0],u=h=>s.mutation(...ni([l,{input:h}],i));return t.setMutationDefaults(n,typeof a=="function"?a({canonicalMutationFn:u}):a)},getMutationDefaults:n=>t.getMutationDefaults(n),isMutating:n=>t.isMutating((0,Bt.default)((0,Bt.default)({},n),{},{exact:!0}))}}var He=Pa(Rc());const Cv=(i,e)=>new Proxy(i,{get(s,n){return e(n),s[n]}});function cD(i){var e,t;const s=(e=void 0)!==null&&e!==void 0?e:k=>k.originalFn(),n=(t=void 0)!==null&&t!==void 0?t:tD,a=YO,l=k=>{var U;const{abortOnUnmount:N=!1,queryClient:H,ssrContext:q}=k,[re,ce]=C.useState((U=k.ssrState)!==null&&U!==void 0?U:!1),ae=k.client instanceof $h?k.client:mm(k.client),fe=C.useMemo(()=>lD({client:ae,queryClient:H}),[ae,H]),_e=C.useMemo(()=>(0,He.default)({abortOnUnmount:N,queryClient:H,client:ae,ssrContext:q??null,ssrState:re},fe),[N,ae,fe,H,q,re]);return C.useEffect(()=>{ce(Te=>Te?"mounted":!1)},[]),_.jsx(n.Provider,{value:_e,children:k.children})};function u(){const k=C.useContext(n);if(!k)throw new Error("Unable to find tRPC Context. Did you forget to wrap your Ap
18p inside `withTRPC` HoC?");return k}function h(k,U){var N;const{queryClient:H,ssrState:q}=u();return q&&q!=="mounted"&&((N=H.getQueryCache().find({queryKey:k}))===null||N===void 0?void 0:N.state.status)==="error"?(0,He.default)({retryOnMount:!1},U):U}function f(k,U,N){var H,q,re,ce,ae;const fe=u(),{abortOnUnmount:_e,client:Te,ssrState:z,queryClient:J,prefetchQuery:Y}=fe,V=bn(k,U,"query"),ge=J.getQueryDefaults(V),L=U===Fi;typeof window>"u"&&z==="prepass"&&(N==null||(H=N.trpc)===null||H===void 0?void 0:H.ssr)!==!1&&((q=N?.enabled)!==null&&q!==void 0?q:ge?.enabled)!==!1&&!L&&!J.getQueryCache().find({queryKey:V})&&Y(V,N);const B=h(V,(0,He.default)((0,He.default)({},ge),N)),X=(re=(ce=N==null||(ae=N.trpc)===null||ae===void 0?void 0:ae.abortOnUnmount)!==null&&ce!==void 0?ce:void 0)!==null&&re!==void 0?re:_e,Q=kP((0,He.default)((0,He.default)({},B),{},{queryKey:V,queryFn:L?U:async F=>{const $=(0,He.default)((0,He.default)({},B),{},{trpc:(0,He.default)((0,He.default)({},B?.trpc),X?{signal:F.signal}:{signal:null})}),he=await Te.query(...ni(V,$));return vE(he)?jE(he,J,V):he}}),J);return Q.trpc=jl({path:k}),Q}function m(k,U,N){var H,q,re;const ce=u(),ae=bn(k,U,"query"),fe=U===Fi,_e=(H=(q=N==null||(re=N.trpc)===null||re===void 0?void 0:re.abortOnUnmount)!==null&&q!==void 0?q:void 0)!==null&&H!==void 0?H:ce.abortOnUnmount;UP((0,He.default)((0,He.default)({},N),{},{queryKey:ae,queryFn:fe?U:Te=>{const z={trpc:(0,He.default)((0,He.default)({},N?.trpc),_e?{signal:Te.signal}:{})};return ce.client.query(...ni(ae,z))}}))}function p(k,U,N){var H,q,re;const ce=u(),ae=bn(k,U,"query"),fe=(H=(q=N==null||(re=N.trpc)===null||re===void 0?void 0:re.abortOnUnmount)!==null&&q!==void 0?q:void 0)!==null&&H!==void 0?H:ce.abortOnUnmount,_e=LP((0,He.default)((0,He.default)({},N),{},{queryKey:ae,queryFn:Te=>{const z=(0,He.default)((0,He.default)({},N),{},{trpc:(0,He.default)((0,He.default)({},N?.trpc),fe?{signal:Te.signal}:{signal:null})});return ce.client.query(...ni(ae,z))}}),ce.queryClient);return _e.trpc=jl({path:k}),[_e.data,_e]}function b(k,U){const{client:N,queryClient:H}=u(),q=dh(k),re=H.defaultMutationOptions(H.getMutationDefaults(q)),ce=GP((0,He.default)((0,He.default)({},U),{},{mutationKey:q,mutationFn:ae=>N.mutation(...ni([k,{input:ae}],U)),onSuccess(...ae){var fe,_e;return s({originalFn:()=>{var z,J,Y;return(z=U==null||(J=U.onSuccess)===null||J===void 0?void 0:J.call(U,...ae))!==null&&z!==void 0?z:re==null||(Y=re.onSuccess)===null||Y===void 0?void 0:Y.call(re,...ae)},queryClient:H,meta:(fe=(_e=U?.meta)!==null&&_e!==void 0?_e:re?.meta)!==null&&fe!==void 0?fe:{}})}}),H);return ce.trpc=jl({path:k}),ce}const v={data:void 0,error:null,status:"idle"},R={data:void 0,error:null,status:"connecting"};/* istanbul ignore next -- @preserve */function x(k,U,N){var H;const q=(H=N?.enabled)!==null&&H!==void 0?H:U!==Fi,re=Hr(bn(k,U,"any")),{client:ce}=u(),ae=C.useRef(N);C.useEffect(()=>{ae.current=N});const[fe]=C.useState(new Set([])),_e=C.useCallback(L=>{fe.add(L)},[fe]),Te=C.useRef(null),z=C.useCallback(L=>{const B=Y.current,X=Y.current=L(B);let Q=!1;for(const F of fe)if(B[F]!==X[F]){Q=!0;break}Q&&ge(Cv(X,_e))},[_e,fe]),J=C.useCallback(()=>{var L;if((L=Te.current)===null||L===void 0||L.unsubscribe(),!q){z(()=>(0,He.default)((0,He.default)({},v),{},{reset:J}));return}z(()=>(0,He.default)((0,He.default)({},R),{},{reset:J}));const B=ce.subscription(k.join("."),U??void 0,{onStarted:()=>{var X,Q;(X=(Q=ae.current).onStarted)===null||X===void 0||X.call(Q),z(F=>(0,He.default)((0,He.default)({},F),{},{status:"pending",error:null}))},onData:X=>{var Q,F;(Q=(F=ae.current).onData)===null||Q===void 0||Q.call(F,X),z($=>(0,He.default)((0,He.default)({},$),{},{status:"pending",data:X,error:null}))},onError:X=>{var Q,F;(Q=(F=ae.current).onError)===null||Q===void 0||Q.call(F,X),z($=>(0,He.default)((0,He.default)({},$),{},{status:"error",error:X}))},onConnectionStateChange:X=>{z(Q=>{switch(X.state){case"idle":return(0,He.default)((0,He.default)({},Q),{},{status:X.state,error:null,data:void 0});case"connecting":return(0,He.default)((0,He.default)({},Q),{},{error:X.error,status:X.state});
18case"pending":return Q}})},onComplete:()=>{var X,Q;(X=(Q=ae.current).onComplete)===null||X===void 0||X.call(Q),z(F=>(0,He.default)((0,He.default)({},F),{},{status:"idle",error:null,data:void 0}))}});Te.current=B},[ce,re,q,z]);C.useEffect(()=>(J(),()=>{var L;(L=Te.current)===null||L===void 0||L.unsubscribe()}),[J]);const Y=C.useRef(q?(0,He.default)((0,He.default)({},R),{},{reset:J}):(0,He.default)((0,He.default)({},v),{},{reset:J})),[V,ge]=C.useState(Cv(Y.current,_e));return V}function T(k,U,N){var H,q,re,ce,ae;const{client:fe,ssrState:_e,prefetchInfiniteQuery:Te,queryClient:z,abortOnUnmount:J}=u(),Y=bn(k,U,"infinite"),V=z.getQueryDefaults(Y),ge=U===Fi;typeof window>"u"&&_e==="prepass"&&(N==null||(H=N.trpc)===null||H===void 0?void 0:H.ssr)!==!1&&((q=N?.enabled)!==null&&q!==void 0?q:V?.enabled)!==!1&&!ge&&!z.getQueryCache().find({queryKey:Y})&&Te(Y,(0,He.default)((0,He.default)({},V),N));const L=h(Y,(0,He.default)((0,He.default)({},V),N)),B=(re=N==null||(ce=N.trpc)===null||ce===void 0?void 0:ce.abortOnUnmount)!==null&&re!==void 0?re:J,X=zP((0,He.default)((0,He.default)({},L),{},{initialPageParam:(ae=N.initialCursor)!==null&&ae!==void 0?ae:null,persister:N.persister,queryKey:Y,queryFn:ge?U:Q=>{var F;const $=(0,He.default)((0,He.default)({},L),{},{trpc:(0,He.default)((0,He.default)({},L?.trpc),B?{signal:Q.signal}:{signal:null})});return fe.query(...ni(Y,$,{pageParam:(F=Q.pageParam)!==null&&F!==void 0?F:N.initialCursor,direction:Q.direction}))}}),z);return X.trpc=jl({path:k}),X}function E(k,U,N){var H,q,re;const ce=u(),ae=bn(k,U,"infinite"),fe=ce.queryClient.getQueryDefaults(ae),_e=U===Fi,Te=h(ae,(0,He.default)((0,He.default)({},fe),N)),z=(H=N==null||(q=N.trpc)===null||q===void 0?void 0:q.abortOnUnmount)!==null&&H!==void 0?H:ce.abortOnUnmount;jP((0,He.default)((0,He.default)({},N),{},{initialPageParam:(re=N.initialCursor)!==null&&re!==void 0?re:null,queryKey:ae,queryFn:_e?U:J=>{var Y;const V=(0,He.default)((0,He.default)({},Te),{},{trpc:(0,He.default)((0,He.default)({},Te?.trpc),z?{signal:J.signal}:{})});return ce.client.query(...ni(ae,V,{pageParam:(Y=J.pageParam)!==null&&Y!==void 0?Y:N.initialCursor,direction:J.direction}))}}))}function A(k,U,N){var H,q,re;const ce=u(),ae=bn(k,U,"infinite"),fe=ce.queryClient.getQueryDefaults(ae),_e=h(ae,(0,He.default)((0,He.default)({},fe),N)),Te=(H=N==null||(q=N.trpc)===null||q===void 0?void 0:q.abortOnUnmount)!==null&&H!==void 0?H:ce.abortOnUnmount,z=BP((0,He.default)((0,He.default)({},N),{},{initialPageParam:(re=N.initialCursor)!==null&&re!==void 0?re:null,queryKey:ae,queryFn:J=>{var Y;const V=(0,He.default)((0,He.default)({},_e),{},{trpc:(0,He.default)((0,He.default)({},_e?.trpc),Te?{signal:J.signal}:{})});return ce.client.query(...ni(ae,V,{pageParam:(Y=J.pageParam)!==null&&Y!==void 0?Y:N.initialCursor,direction:J.direction}))}}),ce.queryClient);return z.trpc=jl({path:k}),[z.data,z]}return{Provider:l,createClient:a,useContext:u,useUtils:u,useQuery:f,usePrefetchQuery:m,useSuspenseQuery:p,useQueries:(k,U)=>{const{ssrState:N,queryClient:H,prefetchQuery:q,client:re}=u(),ce=Sv(re),ae=k(ce);if(typeof window>"u"&&N==="prepass")for(const _e of ae){var fe;const Te=_e;((fe=Te.trpc)===null||fe===void 0?void 0:fe.ssr)!==!1&&!H.getQueryCache().find({queryKey:Te.queryKey})&&q(Te.queryKey,Te)}return xE({queries:ae.map(_e=>(0,He.default)((0,He.default)({},_e),{},{queryKey:_e.queryKey})),combine:U?.combine},H)},useSuspenseQueries:k=>{const{queryClient:U,client:N}=u(),H=Sv(N),q=k(H),re=NP({queries:q.map(ce=>(0,He.default)((0,He.default)({},ce),{},{queryFn:ce.queryFn,queryKey:ce.queryKey}))},U);return[re.map(ce=>ce.data),re]},useMutation:b,useSubscription:x,useInfiniteQuery:T,usePrefetchInfiniteQuery:E,useSuspenseInfiniteQuery:A}}function uD(i){const e=JO(i);return _m(t=>t==="useContext"||t==="useUtils"?()=>{const s=i.useUtils();return C.useMemo(()=>nD(s),[s])}:i.hasOwnProperty(t)?i[t]:e[t])}function hD(i){const e=cD();return uD(e)}const dt=hD(),dD="app_session_id",fD="Please login (10001)",_D="__Host-oauth_state",pD=i=>btoa(JSON.stringify(i));var U_={exports:{}},Gl={},j_={exports:{}},G_={};/**
19 * @license React
20 * scheduler.production.js
21 *
22 * Copyright (c) Meta Platforms, Inc. and affiliates.
23 *
24 * This source code is licensed under the MIT license found in the
25 * LICENSE file in the root directory of this source tree.
26 */var Av;function mD(){return Av||(Av=1,(function(i){function e(z,J){var Y=z.length;z.push(J);e:for(;0<Y;){var V=Y-1>>>1,ge=z[V];if(0<n(ge,J))z[V]=J,z[Y]=ge,Y=V;else break e}}function t(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var J=z[0],Y=z.pop();if(Y!==J){z[0]=Y;e:for(var V=0,ge=z.length,L=ge>>>1;V<L;){var B=2*(V+1)-1,X=z[B],Q=B+1,F=z[Q];if(0>n(X,Y))Q<ge&&0>n(F,X)?(z[V]=F,z[Q]=Y,V=Q):(z[V]=X,z[B]=Y,V=B);else if(Q<ge&&0>n(F,Y))z[V]=F,z[Q]=Y,V=Q;else break e}}return J}function n(z,J){var Y=z.sortIndex-J.sortIndex;return Y!==0?Y:z.id-J.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;i.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();i.unstable_now=function(){return l.now()-u}}var h=[],f=[],m=1,p=null,b=3,v=!1,R=!1,x=!1,T=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function M(z){for(var J=t(f);J!==null;){if(J.callback===null)s(f);else if(J.startTime<=z)s(f),J.sortIndex=J.expirationTime,e(h,J);else break;J=t(f)}}function k(z){if(x=!1,M(z),!R)if(t(h)!==null)R=!0,U||(U=!0,ae());else{var J=t(f);J!==null&&Te(k,J.startTime-z)}}var U=!1,N=-1,H=5,q=-1;function re(){return T?!0:!(i.unstable_now()-q<H)}
vendor: 11,371 bytes, lines 26-44
26function ce(){if(T=!1,U){var z=i.unstable_now();q=z;var J=!0;try{e:{R=!1,x&&(x=!1,A(N),N=-1),v=!0;var Y=b;try{t:{for(M(z),p=t(h);p!==null&&!(p.expirationTime>z&&re());){var V=p.callback;if(typeof V=="function"){p.callback=null,b=p.priorityLevel;var ge=V(p.expirationTime<=z);if(z=i.unstable_now(),typeof ge=="function"){p.callback=ge,M(z),J=!0;break t}p===t(h)&&s(h),M(z)}else s(h);p=t(h)}if(p!==null)J=!0;else{var L=t(f);L!==null&&Te(k,L.startTime-z),J=!1}}break e}finally{p=null,b=Y,v=!1}J=void 0}}finally{J?ae():U=!1}}}var ae;if(typeof D=="function")ae=function(){D(ce)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,_e=fe.port2;fe.port1.onmessage=ce,ae=function(){_e.postMessage(null)}}else ae=function(){E(ce,0)};function Te(z,J){N=E(function(){z(i.unstable_now())},J)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(z){z.callback=null},i.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<z?Math.floor(1e3/z):5},i.unstable_getCurrentPriorityLevel=function(){return b},i.unstable_next=function(z){switch(b){case 1:case 2:case 3:var J=3;break;default:J=b}var Y=b;b=J;try{return z()}finally{b=Y}},i.unstable_requestPaint=function(){T=!0},i.unstable_runWithPriority=function(z,J){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var Y=b;b=z;try{return J()}finally{b=Y}},i.unstable_scheduleCallback=function(z,J,Y){var V=i.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?V+Y:V):Y=V,z){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=Y+ge,z={id:m++,callback:J,priorityLevel:z,startTime:Y,expirationTime:ge,sortIndex:-1},Y>V?(z.sortIndex=Y,e(f,z),t(h)===null&&z===t(f)&&(x?(A(N),N=-1):x=!0,Te(k,Y-V))):(z.sortIndex=ge,e(h,z),R||v||(R=!0,U||(U=!0,ae()))),z},i.unstable_shouldYield=re,i.unstable_wrapCallback=function(z){var J=b;return function(){var Y=b;b=J;try{return z.apply(this,arguments)}finally{b=Y}}}})(G_)),G_}var Mv;function gD(){return Mv||(Mv=1,j_.exports=mD()),j_.exports}var z_={exports:{}},ei={};/**
27 * @license React
28 * react-dom.production.js
29 *
30 * Copyright (c) Meta Platforms, Inc. and affiliates.
31 *
32 * This source code is licensed under the MIT license found in the
33 * LICENSE file in the root directory of this source tree.
34 */var wv;function yD(){if(wv)return ei;wv=1;var i=qh();function e(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var s={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},n=Symbol.for("react.portal");function a(h,f,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:n,key:p==null?null:""+p,children:h,containerInfo:f,implementation:m}}var l=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return ei.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,ei.createPortal=function(h,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return a(h,f,null,m)},ei.flushSync=function(h){var f=l.T,m=s.p;try{if(l.T=null,s.p=2,h)return h()}finally{l.T=f,s.p=m,s.d.f()}},ei.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,s.d.C(h,f))},ei.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},ei.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?s.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:v}):m==="script"&&s.d.X(h,{crossOrigin:p,integrity:b,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ei.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=u(f.as,f.crossOrigin);s.d.M(h,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&s.d.M(h)},ei.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin);s.d.L(h,m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},ei.preloadModule=function(h,f){if(typeof h=="string")if(f){var m=u(f.as,f.crossOrigin);s.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else s.d.m(h)},ei.requestFormReset=function(h){s.d.r(h)},ei.unstable_batchedUpdates=function(h,f){return h(f)},ei.useFormState=function(h,f,m){return l.H.useFormState(h,f,m)},ei.useFormStatus=function(){return l.H.useHostTransitionStatus()},ei.version="19.2.1",ei}var Pv;function GE(){if(Pv)return z_.exports;Pv=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),z_.exports=yD(),z_.exports}/**
35 * @license React
36 * react-dom-client.production.js
37 *
38 * Copyright (c) Meta Platforms, Inc. and affiliates.
39 *
40 * This source code is licensed under the MIT license found in the
41 * LICENSE file in the root directory of this source tree.
42 */var Ov;function bD(){if(Ov)return Gl;Ov=1;var i=gD(),e=qh(),t=GE();function s(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function a(r){var o=r,c=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(c=o.return),r=o.return;while(r)}return o.tag===3?c:null}function l(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function u(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function h(r){if(a(r)!==r)throw Error(s(188))}function f(r){var o=r.alternate;if(!o){if(o=a(r),o===null)throw Error(s(188));return o!==r?null:r}for(var c=r,d=o;;){var g=c.return;if(g===null)break;var y=g.alternate;if(y===null){if(d=g.return,d!==null){c=d;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===c)return h(g),r;if(y===d)return h(g),o;y=y.sibling}throw Error(s(188))}if(c.return!==d.return)c=g,d=y;else{for(var S=!1,P=g.child;P;){if(P===c){S=!0,c=g,d=y;break}if(P===d){S=!0,d=g,c=y;break}P=P.sibling}if(!S){for(P=y.child;P;){if(P===c){S=!0,c=y,d=g;break}if(P===d){S=!0,d=y,c=g;break}P=P.sibling}if(!S)throw Error(s(189))}}if(c.alternate!==d)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?r:o}function m(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=m(r),o!==null)return o;r=r.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),D=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),ce=Symbol.iterator;function ae(r){return r===null||typeof r!="object"?null:(r=ce&&r[ce]||r["@@iterator"],typeof r=="function"?r:null)}var fe=Symbol.for("react.client.reference");function _e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===fe?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case x:return"Fragment";case E:return"Profiler";case T:return"StrictMode";case k:return"Suspense";case U:return"SuspenseList";case q:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case R:return"Portal";case D:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case M:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case N:return o=r.displayName||null,o!==null?o:_e(r.type)||"Memo";case H:o=r._payload,r=r._init;try{return _e(r(o))}catch{}}return null}var Te=Array.isArray,z=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},V=[],ge=-1;function L(r){return{current:r}}function B(r){0>ge||(r.current=V[ge],V[ge]=null,ge--)}function X(r,o){ge++,V[ge]=r.current,r.current=o}var Q=L(null),F=L(null),$=L(null),he=L(null);function Ae(r,o){switch(X($,o),X(F,r),X(Q,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?wx(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=wx(o),r=Px(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B(Q),X(Q,r)}function Oe(){B(Q),B(F),B($)}function G(r){r.memoizedState!==null&&X(he,r);var o=Q.current,c=Px(o,r.type);o!==c&&(X(F,r),X(Q,c))}function ie(r){F.current===r&&(B(Q),B(F)),he.current===r&&(B(he),kl._currentValue=Y)}var de,Se;function qe(r){if(de===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);de=o&&o[1]||"",Se=-1<c.stack.indexOf(`
43    at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
44`+de+r+Se}var Je=!1;function Ct(r,o){if(!r||Je)return"";Je=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(o){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(pe){var ue=pe}Reflect.construct(r,[],Ee)}else{try{Ee.call()}catch(pe){ue=pe}r.call(Ee.prototype)}}else{try{throw Error()}catch(pe){ue=pe}(Ee=r())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}
vendor: 8,843 bytes, lines 44-49
44catch(pe){if(pe&&ue&&typeof pe.stack=="string")return[pe.stack,ue.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),S=y[0],P=y[1];if(S&&P){var W=S.split(`
45`),le=P.split(`
46`);for(g=d=0;d<W.length&&!W[d].includes("DetermineComponentFrameRoot");)d++;for(;g<le.length&&!le[g].includes("DetermineComponentFrameRoot");)g++;if(d===W.length||g===le.length)for(d=W.length-1,g=le.length-1;1<=d&&0<=g&&W[d]!==le[g];)g--;for(;1<=d&&0<=g;d--,g--)if(W[d]!==le[g]){if(d!==1||g!==1)do if(d--,g--,0>g||W[d]!==le[g]){var ye=`
47`+W[d].replace(" at new "," at ");return r.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",r.displayName)),ye}while(1<=d&&0<=g);break}}}finally{Je=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?qe(c):""}function es(r,o){switch(r.tag){case 26:case 27:case 5:return qe(r.type);case 16:return qe("Lazy");case 13:return r.child!==o&&o!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return Ct(r.type,!1);case 11:return Ct(r.type.render,!1);case 1:return Ct(r.type,!0);case 31:return qe("Activity");default:return""}}function ps(r){try{var o="",c=null;do o+=es(r,c),c=r,r=r.return;while(r);return o}catch(d){return`
48Error generating stack: `+d.message+`
49`+d.stack}}var Gt=Object.prototype.hasOwnProperty,Rs=i.unstable_scheduleCallback,ms=i.unstable_cancelCallback,et=i.unstable_shouldYield,K=i.unstable_requestPaint,we=i.unstable_now,Ut=i.unstable_getCurrentPriorityLevel,yt=i.unstable_ImmediatePriority,wt=i.unstable_UserBlockingPriority,Ot=i.unstable_NormalPriority,Yt=i.unstable_LowPriority,Ft=i.unstable_IdlePriority,ns=i.log,rs=i.unstable_setDisableYieldValue,zt=null,Ne=null;function rt(r){if(typeof ns=="function"&&rs(r),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(zt,r)}catch{}}var vt=Math.clz32?Math.clz32:js,$s=Math.log,ti=Math.LN2;function js(r){return r>>>=0,r===0?32:31-($s(r)/ti|0)|0}var Gs=256,li=262144,Js=4194304;function hs(r){var o=r&42;if(o!==0)return o;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function st(r,o,c){var d=r.pendingLanes;if(d===0)return 0;var g=0,y=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var P=d&134217727;return P!==0?(d=P&~y,d!==0?g=hs(d):(S&=P,S!==0?g=hs(S):c||(c=P&~r,c!==0&&(g=hs(c))))):(P=d&~y,P!==0?g=hs(P):S!==0?g=hs(S):c||(c=d&~r,c!==0&&(g=hs(c)))),g===0?0:o!==0&&o!==g&&(o&y)===0&&(y=g&-g,c=o&-o,y>=c||y===32&&(c&4194048)!==0)?o:g}function ke(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function w(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function me(){var r=Js;return Js<<=1,(Js&62914560)===0&&(Js=4194304),r}function lt(r){for(var o=[],c=0;31>c;c++)o.push(r);return o}function Pe(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function O(r,o,c,d,g,y){var S=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var P=r.entanglements,W=r.expirationTimes,le=r.hiddenUpdates;for(c=S&~c;0<c;){var ye=31-vt(c),Ee=1<<ye;P[ye]=0,W[ye]=-1;var ue=le[ye];if(ue!==null)for(le[ye]=null,ye=0;ye<ue.length;ye++){var pe=ue[ye];pe!==null&&(pe.lane&=-536870913)}c&=~Ee}d!==0&&Ie(r,d,0),y!==0&&g===0&&r.tag!==0&&(r.suspendedLanes|=y&~(S&~o))}function Ie(r,o,c){r.pendingLanes|=o,r.suspendedLanes&=~o;var d=31-vt(o);r.entangledLanes|=o,r.entanglements[d]=r.entanglements[d]|1073741824|c&261930}function Rt(r,o){var c=r.entangledLanes|=o;for(r=r.entanglements;c;){var d=31-vt(c),g=1<<d;g&o|r[d]&o&&(r[d]|=o),c&=~g}}function as(r,o){var c=o&-o;return c=(c&42)!==0?1:un(c),(c&(r.suspendedLanes|o))!==0?0:c}function un(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ts(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function vi(){var r=J.p;return r!==0?r:(r=window.event,r===void 0?32:Jx(r.type))}function Ri(r,o){var c=J.p;try{return J.p=r,o()}finally{J.p=c}}var hn=Math.random().toString(36).slice(2),qs="__reactFiber$"+hn,ci="__reactProps$"+hn,ka="__reactContainer$"+hn,Td="__reactEvents$"+hn,VA="__reactListeners$"+hn,XA="__reactHandles$"+hn,mg="__reactResources$"+hn,Zo="__reactMarker$"+hn;function Ed(r){delete r[qs],delete r[ci],delete r[Td],delete r[VA],delete r[XA]}function La(r){var o=r[qs];if(o)return o;for(var c=r.parentNode;c;){if(o=c[ka]||c[qs]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(r=Bx(r);r!==null;){if(c=r[qs])return c;r=Bx(r)}return o}r=c,c=r.parentNode}return null}function Ba(r){if(r=r[qs]||r[ka]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function Qo(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(s(33))}function Na(r){var o=r[mg];return o||(o=r[mg]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function zs(r){r[Zo]=!0}var gg=new Set,yg={};function Qr(r,o){Ua(r,o),Ua(r+"Capture",o)}function Ua(r,o){for(yg[r]=o,r=0;r<o.length;r++)gg.add(o[r])}var qA=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),bg={},xg={};function WA(r){return Gt.call(xg,r)?!0:Gt.call(bg,r)?!1:qA.test(r)?xg[r]=!0:(bg[r]=!0,!1)}function Fc(r,o,c){if(WA(o))if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var d=o.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+c)}}function kc(r,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+c)}}function Fn(r,o,c,d){if(d===null)r.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(o,c,""+d)}}function Li(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function vg(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function YA(r,o,c){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,y=d.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return g.call(this)},set:function(S){c=""+S,y.call(this,S)}}),Object.defineProperty(r,o,{enumerable:d.enumerable}),{getValue:function(){return c},setValue:function(S){c=""+S},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Sd(r){if(!r._valueTracker){var o=vg(r)?"checked":"value";r._valueTracker=YA(r,o,""+r[o])}}function Rg(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var c=o.getValue(),d="";return r&&(d=vg(r)?r.checked?"true":"false":r.value),r=d,r!==c?(o.setValue(r),!0):!1}function Lc(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var KA=/[\n"\\]/g;function Bi(r){return r.replace(KA,function(o){return"\\"+o.charCo
vendor: 4,418 bytes, line 49
49deAt(0).toString(16)+" "})}function Cd(r,o,c,d,g,y,S,P){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),o!=null?S==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+Li(o)):r.value!==""+Li(o)&&(r.value=""+Li(o)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),o!=null?Ad(r,S,Li(o)):c!=null?Ad(r,S,Li(c)):d!=null&&r.removeAttribute("value"),g==null&&y!=null&&(r.defaultChecked=!!y),g!=null&&(r.checked=g&&typeof g!="function"&&typeof g!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?r.name=""+Li(P):r.removeAttribute("name")}function Tg(r,o,c,d,g,y,S,P){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),o!=null||c!=null){if(!(y!=="submit"&&y!=="reset"||o!=null)){Sd(r);return}c=c!=null?""+Li(c):"",o=o!=null?""+Li(o):c,P||o===r.value||(r.value=o),r.defaultValue=o}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=P?r.checked:!!d,r.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Sd(r)}function Ad(r,o,c){o==="number"&&Lc(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function ja(r,o,c,d){if(r=r.options,o){o={};for(var g=0;g<c.length;g++)o["$"+c[g]]=!0;for(c=0;c<r.length;c++)g=o.hasOwnProperty("$"+r[c].value),r[c].selected!==g&&(r[c].selected=g),g&&d&&(r[c].defaultSelected=!0)}else{for(c=""+Li(c),o=null,g=0;g<r.length;g++){if(r[g].value===c){r[g].selected=!0,d&&(r[g].defaultSelected=!0);return}o!==null||r[g].disabled||(o=r[g])}o!==null&&(o.selected=!0)}}function Eg(r,o,c){if(o!=null&&(o=""+Li(o),o!==r.value&&(r.value=o),c==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=c!=null?""+Li(c):""}function Sg(r,o,c,d){if(o==null){if(d!=null){if(c!=null)throw Error(s(92));if(Te(d)){if(1<d.length)throw Error(s(93));d=d[0]}c=d}c==null&&(c=""),o=c}c=Li(o),r.defaultValue=c,d=r.textContent,d===c&&d!==""&&d!==null&&(r.value=d),Sd(r)}function Ga(r,o){if(o){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=o;return}}r.textContent=o}var ZA=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Cg(r,o,c){var d=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?d?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":d?r.setProperty(o,c):typeof c!="number"||c===0||ZA.has(o)?o==="float"?r.cssFloat=c:r[o]=(""+c).trim():r[o]=c+"px"}function Ag(r,o,c){if(o!=null&&typeof o!="object")throw Error(s(62));if(r=r.style,c!=null){for(var d in c)!c.hasOwnProperty(d)||o!=null&&o.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var g in o)d=o[g],o.hasOwnProperty(g)&&c[g]!==d&&Cg(r,g,d)}else for(var y in o)o.hasOwnProperty(y)&&Cg(r,y,o[y])}function Md(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var QA=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
49dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$A=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bc(r){return $A.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function kn(){}var wd=null;function Pd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var za=null,Ha=null;function Mg(r){var o=Ba(r);if(o&&(r=o.stateNode)){var c=r[ci]||null;e:switch(r=o.stateNode,o.type){case"input":if(Cd(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Bi(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var d=c[o];if(d!==r&&d.form===r.form){var g=d[ci]||null;if(!g)throw Error(s(90));Cd(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(o=0;o<c.length;o++)d=c[o],d.form===r.form&&Rg(d)}break e;case"textarea":Eg(r,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&ja(r,!!c.multiple,o,!1)}}}var Od=!1;function wg(r,o,c){if(Od)return r(o,c);Od=!0;try{var d=r(o);return d}finally{if(Od=!1,(za!==null||Ha!==null)&&(Eu(),za&&(o=za,r=Ha,Ha=za=null,Mg(o),r)))for(o=0;o<r.length;o++)Mg(r[o])}}function $o(r,o){var c=r.stateNode;if(c===null)return null;var d=c[ci]||null;if(d===null)return null;c=d[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(s(231,o,typeof c));return c}var Ln=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dd=!1;if(Ln)try{var Jo={};Object.defineProperty(Jo,"passive",{get:function(){Dd=!0}}),window.addEventListener("test",Jo,Jo),window.removeEventListener("test",Jo,Jo)}catch{Dd=!1}var dr=null,Id=null,Nc=null;function Pg(){if(Nc)return Nc;var r,o=Id,c=o.length,d,g="value"in dr?dr.value:dr.textContent,y=g.length;for(r=0;r<c&&o[r]===g[r];r++);var S=c-r;for(d=1;d<=S&&o[c-d]===g[y-d];d++);return Nc=g.slice(r,1<d?1-d:void 0)}function Uc(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function jc(){return!0}function Og(){return!1}function ui(r){function o(c,d,g,y,S){this._reactName=c,this._targetInst=g,this.type=d,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var P in r)r.hasOwnProperty(P)&&(c=r[P],this[P]=c?c(y):y[P]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?jc:Og,this.isPropagationStopped=Og,this}return p(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=jc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=jc)},persist:function(){},isPersistent:jc}),o}var $r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gc=ui($r),el=p({},$r,{view:0,detail:0}),JA=ui(el),Fd,kd,tl,zc=p({},el,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==tl&&(tl&&r.type==="mousemove"?(Fd=r.screenX-tl.screenX,kd=r.screenY-tl.screenY):kd=Fd=0,tl=r),Fd)},movementY:function(r){return"movementY"in r?r.movementY:kd}}),Dg=ui(zc),eM=p({},zc,{dataTransfer:0}),tM=ui(eM),sM=p({},el,{relatedTarget:0}),Ld=ui(sM),iM=p({},$r,{animationName:0,elapsedTime:0,pseudoElement:0}),nM=ui(iM),rM=p({},$r,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),aM=ui(rM),oM=p({},$r,{data:0}),Ig=ui(oM),lM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cM={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},uM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hM(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=uM[r])?!!o[r]:!1}function Bd(){return hM}var dM=p({}
vendor: 5,271 bytes, line 49
49,el,{key:function(r){if(r.key){var o=lM[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=Uc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?cM[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bd,charCode:function(r){return r.type==="keypress"?Uc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Uc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),fM=ui(dM),_M=p({},zc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fg=ui(_M),pM=p({},el,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bd}),mM=ui(pM),gM=p({},$r,{propertyName:0,elapsedTime:0,pseudoElement:0}),yM=ui(gM),bM=p({},zc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),xM=ui(bM),vM=p({},$r,{newState:0,oldState:0}),RM=ui(vM),TM=[9,13,27,32],Nd=Ln&&"CompositionEvent"in window,sl=null;Ln&&"documentMode"in document&&(sl=document.documentMode);var EM=Ln&&"TextEvent"in window&&!sl,kg=Ln&&(!Nd||sl&&8<sl&&11>=sl),Lg=" ",Bg=!1;function Ng(r,o){switch(r){case"keyup":return TM.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ug(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Va=!1;function SM(r,o){switch(r){case"compositionend":return Ug(o);case"keypress":return o.which!==32?null:(Bg=!0,Lg);case"textInput":return r=o.data,r===Lg&&Bg?null:r;default:return null}}function CM(r,o){if(Va)return r==="compositionend"||!Nd&&Ng(r,o)?(r=Pg(),Nc=Id=dr=null,Va=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return kg&&o.locale!=="ko"?null:o.data;default:return null}}var AM={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jg(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!AM[r.type]:o==="textarea"}function Gg(r,o,c,d){za?Ha?Ha.push(d):Ha=[d]:za=d,o=Ou(o,"onChange"),0<o.length&&(c=new Gc("onChange","change",null,c,d),r.push({event:c,listeners:o}))}var il=null,nl=null;function MM(r){Tx(r,0)}function Hc(r){var o=Qo(r);if(Rg(o))return r}function zg(r,o){if(r==="change")return o}var Hg=!1;if(Ln){var Ud;if(Ln){var jd="oninput"in document;if(!jd){var Vg=document.createElement("div");Vg.setAttribute("oninput","return;"),jd=typeof Vg.oninput=="function"}Ud=jd}else Ud=!1;Hg=Ud&&(!document.documentMode||9<document.documentMode)}function Xg(){il&&(il.detachEvent("onpropertychange",qg),nl=il=null)}function qg(r){if(r.propertyName==="value"&&Hc(nl)){var o=[];Gg(o,nl,r,Pd(r)),wg(MM,o)}}function wM(r,o,c){r==="focusin"?(Xg(),il=o,nl=c,il.attachEvent("onpropertychange",qg)):r==="focusout"&&Xg()}function PM(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Hc(nl)}function OM(r,o){if(r==="click")return Hc(o)}function DM(r,o){if(r==="input"||r==="change")return Hc(o)}function IM(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Ti=typeof Object.is=="function"?Object.is:IM;function rl(r,o){if(Ti(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var c=Object.keys(r),d=Object.keys(o);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var g=c[d];if(!Gt.call(o,g)||!Ti(r[g],o[g]))return!1}return!0}function Wg(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Yg(r,o){var c=Wg(r);r=0;for(var d;c;){if(c.nodeType===3){if(d=r+c.textContent.length,r<=o&&d>=o)return{node:c,offset:o-r};r=d}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Wg(c)}}function Kg(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Kg(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Zg(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=Lc(r.document);o instanceof r.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)r=o.contentWindow;else break;o=Lc(r.document)}return o}function Gd(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var FM=Ln&&"documentMode"in document&&11>=document.documentMode,Xa=null,zd=null,al=null,Hd=!1;function Qg(r,o,c){var d=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Hd||Xa==null||Xa!==Lc(d)||(d=Xa,"selectionStart"in d&&Gd(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focu
vendor: 22,659 bytes, line 49
49sNode:d.focusNode,focusOffset:d.focusOffset}),al&&rl(al,d)||(al=d,d=Ou(zd,"onSelect"),0<d.length&&(o=new Gc("onSelect","select",null,o,c),r.push({event:o,listeners:d}),o.target=Xa)))}function Jr(r,o){var c={};return c[r.toLowerCase()]=o.toLowerCase(),c["Webkit"+r]="webkit"+o,c["Moz"+r]="moz"+o,c}var qa={animationend:Jr("Animation","AnimationEnd"),animationiteration:Jr("Animation","AnimationIteration"),animationstart:Jr("Animation","AnimationStart"),transitionrun:Jr("Transition","TransitionRun"),transitionstart:Jr("Transition","TransitionStart"),transitioncancel:Jr("Transition","TransitionCancel"),transitionend:Jr("Transition","TransitionEnd")},Vd={},$g={};Ln&&($g=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function ea(r){if(Vd[r])return Vd[r];if(!qa[r])return r;var o=qa[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in $g)return Vd[r]=o[c];return r}var Jg=ea("animationend"),ey=ea("animationiteration"),ty=ea("animationstart"),kM=ea("transitionrun"),LM=ea("transitionstart"),BM=ea("transitioncancel"),sy=ea("transitionend"),iy=new Map,Xd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xd.push("scrollEnd");function Qi(r,o){iy.set(r,o),Qr(o,[r])}var Vc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Ni=[],Wa=0,qd=0;function Xc(){for(var r=Wa,o=qd=Wa=0;o<r;){var c=Ni[o];Ni[o++]=null;var d=Ni[o];Ni[o++]=null;var g=Ni[o];Ni[o++]=null;var y=Ni[o];if(Ni[o++]=null,d!==null&&g!==null){var S=d.pending;S===null?g.next=g:(g.next=S.next,S.next=g),d.pending=g}y!==0&&ny(c,g,y)}}function qc(r,o,c,d){Ni[Wa++]=r,Ni[Wa++]=o,Ni[Wa++]=c,Ni[Wa++]=d,qd|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function Wd(r,o,c,d){return qc(r,o,c,d),Wc(r)}function ta(r,o){return qc(r,null,null,o),Wc(r)}function ny(r,o,c){r.lanes|=c;var d=r.alternate;d!==null&&(d.lanes|=c);for(var g=!1,y=r.return;y!==null;)y.childLanes|=c,d=y.alternate,d!==null&&(d.childLanes|=c),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(g=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,g&&o!==null&&(g=31-vt(c),r=y.hiddenUpdates,d=r[g],d===null?r[g]=[o]:d.push(o),o.lane=c|536870912),y):null}function Wc(r){if(50<Ml)throw Ml=0,i_=null,Error(s(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Ya={};function NM(r,o,c,d){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ei(r,o,c,d){return new NM(r,o,c,d)}function Yd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Bn(r,o){var c=r.alternate;return c===null?(c=Ei(r.tag,o,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=o,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,o=r.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function ry(r,o){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,o=c.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function Yc(r,o,c,d,g,y){var S=0;if(d=r,typeof r=="function")Yd(r)&&(S=1);else if(typeof r=="string")S=Hw(r,c,Q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case q:return r=Ei(31,c,o,g),r.elementType=q,r.lanes=y,r;case x:return sa(c.children,g,y,o);case T:S=8,g|=24;break;case E:return r=Ei(12,c,o,g|2),r.elementType=E,r.lanes=y,r;case k:return r=Ei(13,c,o,g),r.elementType=k,r.lanes=y,r;case U:return r=Ei(19,c,o,g),r.elementType=U,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case D:S=10;break e;case A:S=9;break e;case M:S=11;break e;case N:S=14;break e;case H:S=16,d=null;break e}S=29,c=Error(s(130,r===null?"null":typeof r,"")),d=null}return o=Ei(S,c,o,g),o.elementType=r,o.type=d,o.lanes=y,o}function sa(r,o,c,d){return r=Ei(7,r,d,o),r.lanes=c,r}function Kd(r,o,c){return r=Ei(6,r,null,o),r.lanes=c,r}function ay(r){var o=Ei(18,null,null,0);return o.stateNode=r,o}function Zd(r,o,c){return o=Ei(4,r.children!==null?r.children:[],r.key,o),o.lanes=c,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var oy=new WeakMap;function Ui(r,o){if(typeof r=="object"&&r!==null){var c=oy.get(r);return c!==void 0?c:(o={value:r,source:o,stack:ps(o)},oy.set(r,o),o)}return{value:r,source:o,stack:ps(o)}}var Ka=[],Za=0,Kc=null,ol=0,ji=[],Gi=0,fr=null,dn=1,fn="";function Nn(r,o){Ka[Za++]=ol,Ka[Za++]=Kc,Kc=r,ol=o}function ly(r,o,c){ji[Gi++]=dn,ji[Gi++]=fn,ji[Gi++]=fr,fr=r;var d=dn;r=fn;var g=32-vt(d)-1;d&=~(1<<g),c+=1;var y=32-vt(o)+g;if(30<y){var S=g-g%5;y=(d&(1<<S)-1).toString(32),d>>=S,g-=S,dn=1<<32-vt(o)+g|c<<g|d,fn=y+r}else dn=1<<y|c<<g|d,fn=r}function Qd(r){r.return!==null&&(Nn(r,1),ly(r,1,0))}function $d(r){for(;r===Kc;)Kc=Ka[--Za],Ka[Za]=null,ol=Ka[--Za],Ka[Za]=null;for(;r===fr;)fr=ji[--Gi],ji[Gi]=null,fn=ji[--Gi],ji[Gi]=null,dn=ji[--Gi],ji[Gi]=null}function cy(r,o){ji[Gi++]=dn,ji[Gi++]=fn,ji[Gi++]=fr,dn=o.id,fn=o.overflow,fr=r}var Ws=null,os=null,Pt=!1,_r=null,zi=!1,Jd=Error(s(519));function pr(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ll(Ui(o,r)),Jd}function uy(r){var o=r.stateNode,c=r.type,d=r.memoizedProps;switch(o[qs]=r,o[ci]=d,c){case"dialog":Et("cancel",o),Et("close",o);break;case"iframe":case"object":case"embed":Et("load",o);break;case"video":case"audio":for(c=0;c<Pl.length;c++)Et(Pl[c],o);break;case"source":Et("error",o);break;case"img":case"image":case"link":Et("error",o),Et("load",o);break;case"details":Et("toggle",o);break;case"input":Et("invalid",o),Tg(o,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Et("invalid",o);break;case"textarea":Et("invalid",o),Sg(o,d.value,d.defaultValue,d.children)}c=d.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||d.suppressHydrationWarning===!0||Ax(o.textContent,c)?(d.popover!=null&&(Et("beforetoggle",o),Et("toggle",o)),d.onScroll!=null&&Et("scroll",o),d.onScrollEnd!=null&&Et("scrollend",o),d.onClick!=null&&(o.onclick=kn),o=!0):o=!1,o||pr(r,!0)}function hy(r){for(Ws=r.return;Ws;)switch(Ws.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Ws=Ws.return}}function Qa(r){if(r!==Ws)return!1;if(!Pt)return hy(r),Pt=!0,!1;var o=r.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||y_(r.type,r.memoizedProps)),c=!c),c&&os&&pr(r),hy(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));os=Lx(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));os=Lx(r)}else o===27?(o=os,wr(r.type)?(r=T_,T_=null,os=r):os=o):os=Ws?Vi(r.stateNode.nextSibling):null;return!0}function ia(){os=Ws=null,Pt=!1}function ef(){var r=_r;return r!==null&&(_i===null?_i=r:_i.push.apply(_i,r),_r=null),r}function ll(r){_r===null?_r=[r]:_r.push(r)}var tf=L(null),na=null,Un=null;function mr(r,o,c){X(tf,o._currentValue),o._currentValue=c}function jn(r){r._currentValue=tf.current,B(tf)}function sf(r,o,c){for(;r!==null;){var d=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,d!==null&&(d.childLanes|=o)):d!==null&&(d.childLanes&o)!==o&&(d.childLanes|=o),r===c)break;r=r.return}}function nf(r,o,c,d){var g=r.child;for(g!==null&&(g.return=r);g!==null;){var y=g.dependencies;if(y!==null){var S=g.child;y=y.firstContext;e:for(;y!==null;){var P=y;y=g;for(var W=0;W<o.length;W++)if(P.context===o[W]){y.lanes|=c,P=y.alternate,P!==null&&(P.lanes|=c),sf(y.return,c,r),d||(S=null);break e}y=P.next}}else if(g.tag===18){if(S=g.return,S===null)throw Error(s(341));S.lanes|=c,y=S.alternate,y!==null&&(y.lanes|=c),sf(S,c,r),S=null}else S=g.child;if(S!==null)S.return=g;else for(S=g;S!==null;){if(S===r){S=null;break}if(g=S.sibling,g!==null){g.return=S.return,S=g;break}S=S.return}g=S}}function $a(r,o,c,d){r=null;for(var g=o,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var S=g.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var P=g.type;Ti(g.pendingProps.value,S.value)||(r!==null?r.push(P):r=[P])}}else if(g===he.current){if(S=g.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(r!==null?r.push(kl):r=[kl])}g=g.return}r!==null&&nf(o,r,c,d),o.flags|=262144}function Zc(r){for(r=r.firstContext;r!==null;){if(!Ti(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ra(r){na=r,Un=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Ys(r){return dy(na,r)}function Qc(r,o){return na===null&&ra(r),dy(r,o)}function dy(r,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Un===null){if(r===null)throw Error(s(308));Un=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else Un=Un.next=o;return c}var UM=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(c,d){r.push(d)}};this.abort=function(){o.aborted=!0,r.forEach(function(c){return c()})}},jM=i.unstable_scheduleCallback,GM=i.unstable_NormalPriority,Ps={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rf(){return{controller:new UM,data:new Map,refCount:0}}function cl(r){r.refCount--,r.refCount===0&&jM(GM,function(){r.controller.abort()})}var ul=null,af=0,Ja=0,eo=null;function zM(r,o){if(ul===null){var c=ul=[];af=0,Ja=c_(),eo={status:"pending",value:void 0,then:function(d){c.push(d)}}}return af++,o.then(fy,fy),o}function fy(){if(--af===0&&ul!==null){eo!==null&&(eo.status="fulfilled");var r=ul;ul=null,Ja=0,eo=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function HM(r,o){var c=[],d={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return r.then(function(){d.status="fulfilled",d.value=o;for(var g=0;g<c.length;g++)(0,c[g])(o)},function(g){for(d.status="rejected",d.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),d}var _y=z.S;z.S=function(r,o){Qb=we(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&zM(r,o),_y!==null&&_y(r,o)};var aa=L(null);function of(){var r=aa.current;return r!==null?r:Kt.pooledCache}function $c(r,o){o===null?X(aa,aa.current):X(aa,o.pool)}function py(){var r=of();return r===null?null:{parent:Ps._currentValue,pool:r}}var to=Error(s(460)),lf=Error(s(474)),Jc=Error(s(542)),eu={then:function(){}};function my(r){return r=r.status,r==="fulfilled"||r==="rejected"}function gy(r,o,c){switch(c=r[c],c===void 0?r.push(o):c!==o&&(o.then(kn,kn),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,by(r),r;default:if(typeof o.status=="string")o.then(kn,kn);else{if(r=Kt,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=o,r.status="pending",r.then(function(d){if(o.status==="pending"){var g=o;g.status="fulfilled",g.value=d}},function(d){if(o.status==="pending"){var g=o;g.status="rejected",g.reason=d}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,by(r),r}throw la=o,to}}function oa(r){try{var o=r._init;return o(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(la=c,to):c}}var la=null;function yy(){if(la===null)throw Error(s(459));var r=la;return la=null,r}function by(r){if(r===to||r===Jc)throw Error(s(483))}var so=null,hl=0;function tu(r){var o=hl;return hl+=1,so===null&&(so=[]),gy(so,r,o)}function dl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function su(r,o){throw o.$$typeof===b?Error(s(525)):(r=Object.prototype.toString.call(o),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function xy(r){function o(se,Z){if(r){var oe=se.deletions;oe===null?(se.deletions=[Z],se.flags|=16):oe.push(Z)}}function c(se,Z){if(!r)return null;for(;Z!==null;)o(se,Z),Z=Z.sibling;return null}function d(se){for(var Z=new Map;se!==null;)se.key!==null?Z.set(se.key,se):Z.set(se.index,se),se=se.sibling;return Z}function g(se,Z){return se=Bn(se,Z),se.index=0,se.sibling=null,se}function y(se,Z,oe){return se.index=oe,r?(oe=se.alternate,oe!==null?(oe=oe.index,oe<Z?(se.flags|=67108866,Z):oe):(se.flags|=67108866,Z)):(se.flags|=1048576,Z)}function S(se){return r&&se.alternate===null&&(se.flags|=67108866),se}function P(se,Z,oe,ve){return Z===null||Z.tag!==6?(Z=Kd(oe,se.mode,ve),Z.return=se,Z):(Z=g(Z,oe),Z.return=se,Z)}function W(se,Z,oe,ve){var nt=oe.type;return nt===x?ye(se,Z,oe.props.children,ve,oe.key):Z!==null&&(Z.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===H&&oa(nt)===Z.type)?(Z=g(Z,oe.props),dl(Z,oe),Z.return=se,Z):(Z=Yc(oe.type,oe.key,oe.props,null,se.mode,ve),dl(Z,oe),Z.return=se,Z)}function le(se,Z,oe,ve){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==oe.containerInfo||Z.stateNode.implementation!==oe.implementation?(Z=Zd(oe,se.mode,ve),Z.return=se,Z):(Z=g(Z,oe.children||[]),Z.return=se,Z)}function ye(se,Z,oe,ve,nt){return Z===null||Z.tag!==7?(Z=sa(oe,se.mode,ve,nt),Z.return=se,Z):(Z=g(Z,oe),Z.return=se,Z)}function Ee(se,Z,oe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Kd(""+Z,se.mode,oe),Z.return=se,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return oe=Yc(Z.type,Z.key,Z.props,null,se.mode,oe),dl(oe,Z),oe.return=se,oe;case R:return Z=Zd(Z,se.mode,oe),Z.return=se,Z;case H:return Z=oa(Z),Ee(se,Z,oe)}if(Te(Z)||ae(Z))return Z=sa(Z,se.mode,oe,null),Z.return=se,Z;if(typeof Z.then=="function")return Ee(se,tu(Z),oe);if(Z.$$typeof===D)return Ee(se,Qc(se,Z),oe);su(se,Z)}return null}function ue(se,Z,oe,ve){var nt=Z!==null?Z.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return nt!==null?null:P(se,Z,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return oe.key===nt?W(se,Z,oe,ve):null;case R:return oe.key===nt?le(se,Z,oe,ve):null;case H:return oe=oa(oe),ue(se,Z,oe,ve)}if(Te(oe)||ae(oe))return nt!==null?null:ye(se,Z,oe,ve,null);if(typeof oe.then=="function")return ue(se,Z,tu(oe),ve);if(oe.$$typeof===D)return ue(se,Z,Qc(se,oe),ve);su(se,oe)}return null}function pe(se,Z,oe,ve,nt){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return se=se.get(oe)||null,P(Z,se,""+ve,nt);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return se=se.get(ve.key===null?oe:ve.key)||null,W(Z,se,ve,nt);case R:return se=se.get(ve.key===null?oe:ve.key)||null,le(Z,se,ve,nt);case H:return ve=oa(ve),pe(se,Z,oe,ve,nt)}if(Te(ve)||ae(ve))return se=se.get(oe)||null,ye(Z,se,ve,nt,null);if(typeof ve.then=="function")return pe(se,Z,oe,tu(ve),nt);if(ve.$$typeof===D)return pe(se,Z,oe,Qc(Z,ve),nt);su(Z,ve)}return null}function Ye(se,Z,oe,ve){for(var nt=null,kt=null,$e=Z,gt=Z=0,Mt=null;$e!==null&&gt<oe.length;gt++){$e.index>gt?(Mt=$e,$e=null):Mt=$e.sibling;var Lt=ue(se,$e,oe[gt],ve);if(Lt===null){$e===null&&($e=Mt);break}r&&$e&&Lt.alternate===null&&o(se,$e),Z=y(Lt,Z,gt),kt===null?nt=Lt:kt.sibling=Lt,kt=Lt,$e=Mt}if(gt===oe.length)return c(se,$e),Pt&&Nn(se,gt),nt;if($e===null){for(;gt<oe.length;gt++)$e=Ee(se,oe[gt],ve),$e!==null&&(Z=y($e,Z,gt),kt===null?nt=$e:kt.sibling=$e,kt=$e);return Pt&&Nn(se,gt),nt}for($e=d($e);gt<oe.length;gt++)Mt=pe($e,se,gt,oe[gt],ve),Mt!==null&&(r&&Mt.alternate!==null&&$e.delete(Mt.key===null?gt:Mt.key),Z=y(Mt,Z,gt),kt===null?nt=Mt:kt.sibling=Mt,kt=Mt);return r&&$e.forEach(function(Fr){return o(se,Fr)}),Pt&&Nn(se,gt),nt}function ot(se,Z,oe,ve){if(oe==null)throw Error(s(151));for(var nt=null,kt=null,$e=Z,gt=Z=0,Mt=null,Lt=oe.next();$e!==null&&!Lt.done;gt++,Lt=oe.next()){$e.index>gt?(Mt=$e,$e=null):Mt=$e.sibling;var Fr=ue(se,$e,Lt.value,ve);if(Fr===null){$e===null&&($e=Mt);break}r&&$e&&Fr.alternate===null&&o(se,$e),Z=y(Fr,Z,gt),kt===null?nt=Fr:kt.sibling=Fr,kt=Fr,$e=Mt}if(Lt.done)return c(se,$e),Pt&&Nn(se,gt),nt;if($e===null){for(;!Lt.done;gt++,Lt=oe.next())Lt=Ee(se,Lt.value,ve),Lt!==null&&(Z=y(Lt,Z,gt),kt===null?nt=Lt:kt.sibling=Lt,kt=Lt);return Pt&&Nn(se,gt),nt}for($e=d($e);!Lt.done;gt++,Lt=oe.next())Lt=pe($e,se,gt,Lt.value,ve),Lt!==null&&(r&&Lt.alternate!==null&&$e.delete(Lt.key===null?gt:Lt.key),Z=y(Lt,Z,gt),kt===null?nt=Lt:kt.sibling=Lt,kt=Lt);return r&&$e.forEach(function(eP){return o(se,eP)}),Pt&&Nn(se,gt),nt}function Wt(se,Z,oe,ve){if(typeof oe=="object"&&oe!==null&&oe.type===x&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:e:{for(var nt=oe.key;Z!==null;){if(Z.key===nt){if(nt=oe.type,nt===x){if(Z.tag===7){c(se,Z.sibling),ve=g(Z,oe.props.children),ve.return=se,se=ve;break e}}else if(Z.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===H&&oa(nt)===Z.type){c(se,Z.sibling),ve=g(Z,oe.props),dl(ve,oe),ve.return=se,se=ve;break e}c(se,Z);break}else o(se,Z);Z=Z.sibling}oe.type===x?(ve=sa(oe.props.children,se.mode,ve,oe.key),ve.return=se,se=ve):(ve=Yc(oe.type,oe.key,oe.props,null,se.mode,ve),dl(ve,oe),ve.return=se,se=ve)}return S(se);case R:e:{for(nt=oe.key;Z!==null;){if(Z.key===nt)if(Z.tag===4&&Z.stateNode.containerInfo===oe.containerInfo&&Z.stateNode.implementation===oe.implementation){c(se,Z.sibling),ve=g(Z,oe.children||[]),ve.return=se,se=ve;break e}else{c(se,Z);break}else o(se,Z);Z=Z.sibling}ve=Zd(oe,se.mode,ve),ve.return=se,se=ve}return S(se);case H:return oe=oa(oe),Wt(se,Z,oe,ve)}if(Te(oe))return Ye(se,Z,oe,ve);if(ae(oe)){if(nt=ae(oe),typeof nt!="function")throw Error(s(150));return oe=nt.call(oe),ot(se,Z,oe,ve)}if(typeof oe.then=="function")return Wt(se,Z,tu(oe),ve);if(oe.$$typeof===D)return Wt(se,Z,Qc(se,oe),ve);su(se,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,Z!==null&&Z.tag===6?(c(se,Z.sibling),ve=g(Z,oe),ve.return=se,se=ve):(c(se,Z),ve=Kd(oe,se.mode,ve),ve.return=se,se=ve),S(se)):c(se,Z)}return function(se,Z,oe,ve){try{hl=0;var nt=Wt(se,Z,oe,ve);return so=null,nt}catch($e){if($e===to||$e===Jc)throw $e;var kt=Ei(29,$e,null,se.mode);return kt.lanes=ve,kt.return=se,kt}finally{}}}var ca=xy(!0),vy=xy(!1),gr=!1;function cf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uf(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function yr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function br(r,o,c){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(jt&2)!==0){var g=d.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),d.pending=o,o=Wc(r),ny(r,null,c),o}return qc(r,d,o,c),Wc(r)}function fl(r,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var d=o.lanes;d&=r.pendingLanes,c|=d,o.lanes=c,Rt(r,c)}}function hf(r,o){var c=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,c===d)){var g=null,y=null;if(c=c.firstBaseUpdate,c!==null){do{var S={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};y===null?g=y=S:y=y.next=S,c=c.next}while(c!==null);y===null?g=y=o:y=y.next=o}else g=y=o;c={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=o:r.next=o,c.lastBaseUpdate=o}var df=!1;function _l(){if(df){var r=eo;if(r!==null)throw r}}function pl(r,o,c,d){df=!1;var g=r.updateQueue;gr=!1;var y=g.firstBaseUpdate,S=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var W=P,le=W.next;W.next=null,S===null?y=le:S.next=le,S=W;var ye=r.alternate;ye!==null&&(ye=ye.updateQueue,P=ye.lastBaseUpdate,P!==S&&(P===null?ye.firstBaseUpdate=le:P.next=le,ye.lastBaseUpdate=W))}if(y!==null){var Ee=g.baseState;S=0,ye=le=W=null,P=y;do{var ue=P.lane&-536870913,pe=ue!==P.lane;if(pe?(At&ue)===ue:(d&ue)===ue){ue!==0&&ue===Ja&&(df=!0),ye!==null&&(ye=ye.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ye=r,ot=P;ue=o;var Wt=c;switch(ot.tag){case 1:if(Ye=ot.payload,typeof Ye=="function"){Ee=Ye.call(Wt,Ee,ue);break e}Ee=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=ot.payload,ue=typeof Ye=="function"?Ye.call(Wt,Ee,ue):Ye,ue==null)break e;Ee=p({},Ee,ue);break e;case 2:gr=!0}}ue=P.callback,ue!==null&&(r.flags|=64,pe&&(r.flags|=8192),pe=g.callbacks,pe===null?g.callbacks=[ue]:pe.push(ue))}else pe={lane:ue,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ye===null?(le=ye=pe,W=Ee):ye=ye.next=pe,S|=ue;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;pe=P,P=pe.next,pe.next=null,g.lastBaseUpdate=pe,g.shared.pending=null}}while(!0);ye===null&&(W=Ee),g.baseState=W,g.firstBaseUpdate=le,g.lastBaseUpdate=ye,y===null&&(g.shared.lanes=0),Er|=S,r.lanes=S,r.memoizedState=Ee}}function Ry(r,o){if(typeof r!="function")throw Error(s(191,r));r.call(o)}function Ty(r,o){var c=r.callbacks;
vendor: 5,015 bytes, line 49
49if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)Ry(c[r],o)}var io=L(null),iu=L(0);function Ey(r,o){r=Kn,X(iu,r),X(io,o),Kn=r|o.baseLanes}function ff(){X(iu,Kn),X(io,io.current)}function _f(){Kn=iu.current,B(io),B(iu)}var Si=L(null),Hi=null;function xr(r){var o=r.alternate;X(Es,Es.current&1),X(Si,r),Hi===null&&(o===null||io.current!==null||o.memoizedState!==null)&&(Hi=r)}function pf(r){X(Es,Es.current),X(Si,r),Hi===null&&(Hi=r)}function Sy(r){r.tag===22?(X(Es,Es.current),X(Si,r),Hi===null&&(Hi=r)):vr()}function vr(){X(Es,Es.current),X(Si,Si.current)}function Ci(r){B(Si),Hi===r&&(Hi=null),B(Es)}var Es=L(0);function nu(r){for(var o=r;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||v_(c)||R_(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Gn=0,mt=null,Xt=null,Os=null,ru=!1,no=!1,ua=!1,au=0,ml=0,ro=null,VM=0;function gs(){throw Error(s(321))}function mf(r,o){if(o===null)return!1;for(var c=0;c<o.length&&c<r.length;c++)if(!Ti(r[c],o[c]))return!1;return!0}function gf(r,o,c,d,g,y){return Gn=y,mt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,z.H=r===null||r.memoizedState===null?lb:Df,ua=!1,y=c(d,g),ua=!1,no&&(y=Ay(o,c,d,g)),Cy(r),y}function Cy(r){z.H=bl;var o=Xt!==null&&Xt.next!==null;if(Gn=0,Os=Xt=mt=null,ru=!1,ml=0,ro=null,o)throw Error(s(300));r===null||Ds||(r=r.dependencies,r!==null&&Zc(r)&&(Ds=!0))}function Ay(r,o,c,d){mt=r;var g=0;do{if(no&&(ro=null),ml=0,no=!1,25<=g)throw Error(s(301));if(g+=1,Os=Xt=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}z.H=cb,y=o(c,d)}while(no);return y}function XM(){var r=z.H,o=r.useState()[0];return o=typeof o.then=="function"?gl(o):o,r=r.useState()[0],(Xt!==null?Xt.memoizedState:null)!==r&&(mt.flags|=1024),o}function yf(){var r=au!==0;return au=0,r}function bf(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function xf(r){if(ru){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ru=!1}Gn=0,Os=Xt=mt=null,no=!1,ml=au=0,ro=null}function si(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Os===null?mt.memoizedState=Os=r:Os=Os.next=r,Os}function Ss(){if(Xt===null){var r=mt.alternate;r=r!==null?r.memoizedState:null}else r=Xt.next;var o=Os===null?mt.memoizedState:Os.next;if(o!==null)Os=o,Xt=r;else{if(r===null)throw mt.alternate===null?Error(s(467)):Error(s(310));Xt=r,r={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},Os===null?mt.memoizedState=Os=r:Os=Os.next=r}return Os}function ou(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gl(r){var o=ml;return ml+=1,ro===null&&(ro=[]),r=gy(ro,r,o),o=mt,(Os===null?o.memoizedState:Os.next)===null&&(o=o.alternate,z.H=o===null||o.memoizedState===null?lb:Df),r}function lu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return gl(r);if(r.$$typeof===D)return Ys(r)}throw Error(s(438,String(r)))}function vf(r){var o=null,c=mt.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var d=mt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(o={data:d.data.map(function(g){return g.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=ou(),mt.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(r),d=0;d<r;d++)c[d]=re;return o.index++,c}function zn(r,o){return typeof o=="function"?o(r):o}function cu(r){var o=Ss();return Rf(o,Xt,r)}function Rf(r,o,c){var d=r.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=c;var g=r.baseQueue,y=d.pending;if(y!==null){if(g!==null){var S=g.next;g.next=y.next,y.next=S}o.baseQueue=g=y,d.pending=null}if(y=r.baseState,g===null)r.memoizedState=y;else{o=g.next;var P=S=null,W=null,le=o,ye=!1;do{var Ee=le.lane&-536870913;if(Ee!==le.lane?(At&Ee)===Ee:(Gn&Ee)===Ee){var ue=le.revertLane;if(ue===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),Ee===Ja&&(ye=!0);else if((Gn&ue)===ue){le=le.next,ue===Ja&&(ye=!0);continue}else Ee={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},W===null?(P=W=Ee,S=y):W=W.next=Ee,mt.lanes|=ue,Er|=ue;Ee=le.action,ua&&c(y,Ee),y=le.hasEagerState?le.eagerState:c(y,Ee)}else ue={lane:Ee,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},W===null?(P=W=ue,S=y):W=W.next=ue,mt.lanes|=Ee,Er|=Ee;le=le.next}
vendor: 12,455 bytes, line 49
49while(le!==null&&le!==o);if(W===null?S=y:W.next=P,!Ti(y,r.memoizedState)&&(Ds=!0,ye&&(c=eo,c!==null)))throw c;r.memoizedState=y,r.baseState=S,r.baseQueue=W,d.lastRenderedState=y}return g===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Tf(r){var o=Ss(),c=o.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var d=c.dispatch,g=c.pending,y=o.memoizedState;if(g!==null){c.pending=null;var S=g=g.next;do y=r(y,S.action),S=S.next;while(S!==g);Ti(y,o.memoizedState)||(Ds=!0),o.memoizedState=y,o.baseQueue===null&&(o.baseState=y),c.lastRenderedState=y}return[y,d]}function My(r,o,c){var d=mt,g=Ss(),y=Pt;if(y){if(c===void 0)throw Error(s(407));c=c()}else c=o();var S=!Ti((Xt||g).memoizedState,c);if(S&&(g.memoizedState=c,Ds=!0),g=g.queue,Cf(Oy.bind(null,d,g,r),[r]),g.getSnapshot!==o||S||Os!==null&&Os.memoizedState.tag&1){if(d.flags|=2048,ao(9,{destroy:void 0},Py.bind(null,d,g,c,o),null),Kt===null)throw Error(s(349));y||(Gn&127)!==0||wy(d,o,c)}return c}function wy(r,o,c){r.flags|=16384,r={getSnapshot:o,value:c},o=mt.updateQueue,o===null?(o=ou(),mt.updateQueue=o,o.stores=[r]):(c=o.stores,c===null?o.stores=[r]:c.push(r))}function Py(r,o,c,d){o.value=c,o.getSnapshot=d,Dy(o)&&Iy(r)}function Oy(r,o,c){return c(function(){Dy(o)&&Iy(r)})}function Dy(r){var o=r.getSnapshot;r=r.value;try{var c=o();return!Ti(r,c)}catch{return!0}}function Iy(r){var o=ta(r,2);o!==null&&pi(o,r,2)}function Ef(r){var o=si();if(typeof r=="function"){var c=r;if(r=c(),ua){rt(!0);try{c()}finally{rt(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:r},o}function Fy(r,o,c,d){return r.baseState=c,Rf(r,Xt,typeof d=="function"?d:zn)}function qM(r,o,c,d,g){if(du(r))throw Error(s(485));if(r=o.action,r!==null){var y={payload:g,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};z.T!==null?c(!0):y.isTransition=!1,d(y),c=o.pending,c===null?(y.next=o.pending=y,ky(o,y)):(y.next=c.next,o.pending=c.next=y)}}function ky(r,o){var c=o.action,d=o.payload,g=r.state;if(o.isTransition){var y=z.T,S={};z.T=S;try{var P=c(g,d),W=z.S;W!==null&&W(S,P),Ly(r,o,P)}catch(le){Sf(r,o,le)}finally{y!==null&&S.types!==null&&(y.types=S.types),z.T=y}}else try{y=c(g,d),Ly(r,o,y)}catch(le){Sf(r,o,le)}}function Ly(r,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(d){By(r,o,d)},function(d){return Sf(r,o,d)}):By(r,o,c)}function By(r,o,c){o.status="fulfilled",o.value=c,Ny(o),r.state=c,o=r.pending,o!==null&&(c=o.next,c===o?r.pending=null:(c=c.next,o.next=c,ky(r,c)))}function Sf(r,o,c){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do o.status="rejected",o.reason=c,Ny(o),o=o.next;while(o!==d)}r.action=null}function Ny(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function Uy(r,o){return o}function jy(r,o){if(Pt){var c=Kt.formState;if(c!==null){e:{var d=mt;if(Pt){if(os){t:{for(var g=os,y=zi;g.nodeType!==8;){if(!y){g=null;break t}if(g=Vi(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){os=Vi(g.nextSibling),d=g.data==="F!";break e}}pr(d)}d=!1}d&&(o=c[0])}}return c=si(),c.memoizedState=c.baseState=o,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uy,lastRenderedState:o},c.queue=d,c=rb.bind(null,mt,d),d.dispatch=c,d=Ef(!1),y=Of.bind(null,mt,!1,d.queue),d=si(),g={state:o,dispatch:null,action:r,pending:null},d.queue=g,c=qM.bind(null,mt,g,y,c),g.dispatch=c,d.memoizedState=r,[o,c,!1]}function Gy(r){var o=Ss();return zy(o,Xt,r)}function zy(r,o,c){if(o=Rf(r,o,Uy)[0],r=cu(zn)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var d=gl(o)}catch(S){throw S===to?Jc:S}else d=o;o=Ss();var g=o.queue,y=g.dispatch;return c!==o.memoizedState&&(mt.flags|=2048,ao(9,{destroy:void 0},WM.bind(null,g,c),null)),[d,y,r]}function WM(r,o){r.action=o}function Hy(r){var o=Ss(),c=Xt;if(c!==null)return zy(o,c,r);Ss(),o=o.memoizedState,c=Ss();var d=c.queue.dispatch;return c.memoizedState=r,[o,d,!1]}function ao(r,o,c,d){return r={tag:r,create:c,deps:d,inst:o,next:null},o=mt.updateQueue,o===null&&(o=ou(),mt.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=r.next=r:(d=c.next,c.next=r,r.next=d,o.lastEffect=r),r}function Vy(){return Ss().memoizedState}function uu(r,o,c,d){var g=si();mt.flags|=r,g.memoizedState=ao(1|o,{destroy:void 0},c,d===void 0?null:d)}function hu(r,o,c,d){var g=Ss();d=d===void 0?null:d;var y=g.memoizedState.inst;Xt!==null&&d!==null&&mf(d,Xt.memoizedState.deps)?g.memoizedState=ao(o,y,c,d):(mt.flags|=r,g.memoizedState=ao(1|o,y,c,d))}function Xy(r,o){uu(8390656,8,r,o)}function Cf(r,o){hu(2048,8,r,o)}function YM(r){mt.flags|=4;var o=mt.updateQueue;if(o===null)o=ou(),mt.updateQueue=o,o.events=[r];else{var c=o.events;c===null?o.events=[r]:c.push(r)}}function qy(r){var o=Ss().memoizedState;return YM({ref:o,nextImpl:r}),function(){if((jt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}function Wy(r,o){return hu(4,2,r,o)}function Yy(r,o){return hu(4,4,r,o)}function Ky(r,o){if(typeof o=="function"){r=r();var c=o(r);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function Zy(r,o,c){c=c!=null?c.concat([r]):null,hu(4,4,Ky.bind(null,o,r),c)}function Af(){}function Qy(r,o){var c=Ss();o=o===void 0?null:o;var d=c.memoizedState;return o!==null&&mf(o,d[1])?d[0]:(c.memoizedState=[r,o],r)}function $y(r,o){var c=Ss();o=o===void 0?null:o;var d=c.memoizedState;if(o!==null&&mf(o,d[1]))return d[0];if(d=r(),ua){rt(!0);try{r()}finally{rt(!1)}}return c.memoizedState=[d,o],d}function Mf(r,o,c){return c===void 0||(Gn&1073741824)!==0&&(At&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=Jb(),mt.lanes|=r,Er|=r,c)}function Jy(r,o,c,d){return Ti(c,o)?c:io.current!==null?(r=Mf(r,c,d),Ti(r,o)||(Ds=!0),r):(Gn&42)===0||(Gn&1073741824)!==0&&(At&261930)===0?(Ds=!0,r.memoizedState=c):(r=Jb(),mt.lanes|=r,Er|=r,o)}function eb(r,o,c,d,g){var y=J.p;J.p=y!==0&&8>y?y:8;var S=z.T,P={};z.T=P,Of(r,!1,o,c);try{var W=g(),le=z.S;if(le!==null&&le(P,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ye=HM(W,d);yl(r,o,ye,wi(r))}else yl(r,o,d,wi(r))}catch(Ee){yl(r,o,{then:function(){},status:"rejected",reason:Ee},wi())}finally{J.p=y,S!==null&&P.types!==null&&(S.types=P.types),z.T=S}}function KM(){}function wf(r,o,c,d){if(r.tag!==5)throw Error(s(476));var g=tb(r).queue;eb(r,g,o,Y,c===null?KM:function(){return sb(r),c(d)})}function tb(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:Y},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:c},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function sb(r){var o=tb(r);o.next===null&&(o=r.alternate.memoizedState),yl(r,o.next.queue,{},wi())}function Pf(){return Ys(kl)}function ib(){return Ss().memoizedState}function nb(){return Ss().memoizedState}function ZM(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=wi();r=yr(c);var d=br(o,r,c);d!==null&&(pi(d,o,c),fl(d,o,c)),o={cache:rf()},r.payload=o;return}o=o.return}}function QM(r,o,c){var d=wi();c={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},du(r)?ab(o,c):(c=Wd(r,o,c,d),c!==null&&(pi(c,r,d),ob(c,o,d)))}function rb(r,o,c){var d=wi();yl(r,o,c,d)}function yl(r,o,c,d){var g={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(du(r))ab(o,g);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var S=o.lastRenderedState,P=y(S,c);if(g.hasEagerState=!0,g.eagerState=P,Ti(P,S))return qc(r,o,g,0),Kt===null&&Xc(),!1}catch{}finally{}if(c=Wd(r,o,g,d),c!==null)return pi(c,r,d),ob(c,o,d),!0}return!1}function Of(r,o,c,d){if(d={lane:2,revertLane:c_(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},du(r)){if(o)throw Error(s(479))}else o=Wd(r,c,d,2),o!==null&&pi(o,r,2)}function du(r){var o=r.alternate;return r===mt||o!==null&&o===mt}function ab(r,o){no=ru=!0;var c=r.pending;c===null?o.next=o:(o.next=c.next,c.next=o),r.pending=o}function ob(r,o,c){if((c&4194048)!==0){var d=o.lanes;d&=r.pendingLanes,c|=d,o.lanes=c,Rt(r,c)}}var bl={readContext:Ys,use:lu,useCallback:gs,useContext:gs,useEffect:gs,useImperativeHandle:gs,useLayoutEffect:gs,useInsertionEffect:gs,useMemo:gs,useReducer:gs,useRef:gs,useState:gs,useDebugValue:gs,useDeferredValue:gs,useTransition:gs,useSyncExternalStore:gs,useId:gs,useHostTransitionStatus:gs,useFormState:gs,useActionState:gs,useOptimistic:gs,useMemoCache:gs,useCacheRefresh:gs};bl.useEffectEvent=gs;var lb={readContext:Ys,use:lu,useCallback:function(r,o){return si().memoizedState=[r,o===void 0?null:o],r},useContext:Ys,useEffect:Xy,useImperativeHandle:function(r,o,c){c=c!=null?c.concat([r]):null,uu(4194308,4,Ky.bind(null,o,r),c)},useLayoutEffect:function(r,o){return uu(4194308,4,r,o)},useInsertionEffect:function(r,o){uu(4,2,r,o)},useMemo:function(r,o){var c=si();o=o===void 0?null:o;var d=r();if(ua){rt(!0);try{r()}finally{rt(!1)}}return c.memoizedState=[d,o],d},useReducer:function(r,o,c){var d=si();if(c!==void 0){var g=c(o);if(ua){rt(!0);try{c(o)}finally{rt(!1)}}}else g=o;return d.memoizedState=d.baseState=g,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:g},d.queue=r,r=r.dispatch=QM.bind(null,mt,r),[d.memoizedState,r]},useRef:function(r){var o=si();return r={current:r},o.memoizedState=r},useState:function(r){r=Ef(r);var o=r.queue,c=rb.bind(null,mt,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Af,useDeferredValue:function(r,o){var c=si();return Mf(c,r,o)},useTransition:function(){var r=Ef(!1);return r=eb.bind(null,mt,r.queue,!0,!1),si().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,c){var d=mt,g=si();if(Pt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=o(),Kt===null)throw Error(s(349));(At&127)!==0||wy(d,o,c)}g.memoizedState=c;var y={value:c,getSnapshot:o};return g.queue=y,Xy(Oy.bind(null,d,y,r),[r]),d.flags|=2048,ao(9,{destroy:void 0},Py.bind(null,d,y,c,o),null),c},useId:function(){var r=si(),o=Kt.identifierPrefix;if(Pt){var c=fn,d=dn;c=(d&~(1<<32-vt(d)-1)).toString(32)+c,o="_"+o+"R_"+c,c=au++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=VM++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Pf,useFormState:jy,useActionState:jy,useOptimistic:function(r){var o=si();o.memoizedState=o.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Of.bind(null,mt,!0,c),c.dispatch=o,[r,o]},useMemoCache:vf,useCacheRefresh:function(){return si().memoizedState=ZM.bind(null,mt)},useEffectEvent:function(r){var o=si(),c={impl:r};return o.memoizedState=c,function(){if((jt&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Df={readContext:Ys,use:lu,useCallback:Qy,useContext:Ys,useEffect:Cf,useImperativeHandle:Zy,useInsertionEffect:Wy,useLayoutEffect:Yy,useMemo:$y,useReducer:cu,useRef:Vy,useState:function(){return cu(zn)},useDebugValue:Af,useDeferredValue:function(r,o){var c=Ss();return Jy(c,Xt.memoizedState,r,o)},useTransition:function(){var r=cu(zn)[0],o=Ss().memoizedState;return[typeof r=="boolean"?r:gl(r),o]},useSyncExternalStore:My,useId:ib,useHostTransitionStatus:Pf,useFormState:Gy,useActionState:Gy,useOptimistic:function(r,o){var c=Ss();return Fy(c,Xt,r,o)},useMemoCache:vf,useCacheRefresh:nb};Df.useEffectEvent=qy;var cb={readContext:Ys,use:lu,useCallback:Qy,useContext:Ys,useEffect:Cf,useImperativeHandle:Zy,useInsertionEffect:Wy,useLayoutEffect:Yy,useMemo:$y,useReducer:Tf,useRef:Vy,useState:function(){return Tf(zn)},useDebugValue:Af,useDeferredValue:function(r,o){var c=Ss();return Xt===null?Mf(c,r,o):Jy(c,Xt.memoizedState,r,o)},useTransition:function(){var r=Tf(zn)[0],o=Ss().memoizedState;return[typeof r=="boolean"?r:gl(r),o]},useSyncExternalStore:My,useId:ib,useHostTransitionStatus:Pf,useFormState:Hy,useActionState:Hy,useOptimistic:function(r,o){var c=Ss();return Xt!==null?Fy(c,Xt,r,o):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:vf,useCacheRefresh:nb};cb.useEffectEvent=qy;function If(r,o,c,d){o=r.memoizedState,c=c(d,o),c=c==null?o:p({},o,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Ff={enqueueSetState:function(r,o,c){r=r._reactInternals;
vendor: 13,670 bytes, line 49
49var d=wi(),g=yr(d);g.payload=o,c!=null&&(g.callback=c),o=br(r,g,d),o!==null&&(pi(o,r,d),fl(o,r,d))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var d=wi(),g=yr(d);g.tag=1,g.payload=o,c!=null&&(g.callback=c),o=br(r,g,d),o!==null&&(pi(o,r,d),fl(o,r,d))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=wi(),d=yr(c);d.tag=2,o!=null&&(d.callback=o),o=br(r,d,c),o!==null&&(pi(o,r,c),fl(o,r,c))}};function ub(r,o,c,d,g,y,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,y,S):o.prototype&&o.prototype.isPureReactComponent?!rl(c,d)||!rl(g,y):!0}function hb(r,o,c,d){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,d),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,d),o.state!==r&&Ff.enqueueReplaceState(o,o.state,null)}function ha(r,o){var c=o;if("ref"in o){c={};for(var d in o)d!=="ref"&&(c[d]=o[d])}if(r=r.defaultProps){c===o&&(c=p({},c));for(var g in r)c[g]===void 0&&(c[g]=r[g])}return c}function db(r){Vc(r)}function fb(r){console.error(r)}function _b(r){Vc(r)}function fu(r,o){try{var c=r.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(d){setTimeout(function(){throw d})}}function pb(r,o,c){try{var d=r.onCaughtError;d(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function kf(r,o,c){return c=yr(c),c.tag=3,c.payload={element:null},c.callback=function(){fu(r,o)},c}function mb(r){return r=yr(r),r.tag=3,r}function gb(r,o,c,d){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var y=d.value;r.payload=function(){return g(y)},r.callback=function(){pb(o,c,d)}}var S=c.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){pb(o,c,d),typeof g!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var P=d.stack;this.componentDidCatch(d.value,{componentStack:P!==null?P:""})})}function $M(r,o,c,d,g){if(c.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(o=c.alternate,o!==null&&$a(o,c,g,!0),c=Si.current,c!==null){switch(c.tag){case 31:case 13:return Hi===null?Su():c.alternate===null&&ys===0&&(ys=3),c.flags&=-257,c.flags|=65536,c.lanes=g,d===eu?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([d]):o.add(d),a_(r,d,g)),!1;case 22:return c.flags|=65536,d===eu?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([d])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([d]):c.add(d)),a_(r,d,g)),!1}throw Error(s(435,c.tag))}return a_(r,d,g),Su(),!1}if(Pt)return o=Si.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=g,d!==Jd&&(r=Error(s(422),{cause:d}),ll(Ui(r,c)))):(d!==Jd&&(o=Error(s(423),{cause:d}),ll(Ui(o,c))),r=r.current.alternate,r.flags|=65536,g&=-g,r.lanes|=g,d=Ui(d,c),g=kf(r.stateNode,d,g),hf(r,g),ys!==4&&(ys=2)),!1;var y=Error(s(520),{cause:d});if(y=Ui(y,c),Al===null?Al=[y]:Al.push(y),ys!==4&&(ys=2),o===null)return!0;d=Ui(d,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,r=g&-g,c.lanes|=r,r=kf(c.stateNode,d,r),hf(c,r),!1;case 1:if(o=c.type,y=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Sr===null||!Sr.has(y))))return c.flags|=65536,g&=-g,c.lanes|=g,g=mb(g),gb(g,r,c,d),hf(c,g),!1}c=c.return}while(c!==null);return!1}var Lf=Error(s(461)),Ds=!1;function Ks(r,o,c,d){o.child=r===null?vy(o,null,c,d):ca(o,r.child,c,d)}function yb(r,o,c,d,g){c=c.render;var y=o.ref;if("ref"in d){var S={};for(var P in d)P!=="ref"&&(S[P]=d[P])}else S=d;return ra(o),d=gf(r,o,c,S,y,g),P=yf(),r!==null&&!Ds?(bf(r,o,g),Hn(r,o,g)):(Pt&&P&&Qd(o),o.flags|=1,Ks(r,o,d,g),o.child)}function bb(r,o,c,d,g){if(r===null){var y=c.type;return typeof y=="function"&&!Yd(y)&&y.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=y,xb(r,o,y,d,g)):(r=Yc(c.type,null,d,o,o.mode,g),r.ref=o.ref,r.return=o,o.child=r)}if(y=r.child,!Vf(r,g)){var S=y.memoizedProps;if(c=c.compare,c=c!==null?c:rl,c(S,d)&&r.ref===o.ref)return Hn(r,o,g)}return o.flags|=1,r=Bn(y,d),r.ref=o.ref,r.return=o,o.child=r}function xb(r,o,c,d,g){if(r!==null){var y=r.memoizedProps;if(rl(y,d)&&r.ref===o.ref)if(Ds=!1,o.pendingProps=d=y,Vf(r,g))(r.flags&131072)!==0&&(Ds=!0);else return o.lanes=r.lanes,Hn(r,o,g)}return Bf(r,o,c,d,g)}function vb(r,o,c,d){var g=d.children,y=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((o.flags&128)!==0){if(y=y!==null?y.baseLanes|c:c,r!==null){for(d=o.child=r.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~y}else d=0,o.child=null;return Rb(r,o,y,c,d)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&$c(o,y!==null?y.cachePool:null),y!==null?Ey(o,y):ff(),Sy(o);else return d=o.lanes=536870912,Rb(r,o,y!==null?y.baseLanes|c:c,c,d)}else y!==null?($c(o,y.cachePool),Ey(o,y),vr(),o.memoizedState=null):(r!==null&&$c(o,null),ff(),vr());return Ks(r,o,g,c),o.child}function xl(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Rb(r,o,c,d,g){var y=of();return y=y===null?null:{parent:Ps._currentValue,pool:y},o.memoizedState={baseLanes:c,cachePool:y},r!==null&&$c(o,null),ff(),Sy(o),r!==null&&$a(r,o,d,!0),o.childLanes=g,null}function _u(r,o){return o=mu({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function Tb(r,o,c){return ca(o,r.child,null,c),r=_u(o,o.pendingProps),r.flags|=2,Ci(o),o.memoizedState=null,r}function JM(r,o,c){var d=o.pendingProps,g=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(Pt){if(d.mode==="hidden")return r=_u(o,d),o.lanes=536870912,xl(null,r);if(pf(o),(r=os)?(r=kx(r,zi),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:fr!==null?{id:dn,overflow:fn}:null,retryLane:536870912,hydrationErrors:null},c=ay(r),c.return=o,o.child=c,Ws=o,os=null)):r=null,r===null)throw pr(o);return o.lanes=536870912,null}return _u(o,d)}var y=r.memoizedState;if(y!==null){var S=y.dehydrated;if(pf(o),g)if(o.flags&256)o.flags&=-257,o=Tb(r,o,c);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(s(558));else if(Ds||$a(r,o,c,!1),g=(c&r.childLanes)!==0,Ds||g){if(d=Kt,d!==null&&(S=as(d,c),S!==0&&S!==y.retryLane))throw y.retryLane=S,ta(r,S),pi(d,r,S),Lf;Su(),o=Tb(r,o,c)}else r=y.treeContext,os=Vi(S.nextSibling),Ws=o,Pt=!0,_r=null,zi=!1,r!==null&&cy(o,r),o=_u(o,d),o.flags|=4096;return o}return r=Bn(r.child,{mode:d.mode,children:d.children}),r.ref=o.ref,o.child=r,r.return=o,r}function pu(r,o){var c=o.ref;if(c===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(o.flags|=4194816)}}function Bf(r,o,c,d,g){return ra(o),c=gf(r,o,c,d,void 0,g),d=yf(),r!==null&&!Ds?(bf(r,o,g),Hn(r,o,g)):(Pt&&d&&Qd(o),o.flags|=1,Ks(r,o,c,g),o.child)}function Eb(r,o,c,d,g,y){return ra(o),o.updateQueue=null,c=Ay(o,d,c,g),Cy(r),d=yf(),r!==null&&!Ds?(bf(r,o,y),Hn(r,o,y)):(Pt&&d&&Qd(o),o.flags|=1,Ks(r,o,c,y),o.child)}function Sb(r,o,c,d,g){if(ra(o),o.stateNode===null){var y=Ya,S=c.contextType;typeof S=="object"&&S!==null&&(y=Ys(S)),y=new c(d,y),o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Ff,o.stateNode=y,y._reactInternals=o,y=o.stateNode,y.props=d,y.state=o.memoizedState,y.refs={},cf(o),S=c.contextType,y.context=typeof S=="object"&&S!==null?Ys(S):Ya,y.state=o.memoizedState,S=c.getDerivedStateFromProps,typeof S=="function"&&(If(o,c,S,d),y.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&Ff.enqueueReplaceState(y,y.state,null),pl(o,d,y,g),_l(),y.state=o.memoizedState),typeof y.componentDidMount=="function"&&(o.flags|=4194308),d=!0}else if(r===null){y=o.stateNode;var P=o.memoizedProps,W=ha(c,P);y.props=W;var le=y.context,ye=c.contextType;S=Ya,typeof ye=="object"&&ye!==null&&(S=Ys(ye));var Ee=c.getDerivedStateFromProps;ye=typeof Ee=="function"||typeof y.getSnapshotBeforeUpdate=="function",P=o.pendingProps!==P,ye||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(P||le!==S)&&hb(o,y,d,S),gr=!1;var ue=o.memoizedState;y.state=ue,pl(o,d,y,g),_l(),le=o.memoizedState,P||ue!==le||gr?(typeof Ee=="function"&&(If(o,c,Ee,d),le=o.memoizedState),(W=gr||ub(o,c,W,d,ue,le,S))?(ye||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(o.flags|=4194308)):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=d,o.memoizedState=le),y.props=d,y.state=le,y.context=S,d=W):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),d=!1)}else{y=o.stateNode,uf(r,o),S=o.memoizedProps,ye=ha(c,S),y.props=ye,Ee=o.pendingProps,ue=y.context,le=c.contextType,W=Ya,typeof le=="object"&&le!==null&&(W=Ys(le)),P=c.getDerivedStateFromProps,(le=typeof P=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==Ee||ue!==W)&&hb(o,y,d,W),gr=!1,ue=o.memoizedState,y.state=ue,pl(o,d,y,g),_l();var pe=o.memoizedState;S!==Ee||ue!==pe||gr||r!==null&&r.dependencies!==null&&Zc(r.dependencies)?(typeof P=="function"&&(If(o,c,P,d),pe=o.memoizedState),(ye=gr||ub(o,c,ye,d,ue,pe,W)||r!==null&&r.dependencies!==null&&Zc(r.dependencies))?(le||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,pe,W),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,pe,W)),typeof y.componentDidUpdate=="function"&&(o.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===r.memoizedProps&&ue===r.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&ue===r.memoizedState||(o.flags|=1024),o.memoizedProps=d,o.memoizedState=pe),y.props=d,y.state=pe,y.context=W,d=ye):(typeof y.componentDidUpdate!="function"||S===r.memoizedProps&&ue===r.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&ue===r.memoizedState||(o.flags|=1024),d=!1)}return y=d,pu(r,o),d=(o.flags&128)!==0,y||d?(y=o.stateNode,c=d&&typeof c.getDerivedStateFromError!="function"?null:y.render(),o.flags|=1,r!==null&&d?(o.child=ca(o,r.child,null,g),o.child=ca(o,null,c,g)):Ks(r,o,c,g),o.memoizedState=y.state,r=o.child):r=Hn(r,o,g),r}function Cb(r,o,c,d){return ia(),o.flags|=256,Ks(r,o,c,d),o.child}var Nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uf(r){return{baseLanes:r,cachePool:py()}}function jf(r,o,c){return r=r!==null?r.childLanes&~c:0,o&&(r|=Mi),r}function Ab(r,o,c){var d=o.pendingProps,g=!1,y=(o.flags&128)!==0,S;if((S=y)||(S=r!==null&&r.memoizedState===null?!1:(Es.current&2)!==0),S&&(g=!0,o.flags&=-129),S=(o.flags&32)!==0,o.flags&=-33,r===null){if(Pt){if(g?xr(o):vr(),(r=os)?(r=kx(r,zi),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:fr!==null?{id:dn,overflow:fn}:null,retryLane:536870912,hydrationErrors:null},c=ay(r),c.return=o,o.child=c,Ws=o,os=null)):r=null,r===null)throw pr(o);return R_(r)?o.lanes=32:o.lanes=536870912,null}var P=d.children;return d=d.fallback,g?(vr(),g=o.mode,P=mu({mode:"hidden",children:P},g),d=sa(d,g,c,null),P.return=o,d.return=o,P.sibling=d,o.child=P,d=o.child,d.memoizedState=Uf(c),d.childLanes=jf(r,S,c),o.memoizedState=Nf,xl(null,d)):(xr(o),Gf(o,P))}var W=r.memoizedState;if(W!==null&&(P=W.dehydrated,P!==null)){if(y)o.flags&256?(xr(o),o.flags&=-257,o=zf(r,o,c)):o.memoizedState!==null?(vr(),o.child=r.child,o.flags|=128,o=null):(vr(),P=d.fallback,g=o.mode,d=mu({mode:"visible",children:d.children},g),P=sa(P,g,c,null),P.flags|=2,d.return=o,P.return=o,d.sibling=P,o.child=d,ca(o,r.child,null,c),d=o.child,d.memoizedState=Uf(c),d.childLanes=jf(r,S,c),o.memoizedState=Nf,o=xl(null,d));else if(xr(o),R_(P)){if(S=P.nextSibling&&P.nextSibling.dataset,S)var le=S.dgst;S=le,d=Error(s(419)),d.stack="",d.digest=S,ll({value:d,source:null,stack:null}),o=zf(r,o,c)}else if(Ds||$a(r,o,c,!1),S=(c&r.childLanes)!==0,Ds||S){if(S=Kt,S!==null&&(d=as(S,c),d!==0&&d!==W.retryLane))throw W.retryLane=d,ta(r,d),pi(S,r,d),Lf;v_(P)||Su(),o=zf(r,o,c)}else v_(P)?(o.flags|=192,o.child=r.child,o=null):(r=W.treeContext,os=Vi(P.nextSibling),Ws=o,Pt=!0,_r=null,zi=!1,r!==null&&cy(o,r),o=Gf(o,d.children),o.flags|=4096);return o}return g?(vr(),P=d.fallback,g=o.mode,W=r.child,le=W.sibling,d=Bn(W,{mode:"hidden",children:d.children}),d.subtreeFlags=W.subtreeFlags&65011712,le!==null?P=Bn(le,P):(P=sa(P,g,c,null),P.flags|=2),P.return=o,d.return=o,d.sibling=P,o.child=d,xl(null,d),d=o.child,P=r.child.memoizedState,P===null?P=Uf(c):(g=P.cachePool,g!==null?(W=Ps._currentValue,g=g.parent!==W?{parent:W,pool:W}:g):g=py(),P={baseLanes:P.baseLanes|c,cachePool:g}),d.memoizedState=P,d.childLanes=jf(r,S,c),o.memoizedState=Nf,xl(r.child,d)):(xr(o),c=r.child,r=c.sibling,c=Bn(c,{mode:"visible",children:d.children}
vendor: 5,250 bytes, line 49
49),c.return=o,c.sibling=null,r!==null&&(S=o.deletions,S===null?(o.deletions=[r],o.flags|=16):S.push(r)),o.child=c,o.memoizedState=null,c)}function Gf(r,o){return o=mu({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function mu(r,o){return r=Ei(22,r,null,o),r.lanes=0,r}function zf(r,o,c){return ca(o,r.child,null,c),r=Gf(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function Mb(r,o,c){r.lanes|=o;var d=r.alternate;d!==null&&(d.lanes|=o),sf(r.return,o,c)}function Hf(r,o,c,d,g,y){var S=r.memoizedState;S===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:g,treeForkCount:y}:(S.isBackwards=o,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=c,S.tailMode=g,S.treeForkCount=y)}function wb(r,o,c){var d=o.pendingProps,g=d.revealOrder,y=d.tail;d=d.children;var S=Es.current,P=(S&2)!==0;if(P?(S=S&1|2,o.flags|=128):S&=1,X(Es,S),Ks(r,o,d,c),d=Pt?ol:0,!P&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Mb(r,c,o);else if(r.tag===19)Mb(r,c,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(g){case"forwards":for(c=o.child,g=null;c!==null;)r=c.alternate,r!==null&&nu(r)===null&&(g=c),c=c.sibling;c=g,c===null?(g=o.child,o.child=null):(g=c.sibling,c.sibling=null),Hf(o,!1,g,c,y,d);break;case"backwards":case"unstable_legacy-backwards":for(c=null,g=o.child,o.child=null;g!==null;){if(r=g.alternate,r!==null&&nu(r)===null){o.child=g;break}r=g.sibling,g.sibling=c,c=g,g=r}Hf(o,!0,c,null,y,d);break;case"together":Hf(o,!1,null,null,void 0,d);break;default:o.memoizedState=null}return o.child}function Hn(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Er|=o.lanes,(c&o.childLanes)===0)if(r!==null){if($a(r,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(s(153));if(o.child!==null){for(r=o.child,c=Bn(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Bn(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Vf(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Zc(r)))}function ew(r,o,c){switch(o.tag){case 3:Ae(o,o.stateNode.containerInfo),mr(o,Ps,r.memoizedState.cache),ia();break;case 27:case 5:G(o);break;case 4:Ae(o,o.stateNode.containerInfo);break;case 10:mr(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,pf(o),null;break;case 13:var d=o.memoizedState;if(d!==null)return d.dehydrated!==null?(xr(o),o.flags|=128,null):(c&o.child.childLanes)!==0?Ab(r,o,c):(xr(o),r=Hn(r,o,c),r!==null?r.sibling:null);xr(o);break;case 19:var g=(r.flags&128)!==0;if(d=(c&o.childLanes)!==0,d||($a(r,o,c,!1),d=(c&o.childLanes)!==0),g){if(d)return wb(r,o,c);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),X(Es,Es.current),d)break;return null;case 22:return o.lanes=0,vb(r,o,c,o.pendingProps);case 24:mr(o,Ps,r.memoizedState.cache)}return Hn(r,o,c)}function Pb(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)Ds=!0;else{if(!Vf(r,c)&&(o.flags&128)===0)return Ds=!1,ew(r,o,c);Ds=(r.flags&131072)!==0}else Ds=!1,Pt&&(o.flags&1048576)!==0&&ly(o,ol,o.index);switch(o.lanes=0,o.tag){case 16:e:{var d=o.pendingProps;if(r=oa(o.elementType),o.type=r,typeof r=="function")Yd(r)?(d=ha(r,d),o.tag=1,o=Sb(null,o,r,d,c)):(o.tag=0,o=Bf(null,o,r,d,c));else{if(r!=null){var g=r.$$typeof;if(g===M){o.tag=11,o=yb(null,o,r,d,c);break e}else if(g===N){o.tag=14,o=bb(null,o,r,d,c);break e}}throw o=_e(r)||r,Error(s(306,o,""))}}return o;case 0:return Bf(r,o,o.type,o.pendingProps,c);case 1:return d=o.type,g=ha(d,o.pendingProps),Sb(r,o,d,g,c);case 3:e:{if(Ae(o,o.stateNode.containerInfo),r===null)throw Error(s(387));d=o.pendingProps;var y=o.memoizedState;g=y.element,uf(r,o),pl(o,d,null,c);var S=o.memoizedState;if(d=S.cache,mr(o,Ps,d),d!==y.cache&&nf(o,[Ps],c,!0),_l(),d=S.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:S.cache},o.updateQueue.baseState=y,o.memoizedState=y,o.flags&256){o=Cb(r,o,d,c);break e}else if(d!==g){g=Ui(Error(s(424)),o),ll(g),o=Cb(r,o,d,c);break e}else{switch(r=o.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(os=Vi(r.firstChild),Ws=o,Pt=!0,_r=null,zi=!0,c=vy(o,null,d,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(ia(),d===g){o=Hn(r,o,c);break e}Ks(r,o,d,c)}o=o.child}return o;case 26:return pu(r,o),r===null?(c=Gx(o.type,null,o.pendingProps,null))?o.memoizedState=c:Pt||(c=o.type,r=o.pendingProps,d=Du($.current).createElement(c),d[qs]=o,d[ci]=r,Zs(d,c,r),zs(d),o.stateNode=d):o.memoizedState=Gx(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return G(o),r===null&&Pt&&(d=o.stateNode=Nx(o.type,o.pendingProps,$.current),Ws=o,zi=!0,g=os,wr(o.type)?(T_=g,os=Vi(d.firstChild)):os=g),Ks(r,o,o.pendingProps.children,c),pu(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&Pt&&((g=d=os)&&(d=Pw(d,o.type,o.pendingProps,zi),d!==null?(o.stateNode=d,Ws=o,os=Vi(d.firstChild),zi=!1,g=!0):g=!1),g||pr(o)),G(o),g=o.type,y=o.pendingProps,S=r!==null?r.memoizedProps:null,d=y.
vendor: 4,339 bytes, line 49
49children,y_(g,y)?d=null:S!==null&&y_(g,S)&&(o.flags|=32),o.memoizedState!==null&&(g=gf(r,o,XM,null,null,c),kl._currentValue=g),pu(r,o),Ks(r,o,d,c),o.child;case 6:return r===null&&Pt&&((r=c=os)&&(c=Ow(c,o.pendingProps,zi),c!==null?(o.stateNode=c,Ws=o,os=null,r=!0):r=!1),r||pr(o)),null;case 13:return Ab(r,o,c);case 4:return Ae(o,o.stateNode.containerInfo),d=o.pendingProps,r===null?o.child=ca(o,null,d,c):Ks(r,o,d,c),o.child;case 11:return yb(r,o,o.type,o.pendingProps,c);case 7:return Ks(r,o,o.pendingProps,c),o.child;case 8:return Ks(r,o,o.pendingProps.children,c),o.child;case 12:return Ks(r,o,o.pendingProps.children,c),o.child;case 10:return d=o.pendingProps,mr(o,o.type,d.value),Ks(r,o,d.children,c),o.child;case 9:return g=o.type._context,d=o.pendingProps.children,ra(o),g=Ys(g),d=d(g),o.flags|=1,Ks(r,o,d,c),o.child;case 14:return bb(r,o,o.type,o.pendingProps,c);case 15:return xb(r,o,o.type,o.pendingProps,c);case 19:return wb(r,o,c);case 31:return JM(r,o,c);case 22:return vb(r,o,c,o.pendingProps);case 24:return ra(o),d=Ys(Ps),r===null?(g=of(),g===null&&(g=Kt,y=rf(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=c),g=y),o.memoizedState={parent:d,cache:g},cf(o),mr(o,Ps,g)):((r.lanes&c)!==0&&(uf(r,o),pl(o,null,null,c),_l()),g=r.memoizedState,y=o.memoizedState,g.parent!==d?(g={parent:d,cache:d},o.memoizedState=g,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=g),mr(o,Ps,d)):(d=y.cache,mr(o,Ps,d),d!==g.cache&&nf(o,[Ps],c,!0))),Ks(r,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function Vn(r){r.flags|=4}function Xf(r,o,c,d,g){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(g&335544128)===g)if(r.stateNode.complete)r.flags|=8192;else if(ix())r.flags|=8192;else throw la=eu,lf}else r.flags&=-16777217}function Ob(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!qx(o))if(ix())r.flags|=8192;else throw la=eu,lf}function gu(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?me():536870912,r.lanes|=o,uo|=o)}function vl(r,o){if(!Pt)switch(r.tailMode){case"hidden":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function ls(r){var o=r.alternate!==null&&r.alternate.child===r.child,c=0,d=0;if(o)for(var g=r.child;g!==null;)c|=g.lanes|g.childLanes,d|=g.subtreeFlags&65011712,d|=g.flags&65011712,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)c|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=d,r.childLanes=c,o}function tw(r,o,c){var d=o.pendingProps;switch($d(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ls(o),null;case 1:return ls(o),null;case 3:return c=o.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),jn(Ps),Oe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Qa(o)?Vn(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,ef())),ls(o),null;case 26:var g=o.type,y=o.memoizedState;return r===null?(Vn(o),y!==null?(ls(o),Ob(o,y)):(ls(o),Xf(o,g,null,d,c))):y?y!==r.memoizedState?(Vn(o),ls(o),Ob(o,y)):(ls(o),o.flags&=-16777217):(r=r.memoizedProps,r!==d&&Vn(o),ls(o),Xf(o,g,r,d,c)),null;case 27:if(ie(o),c=$.current,g=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==d&&Vn(o);else{if(!d){if(o.stateNode===null)throw Error(s(166));return ls(o),null}r=Q.current,Qa(o)?uy(o):(r=Nx(g,d,c),o.stateNode=r,Vn(o))}return ls(o),null;case 5:if(ie(o),g=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==d&&Vn(o);else{if(!d){if(o.stateNode===null)throw Error(s(166));return ls(o),null}if(y=Q.current,Qa(o))uy(o);else{var S=Du($.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;
vendor: 22,180 bytes, line 49
49case"select":y=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?S.createElement(g,{is:d.is}):S.createElement(g)}}y[qs]=o,y[ci]=d;e:for(S=o.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===o)break e;for(;S.sibling===null;){if(S.return===null||S.return===o)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}o.stateNode=y;e:switch(Zs(y,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Vn(o)}}return ls(o),Xf(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==d&&Vn(o);else{if(typeof d!="string"&&o.stateNode===null)throw Error(s(166));if(r=$.current,Qa(o)){if(r=o.stateNode,c=o.memoizedProps,d=null,g=Ws,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}r[qs]=o,r=!!(r.nodeValue===c||d!==null&&d.suppressHydrationWarning===!0||Ax(r.nodeValue,c)),r||pr(o,!0)}else r=Du(r).createTextNode(d),r[qs]=o,o.stateNode=r}return ls(o),null;case 31:if(c=o.memoizedState,r===null||r.memoizedState!==null){if(d=Qa(o),c!==null){if(r===null){if(!d)throw Error(s(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[qs]=o}else ia(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ls(o),r=!1}else c=ef(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return o.flags&256?(Ci(o),o):(Ci(o),null);if((o.flags&128)!==0)throw Error(s(558))}return ls(o),null;case 13:if(d=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(g=Qa(o),d!==null&&d.dehydrated!==null){if(r===null){if(!g)throw Error(s(318));if(g=o.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(s(317));g[qs]=o}else ia(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ls(o),g=!1}else g=ef(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=g),g=!0;if(!g)return o.flags&256?(Ci(o),o):(Ci(o),null)}return Ci(o),(o.flags&128)!==0?(o.lanes=c,o):(c=d!==null,r=r!==null&&r.memoizedState!==null,c&&(d=o.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==g&&(d.flags|=2048)),c!==r&&c&&(o.child.flags|=8192),gu(o,o.updateQueue),ls(o),null);case 4:return Oe(),r===null&&f_(o.stateNode.containerInfo),ls(o),null;case 10:return jn(o.type),ls(o),null;case 19:if(B(Es),d=o.memoizedState,d===null)return ls(o),null;if(g=(o.flags&128)!==0,y=d.rendering,y===null)if(g)vl(d,!1);else{if(ys!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(y=nu(r),y!==null){for(o.flags|=128,vl(d,!1),r=y.updateQueue,o.updateQueue=r,gu(o,r),o.subtreeFlags=0,r=c,c=o.child;c!==null;)ry(c,r),c=c.sibling;return X(Es,Es.current&1|2),Pt&&Nn(o,d.treeForkCount),o.child}r=r.sibling}d.tail!==null&&we()>Ru&&(o.flags|=128,g=!0,vl(d,!1),o.lanes=4194304)}else{if(!g)if(r=nu(y),r!==null){if(o.flags|=128,g=!0,r=r.updateQueue,o.updateQueue=r,gu(o,r),vl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!Pt)return ls(o),null}else 2*we()-d.renderingStartTime>Ru&&c!==536870912&&(o.flags|=128,g=!0,vl(d,!1),o.lanes=4194304);d.isBackwards?(y.sibling=o.child,o.child=y):(r=d.last,r!==null?r.sibling=y:o.child=y,d.last=y)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=we(),r.sibling=null,c=Es.current,X(Es,g?c&1|2:c&1),Pt&&Nn(o,d.treeForkCount),r):(ls(o),null);case 22:case 23:return Ci(o),_f(),d=o.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(o.flags|=8192):d&&(o.flags|=8192),d?(c&536870912)!==0&&(o.flags&128)===0&&(ls(o),o.subtreeFlags&6&&(o.flags|=8192)):ls(o),c=o.updateQueue,c!==null&&gu(o,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==c&&(o.flags|=2048),r!==null&&B(aa),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),jn(Ps),ls(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function sw(r,o){switch($d(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return jn(Ps),Oe(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return ie(o),null;case 31:if(o.memoizedState!==null){if(Ci(o),o.alternate===null)throw Error(s(340));ia()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(Ci(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(s(340));ia()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return B(Es),null;case 4:return Oe(),null;case 10:return jn(o.type),null;case 22:case 23:return Ci(o),_f(),r!==null&&B(aa),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return jn(Ps),null;case 25:return null;default:return null}}function Db(r,o){switch($d(o),o.tag){case 3:jn(Ps),Oe();break;case 26:case 27:case 5:ie(o);break;case 4:Oe();break;case 31:o.memoizedState!==null&&Ci(o);break;case 13:Ci(o);break;case 19:B(Es);break;case 10:jn(o.type);break;case 22:case 23:Ci(o),_f(),r!==null&&B(aa);break;case 24:jn(Ps)}}function Rl(r,o){try{var c=o.updateQueue,d=c!==null?c.lastEffect:null;if(d!==null){var g=d.next;c=g;do{if((c.tag&r)===r){d=void 0;var y=c.create,S=c.inst;d=y(),S.destroy=d}c=c.next}while(c!==g)}}catch(P){Vt(o,o.return,P)}}function Rr(r,o,c){try{var d=o.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var y=g.next;d=y;do{if((d.tag&r)===r){var S=d.inst,P=S.destroy;if(P!==void 0){S.destroy=void 0,g=o;var W=c,le=P;try{le()}catch(ye){Vt(g,W,ye)}}}d=d.next}while(d!==y)}}catch(ye){Vt(o,o.return,ye)}}function Ib(r){var o=r.updateQueue;if(o!==null){var c=r.stateNode;try{Ty(o,c)}catch(d){Vt(r,r.return,d)}}}function Fb(r,o,c){c.props=ha(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(d){Vt(r,o,d)}}function Tl(r,o){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof c=="function"?r.refCleanup=c(d):c.current=d}}catch(g){Vt(r,o,g)}}function _n(r,o){var c=r.ref,d=r.refCleanup;if(c!==null)if(typeof d=="function")try{d()}catch(g){Vt(r,o,g)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(g){Vt(r,o,g)}else c.current=null}function kb(r){var o=r.type,c=r.memoizedProps,d=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&d.focus();break e;case"img":c.src?d.src=c.src:c.srcSet&&(d.srcset=c.srcSet)}}catch(g){Vt(r,r.return,g)}}function qf(r,o,c){try{var d=r.stateNode;Ew(d,r.type,c,o),d[ci]=o}catch(g){Vt(r,r.return,g)}}function Lb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&wr(r.type)||r.tag===4}function Wf(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Lb(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&wr(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Yf(r,o,c){var d=r.tag;if(d===5||d===6)r=r.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(r),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=kn));else if(d!==4&&(d===27&&wr(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(Yf(r,o,c),r=r.sibling;r!==null;)Yf(r,o,c),r=r.sibling}function yu(r,o,c){var d=r.tag;if(d===5||d===6)r=r.stateNode,o?c.insertBefore(r,o):c.appendChild(r);else if(d!==4&&(d===27&&wr(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(yu(r,o,c),r=r.sibling;r!==null;)yu(r,o,c),r=r.sibling}function Bb(r){var o=r.stateNode,c=r.memoizedProps;try{for(var d=r.type,g=o.attributes;g.length;)o.removeAttributeNode(g[0]);Zs(o,d,c),o[qs]=r,o[ci]=c}catch(y){Vt(r,r.return,y)}}var Xn=!1,Is=!1,Kf=!1,Nb=typeof WeakSet=="function"?WeakSet:Set,Hs=null;function iw(r,o){if(r=r.containerInfo,m_=Uu,r=Zg(r),Gd(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&d.rangeCount!==0){c=d.anchorNode;var g=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{c.nodeType,y.nodeType}catch{c=null;break e}var S=0,P=-1,W=-1,le=0,ye=0,Ee=r,ue=null;t:for(;;){for(var pe;Ee!==c||g!==0&&Ee.nodeType!==3||(P=S+g),Ee!==y||d!==0&&Ee.nodeType!==3||(W=S+d),Ee.nodeType===3&&(S+=Ee.nodeValue.length),(pe=Ee.firstChild)!==null;)ue=Ee,Ee=pe;for(;;){if(Ee===r)break t;if(ue===c&&++le===g&&(P=S),ue===y&&++ye===d&&(W=S),(pe=Ee.nextSibling)!==null)break;Ee=ue,ue=Ee.parentNode}Ee=pe}c=P===-1||W===-1?null:{start:P,end:W}}else c=null}c=c||{start:0,end:0}}else c=null;for(g_={focusedElem:r,selectionRange:c},Uu=!1,Hs=o;Hs!==null;)if(o=Hs,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Hs=r;else for(;Hs!==null;){switch(o=Hs,y=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)g=r[c],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,c=o,g=y.memoizedProps,y=y.memoizedState,d=c.stateNode;try{var Ye=ha(c.type,g);r=d.getSnapshotBeforeUpdate(Ye,y),d.__reactInternalSnapshotBeforeUpdate=r}catch(ot){Vt(c,c.return,ot)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,c=r.nodeType,c===9)x_(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":x_(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=o.sibling,r!==null){r.return=o.return,Hs=r;break}Hs=o.return}}function Ub(r,o,c){var d=c.flags;switch(c.tag){case 0:case 11:case 15:Wn(r,c),d&4&&Rl(5,c);break;case 1:if(Wn(r,c),d&4)if(r=c.stateNode,o===null)try{r.componentDidMount()}catch(S){Vt(c,c.return,S)}else{var g=ha(c.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(g,o,r.__reactInternalSnapshotBeforeUpdate)}catch(S){Vt(c,c.return,S)}}d&64&&Ib(c),d&512&&Tl(c,c.return);break;case 3:if(Wn(r,c),d&64&&(r=c.updateQueue,r!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{Ty(r,o)}catch(S){Vt(c,c.return,S)}}break;case 27:o===null&&d&4&&Bb(c);case 26:case 5:Wn(r,c),o===null&&d&4&&kb(c),d&512&&Tl(c,c.return);break;case 12:Wn(r,c);break;case 31:Wn(r,c),d&4&&zb(r,c);break;case 13:Wn(r,c),d&4&&Hb(r,c),d&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=dw.bind(null,c),Dw(r,c))));break;case 22:if(d=c.memoizedState!==null||Xn,!d){o=o!==null&&o.memoizedState!==null||Is,g=Xn;var y=Is;Xn=d,(Is=o)&&!y?Yn(r,c,(c.subtreeFlags&8772)!==0):Wn(r,c),Xn=g,Is=y}break;case 30:break;default:Wn(r,c)}}function jb(r){var o=r.alternate;o!==null&&(r.alternate=null,jb(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Ed(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var ds=null,hi=!1;function qn(r,o,c){for(c=c.child;c!==null;)Gb(r,o,c),c=c.sibling}function Gb(r,o,c){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(zt,c)}catch{}switch(c.tag){case 26:Is||_n(c,o),qn(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Is||_n(c,o);var d=ds,g=hi;wr(c.type)&&(ds=c.stateNode,hi=!1),qn(r,o,c),Dl(c.stateNode),ds=d,hi=g;break;case 5:Is||_n(c,o);case 6:if(d=ds,g=hi,ds=null,qn(r,o,c),ds=d,hi=g,ds!==null)if(hi)try{(ds.nodeType===9?ds.body:ds.nodeName==="HTML"?ds.ownerDocument.body:ds).removeChild(c.stateNode)}catch(y){Vt(c,o,y)}else try{ds.removeChild(c.stateNode)}catch(y){Vt(c,o,y)}break;case 18:ds!==null&&(hi?(r=ds,Ix(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),bo(r)):Ix(ds,c.stateNode));break;case 4:d=ds,g=hi,ds=c.stateNode.containerInfo,hi=!0,qn(r,o,c),ds=d,hi=g;break;case 0:case 11:case 14:case 15:Rr(2,c,o),Is||Rr(4,c,o),qn(r,o,c);break;case 1:Is||(_n(c,o),d=c.stateNode,typeof d.componentWillUnmount=="function"&&Fb(c,o,d)),qn(r,o,c);break;case 21:qn(r,o,c);break;case 22:Is=(d=Is)||c.memoizedState!==null,qn(r,o,c),Is=d;break;default:qn(r,o,c)}}function zb(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{bo(r)}catch(c){Vt(o,o.return,c)}}}function Hb(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{bo(r)}catch(c){Vt(o,o.return,c)}}function nw(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new Nb),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new Nb),o;default:throw Error(s(435,r.tag))}}function bu(r,o){var c=nw(r);o.forEach(function(d){if(!c.has(d)){c.add(d);var g=fw.bind(null,r,d);d.then(g,g)}})}function di(r,o){var c=o.deletions;if(c!==null)for(var d=0;d<c.length;d++){var g=c[d],y=r,S=o,P=S;e:for(;P!==null;){switch(P.tag){case 27:if(wr(P.type)){ds=P.stateNode,hi=!1;break e}break;case 5:ds=P.stateNode,hi=!1;break e;case 3:case 4:ds=P.stateNode.containerInfo,hi=!0;break e}P=P.return}if(ds===null)throw Error(s(160));Gb(y,S,g),ds=null,hi=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Vb(o,r),o=o.sibling}var $i=null;function Vb(r,o){var c=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:di(o,r),fi(r),d&4&&(Rr(3,r,r.return),Rl(3,r),Rr(5,r,r.return));break;case 1:di(o,r),fi(r),d&512&&(Is||c===null||_n(c,c.return)),d&64&&Xn&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?d:c.concat(d))));break;case 26:var g=$i;if(di(o,r),fi(r),d&512&&(Is||c===null||_n(c,c.return)),d&4){var y=c!==null?c.memoizedState:null;if(d=r.memoizedState,c===null)if(d===null)if(r.stateNode===null){e:{d=r.type,c=r.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":y=g.getElementsByTagName("title")[0],(!y||y[Zo]||y[qs]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(d),g.head.insertBefore(y,g.querySelector("head > title"))),Zs(y,d,c),y[qs]=r,zs(y),d=y;break e;case"link":var S=Vx("link","href",g).get(d+(c.href||""));if(S){for(var P=0;P<S.length;P++)if(y=S[P],y.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&y.getAttribute("rel")===(c.rel==null?null:c.rel)&&y.getAttribute("title")===(c.title==null?null:c.title)&&y.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){S.splice(P,1);break t}}y=g.createElement(d),Zs(y,d,c),g.head.appendChild(y);break;case"meta":if(S=Vx("meta","content",g).get(d+(c.content||""))){for(P=0;P<S.length;P++)if(y=S[P],y.getAttribute("content")===(c.content==null?null:""+c.content)&&y.getAttribute("name")===(c.name==null?null:c.name)&&y.getAttribute("property")===(c.property==null?null:c.property)&&y.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&y.getAttribute("charset")===(c.charSet==null?null:c.charSet)){S.splice(P,1);break t}}y=g.createElement(d),Zs(y,d,c),g.head.appendChild(y);break;default:throw Error(s(468,d))}y[qs]=r,zs(y),d=y}r.stateNode=d}else Xx(g,r.type,r.stateNode);else r.stateNode=Hx(g,d,r.memoizedProps);else y!==d?(y===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):y.count--,d===null?Xx(g,r.type,r.stateNode):Hx(g,d,r.memoizedProps)):d===null&&r.stateNode!==null&&qf(r,r.memoizedProps,c.memoizedProps)}break;case 27:di(o,r),fi(r),d&512&&(Is||c===null||_n(c,c.return)),c!==null&&d&4&&qf(r,r.memoizedProps,c.memoizedProps);break;case 5:if(di(o,r),fi(r),d&512&&(Is||c===null||_n(c,c.return)),r.flags&32){g=r.stateNode;try{Ga(g,"")}catch(Ye){Vt(r,r.return,Ye)}}d&4&&r.stateNode!=null&&(g=r.memoizedProps,qf(r,g,c!==null?c.memoizedProps:g)),d&1024&&(Kf=!0);break;case 6:if(di(o,r),fi(r),d&4){if(r.stateNode===null)throw Error(s(162));d=r.memoizedProps,c=r.stateNode;try{c.nodeValue=d}catch(Ye){Vt(r,r.return,Ye)}}break;case 3:if(ku=null,g=$i,$i=Iu(o.containerInfo),di(o,r),$i=g,fi(r),d&4&&c!==null&&c.memoizedState.isDehydrated)try{bo(o.containerInfo)}catch(Ye){Vt(r,r.return,Ye)}Kf&&(Kf=!1,Xb(r));break;case 4:d=$i,$i=Iu(r.stateNode.containerInfo),di(o,r),fi(r),$i=d;break;case 12:di(o,r),fi(r);break;case 31:di(o,r),fi(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,bu(r,d)));break;case 13:di(o,r),fi(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(vu=we()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,bu(r,d)));break;case 22:g=r.memoizedState!==null;var W=c!==null&&c.memoizedState!==null,le=Xn,ye=Is;if(Xn=le||g,Is=ye||W,di(o,r),Is=ye,Xn=le,fi(r),d&8192)e:for(o=r.stateNode,o._visibility=g?o._visibility&-2:o._visibility|1,g&&(c===null||W||Xn||Is||da(r)),c=null,o=r;;){if(o.tag===5||o.tag===26){if(c===null){W=c=o;try{if(y=W.stateNode,g)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{P=W.stateNode;var Ee=W.memoizedProps.style,ue=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;P.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ye){Vt(W,W.return,Ye)}}}else if(o.tag===6){if(c===null){W=o;try{W.stateNode.nodeValue=g?"":W.memoizedProps}catch(Ye){Vt(W,W.return,Ye)}}}else if(o.tag===18){if(c===null){W=o;try{var pe=W.stateNode;g?Fx(pe,!0):Fx(W.stateNode,!1)}catch(Ye){Vt(W,W.return,Ye)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}d&4&&(d=r.updateQueue,d!==null&&(c=d.retryQueue,c!==null&&(d.retryQueue=null,bu(r,c))));break;case 19:di(o,r),fi(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,bu(r,d)));break;case 30:break;case 21:break;default:di(o,r),fi(r)}}function fi(r){var o=r.flags;if(o&2){try{for(var c,d=r.return;d!==null;){if(Lb(d)){c=d;break}d=d.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var g=c.stateNode,y=Wf(r);yu(r,y,g);break;case 5:var S=c.stateNode;c.flags&32&&(Ga(S,""),c.flags&=-33);var P=Wf(r);yu(r,P,S);break;case 3:case 4:var W=c.stateNode.containerInfo,le=Wf(r);Yf(r,le,W);break;default:throw Error(s(161))}}catch(ye){Vt(r,r.return,ye)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function Xb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;Xb(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function Wn(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Ub(r,o.alternate,o),o=o.sibling}function da(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Rr(4,o,o.return),da(o);break;case 1:_n(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&Fb(o,o.return,c),da(o);break;case 27:Dl(o.stateNode);case 26:case 5:_n(o,o.return),da(o);break;case 22:o.memoizedState===null&&da(o);break;case 30:da(o);break;default:da(o)}r=r.sibling}}function Yn(r,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var d=o.alternate,g=r,y=o,S=y.flags;switch(y.tag){case 0:case 11:case 15:Yn(g,y,c),Rl(4,y);break;case 1:if(Yn(g,y,c),d=y,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(le){Vt(d,d.return,le)}if(d=y,g=d.updateQueue,g!==null){var P=d.stateNode;try{var W=g.shared.hiddenCallbacks;if(W!==null)for(g.shared.hiddenCallbacks=null,g=0;g<W.length;g++)Ry(W[g],P)}catch(le){Vt(d,d.return,le)}}c&&S&64&&Ib(y),Tl(y,y.return);break;case 27:Bb(y);case 26:case 5:Yn(g,y,c),c&&d===null&&S&4&&kb(y),Tl(y,y.return);break;case 12:Yn(g,y,c);break;case 31:Yn(g,y,c),c&&S&4&&zb(g,y);break;case 13:Yn(g,y,c),c&&S&4&&Hb(g,y);break;case 22:y.memoizedState===null&&Yn(g,y,c),Tl(y,y.return);break;case 30:break;default:Yn(g,y,c)}o=o.sibling}}function Zf(r,o){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&cl(c))}function Qf(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&cl(r))}function Ji(r,o,c,d){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)qb(r,o,c,d),o=o.sibling}function qb(r,o,c,d){var g=o.flags;switch(o.tag){case 0:case 11:case 15:Ji(r,o,c,d),g&2048&&Rl(9,o);break;case 1:Ji(r,o,c,d);break;case 3:Ji(r,o,c,d),g&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&cl(r)));break;case 12:if(g&2048){Ji(r,o,c,d),r=o.stateNode;try{var y=o.memoizedProps,S=y.id,P=y.onPostCommit;typeof P=="function"&&P(S,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(W){Vt(o,o.return,W)}}else Ji(r,o,c,d);break;case 31:Ji(r,o,c,d);break;case 13:Ji(r,o,c,d);break;case 23:break;case 22:y=o.stateNode,S=o.alternate,o.memoizedState!==null?y._visibility&2?Ji(r,o,c,d):El(r,o):y._visibility&2?Ji(r,o,c,d):(y._visibility|=2,oo(r,o,c,d,(o.subtreeFlags&10256)!==0||!1)),g&2048&&Zf(S,o);break;case 24:Ji(r,o,c,d),g&2048&&Qf(o.alternate,o);break;default:Ji(r,o,c,d)}}function oo(r,o,c,d,g){for(g=g&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var y=r,S=o,P=c,W=d,le=S.flags;switch(S.tag){case 0:case 11:case 15:oo(y,S,P,W,g),Rl(8,S);break;case 23:break;case 22:var ye=S.stateNode;S.memoizedState!==null?ye._visibility&2?oo(y,S,P,W,g):El(y,S):(ye._visibility|=2,oo(y,S,P,W,g)),g&&le&2048&&Zf(S.alternate,S);break;case 24:oo(y,S,P,W,g),g&&le&2048&&Qf(S.alternate,S);break;default:oo(y,S,P,W,g)}
vendor: 5,190 bytes, line 49
49o=o.sibling}}function El(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=r,d=o,g=d.flags;switch(d.tag){case 22:El(c,d),g&2048&&Zf(d.alternate,d);break;case 24:El(c,d),g&2048&&Qf(d.alternate,d);break;default:El(c,d)}o=o.sibling}}var Sl=8192;function lo(r,o,c){if(r.subtreeFlags&Sl)for(r=r.child;r!==null;)Wb(r,o,c),r=r.sibling}function Wb(r,o,c){switch(r.tag){case 26:lo(r,o,c),r.flags&Sl&&r.memoizedState!==null&&Vw(c,$i,r.memoizedState,r.memoizedProps);break;case 5:lo(r,o,c);break;case 3:case 4:var d=$i;$i=Iu(r.stateNode.containerInfo),lo(r,o,c),$i=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Sl,Sl=16777216,lo(r,o,c),Sl=d):lo(r,o,c));break;default:lo(r,o,c)}}function Yb(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function Cl(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var d=o[c];Hs=d,Zb(d,r)}Yb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Kb(r),r=r.sibling}function Kb(r){switch(r.tag){case 0:case 11:case 15:Cl(r),r.flags&2048&&Rr(9,r,r.return);break;case 3:Cl(r);break;case 12:Cl(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,xu(r)):Cl(r);break;default:Cl(r)}}function xu(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var d=o[c];Hs=d,Zb(d,r)}Yb(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Rr(8,o,o.return),xu(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,xu(o));break;default:xu(o)}r=r.sibling}}function Zb(r,o){for(;Hs!==null;){var c=Hs;switch(c.tag){case 0:case 11:case 15:Rr(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var d=c.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:cl(c.memoizedState.cache)}if(d=c.child,d!==null)d.return=c,Hs=d;else e:for(c=r;Hs!==null;){d=Hs;var g=d.sibling,y=d.return;if(jb(d),d===c){Hs=null;break e}if(g!==null){g.return=y,Hs=g;break e}Hs=y}}}var rw={getCacheForType:function(r){var o=Ys(Ps),c=o.data.get(r);return c===void 0&&(c=r(),o.data.set(r,c)),c},cacheSignal:function(){return Ys(Ps).controller.signal}},aw=typeof WeakMap=="function"?WeakMap:Map,jt=0,Kt=null,Tt=null,At=0,Ht=0,Ai=null,Tr=!1,co=!1,$f=!1,Kn=0,ys=0,Er=0,fa=0,Jf=0,Mi=0,uo=0,Al=null,_i=null,e_=!1,vu=0,Qb=0,Ru=1/0,Tu=null,Sr=null,ks=0,Cr=null,ho=null,Zn=0,t_=0,s_=null,$b=null,Ml=0,i_=null;function wi(){return(jt&2)!==0&&At!==0?At&-At:z.T!==null?c_():vi()}function Jb(){if(Mi===0)if((At&536870912)===0||Pt){var r=li;li<<=1,(li&3932160)===0&&(li=262144),Mi=r}else Mi=536870912;return r=Si.current,r!==null&&(r.flags|=32),Mi}function pi(r,o,c){(r===Kt&&(Ht===2||Ht===9)||r.cancelPendingCommit!==null)&&(fo(r,0),Ar(r,At,Mi,!1)),Pe(r,c),((jt&2)===0||r!==Kt)&&(r===Kt&&((jt&2)===0&&(fa|=c),ys===4&&Ar(r,At,Mi,!1)),pn(r))}function ex(r,o,c){if((jt&6)!==0)throw Error(s(327));var d=!c&&(o&127)===0&&(o&r.expiredLanes)===0||ke(r,o),g=d?cw(r,o):r_(r,o,!0),y=d;do{if(g===0){co&&!d&&Ar(r,o,0,!1);break}else{if(c=r.current.alternate,y&&!ow(c)){g=r_(r,o,!1),y=!1;continue}if(g===2){if(y=o,r.errorRecoveryDisabledLanes&y)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){o=S;e:{var P=r;g=Al;var W=P.current.memoizedState.isDehydrated;if(W&&(fo(P,S).flags|=256),S=r_(P,S,!1),S!==2){if($f&&!W){P.errorRecoveryDisabledLanes|=y,fa|=y,g=4;break e}y=_i,_i=g,y!==null&&(_i===null?_i=y:_i.push.apply(_i,y))}g=S}if(y=!1,g!==2)continue}}if(g===1){fo(r,0),Ar(r,o,0,!0);break}e:{switch(d=r,y=g,y){case 0:case 1:throw Error(s(345));case 4:if((o&4194048)!==o)break;case 6:Ar(d,o,Mi,!Tr);break e;case 2:_i=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(g=vu+300-we(),10<g)){if(Ar(d,o,Mi,!Tr),st(d,0,!0)!==0)break e;Zn=o,d.timeoutHandle=Ox(tx.bind(null,d,c,_i,Tu,e_,o,Mi,fa,uo,Tr,y,"Throttled",-0,0),g);break e}tx(d,c,_i,Tu,e_,o,Mi,fa,uo,Tr,y,null,-0,0)}}break}while(!0);pn(r)}function tx(r,o,c,d,g,y,S,P,W,le,ye,Ee,ue,pe){if(r.timeoutHandle=-1,Ee=o.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},Wb(o,y,Ee);var Ye=(y&62914560)===y?vu-we():(y&4194048)===y?Qb-we():0;if(Ye=Xw(Ee,Ye),Ye!==null){Zn=y,r.cancelPendingCommit=Ye(cx.bind(null,r,o,y,c,d,g,S,P,W,ye,Ee,null,ue,pe)),Ar(r,y,S,!le);return}}cx(r,o,y,c,d,g,S,P,W)}function ow(r){for(var o=r;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var d=0;d<c.length;d++){var g=c[d],y=g.getSnapshot;g=g.value;try{if(!Ti(y(),g))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ar(r,o,c,d){o&=~Jf,o&=~fa,r.suspendedLanes|=o,r.pingedLanes&=~o,d&&(r.warmLanes|=o),d=r.expirationTimes;for(var g=o;0<g;){var y=31-vt(g),S=1<<y;d[y]=-1,g&=~S}c!==0&&Ie(r,c,o)}function Eu(){return(jt&6)===0?(wl(0),!1):!0}
vendor: 3,659 bytes, line 49
49function n_(){if(Tt!==null){if(Ht===0)var r=Tt.return;else r=Tt,Un=na=null,xf(r),so=null,hl=0,r=Tt;for(;r!==null;)Db(r.alternate,r),r=r.return;Tt=null}}function fo(r,o){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,Aw(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Zn=0,n_(),Kt=r,Tt=c=Bn(r.current,null),At=o,Ht=0,Ai=null,Tr=!1,co=ke(r,o),$f=!1,uo=Mi=Jf=fa=Er=ys=0,_i=Al=null,e_=!1,(o&8)!==0&&(o|=o&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=o;0<d;){var g=31-vt(d),y=1<<g;o|=r[g],d&=~y}return Kn=o,Xc(),c}function sx(r,o){mt=null,z.H=bl,o===to||o===Jc?(o=yy(),Ht=3):o===lf?(o=yy(),Ht=4):Ht=o===Lf?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Ai=o,Tt===null&&(ys=1,fu(r,Ui(o,r.current)))}function ix(){var r=Si.current;return r===null?!0:(At&4194048)===At?Hi===null:(At&62914560)===At||(At&536870912)!==0?r===Hi:!1}function nx(){var r=z.H;return z.H=bl,r===null?bl:r}function rx(){var r=z.A;return z.A=rw,r}function Su(){ys=4,Tr||(At&4194048)!==At&&Si.current!==null||(co=!0),(Er&134217727)===0&&(fa&134217727)===0||Kt===null||Ar(Kt,At,Mi,!1)}function r_(r,o,c){var d=jt;jt|=2;var g=nx(),y=rx();(Kt!==r||At!==o)&&(Tu=null,fo(r,o)),o=!1;var S=ys;e:do try{if(Ht!==0&&Tt!==null){var P=Tt,W=Ai;switch(Ht){case 8:n_(),S=6;break e;case 3:case 2:case 9:case 6:Si.current===null&&(o=!0);var le=Ht;if(Ht=0,Ai=null,_o(r,P,W,le),c&&co){S=0;break e}break;default:le=Ht,Ht=0,Ai=null,_o(r,P,W,le)}}lw(),S=ys;break}catch(ye){sx(r,ye)}while(!0);return o&&r.shellSuspendCounter++,Un=na=null,jt=d,z.H=g,z.A=y,Tt===null&&(Kt=null,At=0,Xc()),S}function lw(){for(;Tt!==null;)ax(Tt)}function cw(r,o){var c=jt;jt|=2;var d=nx(),g=rx();Kt!==r||At!==o?(Tu=null,Ru=we()+500,fo(r,o)):co=ke(r,o);e:do try{if(Ht!==0&&Tt!==null){o=Tt;var y=Ai;t:switch(Ht){case 1:Ht=0,Ai=null,_o(r,o,y,1);break;case 2:case 9:if(my(y)){Ht=0,Ai=null,ox(o);break}o=function(){Ht!==2&&Ht!==9||Kt!==r||(Ht=7),pn(r)},y.then(o,o);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:my(y)?(Ht=0,Ai=null,ox(o)):(Ht=0,Ai=null,_o(r,o,y,7));break;case 5:var S=null;switch(Tt.tag){case 26:S=Tt.memoizedState;case 5:case 27:var P=Tt;if(S?qx(S):P.stateNode.complete){Ht=0,Ai=null;var W=P.sibling;if(W!==null)Tt=W;else{var le=P.return;le!==null?(Tt=le,Cu(le)):Tt=null}break t}}Ht=0,Ai=null,_o(r,o,y,5);break;case 6:Ht=0,Ai=null,_o(r,o,y,6);break;case 8:n_(),ys=6;break e;default:throw Error(s(462))}}uw();break}catch(ye){sx(r,ye)}while(!0);return Un=na=null,z.H=d,z.A=g,jt=c,Tt!==null?0:(Kt=null,At=0,Xc(),ys)}function uw(){for(;Tt!==null&&!et();)ax(Tt)}function ax(r){var o=Pb(r.alternate,r,Kn);r.memoizedProps=r.pendingProps,o===null?Cu(r):Tt=o}function ox(r){var o=r,c=o.alternate;switch(o.tag){case 15:case 0:o=Eb(c,o,o.pendingProps,o.type,void 0,At);break;case 11:o=Eb(c,o,o.pendingProps,o.type.render,o.ref,At);break;case 5:xf(o);default:Db(c,o),o=Tt=ry(o,Kn),o=Pb(c,o,Kn)}r.memoizedProps=r.pendingProps,o===null?Cu(r):Tt=o}function _o(r,o,c,d){Un=na=null,xf(o),so=null,hl=0;var g=o.return;try{if($M(r,g,o,c,At)){ys=1,fu(r,Ui(c,r.current)),Tt=null;return}}catch(y){if(g!==null)throw Tt=g,y;ys=1,fu(r,Ui(c,r.current)),Tt=null;return}o.flags&32768?(Pt||d===1?r=!0:co||(At&536870912)!==0?r=!1:(Tr=r=!0,(d===2||d===9||d===3||d===6)&&(d=Si.current,d!==null&&d.tag===13&&(d.flags|=16384))),lx(o,r)):Cu(o)}function Cu(r){var o=r;do{if((o.flags&32768)!==0){lx(o,Tr);return}r=o.return;var c=tw(o.alternate,o,Kn);if(c!==null){Tt=c;return}if(o=o.sibling,o!==null){Tt=o;return}Tt=o=r}while(o!==null);ys===0&&(ys=5)}function lx(r,o){do{var c=sw(r.alternate,r);if(c!==null){c.flags&=32767,Tt=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deleti
vendor: 18,552 bytes, lines 49-50
49ons=null),!o&&(r=r.sibling,r!==null)){Tt=r;return}Tt=r=c}while(r!==null);ys=6,Tt=null}function cx(r,o,c,d,g,y,S,P,W){r.cancelPendingCommit=null;do Au();while(ks!==0);if((jt&6)!==0)throw Error(s(327));if(o!==null){if(o===r.current)throw Error(s(177));if(y=o.lanes|o.childLanes,y|=qd,O(r,c,y,S,P,W),r===Kt&&(Tt=Kt=null,At=0),ho=o,Cr=r,Zn=c,t_=y,s_=g,$b=d,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,_w(Ot,function(){return _x(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||d){d=z.T,z.T=null,g=J.p,J.p=2,S=jt,jt|=4;try{iw(r,o,c)}finally{jt=S,J.p=g,z.T=d}}ks=1,ux(),hx(),dx()}}function ux(){if(ks===1){ks=0;var r=Cr,o=ho,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=z.T,z.T=null;var d=J.p;J.p=2;var g=jt;jt|=4;try{Vb(o,r);var y=g_,S=Zg(r.containerInfo),P=y.focusedElem,W=y.selectionRange;if(S!==P&&P&&P.ownerDocument&&Kg(P.ownerDocument.documentElement,P)){if(W!==null&&Gd(P)){var le=W.start,ye=W.end;if(ye===void 0&&(ye=le),"selectionStart"in P)P.selectionStart=le,P.selectionEnd=Math.min(ye,P.value.length);else{var Ee=P.ownerDocument||document,ue=Ee&&Ee.defaultView||window;if(ue.getSelection){var pe=ue.getSelection(),Ye=P.textContent.length,ot=Math.min(W.start,Ye),Wt=W.end===void 0?ot:Math.min(W.end,Ye);!pe.extend&&ot>Wt&&(S=Wt,Wt=ot,ot=S);var se=Yg(P,ot),Z=Yg(P,Wt);if(se&&Z&&(pe.rangeCount!==1||pe.anchorNode!==se.node||pe.anchorOffset!==se.offset||pe.focusNode!==Z.node||pe.focusOffset!==Z.offset)){var oe=Ee.createRange();oe.setStart(se.node,se.offset),pe.removeAllRanges(),ot>Wt?(pe.addRange(oe),pe.extend(Z.node,Z.offset)):(oe.setEnd(Z.node,Z.offset),pe.addRange(oe))}}}}for(Ee=[],pe=P;pe=pe.parentNode;)pe.nodeType===1&&Ee.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Ee.length;P++){var ve=Ee[P];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}Uu=!!m_,g_=m_=null}finally{jt=g,J.p=d,z.T=c}}r.current=o,ks=2}}function hx(){if(ks===2){ks=0;var r=Cr,o=ho,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=z.T,z.T=null;var d=J.p;J.p=2;var g=jt;jt|=4;try{Ub(r,o.alternate,o)}finally{jt=g,J.p=d,z.T=c}}ks=3}}function dx(){if(ks===4||ks===3){ks=0,K();var r=Cr,o=ho,c=Zn,d=$b;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?ks=5:(ks=0,ho=Cr=null,fx(r,r.pendingLanes));var g=r.pendingLanes;if(g===0&&(Sr=null),Ts(c),o=o.stateNode,Ne&&typeof Ne.onCommitFiberRoot=="function")try{Ne.onCommitFiberRoot(zt,o,void 0,(o.current.flags&128)===128)}catch{}if(d!==null){o=z.T,g=J.p,J.p=2,z.T=null;try{for(var y=r.onRecoverableError,S=0;S<d.length;S++){var P=d[S];y(P.value,{componentStack:P.stack})}}finally{z.T=o,J.p=g}}(Zn&3)!==0&&Au(),pn(r),g=r.pendingLanes,(c&261930)!==0&&(g&42)!==0?r===i_?Ml++:(Ml=0,i_=r):Ml=0,wl(0)}}function fx(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,cl(o)))}function Au(){return ux(),hx(),dx(),_x()}function _x(){if(ks!==5)return!1;var r=Cr,o=t_;t_=0;var c=Ts(Zn),d=z.T,g=J.p;try{J.p=32>c?32:c,z.T=null,c=s_,s_=null;var y=Cr,S=Zn;if(ks=0,ho=Cr=null,Zn=0,(jt&6)!==0)throw Error(s(331));var P=jt;if(jt|=4,Kb(y.current),qb(y,y.current,S,c),jt=P,wl(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(zt,y)}catch{}return!0}finally{J.p=g,z.T=d,fx(r,o)}}function px(r,o,c){o=Ui(c,o),o=kf(r.stateNode,o,2),r=br(r,o,2),r!==null&&(Pe(r,2),pn(r))}function Vt(r,o,c){if(r.tag===3)px(r,r,c);else for(;o!==null;){if(o.tag===3){px(o,r,c);break}else if(o.tag===1){var d=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Sr===null||!Sr.has(d))){r=Ui(c,r),c=mb(2),d=br(o,c,2),d!==null&&(gb(c,d,o,r),Pe(d,2),pn(d));break}}o=o.return}}function a_(r,o,c){var d=r.pingCache;if(d===null){d=r.pingCache=new aw;var g=new Set;d.set(o,g)}else g=d.get(o),g===void 0&&(g=new Set,d.set(o,g));g.has(c)||($f=!0,g.add(c),r=hw.bind(null,r,o,c),o.then(r,r))}function hw(r,o,c){var d=r.pingCache;d!==null&&d.delete(o),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Kt===r&&(At&c)===c&&(ys===4||ys===3&&(At&62914560)===At&&300>we()-vu?(jt&2)===0&&fo(r,0):Jf|=c,uo===At&&(uo=0)),pn(r)}function mx(r,o){o===0&&(o=me()),r=ta(r,o),r!==null&&(Pe(r,o),pn(r))}function dw(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),mx(r,c)}function fw(r,o){var c=0;switch(r.tag){case 31:case 13:var d=r.stateNode,g=r.memoizedState;g!==null&&(c=g.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(o),mx(r,c)}function _w(r,o){return Rs(r,o)}var Mu=null,po=null,o_=!1,wu=!1,l_=!1,Mr=0;function pn(r){r!==po&&r.next===null&&(po===null?Mu=po=r:po=po.next=r),wu=!0,o_||(o_=!0,mw())}function wl(r,o){if(!l_&&wu){l_=!0;do for(var c=!1,d=Mu;d!==null;){if(r!==0){var g=d.pendingLanes;if(g===0)var y=0;else{var S=d.suspendedLanes,P=d.pingedLanes;y=(1<<31-vt(42|r)+1)-1,y&=g&~(S&~P),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(c=!0,xx(d,y))}else y=At,y=st(d,d===Kt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||ke(d,y)||(c=!0,xx(d,y));d=d.next}while(c);l_=!1}}function pw(){gx()}function gx(){wu=o_=!1;var r=0;Mr!==0&&Cw()&&(r=Mr);for(var o=we(),c=null,d=Mu;d!==null;){var g=d.next,y=yx(d,o);y===0?(d.next=null,c===null?Mu=g:c.next=g,g===null&&(po=c)):(c=d,(r!==0||(y&3)!==0)&&(wu=!0)),d=g}ks!==0&&ks!==5||wl(r),Mr!==0&&(Mr=0)}function yx(r,o){for(var c=r.suspendedLanes,d=r.pingedLanes,g=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var S=31-vt(y),P=1<<S,W=g[S];W===-1?((P&c)===0||(P&d)!==0)&&(g[S]=w(P,o)):W<=o&&(r.expiredLanes|=P),y&=~P}if(o=Kt,c=At,c=st(r,r===o?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,c===0||r===o&&(Ht===2||Ht===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&ms(d),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||ke(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(d!==null&&ms(d),Ts(c)){case 2:case 8:c=wt;break;case 32:c=Ot;break;case 268435456:c=Ft;break;default:c=Ot}return d=bx.bind(null,r),c=Rs(c,d),r.callbackPriority=o,r.callbackNode=c,o}return d!==null&&d!==null&&ms(d),r.callbackPriority=2,r.callbackNode=null,2}function bx(r,o){if(ks!==0&&ks!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(Au()&&r.callbackNode!==c)return null;var d=At;return d=st(r,r===Kt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(ex(r,d,o),yx(r,we()),r.callbackNode!=null&&r.callbackNode===c?bx.bind(null,r):null)}function xx(r,o){if(Au())return null;ex(r,o,!0)}function mw(){Mw(function(){(jt&6)!==0?Rs(yt,pw):gx()})}function c_(){if(Mr===0){var r=Ja;r===0&&(r=Gs,Gs<<=1,(Gs&261888)===0&&(Gs=256)),Mr=r}return Mr}function vx(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Bc(""+r)}function Rx(r,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,r.id&&c.setAttribute("form",r.id),o.parentNode.insertBefore(c,o),r=new FormData(r),c.parentNode.removeChild(c),r}function gw(r,o,c,d,g){if(o==="submit"&&c&&c.stateNode===g){var y=vx((g[ci]||null).action),S=d.submitter;S&&(o=(o=S[ci]||null)?vx(o.formAction):S.getAttribute("formAction"),o!==null&&(y=o,S=null));var P=new Gc("action","action",null,d,g);r.push({event:P,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Mr!==0){var W=S?Rx(g,S):new FormData(g);wf(c,{pending:!0,data:W,method:g.method,action:y},null,W)}}else typeof y=="function"&&(P.preventDefault(),W=S?Rx(g,S):new FormData(g),wf(c,{pending:!0,data:W,method:g.method,action:y},y,W))},currentTarget:g}]})}}for(var u_=0;u_<Xd.length;u_++){var h_=Xd[u_],yw=h_.toLowerCase(),bw=h_[0].toUpperCase()+h_.slice(1);Qi(yw,"on"+bw)}Qi(Jg,"onAnimationEnd"),Qi(ey,"onAnimationIteration"),Qi(ty,"onAnimationStart"),Qi("dblclick","onDoubleClick"),Qi("focusin","onFocus"),Qi("focusout","onBlur"),Qi(kM,"onTransitionRun"),Qi(LM,"onTransitionStart"),Qi(BM,"onTransitionCancel"),Qi(sy,"onTransitionEnd"),Ua("onMouseEnter",["mouseout","mouseover"]),Ua("onMouseLeave",["mouseout","mouseover"]),Ua("onPointerEnter",["pointerout","pointerover"]),Ua("onPointerLeave",["pointerout","pointerover"]),Qr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pl));function Tx(r,o){o=(o&4)!==0;for(var c=0;c<r.length;c++){var d=r[c],g=d.event;d=d.listeners;e:{var y=void 0;if(o)for(var S=d.length-1;0<=S;S--){var P=d[S],W=P.instance,le=P.currentTarget;if(P=P.listener,W!==y&&g.isPropagationStopped())break e;y=P,g.currentTarget=le;try{y(g)}catch(ye){Vc(ye)}g.currentTarget=null,y=W}else for(S=0;S<d.length;S++){if(P=d[S],W=P.instance,le=P.currentTarget,P=P.listener,W!==y&&g.isPropagationStopped())break e;y=P,g.currentTarget=le;try{y(g)}catch(ye){Vc(ye)}g.currentTarget=null,y=W}}}}function Et(r,o){var c=o[Td];c===void 0&&(c=o[Td]=new Set);var d=r+"__bubble";c.has(d)||(Ex(o,r,2,!1),c.add(d))}function d_(r,o,c){var d=0;o&&(d|=4),Ex(c,r,d,o)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function f_(r){if(!r[Pu]){r[Pu]=!0,gg.forEach(function(c){c!=="selectionchange"&&(xw.has(c)||d_(c,!1,r),d_(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[Pu]||(o[Pu]=!0,d_("selectionchange",!1,o))}}function Ex(r,o,c,d){switch(Jx(o)){case 2:var g=Yw;break;case 8:g=Kw;break;default:g=M_}c=g.bind(null,o,c,r),g=void 0,!Dd||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),d?g!==void 0?r.addEventListener(o,c,{capture:!0,passive:g}):r.addEventListener(o,c,!0):g!==void 0?r.addEventListener(o,c,{passive:g}):r.addEventListener(o,c,!1)}function __(r,o,c,d,g){var y=d;if((o&1)===0&&(o&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var P=d.stateNode.containerInfo;if(P===g)break;if(S===4)for(S=d.return;S!==null;){var W=S.tag;if((W===3||W===4)&&S.stateNode.containerInfo===g)return;S=S.return}for(;P!==null;){if(S=La(P),S===null)return;if(W=S.tag,W===5||W===6||W===26||W===27){d=y=S;continue e}P=P.parentNode}}d=d.return}wg(function(){var le=y,ye=Pd(c),Ee=[];e:{var ue=iy.get(r);if(ue!==void 0){var pe=Gc,Ye=r;switch(r){case"keypress":if(Uc(c)===0)break e;case"keydown":case"keyup":pe=fM;break;case"focusin":Ye="focus",pe=Ld;break;case"focusout":Ye="blur",pe=Ld;break;case"beforeblur":case"afterblur":pe=Ld;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Dg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=tM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=mM;break;case Jg:case ey:case ty:pe=nM;break;case sy:pe=yM;break;case"scroll":case"scrollend":pe=JA;break;case"wheel":pe=xM;break;case"copy":case"cut":case"paste":pe=aM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Fg;break;case"toggle":case"beforetoggle":pe=RM}var ot=(o&4)!==0,Wt=!ot&&(r==="scroll"||r==="scrollend"),se=ot?ue!==null?ue+"Capture":null:ue;ot=[];for(var Z=le,oe;Z!==null;){var ve=Z;if(oe=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||oe===null||se===null||(ve=$o(Z,se),ve!=null&&ot.push(Ol(Z,ve,oe))),Wt)break;Z=Z.return}0<ot.length&&(ue=new pe(ue,Ye,null,c,ye),Ee.push({event:ue,listeners:ot}))}}if((o&7)===0){e:{if(ue=r==="mouseover"||r==="pointerover",pe=r==="mouseout"||r==="pointerout",ue&&c!==wd&&(Ye=c.relatedTarget||c.fromElement)&&(La(Ye)||Ye[ka]))break e;if((pe||ue)&&(ue=ye.window===ye?ye:(ue=ye.ownerDocument)?ue.defaultView||ue.parentWindow:window,pe?(Ye=c.relatedTarget||c.toElement,pe=le,Ye=Ye?La(Ye):null,Ye!==null&&(Wt=a(Ye),ot=Ye.tag,Ye!==Wt||ot!==5&&ot!==27&&ot!==6)&&(Ye=null)):(pe=null,Ye=le),pe!==Ye)){if(ot=Dg,ve="onMouseLeave",se="onMouseEnter",Z="mouse",(r==="pointerout"||r==="pointerover")&&(ot=Fg,ve="onPointerLeave",se="onPointerEnter",Z="pointer"),Wt=pe==null?ue:Qo(pe),oe=Ye==null?ue:Qo(Ye),ue=new ot(ve,Z+"leave",pe,c,ye),ue.target=Wt,ue.relatedTarget=oe,ve=null,La(ye)===le&&(ot=new ot(se,Z+"enter",Ye,c,ye),ot.target=oe,ot.relatedTarget=Wt,ve=ot),Wt=ve,pe&&Ye)t:{for(ot=vw,se=pe,Z=Ye,oe=0,ve=se;ve;ve=ot(ve))oe++;ve=0;for(var nt=Z;nt;nt=ot(nt))ve++;for(;0<oe-ve;)se=ot(se),oe--;for(;0<ve-oe;)Z=ot(Z),ve--;for(;oe--;){if(se===Z||Z!==null&&se===Z.alternate){ot=se;break t}se=ot(se),Z=ot(Z)}ot=null}else ot=null;pe!==null&&Sx(Ee,ue,pe,ot,!1),Ye!==null&&Wt!==null&&Sx(Ee,Wt,Ye,ot,!0)}}e:{if(ue=le?Qo(le):window,pe=ue.nodeName&&ue.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ue.type==="file")var kt=zg;else if(jg(ue))if(Hg)kt=DM;else{kt=PM;var $e=wM}else pe=ue.nodeName,!pe||pe.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?le&&Md(le.elementType)&&(kt=zg):kt=OM;if(kt&&(kt=kt(r,le))){Gg(Ee,kt,c,ye);break e}$e&&$e(r,ue,le),r==="focusout"&&le&&ue.type==="number"&&le.memoizedProps.value!=null&&Ad(ue,"number",ue.value)}switch($e=le?Qo(le):window,r){case"focusin":(jg($e)||$e.contentEditable==="true")&&(Xa=$e,zd=le,al=null);break;case"focusout":al=zd=Xa=null;break;case"mousedown":Hd=!0;break;case"contextmenu":case"mouseup":case"dragend":Hd=!1,Qg(Ee,c,ye);break;case"selectionchange":if(FM)break;case"keydown":case"keyup":Qg(Ee,c,ye)}var gt;if(Nd)e:{switch(r){case"compositionstart":var Mt="onCompositionStart";break e;case"compositionend":Mt="onCompositionEnd";break e;case"compositionupdate":Mt="onCompositionUpdate";break e}Mt=void 0}else Va?Ng(r,c)&&(Mt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(Mt="onCompositionStart");Mt&&(kg&&c.locale!=="ko"&&(Va||Mt!=="onCompositionStart"?Mt==="onCompositionEnd"&&Va&&(gt=Pg()):(dr=ye,Id="value"in dr?dr.value:dr.textContent,Va=!0)),$e=Ou(le,Mt),0<$e.length&&(Mt=new Ig(Mt,r,null,c,ye),Ee.push({event:Mt,listeners:$e}),gt?Mt.data=gt:(gt=Ug(c),gt!==null&&(Mt.data=gt)))),(gt=EM?SM(r,c):CM(r,c))&&(Mt=Ou(le,"onBeforeInput"),0<Mt.length&&($e=new Ig("onBeforeInput","beforeinput",null,c,ye),Ee.push({event:$e,listeners:Mt}),$e.data=gt)),gw(Ee,r,le,c,ye)}Tx(Ee,o)})}function Ol(r,o,c){return{instance:r,listener:o,currentTarget:c}}function Ou(r,o){for(var c=o+"Capture",d=[];r!==null;){var g=r,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=$o(r,c),g!=null&&d.unshift(Ol(r,g,y)),g=$o(r,o),g!=null&&d.push(Ol(r,g,y))),r.tag===3)return d;r=r.return}return[]}function vw(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Sx(r,o,c,d,g){for(var y=o._reactName,S=[];c!==null&&c!==d;){var P=c,W=P.alternate,le=P.stateNode;if(P=P.tag,W!==null&&W===d)break;P!==5&&P!==26&&P!==27||le===null||(W=le,g?(le=$o(c,y),le!=null&&S.unshift(Ol(c,le,W))):g||(le=$o(c,y),le!=null&&S.push(Ol(c,le,W)))),c=c.return}S.length!==0&&r.push({event:o,listeners:S})}var Rw=/\r\n?/g,Tw=/\u0000|\uFFFD/g;function Cx(r){return(typeof r=="string"?r:""+r).replace(Rw,`
50`).replace(Tw,"")}function Ax(r,o){return o=Cx(o),Cx(r)===o}function qt(r,o,c,d,g,y){switch(c){case"children":typeof d=="string"?o==="body"||o==="textarea"&&d===""||Ga(r,d):(typeof d=="number"||typeof d=="bigint")&&o!=="body"&&Ga(r,""+d);break;case"className":kc(r,"class",d);break;case"tabIndex":kc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":kc(r,c,d);break;case"style":Ag(r,d,y);break;case"data":if(o!=="object"){kc(r,"data",d);break}case"src":case"href":if(d===""&&(o!=="a"||c!=="href")){r.removeAttribute(c);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(c);break}d=Bc(""+d),r.setAttribute(c,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(c==="formAction"?(o!=="input"&&qt(r,o,"name",g.name,g,null),qt(r,o,"formEncType",g.formEncType,g,null),qt(r,o,"formMethod",g.formMethod,g,null),qt(r,o,"formTarget",g.formTarget,g,null)):(qt(r,o,"encType",g.encType,g,null),qt(r,o,"method",g.method,g,null),qt(r,o,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(c);break}d=Bc(""+d),r.setAttribute(c,d);break;case"onClick":d!=null&&(r.onclick=kn);break;case"onScroll":d!=null&&Et("scroll",r);break;case"onScrollEnd":d!=null&&Et("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(c=d.__html,c!=null){if(g.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}c=Bc(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(c,""+d):r.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
50ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":d===!0?r.setAttribute(c,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(c,d):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(c,d):r.removeAttribute(c);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(c):r.setAttribute(c,d);break;case"popover":Et("beforetoggle",r),Et("toggle",r),Fc(r,"popover",d);break;case"xlinkActuate":Fn(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Fn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Fn(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Fn(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Fn(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Fn(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Fn(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Fc(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=QA.get(c)||c,Fc(r,c,d))}}function p_(r,o,c,d,g,y){switch(c){case"style":Ag(r,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(c=d.__html,c!=null){if(g.children!=null)throw Error(s(60));r.innerHTML=c}}break;case"children":typeof d=="string"?Ga(r,d):(typeof d=="number"||typeof d=="bigint")&&Ga(r,""+d);break;case"onScroll":d!=null&&Et("scroll",r);break;case"onScrollEnd":d!=null&&Et("scrollend",r);break;case"onClick":d!=null&&(r.onclick=kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yg.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(g=c.endsWith("Capture"),o=c.slice(2,g?c.length-7:void 0),y=r[ci]||null,y=y!=null?y[c]:null,typeof y=="function"&&r.removeEventListener(o,y,g),typeof d=="function")){typeof y!="function"&&y!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(o,d,g);break e}c in r?r[c]=d:d===!0?r.setAttribute(c,""):Fc(r,c,d)}}}function Zs(r,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",r),Et("load",r);var d=!1,g=!1,y;for(y in c)if(c.hasOwnProperty(y)){var S=c[y];if(S!=null)switch(y){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:qt(r,o,y,S,c,null)}}g&&qt(r,o,"srcSet",c.srcSet,c,null),d&&qt(r,o,"src",c.src,c,null);return;case"input":Et("invalid",r);var P=y=S=g=null,W=null,le=null;for(d in c)if(c.hasOwnProperty(d)){var ye=c[d];if(ye!=null)switch(d){case"name":g=ye;break;case"type":S=ye;break;case"checked":W=ye;break;case"defaultChecked":le=ye;break;case"value":y=ye;break;case"defaultValue":P=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,o));break;default:qt(r,o,d,ye,c,null)}}Tg(r,y,P,W,le,S,g,!1);return;case"select":Et("invalid",r),d=S=y=null;for(g in c)if(c.hasOwnProperty(g)&&(P=c[g],P!=null))switch(g){case"value":y=P;break;case"defaultValue":S=P;break;case"multiple":d=P;default:qt(r,o,g,P,c,null)}o=y,c=S,r.multiple=!!d,o!=null?ja(r,!!d,o,!1):c!=null&&ja(r,!!d,c,!0);return;case"textarea":Et("invalid",r),y=g=d=null;for(S in c)if(c.hasOwnProperty(S)&&(P=c[S],P!=null))switch(S){case"value":d=P;break;case"defaultValue":g=P;break;case"children":y=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(s(91));break;default:qt(r,o,S,P,c,null)}Sg(r,d,g,y);return;case"option":for(W in c)if(c.hasOwnProperty(W)&&(d=c[W],d!=null))switch(W){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:qt(r,o,W,d,c,null)}return;case"dialog":Et("beforetoggle",r),Et("toggle",r),Et("cancel",r),Et("close",r);break;case"iframe":case"object":Et("load",r);break;case"video":case"audio":for(d=0;d<Pl.length;d++)Et(Pl[d],r);break;case"image":Et("error",r),Et("load",r);break;case"details":Et("toggle",r);break;case"embed":case"source":case"link":Et("error",r),Et("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in c)if(c.hasOwnProperty(le)&&(d=c[le],d!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:qt(r,o,le,d,c,null)}return;default:if(Md(o)){for(ye in c)c.hasOwnProperty(ye)&&(d=c[ye],d!==void 0&&p_(r,o,ye,d,c,void 0));return}}for(P in c)c.hasOwnProperty(P)&&(d=c[P],d!=null&&qt(r,o,P,d,c,null))}function Ew(r,o,c,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,S=null,P=null,W=null,le=null,ye=null;for(pe in c){var Ee=c[pe];if(c.hasOwnProperty(pe)&&Ee!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":W=Ee;default:d.hasOwnProperty(pe)||qt(r,o,pe,null,d,Ee)}}for(var ue in d){var pe=d[ue];if(Ee=c[ue],d.hasOwnProperty(ue)&&(pe!=null||Ee!=null))switch(ue){case"type":y=pe;break;case"name":g=pe;break;case"checked":le=pe;break;case"defaultChecked":ye=pe;break;case"value":S=pe;break;case"defaultValue":P=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,o));break;default:pe!==Ee&&qt(r,o,ue,pe,d,Ee)}}Cd(r,S,P,W,le,ye,y,g);return;case"select":pe=S=P=ue=null;
vendor: 7,231 bytes, line 50
50for(y in c)if(W=c[y],c.hasOwnProperty(y)&&W!=null)switch(y){case"value":break;case"multiple":pe=W;default:d.hasOwnProperty(y)||qt(r,o,y,null,d,W)}for(g in d)if(y=d[g],W=c[g],d.hasOwnProperty(g)&&(y!=null||W!=null))switch(g){case"value":ue=y;break;case"defaultValue":P=y;break;case"multiple":S=y;default:y!==W&&qt(r,o,g,y,d,W)}o=P,c=S,d=pe,ue!=null?ja(r,!!c,ue,!1):!!d!=!!c&&(o!=null?ja(r,!!c,o,!0):ja(r,!!c,c?[]:"",!1));return;case"textarea":pe=ue=null;for(P in c)if(g=c[P],c.hasOwnProperty(P)&&g!=null&&!d.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:qt(r,o,P,null,d,g)}for(S in d)if(g=d[S],y=c[S],d.hasOwnProperty(S)&&(g!=null||y!=null))switch(S){case"value":ue=g;break;case"defaultValue":pe=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(s(91));break;default:g!==y&&qt(r,o,S,g,d,y)}Eg(r,ue,pe);return;case"option":for(var Ye in c)if(ue=c[Ye],c.hasOwnProperty(Ye)&&ue!=null&&!d.hasOwnProperty(Ye))switch(Ye){case"selected":r.selected=!1;break;default:qt(r,o,Ye,null,d,ue)}for(W in d)if(ue=d[W],pe=c[W],d.hasOwnProperty(W)&&ue!==pe&&(ue!=null||pe!=null))switch(W){case"selected":r.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:qt(r,o,W,ue,d,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ot in c)ue=c[ot],c.hasOwnProperty(ot)&&ue!=null&&!d.hasOwnProperty(ot)&&qt(r,o,ot,null,d,ue);for(le in d)if(ue=d[le],pe=c[le],d.hasOwnProperty(le)&&ue!==pe&&(ue!=null||pe!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,o));break;default:qt(r,o,le,ue,d,pe)}return;default:if(Md(o)){for(var Wt in c)ue=c[Wt],c.hasOwnProperty(Wt)&&ue!==void 0&&!d.hasOwnProperty(Wt)&&p_(r,o,Wt,void 0,d,ue);for(ye in d)ue=d[ye],pe=c[ye],!d.hasOwnProperty(ye)||ue===pe||ue===void 0&&pe===void 0||p_(r,o,ye,ue,d,pe);return}}for(var se in c)ue=c[se],c.hasOwnProperty(se)&&ue!=null&&!d.hasOwnProperty(se)&&qt(r,o,se,null,d,ue);for(Ee in d)ue=d[Ee],pe=c[Ee],!d.hasOwnProperty(Ee)||ue===pe||ue==null&&pe==null||qt(r,o,Ee,ue,d,pe)}function Mx(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Sw(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,c=performance.getEntriesByType("resource"),d=0;d<c.length;d++){var g=c[d],y=g.transferSize,S=g.initiatorType,P=g.duration;if(y&&P&&Mx(S)){for(S=0,P=g.responseEnd,d+=1;d<c.length;d++){var W=c[d],le=W.startTime;if(le>P)break;var ye=W.transferSize,Ee=W.initiatorType;ye&&Mx(Ee)&&(W=W.responseEnd,S+=ye*(W<P?1:(P-le)/(W-le)))}if(--d,o+=8*(y+S)/(g.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var m_=null,g_=null;function Du(r){return r.nodeType===9?r:r.ownerDocument}function wx(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Px(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function y_(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var b_=null;function Cw(){var r=window.event;return r&&r.type==="popstate"?r===b_?!1:(b_=r,!0):(b_=null,!1)}var Ox=typeof setTimeout=="function"?setTimeout:void 0,Aw=typeof clearTimeout=="function"?clearTimeout:void 0,Dx=typeof Promise=="function"?Promise:void 0,Mw=typeof queueMicrotask=="function"?queueMicrotask:typeof Dx<"u"?function(r){return Dx.resolve(null).then(r).catch(ww)}:Ox;function ww(r){setTimeout(function(){throw r})}function wr(r){return r==="head"}function Ix(r,o){var c=o,d=0;do{var g=c.nextSibling;if(r.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"||c==="/&"){if(d===0){r.removeChild(g),bo(o);return}d--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")d++;else if(c==="html")Dl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Dl(c);for(var y=c.firstChild;y;){var S=y.nextSibling,P=y.nodeName;y[Zo]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&y.rel.toLowerCase()==="stylesheet"||c.removeChild(y),y=S}}else c==="body"&&Dl(r.ownerDocument.body);c=g}while(c);bo(o)}function Fx(r,o){var c=r;r=0;do{var d=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),d&&d.nodeType===8)if(c=d.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=d}while(c)}function x_(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":x_(c),Ed(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function Pw(r,o,c,d){for(;r.nodeType===1;){var g=c;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[Zo])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==g.rel||r.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||r.getAttribute("title")!==(g.title==null?null:g.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(g.src==null?null:g.src)||r.getAttribute("type")!==(g.type==null?null:g.type)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=Vi(r.nextSibling),r===null)break}return null}function Ow(r,o,c){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Vi(r.nextSibling),r===null))return null;return r}function kx(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Vi(r.nextSibling),r===null))return null;return r}function v_(r){return r.data==="$?"||r.data==="$~"}function R_(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function Dw(r,o){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||c.readyState!=="loading")o();else{var d=function(){o(),c.removeEventListener("DOMContentLoaded",d)};c.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function Vi(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;
vendor: 8,821 bytes, line 50
50if(o==="/$"||o==="/&")return null}}return r}var T_=null;function Lx(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(o===0)return Vi(r.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}r=r.nextSibling}return null}function Bx(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return r;o--}else c!=="/$"&&c!=="/&"||o++}r=r.previousSibling}return null}function Nx(r,o,c){switch(o=Du(c),r){case"html":if(r=o.documentElement,!r)throw Error(s(452));return r;case"head":if(r=o.head,!r)throw Error(s(453));return r;case"body":if(r=o.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function Dl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Ed(r)}var Xi=new Map,Ux=new Set;function Iu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Qn=J.d;J.d={f:Iw,r:Fw,D:kw,C:Lw,L:Bw,m:Nw,X:jw,S:Uw,M:Gw};function Iw(){var r=Qn.f(),o=Eu();return r||o}function Fw(r){var o=Ba(r);o!==null&&o.tag===5&&o.type==="form"?sb(o):Qn.r(r)}var mo=typeof document>"u"?null:document;function jx(r,o,c){var d=mo;if(d&&typeof o=="string"&&o){var g=Bi(o);g='link[rel="'+r+'"][href="'+g+'"]',typeof c=="string"&&(g+='[crossorigin="'+c+'"]'),Ux.has(g)||(Ux.add(g),r={rel:r,crossOrigin:c,href:o},d.querySelector(g)===null&&(o=d.createElement("link"),Zs(o,"link",r),zs(o),d.head.appendChild(o)))}}function kw(r){Qn.D(r),jx("dns-prefetch",r,null)}function Lw(r,o){Qn.C(r,o),jx("preconnect",r,o)}function Bw(r,o,c){Qn.L(r,o,c);var d=mo;if(d&&r&&o){var g='link[rel="preload"][as="'+Bi(o)+'"]';o==="image"&&c&&c.imageSrcSet?(g+='[imagesrcset="'+Bi(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(g+='[imagesizes="'+Bi(c.imageSizes)+'"]')):g+='[href="'+Bi(r)+'"]';var y=g;switch(o){case"style":y=go(r);break;case"script":y=yo(r)}Xi.has(y)||(r=p({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:r,as:o},c),Xi.set(y,r),d.querySelector(g)!==null||o==="style"&&d.querySelector(Il(y))||o==="script"&&d.querySelector(Fl(y))||(o=d.createElement("link"),Zs(o,"link",r),zs(o),d.head.appendChild(o)))}}function Nw(r,o){Qn.m(r,o);var c=mo;if(c&&r){var d=o&&typeof o.as=="string"?o.as:"script",g='link[rel="modulepreload"][as="'+Bi(d)+'"][href="'+Bi(r)+'"]',y=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=yo(r)}if(!Xi.has(y)&&(r=p({rel:"modulepreload",href:r},o),Xi.set(y,r),c.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Fl(y)))return}d=c.createElement("link"),Zs(d,"link",r),zs(d),c.head.appendChild(d)}}}function Uw(r,o,c){Qn.S(r,o,c);var d=mo;if(d&&r){var g=Na(d).hoistableStyles,y=go(r);o=o||"default";var S=g.get(y);if(!S){var P={loading:0,preload:null};if(S=d.querySelector(Il(y)))P.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":o},c),(c=Xi.get(y))&&E_(r,c);var W=S=d.createElement("link");zs(W),Zs(W,"link",r),W._p=new Promise(function(le,ye){W.onload=le,W.onerror=ye}),W.addEventListener("load",function(){P.loading|=1}),W.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Fu(S,o,d)}S={type:"stylesheet",instance:S,count:1,state:P},g.set(y,S)}}}function jw(r,o){Qn.X(r,o);var c=mo;if(c&&r){var d=Na(c).hoistableScripts,g=yo(r),y=d.get(g);y||(y=c.querySelector(Fl(g)),y||(r=p({src:r,async:!0},o),(o=Xi.get(g))&&S_(r,o),y=c.createElement("script"),zs(y),Zs(y,"link",r),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(g,y))}}function Gw(r,o){Qn.M(r,o);var c=mo;if(c&&r){var d=Na(c).hoistableScripts,g=yo(r),y=d.get(g);y||(y=c.querySelector(Fl(g)),y||(r=p({src:r,async:!0,type:"module"},o),(o=Xi.get(g))&&S_(r,o),y=c.createElement("script"),zs(y),Zs(y,"link",r),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(g,y))}}function Gx(r,o,c,d){var g=(g=$.current)?Iu(g):null;if(!g)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=go(c.href),c=Na(g).hoistableStyles,d=c.get(o),d||(d={type:"style",instance:null,count:0,state:null},c.set(o,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=go(c.href);var y=Na(g).hoistableStyles,S=y.get(r);if(S||(g=g.ownerDocument||g,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,S),(y=g.querySelector(Il(r)))&&!y._p&&(S.instance=y,S.state.loading=5),Xi.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Xi.set(r,c),y||zw(g,r,c,S.state))),o&&d===null)throw Error(s(528,""));return S}if(o&&d!==null)throw Error(s(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=yo(c),c=Na(g).hoistableScripts,d=c.get(o),d||(d={type:"script",instance:null,count:0,state:null},c.set(o,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function go(r){return'href="'+Bi(r)+'"'}function Il(r){return'link[rel="stylesheet"]['+r+"]"}function zx(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function zw(r,o,c,d){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?d.loading=1:(o=r.createElement("link"),d.preload=o,o.addEventListener("load",function(){return d.loading|=1}),o.addEventListener("error",function(){return d.loading|=2}),Zs(o,"link",c),zs(o),r.head.appendChild(o))}function yo(r){return'[src="'+Bi(r)+'"]'}function Fl(r){return"script[async]"+r}function Hx(r,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var d=r.querySelector('style[data-href~="'+Bi(c.href)+'"]');if(d)return o.instance=d,zs(d),d;var g=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),zs(d),Zs(d,"style",g),Fu(d,c.precedence,r),o.instance=d;case"stylesheet":g=go(c.href);var y=r.querySelector(Il(g));if(y)return o.state.loading|=4,o.instance=y,zs(y),y;d=zx(c),(g=Xi.get(g))&&E_(d,g),y=(r.ownerDocument||r).createElement("link"),zs(y);var S=y;return S._p=new Promise(function(P,W){S.onload=P,S.onerror=W}),Zs(y,"link",d),o.state.loading|=4,Fu(y,c.precedence,r),o.instance=y;case"script":return y=yo(c.src),(g=r.querySelector(Fl(y)))?(o.instance=g,zs(g),g):(d=c,(g=Xi.get(y))&&(d=p({},c),S_(d,g)),r=r.ownerDocument||r,g=r.createElement("script"),zs(g),Zs(g,"link",d),r.head.appendChild(g),o.instance=g);case"void":return null;default:throw Error(s(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(d=o.instance,o.state.loading|=4,Fu(d,c.precedence,r));return o.instance}function Fu(r,o,c){for(var d=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,y=g,S=0;S<d.length;S++){var P=d[S];if(P.dataset.precedence===o)y=P;else if(y!==g)break}y?y.parentNode.insertBefore(r,y.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(r,o.firstChild))}function E_(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function S_(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var ku=null;function Vx(r,o,c){if(ku===null){var d=new Map,g=ku=new Map;g.set(c,d)}else g=ku,d=g.get(c),d||(d=new Map,g.set(c,d));if(d.has(r))return d;for(d.set(r,null),c=c.getElementsByTagName(r),g=0;g<c.length;g++){var y=c[g];if(!(y[Zo]||y[qs]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(o)||"";S=r+S;var P=d.get(S);P?P.push(y):d.set(S,[y])}}return d}function Xx(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function Hw(r,o,c){if(c===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return r=o.disabled,typeof o.precedence=="string"&&r==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function qx(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function Vw(r,o,c,d){if(c.type==="stylesheet"&&(typeof d.media!="str
50ing"||matchMedia(d.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var g=go(d.href),y=o.querySelector(Il(g));if(y){o=y._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=Lu.bind(r),o.then(r,r)),c.state.loading|=4,c.instance=y,zs(y);return}y=o.ownerDocument||o,d=zx(d),(g=Xi.get(g))&&E_(d,g),y=y.createElement("link"),zs(y);var S=y;S._p=new Promise(function(P,W){S.onload=P,S.onerror=W}),Zs(y,"link",d),c.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=Lu.bind(r),o.addEventListener("load",c),o.addEventListener("error",c))}}var C_=0;function Xw(r,o){return r.stylesheets&&r.count===0&&Nu(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var d=setTimeout(function(){if(r.stylesheets&&Nu(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+o);0<r.imgBytes&&C_===0&&(C_=62500*Sw());var g=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Nu(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>C_?50:800)+o);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function Lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Bu=null;function Nu(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Bu=new Map,o.forEach(qw,r),Bu=null,Lu.call(r))}function qw(r,o){if(!(o.state.loading&4)){var c=Bu.get(r);if(c)var d=c.get(null);else{c=new Map,Bu.set(r,c);for(var g=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var S=g[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(c.set(S.dataset.precedence,S),d=S)}d&&c.set(null,d)}g=o.instance,S=g.getAttribute("data-precedence"),y=c.get(S)||d,y===d&&c.set(null,g),c.set(S,g),this.count++,d=Lu.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),y?y.parentNode.insertBefore(g,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(g,r.firstChild)),o.state.loading|=4}}var kl={$$typeof:D,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function Ww(r,o,c,d,g,y,S,P,W){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function Wx(r,o,c,d,g,y,S,P,W,le,ye,Ee){return r=new Ww(r,o,c,S,W,le,ye,Ee,P),o=1,y===!0&&(o|=24),y=Ei(3,null,null,o),r.current=y,y.stateNode=r,o=rf(),o.refCount++,r.pooledCache=o,o.refCount++,y.memoizedState={element:d,isDehydrated:c,cache:o},cf(y),r}function Yx(r){return r?(r=Ya,r):Ya}function Kx(r,o,c,d,g,y){g=Yx(g),d.context===null?d.context=g:d.pendingContext=g,d=yr(o),d.payload={element:c},y=y===void 0?null:y,y!==null&&(d.callback=y),c=br(r,d,o),c!==null&&(pi(c,r,o),fl(c,r,o))}function Zx(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<o?c:o}}function A_(r,o){Zx(r,o),(r=r.alternate)&&Zx(r,o)}function Qx(r){if(r.tag===13||r.tag===31){var o=ta(r,67108864);o!==null&&pi(o,r,67108864),A_(r,67108864)}}function $x(r){if(r.tag===13||r.tag===31){var o=wi();o=un(o);var c=ta(r,o);c!==null&&pi(c,r,o),A_(r,o)}}var Uu=!0;function Yw(r,o,c,d){var g=z.T;z.T=null;var y=J.p;try{J.p=2,M_(r,o,c,d)}finally{J.p=y,z.T=g}}function Kw(r,o,c,d){var g=z.T;z.T=null;var y=J.p;try{J.p=8,M_(r,o,c,d)}finally{J.p=y,z.T=g}}function M_(r,o,c,d){if(Uu){var g=w_(d);if(g===null)__(r,o,d,ju,c),ev(r,d);else if(Qw(g,r,o,c,d))d.stopPropagation();else if(ev(r,d),o&4&&-1<Zw.indexOf(r)){for(;g!==null;){var y=Ba(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=hs(y.pendingLanes);if(S!==0){var P=y;
vendor: 6,203 bytes, line 50
50for(P.pendingLanes|=2,P.entangledLanes|=2;S;){var W=1<<31-vt(S);P.entanglements[1]|=W,S&=~W}pn(y),(jt&6)===0&&(Ru=we()+500,wl(0))}}break;case 31:case 13:P=ta(y,2),P!==null&&pi(P,y,2),Eu(),A_(y,2)}if(y=w_(d),y===null&&__(r,o,d,ju,c),y===g)break;g=y}g!==null&&d.stopPropagation()}else __(r,o,d,null,c)}}function w_(r){return r=Pd(r),P_(r)}var ju=null;function P_(r){if(ju=null,r=La(r),r!==null){var o=a(r);if(o===null)r=null;else{var c=o.tag;if(c===13){if(r=l(o),r!==null)return r;r=null}else if(c===31){if(r=u(o),r!==null)return r;r=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return ju=r,null}function Jx(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ut()){case yt:return 2;case wt:return 8;case Ot:case Yt:return 32;case Ft:return 268435456;default:return 32}default:return 32}}var O_=!1,Pr=null,Or=null,Dr=null,Ll=new Map,Bl=new Map,Ir=[],Zw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ev(r,o){switch(r){case"focusin":case"focusout":Pr=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Dr=null;break;case"pointerover":case"pointerout":Ll.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bl.delete(o.pointerId)}}function Nl(r,o,c,d,g,y){return r===null||r.nativeEvent!==y?(r={blockedOn:o,domEventName:c,eventSystemFlags:d,nativeEvent:y,targetContainers:[g]},o!==null&&(o=Ba(o),o!==null&&Qx(o)),r):(r.eventSystemFlags|=d,o=r.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),r)}function Qw(r,o,c,d,g){switch(o){case"focusin":return Pr=Nl(Pr,r,o,c,d,g),!0;case"dragenter":return Or=Nl(Or,r,o,c,d,g),!0;case"mouseover":return Dr=Nl(Dr,r,o,c,d,g),!0;case"pointerover":var y=g.pointerId;return Ll.set(y,Nl(Ll.get(y)||null,r,o,c,d,g)),!0;case"gotpointercapture":return y=g.pointerId,Bl.set(y,Nl(Bl.get(y)||null,r,o,c,d,g)),!0}return!1}function tv(r){var o=La(r.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){r.blockedOn=o,Ri(r.priority,function(){$x(c)});return}}else if(o===31){if(o=u(c),o!==null){r.blockedOn=o,Ri(r.priority,function(){$x(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Gu(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var c=w_(r.nativeEvent);if(c===null){c=r.nativeEvent;var d=new c.constructor(c.type,c);wd=d,c.target.dispatchEvent(d),wd=null}else return o=Ba(c),o!==null&&Qx(o),r.blockedOn=c,!1;o.shift()}return!0}function sv(r,o,c){Gu(r)&&c.delete(o)}function $w(){O_=!1,Pr!==null&&Gu(Pr)&&(Pr=null),Or!==null&&Gu(Or)&&(Or=null),Dr!==null&&Gu(Dr)&&(Dr=null),Ll.forEach(sv),Bl.forEach(sv)}function zu(r,o){r.blockedOn===o&&(r.blockedOn=null,O_||(O_=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,$w)))}var Hu=null;function iv(r){Hu!==r&&(Hu=r,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Hu===r&&(Hu=null);for(var o=0;o<r.length;o+=3){var c=r[o],d=r[o+1],g=r[o+2];if(typeof d!="function"){if(P_(d||c)===null)continue;break}var y=Ba(c);y!==null&&(r.splice(o,3),o-=3,wf(y,{pending:!0,data:g,method:c.method,action:d},d,g))}}))}function bo(r){function o(W){return zu(W,r)}Pr!==null&&zu(Pr,r),Or!==null&&zu(Or,r),Dr!==null&&zu(Dr,r),Ll.forEach(o),Bl.forEach(o);for(var c=0;c<Ir.length;c++){var d=Ir[c];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Ir.length&&(c=Ir[0],c.blockedOn===null);)tv(c),c.blockedOn===null&&Ir.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(d=0;d<c.length;d+=3){var g=c[d],y=c[d+1],S=g[ci]||null;if(typeof y=="function")S||iv(c);else if(S){var P=null;if(y&&y.hasAttribute("formAction")){if(g=y,S=y[ci]||null)P=S.formAction;else if(P_(g)!==null)continue}else P=S.action;typeof P=="function"?c[d+1]=P:(c.splice(d,3),d-=3),iv(c)}}}function nv(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return g=S})},focusReset:"manual",scroll:"manual"})}function o(){g!==null&&(g(),g=null),d||setTimeout(c,20)}function c(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,g=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),g!==null&&(g(),g=null)}}}function D_(r){this._internalRoot=r}Vu.prototype.render=D_.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(s(409));var c=o.current,d=wi();Kx(c,d,r,o,null,null)}
50,Vu.prototype.unmount=D_.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Kx(r.current,2,null,r,null,null),Eu(),o[ka]=null}};function Vu(r){this._internalRoot=r}Vu.prototype.unstable_scheduleHydration=function(r){if(r){var o=vi();r={blockedOn:null,target:r,priority:o};for(var c=0;c<Ir.length&&o!==0&&o<Ir[c].priority;c++);Ir.splice(c,0,r),c===0&&tv(r)}};var rv=e.version;if(rv!=="19.2.1")throw Error(s(527,rv,"19.2.1"));J.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=f(o),r=r!==null?m(r):null,r=r===null?null:r.stateNode,r};var Jw={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xu.isDisabled&&Xu.supportsFiber)try{zt=Xu.inject(Jw),Ne=Xu}catch{}}return Gl.createRoot=function(r,o){if(!n(r))throw Error(s(299));var c=!1,d="",g=db,y=fb,S=_b;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(y=o.onCaughtError),o.onRecoverableError!==void 0&&(S=o.onRecoverableError)),o=Wx(r,1,!1,null,null,c,d,null,g,y,S,nv),r[ka]=o.current,f_(r),new D_(o)},Gl.hydrateRoot=function(r,o,c){if(!n(r))throw Error(s(299));var d=!1,g="",y=db,S=fb,P=_b,W=null;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(S=c.onCaughtError),c.onRecoverableError!==void 0&&(P=c.onRecoverableError),c.formState!==void 0&&(W=c.formState)),o=Wx(r,1,!0,o,c??null,d,g,W,y,S,P,nv),o.context=Yx(null),c=o.current,d=wi(),d=un(d),g=yr(d),g.callback=null,br(c,g,d),c=d,o.current.lanes=c,Pe(o,c),pn(o),r[ka]=o.current,f_(r),new Vu(o)},Gl.version="19.2.1",Gl}var Dv;function xD(){if(Dv)return U_.exports;Dv=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),U_.exports=bD(),U_.exports}var vD=xD(),RD=(function(){function i(){this.keyToValue=new Map,this.valueToKey=new Map}return i.prototype.set=function(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)},i.prototype.getByKey=function(e){return this.keyToValue.get(e)},i.prototype.getByValue=function(e){return this.valueToKey.get(e)},i.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},i})(),zE=(function(){function i(e){this.generateIdentifier=e,this.kv=new RD}return i.prototype.register=function(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))},i.prototype.clear=function(){this.kv.clear()},i.prototype.getIdentifier=function(e){return this.kv.getByValue(e)},i.prototype.getValue=function(e){return this.kv.getByKey(e)},i})(),TD=(function(){var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,n){s.__proto__=n}||function(s,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(s[a]=n[a])},i(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function s(){this.constructor=e}e.prototype=t===null?Object.create(t):(s.prototype=t.prototype,new s)}})(),ED=(function(i){TD(e,i);function e(){var t=i.call(this,function(s){return s.name})||this;return t.classToAllowedProps=new Map,t}return e.prototype.register=function(t,s){typeof s=="object"?(s.allowProps&&this.classToAllowedProps.set(t,s.allowProps),i.prototype.register.call(this,t,s.identifier)):i.prototype.register.call(this,t,s)},e.prototype.getAllowedProps=function(t){return this.classToAllowedProps.get(t)},e})(zE),SD=function(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),n,a=[],l;try{for(;(e===void 0||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(u){l={error:u}}finally{try{n&&!n.done&&(t=s.return)&&t.call(s)}finally{if(l)throw l.error}}return a};function CD(i){if("values"in Object)return Object.values(i);var e=[];
50for(var t in i)i.hasOwnProperty(t)&&e.push(i[t]);return e}function AD(i,e){var t=CD(i);if("find"in t)return t.find(e);for(var s=t,n=0;n<s.length;n++){var a=s[n];if(e(a))return a}}function No(i,e){Object.entries(i).forEach(function(t){var s=SD(t,2),n=s[0],a=s[1];return e(a,n)})}function _h(i,e){return i.indexOf(e)!==-1}function Iv(i,e){for(var t=0;t<i.length;t++){var s=i[t];if(e(s))return s}}var MD=(function(){function i(){this.transfomers={}}return i.prototype.register=function(e){this.transfomers[e.name]=e},i.prototype.findApplicable=function(e){return AD(this.transfomers,function(t){return t.isApplicable(e)})},i.prototype.findByName=function(e){return this.transfomers[e]},i})(),wD=function(i){return Object.prototype.toString.call(i).slice(8,-1)},HE=function(i){return typeof i>"u"},PD=function(i){return i===null},$l=function(i){return typeof i!="object"||i===null||i===Object.prototype?!1:Object.getPrototypeOf(i)===null?!0:Object.getPrototypeOf(i)===Object.prototype},Tp=function(i){return $l(i)&&Object.keys(i).length===0},Vr=function(i){return Array.isArray(i)},OD=function(i){return typeof i=="string"},DD=function(i){return typeof i=="number"&&!isNaN(i)},ID=function(i){return typeof i=="boolean"},FD=function(i){return i instanceof RegExp},Jl=function(i){return i instanceof Map},ec=function(i){return i instanceof Set},VE=function(i){return wD(i)==="Symbol"},kD=function(i){return i instanceof Date&&!isNaN(i.valueOf())},LD=function(i){return i instanceof Error},Fv=function(i){return typeof i=="number"&&isNaN(i)},BD=function(i){return ID(i)||PD(i)||HE(i)||DD(i)||OD(i)||VE(i)},ND=function(i){return typeof i=="bigint"},UD=function(i){return i===1/0||i===-1/0},jD=function(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)},GD=function(i){return i instanceof URL},XE=function(i){return i.replace(/\./g,"\\.")},H_=function(i){return i.map(String).map(XE).join(".")},Yl=function(i){for(var e=[],t="",s=0;s<i.length;s++){var n=i.charAt(s),a=n==="\\"&&i.charAt(s+1)===".";if(a){t+=".",s++;continue}var l=n===".";if(l){e.push(t),t="";continue}t+=n}var u=t;return e.push(u),e},Ep=function(){return Ep=Object.assign||function(i){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Ep.apply(this,arguments)},Sp=function(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),n,a=[],l;try{for(;(e===void 0||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(u){l={error:u}}finally{try{n&&!n.done&&(t=s.return)&&t.call(s)}finally{if(l)throw l.error}}return a},Cp=function(i,e){for(var t=0,s=e.length,n=i.length;t<s;t++,n++)i[n]=e[t];return i};function mn(i,e,t,s){return{isApplicable:i,annotation:e,transform:t,untransform:s}}var qE=[mn(HE,"undefined",function(){return null},function(){}),mn(ND,"bigint",function(i){return i.toString()},function(i){return typeof BigInt<"u"?BigInt(i):(console.error("Please add a BigInt polyfill."),i)}),mn(kD,"Date",function(i){return i.toISOString()},function(i){return new Date(i)}),mn(LD,"Error",function(i,e){var t={name:i.name,message:i.message};return e.allowedErrorProps.forEach(function(s){t[s]=i[s]}),t},function(i,e){var t=new Error(i.message);return t.name=i.name,t.stack=i.stack,e.allowedErrorProps.forEach(function(s){t[s]=i[s]}),t}),mn(FD,"regexp",function(i){return""+i},function(i){var e=i.slice(1,i.lastIndexOf("/")),t=i.slice(i.lastIndexOf("/")+1);return new RegExp(e,t)}),mn(ec,"set",function(i){return Cp([],Sp(i.values()))},function(i){return new Set(i)}),mn(Jl,"map",function(i){return Cp([],Sp(i.entries()))},function(i){return new Map(i)}),mn(function(i){return Fv(i)||UD(i)},"number",function(i){return Fv(i)?"NaN":i>0?"Infinity":"-Infinity"},Number),mn(function(i){return i===0&&1/i===-1/0},"number",function(){return"-0"},Number),mn(GD,"URL",function(i){return i.toString()},function(i){return new URL(i)})];function Jh(i,e,t,s){return{isApplicable:i,annotation:e,transform:t,untransform:s}}var WE=Jh(function(i,e){if(VE(i)){var t=!!e.symbolRegistry.getIdentifier(i);return t}return!1},function(i,e){var t=e.symbolRegistry.getIdentifier(i);return["symbol",t]},function(i){return i.description},function(i,e,t){var s=t.symbolRegistry.getValue(e[1]);
50if(!s)throw new Error("Trying to deserialize unknown symbol");return s}),zD=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(i,e){return i[e.name]=e,i},{}),YE=Jh(jD,function(i){return["typed-array",i.constructor.name]},function(i){return Cp([],Sp(i))},function(i,e){var t=zD[e[1]];if(!t)throw new Error("Trying to deserialize unknown typed array");return new t(i)});function KE(i,e){if(i?.constructor){var t=!!e.classRegistry.getIdentifier(i.constructor);return t}return!1}var ZE=Jh(KE,function(i,e){var t=e.classRegistry.getIdentifier(i.constructor);return["class",t]},function(i,e){var t=e.classRegistry.getAllowedProps(i.constructor);if(!t)return Ep({},i);var s={};return t.forEach(function(n){s[n]=i[n]}),s},function(i,e,t){var s=t.classRegistry.getValue(e[1]);if(!s)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(s.prototype),i)}),QE=Jh(function(i,e){return!!e.customTransformerRegistry.findApplicable(i)},function(i,e){var t=e.customTransformerRegistry.findApplicable(i);return["custom",t.name]},function(i,e){var t=e.customTransformerRegistry.findApplicable(i);return t.serialize(i)},function(i,e,t){var s=t.customTransformerRegistry.findByName(e[1]);if(!s)throw new Error("Trying to deserialize unknown custom value");return s.deserialize(i)}),HD=[ZE,WE,QE,YE],kv=function(i,e){var t=Iv(HD,function(n){return n.isApplicable(i,e)});if(t)return{value:t.transform(i,e),type:t.annotation(i,e)};var s=Iv(qE,function(n){return n.isApplicable(i,e)});if(s)return{value:s.transform(i,e),type:s.annotation}},$E={};qE.forEach(function(i){$E[i.annotation]=i});var VD=function(i,e,t){if(Vr(e))switch(e[0]){case"symbol":return WE.untransform(i,e,t);case"class":return ZE.untransform(i,e,t);case"custom":return QE.untransform(i,e,t);case"typed-array":return YE.untransform(i,e,t);default:throw new Error("Unknown transformation: "+e)}else{var s=$E[e];if(!s)throw new Error("Unknown transformation: "+e);return s.untransform(i,t)}},Co=function(i,e){for(var t=i.keys();e>0;)t.next(),e--;return t.next().value};function JE(i){if(_h(i,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(_h(i,"prototype"))throw new Error("prototype is not allowed as a property");if(_h(i,"constructor"))throw new Error("constructor is not allowed as a property")}var XD=function(i,e){JE(e);for(var t=0;t<e.length;t++){var s=e[t];if(ec(i))i=Co(i,+s);else if(Jl(i)){var n=+s,a=+e[++t]==0?"key":"value",l=Co(i,n);switch(a){case"key":i=l;break;case"value":i=i.get(l);break}}else i=i[s]}return i},Ap=function(i,e,t){if(JE(e),e.length===0)return t(i);for(var s=i,n=0;n<e.length-1;n++){var a=e[n];if(Vr(s)){var l=+a;s=s[l]}else if($l(s))s=s[a];else if(ec(s)){var u=+a;s=Co(s,u)}else if(Jl(s)){var h=n===e.length-2;if(h)break;var u=+a,f=+e[++n]==0?"key":"value",m=Co(s,u);switch(f){case"key":s=m;break;case"value":s=s.get(m);break}}}var p=e[e.length-1];if(Vr(s)?s[+p]=t(s[+p]):$l(s)&&(s[p]=t(s[p])),ec(s)){var b=Co(s,+p),v=t(b);b!==v&&(s.delete(b),s.add(v))}if(Jl(s)){var u=+e[e.length-2],R=Co(s,u),f=+p==0?"key":"value";switch(f){case"key":{var x=t(R);s.set(x,s.get(R)),x!==R&&s.delete(R);break}case"value":{s.set(R,t(s.get(R)));break}}}return i},nr=function(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),n,a=[],l;try{for(;(e===void 0||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(u){l={error:u}}finally{try{n&&!n.done&&(t=s.return)&&t.call(s)}finally{if(l)throw l.error}}return a},Ur=function(i,e){for(var t=0,s=e.length,n=i.length;t<s;t++,n++)i[n]=e[t];return i};function Mp(i,e,t){if(t===void 0&&(t=[]),!!i){if(!Vr(i)){No(i,function(l,u){return Mp(l,e,Ur(Ur([],nr(t)),nr(Yl(u))))});return}var s=nr(i,2),n=s[0],a=s[1];a&&No(a,function(l,u){Mp(l,e,Ur(Ur([],nr(t)),nr(Yl(u))))}),e(n,t)}}function qD(i,e,t){return Mp(e,function(s,n){i=Ap(i,n,function(a){return VD(a,s,t)})}),i}function WD(i,e){function t(l,u){var h=XD(i,Yl(u));l.map(Yl).forEach(function(f){i=Ap(i,f,function(){return h})})}if(Vr(e)){var s=nr(e,2),n=s[0],a=s[1];
50n.forEach(function(l){i=Ap(i,Yl(l),function(){return i})}),a&&No(a,t)}else No(e,t);return i}var YD=function(i,e){return $l(i)||Vr(i)||Jl(i)||ec(i)||KE(i,e)};function KD(i,e,t){var s=t.get(i);s?s.push(e):t.set(i,[e])}function ZD(i,e){var t={},s=void 0;return i.forEach(function(n){if(!(n.length<=1)){e||(n=n.map(function(h){return h.map(String)}).sort(function(h,f){return h.length-f.length}));var a=nr(n),l=a[0],u=a.slice(1);l.length===0?s=u.map(H_):t[H_(l)]=u.map(H_)}}),s?Tp(t)?[s]:[s,t]:Tp(t)?void 0:t}var eS=function(i,e,t,s,n,a,l){var u;n===void 0&&(n=[]),a===void 0&&(a=[]),l===void 0&&(l=new Map);var h=BD(i);if(!h){KD(i,n,e);var f=l.get(i);if(f)return s?{transformedValue:null}:f}if(!YD(i,t)){var m=kv(i,t),p=m?{transformedValue:m.value,annotations:[m.type]}:{transformedValue:i};return h||l.set(i,p),p}if(_h(a,i))return{transformedValue:null};var b=kv(i,t),v=(u=b?.value)!==null&&u!==void 0?u:i,R=Vr(v)?[]:{},x={};No(v,function(E,A){var D=eS(E,e,t,s,Ur(Ur([],nr(n)),[A]),Ur(Ur([],nr(a)),[i]),l);R[A]=D.transformedValue,Vr(D.annotations)?x[A]=D.annotations:$l(D.annotations)&&No(D.annotations,function(M,k){x[XE(A)+"."+k]=M})});var T=Tp(x)?{transformedValue:R,annotations:b?[b.type]:void 0}:{transformedValue:R,annotations:b?[b.type,x]:x};return h||l.set(i,T),T};function tS(i){return Object.prototype.toString.call(i).slice(8,-1)}function Lv(i){return tS(i)==="Array"}function QD(i){if(tS(i)!=="Object")return!1;const e=Object.getPrototypeOf(i);return!!e&&e.constructor===Object&&e===Object.prototype}function $D(i,e,t,s,n){const a={}.propertyIsEnumerable.call(s,e)?"enumerable":"nonenumerable";a==="enumerable"&&(i[e]=t),n&&a==="nonenumerable"&&Object.defineProperty(i,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}function wp(i,e={}){if(Lv(i))return i.map(n=>wp(n,e));if(!QD(i))return i;const t=Object.getOwnPropertyNames(i),s=Object.getOwnPropertySymbols(i);return[...t,...s].reduce((n,a)=>{if(Lv(e.props)&&!e.props.includes(a))return n;const l=i[a],u=wp(l,e);return $D(n,a,u,i,e.nonenumerable),n},{})}var ga=function(){return ga=Object.assign||function(i){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ga.apply(this,arguments)},JD=function(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),n,a=[],l;try{for(;(e===void 0||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(u){l={error:u}}finally{try{n&&!n.done&&(t=s.return)&&t.call(s)}finally{if(l)throw l.error}}return a},e2=function(i,e){for(var t=0,s=e.length,n=i.length;t<s;t++,n++)i[n]=e[t];return i},hr=(function(){function i(e){var t=e===void 0?{}:e,s=t.dedupe,n=s===void 0?!1:s;this.classRegistry=new ED,this.symbolRegistry=new zE(function(a){var l;return(l=a.description)!==null&&l!==void 0?l:""}),this.customTransformerRegistry=new MD,this.allowedErrorProps=[],this.dedupe=n}return i.prototype.serialize=function(e){var t=new Map,s=eS(e,t,this,this.dedupe),n={json:s.transformedValue};s.annotations&&(n.meta=ga(ga({},n.meta),{values:s.annotations}));var a=ZD(t,this.dedupe);return a&&(n.meta=ga(ga({},n.meta),{referentialEqualities:a})),n},i.prototype.deserialize=function(e){var t=e.json,s=e.meta,n=wp(t);return s?.values&&(n=qD(n,s.values,this)),s?.referentialEqualities&&(n=WD(n,s.referentialEqualities)),n},i.prototype.stringify=function(e){return JSON.stringify(this.serialize(e))},i.prototype.parse=function(e){return this.deserialize(JSON.parse(e))},i.prototype.registerClass=function(e,t){this.classRegistry.register(e,t)},i.prototype.registerSymbol=function(e,t){this.symbolRegistry.register(e,t)},i.prototype.registerCustom=function(e,t){this.customTransformerRegistry.register(ga({name:t},e))},i.prototype.allowErrorProps=function(){for(var e,t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];(e=this.allowedErrorProps).push.apply(e,e2([],JD(t)))},i.defaultInstance=new i,i.serialize=i.defaultInstance.serialize.bind(i.defaultInstance),i.deserialize=i.defaultInstance.deserialize.bind(i.defaultInstance),i.stringify=i.defaultInstance.stringify.bind(i.defaultInstance),i.parse=i.defaultInstance.parse.bind(i.defaultInstance),i.registerClass=i.defaultInstance.registerClass.bind(i.defaultInstance),i.registerSymbol=i.defaultInstance.registerSymbol.bind(i.defaultInstance),i.registerCustom=i.defaultInstance.registerCustom.bind(i.defaultInstance),i.allowErrorProps=i.defaultInstance.allowErrorProps.bind(i.defaultInstance),i})();hr.serialize;hr.deserialize;hr.stringify;hr.parse;hr.registerClass;hr.registerCustom;hr.registerSymbol;hr.allowErrorProps;var t2=(i,e,t,s,n,a,l,u)=>{let h=document.documentElement,f=["light","dark"];
vendor: 7,462 bytes, line 50
50function m(v){(Array.isArray(i)?i:[i]).forEach(R=>{let x=R==="class",T=x&&a?n.map(E=>a[E]||E):n;x?(h.classList.remove(...T),h.classList.add(a&&a[v]?a[v]:v)):h.setAttribute(R,v)}),p(v)}function p(v){u&&f.includes(v)&&(h.style.colorScheme=v)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)m(s);else try{let v=localStorage.getItem(e)||t,R=l&&v==="system"?b():v;m(R)}catch{}},s2=C.createContext(void 0),i2={setTheme:i=>{},themes:[]},n2=()=>{var i;return(i=C.useContext(s2))!=null?i:i2};C.memo(({forcedTheme:i,storageKey:e,attribute:t,enableSystem:s,enableColorScheme:n,defaultTheme:a,value:l,themes:u,nonce:h,scriptProps:f})=>{let m=JSON.stringify([t,e,a,i,u,l,s,n]).slice(1,-1);return C.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${t2.toString()})(${m})`}})});var gm=GE();const sS=eE(gm);function r2(i){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",e.appendChild(t),t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i))}const a2=i=>{switch(i){case"success":return c2;case"info":return h2;case"warning":return u2;case"error":return d2;default:return null}},o2=Array(12).fill(0),l2=({visible:i,className:e})=>Fe.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":i},Fe.createElement("div",{className:"sonner-spinner"},o2.map((t,s)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),c2=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),u2=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),h2=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),d2=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),f2=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),_2=()=>{const[i,e]=Fe.useState(document.hidden);return Fe.useEffect(()=>{const t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),i};let Pp=1,p2=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:s,...n}=e,a=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Pp++,l=this.toasts.find(h=>h.id===a),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(h=>h.id===a?(this.publish({...h,...e,id:a,title:s}),{...h,...e,id:a,dismissible:u,title:s}):h):this.addToast({title:s,...n,dismissible:u,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(s=>s({id:t.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let s;t.loading!==void 0&&(s=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const n=Promise.resolve(e instanceof Function?e():e);let a=s!==void 0,l;const u=n.then(async f=>{if(l=["resolve",f],Fe.isValidElement(f))a=!1,this.create({id:s,type:"default",message:f});else if(g2(f)&&!f.ok){a=!1;const p=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,b=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description,R=typeof p=="object"&&!Fe.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:b,...R})}else if(f instanceof Error){a=!1;const p=typeof t.error=="function"?await t.error(f):t.error,b=typeof t.description=="function"?await t.description(f):t.description,R=typeof p=="object"&&!Fe.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:b,...R})}else if(t.success!==void 0){a=!1;const p=typeof t.success=="function"?await t.success(f):t.success,b=typeof t.description=="function"?await t.description(f):t.description,R=typeof p=="object"&&!Fe.isValidElement(p)?p:{message:p};this.create({id:s,type:"success",description:b,...R})}}).catch(async f=>{if(l=["reject",f],t.error!==void 0){a=!1;const m=typeof t.error=="function"?await t.error(f):t.error,p=typeof t.description=="function"?await t.description(f):t.description,v=typeof m=="object"&&!Fe.isValidElement(m)?m:{message:m};this.create({id:s,type:"error",description:p,...v})}}).finally(()=>{a&&(this.dismiss(s),s=void 0),t.finally==null||t.finally.call(t)}),h=()=>new Promise((f,m)=>u.then(()=>l[0]==="reject"?m(l[1]):f(l[1])).catch(m));return typeof s!="string"&&typeof s!="number"?{unwrap:h}:Object.assign(s,{unwrap:h})},this.custom=(e,t)=>{const s=t?.id||Pp++;return this.create({jsx:e(s),id:s,...t}),s},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}};const mi=new p2,m2=(i,e)=>{const t=e?.id||Pp++;return mi.addToast({title:i,...e,id:t}),t},g2=i=>i&&typeof i=="object"&&"ok"in i&&typeof i.ok=="boolean"&&"status"in i&&typeof i.status=="number",y2=m2,b2=()=>mi.toasts,x2=()=>mi.getActiveToasts();Object.assign(y2,{success:mi.success,info:mi.info,warning:mi.warning,error:mi.error,custom:mi.custom,message:mi.message,promise:mi.promise,dismiss:mi.dismiss,loading:mi.loading},{getHistory:b2,getToasts:x2});r2
vendor: 14,873 bytes, line 50
50("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function 
vendor: 1,315 bytes, line 50
50Zu(i){return i.label!==void 0}const v2=3,R2="24px",T2="16px",Bv=4e3,E2=356,S2=14,C2=45,A2=200;function gn(...i){return i.filter(Boolean).join(" ")}function M2(i){const[e,t]=i.split("-"),s=[];return e&&s.push(e),t&&s.push(t),s}const w2=i=>{var e,t,s,n,a,l,u,h,f;const{invert:m,toast:p,unstyled:b,interacting:v,setHeights:R,visibleToasts:x,heights:T,index:E,toasts:A,expanded:D,removeToast:M,defaultRichColors:k,closeButton:U,style:N,cancelButtonStyle:H,actionButtonStyle:q,className:re="",descriptionClassName:ce="",duration:ae,position:fe,gap:_e,expandByDefault:Te,classNames:z,icons:J,closeButtonAriaLabel:Y="Close toast"}=i,[V,ge]=Fe.useState(null),[L,B]=Fe.useState(null),[X,Q]=Fe.useState(!1),[F,$]=Fe.useState(!1),[he,Ae]=Fe.useState(!1),[Oe,G]=Fe.useState(!1),[ie,de]=Fe.useState(!1),[Se,qe]=Fe.useState(0),[Je,Ct]=Fe.useState(0),es=Fe.useRef(p.duration||ae||Bv),ps=Fe.useRef(null),Gt=Fe.useRef(null),Rs=E===0,ms=E+1<=x,et=p.type,K=p.dismissible!==!1,we=p.className||"",Ut=p.descriptionClassName||"",yt=Fe.useMemo(()=>T.findIndex(st=>st.toastId===p.id)||0,[T,p.id]),wt=Fe.useMemo(()=>{var st;return(st=p.closeButton)!=null?st:U},[p.closeButton,U]),Ot=Fe.useMemo(()=>p.duration||ae||Bv,[p.duration,ae]),Yt=Fe.useRef(0),Ft=Fe.useRef(0),ns=Fe.useRef(0),rs=Fe.useRef(null),[zt,Ne]=fe.split("-"),rt=Fe.useMemo(()=>
vendor: 14,119 bytes, line 50
50T.reduce((st,ke,w)=>w>=yt?st:st+ke.height,0),[T,yt]),vt=_2(),$s=p.invert||m,ti=et==="loading";Ft.current=Fe.useMemo(()=>yt*_e+rt,[yt,rt]),Fe.useEffect(()=>{es.current=Ot},[Ot]),Fe.useEffect(()=>{Q(!0)},[]),Fe.useEffect(()=>{const st=Gt.current;if(st){const ke=st.getBoundingClientRect().height;return Ct(ke),R(w=>[{toastId:p.id,height:ke,position:p.position},...w]),()=>R(w=>w.filter(me=>me.toastId!==p.id))}},[R,p.id]),Fe.useLayoutEffect(()=>{if(!X)return;const st=Gt.current,ke=st.style.height;st.style.height="auto";const w=st.getBoundingClientRect().height;st.style.height=ke,Ct(w),R(me=>me.find(Pe=>Pe.toastId===p.id)?me.map(Pe=>Pe.toastId===p.id?{...Pe,height:w}:Pe):[{toastId:p.id,height:w,position:p.position},...me])},[X,p.title,p.description,R,p.id,p.jsx,p.action,p.cancel]);const js=Fe.useCallback(()=>{$(!0),qe(Ft.current),R(st=>st.filter(ke=>ke.toastId!==p.id)),setTimeout(()=>{M(p)},A2)},[p,M,R,Ft]);Fe.useEffect(()=>{if(p.promise&&et==="loading"||p.duration===1/0||p.type==="loading")return;let st;return D||v||vt?(()=>{if(ns.current<Yt.current){const me=new Date().getTime()-Yt.current;es.current=es.current-me}ns.current=new Date().getTime()})():(()=>{es.current!==1/0&&(Yt.current=new Date().getTime(),st=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),js()},es.current))})(),()=>clearTimeout(st)},[D,v,p,et,vt,js]),Fe.useEffect(()=>{p.delete&&(js(),p.onDismiss==null||p.onDismiss.call(p,p))},[js,p.delete]);function Gs(){var st;if(J?.loading){var ke;return Fe.createElement("div",{className:gn(z?.loader,p==null||(ke=p.classNames)==null?void 0:ke.loader,"sonner-loader"),"data-visible":et==="loading"},J.loading)}return Fe.createElement(l2,{className:gn(z?.loader,p==null||(st=p.classNames)==null?void 0:st.loader),visible:et==="loading"})}const li=p.icon||J?.[et]||a2(et);var Js,hs;return Fe.createElement("li",{tabIndex:0,ref:Gt,className:gn(re,we,z?.toast,p==null||(e=p.classNames)==null?void 0:e.toast,z?.default,z?.[et],p==null||(t=p.classNames)==null?void 0:t[et]),"data-sonner-toast":"","data-rich-colors":(Js=p.richColors)!=null?Js:k,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":X,"data-promise":!!p.promise,"data-swiped":ie,"data-removed":F,"data-visible":ms,"data-y-position":zt,"data-x-position":Ne,"data-index":E,"data-front":Rs,"data-swiping":he,"data-dismissible":K,"data-type":et,"data-invert":$s,"data-swipe-out":Oe,"data-swipe-direction":L,"data-expanded":!!(D||Te&&X),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":A.length-E,"--offset":`${F?Se:Ft.current}px`,"--initial-height":Te?"auto":`${Je}px`,...N,...p.style},onDragEnd:()=>{Ae(!1),ge(null),rs.current=null},onPointerDown:st=>{st.button!==2&&(ti||!K||(ps.current=new Date,qe(Ft.current),st.target.setPointerCapture(st.pointerId),st.target.tagName!=="BUTTON"&&(Ae(!0),rs.current={x:st.clientX,y:st.clientY})))},onPointerUp:()=>{var st,ke,w;if(Oe||!K)return;rs.current=null;const me=Number(((st=Gt.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),lt=Number(((ke=Gt.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Pe=new Date().getTime()-((w=ps.current)==null?void 0:w.getTime()),O=V==="x"?me:lt,Ie=Math.abs(O)/Pe;if(Math.abs(O)>=C2||Ie>.11){qe(Ft.current),p.onDismiss==null||p.onDismiss.call(p,p),B(V==="x"?me>0?"right":"left":lt>0?"down":"up"),js(),G(!0);return}else{var Rt,as;(Rt=Gt.current)==null||Rt.style.setProperty("--swipe-amount-x","0px"),(as=Gt.current)==null||as.style.setProperty("--swipe-amount-y","0px")}de(!1),Ae(!1),ge(null)},onPointerMove:st=>{var ke,w,me;if(!rs.current||!K||((ke=window.getSelection())==null?void 0:ke.toString().length)>0)return;const Pe=st.clientY-rs.current.y,O=st.clientX-rs.current.x;var Ie;const Rt=(Ie=i.swipeDirections)!=null?Ie:M2(fe);!V&&(Math.abs(O)>1||Math.abs(Pe)>1)&&ge(Math.abs(O)>Math.abs(Pe)?"x":"y");let as={x:0,y:0};const un=Ts=>1/(1.5+Math.abs(Ts)/20);if(V==="y"){if(Rt.includes("top")||Rt.includes("bottom"))if(Rt.includes("top")&&Pe<0||Rt.includes("bottom")&&Pe>0)as.y=Pe;else{const Ts=Pe*un(Pe);as.y=Math.abs(Ts)<Math.abs(Pe)?Ts:Pe}}else if(V==="x"&&(Rt.includes("left")||Rt.includes("right")))if(Rt.includes("left")&&O<0||Rt.includes("right")&&O>0)as.x=O;else{const Ts=O*un(O);as.x=Math.abs(Ts)<Math.abs(O)?Ts:O}(Math.abs(as.x)>0||Math.abs(as.y)>0)&&de(!0),(w=Gt.current)==null||w.style.setProperty("--swipe-amount-x",`${as.x}px`),(me=Gt.current)==null||me.style.setProperty("--swipe-amount-y",`${as.y}px`)}},wt&&!p.jsx&&et!=="loading"?Fe.createElement("button",{"aria-label":Y,"data-disabled":ti,"data-close-button":!0,onClick:ti||!K?()=>{}:()=>{js(),p.onDismiss==null||p.onDismiss.call(p,p)},className:gn(z?.closeButton,p==null||(s=p.classNames)==null?void 0:s.closeButton)},(hs=J?.close)!=null?hs:f2):null,(et||p.icon||p.promise)&&p.icon!==null&&(J?.[et]!==null||p.icon)?Fe.createElement("div",{"data-icon":"",className:gn(z?.icon,p==null||(n=p.classNames)==null?void 0:n.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Gs():null,p.type!=="loading"?li:null):null,Fe.createElement("div",{"data-content":"",className:gn(z?.content,p==null||(a=p.classNames)==null?void 0:a.content)},Fe.createElement("div",{"data-title":"",className:gn(z?.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?Fe.createElement("div",{"data-description":"",className:gn(ce,Ut,z?.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),Fe.isValidElement(p.cancel)?p.cancel:p.cancel&&Zu(p.cancel)?Fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||H,onClick:st=>{Zu(p.cancel)&&K&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,st),js())},className:gn(z?.cancelButton,p==null||(h=p.classNames)==null?void 0:h.cancelButton)},p.cancel.label):null,Fe.isValidElement(p.action)?p.action:p.action&&Zu(p.action)?Fe.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||q,onClick:st=>{Zu(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,st),!st.defaultPrevented&&js())},className:gn(z?.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function Nv(){if(typeof window>"u"||typeof document>"u")return"ltr";const i=document.documentElement.getAttribute("dir");return i==="auto"||!i?window.getComputedStyle(document.documentElement).direction:i}function P2(i,e){const t={};return[i,e].forEach((s,n)=>{const a=n===1,l=a?"--mobile-offset":"--offset",u=a?T2:R2;function h(f){["top","right","bottom","left"].forEach(m=>{t[`${l}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof s=="number"||typeof s=="string"?h(s):typeof s=="object"?["top","right","bottom","left"].forEach(f=>{s[f]===void 0?t[`${l}-${f}`]=u:t[`${l}-${f}`]=typeof s[f]=="number"?`${s[f]}px`:s[f]}):h(u)}),t}const O2=Fe.forwardRef(function(e,t){const{id:s,invert:n,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:h,className:f,offset:m,mobileOffset:p,theme:b="light",richColors:v,duration:R,style:x,visibleToasts:T=v2,toastOptions:E,dir:A=Nv(),gap:D=S2,icons:M,containerAriaLabel:k="Notifications"}=e,[U,N]=Fe.useState([]),H=Fe.useMemo(()=>s?U.filter(X=>X.toasterId===s):U.filter(X=>!X.toasterId),[U,s]),q=Fe.useMemo(()=>Array.from(new Set([a].concat(H.filter(X=>X.position).map(X=>X.position)))),[H,a]),[re,ce]=Fe.useState([]),[ae,fe]=Fe.useState(!1),[_e,Te]=Fe.useState(!1),[z,J]=Fe.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=Fe.useRef(null),V=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),ge=Fe.useRef(null),L=Fe.useRef(!1),B=Fe.useCallback(X=>{N(Q=>{var F;return(F=Q.find($=>$.id===X.id))!=null&&F.delete||mi.dismiss(X.id),Q.filter(({id:$})=>$!==X.id)})},[]);return Fe.useEffect(()=>mi.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{N(Q=>Q.map(F=>F.id===X.id?{...F,delete:!0}:F))});return}setTimeout(()=>{sS.flushSync(()=>{N(Q=>{const F=Q.findIndex($=>$.id===X.id);return F!==-1?[...Q.slice(0,F),{...Q[F],...X},...Q.slice(F+1)]:[X,...Q]})})})}),[U]),Fe.useEffect(()=>{if(b!=="system"){J(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?J("dark"):J("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:Q})=>{J(Q?"dark":"light")})}catch{X.addListener(({matches:F})=>{try{J(F?"dark":"light")}catch($){console.error($)}})}},[b]),Fe.useEffect(()=>{U.length<=1&&fe(!1)},[U]),Fe.useEffect(()=>{const X=Q=>{var F;if(l.every(Ae=>Q[Ae]||Q.code===Ae)){var he;fe(!0),(he=Y.current)==null||he.focus()}Q.code==="Escape"&&(document.activeElement===Y.current||(F=Y.current)!=null&&F.contains(document.activeElement))&&fe(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[l]),Fe.useEffect(()=>{if(Y.current)return()=>{ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null,L.current=!1)}},[Y.current]),Fe.createElement("section",{ref:t,"aria-label":`${k} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},q.map((X,Q)=>{var F;const[$,he]=X.split("-");return H.length?Fe.createElement("ol",{key:X,dir:A==="auto"?Nv():A,tabIndex:-1,ref:Y,className:f,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":$,"data-x-position":he,style:{"--front-toast-height":`${((F=re[0])==null?void 0:F.height)||0}px`,"--width":`${E2}px`,"--gap":`${D}px`,...x,...P2(m,p)},onBlur:Ae=>{L.current&&!Ae.currentTarget.contains(Ae.relatedTarget)&&(L.current=!1,ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null))},onFocus:Ae=>{Ae.target instanceof HTMLElement&&Ae.target.dataset.dismissible==="false"||L.current||(L.current=!0,ge.current=Ae.relatedTarget)},onMouseEnter:()=>fe(!0),onMouseMove:()=>fe(!0),onMouseLeave:()=>{_e||fe(!1)},onDragEnd:()=>fe(!1),onPointerDown:Ae=>{Ae.target instanceof HTMLElement&&Ae.target.dataset.dismissible==="false"||Te(!0)},onPointerUp:()=>Te(!1)},H.filter(Ae=>!Ae.position&&Q===0||Ae.position===X).map((Ae,Oe)=>{var G,ie;return Fe.createElement(w2,{key:Ae.id,icons:M,index:Oe,toast:Ae,defaultRichColors:v,duration:(G=E?.duration)!=null?G:R,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:n,visibleToasts:T,closeButton:(ie=E?.closeButton)!=null?ie:h,interacting:_e,position:X,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:B,toasts:H.filter(de=>de.position==Ae.position),heights:re.filter(de=>de.position==Ae.position),setHeights:ce,expandByDefault:u,gap:D,expanded:ae,swipeDirections:e.swipeDirections})})):null}))}),D2=({...i})=>{const{theme:e="system"}=n2();return _.jsx(O2,{"data-loc":"client/src/components/ui/sonner.tsx:8",theme:e,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...i})};function ut(i,e,{checkForDefaultPrevented:t=!0}={}){return function(n){if(i?.(n),t===!1||!n.defaultPrevented)return e?.(n)}}function Uv(i,e){if(typeof i=="function")return i(e);i!=null&&(i.current=e)}function ed(...i){return e=>{let t=!1;const s=i.map(n=>{const a=Uv(n,e);return!t&&typeof a=="function"&&(t=!0),a});if(t)return()=>{for(let n=0;n<s.length;n++){const a=s[n];typeof a=="function"?a():Uv(i[n],null)}}}}function Ns(...i){return C.useCallback(ed(...i),i)}function I2(i,e){const t=C.createContext(e),s=a=>{const{children:l,...u}=a,h=C.useMemo(()=>u,Object.values(u));return _.jsx(t.Provider,{value:h,children:l})};s.displayName=i+"Provider";function n(a){const l=C.useContext(t);if(l)return l;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${i}\``)}return[s,n]}function Kr(i,e=[]){let t=[];function s(a,l){const u=C.createContext(l),h=t.length;t=[...t,l];const f=p=>{const{scope:b,children:v,...R}=p,x=b?.[i]?.[h]||u,T=C.useMemo(()=>R,Object.values(R));return _.jsx(x.Provider,{value:T,children:v})};f.displayName=a+"Provider";function m(p,b){const v=b?.[i]?.[h]||u,R=C.useContext(v);if(R)return R;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[f,m]}const n=()=>{const a=t.map(l=>C.createContext(l));return function(u){const h=u?.[i]||a;return C.useMemo(()=>({[`__scope${i}`]:{...u,[i]:h}}),[u,h])}};return n.scopeName=i,[s,F2(n,...e)]}function F2(...i){const e=i[0];if(i.length===1)return e;const t=()=>{const s=i.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){const l=s.reduce((u,{useScope:h,scopeName:f})=>{const p=h(a)[`__scope${f}`];return{...u,...p}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return t.scopeName=e.scopeName,t}function Uo(i){const e=k2(i),t=C.forwardRef((s,n)=>{const{children:a,...l}=s,u=C.Children.toArray(a),h=u.find(B2);if(h){const f=h.props.children,m=u.map(p=>p===h?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:p);return _.jsx(e,{...l,ref:n,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return _.jsx(e,{...l,ref:n,children:a})});return t.displayName=`${i}.Slot`,t}var iS=Uo("Slot");function k2(i){const e=C.forwardRef((t,s)=>{const{children:n,...a}=t;if(C.isValidElement(n)){const l=U2(n),u=N2(a,n.props);return n.type!==C.Fragment&&(u.ref=s?ed(s,l):l),C.cloneElement(n,u)}return C.Children.count(n)>1?C.Children.only(null):null});return e.displayName=`${i}.SlotClone`,e}var nS=Symbol("radix.slottable");function L2(i){const e=({children:t})=>_.jsx(_.Fragment,{children:t});return e.displayName=`${i}.Slottable`,e.__radixId=nS,e}function B2(i){return C.isValidElement(i)&&typeof i.type=="function"&&"__radixId"in i.type&&i.type.__radixId===nS}function N2(i,e){const t={...e};for(const s in e){const n=i[s],a=e[s];/^on[A-Z]/.test(s)?n&&a?t[s]=(...u)=>{const h=a(...u);return n(...u),h}:n&&(t[s]=n):s==="style"?t[s]={...n,...a}
vendor: 4,621 bytes, line 50
50:s==="className"&&(t[s]=[n,a].filter(Boolean).join(" "))}return{...i,...t}}function U2(i){let e=Object.getOwnPropertyDescriptor(i.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=Object.getOwnPropertyDescriptor(i,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}var j2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],us=j2.reduce((i,e)=>{const t=Uo(`Primitive.${e}`),s=C.forwardRef((n,a)=>{const{asChild:l,...u}=n,h=l?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(h,{...u,ref:a})});return s.displayName=`Primitive.${e}`,{...i,[e]:s}},{});function rS(i,e){i&&gm.flushSync(()=>i.dispatchEvent(e))}function Mn(i){const e=C.useRef(i);return C.useEffect(()=>{e.current=i}),C.useMemo(()=>(...t)=>e.current?.(...t),[])}function G2(i,e=globalThis?.document){const t=Mn(i);C.useEffect(()=>{const s=n=>{n.key==="Escape"&&t(n)};return e.addEventListener("keydown",s,{capture:!0}),()=>e.removeEventListener("keydown",s,{capture:!0})},[t,e])}var z2="DismissableLayer",Op="dismissableLayer.update",H2="dismissableLayer.pointerDownOutside",V2="dismissableLayer.focusOutside",jv,aS=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),td=C.forwardRef((i,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:s,onPointerDownOutside:n,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...h}=i,f=C.useContext(aS),[m,p]=C.useState(null),b=m?.ownerDocument??globalThis?.document,[,v]=C.useState({}),R=Ns(e,N=>p(N)),x=Array.from(f.layers),[T]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=x.indexOf(T),A=m?x.indexOf(m):-1,D=f.layersWithOutsidePointerEventsDisabled.size>0,M=A>=E,k=W2(N=>{const H=N.target,q=[...f.branches].some(re=>re.contains(H));!M||q||(n?.(N),l?.(N),N.defaultPrevented||u?.())},b),U=Y2(N=>{const H=N.target;[...f.branches].some(re=>re.contains(H))||(a?.(N),l?.(N),N.defaultPrevented||u?.())},b);return G2(N=>{A===f.layers.size-1&&(s?.(N),!N.defaultPrevented&&u&&(N.preventDefault(),u()))},b),C.useEffect(()=>{if(m)return t&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(jv=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),Gv(),()=>{t&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=jv)}},[m,b,t,f]),C.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),Gv())},[m,f]),C.useEffect(()=>{const N=()=>v({});return document.addEventListener(Op,N),()=>document.removeEventListener(Op,N)},[]),_.jsx(us.div,{...h,ref:R,style:{pointerEvents:D?M?"auto":"none":void 0,...i.style},onFocusCapture:ut(i.onFocusCapture,U.onFocusCapture),onBlurCapture:ut(i.onBlurCapture,U.onBlurCapture),onPointerDownCapture:ut(i.onPointerDownCapture,k.onPointerDownCapture)})});td.displayName=z2;var X2="DismissableLayerBranch",q2=C.forwardRef((i,e)=>{const t=C.useContext(aS),s=C.useRef(null),n=Ns(e,s);return C.useEffect(()=>{const a=s.current;if(a)return t.branches.add(a),()=>{t.branches.delete(a)}},[t.branches]),_.jsx(us.div,{...i,ref:n})});q2.displayName=X2;function W2(i,e=globalThis?.document){const t=Mn(i),s=C.useRef(!1),n=C.useRef(()=>{});return C.useEffect(()=>{const a=u=>{if(u.target&&!s.current){let h=function(){oS(H2,t,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(e.removeEventListener("click",n.current),n.current=h,e.addEventListener("click",n.current,{once:!0})):h()}else e.removeEventListener("click",n.current);s.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",a),e.removeEventListener("click",n.current)}},[e,t]),{onPointerDownCapture:()=>s.current=!0}}function Y2(i,e=globalThis?.document){const t=Mn(i),s=C.useRef(!1);return C.useEffect(()=>{const n=a=>{a.target&&!s.current&&oS(V2,t,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",n),()=>e.removeEventListener("focusin",n)},[e,t]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Gv(){const i=new CustomEvent(Op);document.dispatchEvent(i)}function oS(i,e,t,{discrete:s}){const n=t.originalEvent.target,a=new CustomEvent(i,{bubbles:!1,cancelable:!0,detail:t});e&&n.addEventListener(i,e,{once:!0}),s?rS(n,a):n.dispatchEvent(a)}var rn=globalThis?.document?C.useLayoutEffect:()=>{},K2=Wh[" useId ".trim().toString()]||(()=>{}),Z2=0;function va(i){const[e,t]=C.useState(K2());return rn(()=>{t(s=>s??String(Z2++))},[i]),i||(e?`radix-${e}
50`:"")}const Q2=["top","right","bottom","left"],Xr=Math.min,Di=Math.max,Th=Math.round,Qu=Math.floor,Cn=i=>({x:i,y:i}),$2={left:"right",right:"left",bottom:"top",top:"bottom"},J2={start:"end",end:"start"};function Dp(i,e,t){return Di(i,Xr(e,t))}function cr(i,e){return typeof i=="function"?i(e):i}function ur(i){return i.split("-")[0]}function Vo(i){return i.split("-")[1]}function ym(i){return i==="x"?"y":"x"}function bm(i){return i==="y"?"height":"width"}const eI=new Set(["top","bottom"]);function Tn(i){return eI.has(ur(i))?"y":"x"}function xm(i){return ym(Tn(i))}function tI(i,e,t){t===void 0&&(t=!1);const s=Vo(i),n=xm(i),a=bm(n);let l=n==="x"?s===(t?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(l=Eh(l)),[l,Eh(l)]}function sI(i){const e=Eh(i);return[Ip(i),e,Ip(e)]}function Ip(i){return i.replace(/start|end/g,e=>J2[e])}const zv=["left","right"],Hv=["right","left"],iI=["top","bottom"],nI=["bottom","top"];function rI(i,e,t){switch(i){case"top":case"bottom":return t?e?Hv:zv:e?zv:Hv;case"left":case"right":return e?iI:nI;default:return[]}}function aI(i,e,t,s){const n=Vo(i);let a=rI(ur(i),t==="start",s);return n&&(a=a.map(l=>l+"-"+n),e&&(a=a.concat(a.map(Ip)))),a}function Eh(i){return i.replace(/left|right|bottom|top/g,e=>$2[e])}function oI(i){return{top:0,right:0,bottom:0,left:0,...i}}function lS(i){return typeof i!="number"?oI(i):{top:i,right:i,bottom:i,left:i}}function Sh(i){const{x:e,y:t,width:s,height:n}=i;return{width:s,height:n,top:t,left:e,right:e+s,bottom:t+n,x:e,y:t}}function Vv(i,e,t){let{reference:s,floating:n}=i;const a=Tn(e),l=xm(e),u=bm(l),h=ur(e),f=a==="y",m=s.x+s.width/2-n.width/2,p=s.y+s.height/2-n.height/2,b=s[u]/2-n[u]/2;let v;switch(h){case"top":v={x:m,y:s.y-n.height};break;case"bottom":v={x:m,y:s.y+s.height};break;case"right":v={x:s.x+s.width,y:p};break;case"left":v={x:s.x-n.width,y:p};break;default:v={x:s.x,y:s.y}}switch(Vo(e)){case"start":v[l]-=b*(t&&f?-1:1);break;case"end":v[l]+=b*(t&&f?-1:1);break}return v}const lI=async(i,e,t)=>{const{placement:s="bottom",strategy:n="absolute",middleware:a=[],platform:l}=t,u=a.filter(Boolean),h=await(l.isRTL==null?void 0:l.isRTL(e));let f=await l.getElementRects({reference:i,floating:e,strategy:n}),{x:m,y:p}=Vv(f,s,h),b=s,v={},R=0;for(let x=0;x<u.length;x++){const{name:T,fn:E}=u[x],{x:A,y:D,data:M,reset:k}=await E({x:m,y:p,initialPlacement:s,placement:b,strategy:n,middlewareData:v,rects:f,platform:l,elements:{reference:i,floating:e}});m=A??m,p=D??p,v={...v,[T]:{...v[T],...M}},k&&R<=50&&(R++,typeof k=="object"&&(k.placement&&(b=k.placement),k.rects&&(f=k.rects===!0?await l.getElementRects({reference:i,floating:e,strategy:n}):k.rects),{x:m,y:p}=Vv(f,b,h)),x=-1)}return{x:m,y:p,placement:b,strategy:n,middlewareData:v}};async function tc(i,e){var t;e===void 0&&(e={});const{x:s,y:n,platform:a,rects:l,elements:u,strategy:h}=i,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:b=!1,padding:v=0}=cr(e,i),R=lS(v),T=u[b?p==="floating"?"reference":"floating":p],E=Sh(await a.getClippingRect({element:(t=await(a.isElement==null?void 0:a.isElement(T)))==null||t?T:T.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:f,rootBoundary:m,strategy:h})),A=p==="floating"?{x:s,y:n,width:l.floating.width,height:l.floating.height}:l.reference,D=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),M=await(a.isElement==null?void 0:a.isElement(D))?await(a.getScale==null?void 0:a.getScale(D))||{x:1,y:1}:{x:1,y:1},k=Sh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:A,offsetParent:D,strategy:h}):A);return{top:(E.top-k.top+R.top)/M.y,bottom:(k.bottom-E.bottom+R.bottom)/M.y,left:(E.left-k.left+R.left)/M.x,right:(k.right-E.right+R.right)/M.x}}const cI=i=>({name:"arrow",options:i,async fn(e){const{x:t,y:s,placement:n,rects:a,platform:l,elements:u,middlewareData:h}=e,{element:f,padding:m=0}=cr(i,e)||{};if(f==null)return{};const p=lS(m),b={x:t,y:s}
vendor: 8,765 bytes, line 50
50,v=xm(n),R=bm(v),x=await l.getDimensions(f),T=v==="y",E=T?"top":"left",A=T?"bottom":"right",D=T?"clientHeight":"clientWidth",M=a.reference[R]+a.reference[v]-b[v]-a.floating[R],k=b[v]-a.reference[v],U=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let N=U?U[D]:0;(!N||!await(l.isElement==null?void 0:l.isElement(U)))&&(N=u.floating[D]||a.floating[R]);const H=M/2-k/2,q=N/2-x[R]/2-1,re=Xr(p[E],q),ce=Xr(p[A],q),ae=re,fe=N-x[R]-ce,_e=N/2-x[R]/2+H,Te=Dp(ae,_e,fe),z=!h.arrow&&Vo(n)!=null&&_e!==Te&&a.reference[R]/2-(_e<ae?re:ce)-x[R]/2<0,J=z?_e<ae?_e-ae:_e-fe:0;return{[v]:b[v]+J,data:{[v]:Te,centerOffset:_e-Te-J,...z&&{alignmentOffset:J}},reset:z}}}),uI=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(e){var t,s;const{placement:n,middlewareData:a,rects:l,initialPlacement:u,platform:h,elements:f}=e,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:R="none",flipAlignment:x=!0,...T}=cr(i,e);if((t=a.arrow)!=null&&t.alignmentOffset)return{};const E=ur(n),A=Tn(u),D=ur(u)===u,M=await(h.isRTL==null?void 0:h.isRTL(f.floating)),k=b||(D||!x?[Eh(u)]:sI(u)),U=R!=="none";!b&&U&&k.push(...aI(u,x,R,M));const N=[u,...k],H=await tc(e,T),q=[];let re=((s=a.flip)==null?void 0:s.overflows)||[];if(m&&q.push(H[E]),p){const _e=tI(n,l,M);q.push(H[_e[0]],H[_e[1]])}if(re=[...re,{placement:n,overflows:q}],!q.every(_e=>_e<=0)){var ce,ae;const _e=(((ce=a.flip)==null?void 0:ce.index)||0)+1,Te=N[_e];if(Te&&(!(p==="alignment"?A!==Tn(Te):!1)||re.every(Y=>Tn(Y.placement)===A?Y.overflows[0]>0:!0)))return{data:{index:_e,overflows:re},reset:{placement:Te}};let z=(ae=re.filter(J=>J.overflows[0]<=0).sort((J,Y)=>J.overflows[1]-Y.overflows[1])[0])==null?void 0:ae.placement;if(!z)switch(v){case"bestFit":{var fe;const J=(fe=re.filter(Y=>{if(U){const V=Tn(Y.placement);return V===A||V==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(V=>V>0).reduce((V,ge)=>V+ge,0)]).sort((Y,V)=>Y[1]-V[1])[0])==null?void 0:fe[0];J&&(z=J);break}case"initialPlacement":z=u;break}if(n!==z)return{reset:{placement:z}}}return{}}}};function Xv(i,e){return{top:i.top-e.height,right:i.right-e.width,bottom:i.bottom-e.height,left:i.left-e.width}}function qv(i){return Q2.some(e=>i[e]>=0)}const hI=function(i){return i===void 0&&(i={}),{name:"hide",options:i,async fn(e){const{rects:t}=e,{strategy:s="referenceHidden",...n}=cr(i,e);switch(s){case"referenceHidden":{const a=await tc(e,{...n,elementContext:"reference"}),l=Xv(a,t.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:qv(l)}}}case"escaped":{const a=await tc(e,{...n,altBoundary:!0}),l=Xv(a,t.floating);return{data:{escapedOffsets:l,escaped:qv(l)}}}default:return{}}}}},cS=new Set(["left","top"]);async function dI(i,e){const{placement:t,platform:s,elements:n}=i,a=await(s.isRTL==null?void 0:s.isRTL(n.floating)),l=ur(t),u=Vo(t),h=Tn(t)==="y",f=cS.has(l)?-1:1,m=a&&h?-1:1,p=cr(e,i);let{mainAxis:b,crossAxis:v,alignmentAxis:R}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof R=="number"&&(v=u==="end"?R*-1:R),h?{x:v*m,y:b*f}:{x:b*f,y:v*m}}const fI=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(e){var t,s;const{x:n,y:a,placement:l,middlewareData:u}=e,h=await dI(e,i);return l===((t=u.offset)==null?void 0:t.placement)&&(s=u.arrow)!=null&&s.alignmentOffset?{}:{x:n+h.x,y:a+h.y,data:{...h,placement:l}}}}},_I=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(e){const{x:t,y:s,placement:n}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:T=>{let{x:E,y:A}=T;return{x:E,y:A}}},...h}=cr(i,e),f={x:t,y:s},m=await tc(e,h),p=Tn(ur(n)),b=ym(p);let v=f[b],R=f[p];if(a){const T=b==="y"?"top":"left",E=b==="y"?"bottom":"right",A=v+m[T],D=v-m[E];v=Dp(A,v,D)}if(l){const T=p==="y"?"top":"left",E=p==="y"?"bottom":"right",A=R+m[T],D=R-m[E];R=Dp(A,R,D)}const x=u.fn({...e,[b]:v,[p]:R});return{...x,data:{x:x.x-t,y:x.y-s,enabled:{[b]:a,[p]:l}}}}}},pI=function(i){return i===void 0&&(i={}),{options:i,fn(e){const{x:t,y:s,placement:n,rects:a,middlewareData:l}=e,{offset:u=0,mainAxis:h=!0,crossAxis:f=!0}=cr(i,e),m={x:t,y:s},p=Tn(n),b=ym(p);let v=m[b],R=m[p];const x=cr(u,e),T=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(h){const D=b==="y"?"height":"width",M=a.reference[b]-a.floating[D]+T.mainAxis,k=a.reference[b]+a.reference[D]-T.mainAxis;v<M?v=M:v>k&&(v=k)}if(f){var E,A;const D=b==="y"?"width":"height",M=cS.has(ur(n)),k=a.reference[p]-a.floating[D]+(M&&((E=l.offset)==null?void 0:E[p])||0)+(M?0:T.crossAxis),U=a.reference[p]+a.reference[D]+(M?0:((A=l.offset)==null?void 0:A[p])||0)-(M?T.crossAxis:0);R<k?R=k:R>U&&(R=U)}return{[b]:v,[p]:R}}}},mI=function(i){return i===void 0&&(i={}),{name:"size",options:i,async fn(e){var t,s;const{placement:n,rects:a,platform:l,elements:u}=e,{apply:h=()=>{},...f}=cr(i,e),m=await tc(e,f),p=ur(n),b=Vo(n),v=Tn(n)==="y",{width:R,height:x}=a.floating;let T,E;p==="top"||p==="bottom"?(T=p,E=b===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(E=p,T=b==="end"?"top":"bottom");const A=x-m.top-m.bottom,D=R-m.left-m.right,M=Xr(x-m[T],A),k=Xr(R-m[E],D),U=!e.middlewareData.shift;let N=M,H=k;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(H=D),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(N=A),U&&!b){const re=Di(m.left,0),ce=Di(m.right,0),ae=Di(m.top,0),fe=Di(m.bottom,0);v?H=R-2*(re!==0||ce!==0?re+ce:Di(m.left,m.right)):N=x-2*(ae!==0||fe!==0?ae+fe:Di(m.top,m.bottom))}await h({...e,availableWidth:H,availableHeight:N});const q=await l.getDimensions(u.floating);return R!==q.width||x!==q.height?{reset:{rects:!0}}:{}}}};function sd(){return typeof window<"u"}function Xo(i){return uS(i)?(i.nodeName||"").toLowerCase():"#document"}function ki(i){var e;return(i==null||(e=i.ownerDocument)==null?void 0:e.defaultView)||window}function Dn(i){var e;return(e=(uS(i)?i.ownerDocument:i.document)||window.document)==null?void 0:e.documentElement}function uS(i){return sd()?i instanceof Node||i instanceof ki(i).Node:!1}function an(i){return sd()?i instanceof Element||i instanceof ki(i).Element:!1}function wn(i){return sd()?i instanceof HTMLElement||i instanceof ki(i).HTMLElement:!1}function Wv(i){return!sd()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof ki(i).ShadowRoot}const gI=new Set(["inline","contents"]);function Tc(i){const{overflow:e,overflowX:t,overflowY:s,display:n}=on(i);return/auto|scroll|overlay|hidden|clip/.test(e+s+t)&&!gI.has(n)}const yI=new Set(["table","td","th"]);function bI(i){return yI.has(Xo(i))}const xI=[":popover-open",":modal"];function id(i){return xI.some(e=>{try{return i.matches(e)}catch{return!1}})}const vI=["transform","translate","scale","rotate","perspective"],RI=["transform","translate","scale","rotate","perspective","filter"],TI=["paint","layout","strict","content"];function vm(i){const e=Rm(),t=an(i)?on(i):i;return vI.some(s=>t[s]?t[s]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||RI.some(s=>(t.willChange||"").includes(s))||TI.some(s=>(t.contain||"").includes(s))}function EI(i){let e=qr(i);for(;wn(e)&&!jo(e);){if(vm(e))return e;if(id(e))return null;e=qr(e)}return null}function Rm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const SI=new Set(["html","body","#document"]);function jo(i){return SI.has(Xo(i))}function on(i){return ki(i).getComputedStyle(i)}function nd(i){return an(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function qr(i){if(Xo(i)==="html")return i;const e=i.assignedSlot||i.parentNode||Wv(i)&&i.host||Dn(i);return Wv(e)?e.host:e}function hS(i){const e=qr(i);return jo(e)?i.ownerDocument?i.ownerDocument.body:i.body:wn(e)&&Tc(e)?e:hS(e)}function sc(i,e,t){var s;e===void 0&&(e=[]),t===void 0&&(t=!0);const n=hS(i),a=n===((s=i.ownerDocument)==null?void 0:s.body),l=ki(n);if(a){const u=Fp(l);return e.concat(l,l.visualViewport||[],Tc(n)?n:[],u&&t?sc(u):[])}return e.concat(n,sc(n,[],t))}function Fp(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function dS(i){const e=on(i);let t=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const n=wn(i),a=n?i.offsetWidth:t,l=n?i.offsetHeight:s,u=Th(t)!==a||Th(s)!==l;return u&&(t=a,s=l),{width:t,height:s,$:u}}function Tm(i){return an(i)?i:i.contextElement}function wo(i){const e=Tm(i);if(!wn(e))return Cn(1);const t=e.getBoundingClientRect(),{width:s,height:n,$:a}=dS(e);let l=(a?Th(t.width):t.width)/s,u=(a?Th(t.height):t.height)/n;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const CI=Cn(0);function fS(i){const e=ki(i);
vendor: 15,161 bytes, line 50
50return!Rm()||!e.visualViewport?CI:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function AI(i,e,t){return e===void 0&&(e=!1),!t||e&&t!==ki(i)?!1:e}function Aa(i,e,t,s){e===void 0&&(e=!1),t===void 0&&(t=!1);const n=i.getBoundingClientRect(),a=Tm(i);let l=Cn(1);e&&(s?an(s)&&(l=wo(s)):l=wo(i));const u=AI(a,t,s)?fS(a):Cn(0);let h=(n.left+u.x)/l.x,f=(n.top+u.y)/l.y,m=n.width/l.x,p=n.height/l.y;if(a){const b=ki(a),v=s&&an(s)?ki(s):s;let R=b,x=Fp(R);for(;x&&s&&v!==R;){const T=wo(x),E=x.getBoundingClientRect(),A=on(x),D=E.left+(x.clientLeft+parseFloat(A.paddingLeft))*T.x,M=E.top+(x.clientTop+parseFloat(A.paddingTop))*T.y;h*=T.x,f*=T.y,m*=T.x,p*=T.y,h+=D,f+=M,R=ki(x),x=Fp(R)}}return Sh({width:m,height:p,x:h,y:f})}function rd(i,e){const t=nd(i).scrollLeft;return e?e.left+t:Aa(Dn(i)).left+t}function _S(i,e){const t=i.getBoundingClientRect(),s=t.left+e.scrollLeft-rd(i,t),n=t.top+e.scrollTop;return{x:s,y:n}}function MI(i){let{elements:e,rect:t,offsetParent:s,strategy:n}=i;const a=n==="fixed",l=Dn(s),u=e?id(e.floating):!1;if(s===l||u&&a)return t;let h={scrollLeft:0,scrollTop:0},f=Cn(1);const m=Cn(0),p=wn(s);if((p||!p&&!a)&&((Xo(s)!=="body"||Tc(l))&&(h=nd(s)),wn(s))){const v=Aa(s);f=wo(s),m.x=v.x+s.clientLeft,m.y=v.y+s.clientTop}const b=l&&!p&&!a?_S(l,h):Cn(0);return{width:t.width*f.x,height:t.height*f.y,x:t.x*f.x-h.scrollLeft*f.x+m.x+b.x,y:t.y*f.y-h.scrollTop*f.y+m.y+b.y}}function wI(i){return Array.from(i.getClientRects())}function PI(i){const e=Dn(i),t=nd(i),s=i.ownerDocument.body,n=Di(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),a=Di(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let l=-t.scrollLeft+rd(i);const u=-t.scrollTop;return on(s).direction==="rtl"&&(l+=Di(e.clientWidth,s.clientWidth)-n),{width:n,height:a,x:l,y:u}}const Yv=25;function OI(i,e){const t=ki(i),s=Dn(i),n=t.visualViewport;let a=s.clientWidth,l=s.clientHeight,u=0,h=0;if(n){a=n.width,l=n.height;const m=Rm();(!m||m&&e==="fixed")&&(u=n.offsetLeft,h=n.offsetTop)}const f=rd(s);if(f<=0){const m=s.ownerDocument,p=m.body,b=getComputedStyle(p),v=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,R=Math.abs(s.clientWidth-p.clientWidth-v);R<=Yv&&(a-=R)}else f<=Yv&&(a+=f);return{width:a,height:l,x:u,y:h}}const DI=new Set(["absolute","fixed"]);function II(i,e){const t=Aa(i,!0,e==="fixed"),s=t.top+i.clientTop,n=t.left+i.clientLeft,a=wn(i)?wo(i):Cn(1),l=i.clientWidth*a.x,u=i.clientHeight*a.y,h=n*a.x,f=s*a.y;return{width:l,height:u,x:h,y:f}}function Kv(i,e,t){let s;if(e==="viewport")s=OI(i,t);else if(e==="document")s=PI(Dn(i));else if(an(e))s=II(e,t);else{const n=fS(i);s={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Sh(s)}function pS(i,e){const t=qr(i);return t===e||!an(t)||jo(t)?!1:on(t).position==="fixed"||pS(t,e)}function FI(i,e){const t=e.get(i);if(t)return t;let s=sc(i,[],!1).filter(u=>an(u)&&Xo(u)!=="body"),n=null;const a=on(i).position==="fixed";let l=a?qr(i):i;for(;an(l)&&!jo(l);){const u=on(l),h=vm(l);!h&&u.position==="fixed"&&(n=null),(a?!h&&!n:!h&&u.position==="static"&&!!n&&DI.has(n.position)||Tc(l)&&!h&&pS(i,l))?s=s.filter(m=>m!==l):n=u,l=qr(l)}return e.set(i,s),s}function kI(i){let{element:e,boundary:t,rootBoundary:s,strategy:n}=i;const l=[...t==="clippingAncestors"?id(e)?[]:FI(e,this._c):[].concat(t),s],u=l[0],h=l.reduce((f,m)=>{const p=Kv(e,m,n);return f.top=Di(p.top,f.top),f.right=Xr(p.right,f.right),f.bottom=Xr(p.bottom,f.bottom),f.left=Di(p.left,f.left),f},Kv(e,u,n));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function LI(i){const{width:e,height:t}=dS(i);return{width:e,height:t}}function BI(i,e,t){const s=wn(e),n=Dn(e),a=t==="fixed",l=Aa(i,!0,a,e);let u={scrollLeft:0,scrollTop:0};const h=Cn(0);function f(){h.x=rd(n)}if(s||!s&&!a)if((Xo(e)!=="body"||Tc(n))&&(u=nd(e)),s){const v=Aa(e,!0,a,e);h.x=v.x+e.clientLeft,h.y=v.y+e.clientTop}else n&&f();a&&!s&&n&&f();const m=n&&!s&&!a?_S(n,u):Cn(0),p=l.left+u.scrollLeft-h.x-m.x,b=l.top+u.scrollTop-h.y-m.y;return{x:p,y:b,width:l.width,height:l.height}}function V_(i){return on(i).position==="static"}function Zv(i,e){if(!wn(i)||on(i).position==="fixed")return null;if(e)return e(i);let t=i.offsetParent;return Dn(i)===t&&(t=t.ownerDocument.body),t}function mS(i,e){const t=ki(i);if(id(i))return t;if(!wn(i)){let n=qr(i);for(;n&&!jo(n);){if(an(n)&&!V_(n))return n;n=qr(n)}return t}let s=Zv(i,e);for(;s&&bI(s)&&V_(s);)s=Zv(s,e);return s&&jo(s)&&V_(s)&&!vm(s)?t:s||EI(i)||t}const NI=async function(i){const e=this.getOffsetParent||mS,t=this.getDimensions,s=await t(i.floating);return{reference:BI(i.reference,await e(i.floating),i.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function UI(i){return on(i).direction==="rtl"}const jI={convertOffsetParentRelativeRectToViewportRelativeRect:MI,getDocumentElement:Dn,getClippingRect:kI,getOffsetParent:mS,getElementRects:NI,getClientRects:wI,getDimensions:LI,getScale:wo,isElement:an,isRTL:UI};function gS(i,e){return i.x===e.x&&i.y===e.y&&i.width===e.width&&i.height===e.height}function GI(i,e){let t=null,s;const n=Dn(i);function a(){var u;clearTimeout(s),(u=t)==null||u.disconnect(),t=null}function l(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),a();const f=i.getBoundingClientRect(),{left:m,top:p,width:b,height:v}=f;if(u||e(),!b||!v)return;const R=Qu(p),x=Qu(n.clientWidth-(m+b)),T=Qu(n.clientHeight-(p+v)),E=Qu(m),D={rootMargin:-R+"px "+-x+"px "+-T+"px "+-E+"px",threshold:Di(0,Xr(1,h))||1};let M=!0;function k(U){const N=U[0].intersectionRatio;if(N!==h){if(!M)return l();N?l(!1,N):s=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!gS(f,i.getBoundingClientRect())&&l(),M=!1}try{t=new IntersectionObserver(k,{...D,root:n.ownerDocument})}catch{t=new IntersectionObserver(k,D)}t.observe(i)}return l(!0),a}function zI(i,e,t,s){s===void 0&&(s={});const{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,f=Tm(i),m=n||a?[...f?sc(f):[],...sc(e)]:[];m.forEach(E=>{n&&E.addEventListener("scroll",t,{passive:!0}),a&&E.addEventListener("resize",t)});const p=f&&u?GI(f,t):null;let b=-1,v=null;l&&(v=new ResizeObserver(E=>{let[A]=E;A&&A.target===f&&v&&(v.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var D;(D=v)==null||D.observe(e)})),t()}),f&&!h&&v.observe(f),v.observe(e));let R,x=h?Aa(i):null;h&&T();function T(){const E=Aa(i);x&&!gS(x,E)&&t(),x=E,R=requestAnimationFrame(T)}return t(),()=>{var E;m.forEach(A=>{n&&A.removeEventListener("scroll",t),a&&A.removeEventListener("resize",t)}),p?.(),(E=v)==null||E.disconnect(),v=null,h&&cancelAnimationFrame(R)}}const HI=fI,VI=_I,XI=uI,qI=mI,WI=hI,Qv=cI,YI=pI,KI=(i,e,t)=>{const s=new Map,n={platform:jI,...t},a={...n.platform,_c:s};return lI(i,e,{...n,platform:a})};var ZI=typeof document<"u",QI=function(){},ph=ZI?C.useLayoutEffect:QI;function Ch(i,e){if(i===e)return!0;if(typeof i!=typeof e)return!1;if(typeof i=="function"&&i.toString()===e.toString())return!0;let t,s,n;if(i&&e&&typeof i=="object"){if(Array.isArray(i)){if(t=i.length,t!==e.length)return!1;for(s=t;s--!==0;)if(!Ch(i[s],e[s]))return!1;return!0}if(n=Object.keys(i),t=n.length,t!==Object.keys(e).length)return!1;for(s=t;s--!==0;)if(!{}.hasOwnProperty.call(e,n[s]))return!1;for(s=t;s--!==0;){const a=n[s];if(!(a==="_owner"&&i.$$typeof)&&!Ch(i[a],e[a]))return!1}return!0}return i!==i&&e!==e}function yS(i){return typeof window>"u"?1:(i.ownerDocument.defaultView||window).devicePixelRatio||1}function $v(i,e){const t=yS(i);return Math.round(e*t)/t}function X_(i){const e=C.useRef(i);return ph(()=>{e.current=i}),e}function $I(i){i===void 0&&(i={});const{placement:e="bottom",strategy:t="absolute",middleware:s=[],platform:n,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:h,open:f}=i,[m,p]=C.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[b,v]=C.useState(s);Ch(b,s)||v(s);const[R,x]=C.useState(null),[T,E]=C.useState(null),A=C.useCallback(Y=>{Y!==U.current&&(U.current=Y,x(Y))},[]),D=C.useCallback(Y=>{Y!==N.current&&(N.current=Y,E(Y))},[]),M=a||R,k=l||T,U=C.useRef(null),N=C.useRef(null),H=C.useRef(m),q=h!=null,re=X_(h),ce=X_(n),ae=X_(f),fe=C.useCallback(()=>{if(!U.current||!N.current)return;const Y={placement:e,strategy:t,middleware:b};ce.current&&(Y.platform=ce.current),KI(U.current,N.current,Y).then(V=>{const ge={...V,isPositioned:ae.current!==!1};_e.current&&!Ch(H.current,ge)&&(H.current=ge,gm.flushSync(()=>{p(ge)}))})},[b,e,t,ce,ae]);ph(()=>{f===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,p(Y=>({...Y,isPositioned:!1})))},[f]);const _e=C.useRef(!1);ph(()=>(_e.current=!0,()=>{_e.current=!1}),[]),ph(()=>{if(M&&(U.current=M),k&&(N.current=k),M&&k){if(re.current)return re.current(M,k,fe);fe()}},[M,k,fe,re,q]);const Te=C.useMemo(()=>({reference:U,floating:N,setReference:A,setFloating:D}),[A,D]),z=C.useMemo(()=>({reference:M,floating:k}),[M,k]),J=C.useMemo(()=>{const Y={position:t,left:0,top:0};if(!z.floating)return Y;const V=$v(z.floating,m.x),ge=$v(z.floating,m.y);return u?{...Y,transform:"translate("+V+"px, "+ge+"px)",...yS(z.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:V,top:ge}},[t,u,z.floating,m.x,m.y]);return C.useMemo(()=>({...m,update:fe,refs:Te,elements:z,floatingStyles:J}),[m,fe,Te,z,J])}const JI=i=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:i,fn(t){const{element:s,padding:n}=typeof i=="function"?i(t):i;return s&&e(s)?s.current!=null?Qv({element:s.current,padding:n}).fn(t):{}:s?Qv({element:s,padding:n}).fn(t):{}}}},eF=(i,e)=>({...HI(i),options:[i,e]}),tF=(i,e)=>({...VI(i),options:[i,e]}),sF=(i,e)=>({...YI(i),options:[i,e]}),iF=(i,e)=>({...XI(i),options:[i,e]}),nF=(i,e)=>({...qI(i),options:[i,e]}),rF=(i,e)=>({...WI(i),options:[i,e]}),aF=(i,e)=>({...JI(i),options:[i,e]});var oF="Arrow",bS=C.forwardRef((i,e)=>{const{children:t,width:s=10,height:n=5,...a}=i;return _.jsx(us.svg,{...a,ref:e,width:s,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:i.asChild?t:_.jsx("polygon",{points:"0,0 30,0 15,10"})})});bS.displayName=oF;var lF=bS;function cF(i){const[e,t]=C.useState(void 0);return rn(()=>{if(i){t({width:i.offsetWidth,height:i.offsetHeight});const s=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const a=n[0];let l,u;if("borderBoxSize"in a){const h=a.borderBoxSize,f=Array.isArray(h)?h[0]:h;l=f.inlineSize,u=f.blockSize}else l=i.offsetWidth,u=i.offsetHeight;t({width:l,height:u})});return s.observe(i,{box:"border-box"}),()=>s.unobserve(i)}else t(void 0)},[i]),e}var Em="Popper",[xS,ad]=Kr(Em),[uF,vS]=xS(Em),RS=i=>{const{__scopePopper:e,children:t}=i,[s,n]=C.useState(null);return _.jsx(uF,{scope:e,anchor:s,onAnchorChange:n,children:t})};RS.displayName=Em;var TS="PopperAnchor",ES=C.forwardRef((i,e)=>{const{__scopePopper:t,virtualRef:s,...n}=i,a=vS(TS,t),l=C.useRef(null),u=Ns(e,l),h=C.useRef(null);return C.useEffect(()=>{const f=h.current;h.current=s?.current||l.current,f!==h.current&&a.onAnchorChange(h.current)}),s?null:_.jsx(us.div,{...n,ref:u})});ES.displayName=TS;var Sm="PopperContent",[hF,dF]=xS(Sm),SS=C.forwardRef((i,e)=>{const{__scopePopper:t,side:s="bottom",sideOffset:n=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:R,...x}=i,T=vS(Sm,t),[E,A]=C.useState(null),D=Ns(e,he=>A(he)),[M,k]=C.useState(null),U=cF(M),N=U?.width??0,H=U?.height??0,q=s+(a!=="center"?"-"+a:""),re=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},ce=Array.isArray(f)?f:[f],ae=ce.length>0,fe={padding:re,boundary:ce.filter(_F),altBoundary:ae},{refs:_e,floatingStyles:Te,placement:z,isPositioned:J,middlewareData:Y}=$I({strategy:"fixed",placement:q,whileElementsMounted:(...he)=>zI(...he,{animationFrame:v==="always"}),elements:{reference:T.anchor},middleware:[eF({mainAxis:n+H,alignmentAxis:l}),h&&tF({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?sF():void 0,...fe}),h&&iF({...fe}),nF({...fe,apply:({elements:he,rects:Ae,availableWidth:Oe,availableHeight:G})=>{const{width:ie,height:de}=Ae.reference,Se=he.floating.style;Se.setProperty("--radix-popper-available-width",`${Oe}px`),Se.setProperty("--radix-popper-available-height",`${G}px`),Se.setProperty("--radix-popper-anchor-width",`${ie}px`),Se.setProperty("--radix-popper-anchor-height",`${de}px`)}}),M&&aF({element:M,padding:u}),pF({arrowWidth:N,arrowHeight:H}),b&&rF({strategy:"referenceHidden",...fe})]}),[V,ge]=MS(z),L=Mn(R);rn(()=>{J&&L?.()},[J,L]);const B=Y.arrow?.x,X=Y.arrow?.y,Q=Y.arrow?.centerOffset!==0,[F,$]=C.useState();return rn(()=>{E&&$(window.getComputedStyle(E).zIndex)},[E]),_.jsx("div",{ref:_e.setFloating,"data-radix-popper-content-wrapper":"",style:{...Te,transform:J?Te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:F,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:i.dir,children:_.jsx(hF,{scope:t,placedSide:V,onArrowChange:k,arrowX:B,arrowY:X,shouldHideArrow:Q,children:_.jsx(us.div,{"data-side":V,"data-align":ge,...x,ref:D,style:{...x.style,animation:J?void 0:"none"}})})})});SS.displayName=Sm;var CS="PopperArrow",fF={top:"bottom",right:"left",bottom:"top",left:"right"},AS=C.forwardRef(function(e,t){const{__scopePopper:s,...n}=e,a=dF(CS,s),l=fF[a.placedSide];return _.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:_.jsx(lF,{...n,ref:t,style:{...n.style,display:"block"}})})});AS.displayName=CS;function _F(i){return i!==null}var pF=i=>({name:"transformOrigin",options:i,fn(e){const{placement:t,rects:s,middlewareData:n}=e,l=n.arrow?.centerOffset!==0,u=l?0:i.arrowWidth,h=l?0:i.arrowHeight,[f,m]=MS(t),p={start:"0%",center:"50%",end:"100%"}[m],b=(n.arrow?.x??0)+u/2,v=(n.arrow?.y??0)+h/2;let R="",x="";return f==="bottom"?(R=l?p:`${b}px`,x=`${-h}px`):f==="top"?(R=l?p:`${b}px`,x=`${s.floating.height+h}px`):f==="right"?(R=`${-h}px`,x=l?p:`${v}px`):f==="left"&&(R=`${s.floating.width+h}px`,x=l?p:`${v}px`),{data:{x:R,y:x}}}});function MS(i){const[e,t="center"]=i.split("-");return[e,t]}var wS=RS,PS=ES,OS=SS,DS=AS,mF="Portal",od=C.forwardRef((i,e)=>{const{container:t,...s}=i,[n,a]=C.useState(!1);rn(()=>a(!0),[]);const l=t||n&&globalThis?.document?.body;return l?sS.createPortal(_.jsx(us.div,{...s,ref:e}),l):null});od.displayName=mF;function gF(i,e){return C.useReducer((t,s)=>e[t][s]??t,i)}var In=i=>{const{present:e,children:t}=i,s=yF(e),n=typeof t=="function"?t({present:s.isPresent}):C.Children.only(t),a=Ns(s.ref,bF(n));return typeof t=="function"||s.isPresent?C.cloneElement(n,{ref:a}):null};In.displayName="Presence";function yF(i){const[e,t]=C.useState(),s=C.useRef(null),n=C.useRef(i),a=C.useRef("none"),l=i?"mounted":"unmounted",[u,h]=gF(l,{mou
vendor: 8,954 bytes, line 50
50nted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const f=$u(s.current);a.current=u==="mounted"?f:"none"},[u]),rn(()=>{const f=s.current,m=n.current;if(m!==i){const b=a.current,v=$u(f);i?h("MOUNT"):v==="none"||f?.display==="none"?h("UNMOUNT"):h(m&&b!==v?"ANIMATION_OUT":"UNMOUNT"),n.current=i}},[i,h]),rn(()=>{if(e){let f;const m=e.ownerDocument.defaultView??window,p=v=>{const x=$u(s.current).includes(CSS.escape(v.animationName));if(v.target===e&&x&&(h("ANIMATION_END"),!n.current)){const T=e.style.animationFillMode;e.style.animationFillMode="forwards",f=m.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=T)})}},b=v=>{v.target===e&&(a.current=$u(s.current))};return e.addEventListener("animationstart",b),e.addEventListener("animationcancel",p),e.addEventListener("animationend",p),()=>{m.clearTimeout(f),e.removeEventListener("animationstart",b),e.removeEventListener("animationcancel",p),e.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[e,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:C.useCallback(f=>{s.current=f?getComputedStyle(f):null,t(f)},[])}}function $u(i){return i?.animationName||"none"}function bF(i){let e=Object.getOwnPropertyDescriptor(i.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?i.ref:(e=Object.getOwnPropertyDescriptor(i,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?i.props.ref:i.props.ref||i.ref)}var xF=Wh[" useInsertionEffect ".trim().toString()]||rn;function ld({prop:i,defaultProp:e,onChange:t=()=>{},caller:s}){const[n,a,l]=vF({defaultProp:e,onChange:t}),u=i!==void 0,h=u?i:n;{const m=C.useRef(i!==void 0);C.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=u},[u,s])}const f=C.useCallback(m=>{if(u){const p=RF(m)?m(i):m;p!==i&&l.current?.(p)}else a(m)},[u,i,a,l]);return[h,f]}function vF({defaultProp:i,onChange:e}){const[t,s]=C.useState(i),n=C.useRef(t),a=C.useRef(e);return xF(()=>{a.current=e},[e]),C.useEffect(()=>{n.current!==t&&(a.current?.(t),n.current=t)},[t,n]),[t,s,a]}function RF(i){return typeof i=="function"}var TF=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),EF="VisuallyHidden",IS=C.forwardRef((i,e)=>_.jsx(us.span,{...i,ref:e,style:{...TF,...i.style}}));IS.displayName=EF;var SF=IS,[cd]=Kr("Tooltip",[ad]),ud=ad(),FS="TooltipProvider",CF=700,kp="tooltip.open",[AF,Cm]=cd(FS),kS=i=>{const{__scopeTooltip:e,delayDuration:t=CF,skipDelayDuration:s=300,disableHoverableContent:n=!1,children:a}=i,l=C.useRef(!0),u=C.useRef(!1),h=C.useRef(0);return C.useEffect(()=>{const f=h.current;return()=>window.clearTimeout(f)},[]),_.jsx(AF,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:C.useCallback(()=>{window.clearTimeout(h.current),l.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>l.current=!0,s)},[s]),isPointerInTransitRef:u,onPointerInTransitChange:C.useCallback(f=>{u.current=f},[]),disableHoverableContent:n,children:a})};kS.displayName=FS;var ic="Tooltip",[MF,Ec]=cd(ic),LS=i=>{const{__scopeTooltip:e,children:t,open:s,defaultOpen:n,onOpenChange:a,disableHoverableContent:l,delayDuration:u}=i,h=Cm(ic,i.__scopeTooltip),f=ud(e),[m,p]=C.useState(null),b=va(),v=C.useRef(0),R=l??h.disableHoverableContent,x=u??h.delayDuration,T=C.useRef(!1),[E,A]=ld({prop:s,defaultProp:n??!1,onChange:N=>{N?(h.onOpen(),document.dispatchEvent(new CustomEvent(kp))):h.onClose(),a?.(N)},caller:ic}),D=C.useMemo(()=>E?T.current?"delayed-open":"instant-open":"closed",[E]),M=C.useCallback(()=>{window.clearTimeout(v.current),v.current=0,T.current=!1,A(!0)},[A]),k=C.useCallback(()=>{window.clearTimeout(v.current),v.current=0,A(!1)},[A]),U=C.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{T.current=!0,A(!0),v.current=0},x)},[x,A]);return C.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),_.jsx(wS,{...f,children:_.jsx(MF,{scope:e,contentId:b,open:E,stateAttribute:D,trigger:m,onTriggerChange:p,onTriggerEnter:C.useCallback(()=>{h.isOpenDelayedRef.current?U():M()},[h.isOpenDelayedRef,U,M]),onTriggerLeave:C.useCallback(()=>{R?k():(window.clearTimeout(v.current),v.current=0)},[k,R]),onOpen:M,onClose:k,disableHoverableContent:R,children:t})})};LS.displayName=ic;var Lp="TooltipTrigger",BS=C.forwardRef((i,e)=>{const{__scopeTooltip:t,...s}=i,n=Ec(Lp,t),a=Cm(Lp,t),l=ud(t),u=C.useRef(null),h=Ns(e,u,n.onTriggerChange),f=C.useRef(!1),m=C.useRef(!1),p=C.useCallback(()=>f.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),_.jsx(PS,{asChild:!0,...l,children:_.jsx(us.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...s,ref:h,onPointerMove:ut(i.onPointerMove,b=>{b.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(n.onTriggerEnter(),m.current=!0)}),onPointerLeave:ut(i.onPointerLeave,()=>{n.onTriggerLeave(),m.current=!1}),onPointerDown:ut(i.onPointerDown,()=>{n.open&&n.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ut(i.onFocus,()=>{f.current||n.onOpen()}),onBlur:ut(i.onBlur,n.onClose),onClick:ut(i.onClick,n.onClose)})})});BS.displayName=Lp;var Am="TooltipPortal",[wF,PF]=cd(Am,{forceMount:void 0}),NS=i=>{const{__scopeTooltip:e,forceMount:t,children:s,container:n}=i,a=Ec(Am,e);return _.jsx(wF,{scope:e,forceMount:t,children:_.jsx(In,{present:t||a.open,children:_.jsx(od,{asChild:!0,container:n,children:s})})})};NS.displayName=Am;var Go="TooltipContent",US=C.forwardRef((i,e)=>{const t=PF(Go,i.__scopeTooltip),{forceMount:s=t.forceMount,side:n="top",...a}=i,l=Ec(Go,i.__scopeTooltip);return _.jsx(In,{present:s||l.open,children:l.disableHoverableContent?_.jsx(jS,{side:n,...a,ref:e}):_.jsx(OF,{side:n,...a,ref:e})})}),OF=C.forwardRef((i,e)=>{const t=Ec(Go,i.__scopeTooltip),s=Cm(Go,i.__scopeTooltip),n=C.useRef(null),a=Ns(e,n),[l,u]=C.useState(null),{trigger:h,onClose:f}=t,m=n.current,{onPointerInTransitChange:p}=s,b=C.useCallback(()=>{u(null),p(!1)},[p]),v=C.useCallback((R,x)=>{const T=R.currentTarget,E={x:R.clientX,y:R.clientY},A=kF(E,T.getBoundingClientRect()),D=LF(E,A),M=BF(x.getBoundingClientRect()),k=UF([...D,...M]);u(k),p(!0)},[p]);return C.useEffect(()=>()=>b(),[b]),C.useEffect(()=>{if(h&&m){const R=T=>v(T,m),x=T=>v(T,h);return h.addEventListener("pointerleave",R),m.addEventListener("pointerleave",x),()=>{h.removeEventListener("pointerleave",R),m.removeEventListener("pointerleave",x)}}},[h,m,v,b]),C.useEffect(()=>{if(l){const R=x=>{const T=x.target,E={x:x.clientX,y:x.clientY},A=h?.contains(T)||m?.contains(T),D=!NF(E,l);A?b():D&&(b(),f())};return document.addEventListener("pointermove",R),()=>document.removeEventListener("pointermove",R)}},[h,m,l,f,b]),_.jsx(jS,{...i,ref:a})}),[DF,IF]=cd(ic,{isInside:!1}),FF=L2("TooltipContent"),jS=C.forwardRef((i,e)=>{const{__scopeTooltip:t,children:s,"aria-label":n,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=i,h=Ec(Go,t),f=ud(t),{onClose:m}=h;return C.useEffect(()=>(document.addEventListener(kp,m),()=>document.removeEventListener(kp,m)),[m]),C.useEffect(()=>{if(h.trigger){const p=b=>{b.target?.contains(h.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[h.trigger,m]),_.jsx(td,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:_.jsxs(OS,{"data-state":h.stateAttribute,...f,...u,ref:e,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[_.jsx(FF,{children:s}),_.jsx(DF,{scope:t,isInside:!0,children:_.jsx(SF,{id:h.contentId,role:"tooltip",children:n||s})})]})})});US.displayName=Go;var GS="TooltipArrow",zS=C.forwardRef((i,e)=>{const{__scopeTooltip:t,...s}=i,n=ud(t);return IF(GS,t).isInside?null:_.jsx(DS,{...n,...s,ref:e})});zS.displayName=GS;function kF(i,e){const t=Math.abs(e.top-i.y),s=Math.abs(e.bottom-i.y),n=Math.abs(e.right-i.x),a=Math.abs(e.left-i.x);switch(Math.min(t,s,n,a)){case a:return"left";case n:return"right";case t:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function LF(i,e,t=5){const s=[];
vendor: 6,297 bytes, line 50
50switch(e){case"top":s.push({x:i.x-t,y:i.y+t},{x:i.x+t,y:i.y+t});break;case"bottom":s.push({x:i.x-t,y:i.y-t},{x:i.x+t,y:i.y-t});break;case"left":s.push({x:i.x+t,y:i.y-t},{x:i.x+t,y:i.y+t});break;case"right":s.push({x:i.x-t,y:i.y-t},{x:i.x-t,y:i.y+t});break}return s}function BF(i){const{top:e,right:t,bottom:s,left:n}=i;return[{x:n,y:e},{x:t,y:e},{x:t,y:s},{x:n,y:s}]}function NF(i,e){const{x:t,y:s}=i;let n=!1;for(let a=0,l=e.length-1;a<e.length;l=a++){const u=e[a],h=e[l],f=u.x,m=u.y,p=h.x,b=h.y;m>s!=b>s&&t<(p-f)*(s-m)/(b-m)+f&&(n=!n)}return n}function UF(i){const e=i.slice();return e.sort((t,s)=>t.x<s.x?-1:t.x>s.x?1:t.y<s.y?-1:t.y>s.y?1:0),jF(e)}function jF(i){if(i.length<=1)return i.slice();const e=[];for(let s=0;s<i.length;s++){const n=i[s];for(;e.length>=2;){const a=e[e.length-1],l=e[e.length-2];if((a.x-l.x)*(n.y-l.y)>=(a.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let s=i.length-1;s>=0;s--){const n=i[s];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(n.y-l.y)>=(a.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var GF=kS,zF=LS,HF=BS,VF=NS,XF=US,qF=zS;function HS(i){var e,t,s="";if(typeof i=="string"||typeof i=="number")s+=i;else if(typeof i=="object")if(Array.isArray(i)){var n=i.length;for(e=0;e<n;e++)i[e]&&(t=HS(i[e]))&&(s&&(s+=" "),s+=t)}else for(t in i)i[t]&&(s&&(s+=" "),s+=t);return s}function VS(){for(var i,e,t=0,s="",n=arguments.length;t<n;t++)(i=arguments[t])&&(e=HS(i))&&(s&&(s+=" "),s+=e);return s}const Mm="-",WF=i=>{const e=KF(i),{conflictingClassGroups:t,conflictingClassGroupModifiers:s}=i;return{getClassGroupId:l=>{const u=l.split(Mm);return u[0]===""&&u.length!==1&&u.shift(),XS(u,e)||YF(l)},getConflictingClassGroupIds:(l,u)=>{const h=t[l]||[];return u&&s[l]?[...h,...s[l]]:h}}},XS=(i,e)=>{if(i.length===0)return e.classGroupId;const t=i[0],s=e.nextPart.get(t),n=s?XS(i.slice(1),s):void 0;if(n)return n;if(e.validators.length===0)return;const a=i.join(Mm);return e.validators.find(({validator:l})=>l(a))?.classGroupId},Jv=/^\[(.+)\]$/,YF=i=>{if(Jv.test(i)){const e=Jv.exec(i)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},KF=i=>{const{theme:e,classGroups:t}=i,s={nextPart:new Map,validators:[]};for(const n in t)Bp(t[n],s,n,e);return s},Bp=(i,e,t,s)=>{i.forEach(n=>{if(typeof n=="string"){const a=n===""?e:e0(e,n);a.classGroupId=t;return}if(typeof n=="function"){if(ZF(n)){Bp(n(s),e,t,s);return}e.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(([a,l])=>{Bp(l,e0(e,a),t,s)})})},e0=(i,e)=>{let t=i;return e.split(Mm).forEach(s=>{t.nextPart.has(s)||t.nextPart.set(s,{nextPart:new Map,validators:[]}),t=t.nextPart.get(s)}),t},ZF=i=>i.isThemeGetter,QF=i=>{if(i<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,s=new Map;const n=(a,l)=>{t.set(a,l),e++,e>i&&(e=0,s=t,t=new Map)};return{get(a){let l=t.get(a);if(l!==void 0)return l;if((l=s.get(a))!==void 0)return n(a,l),l},set(a,l){t.has(a)?t.set(a,l):n(a,l)}}},Np="!",Up=":",$F=Up.length,JF=i=>{const{prefix:e,experimentalParseClassName:t}=i;let s=n=>{const a=[];let l=0,u=0,h=0,f;for(let R=0;R<n.length;R++){let x=n[R];if(l===0&&u===0){if(x===Up){a.push(n.slice(h,R)),h=R+$F;continue}if(x==="/"){f=R;continue}}x==="["?l++:x==="]"?l--:x==="("?u++:x===")"&&u--}const m=a.length===0?n:n.substring(h),p=ek(m),b=p!==m,v=f&&f>h?f-h:void 0;return{modifiers:a,hasImportantModifier:b,baseClassName:p,maybePostfixModifierPosition:v}};if(e){const n=e+Up,a=s;s=l=>l.startsWith(n)?a(l.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(t){const n=s;s=a=>t({className:a,parseClassName:n})}return s},ek=i=>i.endsWith(Np)?i.substring(0,i.length-1):i.startsWith(Np)?i.substring(1):i,tk=i=>{const e=Object.fromEntries(i.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const n=[];let a=[];return s.forEach(l=>{l[0]==="["||e[l]?(n.push(...a.sort(),l),a=[]):a.push(l)}),n.push(...a.sort()),n}},sk=i=>({cache:QF(i.cacheSize),parseClassName:JF(i),sortModifiers:tk(i),...WF(i)}),ik=/\s+/,nk=(i,e)=>{const{parseClassName:t,getClassGroupId:s,getConflictingClassGroupIds:n,sortModifiers:a}=e,l=[],u=i.trim().split(ik);let h="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:p,modifiers:b,hasImportantModifier:v,baseClassName:R,maybePostfixModifierPosition:x}=t(m);if(p){h=m+(h.length>0?" "+h:h);continue}let T=!!x,E=s(T?R.substring(0,x):R);if(!E){if(!T){h=m+(h.length>0?" "+h:h);continue}if(E=s(R),!E){h=m+(h.length>0?" "+h:h);continue}T=!1}const A=a(b).join(":"),D=v?A+Np:A,M=D+E;if(l.includes(M))continue;l.push(M);const k=n(E,T);for(let U=0;U<k.length;++U){const N=k[U];l.push(D+N)}h=m+(h.length>0?" "+h:h)}return h};function rk(){let i=0,e,t,s="";for(;i<arguments.length;)(e=arguments[i++])&&(t=qS(e))&&(s&&(s+=" "),s+=t);return s}const qS=i=>{if(typeof i=="string")return i;let e,t="";for(let s=0;s<i.length;s++)i[s]&&(e=qS(i[s]))&&(t&&(t+=" "),t+=e);return t};function ak(i,...e){let t,s,n,a=l;function l(h){const f=e.reduce((m,p)=>p(m),i());return t=sk(f),s=t.cache.get,n=t.cache.set,a=u,u(h)}function u(h){const f=s(h);if(f)return f;const m=nk(h,t);return n(h,m),m}return function(){return a(rk.apply(null,arguments))}}const Ls=i=>{const e=t=>t[i]||[];return e.isThemeGetter=!0,e},WS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,YS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ok=/^\d+\/\d+$/,lk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ck=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vo=i=>ok.test(i),xt=i=>!!i&&!Number.isNaN(Number(i)),kr=i=>!!i&&Number.isInteger(Number(i)),q_=i=>i.endsWith("%")&&xt(i.slice(0,-1)),$n=i=>lk.test(i),fk=()=>!0,_k=i=>ck.test(i)&&!uk.test(i),KS=()=>!1,pk=i=>hk.test(i),mk=i=>dk.test(i),gk=i=>!Ke(i)&&!Ze(i),yk=i=>qo(i,$S,KS),Ke=i=>WS.test(i),_a=i=>qo(i,JS,_k),W_=i=>qo(i,Tk,xt),t0=i=>qo(i,ZS,KS),bk=i=>qo(i,QS,mk),Ju=i=>qo(i,eC,pk),Ze=i=>YS.test(i),zl=i=>Wo(i,JS),xk=i=>Wo(i,Ek),s0=i=>Wo(i,ZS),vk=i=>Wo(i,$S),Rk=i=>Wo(i,QS),eh=i=>
vendor: 4,522 bytes, line 50
50Wo(i,eC,!0),qo=(i,e,t)=>{const s=WS.exec(i);return s?s[1]?e(s[1]):t(s[2]):!1},Wo=(i,e,t=!1)=>{const s=YS.exec(i);return s?s[1]?e(s[1]):t:!1},ZS=i=>i==="position"||i==="percentage",QS=i=>i==="image"||i==="url",$S=i=>i==="length"||i==="size"||i==="bg-size",JS=i=>i==="length",Tk=i=>i==="number",Ek=i=>i==="family-name",eC=i=>i==="shadow",Sk=()=>{const i=Ls("color"),e=Ls("font"),t=Ls("text"),s=Ls("font-weight"),n=Ls("tracking"),a=Ls("leading"),l=Ls("breakpoint"),u=Ls("container"),h=Ls("spacing"),f=Ls("radius"),m=Ls("shadow"),p=Ls("inset-shadow"),b=Ls("text-shadow"),v=Ls("drop-shadow"),R=Ls("blur"),x=Ls("perspective"),T=Ls("aspect"),E=Ls("ease"),A=Ls("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...M(),Ze,Ke],U=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],H=()=>[Ze,Ke,h],q=()=>[vo,"full","auto",...H()],re=()=>[kr,"none","subgrid",Ze,Ke],ce=()=>["auto",{span:["full",kr,Ze,Ke]},kr,Ze,Ke],ae=()=>[kr,"auto",Ze,Ke],fe=()=>["auto","min","max","fr",Ze,Ke],_e=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Te=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...H()],J=()=>[vo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],Y=()=>[i,Ze,Ke],V=()=>[...M(),s0,t0,{position:[Ze,Ke]}],ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",vk,yk,{size:[Ze,Ke]}],B=()=>[q_,zl,_a],X=()=>["","none","full",f,Ze,Ke],Q=()=>["",xt,zl,_a],F=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[xt,q_,s0,t0],Ae=()=>["","none",R,Ze,Ke],Oe=()=>["none",xt,Ze,Ke],G=()=>["none",xt,Ze,Ke],ie=()=>[xt,Ze,Ke],de=()=>[vo,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$n],breakpoint:[$n],color:[fk],container:[$n],"drop-shadow":[$n],ease:["in","out","in-out"],font:[gk],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$n],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$n],shadow:[$n],spacing:["px",xt],text:[$n],"text-shadow":[$n],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vo,Ke,Ze,T]}],container:["container"],columns:[{columns:[xt,Ke,Ze,u]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[kr,"auto",Ze,Ke]}],basis:[{basis:[vo,"full","auto",u,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xt,vo,"auto","initial","none",Ke]}],grow:[{grow:["",xt,Ze,Ke]}],shrink:[{shrink:["",xt,Ze,Ke]}],order:[{order:[kr,"first","last","none",Ze,Ke]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":ae()}
vendor: 11,043 bytes, line 50
50],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"justify-content":[{justify:[..._e(),"normal"]}],"justify-items":[{"justify-items":[...Te(),"normal"]}],"justify-self":[{"justify-self":["auto",...Te()]}],"align-content":[{content:["normal",..._e()]}],"align-items":[{items:[...Te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Te(),{baseline:["","last"]}]}],"place-content":[{"place-content":_e()}],"place-items":[{"place-items":[...Te(),"baseline"]}],"place-self":[{"place-self":["auto",...Te()]}],p:[{p:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[u,"screen",...J()]}],"min-w":[{"min-w":[u,"screen","none",...J()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",t,zl,_a]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ze,W_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",q_,Ke]}],"font-family":[{font:[xk,Ke,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,Ze,Ke]}],"line-clamp":[{"line-clamp":[xt,"none",Ze,W_]}],leading:[{leading:[a,...H()]}],"list-image":[{"list-image":["none",Ze,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:[xt,"from-font","auto",Ze,_a]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[xt,"auto",Ze,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:ge()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},kr,Ze,Ke],radial:["",Ze,Ke],conic:[kr,Ze,Ke]},Rk,bk]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...F(),"hidden","none"]}],"divide-style":[{divide:[...F(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...F(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xt,Ze,Ke]}],"outline-w":[{outline:["",xt,zl,_a]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",m,eh,Ju]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",p,eh,Ju]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[xt,_a]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",b,eh,Ju]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[xt,Ze,Ke]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[xt]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[Ze,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[xt]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:ge()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Ke]}],filter:[{filter:["","none",Ze,Ke]}],blur:[{blur:Ae()}],brightness:[{brightness:[xt,Ze,Ke]}],contrast:[{contrast:[xt,Ze,Ke]}],"drop-shadow":[{"drop-shadow":["","none",v,eh,Ju]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",xt,Ze,Ke]}],"hue-rotate":[{"hue-rotate":[xt,Ze,Ke]}],invert:[{invert:["",xt,Ze,Ke]}],saturate:[{saturate:[xt,Ze,Ke]}],sepia:[{sepia:["",xt,Ze,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Ke]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[xt,Ze,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[xt,Ze,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xt,Ze,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xt,Ze,Ke]}],"backdrop-invert":[{"backdrop-invert":["",xt,Ze,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[xt,Ze,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[xt,Ze,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",xt,Ze,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ze,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xt,"initial",Ze,Ke]}],ease:[{ease:["linear","initial",E,Ze,Ke]}],delay:[{delay:[xt,Ze,Ke]}],animate:[{animate:["none",A,Ze,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ze,Ke]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[Ze,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}
vendor: 5,466 bytes, line 50
50],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze,Ke]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[xt,zl,_a,W_]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ck=ak(Sk);function cs(...i){return Ck(VS(i))}function wm({delayDuration:i=0,...e}){return _.jsx(GF,{"data-loc":"client/src/components/ui/tooltip.tsx:11","data-slot":"tooltip-provider",delayDuration:i,...e})}function Ak({...i}){return _.jsx(wm,{"data-loc":"client/src/components/ui/tooltip.tsx:23",children:_.jsx(zF,{"data-loc":"client/src/components/ui/tooltip.tsx:24","data-slot":"tooltip",...i})})}function Mk({...i}){return _.jsx(HF,{"data-loc":"client/src/components/ui/tooltip.tsx:32","data-slot":"tooltip-trigger",...i})}function wk({className:i,sideOffset:e=0,children:t,...s}){return _.jsx(VF,{"data-loc":"client/src/components/ui/tooltip.tsx:42",children:_.jsxs(XF,{"data-loc":"client/src/components/ui/tooltip.tsx:43","data-slot":"tooltip-content",sideOffset:e,className:cs("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
50de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",i),...s,children:[t,_.jsx(qF,{"data-loc":"client/src/components/ui/tooltip.tsx:53",className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Pk(i,e){if(i instanceof RegExp)return{keys:!1,pattern:i};var t,s,n,a,l=[],u="",h=i.split("/");for(h[0]||h.shift();n=h.shift();)t=n[0],t==="*"?(l.push(t),u+=n[1]==="?"?"(?:/(.*))?":"/(.*)"):t===":"?(s=n.indexOf("?",1),a=n.indexOf(".",1),l.push(n.substring(1,~s?s:~a?a:n.length)),u+=~s&&!~a?"(?:/([^/]+?))?":"/([^/]+?)",~a&&(u+=(~s?"?":"")+"\\"+n.substring(a))):u+="/"+n;return{keys:l,pattern:new RegExp("^"+u+(e?"(?=$|/)":"/?$"),"i")}}var Y_={exports:{}},K_={};/**
51 * @license React
52 * use-sync-external-store-shim.production.js
53 *
54 * Copyright (c) Meta Platforms, Inc. and affiliates.
55 *
56 * This source code is licensed under the MIT license found in the
57 * LICENSE file in the root directory of this source tree.
58 */var i0;function Ok(){if(i0)return K_;i0=1;var i=qh();function e(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var t=typeof Object.is=="function"?Object.is:e,s=i.useState,n=i.useEffect,a=i.useLayoutEffect,l=i.useDebugValue;function u(p,b){var v=b(),R=s({inst:{value:v,getSnapshot:b}}),x=R[0].inst,T=R[1];return a(function(){x.value=v,x.getSnapshot=b,h(x)&&T({inst:x})},[p,v,b]),n(function(){return h(x)&&T({inst:x}),p(function(){h(x)&&T({inst:x})})},[p]),l(v),v}function h(p){var b=p.getSnapshot;p=p.value;try{var v=b();return!t(p,v)}catch{return!0}}function f(p,b){return b()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return K_.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:m,K_}var n0;function Dk(){return n0||(n0=1,Y_.exports=Ok()),Y_.exports}var tC=Dk();const Ik=Wh.useInsertionEffect,Fk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kk=Fk?C.useLayoutEffect:C.useEffect,Lk=Ik||kk,sC=i=>{const e=C.useRef([i,(...t)=>e[0](...t)]).current;return Lk(()=>{e[0]=i}),e[1]},Bk="popstate",Pm="pushState",Om="replaceState",Nk="hashchange",r0=[Bk,Pm,Om,Nk],Uk=i=>{for(const e of r0)addEventListener(e,i);return()=>{for(const e of r0)removeEventListener(e,i)}},iC=(i,e)=>tC.useSyncExternalStore(Uk,i,e),jk=()=>location.search,Gk=({ssrSearch:i=""}={})=>iC(jk,()=>i),a0=()=>location.pathname,zk=({ssrPath:i}={})=>iC(a0,i?()=>i:a0),Hk=(i,{replace:e=!1,state:t=null}={})=>history[e?Om:Pm](t,"",i),Vk=(i={})=>[zk(i),Hk],o0=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[o0]>"u"){for(const i of[Pm,Om]){const e=history[i];history[i]=function(){const t=e.apply(this,arguments),s=new Event(i);return s.arguments=arguments,dispatchEvent(s),t}}Object.defineProperty(window,o0,{value:!0})}const Xk=(i,e)=>e.toLowerCase().indexOf(i.toLowerCase())?"~"+e:e.slice(i.length)||"/",nC=(i="")=>i==="/"?"":i,qk=(i,e)=>i[0]==="~"?i.slice(1):nC(e)+i,Wk=(i="",e)=>Xk(l0(nC(i)),l0(e)),l0=i=>{try{return decodeURI(i)}catch{return i}},rC={hook:Vk,searchHook:Gk,parser:Pk,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:i=>i},aC=C.createContext(rC),Sc=()=>C.useContext(aC),oC={},lC=C.createContext(oC),Yk=()=>C.useContext(lC),hd=i=>{const[e,t]=i.hook(i);return[Wk(i.base,e),sC((s,n)=>t(qk(s,i.base),n))]},dd=()=>hd(Sc()),cC=(i,e,t,s)=>{const{pattern:n,keys:a}=e instanceof RegExp?{keys:!1,pattern:e}:i(e||"*",s),l=n.exec(t)||[],[u,...h]=l;return u!==void 0?[!0,(()=>{const f=a!==!1?Object.fromEntries(a.map((p,b)=>[p,h[b]])):l.groups;let m={...h};return f&&Object.assign(m,f),m})(),...s?[u]:[]]:[!1,null]},Kk=({children:i,...e})=>{const t=Sc(),s=e.hook?rC:t;let n=s;const[a,l]=e.ssrPath?.split("?")??[];l&&(e.ssrSearch=l,e.ssrPath=a),e.hrefs=e.hrefs??e.hook?.hrefs;let u=C.useRef({}),h=u.current,f=h;for(let m in s){const p=m==="base"?s[m]+(e[m]||""):e[m]||s[m];h===f&&p!==f[m]&&(u.current=f={...f}),f[m]=p,(p!==s[m]||p!==n[m])&&(n=f)}return C.createElement(aC.Provider,{value:n,children:i})},c0=({children:i,component:e},t)=>e?C.createElement(e,{params:t}):typeof i=="function"?i(t):i,Zk=i=>{let e=C.useRef(oC);const t=e.current;return e.current=Object.keys(i).length!==Object.keys(t).length||Object.entries(i).some(([s,n])=>n!==t[s])?i:t},en=({path:i,nest:e,match:t,...s})=>{const n=Sc(),[a]=hd(n),[l,u,h]=t??cC(n.parser,i,a,e),f=Zk({...Yk(),...u});if(!l)return null;const m=h?C.createElement(Kk,{base:h},c0(s,f)):c0(s,f);return C.createElement(lC.Provider,{value:f,children:m})};C.forwardRef((i,e)=>
58{const t=Sc(),[s,n]=hd(t),{to:a="",href:l=a,onClick:u,asChild:h,children:f,className:m,replace:p,state:b,...v}=i,R=sC(T=>{T.ctrlKey||T.metaKey||T.altKey||T.shiftKey||T.button!==0||(u?.(T),T.defaultPrevented||(T.preventDefault(),n(l,i)))}),x=t.hrefs(l[0]==="~"?l.slice(1):t.base+l,t);return h&&C.isValidElement(f)?C.cloneElement(f,{onClick:R,href:x}):C.createElement("a",{...v,onClick:R,href:x,className:m?.call?m(s===l):m,children:f,ref:e})});const jp=i=>Array.isArray(i)?i.flatMap(e=>jp(e&&e.type===C.Fragment?e.props.children:e)):[i],Qk=({children:i,location:e})=>{const t=Sc(),[s]=hd(t);typeof window<"u"&&(window.__WOUTER_ROUTES__||(window.__WOUTER_ROUTES__=[]),jp(i).forEach(a=>{if(C.isValidElement(a)&&a.props.path){const l=a.props.path;window.__WOUTER_ROUTES__.includes(l)||window.__WOUTER_ROUTES__.push(l)}}));for(const n of jp(i)){let a=0;if(C.isValidElement(n)&&(a=cC(t.parser,n.props.path,e||s,n.props.nest))[0])return C.cloneElement(n,{match:a})}return null};/**
59 * @license lucide-react v0.453.0 - ISC
60 *
61 * This source code is licensed under the ISC license.
62 * See the LICENSE file in the root directory of this source tree.
63 */const $k=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uC=(...i)=>i.filter((e,t,s)=>!!e&&s.indexOf(e)===t).join(" ");/**
64 * @license lucide-react v0.453.0 - ISC
65 *
66 * This source code is licensed under the ISC license.
67 * See the LICENSE file in the root directory of this source tree.
68 */var Jk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
69 * @license lucide-react v0.453.0 - ISC
70 *
71 * This source code is licensed under the ISC license.
72 * See the LICENSE file in the root directory of this source tree.
73 */const eL=C.forwardRef(({color:i="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:s,className:n="",children:a,iconNode:l,...u},h)=>C.createElement("svg",{ref:h,...Jk,width:e,height:e,stroke:i,strokeWidth:s?Number(t)*24/Number(e):t,className:uC("lucide",n),...u},[...l.map(([f,m])=>C.createElement(f,m)),...Array.isArray(a)?a:[a]]));/**
74 * @license lucide-react v0.453.0 - ISC
75 *
76 * This source code is licensed under the ISC license.
77 * See the LICENSE file in the root directory of this source tree.
78 */const Qe=(i,e)=>{const t=C.forwardRef(({className:s,...n},a)=>C.createElement(eL,{ref:a,iconNode:e,className:uC(`lucide-${$k(i)}`,s),...n}));return t.displayName=`${i}`,t};/**
79 * @license lucide-react v0.453.0 - ISC
80 *
81 * This source code is licensed under the ISC license.
82 * See the LICENSE file in the root directory of this source tree.
83 */const tL=Qe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
84 * @license lucide-react v0.453.0 - ISC
85 *
86 * This source code is licensed under the ISC license.
87 * See the LICENSE file in the root directory of this source tree.
88 */const sL=Qe("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
89 * @license lucide-react v0.453.0 - ISC
90 *
91 * This source code is licensed under the ISC license.
92 * See the LICENSE file in the root directory of this source tree.
93 */const Gp=Qe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
94 * @license lucide-react v0.453.0 - ISC
95 *
96 * This source code is licensed under the ISC license.
97 * See the LICENSE file in the root directory of this source tree.
98 */const hC=Qe("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
99 * @license lucide-react v0.453.0 - ISC
100 *
101 * This source code is licensed under the ISC license.
102 * See the LICENSE file in the root directory of this source tree.
103 */const iL=Qe("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/**
104 * @license lucide-react v0.453.0 - ISC
105 *
106 * This source code is licensed under the ISC license.
107 * See the LICENSE file in the root directory of this source tree.
108 */const dC=Qe("BookOpenText",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]);/**
109 * @license lucide-react v0.453.0 - ISC
110 *
111 * This source code is licensed under the ISC license.
112 * See the LICENSE file in the root directory of this source tree.
113 */const Dm=Qe("BrainCircuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}
113],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);/**
114 * @license lucide-react v0.453.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const Im=Qe("BriefcaseBusiness",[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2",key:"1ksdt3"}],["path",{d:"M22 13a18.15 18.15 0 0 1-20 0",key:"12hx5q"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
119 * @license lucide-react v0.453.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */const mh=Qe("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
124 * @license lucide-react v0.453.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const fC=Qe("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
129 * @license lucide-react v0.453.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const zp=Qe("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);/**
134 * @license lucide-react v0.453.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const _C=Qe("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
139 * @license lucide-react v0.453.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const Cc=Qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
144 * @license lucide-react v0.453.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const u0=Qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
149 * @license lucide-react v0.453.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const nL=Qe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
154 * @license lucide-react v0.453.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const rL=Qe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
159 * @license lucide-react v0.453.0 - ISC
160 *
161 * This source code is licensed under the ISC license.
162 * See the LICENSE file in the root directory of this source tree.
163 */const aL=Qe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
164 * @license lucide-react v0.453.0 - ISC
165 *
166 * This source code is licensed under the ISC license.
167 * See the LICENSE file in the root directory of this source tree.
168 */const pC=Qe("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
169 * @license lucide-react v0.453.0 - ISC
170 *
171 * This source code is licensed under the ISC license.
172 * See the LICENSE file in the root directory of this source tree.
173 */const h0=Qe("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
174 * @license lucide-react v0.453.0 - ISC
175 *
176 * This source code is licensed under the ISC license.
177 * See the LICENSE file in the root directory of this source tree.
178 */const oL=Qe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
179 * @license lucide-react v0.453.0 - ISC
180 *
181 * This source code is licensed under the ISC license.
182 * See the LICENSE file in the root directory of this source tree.
183 */const Hp=Qe("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
184 * @license lucide-react v0.453.0 - ISC
185 *
186 * This source code is licensed under the ISC license.
187 * See the LICENSE file in the root directory of this source tree.
188 */const d0=Qe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
189 * @license lucide-react v0.453.0 - ISC
190 *
191 * This source code is licensed under the ISC license.
192 * See the LICENSE file in the root directory of this source tree.
193 */const lL=Qe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
194 * @license lucide-react v0.453.0 - ISC
195 *
196 * This source code is licensed under the ISC license.
197 * See the LICENSE file in the root directory of this source tree.
198 */const cL=Qe("FileClock",[["path",{d:"M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"37hlfg"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]]);/**
199 * @license lucide-react v0.453.0 - ISC
200 *
201 * This source code is licensed under the ISC license.
202 * See the LICENSE file in the root directory of this source tree.
203 */const mC=Qe("FilePenLine",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);/**
204 * @license lucide-react v0.453.0 - ISC
205 *
206 * This source code is licensed under the ISC license.
207 * See the LICENSE file in the root directory of this source tree.
208 */const fd=Qe("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);/**
209 * @license lucide-react v0.453.0 - ISC
210 *
211 * This source code is licensed under the ISC license.
212 * See the LICENSE file in the root directory of this source tree.
213 */const gC=Qe("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/**
214 * @license lucide-react v0.453.0 - ISC
215 *
216 * This source code is licensed under the ISC license.
217 * See the LICENSE file in the root directory of this source tree.
218 */const jr=Qe("Gamepad2",[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]]);/**
219 * @license lucide-react v0.453.0 - ISC
220 *
221 * This source code is licensed under the ISC license.
222 * See the LICENSE file in the root directory of this source tree.
223 */const Fm=Qe("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
224 * @license lucide-react v0.453.0 - ISC
225 *
226 * This source code is licensed under the ISC license.
227 * See the LICENSE file in the root directory of this source tree.
228 */const Ah=Qe("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
229 * @license lucide-react v0.453.0 - ISC
230 *
231 * This source code is licensed under the ISC license.
232 * See the LICENSE file in the root directory of this source tree.
233 */const km=Qe("HeartHandshake",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66",key:"4oyue0"}],["path",{d:"m18 15-2-2",key:"60u0ii"}],["path",{d:"m15 18-2-2",key:"6p76be"}]]);/**
234 * @license lucide-react v0.453.0 - ISC
235 *
236 * This source code is licensed under the ISC license.
237 * See the LICENSE file in the root directory of this source tree.
238 */const uL=Qe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
239 * @license lucide-react v0.453.0 - ISC
240 *
241 * This source code is licensed under the ISC license.
242 * See the LICENSE file in the root directory of this source tree.
243 */const nc=Qe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
244 * @license lucide-react v0.453.0 - ISC
245 *
246 * This source code is licensed under the ISC license.
247 * See the LICENSE file in the root directory of this source tree.
248 */const hL=Qe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
249 * @license lucide-react v0.453.0 - ISC
250 *
251 * This source code is licensed under the ISC license.
252 * See the LICENSE file in the root directory of this source tree.
253 */const dL=Qe("Link2Off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
254 * @license lucide-react v0.453.0 - ISC
255 *
256 * This source code is licensed under the ISC license.
257 * See the LICENSE file in the root directory of this source tree.
258 */const Yo=Qe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
259 * @license lucide-react v0.453.0 - ISC
260 *
261 * This source code is licensed under the ISC license.
262 * See the LICENSE file in the root directory of this source tree.
263 */const yC=Qe("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
264 * @license lucide-react v0.453.0 - ISC
265 *
266 * This source code is licensed under the ISC license.
267 * See the LICENSE file in the root directory of this source tree.
268 */const Lm=Qe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
269 * @license lucide-react v0.453.0 - ISC
270 *
271 * This source code is licensed under the ISC license.
272 * See the LICENSE file in the root directory of this source tree.
273 */const Bm=Qe("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/**
274 * @license lucide-react v0.453.0 - ISC
275 *
276 * This source code is licensed under the ISC license.
277 * See the LICENSE file in the root directory of this source tree.
278 */const bC=Qe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
279 * @license lucide-react v0.453.0 - ISC
280 *
281 * This source code is licensed under the ISC license.
282 * See the LICENSE file in the root directory of this source tree.
283 */const fL=Qe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
284 * @license lucide-react v0.453.0 - ISC
285 *
286 * This source code is licensed under the ISC license.
287 * See the LICENSE file in the root directory of this source tree.
288 */const _L=Qe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
289 * @license lucide-react v0.453.0 - ISC
290 *
291 * This source code is licensed under the ISC license.
292 * See the LICENSE file in the root directory of this source tree.
293 */const xC=Qe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
294 * @license lucide-react v0.453.0 - ISC
295 *
296 * This source code is licensed under the ISC license.
297 * See the LICENSE file in the root directory of this source tree.
298 */const Nm=Qe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
299 * @license lucide-react v0.453.0 - ISC
300 *
301 * This source code is licensed under the ISC license.
302 * See the LICENSE file in the root directory of this source tree.
303 */const vC=Qe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
304 * @license lucide-react v0.453.0 - ISC
305 *
306 * This source code is licensed under the ISC license.
307 * See the LICENSE file in the root directory of this source tree.
308 */const xi=Qe("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}
308],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
309 * @license lucide-react v0.453.0 - ISC
310 *
311 * This source code is licensed under the ISC license.
312 * See the LICENSE file in the root directory of this source tree.
313 */const RC=Qe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
314 * @license lucide-react v0.453.0 - ISC
315 *
316 * This source code is licensed under the ISC license.
317 * See the LICENSE file in the root directory of this source tree.
318 */const pL=Qe("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
319 * @license lucide-react v0.453.0 - ISC
320 *
321 * This source code is licensed under the ISC license.
322 * See the LICENSE file in the root directory of this source tree.
323 */const Da=Qe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
324 * @license lucide-react v0.453.0 - ISC
325 *
326 * This source code is licensed under the ISC license.
327 * See the LICENSE file in the root directory of this source tree.
328 */const Um=Qe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
329 * @license lucide-react v0.453.0 - ISC
330 *
331 * This source code is licensed under the ISC license.
332 * See the LICENSE file in the root directory of this source tree.
333 */const mL=Qe("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
334 * @license lucide-react v0.453.0 - ISC
335 *
336 * This source code is licensed under the ISC license.
337 * See the LICENSE file in the root directory of this source tree.
338 */const gL=Qe("TicketCheck",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
339 * @license lucide-react v0.453.0 - ISC
340 *
341 * This source code is licensed under the ISC license.
342 * See the LICENSE file in the root directory of this source tree.
343 */const yL=Qe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
344 * @license lucide-react v0.453.0 - ISC
345 *
346 * This source code is licensed under the ISC license.
347 * See the LICENSE file in the root directory of this source tree.
348 */const bL=Qe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
349 * @license lucide-react v0.453.0 - ISC
350 *
351 * This source code is licensed under the ISC license.
352 * See the LICENSE file in the root directory of this source tree.
353 */const Pn=Qe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
354 * @license lucide-react v0.453.0 - ISC
355 *
356 * This source code is licensed under the ISC license.
357 * See the LICENSE file in the root directory of this source tree.
358 */const xL=Qe("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
359 * @license lucide-react v0.453.0 - ISC
360 *
361 * This source code is licensed under the ISC license.
362 * See the LICENSE file in the root directory of this source tree.
363 */const vL=Qe("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
364 * @license lucide-react v0.453.0 - ISC
365 *
366 * This source code is licensed under the ISC license.
367 * See the LICENSE file in the root directory of this source tree.
368 */const RL=Qe("UserRoundCog",[["path",{d:"M2 21a8 8 0 0 1 10.434-7.62",key:"1yezr2"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"m19.5 14.3-.4.9",key:"1eb35c"}],["path",{d:"m16.9 20.8-.4.9",key:"dfjc4z"}],["path",{d:"m21.7 19.5-.9-.4",key:"q4dx6b"}],["path",{d:"m15.2 16.9-.9-.4",key:"1r0w5f"}],["path",{d:"m21.7 16.5-.9.4",key:"1knoei"}],["path",{d:"m15.2 19.1-.9.4",key:"j188fs"}],["path",{d:"m19.5 21.7-.4-.9",key:"1tonu5"}],["path",{d:"m16.9 15.2-.4-.9",key:"699xu"}]]);/**
369 * @license lucide-react v0.453.0 - ISC
370 *
371 * This source code is licensed under the ISC license.
372 * See the LICENSE file in the root directory of this source tree.
373 */const TC=Qe("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
374 * @license lucide-react v0.453.0 - ISC
375 *
376 * This source code is licensed under the ISC license.
377 * See the LICENSE file in the root directory of this source tree.
378 */const jm=Qe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
379 * @license lucide-react v0.453.0 - ISC
380 *
381 * This source code is licensed under the ISC license.
382 * See the LICENSE file in the root directory of this source tree.
383 */const TL=Qe("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
384 * @license lucide-react v0.453.0 - ISC
385 *
386 * This source code is licensed under the ISC license.
387 * See the LICENSE file in the root directory of this source tree.
388 */const EL=Qe("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
389 * @license lucide-react v0.453.0 - ISC
390 *
391 * This source code is licensed under the ISC license.
392 * See the LICENSE file in the root directory of this source tree.
393 */const EC=Qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
394 * @license lucide-react v0.453.0 - ISC
395 *
396 * This source code is licensed under the ISC license.
397 * See the LICENSE file in the root directory of this source tree.
398 */const SL=Qe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class CL extends C.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?_.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:27",className:"flex items-center justify-center min-h-screen p-8 bg-background",children:_.jsxs("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:28",className:"flex flex-col items-center w-full max-w-2xl p-8",children:[_.jsx(bL,{"data-loc":"client/src/components/ErrorBoundary.tsx:29",size:48,className:"text-destructive mb-6 flex-shrink-0"}),_.jsx("h2",{"data-loc":"client/src/components/ErrorBoundary.tsx:34",className:"text-xl mb-4",children:"An unexpected error occurred."}),_.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:36",className:"p-4 w-full rounded bg-muted overflow-auto mb-6",children:_.jsx("pre",{"data-loc":"client/src/components/ErrorBoundary.tsx:37",className:"text-sm text-muted-foreground whitespace-break-spaces",children:this.state.error?.stack})}),_.jsxs("button",{"data-loc":"client/src/components/ErrorBoundary.tsx:42",onClick:()=>window.location.reload(),className:cs("flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground","hover:opacity-90 cursor-pointer"),children:[_.jsx(Nm,{"data-loc":"client/src/components/ErrorBoundary.tsx:50",size:16}),"Reload Page"]})]})}):this.props.children}}const _d=()=>{const i="https://manus.im",e="f9z9rJ7DWWVAcM27WnmKhf",t=`${window.location.origin}/api/oauth/callback`,s=crypto.randomUUID();document.cookie=`${_D}=${s}; Path=/; Max-Age=600; SameSite=None; Secure`;const n=pD({redirectUri:t,nonce:s}
398),a=new URL(`${i}/app-auth`);a.searchParams.set("appId",e),a.searchParams.set("redirectUri",t),a.searchParams.set("state",n),a.searchParams.set("type","signIn"),window.location.href=a.toString()};function Zi(i){const{redirectOnUnauthenticated:e=!1,redirectPath:t}={},s=dt.useUtils(),n=dt.auth.me.useQuery(void 0,{retry:!1,refetchOnWindowFocus:!1}),a=dt.auth.logout.useMutation({onSuccess:()=>{s.auth.me.setData(void 0,null)}}),l=C.useCallback(async()=>{try{await a.mutateAsync()}catch(h){if(h instanceof Bo&&h.data?.code==="UNAUTHORIZED")return;throw h}finally{try{sessionStorage.removeItem("manus-cookie")}catch{}s.auth.me.setData(void 0,null),await s.auth.me.invalidate()}},[a,s]),u=C.useMemo(()=>(localStorage.setItem("manus-runtime-user-info",JSON.stringify(n.data)),{user:n.data??null,loading:n.isLoading||a.isPending,error:n.error??a.error??null,isAuthenticated:!!n.data}),[n.data,n.error,n.isLoading,a.error,a.isPending]);return C.useEffect(()=>{e&&(n.isLoading||a.isPending||u.user||typeof window>"u"||t&&window.location.pathname===t||(t?window.location.href=t:_d()))},[e,t,a.isPending,n.isLoading,u.user]),{...u,refresh:()=>n.refetch(),logout:l}}function AL(){return tC.useSyncExternalStore(ML,()=>!0,()=>!1)}function ML(){return()=>{}}var Gm="Avatar",[wL]=Kr(Gm),[PL,SC]=wL(Gm),CC=C.forwardRef((i,e)=>{const{__scopeAvatar:t,...s}=i,[n,a]=C.useState("idle");return _.jsx(PL,{scope:t,imageLoadingStatus:n,onImageLoadingStatusChange:a,children:_.jsx(us.span,{...s,ref:e})})});CC.displayName=Gm;var AC="AvatarImage",OL=C.forwardRef((i,e)=>{const{__scopeAvatar:t,src:s,onLoadingStatusChange:n=()=>{},...a}=i,l=SC(AC,t),u=DL(s,a),h=Mn(f=>{n(f),l.onImageLoadingStatusChange(f)});return rn(()=>{u!=="idle"&&h(u)},[u,h]),u==="loaded"?_.jsx(us.img,{...a,ref:e,src:s}):null});OL.displayName=AC;var MC="AvatarFallback",wC=C.forwardRef((i,e)=>{const{__scopeAvatar:t,delayMs:s,...n}=i,a=SC(MC,t),[l,u]=C.useState(s===void 0);return C.useEffect(()=>{if(s!==void 0){const h=window.setTimeout(()=>u(!0),s);return()=>window.clearTimeout(h)}},[s]),l&&a.imageLoadingStatus!=="loaded"?_.jsx(us.span,{...n,ref:e}):null});wC.displayName=MC;function f0(i,e){return i?e?(i.src!==e&&(i.src=e),i.complete&&i.naturalWidth>0?"loaded":"loading"):"error":"idle"}function DL(i,{referrerPolicy:e,crossOrigin:t}){const s=AL(),n=C.useRef(null),a=s?(n.current||(n.current=new window.Image),n.current):null,[l,u]=C.useState(()=>f0(a,i));return rn(()=>{u(f0(a,i))},[a,i]),rn(()=>{const h=p=>()=>{u(p)};if(!a)return;const f=h("loaded"),m=h("error");return a.addEventListener("load",f),a.addEventListener("error",m),e&&(a.referrerPolicy=e),typeof t=="string"&&(a.crossOrigin=t),()=>{a.removeEventListener("load",f),a.removeEventListener("error",m)}},[a,t,e]),l}var IL=CC,FL=wC;function kL({className:i,...e}){return _.jsx(IL,{"data-loc":"client/src/components/ui/avatar.tsx:11","data-slot":"avatar",className:cs("relative flex size-8 shrink-0 overflow-hidden rounded-full",i),...e})}function LL({className:i,...e}){return _.jsx(FL,{"data-loc":"client/src/components/ui/avatar.tsx:40","data-slot":"avatar-fallback",className:cs("bg-muted flex size-full items-center justify-center rounded-full",i),...e})}function PC(i){const e=i+"CollectionProvider",[t,s]=Kr(e),[n,a]=t(e,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:T,children:E}=x,A=Fe.useRef(null),D=Fe.useRef(new Map).current;return _.jsx(n,{scope:T,itemMap:D,collectionRef:A,children:E})};l.displayName=e;const u=i+"CollectionSlot",h=Uo(u),f=Fe.forwardRef((x,T)=>{const{scope:E,children:A}=x,D=a(u,E),M=Ns(T,D.collectionRef);return _.jsx(h,{ref:M,children:A})});f.displayName=u;const m=i+"CollectionItemSlot",p="data-radix-collection-item",b=Uo(m),v=Fe.forwardRef((x,T)=>{const{scope:E,children:A,...D}=x,M=Fe.useRef(null),k=Ns(T,M),U=a(m,E);return Fe.useEffect(()=>(U.itemMap.set(M,{ref:M,...D}),()=>void U.itemMap.delete(M))),_.jsx(b,{[p]:"",ref:k,children:A})});v.displayName=m;function R(x){const T=a(i+"CollectionConsumer",x);return Fe.useCallback(()=>{const A=T.collectionRef.current;if(!A)return[];const D=Array.from(A.querySelectorAll(`[${p}]`));return Array.from(T.itemMap.values()).sort((U,N)=>D.indexOf(U.ref.current)-D.indexOf(N.ref.current))},[T.collectionRef,T.itemMap])}return[{Provider:l,Slot:f,ItemSlot:v},R,s]}var BL=C.createContext(void 0);function OC(i){const e=C.useContext(BL);return i||e||"ltr"}var Z_=0;function DC(){C.useEffect(()=>{const i=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",i[0]??_0()),document.body.insertAdjacentElement("beforeend",i[1]??_0()),Z_++,()=>{Z_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 4,893 bytes, line 398
398=>e.remove()),Z_--}},[])}function _0(){const i=document.createElement("span");return i.setAttribute("data-radix-focus-guard",""),i.tabIndex=0,i.style.outline="none",i.style.opacity="0",i.style.position="fixed",i.style.pointerEvents="none",i}var Q_="focusScope.autoFocusOnMount",$_="focusScope.autoFocusOnUnmount",p0={bubbles:!1,cancelable:!0},NL="FocusScope",zm=C.forwardRef((i,e)=>{const{loop:t=!1,trapped:s=!1,onMountAutoFocus:n,onUnmountAutoFocus:a,...l}=i,[u,h]=C.useState(null),f=Mn(n),m=Mn(a),p=C.useRef(null),b=Ns(e,x=>h(x)),v=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(s){let x=function(D){if(v.paused||!u)return;const M=D.target;u.contains(M)?p.current=M:Nr(p.current,{select:!0})},T=function(D){if(v.paused||!u)return;const M=D.relatedTarget;M!==null&&(u.contains(M)||Nr(p.current,{select:!0}))},E=function(D){if(document.activeElement===document.body)for(const k of D)k.removedNodes.length>0&&Nr(u)};document.addEventListener("focusin",x),document.addEventListener("focusout",T);const A=new MutationObserver(E);return u&&A.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",T),A.disconnect()}}},[s,u,v.paused]),C.useEffect(()=>{if(u){g0.add(v);const x=document.activeElement;if(!u.contains(x)){const E=new CustomEvent(Q_,p0);u.addEventListener(Q_,f),u.dispatchEvent(E),E.defaultPrevented||(UL(VL(IC(u)),{select:!0}),document.activeElement===x&&Nr(u))}return()=>{u.removeEventListener(Q_,f),setTimeout(()=>{const E=new CustomEvent($_,p0);u.addEventListener($_,m),u.dispatchEvent(E),E.defaultPrevented||Nr(x??document.body,{select:!0}),u.removeEventListener($_,m),g0.remove(v)},0)}}},[u,f,m,v]);const R=C.useCallback(x=>{if(!t&&!s||v.paused)return;const T=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(T&&E){const A=x.currentTarget,[D,M]=jL(A);D&&M?!x.shiftKey&&E===M?(x.preventDefault(),t&&Nr(D,{select:!0})):x.shiftKey&&E===D&&(x.preventDefault(),t&&Nr(M,{select:!0})):E===A&&x.preventDefault()}},[t,s,v.paused]);return _.jsx(us.div,{tabIndex:-1,...l,ref:b,onKeyDown:R})});zm.displayName=NL;function UL(i,{select:e=!1}={}){const t=document.activeElement;for(const s of i)if(Nr(s,{select:e}),document.activeElement!==t)return}function jL(i){const e=IC(i),t=m0(e,i),s=m0(e.reverse(),i);return[t,s]}function IC(i){const e=[],t=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const n=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||n?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function m0(i,e){for(const t of i)if(!GL(t,{upTo:e}))return t}function GL(i,{upTo:e}){if(getComputedStyle(i).visibility==="hidden")return!0;for(;i;){if(e!==void 0&&i===e)return!1;if(getComputedStyle(i).display==="none")return!0;i=i.parentElement}return!1}function zL(i){return i instanceof HTMLInputElement&&"select"in i}function Nr(i,{select:e=!1}={}){if(i&&i.focus){const t=document.activeElement;i.focus({preventScroll:!0}),i!==t&&zL(i)&&e&&i.select()}}var g0=HL();function HL(){let i=[];return{add(e){const t=i[0];e!==t&&t?.pause(),i=y0(i,e),i.unshift(e)},remove(e){i=y0(i,e),i[0]?.resume()}}}function y0(i,e){const t=[...i],s=t.indexOf(e);return s!==-1&&t.splice(s,1),t}function VL(i){return i.filter(e=>e.tagName!=="A")}var J_="rovingFocusGroup.onEntryFocus",XL={bubbles:!1,cancelable:!0},Ac="RovingFocusGroup",[Vp,FC,qL]=PC(Ac),[WL,kC]=Kr(Ac,[qL]),[YL,KL]=WL(Ac),LC=C.forwardRef((i,e)=>_.jsx(Vp.Provider,{scope:i.__scopeRovingFocusGroup,children:_.jsx(Vp.Slot,{scope:i.__scopeRovingFocusGroup,children:_.jsx(ZL,{...i,ref:e})})}));LC.displayName=Ac;var ZL=C.forwardRef((i,e)=>{const{__scopeRovingFocusGroup:t,orientation:s,loop:n=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=i,b=C.useRef(null),v=Ns(e,b),R=OC(a),[x,T]=ld({prop:l,defaultProp:u??null,onChange:h,caller:Ac}),[E,A]=C.useState(!1),D=Mn(f),M=FC(t),k=C.useRef(!1),[U,N]=C.useState(0);return C.useEffect(()=>{const H=b.current;if(H)return H.addEventListener(J_,D),()=>H.removeEventListener(J_,D)},[D]),_.jsx(YL,{scope:t,orientation:s,dir:R,loop:n,currentTabStopId:x,onItemFocus:C.useCallback(H=>T(H),[T]),onItemShiftTab:C.useCallback(()=>A(!0),[]),onFocusableItemAdd:C.useCallback(()=>N(H=>H+1),[]),onFocusableItemRemove:C.useCallback(()=>N(H=>H-1),[]),children:_.jsx(us.div,{tabIndex:E||U===0?-1:0,"data-orientation":s,...p,ref:v,style:{outline:"none",...i.style},onMouseDown:ut(i.onMouseDown,()=>{k.current=!0}),onFocus:ut(i.onFocus,H=>{const q=!k.current;if(H.target===H.currentTarget&&q&&!E){const re=new CustomEvent(J_,XL);if(H.currentTarget.dispatchEvent(re),!re.defaultPrevented){const ce=M().filter(z=>z.focusable),ae=ce.find(z=>z.active),fe=ce.find(z=>
vendor: 8,961 bytes, lines 398-413
398z.id===x),Te=[ae,fe,...ce].filter(Boolean).map(z=>z.ref.current);UC(Te,m)}}k.current=!1}),onBlur:ut(i.onBlur,()=>A(!1))})})}),BC="RovingFocusGroupItem",NC=C.forwardRef((i,e)=>{const{__scopeRovingFocusGroup:t,focusable:s=!0,active:n=!1,tabStopId:a,children:l,...u}=i,h=va(),f=a||h,m=KL(BC,t),p=m.currentTabStopId===f,b=FC(t),{onFocusableItemAdd:v,onFocusableItemRemove:R,currentTabStopId:x}=m;return C.useEffect(()=>{if(s)return v(),()=>R()},[s,v,R]),_.jsx(Vp.ItemSlot,{scope:t,id:f,focusable:s,active:n,children:_.jsx(us.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...u,ref:e,onMouseDown:ut(i.onMouseDown,T=>{s?m.onItemFocus(f):T.preventDefault()}),onFocus:ut(i.onFocus,()=>m.onItemFocus(f)),onKeyDown:ut(i.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){m.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const E=JL(T,m.orientation,m.dir);if(E!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let D=b().filter(M=>M.focusable).map(M=>M.ref.current);if(E==="last")D.reverse();else if(E==="prev"||E==="next"){E==="prev"&&D.reverse();const M=D.indexOf(T.currentTarget);D=m.loop?eB(D,M+1):D.slice(M+1)}setTimeout(()=>UC(D))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:x!=null}):l})})});NC.displayName=BC;var QL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $L(i,e){return e!=="rtl"?i:i==="ArrowLeft"?"ArrowRight":i==="ArrowRight"?"ArrowLeft":i}function JL(i,e,t){const s=$L(i.key,t);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return QL[s]}function UC(i,e=!1){const t=document.activeElement;for(const s of i)if(s===t||(s.focus({preventScroll:e}),document.activeElement!==t))return}function eB(i,e){return i.map((t,s)=>i[(e+s)%i.length])}var tB=LC,sB=NC,iB=function(i){if(typeof document>"u")return null;var e=Array.isArray(i)?i[0]:i;return e.ownerDocument.body},Ro=new WeakMap,th=new WeakMap,sh={},ep=0,jC=function(i){return i&&(i.host||jC(i.parentNode))},nB=function(i,e){return e.map(function(t){if(i.contains(t))return t;var s=jC(t);return s&&i.contains(s)?s:(console.error("aria-hidden",t,"in not contained inside",i,". Doing nothing"),null)}).filter(function(t){return!!t})},rB=function(i,e,t,s){var n=nB(e,Array.isArray(i)?i:[i]);sh[t]||(sh[t]=new WeakMap);var a=sh[t],l=[],u=new Set,h=new Set(n),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};n.forEach(f);var m=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(b){if(u.has(b))m(b);else try{var v=b.getAttribute(s),R=v!==null&&v!=="false",x=(Ro.get(b)||0)+1,T=(a.get(b)||0)+1;Ro.set(b,x),a.set(b,T),l.push(b),x===1&&R&&th.set(b,!0),T===1&&b.setAttribute(t,"true"),R||b.setAttribute(s,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return m(e),u.clear(),ep++,function(){l.forEach(function(p){var b=Ro.get(p)-1,v=a.get(p)-1;Ro.set(p,b),a.set(p,v),b||(th.has(p)||p.removeAttribute(s),th.delete(p)),v||p.removeAttribute(t)}),ep--,ep||(Ro=new WeakMap,Ro=new WeakMap,th=new WeakMap,sh={})}},GC=function(i,e,t){t===void 0&&(t="data-aria-hidden");var s=Array.from(Array.isArray(i)?i:[i]),n=iB(i);return n?(s.push.apply(s,Array.from(n.querySelectorAll("[aria-live], script"))),rB(s,n,t,"aria-hidden")):function(){return null}},Rn=function(){return Rn=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++){t=arguments[s];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Rn.apply(this,arguments)};function zC(i,e){var t={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e.indexOf(s)<0&&(t[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(i);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(i,s[n])&&(t[s[n]]=i[s[n]]);return t}function aB(i,e,t){if(t||arguments.length===2)for(var s=0,n=e.length,a;s<n;s++)(a||!(s in e))&&(a||(a=Array.prototype.slice.call(e,0,s)),a[s]=e[s]);return i.concat(a||Array.prototype.slice.call(e))}var gh="right-scroll-bar-position",yh="width-before-scroll-bar",oB="with-scroll-bars-hidden",lB="--removed-body-scroll-bar-size";function tp(i,e){return typeof i=="function"?i(e):i&&(i.current=e),i}function cB(i,e){var t=C.useState(function(){return{value:i,callback:e,facade:{get current(){return t.value},set current(s){var n=t.value;n!==s&&(t.value=s,t.callback(s,n))}}}})[0];return t.callback=e,t.facade}var uB=typeof window<"u"?C.useLayoutEffect:C.useEffect,b0=new WeakMap;function hB(i,e){var t=cB(null,function(s){return i.forEach(function(n){return tp(n,s)})});return uB(function(){var s=b0.get(t);if(s){var n=new Set(s),a=new Set(i),l=t.current;n.forEach(function(u){a.has(u)||tp(u,null)}),a.forEach(function(u){n.has(u)||tp(u,l)})}b0.set(t,i)},[i]),t}function dB(i){return i}function fB(i,e){e===void 0&&(e=dB);var t=[],s=!1,n={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:i},useMedium:function(a){var l=e(a,s);return t.push(l),function(){t=t.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(s=!0;t.length;){var l=t;t=[],l.forEach(a)}t={push:function(u){return a(u)},filter:function(){return t}}},assignMedium:function(a){s=!0;var l=[];if(t.length){var u=t;t=[],u.forEach(a),l=t}var h=function(){var m=l;l=[],m.forEach(a)},f=function(){return Promise.resolve().then(h)};f(),t={push:function(m){l.push(m),f()},filter:function(m){return l=l.filter(m),t}}}};return n}function _B(i){i===void 0&&(i={});var e=fB(null);return e.options=Rn({async:!0,ssr:!1},i),e}var HC=function(i){var e=i.sideCar,t=zC(i,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=e.read();if(!s)throw new Error("Sidecar medium not found");return C.createElement(s,Rn({},t))};HC.isSideCarExport=!0;function pB(i,e){return i.useMedium(e),HC}var VC=_B(),sp=function(){},pd=C.forwardRef(function(i,e){var t=C.useRef(null),s=C.useState({onScrollCapture:sp,onWheelCapture:sp,onTouchMoveCapture:sp}),n=s[0],a=s[1],l=i.forwardProps,u=i.children,h=i.className,f=i.removeScrollBar,m=i.enabled,p=i.shards,b=i.sideCar,v=i.noRelative,R=i.noIsolation,x=i.inert,T=i.allowPinchZoom,E=i.as,A=E===void 0?"div":E,D=i.gapMode,M=zC(i,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=b,U=hB([t,e]),N=Rn(Rn({},M),n);return C.createElement(C.Fragment,null,m&&C.createElement(k,{sideCar:VC,removeScrollBar:f,shards:p,noRelative:v,noIsolation:R,inert:x,setCallbacks:a,allowPinchZoom:!!T,lockRef:t,gapMode:D}),l?C.cloneElement(C.Children.only(u),Rn(Rn({},N),{ref:U})):C.createElement(A,Rn({},N,{className:h,ref:U}),u))});pd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};pd.classNames={fullWidth:yh,zeroRight:gh};var mB=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gB(){if(!document)return null;var i=document.createElement("style");i.type="text/css";var e=mB();return e&&i.setAttribute("nonce",e),i}function yB(i,e){i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}function bB(i){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(i)}var xB=function(){var i=0,e=null;return{add:function(t){i==0&&(e=gB())&&(yB(e,t),bB(e)),i++},remove:function(){i--,!i&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},vB=function(){var i=xB();return function(e,t){C.useEffect(function(){return i.add(e),function(){i.remove()}},[e&&t])}},XC=function(){var i=vB(),e=function(t){var s=t.styles,n=t.dynamic;return i(s,n),null};return e},RB={left:0,top:0,right:0,gap:0},ip=function(i){return parseInt(i||"",10)||0},TB=function(i){var e=window.getComputedStyle(document.body),t=e[i==="padding"?"paddingLeft":"marginLeft"],s=e[i==="padding"?"paddingTop":"marginTop"],n=e[i==="padding"?"paddingRight":"marginRight"];return[ip(t),ip(s),ip(n)]},EB=function(i){if(i===void 0&&(i="margin"),typeof window>"u")return RB;var e=TB(i),t=document.documentElement.clientWidth,s=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,s-t+e[2]-e[0])}},SB=XC(),Po="data-scroll-locked",CB=function(i,e,t,s){var n=i.left,a=i.top,l=i.right,u=i.gap;return t===void 0&&(t="margin"),`
399  .`.concat(oB,` {
400   overflow: hidden `).concat(s,`;
401   padding-right: `).concat(u,"px ").concat(s,`;
402  }
403  body[`).concat(Po,`] {
404    overflow: hidden `).concat(s,`;
405    overscroll-behavior: contain;
406    `).concat([e&&"position: relative ".concat(s,";"),t==="margin"&&`
407    padding-left: `.concat(n,`px;
408    padding-top: `).concat(a,`px;
409    padding-right: `).concat(l,`px;
410    margin-left:0;
411    margin-top:0;
412    margin-right: `).concat(u,"px ").concat(s,`;
413    `),t==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";
413")].filter(Boolean).join(""),`
414  }
415  
416  .`).concat(gh,` {
417    right: `).concat(u,"px ").concat(s,`;
418  }
419  
420  .`).concat(yh,` {
421    margin-right: `).concat(u,"px ").concat(s,`;
422  }
423  
424  .`).concat(gh," .").concat(gh,` {
425    right: 0 `).concat(s,`;
426  }
427  
428  .`).concat(yh," .").concat(yh,` {
429    margin-right: 0 `).concat(s,`;
430  }
431  
432  body[`).concat(Po,`] {
433    `).concat(lB,": ").concat(u,`px;
434  }
435`)},x0=function(){var i=parseInt(document.body.getAttribute(Po)||"0",10);return isFinite(i)?i:0},AB=function(){C.useEffect(function(){return document.body.setAttribute(Po,(x0()+1).toString()),function(){var i=x0()-1;i<=0?document.body.removeAttribute(Po):document.body.setAttribute(Po,i.toString())}},[])},MB=function(i){var e=i.noRelative,t=i.noImportant,s=i.gapMode,n=s===void 0?"margin":s;AB();var a=C.useMemo(function(){return EB(n)},[n]);return C.createElement(SB,{styles:CB(a,!e,n,t?"":"!important")})},Xp=!1;if(typeof window<"u")try{var ih=Object.defineProperty({},"passive",{get:function(){return Xp=!0,!0}});window.addEventListener("test",ih,ih),window.removeEventListener("test",ih,ih)}catch{Xp=!1}var To=Xp?{passive:!1}:!1,wB=function(i){return i.tagName==="TEXTAREA"},qC=function(i,e){if(!(i instanceof Element))return!1;var t=window.getComputedStyle(i);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!wB(i)&&t[e]==="visible")},PB=function(i){return qC(i,"overflowY")},OB=function(i){return qC(i,"overflowX")},v0=function(i,e){var t=e.ownerDocument,s=e;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var n=WC(i,s);if(n){var a=YC(i,s),l=a[1],u=a[2];if(l>u)return!0}s=s.parentNode}while(s&&s!==t.body);return!1},DB=function(i){var e=i.scrollTop,t=i.scrollHeight,s=i.clientHeight;return[e,t,s]},IB=function(i){var e=i.scrollLeft,t=i.scrollWidth,s=i.clientWidth;return[e,t,s]},WC=function(i,e){return i==="v"?PB(e):OB(e)},YC=function(i,e){return i==="v"?DB(e):IB(e)},FB=function(i,e){return i==="h"&&e==="rtl"?-1:1},kB=function(i,e,t,s,n){var a=FB(i,window.getComputedStyle(e).direction),l=a*s,u=t.target,h=e.contains(u),f=!1,m=l>0,p=0,b=0;do{if(!u)break;var v=YC(i,u),R=v[0],x=v[1],T=v[2],E=x-T-a*R;(R||E)&&WC(i,u)&&(p+=E,b+=R);var A=u.parentNode;u=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!h&&u!==document.body||h&&(e.contains(u)||e===u));return(m&&Math.abs(p)<1||!m&&Math.abs(b)<1)&&(f=!0),f},nh=function(i){return"changedTouches"in i?[i.changedTouches[0].clientX,i.changedTouches[0].clientY]:[0,0]},R0=function(i){return[i.deltaX,i.deltaY]},T0=function(i){return i&&"current"in i?i.current:i},LB=function(i,e){return i[0]===e[0]&&i[1]===e[1]},BB=function(i){return`
436  .block-interactivity-`.concat(i,` {pointer-events: none;}
437  .allow-interactivity-`).concat(i,` {pointer-events: all;}
438`)},NB=0,Eo=[];function UB(i){var e=C.useRef([]),t=C.useRef([0,0]),s=C.useRef(),n=C.useState(NB++)[0],a=C.useState(XC)[0],l=C.useRef(i);C.useEffect(function(){l.current=i},[i]),C.useEffect(function(){if(i.inert){document.body.classList.add("block-interactivity-".concat(n));var x=aB([i.lockRef.current],(i.shards||[]).map(T0),!0).filter(Boolean);return x.forEach(function(T){return T.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),x.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(n))})}}},[i.inert,i.lockRef.current,i.shards]);var u=C.useCallback(function(x,T){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!l.current.allowPinchZoom;var E=nh(x),A=t.current,D="deltaX"in x?x.deltaX:A[0]-E[0],M="deltaY"in x?x.deltaY:A[1]-E[1],k,U=x.target,N=Math.abs(D)>Math.abs(M)?"h":"v";if("touches"in x&&N==="h"&&U.type==="range")return!1;var H=v0(N,U);if(!H)return!0;if(H?k=N:(k=N==="v"?"h":"v",H=v0(N,U)),!H)return!1;if(!s.current&&"changedTouches"in x&&(D||M)&&(s.current=k),!k)return!0;var q=s.current||k;return kB(q,T,x,q==="h"?D:M)},[]),h=C.useCallback(function(x){var T=x;if(!(!Eo.length||Eo[Eo.length-1]!==a)){var E="deltaY"in T?R0(T):nh(T),A=e.current.filter(function(k){return k.name===T.type&&(k.target===T.target||T.target===k.shadowParent)&&LB(k.delta,E)})[0];if(A&&A.should){T.cancelable&&T.preventDefault();return}
vendor: 19,070 bytes, line 438
438if(!A){var D=(l.current.shards||[]).map(T0).filter(Boolean).filter(function(k){return k.contains(T.target)}),M=D.length>0?u(T,D[0]):!l.current.noIsolation;M&&T.cancelable&&T.preventDefault()}}},[]),f=C.useCallback(function(x,T,E,A){var D={name:x,delta:T,target:E,should:A,shadowParent:jB(E)};e.current.push(D),setTimeout(function(){e.current=e.current.filter(function(M){return M!==D})},1)},[]),m=C.useCallback(function(x){t.current=nh(x),s.current=void 0},[]),p=C.useCallback(function(x){f(x.type,R0(x),x.target,u(x,i.lockRef.current))},[]),b=C.useCallback(function(x){f(x.type,nh(x),x.target,u(x,i.lockRef.current))},[]);C.useEffect(function(){return Eo.push(a),i.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:b}),document.addEventListener("wheel",h,To),document.addEventListener("touchmove",h,To),document.addEventListener("touchstart",m,To),function(){Eo=Eo.filter(function(x){return x!==a}),document.removeEventListener("wheel",h,To),document.removeEventListener("touchmove",h,To),document.removeEventListener("touchstart",m,To)}},[]);var v=i.removeScrollBar,R=i.inert;return C.createElement(C.Fragment,null,R?C.createElement(a,{styles:BB(n)}):null,v?C.createElement(MB,{noRelative:i.noRelative,gapMode:i.gapMode}):null)}function jB(i){for(var e=null;i!==null;)i instanceof ShadowRoot&&(e=i.host,i=i.host),i=i.parentNode;return e}const GB=pB(VC,UB);var Hm=C.forwardRef(function(i,e){return C.createElement(pd,Rn({},i,{ref:e,sideCar:GB}))});Hm.classNames=pd.classNames;var qp=["Enter"," "],zB=["ArrowDown","PageUp","Home"],KC=["ArrowUp","PageDown","End"],HB=[...zB,...KC],VB={ltr:[...qp,"ArrowRight"],rtl:[...qp,"ArrowLeft"]},XB={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Mc="Menu",[rc,qB,WB]=PC(Mc),[Ia,ZC]=Kr(Mc,[WB,ad,kC]),md=ad(),QC=kC(),[YB,Fa]=Ia(Mc),[KB,wc]=Ia(Mc),$C=i=>{const{__scopeMenu:e,open:t=!1,children:s,dir:n,onOpenChange:a,modal:l=!0}=i,u=md(e),[h,f]=C.useState(null),m=C.useRef(!1),p=Mn(a),b=OC(n);return C.useEffect(()=>{const v=()=>{m.current=!0,document.addEventListener("pointerdown",R,{capture:!0,once:!0}),document.addEventListener("pointermove",R,{capture:!0,once:!0})},R=()=>m.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",R,{capture:!0}),document.removeEventListener("pointermove",R,{capture:!0})}},[]),_.jsx(wS,{...u,children:_.jsx(YB,{scope:e,open:t,onOpenChange:p,content:h,onContentChange:f,children:_.jsx(KB,{scope:e,onClose:C.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:b,modal:l,children:s})})})};$C.displayName=Mc;var ZB="MenuAnchor",Vm=C.forwardRef((i,e)=>{const{__scopeMenu:t,...s}=i,n=md(t);return _.jsx(PS,{...n,...s,ref:e})});Vm.displayName=ZB;var Xm="MenuPortal",[QB,JC]=Ia(Xm,{forceMount:void 0}),e1=i=>{const{__scopeMenu:e,forceMount:t,children:s,container:n}=i,a=Fa(Xm,e);return _.jsx(QB,{scope:e,forceMount:t,children:_.jsx(In,{present:t||a.open,children:_.jsx(od,{asChild:!0,container:n,children:s})})})};e1.displayName=Xm;var Ki="MenuContent",[$B,qm]=Ia(Ki),t1=C.forwardRef((i,e)=>{const t=JC(Ki,i.__scopeMenu),{forceMount:s=t.forceMount,...n}=i,a=Fa(Ki,i.__scopeMenu),l=wc(Ki,i.__scopeMenu);return _.jsx(rc.Provider,{scope:i.__scopeMenu,children:_.jsx(In,{present:s||a.open,children:_.jsx(rc.Slot,{scope:i.__scopeMenu,children:l.modal?_.jsx(JB,{...n,ref:e}):_.jsx(eN,{...n,ref:e})})})})}),JB=C.forwardRef((i,e)=>{const t=Fa(Ki,i.__scopeMenu),s=C.useRef(null),n=Ns(e,s);return C.useEffect(()=>{const a=s.current;if(a)return GC(a)},[]),_.jsx(Wm,{...i,ref:n,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:ut(i.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),eN=C.forwardRef((i,e)=>{const t=Fa(Ki,i.__scopeMenu);return _.jsx(Wm,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),tN=Uo("MenuContent.ScrollLock"),Wm=C.forwardRef((i,e)=>{const{__scopeMenu:t,loop:s=!1,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:b,onDismiss:v,disableOutsideScroll:R,...x}=i,T=Fa(Ki,t),E=wc(Ki,t),A=md(t),D=QC(t),M=qB(t),[k,U]=C.useState(null),N=C.useRef(null),H=Ns(e,N,T.onContentChange),q=C.useRef(0),re=C.useRef(""),ce=C.useRef(0),ae=C.useRef(null),fe=C.useRef("right"),_e=C.useRef(0),Te=R?Hm:C.Fragment,z=R?{as:tN,allowPinchZoom:!0}:void 0,J=V=>{const ge=re.current+V,L=M().filter(he=>!he.disabled),B=document.activeElement,X=L.find(he=>he.ref.current===B)?.textValue,Q=L.map(he=>he.textValue),F=fN(Q,ge,X),$=L.find(he=>he.textValue===F)?.ref.current;(function he(Ae){re.current=Ae,window.clearTimeout(q.current),Ae!==""&&(q.current=window.setTimeout(()=>he(""),1e3))})(ge),$&&setTimeout(()=>$.focus())};C.useEffect(()=>()=>window.clearTimeout(q.current),[]),DC();const Y=C.useCallback(V=>fe.current===ae.current?.side&&pN(V,ae.current?.area),[]);return _.jsx($B,{scope:t,searchRef:re,onItemEnter:C.useCallback(V=>{Y(V)&&V.preventDefault()},[Y]),onItemLeave:C.useCallback(V=>{Y(V)||(N.current?.focus(),U(null))},[Y]),onTriggerLeave:C.useCallback(V=>{Y(V)&&V.preventDefault()},[Y]),pointerGraceTimerRef:ce,onPointerGraceIntentChange:C.useCallback(V=>{ae.current=V},[]),children:_.jsx(Te,{...z,children:_.jsx(zm,{asChild:!0,trapped:n,onMountAutoFocus:ut(a,V=>{V.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:_.jsx(td,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:b,onDismiss:v,children:_.jsx(tB,{asChild:!0,...D,dir:E.dir,orientation:"vertical",loop:s,currentTabStopId:k,onCurrentTabStopIdChange:U,onEntryFocus:ut(h,V=>{E.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:_.jsx(OS,{role:"menu","aria-orientation":"vertical","data-state":g1(T.open),"data-radix-menu-content":"",dir:E.dir,...A,...x,ref:H,style:{outline:"none",...x.style},onKeyDown:ut(x.onKeyDown,V=>{const L=V.target.closest("[data-radix-menu-content]")===V.currentTarget,B=V.ctrlKey||V.altKey||V.metaKey,X=V.key.length===1;L&&(V.key==="Tab"&&V.preventDefault(),!B&&X&&J(V.key));const Q=N.current;if(V.target!==Q||!HB.includes(V.key))return;V.preventDefault();const $=M().filter(he=>!he.disabled).map(he=>he.ref.current);KC.includes(V.key)&&$.reverse(),hN($)}),onBlur:ut(i.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(q.current),re.current="")}),onPointerMove:ut(i.onPointerMove,ac(V=>{const ge=V.target,L=_e.current!==V.clientX;if(V.currentTarget.contains(ge)&&L){const B=V.clientX>_e.current?"right":"left";fe.current=B,_e.current=V.clientX}}))})})})})})})});t1.displayName=Ki;var sN="MenuGroup",Ym=C.forwardRef((i,e)=>{const{__scopeMenu:t,...s}=i;return _.jsx(us.div,{role:"group",...s,ref:e})});Ym.displayName=sN;var iN="MenuLabel",s1=C.forwardRef((i,e)=>{const{__scopeMenu:t,...s}=i;return _.jsx(us.div,{...s,ref:e})});s1.displayName=iN;var Mh="MenuItem",E0="menu.itemSelect",gd=C.forwardRef((i,e)=>{const{disabled:t=!1,onSelect:s,...n}=i,a=C.useRef(null),l=wc(Mh,i.__scopeMenu),u=qm(Mh,i.__scopeMenu),h=Ns(e,a),f=C.useRef(!1),m=()=>{const p=a.current;if(!t&&p){const b=new CustomEvent(E0,{bubbles:!0,cancelable:!0});p.addEventListener(E0,v=>s?.(v),{once:!0}),rS(p,b),b.defaultPrevented?f.current=!1:l.onClose()}};return _.jsx(i1,{...n,ref:h,disabled:t,onClick:ut(i.onClick,m),onPointerDown:p=>{i.onPointerDown?.(p),f.current=!0},onPointerUp:ut(i.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:ut(i.onKeyDown,p=>{const b=u.searchRef.current!=="";t||b&&p.key===" "||qp.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});gd.displayName=Mh;var i1=C.forwardRef((i,e)=>{const{__scopeMenu:t,disabled:s=!1,textValue:n,...a}=i,l=qm(Mh,t),u=QC(t),h=C.useRef(null),f=Ns(e,h),[m,p]=C.useState(!1),[b,v]=C.useState("");return C.useEffect(()=>{const R=h.current;R&&v((R.textContent??"").trim())},[a.children]),_.jsx(rc.ItemSlot,{scope:t,disabled:s,textValue:n??b,children:_.jsx(sB,{asChild:!0,...u,focusable:!s,children:_.jsx(us.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...a,ref:f,onPointerMove:ut(i.onPointerMove,ac(R=>{s?l.onItemLeave(R):(l.onItemEnter(R),R.defaultPrevented||R.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ut(i.onPointerLeave,ac(R=>l.onItemLeave(R))),onFocus:ut(i.onFocus,()=>p(!0)),onBlur:ut(i.onBlur,()=>p(!1))})})})}),nN="MenuCheckboxItem",n1=C.forwardRef((i,e)=>{const{checked:t=!1,onCheckedChange:s,...n}=i;return _.jsx(c1,{scope:i.__scopeMenu,checked:t,children:_.jsx(gd,{role:"menuitemcheckbox","aria-checked":wh(t)?"mixed":t,...n,ref:e,"data-state":Zm(t),onSelect:ut(n.onSelect,()=>s?.(wh(t)?!0:!t),{checkForDefaultPrevented:!1})})})});n1.displayName=nN;var r1="MenuRadioGroup",[rN,aN]=Ia(r1,{value:void 0,onValueChange:()=>{}}),a1=C.forwardRef((i,e)=>{const{value:t,onValueChange:s,...n}=i,a=Mn(s);return _.jsx(rN,{scope:i.__scopeMenu,value:t,onValueChange:a,children:_.jsx(Ym,{...n,ref:e})})});a1.displayName=r1;var o1="MenuRadioItem",l1=C.forwardRef((i,e)=>{const{value:t,...s}=i,n=aN(o1,i.__scopeMenu),a=t===n.value;return _.jsx(c1,{scope:i.__scopeMenu,checked:a,children:_.jsx(gd,{role:"menuitemradio","aria-checked":a,...s,ref:e,"data-state":Zm(a),onSelect:ut(s.onSelect,()=>n.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});l1.displayName=o1;var Km="MenuItemIndicator",[c1,oN]=Ia(Km,{checked:!1}),u1=C.forwardRef((i,e)=>{const{__scopeMenu:t,forceMount:s,...n}=i,a=oN(Km,t);return _.jsx(In,{present:s||wh(a.checked)||a.checked===!0,children:_.jsx(us.span,{...n,ref:e,"data-state":Zm(a.checked)})})});u1.displayName=Km;var lN="MenuSeparator",h1=C.forwardRef((i,e)=>{const{__scopeMenu:t,...s}=i;return _.jsx(us.div,{role:"separator","aria-orientation":"horizontal",...s,ref:e})});h1.displayName=lN;var cN="MenuArrow",d1=C.forwardRef((i,e)=>{const{__scopeMenu:t,...s}=i,n=md(t);return _.jsx(DS,{...n,...s,ref:e})});d1.displayName=cN;var uN="MenuSub",[z4,f1]=Ia(uN),Xl="MenuSubTrigger",_1=C.forwardRef((i,e)=>{const t=Fa(Xl,i.__scopeMenu),s=wc(Xl,i.__scopeMenu),n=f1(Xl,i.__scopeMenu),a=qm(Xl,i.__scopeMenu),l=C.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=a,f={__scopeMenu:i.__scopeMenu},m=C.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return C.useEffect(()=>m,[m]),C.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),h(null)}},[u,h]),_.jsx(Vm,{asChild:!0,...f,children:_.jsx(i1,{id:n.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":n.contentId,"data-state":g1(t.open),...i,ref:ed(e,n.onTriggerChange),onClick:p=>{i.onClick?.(p),!(i.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:ut(i.onPointerMove,ac(p=>{a.onItemEnter(p),!p.defaultPrevented&&!i.disabled&&!t.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{t.onOpenChange(!0),m()},100))})),onPointerLeave:ut(i.onPointerLeave,ac(p=>{m();const b=t.content?.getBoundingClientRect();if(b){const v=t.content?.dataset.side,R=v==="right",x=R?-5:5,T=b[R?"left":"right"],E=b[R?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+x,y:p.clientY},{x:T,y:b.top},{x:E,y:b.top},{x:E,y:b.bottom},{x:T,y:b.bottom}],side:v}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:ut(i.onKeyDown,p=>{const b=a.searchRef.current!=="";i.disabled||b&&p.key===" "||VB[s.dir].includes(p.key)&&(t.onOpenChange(!0),t.content?.focus(),p.preventDefault())})})})});_1.displayName=Xl;var p1="MenuSubContent",m1=C.forwardRef((i,e)=>{const t=JC(Ki,i.__scopeMenu),{forceMount:s=t.forceMount,...n}=i,a=Fa(Ki,i.__scopeMenu),l=wc(Ki,i.__scopeMenu),u=f1(p1,i.__scopeMenu),h=C.useRef(null),f=Ns(e,h);return _.jsx(rc.Provider,{scope:i.__scopeMenu,children:_.jsx(In,{present:s||a.open,children:_.jsx(rc.Slot,{scope:i.__scopeMenu,children:_.jsx(Wm,{id:u.contentId,"aria-labelledby":u.triggerId,...n,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{l.isUsingKeyboardRef.current&&h.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:ut(i.onFocusOutside,m=>{m.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:ut(i.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:ut(i.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),b=XB[l.dir].includes(m.key);p&&b&&(a.onOpenChange(!1),u.trigger?.focus(),m.preventDefault())})})})})})});m1.displayName=p1;function g1(i){return i?"open":"closed"}function wh(i){return i==="indeterminate"}function Zm(i){return wh(i)?"indeterminate":i?"checked":"unchecked"}function hN(i){const e=document.activeElement;for(const t of i)if(t===e||(t.focus(),document.activeElement!==e))return}function dN(i,e){return i.map((t,s)=>i[(e+s)%i.length])}function fN(i,e,t){const n=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,a=t?i.indexOf(t):-1;let l=dN(i,Math.max(a,0));n.length===1&&(l=l.filter(f=>f!==t));const h=l.find(f=>f.toLowerCase().startsWith(n.toLowerCase()));return h!==t?h:void 0}function _N(i,e){const{x:t,y:s}=i;let n=!1;for(let a=0,l=e.length-1;a<e.length;l=a++){const u=e[a],h=e[l],f=u.x,m=u.y,p=h.x,b=h.y;m>s!=b>s&&t<(p-f)*(s-m)/(b-m)+f&&(n=!n)}return n}function pN(i,e){if(!e)return!1;const t={x:i.clientX,y:i.clientY};return _N(t,e)}function ac(i){return e=>e.pointerType==="mouse"?i(e):void 0}var mN=$C,gN=Vm,yN=e1,bN=t1,xN=Ym,vN=s1,RN=gd,TN=n1,EN=a1,SN=l1,CN=u1,AN=h1,MN=d1,wN=_1,PN=m1,yd="DropdownMenu",[ON]=Kr(yd,[ZC]),oi=ZC(),[DN,y1]=ON(yd),b1=i=>{const{__scopeDropdownMenu:e,children:t,dir:s,open:n,defaultOpen:a,onOpenChange:l,modal:u=!0}=i,h=oi(e),f=C.useRef(null),[m,p]=ld({prop:n,defaultProp:a??!1,onChange:l,caller:yd});return _.jsx(DN,{scope:e,triggerId:va(),triggerRef:f,contentId:va(),open:m,onOpenChange:p,onOpenToggle:C.useCallback(()=>p(b=>!b),[p]),modal:u,children:_.jsx(mN,{...h,open:m,onOpenChange:p,dir:s,modal:u,children:t})})};b1.displayName=yd;var x1="DropdownMenuTrigger",v1=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,disabled:s=!1,...n}=i,a=y1(x1,t),l=oi(t);return _.jsx(gN,{asChild:!0,...l,children:_.jsx(us.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...n,ref:ed(e,a.triggerRef),onPointerDown:ut(i.onPointerDown,u=>{!s&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:ut(i.onKeyDown,u=>{s||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});v1.displayName=x1;var IN="DropdownMenuPortal",R1=i=>{const{__scopeDropdownMenu:e,...t}=i,s=oi(e);return _.jsx(yN,{...s,...t})};R1.displayName=IN;var T1="DropdownMenuContent",E1=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=y1(T1,t),a=oi(t),l=C.useRef(!1);return _.jsx(bN,{id:n.contentId,"aria-labelledby":n.triggerId,...a,...s,ref:e,onCloseAutoFocus:ut(i.onCloseAutoFocus,u=>{l.current||n.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:ut(i.onInteractOutside,u=>{const h=u.detail.originalEvent,f=h.button===0&&h.ctrlKey===!0,m=h.button===2||f;(!n.modal||m)&&(l.current=!0)}),style:{...i.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});E1.displayName=T1;var FN="DropdownMenuGroup",kN=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(xN,{...n,...s,ref:e})});kN.displayName=FN;var LN="DropdownMenuLabel",BN=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(vN,{...n,...s,ref:e})});BN.displayName=LN;var NN="DropdownMenuItem",S1=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(RN,{...n,...s,ref:e})});S1.displayName=NN;var UN="DropdownMenuCheckboxItem",jN=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(TN,{...n,...s,ref:e})});jN.displayName=UN;var GN="DropdownMenuRadioGroup",zN=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(EN,{...n,...s,ref:e})});zN.displayName=GN;var HN="DropdownMenuRadioItem",VN=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(SN,{...n,...s,ref:e})});VN.displayName=HN;var XN="DropdownMenuItemIndicator",qN=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(CN,{...n,...s,ref:e})});qN.displayName=XN;var WN="DropdownMenuSeparator",YN=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(AN,{...n,...s,ref:e})});YN.displayName=WN;var KN="DropdownMenuArrow",ZN=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(MN,{...n,...s,ref:e})});ZN.displayName=KN;var QN="DropdownMenuSubTrigger",$N=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(wN,{...n,...s,ref:e})});$N.displayName=QN;var JN="DropdownMenuSubContent",eU=C.forwardRef((i,e)=>{const{__scopeDropdownMenu:t,...s}=i,n=oi(t);return _.jsx(PN,{...n,...s,ref:e,style:{...i.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eU.displayName=JN;var tU=b1,sU=v1,iU=R1,nU=E1,rU=S1;function aU({...i}){return _.jsx(tU,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:10","data-slot":"dropdown-menu",...i})}function oU({...i}){return _.jsx(sU,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:25","data-slot":"dropdown-menu-trigger",...i})}function lU({className:i,sideOffset:e=4,...t}){return _.jsx(iU,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:38",children:_.jsx(nU,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:39","data-slot":"dropdown-menu-content",sideOffset:e,className:cs("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
438de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),...t})})}function cU({className:i,inset:e,variant:t="default",...s}){return _.jsx(rU,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:70","data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:cs("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),...s})}const S0=i=>typeof i=="boolean"?`${i}`:i===0?"0":i,C0=VS,C1=(i,e)=>t=>{var s;if(e?.variants==null)return C0(i,t?.class,t?.className);const{variants:n,defaultVariants:a}=e,l=Object.keys(n).map(f=>{const m=t?.[f],p=a?.[f];if(m===null)return null;const b=S0(m)||S0(p);return n[f][b]}),u=t&&Object.entries(t).reduce((f,m)=>{let[p,b]=m;return b===void 0||(f[p]=b),f},{}),h=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((f,m)=>{let{class:p,className:b,...v}=m;return Object.entries(v).every(R=>{let[x,T]=R;return Array.isArray(T)?T.includes({...a,...u}[x]):{...a,...u}[x]===T})?[...f,p,b]:f},[]);return C0(i,l,h,t?.class,t?.className)},uU=C1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-transparent shadow-xs hover:bg-accent dark:bg-transparent dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function bd({className:i,variant:e,size:t,asChild:s=!1,...n}){const a=s?iS:"button";return _.jsx(a,{"data-loc":"client/src/components/ui/button.tsx:52","data-slot":"button",className:cs(uU({variant:e,size:t,className:i})),...n})}var xd="Dialog",[A1]=Kr(xd),[hU,cn]=A1(xd),M1=i=>{const{__scopeDialog:e,children:t,open:s,defaultOpen:n,onOpenChange:a,modal:l=!0}=i,u=C.useRef(null),h=C.useRef(null),[f,m]=ld({prop:s,defaultProp:n??!1,onChange:a,caller:xd});return _.jsx(hU,{scope:e,triggerRef:u,contentRef:h,contentId:va(),titleId:va(),descriptionId:va(),open:f,onOpenChange:m,onOpenToggle:C.useCallback(()=>m(p=>!p),[m]),modal:l,children:t})};M1.displayName=xd;var w1="DialogTrigger",dU=C.forwardRef((i,e)=>{const{__scopeDialog:t,...s}=i,n=cn(w1,t),a=Ns(e,n.triggerRef);return _.jsx(us.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Jm(n.open),...s,ref:a,onClick:ut(i.onClick,n.onOpenToggle)})});dU.displayName=w1;var Qm="DialogPortal",[fU,P1]=A1(Qm,{forceMount:void 0}),O1=i=>{const{__scopeDialog:e,forceMount:t,children:s,container:n}=i,a=cn(Qm,e);return _.jsx(fU,{scope:e,forceMount:t,children:C.Children.map(s,l=>_.jsx(In,{present:t||a.open,children:_.jsx(od,{asChild:!0,container:n,children:l})}))})};O1.displayName=Qm;var Ph="DialogOverlay",D1=C.forwardRef((i,e)=>{const t=P1(Ph,i.__scopeDialog),{forceMount:s=t.forceMount,...n}=i,a=cn(Ph,i.__scopeDialog);return a.modal?_.jsx(In,{present:s||a.open,children:_.jsx(pU,{...n,ref:e})}):null});D1.displayName=Ph;var _U=Uo("DialogOverlay.RemoveScroll"),pU=C.forwardRef((i,e)=>{const{__scopeDialog:t,...s}=i,n=cn(Ph,t);return _.jsx(Hm,{as:_U,allowPinchZoom:!0,shards:[n.contentRef],children:_.jsx(us.div,{"data-state":Jm(n.open),...s,ref:e,style:{pointerEvents:"auto",...s.style}})})}),Ma="DialogContent",I1=C.forwardRef((i,e)=>{const t=P1(Ma,i.__scopeDialog),{forceMount:s=t.forceMount,...n}=i,a=cn(Ma,i.__scopeDialog);return _.jsx(In,{present:s||a.open,children:a.modal?_.jsx(mU,{...n,ref:e}):_.jsx(gU,{...n,ref:e})})});I1.displayName=Ma;var mU=C.forwardRef((i,e)=>{const t=cn(Ma,i.__scopeDialog),s=C.useRef(null),n=Ns(e,t.contentRef,s);return C.useEffect(()=>{const a=s.current;if(a)return GC(a)},[]),_.jsx(F1,{...i,ref:n,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ut(i.onCloseAutoFocus,a=>{a.preventDefault(),t.triggerRef.current?.focus()}),onPointerDownOutside:ut(i.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:ut(i.onFocusOutside,a=>a.preventDefault())})}),gU=C.forwardRef((i,e)=>{const t=cn(Ma,i.__scopeDialog),s=C.useRef(!1),n=C.useRef(!1);return _.jsx(F1,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{i.onCloseAutoFocus?.(a),a.defaultPrevented||(s.current||t.triggerRef.current?.focus(),a.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:a=>
vendor: 4,970 bytes, lines 438-442
438{i.onInteractOutside?.(a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=a.target;t.triggerRef.current?.contains(l)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),F1=C.forwardRef((i,e)=>{const{__scopeDialog:t,trapFocus:s,onOpenAutoFocus:n,onCloseAutoFocus:a,...l}=i,u=cn(Ma,t),h=C.useRef(null),f=Ns(e,h);return DC(),_.jsxs(_.Fragment,{children:[_.jsx(zm,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:n,onUnmountAutoFocus:a,children:_.jsx(td,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Jm(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(yU,{titleId:u.titleId}),_.jsx(xU,{contentRef:h,descriptionId:u.descriptionId})]})]})}),$m="DialogTitle",k1=C.forwardRef((i,e)=>{const{__scopeDialog:t,...s}=i,n=cn($m,t);return _.jsx(us.h2,{id:n.titleId,...s,ref:e})});k1.displayName=$m;var L1="DialogDescription",B1=C.forwardRef((i,e)=>{const{__scopeDialog:t,...s}=i,n=cn(L1,t);return _.jsx(us.p,{id:n.descriptionId,...s,ref:e})});B1.displayName=L1;var N1="DialogClose",U1=C.forwardRef((i,e)=>{const{__scopeDialog:t,...s}=i,n=cn(N1,t);return _.jsx(us.button,{type:"button",...s,ref:e,onClick:ut(i.onClick,()=>n.onOpenChange(!1))})});U1.displayName=N1;function Jm(i){return i?"open":"closed"}var j1="DialogTitleWarning",[H4,G1]=I2(j1,{contentName:Ma,titleName:$m,docsSlug:"dialog"}),yU=({titleId:i})=>{const e=G1(j1),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
439
440If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
441
442For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return C.useEffect(()=>{i&&(document.getElementById(i)||console.error(t))},[t,i]),null},bU="DialogDescriptionWarning",xU=({contentRef:i,descriptionId:e})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G1(bU).contentName}}.`;return C.useEffect(()=>{const n=i.current?.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(s))},[s,i,e]),null},vU=M1,RU=O1,TU=D1,EU=I1,SU=k1,CU=B1,AU=U1;C.createContext({isComposing:()=>!1,setComposing:()=>{},justEndedComposing:()=>!1,markCompositionEnd:()=>{}});function MU({...i}){return _.jsx(vU,{"data-loc":"client/src/components/ui/sheet.tsx:10","data-slot":"sheet",...i})}function wU({...i}){return _.jsx(RU,{"data-loc":"client/src/components/ui/sheet.tsx:28","data-slot":"sheet-portal",...i})}function PU({className:i,...e}){return _.jsx(TU,{"data-loc":"client/src/components/ui/sheet.tsx:36","data-slot":"sheet-overlay",className:cs("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",i),...e})}function OU({className:i,children:e,side:t="right",...s}){return _.jsxs(wU,{"data-loc":"client/src/components/ui/sheet.tsx:56",children:[_.jsx(PU,{"data-loc":"client/src/components/ui/sheet.tsx:57"}),_.jsxs(EU,{"data-loc":"client/src/components/ui/sheet.tsx:58","data-slot":"sheet-content",className:cs("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",t==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",t==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",t==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",t==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",i),...s,children:[e,_.jsxs(AU,{"data-loc":"client/src/components/ui/sheet.tsx:75",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[_.jsx(EC,{"data-loc":"client/src/components/ui/sheet.tsx:76",className:"size-4"}),_.jsx("span",{"data-loc":"client/src/components/ui/sheet.tsx:77",className:"sr-only",children:"Close"})]})]})]})}function DU({className:i,...e}){return _.jsx("div",{"data-loc":"client/src/components/ui/sheet.tsx:86","data-slot":"sheet-header",className:cs("flex flex-col gap-1.5 p-4",i),...e})}function IU({className:i,...e}){return _.jsx(SU,{"data-loc":"client/src/components/ui/sheet.tsx:109","data-slot":"sheet-title",className:cs("text-foreground font-semibold",i),...e})}function FU({className:i,...e}){return _.jsx(CU,{"data-loc":"client/src/components/ui/sheet.tsx:122","data-slot":"sheet-
442description",className:cs("text-muted-foreground text-sm",i),...e})}function Pi({className:i,...e}){return _.jsx("div",{"data-loc":"client/src/components/ui/skeleton.tsx:5","data-slot":"skeleton",className:cs("bg-accent animate-pulse rounded-md",i),...e})}const np=768;function z1(){const[i,e]=C.useState(void 0);return C.useEffect(()=>{const t=window.matchMedia(`(max-width: ${np-1}px)`),s=()=>{e(window.innerWidth<np)};return t.addEventListener("change",s),e(window.innerWidth<np),()=>t.removeEventListener("change",s)},[]),!!i}const kU="sidebar_state",LU=3600*24*7,BU="16rem",NU="18rem",UU="3rem",jU="b",H1=C.createContext(null);function vd(){const i=C.useContext(H1);if(!i)throw new Error("useSidebar must be used within a SidebarProvider.");return i}function GU({defaultOpen:i=!0,open:e,onOpenChange:t,className:s,style:n,children:a,...l}){const u=z1(),[h,f]=C.useState(!1),[m,p]=C.useState(i),b=e??m,v=C.useCallback(E=>{const A=typeof E=="function"?E(b):E;t?t(A):p(A),document.cookie=`${kU}=${A}; path=/; max-age=${LU}`},[t,b]),R=C.useCallback(()=>u?f(E=>!E):v(E=>!E),[u,v,f]);C.useEffect(()=>{const E=A=>{A.key===jU&&(A.metaKey||A.ctrlKey)&&(A.preventDefault(),R())};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[R]);const x=b?"expanded":"collapsed",T=C.useMemo(()=>({state:x,open:b,setOpen:v,isMobile:u,openMobile:h,setOpenMobile:f,toggleSidebar:R}),[x,b,v,u,h,f,R]);return _.jsx(H1.Provider,{"data-loc":"client/src/components/ui/sidebar.tsx:129",value:T,children:_.jsx(wm,{"data-loc":"client/src/components/ui/sidebar.tsx:130",delayDuration:0,children:_.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:131","data-slot":"sidebar-wrapper",style:{"--sidebar-width":BU,"--sidebar-width-icon":UU,...n},className:cs("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:a})})})}function zU({side:i="left",variant:e="sidebar",collapsible:t="offcanvas",disableTransition:s=!1,className:n,children:a,...l}){const{isMobile:u,state:h,openMobile:f,setOpenMobile:m}=vd();return t==="none"?_.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:171","data-slot":"sidebar",className:cs("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...l,children:a}):u?_.jsx(MU,{"data-loc":"client/src/components/ui/sidebar.tsx:186",open:f,onOpenChange:m,...l,children:_.jsxs(OU,{"data-loc":"client/src/components/ui/sidebar.tsx:187","data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":NU},side:i,children:[_.jsxs(DU,{"data-loc":"client/src/components/ui/sidebar.tsx:199",className:"sr-only",children:[_.jsx(IU,{"data-loc":"client/src/components/ui/sidebar.tsx:200",children:"Sidebar"}),_.jsx(FU,{"data-loc":"client/src/components/ui/sidebar.tsx:201",children:"Displays the mobile sidebar."})]}),_.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:203",className:"flex h-full w-full flex-col",children:a})]})}):_.jsxs("div",{"data-loc":"client/src/components/ui/sidebar.tsx:210",className:"group peer text-sidebar-foreground hidden md:block","data-state":h,"data-collapsible":h==="collapsed"?t:"","data-variant":e,"data-side":i,"data-slot":"sidebar",children:[_.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:219","data-slot":"sidebar-gap",className:cs("relative w-(--sidebar-width) bg-transparent",s?"transition-none":"transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),_.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:233","data-slot":"sidebar-container",className:cs("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex",s?"transition-none":"transition-[left,right,width] duration-200 ease-linear",i==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...l,children:_.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:251","data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:a})})]})}function HU({className:i,onClick:e,...t}){const{toggleSidebar:s}=vd();return _.jsxs(bd,{"data-loc":"client/src/components/ui/sidebar.tsx:271","data-sidebar":"trigger","data-slot":"sidebar-tr
442igger",variant:"ghost",size:"icon",className:cs("size-7",i),onClick:n=>{e?.(n),s()},...t,children:[_.jsx(bC,{"data-loc":"client/src/components/ui/sidebar.tsx:283"}),_.jsx("span",{"data-loc":"client/src/components/ui/sidebar.tsx:284",className:"sr-only",children:"Toggle Sidebar"})]})}function VU({className:i,...e}){return _.jsx("main",{"data-loc":"client/src/components/ui/sidebar.tsx:316","data-slot":"sidebar-inset",className:cs("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",i),...e})}function XU({className:i,...e}){return _.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:344","data-slot":"sidebar-header","data-sidebar":"header",className:cs("flex flex-col gap-2 p-2",i),...e})}function qU({className:i,...e}){return _.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:355","data-slot":"sidebar-footer","data-sidebar":"footer",className:cs("flex flex-col gap-2 p-2",i),...e})}function WU({className:i,...e}){return _.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:380","data-slot":"sidebar-content","data-sidebar":"content",className:cs("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",i),...e})}function YU({className:i,...e}){return _.jsx("ul",{"data-loc":"client/src/components/ui/sidebar.tsx:463","data-slot":"sidebar-menu","data-sidebar":"menu",className:cs("flex w-full min-w-0 flex-col gap-1",i),...e})}function KU({className:i,...e}){return _.jsx("li",{"data-loc":"client/src/components/ui/sidebar.tsx:474","data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:cs("group/menu-item relative",i),...e})}const ZU=C1("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function QU({asChild:i=!1,isActive:e=!1,variant:t="default",size:s="default",tooltip:n,className:a,...l}){const u=i?iS:"button",{isMobile:h,state:f}=vd(),m=_.jsx(u,{"data-loc":"client/src/components/ui/sidebar.tsx:522","data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":e,className:cs(ZU({variant:t,size:s}),a),...l});return n?(typeof n=="string"&&(n={children:n}),_.jsxs(Ak,{"data-loc":"client/src/components/ui/sidebar.tsx:543",children:[_.jsx(Mk,{"data-loc":"client/src/components/ui/sidebar.tsx:544",asChild:!0,children:m}),_.jsx(wk,{"data-loc":"client/src/components/ui/sidebar.tsx:545",side:"right",align:"center",hidden:f!=="collapsed"||h,...n})]})):m}function $U(){return _.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:5",className:"flex min-h-screen bg-background",children:[_.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:7",className:"w-[280px] border-r border-border bg-background p-4 space-y-6",children:[_.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:9",className:"flex items-center gap-3 px-2",children:[_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:10",className:"h-8 w-8 rounded-md"}),_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:11",className:"h-4 w-24"})]}),_.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:15",className:"space-y-2 px-2",children:[_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:16",className:"h-10 w-full rounded-lg"}),_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:17",className:"h-10 w-full rounded-lg"}),_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:18",className:"h-10 w-full rounded-lg"})]}),_.jsx("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:22",className:"absolute bottom-4 left-4 right-4",children:_.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:23",className:"flex items-center gap-3 px-1",children:[_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:24",className:"h-9 w-9 rounded-full"}),_.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:25",className:"flex-1 space-y-2",children:[_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:26",className:"h-3 w-20"}),_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:27",className:"h-2 w-32"})]})]})})]}),_.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:34",className:"flex-1 p-4 space-y-4",children:[_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:36",className:"h-12 w-48 rounded-lg"}),_.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:37",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:38",className:"h-32 rounded-xl"}),_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:39",className:"h-32 rounded-xl"}),_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:40",className:"h-32 rounded-xl"})]}),_.jsx(Pi,{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:42",className:"h-64 roun
442ded-xl"})]})]})}const JU=[{icon:jr,label:"返回遊戲",path:"/",adminOnly:!1},{icon:Bm,label:"會員中心",path:"/member",adminOnly:!1},{icon:Pn,label:"職涯排行榜",path:"/leaderboard",adminOnly:!1},{icon:_C,label:"營運總覽",path:"/admin",adminOnly:!0},{icon:jm,label:"會員管理",path:"/admin/users",adminOnly:!0},{icon:nc,label:"邀請碼",path:"/admin/invitations",adminOnly:!0},{icon:zp,label:"賽季與獎勵",path:"/admin/seasons",adminOnly:!0},{icon:mC,label:"章節與選項",path:"/admin/content",adminOnly:!0},{icon:Da,label:"遊戲紀錄",path:"/admin/runs",adminOnly:!0},{icon:RC,label:"營運設定",path:"/admin/settings",adminOnly:!0}],A0="resolve-by-law-sidebar-width";function eg({children:i}){const[e,t]=C.useState(()=>{const a=localStorage.getItem(A0);return a?Number.parseInt(a,10):260}),{loading:s,user:n}=Zi();return C.useEffect(()=>{localStorage.setItem(A0,e.toString())},[e]),s?_.jsx($U,{"data-loc":"client/src/components/DashboardLayout.tsx:70"}):n?_.jsx(GU,{"data-loc":"client/src/components/DashboardLayout.tsx:84",style:{"--sidebar-width":`${e}px`},children:_.jsx(e3,{"data-loc":"client/src/components/DashboardLayout.tsx:85",setSidebarWidth:t,children:i})}):_.jsxs("div",{"data-loc":"client/src/components/DashboardLayout.tsx:73",className:"portal-access-gate",children:[_.jsx(xi,{"data-loc":"client/src/components/DashboardLayout.tsx:74"}),_.jsx("p",{"data-loc":"client/src/components/DashboardLayout.tsx:75",children:"MEMBER ACCESS"}),_.jsx("h1",{"data-loc":"client/src/components/DashboardLayout.tsx:76",children:"登入依法解決"}),_.jsx("span",{"data-loc":"client/src/components/DashboardLayout.tsx:77",children:"註冊或登入後,才能查看個人紀錄與管理功能。"}),_.jsx(bd,{"data-loc":"client/src/components/DashboardLayout.tsx:78",onClick:()=>_d(),size:"lg",children:"註冊/登入"})]})}function e3({children:i,setSidebarWidth:e}){const{user:t,logout:s}=Zi(),[n,a]=dd(),{state:l,toggleSidebar:u}=vd(),h=l==="collapsed",f=z1(),[m,p]=C.useState(!1),b=C.useRef(null),v=JU.filter(x=>!x.adminOnly||t?.role==="admin"),R=v.find(x=>x.path===n);return C.useEffect(()=>{if(!m)return;const x=E=>{const A=b.current?.getBoundingClientRect().left??0,D=E.clientX-A;D>=210&&D<=360&&e(D)},T=()=>p(!1);return document.addEventListener("mousemove",x),document.addEventListener("mouseup",T),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",T)}},[m,e]),_.jsxs("div",{"data-loc":"client/src/components/DashboardLayout.tsx:118",className:"portal-shell",children:[_.jsxs("div",{"data-loc":"client/src/components/DashboardLayout.tsx:119",className:"portal-sidebar-wrap",ref:b,children:[_.jsxs(zU,{"data-loc":"client/src/components/DashboardLayout.tsx:120",collapsible:"icon",className:"portal-sidebar border-r-0",disableTransition:m,children:[_.jsxs(XU,{"data-loc":"client/src/components/DashboardLayout.tsx:121",className:"portal-sidebar__header",children:[_.jsx("button",{"data-loc":"client/src/components/DashboardLayout.tsx:122",onClick:u,"aria-label":"切換導覽",children:_.jsx(bC,{"data-loc":"client/src/components/DashboardLayout.tsx:122"})}),!h&&_.jsxs("div",{"data-loc":"client/src/components/DashboardLayout.tsx:123",children:[_.jsx(xi,{"data-loc":"client/src/components/DashboardLayout.tsx:123"}),_.jsxs("span",{"data-loc":"client/src/components/DashboardLayout.tsx:123",children:[_.jsx("strong",{"data-loc":"client/src/components/DashboardLayout.tsx:123",children:"依法解決"}),_.jsx("small",{"data-loc":"client/src/components/DashboardLayout.tsx:123",children:t?.role==="admin"?"ADMIN CONSOLE":"MEMBER RECORD"})]})]})]}),_.jsx(WU,{"data-loc":"client/src/components/DashboardLayout.tsx:125",children:_.jsx(YU,{"data-loc":"client/src/components/DashboardLayout.tsx:126",className:"portal-menu",children:v.map(x=>_.jsx(KU,{"data-loc":"client/src/components/DashboardLayout.tsx:128",children:_.jsxs(QU,{"data-loc":"client/src/components/DashboardLayout.tsx:129",isActive:n===x.path,onClick:()=>a(x.path),tooltip:x.label,children:[_.jsx(x.icon,{"data-loc":"client/src/components/DashboardLayout.tsx:134"}),_.jsx("span",{"data-loc":"client/src/components/DashboardLayout.t
442sx:135",children:x.label})]})},x.path))})}),_.jsx(qU,{"data-loc":"client/src/components/DashboardLayout.tsx:141",className:"portal-profile",children:_.jsxs(aU,{"data-loc":"client/src/components/DashboardLayout.tsx:142",children:[_.jsx(oU,{"data-loc":"client/src/components/DashboardLayout.tsx:143",asChild:!0,children:_.jsxs("button",{"data-loc":"client/src/components/DashboardLayout.tsx:144",children:[_.jsx(kL,{"data-loc":"client/src/components/DashboardLayout.tsx:145",children:_.jsx(LL,{"data-loc":"client/src/components/DashboardLayout.tsx:145",children:t?.name?.charAt(0).toUpperCase()||"U"})}),!h&&_.jsxs("span",{"data-loc":"client/src/components/DashboardLayout.tsx:146",children:[_.jsx("strong",{"data-loc":"client/src/components/DashboardLayout.tsx:146",children:t?.name||"會員"}),_.jsx("small",{"data-loc":"client/src/components/DashboardLayout.tsx:146",children:t?.email||t?.role})]})]})}),_.jsx(lU,{"data-loc":"client/src/components/DashboardLayout.tsx:149",align:"end",children:_.jsxs(cU,{"data-loc":"client/src/components/DashboardLayout.tsx:150",onClick:()=>void s(),children:[_.jsx(Lm,{"data-loc":"client/src/components/DashboardLayout.tsx:150"})," 登出"]})})]})})]}),!h&&_.jsx("button",{"data-loc":"client/src/components/DashboardLayout.tsx:155",className:"portal-resizer",onMouseDown:()=>p(!0),"aria-label":"調整側欄寬度"})]}),_.jsxs(VU,{"data-loc":"client/src/components/DashboardLayout.tsx:157",className:"portal-inset",children:[f&&_.jsxs("header",{"data-loc":"client/src/components/DashboardLayout.tsx:158",className:"portal-mobile-header",children:[_.jsx(HU,{"data-loc":"client/src/components/DashboardLayout.tsx:158"}),_.jsx("span",{"data-loc":"client/src/components/DashboardLayout.tsx:158",children:R?.label??"依法解決"})]}),_.jsx("main",{"data-loc":"client/src/components/DashboardLayout.tsx:159",className:"portal-content",children:i})]})]})}function Wr({title:i,eyebrow:e,children:t}){const{user:s,loading:n}=Zi();return _.jsx(eg,{"data-loc":"client/src/pages/AdminPages.tsx:27",children:n?_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:28",className:"portal-loading",children:[_.jsx(Yo,{"data-loc":"client/src/pages/AdminPages.tsx:28"})," 驗證權限"]}):s?.role!=="admin"?_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:29",className:"portal-empty portal-empty--forbidden",children:[_.jsx(pL,{"data-loc":"client/src/pages/AdminPages.tsx:29"}),_.jsx("strong",{"data-loc":"client/src/pages/AdminPages.tsx:29",children:"需要管理員權限"}),_.jsx("span",{"data-loc":"client/src/pages/AdminPages.tsx:29",children:"此區只供依法解決管理員使用。"})]}):_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:31",className:"portal-page",children:[_.jsxs("header",{"data-loc":"client/src/pages/AdminPages.tsx:32",className:"portal-page__header",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:32",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminPages.tsx:32",children:e}),_.jsx("h1",{"data-loc":"client/src/pages/AdminPages.tsx:32",children:i}),_.jsx("span",{"data-loc":"client/src/pages/AdminPages.tsx:32",children:"管理會員、遊戲紀錄與營運狀態。"})]}),_.jsxs("span",{"data-loc":"client/src/pages/AdminPages.tsx:32",className:"admin-badge",children:[_.jsx(Da,{"data-loc":"client/src/pages/AdminPages.tsx:32"})," ADMIN"]})]}),t]})})}function t3(){const{user:i}=Zi(),e=dt.admin.overview.useQuery(void 0,{enabled:i?.role==="admin"});return _.jsx(Wr,{"data-loc":"client/src/pages/AdminPages.tsx:44",title:"營運總覽",eyebrow:"ADMINISTRATION OVERVIEW",children:e.isLoading?_.jsx(or,{"data-loc":"client/src/pages/AdminPages.tsx:45"}):e.data&&_.jsxs(_.Fragment,{children:[_.jsxs("section",{"data-loc":"client/src/pages/AdminPages.tsx:47",className:"portal-stat-grid",children:[_.jsx(Hl,{"data-loc":"client/src/pages/AdminPages.tsx:48",icon:jm,label:"註冊會員",value:e.data.totalUsers}),_.jsx(Hl,{"data-loc":"client/src/pages/AdminPages.tsx:49",icon:nc,label:"測試資格",value:e.data.betaMembers}),_.jsx(Hl,{"data-loc":"client/src/pages/AdminPages.tsx:50",icon:jr,label:"完成局數",value:e.data.totalRuns}),_.jsx(Hl,{"data-loc":"client/src/pages/AdminPages.tsx:51",icon:Fm,label:"平均狀態分數",value:e.data.averageScore}),_.jsx(Hl,{"data-loc":"client/src/pages/AdminPages.tsx:52",icon:Pn,label:"成就解鎖總數",value:e.data.totalUnlocks})]}),_.jsxs("section",{"data-loc":"client/src/pages/AdminPages.tsx:54",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:55",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:55",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminPages.tsx:55",children:"ENDING DISTRIBUTION"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminPages.tsx:55",children:"結局分布"})]}),_.jsx(_C,{"data-loc":"client/src/pages/AdminPages.tsx:55"})]}),e.data.endings.length===0?_.jsx(Ra,{"data-loc":"client/src/pages/AdminPages.tsx:56",label:"尚無遊玩資料"}):_.jsx("div",{"data-loc":"client/src/pages/AdminPages.tsx:57",className:"ending-distribution",children:e.data.endings.map(t=>{const s=Math.max(...e.data.endings.map(n=>n.total),1);return _.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:60",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminPages.tsx:60",children:t.title}),_.jsx("i",{"data-loc":"client/src/pages/AdminPages.tsx:60",children:_.jsx("b",{"data-loc":"client/src/pages/AdminPages.tsx:60",style:{transform:`scaleX(${t.total/s})`}})}),_.jsx("strong",{"data-loc":"client/src/pages/AdminPages.tsx:60",children:t.total})]},t.endingId)})})]})]})})}function s3(){const{user:i}=Zi(),e=dt.useUtils(),t=dt.admin.users.useQuery(void 0,{enabled:i?.role==="admin"}),s=dt.admin.updateUserRole.useMutation({onSuccess:()=>void e.admin.users.invalidate()}),n=dt.admin.grantBetaAccess.useMutation({onSuccess:()=>void e.admin.users.invalidate()}),a=dt.admin.revokeBetaAccess.useMutation({onSuccess:()=>void e.admin.users.invalidate()});return _.jsx(Wr,{"data-loc":"client/src/pages/AdminPages.tsx:79",title:"會員管理",eyebrow:"MEMBER ADMINISTRATION",children:t.isLoading?_.jsx(or,{"data-loc":"client/src/pages/AdminPages.tsx:80"}):t.data&&_.jsxs("section",{"data-loc":"client/src/pages/AdminPages.tsx:81",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:82",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:82",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminPages.tsx:82",children:"REGISTERED MEMBERS"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminPages.tsx:82",children:"會員與權限"})]}),_.jsxs("span",{"data-loc":"client/src/pages/AdminPages.tsx:82",children:[t.data.length," 人"]})]}),_.jsx("div",{"data-loc":"client/src/pages/AdminPages.tsx:83",className:"portal-table-wrap",children:_.jsxs("table",{"data-loc":"client/src/pages/AdminPages.tsx:83",className:"portal-table",children:[_.jsx("thead",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:_.jsxs("tr",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:[_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"會員"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"角色"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"測試資格"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"職涯"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"遊玩"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"成就"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"最佳分數"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"最近登入"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:"操作"})]})}),_.jsx("tbody",{"data-loc":"client/src/pages/AdminPages.tsx:83",children:t.data.map(l=>_.jsxs("tr",{"data-loc":"client/src/pages/AdminPages.tsx:84",children:[_.jsxs("td",{"data-loc":"client/src/pages/AdminPages.tsx:85",children:[_.jsx("strong",{"data-loc":"client/src/pages/AdminPages.tsx:85",children:l.name||"未命名會員"}),_.jsx("small",{"data-loc":"client/src/pages/AdminPages.tsx:85",children:l.email||l.openId})]}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:86",children:_.jsx("span",{"data-loc":"client/src/pages/AdminPages.tsx:86",className:`role-pill role-pill--${l.role}`,children:l.role==="admin"?"管理員":"會員"})}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:87",children:_.jsx("span",{"data-loc":"client/src/pages/AdminPages.tsx:87",className:`access-pill ${l.betaEligible?"is-active":""}`,children:l.betaEligible?"已取得":"待邀請"})}),_.jsxs("td",{"data-loc":"client/src/pages/AdminPages.tsx:88",children:[_.jsxs("b",{"data-loc":"client/src/pages/AdminPages.tsx:88",children:["Lv.",l.career.level]}),_.jsx("small",{"data-loc":"client/src/pages/AdminPages.tsx:88",children:l.career.title})]}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:88",children:l.totalRuns}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:88",children:l.totalAchievements}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:88",children:l.bestScore}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:89",children:new Date(l.lastSignedIn).toLocaleStr
442ing("zh-TW")}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:90",children:_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:90",className:"portal-row-actions",children:[_.jsxs("button",{"data-loc":"client/src/pages/AdminPages.tsx:90",className:"portal-row-action",disabled:l.id===i?.id||s.isPending,onClick:()=>s.mutate({userId:l.id,role:l.role==="admin"?"user":"admin"}),children:[_.jsx(RL,{"data-loc":"client/src/pages/AdminPages.tsx:90"}),l.role==="admin"?"改為會員":"升為管理員"]}),l.role!=="admin"&&_.jsxs("button",{"data-loc":"client/src/pages/AdminPages.tsx:90",className:"portal-row-action",disabled:n.isPending||a.isPending,onClick:()=>l.betaEligible?a.mutate({userId:l.id}):n.mutate({userId:l.id}),children:[l.betaEligible?_.jsx(vL,{"data-loc":"client/src/pages/AdminPages.tsx:90"}):_.jsx(xL,{"data-loc":"client/src/pages/AdminPages.tsx:90"}),l.betaEligible?"撤銷資格":"直接核發"]})]})})]},l.id))})]})})]})})}function i3(){const{user:i}=Zi(),e=dt.admin.runs.useQuery({limit:50},{enabled:i?.role==="admin"});return _.jsx(Wr,{"data-loc":"client/src/pages/AdminPages.tsx:103",title:"遊戲紀錄",eyebrow:"GAMEPLAY AUDIT LOG",children:e.isLoading?_.jsx(or,{"data-loc":"client/src/pages/AdminPages.tsx:104"}):e.data&&_.jsxs("section",{"data-loc":"client/src/pages/AdminPages.tsx:105",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:106",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:106",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminPages.tsx:106",children:"RECENT COMPLETIONS"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminPages.tsx:106",children:"最近 50 次結局"})]}),_.jsx(tL,{"data-loc":"client/src/pages/AdminPages.tsx:106"})]}),e.data.length===0?_.jsx(Ra,{"data-loc":"client/src/pages/AdminPages.tsx:107",label:"尚無完成紀錄"}):_.jsx("div",{"data-loc":"client/src/pages/AdminPages.tsx:107",className:"portal-table-wrap",children:_.jsxs("table",{"data-loc":"client/src/pages/AdminPages.tsx:107",className:"portal-table",children:[_.jsx("thead",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:_.jsxs("tr",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:[_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:"時間"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:"會員"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:"結局"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:"評等"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:"狀態分數"}),_.jsx("th",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:"時間"})]})}),_.jsx("tbody",{"data-loc":"client/src/pages/AdminPages.tsx:107",children:e.data.map(t=>_.jsxs("tr",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:[_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:new Date(t.completedAt).toLocaleString("zh-TW")}),_.jsxs("td",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:[_.jsx("strong",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:t.userName||"會員"}),_.jsx("small",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:t.userEmail})]}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:t.endingTitle}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:_.jsx("b",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:t.grade})}),_.jsx("td",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:t.score}),_.jsxs("td",{"data-loc":"client/src/pages/AdminPages.tsx:108",children:[Math.max(1,Math.round(t.durationSeconds/60))," 分鐘"]})]},t.id))})]})})]})})}function n3(){const{user:i}=Zi(),e=dt.admin.settings.useQuery(void 0,{enabled:i?.role==="admin"}),[t,s]=C.useState({gameEnabled:!0,closedBetaEnabled:!0,memberAnnouncement:"",maintenanceMessage:""}),[n,a]=C.useState(!1),l=dt.admin.updateSettings.useMutation({onSuccess:u=>{s({gameEnabled:u.gameEnabled,closedBetaEnabled:u.closedBetaEnabled,memberAnnouncement:u.memberAnnouncement||"",maintenanceMessage:u.maintenanceMessage||""}),a(!0),window.setTimeout(()=>a(!1),1800)}});return C.useEffect(()=>{e.data&&s({gameEnabled:e.data.gameEnabled,closedBetaEnabled:e.data.closedBetaEnabled,memberAnnouncement:e.data.memberAnnouncement||"",maintenanceMessage:e.data.maintenanceMessage||""})},[e.data]),_.jsx(Wr,{"data-loc":"client/src/pages/AdminPages.tsx:140",title:"營運設定",eyebrow:"GAME OPERATIONS",children:e.isLoading?_.jsx(or,{"data-loc":"client/src/pages/AdminPages.tsx:141"}):_.jsxs("section",{"data-loc":"client/src/pages/AdminPages.tsx:142",className:"portal-panel admin-settings-form",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:143",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:143",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminPages.tsx:143",children:"LIVE CONFIGURATION"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminPages.tsx:143",children:"會員入口與公告"})]}),_.jsx(RC,{"data-loc":"client/src/pages/AdminPages.tsx:143"})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminPages.tsx:144",className:"admin-toggle",children:[_.jsxs("span",{"data-loc":"client/src/pages/AdminPages.tsx:144",children:[_.jsx("strong",{"data-loc":"client/src/pages/AdminPages.tsx:144",children:"開放會員遊玩"}),_.jsx("small",{"data-loc":"client/src/pages/AdminPages.tsx:144",children:"關閉後,一般會員會看到維護訊息;管理員仍可進入測試。"})]}),_.jsx("input",{"data-loc":"client/src/pages/AdminPages.tsx:144",type:"checkbox",checked:t.gameEnabled,onChange:u=>s(h=>({...h,gameEnabled:u.target.checked}))})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminPages.tsx:145",className:"admin-toggle",children:[_.jsxs("span",{"data-loc":"client/src/pages/AdminPages.tsx:145",children:[_.jsx("strong",{"data-loc":"client/src/pages/AdminPages.tsx:145",children:"啟用封閉測試資格"}),_.jsx("small",{"data-loc":"client/src/pages/AdminPages.tsx:145",children:"啟用時,一般會員須兌換邀請碼或由管理員直接核發資格。"})]}),_.jsx("input",{"data-loc":"client/src/pages/AdminPages.tsx:145",type:"checkbox",checked:t.closedBetaEnabled,onChange:u=>s(h=>({...h,closedBetaEnabled:u.target.checked}))})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminPages.tsx:146",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminPages.tsx:146",children:"會員公告"}),_.jsx("textarea",{"data-loc":"client/src/pages/AdminPages.tsx:146",maxLength:500,value:t.memberAnnouncement,onChange:u=>s(h=>({...h,memberAnnouncement:u.target.value})),placeholder:"顯示在遊戲會員工具列旁的公告"})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminPages.tsx:147",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminPages.tsx:147",children:"維護訊息"}),_.jsx("textarea",{"data-loc":"client/src/pages/AdminPages.tsx:147",maxLength:500,value:t.maintenanceMessage,onChange:u=>s(h=>({...h,maintenanceMessage:u.target.value})),placeholder:"遊戲關閉時顯示給會員的說明"})]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminPages.tsx:148",className:"portal-primary",disabled:l.isPending,onClick:()=>l.mutate(t),children:[n?_.jsx(Cc,{"data-loc":"client/src/pages/AdminPages.tsx:148"}):_.jsx(vC,{"data-loc":"client/src/pages/AdminPages.tsx:148"}),n?"已儲存":l.isPending?"儲存中":"儲存設定"]})]})})}function or(){return _.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:155",className:"portal-loading",children:[_.jsx(Yo,{"data-loc":"client/src/pages/AdminPages.tsx:155"})," 載入管理資料"]})}function Ra({label:i}){return _.jsxs("div",{"data-loc":"client/src/pages/AdminPages.tsx:156",className:"portal-empty portal-empty--compact",children:[_.jsx(jr,{"data-loc":"client/src/pages/AdminPages.tsx:156"}),_.jsx("strong",{"data-loc":"client/src/pages/AdminPages.tsx:156",children:i})]})}function Hl({icon:i,label:e,value:t}){return _.jsxs("article",{"data-loc":"client/src/pages/AdminPages.tsx:157",className:"portal-stat-card",children:[_.jsx(i,{"data-loc":"client/src/pages/AdminPages.tsx:157"}),_.jsx("span",{"data-loc":"client/src/pages/AdminPages.tsx:157",children:e}),_.jsx("strong",{"data-loc":"client/src/pages/AdminPages.tsx:157",children:t})]})}const r3=[{key:"facts",label:"事實"},{key:"reasoning",label:"推理"},{key:"trust",label:"信任"},{key:"ethics",label:"倫理"},{key:"energy",label:"能量"},{key:"deadline",label:"期限"}],M0={draft_saved:"儲存草稿",published:"立即發布",restored:"版本回復",scheduled:"建立排程",scheduled_published:"排程發布"},w0=i=>new Date(i-new Date(i).getTimezoneOffset()*6e4).toISOString().slice(0,16);function a3(){const{user:i}=Zi(),e=dt.useUtils(),t=dt.admin.content.useQuery(void 0,{enabled:i?.role==="admin"}),[s,n]=C.useState(null),[a,l]=C.useState(0),[u,h]=C.useState(!1),[f,m]=C.useState(null),[p,b]=C.useState(()=>w0(Date.now()+1440*6e4)),v=()=>
442e.admin.content.invalidate(),R=dt.admin.saveContentDraft.useMutation({onSuccess:q=>{n(q.draft),h(!0),v(),window.setTimeout(()=>h(!1),1800)}}),x=dt.admin.publishContent.useMutation({onSuccess:()=>{v(),e.game.content.invalidate()}}),T=dt.admin.restoreContentVersion.useMutation({onSuccess:q=>{n(q.draft),v()}}),E=dt.admin.scheduleContentVersion.useMutation({onSuccess:()=>void v()}),A=dt.admin.cancelContentSchedule.useMutation({onSuccess:()=>void v()});if(C.useEffect(()=>{t.data&&!s&&n(t.data.draft)},[t.data,s]),C.useEffect(()=>{!f&&t.data?.history[0]&&m(t.data.history[0].id)},[t.data?.history,f]),t.isLoading||!s)return _.jsx(Wr,{"data-loc":"client/src/pages/AdminContentPage.tsx:35",title:"章節與選項",eyebrow:"GAME CONTENT STUDIO",children:_.jsx(or,{"data-loc":"client/src/pages/AdminContentPage.tsx:35"})});const D=s.stages[a]??s.stages[0],M=(t.data?.draftRevision??1)!==(t.data?.publishedRevision??1),k=t.data?.history??[],U=q=>n(re=>re&&{stages:re.stages.map((ce,ae)=>ae===a?{...ce,...q}:ce)}),N=(q,re)=>U({choices:D.choices.map((ce,ae)=>ae===q?{...ce,...re}:ce)}),H=new Date(p).getTime();return _.jsxs(Wr,{"data-loc":"client/src/pages/AdminContentPage.tsx:44",title:"章節、版本與發布",eyebrow:"GAME CONTENT STUDIO",children:[_.jsxs("section",{"data-loc":"client/src/pages/AdminContentPage.tsx:45",className:"content-studio-status",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:46",children:[_.jsx(mC,{"data-loc":"client/src/pages/AdminContentPage.tsx:46"}),_.jsxs("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:46",children:[_.jsx("small",{"data-loc":"client/src/pages/AdminContentPage.tsx:46",children:"DRAFT REVISION"}),_.jsxs("strong",{"data-loc":"client/src/pages/AdminContentPage.tsx:46",children:["草稿 v",t.data?.draftRevision]})]})]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:47",children:[_.jsx(h0,{"data-loc":"client/src/pages/AdminContentPage.tsx:47"}),_.jsxs("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:47",children:[_.jsx("small",{"data-loc":"client/src/pages/AdminContentPage.tsx:47",children:"LIVE REVISION"}),_.jsxs("strong",{"data-loc":"client/src/pages/AdminContentPage.tsx:47",children:["發布 v",t.data?.publishedRevision]})]})]}),_.jsx("p",{"data-loc":"client/src/pages/AdminContentPage.tsx:48",className:M?"is-pending":"",children:M?"有尚未發布的修改":"草稿與玩家版本一致"}),_.jsxs("button",{"data-loc":"client/src/pages/AdminContentPage.tsx:49",className:"portal-secondary",disabled:R.isPending,onClick:()=>R.mutate(s),children:[u?_.jsx(Cc,{"data-loc":"client/src/pages/AdminContentPage.tsx:49"}):_.jsx(vC,{"data-loc":"client/src/pages/AdminContentPage.tsx:49"}),u?"已儲存":"儲存草稿"]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminContentPage.tsx:50",className:"portal-primary",disabled:x.isPending||!M,onClick:()=>x.mutate(),children:[_.jsx(h0,{"data-loc":"client/src/pages/AdminContentPage.tsx:50"}),x.isPending?"發布中":"立即發布"]})]}),(R.error||x.error||T.error||E.error||A.error)&&_.jsx("p",{"data-loc":"client/src/pages/AdminContentPage.tsx:52",className:"admin-form-error",children:R.error?.message||x.error?.message||T.error?.message||E.error?.message||A.error?.message}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:54",className:"content-history-grid",children:[_.jsxs("section",{"data-loc":"client/src/pages/AdminContentPage.tsx:55",className:"portal-panel content-schedule-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:56",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:56",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminContentPage.tsx:56",children:"ONE-TIME PUBLISH JOB"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminContentPage.tsx:56",children:"版本發布排程"})]}),_.jsx(mh,{"data-loc":"client/src/pages/AdminContentPage.tsx:56"})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminContentPage.tsx:57",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:57",children:"選擇已儲存版本"}),_.jsxs("select",{"data-loc":"client/src/pages/AdminContentPage.tsx:57",value:f??"",onChange:q=>m(Number(q.target.value)),children:[_.jsx("option",{"data-loc":"client/src/pages/AdminContentPage.tsx:57",value:"",disabled:!0,children:"請先儲存草稿"}),k.filter(q=>q.eventType!=="scheduled").map(q=>_.jsxs("option",{"data-loc":"client/src/pages/AdminContentPage.tsx:57",value:q.id,children:["#",q.id," · v",q.revision," · ",M0[q.eventType]??q.eventType]},q.id))]})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminContentPage.tsx:58",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:58",children:"發布時間"}),_.jsx("input",{"data-loc":"client/src/pages/AdminContentPage.tsx:58",type:"datetime-local",min:w0(Date.now()+6e4),value:p,onChange:q=>b(q.target.value)})]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminContentPage.tsx:59",className:"portal-primary",disabled:!f||!Number.isFinite(H)||H<Date.now()+6e4||E.isPending,onClick:()=>
442f&&E.mutate({versionId:f,scheduledFor:H}),children:[_.jsx(mh,{"data-loc":"client/src/pages/AdminContentPage.tsx:59"}),E.isPending?"建立排程中":"建立獨立發布工作"]}),_.jsx("small",{"data-loc":"client/src/pages/AdminContentPage.tsx:60",children:"每個版本綁定獨立工作識別碼;發布後自動停用,重試不會重複發布。"})]}),_.jsxs("section",{"data-loc":"client/src/pages/AdminContentPage.tsx:62",className:"portal-panel content-history-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:63",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:63",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminContentPage.tsx:63",children:"AUDIT TRAIL"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminContentPage.tsx:63",children:"修改與發布歷程"})]}),_.jsx(uL,{"data-loc":"client/src/pages/AdminContentPage.tsx:63"})]}),k.length?_.jsx("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",className:"content-timeline",children:k.map(q=>_.jsxs("article",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",className:`content-event content-event--${q.eventType}`,children:M0[q.eventType]??q.eventType}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",children:[_.jsxs("strong",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",children:["v",q.revision," · ",q.note||"內容快照"]}),_.jsxs("small",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",children:[new Date(q.createdAt).toLocaleString("zh-TW")," · ",q.createdByName||"系統"]}),q.schedule&&_.jsxs("em",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",className:`schedule-status schedule-status--${q.schedule.status}`,children:[new Date(q.schedule.scheduledFor).toLocaleString("zh-TW")," · ",q.schedule.status]})]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",className:"content-timeline__actions",children:[_.jsx("button",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",title:"回復為新草稿",disabled:T.isPending,onClick:()=>window.confirm(`確定將歷程 #${q.id} 回復為新草稿?`)&&T.mutate({versionId:q.id}),children:_.jsx(Nm,{"data-loc":"client/src/pages/AdminContentPage.tsx:64"})}),q.schedule?.status==="pending"&&_.jsx("button",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",title:"取消排程",disabled:A.isPending,onClick:()=>A.mutate({scheduleId:q.schedule.id}),children:_.jsx(aL,{"data-loc":"client/src/pages/AdminContentPage.tsx:64"})}),_.jsx("button",{"data-loc":"client/src/pages/AdminContentPage.tsx:64",title:"選為排程版本",onClick:()=>m(q.id),children:_.jsx(mh,{"data-loc":"client/src/pages/AdminContentPage.tsx:64"})})]})]},q.id))}):_.jsx(Ra,{"data-loc":"client/src/pages/AdminContentPage.tsx:64",label:"儲存第一份草稿後,這裡會建立不可覆寫的版本歷程"})]})]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:68",className:"content-studio",children:[_.jsxs("aside",{"data-loc":"client/src/pages/AdminContentPage.tsx:69",className:"content-stage-list",children:[_.jsxs("p",{"data-loc":"client/src/pages/AdminContentPage.tsx:69",children:["CHAPTERS · ",s.stages.length]}),s.stages.map((q,re)=>_.jsxs("button",{"data-loc":"client/src/pages/AdminContentPage.tsx:69",className:re===a?"is-active":"",onClick:()=>l(re),children:[_.jsx("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:69",children:String(re+1).padStart(2,"0")}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:69",children:[_.jsx("small",{"data-loc":"client/src/pages/AdminContentPage.tsx:69",children:q.phase}),_.jsx("strong",{"data-loc":"client/src/pages/AdminContentPage.tsx:69",children:q.title})]})]},q.id))]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:70",className:"content-editor",children:[_.jsxs("section",{"data-loc":"client/src/pages/AdminContentPage.tsx:71",className:"portal-panel content-editor__stage",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:72",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:72",children:[_.jsxs("p",{"data-loc":"client/src/pages/AdminContentPage.tsx:72",children:["CHAPTER ",String(a+1).padStart(2,"0")," · ",D.id]}),_.jsx("h2",{"data-loc":"client/src/pages/AdminContentPage.tsx:72",children:"章節文字"})]}),_.jsx("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:72",children:D.phase})]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:73",className:"admin-form-grid admin-form-grid--3",children:[_.jsx(So,{"data-loc":"client/src/pages/AdminContentPage.tsx:73",label:"大字報標記",value:D.kicker,maxLength:40,onChange:q=>U({kicker:q})}),_.jsx(So,{"data-loc":"client/src/pages/AdminContentPage.tsx:73",label:"場景時間",value:D.time,type:"time",onChange:q=>U({time:q})}),_.jsxs("label",{"data-loc":"client/src/pages/AdminContentPage.tsx:73",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:73",children:"工作階段"}),_.jsxs("select",{"data-loc":"client/src/pages/AdminContentPage.tsx:73",value:D.phase,onChange:q=>U({phase:q.target.value}),children:[_.jsx("option",{"data-loc":"client/src/pages/AdminContentPage.tsx:73",children:"數據擷取"}),_.jsx("option",{"data-loc":"client/src/pages/AdminContentPage.tsx:73",children:"邏輯轉換"}),_.jsx("option",{"data-loc":"client/src/pages/AdminContentPage.tsx:73",children:"成果交付"})]})]})]}),_.jsx(So,{"data-loc":"client/src/pages/AdminContentPage.tsx:74",label:"章節標題",value:D.title,maxLength:80,onChange:q=>U({title:q})}),_.jsx(So,{"data-loc":"client/src/pages/AdminContentPage.tsx:74",label:"場景位置",value:D.location,maxLength:100,onChange:q=>U({location:q})}),_.jsx(So,{"data-loc":"client/src/pages/AdminContentPage.tsx:74",label:"說話者顯示名稱",value:D.speakerName,maxLength:80,onChange:q=>U({speakerName:q})}),_.jsx(rh,{"data-loc":"client/src/pages/AdminContentPage.tsx:74",label:"角色台詞",value:D.dialogue,maxLength:500,onChange:q=>U({dialogue:q})}),_.jsx(rh,{"data-loc":"client/src/pages/AdminContentPage.tsx:74",label:"任務說明",value:D.brief,maxLength:500,onChange:q=>U({brief:q})})]}),_.jsx("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",className:"content-choice-grid",children:D.choices.map((q,re)=>_.jsxs("section",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",className:`portal-panel content-choice-card content-choice-card--${q.tone}`,children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",children:[_.jsxs("p",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",children:["OPTION ",re+1," · ",q.id]}),_.jsxs("h2",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",children:["選項 ",re+1]})]}),_.jsxs("select",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",value:q.tone,onChange:ce=>N(re,{tone:ce.target.value}),children:[_.jsx("option",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",value:"careful",children:"謹慎"}),_.jsx("option",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",value:"human",children:"同理"}),_.jsx("option",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",value:"bold",children:"果斷"})]})]}),_.jsx(So,{"data-loc":"client/src/pages/AdminContentPage.tsx:76",label:"選項標題",value:q.label,maxLength:40,onChange:ce=>N(re,{label:ce})}),_.jsx(rh,{"data-loc":"client/src/pages/AdminContentPage.tsx:76",label:"選項說明",value:q.detail,maxLength:180,onChange:ce=>N(re,{detail:ce})}),_.jsx(rh,{"data-loc":"client/src/pages/AdminContentPage.tsx:76",label:"選擇後回饋",value:q.feedback,maxLength:260,onChange:ce=>N(re,{feedback:ce})}),_.jsxs("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",className:"content-effects",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",children:"能力效果(-50 至 50)"}),_.jsx("div",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",children:r3.map(ce=>_.jsxs("label",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",children:ce.label}),_.jsx("input",{"data-loc":"client/src/pages/AdminContentPage.tsx:76",type:"number",min:-50,max:50,value:q.effects[ce.key]??0,onChange:ae=>N(re,{effects:{...q.effects,[ce.key]:Number(ae.target.value)}})})]},ce.key))})]})]},q.id))})]})]})]})}
442function So({label:i,value:e,onChange:t,maxLength:s,type:n="text"}){return _.jsxs("label",{"data-loc":"client/src/pages/AdminContentPage.tsx:82",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:82",children:i}),_.jsx("input",{"data-loc":"client/src/pages/AdminContentPage.tsx:82",type:n,value:e,maxLength:s,onChange:a=>t(a.target.value)})]})}function rh({label:i,value:e,onChange:t,maxLength:s}){return _.jsxs("label",{"data-loc":"client/src/pages/AdminContentPage.tsx:83",children:[_.jsxs("span",{"data-loc":"client/src/pages/AdminContentPage.tsx:83",children:[i,_.jsxs("small",{"data-loc":"client/src/pages/AdminContentPage.tsx:83",children:[e.length,"/",s]})]}),_.jsx("textarea",{"data-loc":"client/src/pages/AdminContentPage.tsx:83",value:e,maxLength:s,onChange:n=>t(n.target.value)})]})}function o3(i){const e=String(i??"");return`"${(/^[=+\-@]/.test(e)?`'${e}`:e).replaceAll('"','""')}"`}function rp(i,e,t){const s=`\uFEFF${[e,...t].map(l=>l.map(o3).join(",")).join(`\r
443`)}`,n=URL.createObjectURL(new Blob([s],{type:"text/csv;charset=utf-8"})),a=document.createElement("a");a.href=n,a.download=i,a.click(),URL.revokeObjectURL(n)}function l3(){const{user:i}=Zi(),e=dt.useUtils(),t=i?.role==="admin",s=dt.admin.invitations.useQuery(void 0,{enabled:t}),n=dt.admin.invitationBatches.useQuery(void 0,{enabled:t}),a=dt.admin.invitationUsage.useQuery(void 0,{enabled:t}),[l,u]=C.useState("batch"),[h,f]=C.useState({label:"封閉測試邀請",maxUses:1,expiryDays:14,quantity:20}),[m,p]=C.useState(null),b=()=>Promise.all([e.admin.invitations.invalidate(),e.admin.invitationBatches.invalidate(),e.admin.invitationUsage.invalidate()]),v=dt.admin.createInvitation.useMutation({onSuccess:M=>{b(),navigator.clipboard?.writeText(M.code),p(M.code)}}),R=dt.admin.createInvitationBatch.useMutation({onSuccess:M=>{b(),rp(`${M.batch.batchKey}.csv`,["批次","用途","邀請碼","可用次數","到期日"],M.invitations.map(k=>[M.batch.batchKey,k.label,k.code,k.maxUses,k.expiresAt?new Date(k.expiresAt).toISOString():"永久"]))}}),x=dt.admin.setInvitationActive.useMutation({onSuccess:()=>void b()}),T=h.expiryDays>0?Date.now()+h.expiryDays*864e5:null,E=()=>l==="single"?v.mutate({label:h.label,maxUses:h.maxUses,expiresAt:T}):R.mutate({label:h.label,quantity:h.quantity,maxUsesEach:h.maxUses,expiresAt:T}),A=async M=>{const k=await e.client.admin.invitationBatchCodes.query({batchId:M});rp(`${k.batch.batchKey}.csv`,["批次","用途","邀請碼","已使用","可用次數","狀態","到期日"],k.invitations.map(U=>[k.batch.batchKey,U.label,U.code,U.usedCount,U.maxUses,U.isActive?"啟用":"停用",U.expiresAt?new Date(U.expiresAt).toISOString():"永久"]))},D=()=>rp("invitation-usage.csv",["兌換時間","會員","Email","邀請碼","用途","批次"],(a.data??[]).map(M=>[new Date(M.grantedAt).toISOString(),M.userName,M.userEmail,M.code,M.label,M.batchKey??"單組"]));return _.jsxs(Wr,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:54",title:"邀請碼與使用紀錄",eyebrow:"CLOSED BETA ACCESS",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:55",className:"admin-split-grid",children:[_.jsxs("section",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:56",className:"portal-panel invitation-create-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:57",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:57",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:57",children:"ISSUE INVITATIONS"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:57",children:l==="batch"?"批次建立邀請碼":"建立單組邀請碼"})]}),_.jsx(nc,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:57"})]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:58",className:"admin-segmented",children:[_.jsxs("button",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:58",className:l==="batch"?"is-active":"",onClick:()=>u("batch"),children:[_.jsx(sL,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:58"}),"批次"]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:58",className:l==="single"?"is-active":"",onClick:()=>u("single"),children:[_.jsx(nc,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:58"}),"單組"]})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:59",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:59",children:"用途標籤"}),_.jsx("input",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:59",value:h.label,maxLength:120,onChange:M=>f(k=>({...k,label:M.target.value}))})]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:60",className:"admin-form-grid admin-form-grid--3",children:[l==="batch"&&_.jsxs("label",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:61",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:61",children:"產生組數"}),_.jsx("input",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:61",type:"number",min:2,max:200,value:h.quantity,onChange:M=>f(k=>({...k,quantity:Number(M.target.value)}))}),_.jsx("small",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:61",children:"每批最多 200 組"})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:62",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:62",children:"每組可用次數"}),_.jsx("input",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:62",type:"number",min:1,max:1e3,value:h.maxUses,onChange:M=>f(k=>({...k,maxUses:Number(M.target.value)}))})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:63",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:63",children:"有效天數"}),_.jsx("input",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:63",type:"number",min:0,max:365,value:h.expiryDays,onChange:M=>f(k=>({...k,expiryDays:Number(M.target.value)}))}),_.jsx("small",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:63",children:"0 代表永久有效"})]})]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:65",className:"portal-primary",disabled:v.isPending||R.isPending||h.label.trim().length<2,onClick:E,children:[_.jsx(xC,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:65"}),v.isPending||R.isPending?"產生中":l==="batch"?"產生並下載 CSV":"產生並複製"]}),(v.error||R.error)&&_.jsx("p",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:66",className:"admin-form-error",children:v.error?.message||R.error?.message}),m&&_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:67",className:"invitation-created",children:[_.jsx(Cc,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:67"}),_.jsxs("span",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:67",children:[_.jsx("small",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:67",children:"已建ç«
443‹ä¸¦è¤‡è£½"}),_.jsx("strong",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:67",children:m})]})]})]}),_.jsxs("section",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",className:"portal-panel invitation-rules",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",children:"EXPORT & AUDIT"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",children:"匯出與稽核"})]}),_.jsx(cL,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69"})]}),_.jsxs("ol",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",children:[_.jsx("li",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",children:"批次建立後立即下載 UTF-8 CSV。"}),_.jsx("li",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",children:"每批可隨時重新匯出完整代碼。"}),_.jsx("li",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",children:"兌換紀錄保留會員、時間、代碼與批次。"}),_.jsx("li",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",children:"用量仍以資料庫交易原子扣除,避免超發。"})]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69",className:"portal-secondary",disabled:!a.data?.length,onClick:D,children:[_.jsx(d0,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:69"}),"匯出使用紀錄"]})]})]}),_.jsxs("section",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:72",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:73",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:73",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:73",children:"BATCH LEDGER"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:73",children:"邀請碼批次"})]}),_.jsxs("span",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:73",children:[n.data?.length??0," 批"]})]}),n.isLoading?_.jsx(or,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74"}):n.data?.length?_.jsx("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",className:"portal-table-wrap",children:_.jsxs("table",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",className:"portal-table",children:[_.jsx("thead",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:_.jsxs("tr",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:[_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:"批次"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:"用途"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:"代碼"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:"累計使用"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:"有效期限"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:"操作"})]})}),_.jsx("tbody",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:n.data.map(M=>_.jsxs("tr",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:[_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:_.jsx("code",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:M.batchKey})}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:M.label}),_.jsxs("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:[M.codeCount," 組 · ",M.activeCodes," 啟用"]}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:M.totalUses}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:M.expiresAt?new Date(M.expiresAt).toLocaleDateString("zh-TW"):"永久"}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",children:_.jsxs("button",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",className:"portal-row-action",onClick:()=>void A(M.id),children:[_.jsx(d0,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74"}),"CSV"]})})]},M.id))})]})}):_.jsx(Ra,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:74",label:"尚未建立邀請碼批次"})]}),_.jsxs("section",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:77",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:78",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:78",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:78",children:"INVITATION LEDGER"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:78",children:"全部邀請碼"})]}),_.jsxs("span",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:78",children:[s.data?.length??0," 組"]})]}),s.isLoading?_.jsx(or,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79"}):s.data?.length?_.jsx("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",className:"portal-table-wrap",children:_.jsxs("table",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",className:"portal-table",children:[_.jsx("thead",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:_.jsxs("tr",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:[_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:"邀請碼"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:"用途"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:"使用量"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:"期限"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:"狀態"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:"操作"})]})}),_.jsx("tbody",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:79",children:s.data.map(M=>{const k=!!(M.expiresAt&&M.expiresAt<=Date.now()),U=M.usedCount>=M.maxUses;return _.jsxs("tr",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",children:[_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",children:_.jsx("code",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",children:M.code})}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",children:M.label}),_.jsxs("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",children:[M.usedCount," / ",M.maxUses]}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",children:M.expiresAt?new Date(M.expiresAt).toLocaleDateString("zh-TW"):"永久"}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",children:_.jsx("span",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",className:`access-pill ${M.isActive&&!k&&!U?"is-active":""}`,children:M.isActive?k?"已逾期":U?"已用完":"可使用":"已停用"})}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",children:_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",className:"portal-row-actions",children:[_.jsxs("button",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",className:"portal-row-action",onClick:()=>{navigator.clipboard?.writeText(M.code),p(M.code)},children:[_.jsx(oL,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81"}),"複製"]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81",className:"portal-row-action",disabled:x.isPending,onClick:()=>x.mutate({id:M.id,isActive:!M.isActive}),children:[M.isActive?_.jsx(dL,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81"}):_.jsx(gL,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:81"}),M.isActive?"停用":"啟用"]})]})})]},M.id)})})]})}):_.jsx(Ra,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:82",label:"尚未建立邀請碼"})]}),_.jsxs("section",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:85",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:86",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:86",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:86",children:"REDEMPTION HISTORY"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:86",children:"使用紀錄"})]}),_.jsx(jm,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:86"})]}),a.isLoading?_.jsx(or,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87"}):a.data?.length?_.jsx("div",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",className:"portal-table-wrap",children:_.jsxs("table",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",className:"portal-table",children:[_.jsx("thead",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:_.jsxs("tr",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:[_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:"兌換時間"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:"會員"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:"邀請碼"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:"用途"}),_.jsx("th",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:"批次"})]})}),_.jsx("tbody",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:a.data.map(M=>_.jsxs("tr",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:[_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:new Date(M.grantedAt).toLocaleStr
443ing("zh-TW")}),_.jsxs("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:[_.jsx("strong",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:M.userName||"匿名會員"}),_.jsx("small",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:M.userEmail})]}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:_.jsx("code",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:M.code})}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:M.label}),_.jsx("td",{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",children:M.batchKey??"單組"})]},M.accessId))})]})}):_.jsx(Ra,{"data-loc":"client/src/pages/AdminInvitationsPage.tsx:87",label:"尚無邀請碼兌換紀錄"})]})]})}const P0=i=>new Date(i-new Date(i).getTimezoneOffset()*6e4).toISOString().slice(0,16);function c3(){const{user:i}=Zi(),e=dt.useUtils(),t=dt.admin.seasons.useQuery(void 0,{enabled:i?.role==="admin"}),[s,n]=C.useState({name:"首季|實習律師成長賽",startsAt:P0(Date.now()),endsAt:P0(Date.now()+30*864e5)}),[a,l]=C.useState([{fromRank:1,toRank:1,title:"首席辯護人",xpBonus:500},{fromRank:2,toRank:3,title:"卓越實務家",xpBonus:300},{fromRank:4,toRank:10,title:"賽季菁英",xpBonus:150}]),u=dt.admin.createSeason.useMutation({onSuccess:()=>void e.admin.seasons.invalidate()}),h=dt.admin.finalizeSeason.useMutation({onSuccess:()=>{e.admin.seasons.invalidate(),e.member.dashboard.invalidate(),e.member.leaderboard.invalidate()}}),f=(p,b)=>l(v=>v.map((R,x)=>x===p?{...R,...b}:R)),m=()=>u.mutate({name:s.name,startsAt:new Date(s.startsAt).getTime(),endsAt:new Date(s.endsAt).getTime(),rewards:a});return _.jsxs(Wr,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:35",title:"排行榜賽季與獎勵",eyebrow:"SEASON OPERATIONS",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:36",className:"admin-split-grid season-admin-grid",children:[_.jsxs("section",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:37",className:"portal-panel season-create-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:38",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:38",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:38",children:"CREATE SEASON"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:38",children:"建立新賽季"})]}),_.jsx(zp,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:38"})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:39",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:39",children:"賽季名稱"}),_.jsx("input",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:39",maxLength:120,value:s.name,onChange:p=>n(b=>({...b,name:p.target.value}))})]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:40",className:"admin-form-grid",children:[_.jsxs("label",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:40",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:40",children:"開始時間"}),_.jsx("input",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:40",type:"datetime-local",value:s.startsAt,onChange:p=>n(b=>({...b,startsAt:p.target.value}))})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:40",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:40",children:"結束時間"}),_.jsx("input",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:40",type:"datetime-local",value:s.endsAt,onChange:p=>n(b=>({...b,endsAt:p.target.value}))})]})]}),_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",className:"season-reward-editor",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:"名次獎勵"}),a.map((p,b)=>_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:[_.jsxs("label",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:"起始名次"}),_.jsx("input",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",type:"number",min:1,max:500,value:p.fromRank,onChange:v=>f(b,{fromRank:Number(v.target.value)})})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:"結束名次"}),_.jsx("input",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",type:"number",min:1,max:500,value:p.toRank,onChange:v=>f(b,{toRank:Number(v.target.value)})})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:"獎勵名稱"}),_.jsx("input",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",maxLength:120,value:p.title,onChange:v=>f(b,{title:v.target.value})})]}),_.jsxs("label",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:[_.jsx("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",children:"XP 加成"}),_.jsx("input",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:41",type:"number",min:0,max:1e4,value:p.xpBonus,onChange:v=>f(b,{xpBonus:Number(v.target.value)})})]})]},b))]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:42",className:"portal-secondary",onClick:()=>l(p=>[...p,{fromRank:11,toRank:20,title:"賽季參與獎",xpBonus:50}]),children:[_.jsx(xC,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:42"}),"新增獎勵層級"]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:43",className:"portal-primary",disabled:u.isPending||!s.name.trim(),onClick:m,children:[_.jsx(Hp,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:43"}
443),u.isPending?"建立中":"建立賽季"]}),u.error&&_.jsx("p",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:44",className:"admin-form-error",children:u.error.message})]}),_.jsxs("section",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:46",className:"portal-panel season-rules",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:47",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:47",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:47",children:"SCORING & REWARDS"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:47",children:"計分規則"})]}),_.jsx(Ah,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:47"})]}),_.jsxs("ol",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:48",children:[_.jsx("li",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:48",children:"週榜以 UTC 週一 00:00 起算,月榜以每月一日 00:00 起算。"}),_.jsx("li",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:48",children:"期間積分=案件分數+完成局數×20+新成就×75。"}),_.jsx("li",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:48",children:"賽季結束後由管理員結算,獎勵 XP 永久加入職涯等級。"}),_.jsx("li",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:48",children:"同一賽季與會員使用唯一鍵,重複結算不會重複發獎。"})]})]})]}),_.jsxs("section",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:52",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:53",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:53",children:[_.jsx("p",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:53",children:"SEASON LEDGER"}),_.jsx("h2",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:53",children:"賽季紀錄"})]}),_.jsx(Pn,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:53"})]}),t.isLoading?_.jsx(or,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:54"}):t.data?.length?_.jsx("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:54",className:"season-ledger",children:t.data.map(p=>{const b=Date.now(),v=p.startsAt<=b&&p.endsAt>=b,R=p.endsAt<b;return _.jsxs("article",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",className:v?"is-active":"",children:[_.jsxs("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",className:"season-ledger__header",children:[_.jsxs("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",children:[_.jsx("small",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",children:v?"ACTIVE":p.finalizedAt?"FINALIZED":R?"READY TO FINALIZE":"UPCOMING"}),_.jsx("strong",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",children:p.name})]}),p.finalizedAt?_.jsx(rL,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56"}):_.jsx(zp,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56"})]}),_.jsxs("p",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",children:[new Date(p.startsAt).toLocaleString("zh-TW")," — ",new Date(p.endsAt).toLocaleString("zh-TW")]}),_.jsx("div",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",className:"season-ledger__rewards",children:p.rewards.map((x,T)=>_.jsxs("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",children:["#",x.fromRank,x.toRank!==x.fromRank?`–${x.toRank}`:""," ",x.title," · +",x.xpBonus," XP"]},T))}),_.jsxs("footer",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",children:[_.jsxs("span",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",children:["已發 ",p.grantedCount," 人 · ",p.totalXp," XP"]}),_.jsxs("button",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56",className:"portal-row-action",disabled:!R||!!p.finalizedAt||h.isPending,onClick:()=>h.mutate({seasonId:p.id}),children:[_.jsx(Ah,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:56"}),p.finalizedAt?"已結算":R?"結算並發獎":"賽季進行中"]})]})]},p.id)})}):_.jsx(Ra,{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:57",label:"尚未建立排行榜賽季"}),h.error&&_.jsx("p",{"data-loc":"client/src/pages/AdminSeasonsPage.tsx:58",className:"admin-form-error",children:h.error.message})]})]})}const u3=typeof WeakRef<"u";class h3{constructor(e,t=!1,s,n){this.initialize(e,t,s,n)}initialize(e,t=!1,s,n){return this.mask=e,this.skipNextObservers=t,this.target=s,this.currentTarget=n,this}}class d3{constructor(e,t,s=null){this.callback=e,this.mask=t,this.scope=s,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(e=!1){this._remove&&this._remove(e)}}class xe{static FromPromise(e,t){const s=new xe;return e.then(n=>{s.notifyObservers(n)}).catch(n=>{if(t)t.notifyObservers(n);else throw n}),s}get observers(){return this._observers}constructor(e,t=!1){this.notifyIfTriggered=t,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new h3(0),e&&(this._onObserverAdded=e)}add(e,t=-1,s=!1,n=null,a=!1){if(!e)return null;const l=new d3(e,t,n);l.unregisterOnNextCall=a,s?this._observers.unshift(l):this._observers.push(l),this._onObserverAdded&&this._onObserverAdded(l),this._hasNotified&&this.notifyIfTriggered&&this.notifyObserver(l,this._lastNotifiedValue);const u=u3?new WeakRef(this):{deref:()=>this};return l._remove=(h=!1)=>{const f=u.deref();f&&(h?f.remove(l):f._remove(l))},l}addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e?(e._remove=null,this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1):!1}removeCallback(e,t){for(let s=0;s<this._observers.length;s++){const n=this._observers[s];if(!n._willBeUnregistered&&n.callback===e&&(!t||t===n.scope))return this._deferUnregister(n),!0}return!1}_deferUnregister(e){e._willBeUnregistered||(this._numObserversMarkedAsDeleted++,e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0))}_remove(e,t=!0){if(!e)return!1;const s=this._observers.indexOf(e);return s!==-1?(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(s,1),!0):!1}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,t=-1,s,n,a){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;const l=this._eventState;l.mask=t,l.target=s,l.currentTarget=n,l.skipNextObservers=!1,l.lastReturnValue=e,l.userInfo=a;for(const u of this._observers)if(!u._willBeUnregistered&&(u.mask&t&&(u.unregisterOnNextCall&&this._deferUnregister(u),u.scope?l.lastReturnValue=u.callback.apply(u.scope,[e,l]):l.lastReturnValue=u.callback(e,l)),l.skipNextObservers))return!1;return!0}notifyObserver(e,t,s=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;const n=this._eventState;n.mask=s,n.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,n)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){for(;this._observers.length;){const e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){const e=new xe;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(const t of this._observers)if(t.mask&e||t.mask===e)return!0;return!1}}class f3{get wrapU(){return this._cachedWrapU}set wrapU(e){this._cachedWrapU=e}get wrapV(){return this._cachedWrapV}set wrapV(e){this._cachedWrapV=e}get wrapR(){return this._cachedWrapR}set wrapR(e){this._cachedWrapR=e}get anisotropicFilteringLevel(){return this._cachedAnisotropicFilteringLevel}set anisotropicFilteringLevel(e){this._cachedAnisotropicFilteringLevel=e}get comparisonFunction(){return this._comparisonFunction}set comparisonFunction(e){this._comparisonFunction=e}get useMipMaps(){return this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}constructor(){this.samplingMode=-1,this._useMipMaps=!0,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._comparisonFunction=0}setParameters(e=1,t=1,s=1,n=1,a=2,l=0){return this._cachedWrapU=e,this._cachedWrapV=t,this._cachedWrapR=s,this._cachedAnisotropicFilteringLevel=n,this.samplingMode=a,this._comparisonFunction=l,this}compareSampler(e){return this._cachedWrapU===e._cachedWrapU&&this._cachedWrapV===e._cachedWrapV&&this._cachedWrapR===e._cachedWrapR&&this._cachedAnisotropicFilteringLevel===e._cachedAnisotropicFilteringLevel&&this.samplingMode===e.samplingMode&&this._comparisonFunction===e._comparisonFunction&&this._useMipMaps===e._useMipMaps}}var O0;(function(i){i[i.Unknown=0]="Unknown",i[i.Url=1]="Url",i[i.Temp=2]="Temp",i[i.Raw=3]="Raw",i[i.Dynamic=4]="Dynamic",i[i.RenderTarget=5]="RenderTarget",i[i.MultiRenderTarget=6]="MultiRenderTarget",i[i.Cube=7]="Cube",i[i.CubeRaw=8]="CubeRaw",i[i.CubePrefiltered=9]="CubePrefiltered",i[i.Raw3D=10]="Raw3D",i[i.Raw2DArray=11]="Raw2DArray",i[i.DepthStencil=12]="DepthStencil",i[i.CubeRawRGBD=13]="CubeRawRGBD",i[i.Depth=14]="Depth",i[i.Exter
vendor: 12,499 bytes, line 443
443nal=15]="External"})(O0||(O0={}));class ai extends f3{get useMipMaps(){return this._useMipMaps===null?this.generateMipMaps:this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}get uniqueId(){return this._uniqueId}_setUniqueId(e){this._uniqueId=e}getEngine(){return this._engine}get source(){return this._source}constructor(e,t,s=!1){super(),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.generateMipMaps=!1,this._useMipMaps=null,this.mipLevelCount=1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new xe,this.onErrorObservable=new xe,this.onRebuildCallback=null,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=0,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._cachedCoordinatesMode=null,this._isDisabled=!1,this._compression=null,this._sphericalPolynomial=null,this._sphericalPolynomialPromise=null,this._sphericalPolynomialComputed=!1,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._useSRGBBuffer=!1,this._creationFlags=0,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._hardwareTexture=null,this._maxLodLevel=null,this._references=1,this._gammaSpace=null,this._premulAlpha=!1,this._dynamicTextureSource=null,this._autoMSAAManagement=!1,this._engine=e,this._source=t,this._uniqueId=ai._Counter++,s||(this._hardwareTexture=e._createHardwareTexture())}incrementReferences(){this._references++}updateSize(e,t,s=1){this._engine.updateTextureDimensions(this,e,t,s),this.width=e,this.height=t,this.depth=s,this.baseWidth=e,this.baseHeight=t,this.baseDepth=s,this._size=e*t*s}_rebuild(){if(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this.onRebuildCallback){const t=this.onRebuildCallback(this),s=n=>{n._swapAndDie(this,!1),this.isReady=t.isReady};t.isAsync?t.proxy.then(s):s(t.proxy);return}let e;switch(this.source){case 2:break;case 1:e=this._engine.createTexture(this._originalUrl??this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,t=>{t._swapAndDie(this,!1),this.isReady=!0},null,this._buffer,void 0,this.format,this._extension,void 0,void 0,void 0,this._useSRGBBuffer);return;case 3:if(e=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this._useSRGBBuffer,this.mipLevelCount),e._swapAndDie(this,!1),this._bufferViewArray)for(let t=0;t<this._bufferViewArray.length;t++){const s=this._bufferViewArray[t];s&&this._engine.updateRawTexture(this,s,this.format,this.invertY,this._compression,this.type,this._useSRGBBuffer,t)}this.isReady=!0;break;case 10:e=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 11:if(e=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this.mipLevelCount),e._swapAndDie(this,!1),this._bufferViewArray)for(let t=0;t<this._bufferViewArray.length;t++){const s=this._bufferViewArray[t];s&&this._engine.updateRawTexture2DArray(this,s,this.format,this.invertY,this._compression,this.type,t)}this.isReady=!0;break;case 4:e=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode),e._swapAndDie(this,!1),this._dynamicTextureSource&&this._engine.updateDynamicTexture(this,this._dynamicTextureSource,this.invertY,this._premulAlpha,this.format,!0);break;case 7:e=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,()=>{e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension,!1,0,0,null,void 0,this._useSRGBBuffer,ArrayBuffer.isView(this._buffer)?this._buffer:null);return;case 8:e=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,this._originalFormat??this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),e._swapAndDie(this,!1),this.isReady=!0;break;case 13:return;case 9:e=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,t=>{t&&t._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension),e._sphericalPolynomial=this._sphericalPolynomial;return}}_swapAndDie(e,t=!0){this._hardwareTexture?.setUsage(e._source,this.generateMipMaps,this.is2DArray,this.isCube,this.is3D,this.width,this.height,this.depth),e._hardwareTexture=this._hardwareTexture,e._setUniqueId(ai._Counter++),t&&(e._isRGBD=this._isRGBD),this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);const s=this._engine.getLoadedTexturesCache();let n=s.indexOf(this);n!==-1&&s.splice(n,1),n=s.indexOf(e),n===-1&&s.push(e)}dispose(){this._references--,this._references===0&&(this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._engine._releaseTexture(this),this._hardwareTexture=null,this._dynamicTextureSource=null)}}ai._Counter=0;class pt{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}pt.Instances=[];pt.OnEnginesDisposedObservable=new xe;pt._LastCreatedScene=null;pt.UseFallbackTexture=!0;pt.FallbackTexture="";class Re{static _CheckLimit(e,t){let s=Re._LogLimitOutputs[e];return s?s.current++:(s={limit:t,current:1},Re._LogLimitOutputs[e]=s),s.current<=s.limit}static _GenerateLimitMessage(e,t=1){const s=Re._LogLimitOutputs[e];if(!s||!Re.MessageLimitReached)return;const n=this._Levels[t];s.current===s.limit&&Re[n.name](Re.MessageLimitReached.replace(/%LIMIT%/g,""+s.limit).replace(/%TYPE%/g,n.name??""))}static _AddLogEntry(e){Re._LogCache=e+Re._LogCache,Re.OnNewCacheEntry&&Re.OnNewCacheEntry(e)}static _FormatMessage(e){const t=n=>n<10?"0"+n:""+n,s=new Date;return"["+t(s.getHours())+":"+t(s.getMinutes())+":"+t(s.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,t,s){const n=Array.isArray(t)?t[0]:t;if(s!==void 0&&!Re._CheckLimit(n,s))return;const a=Re._FormatMessage(n),l=this._Levels[e],u=Array.isArray(t)?t.slice(1):[];l.logFunc&&l.logFunc("BJS - "+a,...u);const h=`<div style='color:${l.color}'>${a}</div><br>`;Re._AddLogEntry(h),Re._GenerateLimitMessage(n,e)}static get LogCache(){return Re._LogCache}static ClearLogCache(){Re._LogCache="",Re._LogLimitOutputs={},Re.errorsCount=0}static set LogLevels(e){Re.Log=Re._LogDisabled,Re.Warn=Re._LogDisabled,Re.Error=Re._LogDisabled;const t=[Re.MessageLogLevel,Re.WarningLogLevel,Re.ErrorLogLevel];for(const s of t)if((e&s)===s){const n=this._Levels[s];Re[n.name]=Re._LogEnabled.bind(Re,s)}}}Re.NoneLogLevel=0;Re.MessageLogLevel=1;Re.WarningLogLevel=2;Re.ErrorLogLevel=4;Re.AllLogLevel=7;Re.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";Re._LogCache="";Re._LogLimitOutputs={};Re._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}];Re.errorsCount=0;Re.Log=Re._LogEnabled.bind(Re,Re.MessageLogLevel);Re.Warn=Re._LogEnabled.bind(Re,Re.WarningLogLevel);Re.Error=Re._LogEnabled.bind(Re,Re.ErrorLogLevel);class _s{static GetShadersRepository(e=0){return e===0?_s.ShadersRepository:_s.ShadersRepositoryWGSL}static GetShadersStore(e=0){return e===0?_s.ShadersStore:_s.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){return e===0?_s.IncludesShadersStore:_s.IncludesShadersStoreWGSL}}_s.ShadersRepository="src/Shaders/";_s.ShadersStore={};_s.IncludesShadersStore={};_s.ShadersRepositoryWGSL="src/ShadersWGSL/";_s.ShadersStoreWGSL={};_s.IncludesShadersStoreWGSL={};function Bs(){return typeof window<"u"}function Ao(){return typeof navigator<"u"}function Ta(){return typeof document<"u"}function V1(i){let e="",t=i.firstChild;for(;t;)t.nodeType===3&&(e+=t.textContent),t=t.nextSibling;return e}class _3{constructor(){this._valueCache={},this.vertexCompilationError=null,this.fragmentCompilationError=null,this.programLinkError=null,this.programValidationError=null,this._isDisposed=!1}get isAsync(){return this.isParallelCompiled}get isReady(){return this.program?this.isParallelCompiled?this.engine._isRenderingStateCompiled(this):!0:!1}_handlesSpectorRebuildCallback(e){e&&this.program&&e(this.program)}setEngine(e){this.engine=e}_fillEffectInformation(e,t,s,n,a,l,u,h){const f=this.engine;if(f.supportsUniformBuffers)for(const b in t)e.bindUniformBlock(b,t[b]);this.engine.getUniforms(this,s).forEach((b,v)=>{n[s[v]]=b}),this._uniforms=n;let p;for(p=0;p<a.length;p++)e.getUniform(a[p])==null&&(a.splice(p,1),p--);a.forEach((b,v)=>{l[b]=v});for(const b of f.getAttributes(this,u))h.push(b)}dispose(){this._uniforms={},this._isDisposed=!0}_cacheMatrix(e,t){const s=this._valueCache[e],n=t.updateFlag;return s!==void 0&&s===n?!1:(this._valueCache[e]=n,!0)}_cacheFloat2(e,t,s){let n=this._valueCache[e];if(!n||n.length!==2)return n=[t,s],this._valueCache[e]=n,!0;let a=!1;return n[0]!==t&&(n[0]=t,a=!0),n[1]!==s&&(n[1]=s,a=!0),a}_cacheFloat3(e,t,s,n){let a=this._valueCache[e];if(!a||a.length!==3)return a=[t,s,n],this._valueCache[e]=a,!0;let l=!1;return a[0]!==t&&(a[0]=t,l=!0),a[1]!==s&&(a[1]=s,l=!0),a[2]!==n&&(a[2]=n,l=!0),l}_cacheFloat4(e,t,s,n,a){let l=this._valueCache[e];if(!l||l.length!==4)return l=[t,s,n,a],this._valueCache[e]=l,!0;let u=!1;return l[0]!==t&&(l[0]=t,u=!0),l[1]!==s&&(l[1]=s,u=!0),l[2]!==n&&(l[2]=n,u=!0),l[3]!==a&&(l[3]=a,u=!0),u}setInt(e,t){const s=this._valueCache[e];s!==void 0&&s===t||this.engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setInt2(e,t,s){this._cacheFloat2(e,t,s)&&(this.engine.setInt2(this._uniforms[e],t,s)||(this._valueCache[e]=null))}setInt3(e,t,s,n){this._cacheFloat3(e,t,s,n)&&(this.engine.setInt3(this._uniforms[e],t,s,n)||(this._valueCache[e]=null))}setInt4(e,t,s,n,a){this._cacheFloat4(e,t,s,n,a)&&(this.engine.setInt4(this._uniforms[e],t,s,n,a)||(this._valueCache[e]=null))}setIntArray(e,t){this._valueCache[e]=null,this.engine.setIntArray(this._uniforms[e],t)}setIntArray2(e,t){this._valueCache[e]=null,this.engine.setIntArray2(this._uniforms[e],t)}setIntArray3(e,t){this._valueCache[e]=null,this.engine.setIntArray3(this._uniforms[e],t)}setIntArray4(e,t){this._valueCache[e]=null,this.engine.setIntArray4(this._uniforms[e],t)}setUInt(e,t){const s=this._valueCache[e];s!==void 0&&s===t||this.engine.setUInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setUInt2(e,t,s){this._cacheFloat2(e,t,s)&&(this.engine.setUInt2(this._uniforms[e],t,s)||(this._valueCache[e]=null))}setUInt3(e,t,s,n){this._cacheFloat3(e,t,s,n)&&(this.engine.setUInt3(this._uniforms[e],t,s,n)||(this._valueCache[e]=null))}setUInt4(e,t,s,n,a){this._cacheFloat4(e,t,s,n,a)&&(this.engine.setUInt4(this._uniforms[e],t,s,n,a)||(this._valueCache[e]=null))}setUIntArray(e,t){this._valueCache[e]=null,this.engine.setUIntArray(this._uniforms[e],t)}setUIntArray2(e,t){this._valueCache[e]=null,this.engine.setUIntArray2(this._uniforms[e],t)}setUIntArray3(e,t){this._valueCache[e]=null,this.engine.setUIntArray3(this._uniforms[e],t)}setUIntArray4(e,t){this._valueCache[e]=null,this.engine.setUIntArray4(this._uniforms[e],t)}setArray(e,t){this._valueCache[e]=null,this.engine.setArray(this._uniforms[e],t)}setArray2(e,t){this._valueCache[e]=null,this.engine.setArray2(this._uniforms[e],t)}setArray3(e,t){this._valueCache[e]=null,this.engine.setArray3(this._uniforms[e],t)}setArray4(e,t){this._valueCache[e]=null,this.engine.setArray4(this._uniforms[e],t)}setMatrices(e,t){t&&(this._valueCache[e]=null,this.engine.setMatr
443ices(this._uniforms[e],t))}setMatrix(e,t){this._cacheMatrix(e,t)&&(this.engine.setMatrices(this._uniforms[e],t.asArray())||(this._valueCache[e]=null))}setMatrix3x3(e,t){this._valueCache[e]=null,this.engine.setMatrix3x3(this._uniforms[e],t)}setMatrix2x2(e,t){this._valueCache[e]=null,this.engine.setMatrix2x2(this._uniforms[e],t)}setFloat(e,t){const s=this._valueCache[e];s!==void 0&&s===t||this.engine.setFloat(this._uniforms[e],t)&&(this._valueCache[e]=t)}setVector2(e,t){this._cacheFloat2(e,t.x,t.y)&&(this.engine.setFloat2(this._uniforms[e],t.x,t.y)||(this._valueCache[e]=null))}setFloat2(e,t,s){this._cacheFloat2(e,t,s)&&(this.engine.setFloat2(this._uniforms[e],t,s)||(this._valueCache[e]=null))}setVector3(e,t){this._cacheFloat3(e,t.x,t.y,t.z)&&(this.engine.setFloat3(this._uniforms[e],t.x,t.y,t.z)||(this._valueCache[e]=null))}setFloat3(e,t,s,n){this._cacheFloat3(e,t,s,n)&&(this.engine.setFloat3(this._uniforms[e],t,s,n)||(this._valueCache[e]=null))}setVector4(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setQuaternion(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setFloat4(e,t,s,n,a){this._cacheFloat4(e,t,s,n,a)&&(this.engine.setFloat4(this._uniforms[e],t,s,n,a)||(this._valueCache[e]=null))}setColor3(e,t){this._cacheFloat3(e,t.r,t.g,t.b)&&(this.engine.setFloat3(this._uniforms[e],t.r,t.g,t.b)||(this._valueCache[e]=null))}setColor4(e,t,s){this._cacheFloat4(e,t.r,t.g,t.b,s)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,s)||(this._valueCache[e]=null))}setDirectColor4(e,t){this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a)||(this._valueCache[e]=null))}_getVertexShaderCode(){return this.vertexShader?this.engine._getShaderSource(this.vertexShader):null}_getFragmentShaderCode(){return this.fragmentShader?this.engine._getShaderSource(this.fragmentShader):null}}const D0={};function bt(i,e=!1){if(!(e&&D0[i]))return D0[i]=!0,`${i} needs to be imported before as it contains a side-effect required by your code.`}const I0={};let p3=!1,m3=0;function tt(i,e,t=!1){const s=function(){if((t||p3)&&m3===0){const n=`${i}.${e}`;I0[n]||(I0[n]=!0,console.warn(`[Babylon.js] ${n}() requires a side-effect import. See: https://doc.babylonjs.com/setup/treeshaking`))}};return s.__isSideEffectStub=!0,s}function g3(i){return i?!i.__isSideEffectStub:!1}function Jt(i,e){return{get(){},set(t){Object.defineProperty(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0}}const xa={};function X1(i,e,t=""){return t+(e?e+`
444`:"")+i}function q1(i,e,t,s,n,a,l){const u=l||xa.loadFile;if(!u)throw bt("FileTools");return u(i,e,t,s,n,a)}function W1(i,e,t,s){if(i){e?i.IS_NDC_HALF_ZRANGE="":delete i.IS_NDC_HALF_ZRANGE,t?i.USE_REVERSE_DEPTHBUFFER="":delete i.USE_REVERSE_DEPTHBUFFER,s?i.USE_EXACT_SRGB_CONVERSIONS="":delete i.USE_EXACT_SRGB_CONVERSIONS;return}else{let n="";return e&&(n+="#define IS_NDC_HALF_ZRANGE"),t&&(n&&(n+=`
445`),n+="#define USE_REVERSE_DEPTHBUFFER"),s&&(n&&(n+=`
446`),n+="#define USE_EXACT_SRGB_CONVERSIONS"),n}}function y3(i,e,t=!1,s){switch(i){case 3:return new Int8Array(e);case 0:return new Uint8Array(e);case 4:return typeof e!="number"?new Int16Array(e):new Int16Array(t?e/2:e);case 5:case 8:case 9:case 10:case 2:return typeof e!="number"?new Uint16Array(e):new Uint16Array(t?e/2:e);case 6:return typeof e!="number"?new Int32Array(e):new Int32Array(t?e/4:e);case 7:case 11:case 12:case 13:case 14:case 15:return typeof e!="number"?new Uint32Array(e):new Uint32Array(t?e/4:e);case 1:return typeof e!="number"?new Float32Array(e):new Float32Array(t?e/4:e)}return new Uint8Array(e)}const Wp=new WeakMap,b3={_webGLVersion:2,cachedPipelines:{}};function yi(i){let e=Wp.get(i);if(!e){if(!i)return b3;e={_webGLVersion:i.TEXTURE_BINDING_3D?2:1,_context:i,parallelShaderCompile:i.getExtension("KHR_parallel_shader_compile")||void 0,cachedPipelines:{}},Wp.set(i,e)}return e}function ap(i){Wp.delete(i)}function Y1(i,e,t,s,n,a){const l=yi(s);a||(a=l._createShaderProgramInjection??tg);const u=Yp(e,"vertex",s,l._contextWasLost),h=Yp(t,"fragment",s,l._contextWasLost);return a(i,u,h,s,n,l.validateShaderPrograms)}function K1(i,e,t,s,n,a=null,l){const u=yi(n);l||(l=u._createShaderProgramInjection??tg);const h=u._webGLVersion>1?`#version 300 es
447#define WEBGL2 
448`:"",f=F0(e,"vertex",s,h,n,u._contextWasLost),m=F0(t,"fragment",s,h,n,u._contextWasLost);return l(i,f,m,n,a,u.validateShaderPrograms)}function x3(i,e){const t=new _3,s=yi(i);return s.parallelShaderCompile&&!s.disableParallelShaderCompile&&(t.isParallelCompiled=!0),t.context=s._context,t}function tg(i,e,t,s,n=null,a){const l=s.createProgram();if(i.program=l,!l)throw new Error("Unable to create program");return s.attachShader(l,e),s.attachShader(l,t),s.linkProgram(l),i.context=s,i.vertexShader=e,i.fragmentShader=t,i.isParallelCompiled||sg(i,s,a),l}function v3(i,e,t){const s=i;if(s._isDisposed)return!1;const n=yi(e);return n&&n.parallelShaderCompile&&n.parallelShaderCompile.COMPLETION_STATUS_KHR&&s.program&&e.getProgramParameter(s.program,n.parallelShaderCompile.COMPLETION_STATUS_KHR
vendor: 39,471 bytes, lines 448-460
448)?(sg(s,e,t),!0):!1}function sg(i,e,t){const s=i.context,n=i.vertexShader,a=i.fragmentShader,l=i.program;if(!s.getProgramParameter(l,s.LINK_STATUS)){if(!e.getShaderParameter(n,e.COMPILE_STATUS)){const f=e.getShaderInfoLog(n);if(f)throw i.vertexCompilationError=f,new Error("VERTEX SHADER "+f)}if(!e.getShaderParameter(a,e.COMPILE_STATUS)){const f=e.getShaderInfoLog(a);if(f)throw i.fragmentCompilationError=f,new Error("FRAGMENT SHADER "+f)}const h=s.getProgramInfoLog(l);if(h)throw i.programLinkError=h,new Error(h)}if(t&&(s.validateProgram(l),!s.getProgramParameter(l,s.VALIDATE_STATUS))){const f=s.getProgramInfoLog(l);if(f)throw i.programValidationError=f,new Error(f)}s.deleteShader(n),s.deleteShader(a),i.vertexShader=void 0,i.fragmentShader=void 0,i.onCompiled&&(i.onCompiled(),i.onCompiled=void 0)}function R3(i,e,t,s,n,a,l,u,h,f="",m,p,b){const v=yi(i.context);p||(p=v.createRawShaderProgramInjection??Y1),b||(b=v.createShaderProgramInjection??K1);const R=i;s?R.program=p(R,e,t,R.context,h):R.program=b(R,e,t,u,R.context,h),R.program.__SPECTOR_rebuildProgram=l,m()}function F0(i,e,t,s,n,a){return Yp(X1(i,t,s),e,n,a)}function Yp(i,e,t,s){const n=t.createShader(e==="vertex"?t.VERTEX_SHADER:t.FRAGMENT_SHADER);if(!n){let a=t.NO_ERROR,l;for(;(l=t.getError())!==t.NO_ERROR;)a=l;throw new Error(`Something went wrong while creating a gl ${e} shader object. gl error=${a}, gl isContextLost=${t.isContextLost()}, _contextWasLost=${s}`)}return t.shaderSource(n,i),t.compileShader(n),n}function T3(i,e){e.useProgram(i)}function E3(i,e){const t=i;if(!t.isParallelCompiled){e(i);return}const s=t.onCompiled;t.onCompiled=()=>{s?.(),e(i)}}const S3="attribute",C3="varying";class Pc{constructor(){this.children=[]}isValid(e){return!0}process(e,t,s){let n="";if(this.line){let a=this.line;const l=t.processor;if(l){l.lineProcessor&&(a=l.lineProcessor(a,t.isFragment,t.processingContext));const u=t.processor?.attributeKeywordName??S3,h=t.isFragment&&t.processor?.varyingFragmentKeywordName?t.processor?.varyingFragmentKeywordName:!t.isFragment&&t.processor?.varyingVertexKeywordName?t.processor?.varyingVertexKeywordName:C3;!t.isFragment&&l.attributeProcessor&&this.line.startsWith(u)?a=l.attributeProcessor(this.line,e,t.processingContext):l.varyingProcessor&&(l.varyingCheck?.(this.line,t.isFragment)||!l.varyingCheck&&this.line.startsWith(h))?a=l.varyingProcessor(this.line,t.isFragment,e,t.processingContext):l.uniformProcessor&&l.uniformRegexp&&l.uniformRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(a=l.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):l.uniformBufferProcessor&&l.uniformBufferRegexp&&l.uniformBufferRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(a=l.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0):l.textureProcessor&&l.textureRegexp&&l.textureRegexp.test(this.line)?a=l.textureProcessor(this.line,t.isFragment,e,t.processingContext):(l.uniformProcessor||l.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer&&(/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?l.uniformProcessor&&(a=l.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):l.uniformBufferProcessor&&(a=l.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)),t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,l.endOfUniformBufferProcessor&&(a=l.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}n+=a+`
449`}for(const a of this.children)n+=a.process(e,t,s);return this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true",s[this.additionalDefineKey]=e[this.additionalDefineKey]),n}}class A3{constructor(){this._lines=[]}get currentLine(){return this._lines[this.lineIndex]}get canRead(){return this.lineIndex<this._lines.length-1}set lines(e){this._lines.length=0;for(const t of e){if(!t||t==="\r")continue;if(t[0]==="#"){this._lines.push(t);continue}const s=t.trim();if(!s)continue;if(s.startsWith("//")){this._lines.push(t);continue}const n=s.indexOf(";");if(n===-1)this._lines.push(s);else if(n===s.length-1)s.length>1&&this._lines.push(s);else{const a=t.split(";");for(let l=0;l<a.length;l++){let u=a[l];u&&(u=u.trim(),u&&this._lines.push(u+(l!==a.length-1?";":"")))}}}}}class op extends Pc{process(e,t,s){for(let n=0;n<this.children.length;n++){const a=this.children[n];if(a.isValid(e))return a.process(e,t,s)}return""}}class M3 extends Pc{isValid(e){return this.testExpression.isTrue(e)}}class Zt{isTrue(e){return!0}static postfixToInfix(e){const t=[];for(const s of e)if(Zt._OperatorPriority[s]===void 0)t.push(s);else{const n=t[t.length-1],a=t[t.length-2];t.length-=2,t.push(`(${a}${s}${n})`)}return t[t.length-1]}static infixToPostfix(e){const t=Zt._InfixToPostfixCache.get(e);if(t)return t.accessTime=Date.now(),t.result;if(!e.includes("&&")&&!e.includes("||")&&!e.includes(")")&&!e.includes("("))return[e];const s=[];let n=-1;const a=()=>{m=m.trim(),m!==""&&(s.push(m),m="")},l=p=>{n<Zt._Stack.length-1&&(Zt._Stack[++n]=p)},u=()=>Zt._Stack[n],h=()=>n===-1?"!!INVALID EXPRESSION!!":Zt._Stack[n--];let f=0,m="";for(;f<e.length;){const p=e.charAt(f),b=f<e.length-1?e.substring(f,2+f):"";if(p==="(")m="",l(p);else if(p===")"){for(a();n!==-1&&u()!=="(";)s.push(h());h()}else if(Zt._OperatorPriority[b]>1){for(a();n!==-1&&Zt._OperatorPriority[u()]>=Zt._OperatorPriority[b];)s.push(h());l(b),f++}else m+=p;f++}for(a();n!==-1;)u()==="("?h():s.push(h());return Zt._InfixToPostfixCache.size>=Zt.InfixToPostfixCacheLimitSize&&Zt.ClearCache(),Zt._InfixToPostfixCache.set(e,{result:s,accessTime:Date.now()}),s}static ClearCache(){const e=Array.from(Zt._InfixToPostfixCache.entries()).sort((t,s)=>t[1].accessTime-s[1].accessTime);for(let t=0;t<Zt.InfixToPostfixCacheCleanupSize;t++)Zt._InfixToPostfixCache.delete(e[t][0])}}Zt.InfixToPostfixCacheLimitSize=5e4;Zt.InfixToPostfixCacheCleanupSize=25e3;Zt._InfixToPostfixCache=new Map;Zt._OperatorPriority={")":0,"(":1,"||":2,"&&":3};Zt._Stack=["","","","","","","","","","","","","","","","","","","",""];class Oh extends Zt{constructor(e,t=!1){super(),this.define=e,this.not=t}isTrue(e){let t=e[this.define]!==void 0;return this.not&&(t=!t),t}}class w3 extends Zt{isTrue(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)}}class P3 extends Zt{isTrue(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)}}class O3 extends Zt{constructor(e,t,s){super(),this.define=e,this.operand=t,this.testValue=s}toString(){return`${this.define} ${this.operand} ${this.testValue}`}isTrue(e){let t=!1;const s=parseInt(e[this.define]!=null?e[this.define]:this.define),n=parseInt(e[this.testValue]!=null?e[this.testValue]:this.testValue);if(isNaN(s)||isNaN(n))return!1;switch(this.operand){case">":t=s>n;break;case"<":t=s<n;break;case"<=":t=s<=n;break;case">=":t=s>=n;break;case"==":t=s===n;break;case"!=":t=s!==n;break}return t}}const D3=/defined\s*?\((.+?)\)/g,lp=/defined\s*?\[(.+?)\]/g,I3=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g,F3=/__decl__/,k0=/light\{X\}.(\w*)/g,L0=/\{X\}/g,ah=[],k3=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;function L3(i){i.processor&&i.processor.initializeShaders&&i.processor.initializeShaders(i.processingContext)}function B0(i,e,t,s){e.processor?.preProcessShaderCode&&(i=e.processor.preProcessShaderCode(i,e.isFragment)),Zp(i,e,n=>{e.processCodeAfterIncludes&&(n=e.processCodeAfterIncludes(e.isFragment?"fragment":"vertex",n,e.defines));const a=z3(n,e,s);t(a,n)})}function B3(i,e,t){return!t.processor||!t.processor.finalizeShaders?{vertexCode:i,fragmentCode:e}:t.processor.finalizeShaders(i,e,t.processingContext)}function N3(i,e){if(e.processor?.noPrecision)return i;const t=e.shouldUseHighPrecisionShader;return i.indexOf("precision highp float")===-1?t?i=`precision highp float;
450`+i:i=`precision mediump float;
451`+i:t||(i=i.replace("precision highp float","precision mediump float")),i}function cp(i){const t=/defined\((.+)\)/.exec(i);if(t&&t.length)return new Oh(t[1].trim(),i[0]==="!");const s=["==","!=",">=","<=","<",">"];let n="",a=0;for(n of s)if(a=i.indexOf(n),a>-1)break;if(a===-1)return new Oh(i);const l=i.substring(0,a).trim(),u=i.substring(a+n.length).trim();return new O3(l,n,u)}function U3(i){i=i.replace(D3,"defined[$1]");const e=Zt.infixToPostfix(i),t=[];for(const n of e)if(n!=="||"&&n!=="&&")t.push(n);else if(t.length>=2){let a=t[t.length-1],l=t[t.length-2];t.length-=2;const u=n=="&&"?new P3:new w3;typeof a=="string"&&(a=a.replace(lp,"defined($1)")),typeof l=="string"&&(l=l.replace(lp,"defined($1)")),u.leftOperand=typeof l=="string"?cp(l):l,u.rightOperand=typeof a=="string"?cp(a):a,t.push(u)}let s=t[t.length-1];return typeof s=="string"&&(s=s.replace(lp,"defined($1)")),typeof s=="string"?cp(s):s}function bh(i,e){const t=new M3,s=i.substring(0,e);let n=i.substring(e);return n=n.substring(0,(n.indexOf("//")+1||n.length+1)-1).trim(),s==="#ifdef"?t.testExpression=new Oh(n):s==="#ifndef"?t.testExpression=new Oh(n,!0):t.testExpression=U3(n),t}function up(i,e,t,s){let n;for(;Kp(i,t);){n=i.currentLine;const a=n.substring(0,5).toLowerCase();if(a==="#else"){const l=new Pc;e.children.push(l),Kp(i,l);return}else if(a==="#elif"){const l=bh(n,5);e.children.push(l),t=l}}}function Kp(i,e,t){for(;i.canRead;){i.lineIndex++;const s=i.currentLine;if(s.indexOf("#")>=0){const a=k3.exec(s);if(a&&a.length){switch(a[0]){case"#ifdef":{const u=new op;e.children.push(u);const h=bh(s,6);u.children.push(h),up(i,u,h);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{const u=new op;e.children.push(u);const h=bh(s,7);u.children.push(h),up(i,u,h);break}case"#if":{const u=new op,h=bh(s,3);e.children.push(u),u.children.push(h),up(i,u,h);break}}continue}}const n=new Pc;if(n.line=s,e.children.push(n),s[0]==="#"&&s[1]==="d"){const a=s.replace(";","").split(" ");n.additionalDefineKey=a[1],a.length===3&&(n.additionalDefineValue=a[2])}}return!1}function j3(i,e,t,s){const n=new Pc,a=new A3;return a.lineIndex=-1,a.lines=i.split(`
452`),Kp(a,n),n.process(e,t,s)}function G3(i,e){const t=i.defines,s={};for(const n of t){const l=n.replace("#define","").replace(";","").trim().split(" ");s[l[0]]=l.length>1?l[1]:""}return i.processor?.shaderLanguage===0&&(s.GL_ES="true"),s.__VERSION__=i.version,s[i.platformName]="true",W1(s,e?.isNDCHalfZRange,e?.useReverseDepthBuffer,e?.useExactSrgbConversions),s}function z3(i,e,t){let s=N3(i,e);if(!e.processor||e.processor.shaderLanguage===0&&s.indexOf("#version 3")!==-1&&(s=s.replace("#version 300 es",""),!e.processor.parseGLES3))return s;const n=e.defines,a=G3(e,t);e.processor.preProcessor&&(s=e.processor.preProcessor(s,n,a,e.isFragment,e.processingContext));const l={};return s=j3(s,a,e,l),e.processor.postProcessor&&(s=e.processor.postProcessor(s,n,e.isFragment,e.processingContext,t?{drawBuffersExtensionDisabled:!t.getCaps().drawBuffersExtension}:{},a,l)),t?._features.needShaderCodeInlining&&(s=t.inlineShaderCode(s)),s}function Zp(i,e,t){ah.length=0;let s;for(;(s=I3.exec(i))!==null;)ah.push(s);let n=[i],a=!1;for(const u of ah){let h=u[1];if(h.indexOf("__decl__")!==-1&&(h=h.replace(F3,""),e.supportsUniformBuffers&&(h=h.replace("Vertex","Ubo").replace("Fragment","Ubo")),h=h+"Declaration"),e.includesShadersStore[h]){let f=e.includesShadersStore[h];if(u[2]){const p=u[3].split(",");for(let b=0;b<p.length;b+=2){const v=new RegExp(p[b],"g"),R=p[b+1];f=f.replace(v,R)}}if(u[4]){const p=u[5];if(p.indexOf("..")!==-1){const b=p.split(".."),v=parseInt(b[0]);let R=parseInt(b[1]),x=f.slice(0);f="",isNaN(R)&&(R=e.indexParameters[b[1]]);for(let T=v;T<R;T++)e.supportsUniformBuffers||(x=x.replace(k0,(E,A)=>A+"{X}")),f+=x.replace(L0,T.toString())+`
453`}else e.supportsUniformBuffers||(f=f.replace(k0,(b,v)=>v+"{X}")),f=f.replace(L0,p)}const m=[];for(const p of n){const b=p.split(u[0]);for(let v=0;v<b.length-1;v++)m.push(b[v]),m.push(f);m.push(b[b.length-1])}n=m,a=a||f.indexOf("#include<")>=0||f.indexOf("#include <")>=0}else{const f=e.shadersRepository+"ShadersInclude/"+h+".fx";Z1.loadFile(f,m=>{e.includesShadersStore[h]=m,Zp(n.join(""),e,t)});return}}ah.length=0;const l=n.join("");a?Zp(l.toString(),e,t):t(l)}const Z1={loadFile:(i,e,t,s,n,a)=>{throw bt("FileTools")}};function H3(i,e){return yi(e).cachedPipelines[i]}function Q1(i){const e=i._name,t=i.context;if(e&&t){const s=yi(t);s.cachedPipelines[e]?.dispose(),delete s.cachedPipelines[e]}}function V3(i,e,t,s,n,a,l){let u,h;const f=Bs()?a?.getHostDocument():null;typeof e=="string"?u=e:typeof e.vertexSource=="string"?u="source:"+e.vertexSource:typeof e.vertexElement=="string"?u=f?.getElementById(e.vertexElement)||e.vertexElement:u=e.vertex||e,typeof e=="string"?h=e:typeof e.fragmentSource=="string"?h="source:"+e.fragmentSource:typeof e.fragmentElement=="string"?h=f?.getElementById(e.fragmentElement)||e.fragmentElement:h=e.fragment||e;const m=[void 0,void 0],p=()=>{if(m[0]&&m[1]){const[b,v]=m;L3(i),B0(b,i,(R,x)=>{l&&(l._vertexSourceCodeBeforeMigration=x),t&&(R=t("vertex",R)),i.isFragment=!0,B0(v,i,(T,E)=>{l&&(l._fragmentSourceCodeBeforeMigration=E),t&&(T=t("fragment",T));const A=B3(R,T,i);i=null;const D=X3(A.vertexCode,A.fragmentCode,e,n);s?.(D.vertexSourceCode,D.fragmentSourceCode)},a)},a)}};N0(u,"Vertex","",b=>{l&&(l._rawVertexSourceCode=b),m[0]=b,p()},n),N0(h,"Fragment","Pixel",b=>{l&&(l._rawFragmentSourceCode=b),m[1]=b,p()},n)}function N0(i,e,t,s,n,a){if(typeof HTMLElement<"u"&&i instanceof HTMLElement){const h=V1(i);s(h);return}if(i.substring(0,7)==="source:"){s(i.substring(7));return}if(i.substring(0,7)==="base64:"){const h=window.atob(i.substring(7));s(h);return}const l=_s.GetShadersStore(n);if(l[i+e+"Shader"]){s(l[i+e+"Shader"]);return}if(t&&l[i+t+"Shader"]){s(l[i+t+"Shader"]);return}let u;if(i[0]==="."||i[0]==="/"||i.indexOf("http")>-1?u=i:u=_s.GetShadersRepository(n)+i,a=a||q1,!a)throw new Error("loadFileInjection is not defined");a(u+"."+e.toLowerCase()+".fx",s)}function X3(i,e,t,s){if(t){const n=t.vertexElement||t.vertex||t.spectorName||t,a=t.fragmentElement||t.fragment||t.spectorName||t;return{vertexSourceCode:(s===1?"//":"")+"#define SHADER_NAME vertex:"+n+`
454`+i,fragmentSourceCode:(s===1?"//":"")+"#define SHADER_NAME fragment:"+a+`
455`+e}}else return{vertexSourceCode:i,fragmentSourceCode:e}}const q3=(i,e,t,s)=>{try{const n=i.context?yi(i.context):null;n&&(n.disableParallelShaderCompile=i.disableParallelCompilation);const a=i.existingPipelineContext||e(i.shaderProcessingContext);return a._name=i.name,i.name&&n&&(n.cachedPipelines[i.name]=a),t(a,i.vertex,i.fragment,!!i.createAsRaw,"","",i.rebuildRebind,i.defines,i.transformFeedbackVaryings,"",()=>{s(a,()=>{i.onRenderingStateCompiled?.(a)})}),a}catch(n){throw Re.Error("Error compiling effect"),n}};let oh=[];class Vs{static SetImmediate(e){oh.length===0&&setTimeout(()=>{const t=oh;oh=[];for(const s of t)s()},1),oh.push(e)}}function U0(i,e,t){try{if(i())return e(),!0}catch(s){return t?.(s),!0}return!1}const ig=(i,e,t,s=16,n=3e4,a=!0,l)=>{if(a&&U0(i,e,t))return null;const u=setInterval(()=>{U0(i,e,t)?clearInterval(u):(n-=s,n<0&&(clearInterval(u),t?.(new Error("Operation timed out after maximum retries. "+(l||"")),!0)))},s);return()=>clearInterval(u)};class fs{static get ShadersRepository(){return _s.ShadersRepository}static set ShadersRepository(e){_s.ShadersRepository=e}get isDisposed(){return this._isDisposed}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new xe),this._onBindObservable}get shaderLanguage(){return this._shaderLanguage}constructor(e,t,s,n=null,a,l=null,u=null,h=null,f=null,m,p="",b=0,v){this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new xe,this.onErrorObservable=new xe,this._onBindObservable=null,this._isDisposed=!1,this._refCount=1,this._bonesComputationForcedToCPU=!1,this._uniformBuffersNames={},this._multiTarget=!1,this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._disableParallelShaderCompilation=!1,this._pipelineContext=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeBeforeMigration="",this._fragmentSourceCodeBeforeMigration="",this._rawVertexSourceCode="",this._rawFragmentSourceCode="",this._processCodeAfterIncludes=void 0,this._processFinalCode=null,this._onReleaseEffectsObserver=null,this.name=e,this._key=p;const R=this._key.replace(/\r/g,"").replace(/\n/g,"|");let x;if(t.attributes){const T=t;if(this._engine=s,this._attributesNames=T.attributes,this._uniformsNames=T.uniformsNames.concat(T.samplers),this._samplerList=T.samplers.slice(),this.defines=T.defines,this.onError=T.onError,this.onCompiled=T.onCompiled,this._fallbacks=T.fallbacks,this._indexParameters=T.indexParameters,this._transformFeedbackVaryings=T.transformFeedbackVaryings||null,this._multiTarget=!!T.multiTarget,this._shaderLanguage=T.shaderLanguage??0,this._disableParallelShaderCompilation=!!T.disableParallelShaderCompilation,T.uniformBuffersNames){this._uniformBuffersNamesList=T.uniformBuffersNames.slice();for(let E=0;E<T.uniformBuffersNames.length;E++)this._uniformBuffersNames[T.uniformBuffersNames[E]]=E}this._processFinalCode=T.processFinalCode??null,this._processCodeAfterIncludes=T.processCodeAfterIncludes??void 0,v=T.extraInitializationsAsync,x=T.existingPipelineContext}else this._engine=a,this.defines=l??"",this._uniformsNames=s.concat(n),this._samplerList=n?n.slice():[],this._attributesNames=t,this._uniformBuffersNamesList=[],this._shaderLanguage=b,this.onError=f,this.onCompiled=h,this._indexParameters=m,this._fallbacks=u;this._engine.shaderPlatformName==="WEBGL2"&&(x=H3(R,this._engine._gl)??x),this._attributeLocationByName={},this.uniqueId=fs._UniqueIdSeed++,x?(this._pipelineContext=x,this._pipelineContext.setEngine(this._engine),this._onRenderingStateCompiled(this._pipelineContext),this._pipelineContext.program&&(this._pipelineContext.program.__SPECTOR_rebuildProgram=this._rebuildProgram.bind(this))):this._processShaderCodeAsync(null,!1,null,v).catch(T=>{const E=T?.message??String(T),A=new Error(`Effect async shader preparation failed for "${String(this.name)}": ${E}`);T&&typeof T.stack=="string"&&(A.stack=`${A.message}
456Caused by: ${T.stack}`),this._processCompilationErrors(A)}),this._onReleaseEffectsObserver=this._engine.onReleaseEffectsObservable.addOnce(()=>{this._onReleaseEffectsObserver=null,!this.isDisposed&&this.dispose(!0)})}async _processShaderCodeAsync(e=null,t=!1,s=null,n){n&&await n(),this._processingContext=s||this._engine._getShaderProcessingContext(this._shaderLanguage,!1);const a={defines:this.defines.split(`
457`),indexParameters:this._indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:e??this._engine._getShaderProcessor(this._shaderLanguage),supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:_s.GetShadersRepository(this._shaderLanguage),includesShadersStore:_s.GetIncludesShadersStore(this._shaderLanguage),version:(this._engine.version*100).toString(),platformName:this._engine.shaderPlatformName,processingContext:this._processingContext,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:this._processCodeAfterIncludes};V3(a,this.name,this._processFinalCode,(l,u)=>{this._vertexSourceCode=l,this._fragmentSourceCode=u,this._prepareEffect(t)},this._shaderLanguage,this._engine,this)}get key(){return this._key}isReady(){try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){return this._engine.isDisposed||this._isReady?!0:this._pipelineContext?this._pipelineContext.isReady:!1}getEngine(){return this._engine}getPipelineContext(){return this._pipelineContext}getAttributesNames(){return this._attributesNames}getAttributeLocation(e){return this._attributes[e]}getAttributeLocationByName(e){return this._attributeLocationByName[e]}getAttributesCount(){return this._attributes.length}getUniformIndex(e){return this._uniformsNames.indexOf(e)}getUniform(e){return this._uniforms[e]}getSamplers(){return this._samplerList}getUniformNames(){return this._uniformsNames}getUniformBuffersNames(){return this._uniformBuffersNamesList}getIndexParameters(){return this._indexParameters}getCompilationError(){return this._compilationError}allFallbacksProcessed(){return this._allFallbacksProcessed}async whenCompiledAsync(){return await new Promise(e=>{this.executeWhenCompiled(e)})}executeWhenCompiled(e){if(this.isReady()){e(this);return}this.onCompileObservable.add(t=>{e(t)}),(!this._pipelineContext||this._pipelineContext.isAsync)&&this._checkIsReady(null)}_checkIsReady(e){ig(()=>this._isReadyInternal()||this._isDisposed,()=>{},t=>{this._processCompilationErrors(t,e)},16,12e4,!0,` - Effect: ${typeof this.name=="string"?this.name:this.key}`)}get vertexSourceCode(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:this._pipelineContext?._getVertexShaderCode()??this._vertexSourceCode}get fragmentSourceCode(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:this._pipelineContext?._getFragmentShaderCode()??this._fragmentSourceCode}get vertexSourceCodeBeforeMigration(){return this._vertexSourceCodeBeforeMigration}get fragmentSourceCodeBeforeMigration(){return this._fragmentSourceCodeBeforeMigration}get rawVertexSourceCode(){return this._rawVertexSourceCode}get rawFragmentSourceCode(){return this._rawFragmentSourceCode}getPipelineGenerationOptions(){return{platformName:this._engine.shaderPlatformName,shaderLanguage:this._shaderLanguage,shaderNameOrContent:this.name,key:this._key,defines:this.defines.split(`
458`),addGlobalDefines:!1,extendedProcessingOptions:{indexParameters:this._indexParameters,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,supportsUniformBuffers:this._engine.supportsUniformBuffers},extendedCreatePipelineOptions:{transformFeedbackVaryings:this._transformFeedbackVaryings,createAsRaw:!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride)}}}_rebuildProgram(e,t,s,n){this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=(a,l)=>{n&&n(l)},this.onCompiled=()=>{const a=this.getEngine().scenes;if(a)for(let l=0;l<a.length;l++)a[l].markAllMaterialsAsDirty(127);this._pipelineContext._handlesSpectorRebuildCallback?.(s)},this._fallbacks=null,this._prepareEffect()}_onRenderingStateCompiled(e){if(this._pipelineContext=e,this._pipelineContext.setEngine(this._engine),this._attributes=[],this._pipelineContext._fillEffectInformation(this,this._uniformBuffersNames,this._uniformsNames,this._uniforms,this._samplerList,this._samplers,this._attributesNames,this._attributes),this._attributesNames)for(let t=0;t<this._attributesNames.length;t++){const s=this._attributesNames[t];this._attributeLocationByName[s]=this._attributes[t]}this._engine.bindSamplers(this),this._compilationError="",this._isReady=!0,this.onCompiled&&this.onCompiled(this),this.onCompileObservable.notifyObservers(this),this.onCompileObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh(),fs.AutomaticallyClearCodeCache&&this.clearCodeCache()}_prepareEffect(e=!1){const t=this._pipelineContext;this._isReady=!1;try{const s=!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride),n=s?null:this.defines,a=s?this._vertexSourceCodeOverride:this._vertexSourceCode,l=s?this._fragmentSourceCodeOverride:this._fragmentSourceCode,u=this._engine;this._pipelineContext=q3({existingPipelineContext:e?t:null,vertex:a,fragment:l,context:u.shaderPlatformName==="WEBGL2"||u.shaderPlatformName==="WEBGL1"?u._gl:void 0,rebuildRebind:(h,f,m,p)=>this._rebuildProgram(h,f,m,p),defines:n,transformFeedbackVaryings:this._transformFeedbackVaryings,name:this._key.replace(/\r/g,"").replace(/\n/g,"|"),createAsRaw:s,disableParallelCompilation:this._disableParallelShaderCompilation,shaderProcessingContext:this._processingContext,onRenderingStateCompiled:h=>{t&&!e&&this._engine._deletePipelineContext(t),h&&this._onRenderingStateCompiled(h)}},this._engine.createPipelineContext.bind(this._engine),this._engine._preparePipelineContextAsync.bind(this._engine),this._engine._executeWhenRenderingStateIsCompiled.bind(this._engine)),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(s){this._processCompilationErrors(s,t)}}_getShaderCodeAndErrorLine(e,t,s){const n=s?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/;let a=null;if(t&&e){const l=t.match(n);if(l&&l.length===2){const u=parseInt(l[1]),h=e.split(`
459`,-1);h.length>=u&&(a=`Offending line [${u}] in ${s?"fragment":"vertex"} code: ${h[u-1]}`)}}return[e,a]}_processCompilationErrors(e,t=null){this._compilationError=typeof e?.stack=="string"?e.stack:e?.message??String(e);const s=this._attributesNames,n=this._fallbacks;if(Re.Error("Unable to compile effect:"),Re.Error(`Uniforms: ${this._uniformsNames.join(" ")}`),Re.Error(`Attributes: ${s.join(" ")}`),Re.Error(`Defines:
460`+this.defines),fs.LogShaderCodeOnCompilationError){let l=null,u=null,h;this._pipelineContext?._getVertexShaderCode()&&([h,l]=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1),h&&(Re.Error("Vertex code:"),Re.Error(h))),this._pipelineContext?._getFragmentShaderCode()&&([h,u]=this._getShaderCodeAndErrorLine(this._pipelineContext?._getFragmentShaderCode(),this._compilationError,!0),h&&(Re.Error("Fragment code:"),Re.Error(h))),l&&Re.Error(l),u&&Re.Error(u)}Re.Error("Error: "+this._compilationError);const a=()=>{this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this),this._engine.onEffectErrorObservable.notifyObservers({effect:this,errors:this._compilationError})};t&&(this._pipelineContext=t,this._isReady=!0,a()),n?(this._pipelineContext=null,n.hasMoreFallbacks?(this._allFallbacksProcessed=!1,Re.Error("Trying next fallback."),this.defines=n.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,a(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,t||a())}get isSupported(){return this._compilationError===""}_bindTexture(e,t){this._engine._bindTexture(this._samplers[e],t,e)}setTexture(e,t){this._engine.setTexture(this._samplers[e],this._uniforms[e],t,e)}setTextureArray(e,t){const s=e+"Ex";if(this._samplerList.indexOf(s+"0")===-1){const n=this._samplerList.indexOf(e);for(let l=1;l<t.length;l++){const u=s+(l-1).toString();this._samplerList.splice(n+l,0,u)}let a=0;for(const l of this._samplerList)this._samplers[l]=a,a+=1}this._engine.setTextureArray(this._samplers[e],this._uniforms[e],t,e)}bindUniformBuffer(e,t){const s=this._uniformBuffersNames[t];s===void 0||fs._BaseCache[s]===e&&this._engine._features.useUBOBindingCache||(fs._BaseCache[s]=e,this._engine.bindUniformBufferBase(e,s,t))}bindUniformBlock(e,t){this._engine.bindUniformBlock(this._pipelineContext,e,t)}setInt(e,t){return this._pipelineContext.setInt(e,t),this}setInt2(e,t,s){return this._pipelineContext.setInt2(e,t,s),this}setInt3(e,t,s,n){return this._pipelineContext.setInt3(e,t,s,n),this}setInt4(e,t,s,n,a){return this._pipelineContext.setInt4(e,t,s,n,a),this}setIntArray(e,t){return this._pipelineContext.setIntArray(e,t),this}setIntArray2(e,t){return this._pipelineContext.setIntArray2(e,t),this}setIntArray3(e,t){return this._pipelineContext.setIntArray3(e,t),this}setIntArray4(e,t){return this._pipelineContext.setIntArray4(e,t),this}setUInt(e,t){return this._pipelineContext.setUInt(e,t),this}setUInt2(e,t,s){return this._pipelineContext.setUInt2(e,t,s),this}setUInt3(e,t,s,n){return this._pipelineContext.setUInt3(e,t,s,n),this}setUInt4(e,t,s,n,a){return this._pipelineContext.setUInt4(e,t,s,n,a),this}setUIntArray(e,t){return this._pipelineContext.setUIntArray(e,t),this}setUIntArray2(e,t){return this._pipelineContext.setUIntArray2(e,t),this}setUIntArray3(e,t){return this._pipelineContext.setUIntArray3(e,t),this}setUIntArray4(e,t){return this._pipelineContext.setUIntArray4(e,t),this}setFloatArray(e,t){return this._pipelineContext.setArray(e,t),this}setFloatArray2(e,t){return this._pipelineContext.setArray2(e,t),this}setFloatArray3(e,t){return this._pipelineContext.setArray3(e,t),this}setFloatArray4(e,t){return this._pipelineContext.setArray4(e,t),this}setArray(e,t){return this._pipelineContext.setArray(e,t),this}setArray2(e,t){return this._pipelineContext.setArray2(e,t),this}setArray3(e,t){return this._pipelineContext.setArray3(e,t),this}setArray4(e,t){return this._pipelineContext.setArray4(e,t),this}setMatrices(e,t){return this._pipelineContext.setMatrices(e,t),this}setMatrix(e,t){return this._pipelineContext.setMatrix(e,t),this}setMatrix3x3(e,t){return this._pipelineContext.setMatrix3x3(e,t),this}setMatrix2x2(e,t){return this._pipelineContext.setMatrix2x2(e,t),this}setFloat(e,t){return this._pipelineContext.setFloat(e,t),this}setBool(e,t){return this._pipelineContext.setInt(e,t?1:0),this}setVector2(e,t){return this._pipelineContext.setVector2(e,t),this}setFloat2(e,t,s){return this._pipelineContext.setFloat2(e,t,s),this}setVector3(e,t){return this._pipelineContext.setVector3(e,t),this}setFloat3(e,t,s,n){return this._pipelineContext.setFloat3(e,t,s,n),this}setVector4(e,t){return this._pipelineContext.setVector4(e,t),this}setQuaternion(e,t){return this._pipelineContext.setQuaternion(e,t),this}setFloat4(e,t,s,n,a){return this._pipelineContext.setFloat4(e,t,s,n,a),this}setColor3(e,t){return this._pipelineContext.setColor3(e,t),this}setColor4(e,t,s){return this._pipelineContext.setColor4(e,t,s),this}setDirectColor4(e,t){return this._pipelineContext.setDirectColor4(e,t),this}clearCodeCache(){this._vertexSourceCode="",this._fragmentSourceCode="",this._fragmentSourceCodeBeforeMigration="",this._vertexSourceCodeBeforeMigration=""}dispose(e=!1){if(e)this._refCount=0;else{if(fs.PersistentMode)return;this._refCount--}this._refCount>0||this._isDisposed||(this._onReleaseEffectsObserver&&(this._engine.onReleaseEffectsObservable.remove(this._onReleaseEffectsObserver),this._onReleaseEffectsObserver=null),this._pipelineContext&&Q1(this._pipelineContext),this._engine._releaseEffect(this),this.clearCodeCache(),this._isDisposed=!0)}static RegisterShader(e,t,s,n=0){t&&(_s.GetShadersStore(n)[`${e}PixelShader`]=t),s&&(_s.GetShadersStore(n)[`${e}VertexShader`]=s)}static ResetCache(){fs._BaseCache={}}}fs.LogShaderCodeOnCompilationError=!0;fs.PersistentMode=!1;fs.AutomaticallyClearCodeCache=!1;fs._UniqueIdSeed=0;fs._BaseCache={};fs.ShadersStore=_s.ShadersStore;fs.IncludesShadersStore=_s.IncludesShadersStore;class As{static SetMatrixPrecision(e){if(As.MatrixTrackPrecisionChange=!1,e&&!As.MatrixUse64Bits&&As.MatrixTrackedMatrices)for(let t=0;t<As.MatrixTrackedMatrices.length;++t){const s=As.MatrixTrackedMatrices[t],n=s._m;s._m=new Array(16);for(let a=0;a<16;++a)s._m[a]=n[a]}As.MatrixUse64Bits=e,As.MatrixCurrentType=As.MatrixUse64Bits?Array:Float32Array,As.MatrixTrackedMatrices=null}}As.MatrixUse64Bits=!1;As.MatrixTrackPrecisionChange=!0;As.MatrixCurrentType=Float32Array;As.MatrixTrackedMatrices=[];class lr{static get Now(){return Bs()&&window.performance&&window.performance.now?window.performance.now():Date.now()}}class W3{constructor(e=!0){this._isDepthTestDirty=!1,this._isDepthMaskDirty=!1,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!1,this._isFrontFaceDirty=!1,e&&this.reset()}get isDirty(){return this._isDepthFuncDirty||this._isDepthTestDirty||this._isDepthMaskDirty||this._isCullFaceDirty||this._isCullDirty||this._isZOffsetDirty||this._isFrontFaceDirty}get zOffset(){return this._zOffset}set zOffset(e){this._zOffset!==e&&(this._zOffset=e,this._isZOffsetDirty=!0)}get zOffsetUnits(){return this._zOffsetUnits}set zOffsetUnits(e){this._zOffsetUnits!==e&&(this._zOffsetUnits=e,this._isZOffsetDirty=!0)}get cullFace(){return this._cullFace}set cullFace(e){this._cullFace!==e&&(this._cullFace=e,this._isCullFaceDirty=!0)}get cull(){return this._cull}set cull(e){this._cull!==e&&(this._cull=e,this._isCullDirty=!0)}get depthFunc(){return this._depthFunc}set depthFunc(e){this._depthFunc!==e&&(this._depthFunc=e,this._isDepthFuncDirty=!0)}get depthMask(){return this._depthMask}set depthMask(e){this._depthMask!==e&&(this._depthMask=e,this._isDepthMaskDirty=!0)}get depthTest(){return this._depthTest}set depthTest(e){this._depthTest!==e&&(this._depthTest=e,this._isDepthTestDirty=!0)}get frontFace(){return this._frontFace}set frontFace(e){this._frontFace!==e&&(this._frontFace=e,this._isFrontFaceDirty=!0)}reset(){this._depthMask=!0,this._depthTest=!0,this._depthFunc=null,this._cullFace=null,this._cull=null,this._zOffset=0,this._zOffsetUnits=0,this._frontFace=null,this._isDepthTestDirty=!0,this._isDepthMaskDirty=!0,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!0,this._isFrontFaceDirty=!1}apply(e){this.isDirty&&(this._isCullDirty&&(this.cull?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this._isCullDirty=!1),this._isCullFaceDirty&&(e.cullFace(this.cullFace),this._isCullFaceDirty=!1),this._isDepthMaskDirty&&(e.depthMask(this.depthMask),this._isDepthMaskDirty=!1),this._isDepthTestDirty&&(this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this._isDepthTestDirty=!1),this._isDepthFuncDirty&&(e.depthFunc(this.depthFunc),this._isDepthFuncDirty=!1),this._isZOffsetDirty&&(this.zOffset||this.zOffsetUnits?(e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(this.zOffset,this.zOffsetUnits)):e.disable(e.POLYGON_OFFSET_FILL),this._isZOffsetDirty=!1),this._isFrontFaceDirty&&(e.frontFace(this.frontFace),this._isFrontFaceDirty=!1))}}class Y3{get isDirty(){return this._isStencilTestDirty||this._isStencilMaskDirty||this._isStencilFuncDirty||this._isStencilOpDirty}get func(){return this._func}set func(e){this._func!==e&&(this._func=e,this._isStencilFuncDirty=!0)}get backFunc(){return this._func}set backFunc(e){this._backFunc!==e&&(this._backFunc=e,this._isStencilFuncDirty=!0)}get funcRef(){return this._funcRef}set funcRef(e){this._funcRef!==e&&(this._funcRef=e,this._isStencilFuncDirty=!0)}get funcMask(){return this._funcMask}set funcMask(e){this._funcMask!==e&&(this._funcMask=e,this._isStencilFuncDirty=!0)}get opStencilFail(){return this._opStencilFail}set opStencilFail(e){this._opStencilFail!==e&&(this._opStencilFail=e,this._isStencilOpDirty=!0)}get opDepthFail(){return this._opDepthFail}set opDepthFail(e){this._opDepthFail!==e&&(this._opDepthFail=e,this._isStencilOpDirty=!0)}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(e){this._opStencilDepthPass!==e&&(this._opStencilDepthPass=e,this._isStencilOpDirty=!0)}get backOpStencilFail(){return this._backOpStencilFail}set backOpStencilFail(e){this._backOpStencilFail!==e&&(this._backOpStencilFail=e,this._isStencilOpDirty=!0)}get backOpDepthFail(){return this._backOpDepthFail}set backOpDepthFail(e){this._backOpDepthFail!==e&&(this._backOpDepthFail=e,this._isStencilOpDirty=!0)}get backOpStencilDepthPass(){return this._backOpStencilDepthPass}set backOpStencilDepthPass(e){this._backOpStencilDepthPass!==e&&(this._backOpStencilDepthPass=e,this._isStencilOpDirty=!0)}get mask(){return this._mask}set mask(e){this._mask!==e&&(this._mask=e,this._isStencilMaskDirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._isStencilTestDirty=!0)}constructor(e=!0){this._isStencilTestDirty=!1,this._isStencilMaskDirty=!1,this._isStencilFuncDirty=!1,this._isStencilOpDirty=!1,this.useStencilGlobalOnly=!1,e&&this.reset()}reset(){this.stencilMaterial=void 0,this.stencilGlobal?.reset(),this._isStencilTestDirty=!0,this._isStencilMaskDirty=!0,this._isStencilFuncDirty=!0,this._isStencilOpDirty=!0}apply(e){if(!e)return;const t=!this.useStencilGlobalOnly&&!!this.stencilMaterial?.enabled;this.enabled=t?this.stencilMaterial.enabled:this.stencilGlobal.enabled,this.func=t?this.stencilMaterial.func:this.stencilGlobal.func,this.backFunc=t?this.stencilMaterial.backFunc:this.stencilGlobal.backFunc,this.funcRef=t?this.stencilMaterial.funcRef:this.stencilGlobal.funcRef,this.funcMask=t?this.stencilMaterial.funcMask:this.stencilGlobal.funcMask,this.opStencilFail=t?this.stencilMaterial.opStencilFail:this.stencilGlobal.opStencilFail,this.opDepthFail=t?this.stencilMaterial.opDepthFail:this.stencilGlobal.opDepthFail,this.opStencilDepthPass=t?this.stencilMaterial.opStencilDepthPass:this.stencilGlobal.opStencilDepthPass,this.backOpStencilFail=t?this.stencilMaterial.backOpStencilFail:this.stencilGlobal.backOpStencilFail,this.backOpDepthFail=t?this.stencilMaterial.backOpDepthFail:this.stencilGlobal.backOpDepthFail,this.backOpStencilDepthPass=t?this.stencilMaterial.backOpStencilDepthPass:this.stencilGlobal.backOpStencilDepthPass,this.mask=t?this.stencilMaterial.mask:this.stencilGlobal.mask,this.isDirty&&(this._isStencilTestDirty&&(this.enabled?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this._isStencilTestDirty=!1),this._isStencilMaskDirty&&(e.stencilMask(this.mask),this._isStencilMaskDirty=!1),this._isStencilFuncDirty&&(e.stencilFuncSeparate(e.FRONT,this.func,this.funcRef,this.funcMask),e.stencilFuncSeparate(e.BACK,this.backFunc,this.funcRef,this.funcMask),this._isStencilFuncDirty=!1),this._isStencilOpDirty&&(e.stencilOpSeparate(e.FRONT,this.opStencilFail,this.opDepthFail,this.opStencilDepthPass),e.stencilOpSeparate(e.BACK,this.backOpStencilFail,this.backOpDepthFail,this.backOpStencilDepthPass),this._isStencilOpDirty=!1))}}class Oi{constructor(){this.reset()}reset(){this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=Oi.ALWAYS,this.opStencilFail=Oi.KEEP,this.opDepthFail=Oi.KEEP,this.opStencilDepthPass=Oi.REPLACE,this.backFunc=Oi.ALWAYS,this.backOpStencilFail=Oi.KEEP,this.backOpDepthFail=Oi.KEEP,this.backOpStencilDepthPass=Oi.REPLACE}get stencilFunc(){return this.func}set stencilFunc(e){this.func=e}get stencilBackFunc(){return this.backFunc}set stencilBackFunc(e){this.backFunc=e}get stencilFuncRef(){return this.funcRef}set stencilFuncRef(e){this.funcRef=e}get stencilFuncMask(){return this.funcMask}set stencilFuncMask(e){this.funcMask=e}get stencilOpStencilFail(){return this.opStencilFail}set stencilOpStencilFail(e){this.opStencilFail=e}get stencilOpDepthFail(){return this.opDepthFail}set stencilOpDepthFail(e){this.opDepthFail=e}get stencilOpStencilDepthPass(){return this.opStencilDepthPass}set stencilOpStencilDepthPass(e){this.opStencilDepthPass=e}get stencilBackOpStencilFail(){return this.backOpStencilFail}set stencilBackOpStencilFail(e){this.backOpStencilFail=e}get stencilBackOpDepthFail(){return this.backOpDepthFail}set stencilBackOpDepthFail(e){this.backOpDepthFail=e}get stencilBackOpStencilDepthPass(){return this.backOpStencilDepthPass}set stencilBackOpStencilDepthPass(e){this.backOpStencilDepthPass=e}get stencilMask(){return this.mask}set stencilMask(e){this.mask=e}get stencilTest(){return this.enabled}set stencilTest(e){this.enabled=e}}Oi.ALWAYS=519;Oi.KEEP=7680;Oi.REPLACE=7681;class $1{constructor(e){this._supportBlendParametersPerTarget=e,this._blendFunctionParameters=new Array(32),this._blendEquationParameters=new Array(16),this._blendConstants=new Array(4),this._isBlendConstantsDirt
460y=!1,this._alphaBlend=Array(8).fill(!1),this._numTargetEnabled=0,this._isAlphaBlendDirty=!1,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this.reset()}get isDirty(){return this._isAlphaBlendDirty||this._isBlendFunctionParametersDirty||this._isBlendEquationParametersDirty}get alphaBlend(){return this._numTargetEnabled>0}set alphaBlend(e){this.setAlphaBlend(e)}setAlphaBlend(e,t=0){this._alphaBlend[t]!==e&&(e?this._numTargetEnabled++:this._numTargetEnabled--,this._alphaBlend[t]=e,this._isAlphaBlendDirty=!0)}setAlphaBlendConstants(e,t,s,n){this._blendConstants[0]===e&&this._blendConstants[1]===t&&this._blendConstants[2]===s&&this._blendConstants[3]===n||(this._blendConstants[0]=e,this._blendConstants[1]=t,this._blendConstants[2]=s,this._blendConstants[3]=n,this._isBlendConstantsDirty=!0)}setAlphaBlendFunctionParameters(e,t,s,n,a=0){const l=a*4;this._blendFunctionParameters[l+0]===e&&this._blendFunctionParameters[l+1]===t&&this._blendFunctionParameters[l+2]===s&&this._blendFunctionParameters[l+3]===n||(this._blendFunctionParameters[l+0]=e,this._blendFunctionParameters[l+1]=t,this._blendFunctionParameters[l+2]=s,this._blendFunctionParameters[l+3]=n,this._isBlendFunctionParametersDirty=!0)}setAlphaEquationParameters(e,t,s=0){const n=s*2;this._blendEquationParameters[n+0]===e&&this._blendEquationParameters[n+1]===t||(this._blendEquationParameters[n+0]=e,this._blendEquationParameters[n+1]=t,this._isBlendEquationParametersDirty=!0)}reset(){this._alphaBlend.fill(!1),this._numTargetEnabled=0,this._blendFunctionParameters.fill(null),this._blendEquationParameters.fill(null),this._blendConstants[0]=null,this._blendConstants[1]=null,this._blendConstants[2]=null,this._blendConstants[3]=null,this._isAlphaBlendDirty=!0,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this._isBlendConstantsDirty=!1}apply(e,t=1){if(!this.isDirty)return;if(this._isBlendConstantsDirty&&(e.blendColor(this._blendConstants[0],this._blendConstants[1],this._blendConstants[2],this._blendConstants[3]),this._isBlendConstantsDirty=!1),t===1||!this._supportBlendParametersPerTarget){this._isAlphaBlendDirty&&(this._alphaBlend[0]?e.enable(e.BLEND):e.disable(e.BLEND),this._isAlphaBlendDirty=!1),this._isBlendFunctionParametersDirty&&(e.blendFuncSeparate(this._blendFunctionParameters[0],this._blendFunctionParameters[1],this._blendFunctionParameters[2],this._blendFunctionParameters[3]),this._isBlendFunctionParametersDirty=!1),this._isBlendEquationParametersDirty&&(e.blendEquationSeparate(this._blendEquationParameters[0],this._blendEquationParameters[1]),this._isBlendEquationParametersDirty=!1);return}const s=e;if(this._isAlphaBlendDirty){for(let n=0;n<t;n++){const a=n<this._numTargetEnabled?n:0;this._alphaBlend[a]?s.enableIndexed(e.BLEND,n):s.disableIndexed(e.BLEND,n)}this._isAlphaBlendDirty=!1}if(this._isBlendFunctionParametersDirty){for(let n=0;n<t;n++){const a=n<this._numTargetEnabled?n*4:0;s.blendFuncSeparateIndexed(n,this._blendFunctionParameters[a+0],this._blendFunctionParameters[a+1],this._blendFunctionParameters[a+2],this._blendFunctionParameters[a+3])}this._isBlendFunctionParametersDirty=!1}if(this._isBlendEquationParametersDirty){for(let n=0;n<t;n++){const a=n<this._numTargetEnabled?n*2:0;s.blendEquationSeparateIndexed(n,this._blendEquationParameters[a+0],this._blendEquationParameters[a+1])}this._isBlendEquationParametersDirty=!1}}setAlphaMode(e,t){let s=32774;switch(e){case 0:break;case 7:this.setAlphaBlendFunctionParameters(1,771,1,1,t);break;case 8:this.setAlphaBlendFunctionParameters(1,771,1,771,t);break;case 2:this.setAlphaBlendFunctionParameters(770,771,1,1,t);break;case 6:this.setAlphaBlendFunctionParameters(1,1,0,1,t);break;case 1:this.setAlphaBlendFunctionParameters(770,1,0,1,t);break;case 3:this.setAlphaBlendFunctionParameters(0,769,1,1,t);break;case 4:this.setAlphaBlendFunctionParameters(774,0,1,1,t);break;case 5:this.setAlphaBlendFunctionParameters(770,769,1,1,t);break;case 9:this.setAlphaBlendFunctionParameters(32769,32770,32771,32772,t);break;case 10:this.setAlphaBlendFunctionParameters(1,769,1,771,t);break;case 11:this.setAlphaBlendFunctionParameters(1,1,1,1,t);break;case 12:this.setAlphaBlendFunctionParameters(772,1,0,0,t);break;case 13:this.setAlphaBlendFunctionParameters(775,769,773,771,t);break;case 14:this.setAlphaBlendFunctionParameters(1,771,1,771,t);break;case 15:this.setAlphaBlendFunctionParameters(1,1,1,0,t);break;case 16:this.setAlphaBlendFunctionParameters(775,769,0,1,t);break;case 17:this.setAlphaBlendFunctionParameters(770,771,1,771,t);break;case 18:this.setAlphaBlendFunctionParameters(1,1,1,1,t),s=32775;break;case 19:this.setAlphaBlendFunctionParameters(1,1,1,1,t),s=32776;break;case 20:this.setAlphaBlendFunctionParameters(1,35065,0,1,t);break;case 21:this.setAlphaBlendFunctionParameters(1,0,1,771,t);break}this.setAlphaEquationParameters(s,s,t)}}function J1(i,e){if(e){const{requestAnimationFrame:t}=e;if(typeof t=="function")return t(i)}if(Bs()){const{requestAnimationFrame:t}=e||window;if(typeof t=="function")return t(i)}else if(typeof requestAnimationFrame=="function")return requestAnimationFrame(i);return setTimeout(i,16)}class Be{get frameId(){return this._frameId}get isWebGPU(){return this._isWebGPU}_getShaderProcessor(e){return this._shaderProcessor}_resetAlphaMode(){this._alphaMode.fill(-1),this._alphaEquation.fill(-1)}get shaderPlatformName(){return this._shaderPlatformName}_clearEmptyResources(){this._emptyTexture=null,this._emptyCubeTexture=null,this._emptyTexture3D=null,this._emptyTexture2DArray=null}get useReverseDepthBuffer(){return this._useReverseDepthBuffer}set useReverseDepthBuffer(e){e!==this._useReverseDepthBuffer&&(this._useReverseDepthBuffer=e,e?this._depthCullingState.depthFunc=518:this._depthCullingState.depthFunc=515)}setColorWrite(e){e!==this._colorWrite&&(this._colorWriteChanged=!0,this._colorWrite=e)}
460getColorWrite(){return this._colorWrite}get depthCullingState(){return this._depthCullingState}get alphaState(){return this._alphaState}get stencilState(){return this._stencilState}get stencilStateComposer(){return this._stencilStateComposer}_getGlobalDefines(e){if(e){this.isNDCHalfZRange?e.IS_NDC_HALF_ZRANGE="":delete e.IS_NDC_HALF_ZRANGE,this.useReverseDepthBuffer?e.USE_REVERSE_DEPTHBUFFER="":delete e.USE_REVERSE_DEPTHBUFFER,this.useExactSrgbConversions?e.USE_EXACT_SRGB_CONVERSIONS="":delete e.USE_EXACT_SRGB_CONVERSIONS;return}else{let t="";return this.isNDCHalfZRange&&(t+="#define IS_NDC_HALF_ZRANGE"),this.useReverseDepthBuffer&&(t&&(t+=`
461`),t+="#define USE_REVERSE_DEPTHBUFFER"),this.useExactSrgbConversions&&(t&&(t+=`
462`),t+="#define USE_EXACT_SRGB_CONVERSIONS"),t}}_rebuildInternalTextures(){const e=this._internalTexturesCache.slice();for(const t of e)t._rebuild()}_rebuildRenderTargetWrappers(){const e=this._renderTargetWrapperCache.slice();for(const t of e)t.textures?.some(s=>s.source===15)||t._rebuild()}_rebuildEffects(){for(const e in this._compiledEffects){const t=this._compiledEffects[e];t._pipelineContext=null,t._prepareEffect()}fs.ResetCache()}_rebuildGraphicsResources(){this.wipeCaches(!0),this._rebuildEffects(),this._rebuildComputeEffects?.(),this._rebuildBuffers(),this._rebuildInternalTextures(),this._rebuildTextures(),this._rebuildRenderTargetWrappers(),this.wipeCaches(!0)}_flagContextRestored(){Re.Warn(this.name+" context successfully restored."),this.onContextRestoredObservable.notifyObservers(this),this._contextWasLost=!1}_restoreEngineAfterContextLost(e){setTimeout(()=>{this._clearEmptyResources();const t=this._depthCullingState.depthTest,s=this._depthCullingState.depthFunc,n=this._depthCullingState.depthMask,a=this._stencilState.stencilTest;e(),this._rebuildGraphicsResources(),this._depthCullingState.depthTest=t,this._depthCullingState.depthFunc=s,this._depthCullingState.depthMask=n,this._stencilState.stencilTest=a,this._flagContextRestored()},0)}get isDisposed(){return this._isDisposed}get snapshotRendering(){return!1}set snapshotRendering(e){}get snapshotRenderingMode(){return 0}set snapshotRenderingMode(e){}getClassName(){return"AbstractEngine"}get emptyTexture(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,5,!1,!1,1)),this._emptyTexture}get emptyTexture3D(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture3D}get emptyTexture2DArray(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture2DArray}get emptyCubeTexture(){if(!this._emptyCubeTexture){const e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,5,0,!1,!1,1)}return this._emptyCubeTexture}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}get activeRenderLoops(){return this._activeRenderLoops}stopRenderLoop(e){if(!e){this._activeRenderLoops.length=0,this._cancelFrame();return}const t=this._activeRenderLoops.indexOf(e);t>=0&&(this._activeRenderLoops.splice(t,1),this._activeRenderLoops.length==0&&this._cancelFrame())}_cancelFrame(){if(this.customAnimationFrameRequester){if(this._frameHandler!==0){this._frameHandler=0;const{cancelAnimationFrame:e}=this.customAnimationFrameRequester;e&&e(this.customAnimationFrameRequester.requestID),delete this.customAnimationFrameRequester.requestID}return}if(this._frameHandler!==0){const e=this._frameHandler;if(this._frameHandler=0,Bs()){const{cancelAnimationFrame:t}=this.getHostWindow()||window;if(typeof t=="function")return t(e)}else if(typeof cancelAnimationFrame=="function")return cancelAnimationFrame(e);return clearTimeout(e)}}beginFrame(){this.onBeginFrameObservable.notifyObservers(this)}endFrame(){this._frameId++,this.onEndFrameObservable.notifyObservers(this)}get maxFPS(){return this._maxFPS}set maxFPS(e){if(this._maxFPS=e,e!==void 0){if(e<=0){this._minFrameTime=Number.MAX_VALUE;return}this._minFrameTime=1e3/e}}_isOverFrameTime(e){if(!e||this._maxFPS===void 0)return!1;const t=e-this._lastFrameTime;return this._lastFrameTime=e,this._renderAccumulator+=t,this._renderAccumulator<this._minFrameTime?!0:(this._renderAccumulator-=this._minFrameTime,this._renderAccumulator>this._minFrameTime&&(this._renderAccumulator=this._minFrameTime),!1)}
vendor: 3,763 bytes, line 462
462_processFrame(e){if(this._frameHandler=0,!this._contextWasLost&&!this._isOverFrameTime(e)){let t=!0;(this.isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(t=!1),t&&(this.beginFrame(),!this.skipFrameRender&&!this._renderViews()&&this._renderFrame(),this.endFrame())}}_renderLoop(e){this._processFrame(e),this._activeRenderLoops.length>0&&this._frameHandler===0&&this._queueNewFrameForRenderLoop()}_renderFrame(){for(let e=0;e<this._activeRenderLoops.length;e++){const t=this._activeRenderLoops[e];t()}}_renderViews(){return!1}_queueNewFrame(e,t){return J1(e,t)}_queueNewFrameForRenderLoop(){this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())}runRenderLoop(e){this._activeRenderLoops.indexOf(e)===-1&&(this._activeRenderLoops.push(e),this._activeRenderLoops.length===1&&this._frameHandler===0&&this._queueNewFrameForRenderLoop())}getDepthBuffer(){return this._depthCullingState.depthTest}setDepthBuffer(e){this._depthCullingState.depthTest=e}setZOffset(e){this._depthCullingState.zOffset=this.useReverseDepthBuffer?-e:e}getZOffset(){const e=this._depthCullingState.zOffset;return this.useReverseDepthBuffer?-e:e}setZOffsetUnits(e){this._depthCullingState.zOffsetUnits=this.useReverseDepthBuffer?-e:e}getZOffsetUnits(){const e=this._depthCullingState.zOffsetUnits;return this.useReverseDepthBuffer?-e:e}getHostWindow(){return Bs()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null}get compatibilityMode(){return this._compatibilityMode}set compatibilityMode(e){this._compatibilityMode=!0}_rebuildTextures(){for(const e of this.scenes)e._rebuildTextures();for(const e of this._virtualScenes)e._rebuildTextures()}_releaseRenderTargetWrapper(e){const t=this._renderTargetWrapperCache.indexOf(e);t!==-1&&this._renderTargetWrapperCache.splice(t,1)}get currentViewport(){return this._cachedViewport}setViewport(e,t,s){const n=t||this.getRenderWidth(),a=s||this.getRenderHeight(),l=e.x||0,u=e.y||0;this._cachedViewport=e,this._viewport(l*n,u*a,n*e.width,a*e.height)}createCanvasImage(){return document.createElement("img")}createCanvasPath2D(e){return new Path2D(e)}get description(){let e=this.name+this.version;return this._caps.parallelShaderCompile&&(e+=" - Parallel shader compilation"),e}_createTextureBase(e,t,s,n,a=3,l=null,u=null,h,f,m=null,p=null,b=null,v=null,R,x,T){e=e||"";const E=e.substring(0,5)==="data:",A=e.substring(0,5)==="blob:",D=E&&e.indexOf(";base64,")!==-1,M=p||new ai(this,1);M!==p&&(M.label=e.substring(0,60));const k=e;this._transformTextureUrl&&!D&&!p&&!m&&(e=this._transformTextureUrl(e)),k!==e&&(M._originalUrl=k);const U=e.lastIndexOf(".");let N=v||(U>-1?e.substring(U).toLowerCase():"");N.indexOf("?")>-1&&(N=N.split("?")[0]);const q=Be.GetCompatibleTextureLoader(N,R);n&&n.addPendingData(M),M.url=e,M.generateMipMaps=!t,M.samplingMode=a,M.invertY=s,M._useSRGBBuffer=this._getUseSRGBBuffer(!!T,t),this._doNotHandleContextLost||(M._buffer=m);let re=null;l&&!p&&(re=M.onLoadedObservable.add(l)),p||this._internalTexturesCache.push(M);const ce=(ae,fe)=>{n&&n.removePendingData(M),e===k?(re&&M.onLoadedObservable.remove(re),pt.UseFallbackTexture&&e!==pt.FallbackTexture&&this._createTextureBase(pt.FallbackTexture,t,M.invertY,n,a,null,u,h,f,m,M),ae=(ae||"Unknown error")+(pt.UseFallbackTexture?" - Fallback texture was used":""),M.onErrorObservable.notifyObservers({message:ae,exception:fe}
vendor: 4,250 bytes, line 462
462),u&&u(ae,fe)):(Re.Warn(`Failed to load ${e}, falling back to ${k}`),this._createTextureBase(k,t,M.invertY,n,a,l,u,h,f,m,M,b,v,R,x,T))};if(q){const ae=async fe=>{(await q).loadData(fe,M,(Te,z,J,Y,V,ge)=>{ge?ce("TextureLoader failed to load data"):h(M,N,n,{width:Te,height:z},M.invertY,!J,Y,()=>(V(),!1),a)},x)};if(!m)this._loadFile(e,async fe=>{try{await ae(new Uint8Array(fe))}catch(_e){ce("Failed to parse texture data",_e)}},void 0,n?n.offlineProvider:void 0,!0,(fe,_e)=>{ce("Unable to load "+(fe&&fe.responseURL,_e))});else{const fe=async _e=>{try{await ae(_e)}catch(Te){ce("Failed to parse texture data",Te)}};m instanceof ArrayBuffer?fe(new Uint8Array(m)):ArrayBuffer.isView(m)?fe(m):u&&u("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null)}}else{const ae=fe=>{A&&!this._doNotHandleContextLost&&(M._buffer=fe),h(M,N,n,fe,M.invertY,t,!1,f,a)};!E||D?m&&(typeof m.decoding=="string"||m.close)?ae(m):Be._FileToolsLoadImage(e||"",ae,ce,n?n.offlineProvider:null,R,M.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):typeof m=="string"||m instanceof ArrayBuffer||ArrayBuffer.isView(m)||m instanceof Blob?Be._FileToolsLoadImage(m,ae,ce,n?n.offlineProvider:null,R,M.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):m&&ae(m)}return M}_rebuildBuffers(){for(const e of this._uniformBuffers)e._rebuildAfterContextLost()}get _shouldUseHighPrecisionShader(){return!!(this._caps.highPrecisionShaderSupported&&this._highPrecisionShadersAllowed)}getHostDocument(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:Ta()?document:null}getLoadedTexturesCache(){return this._internalTexturesCache}clearInternalTexturesCache(){this._internalTexturesCache.length=0}getCaps(){return this._caps}resetTextureCache(){for(const e in this._boundTexturesCache)Object.prototype.hasOwnProperty.call(this._boundTexturesCache,e)&&(this._boundTexturesCache[e]=null);this._currentTextureChannel=-1}get name(){return this._name}set name(e){this._name=e}static get NpmPackage(){return"[email protected]"}static get Version(){return"9.25.0"}getRenderingCanvas(){return this._renderingCanvas}getAudioContext(){return this._audioContext}getAudioDestination(){return this._audioDestination}setHardwareScalingLevel(e){this._hardwareScalingLevel=e,this.resize()}getHardwareScalingLevel(){return this._hardwareScalingLevel}get doNotHandleContextLost(){return this._doNotHandleContextLost}set doNotHandleContextLost(e){this._doNotHandleContextLost=e}get isStencilEnable(){return this._isStencilEnable}getCreationOptions(){return this._creationOptions}constructor(e,t,s){this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new W3,this._stencilStateComposer=new Y3,this._stencilState=new Oi,this._alphaState=new $1(!1),this._alphaMode=Array(8).fill(-1),this._alphaEquation=Array(8).fill(-1),this._activeRequests=[],this._badOS=!1,this._badDesktopOS=!1,this._compatibilityMode=!0,this._internalTexturesCache=new Array,this._currentRenderTarget=null,this._boundTexturesCache={},this._activeChannel=0,this._currentTextureChannel=-1,this._viewportCached={x:0,y:0,z:0,w:0},this._isWebGPU=!1,this._enableGPUDebugMarkers=!1,this.onCanvasBlurObservable=new xe,this.onCanvasFocusObservable=new xe,this.onNewSceneAddedObservable=new xe,this.onResizeObservable=new xe,this.onCanvasPointerOutObservable=new xe,this.onEffectErrorObservable=new xe,this.disablePerformanceMonitorInBackground=!1,this.disableVertexArrayObjects=!1,this._frameId=0,this.hostInformation={isMobile:!1},this.isFullscreen=!1,this.enableOfflineSupport=!1,this.disableManifestCheck=!1,this.disableContextMenu=!0,this.currentRenderPassId=0,this.isPointerLock=!1,this.postProcesses=[],this.canvasTabIndex=1,this._contextWasLost=!1,this._useReverseDepthBuffer=!1,this.isNDCHalfZRange=!1,this.hasOriginBottomLeft=!0,this._renderTargetWrapperCache=new Array,this._compiledEffects={},this._isDisposed=!1,this.scenes=[],this._virtualScenes=new Array,this.onBeforeTextureInitObservable=new xe,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this._frameHandler=0,this._activeRenderLoops=new Array,this.customAnimationFrameRequester=null,this._windowIsBackgroun
vendor: 22,960 bytes, lines 462-469
462d=!1,this._boundRenderFunction=l=>this._renderLoop(l),this._lastFrameTime=0,this._renderAccumulator=0,this.skipFrameRender=!1,this.onBeforeShaderCompilationObservable=new xe,this.onAfterShaderCompilationObservable=new xe,this.onBeginFrameObservable=new xe,this.onEndFrameObservable=new xe,this._transformTextureUrl=null,this._uniformBuffers=new Array,this._storageBuffers=new Array,this._highPrecisionShadersAllowed=!0,this.onContextLostObservable=new xe,this.onContextRestoredObservable=new xe,this._name="",this.premultipliedAlpha=!0,this.adaptToDeviceRatio=!1,this._lastDevicePixelRatio=1,this._doNotHandleContextLost=!1,this.cullBackFaces=null,this._renderPassNames=["main"],this._fps=60,this._deltaTime=0,this._deterministicLockstep=!1,this._lockstepMaxSteps=4,this._timeStep=1/60,this.onDisposeObservable=new xe,this.onReleaseEffectsObservable=new xe,pt.Instances.push(this),this.startTime=lr.Now,this._stencilStateComposer.stencilGlobal=this._stencilState,As.SetMatrixPrecision(!!t.useLargeWorldRendering||!!t.useHighPrecisionMatrix),Ao()&&navigator.userAgent&&(this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),t.antialias=e??t.antialias,t.deterministicLockstep=t.deterministicLockstep??!1,t.lockstepMaxSteps=t.lockstepMaxSteps??4,t.timeStep=t.timeStep??1/60,t.stencil=t.stencil??!0,this._audioContext=t.audioEngineOptions?.audioContext??null,this._audioDestination=t.audioEngineOptions?.audioDestination??null,this.premultipliedAlpha=t.premultipliedAlpha??!0,this._doNotHandleContextLost=!!t.doNotHandleContextLost,this._isStencilEnable=!!t.stencil,this.useExactSrgbConversions=t.useExactSrgbConversions??!1,this.canvasTabIndex=t.canvasTabIndex??this.canvasTabIndex;const n=Bs()&&window.devicePixelRatio||1,a=t.limitDeviceRatio||n;s=s||t.adaptToDeviceRatio||!1,this.adaptToDeviceRatio=s,this._hardwareScalingLevel=s?1/Math.min(a,n):1,this._lastDevicePixelRatio=n,this._creationOptions=t}resize(e=!1){let t,s;if(this.adaptToDeviceRatio){const n=Bs()&&window.devicePixelRatio||1,a=this._lastDevicePixelRatio/n;this._lastDevicePixelRatio=n,this._hardwareScalingLevel*=a}if(Bs()&&Ta())if(this._renderingCanvas){const n=this._renderingCanvas.getBoundingClientRect?.();t=this._renderingCanvas.clientWidth||n?.width||this._renderingCanvas.width*this._hardwareScalingLevel||100,s=this._renderingCanvas.clientHeight||n?.height||this._renderingCanvas.height*this._hardwareScalingLevel||100}else t=window.innerWidth,s=window.innerHeight;else t=this._renderingCanvas?this._renderingCanvas.width:100,s=this._renderingCanvas?this._renderingCanvas.height:100;this.setSize(t/this._hardwareScalingLevel,s/this._hardwareScalingLevel,e)}setSize(e,t,s=!1){if(!this._renderingCanvas||(e=e|0,t=t|0,!s&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t))return!1;if(this._renderingCanvas.width=e,this._renderingCanvas.height=t,this.scenes){for(let n=0;n<this.scenes.length;n++){const a=this.scenes[n];for(let l=0;l<a.cameras.length;l++){const u=a.cameras[l];u._currentRenderId=0}}this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this)}return!0}createRawTexture(e,t,s,n,a,l,u,h,f,m,p,b){throw bt("engine.rawTexture")}createRawCubeTexture(e,t,s,n,a,l,u,h){throw bt("engine.rawTexture")}createRawTexture3D(e,t,s,n,a,l,u,h,f,m,p){throw bt("engine.rawTexture")}createRawTexture2DArray(e,t,s,n,a,l,u,h,f,m,p,b){throw bt("engine.rawTexture")}_sharedInit(e){this._renderingCanvas=e}_setupMobileChecks(){navigator&&navigator.userAgent&&(this._checkForMobile=()=>{const e=navigator.userAgent;this.hostInformation.isMobile=e.indexOf("Mobile")!==-1||e.indexOf("Mac")!==-1&&Ta()&&"ontouchend"in document},this._checkForMobile(),Bs()&&window.addEventListener("resize",this._checkForMobile))}createVideoElement(e){return document.createElement("video")}_reportDrawCall(e=1){this._drawCalls?.addCount(e,!1)}getFps(){return this._fps}getDeltaTime(){return this._deltaTime}isDeterministicLockStep(){return this._deterministicLockstep}getLockstepMaxSteps(){return this._lockstepMaxSteps}getTimeStep(){return this._timeStep*1e3}_createImageBitmapFromSource(e,t){throw new Error("createImageBitmapFromSource is not implemented")}createImageBitmap(e,t){return createImageBitmap(e,t)}resizeImageBitmap(e,t,s){throw new Error("resizeImageBitmap is not implemented")}getFontOffset(e){throw new Error("getFontOffset is not implemented")}static _CreateCanvas(e,t){if(typeof document>"u")return new OffscreenCanvas(e,t);const s=document.createElement("canvas");return s.width=e,s.height=t,s}createCanvas(e,t){return Be._CreateCanvas(e,t)}static _FileToolsLoadImage(e,t,s,n,a,l,u){if(!xa.loadImage)throw bt("FileTools");return xa.loadImage(e,t,s,n,a,l,u)}_loadFile(e,t,s,n,a,l){const u=q1(e,t,s,n,a,l);return this._activeRequests.push(u),u.onCompleteObservable.add(()=>{const h=this._activeRequests.indexOf(u);h!==-1&&this._activeRequests.splice(h,1)}),u}static _FileToolsLoadFile(e,t,s,n,a,l){if(xa.loadFile)return xa.loadFile(e,t,s,n,a,l);throw bt("FileTools")}dispose(){for(this.releaseEffects(),this._isDisposed=!0,this.stopRenderLoop(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._renderingCanvas=null,this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(;this.scenes.length;)this.scenes[0].dispose();for(;this._virtualScenes.length;)this._virtualScenes[0].dispose();this.releaseComputeEffects?.(),fs.ResetCache();for(const t of this._activeRequests)t.abort();this._boundRenderFunction=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onNewSceneAddedObservable.clear(),this.onEffectErrorObservable.clear(),Bs()&&window.removeEventListener("resize",this._checkForMobile);const e=pt.Instances.indexOf(this);e>=0&&pt.Instances.splice(e,1),pt.Instances.length||(pt.OnEnginesDisposedObservable.notifyObservers(this),pt.OnEnginesDisposedObservable.clear()),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()}static DefaultLoadingScreenFactory(e){throw bt("LoadingScreen")}static MarkAllMaterialsAsDirty(e,t){for(let s=0;s<pt.Instances.length;s++){const n=pt.Instances[s];for(let a=0;a<n.scenes.length;a++)n.scenes[a].markAllMaterialsAsDirty(e,t)}}static GetCompatibleTextureLoader(e,t){return null}}Be._RenderPassIdCounter=0;Be._RescalePostProcessFactory=null;Be.CollisionsEpsilon=.001;Be.QueueNewFrame=J1;function eA(i){return i.getPipelineContext===void 0}class K3{constructor(){this.shaderLanguage=0}postProcessor(e,t,s,n,a){if(a.drawBuffersExtensionDisabled){const l=/#extension.+GL_EXT_draw_buffers.+(enable|require)/g;e=e.replace(l,"")}return e}}const Z3=/(flat\s)?\s*varying\s*.*/;class Q3{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,t){return Z3.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,s){const n=e.search(/#extension.+GL_EXT_draw_buffers.+require/)!==-1,a=/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;if(e=e.replace(a,""),e=e.replace(/texture2D\s*\(/g,"texture("),s){const l=e.search(/layout *\(location *= *0\) *out/g)!==-1,u=t.indexOf("#define DUAL_SOURCE_BLENDING")!==-1,h=u?`layout(location = 0, index = 0) out vec4 glFragColor;
463layout(location = 0, index = 1) out vec4 glFragColor2;
464`:`layout(location = 0) out vec4 glFragColor;
465`;u&&(e=`#extension GL_EXT_blend_func_extended : require
466`+e),e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCubeLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCube\s*\(/g,"texture("),e=e.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),e=e.replace(/gl_FragColor/g,"glFragColor"),e=e.replace(/gl_FragData/g,"glFragData"),e=e.replace(/void\s+?main\s*\(/g,(n||l?"":h)+"void main(")}else if(t.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0&&(e=`invariant gl_Position;
467`+e),t.indexOf("#define MULTIVIEW")!==-1)return`#extension GL_OVR_multiview2 : require
468layout (num_views = 2) in;
469`+e;return e}}class Oc{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=Oc._Counter++}}Oc._Counter=0;class oc extends Oc{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}function lh(i){let e=1;do e*=2;while(e<i);return e===i}function j0(i,e,t){return i*(1-t)+e*t}function $3(i){const e=tA(i),t=sA(i);return e-i>i-t?t:e}function tA(i){return i--,i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i|=i>>16,i++,i}function sA(i){return i=i|i>>1,i=i|i>>2,i=i|i>>4,i=i|i>>8,i=i|i>>16,i-(i>>1)}function Qp(i,e,t=2){let s;switch(t){case 1:s=sA(i);break;case 2:s=$3(i);break;case 3:default:s=tA(i);break}return Math.min(s,e)}class $p{get underlyingResource(){return this._webGLTexture}constructor(e=null,t){if(this._MSAARenderBuffers=null,this._context=t,!e&&(e=t.createTexture(),!e))throw new Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){this._webGLTexture=e}reset(){this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){if(this._MSAARenderBuffers){for(const e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){return this._MSAARenderBuffers?.[e]??null}release(){this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}function G0(i){return i===13||i===14||i===15||i===16||i===17||i===18||i===19}function lc(i){return i===13||i===17||i===18||i===19}class J3{}class it extends Be{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return fs.ShadersRepository}static set ShadersRepository(e){fs.ShadersRepository=e}get supportsUniformBuffers(){return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,s,n){if(s=s||{},super(t??s.antialias,s,n),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;let a;if(e.getContext){if(a=e,s.preserveDrawingBuffer===void 0&&(s.preserveDrawingBuffer=!1),s.xrCompatible===void 0&&(s.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const h=navigator.userAgent;for(const f of it.ExceptionList){const m=f.key,p=f.targets;if(new RegExp(m).test(h)){if(f.capture&&f.captureConstraint){const v=f.capture,R=f.captureConstraint,T=new RegExp(v).exec(h);if(T&&T.length>0&&parseInt(T[T.length-1])>=R)continue}for(const v of p)switch(v){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":s.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1;break}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{ap(this._gl)}:(this._onContextLost=h=>{h.preventDefault(),this._contextWasLost=!0,ap(this._gl),Re.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},a.addEventListener("webglcontextrestored",this._onContextRestored,!1),s.powerPreference=s.powerPreference||"high-performance"),a.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(s.xrCompatible=!1),!s.disableWebGL2Support)try{this._gl=a.getContext("webgl2",s)||a.getContext("experimental-webgl2",s),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch{}if(!this._gl){if(!a)throw new Error("The provided canvas is null or undefined.");try{this._gl=a.getContext("webgl",s)||a.getContext("experimental-webgl",s)}catch(h){throw new Error("WebGL not supported",{cause:h})}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=e,a=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const h=this._gl.getContextAttributes();h&&(s.stencil=h.stencil)}this._sharedInit(a),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),s.useHighPrecisionFloats!==void 0&&(this._highPrecisionShadersAllowed=s.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let h=0;h<this._caps.maxVertexAttribs;h++)this._currentBufferPointers[h]=new J3;this._shaderProcessor=this.webGLVersion>1?new Q3:new K3;const l=`Babylon.js v${it.Version}`;Re.Log(l+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",l);const u=yi(this._gl);u.validateShaderPrograms=this.validateShaderPrograms,u.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}areAllEffectsReady(){for(const e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),shaderFloatPrecision:0,parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||this._gl.getExtension("OES_standard_derivatives")!==null,maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||this._gl.getExtension("OES_element_index_uint")!==null,fragmentDepthSupported:this._webGLVersion>1||this._gl.getExtension("EXT_frag_depth")!==null,highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),blendFloat:this._gl.getExtension("EXT_float_blend")!==null,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:this._webGLVersion!==1,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16"),blendParametersPerTarget:!1,dualSourceBlending:!1,supportReadWriteStorageTextures:!1},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);const e=this._gl.getExtension("WEBGL_debug_renderer_info");e!=null&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),this._gl.HALF_FLOAT_OES!==36193&&(this._gl.HALF_FLOAT_OES=36193),this._gl.RGBA16F!==34842&&(this._gl.RGBA16F=34842),this._gl.RGBA32F!==34836&&(this._gl.RGBA32F=34836),this._gl.DEPTH24_STENCIL8!==35056&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(this._webGLVersion===1&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)??0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763);const t=this._gl.getExtension("OES_draw_buffers_indexed");if(this._caps.blendParametersPerTarget=!!t,this._alphaState=new $1(this._caps.blendParametersPerTarget),t&&(this._gl.blendEquationSeparateIndexed=t.blendEquationSeparateiOES.bind(t),this._gl.blendEquationIndexed=t.blendEquationiOES.bind(t),this._gl.blendFuncSeparateIndexed=t.blendFuncSeparateiOES.bind(t),this._gl.blendFuncIndexed=t.blendFunciOES.bind(t),this._gl.colorMaskIndexed=t.colorMaskiOES.bind(t),this._gl.disableIndexed=t.disableiOES.bind(t),this._gl.enableIndexed=t.enableiOES.bind(t)),this._caps.dualSourceBlending=!!this._gl.getExtension("WEBGL_blend_func_extended"),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&this._gl.HALF_FLOAT_OES!==5131&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRen
469der=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=this._maxMSAASamplesOverride!==null?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{const s=this._gl.getExtension("WEBGL_draw_buffers");if(s!==null){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=s.drawBuffersWEBGL.bind(s),this._caps.maxDrawBuffers=this._gl.getParameter(s.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let n=0;n<16;n++)this._gl["COLOR_ATTACHMENT"+n+"_WEBGL"]=s["COLOR_ATTACHMENT"+n+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{const s=this._gl.getExtension("WEBGL_depth_texture");s!=null&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=s.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{const s=this._gl.getExtension("OES_vertex_array_object");s!=null&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=s.createVertexArrayOES.bind(s),this._gl.bindVertexArray=s.bindVertexArrayOES.bind(s),this._gl.deleteVertexArray=s.deleteVertexArrayOES.bind(s))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{const s=this._gl.getExtension("ANGLE_instanced_arrays");s!=null?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=s.drawArraysInstancedANGLE.bind(s),this._gl.drawElementsInstanced=s.drawElementsInstancedANGLE.bind(s),this._gl.vertexAttribDivisor=s.vertexAttribDivisorANGLE.bind(s)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){const s=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),n=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);if(s&&n&&(this._caps.highPrecisionShaderSupported=s.precision!==0&&n.precision!==0,this._caps.shaderFloatPrecision=Math.min(s.precision,n.precision)),!this._shouldUseHighPrecisionShader){const a=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.MEDIUM_FLOAT),l=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.MEDIUM_FLOAT);a&&l&&(this._caps.shaderFloatPrecision=Math.min(a.precision,l.precision))}this._caps.shaderFloatPrecision<10&&(this._caps.shaderFloatPrecision=10)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{const s=this._gl.getExtension("EXT_blend_minmax");s!=null&&(this._caps.blendMinMax=!0,this._gl.MAX=s.MAX_EXT,this._gl.MIN=s.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{const s=this._gl.getExtension("EXT_sRGB");s!=null&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:s.SRGB_EXT,SRGB8:s.SRGB_ALPHA_EXT,SRGB8_ALPHA8:s.SRGB_ALPHA_EXT})}if(this._creationOptions){const s=this._creationOptions.forceSRGBBufferSupportState;s!==void 0&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&s)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let s=0;s<this._maxSimultaneousTextures;s++)this._nextFreeTextureSlots.push(s);this._glRenderer==="Mali-G72"&&(this._caps.disableMorphTargetTexture=!0)}_initFeatures(){this._features={forceBitmapOverHTMLImageElement:typeof HTMLImageElement>"u",supportRenderAndCopyToLodForFloatTextures:this._webGLVersion!==1,supportDepthStencilTexture:this._webGLVersion!==1,supportShadowSamplers:this._webGLVersion!==1,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:this._webGLVersion!==1,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:this._webGLVersion!==1,basisNeedsPOT:this._webGLVersion===1,support3DTextures:this._webGLVersion!==1,needTypeSuffixInShaderConstants:this._webGLVersion!==1,supportMSAA:this._webGLVersion!==1,supportSSAO2:this._webGLVersion!==1,supportIBLShadows:this._webGLVersion!==1,supportExtendedTextureFormats:this._webGLVersion!==1,supportSwitchCaseInSha
vendor: 50,957 bytes, line 469
469der:this._webGLVersion!==1,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);const e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){const e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,s,n=!1,a=0){const l=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=l;let u=0;if(t&&e){let h=!0;if(this._currentRenderTarget){const f=this._currentRenderTarget.texture?.format;if(f===8||f===9||f===10||f===11){const m=this._currentRenderTarget.texture?.type;m===7||m===5?(it._TempClearColorUint32[0]=e.r*255,it._TempClearColorUint32[1]=e.g*255,it._TempClearColorUint32[2]=e.b*255,it._TempClearColorUint32[3]=e.a*255,this._gl.clearBufferuiv(this._gl.COLOR,0,it._TempClearColorUint32),h=!1):(it._TempClearColorInt32[0]=e.r*255,it._TempClearColorInt32[1]=e.g*255,it._TempClearColorInt32[2]=e.b*255,it._TempClearColorInt32[3]=e.a*255,this._gl.clearBufferiv(this._gl.COLOR,0,it._TempClearColorInt32),h=!1)}}h&&(this._gl.clearColor(e.r,e.g,e.b,e.a!==void 0?e.a:1),u|=this._gl.COLOR_BUFFER_BIT)}s&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),u|=this._gl.DEPTH_BUFFER_BIT),n&&(this._gl.clearStencil(a),u|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(u)}_viewport(e,t,s,n){(e!==this._viewportCached.x||t!==this._viewportCached.y||s!==this._viewportCached.z||n!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=s,this._viewportCached.w=n,this._gl.viewport(e,t,s,n))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw new Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,s,n,a,l=0,u=0){const h=e;this._currentRenderTarget&&this._resolveAndGenerateMipMapsFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(h._framebuffer);const f=this._gl;e.isMulti||(e.is2DArray||e.is3D?(f.framebufferTextureLayer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,e.texture._hardwareTexture?.underlyingResource,l,u),h._currentLOD=l):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,l):h._currentLOD!==l&&(f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,l),h._currentLOD=l));const m=e._depthStencilTexture;if(m){e.is3D&&(e.texture.width!==m.width||e.texture.height!==m.height||e.texture.depth!==m.depth)&&Re.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");const p=e._depthStencilTextureWithStencil?f.DEPTH_STENCIL_ATTACHMENT:f.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?f.framebufferTextureLayer(f.FRAMEBUFFER,p,m._hardwareTexture?.underlyingResource,l,u):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,p,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,m._hardwareTexture?.underlyingResource,l):f.framebufferTexture2D(f.FRAMEBUFFER,p,f.TEXTURE_2D,m._hardwareTexture?.underlyingResource,l)}h._MSAAFramebuffer&&this._bindUnboundFramebuffer(h._MSAAFramebuffer),this._cachedViewport&&!a?this.setViewport(this._cachedViewport,s,n):(s||(s=e.width,l&&(s=s/Math.pow(2,l))),n||(n=e.height,l&&(n=n/Math.pow(2,l))),this._viewport(0,0,s,n)),this.wipeCaches()}setStateCullFaceType(e,t){const s=this.cullBackFaces??e??!0?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==s||t)&&(this._depthCullingState.cullFace=s)}setState(e,t=0,s,n=!1,a,l,u=0){(this._depthCullingState.cull!==e||s)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(a,s),this.setZOffset(t),this.setZOffsetUnits(u);const h=n?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==h||s)&&(this._depthCullingState.frontFace=h),this._stencilStateComposer.stencilMaterial=l}_resolveAndGenerateMipMapsFramebuffer(e,t=!1){e.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e))}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return this._currentFramebuffer===null}generateMipmaps(e){const t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t,s){const n=e;this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),s&&(n._MSAAFramebuffer&&this._bindUnboundFramebuffer(n._framebuffer),s()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){!e.isMulti&&e.texture?.generateMipMaps&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){const t=e,s=this._gl;if(!t._MSAAFramebuffer||t.isMulti)return;let n=t.resolveMSAAColors?s.COLOR_BUFFER_BIT:0;n|=t._generateDepthBuffer&&t.resolveMSAADepth?s.DEPTH_BUFFER_BIT:0,n|=t._generateStencilBuffer&&t.resolveMSAAStencil?s.STENCIL_BUFFER_BIT:0,s.bindFramebuffer(s.READ_FRAMEBUFFER,t._MSAAFramebuffer),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,t._framebuffer),s.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,n,s.NEAREST)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,s){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){const s=this._gl.createBuffer();if(!s)throw new Error("Unable to create vertex buffer");const n=new oc(s);return this.bindArrayBuffer(n),typeof e!="number"?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),n.capacity=e.length*4):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),n.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),n.capacity=e),this._resetVertexBufferBinding(),n.references=1,n}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,s){const n=this._gl.createBuffer(),a=new oc(n);if(!n)throw new Error("Unable to create index buffer");this.bindIndexBuffer(a);const l=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,l,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),a.references=1,a.is32Bits=l.BYTES_PER_ELEMENT===4,a}_normalizeIndexData(e){if(e.BYTES_PER_ELEMENT===2)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(let s=0;s<e.length;s++)if(e[s]>=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,s){const n=e.program,a=this._gl.getUniformBlockIndex(n,t);this._gl.uniformBlockBinding(n,a,s)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,s,n,a,l,u){const h=this._currentBufferPointers[t];if(!h)return;let f=!1;h.active?(h.buffer!==e&&(h.buffer=e,f=!0),h.size!==s&&(h.size=s,f=!0),h.type!==n&&(h.type=n,f=!0),h.normalized!==a&&(h.normalized=a,f=!0),h.stride!==l&&(h.stride=l,f=!0),h.offset!==u&&(h.offset=u,f=!0)):(f=!0,h.active=!0,h.index=t,h.size=s,h.type=n,h.normalized=a,h.stride=l,h.offset=u,h.buffer=e),(f||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),n===this._gl.UNSIGNED_INT||n===this._gl.INT?this._gl.vertexAttribIPointer(t,s,n,l,u):this._gl.vertexAttribPointer(t,s,n,a,l,u))}_bindIndexBufferWithCache(e){e!=null&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,s){const n=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let a=0;a<n.length;a++){const l=t.getAttributeLocation(a);if(l>=0){const u=n[a];let h=null;if(s&&(h=s[u]),h||(h=e[u]),!h)continue;this._gl.enableVertexAttribArray(l),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[l]=!0);const f=h.getBuffer();f&&(this._vertexAttribPointer(f,l,h.getSize(),h.type,h.normalized,h.byteStride,h.byteOffset),h.getIsInstanced()&&(this._gl.vertexAttribDivisor(l,h.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(l),this._currentInstanceBuffers.push(f))))}}}recordVertexArrayObject(e,t,s,n){const a=this._gl.createVertexArray();if(!a)throw new Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(a),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,s,n),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),a}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=t!=null&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,s,n,a){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==a){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=a;const l=a.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let u=0;for(let h=0;h<l;h++)if(h<s.length){const f=a.getAttributeLocation(h);f>=0&&(this._gl.enableVertexAttribArray(f),this._vertexAttribArraysEnabled[f]=!0,this._vertexAttribPointer(e,f,s[h],this._gl.FLOAT,!1,n,u)),u+=s[h]*4}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,s,n){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==s)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=s,this._bindVertexBuffersAttributes(e,s,n)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,s=this._currentInstanceLocations.length;t<s;t++){const n=this._currentInstanceBuffers[t];e!=n&&n.references&&(e=n,this.bindArrayBuffer(n));const a=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(a,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0}releaseVertexArrayObject(e){this._gl.deleteVertexArray(e)}_releaseBuffer(e){return e.references--,e.references===0?(this._deleteBuffer(e),!0):!1}_deleteBuffer(e){this._gl.deleteBuffer(e.underlyingResource)}updateAndBindInstancesBuffer(e,t,s){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),s[0].index!==void 0)this.bindInstancesBuffer(e,s,!0);else for(let n=0;n<4;n++){const a=s[n];this._vertexAttribArraysEnabled[a]||(this._gl.enableVertexAttribArray(a),this._vertexAttribArraysEnabled[a]=!0),this._vertexAttribPointer(e,a,4,this._gl.FLOAT,!1,64,n*16),this._gl.vertexAttribDivisor(a,1),this._currentInstanceLocations.push(a),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,s=!0){this.bindArrayBuffer(e);let n=0;if(s)for(let a=0;a<t.length;a++){const l=t[a];n+=l.attributeSize*4}for(let a=0;a<t.length;a++){const l=t[a];l.index===void 0&&(l.index=this._currentEffect.getAttributeLocationByName(l.attributeName)),!(l.index<0)&&(this._vertexAttribArraysEnabled[l.index]||(this._gl.enableVertexAttribArray(l.index),this._vertexAttribArraysEnabled[l.index]=!0),this._vertexAttribPointer(e,l.index,l.attributeSize,l.attributeType||this._gl.FLOAT,l.normalized||!1,n,l.offset),this._gl.vertexAttribDivisor(l.index,l.divisor===void 0?1:l.divisor),this._currentInstanceLocations.push(l.index),this._currentInstanceBuffers.push(e))}}disableInstanceAttributeByName(e){if(!this._currentEffect)return;const t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}disableInstanceAttribute(e){let t=!1,s;for(;(s=this._currentInstanceLocations.indexOf(e))!==-1;)this._currentInstanceLocations.splice(s,1),this._currentInstanceBuffers.splice(s,1),t=!0;t&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))}disableAttributeByIndex(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}draw(e,t,s,n){this.drawElementsType(e?0:1,t,s,n)}drawPointClouds(e,t,s){this.drawArraysType(2,e,t,s)}drawUnIndexed(e,t,s,n){this.drawArraysType(e?0:1,t,s,n)}drawElementsType(e,t,s,n){this.applyStates(),this._reportDrawCall();const a=this._drawMode(e),l=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,u=this._uintIndicesCurrentlySet?4:2;n?this._gl.drawElementsInstanced(a,s,l,t*u,n):this._gl.drawElements(a,s,l,t*u)}drawArraysType(e,t,s,n){this.applyStates(),this._reportDrawCall();const a=this._drawMode(e);n?this._gl.drawArraysInstanced(a,t,s,n):this._gl.drawArrays(a,t,s)}_drawMode(e){switch(e){case 0:return this._gl.TRIANGLES;case 2:return this._gl.POINTS;case 1:return this._gl.LINES;case 3:return this._gl.POINTS;case 4:return this._gl.LINES;case 5:return this._gl.LINE_LOOP;case 6:return this._gl.LINE_STRIP;case 7:return this._gl.TRIANGLE_STRIP;case 8:return this._gl.TRIANGLE_FAN;default:return this._gl.TRIANGLES}}_releaseEffect(e){this._compiledEffects[e._key]&&delete this._compiledEffects[e._key];const t=e.getPipelineContext();t&&this._deletePipelineContext(t)}_deletePipelineContext(e){const t=e;t&&t.program&&(t.program.__SPECTOR_rebuildProgram=null,Q1(t),this._gl&&(this._currentProgram===t.program&&this._setProgram(null),this._gl.deleteProgram(t.program)))}_getGlobalDefines(e){return W1(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,s,n,a,l,u,h,f,m=0,p){const b=typeof e=="string"?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,v=typeof e=="string"?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,R=this._getGlobalDefines(),x=t.attributes!==void 0;let T=a??t.defines??"";R&&(T+=R);const E=b+"+"+v+"@"+T;if(this._compiledEffects[E]){const D=this._compiledEffects[E];return u&&D.isReady()&&u(D),D._refCount++,D}this._gl&&yi(this._gl);const A=new fs(e,t,x?this:s,n,this,a,l,u,h,f,E,t.shaderLanguage??m,t.extraInitializationsAsync??p);return this._compiledEffects[E]=A,A}_getShaderSource(e){return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,s,n,a=null){const l=yi(this._gl);return l._contextWasLost=this._contextWasLost,l.validateShaderPrograms=this.validateShaderPrograms,Y1(e,t,s,n||this._gl,a)}createShaderProgram(e,t,s,n,a,l=null){const u=yi(this._gl);return u._contextWasLost=this._contextWasLost,u.validateShaderPrograms=this.validateShaderPrograms,K1(e,t,s,n,a||this._gl,l)}inlineShaderCode(e){return e}createPipelineContext(e){if(this._gl){const s=yi(this._gl);s.parallelShaderCompile=this._caps.parallelShaderCompile}const t=x3(this._gl);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){return sg(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,s,n,a,l,u,h,f,m,p){const b=yi(this._gl);return b._contextWasLost=this._contextWasLost,b.validateShaderPrograms=this.validateShaderPrograms,b._createShaderProgramInjection=this._createShaderProgram.bind(this),b.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),b.createShaderProgramInjection=this.createShaderProgram.bind(this),b.loadFileInjection=this._loadFile.bind(this),R3(e,t,s,n,a,l,u,h,f,m,p)}_createShaderProgram(e,t,s,n,a=null){return tg(e,t,s,n,a)}_isRenderingStateCompiled(e){return this._isDisposed?!1:v3(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){E3(e,t)}getUniforms(e,t){const s=new Array,n=e;for(let a=0;a<t.length;a++)s.push(this._gl.getUniformLocation(n.program,t[a]));return s}getAttributes(e,t){const s=[],n=e;for(let a=0;a<t.length;a++)try{s.push(this._gl.getAttribLocation(n.program,t[a]))}catch{s.push(-1)}return s}enableEffect(e){e=e!==null&&eA(e)?e.effect:e,!(!e||e===this._currentEffect)&&(this._stencilStateComposer.stencilMaterial=void 0,this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setInt(e,t){return e?(this._gl.uniform1i(e,t),!0):!1}setInt2(e,t,s){return e?(this._gl.uniform2i(e,t,s),!0):!1}setInt3(e,t,s,n){return e?(this._gl.uniform3i(e,t,s,n),!0):!1}setInt4(e,t,s,n,a){return e?(this._gl.uniform4i(e,t,s,n,a),!0):!1}setIntArray(e,t){return e?(this._gl.uniform1iv(e,t),!0):!1}setIntArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2iv(e,t),!0)}setIntArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3iv(e,t),!0)}setIntArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4iv(e,t),!0)}setUInt(e,t){return e?(this._gl.uniform1ui(e,t),!0):!1}setUInt2(e,t,s){return e?(this._gl.uniform2ui(e,t,s),!0):!1}setUInt3(e,t,s,n){return e?(this._gl.uniform3ui(e,t,s,n),!0):!1}setUInt4(e,t,s,n,a){return e?(this._gl.uniform4ui(e,t,s,n,a),!0):!1}setUIntArray(e,t){return e?(this._gl.uniform1uiv(e,t),!0):!1}setUIntArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2uiv(e,t),!0)}setUIntArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3uiv(e,t),!0)}setUIntArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4uiv(e,t),!0)}setArray(e,t){return!e||t.length<1?!1:(this._gl.uniform1fv(e,t),!0)}setArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2fv(e,t),!0)}setArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3fv(e,t),!0)}setArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4fv(e,t),!0)}setMatrices(e,t){return e?(this._gl.uniformMatrix4fv(e,!1,t),!0):!1}setMatrix3x3(e,t){return e?(this._gl.uniformMatrix3fv(e,!1,t),!0):!1}setMatrix2x2(e,t){return e?(this._gl.uniformMatrix2fv(e,!1,t),!0):!1}setFloat(e,t){return e?(this._gl.uniform1f(e,t),!0):!1}setFloat2(e,t,s){return e?(this._gl.uniform2f(e,t,s),!0):!1}setFloat3(e,t,s,n){return e?(this._gl.uniform3f(e,t,s,n),!0):!1}setFloat4(e,t,s,n,a){return e?(this._gl.uniform4f(e,t,s,n,a),!0):!1}applyStates(){if(this._depthCullingState.apply(this._gl),this._stencilStateComposer.apply(this._gl),this._alphaState.apply(this._gl,this._currentRenderTarget&&this._currentRenderTarget.textures?this._currentRenderTarget.textures.length:1),this._colorWriteChanged){this._colorWriteChanged=!1;const e=this._colorWrite;this._gl.colorMask(e,e,e,e)}}wipeCaches(e){this.preventCacheWipeBetweenFrames&&!e||(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._resetAlphaMode(),this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))}_getSamplingParameters(e,t){const s=this._gl;let n=s.NEAREST,a=s.NEAREST,l=!1;switch(e){case 11:n=s.LINEAR,t?a=s.LINEAR_MIPMAP_NEAREST:a=s.LINEAR;break;case 3:n=s.LINEAR,l=!0,t?a=s.LINEAR_MIPMAP_LINEAR:a=s.LINEAR;break;case 8:l=!0,n=s.NEAREST,t?a=s.NEAREST_MIPMAP_LINEAR:a=s.NEAREST;break;case 4:n=s.NEAREST,t?a=s.NEAREST_MIPMAP_NEAREST:a=s.NEAREST;break;case 5:n=s.NEAREST,t?a=s.LINEAR_MIPMAP_NEAREST:a=s.LINEAR;break;case 6:l=!0,n=s.NEAREST,t?a=s.LINEAR_MIPMAP_LINEAR:a=s.LINEAR;break;case 7:n=s.NEAREST,a=s.LINEAR;break;case 1:n=s.NEAREST,a=s.NEAREST;break;case 9:n=s.LINEAR,t?a=s.NEAREST_MIPMAP_NEAREST:a=s.NEAREST;break;case 10:l=!0,n=s.LINEAR,t?a=s.NEAREST_MIPMAP_LINEAR:a=s.NEAREST;break;case 2:n=s.LINEAR,a=s.LINEAR;break;case 12:n=s.LINEAR,a=s.NEAREST;break}return{min:a,mag:n,hasMipMaps:l}}_createTexture(){const e=this._gl.createTexture();if(!e)throw new Error("Unable to create texture");return e}_createHardwareTexture(){return new $p(this._createTexture(),this._gl)}_createInternalTexture(e,t,s=!0,n=0){let a,l=!1,u=0,h=3,f=5,m=!1,p=1,b,v=!1,R=0,x=!1;t!==void 0&&typeof t=="object"?(a=!!t.generateMipMaps,l=!!t.createMipMaps,u=t.type===void 0?0:t.type,h=t.samplingMode===void 0?3:t.samplingMode,f=t.format===void 0?5:t.format,m=t.useSRGBBuffer===void 0?!1:t.useSRGBBuffer,p=t.samples??1,b=t.label,v=!!t.createMSAATexture,R=t.comparisonFunction||0,x=!!t.isCube):a=!!t,m&&(m=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(u===1&&!this._caps.textureFloatLinearFiltering||u===2&&!this._caps.textureHalfFloatLinearFiltering)&&(h=1),u===1&&!this._caps.textureFloat&&(u=0,Re.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const T=G0(f),E=lc(f),A=this._gl,D=new ai(this,n),M=e.width||e,k=e.height||e,U=e.depth||0,N=e.layers||0,H=this._getSamplingParameters(h,(a||l)&&!T),q=N!==0?A.TEXTURE_2D_ARRAY:U!==0?A.TEXTURE_3D:x?A.TEXTURE_CUBE_MAP:A.TEXTURE_2D,re=T?this._getInternalFormatFromDepthTextureFormat(f,!0,E):this._getRGBABufferInternalSizedFormat(u,f,m),ce=T?E?A.DEPTH_STENCIL:A.DEPTH_COMPONENT:this._getInternalFormat(f),ae=T?this._getWebGLTextureTypeFromDepthTextureFormat(f):this._getWebGLTextureType(u);if(this._bindTextureDirectly(q,D),N!==0)D.is2DArray=!0,A.texImage3D(q,0,re,M,k,N,0,ce,ae,null);else if(U!==0)D.is3D=!0,A.texImage3D(q,0,re,M,k,U,0,ce,ae,null);else if(x){D.isCube=!0;for(let fe=0;fe<6;fe++)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+fe,0,re,M,k,0,ce,ae,null)}else A.texImage2D(q,0,re,M,k,0,ce,ae,null);if(A.texParameteri(q,A.TEXTURE_MAG_FILTER,H.mag),A.texParameteri(q,A.TEXTURE_MIN_FILTER,H.min),A.texParameteri(q,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(q,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),T&&this.webGLVersion>1&&(R===0?(A.texParameteri(q,A.TEXTURE_COMPARE_FUNC,515),A.texParameteri(q,A.TEXTURE_COMPARE_MODE,A.NONE)):(A.texParameteri(q,A.TEXTURE_COMPARE_FUNC,R),A.texParameteri(q,A.TEXTURE_COMPARE_MODE,A.COMPARE_REF_TO_TEXTURE))),(a||l)&&this._gl.generateMipmap(q),this._bindTextureDirectly(q,null),D._useSRGBBuffer=m,D.baseWidth=M,D.baseHeight=k,D.width=M,D.height=k,D.depth=N||U,D.isReady=!0,D.samples=p,D.generateMipMaps=a,D.samplingMode=h,D.type=u,D.format=f,D.label=b,D.comparisonFunction=R,this._internalTexturesCache.push(D),v){let fe;if(G0(D.format)?fe=this._setupFramebufferDepthAttachments(lc(D.format),D.format!==19,D.width,D.height,p,D.format,!0):fe=this._createRenderBuffer(D.width,D.height,p,-1,this._getRGBABufferInternalSizedFormat(D.type,D.format,D._useSRGBBuffer),-1),!fe)throw new Error("Unable to create render buffer");D._autoMSAAManagement=!0;let _e=D._hardwareTexture;_e||(_e=D._hardwareTexture=this._createHardwareTexture()),_e.addMSAARenderBuffer(fe)}return D}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,s,n,a=3,l=null,u=null,h=null,f=null,m=null,p=null,b,v,R,x){return this._createTextureBase(e,t,s,n,a,l,u,(...T)=>this._prepareWebGLTexture(...T,m),(T,E,A,D,M,k)=>{const U=this._gl,N=A.width===T&&A.height===E;M._creationFlags=R??0;const H=this._getTexImageParametersForCreateTexture(M.format,M._useSRGBBuffer);if(N)return U.texImage2D(U.TEXTURE_2D,0,H.internalFormat,H.format,H.type,A),!1;const q=this._caps.maxTextureSize;if(A.width>q||A.height>q||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext||(this._workingCanvas.width=T,this._workingCanvas.height=E,this._workingContext.drawImage(A,0,0,A.width,A.height,0,0,T,E),U.texImage2D(U.TEXTURE_2D,0,H.internalFormat,H.format,H.type,this._workingCanvas),M.width=T,M.height=E),!1;{const re=new ai(this,2);this._bindTextureDirectly(U.TEXTURE_2D,re,!0),U.texImage2D(U.TEXTURE_2D,0,H.internalFormat,H.format,H.type,A),this._rescaleTexture(re,M,n,H.format,()=>{this._releaseTexture(re),this._bindTextureDirectly(U.TEXTURE_2D,M,!0),k()})}return!0},h,f,m,p,b,v,x)}_getTexImageParametersForCreateTexture(e,t){let s,n;return this.webGLVersion===1?(s=this._getInternalFormat(e,t),n=s):(s=this._getInternalFormat(e,!1),n=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:n,format:s,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,s,n,a){}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,s=!1){const n=this._getTextureTarget(t),a=this._getSamplingParameters(e,t.useMipMaps||s);this._setTextureParameterInteger(n,this._gl.TEXTURE_MAG_FILTER,a.mag,t),this._setTextureParameterInteger(n,this._gl.TEXTURE_MIN_FILTER,a.min),s&&a.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(n)),this._bindTextureDirectly(n,null),t.samplingMode=e}updateTextureDimensions(e,t,s,n=1){}updateTextureWrappingMode(e,t,s=null,n=null){const a=this._getTextureTarget(e);t!==null&&(this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),s!==null&&(this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(s),e),e._cachedWrapV=s),(e.is2DArray||e.is3D)&&n!==null&&(this._setTextureParameterInteger(a,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(n),e),e._cachedWrapR=n),this._bindTextureDirectly(a,null)}_uploadCompressedDataToTextureDirectly(e,t,s,n,a,l=0,u=0){const h=this._gl;let f=h.TEXTURE_2D;if(e.isCube&&(f=h.TEXTURE_CUBE_MAP_POSITIVE_X+l),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=h.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=h.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=h.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 37809:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;break;case 37810:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;break;case 37811:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;break;case 37812:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;break;case 37813:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;break;case 37814:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;break;case 37815:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;break;case 37816:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;break;case 37817:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;break;case 37818:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;break;case 37819:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;break;case 37820:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;break;case 37821:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;break;case 33776:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1;break}if(e.generateMipMaps){const m=e._hardwareTexture;m.memoryAllocated||(h.texStorage2D(e.isCube?h.TEXTURE_CUBE_MAP:h.TEXTURE_2D,Math.floor(Math.log2(Math.max(s,n)))+1,t,e.width,e.height),m.memoryAllocated=!0),this._gl.compressedTexSubImage2D(f,u,0,0,s,n,t,a)}else this._gl.compressedTexImage2D(f,u,t,s,n,0,a)}_uploadDataToTextureDirectly(e,t,s=0,n=0,a,l=!1){const u=this._gl,h=this._getWebGLTextureType(e.type),f=this._getInternalFormat(e.format),m=a===void 0?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(a,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let p=u.TEXTURE_2D;e.isCube&&(p=u.TEXTURE_CUBE_MAP_POSITIVE_X+s);const b=Math.round(Math.log(e.width)*Math.LOG2E),v=Math.round(Math.log(e.height)*Math.LOG2E),R=l?e.width:Math.pow(2,Math.max(b-n,0)),x=l?e.height:Math.pow(2,Math.max(v-n,0));u.texImage2D(p,n,m,R,x,0,f,h,t)}updateTextureData(e,t,s,n,a,l,u=0,h=0,f=!1){const m=this._gl,p=this._getWebGLTextureType(e.type),b=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let v=m.TEXTURE_2D,R=m.TEXTURE_2D;e.isCube&&(R=m.TEXTURE_CUBE_MAP_POSITIVE_X+u,v=m.TEXTURE_CUBE_MAP),this._bindTextureDirectly(v,e,!0),m.texSubImage2D(R,h,s,n,a,l,b,p,t),f&&this._gl.generateMipmap(R),this._bindTextureDirectly(v,null)}_uploadArrayBufferViewToTexture(e,t,s=0,n=0){const a=this._gl,l=e.isCube?a.TEXTURE_CUBE_MAP:a.TEXTURE_2D;this._bindTextureDirectly(l,e,!0),this._uploadDataToTextureDirectly(e,t,s,n),this._bindTextureDirectly(l,null,!0)}_prepareWebGLTextureContinuation(e,t,s,n,a){const l=this._gl;if(!l)return;const u=this._getSamplingParameters(a,!s);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,u.mag),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,u.min),!s&&!n&&l.generateMipmap(l.TEXTURE_2D),this._bindTextureDirectly(l.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,s,n,a,l,u,h,f,m){const p=this.getCaps().maxTextureSize,b=Math.min(p,this.needPOTTextures?Qp(n.width,p):n.width),v=Math.min(p,this.needPOTTextures?Qp(n.height,p):n.height),R=this._gl;if(R){if(!e._hardwareTexture){s&&s.removePendingData(e);return}this._bindTextureDirectly(R.TEXTURE_2D,e,!0),this._unpackFlipY(a===void 0?!0:!!a),e.baseWidth=n.width,e.baseHeight=n.height,e.width=b,e.height=v,e.isReady=!0,e.type=e.type!==-1?e.type:0,e.format=e.format!==-1?e.format:m??(t===".jpg"&&!e._useSRGBBuffer?4:5),!h(b,v,n,t,e,()=>{this._prepareWebGLTextureContinuation(e,s,l,u,f)})&&this._prepareWebGLTextureContinuation(e,s,l,u,f)}}_getInternalFormatFromDepthTextureFormat(e,t,s){const n=this._gl;if(!t)return n.STENCIL_INDEX8;let l=s?n.DEPTH_STENCIL:n.DEPTH_COMPONENT;return this.webGLVersion>1?e===15?l=n.DEPTH_COMPONENT16:e===16?l=n.DEPTH_COMPONENT24:e===17||e===13?l=s?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24:e===14?l=n.DEPTH_COMPONENT32F:e===18&&(l=s?n.DEPTH32F_STENCIL8:n.DEPTH_COMPONENT32F):l=n.DEPTH_COMPONENT16,l}_getWebGLTextureTypeFromDepthTextureFormat(e){const t=this._gl;let s=t.UNSIGNED_INT;return e===15?s=t.UNSIGNED_SHORT:e===17||e===13?s=t.UNSIGNED_INT_24_8:e===14?s=t.FLOAT:e===18?s=t.FLOAT_32_UNSIGNED_INT_24_8_REV:e===19&&(s=t.UNSIGNED_BYTE),s}_setupFramebufferDepthAttachments(e,t,s,n,a=1,l,u=!1){const h=this._gl;l=l??(e?13:14);const f=this._getInternalFormatFromDepthTextureFormat(l,t,e);return e&&t?this._createRenderBuffer(s,n,a,h.DEPTH_STENCIL,f,u?-1:h.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(s,n,a,f,f,u?-1:h.DEPTH_ATTACHMENT):e?this._createRenderBuffer(s,n,a,f,f,u?-1:h.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,s,n,a,l,u=!0){const f=this._gl.createRenderbuffer();return this._updateRenderBuffer(f,e,t,s,n,a,l,u)}_updateRenderBuffer(e,t,s,n,a,l,u,h=!0){const f=this._gl;return f.bindRenderbuffer(f.RENDERBUFFER,e),n>1&&f.renderbufferStorageMultisample?f.renderbufferStorageMultisample(f.RENDERBUFFER,n,l,t,s):f.renderbufferStorage(f.RENDERBUFFER,a,t,s),u!==-1&&f.framebufferRenderbuffer(f.FRAMEBUFFER,u,f.RENDERBUFFER,e),h&&f.bindRenderbuffer(f.RENDERBUFFER,null),e}_releaseTexture(e){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();const t=this._internalTexturesCache.indexOf(e);t!==-1&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e?.release()}_setProgram(e){this._currentProgram!==e&&(T3(e,this._gl),this._currentProgram=e)}bindSamplers(e){const t=e.getPipelineContext();this._setProgram(t.program);const s=e.getSamplers();for(let n=0;n<s.length;n++){const a=e.getUniform(s[n]);a&&(this._boundUniforms[n]=a)}this._currentEffect=null}_activateCurrentTexture(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,s=!1,n=!1){let a=!1;const l=t&&t._associatedChannel>-1;if(s&&l&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||n){if(this._activateCurrentTexture(),t&&t.isMultiview)throw Re.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,t?._hardwareTexture?.underlyingResource??null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else s&&(a=!0,this._activateCurrentTexture());return l&&!s&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),a}_bindTexture(e,t,s){if(e===void 0)return;t&&(t._associatedChannel=e),this._activeChannel=e;const n=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(n,t)}unbindAllTextures(){for(let e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,s,n){e!==void 0&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,s))}_bindSamplerUniformToChannel(e,t){const s=this._boundUniforms[e];!s||s._currentState===t||(this._gl.uniform1i(s,t),s._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:return this._gl.REPEAT;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,s=!1,n=!1,a=""){if(!t)return this._boundTexturesCache[e]!=null&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;const f=t.getInternalTexture();f&&(f._associatedChannel=e),t.update()}else if(t.delayLoadState===4)return t.delayLoad(),!1;let l;n?l=t.depthStencilTexture:t.isReady()?l=t.getInternalTexture():t.isCube?l=this.emptyCubeTexture:t.is3D?l=this.emptyTexture3D:t.is2DArray?l=this.emptyTexture2DArray:l=this.emptyTexture,!s&&l&&(l._associatedChannel=e);let u=!0;this._boundTexturesCache[e]===l&&(s||this._bindSamplerUniformToChannel(l._associatedChannel,e),u=!1),this._activeChannel=e;const h=this._getTextureTarget(l);if(u&&this._bindTextureDirectly(h,l,s),l&&!l.isMultiview){if(l.isCube&&l._cachedCoordinatesMode!==t.coordinatesMode){l._cachedCoordinatesMode=t.coordinatesMode;const f=t.coordinatesMode!==3&&t.coordinatesMode!==5?1:0;t.wrapU=f,t.wrapV=f}l._cachedWrapU!==t.wrapU&&(l._cachedWrapU=t.wrapU,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),l)),l._cachedWrapV!==t.wrapV&&(l._cachedWrapV=t.wrapV,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),l)),l.is3D&&l._cachedWrapR!==t.wrapR&&(l._cachedWrapR=t.wrapR,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),l)),this._setAnisotropicLevel(h,l,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,s,n){if(!(e===void 0||!t)){(!this._textureUnits||this._textureUnits.length!==s.length)&&(this._textureUnits=new Int32Array(s.length));for(let a=0;a<s.length;a++){const l=s[a].getInternalTexture();l?(this._textureUnits[a]=e+a,l._associatedChannel=e+a):this._textureUnits[a]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let a=0;a<s.length;a++)this._setTexture(this._textureUnits[a],s[a],!0)}}_setAnisotropicLevel(e,t,s){const n=this._caps.textureAnisotropicFilterExtension;t.samplingMode!==11&&t.samplingMode!==3&&t.samplingMode!==2&&(s=1),n&&t._cachedAnisotropicFilteringLevel!==s&&(this._setTextureParameterFloat(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=s)}_setTextureParameterFloat(e,t,s,n){this._bindTextureDirectly(e,n,!0,!0),this._gl.texParameterf(e,t,s)}_setTextureParameterInteger(e,t,s,n){n&&this._bindTextureDirectly(e,n,!0,!0),this._gl.texParameteri(e,t,s)}unbindAllAttributes(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(let e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e);return}for(let e=0,t=this._vertexAttribArraysEnabled.length;e<t;e++)e>=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}releaseEffects(){this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}dispose(){Bs()&&this._renderingCanvas&&(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&this._gl.getExtension("WEBGL_lose_context")?.loseContext(),ap(this._gl)}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){const t=this._gl;for(;t.getError()!==t.NO_ERROR;);let s=!0;const n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);const a=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,a),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);const l=t.checkFramebufferStatus(t.FRAMEBUFFER);if(s=s&&l===t.FRAMEBUFFER_COMPLETE,s=s&&t.getError()===t.NO_ERROR,s&&(t.clear(t.COLOR_BUFFER_BIT),s=s&&t.getError()===t.NO_ERROR),s){t.bindFramebuffer(t.FRAMEBUFFER,null);const u=t.RGBA,h=t.UNSIGNED_BYTE,f=new Uint8Array(4);t.readPixels(0,0,1,1,u,h,f),s=s&&t.getError()===t.NO_ERROR}for(t.deleteTexture(n),t.deleteFramebuffer(a),t.bindFramebuffer(t.FRAMEBUFFER,null);!s&&t.getError()!==t.NO_ERROR;);return s}_getWebGLTextureType(e){if(this._webGLVersion===1){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:return this._gl.UNSIGNED_BYTE;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:return this._gl.UNSIGNED_BYTE;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let s=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:s=this._gl.ALPHA;break;case 1:s=this._gl.LUMINANCE;break;case 2:s=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:s=this._gl.RED;break;case 7:case 33324:case 36761:s=this._gl.RG;break;case 4:case 32852:case 36762:s=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:s=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;break}if(this._webGLVersion>1)switch(e){case 8:s=this._gl.RED_INTEGER;break;case 9:s=this._gl.RG_INTEGER;break;case 10:s=this._gl.RGB_INTEGER;break;case 11:s=this._gl.RGBA_INTEGER;break}return s}_getRGBABufferInternalSizedFormat(e,t,s=!1){if(this._webGLVersion===1){if(t!==void 0)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return s?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return s?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return s?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;case 11:return this._gl.RGBA16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;case 11:return this._gl.RGBA16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;case 11:return this._gl.RGBA32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;case 11:return this._gl.RGBA32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;case 5:return this._gl.RGBA32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;case 5:return this._gl.RGBA16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return s?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,s,n,a=!0,l=!0,u=null){const h=a?4:3,f=a?this._gl.RGBA:this._gl.RGB,m=s*n*h;if(!u)u=new Uint8Array(m);else if(u.length<m)return Re.Error(`Data buffer is too small to store the read pixels (${u.length} should be more than ${m})`),Promise.resolve(u);return l&&this.flushFramebuffer(),this._gl.readPixels(e,t,s,n,f,this._gl.UNSIGNED_BYTE,u),Promise.resolve(u)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(this._HasMajorPerformanceCaveat!==null)return!this._HasMajorPerformanceCaveat;if(this._IsSupported===null)try{const e=Be._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=t!=null&&!!globalThis.WebGLRenderingContext}catch{this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(this._HasMajorPerformanceCaveat===null)try{const e=Be._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch{this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}it._TempClearColorUint32=new Uint32Array(4);it._TempClearColorInt32=new Int32Array(4);it.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}];it._ConcatenateShader=X1;it._IsSupported=null;it._HasMajorPerformanceCaveat=null;class ej{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new tj(e)}sampleFrame(e=lr.Now){if(this._enabled){if(this._lastFrameTimeMs!=null){const t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){return this._rollingFrameTime.average}get averageFrameTimeVariance(){return this._rollingFrameTime.variance}get instantaneousFrameTime(){return this._rollingFrameTime.history(0)}get averageFPS(){return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){const e=this._rollingFrameTime.history(0);return e===0?0:1e3/e}get isSaturated(){return this._rollingFrameTime.isSaturated()}enable(){this._enabled=!0}disable(){this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){return this._enabled}reset(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}class tj{constructor(e){this._samples=new Array(e),this.reset()}add(e){let t;if(this.isSaturated()){const s=this._samples[this._pos];t=s-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(s-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;const t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){return this._sampleCount>=this._samples.length}reset(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){const t=this._samples.length;return(e%t+t)%t}}function sj(i){!i||!i.setAttribute||(i.setAttribute("touch-action","none"),i.style.touchAction="none",i.style.webkitTapHighlightColor="transparent")}function ij(i,e,t){i._onCanvasFocus=()=>{i.onCanvasFocusObservable.notifyObservers(i)},i._onCanvasBlur=()=>{i.onCanvasBlurObservable.notifyObservers(i)},i._onCanvasContextMenu=n=>{i.disableContextMenu&&n.preventDefault()},e.addEventListener("focus",i._onCanvasFocus),e.addEventListener("blur",i._onCanvasBlur),e.addEventListener("contextmenu",i._onCanvasContextMenu),i._onBlur=()=>{i.disablePerformanceMonitorInBackground&&i.performanceMonitor.disable(),i._windowIsBackground=!0},i._onFocus=()=>{i.disablePerformanceMonitorInBackground&&i.performanceMonitor.enable(),i._windowIsBackground=!1},i._onCanvasPointerOut=n=>{document.elementFromPoint(n.clientX,n.clientY)!==e&&i.onCanvasPointerOutObservable.notifyObservers(n)};const s=i.getHostWindow();s&&typeof s.addEventListener=="function"&&(s.addEventListener("blur",i._onBlur),s.addEventListener("focus",i._onFocus)),e.addEventListener("pointerout",i._onCanvasPointerOut),t.doNotHandleTouchAction||sj(e),!Be.audioEngine&&t.audioEngine&&Be.AudioEngineFactory&&(Be.audioEngine=Be.AudioEngineFactory(i.getRenderingCanvas(),i.getAudioContext(),i.getAudioDestination())),Ta()&&(i._onFullscreenChange=()=>{i.isFullscreen=!!document.fullscreenElement,i.isFullscreen&&i._pointerLockRequested&&e&&nA(e)},document.addEventListener("fullscreenchange",i._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",i._onFullscreenChange,!1),i._onPointerLockChange=()=>{i.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",i._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",i._onPointerLockChange,!1)),i.enableOfflineSupport=Be.OfflineProviderFactory!==void 0,i._deterministicLockstep=!!t.deterministicLockstep,i._lockstepMaxSteps=t.lockstepMaxSteps||0,i._timeStep=t.timeStep||1/60}function nj(i,e){pt.Instances.length===1&&Be.audioEngine&&(Be.audioEngine.dispose(),Be.audioEngine=null);const t=i.getHostWindow();t&&typeof t.removeEventListener=="function"&&(t.removeEventListener("blur",i._onBlur),t.removeEventListener("focus",i._onFocus)),e&&(e.removeEventListener("focus",i._onCanvasF
469ocus),e.removeEventListener("blur",i._onCanvasBlur),e.removeEventListener("pointerout",i._onCanvasPointerOut),e.removeEventListener("contextmenu",i._onCanvasContextMenu)),Ta()&&(document.removeEventListener("fullscreenchange",i._onFullscreenChange),document.removeEventListener("mozfullscreenchange",i._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",i._onFullscreenChange),document.removeEventListener("msfullscreenchange",i._onFullscreenChange),document.removeEventListener("pointerlockchange",i._onPointerLockChange),document.removeEventListener("mspointerlockchange",i._onPointerLockChange),document.removeEventListener("mozpointerlockchange",i._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",i._onPointerLockChange))}function rj(i){const e=aj(i);if(e)return e;const t=oj(i);return t||lj(i)}function aj(i){if(!Ta()||!document.body)return null;const e=document.createElement("span");e.textContent="Hg",e.style.font=i;const t=document.createElement("div");t.style.display="inline-block",t.style.width="1px",t.style.height="0px",t.style.verticalAlign="bottom";const s=document.createElement("div");s.style.whiteSpace="nowrap",s.appendChild(e),s.appendChild(t),document.body.appendChild(s);let n,a;try{a=t.getBoundingClientRect().top-e.getBoundingClientRect().top,t.style.verticalAlign="baseline",n=t.getBoundingClientRect().top-e.getBoundingClientRect().top}finally{document.body.removeChild(s)}const l={ascent:n,height:a,descent:a-n};return iA(l)?l:null}function oj(i){let e=null;try{typeof OffscreenCanvas<"u"?e=new OffscreenCanvas(64,64):Ta()&&typeof document.createElement=="function"&&(e=document.createElement("canvas"),e.width=64,e.height=64);const t=e?.getContext("2d");if(!t)return null;t.font=i;const s=t.measureText("Hg"),n=Number(s.actualBoundingBoxAscent??s.fontBoundingBoxAscent),a=Number(s.actualBoundingBoxDescent??s.fontBoundingBoxDescent),l={ascent:n,height:n+a,descent:a};return iA(l)?l:null}catch{return null}finally{const t=e;typeof t?.dispose=="function"&&t.dispose()}}function lj(i){const e=Math.max(1,cj(i)),t=e*.8,s=e*.2;return{ascent:t,height:t+s,descent:s}}function cj(i){const e=/(?:^|\s)([0-9]+(?:\.[0-9]+)?)px(?:\/|\s|$)/.exec(String(i||""));return e?Number(e[1]):16}function iA(i){return Number.isFinite(i.ascent)&&Number.isFinite(i.height)&&Number.isFinite(i.descent)&&i.height>0}async function uj(i,e,t){return await new Promise((s,n)=>{const a=new Image;a.onload=()=>{a.decode().then(()=>{i.createImageBitmap(a,t).then(l=>{s(l)})})},a.onerror=()=>{n(`Error loading image ${a.src}`)},a.src=e})}function hj(i,e,t,s){const a=i.createCanvas(t,s).getContext("2d");if(!a)throw new Error("Unable to get 2d context for resizeImageBitmap");return a.drawImage(e,0,0),a.getImageData(0,0,t,s).data}function dj(i){const e=i.requestFullscreen||i.webkitRequestFullscreen;e&&e.call(i)}function fj(){const i=document;document.exitFullscreen?document.exitFullscreen():i.webkitCancelFullScreen&&i.webkitCancelFullScreen()}function nA(i){if(i.requestPointerLock){const e=i.requestPointerLock();e instanceof Promise?e.then(()=>{i.focus()}).catch(()=>{}):i.focus()}}function _j(){document.exitPointerLock&&document.exitPointerLock()}class nn{get min(){return this._min}get max(){return this._max}get average(){return this._average}get lastSecAverage(){return this._lastSecAverage}get current(){return this._current}get total(){return this._totalAccumulated}get count(){return this._totalValueCount}constructor(){this._startMonitoringTime=0,this._min=0,this._max=0,this._hasResult=!1,this._hasCurrentValue=!1,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}fetchNewFrame(){this._totalValueCount++,this._current=0,this._hasCurrentValue=nn.Enabled,this._lastSecValueCount++}addCount(e,t){nn.Enabled&&(this._current+=e,this._hasCurrentValue=!0,t&&this._fetchResult())}beginMonitoring(){nn.Enabled&&(this._startMonitoringTime=lr.Now)}endMonitoring(e=!0){if(!nn.Enabled)return;e&&this.fetchNewFrame();const t=lr.Now;this._current=t-this._startMonitoringTime,this._hasCurrentValue=!0,e&&this._fetchResult()}endFrame(){this._fetchResult()}
vendor: 6,877 bytes, line 469
469_fetchResult(){if(!this._hasCurrentValue)return;this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._hasResult?(this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current)):(this._min=this._current,this._max=this._current,this._hasResult=!0),this._average=this._totalAccumulated/this._totalValueCount;const e=lr.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}nn.Enabled=!0;let z0=!1;function rA(){z0||(z0=!0,Be.prototype.getInputElement=function(){return this._renderingCanvas},Be.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},Be.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},Be.prototype.getAspectRatio=function(i,e=!1){const t=i.viewport;return this.getRenderWidth(e)*t.width/(this.getRenderHeight(e)*t.height)},Be.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},Be.prototype._verifyPointerLock=function(){this._onPointerLockChange?.()})}let H0=!1;function ng(){H0||(H0=!0,Be.prototype.getRenderPassNames=function(){return this._renderPassNames},Be.prototype.getCurrentRenderPassName=function(){return this._renderPassNames[this.currentRenderPassId]},Be.prototype.createRenderPassId=function(i){const e=++Be._RenderPassIdCounter;return this._renderPassNames[e]=i??"NONAME",e},Be.prototype.releaseRenderPassId=function(i){this._renderPassNames[i]=void 0;for(let e=0;e<this.scenes.length;++e){const t=this.scenes[e];for(let s=0;s<t.meshes.length;++s){const n=t.meshes[s];if(n._releaseRenderPassId(i),n.subMeshes)for(let a=0;a<n.subMeshes.length;++a)n.subMeshes[a]._removeDrawWrapper(i)}}})}class Ce extends it{static get NpmPackage(){return Be.NpmPackage}static get Version(){return Be.Version}static get Instances(){return pt.Instances}static get LastCreatedEngine(){return pt.LastCreatedEngine}static get LastCreatedScene(){return pt.LastCreatedScene}static DefaultLoadingScreenFactory(e){return Be.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){return!!Ce._RescalePostProcessFactory}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){return this._performanceMonitor}constructor(e,t,s,n=!1){rA(),ng(),super(e,t,s,n),this._performanceMonitor=new ej,this._drawCalls=new nn,e&&(this._features.supportRenderPasses=!0)}_initGLContext(){super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){super._sharedInit(e),ij(this,e,this._creationOptions)}resizeImageBitmap(e,t,s){return hj(this,e,t,s)}async _createImageBitmapFromSource(e,t){return await uj(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&dj(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&fj()}setDitheringState(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}setDirectViewport(e,t,s,n){const a=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,s,n),a}scissorClear(e,t,s,n,a){this.enableScissor(e,t,s,n),this.clear(a,!0,!0,!0),this.disableScissor()}getVertexShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){for(const e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(const e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){return rj(e)}enterPointerlock(){this._renderingCanvas&&nA(this._renderingCanvas)}exitPointerlock(){_j()}beginFrame(){this._measureFps(),super.beginFrame()}_deletePipelineContext(e){const t=e;t&&t.program&&t.transformFeedback&&(this.deleteTransformFeedback(t.transformFeedback),t.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,s,n,a,l=null){a=a||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);const u=super.createShaderProgram(e,t,s,n,a,l);return this.onAfterShaderCompilationObservable.notifyObservers(this),u}_createShaderProgram(e,t,s,n,a=null){const l=n.createProgram();if(e.program=l,!l)throw new Error("Unable to create program");if(n.attachShader(l,t),n.attachShader(l,s),this.webGLVersion>1&&a){const u=this.createTransformFeedback();this.bindTransformFeedback(u),this.setTranformFeedbackVaryings(l,a),e.transformFeedback=u}return n.linkProgram(l),this.webGLVersion>1&&a&&this.bindTransformFeedback(null),e.context=n,e.vertexShader=t,e.fragmentShader=s,e.isParallelCompiled||this._finalizePipelineContext(e),l}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){super._releaseRenderTargetWrapper(e);for(const t of this.scenes){for(const s of t.postProcesses)s._outputTexture===e&&(s._outputTexture=null);for(const s of t.cameras)for(const n of s._postProcesses)n&&n._outputTexture===e&&(n._outputTexture=null)}}_rescaleTexture(e,t,s,n,a){this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);const l=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&Ce._RescalePostProcessFactory&&(this._rescalePostProcess=Ce._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;const u=()=>{this._rescalePostProcess.onApply=function(m){m._bindTexture("textureSampler",e)};let f=s;f||(f=this.scenes[this.scenes.length-1]),f.postProcessManager.directRender([this._rescalePostProcess],l,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,n,0,0,t.width,t.height,0),this.unBindFramebuffer(l),l.dispose(),a&&a()},h=this._rescalePostProcess.getEffect();h?h.executeWhenCompiled(u):this._rescalePostProcess.onEffectCreatedObservable.addOnce(f=>{f.executeWhenCompiled(u)})}}
vendor: 6,296 bytes, line 469
469wrapWebGLTexture(e,t=!1,s=3,n=0,a=0){const l=new $p(e,this._gl),u=new ai(this,15,!0);return u._hardwareTexture=l,u.baseWidth=n,u.baseHeight=a,u.width=n,u.height=a,u.isReady=!0,u.useMipMaps=t,this.updateTextureSamplingMode(s,u),u}updateWrappedWebGLTexture(e,t){if(e.source!==15)throw new Error("updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.");for(const n of this._renderTargetWrapperCache)if(n.textures?.includes(e)){if(n.isMulti)throw new Error("updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.");if(n._depthStencilTexture)throw new Error("updateWrappedWebGLTexture: wrapped texture's render-target wrapper has a depth/stencil texture; not supported. Dispose and re-wrap.")}e._hardwareTexture=new $p(t,this._gl),e.isReady=!0,e._cachedCoordinatesMode=null,e._cachedWrapU=null,e._cachedWrapV=null,e._cachedWrapR=null,e._cachedAnisotropicFilteringLevel=null;for(const n in this._boundTexturesCache)this._boundTexturesCache[n]===e&&(this._boundTexturesCache[n]=null);this.updateTextureSamplingMode(e.samplingMode,e);const s=this._gl;for(const n of this._renderTargetWrapperCache){if(n.texture!==e)continue;const a=n,l=n.samples,u=l>1;a._framebuffer&&s.deleteFramebuffer(a._framebuffer),!u&&a._depthStencilBuffer&&(s.deleteRenderbuffer(a._depthStencilBuffer),a._depthStencilBuffer=null);const h=this._currentFramebuffer,f=s.createFramebuffer();this._bindUnboundFramebuffer(f),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0),u||(a._depthStencilBuffer=this._setupFramebufferDepthAttachments(n._generateStencilBuffer,n._generateDepthBuffer,n.width,n.height)),this._bindUnboundFramebuffer(h),a._framebuffer=f,u&&(n._samples=1,this.updateRenderTargetTextureSampleCount(a,l))}}_uploadImageToTexture(e,t,s=0,n=0){const a=this._gl,l=this._getWebGLTextureType(e.type),u=this._getInternalFormat(e.format),h=this._getRGBABufferInternalSizedFormat(e.type,u),f=e.isCube?a.TEXTURE_CUBE_MAP:a.TEXTURE_2D;this._bindTextureDirectly(f,e,!0),this._unpackFlipY(e.invertY);let m=a.TEXTURE_2D;e.isCube&&(m=a.TEXTURE_CUBE_MAP_POSITIVE_X+s),a.texImage2D(m,n,h,u,l,t),this._bindTextureDirectly(f,null,!0)}updateTextureComparisonFunction(e,t){if(this.webGLVersion===1){Re.Error("WebGL 1 does not support texture comparison.");return}const s=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),t===0?(s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_COMPARE_FUNC,515),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_COMPARE_MODE,s.NONE)):(s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_COMPARE_FUNC,t),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),t===0?(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_FUNC,515),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_MODE,s.NONE)):(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_FUNC,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");const s=new oc(t);return s.capacity=e,this.bindArrayBuffer(s),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),s.references=1,s}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}async _clientWaitAsync(e,t=0,s=10){const n=this._gl;return await new Promise((a,l)=>{ig(()=>{const u=n.clientWaitSync(e,t,0);if(u==n.WAIT_FAILED)throw new Error("clientWaitSync failed");return u!=n.TIMEOUT_EXPIRED},a,l,s)})}_readPixelsAsync(e,t,s,n,a,l,u){if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");const h=this._gl,f=h.createBuffer();h.bindBuffer(h.PIXEL_PACK_BUFFER,f),h.bufferData(h.PIXEL_PACK_BUFFER,u.byteLength,h.STREAM_READ),h.readPixels(e,t,s,n,a,l,0),h.bindBuffer(h.PIXEL_PACK_BUFFER,null);const m=h.fenceSync(h.SYNC_GPU_COMMANDS_COMPLETE,0);return m?(h.flush(),this._clientWaitAsync(m,0,10).then(()=>(h.deleteSync(m),h.bindBuffer(h.PIXEL_PACK_BUFFER,f),h.getBufferSubData(h.PIXEL_PACK_BUFFER,0,u),h.bindBuffer(h.PIXEL_PACK_BUFFER,null),h.deleteBuffer(f),u))):null}dispose(){this.hideLoadingUI?.(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),nj(this,this._renderingCanvas),super.dispose()}}Ce.ALPHA_DISABLE=0;Ce.ALPHA_ADD=1;Ce.ALPHA_COMBINE=2;Ce.ALPHA_SUBTRACT=3;Ce.ALPHA_MULTIPLY=4;Ce.ALPHA_MAXIMIZED=5;Ce.ALPHA_ONEONE=6;Ce.ALPHA_PREMULTIPLIED=7;Ce.ALPHA_PREMULTIPLIED_PORTERDUFF=8;Ce.ALPHA_INTERPOLATE=9;Ce.ALPHA_SCREENMODE=10;Ce.DELAYLOADSTATE_NONE=0;Ce.DELAYLOADSTATE_LOADED=1;Ce.DELAYLOADSTATE_LOADING=2;Ce.DELAYLOADSTATE_NOTLOADED=4;Ce.NEVER=512;Ce.ALWAYS=519;Ce.LESS=513;Ce.EQUAL=514;Ce.LEQUAL=515;Ce.GREATER=516;Ce.GEQUAL=518;Ce.NOTEQUAL=517;Ce.KEEP=7680;Ce.REPLACE=7681;Ce.INCR=7682;Ce.DECR=7683;Ce.INVERT=5386;Ce.INCR_WRAP=34055;Ce.DECR_WRAP=34056;Ce.TEXTURE_CLAMP_ADDRESSMODE=0;Ce.TEXTURE_WRAP_ADDRESSMODE=1;Ce.TEXTURE_MIRROR_ADDRESSMODE=2;Ce.TEXTUREFORMAT_ALPHA=0;Ce.TEXTUREFORMAT_LUMINANCE=1;Ce.TEXTUREFORMAT_LUMINANCE_ALPHA=2;Ce.TEXTUREFORMAT_RGB=4;Ce.TEXTUREFORMAT_RGBA=5;Ce.TEXTUREFORMAT_RED=6;Ce.TEXTUREFORMAT_R=6;Ce.TEXTUREFORMAT_R16_UNORM=33322;Ce.TEXTUREFORMAT_RG16_UNORM=33324;Ce.TEXTUREFORMAT_RGB16_UNORM=32852;Ce.TEXTUREFORMAT_RGBA16_UNORM=32859;Ce.TEXTUREFORMAT_R16_SNORM=36760;Ce.TEXTUREFORMAT_RG16_SNORM=36761;Ce.TEXTUREFORMAT_RGB16_SNORM=36762;Ce.TEXTUREFORMAT_RGBA16_SNORM=36763;Ce.TEXTUREFORMAT_RG=7;Ce.TEXTUREFORMAT_RED_INTEGER=8;Ce.TEXTUREFORMAT_R_INTEGER=8;Ce.TEXTUREFORMAT_RG_INTEGER=9;Ce.TEXTUREFORMAT_RGB_INTEGER=10;Ce.TEXTUREFORMAT_RGBA_INTEGER=11;Ce.TEXTURETYPE_UNSIGNED_BYTE=0;Ce.TEXTURETYPE_UNSIGNED_INT=0;Ce.TEXTURETYPE_FLOAT=1;Ce.TEXTURETYPE_HALF_FLOAT=2;Ce.TEXTURETYPE_BYTE=3;Ce.TEXTURETYPE_SHORT=4;Ce.TEXTURETYPE_UNSIGNED_SHORT=5;Ce.TEXTURETYPE_INT=6;Ce.TEXTURETYPE_UNSIGNED_INTEGER=7;Ce.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8;Ce.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9;Ce.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10;Ce.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11;Ce.TEXTURETYPE_UNSIGNED_INT_24_8=12;Ce.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13;Ce.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14;Ce.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15;
469Ce.TEXTURE_NEAREST_SAMPLINGMODE=1;Ce.TEXTURE_BILINEAR_SAMPLINGMODE=2;Ce.TEXTURE_TRILINEAR_SAMPLINGMODE=3;Ce.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8;Ce.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11;Ce.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3;Ce.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4;Ce.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5;Ce.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6;Ce.TEXTURE_NEAREST_LINEAR=7;Ce.TEXTURE_NEAREST_NEAREST=1;Ce.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9;Ce.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10;Ce.TEXTURE_LINEAR_LINEAR=2;Ce.TEXTURE_LINEAR_NEAREST=12;Ce.TEXTURE_EXPLICIT_MODE=0;Ce.TEXTURE_SPHERICAL_MODE=1;Ce.TEXTURE_PLANAR_MODE=2;Ce.TEXTURE_CUBIC_MODE=3;Ce.TEXTURE_PROJECTION_MODE=4;Ce.TEXTURE_SKYBOX_MODE=5;Ce.TEXTURE_INVCUBIC_MODE=6;Ce.TEXTURE_EQUIRECTANGULAR_MODE=7;Ce.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8;Ce.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;Ce.SCALEMODE_FLOOR=1;Ce.SCALEMODE_NEAREST=2;Ce.SCALEMODE_CEILING=3;let V0=!1;function pj(){V0||(V0=!0,it.prototype.setAlphaMode=function(i,e=!1,t=0){if(this._alphaMode[t]===i){if(!e){const n=i===0;this.depthCullingState.depthMask!==n&&(this.depthCullingState.depthMask=n)}return}const s=i===0;this._alphaState.setAlphaBlend(!s,t),this._alphaState.setAlphaMode(i,t),e||(this.depthCullingState.depthMask=s),this._alphaMode[t]=i})}pj();let X0=!1;function mj(){if(X0)return;X0=!0;const i=new WeakMap,e=new WeakMap,t=new WeakMap,s=new WeakMap;it.prototype.getAlphaToCoverage=function(){return i.get(this)??!1},it.prototype.setAlphaToCoverage=function(n){i.get(this)===n&&(!this._gl||e.get(this)===this._gl)||(i.set(this,n),this._gl&&(n?this._gl.enable(this._gl.SAMPLE_ALPHA_TO_COVERAGE):this._gl.disable(this._gl.SAMPLE_ALPHA_TO_COVERAGE),e.set(this,this._gl)))},Object.defineProperty(it.prototype,"currentSampleCount",{get:function(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._gl?(s.get(this)!==this._gl&&(t.set(this,this._gl.getContextAttributes()?.antialias?Math.max(1,this._gl.getParameter(this._gl.SAMPLES)):1),s.set(this,this._gl)),t.get(this)):1},enumerable:!1,configurable:!0})}mj();let q0=!1;function gj(){if(q0)return;q0=!0;function i(s,n,a,l){let u,h=1;l===1?u=new Float32Array(n*a*4):l===2?(u=new Uint16Array(n*a*4),h=15360):l===7?u=new Uint32Array(n*a*4):u=new Uint8Array(n*a*4);for(let f=0;f<n;f++)for(let m=0;m<a;m++){const p=(m*n+f)*3,b=(m*n+f)*4;u[b+0]=s[p+0],u[b+1]=s[p+1],u[b+2]=s[p+2],u[b+3]=h}return u}function e(s){return function(n,a,l,u,h,f,m,p,b=null,v=0){const R=s?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,x=s?10:11,T=new ai(this,x);T.baseWidth=a,T.baseHeight=l,T.baseDepth=u,T.width=a,T.height=l,T.depth=u,T.format=h,T.type=v,T.generateMipMaps=f,T.samplingMode=p,s?T.is3D=!0:T.is2DArray=!0,this._doNotHandleContextLost||(T._bufferView=n),s?this.updateRawTexture3D(T,n,h,m,b,v):this.updateRawTexture2DArray(T,n,h,m,b,v),this._bindTextureDirectly(R,T,!0);const E=this._getSamplingParameters(p,f);return this._gl.texParameteri(R,this._gl.TEXTURE_MAG_FILTER,E.mag),this._gl.texParameteri(R,this._gl.TEXTURE_MIN_FILTER,E.min),f&&this._gl.generateMipmap(R),this._bindTextureDirectly(R,null),this._internalTexturesCache.push(T),T}}function t(s){return function(n,a,l,u,h=null,f=0){const m=s?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,p=this._getWebGLTextureType(f),b=this._getInternalFormat(l),v=this._getRGBABufferInternalSizedFormat(f,l);this._bindTextureDirectly(m,n,!0),this._unpackFlipY(u===void 0?!0:!!u),this._doNotHandleContextLost||(n._bufferView=a,n.format=l,n.invertY=u,n._compression=h),n.width%4!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),h&&a?this._gl.compressedTexImage3D(m,0,this.getCaps().s3tc[h],n.width,n.height,n.depth,0,a):this._gl.texImage3D(m,0,v,n.width,n.height,n.depth,0,b,p,a),n.generateMipMaps&&this._gl.generateMipmap(m),this._bindTextureDirectly(m,null),n.isReady=!0}}it.prototype.updateRawTexture=function(s,n,a,l,u=null,h=0,f=!1){if(!s)return;const m=this._getRGBABufferInternalSizedFormat(h,a,f),p=this._getInternalFormat(a),b=this._getWebGLTextureType(h);this._bindTextureDirectly(this._gl.TEXTURE_2D,s,!0),this._unpackFlipY(l===void 0?!0:!!l),this._doNotHandleContextLost||(s._bufferView=n,s.format=a,s.type=h,s.invertY=l,s._compression=u),s.width%4
vendor: 120,217 bytes, lines 469-472
469!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),u&&n?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[u],s.width,s.height,0,n):this._gl.texImage2D(this._gl.TEXTURE_2D,0,m,s.width,s.height,0,p,b,n),s.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),s.isReady=!0},it.prototype.createRawTexture=function(s,n,a,l,u,h,f,m=null,p=0,b=0,v=!1){const R=new ai(this,3);R.baseWidth=n,R.baseHeight=a,R.width=n,R.height=a,R.format=l,R.generateMipMaps=u,R.samplingMode=f,R.invertY=h,R._compression=m,R.type=p,R._useSRGBBuffer=this._getUseSRGBBuffer(v,!u),this._doNotHandleContextLost||(R._bufferView=s),this.updateRawTexture(R,s,l,h,m,p,R._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,R,!0);const x=this._getSamplingParameters(f,u);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,x.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,x.min),u&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(R),R},it.prototype.createRawCubeTexture=function(s,n,a,l,u,h,f,m=null){const p=this._gl,b=new ai(this,8);b.isCube=!0,b.format=a,b.type=l,this._doNotHandleContextLost||(b._bufferViewArray=s);const v=this._getWebGLTextureType(l);let R=this._getInternalFormat(a);R===p.RGB&&(R=p.RGBA),v===p.FLOAT&&!this._caps.textureFloatLinearFiltering?(u=!1,f=1,Re.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):v===this._gl.HALF_FLOAT_OES&&!this._caps.textureHalfFloatLinearFiltering?(u=!1,f=1,Re.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):v===p.FLOAT&&!this._caps.textureFloatRender?(u=!1,Re.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):v===p.HALF_FLOAT&&!this._caps.colorBufferFloat&&(u=!1,Re.Warn("Render to half float textures is not supported. Mipmap generation forced to false."));const x=n,T=x;if(b.width=x,b.height=T,b.invertY=h,b._compression=m,!this.needPOTTextures||lh(b.width)&&lh(b.height)||(u=!1),s)this.updateRawCubeTexture(b,s,a,l,h,m);else{const D=this._getRGBABufferInternalSizedFormat(l),M=0;this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,b,!0);for(let k=0;k<6;k++)m?p.compressedTexImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+k,M,this.getCaps().s3tc[m],b.width,b.height,0,void 0):p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+k,M,D,b.width,b.height,0,R,v,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,b,!0),s&&u&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);const A=this._getSamplingParameters(f,u);return p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_MAG_FILTER,A.mag),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_MIN_FILTER,A.min),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,null),b.generateMipMaps=u,b.samplingMode=f,b.isReady=!0,b},it.prototype.updateRawCubeTexture=function(s,n,a,l,u,h=null,f=0){s._bufferViewArray=n,s.format=a,s.type=l,s.invertY=u,s._compression=h;const m=this._gl,p=this._getWebGLTextureType(l);let b=this._getInternalFormat(a);const v=this._getRGBABufferInternalSizedFormat(l);let R=!1;b===m.RGB&&(b=m.RGBA,R=!0),this._bindTextureDirectly(m.TEXTURE_CUBE_MAP,s,!0),this._unpackFlipY(u===void 0?!0:!!u),s.width%4!==0&&m.pixelStorei(m.UNPACK_ALIGNMENT,1);for(let T=0;T<6;T++){let E=n[T];h?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+T,f,this.getCaps().s3tc[h],s.width,s.height,0,E):(R&&(E=i(E,s.width,s.height,l)),m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+T,f,v,s.width,s.height,0,b,p,E))}(!this.needPOTTextures||lh(s.width)&&lh(s.height))&&s.generateMipMaps&&f===0&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),s.isReady=!0},it.prototype.createRawCubeTextureFromUrl=function(s,n,a,l,u,h,f,m,p=null,b=null,v=3,R=!1){const x=this._gl,T=this.createRawCubeTexture(null,a,l,u,!h,R,v,null);n?.addPendingData(T),T.url=s,T.isReady=!1,this._internalTexturesCache.push(T);const E=(D,M)=>{n?.removePendingData(T),b&&b(D?D.status+" "+D.statusText:"Failed to parse texture data",M)},A=async D=>{if(!T._hardwareTexture)return;const M=f(D);if(!M)return;const k=M instanceof Promise?await M:M,U=T.width;if(m){const N=this._getWebGLTextureType(u);let H=this._getInternalFormat(l);const q=this._getRGBABufferInternalSizedFormat(u);let re=!1;H===x.RGB&&(H=x.RGBA,re=!0),this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,T,!0),this._unpackFlipY(!1);const ce=m(k);for(let ae=0;ae<ce.length;ae++){const fe=U>>ae;for(let _e=0;_e<6;_e++){let Te=ce[ae][_e];re&&(Te=i(Te,fe,fe,u)),x.texImage2D(_e,ae,q,fe,fe,0,H,N,Te)}}this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(T,k,l,u,R);T.isReady=!0,n?.removePendingData(T),T.onLoadedObservable.notifyObservers(T),T.onLoadedObservable.clear(),p&&p()};return this._loadFile(s,D=>{A(D).catch(M=>{E(void 0,M)})},void 0,n?.offlineProvider,!0,E),T},it.prototype.createRawTexture2DArray=e(!1),it.prototype.createRawTexture3D=e(!0),it.prototype.updateRawTexture2DArray=t(!1),it.prototype.updateRawTexture3D=t(!0)}gj();let W0=!1;function yj(){W0||(W0=!0,it.prototype._readTexturePixelsSync=function(i,e,t,s=-1,n=0,a=null,l=!0,u=!1,h=0,f=0){const m=this._gl;if(!m)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){const b=m.createFramebuffer();if(!b)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=b}m.bindFramebuffer(m.FRAMEBUFFER,this._dummyFramebuffer),s>-1&&(i.is2DArray||i.is3D)?m.framebufferTextureLayer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,i._hardwareTexture?.underlyingResource,n,s):s>-1?m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+s,i._hardwareTexture?.underlyingResource,n):m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_2D,i._hardwareTexture?.underlyingResource,n);let p=i.type!==void 0?this._getWebGLTextureType(i.type):m.UNSIGNED_BYTE;if(u)a||(a=y3(i.type,4*e*t));else switch(p){case m.UNSIGNED_BYTE:a||(a=new Uint8Array(4*e*t)),p=m.UNSIGNED_BYTE;break;default:a||(a=new Float32Array(4*e*t)),p=m.FLOAT;break}return l&&this.flushFramebuffer(),m.readPixels(h,f,e,t,m.RGBA,p,a),m.bindFramebuffer(m.FRAMEBUFFER,this._currentFramebuffer),a},it.prototype._readTexturePixels=function(i,e,t,s=-1,n=0,a=null,l=!0,u=!1,h=0,f=0){return Promise.resolve(this._readTexturePixelsSync(i,e,t,s,n,a,l,u,h,f))})}yj();let Y0=!1;function aA(){Y0||(Y0=!0,it.prototype.updateDynamicIndexBuffer=function(i,e,t=0){this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(i);let s;i.is32Bits?s=e instanceof Uint32Array?e:new Uint32Array(e):s=e instanceof Uint16Array?e:new Uint16Array(e),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,s,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},it.prototype.updateDynamicVertexBuffer=function(i,e,t,s){this.bindArrayBuffer(i),t===void 0&&(t=0);const n=e.byteLength||e.length;s===void 0||s>=n&&t===0?e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,new Float32Array(e)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e):e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,new Float32Array(e).subarray(0,s/4)):(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,s):e=new Uint8Array(e,0,s),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e)),this._resetVertexBufferBinding()})}aA();let K0=!1;function bj(){K0||(K0=!0,it.prototype._createDepthStencilCubeTexture=function(i,e){const t=new ai(this,12);if(t.isCube=!0,this.webGLVersion===1)return Re.Error("Depth cube texture is not supported by WebGL 1."),t;const s={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e},n=this._gl;this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,t,!0),this._setupDepthStencilTexture(t,i,s.bilinearFiltering,s.comparisonFunction);for(let a=0;a<6;a++)s.generateStencil?n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,n.DEPTH24_STENCIL8,i,i,0,n.DEPTH_STENCIL,n.UNSIGNED_INT_24_8,null):n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,n.DEPTH_COMPONENT24,i,i,0,n.DEPTH_COMPONENT,n.UNSIGNED_INT,null);return this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(t),t},it.prototype._setCubeMapTextureParams=function(i,e,t){const s=this._gl;s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,e?s.LINEAR_MIPMAP_LINEAR:s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),i.samplingMode=e?3:2,e&&this.getCaps().textureMaxLevel&&t!==void 0&&t>0&&(s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAX_LEVEL,t),i._maxLodLevel=t),this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null)},it.prototype.createCubeTexture=function(i,e,t,s,n=null,a=null,l,u=null,h=!1,f=0,m=0,p=null,b,v=!1,R=null){const x=this._gl;return this.createCubeTextureBase(i,e,t,!!s,n,a,l,u,h,f,m,p,T=>this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,T,!0),(T,E)=>{const A=this.needPOTTextures?Qp(E[0].width,this._caps.maxCubemapTextureSize):E[0].width,D=A,M=[x.TEXTURE_CUBE_MAP_POSITIVE_X,x.TEXTURE_CUBE_MAP_POSITIVE_Y,x.TEXTURE_CUBE_MAP_POSITIVE_Z,x.TEXTURE_CUBE_MAP_NEGATIVE_X,x.TEXTURE_CUBE_MAP_NEGATIVE_Y,x.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,T,!0),this._unpackFlipY(!1);const k=l?this._getInternalFormat(l,T._useSRGBBuffer):T._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:x.RGBA;let U=l?this._getInternalFormat(l):x.RGBA;T._useSRGBBuffer&&this.webGLVersion===1&&(U=k);for(let N=0;N<M.length;N++)if(E[N].width!==A||E[N].height!==D){if(this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext){Re.Warn("Cannot create canvas to resize texture.");return}this._workingCanvas.width=A,this._workingCanvas.height=D,this._workingContext.drawImage(E[N],0,0,E[N].width,E[N].height,0,0,A,D),x.texImage2D(M[N],0,k,U,x.UNSIGNED_BYTE,this._workingCanvas)}else x.texImage2D(M[N],0,k,U,x.UNSIGNED_BYTE,E[N]);s||x.generateMipmap(x.TEXTURE_CUBE_MAP),this._setCubeMapTextureParams(T,!s),T.width=A,T.height=D,T.isReady=!0,l&&(T.format=l),T.onLoadedObservable.notifyObservers(T),T.onLoadedObservable.clear(),n&&n()},!!v,R)},it.prototype.generateMipMapsForCubemap=function(i,e=!0){if(i.generateMipMaps){const t=this._gl;this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,i,!0),t.generateMipmap(t.TEXTURE_CUBE_MAP),e&&this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,null)}})}bj();class xj{get depthStencilTexture(){return this._depthStencilTexture}setDepthStencilTexture(e,t=!0){t&&this._depthStencilTexture&&this._depthStencilTexture.dispose(),this._depthStencilTexture=e,this._generateDepthBuffer=this._generateStencilBuffer=this._depthStencilTextureWithStencil=!1,e&&(this._generateDepthBuffer=!0,this._generateStencilBuffer=this._depthStencilTextureWithStencil=lc(e.format))}get depthStencilTextureWithStencil(){return this._depthStencilTextureWithStencil}get isCube(){return this._isCube}get isMulti(){return this._isMulti}get is2DArray(){return this.layers>0}get is3D(){return this.depth>0}get size(){return this.width}get width(){return this._size.width??this._size}get height(){return this._size.height??this._size}get layers(){return this._size.layers||0}get depth(){return this._size.depth||0}get texture(){return this._textures?.[0]??null}get textures(){return this._textures}get faceIndices(){return this._faceIndices}get layerIndices(){return this._layerIndices}getBaseArrayLayer(e){if(!this._textures)return-1;const t=this._textures[e],s=this._layerIndices?.[e]??0,n=this._faceIndices?.[e]??0;return t.isCube?s*6+n:t.is3D?0:s}get samples(){return this._samples}setSamples(e,t=!0,s=!1){if(this.samples===e&&!s)return e;const n=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,n}resolveMSAATextures(){this.isMulti?this._engine.resolveMultiFramebuffer(this):this._engine.resolveFramebuffer(this)}generateMipMaps(){this._engine._currentRenderTarget===this&&(this.isMulti?this._engine.unBindMultiColorAttachmentFramebuffer(this,!0):this._engine.unBindFramebuffer(this,!0)),this.isMulti?this._engine.generateMipMapsMultiFramebuffer(this):this._engine.generateMipMapsFramebuffer(this)}constructor(e,t,s,n,a){this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this.disableAutomaticMSAAResolve=!1,this.resolveMSAAColors=!0,this.resolveMSAADepth=!1,this.resolveMSAAStencil=!1,this.depthReadOnly=!1,this.stencilReadOnly=!1,this._isMulti=e,this._isCube=t,this._size=s,this._engine=n,this._depthStencilTexture=null,this.label=a}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,s=!0){this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&s&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,s){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),t!==void 0&&t>=0&&(this._layerIndices[e]=t),s!==void 0&&s>=0&&(this._faceIndices[e]=s)}createDepthStencilTexture(e=0,t=!0,s=!1,n=1,a=14,l){return this._depthStencilTexture?.dispose(),this._depthStencilTextureWithStencil=s,this._depthStencilTextureLabel=l,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:s,isCube:this._isCube,samples:n,depthTextureFormat:a,label:l},this),this._depthStencilTexture}_shareDepth(e){this.shareDepth(e)}shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){let e=null;if(this._isMulti){const t=this.textures;if(t&&t.length>0){let s=!1,n=t.length,a=-1;const l=t[t.length-1]._source;(l===14||l===12)&&(s=!0,a=t[t.length-1].format,n--);const u=[],h=[],f=[],m=[],p=[],b=[],v=[],R={};for(let E=0;E<n;++E){const A=t[E];u.push(A.samplingMode),h.push(A.type),f.push(A.format),R[A.uniqueId]!==void 0?(m.push(-1),v.push(0)):(R[A.uniqueId]=E,A.is2DArray?(m.push(35866),v.push(A.depth)):A.isCube?(m.push(34067),v.push(0)):A.is3D?(m.push(32879),v.push(A.depth)):(m.push(3553),v.push(0))),this._faceIndices&&p.push(this._faceIndices[E]??0),this._layerIndices&&b.push(this._layerIndices[E]??0)}const x={samplingModes:u,generateMipMaps:t[0].generateMipMaps,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:this._generateStencilBuffer,generateDepthTexture:s,depthTextureFormat:a,types:h,formats:f,textureCount:n,targetTypes:m,faceIndex:p,layerIndex:b,layerCounts:v,label:this.label},T={width:this.width,height:this.height,depth:this.depth};e=this._engine.createMultipleRenderTarget(T,x);for(let E=0;E<n;++E){if(m[E]!==-1)continue;const A=R[t[E].uniqueId];e.setTexture(e.textures[A],E)}}}else{const t={};if(t.generateDepthBuffer=this._generateDepthBuffer,t.generateMipMaps=this.texture?.generateMipMaps??!1,t.generateStencilBuffer=this._generateStencilBuffer,t.samplingMode=this.texture?.samplingMode,t.type=this.texture?.type,t.format=this.texture?.format,t.noColorAttachment=!this._textures,t.label=this.label,this.isCube)e=this._engine.createRenderTargetCubeTexture(this.width,t);else{const s={width:this.width,height:this.height,layers:this.is2DArray||this.is3D?this.texture?.depth:void 0};e=this._engine.createRenderTargetTexture(s,t)}e.texture&&(e.texture.isReady=!0)}return e}_swapRenderTargetWrapper(e){if(this._textures&&e._textures)for(let t=0;t<this._textures.length;++t)this._textures[t]._swapAndDie(e._textures[t],!1),e._textures[t].isReady=!0;this._depthStencilTexture&&e._depthStencilTexture&&(this._depthStencilTexture._swapAndDie(e._depthStencilTexture),e._depthStencilTexture.isReady=!0),this._textures=null,this._depthStencilTexture=null}_rebuild(){const e=this._cloneRenderTargetWrapper();if(e){if(this._depthStencilTexture){const t=this._depthStencilTexture.samplingMode,s=this._depthStencilTexture.format,n=t===2||t===3||t===11;e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction,n,this._depthStencilTextureWithStencil,this._depthStencilTexture.samples,s,this._depthStencilTextureLabel)}this.samples>1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){if(this._textures)for(let e=0;e<this._textures.length;++e)this._textures[e].dispose();this._textures=null}dispose(e=!1){e||(this._depthStencilTexture?.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}class vj extends xj{setDepthStencilTexture(e,t=!0){if(super.setDepthStencilTexture(e,t),!e)return;const s=this._engine,n=this._context,a=e._hardwareTexture;if(a&&e._autoMSAAManagement&&this._MSAAFramebuffer){const l=s._currentFramebuffer;s._bindUnboundFramebuffer(this._MSAAFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,lc(e.format)?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,n.RENDERBUFFER,a.getMSAARenderBuffer()),s._bindUnboundFramebuffer(l)}}constructor(e,t,s,n,a){super(e,t,s,n),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._disposeOnlyFramebuffers=!1,this._currentLOD=0,this._context=a}_cloneRenderTargetWrapper(){let e;return this._colorTextureArray&&this._depthStencilTextureArray?(e=this._engine.createMultiviewRenderTargetTexture(this.width,this.height),e.texture.isReady=!0):e=super._cloneRenderTargetWrapper(),e}_swapRenderTargetWrapper(e){super._swapRenderTargetWrapper(e),e._framebuffer=this._framebuffer,e._depthStencilBuffer=this._depthStencilBuffer,e._MSAAFramebuffer=this._MSAAFramebuffer,e._colorTextureArray=this._colorTextureArray,e._depthStencilTextureArray=this._depthStencilTextureArray,this._framebuffer=this._depthStencilBuffer=this._MSAAFramebuffer=this._colorTextureArray=this._depthStencilTextureArray=null}createDepthStencilTexture(e=0,t=!0,s=!1,n=1,a=14,l){if(this._depthStencilBuffer){const u=this._engine,h=u._currentFramebuffer,f=this._context;u._bindUnboundFramebuffer(this._framebuffer),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,null),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,null),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.STENCIL_ATTACHMENT,f.RENDERBUFFER,null),u._bindUnboundFramebuffer(h),f.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,s,n,a,l)}shareDepth(e){super.shareDepth(e);const t=this._context,s=this._depthStencilBuffer,n=e._MSAAFramebuffer||e._framebuffer,a=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==s&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=s;const l=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;a._bindUnboundFramebuffer(n),t.framebufferRenderbuffer(t.FRAMEBUFFER,l,t.RENDERBUFFER,s),a._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,s,n=0){const a=e._hardwareTexture;if(!a)return;const l=this._framebuffer,u=this._engine,h=u._currentFramebuffer;u._bindUnboundFramebuffer(l);let f;if(u.webGLVersion>1){const m=this._context;f=m["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(s=s??this.layerIndices?.[t]??0,m.framebufferTextureLayer(m.FRAMEBUFFER,f,a.underlyingResource,n,s)):e.isCube?(s=s??this.faceIndices?.[t]??0,m.framebufferTexture2D(m.FRAMEBUFFER,f,m.TEXTURE_CUBE_MAP_POSITIVE_X+s,a.underlyingResource,n)):m.framebufferTexture2D(m.FRAMEBUFFER,f,m.TEXTURE_2D,a.underlyingResource,n)}else{const m=this._context;f=m["COLOR_ATTACHMENT"+t+"_WEBGL"];const p=s!==void 0?m.TEXTURE_CUBE_MAP_POSITIVE_X+s:m.TEXTURE_2D;m.framebufferTexture2D(m.FRAMEBUFFER,f,p,a.underlyingResource,n)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){const m=this._context;u._bindUnboundFramebuffer(this._MSAAFramebuffer),m.framebufferRenderbuffer(m.FRAMEBUFFER,f,m.RENDERBUFFER,a.getMSAARenderBuffer())}u._bindUnboundFramebuffer(h)}setTexture(e,t=0,s=!0){super.setTexture(e,t,s),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;const s=this._attachments?.length??this.textures.length;for(let n=0;n<s;n++){const a=this.textures[n];a&&(a.is2DArray||a.is3D?this._bindTextureRenderTarget(a,n,this.layerIndices[n]):a.isCube?this._bindTextureRenderTarget(a,n,this.faceIndices[n]):this._bindTextureRenderTarget(a,n))}}setLayerAndFaceIndex(e=0,t,s){if(super.setLayerAndFaceIndex(e,t,s),!this.textures||!this.layerIndices||!this.faceIndices)return;const n=this.textures[e];n.is2DArray||n.is3D?this._bindTextureRenderTarget(this.textures[e],e,this.layerIndices[e]):n.isCube&&this._bindTextureRenderTarget(this.textures[e],e,this.faceIndices[e])}resolveMSAATextures(){const e=this._engine,t=e._currentFramebuffer;e._bindUnboundFramebuffer(this._MSAAFramebuffer),super.resolveMSAATextures(),e._bindUnboundFramebuffer(t)}dispose(e=this._disposeOnlyFramebuffers){const t=this._context;e||(this._colorTextureArray&&(this._context.deleteTexture(this._colorTextureArray),this._colorTextureArray=null),this._depthStencilTextureArray&&(this._context.deleteTexture(this._depthStencilTextureArray),this._depthStencilTextureArray=null)),this._framebuffer&&(t.deleteFramebuffer(this._framebuffer),this._framebuffer=null),this._depthStencilBuffer&&(t.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null),this._MSAAFramebuffer&&(t.deleteFramebuffer(this._MSAAFramebuffer),this._MSAAFramebuffer=null),super.dispose(e)}}let Z0=!1;function Rj(){Z0||(Z0=!0,it.prototype._createHardwareRenderTargetWrapper=function(i,e,t){const s=new vj(i,e,t,this,this._gl);return this._renderTargetWrapperCache.push(s),s},it.prototype.createRenderTargetTexture=function(i,e){const t=this._createHardwareRenderTargetWrapper(!1,!1,i);let s=!0,n=!1,a=!1,l,u=1,h;e!==void 0&&typeof e=="object"&&(s=e.generateDepthBuffer??!0,n=!!e.generateStencilBuffer,a=!!e.noColorAttachment,l=e.colorAttachment,u=e.samples??1,h=e.label);const f=l||(a?null:this._createInternalTexture(i,e,!0,5)),m=i.width||i,p=i.height||i,b=this._currentFramebuffer,v=this._gl,R=v.createFramebuffer();if(this._bindUnboundFramebuffer(R),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(n,s,m,p),f&&!f.is2DArray&&!f.is3D&&v.framebufferTexture2D(v.FRAMEBUFFER,v.COLOR_ATTACHMENT0,v.TEXTURE_2D,f._hardwareTexture.underlyingResource,0),this._bindUnboundFramebuffer(b),t.label=h??"RenderTargetWrapper",t._framebuffer=R,t._generateDepthBuffer=s,t._generateStencilBuffer=n,t.setTextures(f),!l)this.updateRenderTargetTextureSampleCount(t,u);else if(t._samples=l.samples,l.samples>1){const x=l._hardwareTexture.getMSAARenderBuffer(0);t._MSAAFramebuffer=v.createFramebuffer(),this._bindUnboundFramebuffer(t._MSAAFramebuffer),v.framebufferRenderbuffer(v.FRAMEBUFFER,v.COLOR_ATTACHMENT0,v.RENDERBUFFER,x),this._bindUnboundFramebuffer(null)}return t},it.prototype._createDepthStencilTexture=function(i,e,t){const s=this._gl,n=i.layers||0,a=i.depth||0;let l=s.TEXTURE_2D;n!==0?l=s.TEXTURE_2D_ARRAY:a!==0&&(l=s.TEXTURE_3D);const u=new ai(this,12);if(u.label=e.label,!this._caps.depthTextureExtension)return Re.Error("Depth texture is not supported by your browser or hardware."),u;const h={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e};if(this._bindTextureDirectly(l,u,!0),this._setupDepthStencilTexture(u,i,h.comparisonFunction===0?!1:h.bilinearFiltering,h.comparisonFunction,h.samples),h.depthTextureFormat!==void 0){if(h.depthTextureFormat!==15&&h.depthTextureFormat!==16&&h.depthTextureFormat!==17&&h.depthTextureFormat!==13&&h.depthTextureFormat!==14&&h.depthTextureFormat!==18)return Re.Error(`Depth texture ${h.depthTextureFormat} format is not supported.`),u;u.format=h.depthTextureFormat}else u.format=h.generateStencil?13:16;const f=lc(u.format),m=this._getWebGLTextureTypeFromDepthTextureFormat(u.format),p=f?s.DEPTH_STENCIL:s.DEPTH_COMPONENT,b=this._getInternalFormatFromDepthTextureFormat(u.format,!0,f);return u.is2DArray?s.texImage3D(l,0,b,u.width,u.height,n,0,p,m,null):u.is3D?s.texImage3D(l,0,b,u.width,u.height,a,0,p,m,null):s.texImage2D(l,0,b,u.width,u.height,0,p,m,null),this._bindTextureDirectly(l,null),this._internalTexturesCache.push(u),t._depthStencilBuffer&&(s.deleteRenderbuffer(t._depthStencilBuffer),t._depthStencilBuffer=null),this._bindUnboundFramebuffer(t._MSAAFramebuffer??t._framebuffer),t._generateStencilBuffer=f,t._depthStencilTextureWithStencil=f,t._depthStencilBuffer=this._setupFramebufferDepthAttachments(t._generateStencilBuffer,t._generateDepthBuffer,t.width,t.height,t.samples,u.format),this._bindUnboundFramebuffer(null),u},it.prototype.updateRenderTargetTextureSampleCount=function(i,e){if(this.webGLVersion<2||!i)return 1;if(i.samples===e)return e;const t=this._gl;e=Math.min(e,this.getCaps().maxMSAASamples),i._depthStencilBuffer&&(t.deleteRenderbuffer(i._depthStencilBuffer),i._depthStencilBuffer=null),i._MSAAFramebuffer&&(t.deleteFramebuffer(i._MSAAFramebuffer),i._MSAAFramebuffer=null);const s=i.texture?._hardwareTexture;if(s?.releaseMSAARenderBuffers(),i.texture&&e>1&&typeof t.renderbufferStorageMultisample=="function"){const a=t.createFramebuffer();if(!a)throw new Error("Unable to create multi sampled framebuffer");i._MSAAFramebuffer=a,this._bindUnboundFramebuffer(i._MSAAFramebuffer);const l=this._createRenderBuffer(i.texture.width,i.texture.height,e,-1,this._getRGBABufferInternalSizedFormat(i.texture.type,i.texture.format,i.texture._useSRGBBuffer),t.COLOR_ATTACHMENT0,!1);if(!l)throw new Error("Unable to create multi sampled framebuffer");s?.addMSAARenderBuffer(l)}this._bindUnboundFramebuffer(i._MSAAFramebuffer??i._framebuffer),i.texture&&(i.texture.samples=e),i._samples=e;const n=i._depthStencilTexture?i._depthStencilTexture.format:void 0;return i._depthStencilBuffer=this._setupFramebufferDepthAttachments(i._generateStencilBuffer,i._generateDepthBuffer,i.width,i.height,e,n),this._bindUnboundFramebuffer(null),e},it.prototype._setupDepthStencilTexture=function(i,e,t,s,n=1){const a=e.width??e,l=e.height??e,u=e.layers||0,h=e.depth||0;i.baseWidth=a,i.baseHeight=l,i.width=a,i.height=l,i.is2DArray=u>0,i.depth=u||h,i.isReady=!0,i.samples=n,i.generateMipMaps=!1,i.samplingMode=t?2:1,i.type=0,i._comparisonFunction=s;const f=this._gl,m=this._getTextureTarget(i),p=this._getSamplingParameters(i.samplingMode,!1);f.texParameteri(m,f.TEXTURE_MAG_FILTER,p.mag),f.texParameteri(m,f.TEXTURE_MIN_FILTER,p.min),f.texParameteri(m,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(m,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),this.webGLVersion>1&&(s===0?(f.texParameteri(m,f.TEXTURE_COMPARE_FUNC,515),f.texParameteri(m,f.TEXTURE_COMPARE_MODE,f.NONE)):(f.texParameteri(m,f.TEXTURE_COMPARE_FUNC,s),f.texParameteri(m,f.TEXTURE_COMPARE_MODE,f.COMPARE_REF_TO_TEXTURE)))})}Rj();let Q0=!1;function Tj(){Q0||(Q0=!0,it.prototype.setDepthStencilTexture=function(i,e,t,s){i!==void 0&&(e&&(this._boundUniforms[i]=e),!t||!t.depthStencilTexture?this._setTexture(i,null,void 0,void 0,s):this._setTexture(i,t,!1,!0,s))})}Tj();let $0=!1;function Ej(){$0||($0=!0,it.prototype.createRenderTargetCubeTexture=function(i,e){const t=this._createHardwareRenderTargetWrapper(!1,!0,i),s={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...e};s.generateStencilBuffer=s.generateDepthBuffer&&s.generateStencilBuffer,(s.type===1&&!this._caps.textureFloatLinearFiltering||s.type===2&&!this._caps.textureHalfFloatLinearFiltering)&&(s.samplingMode=1);const n=this._gl,a=new ai(this,5);this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,a,!0);const l=this._getSamplingParameters(s.samplingMode,s.generateMipMaps);s.type===1&&!this._caps.textureFloat&&(s.type=0,Re.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,l.mag),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,l.min),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);for(let h=0;h<6;h++)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,this._getRGBABufferInternalSizedFormat(s.type,s.format),i,i,0,this._getInternalFormat(s.format),this._getWebGLTextureType(s.type),null);const u=n.createFramebuffer();return this._bindUnboundFramebuffer(u),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(s.generateStencilBuffer,s.generateDepthBuffer,i,i),s.generateMipMaps&&n.generateMipmap(n.TEXTURE_CUBE_MAP),this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),t._framebuffer=u,t._generateDepthBuffer=s.generateDepthBuffer,t._generateStencilBuffer=s.generateStencilBuffer,a.width=i,a.height=i,a.isReady=!0,a.isCube=!0,a.samples=1,a.generateMipMaps=s.generateMipMaps,a.samplingMode=s.samplingMode,a.type=s.type,a.format=s.format,this._internalTexturesCache.push(a),t.setTextures(a),t})}Ej();const Sj="modulepreload",Cj=function(i){return"/"+i},J0={},gi=function(e,t,s){let n=Promise.resolve();if(t&&t.length>0){let h=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");n=h(t.map(f=>{if(f=Cj(f),f in J0)return;J0[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":Sj,m||(b.as="script"),b.crossOrigin="",b.href=f,u&&b.setAttribute("nonce",u),document.head.appendChild(b),m)return new Promise((v,R)=>{b.addEventListener("load",v),b.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return n.then(l=>{for(const u of l||[])u.status==="rejected"&&a(u.reason);return e().catch(a)})},Aj=1/2.2,Mj=2.2;let Ms=.001;function Gr(i,e){const t=[];for(let s=0;s<i;++s)t.push(e());return t}function Zr(i,e){return Gr(i,e)}function wj(i,e,t){const s=i[e];if(typeof s!="function")return null;const n=function(){const a=i.length,l=n.previous.apply(i,arguments);return t(e,a),l};return s.next=n,n.previous=s,i[e]=n,()=>{const a=n.previous;if(!a)return;const l=n.next;l?(a.next=l,l.previous=a):(a.next=void 0,i[e]=a),n.next=void 0,n.previous=void 0}}const Pj=["push","splice","pop","shift","unshift"];function Oj(i,e){const t=Pj.map(s=>wj(i,s,e));return()=>{for(const s of t)s?.()}}function Nt(i,e,t=1401298e-51){return Math.abs(i-e)<=t}function is(i,e){return i===e?i:Math.random()*(e-i)+i}function Dj(i,e,t){return i+(e-i)*t}function $t(i,e=0,t=1){return Math.min(t,Math.max(e,i))}function Ij(i){return i-=Math.PI*2*Math.floor((i+Math.PI)/(Math.PI*2)),i}function xn(i){const e=i.toString(16);return i<=15?("0"+e).toUpperCase():e.toUpperCase()}function V4(i){if(Math.log2)return Math.floor(Math.log2(i));if(i<0)return NaN;if(i===0)return-1/0;let e=0;if(i<1){for(;i<1;)e++,i=i*2;e=-e}else if(i>1)for(;i>1;)e++,i=Math.floor(i/2);return e}class rg{}rg._UpdateFlagSeed=0;function oA(i){i.updateFlag=rg._UpdateFlagSeed++}function lA(i,e,t,s=0){const n=i.asArray(),a=e.asArray(),l=n[0],u=n[1],h=n[2],f=n[3],m=n[4],p=n[5],b=n[6],v=n[7],R=n[8],x=n[9],T=n[10],E=n[11],A=n[12],D=n[13],M=n[14],k=n[15],U=a[0],N=a[1],H=a[2],q=a[3],re=a[4],ce=a[5],ae=a[6],fe=a[7],_e=a[8],Te=a[9],z=a[10],J=a[11],Y=a[12],V=a[13],ge=a[14],L=a[15];t[s]=l*U+u*re+h*_e+f*Y,t[s+1]=l*N+u*ce+h*Te+f*V,t[s+2]=l*H+u*ae+h*z+f*ge,t[s+3]=l*q+u*fe+h*J+f*L,t[s+4]=m*U+p*re+b*_e+v*Y,t[s+5]=m*N+p*ce+b*Te+v*V,t[s+6]=m*H+p*ae+b*z+v*ge,t[s+7]=m*q+p*fe+b*J+v*L,t[s+8]=R*U+x*re+T*_e+E*Y,t[s+9]=R*N+x*ce+T*Te+E*V,t[s+10]=R*H+x*ae+T*z+E*ge,t[s+11]=R*q+x*fe+T*J+E*L,t[s+12]=A*U+D*re+M*_e+k*Y,t[s+13]=A*N+D*ce+M*Te+k*V,t[s+14]=A*H+D*ae+M*z+k*ge,t[s+15]=A*q+D*fe+M*J+k*L}function cc(i,e,t,s=0){lA(i,e,t.asArray(),s),oA(t)}function Fj(i,e,t=0){const s=i.asArray();e[t]=s[0],e[t+1]=s[1],e[t+2]=s[2],e[t+3]=s[3],e[t+4]=s[4],e[t+5]=s[5],e[t+6]=s[6],e[t+7]=s[7],e[t+8]=s[8],e[t+9]=s[9],e[t+10]=s[10],e[t+11]=s[11],e[t+12]=s[12],e[t+13]=s[13],e[t+14]=s[14],e[t+15]=s[15]}function Dh(i,e){const t=cA(i,e.asArray());return t&&oA(e),t}function cA(i,e){const t=i.asArray(),s=t[0],n=t[1],a=t[2],l=t[3],u=t[4],h=t[5],f=t[6],m=t[7],p=t[8],b=t[9],v=t[10],R=t[11],x=t[12],T=t[13],E=t[14],A=t[15],D=v*A-E*R,M=b*A-T*R,k=b*E-T*v,U=p*A-x*R,N=p*E-v*x,H=p*T-x*b,q=+(h*D-f*M+m*k),re=-(u*D-f*U+m*N),ce=+(u*M-h*U+m*H),ae=-(u*k-h*N+f*H),fe=s*q+n*re+a*ce+l*ae;if(fe===0)return!1;const _e=1/fe,Te=f*A-E*m,z=h*A-T*m,J=h*E-T*f,Y=u*A-x*m,V=u*E-x*f,ge=u*T-x*h,L=f*R-v*m,B=h*R-b*m,X=h*v-b*f,Q=u*R-p*m,F=u*v-p*f,$=u*b-p*h,he=-(n*D-a*M+l*k),Ae=+(s*D-a*U+l*N),Oe=-(s*M-n*U+l*H),G=+(s*k-n*N+a*H),ie=+(n*Te-a*z+l*J),de=-(s*Te-a*Y+l*V),Se=+(s*z-n*Y+l*ge),qe=-(s*J-n*V+a*ge),Je=-(n*L-a*B+l*X),Ct=+(s*L-a*Q+l*F),es=-(s*B-n*Q+l*$),ps=+(s*X-n*F+a*$);return e[0]=q*_e,e[1]=he*_e,e[2]=ie*_e,e[3]=Je*_e,e[4]=re*_e,e[5]=Ae*_e,e[6]=de*_e,e[7]=Ct*_e,e[8]=ce*_e,e[9]=Oe*_e,e[10]=Se*_e,e[11]=es*_e,e[12]=ae*_e,e[13]=G*_e,e[14]=qe*_e,e[15]=ps*_e,!0}const uA={};function ar(i,e){uA[i]=e}function hA(i){return uA[i]}const ri=i=>parseInt(i.toString().replace(/\W/g,""));class Xe{constructor(e=0,t=0){this.x=e,this.y=t}toString(){return`{X: ${this.x} Y: ${this.y}}`}getClassName(){return"Vector2"}getHashCode(){const e=ri(this.x),t=ri(this.y);let s=e;return s=s*397^t,s}toArray(e,t=0){return e[t]=this.x,e[t+1]=this.y,this}fromArray(e,t=0){return Xe.FromArrayToRef(e,t,this),this}asArray(){return[this.x,this.y]}copyFrom(e){return this.x=e.x,this.y=e.y,this}copyFromFloats(e,t){return this.x=e,this.y=t,this}set(e,t){return this.copyFromFloats(e,t)}setAll(e){return this.copyFromFloats(e,e)}add(e){return new Xe(this.x+e.x,this.y+e.y)}addToRef(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addInPlaceFromFloats(e,t){return this.x+=e,this.y+=t,this}addVector3(e){return new Xe(this.x+e.x,this.y+e.y)}subtract(e){return new Xe(this.x-e.x,this.y-e.y)}subtractToRef(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this}multiply(e){return new Xe(this.x*e.x,this.y*e.y)}multiplyToRef(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByFloats(e,t){return new Xe(this.x*e,this.y*t)}divide(e){return new Xe(this.x/e.x,this.y/e.y)}divideToRef(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t}divideInPlace(e){return this.x=this.x/e.x,this.y=this.y/e.y,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.x,e.y)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.x,e.y)}minimizeInPlaceFromFloats(e,t){return this.x=Math.min(e,this.x),this.y=Math.min(t,this.y),this}maximizeInPlaceFromFloats(e,t){return this.x=Math.max(e,this.x),this.y=Math.max(t,this.y),this}subtractFromFloats(e,t){return new Xe(this.x-e,this.y-t)}subtractFromFloatsToRef(e,t,s){return s.x=this.x-e,s.y=this.y-t,s}negate(){return new Xe(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(e){return e.x=-this.x,e.y=-this.y,e}scaleInPlace(e){return this.x*=e,this.y*=e,this}scale(e){return new Xe(this.x*e,this.y*e)}scaleToRef(e,t){return t.x=this.x*e,t.y=this.y*e,t}scaleAndAddToRef(e,t){return t.x+=this.x*e,t.y+=this.y*e,t}equals(e){return e&&this.x===e.x&&this.y===e.y}equalsWithEpsilon(e,t=Ms){return e&&Nt(this.x,e.x,t)&&Nt(this.y,e.y,t)}equalsToFloats(e,t){return this.x===e&&this.y===t}floor(){return new Xe(Math.floor(this.x),Math.floor(this.y))}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e}fract(){return new Xe(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e}rotate(e){return this.rotateToRef(e,new Xe)}rotateToRef(e,t){const s=Math.cos(e),n=Math.sin(e);return t.x=s*this.x-n*this.y,t.y=n*this.x+s*this.y,t}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new Xe;return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0||t===1?(e.x=this.x,e.y=this.y,e):this.scaleToRef(1/t,e)}clone(){return new Xe(this.x,this.y)}dot(e){return this.x*e.x+this.y*e.y}static Zero(){return new Xe(0,0)}static One(){return new Xe(1,1)}static Random(e=0,t=1){return new Xe(is(e,t),is(e,t))}static RandomToRef(e=0,t=1,s){return s.copyFromFloats(is(e,t),is(e,t))}static get ZeroReadOnly(){return Xe._ZeroReadOnly}static FromArray(e,t=0){return new Xe(e[t],e[t+1])}static FromArrayToRef(e,t,s){return s.x=e[t],s.y=e[t+1],s}static FromFloatsToRef(e,t,s){return s.copyFromFloats(e,t),s}static CatmullRom(e,t,s,n,a){const l=a*a,u=a*l,h=.5*(2*t.x+(-e.x+s.x)*a+(2*e.x-5*t.x+4*s.x-n.x)*l+(-e.x+3*t.x-3*s.x+n.x)*u),f=.5*(2*t.y+(-e.y+s.y)*a+(2*e.y-5*t.y+4*s.y-n.y)*l+(-e.y+3*t.y-3*s.y+n.y)*u);return new Xe(h,f)}static ClampToRef(e,t,s,n){return n.x=$t(e.x,t.x,s.x),n.y=$t(e.y,t.y,s.y),n}static Clamp(e,t,s){const n=$t(e.x,t.x,s.x),a=$t(e.y,t.y,s.y);return new Xe(n,a)}static Hermite(e,t,s,n,a){const l=a*a,u=a*l,h=2*u-3*l+1,f=-2*u+3*l,m=u-2*l+a,p=u-l,b=e.x*h+s.x*f+t.x*m+n.x*p,v=e.y*h+s.y*f+t.y*m+n.y*p;return new Xe(b,v)}static Hermite1stDerivative(e,t,s,n,a){return this.Hermite1stDerivativeToRef(e,t,s,n,a,new Xe)}static Hermite1stDerivativeToRef(e,t,s,n,a,l){const u=a*a;return l.x=(u-a)*6*e.x+(3*u-4*a+1)*t.x+(-u+a)*6*s.x+(3*u-2*a)*n.x,l.y=(u-a)*6*e.y+(3*u-4*a+1)*t.y+(-u+a)*6*s.y+(3*u-2*a)*n.y,l}static Lerp(e,t,s){return Xe.LerpToRef(e,t,s,new Xe)}static LerpToRef(e,t,s,n){return n.x=e.x+(t.x-e.x)*s,n.y=e.y+(t.y-e.y)*s,n}static Dot(e,t){return e.x*t.x+e.y*t.y}static Normalize(e){return Xe.NormalizeToRef(e,new Xe)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const s=e.x<t.x?e.x:t.x,n=e.y<t.y?e.y:t.y;return new Xe(s,n)}static Maximize(e,t){const s=e.x>t.x?e.x:t.x,n=e.y>t.y?e.y:t.y;return new Xe(s,n)}static Transform(e,t){return Xe.TransformToRef(e,t,new Xe)}static TransformToRef(e,t,s){const n=t.m,a=e.x*n[0]+e.y*n[4]+n[12],l=e.x*n[1]+e.y*n[5]+n[13];return s.x=a,s.y=l,s}static PointInTriangle(e,t,s,n){const a=.5*(-s.y*n.x+t.y*(-s.x+n.x)+t.x*(s.y-n.y)+s.x*n.y),l=a<0?-1:1,u=(t.y*n.x-t.x*n.y+(n.y-t.y)*e.x+(t.x-n.x)*e.y)*l,h=(t.x*s.y-t.y*s.x+(t.y-s.y)*e.x+(s.x-t.x)*e.y)*l;return u>0&&h>0&&u+h<2*a*l}static Distance(e,t){return Math.sqrt(Xe.DistanceSquared(e,t))}static DistanceSquared(e,t){const s=e.x-t.x,n=e.y-t.y;return s*s+n*n}static Center(e,t){return Xe.CenterToRef(e,t,new Xe)}static CenterToRef(e,t,s){return s.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2)}static DistanceOfPointFromSegment(e,t,s){const n=Xe.DistanceSquared(t,s);if(n===0)return Xe.Distance(e,t);const a=s.subtract(t),l=Math.max(0,Math.min(1,Xe.Dot(e.subtract(t),a)/n)),u=t.add(a.multiplyByFloats(l,l));return Xe.Distance(e,u)}}Xe._V8PerformanceHack=new Xe(.5,.5);Xe._ZeroReadOnly=Xe.Zero();class I{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}constructor(e=0,t=0,s=0){this._isDirty=!0,this._x=e,this._y=t,this._z=s}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){const e=ri(this._x),t=ri(this._y),s=ri(this._z);let n=e;return n=n*397^t,n=n*397^s,n}asArray(){return[this._x,this._y,this._z]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this}fromArray(e,t=0){return I.FromArrayToRef(e,t,this),this}toQuaternion(){return Ge.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._isDirty=!0,this}addInPlaceFromFloats(e,t,s){return this._x+=e,this._y+=t,this._z+=s,this._isDirty=!0,this}add(e){return new I(this._x+e._x,this._y+e._y,this._z+e._z)}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._isDirty=!0,t}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this}subtract(e){return new I(this._x-e._x,this._y-e._y,this._z-e._z)}subtractToRef(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)}subtractFromFloats(e,t,s){return new I(this._x-e,this._y-t,this._z-s)}subtractFromFloatsToRef(e,t,s,n){return n._x=this._x-e,n._y=this._y-t,n._z=this._z-s,n._isDirty=!0,n}negate(){return new I(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(e){return e._x=this._x*-1,e._y=this._y*-1,e._z=this._z*-1,e._isDirty=!0,e}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this}scale(e){return new I(this._x*e,this._y*e,this._z*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._isDirty=!0,t}getNormalToRef(e){const t=this.length();let s=Math.acos(this._y/t);const n=Math.atan2(this._z,this._x);s>Math.PI/2?s-=Math.PI/2:s+=Math.PI/2;const a=t*Math.sin(s)*Math.cos(n),l=t*Math.cos(s),u=t*Math.sin(s)*Math.sin(n);return e.set(a,l,u),e}applyRotationQuaternionToRef(e,t){const s=this._x,n=this._y,a=this._z,l=e._x,u=e._y,h=e._z,f=e._w,m=2*(u*a-h*n),p=2*(h*s-l*a),b=2*(l*n-u*s);return t._x=s+f*m+u*b-h*p,t._y=n+f*p+h*m-l*b,t._z=a+f*b+l*p-u*m,t._isDirty=!0,t}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new I)}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._isDirty=!0,t}projectOnPlane(e,t){return this.projectOnPlaneToRef(e,t,new I)}projectOnPlaneToRef(e,t,s){const n=e.normal,a=e.d,l=Me.Vector3[0];this.subtractToRef(t,l),l.normalize();const u=I.Dot(l,n);if(Math.abs(u)<1e-10)s.setAll(1/0);else{const h=-(I.Dot(t,n)+a)/u,f=l.scaleInPlace(h);t.addToRef(f,s)}return s}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,t=Ms){return e&&Nt(this._x,e._x,t)&&Nt(this._y,e._y,t)&&Nt(this._z,e._z,t)}equalsToFloats(e,t,s){return this._x===e&&this._y===t&&this._z===s}multiplyInPlace(e){return this._x*=e._x,this._y*=e._y,this._z*=e._z,this._isDirty=!0,this}multiply(e){return this.multiplyByFloats(e._x,e._y,e._z)}multiplyToRef(e,t){return t._x=this._x*e._x,t._y=this._y*e._y,t._z=this._z*e._z,t._isDirty=!0,t}multiplyByFloats(e,t,s){return new I(this._x*e,this._y*t,this._z*s)}divide(e){return new I(this._x/e._x,this._y/e._y,this._z/e._z)}divideToRef(e,t){return t._x=this._x/e._x,t._y=this._y/e._y,t._z=this._z/e._z,t._isDirty=!0,t}divideInPlace(e){return this._x=this._x/e._x,this._y=this._y/e._y,this._z=this._z/e._z,this._isDirty=!0,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)}minimizeInPlaceFromFloats(e,t,s){return e<this._x&&(this.x=e),t<this._y&&(this.y=t),s<this._z&&(this.z=s),this}maximizeInPlaceFromFloats(e,t,s){return e>this._x&&(this.x=e),t>this._y&&(this.y=t),s>this._z&&(this.z=s),this}isNonUniformWithinEpsilon(e){const t=Math.abs(this._x),s=Math.abs(this._y);if(!Nt(t,s,e))return!0;const n=Math.abs(this._z);return!Nt(t,n,e)||!Nt(s,n,e)}get isNonUniform(){const e=Math.abs(this._x),t=Math.abs(this._y);if(e!==t)return!0;const s=Math.abs(this._z);return e!==s}floorToRef(e){return e._x=Math.floor(this._x),e._y=Math.floor(this._y),e._z=Math.floor(this._z),e._isDirty=!0,e}floor(){return new I(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fractToRef(e){return e._x=this._x-Math.floor(this._x),e._y=this._y-Math.floor(this._y),e._z=this._z-Math.floor(this._z),e._isDirty=!0,e}fract(){return new I(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z===0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(e){if(e=e.toLowerCase(),e==="xyz")return this;const t=Me.Vector3[0].copyFrom(this);return this.x=t[e[0]],this.y=t[e[1]],this.z=t[e[2]],this}rotateByQuaternionToRef(e,t){return e.toRotationMatrix(Me.Matrix[0]),I.TransformCoordinatesToRef(this,Me.Matrix[0],t),t}rotateByQuaternionAroundPointToRef(e,t,s){return this.subtractToRef(t,Me.Vector3[0]),Me.Vector3[0].rotateByQuaternionToRef(e,Me.Vector3[0]),t.addToRef(Me.Vector3[0],s),s}cross(e){return I.CrossToRef(this,e,new I)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new I)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e._x=this._x,e._y=this._y,e._z=this._z,e._isDirty=!0,e):this.scaleToRef(1/t,e)}clone(){return new I(this._x,this._y,this._z)}copyFrom(e){return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,t,s){return this._x=e,this._y=t,this._z=s,this._isDirty=!0,this}set(e,t,s){return this.copyFromFloats(e,t,s)}setAll(e){return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,t,s,n){const a=I.Dot(e,s),l=I.Dot(t,s);return(a-n)/(a-l)}static GetAngleBetweenVectors(e,t,s){const n=e.normalizeToRef(Me.Vector3[1]),a=t.normalizeToRef(Me.Vector3[2]);let l=I.Dot(n,a);l=$t(l,-1,1);const u=Math.acos(l),h=Me.Vector3[3];return I.CrossToRef(n,a,h),I.Dot(h,s)>0?isNaN(u)?0:u:isNaN(u)?-Math.PI:-Math.acos(l)}static GetAngleBetweenVectorsOnPlane(e,t,s){Me.Vector3[0].copyFrom(e);const n=Me.Vector3[0];Me.Vector3[1].copyFrom(t);const a=Me.Vector3[1];Me.Vector3[2].copyFrom(s);const l=Me.Vector3[2],u=Me.Vector3[3],h=Me.Vector3[4];n.normalize(),a.normalize(),l.normalize(),I.CrossToRef(l,n,u),I.CrossToRef(u,l,h);const f=Math.atan2(I.Dot(a,u),I.Dot(a,h));return Ij(f)}static PitchYawRollToMoveBetweenPointsToRef(e,t,s){const n=We.Vector3[0];return t.subtractToRef(e,n),s._y=Math.atan2(n.x,n.z)||0,s._x=Math.atan2(Math.sqrt(n.x**2+n.z**2),n.y)||0,s._z=0,s._isDirty=!0,s}static PitchYawRollToMoveBetweenPoints(e,t){const s=I.Zero();return I.PitchYawRollToMoveBetweenPointsToRef(e,t,s)}static SlerpToRef(e,t,s,n){s=$t(s,0,1);const a=Me.Vector3[0],l=Me.Vector3[1];a.copyFrom(e);const u=a.length();a.normalizeFromLength(u),l.copyFrom(t);const h=l.length();l.normalizeFromLength(h);const f=I.Dot(a,l);let m,p;if(f<1-Ms){const b=Math.acos(f),v=1/Math.sin(b);m=Math.sin((1-s)*b)*v,p=Math.sin(s*b)*v}else m=1-s,p=s;return a.scaleInPlace(m),l.scaleInPlace(p),n.copyFrom(a).addInPlace(l),n.scaleInPlace(Dj(u,h,s)),n}static SmoothToRef(e,t,s,n,a){return I.SlerpToRef(e,t,n===0?1:s/n,a),a}static FromArray(e,t=0){return new I(e[t],e[t+1],e[t+2])}static FromFloatArray(e,t){return I.FromArray(e,t)}static FromArrayToRef(e,t,s){return s._x=e[t],s._y=e[t+1],s._z=e[t+2],s._isDirty=!0,s}static FromFloatArrayToRef(e,t,s){return I.FromArrayToRef(e,t,s)}static FromFloatsToRef(e,t,s,n){return n.copyFromFloats(e,t,s),n}static Zero(){return new I(0,0,0)}static One(){return new I(1,1,1)}static Up(){return new I(0,1,0)}static get UpReadOnly(){return I._UpReadOnly}static get DownReadOnly(){return I._DownReadOnly}static get RightReadOnly(){return I._RightReadOnly}static get LeftReadOnly(){return I._LeftReadOnly}static get LeftHandedForwardReadOnly(){return I._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return I._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return I._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return I._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return I._ZeroReadOnly}static get OneReadOnly(){return I._OneReadOnly}static Down(){return new I(0,-1,0)}static Forward(e=!1){return new I(0,0,e?-1:1)}static Backward(e=!1){return new I(0,0,e?1:-1)}static Right(){return new I(1,0,0)}static Left(){return new I(-1,0,0)}static Random(e=0,t=1){return new I(is(e,t),is(e,t),is(e,t))}static RandomToRef(e=0,t=1,s){return s.copyFromFloats(is(e,t),is(e,t),is(e,t))}static TransformCoordinates(e,t){const s=I.Zero();return I.TransformCoordinatesToRef(e,t,s),s}static TransformCoordinatesToRef(e,t,s){return I.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,s),s}static TransformCoordinatesFromFloatsToRef(e,t,s,n,a){const l=n.m,u=e*l[0]+t*l[4]+s*l[8]+l[12],h=e*l[1]+t*l[5]+s*l[9]+l[13],f=e*l[2]+t*l[6]+s*l[10]+l[14],m=1/(e*l[3]+t*l[7]+s*l[11]+l[15]);return a._x=u*m,a._y=h*m,a._z=f*m,a._isDirty=!0,a}static TransformNormal(e,t){const s=I.Zero();return I.TransformNormalToRef(e,t,s),s}static TransformNormalToRef(e,t,s){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,s),s}static TransformNormalFromFloatsToRef(e,t,s,n,a){const l=n.m;return a._x=e*l[0]+t*l[4]+s*l[8],a._y=e*l[1]+t*l[5]+s*l[9],a._z=e*l[2]+t*l[6]+s*l[10],a._isDirty=!0,a}static CatmullRom(e,t,s,n,a){const l=a*a,u=a*l,h=.5*(2*t._x+(-e._x+s._x)*a+(2*e._x-5*t._x+4*s._x-n._x)*l+(-e._x+3*t._x-3*s._x+n._x)*u),f=.5*(2*t._y+(-e._y+s._y)*a+(2*e._y-5*t._y+4*s._y-n._y)*l+(-e._y+3*t._y-3*s._y+n._y)*u),m=.5*(2*t._z+(-e._z+s._z)*a+(2*e._z-5*t._z+4*s._z-n._z)*l+(-e._z+3*t._z-3*s._z+n._z)*u);return new I(h,f,m)}static Clamp(e,t,s){const n=new I;return I.ClampToRef(e,t,s,n),n}static ClampToRef(e,t,s,n){let a=e._x;a=a>s._x?s._x:a,a=a<t._x?t._x:a;let l=e._y;l=l>s._y?s._y:l,l=l<t._y?t._y:l;let u=e._z;return u=u>s._z?s._z:u,u=u<t._z?t._z:u,n.copyFromFloats(a,l,u),n}static CheckExtends(e,t,s){t.minimizeInPlace(e),s.maximizeInPlace(e)}static Hermite(e,t,s,n,a){const l=a*a,u=a*l,h=2*u-3*l+1,f=-2*u+3*l,m=u-2*l+a,p=u-l,b=e._x*h+s._x*f+t._x*m+n._x*p,v=e._y*h+s._y*f+t._y*m+n._y*p,R=e._z*h+s._z*f+t._z*m+n._z*p;return new I(b,v,R)}static Hermite1stDerivative(e,t,s,n,a){const l=new I;return this.Hermite1stDerivativeToRef(e,t,s,n,a,l),l}static Hermite1stDerivativeToRef(e,t,s,n,a,l){const u=a*a;return l._x=(u-a)*6*e._x+(3*u-4*a+1)*t._x+(-u+a)*6*s._x+(3*u-2*a)*n._x,l._y=(u-a)*6*e._y+(3*u-4*a+1)*t._y+(-u+a)*6*s._y+(3*u-2*a)*n._y,l._z=(u-a)*6*e._z+(3*u-4*a+1)*t._z+(-u+a)*6*s._z+(3*u-2*a)*n._z,l._isDirty=!0,l}static Lerp(e,t,s){const n=new I(0,0,0);return I.LerpToRef(e,t,s,n),n}static LerpToRef(e,t,s,n){return n._x=e._x+(t._x-e._x)*s,n._y=e._y+(t._y-e._y)*s,n._z=e._z+(t._z-e._z)*s,n._isDirty=!0,n}static Dot(e,t){return e._x*t._x+e._y*t._y+e._z*t._z}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z}static Cross(e,t){const s=new I;return I.CrossToRef(e,t,s),s}static CrossToRef(e,t,s){const n=e._y*t._z-e._z*t._y,a=e._z*t._x-e._x*t._z,l=e._x*t._y-e._y*t._x;return s.copyFromFloats(n,a,l),s}static Normalize(e){const t=I.Zero();return I.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Project(e,t,s,n){const a=new I;return I.ProjectToRef(e,t,s,n,a),a}static ProjectToRef(e,t,s,n,a){const l=n.width,u=n.height,h=n.x,f=n.y,m=Me.Matrix[1],p=pt.LastCreatedEngine?.isNDCHalfZRange,b=p?1:.5,v=p?0:.5;ee.FromValuesToRef(l/2,0,0,0,0,-u/2,0,0,0,0,b,0,h+l/2,u/2+f,v,1,m);const R=Me.Matrix[0];return t.multiplyToRef(s,R),R.multiplyToRef(m,R),I.TransformCoordinatesToRef(e,R,a),a}static Reflect(e,t){return this.ReflectToRef(e,t,new I)}static ReflectToRef(e,t,s){const n=We.Vector3[0];return n.copyFrom(t).scaleInPlace(2*I.Dot(e,t)),s.copyFrom(e).subtractInPlace(n)}static UnprojectFromTransform(e,t,s,n,a){return this.Unproject(e,t,s,n,a,ee.IdentityReadOnly)}static Unproject(e,t,s,n,a,l){const u=new I;return I.UnprojectToRef(e,t,s,n,a,l,u),u}static UnprojectToRef(e,t,s,n,a,l,u){return I.UnprojectFloatsToRef(e._x,e._y,e._z,t,s,n,a,l,u),u}static UnprojectFloatsToRef(e,t,s,n,a,l,u,h,f){const m=Me.Matrix[0];l.multiplyToRef(u,m),m.multiplyToRef(h,m),m.invert();const p=Me.Vector3[0];return p.x=e/n*2-1,p.y=-(t/a*2-1),pt.LastCreatedEngine?.isNDCHalfZRange?p.z=s:p.z=2*s-1,I.TransformCoordinatesToRef(p,m,f),f}static Minimize(e,t){const s=new I;return s.copyFrom(e),s.minimizeInPlace(t),s}static Maximize(e,t){const s=new I;return s.copyFrom(e),s.maximizeInPlace(t),s}static Distance(e,t){return Math.sqrt(I.DistanceSquared(e,t))}static DistanceSquared(e,t){const s=e._x-t._x,n=e._y-t._y,a=e._z-t._z;return s*s+n*n+a*a}static ProjectOnTriangleToRef(e,t,s,n,a){const l=Me.Vector3[0],u=Me.Vector3[1],h=Me.Vector3[2],f=Me.Vector3[3],m=Me.Vector3[4];s.subtractToRef(t,l),n.subtractToRef(t,u),n.subtractToRef(s,h);const p=l.length(),b=u.length(),v=h.length();if(p<Ms||b<Ms||v<Ms)return a.copyFrom(t),I.Distance(e,t);e.subtractToRef(t,m),I.CrossToRef(l,u,f);const R=f.length();if(R<Ms)return a.copyFrom(t),I.Distance(e,t);f.normalizeFromLength(R);let x=m.length();if(x<Ms)return a.copyFrom(t),0;m.normalizeFromLength(x);const T=I.Dot(f,m),E=Me.Vector3[5],A=Me.Vector3[6];E.copyFrom(f).scaleInPlace(-x*T),A.copyFrom(e).addInPlace(E);const D=Me.Vector3[4],M=Me.Vector3[5],k=Me.Vector3[7],U=Me.Vector3[8];D.copyFrom(l).scaleInPlace(1/p),U.copyFrom(u).scaleInPlace(1/b),D.addInPlace(U).scaleInPlace(-1),M.copyFrom(l).scaleInPlace(-1/p),U.copyFrom(h).scaleInPlace(1/v),M.addInPlace(U).scaleInPlace(-1),k.copyFrom(h).scaleInPlace(-1/v),U.copyFrom(u).scaleInPlace(-1/b),k.addInPlace(U).scaleInPlace(-1);const N=Me.Vector3[9];let H;N.copyFrom(A).subtractInPlace(t),I.CrossToRef(D,N,U),H=I.Dot(U,f);const q=H;N.copyFrom(A).subtractInPlace(s),I.CrossToRef(M,N,U),H=I.Dot(U,f);const re=H;N.copyFrom(A).subtractInPlace(n),I.CrossToRef(k,N,U),H=I.Dot(U,f);const ce=H,ae=Me.Vector3[10];let fe,_e;q>0&&re<0?(ae.copyFrom(l),fe=t,_e=s):re>0&&ce<0?(ae.copyFrom(h),fe=s,_e=n):(ae.copyFrom(u).scaleInPlace(-1),fe=n,_e=t);const Te=Me.Vector3[9],z=Me.Vector3[4];if(fe.subtractToRef(A,U),_e.subtractToRef(A,Te),I.CrossToRef(U,Te,z),!(I.Dot(z,f)<0))return a.copyFrom(A),Math.abs(x*T);const Y=Me.Vector3[5];I.CrossToRef(ae,z,Y),Y.normalize();const V=Me.Vector3[9];V.copyFrom(fe).subtractInPlace(A);const ge=V.length();if(ge<Ms)return a.copyFrom(fe),I.Distance(e,fe);V.normalizeFromLength(ge);const L=I.Dot(Y,V),B=Me.Vector3[7];B.copyFrom(A).addInPlace(Y.scaleInPlace(ge*L)),U.copyFrom(B).subtractInPlace(fe),x=ae.length(),ae.normalizeFromLength(x);let X=I.Dot(U,ae)/Math.max(x,Ms);return X=$t(X,0,1),B.copyFrom(fe).addInPlace(ae.scaleInPlace(X*x)),a.copyFrom(B),I.Distance(e,B)}static Center(e,t){return I.CenterToRef(e,t,I.Zero())}static CenterToRef(e,t,s){return s.copyFromFloats((e._x+t._x)/2,(e._y+t._y)/2,(e._z+t._z)/2)}static RotationFromAxis(e,t,s){const n=new I;return I.RotationFromAxisToRef(e,t,s,n),n}static RotationFromAxisToRef(e,t,s,n){const a=Me.Quaternion[0];return Ge.RotationQuaternionFromAxisToRef(e,t,s,a),a.toEulerAnglesToRef(n),n}}I._V8PerformanceHack=new I(.5,.5,.5);I._UpReadOnly=I.Up();I._DownReadOnly=I.Down();I._LeftHandedForwardReadOnly=I.Forward(!1);I._RightHandedForwardReadOnly=I.Forward(!0);I._LeftHandedBackwardReadOnly=I.Backward(!1);I._RightHandedBackwardReadOnly=I.Backward(!0);I._RightReadOnly=I.Right();I._LeftReadOnly=I.Left();I._ZeroReadOnly=I.Zero();I._OneReadOnly=I.One();class ct{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,t=0,s=0,n=0){this._isDirty=!0,this._x=e,this._y=t,this._z=s,this._w=n}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Vector4"}getHashCode(){const e=ri(this._x),t=ri(this._y),s=ri(this._z),n=ri(this._w);let a=e;return a=a*397^t,a=a*397^s,a=a*397^n,a}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,t){return t===void 0&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){return ct.FromArrayToRef(e,t,this),this}addInPlace(e){return this.x+=e._x,this.y+=e._y,this.z+=e._z,this.w+=e._w,this}addInPlaceFromFloats(e,t,s,n){return this.x+=e,this.y+=t,this.z+=s,this.w+=n,this}add(e){return new ct(this._x+e.x,this._y+e.y,this._z+e.z,this._w+e.w)}addToRef(e,t){return t.x=this._x+e.x,t.y=this._y+e.y,t.z=this._z+e.z,t.w=this._w+e.w,t}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subtract(e){return new ct(this._x-e.x,this._y-e.y,this._z-e.z,this._w-e.w)}subtractToRef(e,t){return t.x=this._x-e.x,t.y=this._y-e.y,t.z=this._z-e.z,t.w=this._w-e.w,t}subtractFromFloats(e,t,s,n){return new ct(this._x-e,this._y-t,this._z-s,this._w-n)}subtractFromFloatsToRef(e,t,s,n,a){return a.x=this._x-e,a.y=this._y-t,a.z=this._z-s,a.w=this._w-n,a}negate(){return new ct(-this._x,-this._y,-this._z,-this._w)}negateInPlace(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(e){return e.x=-this._x,e.y=-this._y,e.z=-this._z,e.w=-this._w,e}scaleInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}scale(e){return new ct(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){return t.x=this._x*e,t.y=this._y*e,t.z=this._z*e,t.w=this._w*e,t}scaleAndAddToRef(e,t){return t.x+=this._x*e,t.y+=this._y*e,t.z+=this._z*e,t.w+=this._w*e,t}equals(e){return e&&this._x===e.x&&this._y===e.y&&this._z===e.z&&this._w===e.w}equalsWithEpsilon(e,t=Ms){return e&&Nt(this._x,e.x,t)&&Nt(this._y,e.y,t)&&Nt(this._z,e.z,t)&&Nt(this._w,e.w,t)}equalsToFloats(e,t,s,n){return this._x===e&&this._y===t&&this._z===s&&this._w===n}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiply(e){return new ct(this._x*e.x,this._y*e.y,this._z*e.z,this._w*e.w)}multiplyToRef(e,t){return t.x=this._x*e.x,t.y=this._y*e.y,t.z=this._z*e.z,t.w=this._w*e.w,t}multiplyByFloats(e,t,s,n){return new ct(this._x*e,this._y*t,this._z*s,this._w*n)}divide(e){return new ct(this._x/e.x,this._y/e.y,this._z/e.z,this._w/e.w)}divideToRef(e,t){return t.x=this._x/e.x,t.y=this._y/e.y,t.z=this._z/e.z,t.w=this._w/e.w,t}divideInPlace(e){return this.divideToRef(e,this)}minimizeInPlace(e){return e.x<this._x&&(this.x=e.x),e.y<this._y&&(this.y=e.y),e.z<this._z&&(this.z=e.z),e.w<this._w&&(this.w=e.w),this}maximizeInPlace(e){return e.x>this._x&&(this.x=e.x),e.y>this._y&&(this.y=e.y),e.z>this._z&&(this.z=e.z),e.w>this._w&&(this.w=e.w),this}minimizeInPlaceFromFloats(e,t,s,n){return this.x=Math.min(e,this._x),this.y=Math.min(t,this._y),this.z=Math.min(s,this._z),this.w=Math.min(n,this._w),this}maximizeInPlaceFromFloats(e,t,s,n){return this.x=Math.max(e,this._x),this.y=Math.max(t,this._y),this.z=Math.max(s,this._z),this.w=Math.max(n,this._w),this}floorToRef(e){return e.x=Math.floor(this._x),e.y=Math.floor(this._y),e.z=Math.floor(this._z),e.w=Math.floor(this._w),e}floor(){return new ct(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z),Math.floor(this._w))}fractToRef(e){return e.x=this._x-Math.floor(this._x),e.y=this._y-Math.floor(this._y),e.z=this._z-Math.floor(this._z),e.w=this._w-Math.floor(this._w),e}fract(){return new ct(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z),this._w-Math.floor(this._w))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new ct)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e.x=this._x,e.y=this._y,e.z=this._z,e.w=this._w,e):this.scaleToRef(1/t,e)}toVector3(){return new I(this._x,this._y,this._z)}clone(){return new ct(this._x,this._y,this._z,this._w)}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}copyFromFloats(e,t,s,n){return this.x=e,this.y=t,this.z=s,this.w=n,this}set(e,t,s,n){return this.copyFromFloats(e,t,s,n)}setAll(e){return this.x=this.y=this.z=this.w=e,this}dot(e){return this._x*e.x+this._y*e.y+this._z*e.z+this._w*e.w}static FromArray(e,t){return t||(t=0),new ct(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,s){return s.x=e[t],s.y=e[t+1],s.z=e[t+2],s.w=e[t+3],s}static FromFloatArrayToRef(e,t,s){return ct.FromArrayToRef(e,t,s),s}static FromFloatsToRef(e,t,s,n,a){return a.x=e,a.y=t,a.z=s,a.w=n,a}static Zero(){return new ct(0,0,0,0)}static One(){return new ct(1,1,1,1)}static Random(e=0,t=1){return new ct(is(e,t),is(e,t),is(e,t),is(e,t))}static RandomToRef(e=0,t=1,s){return s.x=is(e,t),s.y=is(e,t),s.z=is(e,t),s.w=is(e,t),s}static Clamp(e,t,s){return ct.ClampToRef(e,t,s,new ct)}static ClampToRef(e,t,s,n){return n.x=$t(e.x,t.x,s.x),n.y=$t(e.y,t.y,s.y),n.z=$t(e.z,t.z,s.z),n.w=$t(e.w,t.w,s.w),n}static CheckExtends(e,t,s){t.minimizeInPlace(e),s.maximizeInPlace(e)}static get ZeroReadOnly(){return ct._ZeroReadOnly}static Normalize(e){return ct.NormalizeToRef(e,new ct)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const s=new ct;return s.copyFrom(e),s.minimizeInPlace(t),s}static Maximize(e,t){const s=new ct;return s.copyFrom(e),s.maximizeInPlace(t),s}static Distance(e,t){return Math.sqrt(ct.DistanceSquared(e,t))}static DistanceSquared(e,t){const s=e.x-t.x,n=e.y-t.y,a=e.z-t.z,l=e.w-t.w;return s*s+n*n+a*a+l*l}static Center(e,t){return ct.CenterToRef(e,t,new ct)}static CenterToRef(e,t,s){return s.x=(e.x+t.x)/2,s.y=(e.y+t.y)/2,s.z=(e.z+t.z)/2,s.w=(e.w+t.w)/2,s}static TransformCoordinates(e,t){return ct.TransformCoordinatesToRef(e,t,new ct)}static TransformCoordinatesToRef(e,t,s){return ct.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,s),s}static TransformCoordinatesFromFloatsToRef(e,t,s,n,a){const l=n.m,u=e*l[0]+t*l[4]+s*l[8]+l[12],h=e*l[1]+t*l[5]+s*l[9]+l[13],f=e*l[2]+t*l[6]+s*l[10]+l[14],m=e*l[3]+t*l[7]+s*l[11]+l[15];return a.x=u,a.y=h,a.z=f,a.w=m,a}static TransformNormal(e,t){return ct.TransformNormalToRef(e,t,new ct)}static TransformNormalToRef(e,t,s){const n=t.m,a=e.x*n[0]+e.y*n[4]+e.z*n[8],l=e.x*n[1]+e.y*n[5]+e.z*n[9],u=e.x*n[2]+e.y*n[6]+e.z*n[10];return s.x=a,s.y=l,s.z=u,s.w=e.w,s}static TransformNormalFromFloatsToRef(e,t,s,n,a,l){const u=a.m;return l.x=e*u[0]+t*u[4]+s*u[8],l.y=e*u[1]+t*u[5]+s*u[9],l.z=e*u[2]+t*u[6]+s*u[10],l.w=n,l}static FromVector3(e,t=0){return new ct(e._x,e._y,e._z,t)}static Dot(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}}ct._V8PerformanceHack=new ct(.5,.5,.5,.5);ct._ZeroReadOnly=ct.Zero();class Ge{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,t=0,s=0,n=1){this._isDirty=!0,this._x=e,this._y=t,this._z=s,this._w=n}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){const e=ri(this._x),t=ri(this._y),s=ri(this._z),n=ri(this._w);let a=e;return a=a*397^t,a=a*397^s,a=a*397^n,a}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){return Ge.FromArrayToRef(e,t,this)}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,t=Ms){return e&&Nt(this._x,e._x,t)&&Nt(this._y,e._y,t)&&Nt(this._z,e._z,t)&&Nt(this._w,e._w,t)}isApprox(e,t=Ms){return e&&(Nt(this._x,e._x,t)&&Nt(this._y,e._y,t)&&Nt(this._z,e._z,t)&&Nt(this._w,e._w,t)||Nt(this._x,-e._x,t)&&Nt(this._y,-e._y,t)&&Nt(this._z,-e._z,t)&&Nt(this._w,-e._w,t))}clone(){return new Ge(this._x,this._y,this._z,this._w)}copyFrom(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this}copyFromFloats(e,t,s,n){return this._x=e,this._y=t,this._z=s,this._w=n,this._isDirty=!0,this}set(e,t,s,n){return this.copyFromFloats(e,t,s,n)}setAll(e){return this.copyFromFloats(e,e,e,e)}add(e){return new Ge(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._w=this._w+e._w,t._isDirty=!0,t}addInPlaceFromFloats(e,t,s,n){return this._x+=e,this._y+=t,this._z+=s,this._w+=n,this._isDirty=!0,this}subtractToRef(e,t){return t._x=this._x-e._x,t._y=this._y-e._y,t._z=this._z-e._z,t._w=this._w-e._w,t._isDirty=!0,t}subtractFromFloats(e,t,s,n){return this.subtractFromFloatsToRef(e,t,s,n,new Ge)}subtractFromFloatsToRef(e,t,s,n,a){return a._x=this._x-e,a._y=this._y-t,a._z=this._z-s,a._w=this._w-n,a._isDirty=!0,a}subtract(e){return new Ge(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this}scale(e){return new Ge(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._w=this._w*e,t._isDirty=!0,t}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._w+=this._w*e,t._isDirty=!0,t}multiply(e){const t=new Ge(0,0,0,1);return this.multiplyToRef(e,t),t}multiplyToRef(e,t){const s=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,n=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,a=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,l=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(s,n,a,l),t}multiplyInPlace(e){return this.multiplyToRef(e,this)}multiplyByFloats(e,t,s,n){return this._x*=e,this._y*=t,this._z*=s,this._w*=n,this._isDirty=!0,this}divide(e){throw new ReferenceError("Can not divide a quaternion")}divideToRef(e,t){throw new ReferenceError("Can not divide a quaternion")}divideInPlace(e){throw new ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw new ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw new ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw new ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw new ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new Ge)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(e){return e._x=-this._x,e._y=-this._y,e._z=-this._z,e._w=-this._w,e._isDirty=!0,e}equalsToFloats(e,t,s,n){return this._x===e&&this._y===t&&this._z===s&&this._w===n}floorToRef(e){throw new ReferenceError("Can not floor a quaternion")}floor(){throw new ReferenceError("Can not floor a quaternion")}fractToRef(e){throw new ReferenceError("Can not fract a quaternion")}fract(){throw new ReferenceError("Can not fract a quaternion")}conjugateToRef(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new Ge(-this._x,-this._y,-this._z,this._w)}invert(){const e=this.conjugate(),t=this.lengthSquared();return t==0||t==1||e.scaleInPlace(1/t),e}invertInPlace(){this.conjugateInPlace();const e=this.lengthSquared();return e==0||e==1?this:(this.scaleInPlace(1/e),this)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new Ge(0,0,0,1);return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0||t===1?e.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/t,e)}toEulerAngles(){const e=I.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){const t=this._z,s=this._x,n=this._y,a=this._w,l=n*t-s*a,u=.4999999;if(l<-u)e._y=2*Math.atan2(n,a),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(l>u)e._y=2*Math.atan2(n,a),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{const h=a*a,f=t*t,m=s*s,p=n*n;e._z=Math.atan2(2*(s*n+t*a),-f-m+p+h),e._x=Math.asin(-2*l),e._y=Math.atan2(2*(t*s+n*a),f-m-p+h),e._isDirty=!0}return e}toAlphaBetaGammaToRef(e){const t=this._z,s=this._x,n=this._y,a=this._w,l=Math.sqrt(s*s+n*n),u=Math.sqrt(t*t+a*a),h=2*Math.atan2(l,u),f=2*Math.atan2(t,a),m=2*Math.atan2(n,s),p=(f+m)/2,b=(f-m)/2;return e.set(b,h,p),e}toRotationMatrix(e){return ee.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return Ge.FromRotationMatrixToRef(e,this),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}toAxisAngle(){const e=I.Zero(),t=this.toAxisAngleToRef(e);return{axis:e,angle:t}}toAxisAngleToRef(e){let t;const s=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),n=this._w;return s>0?(t=2*Math.atan2(s,n),e.set(this._x/s,this._y/s,this._z/s)):(t=0,e.set(1,0,0)),t}static FromRotationMatrix(e){const t=new Ge;return Ge.FromRotationMatrixToRef(e,t),t}static FromRotationMatrixToRef(e,t){const s=e.m,n=s[0],a=s[4],l=s[8],u=s[1],h=s[5],f=s[9],m=s[2],p=s[6],b=s[10],v=n+h+b;let R;return v>0?(R=.5/Math.sqrt(v+1),t._w=.25/R,t._x=(p-f)*R,t._y=(l-m)*R,t._z=(u-a)*R,t._isDirty=!0):n>h&&n>b?(R=2*Math.sqrt(1+n-h-b),t._w=(p-f)/R,t._x=.25*R,t._y=(a+u)/R,t._z=(l+m)/R,t._isDirty=!0):h>b?(R=2*Math.sqrt(1+h-n-b),t._w=(l-m)/R,t._x=(a+u)/R,t._y=.25*R,t._z=(f+p)/R,t._isDirty=!0):(R=2*Math.sqrt(1+b-n-h),t._w=(u-a)/R,t._x=(l+m)/R,t._y=(f+p)/R,t._z=.25*R,t._isDirty=!0),t}static Dot(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w}static AreClose(e,t,s=.1){const n=Ge.Dot(e,t);return 1-n*n<=s}static SmoothToRef(e,t,s,n,a){let l=n===0?1:s/n;return l=$t(l,0,1),Ge.SlerpToRef(e,t,l,a),a}static Zero(){return new Ge(0,0,0,0)}static Inverse(e){return new Ge(-e._x,-e._y,-e._z,e._w)}static InverseToRef(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t}static Identity(){return new Ge(0,0,0,1)}static IsIdentity(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1}static RotationAxis(e,t){return Ge.RotationAxisToRef(e,t,new Ge)}static RotationAxisToRef(e,t,s){s._w=Math.cos(t/2);const n=Math.sin(t/2)/e.length();return s._x=e._x*n,s._y=e._y*n,s._z=e._z*n,s._isDirty=!0,s}static FromArray(e,t){return t||(t=0),new Ge(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,s){return s._x=e[t],s._y=e[t+1],s._z=e[t+2],s._w=e[t+3],s._isDirty=!0,s}static FromFloatsToRef(e,t,s,n,a){return a.copyFromFloats(e,t,s,n),a}static FromEulerAngles(e,t,s){const n=new Ge;return Ge.RotationYawPitchRollToRef(t,e,s,n),n}static FromEulerAnglesToRef(e,t,s,n){return Ge.RotationYawPitchRollToRef(t,e,s,n),n}static FromEulerVector(e){const t=new Ge;return Ge.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromEulerVectorToRef(e,t){return Ge.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromUnitVectorsToRef(e,t,s,n=Ms){const a=I.Dot(e,t)+1;return a<n?Math.abs(e.x)>Math.abs(e.z)?s.set(-e.y,e.x,0,0):s.set(0,-e.z,e.y,0):(I.CrossToRef(e,t,We.Vector3[0]),s.set(We.Vector3[0].x,We.Vector3[0].y,We.Vector3[0].z,a)),s.normalize()}static RotationYawPitchRoll(e,t,s){const n=new Ge;return Ge.RotationYawPitchRollToRef(e,t,s,n),n}static RotationYawPitchRollToRef(e,t,s,n){const a=s*.5,l=t*.5,u=e*.5,h=Math.sin(a),f=Math.cos(a),m=Math.sin(l),p=Math.cos(l),b=Math.sin(u),v=Math.cos(u);return n._x=v*m*f+b*p*h,n._y=b*p*f-v*m*h,n._z=v*p*h-b*m*f,n._w=v*p*f+b*m*h,n._isDirty=!0,n}static RotationAlphaBetaGamma(e,t,s){const n=new Ge;return Ge.RotationAlphaBetaGammaToRef(e,t,s,n),n}static RotationAlphaBetaGammaToRef(e,t,s,n){const a=(s+e)*.5,l=(s-e)*.5,u=t*.5;return n._x=Math.cos(l)*Math.sin(u),n._y=Math.sin(l)*Math.sin(u),n._z=Math.sin(a)*Math.cos(u),n._w=Math.cos(a)*Math.cos(u),n._isDirty=!0,n}static RotationQuaternionFromAxis(e,t,s){const n=new Ge(0,0,0,0);return Ge.RotationQuaternionFromAxisToRef(e,t,s,n),n}static RotationQuaternionFromAxisToRef(e,t,s,n){const a=Me.Matrix[0];return e=e.normalizeToRef(Me.Vector3[0]),t=t.normalizeToRef(Me.Vector3[1]),s=s.normalizeToRef(Me.Vector3[2]),ee.FromXYZAxesToRef(e,t,s,a),Ge.FromRotationMatrixToRef(a,n),n}static FromLookDirectionLH(e,t){const s=new Ge;return Ge.FromLookDirectionLHToRef(e,t,s),s}static FromLookDirectionLHToRef(e,t,s){const n=Me.Matrix[0];return ee.LookDirectionLHToRef(e,t,n),Ge.FromRotationMatrixToRef(n,s),s}static FromLookDirectionRH(e,t){const s=new Ge;return Ge.FromLookDirectionRHToRef(e,t,s),s}static FromLookDirectionRHToRef(e,t,s){const n=Me.Matrix[0];return ee.LookDirectionRHToRef(e,t,n),Ge.FromRotationMatrixToRef(n,s)}static Slerp(e,t,s){const n=Ge.Identity();return Ge.SlerpToRef(e,t,s,n),n}static SlerpToRef(e,t,s,n){let a,l,u=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,h=!1;if(u<0&&(h=!0,u=-u),u>.999999)l=1-s,a=h?-s:s;else{const f=Math.acos(u),m=1/Math.sin(f);l=Math.sin((1-s)*f)*m,a=h?-Math.sin(s*f)*m:Math.sin(s*f)*m}return n._x=l*e._x+a*t._x,n._y=l*e._y+a*t._y,n._z=l*e._z+a*t._z,n._w=l*e._w+a*t._w,n._isDirty=!0,n}static Hermite(e,t,s,n,a){const l=a*a,u=a*l,h=2*u-3*l+1,f=-2*u+3*l,m=u-2*l+a,p=u-l,b=e._x*h+s._x*f+t._x*m+n._x*p,v=e._y*h+s._y*f+t._y*m+n._y*p,R=e._z*h+s._z*f+t._z*m+n._z*p,x=e._w*h+s._w*f+t._w*m+n._w*p;return new Ge(b,v,R,x)}static Hermite1stDerivative(e,t,s,n,a){const l=new Ge;return this.Hermite1stDerivativeToRef(e,t,s,n,a,l),l}static Hermite1stDerivativeToRef(e,t,s,n,a,l){const u=a*a;return l._x=(u-a)*6*e._x+(3*u-4*a+1)*t._x+(-u+a)*6*s._x+(3*u-2*a)*n._x,l._y=(u-a)*6*e._y+(3*u-4*a+1)*t._y+(-u+a)*6*s._y+(3*u-2*a)*n._y,l._z=(u-a)*6*e._z+(3*u-4*a+1)*t._z+(-u+a)*6*s._z+(3*u-2*a)*n._z,l._w=(u-a)*6*e._w+(3*u-4*a+1)*t._w+(-u+a)*6*s._w+(3*u-2*a)*n._w,l._isDirty=!0,l}static Normalize(e){const t=Ge.Zero();return Ge.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Clamp(e,t,s){const n=new Ge;return Ge.ClampToRef(e,t,s,n),n}static ClampToRef(e,t,s,n){return n.copyFromFloats($t(e.x,t.x,s.x),$t(e.y,t.y,s.y),$t(e.z,t.z,s.z),$t(e.w,t.w,s.w))}static Random(e=0,t=1){return new Ge(is(e,t),is(e,t),is(e,t),is(e,t))}static RandomToRef(e=0,t=1,s){return s.copyFromFloats(is(e,t),is(e,t),is(e,t),is(e,t))}static Minimize(){throw new ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw new ReferenceError("Quaternion.Maximize does not make sense")}static Distance(e,t){return Math.sqrt(Ge.DistanceSquared(e,t))}static DistanceSquared(e,t){const s=e.x-t.x,n=e.y-t.y,a=e.z-t.z,l=e.w-t.w;return s*s+n*n+a*a+l*l}static Center(e,t){return Ge.CenterToRef(e,t,Ge.Zero())}static CenterToRef(e,t,s){return s.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2,(e.w+t.w)/2)}}Ge._V8PerformanceHack=new Ge(.5,.5,.5,.5);class ee{static get Use64Bits(){return As.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=rg._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,t=!1,s=!1,n=!0){this._isIdentity=e,this._isIdentity3x2=e||s,this._isIdentityDirty=this._isIdentity?!1:t,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:n}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,As.MatrixTrackPrecisionChange&&As.MatrixTrackedMatrices.push(this),this._m=new As.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;const e=this._m;this._isIdentity=e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(this._isIdentity===!0)return 1;const e=this._m,t=e[0],s=e[1],n=e[2],a=e[3],l=e[4],u=e[5],h=e[6],f=e[7],m=e[8],p=e[9],b=e[10],v=e[11],R=e[12],x=e[13],T=e[14],E=e[15],A=b*E-T*v,D=p*E-x*v,M=p*T-x*b,k=m*E-R*v,U=m*T-b*R,N=m*x-R*p,H=+(u*A-h*D+f*M),q=-(l*A-h*k+f*U),re=+(l*D-u*k+f*N),ce=-(l*M-u*U+h*N);return t*H+s*q+n*re+a*ce}toString(){return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
470${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}
471${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}
472${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`}toArray(e=null,t=0){if(!e)return this._m;const s=this._m;for(let n=0;n<16;n++)e[t+n]=s[n];return this}asArray(){return this._m}fromArray(e,t=0){return ee.FromArrayToRef(e,t,this)}copyFromFloats(...e){return ee.FromArrayToRef(e,0,this)}set(...e){const t=this._m;for(let s=0;s<16;s++)t[s]=e[s];return this.markAsUpdated(),this}setAll(e){const t=this._m;for(let s=0;s<16;s++)t[s]=e;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return ee.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(e){const t=new ee;return this.addToRef(e,t),t}addToRef(e,t){const s=this._m,n=t._m,a=e.m;for(let l=0;l<16;l++)n[l]=s[l]+a[l];return t.markAsUpdated(),t}addToSelf(e){const t=this._m,s=e.m;return t[0]+=s[0],t[1]+=s[1],t[2]+=s[2],t[3]+=s[3],t[4]+=s[4],t[5]+=s[5],t[6]+=s[6],t[7]+=s[7],t[8]+=s[8],t[9]+=s[9],t[10]+=s[10],t[11]+=s[11],t[12]+=s[12],t[13]+=s[13],t[14]+=s[14],t[15]+=s[15],this.markAsUpdated(),this}addInPlace(e){const t=this._m,s=e.m;for(let n=0;n<16;n++)t[n]+=s[n];return this.markAsUpdated(),this}addInPlaceFromFloats(...e){const t=this._m;for(let s=0;s<16;s++)t[s]+=e[s];return this.markAsUpdated(),this}subtract(e){const t=this._m,s=e.m;for(let n=0;n<16;n++)t[n]-=s[n];return this.markAsUpdated(),this}subtractToRef(e,t){const s=this._m,n=e.m,a=t._m;for(let l=0;l<16;l++)a[l]=s[l]-n[l];return t.markAsUpdated(),t}subtractInPlace(e){const t=this._m,s=e.m;for(let n=0;n<16;n++)t[n]-=s[n];return this.markAsUpdated(),this}subtractFromFloats(...e){return this.subtractFromFloatsToRef(...e,new ee)}subtractFromFloatsToRef(...e){const t=e.pop(),s=this._m,n=t._m,a=e;for(let l=0;l<16;l++)n[l]=s[l]-a[l];return t.markAsUpdated(),t}invertToRef(e){return this._isIdentity===!0?(ee.IdentityToRef(e),e):(cA(this,e.asArray())?e.markAsUpdated():e.copyFrom(this),e)}addAtIndex(e,t){return this._m[e]+=t,this.markAsUpdated(),this}multiplyAtIndex(e,t){return this._m[e]*=t,this.markAsUpdated(),this}setTranslationFromFloats(e,t,s){return this._m[12]=e,this._m[13]=t,this._m[14]=s,this.markAsUpdated(),this}addTranslationFromFloats(e,t,s){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=s,this.markAsUpdated(),this}setTranslation(e){return this.setTranslationFromFloats(e._x,e._y,e._z)}getTranslation(){return new I(this._m[12],this._m[13],this._m[14])}getTranslationToRef(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],e}removeRotationAndScaling(){const e=this.m;return ee.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e[12],e[13],e[14],e[15],this),this._updateIdentityStatus(e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1),this}copyFrom(e){e.copyToArray(this._m);const t=e;return this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(e,t=0){return Fj(this,e,t),this}multiply(e){const t=new ee;return this.multiplyToRef(e,t),t}multiplyInPlace(e){const t=this._m,s=e.m;for(let n=0;n<16;n++)t[n]*=s[n];return this.markAsUpdated(),this}multiplyByFloats(...e){const t=this._m;for(let s=0;s<16;s++)t[s]*=e[s];return this.markAsUpdated(),this}multiplyByFloatsToRef(...e){const t=e.pop(),s=this._m,n=t._m,a=e;for(let l=0;l<16;l++)n[l]=s[l]*a[l];return t.markAsUpdated(),t}multiplyToRef(e,t){return this._isIdentity?(t.copyFrom(e),t):e._isIdentity?(t.copyFrom(this),t):(this.multiplyToArray(e,t._m,0),t.markAsUpdated(),t)}multiplyToArray(e,t,s){return lA(this,e,t,s),this}divide(e){return this.divideToRef(e,new ee)}divideToRef(e,t){const s=this._m,n=e.m,a=t._m;for(let l=0;l<16;l++)a[l]=s[l]/n[l];return t.markAsUpdated(),t}divideInPlace(e){const t=this._m,s=e.m;for(let n=0;n<16;n++)t[n]/=s[n];return this.markAsUpdated(),this}minimizeInPlace(e){const t=this._m,s=e.m;for(let n=0;n<16;n++)t[n]=Math.min(t[n],s[n]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...e){const t=this._m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],e[s]);return this.markAsUpdated(),this}maximizeInPlace(e){const t=this._m,s=e.m;for(let n=0;n<16;n++)t[n]=Math.max(t[n],s[n]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...e){const t=this._m;for(let s=0;s<16;s++)t[s]=Math.max(t[s],e[s]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new ee)}negateInPlace(){const e=this._m;for(let t=0;t<16;t++)e[t]=-e[t];return this.markAsUpdated(),this}negateToRef(e){const t=this._m,s=e._m;for(let n=0;n<16;n++)s[n]=-t[n];return e.markAsUpdated(),e}equals(e){const t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;const s=this.m,n=t.m;return s[0]===n[0]&&s[1]===n[1]&&s[2]===n[2]&&s[3]===n[3]&&s[4]===n[4]&&s[5]===n[5]&&s[6]===n[6]&&s[7]===n[7]&&s[8]===n[8]&&s[9]===n[9]&&s[10]===n[10]&&s[11]===n[11]&&s[12]===n[12]&&s[13]===n[13]&&s[14]===n[14]&&s[15]===n[15]}equalsWithEpsilon(e,t=0){const s=this._m,n=e.m;for(let a=0;a<16;a++)if(!Nt(s[a],n[a],t))return!1;return!0}equalsToFloats(...e){const t=this._m;for(let s=0;s<16;s++)if(t[s]!=e[s])return!1;return!0}floor(){return this.floorToRef(new ee)}floorToRef(e){const t=this._m,s=e._m;for(let n=0;n<16;n++)s[n]=Math.floor(t[n]);return e.markAsUpdated(),e}fract(){return this.fractToRef(new ee)}fractToRef(e){const t=this._m,s=e._m;for(let n=0;n<16;n++)s[n]=t[n]-Math.floor(t[n]);return e.markAsUpdated(),e}clone(){const e=new ee;return e.copyFrom(this),e}getClassName(){return"Matrix"}getHashCode(){let e=ri(this._m[0]);for(let t=1;t<16;t++)e=e*397^ri(this._m[t]);return e}decomposeToTransformNode(e){return e.rotationQuaternion=e.rotationQuaternion||new Ge,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,t,s,n,a=!0){if(this._isIdentity)return s&&s.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;const l=this._m;if(s&&s.copyFromFloats(l[12],l[13],l[14]),e=e||Me.Vector3[0],e.x=Math.sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]),e.y=Math.sqrt(l[4]*l[4]+l[5]*l[5]+l[6]*l[6]),e.z=Math.sqrt(l[8]*l[8]+l[9]*l[9]+l[10]*l[10]),n){const u=(a?n.absoluteScaling.x:n.scaling.x)<0?-1:1,h=(a?n.absoluteScaling.y:n.scaling.y)<0?-1:1,f=(a?n.absoluteScaling.z:n.scaling.z)<0?-1:1;e.x*=u,e.y*=h,e.z*=f}else this.determinant()<=0&&(e.y*=-1);if(e._x===0||e._y===0||e._z===0)return t&&t.copyFromFloats(0,0,0,1),!1;if(t){const u=1/e._x,h=1/e._y,f=1/e._z;ee.FromValuesToRef(l[0]*u,l[1]*u,l[2]*u,0,l[4]*h,l[5]*h,l[6]*h,0,l[8]*f,l[9]*f,l[10]*f,0,0,0,0,1,Me.Matrix[0]),Ge.FromRotationMatrixToRef(Me.Matrix[0],t)}return!0}getRow(e){if(e<0||e>3)return null;const t=e*4;return new ct(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])}getRowToRef(e,t){if(e>=0&&e<=3){const s=e*4;t.x=this._m[s+0],t.y=this._m[s+1],t.z=this._m[s+2],t.w=this._m[s+3]}return t}setRow(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)}transpose(){const e=new ee;return ee.TransposeToRef(this,e),e}transposeToRef(e){return ee.TransposeToRef(this,e),e}setRowFromFloats(e,t,s,n,a){if(e<0||e>3)return this;const l=e*4;return this._m[l+0]=t,this._m[l+1]=s,this._m[l+2]=n,this._m[l+3]=a,this.markAsUpdated(),this}scale(e){const t=new ee;return this.scaleToRef(e,t),t}scaleToRef(e,t){for(let s=0;s<16;s++)t._m[s]=this._m[s]*e;return t.markAsUpdated(),t}scaleAndAddToRef(e,t){for(let s=0;s<16;s++)t._m[s]+=this._m[s]*e;return t.markAsUpdated(),t}scaleInPlace(e){const t=this._m;for(let s=0;s<16;s++)t[s]*=e;return this.markAsUpdated(),this}toNormalMatrix(e){const t=Me.Matrix[0];this.invertToRef(t),t.transposeToRef(e);const s=e._m;return ee.FromValuesToRef(s[0],s[1],s[2],0,s[4],s[5],s[6],0,s[8],s[9],s[10],0,0,0,0,1,e),e}getRotationMatrix(){const e=new ee;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){const t=Me.Vector3[0];if(!this.decompose(t))return ee.IdentityToRef(e),e;const s=this._m,n=1/t._x,a=1/t._y,l=1/t._z;return ee.FromValuesToRef(s[0]*n,s[1]*n,s[2]*n,0,s[4]*a,s[5]*a,s[6]*a,0,s[8]*l,s[9]*l,s[10]*l,0,0,0,0,1,e),e}toggleModelMatrixHandInPlace(){const e=this._m;return e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){const e=this._m;return e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this.markAsUpdated(),this}_convertProjectionToHalfZRangeInPlace(){return this.multiplyToRef(Lr,this),this}static FromArray(e,t=0){const s=new ee;return ee.FromArrayToRef(e,t,s),s}static FromArrayToRef(e,t,s){for(let n=0;n<16;n++)s._m[n]=e[n+t];return s.markAsUpdated(),s}static FromFloat32ArrayToRefScaled(e,t,s,n){return n._m[0]=e[0+t]*s,n._m[1]=e[1+t]*s,n._m[2]=e[2+t]*s,n._m[3]=e[3+t]*s,n._m[4]=e[4+t]*s,n._m[5]=e[5+t]*s,n._m[6]=e[6+t]*s,n._m[7]=e[7+t]*s,n._m[8]=e[8+t]*s,n._m[9]=e[9+t]*s,n._m[10]=e[10+t]*s,n._m[11]=e[11+t]*s,n._m[12]=e[12+t]*s,n._m[13]=e[13+t]*s,n._m[14]=e[14+t]*s,n._m[15]=e[15+t]*s,n.markAsUpdated(),n}static get IdentityReadOnly(){return ee._IdentityReadOnly}static FromValuesToRef(e,t,s,n,a,l,u,h,f,m,p,b,v,R,x,T,E){const A=E._m;A[0]=e,A[1]=t,A[2]=s,A[3]=n,A[4]=a,A[5]=l,A[6]=u,A[7]=h,A[8]=f,A[9]=m,A[10]=p,A[11]=b,A[12]=v,A[13]=R,A[14]=x,A[15]=T,E.markAsUpdated()}static FromValues(e,t,s,n,a,l,u,h,f,m,p,b,v,R,x,T){const E=new ee,A=E._m;return A[0]=e,A[1]=t,A[2]=s,A[3]=n,A[4]=a,A[5]=l,A[6]=u,A[7]=h,A[8]=f,A[9]=m,A[10]=p,A[11]=b,A[12]=v,A[13]=R,A[14]=x,A[15]=T,E.markAsUpdated(),E}static Compose(e,t,s){const n=new ee;return ee.ComposeToRef(e,t,s,n),n}static ComposeToRef(e,t,s,n){const a=n._m,l=t._x,u=t._y,h=t._z,f=t._w,m=l+l,p=u+u,b=h+h,v=l*m,R=l*p,x=l*b,T=u*p,E=u*b,A=h*b,D=f*m,M=f*p,k=f*b,U=e._x,N=e._y,H=e._z;return a[0]=(1-(T+A))*U,a[1]=(R+k)*U,a[2]=(x-M)*U,a[3]=0,a[4]=(R-k)*N,a[5]=(1-(v+A))*N,a[6]=(E+D)*N,a[7]=0,a[8]=(x+M)*H,a[9]=(E-D)*H,a[10]=(1-(v+T))*H,a[11]=0,a[12]=s._x,a[13]=s._y,a[14]=s._z,a[15]=1,n.markAsUpdated(),n}static Identity(){const e=ee.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e}static IdentityToRef(e){return ee.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0),e}static Zero(){const e=ee.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e}static RotationX(e){const t=new ee;return ee.RotationXToRef(e,t),t}static Invert(e){const t=new ee;return e.invertToRef(t),t}static RotationXToRef(e,t){const s=Math.sin(e),n=Math.cos(e);return ee.FromValuesToRef(1,0,0,0,0,n,s,0,0,-s,n,0,0,0,0,1,t),t._updateIdentityStatus(n===1&&s===0),t}static RotationY(e){const t=new ee;return ee.RotationYToRef(e,t),t}static RotationYToRef(e,t){const s=Math.sin(e),n=Math.cos(e);return ee.FromValuesToRef(n,0,-s,0,0,1,0,0,s,0,n,0,0,0,0,1,t),t._updateIdentityStatus(n===1&&s===0),t}static RotationZ(e){const t=new ee;return ee.RotationZToRef(e,t),t}static RotationZToRef(e,t){const s=Math.sin(e),n=Math.cos(e);return ee.FromValuesToRef(n,s,0,0,-s,n,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(n===1&&s===0),t}static RotationAxis(e,t){const s=new ee;return ee.RotationAxisToRef(e,t,s),s}static RotationAxisToRef(e,t,s){const n=Math.sin(-t),a=Math.cos(-t),l=1-a;e=e.normalizeToRef(Me.Vector3[0]);const u=s._m;return u[0]=e._x*e._x*l+a,u[1]=e._x*e._y*l-e._z*n,u[2]=e._x*e._z*l+e._y*n,u[3]=0,u[4]=e._y*e._x*l+e._z*n,u[5]=e._y*e._y*l+a,u[6]=e._y*e._z*l-e._x*n,u[7]=0,u[8]=e._z*e._x*l-e._y*n,u[9]=e._z*e._y*l+e._x*n,u[10]=e._z*e._z*l+a,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,s.markAsUpdated(),s}static RotationAlignToRef(e,t,s,n=!1){const a=I.Dot(t,e),l=s._m;if(a<-1+Ms)l[0]=-1,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=n?1:-1,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=n?-1:1,l[11]=0;else{const u=I.Cross(t,e),h=1/(1+a);l[0]=u._x*u._x*h+a,l[1]=u._y*u._x*h-u._z,l[2]=u._z*u._x*h+u._y,l[3]=0,l[4]=u._x*u._y*h+u._z,l[5]=u._y*u._y*h+a,l[6]=u._z*u._y*h-u._x,l[7]=0,l[8]=u._x*u._z*h-u._y,l[9]=u._y*u._z*h+u._x,l[10]=u._z*u._z*h+a,l[11]=0}return l[12]=0,l[13]=0,l[14]=0,l[15]=1,s.markAsUpdated(),s}static RotationYawPitchRoll(e,t,s){const n=new ee;return ee.RotationYawPitchRollToRef(e,t,s,n),n}static RotationYawPitchRollToRef(e,t,s,n){return Ge.RotationYawPitchRollToRef(e,t,s,Me.Quaternion[0]),Me.Quaternion[0].toRotationMatrix(n),n}static Scaling(e,t,s){const n=new ee;return ee.ScalingToRef(e,t,s,n),n}static ScalingToRef(e,t,s,n){return ee.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,s,0,0,0,0,1,n),n._updateIdentityStatus(e===1&&t===1&&s===1),n}static Translation(e,t,s){const n=new ee;return ee.TranslationToRef(e,t,s,n),n}static TranslationToRef(e,t,s,n){return ee.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,s,1,n),n._updateIdentityStatus(e===0&&t===0&&s===0),n}static Lerp(e,t,s){const n=new ee;return ee.LerpToRef(e,t,s,n),n}static LerpToRef(e,t,s,n){const a=n._m,l=e.m,u=t.m;for(let h=0;h<16;h++)a[h]=l[h]*(1-s)+u[h]*s;return n.markAsUpdated(),n}static DecomposeLerp(e,t,s){const n=new ee;return ee.DecomposeLerpToRef(e,t,s,n),n}static DecomposeLerpToRef(e,t,s,n){const a=Me.Vector3[0],l=Me.Quaternion[0],u=Me.Vector3[1];e.decompose(a,l,u);const h=Me.Vector3[2],f=Me.Quaternion[1],m=Me.Vector3[3];t.decompose(h,f,m);const p=Me.Vector3[4];I.LerpToRef(a,h,s,p);const b=Me.Quaternion[2];Ge.SlerpToRef(l,f,s,b);const v=Me.Vector3[5];return I.LerpToRef(u,m,s,v),ee.ComposeToRef(p,b,v,n),n}static LookAtLH(e,t,s){const n=new ee;return ee.LookAtLHToRef(e,t,s,n),n}static LookAtLHToRef(e,t,s,n){const a=Me.Vector3[0],l=Me.Vector3[1],u=Me.Vector3[2];t.subtractToRef(e,u),u.normalize(),I.CrossToRef(s,u,a);const h=a.lengthSquared();h===0?a.x=1:a.normalizeFromLength(Math.sqrt(h)),I.CrossToRef(u,a,l),l.normalize();const f=-I.Dot(a,e),m=-I.Dot(l,e),p=-I.Dot(u,e);return ee.FromValuesToRef(a._x,l._x,u._x,0,a._y,l._y,u._y,0,a._z,l._z,u._z,0,f,m,p,1,n),n}static LookAtRH(e,t,s){const n=new ee;return ee.LookAtRHToRef(e,t,s,n),n}static LookAtRHToRef(e,t,s,n){const a=Me.Vector3[0],l=Me.Vector3[1],u=Me.Vector3[2];e.subtractToRef(t,u),u.normalize(),I.CrossToRef(s,u,a);const h=a.lengthSquared();h===0?a.x=1:a.normalizeFromLength(Math.sqrt(h)),I.CrossToRef(u,a,l),l.normalize();const f=-I.Dot(a,e),m=-I.Dot(l,e),p=-I.Dot(u,e);return ee.FromValuesToRef(a._x,l._x,u._x,0,a._y,l._y,u._y,0,a._z,l._z,u._z,0,f,m,p,1,n),n}static LookDirectionLH(e,t){const s=new ee;return ee.LookDirectionLHToRef(e,t,s),s}static LookDirectionLHToRef(e,t,s){const n=Me.Vector3[0];n.copyFrom(e),n.scaleInPlace(-1);const a=Me.Vector3[1];return I.CrossToRef(t,n,a),ee.FromValuesToRef(a._x,a._y,a._z,0,t._x,t._y,t._z,0,n._x,n._y,n._z,0,0,0,0,1,s),s}static LookDirectionRH(e,t){const s=new ee;return ee.LookDirectionRHToRef(e,t,s),s}static LookDirectionRHToRef(e,t,s){const n=Me.Vector3[2];return I.CrossToRef(t,e,n),ee.FromValuesToRef(n._x,n._y,n._z,0,t._x,t._y,t._z,0,e._x,e._y,e._z,0,0,0,0,1,s),s}static OrthoLH(e,t,s,n,a){const l=new ee;return ee.OrthoLHToRef(e,t,s,n,l,a),l}static OrthoLHToRef(e,t,s,n,a,l){const u=s,h=n,f=2/e,m=2/t,p=2/(h-u),b=-(h+u)/(h-u);return ee.FromValuesToRef(f,0,0,0,0,m,0,0,0,0,p,0,0,0,b,1,a),l&&a.multiplyToRef(Lr,a),a._updateIdentityStatus(f===1&&m===1&&p===1&&b===0),a}static OrthoOffCenterLH(e,t,s,n,a,l,u){const h=new ee;return ee.OrthoOffCenterLHToRef(e,t,s,n,a,l,h,u),h}static OrthoOffCenterLHToRef(e,t,s,n,a,l,u,h){const f=a,m=l,p=2/(t-e),b=2/(n-s),v=2/(m-f),R=-(m+f)/(m-f),x=(e+t)/(e-t),T=(n+s)/(s-n);return ee.FromValuesToRef(p,0,0,0,0,b,0,0,0,0,v,0,x,T,R,1,u),h&&u.multiplyToRef(Lr,u),u.markAsUpdated(),u}static ObliqueOffCenterLHToRef(e,t,s,n,a,l,u,h,f,m,p){const b=-u*Math.cos(h),v=-u*Math.sin(h);return ee.TranslationToRef(0,0,-f,Me.Matrix[1]),ee.FromValuesToRef(1,0,0,0,0,1,0,0,b,v,1,0,0,0,0,1,Me.Matrix[0]),Me.Matrix[1].multiplyToRef(Me.Matrix[0],Me.Matrix[0]),ee.TranslationToRef(0,0,f,Me.Matrix[1]),Me.Matrix[0].multiplyToRef(Me.Matrix[1],Me.Matrix[0]),ee.OrthoOffCenterLHToRef(e,t,s,n,a,l,m,p),Me.Matrix[0].multiplyToRef(m,m),m}static OrthoOffCenterRH(e,t,s,n,a,l,u){const h=new ee;return ee.OrthoOffCenterRHToRef(e,t,s,n,a,l,h,u),h}static OrthoOffCenterRHToRef(e,t,s,n,a,l,u,h){return ee.OrthoOffCenterLHToRef(e,t,s,n,a,l,u,h),u._m[10]*=-1,u}static ObliqueOffCenterRHToRef(e,t,s,n,a,l,u,h,f,m,p){const b=u*Math.cos(h),v=u*Math.sin(h);return ee.TranslationToRef(0,0,f,Me.Matrix[1]),ee.FromValuesToRef(1,0,0,0,0,1,0,0,b,v,1,0,0,0,0,1,Me.Matrix[0]),Me.Matrix[1].multiplyToRef(Me.Matrix[0],Me.Matrix[0]),ee.TranslationToRef(0,0,-f,Me.Matrix[1]),Me.Matrix[0].multiplyToRef(Me.Matrix[1],Me.Matrix[0]),ee.OrthoOffCenterRHToRef(e,t,s,n,a,l,m,p),Me.Matrix[0].multiplyToRef(m,m),m}static PerspectiveLH(e,t,s,n,a,l=0){const u=new ee,h=s,f=n,m=2*h/e,p=2*h/t,b=(f+h)/(f-h),v=-2*f*h/(f-h),R=Math.tan(l);return ee.FromValuesToRef(m,0,0,0,0,p,0,R,0,0,b,1,0,0,v,0,u),a&&u.multiplyToRef(Lr,u),u._updateIdentityStatus(!1),u}static PerspectiveFovLH(e,t,s,n,a,l=0,u=!1){const h=new ee;return ee.PerspectiveFovLHToRef(e,t,s,n,h,!0,a,l,u),h}static PerspectiveFovLHToRef(e,t,s,n,a,l=!0,u,h=0,f=!1){const m=s,p=n,b=1/Math.tan(e*.5),v=l?b/t:b,R=l?b:b*t,x=f&&m===0?-1:p!==0?(p+m)/(p-m):1,T=f&&m===0?2*p:p!==0?-2*p*m/(p-m):-2*m,E=Math.tan(h);return ee.FromValuesToRef(v,0,0,0,0,R,0,E,0,0,x,1,0,0,T,0,a),u&&a.multiplyToRef(Lr,a),a._updateIdentityStatus(!1),a}static PerspectiveFovReverseLHToRef(e,t,s,n,a,l=!0,u,h=0){const f=1/Math.tan(e*.5),m=l?f/t:f,p=l?f:f*t,b=Math.tan(h);return ee.FromValuesToRef(m,0,0,0,0,p,0,b,0,0,-s,1,0,0,1,0,a),u&&a.multiplyToRef(Lr,a),a._updateIdentityStatus(!1),a}static PerspectiveFovRH(e,t,s,n,a,l=0,u=!1){const h=new ee;return ee.PerspectiveFovRHToRef(e,t,s,n,h,!0,a,l,u),h}static PerspectiveFovRHToRef(e,t,s,n,a,l=!0,u,h=0,f=!1){const m=s,p=n,b=1/Math.tan(e*.5),v=l?b/t:b,R=l?b:b*t,x=f&&m===0?1:p!==0?-(p+m)/(p-m):-1,T=f&&m===0?2*p:p!==0?-2*p*m/(p-m):-2*m,E=Math.tan(h);return ee.FromValuesToRef(v,0,0,0,0,R,0,E,0,0,x,-1,0,0,T,0,a),u&&a.multiplyToRef(Lr,a),a._updateIdentityStatus(!1),a}static PerspectiveFovReverseRHToRef(e,t,s,n,a,l=!0,u,h=0){const f=1/Math.tan(e*.5),m=l?f/t:f,p=l?f:f*t,b=Math.tan(h);return ee.FromValuesToRef(m,0,0,0,0,p,0,b,0,0,-s,-1,0,0,-1,0,a),u&&a.multiplyToRef(Lr,a),a._updateIdentityStatus(!1),a}static GetFinalMatrix(e,t,s,n,a,l){const u=e.width,h=e.height,f=e.x,m=e.y,p=ee.FromValues(u/2,0,0,0,0,-h/2,0,0,0,0,l-a,0,f+u/2,h/2+m,a,1),b=new ee;return t.multiplyToRef(s,b),b.multiplyToRef(n,b),b.multiplyToRef(p,b)}static GetAsMatrix2x2(e){const t=e.m,s=[t[0],t[1],t[4],t[5]];return As.MatrixUse64Bits?s:new Float32Array(s)}static GetAsMatrix3x3(e){const t=e.m,s=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return As.MatrixUse64Bits?s:new Float32Array(s)}static Transpose(e){const t=new ee;return ee.TransposeToRef(e,t),t}static TransposeToRef(e,t){const s=e.m,n=s[0],a=s[4],l=s[8],u=s[12],h=s[1],f=s[5],m=s[9],p=s[13],b=s[2],v=s[6],R=s[10],x=s[14],T=s[3],E=s[7],A=s[11],D=s[15],M=t._m;return M[0]=n,M[1]=a,M[2]=l,M[3]=u,M[4]=h,M[5]=f,M[6]=m,M[7]=p,M[8]=b,M[9]=v,M[10]=R,M[11]=x,M[12]=T,M[13]=E,M[14]=A,M[15]=D,t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t}static Reflection(e){const t=new ee;return ee.ReflectionToRef(e,t),t}static ReflectionToRef(e,t){e.normalize();const s=e.normal.x,n=e.normal.y,a=e.normal.z,l=-2*s,u=-2*n,h=-2*a;return ee.FromValuesToRef(l*s+1,u*s,h*s,0,l*n,u*n+1,h*n,0,l*a,u*a,h*a+1,0,l*e.d,u*e.d,h*e.d,1,t),t}static FromXYZAxesToRef(e,t,s,n){return ee.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,s._x,s._y,s._z,0,0,0,0,1,n),n}static FromQuaternionToRef(e,t){const s=e._x*e._x,n=e._y*e._y,a=e._z*e._z,l=e._x*e._y,u=e._z*e._w,h=e._z*e._x,f=e._y*e._w,m=e._y*e._z,p=e._x*e._w;return t._m[0]=1-2*(n+a),t._m[1]=2*(l+u),t._m[2]=2*(h-f),t._m[3]=0,t._m[4]=2*(l-u),t._m[5]=1-2*(a+s),t._m[6]=2*(m+p),t._m[7]=0,t._m[8]=2*(h+f),t._m[9]=2*(m-p),t._m[10]=1-2*(n+s),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t.markAsUpdated(),t}}ee._IdentityReadOnly=ee.Identity();class Me{}Me.Vector3=Zr(11,I.Zero);Me.Matrix=Zr(2,ee.Identity);Me.Quaternion=Zr(3,Ge.Zero);class We{}We.Vector2=Zr(3,Xe.Zero);We.Vector3=Zr(13,I.Zero);We.Vector4=Zr(3,ct.Zero);We.Quaternion=Zr(3,Ge.Zero);We.Matrix=Zr(8,ee.Identity);const Lr=ee.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1);let eR=!1;function kj(){eR||(eR=!0,Object.defineProperties(Xe.prototype,{dimension:{value:[2]},rank:{value:1}}),Object.defineProperties(I.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(ct.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(Ge.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(ee.prototype,{dimension:{value:[4,4]},rank:{value:2}}),ar("BABYLON.Vector2",Xe),ar("BABYLON.Vector3",I),ar("BABYLON.Vector4",ct),ar("BABYLON.Matrix",ee))}var tR;(function(i){i[i.LOCAL=0]="LOCAL",i[i.WORLD=1]="WORLD",i[i.BONE=2]="BONE"})(tR||(tR={}));class uc{}uc.X=new I(1,0,0);uc.Y=new I(0,1,0);uc.Z=new I(0,0,1);var sR;(function(i){i[i.X=0]="X",i[i.Y=1]="Y",i[i.Z=2]="Z"})(sR||(sR={}));function Oo(i){return Math.pow(i,Mj)}function Do(i){return i<=.04045?.0773993808*i:Math.pow(.947867299*(i+.055),2.4)}function Io(i){return Math.pow(i,Aj)}function Fo(i){return i<=.0031308?12.92*i:1.055*Math.pow(i,.41666)-.055}class _t{constructor(e=0,t=0,s=0){this.r=e,this.g=t,this.b=s}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"}getClassName(){return"Color3"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this}fromArray(e,t=0){return _t.FromArrayToRef(e,t,this),this}toColor4(e=1){return new St(this.r,this.g,this.b,e)}asArray(){return[this.r,this.g,this.b]}toLuminance(){return this.r*.3+this.g*.59+this.b*.11}multiply(e){return new _t(this.r*e.r,this.g*e.g,this.b*e.b)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyByFloats(e,t,s){return new _t(this.r*e,this.g*t,this.b*s)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.r,e.g,e.b)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.r,e.g,e.b)}minimizeInPlaceFromFloats(e,t,s){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(s,this.b),this}maximizeInPlaceFromFloats(e,t,s){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(s,this.b),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b}equalsFloats(e,t,s){return this.equalsToFloats(e,t,s)}equalsToFloats(e,t,s){return this.r===e&&this.g===t&&this.b===s}equalsWithEpsilon(e,t=Ms){return Nt(this.r,e.r,t)&&Nt(this.g,e.g,t)&&Nt(this.b,e.b,t)}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}scale(e){return new _t(this.r*e,this.g*e,this.b*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t}clampToRef(e=0,t=1,s){return s.r=$t(this.r,e,t),s.g=$t(this.g,e,t),s.b=$t(this.b,e,t),s}add(e){return new _t(this.r+e.r,this.g+e.g,this.b+e.b)}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addInPlaceFromFloats(e,t,s){return this.r+=e,this.g+=t,this.b+=s,this}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t}subtract(e){return new _t(this.r-e.r,this.g-e.g,this.b-e.b)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this}subtractFromFloats(e,t,s){return new _t(this.r-e,this.g-t,this.b-s)}subtractFromFloatsToRef(e,t,s,n){return n.r=this.r-e,n.g=this.g-t,n.b=this.b-s,n}clone(){return new _t(this.r,this.g,this.b)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyFromFloats(e,t,s){return this.r=e,this.g=t,this.b=s,this}set(e,t,s){return this.copyFromFloats(e,t,s)}setAll(e){return this.r=this.g=this.b=e,this}toHexString(){const e=Math.round(this.r*255),t=Math.round(this.g*255),s=Math.round(this.b*255);return"#"+xn(e)+xn(t)+xn(s)}fromHexString(e){return e.substring(0,1)!=="#"||e.length!==7?this:(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,this)}toHSV(){return this.toHSVToRef(new _t)}toHSVToRef(e){const t=this.r,s=this.g,n=this.b,a=Math.max(t,s,n),l=Math.min(t,s,n);let u=0,h=0;const f=a,m=a-l;return a!==0&&(h=m/a),a!=l&&(a==t?(u=(s-n)/m,s<n&&(u+=6)):a==s?u=(n-t)/m+2:a==n&&(u=(t-s)/m+4),u*=60),e.r=u,e.g=h,e.b=f,e}toLinearSpace(e=!1){const t=new _t;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=Do(this.r),e.g=Do(this.g),e.b=Do(this.b)):(e.r=Oo(this.r),e.g=Oo(this.g),e.b=Oo(this.b)),this}toGammaSpace(e=!1){const t=new _t;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=Fo(this.r),e.g=Fo(this.g),e.b=Fo(this.b)):(e.r=Io(this.r),e.g=Io(this.g),e.b=Io(this.b)),this}static HSVtoRGBToRef(e,t,s,n){const a=s*t,l=e/60,u=a*(1-Math.abs(l%2-1));let h=0,f=0,m=0;l>=0&&l<=1?(h=a,f=u):l>=1&&l<=2?(h=u,f=a):l>=2&&l<=3?(f=a,m=u):l>=3&&l<=4?(f=u,m=a):l>=4&&l<=5?(h=u,m=a):l>=5&&l<=6&&(h=a,m=u);const p=s-a;return n.r=h+p,n.g=f+p,n.b=m+p,n}static FromHSV(e,t,s){const n=new _t(0,0,0);return _t.HSVtoRGBToRef(e,t,s,n),n}static FromHexString(e){return new _t(0,0,0).fromHexString(e)}static FromArray(e,t=0){return new _t(e[t],e[t+1],e[t+2])}static FromArrayToRef(e,t=0,s){s.r=e[t],s.g=e[t+1],s.b=e[t+2]}static FromInts(e,t,s){return new _t(e/255,t/255,s/255)}static Lerp(e,t,s){const n=new _t(0,0,0);return _t.LerpToRef(e,t,s,n),n}static LerpToRef(e,t,s,n){n.r=e.r+(t.r-e.r)*s,n.g=e.g+(t.g-e.g)*s,n.b=e.b+(t.b-e.b)*s}static Hermite(e,t,s,n,a){const l=a*a,u=a*l,h=2*u-3*l+1,f=-2*u+3*l,m=u-2*l+a,p=u-l,b=e.r*h+s.r*f+t.r*m+n.r*p,v=e.g*h+s.g*f+t.g*m+n.g*p,R=e.b*h+s.b*f+t.b*m+n.b*p;return new _t(b,v,R)}static Hermite1stDerivative(e,t,s,n,a){const l=_t.Black();return this.Hermite1stDerivativeToRef(e,t,s,n,a,l),l}static Hermite1stDerivativeToRef(e,t,s,n,a,l){const u=a*a;l.r=(u-a)*6*e.r+(3*u-4*a+1)*t.r+(-u+a)*6*s.r+(3*u-2*a)*n.r,l.g=(u-a)*6*e.g+(3*u-4*a+1)*t.g+(-u+a)*6*s.g+(3*u-2*a)*n.g,l.b=(u-a)*6*e.b+(3*u-4*a+1)*t.b+(-u+a)*6*s.b+(3*u-2*a)*n.b}static Red(){return new _t(1,0,0)}static Green(){return new _t(0,1,0)}static Blue(){return new _t(0,0,1)}static Black(){return new _t(0,0,0)}static get BlackReadOnly(){return _t._BlackReadOnly}static White(){return new _t(1,1,1)}static Purple(){return new _t(.5,0,.5)}static Magenta(){return new _t(1,0,1)}static Yellow(){return new _t(1,1,0)}static Gray(){return new _t(.5,.5,.5)}static Teal(){return new _t(0,1,1)}static Random(){return new _t(Math.random(),Math.random(),Math.random())}}_t._V8PerformanceHack=new _t(.5,.5,.5);_t._BlackReadOnly=_t.Black();class St{constructor(e=0,t=0,s=0,n=1){this.r=e,this.g=t,this.b=s,this.a=n}asArray(){return[this.r,this.g,this.b,this.a]}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}add(e){return new St(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t.a=this.a+e.a,t}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this}addInPlaceFromFloats(e,t,s,n){return this.r+=e,this.g+=t,this.b+=s,this.a+=n,this}subtract(e){return new St(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this.a-=e.a,this}subtractFromFloats(e,t,s,n){return new St(this.r-e,this.g-t,this.b-s,this.a-n)}subtractFromFloatsToRef(e,t,s,n,a){return a.r=this.r-e,a.g=this.g-t,a.b=this.b-s,a.a=this.a-n,a}scale(e){return new St(this.r*e,this.g*e,this.b*e,this.a*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this.a*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,t}clampToRef(e=0,t=1,s){return s.r=$t(this.r,e,t),s.g=$t(this.g,e,t),s.b=$t(this.b,e,t),s.a=$t(this.a,e,t),s}multiply(e){return new St(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this.a*=e.a,this}multiplyByFloats(e,t,s,n){return new St(this.r*e,this.g*t,this.b*s,this.a*n)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.r=Math.min(this.r,e.r),this.g=Math.min(this.g,e.g),this.b=Math.min(this.b,e.b),this.a=Math.min(this.a,e.a),this}maximizeInPlace(e){return this.r=Math.max(this.r,e.r),this.g=Math.max(this.g,e.g),this.b=Math.max(this.b,e.b),this.a=Math.max(this.a,e.a),this}minimizeInPlaceFromFloats(e,t,s,n){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(s,this.b),this.a=Math.min(n,this.a),this}maximizeInPlaceFromFloats(e,t,s,n){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(s,this.b),this.a=Math.max(n,this.a),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}equalsWithEpsilon(e,t=Ms){return Nt(this.r,e.r,t)&&Nt(this.g,e.g,t)&&Nt(this.b,e.b,t)&&Nt(this.a,e.a,t)}equalsToFloats(e,t,s,n){return this.r===e&&this.g===t&&this.b===s&&this.a===n}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"}getClassName(){return"Color4"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e=e*397^(this.a*255|0),e}clone(){return new St().copyFrom(this)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}copyFromFloats(e,t,s,n){return this.r=e,this.g=t,this.b=s,this.a=n,this}set(e,t,s,n){return this.copyFromFloats(e,t,s,n)}setAll(e){return this.r=this.g=this.b=this.a=e,this}toHexString(e=!1){const t=Math.round(this.r*255),s=Math.round(this.g*255),n=Math.round(this.b*255);if(e)return"#"+xn(t)+xn(s)+xn(n);const a=Math.round(this.a*255);return"#"+xn(t)+xn(s)+xn(n)+xn(a)}fromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?this:(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,e.length===9&&(this.a=parseInt(e.substring(7,9),16)/255),this)}toLinearSpace(e=!1){const t=new St;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=Do(this.r),e.g=Do(this.g),e.b=Do(this.b)):(e.r=Oo(this.r),e.g=Oo(this.g),e.b=Oo(this.b)),e.a=this.a,this}toGammaSpace(e=!1){const t=new St;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=Fo(this.r),e.g=Fo(this.g),e.b=Fo(this.b)):(e.r=Io(this.r),e.g=Io(this.g),e.b=Io(this.b)),e.a=this.a,this}static FromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?new St(0,0,0,0):new St(0,0,0,1).fromHexString(e)}static Lerp(e,t,s){return St.LerpToRef(e,t,s,new St)}static LerpToRef(e,t,s,n){return n.r=e.r+(t.r-e.r)*s,n.g=e.g+(t.g-e.g)*s,n.b=e.b+(t.b-e.b)*s,n.a=e.a+(t.a-e.a)*s,n}static Hermite(e,t,s,n,a){const l=a*a,u=a*l,h=2*u-3*l+1,f=-2*u+3*l,m=u-2*l+a,p=u-l,b=e.r*h+s.r*f+t.r*m+n.r*p,v=e.g*h+s.g*f+t.g*m+n.g*p,R=e.b*h+s.b*f+t.b*m+n.b*p,x=e.a*h+s.a*f+t.a*m+n.a*p;return new St(b,v,R,x)}static Hermite1stDerivative(e,t,s,n,a){const l=new St;return this.Hermite1stDerivativeToRef(e,t,s,n,a,l),l}static Hermite1stDerivativeToRef(e,t,s,n,a,l){const u=a*a;l.r=(u-a)*6*e.r+(3*u-4*a+1)*t.r+(-u+a)*6*s.r+(3*u-2*a)*n.r,l.g=(u-a)*6*e.g+(3*u-4*a+1)*t.g+(-u+a)*6*s.g+(3*u-2*a)*n.g,l.b=(u-a)*6*e.b+(3*u-4*a+1)*t.b+(-u+a)*6*s.b+(3*u-2*a)*n.b,l.a=(u-a)*6*e.a+(3*u-4*a+1)*t.a+(-u+a)*6*s.a+(3*u-2*a)*n.a}static FromColor3(e,t=1){return new St(e.r,e.g,e.b,t)}static FromArray(e,t=0){return new St(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t=0,s){s.r=e[t],s.g=e[t+1],s.b=e[t+2],s.a=e[t+3]}static FromInts(e,t,s,n){return new St(e/255,t/255,s/255,n/255)}static CheckColors4(e,t){if(e.length===t*3){const s=[];for(let n=0;n<e.length;n+=3){const a=n/3*4;s[a]=e[n],s[a+1]=e[n+1],s[a+2]=e[n+2],s[a+3]=1}return s}return e}}St._V8PerformanceHack=new St(.5,.5,.5,.5);_t.Black;let iR=!1;function Lj(){iR||(iR=!0,Object.defineProperties(_t.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(St.prototype,{dimension:{value:[4]},rank:{value:1}}),ar("BABYLON.Color3",_t),ar("BABYLON.Color4",St))}class sn{constructor(e,t,s,n){this.normal=new I(e,t,s),this.d=n}asArray(){return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){return new sn(this.normal.x,this.normal.y,this.normal.z,this.d)}getClassName(){return"Plane"}getHashCode(){let e=this.normal.getHashCode();return e=e*397^(this.d|0),e}normalize(){const e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z);let t=0;return e!==0&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this}transform(e){const t=sn._TmpMatrix;e.invertToRef(t);const s=t.m,n=this.normal.x,a=this.normal.y,l=this.normal.z,u=this.d,h=n*s[0]+a*s[1]+l*s[2]+u*s[3],f=n*s[4]+a*s[5]+l*s[6]+u*s[7],m=n*s[8]+a*s[9]+l*s[10]+u*s[11],p=n*s[12]+a*s[13]+l*s[14]+u*s[15];return new sn(h,f,m,p)}dotCoordinate(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d}copyFromPoints(e,t,s){const n=t.x-e.x,a=t.y-e.y,l=t.z-e.z,u=s.x-e.x,h=s.y-e.y,f=s.z-e.z,m=a*f-l*h,p=l*u-n*f,b=n*h-a*u,v=Math.sqrt(m*m+p*p+b*b);let R;return v!==0?R=1/v:R=0,this.normal.x=m*R,this.normal.y=p*R,this.normal.z=b*R,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this}isFrontFacingTo(e,t){return I.Dot(this.normal,e)<=t}signedDistanceTo(e){return I.Dot(e,this.normal)+this.d}static FromArray(e){return new sn(e[0],e[1],e[2],e[3])}static FromPoints(e,t,s){const n=new sn(0,0,0,0);return n.copyFromPoints(e,t,s),n}static FromPositionAndNormal(e,t){const s=new sn(0,0,0,0);return this.FromPositionAndNormalToRef(e,t,s)}static FromPositionAndNormalToRef(e,t,s){return s.normal.copyFrom(t),s.normal.normalize(),s.d=-e.dot(s.normal),s}static SignedDistanceToPlaneFromPositionAndNormal(e,t,s){const n=-(t.x*e.x+t.y*e.y+t.z*e.z);return I.Dot(s,t)+n}}sn._TmpMatrix=ee.Identity();class Yi{static GetPlanes(e){const t=[];for(let s=0;s<6;s++)t.push(new sn(0,0,0,0));return Yi.GetPlanesToRef(e,t),t}static GetNearPlaneToRef(e,t){const s=e.m;t.normal.x=s[3]+s[2],t.normal.y=s[7]+s[6],t.normal.z=s[11]+s[10],t.d=s[15]+s[14],t.normalize()}static GetFarPlaneToRef(e,t){const s=e.m;t.normal.x=s[3]-s[2],t.normal.y=s[7]-s[6],t.normal.z=s[11]-s[10],t.d=s[15]-s[14],t.normalize()}static GetLeftPlaneToRef(e,t){const s=e.m;t.normal.x=s[3]+s[0],t.normal.y=s[7]+s[4],t.normal.z=s[11]+s[8],t.d=s[15]+s[12],t.normalize()}static GetRightPlaneToRef(e,t){const s=e.m;t.normal.x=s[3]-s[0],t.normal.y=s[7]-s[4],t.normal.z=s[11]-s[8],t.d=s[15]-s[12],t.normalize()}static GetTopPlaneToRef(e,t){const s=e.m;t.normal.x=s[3]-s[1],t.normal.y=s[7]-s[5],t.normal.z=s[11]-s[9],t.d=s[15]-s[13],t.normalize()}static GetBottomPlaneToRef(e,t){const s=e.m;t.normal.x=s[3]+s[1],t.normal.y=s[7]+s[5],t.normal.z=s[11]+s[9],t.d=s[15]+s[13],t.normalize()}static GetPlanesToRef(e,t){Yi.GetNearPlaneToRef(e,t[0]),Yi.GetFarPlaneToRef(e,t[1]),Yi.GetLeftPlaneToRef(e,t[2]),Yi.GetRightPlaneToRef(e,t[3]),Yi.GetTopPlaneToRef(e,t[4]),Yi.GetBottomPlaneToRef(e,t[5])}static IsPointInFrustum(e,t){for(let s=0;s<6;s++)if(t[s].dotCoordinate(e)<0)return!1;return!0}}class vn{constructor(e,t){this.width=e,this.height=t}toString(){return`{W: ${this.width}, H: ${this.height}}`}getClassName(){return"Size"}getHashCode(){let e=this.width|0;return e=e*397^(this.height|0),e}copyFrom(e){this.width=e.width,this.height=e.height}copyFromFloats(e,t){return this.width=e,this.height=t,this}set(e,t){return this.copyFromFloats(e,t)}multiplyByFloats(e,t){return new vn(this.width*e,this.height*t)}clone(){return new vn(this.width,this.height)}equals(e){return e?this.width===e.width&&this.height===e.height:!1}get surface(){return this.width*this.height}static Zero(){return new vn(0,0)}add(e){return new vn(this.width+e.width,this.height+e.height)}subtract(e){return new vn(this.width-e.width,this.height-e.height)}scale(e){return new vn(this.width*e,this.height*e)}static Lerp(e,t,s){const n=e.width+(t.width-e.width)*s,a=e.height+(t.height-e.height)*s;return new vn(n,a)}}class Ih{constructor(e,t,s,n){this.x=e,this.y=t,this.width=s,this.height=n}toGlobal(e,t){return new Ih(this.x*e,this.y*t,this.width*e,this.height*t)}toGlobalToRef(e,t,s){return s.x=this.x*e,s.y=this.y*t,s.width=this.width*e,s.height=this.height*t,this}clone(){return new Ih(this.x,this.y,this.width,this.height)}}const yn=[Math.sqrt(1/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(3/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(15/(4*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(5/(16*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(15/(16*Math.PI))],Bj=[()=>1,i=>i.y,i=>i.z,i=>i.x,i=>i.x*i.y,i=>i.y*i.z,i=>3*i.z*i.z-1,i=>i.x*i.z,i=>i.x*i.x-i.y*i.y],Jn=(i,e)=>yn[i]*Bj[i](e),er=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4];class Fh{constructor(){this.preScaled=!1,this.l00=I.Zero(),this.l1_1=I.Zero(),this.l10=I.Zero(),this.l11=I.Zero(),this.l2_2=I.Zero(),this.l2_1=I.Zero(),this.l20=I.Zero(),this.l21=I.Zero(),this.l22=I.Zero()}addLight(e,t,s){We.Vector3[0].set(t.r,t.g,t.b);const n=We.Vector3[0],a=We.Vector3[1];n.scaleToRef(s,a),a.scaleToRef(Jn(0,e),We.Vector3[2]),this.l00.addInPlace(We.Vector3[2]),a.scaleToRef(Jn(1,e),We.Vector3[2]),this.l1_1.addInPlace(We.Vector3[2]),a.scaleToRef(Jn(2,e),We.Vector3[2]),this.l10.addInPlace(We.Vector3[2]),a.scaleToRef(Jn(3,e),We.Vector3[2]),this.l11.addInPlace(We.Vector3[2]),a.scaleToRef(Jn(4,e),We.Vector3[2]),this.l2_2.addInPlace(We.Vector3[2]),a.scaleToRef(Jn(5,e),We.Vector3[2]),this.l2_1.addInPlace(We.Vector3[2]),a.scaleToRef(Jn(6,e),We.Vector3[2]),this.l20.addInPlace(We.Vector3[2]),a.scaleToRef(Jn(7,e),We.Vector3[2]),this.l21.addInPlace(We.Vector3[2]),a.scaleToRef(Jn(8,e),We.Vector3[2]),this.l22.addInPlace(We.Vector3[2])}scaleInPlace(e){this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)}convertIncidentRadianceToIrradiance(){this.l00.scaleInPlace(er[0]),this.l1_1.scaleInPlace(er[1]),this.l10.scaleInPlace(er[2]),this.l11.scaleInPlace(er[3]),this.l2_2.scaleInPlace(er[4]),this.l2_1.scaleInPlace(er[5]),this.l20.scaleInPlace(er[6]),this.l21.scaleInPlace(er[7]),this.l22.scaleInPlace(er[8])}convertIrradianceToLambertianRadiance(){this.scaleInPlace(1/Math.PI)}preScaleForRendering(){this.preScaled=!0,this.l00.scaleInPlace(yn[0]),this.l1_1.scaleInPlace(yn[1]),this.l10.scaleInPlace(yn[2]),this.l11.scaleInPlace(yn[3]),this.l2_2.scaleInPlace(yn[4]),this.l2_1.scaleInPlace(yn[5]),this.l20.scaleInPlace(yn[6]),this.l21.scaleInPlace(yn[7]),this.l22.scaleInPlace(yn[8])}updateFromArray(e){return I.FromArrayToRef(e[0],0,this.l00),I.FromArrayToRef(e[1],0,this.l1_1),I.FromArrayToRef(e[2],0,this.l10),I.FromArrayToRef(e[3],0,this.l11),I.FromArrayToRef(e[4],0,this.l2_2),I.FromArrayToRef(e[5],0,this.l2_1),I.FromArrayToRef(e[6],0,this.l20),I.FromArrayToRef(e[7],0,this.l21),I.FromArrayToRef(e[8],0,this.l22),this}updateFromFloatsArray(e){return I.FromFloatsToRef(e[0],e[1],e[2],this.l00),I.FromFloatsToRef(e[3],e[4],e[5],this.l1_1),I.FromFloatsToRef(e[6],e[7],e[8],this.l10),I.FromFloatsToRef(e[9],e[10],e[11],this.l11),I.FromFloatsToRef(e[12],e[13],e[14],this.l2_2),I.FromFloatsToRef(e[15],e[16],e[17],this.l2_1),I.FromFloatsToRef(e[18],e[19],e[20],this.l20),I.FromFloatsToRef(e[21],e[22],e[23],this.l21),I.FromFloatsToRef(e[24],e[25],e[26],this.l22),this}static FromArray(e){return new Fh().updateFromArray(e)}static FromPolynomial(e){const t=new Fh;return t.l00=e.xx.scale(.376127).add(e.yy.scale(.376127)).add(e.zz.scale(.376126)),t.l1_1=e.y.scale(.977204),t.l10=e.z.scale(.977204),t.l11=e.x.scale(.977204),t.l2_2=e.xy.scale(1.16538),t.l2_1=e.yz.scale(1.16538),t.l20=e.zz.scale(1.34567).subtract(e.xx.scale(.672834)).subtract(e.yy.scale(.672834)),t.l21=e.zx.scale(1.16538),t.l22=e.xx.scale(1.16538).subtract(e.yy.scale(1.16538)),t.l1_1.scaleInPlace(-1),t.l11.scaleInPlace(-1),t.l2_1.scaleInPlace(-1),t.l21.scaleInPlace(-1),t.scaleInPlace(Math.PI),t}}class kh{constructor(){this.x=I.Zero(),this.y=I.Zero(),this.z=I.Zero(),this.xx=I.Zero(),this.yy=I.Zero(),this.zz=I.Zero(),this.xy=I.Zero(),this.yz=I.Zero(),this.zx=I.Zero()}get preScaledHarmonics(){return this._harmonics||(this._harmonics=Fh.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics}addAmbient(e){We.Vector3[0].copyFromFloats(e.r,e.g,e.b);const t=We.Vector3[0];this.xx.addInPlace(t),this.yy.addInPlace(t),this.zz.addInPlace(t)}scaleInPlace(e){this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)}updateFromHarmonics(e){return this._harmonics=e,this.x.copyFrom(e.l11),this.x.scaleInPlace(1.02333).scaleInPlace(-1),this.y.copyFrom(e.l1_1),this.y.scaleInPlace(1.02333).scaleInPlace(-1),this.z.copyFrom(e.l10),this.z.scaleInPlace(1.02333),this.xx.copyFrom(e.l00),We.Vector3[0].copyFrom(e.l20).scaleInPlace(.247708),We.Vector3[1].copyFrom(e.l22).scaleInPlace(.429043),this.xx.scaleInPlace(.886277).subtractInPlace(We.Vector3[0]).addInPlace(We.Vector3[1]),this.yy.copyFrom(e.l00),this.yy.scaleInPlace(.886277).subtractInPlace(We.Vector3[0]).subtractInPlace(We.Vector3[1]),this.zz.copyFrom(e.l00),We.Vector3[0].copyFrom(e.l20).scaleInPlace(.495417),this.zz.scaleInPlace(.886277).addInPlace(We.Vector3[0]),this.yz.copyFrom(e.l2_1),this.yz.scaleInPlace(.858086).scaleInPlace(-1),this.zx.copyFrom(e.l21),this.zx.scaleInPlace(.858086).scaleInPlace(-1),this.xy.copyFrom(e.l2_2),this.xy.scaleInPlace(.858086),this.scaleInPlace(1/Math.PI),this}static FromHarmonics(e){return new kh().updateFromHarmonics(e)}static FromArray(e){const t=new kh;return I.FromArrayToRef(e[0],0,t.x),I.FromArrayToRef(e[1],0,t.y),I.FromArrayToRef(e[2],0,t.z),I.FromArrayToRef(e[3],0,t.xx),I.FromArrayToRef(e[4],0,t.yy),I.FromArrayToRef(e[5],0,t.zz),I.FromArrayToRef(e[6],0,t.yz),I.FromArrayToRef(e[7],0,t.zx),I.FromArrayToRef(e[8],0,t.xy),t}}function te(i,e,t,s,n,a){function l(E){if(E!==void 0&&typeof E!="function")throw new TypeError("Function expected");return E}for(var u=s.kind,h=u==="getter"?"get":u==="setter"?"set":"value",f=!e&&i?s.static?i:i.prototype:null,m=e||(f?Object.getOwnPropertyDescriptor(f,s.name):{}),p,b=!1,v=t.length-1;v>=0;v--){var R={};for(var x in s)R[x]=x==="access"?{}:s[x];for(var x in s.access)R.access[x]=s.access[x];R.addInitializer=function(E){if(b)throw new TypeError("Cannot add initializer
472s after decoration has completed");a.push(l(E||null))};var T=(0,t[v])(u==="accessor"?{get:m.get,set:m.set}:m[h],R);if(u==="accessor"){if(T===void 0)continue;if(T===null||typeof T!="object")throw new TypeError("Object expected");(p=l(T.get))&&(m.get=p),(p=l(T.set))&&(m.set=p),(p=l(T.init))&&n.unshift(p)}else(p=l(T))&&(u==="field"?n.unshift(p):m[h]=p)}f&&Object.defineProperty(f,s.name,m),b=!0}function j(i,e,t){for(var s=arguments.length>2,n=0;n<e.length;n++)t=s?e[n].call(i,t):e[n].call(i);return s?t:void 0}const Kl="__bjs_serializable__",nR=new WeakMap;function dA(i,e){return Object.prototype.hasOwnProperty.call(i,e)}function Nj(){let i=Symbol.metadata;return i||(i=Symbol("Symbol.metadata"),Object.defineProperty(Symbol,"metadata",{configurable:!0,writable:!0,value:i})),i}const fA=Nj();function Uj(i){return typeof i=="function"?i:i?.constructor}function jj(i){if(!i)throw new Error(`Decorator metadata is unavailable; the Symbol.metadata (${String(fA)}) polyfill must run before decorated classes are evaluated.`);return dA(i,Kl)||(i[Kl]={}),i[Kl]}function Jp(i){const e=Uj(i),t=e?e[fA]:void 0;if(!t)return{};const s=nR.get(t);if(s)return s;const n={},a=[];let l=t;for(;l;)a.push(l),l=Object.getPrototypeOf(l);for(const u of a)if(dA(u,Kl)){const h=u[Kl];for(const f in h)n[f]=h[f]}return nR.set(t,n),n}function Ko(i,e){return(t,s)=>{if(!s.metadata)return;const n=String(s.name),a=jj(s.metadata);a[n]||(a[n]={type:i,sourceName:e})}}function ne(i){return Ko(0,i)}function _A(i){return Ko(1,i)}function hc(i){return Ko(5,i)}function Gj(i){return Ko(6,i)}function zj(i){return Ko(7,i)}function Hj(i){return Ko(8,i)}function pA(i,e,t){const s=String(e.name);let n=null;const a=function(...l){if(n===null){n=i,typeof _native<"u"&&_native[s]&&(n=t(_native[s],i));const u=this&&(e.static?this:Object.getPrototypeOf(this));u?.[s]===a&&(u[s]=n)}return n.apply(this,l)};return a}function em(i,e){return pA(i,e,t=>t)}em.filter=function(i){return(e,t)=>pA(e,t,(s,n)=>function(...a){return i(...a)?s(...a):n.apply(this,a)})};function mA(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const e=Math.random()*16|0;return(i==="x"?e:e&3|8).toString(16)})}class ag{get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get coordinatesMode(){return 0}get isCube(){return this._texture?this._texture.isCube:!1}set isCube(e){this._texture&&(this._texture.isCube=e)}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}getClassName(){return"ThinTexture"}static _IsRenderTargetWrapper(e){return e?.shareDepth!==void 0}constructor(e){this._wrapU=1,this._wrapV=1,this.wrapR=1,this.anisotropicFilteringLevel=4,this.delayLoadState=0,this._texture=null,this._engine=null,this._cachedSize=vn.Zero(),this._cachedBaseSize=vn.Zero(),this._initialSamplingMode=2,this._texture=ag._IsRenderTargetWrapper(e)?e.texture:e,this._texture&&(this._engine=this._texture.getEngine(),this.wrapU=this._texture._cachedWrapU??this.wrapU,this.wrapV=this._texture._cachedWrapV??this.wrapV,this.wrapR=this._texture._cachedWrapR??this.wrapR)}isReady(){return this.delayLoadState===4?(this.delayLoad(),!1):this._texture?this._texture.isReady:!1}delayLoad(){}getInternalTexture(){return this._texture}getSize(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize}getBaseSize(){return!this.isReady()||!this._texture?(this._cachedBaseSize.width=0,this._cachedBaseSize.height=0,this._cachedBaseSize):this._texture._size?(this._cachedBaseSize.width=this._texture._size,this._cachedBaseSize.height=this._texture._size,this._cachedBaseSize):(this._cachedBaseSize.width=this._texture.baseWidth,this._cachedBaseSize.height=this._texture.baseHeight,this._cachedBaseSize)}get samplingMode(){return this._texture?this._texture.samplingMode:this._initialSamplingMode}updateSamplingMode(e,t=!1){this._texture&&this._engine&&this._engine.updateTextureSamplingMode(e,this._texture,this._texture.generateMipMaps&&t)}releaseInternalTexture(){this._texture&&(this._texture.dispose(),this._texture=null)}dispose(){this._texture&&(this.releaseInternalTexture(),this._engine=null)}}class ya{static Eval(e,t){return e.match(/\([^()]*\)/g)?e=e.replace(/\([^()]*\)/g,s=>(s=s.slice(1,s.length-1),ya._HandleParenthesisContent(s,t))):e=ya._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:ya.Eval(e,t)}static _HandleParenthesisContent(e,t){t=t||(a=>a==="true");let s;const n=e.split("||");for(const a in n)if(Object.prototype.hasOwnProperty.call(n,a)){let l=ya._SimplifyNegation(n[a].trim());const u=l.split("&&");if(u.length>1)for(let h=0;h<u.length;++h){const f=ya._SimplifyNegation(u[h].trim());if(f!=="true"&&f!=="false"?f[0]==="!"?s=!t(f.substring(1)):s=t(f):s=f==="true",!s){l="false";break}}if(s||l==="true"){s=!0;break}l!=="true"&&l!=="false"?l[0]==="!"?s=!t(l.substring(1)):s=t(l):s=l==="true"}return s?"true":"false"}static _SimplifyNegation(e){return e=e.replace(/^[\s!]+/,t=>(t=t.replace(/[\s]/g,()=>""),t.length%2?"!":"")),e=e.trim(),e==="!true"?e="false":e==="!false"&&(e="true"),e}}class Cs{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>Cs.HasTags(e),e.addTags=t=>Cs.AddTagsTo(e,t),e.removeTags=t=>Cs.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>Cs.MatchesQuery(e,t)}static DisableFor(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery}static HasTags(e){if(!e._tags)return!1;const t=e._tags;for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s))return!0;return!1}static GetTags(e,t=!0){if(!e._tags)return null;if(t){const s=[];for(const n in e._tags)Object.prototype.hasOwnProperty.call(e._tags,n)&&e._tags[n]===!0&&s.push(n);return s.join(" ")}else return e._tags}static AddTagsTo(e,t){if(!t||typeof t!="string")return;const s=t.split(" ");for(const n of s)Cs._AddTagTo(e,n)}static _AddTagTo(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(Cs.EnableFor(e),e._tags[t]=!0))}static RemoveTagsFrom(e,t){if(!Cs.HasTags(e))return;const s=t.split(" ");for(const n in s)Cs._RemoveTagFrom(e,s[n])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return t===void 0?!0:t===""?Cs.HasTags(e):ya.Eval(t,s=>Cs.HasTags(e)&&e._tags[s])}}const rR=function(i,e,t,s={}){const n=i();Cs&&Cs.HasTags(e)&&Cs.AddTagsTo(n,Cs.GetTags(e,!0));const a=Jp(n),l={};for(const u in a){const h=a[u],f=e[u],m=h.type;if(f!=null&&(u!=="uniqueId"||It.AllowLoadingUniqueId))switch(m){case 0:case 6:case 9:case 11:typeof f.slice=="function"?n[u]=f.slice():n[u]=f;break;case 1:s.cloneTexturesOnlyOnce&&l[f.uniqueId]?n[u]=l[f.uniqueId]:(n[u]=t||f.isRenderTarget?f:f.clone(),l[f.uniqueId]=n[u]);break;case 2:case 3:case 4:case 5:case 7:case 8:case 10:case 12:case 13:n[u]=t?f:f.clone();break}}return n};class It{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let s=0;s<e.animations.length;s++){const n=e.animations[s];t.animations.push(n.serialize())}}}static Serialize(e,t){t||(t={}),Cs&&(t.tags=Cs.GetTags(e));const s=Jp(e);for(const n in s){const a=s[n],l=a.sourceName||n,u=a.type,h=e[n];if(h!=null&&(n!=="uniqueId"||It.AllowLoadingUniqueId))switch(u){case 0:Array.isArray(h)?t[l]=h.slice():t[l]=h;break;case 1:t[l]=h.serialize();break;case 2:t[l]=h.asArray();break;case 3:t[l]=h.serialize();break;case 4:t[l]=h.asArray();break;case 5:t[l]=h.asArray();break;case 6:t[l]=h.id;break;case 7:t[l]=h.serialize();break;case 8:t[l]=h.asArray();break;case 9:t[l]=h.serialize();break;case 10:t[l]=h.asArray();break;case 11:t[l]=h.id;break;case 12:t[l]=h.asArray();break;case 13:t[l]=h.asArray();break}}return t}static ParseProperties(e,t,s,n){n||(n="");const a=Jp(t);for(const l in a){const u=a[l],h=e[u.sourceName||l],f=u.type;if(h!=null&&(l!=="uniqueId"||It.AllowLoadingUniqueId)){const m=t;switch(f){case 0:m[l]=h;break;case 1:s&&(m[l]=It._TextureParser(h,s,n));break;case 2:m[l]=_t.FromArray(h);break;case 3:m[l]=It._FresnelParametersParser(h);break;case 4:m[l]=Xe.FromArray(h);break;case 5:m[l]=I.FromArray(h);break;case 6:s&&(m[l]=s.getLastMeshById(h));break;case 7:m[l]=It._ColorCurvesParser(h);break;case 8:m[l]=St.FromArray(h);break;case 9:m[l]=It._ImageProcessingConfigurationParser(h);break;case 10:m[l]=Ge.FromArray(h);break;case 11:s&&(m[l]=s.getCameraById(h));break;case 12:m[l]=ee.FromArray(h);break;case 13:m[l]=ct.FromArray(h);break}}}}static Parse(e,t,s,n=null){const a=e();return Cs&&Cs.AddTagsTo(a,t.tags),It.ParseProperties(t,a,s,n),a}static Clone(e,t,s={}){return rR(e,t,!1,s)}static Instanciate(e,t){return rR(e,t,!0)}}It.AllowLoadingUniqueId=!1;It._ImageProcessingConfigurationParser=i=>{throw bt("ImageProcessingConfiguration")};It._FresnelParametersParser=i=>{throw bt("FresnelParameters")};It._ColorCurvesParser=i=>{throw bt("ColorCurves")};It._TextureParser=(i,e,t)=>{throw bt("Texture")};var aR;let dc=(()=>{var i;let e=ag,t=[],s,n=[],a=[],l,u=[],h=[],f,m=[],p=[],b,v=[],R=[],x,T=[],E=[],A,D=[],M=[],k,U=[],N=[],H,q=[],re=[],ce,ae=[],fe=[],_e,Te=[],z=[],J,Y,V,ge=[],L=[],B,X=[],Q=[],F,$,he,Ae,Oe,G=[],ie=[],de,Se=[],qe=[],Je,Ct,es,ps,Gt,Rs=[],ms=[];return i=class extends e{set hasAlpha(K){this._hasAlpha!==K&&(this._hasAlpha=K,this._scene&&this._scene.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get hasAlpha(){return this._hasAlpha}set getAlphaFromRGB(K){this._getAlphaFromRGB!==K&&(this._getAlphaFromRGB=K,this._scene&&this._scene.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get getAlphaFromRGB(){return this._getAlphaFromRGB}set coordinatesIndex(K){this._coordinatesIndex!==K&&(this._coordinatesIndex=K,this._scene&&this._scene.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get coordinatesIndex(){return this._coordinatesIndex}set coordinatesMode(K){this._coordinatesMode!==K&&(this._coordinatesMode=K,this._scene&&this._scene.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get coordinatesMode(){return this._coordinatesMode}get wrapU(){return this._wrapU}set wrapU(K){this._wrapU=K}get wrapV(){return this._wrapV}set wrapV(K){this._wrapV=K}get isCube(){return this._texture?this._texture.isCube:this._isCube}set isCube(K){this._texture?this._texture.isCube=K:this._isCube=K}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(K){this._texture&&(this._texture.is3D=K)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(K){this._texture&&(this._texture.is2DArray=K)}get gammaSpace(){if(this._texture)this._texture._gammaSpace===null&&(this._texture._gammaSpace=this._gammaSpace);else return this._gammaSpace;return this._texture._gammaSpace&&!this._texture._useSRGBBuffer}set gammaSpace(K){if(this._texture){if(this._texture._gammaSpace===K)return;this._texture._gammaSpace=K}else{if(this._gammaSpace===K)return;this._gammaSpace=K}this.getScene()?.markAllMaterialsAsDirty(1,we=>we.hasTexture(this))}get isRGBD(){return this._texture!=null&&this._texture._isRGBD}set isRGBD(K){K!==this.isRGBD&&(this._texture&&(this._texture._isRGBD=K),this.get
vendor: 5,494 bytes, line 472
472Scene()?.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get noMipmap(){return!1}get lodGenerationOffset(){return this._texture?this._texture._lodGenerationOffset:0}set lodGenerationOffset(K){this._texture&&(this._texture._lodGenerationOffset=K)}get lodGenerationScale(){return this._texture?this._texture._lodGenerationScale:0}set lodGenerationScale(K){this._texture&&(this._texture._lodGenerationScale=K)}get linearSpecularLOD(){return this._texture?this._texture._linearSpecularLOD:!1}set linearSpecularLOD(K){this._texture&&(this._texture._linearSpecularLOD=K)}get irradianceTexture(){return this._texture?this._texture._irradianceTexture:null}set irradianceTexture(K){this._texture&&(this._texture._irradianceTexture=K)}get uid(){return this._uid||(this._uid=mA()),this._uid}toString(){return this.name}getClassName(){return"BaseTexture"}set onDispose(K){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(K)}get isBlocking(){return!0}get loadingError(){return this._loadingError}get errorObject(){return this._errorObject}constructor(K,we=null){super(null),this.uniqueId=(j(this,t),j(this,n,void 0)),this.name=(j(this,a),j(this,u,void 0)),this.displayName=(j(this,h),j(this,m,void 0)),this.metadata=(j(this,p),j(this,v,null)),this._internalMetadata=j(this,R),this.reservedDataStore=null,this._hasAlpha=j(this,T,!1),this._getAlphaFromRGB=(j(this,E),j(this,D,!1)),this.level=(j(this,M),j(this,U,1)),this._coordinatesIndex=(j(this,N),j(this,q,0)),this.optimizeUVAllocation=(j(this,re),j(this,ae,!0)),this._coordinatesMode=(j(this,fe),j(this,Te,0)),this.wrapR=(j(this,z),j(this,ge,1)),this.anisotropicFilteringLevel=(j(this,L),j(this,X,i.DEFAULT_ANISOTROPIC_FILTERING_LEVEL)),this._isCube=(j(this,Q),!1),this._gammaSpace=!0,this.invertZ=j(this,G,!1),this.lodLevelInAlpha=(j(this,ie),j(this,Se,!1)),this._dominantDirection=(j(this,qe),null),this.isRenderTarget=j(this,Rs,!1),this._prefiltered=(j(this,ms),!1),this._forceSerialize=!1,this.animations=[],this.onDisposeObservable=new xe,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,K?i._IsScene(K)?this._scene=K:this._engine=K:this._scene=pt.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this),this._engine=this._scene.getEngine()),this._texture=we,this._uid=null}getScene(){return this._scene}_getEngine(){return this._engine}getTextureMatrix(){return ee.IdentityReadOnly}getReflectionTextureMatrix(){return ee.IdentityReadOnly}getRefractionTextureMatrix(){return this.getReflectionTextureMatrix()}isReadyOrNotBlocking(){return!this.isBlocking||this.isReady()||this.loadingError}scale(K){}get canRescale(){return!1}_getFromCache(K,we,Ut,yt,wt,Ot){const Yt=this._getEngine();if(!Yt)return null;const Ft=Yt._getUseSRGBBuffer(!!wt,we),ns=Yt.getLoadedTexturesCache();for(let rs=0;rs<ns.length;rs++){const zt=ns[rs];if((wt===void 0||Ft===zt._useSRGBBuffer)&&(yt===void 0||yt===zt.invertY)&&zt.url===K&&zt.generateMipMaps===!we&&(!Ut||Ut===zt.samplingMode)&&(Ot===void 0||Ot===zt.isCube))return zt.incrementReferences(),zt}return null}_rebuild(K=!1){}clone(){return null}get textureType(){return this._texture&&this._texture.type!==void 0?this._texture.type:0}get textureFormat(){return this._texture&&this._texture.format!==void 0?this._texture.format:5}_markAllSubMeshesAsTexturesDirty(){const K=this.getScene();K&&K.markAllMaterialsAsDirty(1)}readPixels(K=0,we=0,Ut=null,yt=!0,wt=!1,Ot=0,Yt=0,Ft=Number.MAX_VALUE,ns=Number.MAX_VALUE){if(!this._texture)return null;const rs=this._getEngine();if(!rs)return null;const zt=this.getSize();let Ne=zt.width,rt=zt.height;we!==0&&(Ne=Ne/Math.pow(2,we),rt=rt/Math.pow(2,we),Ne=Math.round(Ne),rt=Math.round(rt)),Ft=Math.min(Ne,Ft),ns=Math.min(rt,ns);try{return this._texture.isCube||this._texture.is2DArray?rs._readTexturePixels(this._texture,Ft,ns,K,we,Ut,yt,wt,Ot,Yt):rs._readTexturePixels(this._texture,Ft,ns,-1,we,Ut,yt,wt,Ot,Yt)}catch{return null}}_readPixelsSync(K=0,we=0,Ut=null,yt=!0,wt=!1){if(!this._texture)return null;const Ot=this.getSize();let Yt=Ot.width,Ft=Ot.height;const ns=this._getEngine();if(!ns)return null;we!=0&&(Yt=Yt/Math.pow(2,we),Ft=Ft/Math.pow(2,we),Yt=Math.round(Yt),Ft=Math.round(Ft));try{return this._texture.isCube?ns._readTexturePixelsSync(this._texture,Yt,Ft,K,we,Ut,yt,wt):ns._readTexturePixelsSync(this._texture,Yt,Ft,-1,we,Ut,yt,wt)}catch{return null}}get _lodTextureHigh(){return this._texture?this._texture._lodTextureHigh:null}get _lodTextureMid(){return this._texture?this._texture._lodTextureMid:null}get _lodTextureLow(){return this._texture?this._texture._lodTextureLow:null}dispose(){if(this._scene){this._scene.stopAnimation&&this._scene.stopAnimation(this),this._scene.removePendingData(this);const K=this._scene.textures.indexOf(this);if(K>=0&&this._scene.textures.splice(K,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null,this._parentContainer){const we=this._parentContainer.textures.indexOf(this);we>-1&&this._parentContainer.textures.splice(we,1),this._parentContainer=null}}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.metadata=null,super.dispose()}serialize(K=!1){if(!this.name&&!K)return null;const we=It.Serialize(this);return It.AppendSerializedAnimations(this,we),we}static WhenAllReady(K,we){let Ut=K.length;if(Ut===0){we();return}for(let yt=0;yt<K.length;yt++){const wt=K[yt];
472if(wt.isReady())--Ut===0&&we();else{const Ot=wt.onLoadObservable;Ot?Ot.addOnce(()=>{--Ut===0&&we()}):--Ut===0&&we()}}}static _IsScene(K){return K.getClassName()==="Scene"}},(()=>{const et=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;s=[ne()],l=[ne()],f=[ne()],b=[ne()],x=[ne("hasAlpha")],A=[ne("getAlphaFromRGB")],k=[ne()],H=[ne("coordinatesIndex")],ce=[ne()],_e=[ne("coordinatesMode")],J=[ne()],Y=[ne()],V=[ne()],B=[ne()],F=[ne()],$=[ne()],he=[ne()],Ae=[ne()],Oe=[ne()],de=[ne()],Je=[ne()],Ct=[ne()],es=[ne()],ps=[_A()],Gt=[ne()],te(i,null,J,{kind:"getter",name:"wrapU",static:!1,private:!1,access:{has:K=>"wrapU"in K,get:K=>K.wrapU},metadata:et},null,t),te(i,null,Y,{kind:"getter",name:"wrapV",static:!1,private:!1,access:{has:K=>"wrapV"in K,get:K=>K.wrapV},metadata:et},null,t),te(i,null,F,{kind:"getter",name:"isCube",static:!1,private:!1,access:{has:K=>"isCube"in K,get:K=>K.isCube},metadata:et},null,t),te(i,null,$,{kind:"getter",name:"is3D",static:!1,private:!1,access:{has:K=>"is3D"in K,get:K=>K.is3D},metadata:et},null,t),te(i,null,he,{kind:"getter",name:"is2DArray",static:!1,private:!1,access:{has:K=>"is2DArray"in K,get:K=>K.is2DArray},metadata:et},null,t),te(i,null,Ae,{kind:"getter",name:"gammaSpace",static:!1,private:!1,access:{has:K=>"gammaSpace"in K,get:K=>K.gammaSpace},metadata:et},null,t),te(i,null,Je,{kind:"getter",name:"lodGenerationOffset",static:!1,private:!1,access:{has:K=>"lodGenerationOffset"in K,get:K=>K.lodGenerationOffset},metadata:et},null,t),te(i,null,Ct,{kind:"getter",name:"lodGenerationScale",static:!1,private:!1,access:{has:K=>"lodGenerationScale"in K,get:K=>K.lodGenerationScale},metadata:et},null,t),te(i,null,es,{kind:"getter",name:"linearSpecularLOD",static:!1,private:!1,access:{has:K=>"linearSpecularLOD"in K,get:K=>K.linearSpecularLOD},metadata:et},null,t),te(i,null,ps,{kind:"getter",name:"irradianceTexture",static:!1,private:!1,access:{has:K=>"irradianceTexture"in K,get:K=>K.irradianceTexture},metadata:et},null,t),te(null,null,s,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:K=>"uniqueId"in K,get:K=>K.uniqueId,set:(K,we)=>{K.uniqueId=we}},metadata:et},n,a),te(null,null,l,{kind:"field",name:"name",static:!1,private:!1,access:{has:K=>"name"in K,get:K=>K.name,set:(K,we)=>{K.name=we}},metadata:et},u,h),te(null,null,f,{kind:"field",name:"displayName",static:!1,private:!1,access:{has:K=>"displayName"in K,get:K=>K.displayName,set:(K,we)=>{K.displayName=we}},metadata:et},m,p),te(null,null,b,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:K=>"metadata"in K,get:K=>K.metadata,set:(K,we)=>{K.metadata=we}},metadata:et},v,R),te(null,null,x,{kind:"field",name:"_hasAlpha",static:!1,private:!1,access:{has:K=>"_hasAlpha"in K,get:K=>K._hasAlpha,set:(K,we)=>{K._hasAlpha=we}},metadata:et},T,E),te(null,null,A,{kind:"field",name:"_getAlphaFromRGB",static:!1,private:!1,access:{has:K=>"_getAlphaFromRGB"in K,get:K=>K._getAlphaFromRGB,set:(K,we)=>{K._getAlphaFromRGB=we}},metadata:et},D,M),te(null,null,k,{kind:"field",name:"level",static:!1,private:!1,access:{has:K=>"level"in K,get:K=>K.level,set:(K,we)=>{K.level=we}},metadata:et},U,N),te(null,null,H,{kind:"field",name:"_coordinatesIndex",static:!1,private:!1,access:{has:K=>"_coordinatesIndex"in K,get:K=>K._coordinatesIndex,set:(K,we)=>{K._coordinatesIndex=we}},metadata:et},q,re),te(null,null,ce,{kind:"field",name:"optimizeUVAllocation",static:!1,private:!1,access:{has:K=>"optimizeUVAllocation"in K,get:K=>K.optimizeUVAllocation,set:(K,we)=>{K.optimizeUVAllocation=we}},metadata:et},ae,fe),te(null,null,_e,{kind:"field",name:"_coordinatesMode",static:!1,private:!1,access:{has:K=>"_coordinatesMode"in K,get:K=>K._coordinatesMode,set:(K,we)=>{K._coordinatesMode=we}},metadata:et},Te,z),te(null,null,V,{kind:"field",name:"wrapR",static:!1,private:!1,access:{has:K=>"wrapR"in K,get:K=>K.wrapR,set:(K,we)=>{K.wrapR=we}},metadata:et},ge,L),te(null,null,B,{kind:"field",name:"anisotropicFilteringLevel",static:!1,private:!1,access:{has:K=>"anisotropicFilteringLevel"in K,get:K=>K.anisotropicFilteringLevel,set:(K,we)=>{K.anisotropicFilteringLevel=we}},metadata:et},X,Q),te(null,null,Oe,{kind:"field",name:"invertZ",static:!1,private:!1,access:{has:K=>"invertZ"in K,get:K=>K.invertZ,set:(K,we)=>{K.invertZ=we}},metadata:et},G,ie),te(null,null,de,{kind:"field",name:"lodLevelInAlpha",static:!1,private:!1,access:{has:K=>"lodLevelInAlpha"in K,get:K=>K.lodLevelInAlpha,set:(K,we)=>{K.lodLevelInAlpha=we}},metadata:et},Se,qe),te(null,null,Gt,{kind:"field",name:"isRenderTarget",static:!1,private:!1,access:{has:K=>
472"isRenderTarget"in K,get:K=>K.isRenderTarget,set:(K,we)=>{K.isRenderTarget=we}},metadata:et},Rs,ms),et&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:et})})(),i.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,i})();(aR=dc.prototype).forceSphericalPolynomialsRecompute??(aR.forceSphericalPolynomialsRecompute=tt("BaseTexture","forceSphericalPolynomialsRecompute"));Object.getOwnPropertyDescriptor(dc.prototype,"sphericalPolynomial")||Object.defineProperty(dc.prototype,"sphericalPolynomial",Jt("BaseTexture","sphericalPolynomial"));let oR=!1;function Vj(){oR||(oR=!0,it.prototype.createPrefilteredCubeTexture=function(i,e,t,s,n=null,a=null,l,u=null,h=!0){const f=async m=>{if(!m){n&&n(null);return}const p=m.texture;if(h?m.info.sphericalPolynomial&&(p._sphericalPolynomial=m.info.sphericalPolynomial):p._sphericalPolynomial=p._sphericalPolynomial??new kh,p._source=9,this.getCaps().textureLOD){n&&n(p);return}const b=3,v=this._gl,R=m.width;if(!R)return;const{DDSTools:x}=await gi(async()=>{const{DDSTools:E}=await import("./dds.pure-C58BkMLi.js");return{DDSTools:E}},__vite__mapDeps([0,1])),T=[];for(let E=0;E<b;E++){const D=1-E/(b-1),M=s,k=Math.log2(R)*t+s,U=M+(k-M)*D,N=Math.round(Math.min(Math.max(U,0),k)),H=new ai(this,2);if(H.type=p.type,H.format=p.format,H.width=Math.pow(2,Math.max(Math.log2(R)-N,0)),H.height=H.width,H.isCube=!0,H._cachedWrapU=0,H._cachedWrapV=0,this._bindTextureDirectly(v.TEXTURE_CUBE_MAP,H,!0),H.samplingMode=2,v.texParameteri(v.TEXTURE_CUBE_MAP,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_CUBE_MAP,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_CUBE_MAP,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_CUBE_MAP,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),m.isDDS){const re=m.info,ce=m.data;this._unpackFlipY(re.isCompressed),x.UploadDDSLevels(this,H,ce,re,!0,6,N)}else Re.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(v.TEXTURE_CUBE_MAP,null);const q=new dc(e);q._isCube=!0,q._texture=H,H.isReady=!0,T.push(q)}p._lodTextureHigh=T[2],p._lodTextureMid=T[1],p._lodTextureLow=T[0],n&&n(p)};return this.createCubeTexture(i,e,null,!1,f,a,l,u,h,t,s)})}Vj();let lR=!1;function Xj(){lR||(lR=!0,it.prototype.createUniformBuffer=function(i,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");const s=new oc(t);return this.bindUniformBuffer(s),i instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,i,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(i),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),s.references=1,s},it.prototype.createDynamicUniformBuffer=function(i,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");const s=new oc(t);return this.bindUniformBuffer(s),i instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,i,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(i),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),s.references=1,s},it.prototype.updateUniformBuffer=function(i,e,t,s){this.bindUniformBuffer(i),t===void 0&&(t=0),s===void 0?e instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,t,e):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,t,new Float32Array(e)):e instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,e.subarray(t,t+s)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(e).subarray(t,t+s)),this.bindUniformBuffer(null)},it.prototype.bindUniformBuffer=function(i){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,i?i.underlyingResource:null)},it.prototype.bindUniformBufferBase=function(i,e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,e,i?i.underlyingResource:null)},it.prototype.bindUniformBlock=function(i,e,t){const s=i.program,n=this._gl.getUniformBlockIndex(s,e);n!==4294967295&&this._gl.uniformBlockBinding(s,n,t)})}Xj();let cR=!1;function qj(){cR||(cR=!0,Be.prototype.displayLoadingUI=function(){if(!Bs())return;const i=this.loadingScreen;i&&i.displayLoadingUI()},Be.prototype.hideLoadingUI=function(){if(!Bs())return;const i=this._loadingScreen;i&&i.hideLoadingUI()},Object.defineProperty(Be.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=Be.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(i){this._loadingScreen=i},enumerable:!0,configurable:!0}),Object.defineProperty(Be.prototype,"loadingUIText",{set:function(i){this.loadingScreen.loadingUIText=i},enumerable:!0,configurable:!0}
472),Object.defineProperty(Be.prototype,"loadingUIBackgroundColor",{set:function(i){this.loadingScreen.loadingUIBackgroundColor=i},enumerable:!0,configurable:!0}))}qj();rA();let uR=!1;function Wj(){uR||(uR=!0,Be.prototype.getInputElement=function(){return this._renderingCanvas},Be.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},Be.prototype.setDepthFunction=function(i){this._depthCullingState.depthFunc=i},Be.prototype.setDepthFunctionToGreater=function(){this.setDepthFunction(516)},Be.prototype.setDepthFunctionToGreaterOrEqual=function(){this.setDepthFunction(518)},Be.prototype.setDepthFunctionToLess=function(){this.setDepthFunction(513)},Be.prototype.setDepthFunctionToLessOrEqual=function(){this.setDepthFunction(515)},Be.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},Be.prototype.setDepthWrite=function(i){this._depthCullingState.depthMask=i},Be.prototype.setAlphaConstants=function(i,e,t,s){this._alphaState.setAlphaBlendConstants(i,e,t,s)},Be.prototype.getAlphaMode=function(i=0){return this._alphaMode[i]},Be.prototype.getAlphaEquation=function(i=0){return this._alphaEquation[i]})}Wj();let hR=!1;function Yj(){hR||(hR=!0,Be.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},Be.prototype.setStencilBuffer=function(i){this._stencilState.stencilTest=i},Be.prototype.getStencilMask=function(){return this._stencilState.stencilMask},Be.prototype.setStencilMask=function(i){this._stencilState.stencilMask=i},Be.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},Be.prototype.getStencilBackFunction=function(){return this._stencilState.stencilBackFunc},Be.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},Be.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},Be.prototype.setStencilFunction=function(i){this._stencilState.stencilFunc=i},Be.prototype.setStencilBackFunction=function(i){this._stencilState.stencilBackFunc=i},Be.prototype.setStencilFunctionReference=function(i){this._stencilState.stencilFuncRef=i},Be.prototype.setStencilFunctionMask=function(i){this._stencilState.stencilFuncMask=i},Be.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},Be.prototype.getStencilBackOperationFail=function(){return this._stencilState.stencilBackOpStencilFail},Be.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},Be.prototype.getStencilBackOperationDepthFail=function(){return this._stencilState.stencilBackOpDepthFail},Be.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},Be.prototype.getStencilBackOperationPass=function(){return this._stencilState.stencilBackOpStencilDepthPass},Be.prototype.setStencilOperationFail=function(i){this._stencilState.stencilOpStencilFail=i},Be.prototype.setStencilBackOperationFail=function(i){this._stencilState.stencilBackOpStencilFail=i},Be.prototype.setStencilOperationDepthFail=function(i){this._stencilState.stencilOpDepthFail=i},Be.prototype.setStencilBackOperationDepthFail=function(i){this._stencilState.stencilBackOpDepthFail=i},Be.prototype.setStencilOperationPass=function(i){this._stencilState.stencilOpStencilDepthPass=i},Be.prototype.setStencilBackOperationPass=function(i){this._stencilState.stencilBackOpStencilDepthPass=i},Be.prototype.cacheStencilState=function(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},Be.prototype.restoreStencilState=function(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)})}Yj();ng();let dR=!1;function Kj(){dR||(dR=!0,Be.prototype.createDepthStencilTexture=function(i,e,t){if(e.isCube){const s=i.width||i;return this._createDepthStencilCubeTexture(s,e)}else return this._createDepthStencilTexture(i,e,t)})}Kj();function Zj(){return typeof _native<"u"&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}class bs{constructor(){this._xhr=Zj(),this._requestURL=""}static get IsCustomRequestAvailable(){return Object.keys(bs.CustomRequestHeaders).length>0||bs.CustomRequestModifiers.length>0}static _CleanUrl(e){return e=e.replace("file:http:","http:"),e=e.replace("file:https:","https:"),e}static _ShouldSkipRequestModifications(e){return bs.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}static _CollectCustomizations(e,t={}){const s={...t};if(bs._ShouldSkipRequestModifications(e))return{url:e,headers:s};for(const a in bs.CustomRequestHeaders){const l=bs.CustomRequestHeaders[a];l&&(s[a]=l)}const n={setRequestHeader:(a,l)=>{s[a]=l}};for(const a of bs.CustomRequestModifiers){if(bs._ShouldSkipRequestModifications(e))break;const l=a(n,e);typeof l=="string"&&(e=l)}return{url:e,headers:s}}static async FetchAsync(e,t={}){const s=t.method??"GET";if(typeof fetch<"u"){const{url:n,headers:a}=bs._CollectCustomizations(bs._CleanUrl(e),t.headers??{});return await fetch(n,{method:s,headers:a,body:t.body??void 0})}return await new Promise((n,a)=>{const l=new bs;l.responseType="arraybuffer",l.addEventListener("readystatechange",()=>{if(l.readyState===4)if(l.status>=200&&l.status<300){const u=typeof Headers<"u"?new Headers:void 0,h=l.getResponseHeader("Content-Type");h&&u&&u.set("Content-Type",h),n(typeof Response<"u"?new Response(l.response,{status:l.status,statusText:l.statusText,headers:u}):{ok:!0,status:l.status,statusText:l.statusText,headers:{get:f=>l.getResponseHeader(f)},arrayBuffer:async()=>await Promise.resolve(l.response)})}else a(new Error(`HTTP ${l.status} loading '${l.requestURL}': ${l.statusText}`))}),l.open(s,e,t.headers),l.send(t.body??null)})}get requestURL(){return this._requestURL}get onprogress(){return this._xhr.onprogress}set onprogress(e){this._xhr.onprogress=e}get readyState(){return this._xhr.readyState}get status(){return this._xhr.status}get statusText(){return this._xhr.statusText}get response(){return this._xhr.response}get responseURL(){return this._xhr.responseURL}get responseText(){return this._xhr.responseText}get responseType(){return this._xhr.responseType}set responseType(e){this._xhr.responseType=e}get timeout(){return this._xhr.timeout}set timeout(e){this._xhr.timeout=e}addEventListener(e,t,s){this._xhr.addEventListener(e,t,s)}removeEventListener(e,t,s){this._xhr.removeEventListener(e,t,s)}abort(){this._xhr.abort()}send(e){this._xhr.send(e)}open(e,t,s){const{url:n,headers:a}=bs._CollectCustomizations(t,s);this._requestURL=bs._CleanUrl(n),this._xhr.open(e,this._requestURL,!0);for(const l in a)this._xhr.setRequestHeader(l,a[l])}setRequestHeader(e,t){this._xhr.setRequestHeader(e,t)}getResponseHeader(e){return this._xhr.getResponseHeader(e)}}bs.CustomRequestHeaders={};bs.CustomRequestModifiers=new Array;bs.SkipRequestModificationForBabylonCDN=!0;class Zl{}Zl.FilesToLoad={};class Qj{static ExponentialBackoff(e=3,t=500){return(s,n,a)=>n.status!==0||a>=e||s.indexOf("file:")!==-1?-1:Math.pow(2,a)*t}}
472class zo extends Error{}zo._setPrototypeOf=Object.setPrototypeOf||((i,e)=>(i.__proto__=e,i));const og={LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class Dc extends zo{constructor(e,t,s){super(e),this.errorCode=t,this.innerError=s,this.name="RuntimeError",zo._setPrototypeOf(this,Dc.prototype)}}function $j(i){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",s,n,a,l,u,h,f,m=0;for(;m<i.length;)s=i[m++],n=m<i.length?i[m++]:Number.NaN,a=m<i.length?i[m++]:Number.NaN,l=s>>2,u=(s&3)<<4|n>>4,h=(n&15)<<2|a>>6,f=a&63,isNaN(n)?h=f=64:isNaN(a)&&(f=64),t+=e.charAt(l)+e.charAt(u)+e.charAt(h)+e.charAt(f);return t}function Jj(i){const e=yA(i),t=e.length,s=new Uint8Array(new ArrayBuffer(t));for(let n=0;n<t;n++)s[n]=e.charCodeAt(n);return s.buffer}const gA=i=>{const e=ArrayBuffer.isView(i)?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i);return typeof e.toBase64=="function"?e.toBase64():$j(e)},yA=i=>atob(i),eG=i=>typeof Uint8Array.fromBase64=="function"?Uint8Array.fromBase64(i).buffer:Jj(i);let ch=null;function bA(){if(ch)return ch;const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),s=new Uint32Array(512),n=new Uint32Array(512);for(let h=0;h<256;++h){const f=h-127;f<-24?(s[h]=0,s[h|256]=32768,n[h]=24,n[h|256]=24):f<-14?(s[h]=1024>>-f-14,s[h|256]=1024>>-f-14|32768,n[h]=-f-1,n[h|256]=-f-1):f<=15?(s[h]=f+15<<10,s[h|256]=f+15<<10|32768,n[h]=13,n[h|256]=13):f<128?(s[h]=31744,s[h|256]=64512,n[h]=24,n[h|256]=24):(s[h]=31744,s[h|256]=64512,n[h]=13,n[h|256]=13)}const a=new Uint32Array(2048),l=new Uint32Array(64),u=new Uint32Array(64);for(let h=1;h<1024;++h){let f=h<<13,m=0;for(;(f&8388608)===0;)f<<=1,m-=8388608;f&=-8388609,m+=947912704,a[h]=f|m}for(let h=1024;h<2048;++h)a[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)l[h]=h<<23;l[31]=1199570944,l[32]=2147483648;for(let h=33;h<63;++h)l[h]=2147483648+(h-32<<23);l[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(u[h]=1024);return ch={floatView:e,uint32View:t,baseTable:s,shiftTable:n,mantissaTable:a,exponentTable:l,offsetTable:u},ch}const q4=65504;function tG(i){const e=bA();e.floatView[0]=i;const t=e.uint32View[0],s=t>>23&511;return e.baseTable[s]+((t&8388607)>>e.shiftTable[s])}function sG(i){const e=bA();return e.uint32View[0]=e.mantissaTable[e.offsetTable[i>>10]+(i&1023)]+e.exponentTable[i>>10],e.floatView[0]}function iG(i,e,t,s){switch(e){case 5120:{let n=i.getInt8(t);return s&&(n=Math.max(n/127,-1)),n}case 5121:{let n=i.getUint8(t);return s&&(n=n/255),n}case 5122:{let n=i.getInt16(t,!0);return s&&(n=Math.max(n/32767,-1)),n}case 5123:{let n=i.getUint16(t,!0);return s&&(n=n/65535),n}case 5131:return sG(i.getUint16(t,!0));case 5124:return i.getInt32(t,!0);case 5125:return i.getUint32(t,!0);case 5126:return i.getFloat32(t,!0);default:throw new Error(`Invalid component type ${e}`)}}function nG(i,e,t,s,n){switch(e){case 5120:{s&&(n=Math.round(n*127)),i.setInt8(t,n);break}case 5121:{s&&(n=Math.round(n*255)),i.setUint8(t,n);break}case 5122:{s&&(n=Math.round(n*32767)),i.setInt16(t,n,!0);break}case 5123:{s&&(n=Math.round(n*65535)),i.setUint16(t,n,!0);break}case 5131:{i.setUint16(t,tG(n),!0);break}case 5124:{i.setInt32(t,n,!0);break}case 5125:{i.setUint32(t,n,!0);break}case 5126:{i.setFloat32(t,n,!0);break}default:throw new Error(`Invalid component type ${e}`)}}function Mo(i){switch(i){case 5120:case 5121:return 1;case 5122:case 5123:case 5131:return 2;case 5124:case 5125:case 5126:return 4;default:throw new Error(`Invalid type '${i}'`)}}function xA(i,e,t,s,n,a,l,u){const h=new Array(s),f=new Array(s);if(i instanceof Array){let m=e/4;const p=t/4;for(let b=0;b<a;b+=s){for(let v=0;v<s;v++)h[v]=f[v]=i[m+v];u(f,b);for(let v=0;v<s;v++)h[v]!==f[v]&&(i[m+v]=f[v]);m+=p}}else{const m=ArrayBuffer.isView(i)?new DataView(i.buffer,i.byteOffset,i.byteLength):new DataView(i),p=Mo(n);for(let b=0;b<a;b+=s){for(let v=0,R=e;v<s;v++,R+=p)h[v]=f[v]=iG(m,n,R,l);u(f,b);for(let v=0,R=e;v<s;v++,R+=p)h[v]!==f[v]&&nG(m,n,R,l,f[v]);e+=t}}}function rG(i,e,t,s,n,a,l,u){const h=e*Mo(t),f=l*e;if(t!==5126||n!==h){const m=new Float32Array(f);return xA(i,s,n,e,t,f,a,(p,b)=>{for(let v=0;v<e;v++)m[b+v]=p[v]}),m}if(!(i instanceof Array||i instanceof Float32Array)||s!==0||i.length!==f)if(i instanceof Array){const m=s/4;return i.slice(m,m+f)}else if(ArrayBuffer.isView(i)){const m=i.byteOffset+s;return(m&3)!==0&&(Re.Warn("Float array must be aligned to 4-bytes border"),u=!0),u?new Float32Array(i.buffer.slice(m,m+f*Float32Array.BYTES_PER_ELEMENT)):new Float32Array(i.buffer,m,f)}else return new Float32Array(i,s,f);return u?i.slice():i}function aG(i){const e=i.buffer;if(e instanceof ArrayBuffer)return i;const t=new ArrayBuffer(i.byteLength);return new Uint8Array(t).set(new Uint8Array(e,i.byteOffset,i.byteLength)),t}const vA=new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);class Lh extends Dc{constructor(e,t){super(e,og.LoadFileError),this.name="LoadFileError",zo._setPrototypeOf(this,Lh.prototype),t instanceof bs?this.request=t:this.file=t}}class Bh extends Dc{constructor(e,t){super(e,og.RequestFileError),this.request=t,this.name="RequestFileError",zo._setPrototypeOf(this,Bh.prototype)}}class lg extends Dc{constructor(e,t){super(e,og.ReadFileError),this.file=t,this.name="ReadFileError",zo._setPrototypeOf(this,lg.prototype)}}const oG=i=>(i=i.replace(/#/gm,"%23"),i),Qt={DefaultRetryStrategy:Qj.ExponentialBackoff(),BaseUrl:"",CorsBehavior:"anonymous",PreprocessUrl:i=>i,ScriptBaseUrl:"",ScriptPreprocessUrl:i=>i,CleanUrl:oG},cg=(i,e)=>{if(!(i&&i.indexOf("data:")===0)&&Qt.CorsBehavior)if(typeof Qt.CorsBehavior=="string"||Qt.CorsBehavior instanceof String)e.crossOrigin=Qt.CorsBehavior;else{const t=Qt.CorsBehavior(i);t&&(e.crossOrigin=t)}},tm=(i,e,t,s,n="",a,l=pt.LastCreatedEngine)=>{if(typeof HTMLImageElement>"u"&&!l?._features.forceBitmapOverHTMLImageElement)return t("LoadImage is only supported in web or BabylonNative environments."),null;let u,h=!1;if(i instanceof ArrayBuffer||ArrayBuffer.isView(i))if(typeof Blob<"u"&&typeof URL<"u"){let k;i instanceof ArrayBuffer?k=i:k=aG(i),u=URL.createObjectURL(new Blob([k],{type:n})),h=!0}else u=`data:${n};base64,`+gA(i);else i instanceof Blob?(u=URL.createObjectURL(i),h=!0):(u=Qt.CleanUrl(i),u=Qt.PreprocessUrl(u));const f=k=>{if(t){const U=u||i.toString();t(`Error while trying to load image: ${U.indexOf("http")===0||U.length<=128?U:U.slice(0,128)+"..."}`,k)}};if(l?._features.forceBitmapOverHTMLImageElement)return zr(u,k=>{l.createImageBitmap(new Blob([k],{type:n}),{premultiplyAlpha:"none",colorSpaceConversion:"none",...a}).then(U=>
vendor: 2,110 bytes, line 472
472{e(U),h&&URL.revokeObjectURL(u)}).catch(U=>{t&&t("Error while trying to load image: "+i,U)})},void 0,s||void 0,!0,(k,U)=>{f(U)}),null;const m=new Image;cg(u,m);const p=[],b=()=>{for(const k of p)k.target.addEventListener(k.name,k.handler)},v=()=>{for(const k of p)k.target.removeEventListener(k.name,k.handler);p.length=0},R=()=>{v(),e(m),h&&m.src&&URL.revokeObjectURL(m.src)},x=k=>{v(),f(k),h&&m.src&&URL.revokeObjectURL(m.src)},T=k=>{if(k.blockedURI!==m.src||k.disposition==="report")return;v();const U=new Error(`CSP violation of policy ${k.effectiveDirective} ${k.blockedURI}. Current policy is ${k.originalPolicy}`);pt.UseFallbackTexture=!1,f(U),h&&m.src&&URL.revokeObjectURL(m.src),m.src=""};p.push({target:m,name:"load",handler:R}),p.push({target:m,name:"error",handler:x}),p.push({target:document,name:"securitypolicyviolation",handler:T}),b();const E=u.substring(0,5)==="blob:",A=u.substring(0,5)==="data:",D=()=>{E||A||!bs.IsCustomRequestAvailable?m.src=u:zr(u,(k,U,N)=>{const H=!n&&N?N:n,q=new Blob([k],{type:H}),re=URL.createObjectURL(q);h=!0,m.src=re},void 0,s||void 0,!0,(k,U)=>{f(U)})},M=()=>{s&&s.loadImage(u,m)};if(!E&&!A&&s&&s.enableTexturesOffline)s.open(M,D);else{if(u.indexOf("file:")!==-1){const k=decodeURIComponent(u.substring(5).toLowerCase());if(Zl.FilesToLoad[k]&&typeof URL<"u"){try{let U;try{U=URL.createObjectURL(Zl.FilesToLoad[k])}catch{U=URL.createObjectURL(Zl.FilesToLoad[k])}m.src=U,h=!0}catch{m.src=""}return m}}D()}return m},fc=(i,e,t,s,n)=>{const a=new FileReader,l={onCompleteObservable:new xe,abort:()=>a.abort()};return a.onloadend=()=>l.onCompleteObservable.notifyObservers(l),n&&(a.onerror=()=>{n(new lg(`Unable to read ${i.name}`,i))}),a.onload=u=>{e(u.target.result)},t&&(a.onprogress=t),s?a.readAsArrayBuffer(i):a.readAsText(i),l},zr=(i,e,t,s,n,a,l)=>{if(i.name)return fc(i,e,t,n,a?m=>{a(void 0,m)}:void 0);const u=i;if(u.indexOf("file:")!==-1){let m=decodeURIComponent(u.substring(5).toLowerCase());m.indexOf("./")===0&&(m=m.substring(2));const p=Zl.FilesToLoad[m];if(p)return fc(p,e,t,n,a?b=>a(void 0,new Lh(b.message,b.file)):void 0)}const{match:h,type:f}=lG(u);
472if(h){const m={onCompleteObservable:new xe,abort:()=>()=>{}};try{const p=n?hg(u):EA(u);e(p,void 0,f)}catch(p){a?a(void 0,p):Re.Error(p.message||"Failed to parse the Data URL")}return Vs.SetImmediate(()=>{m.onCompleteObservable.notifyObservers(m)}),m}return ug(u,(m,p)=>{e(m,p?.responseURL,p?.getResponseHeader("content-type"))},t,s,n,a?m=>{a(m.request,new Lh(m.message,m.request))}:void 0,l)},ug=(i,e,t,s,n,a,l)=>{s!==null&&(s??(s=pt.LastCreatedScene?.offlineProvider)),i=Qt.CleanUrl(i),i=Qt.PreprocessUrl(i);const u=Qt.BaseUrl+i;let h=!1;const f={onCompleteObservable:new xe,abort:()=>h=!0},m=()=>{let p=new bs,b=null,v;const R=()=>{p&&(t&&p.removeEventListener("progress",t),v&&p.removeEventListener("readystatechange",v),p.removeEventListener("loadend",x))};let x=()=>{R(),f.onCompleteObservable.notifyObservers(f),f.onCompleteObservable.clear(),t=void 0,v=null,x=null,a=void 0,l=void 0,e=void 0};f.abort=()=>{h=!0,x&&x(),p&&p.readyState!==(XMLHttpRequest.DONE||4)&&p.abort(),b!==null&&(clearTimeout(b),b=null),p=null};const T=A=>{const D=A.message||"Unknown error";a&&p?a(new Bh(D,p)):Re.Error(D)},E=A=>{if(p){if(p.open("GET",u),l)try{l(p)}catch(D){T(D);return}n&&(p.responseType="arraybuffer"),t&&p.addEventListener("progress",t),x&&p.addEventListener("loadend",x),v=()=>{if(!(h||!p)&&p.readyState===(XMLHttpRequest.DONE||4)){if(v&&p.removeEventListener("readystatechange",v),p.status>=200&&p.status<300||p.status===0&&(!Bs()||RA())){const k=n?p.response:p.responseText;if(k!==null){try{e&&e(k,p)}catch(U){T(U)}return}}const D=Qt.DefaultRetryStrategy;if(D){const k=D(u,p,A);if(k!==-1){R(),p=new bs,b=setTimeout(()=>E(A+1),k);return}}const M=new Bh("Error status: "+p.status+" "+p.statusText+" - Unable to load "+u,p);a&&a(M)}},p.addEventListener("readystatechange",v),p.send()}};E(0)};if(s&&s.enableSceneOffline&&!i.startsWith("blob:")){const p=v=>{v&&v.status>400?a&&a(v):m()},b=()=>{s&&s.loadFile(Qt.BaseUrl+i,v=>{!h&&e&&e(v),f.onCompleteObservable.notifyObservers(f)},t?v=>{!h&&t&&t(v)}:void 0,p,n)};s.open(b,p)}else m();return f},RA=()=>typeof location<"u"&&location.protocol==="file:",TA=i=>vA.test(i),lG=i=>{const e=vA.exec(i);return e===null||e.length===0?{match:!1,type:""}:{match:!0,type:e[0].replace("data:","").replace(";base64,","")}};function hg(i){return eG(i.split(",")[1])}const EA=i=>yA(i.split(",")[1]);let Vl;const cG=(i,e,t,s,n,a,l,u,h,f)=>{Vl={DecodeBase64UrlToBinary:i,DecodeBase64UrlToString:e,DefaultRetryStrategy:t.DefaultRetryStrategy,BaseUrl:t.BaseUrl,CorsBehavior:t.CorsBehavior,PreprocessUrl:t.PreprocessUrl,IsBase64DataUrl:s,IsFileURL:n,LoadFile:a,LoadImage:l,ReadFile:u,RequestFile:h,SetCorsBehavior:f},Object.defineProperty(Vl,"DefaultRetryStrategy",{get:function(){return t.DefaultRetryStrategy},set:function(m){t.DefaultRetryStrategy=m}}),Object.defineProperty(Vl,"BaseUrl",{get:function(){return t.BaseUrl},set:function(m){t.BaseUrl=m}}),Object.defineProperty(Vl,"PreprocessUrl",{get:function(){return t.PreprocessUrl},set:function(m){t.PreprocessUrl=m}}),Object.defineProperty(Vl,"CorsBehavior",{get:function(){return t.CorsBehavior},set:function(m){t.CorsBehavior=m}})};let fR=!1;function uG(){fR||(fR=!0,cG(hg,EA,Qt,TA,RA,zr,tm,fc,ug,cg),xa.loadFile=zr,xa.loadImage=tm,Z1.loadFile=zr)}let _R=!1;function hG(){_R||(_R=!0,uG(),Be.prototype._loadFileAsync=async function(i,e,t){return await new Promise((s,n)=>{this._loadFile(i,a=>{s(a)},void 0,e,t,(a,l)=>{n(l)})})})}hG();const Nh=new Map;function tr(i,e){dG(i)&&Re.Warn(`Extension with the name '${i}' already exists`),Nh.set(i,e)}function dG(i){return Nh.delete(i)}function fG(i,e){(e==="image/ktx"||e==="image/ktx2")&&(i=".ktx"),Nh.has(i)||(i.endsWith(".ies")&&tr(".ies",async()=>await gi(()=>import("./iesTextureLoader-C_GWa7bR.js"),[]).then(s=>new s._IESTextureLoader)),i.endsWith(".dds")&&tr(".dds",async()=>await gi(()=>import("./ddsTextureLoader-B_-9FgK9.js"),__vite__mapDeps([2,0,1])).then(s=>new s._DDSTextureLoader)),i.endsWith(".basis")&&tr(".basis",async()=>await gi(()=>import("./basisTextureLoader-DLh01kKH.js"),[]).then(s=>new s._BasisTextureLoader)),i.endsWith(".env")&&tr(".env",async()=>await gi(()=>import("./envTextureLoader-CGqBklsT.js"),__vite__mapDeps([3,1])).then(s=>new s._ENVTextureLoader)),i.endsWith(".hdr")&&tr(".hdr",async()=>await gi(()=>
472import("./hdrTextureLoader-BGQvgh0h.js"),[]).then(s=>new s._HDRTextureLoader)),(i.endsWith(".ktx")||i.endsWith(".ktx2"))&&(tr(".ktx",async()=>await gi(()=>import("./ktxTextureLoader-C8H0nHNx.js"),[]).then(s=>new s._KTXTextureLoader)),tr(".ktx2",async()=>await gi(()=>import("./ktxTextureLoader-C8H0nHNx.js"),[]).then(s=>new s._KTXTextureLoader))),i.endsWith(".tga")&&tr(".tga",async()=>await gi(()=>import("./tgaTextureLoader-CxKoAvrO.js"),[]).then(s=>new s._TGATextureLoader)),i.endsWith(".exr")&&tr(".exr",async()=>await gi(()=>import("./exrTextureLoader-Wiyw_WMK.js"),[]).then(s=>new s._ExrTextureLoader)));const t=Nh.get(i);return t?Promise.resolve(t(e)):null}let pR=!1;function _G(){pR||(pR=!0,Be.GetCompatibleTextureLoader=fG)}_G();let mR=!1;function pG(){mR||(mR=!0,it.prototype.enableScissor=function(i,e,t,s){const n=this._gl;n.enable(n.SCISSOR_TEST),n.scissor(i,e,t,s)},it.prototype.disableScissor=function(){const i=this._gl;i.disable(i.SCISSOR_TEST)})}pG();const mG={facts:22,reasoning:28,trust:48,ethics:62,energy:76,deadline:70},gG=["委任人主張設計服務已完成","對方尚有尾款 48 萬元未付","今天 18:00 前須交出書狀初稿"],sm=[{id:"morning-brief",phase:"數據擷取",kicker:"01 · 接案",time:"09:10",title:"模糊的晨會指示",location:"衡岳法律事務所 · 小會議室",speaker:"mentor",speakerName:"周律師|指導律師",dialogue:"陳小姐的設計公司被積欠尾款。你先整理事實,晚上六點前給我一版起訴狀。案子看起來不複雜,別花太久。",brief:"你只有九小時。此刻最重要的,不是立刻開始寫,而是把目標、期限與未知風險問清楚。",choices:[{id:"confirm-scope",label:"確認任務邊界",detail:"詢問請求金額、管轄、證據缺口與真正期限。",tone:"careful",effects:{facts:8,reasoning:5,deadline:-4,energy:-2},addFacts:["須先確認契約的管轄約定","客戶尚未交付完整對話紀錄"],addTags:["敢於確認"],feedback:"你沒有把模糊指示當成完整資訊。周律師皺眉,但補充了真正的程序風險。"},{id:"start-fast",label:"立刻開始寫",detail:"先依現有資料建立格式,缺的內容稍後再補。",tone:"bold",effects:{reasoning:2,deadline:4,facts:-3},addTags:["速度優先"],feedback:"你爭取了時間,但尚未知道哪些事實會推翻目前的案件理論。"},{id:"ask-template",label:"先找前案範本",detail:"請教同事是否有相似案件,降低格式錯誤。",tone:"human",effects:{reasoning:4,trust:3,deadline:-2,energy:-1},addTags:["善用團隊"],feedback:"你找到可用結構,也讓同事知道你正在處理什麼,但實體事實仍待確認。"}]},{id:"client-interview",phase:"數據擷取",kicker:"02 · 訪談",time:"10:30",title:"客戶沒有主動說的事",location:"衡岳法律事務所 · 訪談室",speaker:"client",speakerName:"陳雅雯|委任人",dialogue:"我們真的全部做完了。對方就是看我們公司小,故意拖款……那些通訊紀錄很多,應該不用每一則都看吧?",brief:"有效的訪談不是讓客戶重複立場,而是把時間、人物、行為與文件逐一對上。你注意到她說話時握緊了手機。",choices:[{id:"timeline-probe",label:"重建完整時間線",detail:"從簽約、修改、交付到催款逐日追問,包含不利訊息。",tone:"careful",effects:{facts:16,trust:2,energy:-7,deadline:-8},addFacts:["客戶曾傳訊表示願意取消部分工作","對方主張最後一階段尚未驗收"],addTags:["發現不利事實"],feedback:"你找到了關鍵訊息:客戶曾寫下『若不滿意可以取消最後階段』。這會傷害原本主張,但不能忽略。"},{id:"empathy-first",label:"先建立安全感",detail:"讓客戶說完受挫經驗,再溫和追問手機紀錄。",tone:"human",effects:{facts:9,trust:12,energy:-5,deadline:-6},addFacts:["客戶曾提及可取消最後階段"],addTags:["客戶信任"],feedback:"客戶願意交出手機,ä¹
472Ÿå¦ç™½æ›¾æœ‰å–消訊息;細節仍不完整,但關係明顯改善。"},{id:"confirm-favorable",label:"只確認有利事實",detail:"聚焦交付與未付款,避免談話失焦。",tone:"bold",effects:{facts:3,trust:4,deadline:2,ethics:-8},addTags:["選擇性聆聽"],feedback:"訪談很順,卻順得不自然。你留下了一個日後可能突然爆炸的資訊缺口。"}]},{id:"evidence-desk",phase:"邏輯轉換",kicker:"03 · 卷證",time:"13:20",title:"把資料變成可證明的事實",location:"實習律師座位 · 文件工作台",speaker:"intern",speakerName:"你的工作筆記",dialogue:"契約、發票、交付郵件、對話截圖、驗收表……每份資料都在說話,但它們說的未必是同一個故事。",brief:"請將原始資料轉換成待證事實。時間有限,你必須決定先驗證哪一條案件鏈。",choices:[{id:"proof-chain",label:"建立待證事實鏈",detail:"契約義務 → 履行證據 → 驗收爭議 → 價金請求。",tone:"careful",effects:{facts:12,reasoning:14,energy:-8,deadline:-9},addFacts:["第二階段有簽收郵件","最後階段缺少正式驗收"],addTags:["證據鏈"],feedback:"你看見案件不是『全有或全無』:第二階段證據強,最後階段則有明顯缺口。"},{id:"sort-everything",label:"依日期整理全部文件",detail:"先把資料排乾淨,相信完整性會帶來答案。",tone:"human",effects:{facts:10,reasoning:5,energy:-11,deadline:-12},addFacts:["第二階段有簽收郵件"],addTags:["完整整理"],feedback:"卷證井然有序,但你花了太多時間在不影響爭點的附件上。"},{id:"use-summary",label:"沿用客戶摘要",detail:"相信客戶整理的 Excel,直接提取最有利欄位。",tone:"bold",effects:{reasoning:4,deadline:5,ethics:-5,facts:-4},addTags:["未驗證資料"],feedback:"效率很好,但摘要把取消訊息標記成『無關』;你的案件理論因此過度樂觀。"}]},{id:"legal-strategy",phase:"邏輯轉換",kicker:"04 · 策略",time:"15:05",title:"不是每一塊錢都同樣站得住腳",location:"法律研究系統 · 爭點板",speaker:"narrator",speakerName:"案件模型",dialogue:"你可以堅持請求全部尾款,也可以依證據強度切分請求,或先用不利事實作為談判籌碼。",brief:"法律涵攝的任務,是把事實差異轉換成可解釋的主張、備位方案與風險判斷。",choices:[{id:"layered-claim",label:"主位與備位分層",detail:"主張全額,並依完成階段配置備位請求與證據。",tone:"careful",effects:{reasoning:16,ethics:5,energy:-7,deadline:-8},addTags:["分層策略"],feedback:"你沒有假裝風險不存在,而是把風險轉換成法院可處理的論證層次。"},{id:"settlement-leverage",label:"設計談判區間",detail:"以證據最強的階段為底線,保留全額主張作為協商槓桿。",tone:"human",effects:{reasoning:11,trust:8,ethics:3,deadline:-5},addTags:["務實談判"],feedback:"策略兼顧客戶利益與訴訟風險,客戶第一次看見可選擇的路徑。"},{id:"all-in",label:"全額強攻",detail:"弱化取消訊息,集中描述對方惡意拖欠。",tone:"bold",effects:{reasoning:6,trust:4,ethics:-13,deadline:3},addTags:["過度主張"],feedback:"故事很有力量,但論證對不利事實沒有答案;一旦對方提出,可信度會快速下降。"}]},{id:"drafting",phase:"成果交付",kicker:"05 · 書狀",time:"16:25",title:"把案件理論寫成法院看得懂的文字",location:"實習律師座位 · 起訴狀初稿",speaker:"mentor",speakerName:"周律師|訊息",dialogue:"初稿快給我。取消那段先不要自己放大,對方真的提出再說。法院沒空看長篇報告。",brief:"輸出不只是排版。你要決定如何呈現不利事實、證據缺口與風險,而不讓書狀失去焦點。",choices:[{id:"transparent-draft",label:"主動處理不利事實",detail:"精簡揭露取消訊息,說明其範圍與履行證據。",tone:"careful",effects:{reasoning:11,ethics:14,energy:-8,deadline:-9,trust:2},addTags:["誠實攻防"],feedback:"你把弱點寫成可爭辯的範圍問題,而不是等待對方把它變成誠信問題。"},{id:"internal-note",label:"正文精簡,另附風險箋",detail
472:"書狀聚焦請求,對指導律師完整揭露風險與建議。",tone:"human",effects:{reasoning:10,ethics:9,deadline:-6,trust:4},addTags:["內部風險管理"],feedback:"輸出層次清楚:法院版本維持焦點,內部決策者也取得完整風險資訊。"},{id:"bury-message",label:"不主動提取消訊息",detail:"照指示完成強勢版本,避免節外生枝。",tone:"bold",effects:{reasoning:3,ethics:-16,deadline:5,trust:-2},addTags:["服從高風險指示"],feedback:"文件準時且流暢,但你知道它建立在一個沒有被處理的風險上。"}]},{id:"final-report",phase:"成果交付",kicker:"06 · 回報",time:"17:42",title:"最後十八分鐘",location:"合夥人辦公室門外",speaker:"mentor",speakerName:"周律師|指導律師",dialogue:"我只剩五分鐘。告訴我:我們能不能告、最大的風險是什麼、你建議怎麼走?",brief:"你必須在極短時間內交付可決策的結論。這一刻會決定別人是否願意再次把案件交給你。",choices:[{id:"three-part-report",label:"結論、風險、建議",detail:"用三段式回報,明確區分強弱證據與下一步。",tone:"careful",effects:{reasoning:8,trust:10,ethics:5,deadline:-4},addTags:["可決策輸出"],feedback:"你在五分鐘內讓指導律師知道能做什麼、不能假設什麼,以及需要客戶決定什麼。"},{id:"client-impact-report",label:"先說客戶真正需要什麼",detail:"提出訴訟與和解兩條路,說明成本、時間與現金流。",tone:"human",effects:{trust:14,reasoning:6,ethics:5,deadline:-5},addTags:["以客戶為中心"],feedback:"你把法律方案翻譯成客戶可以做決定的語言,也保留了專業界線。"},{id:"confident-report",label:"直接保證勝算",detail:"強調對方違約明確,建議立刻提告取得主導權。",tone:"bold",effects:{trust:4,reasoning:-3,ethics:-12,deadline:1},addTags:["過度承諾"],feedback:"你的語氣很有把握,但把尚未解決的證據缺口包裝成確定性。"}]}];function yG(i,e){const t=e.includes("誠實攻防")||e.includes("內部風險管理"),s=i.facts+i.reasoning>=125,n=i.ethics>=62&&!e.includes("過度承諾"),a=i.deadline>=28;return s&&n&&t&&a?{id:"professional",grade:"A",title:"專業可靠",summary:"你守住期限,也沒有把不利事實藏進抽屜。案件策略有層次,指導律師決定讓你參與下一次客戶會議。",mentorNote:"你不只交出文件,還交出了可以負責任地作決定的理由。明天跟我一起見客戶。",careerTag:"生涯標籤:值得託付",color:"gold"}:!n||e.includes("服從高風險指示")||e.includes("選擇性聆聽")?{id:"dangerous",grade:"C+",title:"漂亮,但危險",summary:"初稿準時而有氣勢,卻沒有正面處理關鍵訊息。短期看似過關,這個未解風險已被寫入你的生涯履歷。",mentorNote:"文字很俐落。但如果對方拿出那則訊息,我們憑什麼要求法官相信其他部分?",careerTag:"未解事件:被掩蓋的訊息",color:"red"}:!a||i.energy<25?{id:"overloaded",grade:"B-",title:"善意失控",summary:"你掌握了重要事實,也讓客戶感到被理解,但時間分配失衡。書狀需要資深律師緊急接手收尾。",mentorNote:"方向是對的。下一次,先決定哪些工作足以支持今天的決策,不要把完整當成無限。",careerTag:"成長課題:期限與範圍",color:"slate"}:{id:"trusted",grade:"B+",title:"務實的同盟者",summary:"你讓客戶看見選項,也建立了信任。法律論證仍可更精準,但團隊認為你已具備處理真實人與真實風險的潛力。",mentorNote:"客戶願意聽你的,這很難得。下一步把同樣的清楚帶進證據與書狀。",careerTag:"生涯標籤:客戶信任",color:"teal"}}const SA={common:"普通",rare:"稀有",epic:"史詩",legendary:"傳奇"},gR=(i,e)=>e.every(t=>i.tags.includes(t)),An=[{id:"scope-keeper",title:"案件啟封",description:"你沒有急著動筆,而是先把任務問清楚。",conditionLabel:"確認工作範圍與交付期限",icon:"briefcase",rarity:"common",condition:i=>i.tags.includes("敢於確認")},{id:"truth-seeker",title:"不利事實獵人",description:"真正改變案件走向的,往往是沒人主動說的事。",conditionLabel:"在訪談中發現不利事實",icon:"search",rarity:"common",condition:i=>i.tags.includes("發現不利事實")},{id:"evidence-guardian",title:"證據鏈守門人",description:"每一項主張,都找到了可以承受攻防的支點。",conditionLabel:"建立完整的主張與證據鏈",icon:"evidence",rarity:"rare",condition:i=>i.tags.includes("證據鏈")},{id:"ethical-compass",title:"倫理羅盤",description:"期限愈近,你仍讓專業倫理替選擇定向。",conditionLabel:"專業倫理達到 80",icon:"ethics",rarity:"rare",condition:i=>i.status!=="intro"&&i.metrics.ethics>=80},{id:"client-voice",title:"受託人的聲音",description:"客戶不只被告知結果,也真正理解了風險。",conditionLabel:"客戶信任達到 70",icon:"trust",rarity:"rare",condition:i=>i.status!=="intro"&&i.metrics.trust>=70},{id:"reliable-professional",title:"專業可靠",description:"你交付的不只是書狀,而是一份可供決策的專業判斷。",conditionLabel:"達成「專業可靠」結局",icon:"professional",rarity:"legendary",condition:i=>i.ending?.id==="professional"},{id:"truth-in-pleading",title:"把雷寫進書狀",description:"你沒有藏起不利事實,而是把它轉化為可管理的訴訟風險。",conditionLabel:"隱藏條件",icon:"insight",rarity:"epic",hidden:!0,condition:i=>gR(i,["發現不利事實","誠實攻防"])},{id:"deadline-edge",title:"刀鋒上的期限",description:"時間幾乎歸零,你仍沒有拿專業倫理交換速度。",conditionLabel:"隱藏條件",icon:"deadline",rarity:"epic",hidden:!0,condition:i=>i.status!=="intro"&&i.metrics.deadline<=30&&i.metrics.ethics>=80},{id:"complete-record",title:"全卷無死角",description:"從委任邊界到最終回報,整份案件紀錄形成了完整閉環。",conditionLabel:"隱藏條件",icon:"balance",rarity:"legendary",hidden:!0,condition:i=>i.status==="ending"&&gR(i,["敢於確認","發現不利事實","證據鏈","分層策略","誠實攻防","可決策輸出"])}];class bG{constructor(e=[]){this.unlocked=new Set;const t=new Set(An.map(s=>s.id));e.forEach(s=>{t.has(s)&&this.unlocked.add(s)})}evaluate(e){const t=An.filter(s=>!this.unlocked.has(s.id)&&s.condition(e));return t.forEach(s=>this.unlocked.add(s.id)),t.map(({condition:s,...n})=>n)}clear(){this.unlocked.clear()}getUnlockedIds(){return Array.from(this.unlocked)}}const xG=i=>Math.max(0,Math.min(100,i));class vG{constructor(e=sm){this.listeners=new Set,this.stages=e.length>0?e:sm,this.snapshot=this.freshSnapshot()}freshSnapshot(){return{status:"intro",stageIndex:0,metrics:{...mG},discoveredFacts:[...gG],tags:[],feedback:null,selectedChoice:null,ending:null}}subscribe(e){return this.listeners.add(e),e(this.getSnapshot()),()=>{this.listeners.delete(e)}}getSnapshot(){return{...this.snapshot,metrics:{...this.snapshot.metrics},discoveredFacts:[...this.snapshot.discoveredFacts],tags:[...this.snapshot.tags]}}start(){this.snapshot={...this.freshSnapshot(),status:"playing"},this.publish()}reset(){this.snapshot=this.freshSnapshot(),this.publish()}choose(e){if(this.snapshot.status!=="playing"||this.snapshot.feedback)return;const s=this.stages[this.snapshot.stageIndex]?.choices.find(a=>a.id===e);if(!s)return;const n={...this.snapshot.metrics};for(const[a,l]of Object.entries(s.effects)){const u=a;n[u]=xG(n[u]+(l??0))}this.snapshot={...this.snapshot,metrics:n,discoveredFacts:Array.from(new Set([...this.snapshot.discoveredFacts,...s.addFacts??[]])),tags:Array.from(new Set([...this.snapshot.tags,...s.addTags??[]])),feedback:s.feedback,selectedChoice:e},this.publish()}continue(){this.snapshot.status!=="playing"||!this.snapshot.feedback||(this.snapshot.stageIndex>=this.stages.length-1?this.snapshot={...this.snapshot,status:"ending",feedback:null,selectedChoice:null,ending:yG(this.snapshot.metrics,this.snapshot.tags)}:this.snapshot={...this.snapshot,stageIndex:this.snapshot.stageIndex+1,feedback:null,selectedChoice:null},this.publish())}publish(){const e=this.getSnapshot();
vendor: 9,640 bytes, line 472
472this.listeners.forEach(t=>t(e))}}const RG=i=>Math.round((i.facts+i.reasoning+i.trust+i.ethics+i.energy+i.deadline)/6);Lj();class bi{constructor(e){this.length=0,this.data=new Array(e),this._id=bi._GlobalId++}push(e){this.data[this.length++]=e,this.length>this.data.length&&(this.data.length*=2)}forEach(e){for(let t=0;t<this.length;t++)e(this.data[t])}sort(e){this.data.sort(e)}reset(){this.length=0}dispose(){this.reset(),this.data&&(this.data.length=0)}concat(e){if(e.length!==0){this.length+e.length>this.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;t<e.length;t++)this.data[this.length++]=(e.data||e)[t]}}indexOf(e){const t=this.data.indexOf(e);return t>=this.length?-1:t}contains(e){return this.indexOf(e)!==-1}}bi._GlobalId=0;class pa extends bi{constructor(){super(...arguments),this._duplicateId=0}push(e){super.push(e),e.__smartArrayFlags||(e.__smartArrayFlags={}),e.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(e){return e.__smartArrayFlags&&e.__smartArrayFlags[this._id]===this._duplicateId?!1:(this.push(e),!0)}reset(){super.reset(),this._duplicateId++}concatWithNoDuplicate(e){if(e.length!==0){this.length+e.length>this.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;t<e.length;t++){const s=(e.data||e)[t];this.pushNoDuplicate(s)}}}}class TG{constructor(){this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new xe,this._onEffectiveEnabledStateChangedObservable=null,this._onClonedObservable=new xe,this._inheritVisibility=!1,this._isVisible=!0}}let yR=(()=>{var i;let e,t=[],s=[],n,a=[],l=[],u,h=[],f=[],m,p=[],b=[],v,R=[],x=[];return i=class{static AddNodeConstructor(E,A){this._NodeConstructors[E]=A}static Construct(E,A,D,M){const k=this._NodeConstructors[E];return k?k(A,D,M):null}set accessibilityTag(E){this._accessibilityTag=E,this.onAccessibilityTagChangedObservable.notifyObservers(E)}get accessibilityTag(){return this._accessibilityTag}get doNotSerialize(){return this._nodeDataStorage._doNotSerialize?!0:this._parentNode?this._parentNode.doNotSerialize:!1}set doNotSerialize(E){this._nodeDataStorage._doNotSerialize=E}isDisposed(){return this._nodeDataStorage._isDisposed}set parent(E){if(this._parentNode===E)return;const A=this._parentNode;if(this._parentNode&&this._parentNode._children!==void 0&&this._parentNode._children!==null){const D=this._parentNode._children.indexOf(this);D!==-1&&this._parentNode._children.splice(D,1),!E&&!this._nodeDataStorage._isDisposed&&this._addToSceneRootNodes()}this._parentNode=E,this._isDirty=!0,this._parentNode&&((this._parentNode._children===void 0||this._parentNode._children===null)&&(this._parentNode._children=new Array),this._parentNode._children.push(this),A||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}get parent(){return this._parentNode}get inheritVisibility(){return this._nodeDataStorage._inheritVisibility}set inheritVisibility(E){this._nodeDataStorage._inheritVisibility=E}get isVisible(){return this.inheritVisibility&&this._parentNode&&!this._parentNode.isVisible?!1:this._nodeDataStorage._isVisible}set isVisible(E){this._nodeDataStorage._isVisible=E}_serializeAsParent(E){E.parentId=this.uniqueId}_addToSceneRootNodes(){this._nodeDataStorage._sceneRootNodesIndex===-1&&(this._nodeDataStorage._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))}_removeFromSceneRootNodes(){if(this._nodeDataStorage._sceneRootNodesIndex!==-1){const E=this._scene.rootNodes,A=E.length-1;E[this._nodeDataStorage._sceneRootNodesIndex]=E[A],E[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex=this._nodeDataStorage._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._nodeDataStorage._sceneRootNodesIndex=-1}}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(E){this._animationPropertiesOverride=E}getClassName(){return"Node"}set onDispose(E){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(E)}get onEnabledStateChangedObservable(){return this._nodeDataStorage._onEnabledStateChangedObservable}get onEffectiveEnabledStateChangedObservable(){var E;return(E=this._nodeDataStorage)._onEffectiveEnabledStateChangedObservable??(E._onEffectiveEnabledStateChangedObservable=new xe)}get onClonedObservable(){return this._nodeDataStorage._onClonedObservable}constructor(E,A=null,D=!0){this._isDirty=!1,this._nodeDataStorage=new TG,this.name=j(this,t,void 0),this.id=(j(this,s),j(this,a,void 0)),this.uniqueId=(j(this,l),j(this,h,void 0)),this.state=(j(this,f),j(this,p,"")),this.metadata=(j(this,b),j(this,R,null)),this._internalMetadata=j(this,x),this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new xe,this._parentContainer=null,this.animations=[],this._ranges={},this.onReady=null,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._waitingParentInstanceIndex=null,this._waitingParsedUniqueId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=ee.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new xe,this._onDisposeObserver=null,this._behaviors=new Array,this.name=E,this.id=E,this._scene=A||pt.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),D&&this._addToSceneRootNodes()}getScene(){return this._scene}getEngine(){return this._scene.getEngine()}addBehavior(E,A=!1){return this._behaviors.indexOf(E)!==-1?this:(E.init(),this._scene.isLoading&&!A?this._scene.onDataLoadedObservable.addOnce(()=>{this._behaviors.includes(E)&&E.attach(this)}):E.attach(this),this._behaviors.push(E),this)}removeBehavior(E){const A=this._behaviors.indexOf(E);return A===-1?this:(this._behaviors.splice(A,1),E.detach(),this)}get behaviors(){return this._behaviors}getBehaviorByName(E){for(const A of this._behaviors)if(A.name===E)return A;return null}getWorldMatrix(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix}_getWorldMatrixDeterminant(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant}get worldMatrixFromCache(){return this._worldMatrix}_initCache(){this._cache={}}updateCache(E){!E&&this.isSynchronized()||this._updateCache()}_getActionManagerForTrigger(E,A=!0){return this.parent?this.parent._getActionManagerForTrigger(E,!1):null}_updateCache(E){}_isSynchronized(){return!0}_markSyncedWithParent(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)}isSynchronizedWithParent(){return this._parentNode?this._parentNode._isDirty||this._parentUpdateId!==this._parentNode._childUpdateId?!1:this._parentNode.isSynchronized():!0}isSynchronized(){return this._parentNode&&!this.isSynchronizedWithParent()?!1:this._isSynchronized()}isReady(E=!1){return this._nodeDataStorage._isReady}markAsDirty(E){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this}isEnabled(E=!0){return E===!1?this._nodeDataStorage._isEnabled:this._nodeDataStorage._isEnabled?this._nodeDataStorage._isParentEnabled:!1}_hasEffectiveEnabledStateObservers(){const E=this._nodeDataStorage._onEffectiveEnabledStateChangedObservable;return!!E&&E.hasObservers()}_syncParentEnabledState(){const E=this._hasEffectiveEnabledStateObservers(),A=E?this.isEnabled():null;if(this._nodeDataStorage._isParentEnabled=this._parentNode?this._parentNode.isEnabled():!0,this._children)for(const D of this._children)D._syncParentEnabledState();if(E){const D=this.isEnabled();D!==A&&this._nodeDataStorage._onEffectiveEnabledStateChangedObservable.notifyObservers(D)}}setEnabled(E){if(this._nodeDataStorage._isEnabled===E)return;const A=this._hasEffectiveEnabledStateObservers(),D=A?this.isEnabled():null;if(this._nodeDataStorage._isEnabled=E,this._syncParentEnabledState(),this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(E),A){const M=this.isEnabled();M!==D&&this._nodeDataStorage._onEffectiveEnabledStateChangedObservable.notifyObservers(M)}}isDescendantOf(E){return this.parent?this.parent===E?!0:this.parent.isDescendantOf(E):!1}_getDescendants(E,A=!1,D){if(this._children)for(let M=0;M<this._children.length;M++){const k=this._children[M];(!D||D(k))&&E.push(k),A||k._getDescendants(E,!1,D)}}getDescendants(E,A){const D=[];return this._getDescendants(D,E,A),D}getChildMeshes(E,A){const D=[];return this._getDescendants(D,E,M=>(!A||A(M))&&M.cullingStrategy!==void 0),D}getChildren(E,A=!0){return this.getDescendants(A,E)}_setReady(E){if(E!==this._nodeDataStorage._isReady){if(!E){this._nodeDataStorage._isReady=!1;return}this.onReady&&this.onReady(this),this._nodeDataStorage._isReady=!0}}getAnimationByName(E){for(let A=0;A<this.animations.length;A++){const D=this.animations[A];if(D.name===E)return D}return null}createAnimationRange(E,A,D){if(!this._ranges[E]){this._ranges[E]=i._AnimationRangeFactory(E,A,D);for(let M=0,k=this.animations.length;M<k;M++)this.animations[M]&&this.animations[M].createRange(E,A,D)}}deleteAnimationRange(E,A=!0){for(let D=0,M=this.animations.length;D<M;D++)this.animations[D]&&this.animations[D].deleteRange(E,A);this._ranges[E]=null}getAnimationRange(E){return this._ranges[E]||null}clone(E,A,D){const M=It.Clone(()=>
vendor: 4,281 bytes, line 472
472new i(E,this.getScene()),this);if(A&&(M.parent=A),!D){const k=this.getDescendants(!0);for(let U=0;U<k.length;U++){const N=k[U];N.clone(E+"."+N.name,M)}}return M}getAnimationRanges(){const E=[];let A;for(A in this._ranges)E.push(this._ranges[A]);return E}beginAnimation(E,A,D,M){const k=this.getAnimationRange(E);return k?this._scene.beginAnimation(this,k.from,k.to,A,D,M):null}serializeAnimationRanges(){const E=[];for(const A in this._ranges){const D=this._ranges[A];if(!D)continue;const M={};M.name=A,M.from=D.from,M.to=D.to,E.push(M)}return E}computeWorldMatrix(E){return this._worldMatrix||(this._worldMatrix=ee.Identity()),this._worldMatrix}dispose(E,A=!1){if(this._nodeDataStorage._isDisposed=!0,!E){const D=this.getDescendants(!0);for(const M of D)M.dispose(E,A)}this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onEnabledStateChangedObservable.clear(),this._nodeDataStorage._onEffectiveEnabledStateChangedObservable?.clear(),this.onClonedObservable.clear();for(const D of this._behaviors)D.detach();this._behaviors.length=0,this.metadata=null}static ParseAnimationRanges(E,A,D){if(A.ranges)for(let M=0;M<A.ranges.length;M++){const k=A.ranges[M];E.createAnimationRange(k.name,k.from,k.to)}}getHierarchyBoundingVectors(E=!0,A=null){this.getScene().incrementRenderId(),this.computeWorldMatrix(!0);let D,M;const k=this;if(k.getBoundingInfo&&k.subMeshes){const U=k.getBoundingInfo();D=U.boundingBox.minimumWorld.clone(),M=U.boundingBox.maximumWorld.clone()}else D=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),M=new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(E){const U=this.getDescendants(!1);for(const N of U){const H=N;if(H.computeWorldMatrix(!0),A&&!A(H)||!H.getBoundingInfo||H.getTotalVertices()===0)continue;const re=H.getBoundingInfo().boundingBox,ce=re.minimumWorld,ae=re.maximumWorld;I.CheckExtends(ce,D,M),I.CheckExtends(ae,D,M)}}return{min:D,max:M}}},(()=>{const T=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ne()],n=[ne()],u=[ne()],m=[ne()],v=[ne()],te(null,null,e,{kind:"field",name:"name",static:!1,private:!1,access:{has:E=>"name"in E,get:E=>E.name,set:(E,A)=>{E.name=A}},metadata:T},t,s),te(null,null,n,{kind:"field",name:"id",static:!1,private:!1,access:{has:E=>"id"in E,get:E=>E.id,set:(E,A)=>{E.id=A}},metadata:T},a,l),te(null,null,u,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:E=>"uniqueId"in E,get:E=>E.uniqueId,set:(E,A)=>{E.uniqueId=A}},metadata:T},h,f),te(null,null,m,{kind:"field",name:"state",static:!1,private:!1,access:{has:E=>"state"in E,get:E=>E.state,set:(E,A)=>{E.state=A}},metadata:T},p,b),te(null,null,v,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:E=>"metadata"in E,get:E=>E.metadata,set:(E,A)=>{E.metadata=A}},metadata:T},R,x),T&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:T})})(),i._AnimationRangeFactory=(T,E,A)=>{throw bt("AnimationRange")},i._NodeConstructors={},i})(),Wi=(()=>{var i;let e=yR,t=[],s,n=[],a=[],l,u=[],h=[],f,m,p,b,v,R=[],x=[],T,E=[],A=[],D,M=[],k=[],U,N=[],H=[],q,re,ce,ae=[],fe=[],_e,Te=[],z=[],J,Y=[],V=[],ge,L=[],B=[],X,Q=[],F=[],$,he=[],Ae=[];return i=class extends e{get position(){return this._position}set position(G){this._position=G}set upVector(G){this._upVector=G}get upVector(){return this._upVector}get screenArea(){let G,ie;if(this.mode===i.PERSPECTIVE_CAMERA)this.fovMode===i.FOVMODE_VERTICAL_FIXED?(ie=this.minZ*2*Math.tan(this.fov/2),G=this.getEngine().getAspectRatio(this)*ie):(G=this.minZ*2*Math.tan(this.fov/2),ie=G/this.getEngine().getAspectRatio(this));else{const de=this.getEngine().getRenderWidth()/2,Se=this.getEngine().getRenderHeight()/2;G=(this.orthoRight??de)-(this.orthoLeft??-de),ie=(this.orthoTop??Se)-(this.orthoBottom??-Se)}return G*ie}set orthoLeft(G){this._orthoLeft=G;for(const ie of this._rigCameras)ie.orthoLeft=G}get orthoLeft(){return this._orthoLeft}set orthoRight(G){this._orthoRight=G;for(const ie of this._rigCameras)ie.orthoRight=G}get orthoRight(){return this._orthoRight}set orthoBottom(G){this._orthoBottom=G;for(const ie of this._rigCameras)ie.orthoBottom=G}get orthoBottom(){return this._orthoBottom}set orthoTop(G){this._orthoTop=G;
472for(const ie of this._rigCameras)ie.orthoTop=G}get orthoTop(){return this._orthoTop}setFocalLength(G,ie=36){this.fov=2*Math.atan(ie/(2*G))}get inertia(){return this._baseInertia}set inertia(G){this._baseInertia=G}set mode(G){this._mode=G;for(const ie of this._rigCameras)ie.mode=G}get mode(){return this._mode}get hasMoved(){return this._hasMoved}constructor(G,ie,de,Se=!0){ng(),super(G,de,!1),this.inputs=j(this,t),this._position=j(this,n,I.Zero()),this._upVector=(j(this,a),j(this,u,I.Up())),this.oblique=(j(this,h),null),this._orthoLeft=null,this._orthoRight=null,this._orthoBottom=null,this._orthoTop=null,this.fov=j(this,R,.8),this.projectionPlaneTilt=(j(this,x),j(this,E,0)),this.minZ=(j(this,A),j(this,M,1)),this.maxZ=(j(this,k),j(this,N,1e4)),this._baseInertia=(j(this,H),.9),this._mode=i.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new Ih(0,0,1,1),this.layerMask=j(this,ae,268435455),this.fovMode=(j(this,fe),j(this,Te,i.FOVMODE_VERTICAL_FIXED)),this.cameraRigMode=(j(this,z),j(this,Y,i.RIG_MODE_NONE)),this.interaxialDistance=(j(this,V),j(this,L,void 0)),this.isStereoscopicSideBySide=(j(this,B),j(this,Q,void 0)),this.ignoreCameraMaxZ=(j(this,F),j(this,he,!1)),this.customRenderTargets=(j(this,Ae),[]),this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new xe,this.onProjectionMatrixChangedObservable=new xe,this.onAfterCheckInputsObservable=new xe,this.onRestoreStateObservable=new xe,this.isRigCamera=!1,this._hasMoved=!1,this._rigCameras=new Array,this._skipRendering=!1,this._projectionMatrix=new ee,this._postProcesses=new Array,this._activeMeshes=new bi(256),this._globalPosition=I.Zero(),this._computedViewMatrix=ee.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=ee.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=Ge.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.layerMask=this.getScene().defaultCameraLayerMask,this.getScene().addCamera(this),Se&&!this.getScene().activeCamera&&(this.getScene().activeCamera=this),this.position=ie,this.renderPassId=this.getScene().getEngine().createRenderPassId(`Camera ${G}`)}storeState(){return this._stateStored=!0,this._storedFov=this.fov,this}hasStateStored(){return!!this._stateStored}_restoreStateValues(){return this._stateStored?(this.fov=this._storedFov,!0):!1}restoreState(){return this._restoreStateValues()?(this.onRestoreStateObservable.notifyObservers(this),!0):!1}getClassName(){return"Camera"}toString(G){let ie="Name: "+this.name;if(ie+=", type: "+this.getClassName(),this.animations)for(let de=0;de<this.animations.length;de++)ie+=", animation[0]: "+this.animations[de].toString(G);return ie}applyVerticalCorrection(){const G=this.absoluteRotation.toEulerAngles();this.projectionPlaneTilt=this._scene.useRightHandedSystem?-G.x:G.x}get globalPosition(){return this._globalPosition}getActiveMeshes(){return this._activeMeshes}isActiveMesh(G){return this._activeMeshes.indexOf(G)!==-1}isReady(G=!1){if(G){for(const ie of this._postProcesses)if(ie&&!ie.isReady())return!1}return super.isReady(G)}_initCache(){super._initCache(),this._cache.position=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.mode=void 0,this._cache.minZ=void 0,this._cache.maxZ=void 0,this._cache.fov=void 0,this._cache.fovMode=void 0,this._cache.aspectRatio=void 0,this._cache.orthoLeft=void 0,this._cache.orthoRight=void 0,this._cache.orthoBottom=void 0,this._cache.orthoTop=void 0,this._cache.obliqueAngle=void 0,this._cache.obliqueLength=void 0,this._cache.obliqueOffset=void 0,this._cache.renderWidth=void 0,this._cache.renderHeight=void 0}_updateCache(G){G||super._updateCache(),this._cache.position.copyFrom(this.position),this._cache.upVector.copyFrom(this.upVector)}_isSynchronized(){return this._isSynchronizedViewMatrix()&&this._isSynchronizedProjectionMatrix()}_isSynchronizedViewMatrix(){return super._isSynchronized()?this._cache.position.equals(this.position)&&this._cache.upVector.equals(this.upVector)&&this.isSynchronizedWithParent():!1}_isSynchronizedProjectionMatrix(){const G=this.ignoreCameraMaxZ?0:this.maxZ;let ie=this._cache.mode===this.mode&&this._cache.minZ===this.minZ&&this._cache.maxZ===G;if(!ie)return!1;const de=this.getEngine();return this.mode===i.PERSPECTIVE_CAMERA?ie=this._cache.fov===this.fov&&this._cache.fovMode===this.fovMode&&this._cache.aspectRatio===de.getAspectRatio(this)&&this._cache.projectionPlaneTilt===this.projectionPlaneTilt:(ie=this._cache.orthoLeft===this.orthoLeft&&this._cache.orthoRight===this.orthoRight&&this._cache.orthoBottom===this.orthoBottom&&this._cache.orthoTop===this.orthoTop&&this._cache.renderWidth===de.getRenderWidth()&&this._cache.renderHeight===de.getRenderHeight(),this.oblique&&(ie=ie&&this._cache.obliqueAngle===this.oblique.angle&&this._cache.obliqueLength===this.oblique.length&&this._cache.obliqueOffset===this.oblique.offset)),ie}attachControl(G,ie){}detachControl(G){}update(){this._hasMoved=!1,this._checkInputs(),this.cameraRigMode!==i.RIG_MODE_NONE&&this._updateRigCameras(),this.getViewMatrix(),this.getProjectionMatrix()}_checkInputs(){this.onAfterCheckInputsObservable.notifyObservers(this)}get rigCameras(){return this._rigCameras}get rigPostProcess(){return this._rigPostProcess}_getFirstPostProcess(){for(let G=0;G<this._postProcesses.length;G++)if(this._postProcesses[G]!==null)return this._postProcesses[G];return null}_cascadePostProcessesToRigCams(){const G=this._getFirstPostProcess();G&&G.markTextureDirty();for(let ie=0,de=this._rigCameras.length;ie<de;ie++){const Se=this._rigCameras[ie],qe=Se._rigPostProcess;qe?(qe.getEffectName()==="pass"&&(Se.isIntermediate=this._postProcesses.length===0),Se._postProcesses=this._postProcesses.slice(0).concat(qe),qe.markTextureDirty()):Se._postProcesses=this._postProcesses.slice(0)}}attachPostProcess(G,ie=null){return!G.isReusable()&&this._postProcesses.indexOf(G)>-1?(Re.Error("You're trying to reuse a post process not defined as reusable."),0):(ie==null||ie<0?this._postProcesses.push(G):this._postProcesses[ie]===null?this._postProcesses[ie]=G:this._postProcesses.splice(ie,0,G),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(G))}detachPostProcess(G){const ie=this._postProcesses.indexOf(G);ie!==-1&&(this._postProcesses[ie]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()}getWorldMatrix(){return this._isSynchronizedViewMatrix()?this._worldMatrix:(this.getViewMatrix(),this._worldMatrix)}_getViewMatrix(){return ee.Identity()}getViewMatrix(G){return!G&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this._hasMoved=!0,this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._worldMatrix.getTranslationToRef(this._globalPosition),this._computedViewMatrix)}freezeProjectionMatrix(G){this._doNotComputeProjectionMatrix=!0,G!==void 0&&(this._projectionMatrix=G)}unfreezeProjectionMatrix(){this._doNotComputeProjectionMatrix=!1}getProjectionMatrix(G){if(this._doNotComputeProjectionMatrix||!G&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;const ie=this.ignoreCameraMaxZ?0:this.maxZ;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=ie,this._refreshFrustumPlanes=!0;const de=this.getEngine(),Se=this.getScene(),qe=de.useReverseDepthBuffer;if(this.mode===i.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=de.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1);let Je;Se.useRightHandedSystem?Je=ee.PerspectiveFovRHToRef:Je=ee.PerspectiveFovLHToRef,Je(this.fov,de.getAspectRatio(this),qe?ie:this.minZ,qe?this.minZ:ie,this._projectionMatrix,this.fovMode===i.FO
vendor: 13,960 bytes, line 472
472VMODE_VERTICAL_FIXED,de.isNDCHalfZRange,this.projectionPlaneTilt,qe)}else{const Je=de.getRenderWidth()/2,Ct=de.getRenderHeight()/2;Se.useRightHandedSystem?this.oblique?ee.ObliqueOffCenterRHToRef(this.orthoLeft??-Je,this.orthoRight??Je,this.orthoBottom??-Ct,this.orthoTop??Ct,qe?ie:this.minZ,qe?this.minZ:ie,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,de.isNDCHalfZRange):ee.OrthoOffCenterRHToRef(this.orthoLeft??-Je,this.orthoRight??Je,this.orthoBottom??-Ct,this.orthoTop??Ct,qe?ie:this.minZ,qe?this.minZ:ie,this._projectionMatrix,de.isNDCHalfZRange):this.oblique?ee.ObliqueOffCenterLHToRef(this.orthoLeft??-Je,this.orthoRight??Je,this.orthoBottom??-Ct,this.orthoTop??Ct,qe?ie:this.minZ,qe?this.minZ:ie,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,de.isNDCHalfZRange):ee.OrthoOffCenterLHToRef(this.orthoLeft??-Je,this.orthoRight??Je,this.orthoBottom??-Ct,this.orthoTop??Ct,qe?ie:this.minZ,qe?this.minZ:ie,this._projectionMatrix,de.isNDCHalfZRange),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.obliqueAngle=this.oblique?.angle,this._cache.obliqueLength=this.oblique?.length,this._cache.obliqueOffset=this.oblique?.offset,this._cache.renderWidth=de.getRenderWidth(),this._cache.renderHeight=de.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_computeObliqueDistance(G){const ie=this,de=this;return(ie.radius||(de.target?I.Distance(this.position,de.target):this.position.length()))+G}_updateFrustumPlanes(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?Yi.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=Yi.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)}isInFrustum(G,ie=!1){if(this._updateFrustumPlanes(),ie&&this.rigCameras.length>0){let de=!1;for(const Se of this.rigCameras)Se._updateFrustumPlanes(),de=de||G.isInFrustum(Se._frustumPlanes);return de}else return G.isInFrustum(this._frustumPlanes)}isCompletelyInFrustum(G){return this._updateFrustumPlanes(),G.isCompletelyInFrustum(this._frustumPlanes)}getForwardRay(G=100,ie,de){throw bt("Ray")}getForwardRayToRef(G,ie=100,de,Se){throw bt("Ray")}dispose(G,ie=!1){for(this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.getScene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){const Se=this._rigCameras.pop();Se&&Se.dispose()}if(this._parentContainer){const Se=this._parentContainer.cameras.indexOf(this);Se>-1&&this._parentContainer.cameras.splice(Se,1),this._parentContainer=null}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses.length=0;else if(this.cameraRigMode!==i.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses.length=0;else{let Se=this._postProcesses.length;for(;--Se>=0;){const qe=this._postProcesses[Se];qe&&qe.dispose(this)}}let de=this.customRenderTargets.length;for(;--de>=0;)this.customRenderTargets[de].dispose();this.customRenderTargets.length=0,this._activeMeshes.dispose(),this.getScene().getEngine().releaseRenderPassId(this.renderPassId),super.dispose(G,ie)}get isLeftCamera(){return this._isLeftCamera}get isRightCamera(){return this._isRightCamera}get leftCamera(){return this._rigCameras.length<1?null:this._rigCameras[0]}get rightCamera(){return this._rigCameras.length<2?null:this._rigCameras[1]}getLeftTarget(){return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()}getRightTarget(){return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()}setCameraRigMode(G,ie){if(this.cameraRigMode!==G){for(;this._rigCameras.length>0;){const de=this._rigCameras.pop();de&&de.dispose()}if(this.cameraRigMode=G,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=ie.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=this._cameraRigParams.interaxialDistance/.0637*(Math.PI/180),this.cameraRigMode!==i.RIG_MODE_NONE){const de=this.createRigCamera(this.name+"_L",0);de&&(de._isLeftCamera=!0);const Se=this.createRigCamera(this.name+"_R",1);Se&&(Se._isRightCamera=!0),de&&Se&&(this._rigCameras.push(de),this._rigCameras.push(Se))}this._setRigMode(ie),this._cascadePostProcessesToRigCams(),this.update()}}_setRigMode(G){}_getVRProjectionMatrix(){return ee.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.ignoreCameraMaxZ?0:this.maxZ,this._cameraRigParams.vrWorkMatrix,!0,this.getEngine().isNDCHalfZRange),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix}setCameraRigParameter(G,ie){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[G]=ie,G==="interaxialDistance"&&(this._cameraRigParams.stereoHalfAngle=ie/.0637*(Math.PI/180))}createRigCamera(G,ie){return null}_updateRigCameras(){for(let G=0;G<this._rigCameras.length;G++)this._rigCameras[G].minZ=this.minZ,this._rigCameras[G].maxZ=this.ignoreCameraMaxZ?0:this.maxZ,this._rigCameras[G].fov=this.fov,this._rigCameras[G].upVector.copyFrom(this.upVector);this.cameraRigMode===i.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)}_setupInputs(){}serialize(){const G=It.Serialize(this);return G.uniqueId=this.uniqueId,G.type=this.getClassName(),this.parent&&this.parent._serializeAsParent(G),this.inputs&&this.inputs.serialize(G),It.AppendSerializedAnimations(this,G),G.ranges=this.serializeAnimationRanges(),G.isEnabled=this.isEnabled(),G}clone(G,ie=null){const de=It.Clone(i.GetConstructorFromName(this.getClassName(),G,this.getScene(),this.interaxialDistance,this.isStereoscopicSideBySide),this);return de.name=G,de.parent=ie,this.onClonedObservable.notifyObservers(de),de}getDirection(G){const ie=I.Zero();return this.getDirectionToRef(G,ie),ie}get absoluteRotation(){return this.getWorldMatrix().decompose(void 0,this._absoluteRotation),this._absoluteRotation}getDirectionToRef(G,ie){I.TransformNormalToRef(G,this.getWorldMatrix(),ie)}static GetConstructorFromName(G,ie,de,Se=0,qe=!0){const Je=yR.Construct(G,ie,de,{interaxial_distance:Se,isStereoscopicSideBySide:qe});return Je||(()=>i._CreateDefaultParsedCamera(ie,de))}computeWorldMatrix(){return this.getWorldMatrix()}_calculateHandednessMultiplier(){let G=this.getScene().useRightHandedSystem?-1:1;return this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(G*=-1),G}},(()=>{const Oe=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;s=[hc("position")],l=[hc("upVector")],f=[ne()],m=[ne()],p=[ne()],b=[ne()],v=[ne()],T=[ne()],D=[ne()],U=[ne()],q=[ne()],re=[ne()],ce=[ne()],_e=[ne()],J=[ne()],ge=[ne()],X=[ne()],$=[ne()],te(i,null,f,{kind:"getter",name:"orthoLeft",static:!1,private:!1,access:{has:G=>"orthoLeft"in G,get:G=>G.orthoLeft},metadata:Oe},null,t),te(i,null,m,{kind:"getter",name:"orthoRight",static:!1,private:!1,access:{has:G=>"orthoRight"in G,get:G=>G.orthoRight},metadata:Oe},null,t),te(i,null,p,{kind:"getter",name:"orthoBottom",static:!1,private:!1,access:{has:G=>"orthoBottom"in G,get:G=>G.orthoBottom},metadata:Oe},null,t),te(i,null,b,{kind:"getter",name:"orthoTop",static:!1,private:!1,access:{has:G=>"orthoTop"in G,get:G=>G.orthoTop},metadata:Oe},null,t),te(i,null,q,{kind:"getter",name:"inertia",static:!1,private:!1,access:{has:G=>"inertia"in G,get:G=>G.inertia},metadata:Oe},null,t),te(i,null,re,{kind:"getter",name:"mode",static:!1,private:!1,access:{has:G=>"mode"in G,get:G=>G.mode},metadata:Oe},null,t),te(null,null,s,{kind:"field",name:"_position",static:!1,private:!1,access:{has:G=>"_position"in G,get:G=>G._position,set:(G,ie)=>{G._position=ie}},metadata:Oe},n,a),te(null,null,l,{kind:"field",name:"_upVector",static:!1,private:!1,access:{has:G=>"_upVector"in G,get:G=>G._upVector,set:(G,ie)=>{G._upVector=ie}},metadata:Oe},u,h),te(null,null,v,{kind:"field",name:"fov",static:!1,private:!1,access:{has:G=>"fov"in G,get:G=>G.fov,set:(G,ie)=>{G.fov=ie}},metadata:Oe},R,x),te(null,null,T,{kind:"field",name:"projectionPlaneTilt",static:!1,private:!1,access:{has:G=>"projectionPlaneTilt"in G,get:G=>G.projectionPlaneTilt,set:(G,ie)=>{G.projectionPlaneTilt=ie}},metadata:Oe},E,A),te(null,null,D,{kind:"field",name:"minZ",static:!1,private:!1,access:{has:G=>"minZ"in G,get:G=>G.minZ,set:(G,ie)=>{G.minZ=ie}},metadata:Oe},M,k),te(null,null,U,{kind:"field",name:"maxZ",static:!1,private:!1,access:{has:G=>"maxZ"in G,get:G=>G.maxZ,set:(G,ie)=>{G.maxZ=ie}},metadata:Oe},N,H),te(null,null,ce,{kind:"field",name:"layerMask",static:!1,private:!1,access:{has:G=>"layerMask"in G,get:G=>G.layerMask,set:(G,ie)=>{G.layerMask=ie}},metadata:Oe},ae,fe),te(null,null,_e,{kind:"field",name:"fovMode",static:!1,private:!1,access:{has:G=>"fovMode"in G,get:G=>G.fovMode,set:(G,ie)=>{G.fovMode=ie}},metadata:Oe},Te,z),te(null,null,J,{kind:"field",name:"cameraRigMode",static:!1,private:!1,access:{has:G=>"cameraRigMode"in G,get:G=>G.cameraRigMode,set:(G,ie)=>{G.cameraRigMode=ie}},metadata:Oe},Y,V),te(null,null,ge,{kind:"field",name:"interaxialDistance",static:!1,private:!1,access:{has:G=>"interaxialDistance"in G,get:G=>G.interaxialDistance,set:(G,ie)=>{G.interaxialDistance=ie}},metadata:Oe},L,B),te(null,null,X,{kind:"field",name:"isStereoscopicSideBySide",static:!1,private:!1,access:{has:G=>"isStereoscopicSideBySide"in G,get:G=>G.isStereoscopicSideBySide,set:(G,ie)=>{G.isStereoscopicSideBySide=ie}},metadata:Oe},Q,F),te(null,null,$,{kind:"field",name:"ignoreCameraMaxZ",static:!1,private:!1,access:{has:G=>"ignoreCameraMaxZ"in G,get:G=>G.ignoreCameraMaxZ,set:(G,ie)=>{G.ignoreCameraMaxZ=ie}},metadata:Oe},he,Ae),Oe&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Oe})})(),i._CreateDefaultParsedCamera=(Oe,G)=>{throw bt("UniversalCamera")},i.PERSPECTIVE_CAMERA=0,i.ORTHOGRAPHIC_CAMERA=1,i.FOVMODE_VERTICAL_FIXED=0,i.FOVMODE_HORIZONTAL_FIXED=1,i.RIG_MODE_NONE=0,i.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,i.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,i.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,i.RIG_MODE_STEREOSCOPIC_INTERLACED=14,i.RIG_MODE_VR=20,i.RIG_MODE_CUSTOM=22,i.ForceAttachControlToAlwaysPreventDefault=!1,i})();const EG=60;class SG{constructor(e,t,s){this._cameraPosition=t,this._behavior=s,this.activeInput=!1,this.speed=1,this.zoomSpeed=1,this.panSpeed=1,this.rotationXSpeed=1,this.rotationYSpeed=1,this._zoomSpeedMultiplier=1,this._panSpeedMultiplier=1,this.zoomInertia=.9,this.panInertia=.9,this.rotationInertia=.9,this.zoomAccumulatedPixels=0,this.panAccumulatedPixels=new I,this.rotationAccumulatedPixels=new I,this.zoomDeltaCurrentFrame=0,this.panDeltaCurrentFrame=I.Zero(),this.rotationDeltaCurrentFrame=I.Zero(),this._zoomVelocity=0,this._panVelocity=new I,this.referenceFrameRate=EG,this._rotationVelocity=new I,this._prevFrameTimeMs=0,this._scene=e}computeCurrentFrameDeltas(){const e=this._scene.getEngine().getDeltaTime(),t=this._getEffectiveDeltaMs(e);if(this._zoomVelocity===0&&this.zoomAccumulatedPixels===0&&this._panVelocity.x===0&&this._panVelocity.y===0&&this._panVelocity.z===0&&this.panAccumulatedPixels.x===0&&this.panAccumulatedPixels.y===0&&this.panAccumulatedPixels.z===0&&this._rotationVelocity.x===0&&this._rotationVelocity.y===0&&this._rotationVelocity.z===0&&this.rotationAccumulatedPixels.x===0&&this.rotationAccumulatedPixels.y===0&&this.rotationAccumulatedPixels.z===0&&!this.activeInput){this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,e>0&&(this._prevFrameTimeMs=e);return}this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,(this.panAccumulatedPixels.lengthSquared()>0||this.rotationAccumulatedPixels.lengthSquared()>0||this.zoomAccumulatedPixels!==0)&&this._behavior?.isInterpolating&&this._behavior.stopAllAnimations(),this._panVelocity.copyFromFloats(this._calculateCurrentVelocity(this._panVelocity.x,this.panAccumulatedPixels.x,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.y,this.panAccumulatedPixels.y,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.z,this.panAccumulatedPixels.z,this.panInertia)),this._panVelocity.scaleToRef(this.speed*this.panSpeed*this._panSpeedMultiplier*t,this.panDeltaCurrentFrame),this._rotationVelocity.copyFromFloats(this._calculateCurrentVelocity(this._rotationVelocity.x,this.rotationAccumulatedPixels.x,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.y,this.rotationAccumulatedPixels.y,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.z,this.rotationAccumulatedPixels.z,this.rotationInertia)),this.rotationDeltaCurrentFrame.copyFromFloats(this._rotationVelocity.x*this.speed*this.rotationXSpeed*t,this._rotationVelocity.y*this.speed*this.rotationYSpeed*t,0),this._zoomVelocity=this._calculateCurrentVelocity(this._zoomVelocity,this.zoomAccumulatedPixels,this.zoomInertia),this.zoomDeltaCurrentFrame=this._zoomVelocity*(this.speed*this.zoomSpeed*this._zoomSpeedMultiplier)*t,e>0&&(this._prevFrameTimeMs=e),this.zoomAccumulatedPixels=0,this.panAccumulatedPixels.setAll(0),this.rotationAccumulatedPixels.setAll(0),this.activeInput=!1}resetRotationVelocity(){this._rotationVelocity.setAll(0),this.rotationAccumulatedPixels.setAll(0)}resetPanVelocity(){this._panVelocity.setAll(0),this.panAccumulatedPixels.setAll(0)}resetZoomVelocity(){this._zoomVelocity=0,this.zoomAccumulatedPixels=0}
472get isInterpolating(){return!!this._behavior?.isInterpolating}getFrameIndependentDecay(e){const t=this._scene.getEngine().getDeltaTime(),s=this._getEffectiveDeltaMs(t),n=1e3/this.referenceFrameRate;return Math.pow(e,s/n)}getFrameIndependentInputScale(e){const t=1-e;return t<=0?1:(1-this.getFrameIndependentDecay(e))/t}_getEffectiveDeltaMs(e){return e>0?e:this._prevFrameTimeMs>0?this._prevFrameTimeMs:1e3/this.referenceFrameRate}_calculateCurrentVelocity(e,t,s){let n=e;const a=this._scene.getEngine().getDeltaTime(),l=this._getEffectiveDeltaMs(a);if(l===0)return n;const u=this.getFrameIndependentDecay(s);if(n*=u,t!==0||this.activeInput){const h=1-s,f=h>0?(1-u)/h:1;n+=t/l*f}else Math.abs(n)<1e-6&&(n=0);return n}}class CG{constructor(e,t){this.inputMap=[],this.handlers=e,this._createDefaultEntries=t,this.resetInputMap()}resolveInteraction(e,t){for(const s of this.inputMap)if(s.source===e&&this._entryMatches(s,t))return s;return null}resetInputMap(){this.inputMap=this._createDefaultEntries?.()??[]}getEntry(e,t,s){const n=this.inputMap;for(let a=0;a<n.length;a++){const l=n[a];if(l.source===e&&l.interaction===t&&this._entryConditionsMatch(l,s))return l}}getEntries(e,t,s){const n=[],a=this.inputMap;for(let l=0;l<a.length;l++){const u=a[l];u.source===e&&u.interaction===t&&this._entryConditionsMatch(u,s)&&n.push(u)}return n}addEntry(e){const t=this._entrySpecificity(e);let s=this.inputMap.length;for(let n=0;n<this.inputMap.length;n++)if(this._entrySpecificity(this.inputMap[n])<t){s=n;break}this.inputMap.splice(s,0,e)}setInteraction(e,t,s){const n=this.resolveInteraction(e,t);return n&&this._entryCoversAllConditionsOf(n,t)?(n.interaction=s,!0):(this.addEntry({source:e,...t??{},interaction:s}),!0)}_entryCoversAllConditionsOf(e,t){if(!t)return!0;const s=e;for(const n of Object.keys(t)){const a=t[n];if(a!==void 0){if(n==="modifiers"){const l=s.modifiers??{};for(const u of Object.keys(a))if(a[u]!==void 0&&l[u]===void 0)return!1}else if(s[n]===void 0)return!1}}return!0}setInteractions(e,t,s){let n=0;const a=this.inputMap;for(let l=0;l<a.length;l++){const u=a[l];u.source===e&&this._entryMatches(u,t)&&(u.interaction=s,n++)}return n}_entryMatches(e,t){switch(e.source){case"pointer":return e.button!==void 0&&e.button!==t?.button?!1:this._matchModifiers(e.modifiers,t?.modifiers);case"wheel":return this._matchModifiers(e.modifiers,t?.modifiers);case"touch":return!(e.touchCount!==void 0&&e.touchCount!==t?.touchCount);case"keyboard":return e.key!==void 0&&(Array.isArray(e.key)?e.key.indexOf(t?.key??-1)===-1:e.key!==t?.key)?!1:this._matchModifiers(e.modifiers,t?.modifiers)}}_entryConditionsMatch(e,t){if(!t)return!0;switch(e.source){case"pointer":return"button"in t&&e.button!==t.button?!1:!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers);case"wheel":return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers);case"touch":return!("touchCount"in t)||e.touchCount===t.touchCount;case"keyboard":if("key"in t){if(e.key===void 0)return t.key===void 0;if(t.key===void 0||(Array.isArray(e.key)?e.key.indexOf(t.key)===-1:e.key!==t.key))return!1}return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers)}}_entrySpecificity(e){let t=0;return"button"in e&&e.button!==void 0&&t++,"key"in e&&e.key!==void 0&&t++,"touchCount"in e&&e.touchCount!==void 0&&t++,"modifiers"in e&&e.modifiers&&t++,t}_matchModifiers(e,t){return e?!(e.ctrl!==void 0&&e.ctrl!==(t?.ctrl??!1)||e.shift!==void 0&&e.shift!==(t?.shift??!1)||e.alt!==void 0&&e.alt!==(t?.alt??!1)):!0}_entryModifiersMatch(e,t){return t?t.ctrl!==void 0||t.shift!==void 0||t.alt!==void 0?!(t.ctrl!==void 0&&e?.ctrl!==t.ctrl||t.shift!==void 0&&e?.shift!==t.shift||t.alt!==void 0&&e?.alt!==t.alt):!e||e.ctrl===void 0&&e.shift===void 0&&e.alt===void 0:!e}}class AG extends SG{constructor(e,t,s){super(e,t,s),this.input=new CG({translate:(n,a,l)=>{this.panAccumulatedPixels.x+=n,this.panAccumulatedPixels.y+=a,this.panAccumulatedPixels.z+=l},rotate:(n,a)=>{this.rotationAccumulatedPixels.x+=n,this.rotationAccumulatedPixels.y+=a}},()=>this._createDefaultInputMap())}_createDefaultInputMap(){return[{source:"pointer",interaction:"rotate"},{source:"keyboard",interaction:"translate"},{source:"keyboard",interaction:"rotate"},{source:"touch",interaction:"rotate"},{source:"touch",interaction:"translate"}]}}const uh=ee.Zero(),hp=Ge.Identity();let MG=(()=>{var i;let e=Wi,t,s=[],n=[],a,l=[],u=[],h,f=[],m=[],p,b=[],v=[];return i=class extends e{get inertia(){return this._targetInertia}set inertia(x){this._targetInertia=x,this.movement&&(this.movement.panInertia=x,this.movement.rotationInertia=x)}constructor(x,T,E,A=!0){super(x,T,E,A),this.cameraDirection=new I(0,0,0),this.cameraRotation=new Xe(0,0),this._targetInertia=.9,this.updateUpVectorFromRotation=j(this,s,!1),this.rotation=(j(this,n),j(this,l,void 0)),this.rotationQuaternion=j(this,u),this.speed=j(this,f,2),this.noRotationConstraint=(j(this,m),!1),this.invertRotation=!1,this.inverseRotationSpeed=.2,this._panningEpsilon=Ms,this._rotationEpsilon=Ms,this.lockedTarget=j(this,b,null),this._currentTarget=(j(this,v),I.Zero()),this._initialFocalDistance=1,this._viewMatrix=ee.Zero(),this._cameraTransformMatrix=ee.Zero(),this._cameraRotationMatrix=ee.Zero(),this._transformedReferencePoint=I.Zero(),this._deferredPositionUpdate=new I,this._deferredRotationQuaternionUpdate=new Ge,this._deferredRotationUpdate=new I,this._deferredUpdated=!1,this._deferOnly=!1,this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0,this._referencePoint=I.Forward(this.getScene().useRightHandedSystem),this.rotation=new I(0,this.get
vendor: 11,991 bytes, line 472
472Scene().useRightHandedSystem?Math.PI:0,0),this.movement=new AG(this.getScene(),this.position),this.movement.panInertia=this.inertia,this.movement.rotationInertia=this.inertia}getFrontPosition(x){this.getWorldMatrix();const T=We.Vector3[0],E=We.Vector3[1];return E.set(0,0,this._scene.useRightHandedSystem?-1:1),this.getDirectionToRef(E,T),T.scaleInPlace(x),this.globalPosition.add(T)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){const x=this.lockedTarget;x.computeWorldMatrix().getTranslationToRef(x.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){return super._restoreStateValues()?(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&this._storedRotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0):!1}_initCache(){super._initCache(),this._cache.lockedTarget=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new Ge(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(x){x||super._updateCache();const T=this._getLockedTargetPosition();T?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(T):this._cache.lockedTarget=T.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){if(!super._isSynchronizedViewMatrix())return!1;const x=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(x):!x)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){const x=this.getEngine();return this.speed*Math.sqrt(x.getDeltaTime()/(x.getFps()*100))}setTarget(x){this.upVector.normalize(),this._initialFocalDistance=x.subtract(this.position).length(),this.position.z===x.z&&(this.position.z+=Ms),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),this.getScene().useRightHandedSystem?ee.LookAtRHToRef(this.position,x,I.UpReadOnly,uh):ee.LookAtLHToRef(this.position,x,I.UpReadOnly,uh),uh.invert();const T=this.rotationQuaternion||hp;Ge.FromRotationMatrixToRef(uh,T),T.toEulerAnglesToRef(this.rotation),this.rotation.z=0}get target(){return this.getTarget()}set target(x){this.setTarget(x)}getTarget(){return this._currentTarget}_decideIfNeedsToMove(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){if(this.parent){this.parent.getWorldMatrix().invertToRef(We.Matrix[0]),I.TransformNormalToRef(this.cameraDirection,We.Matrix[0],We.Vector3[0]),this._deferredPositionUpdate.addInPlace(We.Vector3[0]),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate);return}this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){const x=this.movement,T=this.cameraDirection.x!==0||this.cameraDirection.y!==0||this.cameraDirection.z!==0;x.panAccumulatedPixels.addInPlace(this.cameraDirection),x.rotationAccumulatedPixels.x+=this.cameraRotation.x,x.rotationAccumulatedPixels.y+=this.cameraRotation.y,x.computeCurrentFrameDeltas(),this.cameraDirection.copyFrom(x.panDeltaCurrentFrame),this.cameraRotation.set(x.rotationDeltaCurrentFrame.x,x.rotationDeltaCurrentFrame.y);const E=this.speed*this._panningEpsilon;!T&&Math.abs(this.cameraDirection.x)<E&&Math.abs(this.cameraDirection.y)<E&&Math.abs(this.cameraDirection.z)<E&&(this.cameraDirection.setAll(0),x.resetPanVelocity());const A=this.invertRotation?-this.inverseRotationSpeed:1,D=this._decideIfNeedsToMove(),M=!!(this.cameraRotation.x||this.cameraRotation.y);this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),D&&this._updatePosition(),M&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*A,this._deferredRotationUpdate.y+=this.cameraRotation.y*A,this.noRotationConstraint||(this._deferredRotationUpdate.x>1.570796&&(this._deferredRotationUpdate.x=1.570796),this._deferredRotationUpdate.x<-1.570796&&(this._deferredRotationUpdate.x=-1.570796)),this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion&&this._deferredRotationUpdate.lengthSquared()&&(Ge.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))),this.cameraDirection.setAll(0),this.cameraRotation.set(0,0),super._checkInputs()}_updateCameraRotationMatrix(){this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):ee.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)}_rotateUpVectorWithCameraRotationMatrix(){return I.TransformNormalToRef(I.UpReadOnly,this._cameraRotationMatrix,this.upVector),this}_getViewMatrix(){return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!==this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),I.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?uc.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(Ge.FromEulerVectorToRef(this.rotation,hp),uc.Y.rotateByQuaternionToRef(hp,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix}_computeViewMatrix(x,T,E){if(this.getScene().useRightHandedSystem?ee.LookAtRHToRef(x,T,E,this._viewMatrix):ee.LookAtLHToRef(x,T,E,this._viewMatrix),this.parent){const A=this.parent.getWorldMatrix();this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(A,this._viewMatrix),this._viewMatrix.invert(),this._markSyncedWithParent()}}createRigCamera(x,T){if(this.cameraRigMode!==Wi.RIG_MODE_NONE){const E=new i(x,this.position.clone(),this.getScene());return E.isRigCamera=!0,E.rigParent=this,this.cameraRigMode===Wi.RIG_MODE_VR&&(this.rotationQuaternion||(this.rotationQuaternion=new Ge),E._cameraRigParams={},E.rotationQuaternion=new Ge),E.mode=this.mode,E.orthoLeft=this.orthoLeft,E.orthoRight=this.orthoRight,E.orthoTop=this.orthoTop,E.orthoBottom=this.orthoBottom,E}return null}_updateRigCameras(){const x=this._rigCameras[0],T=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case Wi.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Wi.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Wi.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case Wi.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Wi.RIG_MODE_STEREOSCOPIC_INTERLACED:{const E=this.cameraRigMode===Wi.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,A=this.cameraRigMode===Wi.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*E,x),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*A,T);break}case Wi.RIG_MODE_VR:x.rotationQuaternion&&T.rotationQuaternion&&this.rotationQuaternion?(x.rotationQuaternion.copyFrom(this.rotationQuaternion),T.rotationQuaternion.copyFrom(this.rotationQuaternion)):(x.rotation.copyFrom(this.rotation),T.rotation.copyFrom(this.rotation)),x.position.copyFrom(this.position),T.position.copyFrom(this.position);break}super._updateRigCameras()}_getRigCamPositionAndTarget(x,T){this.getTarget().subtractToRef(this.position,i._TargetFocalPoint),i._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);const A=i._TargetFocalPoint.addInPlace(this.position);ee.TranslationToRef(-A.x,-A.y,-A.z,i._TargetTransformMatrix),i._TargetTransformMatrix.multiplyToRef(ee.RotationAxis(T.upVector,x),i._RigCamTransformMatrix),ee.TranslationToRef(A.x,A.y,A.z,i._TargetTransformMatrix),i._RigCamTransformMatrix.multiplyToRef(i._TargetTransformMatrix,i._RigCamTransformMatrix),I.TransformCoordinatesToRef(this.position,i._RigCamTransformMatrix,T.position),T.setTarget(A)}getClassName(){return"TargetCamera"}},(()=>{const R=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[ne()],a=[hc()],h=[ne()],p=[Gj("lockedTargetId")],te(null,null,t,{kind:"field",name:"updateUpVectorFromRotation",static:!1,private:!1,access:{has:x=>"updateUpVectorFromRotation"in x,get:x=>x.updateUpVectorFromRotation,set:(x,T)=>{x.updateUpVectorFromRotation=T}},metadata:R},s,n),te(null,null,a,{kind:"field",name:"rotation",static:!1,private:!1,access:{has:x=>"rotation"in x,get:x=>x.rotation,set:(x,T)=>{x.rotation=T}},metadata:R},l,u),te(null,null,h,{kind:"field",name:"speed",static:!1,private:!1,access:{has:x=>"speed"in x,get:x=>x.speed,set:(x,T)=>{x.speed=T}},metadata:R},f,m),te(null,null,p,{kind:"field",name:"lockedTarget",static:!1,private:!1,access:{has:x=>"lockedTarget"in x,get:x=>x.lockedTarget,set:(x,T)=>{x.lockedTarget=T}},metadata:R},b,v),R&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:R})})(),i._RigCamTransformMatrix=new ee,i._TargetTransformMatrix=new ee,i._TargetFocalPoint=new I,i})();var Ho={};class wG{constructor(e){this.attachedToElement=!1,this.attached={},this.camera=e,this.checkInputs=()=>{}}add(e){const t=e.getSimpleName();if(this.attached[t]){Re.Warn("camera input of type "+t+" already exists on camera");return}this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedToElement&&e.attachControl(this.noPreventDefault)}remove(e){for(const t in this.attached){const s=this.attached[t];if(s===e){s.detachControl(),s.camera=null,delete this.attached[t],this.rebuildInputCheck();return}}}removeByType(e){for(const t in this.attached){const s=this.attached[t];s.getClassName()===e&&(s.detachControl(),s.camera=null,delete this.attached[t],this.rebuildInputCheck())}}_addCheckInputs(e){const t=this.checkInputs;return()=>{t(),e()}}attachInput(e){this.attachedToElement&&e.attachControl(this.noPreventDefault)}attachElement(e=!1){if(!this.attachedToElement){e=Wi.ForceAttachControlToAlwaysPreventDefault?!1:e,this.attachedToElement=!0,this.noPreventDefault=e;for(const t in this.attached)this.attached[t].attachControl(e)}}detachElement(e=!1){for(const t in this.attached)this.attached[t].detachControl(),e&&(this.attached[t].camera=null);this.attachedToElement=!1}rebuildInputCheck(){this.checkInputs=()=>{};for(const e in this.attached){const t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}}clear(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(e){const t={};for(const s in this.attached){const n=this.attached[s],a=It.Serialize(n);t[n.getClassName()]=a}
vendor: 10,198 bytes, line 472
472e.inputsmgr=t}parse(e){const t=e.inputsmgr;if(t){this.clear();for(const s in t){const n=Ho[s];if(n){const a=t[s],l=It.Parse(()=>new n,a,null);this.add(l)}}}else for(const s in this.attached){const n=Ho[this.attached[s].getClassName()];if(n){const a=It.Parse(()=>new n,e,null);this.remove(this.attached[s]),this.add(a)}}}}class _c{}_c.KEYDOWN=1;_c.KEYUP=2;class im{constructor(e,t){this.type=e,this.event=t}}class bR extends im{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){this.skipOnKeyboardObservable=e}constructor(e,t){super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}const xR=(i,e,t)=>!i||i.getClassName&&i.getClassName()==="Mesh"?null:i.getClassName&&(i.getClassName()==="SubMesh"||i.getClassName()==="PhysicsBody")?i.clone(e):i.clone?i.clone():Array.isArray(i)?i.slice():t&&typeof i=="object"?{...i}:null;function PG(i){const e=[];do{const t=Object.getOwnPropertyNames(i);for(const s of t)e.indexOf(s)===-1&&e.push(s)}while(i=Object.getPrototypeOf(i));return e}class OG{static DeepCopy(e,t,s,n,a=!1){const l=PG(e);for(const u of l){if(u[0]==="_"&&(!n||n.indexOf(u)===-1)||u.endsWith("Observable")||s&&s.indexOf(u)!==-1)continue;const h=e[u],f=typeof h;if(f!=="function")try{if(f==="object")if(h instanceof Uint8Array)t[u]=Uint8Array.from(h);else if(h instanceof Array){if(t[u]=[],h.length>0)if(typeof h[0]=="object")for(let m=0;m<h.length;m++){const p=xR(h[m],t,a);t[u].indexOf(p)===-1&&t[u].push(p)}else t[u]=h.slice(0)}else t[u]=xR(h,t,a);else t[u]=h}catch(m){Re.Warn(m.message)}}}}class Ql{static Instantiate(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];const t=hA(e);if(t)return t;Re.Warn(e+" not found, you may have missed an import.");const s=e.split(".");let n=typeof window<"u"?window:typeof globalThis<"u"?globalThis:this;for(let a=0,l=s.length;a<l;a++)n=n[s[a]];return typeof n!="function"?null:n}}Ql.RegisteredExternalClasses={};var je;class ft{static get BaseUrl(){return Qt.BaseUrl}static set BaseUrl(e){Qt.BaseUrl=e}static get CleanUrl(){return Qt.CleanUrl}static set CleanUrl(e){Qt.CleanUrl=e}static IsAbsoluteUrl(e){return e.indexOf("//")===0?!0:e.indexOf("://")===-1||e.indexOf(".")===-1||e.indexOf("/")===-1||e.indexOf(":")>e.indexOf("/")?!1:e.indexOf("://")<e.indexOf(".")||e.indexOf("data:")===0||e.indexOf("blob:")===0}static set ScriptBaseUrl(e){Qt.ScriptBaseUrl=e}static get ScriptBaseUrl(){return Qt.ScriptBaseUrl}static set CDNBaseUrl(e){je.ScriptBaseUrl=e,je.AssetBaseUrl=e}static set ScriptPreprocessUrl(e){Qt.ScriptPreprocessUrl=e}static get ScriptPreprocessUrl(){return Qt.ScriptPreprocessUrl}static get DefaultRetryStrategy(){return Qt.DefaultRetryStrategy}static set DefaultRetryStrategy(e){Qt.DefaultRetryStrategy=e}static get CorsBehavior(){return Qt.CorsBehavior}static set CorsBehavior(e){Qt.CorsBehavior=e}static get UseFallbackTexture(){return pt.UseFallbackTexture}static set UseFallbackTexture(e){pt.UseFallbackTexture=e}static get RegisteredExternalClasses(){return Ql.RegisteredExternalClasses}static set RegisteredExternalClasses(e){Ql.RegisteredExternalClasses=e}static get fallbackTexture(){return pt.FallbackTexture}static set fallbackTexture(e){pt.FallbackTexture=e}static FetchToRef(e,t,s,n,a,l){const u=Math.abs(e)*s%s|0,h=Math.abs(t)*n%n|0,f=(u+h*s)*4;l.r=a[f]/255,l.g=a[f+1]/255,l.b=a[f+2]/255,l.a=a[f+3]/255}static Mix(e,t,s){return 0}static Instantiate(e){return Ql.Instantiate(e)}static SetImmediate(e){Vs.SetImmediate(e)}static IsExponentOfTwo(e){return!0}static FloatRound(e){return Math.fround(e)}static GetFilename(e){const t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)}static GetFolderPath(e,t=!1){const s=e.lastIndexOf("/");return s<0?t?e:"":e.substring(0,s+1)}static ToDegrees(e){return e*180/Math.PI}static ToRadians(e){return e*Math.PI/180}static SmoothAngleChange(e,t,s=.9){const n=this.ToRadians(e),a=this.ToRadians(t);return this.ToDegrees(Math.atan2((1-s)*Math.sin(a)+s*Math.sin(n),(1-s)*Math.cos(a)+s*Math.cos(n)))}static MakeArray(e,t){return t!==!0&&(e===void 0||e==null)?null:Array.isArray(e)?e:[e]}static GetPointerPrefix(e){return Bs()&&!window.PointerEvent?"mouse":"pointer"}static SetCorsBehavior(e,t){cg(e,t)}static SetReferrerPolicyBehavior(e,t){t.referrerPolicy=e}static get PreprocessUrl(){return Qt.PreprocessUrl}static set PreprocessUrl(e){Qt.PreprocessUrl=e}static LoadImage(e,t,s,n,a,l){return tm(e,t,s,n,a,l)}static LoadFile(e,t,s,n,a,l){return zr(e,t,s,n,a,l)}static async LoadFileAsync(e,t=!0){return await new Promise((s,n)=>{zr(e,a=>{s(a)},void 0,void 0,t,(a,l)=>{n(l)})})}static GetAssetUrl(e){if(!e)return"";if(je.AssetBaseUrl&&e.startsWith(je._DefaultAssetsUrl)){const t=je.AssetBaseUrl.endsWith("/")?je.AssetBaseUrl.slice(0,-1):je.AssetBaseUrl;return e.replace(je._DefaultAssetsUrl,t)}return e}static GetBabylonScriptURL(e,t){if(!e)return"";if(e.startsWith(je._DefaultCdnUrl)){if(je.ScriptBaseUrl){const s=je.ScriptBaseUrl.endsWith("/")?je.ScriptBaseUrl.slice(0,-1):je.ScriptBaseUrl;e=e.replace(je._DefaultCdnUrl,s)}else if(je._CdnVersion){const s=`${je._DefaultCdnUrl}/v${je._CdnVersion}`;e.startsWith(s)||(e=e.replace(je._DefaultCdnUrl,s))}}return e=je.ScriptPreprocessUrl(e),t&&!je.IsAbsoluteUrl(e)&&(e=je.GetAbsoluteUrl(e)),e}static LoadBabylonScript(e,t,s,n){e=je.GetBabylonScriptURL(e),je.LoadScript(e,t,s)}static async LoadBabylonScriptAsync(e){return e=je.GetBabylonScriptURL(e),await je.LoadScriptAsync(e)}static _LoadScriptNative(e,t,s,n,a=!1){if(_native){if(a){const l="Loading a script as an ES module is not supported in Babylon Native";s?.(l,new Error(l));return}je.LoadFile(e,l=>{try{Function(l).apply(null),t&&t()}catch(u){s&&s("LoadScript Error",u)}},void 0,void 0,!1,(l,u)=>{s&&s("LoadScript Error",u)})}}static _LoadScriptWeb(e,t,s,n,a=!1){if(typeof importScripts=="function"){try{importScripts(e),t&&t()}catch(h){s?.(`Unable to load script '${e}' in worker`,h)}return}else if(!Bs()){s?.(`Cannot load script '${e}' outside of a window or a worker`);return}const l=document.getElementsByTagName("head")[0],u=document.createElement("script");a?(u.setAttribute("type","module"),u.innerText=e):(u.setAttribute("type","text/javascript"),u.setAttribute("src",e)),n&&(u.id=n),u.onload=()=>{t&&t()},u.onerror=h=>{s&&s(`Unable to load script '${e}'`,h)},l.appendChild(u)}static async LoadScriptAsync(e,t){return await new Promise((s,n)=>{this.LoadScript(e,()=>{s()},(a,l)=>{n(l||new Error(a))},t)})}static ReadFileAsDataURL(e,t,s){const n=new FileReader,a={onCompleteObservable:new xe,abort:()=>n.abort()};return n.onloadend=()=>{a.onCompleteObservable.notifyObservers(a)},n.onload=l=>{t(l.target.result)},n.onprogress=s,n.readAsDataURL(e),a}static ReadFile(e,t,s,n,a){return fc(e,t,s,n,a)}static FileAsURL(e){const t=new Blob([e]);return window.URL.createObjectURL(t)}static Format(e,t=2){return e.toFixed(t)}static DeepCopy(e,t,s,n){OG.DeepCopy(e,t,s,n)}static IsEmpty(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}static RegisterTopRootEvents(e,t){for(let s=0;s<t.length;s++){const n=t[s];e.addEventListener(n.name,n.handler,!1);try{window.parent&&window.parent.addEventListener(n.name,n.handler,!1)}catch{}}}static UnregisterTopRootEvents(e,t){for(let s=0;s<t.length;s++){const n=t[s];e.removeEventListener(n.name,n.handler);try{e.parent&&e.parent.removeEventListener(n.name,n.handler)}catch{}}}static async DumpFramebuffer(e,t,s,n,a="image/png",l,u){throw bt("DumpTools")}static DumpData(e,t,s,n,a="image/png",l,u=!1,h=!1,f){throw bt("DumpTools")}static async DumpDataAsync(e,t,s,n="image/png",a,l=!1,u=!1,h){throw bt("DumpTools")}static _IsOffScreenCanvas(e){return e.convertToBlob!==void 0}static ToBlob(e,t,s="image/png",n){!je._IsOffScreenCanvas(e)&&!e.toBlob&&(e.toBlob=function(a,l,u){setTimeout(()=>{const h=atob(this.toDataURL(l,u).split(",")[1]),f=h.length,m=new Uint8Array(f);for(let p=0;p<f;p++)m[p]=h.charCodeAt(p);a(new Blob([m]))})}),je._IsOffScreenCanvas(e)?e.convertToBlob({type:s,quality:n}).then(a=>t(a)):e.toBlob(function(a){t(a)},s,n)}static DownloadBlob(e,t){if("download"in document.createElement("a")){if(!t){const s=new Date;t="screenshot_"+((s.getFullYear()+"-"+(s.getMonth()+1)).slice(2)+"-"+s.getDate()+"_"+s.getHours()+"-"+("0"+s.getMinutes()).slice(-2))+".png"}je.Download(e,t)}else if(e&&typeof URL<"u"){const s=URL.createObjectURL(e),n=window.open("");if(!n)return;const a=n.document.createElement("img");a.onload=function(){URL.revokeObjectURL(s)},a.src=s,n.document.body.appendChild(a)}}static EncodeScreenshotCanvasData(e,t,s="image/png",n,a){if(typeof n=="string"||!t)this.ToBlob(e,function(l){l&&je.DownloadBlob(l,n),t&&t("")},s,a);else if(t){if(je._IsOffScreenCanvas(e)){e.convertToBlob({type:s,quality:a}).then(u=>{const h=new FileReader;h.readAsDataURL(u),h.onloadend=()=>{const f=h.result;t(f)}});return}const l=e.toDataURL(s,a);t(l)}}static Download(e,t){if(typeof URL>"u")return;const s=window.URL.createObjectURL(e),n=document.createElement("a");document.body.appendChild(n),n.style.display="none",n.href=s,n.download=t,n.addEventListener("click",()=>{n.parentElement&&n.parentElement.removeChild(n)}),n.click(),window.URL.revokeObjectURL(s)}static BackCompatCameraNoPreventDefault(e){return typeof e[0]=="boolean"?e[0]:typeof e[1]=="boolean"?e[1]:!1}static CreateScreenshot(e,t,s,n,a="image/png",l=!1,u){throw bt("ScreenshotTools")}static async CreateScreenshotAsync(e,t,s,n="image/png",a){throw bt("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,s,n,a="image/png",l=1,u=!1,h,f=!1,m=!1,p=!0,b,v){throw bt("ScreenshotTools")}static async CreateScreenshotUsingRenderTargetAsync(e,t,s,n="image/png",a=1,l=!1,u,h=!1,f=!1,m=!0,p,b){throw bt("ScreenshotTools")}static RandomId(){return mA()}static IsBase64(e){return TA(e)}static DecodeBase64(e){return hg(e)}static get errorsCount(){return Re.errorsCount}static Log(e){Re.Log(e)}static Warn(e){Re.Warn(e)}static Error(e){Re.Error(e)}static get LogCache(){return Re.LogCache}static ClearLogCache(){Re.ClearLogCache()}static set LogLevels(e){Re.LogLevels=e}static set PerformanceLogLevel(e){if((e&je.PerformanceUserMarkLogLevel)===je.PerformanceUserMarkLogLevel){_native?.enablePerformanceLogging?(_n
472ative.enablePerformanceLogging(1),je.StartPerformanceCounter=je._StartMarkNative,je.EndPerformanceCounter=je._EndMarkNative):(je.StartPerformanceCounter=je._StartUserMark,je.EndPerformanceCounter=je._EndUserMark);return}if((e&je.PerformanceConsoleLogLevel)===je.PerformanceConsoleLogLevel){_native?.enablePerformanceLogging?(_native.enablePerformanceLogging(2),je.StartPerformanceCounter=je._StartMarkNative,je.EndPerformanceCounter=je._EndMarkNative):(je.StartPerformanceCounter=je._StartPerformanceConsole,je.EndPerformanceCounter=je._EndPerformanceConsole);return}je.StartPerformanceCounter=je._StartPerformanceCounterDisabled,je.EndPerformanceCounter=je._EndPerformanceCounterDisabled,_native?.disablePerformanceLogging?.()}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,t=!0){if(!je._Performance){if(!Bs())return;je._Performance=window.performance}!t||!je._Performance.mark||je._Performance.mark(e+"-Begin")}static _EndUserMark(e,t=!0){!t||!je._Performance.mark||(je._Performance.mark(e+"-End"),je._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,t=!0){t&&(je._StartUserMark(e,t),console.time&&console.time(e))}static _EndPerformanceConsole(e,t=!0){t&&(je._EndUserMark(e,t),console.timeEnd(e))}static _StartMarkNative(e,t=!0){if(t&&_native?.startPerformanceCounter)if(je._NativePerformanceCounterHandles.has(e))je.Warn(`Performance counter with name ${e} is already started.`);else{const s=_native.startPerformanceCounter(e);je._NativePerformanceCounterHandles.set(e,s)}}static _EndMarkNative(e,t=!0){if(t&&_native?.endPerformanceCounter){const s=je._NativePerformanceCounterHandles.get(e);s?(_native.endPerformanceCounter(s),je._NativePerformanceCounterHandles.delete(e)):je.Warn(`Performance counter with name ${e} was not started.`)}}static get Now(){return lr.Now}static GetClassName(e,t=!1){let s=null;return!t&&e.getClassName?s=e.getClassName():(e instanceof Object&&(s=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),s||(s=typeof e)),s}static First(e,t){for(const s of e)if(t(s))return s;return null}static getFullClassName(e,t=!1){let s=null,n=null;if(!t&&e.getClassName)s=e.getClassName();else{if(e instanceof Object){const a=t?e:Object.getPrototypeOf(e);s=a.constructor.__bjsclassName__,n=a.constructor.__bjsmoduleName__}s||(s=typeof e)}return s?(n!=null?n+".":"")+s:null}static async DelayAsync(e){await new Promise(t=>{setTimeout(()=>{t()},e)})}static IsSafari(){return Ao()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}}je=ft;ft.AssetBaseUrl="";ft.UseCustomRequestHeaders=!1;ft.CustomRequestHeaders=bs.CustomRequestHeaders;ft.GetDOMTextContent=V1;ft._DefaultCdnUrl="https://cdn.babylonjs.com";ft._CdnVersion="9.25.0";ft._DefaultAssetsUrl="https://assets.babylonjs.com/core";ft.LoadScript=typeof _native>"u"?je._LoadScriptWeb:je._LoadScriptNative;ft.GetAbsoluteUrl=typeof document=="object"?i=>{const e=document.createElement("a");return e.href=i,e.href}:typeof URL=="function"&&typeof location=="object"?i=>new URL(i,location.origin).href:()=>{throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.")};ft.NoneLogLevel=Re.NoneLogLevel;ft.MessageLogLevel=Re.MessageLogLevel;ft.WarningLogLevel=Re.WarningLogLevel;ft.ErrorLogLevel=Re.ErrorLogLevel;ft.AllLogLevel=Re.AllLogLevel;ft.IsWindowObjectExist=Bs;ft.PerformanceNoneLogLevel=0;ft.PerformanceUserMarkLogLevel=1;ft.PerformanceConsoleLogLevel=2;ft._NativePerformanceCounterHandles=new Map;ft.StartPerformanceCounter=je._StartPerformanceCounterDisabled;ft.EndPerformanceCounter=je._EndPerformanceCounterDisabled;let CA=(()=>{var i;let e,t=[],s=[],n,a=[],l=[],u,h=[],f=[],m,p=[],b=[],v,R=[],x=[],T,E=[],A=[],D,M=[],k=[],U,N=[],H=[],q,re=[],ce=[],ae,fe=[],_e=[],Te,z=[],J=[];return i=class{constructor(){this.keysUp=j(this,t,[38]),this.keysUpward=(j(this,s),j(this,a,[33])),this.keysDown=(j(this,l),j(this,h,[40])),this.keysDownward=(j(this,f),j(this,p,[34])),this.keysLeft=(j(this,b),j(this,R,[37])),this.keysRight=(j(this,x),j(this,E,[39])),this.rotationSpeed=(j(this,A),j(this,M,.5)),this.keysRotateLeft=(j(this,k),j(this,N,[])),this.keysRotateRight=(j(this,H),j(this,re,[])),this.keysRotateUp=(j(this,ce),j(this,fe,[])),this.keysRotateDown=(j(this,_e),j(this,z,[])),this._keys=(j(this,J),new Array)}attachControl(V){V=ft.BackCompatCameraNoPreventDefault(arguments),!this._onCanvasBlurObserver&&(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(ge=>{const L=ge.event;if(!L.metaKey){if(ge.type===_c.KEYDOWN)(this.keysUp.indexOf(L.keyCode)!==-1||this.keysDown.indexOf(L.keyCode)!==-1||this.keysLeft.indexOf(L.keyCode)!==-1||this.keysRight.indexOf(L.keyCode)!==-1||this.keysUpward.indexOf(L.keyCode)!==-1||this.keysDownward.indexOf(L.keyCode)!==-1||this.keysRotateLeft.indexOf(L.keyCode)!==-1||this.keysRotateRight.indexOf(L.keyCode)!==-1||this.keysRotateUp.indexOf(L.keyCode)!==-1||this.keysRotateDown.indexOf(L.keyCode)!==-1)&&(this._keys.indexOf(L.keyCode)===-1&&this._keys.push(L.keyCode),
472V||L.preventDefault());else if(this.keysUp.indexOf(L.keyCode)!==-1||this.keysDown.indexOf(L.keyCode)!==-1||this.keysLeft.indexOf(L.keyCode)!==-1||this.keysRight.indexOf(L.keyCode)!==-1||this.keysUpward.indexOf(L.keyCode)!==-1||this.keysDownward.indexOf(L.keyCode)!==-1||this.keysRotateLeft.indexOf(L.keyCode)!==-1||this.keysRotateRight.indexOf(L.keyCode)!==-1||this.keysRotateUp.indexOf(L.keyCode)!==-1||this.keysRotateDown.indexOf(L.keyCode)!==-1){const B=this._keys.indexOf(L.keyCode);B>=0&&this._keys.splice(B,1),V||L.preventDefault()}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){const V=this.camera,ge=V.movement.input,L=ge.getEntry("keyboard","translate"),B=ge.getEntry("keyboard","rotate"),X=B?.sensitivity??1,Q=V._localDirection.copyFromFloats(0,0,0);for(let F=0;F<this._keys.length;F++){const $=this._keys[F];this.keysLeft.indexOf($)!==-1?Q.x-=1:this.keysUp.indexOf($)!==-1?Q.z+=1:this.keysRight.indexOf($)!==-1?Q.x+=1:this.keysDown.indexOf($)!==-1?Q.z-=1:this.keysUpward.indexOf($)!==-1?Q.y+=1:this.keysDownward.indexOf($)!==-1?Q.y-=1:this.keysRotateLeft.indexOf($)!==-1?B&&(V.cameraRotation.y-=this._getLocalRotation()*X):this.keysRotateRight.indexOf($)!==-1?B&&(V.cameraRotation.y+=this._getLocalRotation()*X):this.keysRotateUp.indexOf($)!==-1?B&&(V.cameraRotation.x-=this._getLocalRotation()*X):this.keysRotateDown.indexOf($)!==-1&&B&&(V.cameraRotation.x+=this._getLocalRotation()*X)}if(L&&(Q.x!==0||Q.y!==0||Q.z!==0)){const F=V._computeLocalCameraSpeed()*(L.sensitivity??1);Q.normalize().scaleInPlace(F),V.getScene().useRightHandedSystem&&(Q.z*=-1),V.getViewMatrix().invertToRef(V._cameraTransformMatrix),I.TransformNormalToRef(Q,V._cameraTransformMatrix,V._transformedDirection),V.cameraDirection.addInPlace(V._transformedDirection)}}}getClassName(){return"FreeCameraKeyboardMoveInput"}_onLostFocus(){this._keys.length=0}getSimpleName(){return"keyboard"}_getLocalRotation(){const V=this.camera._calculateHandednessMultiplier();return this.rotationSpeed*this._engine.getDeltaTime()/1e3*V}},(()=>{const Y=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ne()],n=[ne()],u=[ne()],m=[ne()],v=[ne()],T=[ne()],D=[ne()],U=[ne()],q=[ne()],ae=[ne()],Te=[ne()],te(null,null,e,{kind:"field",name:"keysUp",static:!1,private:!1,access:{has:V=>"keysUp"in V,get:V=>V.keysUp,set:(V,ge)=>{V.keysUp=ge}},metadata:Y},t,s),te(null,null,n,{kind:"field",name:"keysUpward",static:!1,private:!1,access:{has:V=>"keysUpward"in V,get:V=>V.keysUpward,set:(V,ge)=>{V.keysUpward=ge}},metadata:Y},a,l),te(null,null,u,{kind:"field",name:"keysDown",static:!1,private:!1,access:{has:V=>"keysDown"in V,get:V=>V.keysDown,set:(V,ge)=>{V.keysDown=ge}},metadata:Y},h,f),te(null,null,m,{kind:"field",name:"keysDownward",static:!1,private:!1,access:{has:V=>"keysDownward"in V,get:V=>V.keysDownward,set:(V,ge)=>{V.keysDownward=ge}},metadata:Y},p,b),te(null,null,v,{kind:"field",name:"keysLeft",static:!1,private:!1,access:{has:V=>"keysLeft"in V,get:V=>V.keysLeft,set:(V,ge)=>{V.keysLeft=ge}},metadata:Y},R,x),te(null,null,T,{kind:"field",name:"keysRight",static:!1,private:!1,access:{has:V=>"keysRight"in V,get:V=>V.keysRight,set:(V,ge)=>{V.keysRight=ge}},metadata:Y},E,A),te(null,null,D,{kind:"field",name:"rotationSpeed",static:!1,private:!1,access:{has:V=>"rotationSpeed"in V,get:V=>V.rotationSpeed,set:(V,ge)=>{V.rotationSpeed=ge}},metadata:Y},M,k),te(null,null,U,{kind:"field",name:"keysRotateLeft",static:!1,private:!1,access:{has:V=>"keysRotateLeft"in V,get:V=>V.keysRotateLeft,set:(V,ge)=>{V.keysRotateLeft=ge}},metadata:Y},N,H),te(null,null,q,{kind:"field",name:"keysRotateRight",static:!1,private:!1,access:{has:V=>"keysRotateRight"in V,get:V=>V.keysRotateRight,set:(V,ge)=>{V.keysRotateRight=ge}},metadata:Y},re,ce),te(null,null,ae,{kind:"field",name:"keysRotateUp",static:!1,private:!1,access:{has:V=>"keysRotateUp"in V,get:V=>V.keysRotateUp,set:(V,ge)=>{V.keysRotateUp=ge}},metadata:Y},fe,_e),te(null,null,Te,{kind:"field",name:"keysRotateDown",static:!1,private:!1,access:{has:V=>"keysRotateDown"in V,get:V=>V.keysRotateDown,set:(V,ge)=>{V.keysRotateDown=ge}},metadata:Y},z,J),Y&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Y})})(),i})();Ho.FreeCameraKeyboardMoveInput=CA;class at{}at.POINTERDOWN=1;at.POINTERUP=2;at.POINTERMOVE=4;at.POINTERWHEEL=8;at.POINTERPICK=16;at.POINTERTAP=32;at.POINTERDOUBLETAP=64;class AA{constructor(e,t){this.type=e,this.event=t}}class DG extends AA{constructor(e,t,s,n){super(e,t),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new Xe(s,n)}}class sr extends AA{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(e,t,s,n=null){super(e,t),this._pickInfo=s,this._inputManager=n}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}}let MA=(()=>{var i;let e,t=[],s=[],n,a=[],l=[];return i=class{_applyPointerRotation(h,f){this._pointerConditions.button=this._currentActiveButton;const m=this.camera.movement.input.resolveInteraction("pointer",this._pointerConditions);if(!m||m.interaction!=="rotate")return;const p=m.sensitivityX??m.sensitivity??1/this.angularSensibility,b=m.sensitivityY??m.sensitivity??1/this.angularSensibility;this.camera.cameraRotation.y+=h*p,this.camera.cameraRotation.x+=f*b}constructor(h=!0){this.touchEnabled=h,this.buttons=j(this,t,[0,1,2]),this.angularSensibility=(j(this,s),j(this,a,2e3)),this._pointerInput=j(this,l),this._previousPosition=null,this.onPointerMovedObservable=new xe,this._allowCameraRotation=!0,this._currentActiveButton=-1,this._activePointerId=-1,this._pointerConditions={}}attachControl(h){h=ft.BackCompatCameraNoPreventDefault(arguments);
472const f=this.camera.getEngine(),m=f.getInputElement();this._pointerInput||(this._pointerInput=p=>{const b=p.event,v=b.pointerType==="touch";if(!this.touchEnabled&&v||p.type!==at.POINTERMOVE&&this.buttons.indexOf(b.button)===-1)return;const R=b.target;if(p.type===at.POINTERDOWN){if(v&&this._activePointerId!==-1||!v&&this._currentActiveButton!==-1)return;this._activePointerId=b.pointerId;try{R?.setPointerCapture(b.pointerId)}catch{}this._currentActiveButton===-1&&(this._currentActiveButton=b.button),this._previousPosition={x:b.clientX,y:b.clientY},h||(b.preventDefault(),m&&m.focus()),f.isPointerLock&&this._onMouseMove&&this._onMouseMove(p.event)}else if(p.type===at.POINTERUP){if(v&&this._activePointerId!==b.pointerId||!v&&this._currentActiveButton!==b.button)return;try{R?.releasePointerCapture(b.pointerId)}catch{}this._currentActiveButton=-1,this._previousPosition=null,h||b.preventDefault(),this._activePointerId=-1}else if(p.type===at.POINTERMOVE&&(this._activePointerId===b.pointerId||!v)){if(f.isPointerLock&&this._onMouseMove)this._onMouseMove(p.event);else if(this._previousPosition){const x=this.camera._calculateHandednessMultiplier(),T=(b.clientX-this._previousPosition.x)*x,E=(b.clientY-this._previousPosition.y)*x;this._allowCameraRotation&&this._applyPointerRotation(T,E),this.onPointerMovedObservable.notifyObservers({offsetX:T,offsetY:E}),this._previousPosition={x:b.clientX,y:b.clientY},h||b.preventDefault()}}}),this._onMouseMove=p=>{if(!f.isPointerLock)return;const b=this.camera._calculateHandednessMultiplier();this._applyPointerRotation(p.movementX*b,p.movementY*b),this._previousPosition=null,h||p.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,at.POINTERDOWN|at.POINTERUP|at.POINTERMOVE),m&&(this._contextMenuBind=p=>this.onContextMenu(p),m.addEventListener("contextmenu",this._contextMenuBind,!1))}onContextMenu(h){h.preventDefault()}detachControl(){if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._contextMenuBind){const f=this.camera.getEngine().getInputElement();f&&f.removeEventListener("contextmenu",this._contextMenuBind)}this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this._previousPosition=null}this._activePointerId=-1,this._currentActiveButton=-1}getClassName(){return"FreeCameraMouseInput"}getSimpleName(){return"mouse"}},(()=>{const u=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ne()],n=[ne()],te(null,null,e,{kind:"field",name:"buttons",static:!1,private:!1,access:{has:h=>"buttons"in h,get:h=>h.buttons,set:(h,f)=>{h.buttons=f}},metadata:u},t,s),te(null,null,n,{kind:"field",name:"angularSensibility",static:!1,private:!1,access:{has:h=>"angularSensibility"in h,get:h=>h.angularSensibility,set:(h,f)=>{h.angularSensibility=f}},metadata:u},a,l),u&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u})})(),i})();Ho.FreeCameraMouseInput=MA;var vR;(function(i){i[i.PointerMove=0]="PointerMove",i[i.PointerDown=1]="PointerDown",i[i.PointerUp=2]="PointerUp"})(vR||(vR={}));class Ic{}Ic.DOM_DELTA_PIXEL=0;Ic.DOM_DELTA_LINE=1;Ic.DOM_DELTA_PAGE=2;let IG=(()=>{var i;let e,t=[],s=[],n,a=[],l=[],u,h=[],f=[];return i=class{constructor(){this.wheelPrecisionX=j(this,t,3),this.wheelPrecisionY=(j(this,s),j(this,a,3)),this.wheelPrecisionZ=(j(this,l),j(this,h,3)),this.onChangedObservable=(j(this,f),new xe),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}attachControl(p){p=ft.BackCompatCameraNoPreventDefault(arguments),this._wheel=b=>{if(b.type!==at.POINTERWHEEL)return;const v=b.event,R=v.deltaMode===Ic.DOM_DELTA_LINE?this._ffMultiplier:1;this._wheelDeltaX+=this.wheelPrecisionX*R*v.deltaX/this._normalize,this._wheelDeltaY-=this.wheelPrecisionY*R*v.deltaY/this._normalize,this._wheelDeltaZ+=this.wheelPrecisionZ*R*v.deltaZ/this._normalize,v.preventDefault&&(p||v.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,at.POINTERWHEEL)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null),this.onChangedObservable&&this.onChangedObservable.clear()}checkInputs(){this.onChangedObservable.notifyObservers({wheelDeltaX:this._wheelDeltaX,wheelDeltaY:this._wheelDeltaY,wheelDeltaZ:this._wheelDeltaZ}),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0}getClassName(){return"BaseCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}},(()=>{const m=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ne()],n=[ne()],u=[ne()],te(null,null,e,{kind:"field",name:"wheelPrecisionX",static:!1,private:!1,access:{has:p=>"wheelPrecisionX"in p,get:p=>p.wheelPrecisionX,set:(p,b)=>{p.wheelPrecisionX=b}},metadata:m},t,s),te(null,null,n,{kind:"field",name:"wheelPrecisionY",static:!1,private:!1,access:{has:p=>"wheelPrecisionY"in p,get:p=>p.wheelPrecisionY,set:(p,b)=>{p.wheelPrecisionY=b}},metadata:m},a,l),te(null,null,u,{kind:"field",name:"wheelPrecisionZ",static:!1,private:!1,access:{has:p=>"wheelPrecisionZ"in p,get:p=>p.wheelPrecisionZ,set:(p,b)=>{p.wheelPrecisionZ=b}},metadata:m},h,f),m&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:m})})(),i})();var Dt;(function(i){i[i.MoveRelative=0]="MoveRelative",i[i.RotateRelative=1]="RotateRelative",i[i.MoveScene=2]="MoveScene"})(Dt||(Dt={}));let wA=(()=>{var i;let e=IG,t=[],s,n,a,l,u,h,f,m,p;return i=class extends e{constructor(){super(...arguments),this.camera=j(this,t),this._moveRelative=I.Zero(),this._rotateRelative=I.Zero(),this._moveScene=I.Zero(),this._wheelXAction=Dt.MoveRelative,this._wheelXActionCoordinate=0,this._wheelYAction=Dt.MoveRelative,this._wheelYActionCoordinate=2,this._wheelZAction=null,this._wheelZActionCoordinate=null}getClassName(){return"FreeCameraMouseWheelInput"}set wheelXMoveRelative(v){v===null&&this._wheelXAction!==Dt.MoveRelative||(this._wheelXAction=Dt.MoveRelative,this._wheelXActionCoordinate=v)}get wheelXMoveRelative(){return this._wheelXAction!==Dt.MoveRelative?null:this._wheelXActionCoordinate}set wheelYMoveRelative(v){v===null&&this._wheelYAction!==Dt.MoveRelative||(this._wheelYAction=Dt.MoveRelative,this._wheelYActionCoordinate=v)}get wheelYMoveRelative(){return this._wheelYAction!==Dt.MoveRelative?null:this._wheelYActionCoordinate}set wheelZMoveRelative(v){v===null&&this._wheelZAction!==Dt.MoveRelative||(this._wheelZAction=Dt.MoveRelative,this._wheelZActionCoordinate=v)}get wheelZMoveRelative(){return this._wheelZAction!==Dt.MoveRelative?null:this._wheelZActionCoordinate}set wheelXRotateRelative(v){v===null&&this._wheelXAction!==Dt.RotateRelative||(this._wheelXAction=Dt.RotateRelative,this._wheelXActionCoordinate=v)}get wheelXRotateRelative(){return this._wheelXAction!==Dt.RotateRelative?null:this._wheelXActionCoordinate}set wheelYRotateRelative(v){v===null&&this._wheelYAction!==Dt.RotateRelative||(this._wheelYAction=Dt.RotateRelative,this._wheelYActionCoordinate=v)}get wheelYRotateRelative(){return this._wheelYAction!==Dt.RotateRelative?null:this._wheelYActionCoordinate}set wheelZRotateRelative(v){v===null&&this._wheelZAction!==Dt.RotateRelative||(this._wheelZAction=Dt.RotateRelative,this._wheelZActionCoordinate=v)}get wheelZRotateRelative(){return this._wheelZAction!==Dt.RotateRelative?null:this._wheelZActionCoordinate}set wheelXMoveScene(v){v===null&&this._wheelXAction!==Dt.MoveScene||(this._wheelXAction=Dt.MoveScene,this._wheelXActionCoordinate=v)}get wheelXMoveScene(){return this._wheelXAction!==Dt.MoveScene?null:this._wheelXActionCoordinate}set wheelYMoveScene(v){v===null&&this._wheelYAction!==Dt.MoveScene||(this._wheelYAction=Dt.MoveScene,this._wheelYActionCoordinate=v)}get wheelYMoveScene(){return this._wheelYAction!==Dt.MoveScene?null:this._wheelYActionCoordinate}set wheelZMoveScene(v){v===null&&this._wheelZAction!==Dt.MoveScene||(this._wheelZAction=Dt.MoveScene,this._wheelZActionCoordinate=v)}get wheelZMoveScene(){return this._wheelZAction!==Dt.MoveScene?null:this._wheelZActionCoordinate}
472checkInputs(){if(this._wheelDeltaX===0&&this._wheelDeltaY===0&&this._wheelDeltaZ==0)return;this._moveRelative.setAll(0),this._rotateRelative.setAll(0),this._moveScene.setAll(0),this._updateCamera(),this.camera.getScene().useRightHandedSystem&&(this._moveRelative.z*=-1);const v=ee.Zero();this.camera.getViewMatrix().invertToRef(v);const R=I.Zero();I.TransformNormalToRef(this._moveRelative,v,R),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(R),this.camera.cameraDirection.addInPlace(this._moveScene),super.checkInputs()}_updateCamera(){this._updateCameraProperty(this._wheelDeltaX,this._wheelXAction,this._wheelXActionCoordinate),this._updateCameraProperty(this._wheelDeltaY,this._wheelYAction,this._wheelYActionCoordinate),this._updateCameraProperty(this._wheelDeltaZ,this._wheelZAction,this._wheelZActionCoordinate)}_updateCameraProperty(v,R,x){if(v===0||R===null||x===null)return;let T=null;switch(R){case Dt.MoveRelative:T=this._moveRelative;break;case Dt.RotateRelative:T=this._rotateRelative;break;case Dt.MoveScene:T=this._moveScene;break}switch(x){case 0:T.set(v,0,0);break;case 1:T.set(0,v,0);break;case 2:T.set(0,0,v);break}}},(()=>{const b=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;s=[ne()],n=[ne()],a=[ne()],l=[ne()],u=[ne()],h=[ne()],f=[ne()],m=[ne()],p=[ne()],te(i,null,s,{kind:"setter",name:"wheelXMoveRelative",static:!1,private:!1,access:{has:v=>"wheelXMoveRelative"in v,set:(v,R)=>{v.wheelXMoveRelative=R}},metadata:b}
472,null,t),te(i,null,n,{kind:"setter",name:"wheelYMoveRelative",static:!1,private:!1,access:{has:v=>"wheelYMoveRelative"in v,set:(v,R)=>{v.wheelYMoveRelative=R}},metadata:b},null,t),te(i,null,a,{kind:"setter",name:"wheelZMoveRelative",static:!1,private:!1,access:{has:v=>"wheelZMoveRelative"in v,set:(v,R)=>{v.wheelZMoveRelative=R}},metadata:b},null,t),te(i,null,l,{kind:"setter",name:"wheelXRotateRelative",static:!1,private:!1,access:{has:v=>"wheelXRotateRelative"in v,set:(v,R)=>{v.wheelXRotateRelative=R}},metadata:b},null,t),te(i,null,u,{kind:"setter",name:"wheelYRotateRelative",static:!1,private:!1,access:{has:v=>"wheelYRotateRelative"in v,set:(v,R)=>{v.wheelYRotateRelative=R}},metadata:b},null,t),te(i,null,h,{kind:"setter",name:"wheelZRotateRelative",static:!1,private:!1,access:{has:v=>"wheelZRotateRelative"in v,set:(v,R)=>{v.wheelZRotateRelative=R}},metadata:b},null,t),te(i,null,f,{kind:"setter",name:"wheelXMoveScene",static:!1,private:!1,access:{has:v=>"wheelXMoveScene"in v,set:(v,R)=>{v.wheelXMoveScene=R}},metadata:b},null,t),te(i,null,m,{kind:"setter",name:"wheelYMoveScene",static:!1,private:!1,access:{has:v=>"wheelYMoveScene"in v,set:(v,R)=>{v.wheelYMoveScene=R}},metadata:b},null,t),te(i,null,p,{kind:"setter",name:"wheelZMoveScene",static:!1,private:!1,access:{has:v=>"wheelZMoveScene"in v,set:(v,R)=>{v.wheelZMoveScene=R}},metadata:b},null,t),b&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b})})(),i})();Ho.FreeCameraMouseWheelInput=wA;let PA=(()=>{var i;let e,t=[],s=[],n,a=[],l=[];return i=class{constructor(h=!1){this.allowMouse=h,this.touchAngularSensibility=j(this,t,2e5),this.touchMoveSensibility=(j(this,s),j(this,a,250)),this.singleFingerRotate=(j(this,l),!1),this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array,this._isSafari=ft.IsSafari()}attachControl(h){h=ft.BackCompatCameraNoPreventDefault(arguments);let f=null;if(this._pointerInput===void 0&&(this._onLostFocus=()=>{this._offsetX=null,this._offsetY=null},this._pointerInput=m=>{const p=m.event,b=p.pointerType==="mouse"||this._isSafari&&typeof p.pointerType>"u";if(!(!this.allowMouse&&b)){if(m.type===at.POINTERDOWN){if(h||p.preventDefault(),this._pointerPressed.push(p.pointerId),this._pointerPressed.length!==1)return;f={x:p.clientX,y:p.clientY}}else if(m.type===at.POINTERUP){h||p.preventDefault();const v=this._pointerPressed.indexOf(p.pointerId);if(v===-1||(this._pointerPressed.splice(v,1),v!=0))return;f=null,this._offsetX=null,this._offsetY=null}else if(m.type===at.POINTERMOVE){if(h||p.preventDefault(),!f||this._pointerPressed.indexOf(p.pointerId)!=0)return;this._offsetX=p.clientX-f.x,this._offsetY=-(p.clientY-f.y)}}}),this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,at.POINTERDOWN|at.POINTERUP|at.POINTERMOVE),this._onLostFocus){const p=this.camera.getEngine().getInputElement();p&&p.addEventListener("blur",this._onLostFocus)}}detachControl(){if(this._pointerInput){if(this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null),this._onLostFocus){const f=this.camera.getEngine().getInputElement();f&&f.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null}this._pointerPressed.length=0,this._offsetX=null,this._offsetY=null}}checkInputs(){if(this._offsetX===null||this._offsetY===null||this._offsetX===0&&this._offsetY===0)return;const h=this.camera,f=h.movement.input,m=f.getEntry("touch","rotate"),p=f.getEntry("touch","translate"),b=h._calculateHandednessMultiplier(),v=this.singleFingerRotate&&this._pointerPressed.length===1||!this.singleFingerRotate&&this._pointerPressed.length>1;if(m){const R=m.sensitivity??1/this.touchAngularSensibility;h.cameraRotation.y=this._offsetX*b*R,v&&(h.cameraRotation.x=-(this._offsetY*b)*R)}if(!v&&p){const R=h._computeLocalCameraSpeed(),x=p.sensitivity??(this.touchMoveSensibility!==0?1/this.touchMoveSensibility:0),T=We.Vector3[0];T.copyFromFloats(0,0,R*this._offsetY*x),ee.RotationYawPitchRollToRef(h.rotation.y,h.rotation.x,0,h._cameraRotationMatrix),I.TransformCoordinatesToRef(T,h._cameraRotationMatrix,T),h.cameraDirection.addInPlace(T)}}getClassName(){return"FreeCameraTouchInput"}getSimpleName(){return"touch"}},(()=>{const u=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ne()],n=[ne()],te(null,null,e,{kind:"field",name:"touchAngularSensibility",static:!1,private:!1,access:{has:h=>"touchAngularSensibility"in h,get:h=>h.touchAngularSensibility,set:(h,f)=>{h.touchAngularSensibility=f}},metadata:u},t,s),te(null,null,n,{kind:"field",name:"touchMoveSensibility",static:!1,private:!1,access:{has:h=>"touchMoveSensibility"in h,get:h=>h.touchMoveSensibility,set:(h,f)=>{h.touchMoveSensibility=f}},metadata:u},a,l),u&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u})})(),i})();Ho.FreeCameraTouchInput=PA;var RR,TR,ER;class Rd extends wG{constructor(e){super(e),this._mouseInput=null,this._mouseWheelInput=null}addKeyboard(){return this.add(new CA),this}addMouse(e=!0){return this._mouseInput||(this._mouseInput=new MA(e),this.add(this._mouseInput)),this}removeMouse(){return this._mouseInput&&this.remove(this._mouseInput),this}addMouseWheel(){return this._mouseWheelInput||(this._mouseWheelInput=new wA,this.add(this._mouseWheelInput)),this}removeMouseWheel(){return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this}addTouch(){return this.add(new PA),this}clear(){super.clear(),this._mouseInput=null}}(RR=Rd.prototype).addDeviceOrientation??(RR.addDeviceOrientation=tt("FreeCameraInputsManager","addDeviceOrientation"));(TR=Rd.prototype).addVirtualJoystick??(TR.addVirtualJoystick=tt("FreeCameraInputsManager","addVirtualJoystick"));(ER=Rd.prototype).addGamepad??(ER.addGamepad=tt("FreeCameraInputsManager","addGamepad"));let OA=(()=>{var i;let e=MG,t,s=[],n=[],a,l=[],u=[],h,f=[],m=[],p,b=[],v=[];return i=class extends e{get angularSensibility(){const x=this.inputs.attached.mouse;return x?x.angularSensibility:0}set angularSensibility(x){const T=this.inputs.attached.mouse;T&&(T.angularSensibility=x)}get keysUp(){const x=this.inputs.attached.keyboard;return x?x.keysUp:[]}set keysUp(x){const T=this.inputs.attached.keyboard;T&&(T.keysUp=x)}get keysUpward(){const x=this.inputs.attached.keyboard;return x?x.keysUpward:[]}set keysUpward(x){const T=this.inputs.attached.keyboard;T&&(T.keysUpward=x)}get keysDown(){const x=this.inputs.attached.keyboard;return x?x.keysDown:[]}set keysDown(x){const T=this.inputs.attached.keyboard;T&&(T.keysDown=x)}get keysDownward(){const x=this.inputs.attached.keyboard;return x?x.keysDownward:[]}set keysDownward(x){const T=this.inputs.attached.keyboard;T&&(T.keysDownward=x)}get keysLeft(){const x=this.inputs.attached.keyboard;return x?x.keysLeft:[]}set keysLeft(x){const T=this.inputs.attached.keyboard;T&&(T.keysLeft=x)}get keysRight(){const x=this.inputs.attached.keyboard;return x?x.keysRight:[]}set keysRight(x){const T=this.inputs.attached.keyboard;T&&(T.keysRight=x)}get keysRotateLeft(){const x=this.inputs.attached.keyboard;return x?x.keysRotateLeft:[]}set keysRotateLeft(x){const T=this.inputs.attached.keyboard;
vendor: 4,103 bytes, line 472
472T&&(T.keysRotateLeft=x)}get keysRotateRight(){const x=this.inputs.attached.keyboard;return x?x.keysRotateRight:[]}set keysRotateRight(x){const T=this.inputs.attached.keyboard;T&&(T.keysRotateRight=x)}get keysRotateUp(){const x=this.inputs.attached.keyboard;return x?x.keysRotateUp:[]}set keysRotateUp(x){const T=this.inputs.attached.keyboard;T&&(T.keysRotateUp=x)}get keysRotateDown(){const x=this.inputs.attached.keyboard;return x?x.keysRotateDown:[]}set keysRotateDown(x){const T=this.inputs.attached.keyboard;T&&(T.keysRotateDown=x)}constructor(x,T,E,A=!0){super(x,T,E,A),this.ellipsoid=j(this,s,new I(.5,1,.5)),this.ellipsoidOffset=(j(this,n),j(this,l,new I(0,0,0))),this.checkCollisions=(j(this,u),j(this,f,!1)),this.applyGravity=(j(this,m),j(this,b,!1)),this.inputs=j(this,v),this._needMoveForGravity=!1,this._oldPosition=I.Zero(),this._diffPosition=I.Zero(),this._newPosition=I.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(D,M,k=null)=>{this._newPosition.copyFrom(M),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>Be.CollisionsEpsilon&&(this.position.addToRef(this._diffPosition,this._deferredPositionUpdate),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate),this.onCollide&&k&&this.onCollide(k))},this.inputs=new Rd(this),this.inputs.addKeyboard().addMouse()}attachControl(x,T){T=ft.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(T)}detachControl(){this.inputs.detachElement(),this.cameraDirection=new I(0,0,0),this.cameraRotation=new Xe(0,0)}get collisionMask(){return this._collisionMask}set collisionMask(x){this._collisionMask=isNaN(x)?-1:x}_collideWithWorld(x){let T;this.parent?T=I.TransformCoordinates(this.position,this.parent.getWorldMatrix()):T=this.position,T.subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);const E=this.getScene().collisionCoordinator;this._collider||(this._collider=E.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;let A=x;this.applyGravity&&(A=x.add(this.getScene().gravity)),E.getNewPosition(this._oldPosition,A,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){this._localDirection||(this._localDirection=I.Zero(),this._transformedDirection=I.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(x){this._needMoveForGravity=x}get needMoveForGravity(){return this._needMoveForGravity}_decideIfNeedsToMove(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):super._updatePosition()}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"FreeCamera"}},(()=>{const R=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[hc()],a=[hc()],h=[ne()],p=[ne()],te(null,null,t,{kind:"field",name:"ellipsoid",static:!1,private:!1,access:{has:x=>"ellipsoid"in x,get:x=>x.ellipsoid,set:(x,T)=>{x.ellipsoid=T}},metadata:R},s,n),te(null,null,a,{kind:"field",name:"ellipsoidOffset",static:!1,private:!1,access:{has:x=>"ellipsoidOffset"in x,get:x=>x.ellipsoidOffset,set:(x,T)=>{x.ellipsoidOffset=T}},metadata:R},l,u),te(null,null,h,{kind:"field",name:"checkCollisions",static:!1,private:!1,access:{has:x=>"checkCollisions"in x,get:x=>x.checkCollisions,set:(x,T)=>{x.checkCollisions=T}},metadata:R},f,m),te(null,null,p,{kind:"field",name:"applyGravity",static:!1,private:!1,access:{has:x=>"applyGravity"in x,get:x=>x.applyGravity,set:(x,T)=>{x.applyGravity=T}},metadata:R},b,v),R&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:R})})(),i})(),SR=!1;function FG(){SR||(SR=!0,ar("BABYLON.FreeCamera",OA))}FG();class CR{get isDisposed(){return this._isDisposed}constructor(e,t,s,n=0,a=!1,l=!1,u=!1,h,f){this._isAlreadyOwned=!1,this._isDisposed=!1,aA(),e&&e.getSce
vendor: 24,390 bytes, line 472
472ne?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=s,this._instanced=l,this._divisor=h||1,this._label=f,t instanceof Oc?(this._data=null,this._buffer=t):(this._data=t,this._buffer=null),this.byteStride=u?n:n*Float32Array.BYTES_PER_ELEMENT,a||this.create()}createVertexBuffer(e,t,s,n,a,l=!1,u){const h=l?t:t*Float32Array.BYTES_PER_ELEMENT,f=n?l?n:n*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new Ue(this._engine,this,e,this._updatable,!0,f,a===void 0?this._instanced:a,h,s,void 0,void 0,!0,this._divisor||u)}isUpdatable(){return this._updatable}getData(){return this._data}getBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT}create(e=null){!e&&this._buffer||(e=e||this._data,e&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e),this._data=e):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(e,this._label),this._data=e):this._buffer=this._engine.createVertexBuffer(e,void 0,this._label)))}_rebuild(){if(this._data)this._buffer=null,this.create(this._data);else{if(!this._buffer)return;if(this._buffer.capacity>0){this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label);return}Re.Warn(`Missing data for buffer "${this._label}" ${this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":""}. Buffer reconstruction failed.`),this._buffer=null}}update(e){this.create(e)}updateDirectly(e,t,s,n=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,n?t:t*Float32Array.BYTES_PER_ELEMENT,s?s*this.byteStride:void 0),t===0&&s===void 0?this._data=e:this._data=null)}_increaseReferences(){if(this._buffer){if(!this._isAlreadyOwned){this._isAlreadyOwned=!0;return}this._buffer.references++}}dispose(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._isDisposed=!0,this._data=null,this._buffer=null)}}class Ue{get isDisposed(){return this._isDisposed}get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(e){const t=e!=0;this._instanceDivisor=e,t!==this._instanced&&(this._instanced=t,this._computeHashCode())}get _maxVerticesCount(){const e=this.getData();return e?Array.isArray(e)?e.length/(this.byteStride/4)-this.byteOffset/4:(e.byteLength-this.byteOffset)/this.byteStride:0}constructor(e,t,s,n,a,l,u,h,f,m,p=!1,b=!1,v=1,R=!1){this._isDisposed=!1;let x;if(this.engine=e,typeof n=="object"&&n!==null?(x=n.updatable??!1,a=n.postponeInternalCreation,l=n.stride,u=n.instanced,h=n.offset,f=n.size,m=n.type,p=n.normalized??!1,b=n.useBytes??!1,v=n.divisor??1,R=n.takeBufferOwnership??!1,this._label=n.label):x=!!n,t instanceof CR?(this._buffer=t,this._ownsBuffer=R):(this._buffer=new CR(e,t,x,l,a,u,b,v,this._label),this._ownsBuffer=!0),this.uniqueId=Ue._Counter++,this._kind=s,m===void 0){const E=this.getData();this.type=E?kG(E):Ue.FLOAT}else this.type=m;const T=Mo(this.type);b?(this._size=f||(l?l/T:AR(s)),this.byteStride=l||this._buffer.byteStride||this._size*T,this.byteOffset=h||0):(this._size=f||l||AR(s),this.byteStride=l?l*T:this._buffer.byteStride||this._size*T,this.byteOffset=(h||0)*T),this.normalized=p,this._instanced=u!==void 0?u:!1,this._instanceDivisor=u?v:0,this._alignBuffer(),this._computeHashCode()}static _GetTypeHashIndex(e){switch(e){case Ue.BYTE:return 0;case Ue.UNSIGNED_BYTE:return 1;case Ue.SHORT:return 2;case Ue.UNSIGNED_SHORT:return 3;case Ue.INT:return 4;case Ue.UNSIGNED_INT:return 5;case Ue.FLOAT:return 6;case Ue.HALF_FLOAT:return 7;default:throw new Error(`Invalid vertex buffer type '${e}'`)}}_computeHashCode(){this.hashCode=(Ue._GetTypeHashIndex(this.type)<<0)+((this.normalized?1:0)<<3)+(this._size-1<<4)+((this._instanced?1:0)<<6)+(this.byteStride<<12)}_rebuild(){this._buffer?._rebuild()}getKind(){return this._kind}isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(e,t){const s=this.getData();return s?rG(s,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,e,t):null}getBuffer(){return this._buffer.getBuffer()}getWrapperBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Mo(this.type)}getOffset(){return this.byteOffset/Mo(this.type)}getSize(e=!1){return e?this._size*Mo(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(e){this._buffer.create(e),this._alignBuffer()}update(e){this._buffer.update(e),this._alignBuffer()}updateDirectly(e,t,s=!1){this._buffer.updateDirectly(e,t,void 0,s),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(e,t){xA(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,e,this.normalized,(s,n)=>{for(let a=0;a<this._size;a++)t(s[a],n+a)})}_alignBuffer(){}}Ue._Counter=0;Ue.BYTE=5120;Ue.UNSIGNED_BYTE=5121;Ue.SHORT=5122;Ue.UNSIGNED_SHORT=5123;Ue.INT=5124;Ue.UNSIGNED_INT=5125;Ue.FLOAT=5126;Ue.HALF_FLOAT=5131;Ue.PositionKind="position";Ue.NormalKind="normal";Ue.TangentKind="tangent";Ue.UVKind="uv";Ue.UV2Kind="uv2";Ue.UV3Kind="uv3";Ue.UV4Kind="uv4";Ue.UV5Kind="uv5";Ue.UV6Kind="uv6";Ue.ColorKind="color";Ue.ColorInstanceKind="instanceColor";Ue.MatricesIndicesKind="matricesIndices";Ue.MatricesWeightsKind="matricesWeights";Ue.MatricesIndicesExtraKind="matricesIndicesExtra";Ue.MatricesWeightsExtraKind="matricesWeightsExtra";function AR(i){switch(i){case Ue.UVKind:case Ue.UV2Kind:case Ue.UV3Kind:case Ue.UV4Kind:case Ue.UV5Kind:case Ue.UV6Kind:return 2;case Ue.NormalKind:case Ue.PositionKind:return 3;case Ue.ColorKind:case Ue.ColorInstanceKind:case Ue.MatricesIndicesKind:case Ue.MatricesIndicesExtraKind:case Ue.MatricesWeightsKind:case Ue.MatricesWeightsExtraKind:case Ue.TangentKind:return 4;default:throw new Error("Invalid kind '"+i+"'")}}function kG(i){return i instanceof Int8Array?Ue.BYTE:i instanceof Uint8Array?Ue.UNSIGNED_BYTE:i instanceof Int16Array?Ue.SHORT:i instanceof Uint16Array?Ue.UNSIGNED_SHORT:i instanceof Int32Array?Ue.INT:i instanceof Uint32Array?Ue.UNSIGNED_INT:Ue.FLOAT}class MR{constructor(e,t,s){this.bu=e,this.bv=t,this.distance=s,this.faceId=0,this.subMeshId=0,this._internalSubMeshId=0}}class rr{constructor(e,t,s){this.vectors=Gr(8,I.Zero),this.center=I.Zero(),this.centerWorld=I.Zero(),this.extendSize=I.Zero(),this.extendSizeWorld=I.Zero(),this.directions=Gr(3,I.Zero),this.vectorsWorld=Gr(8,I.Zero),this.minimumWorld=I.Zero(),this.maximumWorld=I.Zero(),this.minimum=I.Zero(),this.maximum=I.Zero(),this._drawWrapperFront=null,this._drawWrapperBack=null,this.reConstruct(e,t,s)}reConstruct(e,t,s){const n=e.x,a=e.y,l=e.z,u=t.x,h=t.y,f=t.z,m=this.vectors;this.minimum.copyFromFloats(n,a,l),this.maximum.copyFromFloats(u,h,f),m[0].copyFromFloats(n,a,l),m[1].copyFromFloats(u,h,f),m[2].copyFromFloats(u,a,l),m[3].copyFromFloats(n,h,l),m[4].copyFromFloats(n,a,f),m[5].copyFromFloats(u,h,l),m[6].copyFromFloats(n,h,f),m[7].copyFromFloats(u,a,f),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=s||ee.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){const t=rr._TmpVector3,s=this.maximum.subtractToRef(this.minimum,t[0]),n=s.length();s.normalizeFromLength(n);const a=n*e,l=s.scaleInPlace(a*.5),u=this.center.subtractToRef(l,t[1]),h=this.center.addToRef(l,t[2]);return this.reConstruct(u,h,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){const t=this.minimumWorld,s=this.maximumWorld,n=this.directions,a=this.vectorsWorld,l=this.vectors;if(e.isIdentity()){t.copyFrom(this.minimum),s.copyFrom(this.maximum);for(let u=0;u<8;++u)a[u].copyFrom(l[u]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),s.setAll(-Number.MAX_VALUE);for(let u=0;u<8;++u){const h=a[u];I.TransformCoordinatesToRef(l[u],e,h),t.minimizeInPlace(h),s.maximizeInPlace(h)}s.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),s.addToRef(t,this.centerWorld).scaleInPlace(.5)}I.FromArrayToRef(e.m,0,n[0]),I.FromArrayToRef(e.m,4,n[1]),I.FromArrayToRef(e.m,8,n[2]),this._worldMatrix=e}isInFrustum(e){return rr.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){return rr.IsCompletelyInFrustum(this.vectorsWorld,e)}intersectsPoint(e){const t=this.minimumWorld,s=this.maximumWorld,n=t.x,a=t.y,l=t.z,u=s.x,h=s.y,f=s.z,m=e.x,p=e.y,b=e.z,v=-Ms;return!(u-m<v||v>m-n||h-p<v||v>p-a||f-b<v||v>b-l)}intersectsSphere(e){return rr.IntersectsSphere(this.minimumWorld,this.maximumWorld,e.centerWorld,e.radiusWorld)}intersectsMinMax(e,t){const s=this.minimumWorld,n=this.maximumWorld,a=s.x,l=s.y,u=s.z,h=n.x,f=n.y,m=n.z,p=e.x,b=e.y,v=e.z,R=t.x,x=t.y,T=t.z;return!(h<p||a>R||f<b||l>x||m<v||u>T)}dispose(){this._drawWrapperFront?.dispose(),this._drawWrapperBack?.dispose()}static Intersects(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,s,n){const a=rr._TmpVector3[0];return I.ClampToRef(s,e,t,a),I.DistanceSquared(s,a)<=n*n}static IsCompletelyInFrustum(e,t){for(let s=0;s<6;++s){const n=t[s];for(let a=0;a<8;++a)if(n.dotCoordinate(e[a])<0)return!1}return!0}static IsInFrustum(e,t){for(let s=0;s<6;++s){let n=!0;const a=t[s];for(let l=0;l<8;++l)if(a.dotCoordinate(e[l])>=0){n=!1;break}if(n)return!1}return!0}}rr._TmpVector3=Gr(3,I.Zero);class Ea{constructor(e,t,s){this.center=I.Zero(),this.centerWorld=I.Zero(),this.minimum=I.Zero(),this.maximum=I.Zero(),this.reConstruct(e,t,s)}reConstruct(e,t,s){this.minimum.copyFrom(e),this.maximum.copyFrom(t);const n=I.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=n*.5,this._update(s||ee.IdentityReadOnly)}scale(e){const t=Ea._TmpVector3,s=this.maximum.subtractToRef(this.minimum,t[0]),n=s.length();s.normalizeFromLength(n);const a=n*e,l=s.scaleInPlace(a*.5),u=this.center.subtractToRef(l,t[1]),h=this.center.addToRef(l,t[2]);return this.reConstruct(u,h,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){if(e.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{I.TransformCoordinatesToRef(this.center,e,this.centerWorld);const t=Ea._TmpVector3[0];I.TransformNormalFromFloatsToRef(1,1,1,e,t),this.radiusWorld=Math.max(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))*this.radius}}isInFrustum(e){const t=this.centerWorld,s=this.radiusWorld;for(let n=0;n<6;n++)if(e[n].dotCoordinate(t)<=-s)return!1;return!0}isCenterInFrustum(e){const t=this.centerWorld;for(let s=0;s<6;s++)if(e[s].dotCoordinate(t)<0)return!1;return!0}intersectsPoint(e){const t=I.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld<t)}static Intersects(e,t){const s=I.DistanceSquared(e.centerWorld,t.centerWorld),n=e.radiusWorld+t.radiusWorld;return!(n*n<s)}static CreateFromCenterAndRadius(e,t,s){this._TmpVector3[0].copyFrom(e),this._TmpVector3[1].copyFromFloats(0,0,t),this._TmpVector3[2].copyFrom(e),this._TmpVector3[0].addInPlace(this._TmpVector3[1]),this._TmpVector3[2].subtractInPlace(this._TmpVector3[1]);const n=new Ea(this._TmpVector3[0],this._TmpVector3[2]);return s?n._worldMatrix=s:n._worldMatrix=ee.Identity(),n}}Ea._TmpVector3=Gr(3,I.Zero);const dp={min:0,max:0},fp={min:0,max:0},wR=(i,e,t)=>{const s=I.Dot(e.centerWorld,i),n=Math.abs(I.Dot(e.directions[0],i))*e.extendSize.x,a=Math.abs(I.Dot(e.directions[1],i))*e.extendSize.y,l=Math.abs(I.Dot(e.directions[2],i))*e.extendSize.z,u=n+a+l;t.min=s-u,t.max=s+u},ii=(i,e,t)=>(wR(i,e,dp),wR(i,t,fp),!(dp.min>fp.max||fp.min>dp.max));class Sa{constructor(e,t,s){this._isLocked=!1,this.boundingBox=new rr(e,t,s),this.boundingSphere=new Ea(e,t,s)}reConstruct(e,t,s){this.boundingBox.reConstruct(e,t,s),this.boundingSphere.reConstruct(e,t,s)}get minimum(){return this.boundingBox.minimum}get maximum(){return this.boundingBox.maximum}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e}update(e){this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))}centerOn(e,t){const s=Sa._TmpVector3[0].copyFrom(e).subtractInPlace(t),n=Sa._TmpVector3[1].copyFrom(e).addInPlace(t);return this.boundingBox.reConstruct(s,n,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(s,n,this.boundingBox.getWorldMatrix()),this}encapsulate(e){const t=I.Minimize(this.minimum,e),s=I.Maximize(this.maximum,e);return this.reConstruct(t,s,this.boundingBox.getWorldMatrix()),this}encapsulateBoundingInfo(e){const t=We.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);const s=We.Vector3[0];return I.TransformCoordinatesToRef(e.boundingBox.minimumWorld,t,s),this.encapsulate(s),I.TransformCoordinatesToRef(e.boundingBox.maximumWorld,t,s),this.encapsulate(s),this}scale(e){return this.boundingBox.scale(e),this.boundingSphere.scale(e),this}isInFrustum(e,t=0){return(t===2||t===3)&&this.boundingSphere.isCenterInFrustum(e)?!0:this.boundingSphere.isInFrustum(e)?t===1||t===3?!0:this.boundingBox.isInFrustum(e):!1}get diagonalLength(){const e=this.boundingBox;return e.maximumWorld.subtractToRef(e.minimumWorld,Sa._TmpVector3[0]).length()}isCompletelyInFrustum(e){return this.boundingBox.isCompletelyInFrustum(e)}_checkCollision(e){return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)}intersectsPoint(e){return!(!this.boundingSphere.centerWorld||!this.boundingSphere.intersectsPoint(e)||!this.boundingBox.intersectsPoint(e))}intersects(e,t){if(!Ea.Intersects(this.boundingSphere,e.boundingSphere)||!rr.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;const s=this.boundingBox,n=e.boundingBox;return!(!ii(s.directions[0],s,n)||!ii(s.directions[1],s,n)||!ii(s.directions[2],s,n)||!ii(n.directions[0],s,n)||!ii(n.directions[1],s,n)||!ii(n.directions[2],s,n)||!ii(I.Cross(s.directions[0],n.directions[0]),s,n)||!ii(I.Cross(s.directions[0],n.directions[1]),s,n)||!ii(I.Cross(s.directions[0],n.directions[2]),s,n)||!ii(I.Cross(s.directions[1],n.directions[0]),s,n)||!ii(I.Cross(s.directions[1],n.directions[1]),s,n)||!ii(I.Cross(s.directions[1],n.directions[2]),s,n)||!ii(I.Cross(s.directions[2],n.directions[0]),s,n)||!ii(I.Cross(s.directions[2],n.directions[1]),s,n)||!ii(I.Cross(s.directions[2],n.directions[2]),s,n))}}Sa._TmpVector3=Gr(2,I.Zero);let LG=(()=>{var i;let e=[],t,s;return i=class{static extractMinAndMaxIndexed(a,l,u,h,f,m){for(let p=u;p<u+h;p++){const b=l[p]*3,v=a[b],R=a[b+1],x=a[b+2];f.minimizeInPlaceFromFloats(v,R,x),m.maximizeInPlaceFromFloats(v,R,x)}}static extractMinAndMax(a,l,u,h,f,m){for(let p=l,b=l*h;p<l+u;p++,b+=h){const v=a[b],R=a[b+1],x=a[b+2];f.minimizeInPlaceFromFloats(v,R,x),m.maximizeInPlaceFromFloats(v,R,x)}}},(()=>{const n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[em.filter((...a)=>!Array.isArray(a[0])&&!Array.isArray(a[1]))],s=[em.filter((...a)=>!Array.isArray(a[0]))],te(i,null,t,{kind:"method",name:"extractMinAndMaxIndexed",static:!0,private:!1,access:{has:a=>"extractMinAndMaxIndexed"in a,get:a=>a.extractMinAndMaxIndexed},metadata:n},null,e),te(i,null,s,{kind:"method",name:"extractMinAndMax",static:!0,private:!1,access:{has:a=>"extractMinAndMax"in a,get:a=>a.extractMinAndMax},metadata:n},null,e),n&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),j(i,e)})(),i})();function BG(i,e,t,s,n=null){const a=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l=new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return LG.extractMinAndMaxIndexed(i,e,t,s,a,l),n&&(a.x-=a.x*n.x+n.y,a.y-=a.y*n.x+n.y,a.z-=a.z*n.x+n.y,l.x+=l.x*n.x+n.y,l.y+=l.y*n.x+n.y,l.z+=l.z*n.x+n.y),{minimum:a,maximum:l}}class dg{static GetEffect(e){return e.getPipelineContext===void 0?e.effect:e}constructor(e,t=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=e.createDrawContext(),t&&(this.materialContext=e.createMaterialContext())}setEffect(e,t,s=!0){this.effect=e,t!==void 0&&(this.defines=t),s&&this.drawContext?.reset()}dispose(e=!1){if(this.effect){const t=this.effect;e?t.dispose():Vs.SetImmediate(()=>{t.getEngine().onEndFrameObservable.addOnce(()=>{t.dispose()})}),this.effect=null}this.drawContext?.dispose()}}var PR;class ko{get materialDefines(){const e=this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.defines:this._getDrawWrapper()?.defines;return typeof e=="string"?null:e}set materialDefines(e){const t=this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0);t.defines=e}_getDrawWrapper(e,t=!1){e=e??this._engine.currentRenderPassId;let s=this._drawWrappers[e];return!s&&t&&(this._drawWrappers[e]=s=new dg(this._mesh.getScene().getEngine())),s}_removeDrawWrapper(e,t=!0,s=!1){t&&this._drawWrappers[e]?.dispose(s),this._drawWrappers[e]=void 0}get effect(){return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.effect:this._getDrawWrapper()?.effect??null}get _drawWrapper(){return this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0)}get _drawWrapperOverride(){return this._mainDrawWrapperOverride}_setMainDrawWrapperOverride(e){this._mainDrawWrapperOverride=e}setEffect(e,t=null,s,n=!0){const a=this._drawWrapper;a.setEffect(e,t,n),s!==void 0&&(a.materialContext=s),e||(a.defines=null,a.materialContext=void 0)}resetDrawCache(e,t=!1){if(this._drawWrappers)if(e!==void 0){this._removeDrawWrapper(e,!0,t);return}else for(const s of this._drawWrappers)s?.dispose(t);this._drawWrappers=[]}static AddToMesh(e,t,s,n,a,l,u,h=!0){return new ko(e,t,s,n,a,l,u,h)}constructor(e,t,s,n,a,l,u,h=!0,f=!0){this.materialIndex=e,this.verticesStart=t,this.verticesCount=s,this.indexStart=n,this.indexCount=a,this._mainDrawWrapperOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._wasDispatched=!1,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=l,this._renderingMesh=u||l,f&&l.subMeshes.push(this),this._engine=this._mesh.getScene().getEngine(),this.resetDrawCache(),this._trianglePlanes=[],this._id=l.subMeshes.length-1,h&&(this.refreshBoundingInfo(),l.computeWorldMatrix(!0))}get IsGlobal(){return this.verticesStart===0&&this.verticesCount===this._mesh.getTotalVertices()&&this.indexStart===0&&this.indexCount===this._mesh.getTotalIndices()}getBoundingInfo(){return this.IsGlobal||this._mesh.hasThinInstances?this._mesh.getBoundingInfo():this._boundingInfo}setBoundingInfo(e){return this._boundingInfo=e,this}getMesh(){return this._mesh}getRenderingMesh(){return this._renderingMesh}getReplacementMesh(){return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null}getEffectiveMesh(){const e=this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null;return e||this._renderingMesh}getMaterial(e=!0){const t=this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId)??this._renderingMesh.material;if(t){if(this._isMultiMaterial(t)){const s=t.getSubMaterial(this.materialIndex);return this._currentMaterial!==s&&(this._currentMaterial=s,this.resetDrawCache()),s}}else return e&&this._mesh.getScene()._hasDefaultMaterial?this._mesh.getScene().defaultMaterial:null;return t}_isMultiMaterial(e){return e.getSubMaterial!==void 0}refreshBoundingInfo(e=null){if(this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(Ue.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;const t=this._renderingMesh.getIndices();let s;if(this.indexStart===0&&this.indexCount===t.length){const n=this._renderingMesh.getBoundingInfo();s={minimum:n.minimum.clone(),maximum:n.maximum.clone()}}else s=BG(e,t,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(s.minimum,s.maximum):this._boundingInfo=new Sa(s.minimum,s.maximum),this}_checkCollision(e){return this.getBoundingInfo()._checkCollision(e)}updateBoundingInfo(e){let t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this}isInFrustum(e){const t=this.getBoundingInfo();return t?t.isInFrustum(e,this._mesh.cullingStrategy):!1}isCompletelyInFrustum(e){const t=this.getBoundingInfo();return t?t.isCompletelyInFrustum(e):!1}render(e){return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this}_getLinesIndexBuffer(e,t){if(!this._linesIndexBuffer){const s=Math.floor(this.indexCount/3)*6,a=this.verticesStart+this.verticesCount>65535?new Uint32Array(s):new Uint16Array(s);let l=0;if(e.length===0)for(let u=this.indexStart;u<this.indexStart+this.indexCount;u+=3)a[l++]=u,a[l++]=u+1,a[l++]=u+1,a[l++]=u+2,a[l++]=u+2,a[l++]=u;else for(let u=this.indexStart;u<this.indexStart+this.indexCount;u+=3)a[l++]=e[u],a[l++]=e[u+1],a[l++]=e[u+1],a[l++]=e[u+2],a[l++]=e[u+2],a[l++]=e[u];this._linesIndexBuffer=t.createIndexBuffer(a),this._linesIndexCount=a.length}return this._linesIndexBuffer}canIntersects(e){const t=this.getBoundingInfo();return t?e.intersectsBox(t.boundingBox):!1}intersects(e,t,s,n,a){const l=this.getMaterial();if(!l)return null;let u=3,h=!1;switch(l.fillMode){case 3:case 5:case 6:case 8:return null;case 7:u=1,h=!0;break}return l.fillMode===4?s.length?this._intersectLines(e,t,s,this._mesh.intersectionThreshold,n):this._intersectUnIndexedLines(e,t,s,this._mesh.intersectionThreshold,n):!s.length&&this._mesh._unIndexed?this._intersectUnIndexedTriangles(e,t,s,n,a):this._intersectTriangles(e,t,s,u,h,n,a)}_intersectLines(e,t,s,n,a){let l=null;for(let u=this.indexStart;u<this.indexStart+this.indexCount;u+=2){const h=t[s[u]],f=t[s[u+1]],m=e.intersectionSegment(h,f,n);if(!(m<0)&&(a||!l||m<l.distance)&&(l=new MR(null,null,m),l.faceId=u/2,a))break}return l}_intersectUnIndexedLines(e,t,s,n,a){let l=null;for(let u=this.verticesStart;u<this.verticesStart+this.verticesCount;u+=2){const h=t[u],f=t[u+1],m=e.intersectionSegment(h,f,n);if(!(m<0)&&(a||!l||m<l.distance)&&(l=new MR(null,null,m),l.faceId=u/2,a))break}return l}_intersectTriangles(e,t,s,n,a,l,u){let h=null,f=-1;for(let m=this.indexStart;m<this.indexStart+this.indexCount-(3-n);m+=n){f++;const p=s[m],b=s[m+1],v=s[m+2];if(a&&v===4294967295){m+=2;continue}const R=t[p],x=t[b],T=t[v];if(!R||!x||!T||u&&!u(R,x,T,e,p,b,v))continue;const E=e.intersectsTriangle(R,x,T);if(E){if(E.distance<0)continue;if((l||!h||E.distance<h.distance)&&(h=E,h.faceId=f,l))break}}return h}_intersectUnIndexedTriangles(e,t,s,n,a){let l=null;for(let u=this.verticesStart;u<this.verticesStart+this.verticesCount;u+=3){const h=t[u],f=t[u+1],m=t[u+2];if(a&&!a(h,f,m,e,-1,-1,-1))continue;const p=e.intersectsTriangle(h,f,m);if(p){if(p.distance<0)continue;if((n||!l||p.distance<l.distance)&&(l=p,l.faceId=u/3,n))break}}return l}_rebuild(){this._linesIndexBuffer&&(this._linesIndexBuffer=null)}clone(e,t){const s=new ko(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,e,t,!1);if(!this.IsGlobal){const n=this.getBoundingInfo();if(!n)return s;s._boundingInfo=new Sa(n.minimum,n.maximum)}return s}dispose(e=!1){this._linesIndexBuffer&&(this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer),this._linesIndexBuffer=null);const t=this._mesh.subMeshes.indexOf(this);this._mesh.subMeshes.splice(t,1),this.resetDrawCache(void 0,e)}getClassName(){return"SubMesh"}static CreateFromIndices(e,t,s,n,a,l=!0){let u=Number.MAX_VALUE,h=-Number.MAX_VALUE;const m=(a||n).getIndices();for(let p=t;p<t+s;p++){const b=m[p];b<u&&(u=b),b>h&&(h=b)}return new ko(e,u,h-u+1,t,s,n,a,l)}}(PR=ko.prototype).projectToRef??(PR.projectToRef=tt("SubMesh","projectToRef"));class De{constructor(e,t,s=!1,n,a=!1,l){this._uniformNames=[],this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||a,this._dynamic=s,this._name=n??"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(l===void 0&&this._engine._features.trackUbosInFrame||l===!0)&&(this._buffers=[],this._bufferIndex=-1,this._bufferUpdatedLastFrame=!1,this._createBufferOnWrite=!1,this._currentFrameId=0,this._trackUBOsInFrame=!0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffe
472ct,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic}getData(){return this._bufferData}getBuffer(){return this._buffer}getUniformNames(){return this._uniformNames}_fillAlignment(e){let t;if(e<=2?t=e:t=4,this._uniformLocationPointer%t!==0){const s=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;const n=this._uniformLocationPointer-s;for(let a=0;a<n;a++)this._data.push(0)}}addUniform(e,t,s=0){if(s>0&&typeof t=="number"&&(this._uniformArraySizes[e]={strideSize:t,arraySize:s}),this._uniformLocations[e]!==void 0||(this._uniformNames.push(e),this._noUBO))return;let n;if(s>0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),t==16)t=t*s;else{const l=(4-t)*s;t=t*s+l}n=[];for(let a=0;a<t;a++)n.push(0)}else{if(t instanceof Array)n=t,t=n.length;else{n=[];for(let a=0;a<t;a++)n.push(0)}this._fillAlignment(t)}this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t;for(let a=0;a<t;a++)this._data.push(n[a]);this._needSync=!0}addMatrix(e,t){this.addUniform(e,Array.prototype.slice.call(t.asArray()))}addFloat2(e,t,s){const n=[t,s];this.addUniform(e,n)}addFloat3(e,t,s,n){const a=[t,s,n];this.addUniform(e,a)}addColor3(e,t){const s=[t.r,t.g,t.b];this.addUniform(e,s)}addColor4(e,t,s){const n=[t.r,t.g,t.b,s];this.addUniform(e,n)}addVector3(e,t){const s=[t.x,t.y,t.z];this.addUniform(e,s)}addMatrix3x3(e){this.addUniform(e,12)}addMatrix2x2(e){this.addUniform(e,8)}create(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNamesDebug(){const e=[];let t=0;for(const s in this._uniformLocations)if(e.push(s),++t===10)break;return e.join(",")}_rebuild(){this._noUBO||!this._bufferData||(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()):this._buffer=this._engine.createUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()),this._trackUBOsInFrame&&(this._buffers.push([this._buffer,this._engine._features.checkUbosContentBeforeUpload?this._bufferData.slice():void 0]),this._bufferIndex=this._buffers.length-1,this._createBufferOnWrite=!1))}_rebuildAfterContextLost(){this._trackUBOsInFrame&&(this._buffers=[],this._currentFrameId=0),this._rebuild()}get _numBuffers(){return this._buffers.length}get _indexBuffer(){return this._bufferIndex}get name(){return this._name}set name(e){this._name=e}get currentEffect(){return this._currentEffect}_buffersEqual(e,t){for(let s=0;s<e.length;++s)if(e[s]!==t[s])return!1;return!0}_copyBuffer(e,t){for(let s=0;s<e.length;++s)t[s]=e[s]}update(){if(!this._noUBO){if(this.bindUniformBuffer(),!this._buffer){this.create();return}if(!this._dynamic&&!this._needSync){this._createBufferOnWrite=this._trackUBOsInFrame;return}if(this._buffers&&this._buffers.length>1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._bufferUpdatedLastFrame=!0,this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame}}_createNewBuffer(){this._bufferIndex+1<this._buffers.length?(this._bufferIndex++,this._buffer=this._buffers[this._bufferIndex][
vendor: 4,061 bytes, line 472
4720],this._createBufferOnWrite=!1,this._needSync=!0):this._rebuild()}_checkNewFrame(){this._trackUBOsInFrame&&this._currentFrameId!==this._engine.frameId&&(this._currentFrameId=this._engine.frameId,this._createBufferOnWrite=!1,this._buffers&&this._buffers.length>0?(this._buffers.length===1?this._needSync=!this._bufferUpdatedLastFrame:this._needSync=this._bufferIndex!==0,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(e,t,s){this._checkNewFrame();let n=this._uniformLocations[e];if(n===void 0){if(this._buffer){Re.Error("Cannot add an uniform after UBO has been created. uniformName="+e);return}this.addUniform(e,s),n=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let a=0;a<s;a++)this._bufferData[n+a]=t[a];else{let a=!1;for(let l=0;l<s;l++)(s===16&&!this._engine._features.uniformBufferHardCheckMatrix||this._bufferData[n+l]!==Math.fround(t[l]))&&(a=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[n+l]=t[l]);this._needSync=this._needSync||a}}updateUniformArray(e,t,s){this._checkNewFrame();const n=this._uniformLocations[e];if(n===void 0){Re.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");return}this._buffer||this.create();const a=this._uniformArraySizes[e];if(this._dynamic)for(let l=0;l<s;l++)this._bufferData[n+l]=t[l];else{let l=!1,u=0,h=0;for(let f=0;f<s;f++)if(this._bufferData[n+h*4+u]!==ft.FloatRound(t[f])&&(l=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[n+h*4+u]=t[f]),u++,u===a.strideSize){for(;u<4;u++)this._bufferData[n+h*4+u]=0;u=0,h++}this._needSync=this._needSync||l}}_cacheMatrix(e,t){this._checkNewFrame();const s=this._valueCache[e],n=t.updateFlag;return s!==void 0&&s===n?!1:(this._valueCache[e]=n,!0)}_updateMatrix3x3ForUniform(e,t){for(let s=0;s<3;s++)De._TempBuffer[s*4]=t[s*3],De._TempBuffer[s*4+1]=t[s*3+1],De._TempBuffer[s*4+2]=t[s*3+2],De._TempBuffer[s*4+3]=0;this.updateUniform(e,De._TempBuffer,12)}_updateMatrix3x3ForEffect(e,t){this._currentEffect.setMatrix3x3(e,t)}_updateMatrix2x2ForEffect(e,t){this._currentEffect.setMatrix2x2(e,t)}_updateMatrix2x2ForUniform(e,t){for(let s=0;s<2;s++)De._TempBuffer[s*4]=t[s*2],De._TempBuffer[s*4+1]=t[s*2+1],De._TempBuffer[s*4+2]=0,De._TempBuffer[s*4+3]=0;this.updateUniform(e,De._TempBuffer,8)}_updateFloatForEffect(e,t,s=""){this._currentEffect.setFloat(e+s,t)}_updateFloatForUniform(e,t){De._TempBuffer[0]=t,this.updateUniform(e,De._TempBuffer,1)}_updateFloat2ForEffect(e,t,s,n=""){this._currentEffect.setFloat2(e+n,t,s)}_updateFloat2ForUniform(e,t,s){De._TempBuffer[0]=t,De._TempBuffer[1]=s,this.updateUniform(e,De._TempBuffer,2)}_updateFloat3ForEffect(e,t,s,n,a=""){this._currentEffect.setFloat3(e+a,t,s,n)}_updateFloat3ForUniform(e,t,s,n){De._TempBuffer[0]=t,De._TempBuffer[1]=s,De._TempBuffer[2]=n,this.updateUniform(e,De._TempBuffer,3)}_updateFloat4ForEffect(e,t,s,n,a,l=""){this._currentEffect.setFloat4(e+l,t,s,n,a)}_updateFloat4ForUniform(e,t,s,n,a){De._TempBuffer[0]=t,De._TempBuffer[1]=s,De._TempBuffer[2]=n,De._TempBuffer[3]=a,this.updateUniform(e,De._TempBuffer,4)}_updateFloatArrayForEffect(e,t,s=""){switch(this._uniformArraySizes[e]?.strideSize){case 2:this._currentEffect.setFloatArray2(e+s,t);break;case 3:this._currentEffect.setFloatArray3(e+s,t);break;case 4:this._currentEffect.setFloatArray4(e+s,t);break;default:this._currentEffect.setFloatArray(e+s,t);break}}_updateFloatArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateArrayForEffect(e,t){this._currentEffect.setArray(e,t)}_updateArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateIntArrayForEffect(e,t){this._currentEffect.setIntArray(e,t)}_updateIntArrayForUniform(e,t){De._TempBufferInt32View.set(t),this.updateUniformArray(e,De._TempBuffer,t.length)}_updateUIntArrayForEffect(e,t){this._currentEffect.setUIntArray(e,t)}_updateUIntArrayForUniform(e,t){De._TempBufferUInt32View.set(t),this.updateUniformArray(e,De._TempBuffer,t.length)}
472_updateMatrixForEffect(e,t){this._currentEffect.setMatrix(e,t)}_updateMatrixForUniform(e,t){this._cacheMatrix(e,t)&&this.updateUniform(e,t.asArray(),16)}_updateMatricesForEffect(e,t){this._currentEffect.setMatrices(e,t)}_updateMatricesForUniform(e,t){this.updateUniform(e,t,t.length)}_updateVector3ForEffect(e,t){this._currentEffect.setVector3(e,t)}_updateVector3ForUniform(e,t){De._TempBuffer[0]=t.x,De._TempBuffer[1]=t.y,De._TempBuffer[2]=t.z,this.updateUniform(e,De._TempBuffer,3)}_updateVector4ForEffect(e,t){this._currentEffect.setVector4(e,t)}_updateVector4ForUniform(e,t){De._TempBuffer[0]=t.x,De._TempBuffer[1]=t.y,De._TempBuffer[2]=t.z,De._TempBuffer[3]=t.w,this.updateUniform(e,De._TempBuffer,4)}_updateColor3ForEffect(e,t,s=""){this._currentEffect.setColor3(e+s,t)}_updateColor3ForUniform(e,t){De._TempBuffer[0]=t.r,De._TempBuffer[1]=t.g,De._TempBuffer[2]=t.b,this.updateUniform(e,De._TempBuffer,3)}_updateColor4ForEffect(e,t,s,n=""){this._currentEffect.setColor4(e+n,t,s)}_updateDirectColor4ForEffect(e,t,s=""){this._currentEffect.setDirectColor4(e+s,t)}_updateColor4ForUniform(e,t,s){De._TempBuffer[0]=t.r,De._TempBuffer[1]=t.g,De._TempBuffer[2]=t.b,De._TempBuffer[3]=s,this.updateUniform(e,De._TempBuffer,4)}_updateDirectColor4ForUniform(e,t){De._TempBuffer[0]=t.r,De._TempBuffer[1]=t.g,De._TempBuffer[2]=t.b,De._TempBuffer[3]=t.a,this.updateUniform(e,De._TempBuffer,4)}_updateIntForEffect(e,t,s=""){this._currentEffect.setInt(e+s,t)}_updateIntForUniform(e,t){De._TempBufferInt32View[0]=t,this.updateUniform(e,De._TempBuffer,1)}_updateInt2ForEffect(e,t,s,n=""){this._currentEffect.setInt2(e+n,t,s)}_updateInt2ForUniform(e,t,s){De._TempBufferInt32View[0]=t,De._TempBufferInt32View[1]=s,this.updateUniform(e,De._TempBuffer,2)}_updateInt3ForEffect(e,t,s,n,a=""){this._currentEffect.setInt3(e+a,t,s,n)}_updateInt3ForUniform(e,t,s,n){De._TempBufferInt32View[0]=t,De._TempBufferInt32View[1]=s,De._TempBufferInt32View[2]=n,this.updateUniform(e,De._TempBuffer,3)}_updateInt4ForEffect(e,t,s,n,a,l=""){this._currentEffect.setInt4(e+l,t,s,n,a)}_updateInt4ForUniform(e,t,s,n,a){De._TempBufferInt32View[0]=t,De._TempBufferInt32View[1]=s,De._TempBufferInt32View[2]=n,De._TempBufferInt32View[3]=a,this.updateUniform(e,De._TempBuffer,4)}_updateUIntForEffect(e,t,s=""){this._currentEffect.setUInt(e+s,t)}_updateUIntForUniform(e,t){De._TempBufferUInt32View[0]=t,this.updateUniform(e,De._TempBuffer,1)}_updateUInt2ForEffect(e,t,s,n=""){this._currentEffect.setUInt2(e+n,t,s)}_updateUInt2ForUniform(e,t,s){De._TempBufferUInt32View[0]=t,De._TempBufferUInt32View[1]=s,this.updateUniform(e,De._TempBuffer,2)}_updateUInt3ForEffect(e,t,s,n,a=""){this._currentEffect.setUInt3(e+a,t,s,n)}_updateUInt3ForUniform(e,t,s,n){De._TempBufferUInt32View[0]=t,De._TempBufferUInt32View[1]=s,De._TempBufferUInt32View[2]=n,this.updateUniform(e,De._TempBuffer,3)}_updateUInt4ForEffect(e,t,s,n,a,l=""){this._currentEffect.setUInt4(e+l,t,s,n,a)}_updateUInt4ForUniform(e,t,s,n,a){De._TempBufferUInt32View[0]=t,De._TempBufferUInt32View[1]=s,De._TempBufferUInt32View[2]=n,De._TempBufferUInt32View[3]=a,this.updateUniform(e,De._TempBuffer,4)}setTexture(e,t){this._currentEffect.setTexture(e,t)}setTextureArray(e,t){this._currentEffect.setTextureArray(e,t)}bindTexture(e,t){this._currentEffect._bindTexture(e,t)}updateUniformDirectly(e,t){this.updateUniform(e,t,t.length),this.update()}bindToEffect(e,t){this._currentEffect=e,this._currentEffectName=t}bindUniformBuffer(){!this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(e){if(!this._buffers)return this._buffer===e;for(let t=0;t<this._buffers.length;++t)if(this._buffers[t][0]===e)return this._bufferIndex=t,this._buffer=e,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[t][1]&&this._bufferData.set(this._buffers[t][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0;return!1}has(e){return this._uniformLocations[e]!==void 0}dispose(){if(this._noUBO)return;const e=this._engine._uniformBuffers,t=e.indexOf(this);if(t!==-1&&(e[t]=e[e.length-1],e.pop()),this._trackUBOsInFrame&&this._buffers)for(let s=0;s<this._buffers.length;++s){const n=this._buffers[s][0];this._engine._releaseBuffer(n)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}De._MAX_UNIFORM_SIZE=256;De._TempBuffer=new Float32Array(De._MAX_UNIFORM_SIZE);De._TempBufferInt32View=new Int32Array(De._TempBuffer.buffer);De._TempBufferUInt32View=new Uint32Array(De._TempBuffer.buffer);let NG=(()=>{var i;let e=[],t,s,n,a,l,u,h,f,m,p,b,v;return i=class{constructor(){this._func=j(this,e),this.reset()}reset(){this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=519,this.opStencilFail=7680,this.opDepthFail=7680,this.opStencilDepthPass=7681,this.backFunc=519,this.backOpStencilFail=7680,this.backOpDepthFail=7680,this.backOpStencilDepthPass=7681}get func(){return this._func}set func(x){this._func=x}get backFunc(){return this._backFunc}set backFunc(x){this._backFunc=x}get funcRef(){return this._funcRef}set funcRef(x){this._funcRef=x}get funcMask(){return this._funcMask}set funcMask(x){this._funcMask=x}get opStencilFail(){return this._opStencilFail}set opStencilFail(x){this._opStencilFail=x}get opDepthFail(){return this._opDepthFail}set opDepthFail(x){this._opDepthFail=x}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(x){this._opStencilDepthPass=x}get backOpStencilFail(){return this._backOpStencilFail}set backOpStencilFail(x){this._backOpStencilFail=x}get backOpDepthFail(){return this._backOpDepthFail}set backOpDepthFail(x){this._backOpDepthFail=x}get backOpStencilDepthPass(){return this._backOpStencilDepthPass}set backOpStencilDepthPass(x){this._backOpStencilDepthPass=x}get mask(){return this._mask}set mask(x){this._mask=x}get enabled(){return this._enabled}set enabled(x){this._enabled=x}getClassName(){return"MaterialStencilState"}copyTo(x){It.Clone(()=>x,this)}serialize(){return It.Serialize(this)}parse(x,T,E){It.Parse(()=>this,x,T,E)}},(()=>{const R=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[ne()],s=[ne()],n=[ne()],a=[ne()],l=[ne()],u=[ne()],h=[ne()],f=[ne()],m=[ne()],p=[ne()],b=[ne()],v=[ne()],te(i,null,t,{kind:"getter",name:"func",static:!1,private:!1,access:{has:x=>"func"in x,get:x=>x.func},metadata:R},null,e),te(i,null,s,{kind:"getter",name:"backFunc",static:!1,private:!1,access:{has:x=>"backFunc"in x,get:x=>x.backFunc},metadata:R}
vendor: 11,194 bytes, line 472
472,null,e),te(i,null,n,{kind:"getter",name:"funcRef",static:!1,private:!1,access:{has:x=>"funcRef"in x,get:x=>x.funcRef},metadata:R},null,e),te(i,null,a,{kind:"getter",name:"funcMask",static:!1,private:!1,access:{has:x=>"funcMask"in x,get:x=>x.funcMask},metadata:R},null,e),te(i,null,l,{kind:"getter",name:"opStencilFail",static:!1,private:!1,access:{has:x=>"opStencilFail"in x,get:x=>x.opStencilFail},metadata:R},null,e),te(i,null,u,{kind:"getter",name:"opDepthFail",static:!1,private:!1,access:{has:x=>"opDepthFail"in x,get:x=>x.opDepthFail},metadata:R},null,e),te(i,null,h,{kind:"getter",name:"opStencilDepthPass",static:!1,private:!1,access:{has:x=>"opStencilDepthPass"in x,get:x=>x.opStencilDepthPass},metadata:R},null,e),te(i,null,f,{kind:"getter",name:"backOpStencilFail",static:!1,private:!1,access:{has:x=>"backOpStencilFail"in x,get:x=>x.backOpStencilFail},metadata:R},null,e),te(i,null,m,{kind:"getter",name:"backOpDepthFail",static:!1,private:!1,access:{has:x=>"backOpDepthFail"in x,get:x=>x.backOpDepthFail},metadata:R},null,e),te(i,null,p,{kind:"getter",name:"backOpStencilDepthPass",static:!1,private:!1,access:{has:x=>"backOpStencilDepthPass"in x,get:x=>x.backOpStencilDepthPass},metadata:R},null,e),te(i,null,b,{kind:"getter",name:"mask",static:!1,private:!1,access:{has:x=>"mask"in x,get:x=>x.mask},metadata:R},null,e),te(i,null,v,{kind:"getter",name:"enabled",static:!1,private:!1,access:{has:x=>"enabled"in x,get:x=>x.enabled},metadata:R},null,e),R&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:R})})(),i})();class Us{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority}}Us.FALLOFF_DEFAULT=0;Us.FALLOFF_PHYSICAL=1;Us.FALLOFF_GLTF=2;Us.FALLOFF_STANDARD=3;Us.LIGHTMAP_DEFAULT=0;Us.LIGHTMAP_SPECULAR=1;Us.LIGHTMAP_SHADOWSONLY=2;Us.INTENSITYMODE_AUTOMATIC=0;Us.INTENSITYMODE_LUMINOUSPOWER=1;Us.INTENSITYMODE_LUMINOUSINTENSITY=2;Us.INTENSITYMODE_ILLUMINANCE=3;Us.INTENSITYMODE_LUMINANCE=4;Us.LIGHTTYPEID_POINTLIGHT=0;Us.LIGHTTYPEID_DIRECTIONALLIGHT=1;Us.LIGHTTYPEID_SPOTLIGHT=2;Us.LIGHTTYPEID_HEMISPHERICLIGHT=3;Us.LIGHTTYPEID_RECT_AREALIGHT=4;Us.LIGHTTYPEID_CLUSTERED_CONTAINER=5;const qi=new ee,En=new ee,Sn=new ee,Uh={getScene:()=>{},eyeAtCamera:!0};function pc(i,e,t){const s=t.asArray(),n=e.asArray();for(let a=0;a<16;a++)s[a]=n[a];return s[12]-=i.x,s[13]-=i.y,s[14]-=i.z,t.markAsUpdated(),t}function UG(i,e,t){return Dh(e,En),pc(i,En,Sn),Dh(Sn,t),t}function jh(i,e,t){if(!Uh.eyeAtCamera)return UG(i,e,t);const s=t.asArray(),n=e.asArray();for(let a=0;a<16;a++)s[a]=n[a];return s[12]=0,s[13]=0,s[14]=0,t.markAsUpdated(),t}function nm(i,e,t,s){return cc(jh(i,e,s),t,s),s}function OR(i,e,t,s){return Dh(t,En),cc(e,En,Sn),pc(i,Sn,En),jh(i,t,Sn),cc(En,Sn,s),s}function DR(i,e,t,s,n,a){return Dh(t,En),cc(e,En,Sn),pc(i,Sn,En),nm(i,s,n,Sn),cc(En,Sn,a),a}function IR(i,e){const t=Uh.getScene();if(!t||qi===e)return e;qi.updateFlag=e.updateFlag;const s=t.floatingOriginOffset;switch(i){case"world":return pc(s,e,qi);case"view":return jh(s,e,qi);case"worldView":return OR(s,e,t.getViewMatrix(),qi);case"viewProjection":return nm(s,t.getViewMatrix(),t.getProjectionMatrix(),qi);case"worldViewProjection":return DR(s,e,t.getTransformMatrix(),t.getViewMatrix(),t.getProjectionMatrix(),qi);default:if(i.startsWith("u_")){const n=i.toLowerCase();if(n.startsWith("u_worldviewprojection"))return DR(s,e,t.getTransformMatrix(),t.getViewMatrix(),t.getProjectionMatrix(),qi);if(n.startsWith("u_viewprojection"))return nm(s,t.getViewMatrix(),t.getProjectionMatrix(),qi);if(n.startsWith("u_worldview"))return OR(s,e,t.getViewMatrix(),qi);if(n.startsWith("u_world"))return pc(s,e,qi);if(n.startsWith("u_view"))return jh(s,e,qi)}return e}}const mc=De,rm=fs,DA=mc.prototype._updateMatrixForUniform,IA=fs.prototype.setMatrix;function jG(){fs.prototype.setMatrix=IA,rm._setMatrixOverride=void 0,mc.prototype._updateMatrixForUniform=DA,mc.prototype._updateMatrixForUniformOverride=void 0}function GG(){rm.prototype._setMatrixOverride=IA,rm.prototype.setMatrix=function(i,e){return this._setMatrixOverride(i,IR(i,e)),this},mc.prototype._updateMatrixForUniformOverride=DA,mc.prototype._updateMatrixForUniform=function(i,e){this._updateMatrixForUniformOverride(i,IR(i,e))}}function zG(i,e){e.bindToEffect(i,"Scene")}let Gh=(()=>{var i;let e=[],t,s=[],n=[],a,l=[],u=[],h,f=[],m=[],p,b=[],v=[],R,x=[],T=[],E,A=[],D=[],M,k=[],U=[],N,H=[],q=[],re,ce=[],ae=[],fe,_e=[],Te=[],z,J=[],Y=[],V,ge=[],L=[],B,X=[],Q=[],F,$=[],he=[],Ae,Oe=[],G=[],ie,de=[],Se=[],qe,Je=[],Ct=[],es,ps=[],Gt=[],Rs,ms=[],et=[],K,we=[],Ut=[],yt,wt=[],Ot=[],Yt,Ft=[],ns=[],rs,zt=[],Ne=[],rt,vt=[],$s=[],ti,js,Gs,li,Js=[],hs=[],st;return i=class{get useVertexPulling(){return this._useVertexPulling}set useVertexPulling(w){this._useVertexPulling!==w&&(this._useVertexPulling=w,this.markAsDirty(i.MiscDirtyFlag))}get _supportGlowLayer(){return!1}set _glowModeEnabled(w){}get shaderLanguage(){return this._shaderLanguage}get canRenderToMRT(){return!1}set alpha(w){if(this._alpha===w)return;const me=this._alpha;this._alpha=w,(me===1||w===1)&&this.markAsDirty(i.MiscDirtyFlag+i.PrePassDirtyFlag)}get alpha(){return this._alpha}set backFaceCulling(w){this._backFaceCulling!==w&&(this._backFaceCulling=w,this.markAsDirty(i.TextureDirtyFlag))}get backFaceCulling(){return this._backFaceCulling}set textureRepetitionMode(w){const me=Math.max(0,Math.min(w|0,4));this._textureRepetitionMode!==me&&(this._textureRepetitionMode=me,this.markAsDirty(i.TextureDirtyFlag))}get textureRepetitionMode(){return this._textureRepetitionMode}set cullBackFaces(w){this._cullBackFaces!==w&&(this._cullBackFaces=w,this.markAsDirty(i.TextureDirtyFlag))}get cullBackFaces(){return this._cullBackFaces}get blockDirtyMechanism(){return this._blockDirtyMechanism}set blockDirtyMechanism(w){this._blockDirtyMechanism!==w&&(this._blockDirtyMechanism=w,w||this.markDirty())}atomicMaterialsUpdate(w){this.blockDirtyMechanism=!0;try{w(this)}finally{this.blockDirtyMechanism=!1}}get hasRenderTargetTextures(){return this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._eventInfo.hasRenderTargetTextures}set onDispose(w){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(w)}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new xe),this._onBindObservable}set onBind(w){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(w)}get onUnBindObservable(){return this._onUnBindObservable||(this._onUnBindObservable=new xe),this._onUnBindObservable}get onEffectCreatedObservable(){return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new xe),this._onEffectCreatedObservable}set alphaMode(w){this._alphaMode[0]!==w&&(this._alphaMode[0]=w,this.markAsDirty(i.TextureDirtyFlag))}get alphaMode(){return this._alphaMode[0]}get alphaModes(){return this._alphaMode}setAlphaMode(w,me=0){this._alphaMode[me]!==w&&(this._alphaMode[me]=w,this.markAsDirty(i.TextureDirtyFlag))}set needDepthPrePass(w){this._needDepthPrePass!==w&&(this._needDepthPrePass=w,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))}get needDepthPrePass(){return this._needDepthPrePass}get isPrePassCapable(){return!1}set fogEnabled(w){this._fogEnabled!==w&&(this._fogEnabled=w,this.markAsDirty(i.MiscDirtyFlag))}get fogEnabled(){return this._fogEnabled}get wireframe(){switch(this._fillMode){case i.WireFrameFillMode:case i.LineListDrawMode:case i.LineLoopDrawMode:case i.LineStripDrawMode:return!0}return this._scene.forceWireframe}set wireframe(w){this.fillMode=w?i.WireFrameFillMode:i.TriangleFillMode}get pointsCloud(){switch(this._fillMode){case i.PointFillMode:case i.PointListDrawMode:return!0}return this._scene.forcePointsCloud}set pointsCloud(w){this.fillMode=w?i.PointFillMode:i.TriangleFillMode}get fillMode(){return this._fillMode}set fillMode(w){this._fillMode!==w&&(this._fillMode=w,this.markAsDirty(i.MiscDirtyFlag))}get useLogarithmicDepth(){return this._useLogarithmicDepth}set useLogarithmicDepth(w){const me=this.getScene().getEngine().getCaps().fragmentDepthSupported;w&&!me&&Re.Warn("Logarithmic depth has been requested for a material on a device that doesn't support it."),this._useLogarithmicDepth=w&&me,this._markAllSubMeshesAsMiscDirty()}get isVertexOutputInvariant(){return this._isVertexOutputInvariant}set isVertexOutputInvariant(w){this._isVertexOutputInvariant!==w&&(this._isVertexOutputInvariant=w,this._markAllSubMeshesAsMiscDirty())}_getDrawWrapper(){return this._drawWrapper}_setDrawWrapper(w){this._drawWrapper=w}constructor(w,me,lt,Pe=!1){this.customShaderNameResolve=j(this,e),this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this._shaderLanguage=0,this._forceGLSL=!1,this._useVertexPulling=!1,this.id=j(this,s,void 0),this.uniqueId=(j(this,n),j(this,l,void 0)),this._loadedUniqueId=j(this,u),this.name=j(this,f,void 0),this.metadata=(j(this,m),j(this,b,null)),this._internalMetadata=j(this,v),this.reservedDataStore=null,this.checkReadyOnEveryCall=j(this,x,!1),this.checkReadyOnlyOnce=(j(this,T),j(this,A,!1)),this.state=(j(this,D),j(this,k,"")),this._alpha=(j(this,U),j(this,H,1)),this.inspectableCustomProperties=j(this,q),this._backFaceCulling=j(this,ce,!0),this._textureRepetitionMode=(j(this,ae),j(this,_e,0)),this.textureRepetitionHexTilingParams=(j(this,Te),j(this,J,[1,.6,7,.5])),this._cullBackFaces=(j(this,Y),j(this,ge,!0)),this._blockDirtyMechanism=(j(this,L),!1),this.sideOrientation=j(this,X,null),this.onCompiled=(j(this,Q),null),this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new xe,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=j(this,$,[2]),this._needDepthPrePass=(j(this,he),j(this,Oe,!1)),this.disableDepthWrite=(j(this,G),j(this,de,!1)),this.disableColorWrite=(j(this,Se),j(this,Je,!1)),this.forceDepthWrite=(j(this,Ct),j(this,ps,!1)),this.depthFunction=(j(this,Gt),j(this,ms,0)),this.separateCullingPass=(j(this,et),j(this,we,!1)),this._fogEnabled=(j(this,Ut),j(this,wt,!0)),this.pointSize=(j(this,Ot),j(this,Ft,1)),this.zOffset=(j(this,ns),j(this,zt,0)),this.zOffsetUnits=(j(this,Ne),j(this,vt,0)),this.clipPlane=j(this,$s),this.stencil=new NG,this._isVertexOutputInvariant=j(this,Js,i.ForceVertexOutputInvariant),this._materialContext=j(this,hs),this._useUBO=!1,this._fillMode=i.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedColorWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this._parentContainer=null,this._uniformBufferLayoutBuilt=!1,this._eventInfo={},this._callbackPluginEventGeneric=()=>{},this._callbackPluginEventIsReadyForSubMesh=()=>{},this._callbackPluginEventPrepareDefines=()=>{},this._callbackPluginEventPrepareDefinesBeforeAttributes=()=>{},this._callbackPluginEventHardBindForSubMesh=()=>{},this._callbackPluginEventBindForSubMesh=()=>{},this._callbackPluginEventHasRenderTargetTextures=()=>{}
vendor: 8,756 bytes, line 472
472,this._callbackPluginEventFillRenderTargetTextures=()=>{},this._transparencyMode=null,this.name=w;const O=me||pt.LastCreatedScene;O&&(this._scene=O,this._dirtyCallbacks={},this._forceGLSL=Pe,this._dirtyCallbacks[1]=this._markAllSubMeshesAsTexturesDirty.bind(this),this._dirtyCallbacks[2]=this._markAllSubMeshesAsLightsDirty.bind(this),this._dirtyCallbacks[4]=this._markAllSubMeshesAsFresnelDirty.bind(this),this._dirtyCallbacks[8]=this._markAllSubMeshesAsAttributesDirty.bind(this),this._dirtyCallbacks[16]=this._markAllSubMeshesAsMiscDirty.bind(this),this._dirtyCallbacks[32]=this._markAllSubMeshesAsPrePassDirty.bind(this),this._dirtyCallbacks[127]=this._markAllSubMeshesAsAllDirty.bind(this),this.id=w||ft.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new dg(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._uniformBuffer=new De(this._scene.getEngine(),void 0,void 0,w),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,this._createUniformBuffer(),lt||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),i.OnEventObservable.notifyObservers(this,1))}_createUniformBuffer(){const w=this.getScene().getEngine();this._uniformBuffer?.dispose(),w.isWebGPU&&!this._forceGLSL?(this._uniformBuffer=new De(w,void 0,void 0,this.name,!0),this._shaderLanguage=1):this._uniformBuffer=new De(this._scene.getEngine(),void 0,void 0,this.name),this._uniformBufferLayoutBuilt=!1}toString(w){return"Name: "+this.name}getClassName(){return"Material"}get _isMaterial(){return!0}get isFrozen(){return this.checkReadyOnlyOnce}freeze(){this.markDirty(),this.checkReadyOnlyOnce=!0}unfreeze(){this.markDirty(),this.checkReadyOnlyOnce=!1}isReady(w,me){return!0}isReadyForSubMesh(w,me,lt){const Pe=me.materialDefines;return Pe?(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=Pe,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),this._eventInfo.isReadyForSubMesh):!1}getEffect(){return this._drawWrapper.effect}getScene(){return this._scene}_getEffectiveOrientation(w){return this.sideOrientation!==null?this.sideOrientation:w.sideOrientation}get transparencyMode(){return this._transparencyMode}set transparencyMode(w){this._transparencyMode!==w&&(this._transparencyMode=w,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _hasTransparencyMode(){return this._transparencyMode!=null}get _transparencyModeIsBlend(){return this._transparencyMode===i.MATERIAL_ALPHABLEND||this._transparencyMode===i.MATERIAL_ALPHATESTANDBLEND}get _transparencyModeIsTest(){return this._transparencyMode===i.MATERIAL_ALPHATEST||this._transparencyMode===i.MATERIAL_ALPHATESTANDBLEND}get _disableAlphaBlending(){return this._transparencyMode===i.MATERIAL_OPAQUE||this._transparencyMode===i.MATERIAL_ALPHATEST}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:this._disableAlphaBlending?!1:this.alpha<1}needAlphaBlendingForMesh(w){return this._hasTransparencyMode?this._transparencyModeIsBlend:w.visibility<1?!0:this._disableAlphaBlending?!1:w.hasVertexAlpha||this.needAlphaBlending()}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:!1}needAlphaTestingForMesh(w){return this._hasTransparencyMode?this._transparencyModeIsTest:!this.needAlphaBlendingForMesh(w)&&this.needAlphaTesting()}getAlphaTestTexture(){return null}markDirty(w=!1){const me=this.getScene().meshes;for(const lt of me)if(lt.subMeshes){for(const Pe of lt.subMeshes)if(Pe.getMaterial()===this)for(const O of Pe._drawWrappers)O&&this._materialContext===O.materialContext&&(O._wasPreviouslyReady=!1,O._wasPreviouslyUsingInstances=null,O._forceRebindOnNextCall=w)}w&&this.markAsDirty(i.AllDirtyFlag)}_preBind(w,me=null){const lt=this._scene.getEngine(),O=(me??this.sideOrientation)===i.ClockWiseSideOrientation,Ie=w||this._getDrawWrapper();return eA(Ie)&&Ie.materialContext&&(Ie.materialContext.useVertexPulling=this.useVertexPulling),lt.enableEffect(Ie),lt.setState(this.backFaceCulling,this.zOffset,!1,O,this._scene._mirroredCameraPosition?!this.cullBackFaces:this.cullBackFaces,this.stencil,this.zOffsetUnits),O}bind(w,me){}buildUniformLayout(){const w=this._uniformBuffer;this._eventInfo.ubo=w,this._callbackPluginEventGeneric(8,this._eventInfo),w.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(w,me,lt){const Pe=lt._drawWrapper;this._eventInfo.subMesh=lt,this._callbackPluginEventBindForSubMesh(this._eventInfo),Pe._forceRebindOnNextCall=!1}bindOnlyWorldMatrix(w){}bindView(w){this._useUBO?this._needToBindSceneUbo=!0:w.setMatrix("view",this.getScene().getViewMatrix())}bindViewProjection(w){this._useUBO?this._needToBindSceneUbo=!0:(w.setMatrix("viewProjection",this.getScene().getTransformMatrix()),w.setMatrix("projection",this.getScene().getProjectionMatrix()),w.setMatrix("inverseProjection",this.getScene().getInverseProjectionMatrix()))}bindEyePosition(w,me){this._useUBO?this._needToBindSceneUbo=!0:this._scene.bindEyePosition(w,me)}_afterBind(w,me=null,lt){if(this._scene._cachedMaterial=this,this._needToBindSceneUbo&&me&&(this._needToBindSceneUbo=!1,zG(me,this.getScene().getSceneUniformBuffer()),this._scene.finalizeSceneUbo()),w?this._scene._cachedVisibility=w.visibility:this._scene._cachedVisibility=1,this._onBindObservable&&w&&this._onBindObservable.notifyObservers(w),this.disableDepthWrite){const Pe=this._scene.getEngine();this._cachedDepthWriteState=Pe.getDepthWrite(),Pe.setDepthWrite(!1)}if(this.disableColorWrite){const Pe=this._scene.getEngine();this._cachedColorWriteState=Pe.getColorWrite(),Pe.setColorWrite(!1)}if(this.depthFunction!==0){const Pe=this._scene.getEngine();this._cachedDepthFunctionState=Pe.getDepthFunction()||0,Pe.setDepthFunction(this.depthFunction)}}unbind(){this._scene.getSceneUniformBuffer().unbindEffect(),this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),this.depthFunction!==0&&this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState),this.disableDepthWrite&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState),this.disableColorWrite&&this._scene.getEngine().setColorWrite(this._cachedColorWriteState)}getAnimatables(){return this._eventInfo.animatables=[],this._callbackPluginEventGeneric(256,this._eventInfo),this._eventInfo.animatables}getActiveTextures(){return this._eventInfo.activeTextures=[],this._callbackPluginEventGeneric(512,this._eventInfo),this._eventInfo.activeTextures}hasTexture(w){return this._eventInfo.hasTexture=!1,this._eventInfo.texture=w,this._callbackPluginEventGeneric(1024,this._eventInfo),this._eventInfo.hasTexture}clone(w){return null}_clonePlugins(w,me){const lt={};if(this._serializePlugins(lt),i._ParsePlugins(lt,w,this._scene,me),this.pluginManager)for(const Pe of this.pluginManager._plugins){const O=w.pluginManager.getPlugin(Pe.name);O&&Pe.copyTo(O)}}getBindedMeshes(){if(this.meshMap){const w=[];for(const me in this.meshMap){const lt=this.meshMap[me];lt&&w.push(lt)}return w}else return this._scene.meshes.filter(me=>me.material===this)}forceCompilation(w,me,lt,Pe){const O={clipPlane:!1,useInstances:!1,...lt},Ie=this.getScene(),Rt=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;const as=()=>{if(!this._scene||!this._scene.getEngine())return;const un=Ie.clipPlane;if(O.clipPlane&&(Ie.clipPlane=new sn(0,0,0,1)),this._storeEffectOnSubMeshes){let Ts=!0,vi=null;if(w.subMeshes){const Ri=new ko(0,0,0,0,0,w,void 0,!1,!1);Ri.materialDefines&&(Ri.materialDefines._renderId=-1),this.isReadyForSubMesh(w,Ri,O.useInstances)||(Ri.effect&&Ri.effect.getCompilationError()&&Ri.effect.allFallbacksProcessed()?vi=Ri.effect.getCompilationError():(Ts=!1,setTimeout(as,16)))}Ts&&(this.allowShaderHotSwapping=Rt,vi&&Pe&&Pe(vi),me&&me(this))}else this.isReady()?(this.allowShaderHotSwapping=Rt,me&&me(this)):setTimeout(as,16);O.clipPlane&&(Ie.clipPlane=un)};as()}async forceCompilationAsync(w,me){return await new Promise((lt,Pe)=>{this.forceCompilation(w,()=>{lt()},me,O=>{Pe(O)})})}markAsDirty(w){this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism||(i._DirtyCallbackArray.length=0,w&i.ImageProcessingDirtyFlag&&i._DirtyCallbackArray.push(i._ImageProcessingDirtyCallBack),w&i.TextureDirtyFlag&&i._DirtyCallbackArray.push(i._TextureDirtyCallBack),w&i.LightDirtyFlag&&i._DirtyCallbackArray.push(i._LightsDirtyCallBack),w&i.FresnelDirtyFlag&&i._DirtyCallbackArray.push(i._FresnelDirtyCallBack),w&i.AttributesDirtyFlag&&i._DirtyCallbackArray.push(i._AttributeDirtyCallBack),w&i.MiscDirtyFlag&&i._DirtyCallbackArray.push(i._MiscDirtyCallBack),w&i.PrePassDirtyFlag&&i._DirtyCallbackArray.push(i._PrePassDirtyCallBack),i._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(i._RunDirtyCallBacks),this.get
472Scene().resetCachedMaterial())}resetDrawCache(){const w=this.getScene().meshes;for(const me of w)if(me.subMeshes)for(const lt of me.subMeshes)lt.getMaterial()===this&&lt.resetDrawCache()}_markAllSubMeshesAsDirty(w){const me=this.getScene();if(me.blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const lt=me.meshes;for(const Pe of lt)if(Pe.subMeshes){for(const O of Pe.subMeshes)if((O.getMaterial()||(me._hasDefaultMaterial?me.defaultMaterial:null))===this)for(const Rt of O._drawWrappers)!Rt||!Rt.defines||!Rt.defines.markAllAsDirty||this._materialContext===Rt.materialContext&&w(Rt.defines)}}_markScenePrePassDirty(){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const w=this.getScene().enablePrePassRenderer();w&&w.markAsDirty()}_markAllSubMeshesAsAllDirty(){this._markAllSubMeshesAsDirty(i._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){this._markAllSubMeshesAsDirty(i._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){this._markAllSubMeshesAsDirty(i._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){this._markAllSubMeshesAsDirty(i._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){this._markAllSubMeshesAsDirty(i._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){this._markAllSubMeshesAsDirty(i._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){this._markAllSubMeshesAsDirty(i._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){this._markAllSubMeshesAsDirty(i._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){this._markAllSubMeshesAsDirty(i._PrePassDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){this._markAllSubMeshesAsDirty(i._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){if(this._scene.performancePriority!==0){this.checkReadyOnlyOnce=!0;const w=this._scene.onScenePerformancePriorityChangedObservable.addOnce(()=>{this.checkReadyOnlyOnce=!1});this.onDisposeObservable.add(()=>{this._scene.onScenePerformancePriorityChangedObservable.remove(w)})}}setPrePassRenderer(w){return!1}dispose(w,me,lt){const Pe=this.getScene();if(Pe.stopAnimation(this),Pe.freeProcessedMaterials(),Pe.removeMaterial(this),this._eventInfo.forceDisposeTextures=me,this._callbackPluginEventGeneric(2,this._eventInfo),this._parentContainer){const O=this._parentContainer.materials.indexOf(this);O>-1&&this._parentContainer.materials.splice(O,1),this._parentContainer=null}if(lt!==!0)if(this.meshMap)for(const O in this.meshMap){const Ie=this.meshMap[O];this._disposeMeshResources(Ie)}else{const O=Pe.meshes;for(const Ie of O)this._disposeMeshResources(Ie)}this._uniformBuffer.dispose(),this._drawWrapper.effect&&(this._storeEffectOnSubMeshes||this._drawWrapper.effect.dispose(),this._drawWrapper.effect=null),this.metadata=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear(),this._eventInfo&&(this._eventInfo={})}_disposeMeshResources(w){if(!w)return;const me=w.geometry,lt=w._internalAbstractMeshDataInfo._materialForRenderPass;if(this._storeEffectOnSubMeshes){if(w.subMeshes&&lt)for(const Pe of w.subMeshes){const O=Pe._drawWrappers;for(let Ie=0;Ie<O.length;Ie++){const Rt=O[Ie]?.effect;if(!Rt)continue;lt[Ie]===this&&(me?._releaseVertexArrayObject(Rt),Pe._removeDrawWrapper(Ie,!0,!0))}}}else me?._releaseVertexArrayObject(this._drawWrapper.effect);w.material===this&&!w.sourceMesh&&(w.material=null)}serialize(){const w=It.Serialize(this);return w.stencil=this.stencil.serialize(),w.uniqueId=this.uniqueId,this._serializePlugins(w),w}_serializePlugins(w){if(w.plugins={},this.pluginManager)for(const me of this.pluginManager._plugins)me.doNotSerialize||(w.plugins[me.getClassName()]=me.serialize())}static ParseAlphaMode(w,me){w._alphaMode!==void 0?me._alphaMode=Array.isArray(w._alphaMode)?[...w._alphaMode]:[w._alphaMode]:w.alphaMode!==void 0?me._alphaMode=Array.isArray(w.alphaMode)?[...w.alphaMode]:[w.alphaMode]:me._alphaMode=[2]}static Parse(w,me,lt){if(!w.customType)w.customType="BABYLON.StandardMaterial";else if(w.customType==="BABYLON.PBRMaterial"&&w.overloadedAlbedo&&(w.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return Re.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null;const O=ft.Instantiate(w.customType).Parse(w,me,lt);return O._loadedUniqueId=w.uniqueId,i.ParseAlphaMode(w,O),O}static _ParsePlugins(w,me,lt,Pe){if(w.plugins)for(const O in w.plugins){const Ie=w.plugins[O];let Rt=me.pluginManager?.getPlugin(Ie.name);if(!Rt){const as=ft.Instantiate("BABYLON."+O);as&&(Rt=new as(me))}Rt?.parse(Ie,lt,Pe)}}},(()=>{const ke=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[ne()],a=[ne()],h=[ne()],p=[ne()],R=[ne()],E=[ne()],M=[ne()],N=[ne("alpha")],re=[ne("backFaceCulling")],fe=[ne("textureRepetitionMode")],z=[ne("textureRepetitionHexTilingParams")],V=[ne("cullBackFaces")],B=[ne()],F=[ne()],Ae=[ne()],ie=[ne()],qe=[ne()],es=[ne()],Rs=[ne()],K=[ne()],yt=[ne("fogEnabled")],Yt=[ne()],rs=[ne()],rt=[ne()],ti=[ne()],js=[ne()],Gs=[ne()],li=[ne()],st=[ne()],te(i,null,ti,{kind:"getter",name:"pointsCloud",static:!1,private:!1,access:{has:w=>"pointsCloud"in w,get:w=>w.pointsCloud},metadata:ke}
472,null,e),te(i,null,js,{kind:"getter",name:"fillMode",static:!1,private:!1,access:{has:w=>"fillMode"in w,get:w=>w.fillMode},metadata:ke},null,e),te(i,null,Gs,{kind:"getter",name:"useLogarithmicDepth",static:!1,private:!1,access:{has:w=>"useLogarithmicDepth"in w,get:w=>w.useLogarithmicDepth},metadata:ke},null,e),te(i,null,st,{kind:"getter",name:"transparencyMode",static:!1,private:!1,access:{has:w=>"transparencyMode"in w,get:w=>w.transparencyMode},metadata:ke},null,e),te(null,null,t,{kind:"field",name:"id",static:!1,private:!1,access:{has:w=>"id"in w,get:w=>w.id,set:(w,me)=>{w.id=me}},metadata:ke},s,n),te(null,null,a,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:w=>"uniqueId"in w,get:w=>w.uniqueId,set:(w,me)=>{w.uniqueId=me}},metadata:ke},l,u),te(null,null,h,{kind:"field",name:"name",static:!1,private:!1,access:{has:w=>"name"in w,get:w=>w.name,set:(w,me)=>{w.name=me}},metadata:ke},f,m),te(null,null,p,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:w=>"metadata"in w,get:w=>w.metadata,set:(w,me)=>{w.metadata=me}},metadata:ke},b,v),te(null,null,R,{kind:"field",name:"checkReadyOnEveryCall",static:!1,private:!1,access:{has:w=>"checkReadyOnEveryCall"in w,get:w=>w.checkReadyOnEveryCall,set:(w,me)=>{w.checkReadyOnEveryCall=me}},metadata:ke},x,T),te(null,null,E,{kind:"field",name:"checkReadyOnlyOnce",static:!1,private:!1,access:{has:w=>"checkReadyOnlyOnce"in w,get:w=>w.checkReadyOnlyOnce,set:(w,me)=>{w.checkReadyOnlyOnce=me}},metadata:ke},A,D),te(null,null,M,{kind:"field",name:"state",static:!1,private:!1,access:{has:w=>"state"in w,get:w=>w.state,set:(w,me)=>{w.state=me}},metadata:ke},k,U),te(null,null,N,{kind:"field",name:"_alpha",static:!1,private:!1,access:{has:w=>"_alpha"in w,get:w=>w._alpha,set:(w,me)=>{w._alpha=me}},metadata:ke},H,q),te(null,null,re,{kind:"field",name:"_backFaceCulling",static:!1,private:!1,access:{has:w=>"_backFaceCulling"in w,get:w=>w._backFaceCulling,set:(w,me)=>{w._backFaceCulling=me}},metadata:ke},ce,ae),te(null,null,fe,{kind:"field",name:"_textureRepetitionMode",static:!1,private:!1,access:{has:w=>"_textureRepetitionMode"in w,get:w=>w._textureRepetitionMode,set:(w,me)=>{w._textureRepetitionMode=me}},metadata:ke},_e,Te),te(null,null,z,{kind:"field",name:"textureRepetitionHexTilingParams",static:!1,private:!1,access:{has:w=>"textureRepetitionHexTilingParams"in w,get:w=>w.textureRepetitionHexTilingParams,set:(w,me)=>{w.textureRepetitionHexTilingParams=me}},metadata:ke},J,Y),te(null,null,V,{kind:"field",name:"_cullBackFaces",static:!1,private:!1,access:{has:w=>"_cullBackFaces"in w,get:w=>w._cullBackFaces,set:(w,me)=>{w._cullBackFaces=me}},metadata:ke},ge,L),te(null,null,B,{kind:"field",name:"sideOrientation",static:!1,private:!1,access:{has:w=>"sideOrientation"in w,get:w=>w.sideOrientation,set:(w,me)=>{w.sideOrientation=me}},metadata:ke},X,Q),te(null,null,F,{kind:"field",name:"_alphaMode",static:!1,private:!1,access:{has:w=>"_alphaMode"in w,get:w=>w._alphaMode,set:(w,me)=>{w._alphaMode=me}},metadata:ke},$,he),te(null,null,Ae,{kind:"field",name:"_needDepthPrePass",static:!1,private:!1,access:{has:w=>"_needDepthPrePass"in w,get:w=>w._needDepthPrePass,set:(w,me)=>{w._needDepthPrePass=me}},metadata:ke},Oe,G),te(null,null,ie,{kind:"field",name:"disableDepthWrite",static:!1,private:!1,access:{has:w=>"disableDepthWrite"in w,get:w=>w.disableDepthWrite,set:(w,me)=>{w.disableDepthWrite=me}},metadata:ke},de,Se),te(null,null,qe,{kind:"field",name:"disableColorWrite",static:!1,private:!1,access:{has:w=>"disableColorWrite"in w,get:w=>w.disableColorWrite,set:(w,me)=>{w.disableColorWrite=me}},metadata:ke},Je,Ct),te(null,null,es,{kind:"field",name:"forceDepthWrite",static:!1,private:!1,access:{has:w=>"forceDepthWrite"in w,get:w=>w.forceDepthWrite,set:(w,me)=>{w.forceDepthWrite=me}},metadata:ke},ps,Gt),te(null,null,Rs,{kind:"field",name:"depthFunction",static:!1,private:!1,access:{has:w=>"depthFunction"in w,get:w=>w.depthFunction,set:(w,me)=>{w.depthFunction=me}},metadata:ke},ms,et),te(null,null,K,{kind:"field",name:"separateCullingPass",static:!1,private:!1,access:{has:w=>"separateCullingPass"in w,get:w=>w.separateCullingPass,set:(w,me)=>{w.separateCullingPass=me}},metadata:ke},we,Ut),te(null,null,yt,{kind:"field",name:"_fogEnabled",static:!1,private:!1,access:{has:w=>"_fogEnabled"in w,get:w=>w._fogEnabled,set:(w,me)=>{w._fogEnabled=me}},metadata:ke},wt,Ot),te(null,null,Yt,{kind:"field",name:"pointSize",static:!1,private:!1,access:{has:w=>"pointSize"in w,get:w=>w.pointSize,set:(w,me)=>{w.pointSize=me}},metadata:ke},Ft,ns),te(null,null,rs,{kind:"field",name:"zOffset",static:!1,private:!1,access:{has:w=>"zOffset"in w,get:w=>w.zOffset,set:(w,me)=>{w.zOffset=me}},metadata:ke},zt,Ne),te(null,null,rt,{kind:"field",name:"zOffsetUnits",static:!1,private:!1,access:{has:w=>"zOffsetUnits"in w,get:w=>w.zOffsetUnits,set:(w,me)=>{w.zOffsetUnits=me}},metadata:ke},vt,$s),te(null,null,li,{kind:"field",name:"_isVertexOutputInvariant",static:!1,private:!1,access:{has:w=>"_isVertexOutputInvariant"in w,get:w=>w._isVertexOutputInvariant,set:(w,me)=>{w._isVertexOutputInvariant=me}},metadata:ke}
472,Js,hs),ke&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ke})})(),i.TriangleFillMode=0,i.WireFrameFillMode=1,i.PointFillMode=2,i.PointListDrawMode=3,i.LineListDrawMode=4,i.LineLoopDrawMode=5,i.LineStripDrawMode=6,i.TriangleStripDrawMode=7,i.TriangleFanDrawMode=8,i.ClockWiseSideOrientation=0,i.CounterClockWiseSideOrientation=1,i.ImageProcessingDirtyFlag=64,i.TextureDirtyFlag=1,i.LightDirtyFlag=2,i.FresnelDirtyFlag=4,i.AttributesDirtyFlag=8,i.MiscDirtyFlag=16,i.PrePassDirtyFlag=32,i.AllDirtyFlag=127,i.MATERIAL_OPAQUE=0,i.MATERIAL_ALPHATEST=1,i.MATERIAL_ALPHABLEND=2,i.MATERIAL_ALPHATESTANDBLEND=3,i.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0,i.MATERIAL_NORMALBLENDMETHOD_RNM=1,i.LIGHTFALLOFF_PHYSICAL=0,i.LIGHTFALLOFF_GLTF=1,i.LIGHTFALLOFF_STANDARD=2,i.OnEventObservable=new xe,i.ForceVertexOutputInvariant=!1,i._AllDirtyCallBack=ke=>ke.markAllAsDirty(),i._ImageProcessingDirtyCallBack=ke=>ke.markAsImageProcessingDirty(),i._TextureDirtyCallBack=ke=>ke.markAsTexturesDirty(),i._FresnelDirtyCallBack=ke=>ke.markAsFresnelDirty(),i._MiscDirtyCallBack=ke=>ke.markAsMiscDirty(),i._PrePassDirtyCallBack=ke=>ke.markAsPrePassDirty(),i._LightsDirtyCallBack=ke=>ke.markAsLightDirty(),i._AttributeDirtyCallBack=ke=>ke.markAsAttributesDirty(),i._FresnelAndMiscDirtyCallBack=ke=>{i._FresnelDirtyCallBack(ke),i._MiscDirtyCallBack(ke)},i._TextureAndMiscDirtyCallBack=ke=>{i._TextureDirtyCallBack(ke),i._MiscDirtyCallBack(ke)},i._DirtyCallbackArray=[],i._RunDirtyCallBacks=ke=>{for(const w of i._DirtyCallbackArray)w(ke)},i})();Object.getOwnPropertyDescriptor(Gh.prototype,"pluginManager")||Object.defineProperty(Gh.prototype,"pluginManager",Jt("Material","pluginManager"));function FA(i,e,t=!1){const s=e.width,n=e.height;if(i instanceof Float32Array){let f=i.byteLength/i.BYTES_PER_ELEMENT;const m=new Uint8Array(f);for(;--f>=0;){let p=i[f];p<0?p=0:p>1&&(p=1),m[f]=p*255}i=m}const a=document.createElement("canvas");a.width=s,a.height=n;const l=a.getContext("2d");if(!l)return null;const u=l.createImageData(s,n);if(u.data.set(i),l.putImageData(u,0,0),t){const f=document.createElement("canvas");f.width=s,f.height=n;const m=f.getContext("2d");return m?(m.translate(0,n),m.scale(1,-1),m.drawImage(a,0,0),f.toDataURL("image/png")):null}return a.toDataURL("image/png")}function HG(i,e=0,t=0){const s=i.getInternalTexture();if(!s)return null;const n=i._readPixelsSync(e,t);return n?FA(n,i.getSize(),s.invertY):null}async function VG(i,e=0,t=0){const s=i.getInternalTexture();if(!s)return null;const n=await i.readPixels(e,t);return n?FA(n,i.getSize(),s.invertY):null}let gc=(()=>{var i;let e=dc,t=[],s,n=[],a=[],l,u=[],h=[],f,m=[],p=[],b,v=[],R=[],x,T=[],E=[],A,D=[],M=[],k,U=[],N=[],H,q=[],re=[],ce,ae=[],fe=[],_e,Te=[],z=[],J,Y=[],V=[],ge,L=[],B=[],X;return i=class extends e{static _CreateVideoTexture(F,$,he,Ae=!1,Oe=!1,G=i.TRILINEAR_SAMPLINGMODE,ie={},de,Se=5){throw bt("VideoTexture")}get noMipmap(){return this._noMipmap}get mimeType(){return this._mimeType}set isBlocking(F){this._isBlocking=F}get isBlocking(){return this._isBlocking}get invertY(){return this._invertY}constructor(F,$,he,Ae,Oe=i.TRILINEAR_SAMPLINGMODE,G=null,ie=null,de=null,Se=!1,qe,Je,Ct,es,ps){super($),this.url=(j(this,t),j(this,n,null)),this.uOffset=(j(this,a),j(this,u,0)),this.vOffset=(j(this,h),j(this,m,0)),this.uScale=(j(this,p),j(this,v,1)),this.vScale=(j(this,R),j(this,T,1)),this.uAng=(j(this,E),j(this,D,0)),this.vAng=(j(this,M),j(this,U,0)),this.wAng=(j(this,N),j(this,q,0)),this.uRotationCenter=(j(this,re),j(this,ae,.5)),this.vRotationCenter=(j(this,fe),j(this,Te,.5)),this.wRotationCenter=(j(this,z),j(this,Y,.5)),this.homogeneousRotationInUVTransform=(j(this,V),j(this,L,!1)),this.inspectableCustomProperties=(j(this,B),null),this._noMipmap=!1,this._invertY=!1,this._rowGenerationMatrix=null,this._cachedTextureMatrix=null,this._projectionModeMatrix=null,this._t0=null,this._t1=null,this._t2=null,this._cachedUOffset=-1,this._cachedVOffset=-1,this._cachedUScale=0,this._cachedVScale=0,this._cachedUAng=-1,this._cachedVAng=-1,this._cachedWAng=-1,this._cachedReflectionProjectionMatrixId=-1,this._cachedURotationCenter=-1,this._cachedVRotationCenter=-1,this._cachedWRotationCenter=-1,this._cachedHomogeneousRotationInUVTransform=!1,this._cachedIdentity3x2=!0,this._cachedReflectionTextureMatrix=null,this._cachedReflectionUOffset=-1,this._cachedReflectionVOffset=-1,this._cachedReflectionUScale=0,this._cachedReflectionVScale=0,this._cachedReflectionCoordinatesMode=-1,this._buffer=null,this._deleteBuffer=!1,this._format=null,this._delayedOnLoad=null,this._delayedOnError=null,this.onLoadObservable=new xe,this._isBlocking=!0,this.name=F||"",this.url=F;let Gt,Rs=!1,ms=null,et=!0;typeof he=="object"&&he!==null?(Gt=he.noMipmap??!1,Ae=he.invertY??!0,Oe=he.samplingMode??i.TRILINEAR_SAMPLINGMODE,G=he.onLoad??null,ie=he.onError??null,de=he.buffer??null,Se=he.deleteBuffer??!1,qe=he.format,Je=he.mimeType,Ct=he.loaderOptions,es=he.creationFlags,Rs=he.useSRGBBuffer??!1,ms=he.internalTexture??null,et=he.gammaSpace??et,ps=he.forcedExtension??ps):Gt=!!he,this._gammaSpace=et,this._noMipmap=Gt,this._invertY=Ae===void 0?!0:Ae,this._initialSamplingMode=Oe,this._buffer=de,this._deleteBuffer=Se,this._mimeType=Je,this._loaderOptions=Ct,this._creationFlags=es,this._useSRGBBuffer=Rs,this._forcedExtension=ps,qe!==void 0&&(this._format=qe);const K=this.getScene(),we=this._getEngine();if(!we)return;we.onBeforeTextureInitObservable.notifyObservers(this);const Ut=()=>{this._texture&&(this._texture._invertVScale&&(this.vScale*=-1,this.vOffset+=1),this._texture._cachedWrapU!==null&&(this.wrapU=this._texture._cachedWrapU,this._texture._cachedWrapU=null),this._texture._cachedWrapV!==null&&(this.wrapV=this._texture._cachedWrapV,this._texture._cachedWrapV=null),this._texture._cachedWrapR!==null&&(this.wrapR=this._texture._cachedWrapR,this._texture._cachedWrapR=null)),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),G&&G(),!this.isBlocking&&K&&K.resetCachedMaterial()},yt=(wt,Ot)=>{this._loadingError=!0,this._errorObject={message:wt,exception:Ot},ie&&ie(wt,Ot),i.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!ms){this._delayedOnLoad=Ut,this._delayedOnError=yt;return}if(this._texture=ms??this._getFromCache(this.url,Gt,Oe,this._invertY,Rs,this.isCube),this._texture)if(this._texture.isReady)Vs.SetImmediate(()=>Ut());else{const wt=this._texture.onLoadedObservable.add(Ut);this._texture.onErrorObservable.add(Ot=>{yt(Ot.message,Ot.exception),this._texture?.onLoadedObservable.remove(wt)})}else if(!K||!K.useDelayedTextureLoading){try{this._texture=we.createTexture(this.url,Gt,this._invertY,K,Oe,Ut,yt,this._buffer,void 0,this._format,this._forcedExtension,Je,Ct,es,Rs)}catch(wt){throw yt("error loading",wt),wt}Se&&(this._buffer=null)}else this.delayLoadState=4,this._delayedOnLoad=Ut,this._delayedOnError=yt}updateURL(F,$=null,he,Ae){this.url&&(this.releaseInternalTexture(),this.get
vendor: 13,332 bytes, line 472
472Scene().markAllMaterialsAsDirty(1,ie=>ie.hasTexture(this))),(!this.name||this.name.startsWith("data:"))&&(this.name=F),this.url=F,this._buffer=$,this._forcedExtension=Ae,this.delayLoadState=4;const Oe=this._delayedOnLoad,G=()=>{Oe?Oe():this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),he&&he()};this._delayedOnLoad=G,this.delayLoad()}delayLoad(){if(this.delayLoadState!==4)return;const F=this.getScene();if(!F)return;let $=this.url;!$&&(this.name.indexOf("://")>0||this.name.startsWith("data:"))&&($=this.name),this.delayLoadState=1,this._texture=this._getFromCache($,this._noMipmap,this.samplingMode,this._invertY,this._useSRGBBuffer,this.isCube),this._texture?this._delayedOnLoad&&(this._texture.isReady?Vs.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=F.getEngine().createTexture($,this._noMipmap,this._invertY,F,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,this._forcedExtension,this._mimeType,this._loaderOptions,this._creationFlags,this._useSRGBBuffer),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null}_prepareRowForTextureGeneration(F,$,he,Ae){F*=this._cachedUScale,$*=this._cachedVScale,F-=this.uRotationCenter*this._cachedUScale,$-=this.vRotationCenter*this._cachedVScale,he-=this.wRotationCenter,I.TransformCoordinatesFromFloatsToRef(F,$,he,this._rowGenerationMatrix,Ae),Ae.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,Ae.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,Ae.z+=this.wRotationCenter}getTextureMatrix(F=1){if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*F===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*F,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,(!this._cachedTextureMatrix||!this._rowGenerationMatrix)&&(this._cachedTextureMatrix=ee.Zero(),this._rowGenerationMatrix=new ee,this._t0=I.Zero(),this._t1=I.Zero(),this._t2=I.Zero()),ee.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(ee.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,We.Matrix[0]),ee.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,We.Matrix[1]),ee.ScalingToRef(this._cachedUScale,this._cachedVScale,0,We.Matrix[2]),ee.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,We.Matrix[3]),We.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(We.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(We.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(We.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),ee.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));const $=this.getScene();if(!$)return this._cachedTextureMatrix;const he=this._cachedIdentity3x2;return this._cachedIdentity3x2=this._cachedTextureMatrix.isIdentityAs3x2(),this.optimizeUVAllocation&&he!==this._cachedIdentity3x2&&$.markAllMaterialsAsDirty(1,Ae=>Ae.hasTexture(this)),this._cachedTextureMatrix}getReflectionTextureMatrix(){const F=this.getScene();if(!F)return this._cachedReflectionTextureMatrix;if(this.uOffset===this._cachedReflectionUOffset&&this.vOffset===this._cachedReflectionVOffset&&this.uScale===this._cachedReflectionUScale&&this.vScale===this._cachedReflectionVScale&&this.coordinatesMode===this._cachedReflectionCoordinatesMode)if(this.coordinatesMode===i.PROJECTION_MODE){if(this._cachedReflectionProjectionMatrixId===F.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}else return this._cachedReflectionTextureMatrix;this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=ee.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=ee.Zero());const $=this._cachedReflectionCoordinatesMode!==this.coordinatesMode;switch(this._cachedReflectionUOffset=this.uOffset,this._cachedReflectionVOffset=this.vOffset,this._cachedReflectionUScale=this.uScale,this._cachedReflectionVScale=this.vScale,this._cachedReflectionCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case i.PLANAR_MODE:{ee.IdentityToRef(this._cachedReflectionTextureMatrix),this._cachedReflectionTextureMatrix[0]=this.uScale,this._cachedReflectionTextureMatrix[5]=this.vScale,this._cachedReflectionTextureMatrix[12]=this.uOffset,this._cachedReflectionTextureMatrix[13]=this.vOffset;break}case i.PROJECTION_MODE:{ee.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);const he=F.getProjectionMatrix();this._cachedReflectionProjectionMatrixId=he.updateFlag,he.multiplyToRef(this._projectionModeMatrix,this._cachedReflectionTextureMatrix);break}default:ee.IdentityToRef(this._cachedReflectionTextureMatrix);break}return $&&F.markAllMaterialsAsDirty(1,he=>he.hasTexture(this)),this._cachedReflectionTextureMatrix}clone(){const F={noMipmap:this._noMipmap,invertY:this._invertY,samplingMode:this.samplingMode,onLoad:void 0,onError:void 0,buffer:this._texture?this._texture._buffer:void 0,deleteBuffer:this._deleteBuffer,format:this.textureFormat,mimeType:this.mimeType,loaderOptions:this._loaderOptions,creationFlags:this._creationFlags,useSRGBBuffer:this._useSRGBBuffer};return It.Clone(()=>new i(this._texture?this._texture.url:null,this.getScene(),F),this)}serialize(){const F=this.name;i.SerializeBuffers||this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");const $=super.serialize(i._SerializeInternalTextureUniqueId);if(!$)return null;if(i.SerializeBuffers||i.ForceSerializeBuffers)if(typeof this._buffer=="string"&&this._buffer.startsWith("data:"))$.base64String=this._buffer,$.name=$.name.replace("data:","");else if(this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array){const he=this.mimeType||"image/png";$.base64String=`data:${he};base64,${gA(this._buffer)}`}else(i.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&($.base64String=!this._engine||this._engine._features.supportSyncTextureRead?HG(this):VG(this));return $.invertY=this._invertY,$.samplingMode=this.samplingMode,$._creationFlags=this._creationFlags,$._useSRGBBuffer=this._useSRGBBuffer,i._SerializeInternalTextureUniqueId&&($.internalTextureUniqueId=this._texture?.uniqueId),$.internalTextureLabel=this._texture?.label,$.noMipmap=this._noMipmap,this.name=F,$}getClassName(){return"Texture"}dispose(){super.dispose(),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null,this._buffer=null}static Parse(F,$,he){if(F.customType){const Se=Ql.Instantiate(F.customType).Parse(F,$,he);return F.samplingMode&&Se.updateSamplingMode&&Se._samplingMode&&Se._samplingMode!==F.samplingMode&&Se.updateSamplingMode(F.samplingMode),Se}if(F.isCube&&!F.isRenderTarget)return i._CubeTextureParser(F,$,he);const Ae=F.internalTextureUniqueId!==void 0;if(!F.name&&!F.isRenderTarget&&!Ae)return null;let Oe;if(Ae){const de=$.getEngine().getLoadedTexturesCache();for(const Se of de)if(Se.uniqueId===F.internalTextureUniqueId){Oe=Se;break}}const G=de=>{if(de&&de._texture&&(de._texture._cachedWrapU=null,de._texture._cachedWrapV=null,de._texture._cachedWrapR=null),F.samplingMode){const Se=F.samplingMode;de&&de.samplingMode!==Se&&de.updateSamplingMode(Se)}if(de&&F.animations)for(let Se=0;Se<F.animations.length;Se++){const qe=F.animations[Se],Je=hA("BABYLON.Animation");Je&&de.animations.push(Je.Parse(qe))}de&&de._texture&&(Ae&&!Oe&&de._texture._setUniqueId(F.internalTextureUniqueId),de._texture.label=F.internalTextureLabel)};return It.Parse(()=>{let de=!0;if(F.noMipmap&&(de=!1),F.mirrorPlane){const Se=i._CreateMirror(F.name,F.renderTargetSize,$,de);return Se._waitingRenderList=F.renderList,Se.mirrorPlane=sn.FromArray(F.mirrorPlane),G(Se),Se}else if(F.isRenderTarget&&!F.base64String){let Se=null;if(F.isCube){if($.reflectionProbes)for(let qe=0;qe<$.reflectionProbes.length;qe++){const Je=$.reflectionProbes[qe];if(Je.name===F.name)return Je.cubeTexture}}else Se=i._CreateRenderTargetTexture(F.name,F.renderTargetSize,$,de,F._creationFlags??0),Se._waitingRenderList=F.renderList;return G(Se),Se}else if(F.isVideo){const Se=i._CreateVideoTexture(he+(F.url||F.name),he+(F.src||F.url),$,de,F.invertY,F.samplingMode,F.settings||{});return G(Se),Se}else{let Se;if(typeof F.base64String=="string"&&F.base64String&&!Oe){const qe={buffer:F.base64String,noMipmap:!de,invertY:F.invertY,samplingMode:F.samplingMode,useSRGBBuffer:F._useSRGBBuffer??!1,creationFlags:F._creationFlags??0,onLoad:()=>{G(Se)}},Je=F.base64String,Ct=Je.startsWith("data:")?Je.substring(5):Je;Se=i.CreateFromBase64String("",Ct,$,qe),Se.name=F.name}else{let qe;F.name&&(F.name.indexOf("://")>0||F.name.startsWith("data:"))?qe=F.name:qe=he+F.name,F.url&&(F.url.startsWith("data:")||i.UseSerializedUrlIfAny)&&(qe=F.url);const Je={noMipmap:!de,invertY:F.invertY,samplingMode:F.samplingMode,useSRGBBuffer:F._useSRGBBuffer??!1,creationFlags:F._creationFlags??0,onLoad:()=>{G(Se)},internalTexture:Oe};Se=new i(qe,$,Je)}return Se}},F,$)}static CreateFromBase64String(F,$,he,Ae,Oe,G=i.TRILINEAR_SAMPLINGMODE,ie=null,de=null,Se=5,qe,Je){return new i("data:"+$,he,Ae,Oe,G,ie,de,F,!1,Se,void 0,void 0,qe,Je)}static LoadFromDataString(F,$,he,Ae=!1,Oe,G=!0,ie=i.TRILINEAR_SAMPLINGMODE,de=null,Se=null,qe=5,Je,Ct){return F.substring(0,5)!=="data:"&&(F="data:"+F),new i(F,he,Oe,G,ie,de,Se,$,Ae,qe,void 0,void 0,Je,Ct)}},(()=>{const Q=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;s=[ne()],l=[ne()],f=[ne()],b=[ne()],x=[ne()],A=[ne()],k=[ne()],H=[ne()],ce=[ne()],_e=[ne()],J=[ne()],ge=[ne()],X=[ne()],te(i,null,X,{kind:"getter",name:"isBlocking",static:!1,private:!1,access:{has:F=>"isBlocking"in F,get:F=>F.isBlocking},metadata:Q},null,t),te(null,null,s,{kind:"field",name:"url",static:!1,private:!1,access:{has:F=>"url"in F,get:F=>F.url,set:(F,$)=>{F.url=$}},metadata:Q},n,a),te(null,null,l,{kind:"field",name:"uOffset",static:!1,private:!1,access:{has:F=>"uOffset"in F,get:F=>F.uOffset,set:(F,$)=>{F.uOffset=$}},metadata:Q},u,h),te(null,null,f,{kind:"field",name:"vOffset",static:!1,private:!1,access:{has:F=>"vOffset"in F,get:F=>F.vOffset,set:(F,$)=>{F.vOffset=$}},metadata:Q},m,p),te(null,null,b,{kind:"field",name:"uScale",static:!1,private:!1,access:{has:F=>"uScale"in F,get:F=>F.uScale,set:(F,$)=>{F.uScale=$}},metadata:Q},v,R),te(null,null,x,{kind:"field",name:"vScale",static:!1,private:!1,access:{has:F=>"vScale"in F,get:F=>F.vScale,set:(F,$)=>{F.vScale=$}},metadata:Q},T,E),te(null,null,A,{kind:"field",name:"uAng",static:!1,private:!1,access:{has:F=>"uAng"in F,get:F=>F.uAng,set:(F,$)=>{F.uAng=$}},metadata:Q},D,M),te(null,null,k,{kind:"field",name:"vAng",static:!1,private:!1,access:{has:F=>"vAng"in F,get:F=>F.vAng,set:(F,$)=>{F.vAng=$}},metadata:Q},U,N),te(null,null,H,{kind:"field",name:"wAng",static:!1,private:!1,access:{has:F=>"wAng"in F,get:F=>F.wAng,set:(F,$)=>{F.wAng=$}},metadata:Q},q,re),te(null,null,ce,{kind:"field",name:"uRotationCenter",static:!1,private:!1,access:{has:F=>"uRotationCenter"in F,get:F=>F.uRotationCenter,set:(F,$)=>{F.uRotationCenter=$}},metadata:Q},ae,fe),te(null,null,_e,{kind:"field",name:"vRotationCenter",static:!1,private:!1,access:{has:F=>"vRotationCenter"in F,get:F=>F.vRotationCenter,set:(F,$)=>{F.vRotationCenter=$}},metadata:Q},Te,z),te(null,null,J,{kind:"field",name:"wRotationCenter",static:!1,private:!1,access:{has:F=>"wRotationCenter"in F,get:F=>F.wRotationCenter,set:(F,$)=>{F.wRotationCenter=$}},metadata:Q},Y,V),te(null,null,ge,{kind:"field",name:"homogeneousRotationInUVTransform",static:!1,private:!1,access:{has:F=>"homogeneousRotationInUVTransform"in F,get:F=>F.homogeneousRotationInUVTransform,set:(F,$)=>{F.homogeneousRotationInUVTransform=$}},metadata:Q},L,B),Q&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Q})})(),i.SerializeBuffers=!0,i.ForceSerializeBuffers=!1,i.OnTextureLoadErrorObservable=new xe,i._Seri
472alizeInternalTextureUniqueId=!1,i._CubeTextureParser=(Q,F,$)=>{throw bt("CubeTexture")},i._CreateMirror=(Q,F,$,he)=>{throw bt("MirrorTexture")},i._CreateRenderTargetTexture=(Q,F,$,he,Ae)=>{throw bt("RenderTargetTexture")},i.NEAREST_SAMPLINGMODE=1,i.NEAREST_NEAREST_MIPLINEAR=8,i.BILINEAR_SAMPLINGMODE=2,i.LINEAR_LINEAR_MIPNEAREST=11,i.TRILINEAR_SAMPLINGMODE=3,i.LINEAR_LINEAR_MIPLINEAR=3,i.NEAREST_NEAREST_MIPNEAREST=4,i.NEAREST_LINEAR_MIPNEAREST=5,i.NEAREST_LINEAR_MIPLINEAR=6,i.NEAREST_LINEAR=7,i.NEAREST_NEAREST=1,i.LINEAR_NEAREST_MIPNEAREST=9,i.LINEAR_NEAREST_MIPLINEAR=10,i.LINEAR_LINEAR=2,i.LINEAR_NEAREST=12,i.EXPLICIT_MODE=0,i.SPHERICAL_MODE=1,i.PLANAR_MODE=2,i.CUBIC_MODE=3,i.PROJECTION_MODE=4,i.SKYBOX_MODE=5,i.INVCUBIC_MODE=6,i.EQUIRECTANGULAR_MODE=7,i.FIXED_EQUIRECTANGULAR_MODE=8,i.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,i.CLAMP_ADDRESSMODE=0,i.WRAP_ADDRESSMODE=1,i.MIRROR_ADDRESSMODE=2,i.UseSerializedUrlIfAny=!1,i})(),FR=!1;function XG(){FR||(FR=!0,ar("BABYLON.Texture",gc),It._TextureParser=gc.Parse)}class ze{}ze.NAME_EFFECTLAYER="EffectLayer";ze.NAME_LAYER="Layer";ze.NAME_LENSFLARESYSTEM="LensFlareSystem";ze.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer";ze.NAME_PARTICLESYSTEM="ParticleSystem";ze.NAME_GAMEPAD="Gamepad";ze.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue";ze.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer";ze.NAME_PREPASSRENDERER="PrePassRenderer";ze.NAME_DEPTHRENDERER="DepthRenderer";ze.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer";ze.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager";ze.NAME_SPRITE="Sprite";ze.NAME_SUBSURFACE="SubSurface";ze.NAME_OUTLINERENDERER="Outline";ze.NAME_PROCEDURALTEXTURE="ProceduralTexture";ze.NAME_SHADOWGENERATOR="ShadowGenerator";ze.NAME_OCTREE="Octree";ze.NAME_PHYSICSENGINE="PhysicsEngine";ze.NAME_AUDIO="Audio";ze.NAME_FLUIDRENDERER="FluidRenderer";ze.NAME_IBLCDFGENERATOR="iblCDFGenerator";ze.NAME_CLUSTEREDLIGHTING="ClusteredLighting";ze.STEP_ISREADYFORMESH_EFFECTLAYER=0;ze.STEP_ISREADYFORMESH_DEPTHRENDERER=1;ze.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0;ze.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0;ze.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0;ze.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1;ze.STEP_BEFORECAMERADRAW_PREPASS=0;ze.STEP_BEFORECAMERADRAW_EFFECTLAYER=1;ze.STEP_BEFORECAMERADRAW_LAYER=2;ze.STEP_BEFORERENDERTARGETDRAW_PREPASS=0;ze.STEP_BEFORERENDERTARGETDRAW_LAYER=1;ze.STEP_BEFORERENDERINGMESH_PREPASS=0;ze.STEP_BEFORERENDERINGMESH_OUTLINE=1;ze.STEP_AFTERRENDERINGMESH_PREPASS=0;ze.STEP_AFTERRENDERINGMESH_OUTLINE=1;ze.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0;ze.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1;ze.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0;ze.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0;ze.STEP_BEFORECLEAR_PREPASS=1;ze.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0;ze.STEP_AFTERRENDERTARGETDRAW_PREPASS=0;ze.STEP_AFTERRENDERTARGETDRAW_LAYER=1;ze.STEP_AFTERCAMERADRAW_PREPASS=0;ze.STEP_AFTERCAMERADRAW_EFFECTLAYER=1;ze.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2;ze.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3;ze.STEP_AFTERCAMERADRAW_LAYER=4;ze.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5;ze.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0;ze.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0;ze.STEP_AFTERRENDER_AUDIO=0;ze.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0;ze.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1;ze.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2;ze.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3;ze.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0;ze.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1;ze.STEP_GATHERACTIVECAMERARENDERTARGETS_CLUSTEREDLIGHTING=2;ze.STEP_POINTERMOVE_SPRITE=0;ze.STEP_POINTERDOWN_SPRITE=0;ze.STEP_POINTERUP_SPRITE=0;class ts extends Array{constructor(e){super(...e)}static Create(){return Object.create(ts.prototype)}registerStep(e,t,s){let n=0,a;for(;n<this.length&&(a=this[n].index,!(e<a));n++);this.splice(n,0,{index:e,component:t,action:s.bind(t)})}clear(){this.length=0}}class qG{constructor(e){this.name=ze.NAME_LAYER,this.scene=e||pt.LastCreatedScene,this.scene&&(this._engine=this.scene.getEngine())}register(){this.scene._beforeCameraDrawStage.registerStep(ze.STEP_BEFORECAMERADRAW_LAYER,this,this._drawCameraBackgroun
472d),this.scene._afterCameraDrawStage.registerStep(ze.STEP_AFTERCAMERADRAW_LAYER,this,this._drawCameraForegroundWithPostProcessing),this.scene._afterCameraPostProcessStage.registerStep(ze.STEP_AFTERCAMERAPOSTPROCESS_LAYER,this,this._drawCameraForegroundWithoutPostProcessing),this.scene._beforeRenderTargetDrawStage.registerStep(ze.STEP_BEFORERENDERTARGETDRAW_LAYER,this,this._drawRenderTargetBackground),this.scene._afterRenderTargetDrawStage.registerStep(ze.STEP_AFTERRENDERTARGETDRAW_LAYER,this,this._drawRenderTargetForegroundWithPostProcessing),this.scene._afterRenderTargetPostProcessStage.registerStep(ze.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER,this,this._drawRenderTargetForegroundWithoutPostProcessing)}rebuild(){const e=this.scene.layers;for(const t of e)t._rebuild()}dispose(){const e=this.scene.layers;for(;e.length;)e[0].dispose()}_draw(e){const t=this.scene.layers;if(t.length){this._engine.setDepthBuffer(!1);for(const s of t)e(s)&&s.render();this._engine.setDepthBuffer(!0)}}_drawCameraPredicate(e,t,s,n){return!e.renderOnlyInRenderTargetTextures&&e.isBackground===t&&e.applyPostProcess===s&&(e.layerMask&n)!==0}_drawCameraBackground(e){this._draw(t=>this._drawCameraPredicate(t,!0,!0,e.layerMask))}_drawCameraForegroundWithPostProcessing(e){this._draw(t=>this._drawCameraPredicate(t,!1,!0,e.layerMask))}_drawCameraForegroundWithoutPostProcessing(e){this._draw(t=>this._drawCameraPredicate(t,!1,!1,e.layerMask))}_drawRenderTargetPredicate(e,t,s,n,a){return e.renderTargetTextures.length>0&&e.isBackground===t&&e.applyPostProcess===s&&e.renderTargetTextures.indexOf(a)>-1&&(e.layerMask&n)!==0}_drawRenderTargetBackground(e){this._draw(t=>this._drawRenderTargetPredicate(t,!0,!0,this.scene.activeCamera?this.scene.activeCamera.layerMask:0,e))}_drawRenderTargetForegroundWithPostProcessing(e){this._draw(t=>this._drawRenderTargetPredicate(t,!1,!0,this.scene.activeCamera?this.scene.activeCamera.layerMask:0,e))}_drawRenderTargetForegroundWithoutPostProcessing(e){this._draw(t=>this._drawRenderTargetPredicate(t,!1,!1,this.scene.activeCamera?this.scene.activeCamera.layerMask:0,e))}addFromContainer(e){if(e.layers)for(const t of e.layers)this.scene.layers.push(t)}removeFromContainer(e,t=!1){if(e.layers)for(const s of e.layers){const n=this.scene.layers.indexOf(s);n!==-1&&this.scene.layers.splice(n,1),t&&s.dispose()}}}class yc{set applyPostProcess(e){this._applyPostProcess=e}get applyPostProcess(){return this.isBackground||this._applyPostProcess}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set onBeforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}set onAfterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}get shaderLanguage(){return this._shaderLanguage}constructor(e,t,s,n,a,l=!1){this.name=e,this._applyPostProcess=!0,this.scale=new Xe(1,1),this.offset=new Xe(0,0),this.alphaBlendingMode=2,this.layerMask=268435455,this.renderTargetTextures=[],this.renderOnlyInRenderTargetTextures=!1,this.convertToLinearSpace=!1,this.isEnabled=!0,this._vertexBuffers={},this.onDisposeObservable=new xe,this.onBeforeRenderObservable=new xe,this.onAfterRenderObservable=new xe,this._shaderLanguage=0,this._shadersLoaded=!1,s||(s=pt.LastCreatedScene),this.layerMask=s.defaultRenderableLayerMask,this.texture=t?new gc(t,s,!0):null,this.isBackground=n===void 0?!0:n,this.color=a===void 0?new St(1,1,1,1):a,this._scene=s;const u=this._scene.getEngine();u.isWebGPU&&!l&&!yc.ForceGLSL&&(this._shaderLanguage=1);let h=this._scene._getComponent(ze.NAME_LAYER);h||(h=new qG(this._scene),this._scene._addComponent(h)),this._scene.layers.push(this),this._drawWrapper=new dg(u);const f=[];f.push(1,1),f.push(-1,1),f.push(-1,-1),f.push(1,-1);const m=new Ue(u,f,Ue.PositionKind,!1,!1,2);this._vertexBuffers[Ue.PositionKind]=m,this._createIndexBuffer()}_createIndexBuffer(){const e=this._scene.getEngine(),t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)}_rebuild(){const e=this._vertexBuffers[Ue.PositionKind];e&&e._rebuild(),this._createIndexBuffer()}isReady(){const e=this._scene.getEngine();let t="";return this.alphaTest&&(t="#define ALPHATEST"),this.texture&&(this.texture.gammaSpace?this.convertToLinearSpace&&(t+=`
473#define CONVERT_TO_LINEAR`):this.convertToLinearSpace||(t+=`
474#define CONVERT_TO_GAMMA`)),this._previousDefines!==t&&(this._previousDefines=t,this._drawWrapper.effect=e.createEffe
474ct("layer",[Ue.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],t,void 0,void 0,void 0,void 0,this._shaderLanguage,this._shadersLoaded?void 0:async()=>{this._shaderLanguage===1?await Promise.all([gi(()=>import("./layer.vertex-BVcprXkJ.js"),[]),gi(()=>import("./layer.fragment-BXZ75Fz4.js"),__vite__mapDeps([4,5]))]):await Promise.all([gi(()=>import("./layer.vertex-CEIlI8bE.js"),[]),gi(()=>import("./layer.fragment-C87fhhxb.js"),__vite__mapDeps([6,7]))]),this._shadersLoaded=!0})),!!this._drawWrapper.effect?.isReady()&&(!this.texture||this.texture.isReady())}render(){if(!this.isEnabled)return;const e=this._scene.getEngine();if(!this.isReady())return;const t=this._drawWrapper.effect;this.onBeforeRenderObservable.notifyObservers(this),e.enableEffect(this._drawWrapper),e.setState(!1),this.texture&&(t.setTexture("textureSampler",this.texture),t.setMatrix("textureMatrix",this.texture.getTextureMatrix())),t.setFloat4("color",this.color.r,this.color.g,this.color.b,this.color.a),t.setVector2("offset",this.offset),t.setVector2("scale",this.scale),e.bindBuffers(this._vertexBuffers,this._indexBuffer,t),this.alphaTest?e.drawElementsType(Gh.TriangleFillMode,0,6):(e.setAlphaMode(this.alphaBlendingMode),e.drawElementsType(Gh.TriangleFillMode,0,6),e.setAlphaMode(0)),this.onAfterRenderObservable.notifyObservers(this)}dispose(){const e=this._vertexBuffers[Ue.PositionKind];e&&(e.dispose(),this._vertexBuffers[Ue.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this.texture&&(this.texture.dispose(),this.texture=null),this.renderTargetTextures=[];const t=this._scene.layers.indexOf(this);this._scene.layers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderObservable.clear()}}yc.ForceGLSL=!1;class kR{constructor(){this._count=0,this._data={}}copyFrom(e){this.clear(),e.forEach((t,s)=>this.add(t,s))}get(e){const t=this._data[e];if(t!==void 0)return t}getOrAddWithFactory(e,t){let s=this.get(e);return s!==void 0||(s=t(e),s&&this.add(e,s)),s}getOrAdd(e,t){const s=this.get(e);return s!==void 0?s:(this.add(e,t),t)}contains(e){return this._data[e]!==void 0}add(e,t){return this._data[e]!==void 0?!1:(this._data[e]=t,++this._count,!0)}set(e,t){return this._data[e]===void 0?!1:(this._data[e]=t,!0)}getAndRemove(e){const t=this.get(e);return t!==void 0?(delete this._data[e],--this._count,t):null}remove(e){return this.contains(e)?(delete this._data[e],--this._count,!0):!1}clear(){this._data={},this._count=0}get count(){return this._count}forEach(e){for(const t in this._data){const s=this._data[t];e(t,s)}}first(e){for(const t in this._data){const s=this._data[t],n=e(t,s);if(n)return n}return null}}const ir=[[0,.18006,.26352,-.24341],[10,.18066,.26589,-.25479],[20,.18133,.26846,-.26876],[30,.18208,.27119,-.28539],[40,.18293,.27407,-.3047],[50,.18388,.27709,-.32675],[60,.18494,.28021,-.35156],[70,.18611,.28342,-.37915],[80,.1874,.28668,-.40955],[90,.1888,.28997,-.44278],[100,.19032,.29326,-.47888],[125,.19462,.30141,-.58204],[150,.19962,.30921,-.70471],[175,.20525,.31647,-.84901],[200,.21142,.32312,-1.0182],[225,.21807,.32909,-1.2168],[250,.22511,.33439,-1.4512],[275,.23247,.33904,-1.7298],[300,.2401,.34308,-2.0637],[325,.24792,.34655,-2.4681],[350,.25591,.34951,-2.9641],[375,.264,.352,-3.5814],[400,.27218,.35407,-4.3633],[425,.28039,.35577,-5.3762],[450,.28863,.35714,-6.7262],[475,.29685,.35823,-8.5955],[500,.30505,.35907,-11.324],[525,.3132,.35968,-15.628],[550,.32129,.36011,-23.325],[575,.32931,.36038,-40.77],[600,.33724,.36051,-116.45]],zh=1e6/ir[ir.length-1][0],Hh=150;function kA(i,e){const t=Number.isNaN(i)?zh:Math.max(i,zh),s=$t(1e6/t,ir[0][0],ir[ir.length-1][0]);let n=0,a=ir.length-1;for(;a-n>1;){const H=n+a>>1;ir[H][0]<=s?n=H:a=H}const l=n,[u,h,f,m]=ir[l],[p,b,v,R]=ir[l+1],x=(s-u)/(p-u),T=Xe.Lerp(new Xe(h,f),new Xe(b,v),x),E=Xe.Normalize(new Xe(1,m)),A=Xe.Normalize(new Xe(1,R)),D=Xe.Normalize(Xe.Lerp(E,A,x)),M=$t(e,-Hh,Hh);T.subtractInPlace(D.scale(M/3e3));const k=2*T.x-8*T.y+4,U=3*T.x/k,N=2*T.y/k;return new I(U/N,1,(1-U-N)/N)}const xh=ee.FromArray([.8951,-.7502,.0389,0,.2664,1.7135,-.0685,0,-.1614,.0367,1.0296,0,0,0,0,1]),WG=ee.Invert(xh);function _p(i,e){const t=e>0?i/e:10;return $t(t,.1,10)}function LA(i,e){const t=I.TransformNormal(i,xh),s=I.TransformNormal(e,xh),n=ee.FromArray([_p(s.x,t.x),0,0,0,0,_p(s.y,t.y),0,0,0,0,_p(s.z,t.z),0,0,0,0,1]);return xh.multiply(n).multiply(WG)}const YG=new I(.95047,1,1.08883),KG=ee.FromArray([.4124564,.2126729,.0193339,0,.3575761,.7151522,.119192,0,.1804375,.072175,.9503041,0,0,0,0,1]),fg=KG.multiply(LA(YG,kA(6500,0))),ZG=ee.Invert(fg),QG=I.TransformNormal(new I(1,1,1),fg);function $G(i,e){const t=kA(i,e),s=LA(t,QG),a=fg.multiply(s).multiply(ZG);return ee.GetAsMatrix3x3(a)}function BA(i){i.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")}let JG=(()=>{var i;let e,t=[],s=[],n,a=[],l=[],u,h=[],f=[],m,p=[],b=[],v,R=[],x=[],T,E=[],A=[],D,M=[],k=[],U,N=[],H=[],q,re=[],ce=[],ae,fe=[],_e=[],Te,z=[],J=[],Y,V=[],ge=[];return i=class{constructor(){this._dirty=!0,this._tempColor=new St(0,0,0,0),this._globalCurve=new St(0,0,0,0),this._highlightsCurve=new St(0,0,0,0),this._midtonesCurve=new St(0,0,0,0),this._shadowsCurve=new St(0,0,0,0),this._positiveCurve=new St(0,0,0,0),this._negativeCurve=new St(0,0,0,0),this._globalHue=j(this,t,30),this._globalDensity=(j(this,s),j(this,a,0)),this._globalSaturation=(j(this,l),j(this,h,0)),this._globalExposure=(j(this,f),j(this,p,0)),this._highlightsHue=(j(this,b),j(this,R,30)),this._highlightsDensity=(j(this,x),j(this,E,0)),this._highlightsSaturation=(j(this,A),j(this,M,0)),this._highlightsExposure=(j(this,k),j(this,N,0)),this._midtonesHue=(j(this,H),j(this,re,30)),this._midtonesDensity=(j(this,ce),j(this,fe,0)),this._midtonesSaturation=(j(this,_e),j(this,z,0)),this._midtonesExposure=(j(this,J),j(this,V,0)),this._shadows
vendor: 18,784 bytes, line 474
474Hue=(j(this,ge),30),this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}get globalHue(){return this._globalHue}set globalHue(B){this._globalHue=B,this._dirty=!0}get globalDensity(){return this._globalDensity}set globalDensity(B){this._globalDensity=B,this._dirty=!0}get globalSaturation(){return this._globalSaturation}set globalSaturation(B){this._globalSaturation=B,this._dirty=!0}get globalExposure(){return this._globalExposure}set globalExposure(B){this._globalExposure=B,this._dirty=!0}get highlightsHue(){return this._highlightsHue}set highlightsHue(B){this._highlightsHue=B,this._dirty=!0}get highlightsDensity(){return this._highlightsDensity}set highlightsDensity(B){this._highlightsDensity=B,this._dirty=!0}get highlightsSaturation(){return this._highlightsSaturation}set highlightsSaturation(B){this._highlightsSaturation=B,this._dirty=!0}get highlightsExposure(){return this._highlightsExposure}set highlightsExposure(B){this._highlightsExposure=B,this._dirty=!0}get midtonesHue(){return this._midtonesHue}set midtonesHue(B){this._midtonesHue=B,this._dirty=!0}get midtonesDensity(){return this._midtonesDensity}set midtonesDensity(B){this._midtonesDensity=B,this._dirty=!0}get midtonesSaturation(){return this._midtonesSaturation}set midtonesSaturation(B){this._midtonesSaturation=B,this._dirty=!0}get midtonesExposure(){return this._midtonesExposure}set midtonesExposure(B){this._midtonesExposure=B,this._dirty=!0}get shadowsHue(){return this._shadowsHue}set shadowsHue(B){this._shadowsHue=B,this._dirty=!0}get shadowsDensity(){return this._shadowsDensity}set shadowsDensity(B){this._shadowsDensity=B,this._dirty=!0}get shadowsSaturation(){return this._shadowsSaturation}set shadowsSaturation(B){this._shadowsSaturation=B,this._dirty=!0}get shadowsExposure(){return this._shadowsExposure}set shadowsExposure(B){this._shadowsExposure=B,this._dirty=!0}getClassName(){return"ColorCurves"}_getColorGradingDataToRef(B,X,Q,F,$){B!=null&&(B=i._Clamp(B,0,360),X=i._Clamp(X,-100,100),Q=i._Clamp(Q,-100,100),F=i._Clamp(F,-100,100),X=i._ApplyColorGradingSliderNonlinear(X),X*=.5,F=i._ApplyColorGradingSliderNonlinear(F),X<0&&(X*=-1,B=(B+180)%360),i._FromHSBToRef(B,X,50+.25*F,$),$.scaleToRef(2,$),$.a=1+.01*Q)}static _ApplyColorGradingSliderNonlinear(B){B/=100;let X=Math.abs(B);return X=Math.pow(X,2),B<0&&(X*=-1),X*=100,X}static _FromHSBToRef(B,X,Q,F){let $=i._Clamp(B,0,360);const he=i._Clamp(X/100,0,1),Ae=i._Clamp(Q/100,0,1);if(he===0)F.r=Ae,F.g=Ae,F.b=Ae;else{$/=60;const Oe=Math.floor($),G=$-Oe,ie=Ae*(1-he),de=Ae*(1-he*G),Se=Ae*(1-he*(1-G));switch(Oe){case 0:F.r=Ae,F.g=Se,F.b=ie;break;case 1:F.r=de,F.g=Ae,F.b=ie;break;case 2:F.r=ie,F.g=Ae,F.b=Se;break;case 3:F.r=ie,F.g=de,F.b=Ae;break;case 4:F.r=Se,F.g=ie,F.b=Ae;break;default:F.r=Ae,F.g=ie,F.b=de;break}}F.a=1}static _Clamp(B,X,Q){return Math.min(Math.max(B,X),Q)}clone(){return It.Clone(()=>new i,this)}serialize(){return It.Serialize(this)}_bind(B,X="vCameraColorCurvePositive",Q="vCameraColorCurveNeutral",F="vCameraColorCurveNegative"){this._dirty&&(this._dirty=!1,this._getColorGradingDataToRef(this._globalHue,this._globalDensity,this._globalSaturation,this._globalExposure,this._globalCurve),this._getColorGradingDataToRef(this._highlightsHue,this._highlightsDensity,this._highlightsSaturation,this._highlightsExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._highlightsCurve),this._getColorGradingDataToRef(this._midtonesHue,this._midtonesDensity,this._midtonesSaturation,this._midtonesExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._midtonesCurve),this._getColorGradingDataToRef(this._shadowsHue,this._shadowsDensity,this._shadowsSaturation,this._shadowsExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._shadowsCurve),this._highlightsCurve.subtractToRef(this._midtonesCurve,this._positiveCurve),this._midtonesCurve.subtractToRef(this._shadowsCurve,this._negativeCurve)),B&&(B.setFloat4(X,this._positiveCurve.r,this._positiveCurve.g,this._positiveCurve.b,this._positiveCurve.a),B.setFloat4(Q,this._midtonesCurve.r,this._midtonesCurve.g,this._midtonesCurve.b,this._midtonesCurve.a),B.setFloat4(F,this._negativeCurve.r,this._negativeCurve.g,this._negativeCurve.b,this._negativeCurve.a))}},(()=>{const L=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ne()],n=[ne()],u=[ne()],m=[ne()],v=[ne()],T=[ne()],D=[ne()],U=[ne()],q=[ne()],ae=[ne()],Te=[ne()],Y=[ne()],te(null,null,e,{kind:"field",name:"_globalHue",static:!1,private:!1,access:{has:B=>"_globalHue"in B,get:B=>B._globalHue,set:(B,X)=>{B._globalHue=X}},metadata:L},t,s),te(null,null,n,{kind:"field",name:"_globalDensity",static:!1,private:!1,access:{has:B=>"_globalDensity"in B,get:B=>B._globalDensity,set:(B,X)=>{B._globalDensity=X}},metadata:L},a,l),te(null,null,u,{kind:"field",name:"_globalSaturation",static:!1,private:!1,access:{has:B=>"_globalSaturation"in B,get:B=>B._globalSaturation,set:(B,X)=>{B._globalSaturation=X}},metadata:L},h,f),te(null,null,m,{kind:"field",name:"_globalExposure",static:!1,private:!1,access:{has:B=>"_globalExposure"in B,get:B=>B._globalExposure,set:(B,X)=>{B._globalExposure=X}},metadata:L},p,b),te(null,null,v,{kind:"field",name:"_highlightsHue",static:!1,private:!1,access:{has:B=>"_highlightsHue"in B,get:B=>B._highlightsHue,set:(B,X)=>{B._highlightsHue=X}},metadata:L},R,x),te(null,null,T,{kind:"field",name:"_highlightsDensity",static:!1,private:!1,access:{has:B=>"_highlightsDensity"in B,get:B=>B._highlightsDensity,set:(B,X)=>{B._highlightsDensity=X}},metadata:L},E,A),te(null,null,D,{kind:"field",name:"_highlightsSaturation",static:!1,private:!1,access:{has:B=>"_highlightsSaturation"in B,get:B=>B._highlightsSaturation,set:(B,X)=>{B._highlightsSaturation=X}},metadata:L},M,k),te(null,null,U,{kind:"field",name:"_highlightsExposure",static:!1,private:!1,access:{has:B=>"_highlightsExposure"in B,get:B=>B._highlightsExposure,set:(B,X)=>{B._highlightsExposure=X}},metadata:L},N,H),te(null,null,q,{kind:"field",name:"_midtonesHue",static:!1,private:!1,access:{has:B=>"_midtonesHue"in B,get:B=>B._midtonesHue,set:(B,X)=>{B._midtonesHue=X}},metadata:L},re,ce),te(null,null,ae,{kind:"field",name:"_midtonesDensity",static:!1,private:!1,access:{has:B=>"_midtonesDensity"in B,get:B=>B._midtonesDensity,set:(B,X)=>{B._midtonesDensity=X}},metadata:L},fe,_e),te(null,null,Te,{kind:"field",name:"_midtonesSaturation",static:!1,private:!1,access:{has:B=>"_midtonesSaturation"in B,get:B=>B._midtonesSaturation,set:(B,X)=>{B._midtonesSaturation=X}},metadata:L},z,J),te(null,null,Y,{kind:"field",name:"_midtonesExposure",static:!1,private:!1,access:{has:B=>"_midtonesExposure"in B,get:B=>B._midtonesExposure,set:(B,X)=>{B._midtonesExposure=X}},metadata:L},V,ge),L&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:L})})(),i.PrepareUniforms=BA,i})();function e4(i,e,t="vCameraColorCurvePositive",s="vCameraColorCurveNeutral",n="vCameraColorCurveNegative"){i._bind(e,t,s,n)}function t4(i,e){e.WHITEBALANCE&&i.push("whiteBalanceMatrix"),e.EXPOSURE&&i.push("exposureLinear"),e.CONTRAST&&i.push("contrast"),e.COLORGRADING&&i.push("colorTransformSettings"),(e.VIGNETTE||e.DITHER)&&i.push("vInverseScreenSize"),e.VIGNETTE&&(i.push("vignetteSettings1"),i.push("vignetteSettings2")),e.COLORCURVES&&BA(i),e.DITHER&&i.push("ditherIntensity")}function s4(i,e){e.COLORGRADING&&i.push("txColorTransform")}let LR=(()=>{var i;let e,t=[],s=[],n,a=[],l=[],u,h=[],f=[],m,p=[],b=[],v,R=[],x=[],T,E=[],A=[],D,M=[],k=[],U,N=[],H=[],q,re=[],ce=[],ae,fe=[],_e=[],Te,z=[],J=[],Y,V=[],ge=[],L,B=[],X=[],Q,F=[],$=[],he,Ae=[],Oe=[],G,ie=[],de=[],Se,qe=[],Je=[],Ct,es=[],ps=[],Gt,Rs=[],ms=[],et,K=[],we=[],Ut,yt=[],wt=[],Ot,Yt=[],Ft=[],ns,rs=[],zt=[],Ne,rt=[],vt=[],$s,ti=[],js=[],Gs,li=[],Js=[],hs,st=[],ke=[],w,me=[],lt=[];return i=class{constructor(){this.colorCurves=j(this,t,new JG),this._colorCurvesEnabled=(j(this,s),j(this,a,!1)),this._colorGradingTexture=(j(this,l),j(this,h,void 0)),this._colorGradingEnabled=(j(this,f),j(this,p,!1)),this._colorGradingWithGreenDepth=(j(this,b),j(this,R,!0)),this._colorGradingBGR=(j(this,x),j(this,E,!0)),this._exposure=(j(this,A),j(this,M,1)),this._toneMappingEnabled=(j(this,k),j(this,N,!1)),this._toneMappingType=(j(this,H),j(this,re,i.TONEMAPPING_STANDARD)),this._contrast=(j(this,ce),j(this,fe,1)),this._whiteBalanceEnabled=(j(this,_e),j(this,z,!1)),this._temperature=(j(this,J),j(this,V,6500)),this._tint=(j(this,ge),j(this,B,0)),this._whiteBalanceMatrix=(j(this,X),null),this._whiteBalanceMatrixTemperature=null,this._whiteBalanceMatrixTint=null,this.vignetteStretch=j(this,F,0),this.vignetteCenterX=(j(this,$),j(this,Ae,0)),this.vignetteCenterY=(j(this,Oe),j(this,ie,0)),this.vignetteWeight=(j(this,de),j(this,qe,1.5)),this.vignetteColor=(j(this,Je),j(this,es,new St(0,0,0,0))),this.vignetteCameraFov=(j(this,ps),j(this,Rs,.5)),this._vignetteBlendMode=(j(this,ms),j(this,K,i.VIGNETTEMODE_MULTIPLY)),this._vignetteEnabled=(j(this,we),j(this,yt,!1)),this._ditheringEnabled=(j(this,wt),j(this,Yt,!1)),this._ditheringIntensity=(j(this,Ft),j(this,rs,1/255)),this._skipFinalColorClamp=(j(this,zt),j(this,rt,!1)),this._applyByPostProcess=(j(this,vt),j(this,ti,!1)),this._isEnabled=(j(this,js),j(this,li,!0)),this.outputTextureWidth=(j(this,Js),j(this,st,0)),this.outputTextureHeight=(j(this,ke),j(this,me,0)),this.onUpdateParameters=(j(this,lt),new xe)}get colorCurvesEnabled(){return this._colorCurvesEnabled}set colorCurvesEnabled(O){this._colorCurvesEnabled!==O&&(this._colorCurvesEnabled=O,this._updateParameters())}get colorGradingTexture(){return this._colorGradingTexture}set colorGradingTexture(O){this._colorGradingTexture!==O&&(this._colorGradingTexture=O,this._updateParameters())}get colorGradingEnabled(){return this._colorGradingEnabled}set colorGradingEnabled(O){this._colorGradingEnabled!==O&&(this._colorGradingEnabled=O,this._updateParameters())}get colorGradingWithGreenDepth(){return this._colorGradingWithGreenDepth}set colorGradingWithGreenDepth(O){this._colorGradingWithGreenDepth!==O&&(this._colorGradingWithGreenDepth=O,this._updateParameters())}get colorGradingBGR(){return this._colorGradingBGR}set colorGradingBGR(O){this._colorGradingBGR!==O&&(this._colorGradingBGR=O,this._updateParameters())}get exposure(){return this._exposure}set exposure(O){this._exposure!==O&&(this._exposure=O,this._updateParameters())}get toneMappingEnabled(){return this._toneMappingEnabled}set toneMappingEnabled(O){this._toneMappingEnabled!==O&&(this._toneMappingEnabled=O,this._updateParameters())}get toneMappingType(){return this._toneMappingType}set toneMappingType(O){this._toneMappingType!==O&&(this._toneMappingType=O,this._updateParameters())}get contrast(){return this._contrast}set contrast(O){this._contrast!==O&&(this._contrast=O,this._updateParameters())}get whiteBalanceEnabled(){return this._whiteBalanceEnabled}set whiteBalanceEnabled(O){this._whiteBalanceEnabled!==O&&(this._whiteBalanceEnabled=O,this._updateParameters())}get temperature(){return this._temperature}set temperature(O){O=Number.isNaN(O)?zh:Math.max(O,zh),this._temperature!==O&&(this._temperature=O,this._updateParameters())}get tint(){return this._tint}set tint(O){O=$t(O,-Hh,Hh),this._tint!==O&&(this._tint=O,this._updateParameters())}_getWhiteBalanceMatrix(){return(this._whiteBalanceMatrix===null||this._whiteBalanceMatrixTemperature!==this._temperature||this._whiteBalanceMatrixTint!==this._tint)&&(this._whiteBalanceMatrixTemperature=this._temperature,this._whiteBalanceMatrixTint=this._tint,this._whiteBalanceMatrix=$G(this._temperature,this._tint)),this._whiteBalanceMatrix}get vignetteCentreY(){return this.vignetteCenterY}set vignetteCentreY(O){this.vignetteCenterY=O}get vignetteCentreX(){return this.vignetteCenterX}set vignetteCentreX(O){this.vignetteCenterX=O}get vignetteBlendMode(){return this._vignetteBlendMode}set vignetteBlendMode(O){this._vignetteBlendMode!==O&&(this._vignetteBlendMode=O,this._updateParameters())}get vignetteEnabled(){return this._vignetteEnabled}set vignetteEnabled(O){this._vignetteEnabled!==O&&(this._vignetteEnabled=O,this._updateParameters())}get ditheringEnabled(){return this._ditheringEnabled}set ditheringEnabled(O){this._ditheringEnabled!==O&&(this._ditheringEnabled=O,this._updateParameters())}get ditheringIntensity(){return this._ditheringIntensity}set ditheringIntensity(O){this._ditheringIntensity!==O&&(this._ditheringIntensity=O,this._updateParameters())}get skipFinalColorClamp(){return this._skipFinalColorClamp}set skipFinalColorClamp(O){this._skipFinalColorClamp!==O&&(this._skipFinalColorClamp=O,this._updateParameters())}get applyByPostProcess(){return this._applyByPostProcess}set applyByPostProcess(O){this._applyByPostProcess!==O&&(this._applyByPostProcess=O,this._updateParameters())}get isEnabled(){return this._isEnabled}set isEnabled(O){this._isEnabled!==O&&(this._isEnabled=O,this._updateParameters())}_updateParameters(){this.onUpdateParameters.notifyObservers(this)}getClassName(){return"ImageProcessingConfiguration"}prepareDefines(O,Ie=!1){if(Ie!==this.applyByPostProcess||!this._isEnabled){O.WHITEBALANCE=!1,O.VIGNETTE=!1,O.TONEMAPPING=0,O.CONTRAST=!1,O.EXPOSURE=!1,O.COLORCURVES=!1,O.COLORGRADING=!1,O.COLORGRADING3D=!1,O.DITHER=!1,O.IMAGEPROCESSING=!1,O.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,O.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled;return}if(O.WHITEBALANCE=this._whiteBalanceEnabled,O.VIGNETTE=this.vignetteEnabled,O.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===i._VIGNETTEMODE_MULTIPLY,O.VIGNETTEBLENDMODEOPAQUE=!O.VIGNETTEBLENDMODEMULTIPLY,!this._toneMappingEnabled)O.TONEMAPPING=0;else switch(this._toneMappingType){case i.TONEMAPPING_KHR_PBR_NEUTRAL:O.TONEMAPPING=3;break;case i.TONEMAPPING_ACES:O.TONEMAPPING=2;break;default:O.TONEMAPPING=1;break}O.CONTRAST=this.contrast!==1,O.EXPOSURE=this.exposure!==1,O.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,O.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,O.COLORGRADING?O.COLORGRADING3D=this.colorGradingTexture.is3D:O.COLORGRADING3D=!1,O.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,O.SAMPLER3DBGRMAP=this.colorGradingBGR,O.DITHER=this._ditheringEnabled,O.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,O.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,O.IMAGEPROCESSING=O.WHITEBALANCE||O.VIGNETTE||!!O.TONEMAPPING||O.CONTRAST||O.EXPOSURE||O.COLORCURVES||O.COLORGRADING||O.DITHER}isReady(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()}bind(O,Ie){if(this._whiteBalanceEnabled&&O.setMatrix3x3("whiteBalanceMatrix",this._getWhiteBalanceMatrix()),this._colorCurvesEnabled&&this.colorCurves&&e4(this.colorCurves,O),this._vignetteEnabled||this._ditheringEnabled){const Rt=1/(this.outputTextureWidth||O.getEngine().getRenderWidth()),as=1/(this.outputTextureHeight||O.getEngine().getRenderHeight());if(O.setFloat2("vInverseScreenSize",Rt,as),this._ditheringEnabled&&O.setFloat("ditherIntensity",.5*this._ditheringIntensity),this._vignetteEnabled){const un=Ie??as/Rt;let Ts=Math.tan(this.vignetteCameraFov*.5),vi=Ts*un;const Ri=Math.sqrt(vi*Ts);vi=j0(vi,Ri,this.vignetteStretch),Ts=j0(Ts,Ri,this.vignetteStretch),O.setFloat4("vignetteSettings1",vi,Ts,-vi*this.vignetteCenterX,-Ts*this.vignetteCenterY);const hn=-2*this.vignetteWeight;O.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,hn)}}if(O.setFloat("exposureLinear",this.exposure),O.setFloat("contrast",this.contrast),this.colorGradingTexture){O.setTexture("txColorTransform",this.colorGradingTexture);const Rt=this.colorGradingTexture.getSize().height;O.setFloat4("colorTransformSettings",(Rt-1)/Rt,.5/Rt,Rt,this.colorGradingTexture.level)}}clone(){return It.Clone(()=>new i,this)}serialize(){return It.Serialize(this)}static get VIGNETTEMODE_MULTIPLY(){return this._VIGNETTEMODE_MULTIPLY}static get VIGNETTEMODE_OPAQUE(){return this._VIGNETTEMODE_OPAQUE}},(()=>{const Pe=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[zj()],n=[ne()],u=[_A("colorGradingTexture")],m=[ne()],v=[ne()],T=[ne()],D=[ne()],U=[ne()],q=[ne()],ae=[ne()],Te=[ne()],Y=[ne()],L=[ne()],Q=[ne()],he=[ne()],G=[ne()],Se=[ne()],Ct=[Hj()],Gt=[ne()],et=[ne()],Ut=[ne()],Ot=[ne()],ns=[ne()],Ne=[ne()],$s=[ne()],Gs=[ne()],hs=[ne()],w=[ne()],te(null,null,e,{kind:"field",name:"colorCurves",static:!1,private:!1,access:{has:O=>"colorCurves"in O,get:O=>O.colorCurves,set:(O,Ie)=>{O.colorCurves=Ie}},metadata:Pe},t,s),te(null,null,n,{kind:"field",name:"_colorCurvesEnabled",static:!1,private:!1,access:{has:O=>"_colorCurvesEnabled"in O,get:O=>O._colorCurvesEnabled,set:(O,Ie)=>{O._colorCurvesEnabled=Ie}},metadata:Pe},a,l),te(null,null,u,{kind:"field",name:"_colorGradingTexture",static:!1,private:!1,access:{has:O=>"_colorGradingTexture"in O,get:O=>O._colorGradingTexture,set:(O,Ie)=>{O._colorGradingTexture=Ie}},metadata:Pe},h,f),te(null,null,m,{kind:"field",name:"_colorGradingEnabled",static:!1,private:!1,access:{has:O=>"_colorGradingEnabled"in O,get:O=>O._colorGradingEnabled,set:(O,Ie)=>{O._colorGradingEnabled=Ie}},metadata:Pe},p,b),te(null,null,v,{kind:"field",name:"_colorGradingWithGreenDepth",static:!1,private:!1,access:{has:O=>"_colorGradingWithGreenDepth"in O,get:O=>O._colorGradingWithGreenDepth,set:(O,Ie)=>{O._colorGradingWithGreenDepth=Ie}},metadata:Pe},R,x),te(null,null,T,{kind:"field",name:"_colorGradingBGR",static:!1,private:!1,access:{has:O=>"_colorGradingBGR"in O,get:O=>O._colorGradingBGR,set:(O,Ie)=>{O._colorGradingBGR=Ie}},metadata:Pe},E,A),te(null,null,D,{kind:"field",name:"_exposure",static:!1,private:!1,access:{has:O=>"_exposure"in O,get:O=>O._exposure,set:(O,Ie)=>{O._exposure=Ie}},metadata:Pe},M,k),te(null,null,U,{kind:"field",name:"_toneMappingEnabled",static:!1,private:!1,access:{has:O=>"_toneMappingEnabled"in O,get:O=>O._toneMappingEnabled,set:(O,Ie)=>{O._toneMappingEnabled=Ie}},metadata:Pe},N,H),te(null,null,q,{kind:"field",name:"_toneMappingType",static:!1,private:!1,access:{has:O=>"_toneMappingType"in O,get:O=>O._toneMappingType,set:(O,Ie)=>{O._toneMappingType=Ie}},metadata:Pe},re,ce),te(null,null,ae,{kind:"field",name:"_contrast",static:!1,private:!1,access:{has:O=>"_contrast"in O,get:O=>O._contrast,set:(O,Ie)=>{O._contrast=Ie}},metadata:Pe},fe,_e),te(null,null,Te,{kind:"field",name:"_whiteBalanceEnabled",static:!1,private:!1,access:{has:O=>"_whiteBalanceEnabled"in O,get:O=>O._whiteBalanceEnabled,set:(O,Ie)=>{O._whiteBalanceEnabled=Ie}},metadata:Pe},z,J),te(null,null,Y,{kind:"field",name:"_temperature",static:!1,private:!1,access:{has:O=>"_temperature"in O,get:O=>O._temperature,set:(O,Ie)=>{O._temperature=Ie}},metadata:Pe},V,ge),te(null,null,L,{kind:"field",name:"_tint",static:!1,private:!1,access:{has:O=>"_tint"in O,get:O=>O._tint,set:(O,Ie)=>
474{O._tint=Ie}},metadata:Pe},B,X),te(null,null,Q,{kind:"field",name:"vignetteStretch",static:!1,private:!1,access:{has:O=>"vignetteStretch"in O,get:O=>O.vignetteStretch,set:(O,Ie)=>{O.vignetteStretch=Ie}},metadata:Pe},F,$),te(null,null,he,{kind:"field",name:"vignetteCenterX",static:!1,private:!1,access:{has:O=>"vignetteCenterX"in O,get:O=>O.vignetteCenterX,set:(O,Ie)=>{O.vignetteCenterX=Ie}},metadata:Pe},Ae,Oe),te(null,null,G,{kind:"field",name:"vignetteCenterY",static:!1,private:!1,access:{has:O=>"vignetteCenterY"in O,get:O=>O.vignetteCenterY,set:(O,Ie)=>{O.vignetteCenterY=Ie}},metadata:Pe},ie,de),te(null,null,Se,{kind:"field",name:"vignetteWeight",static:!1,private:!1,access:{has:O=>"vignetteWeight"in O,get:O=>O.vignetteWeight,set:(O,Ie)=>{O.vignetteWeight=Ie}},metadata:Pe},qe,Je),te(null,null,Ct,{kind:"field",name:"vignetteColor",static:!1,private:!1,access:{has:O=>"vignetteColor"in O,get:O=>O.vignetteColor,set:(O,Ie)=>{O.vignetteColor=Ie}},metadata:Pe},es,ps),te(null,null,Gt,{kind:"field",name:"vignetteCameraFov",static:!1,private:!1,access:{has:O=>"vignetteCameraFov"in O,get:O=>O.vignetteCameraFov,set:(O,Ie)=>{O.vignetteCameraFov=Ie}},metadata:Pe},Rs,ms),te(null,null,et,{kind:"field",name:"_vignetteBlendMode",static:!1,private:!1,access:{has:O=>"_vignetteBlendMode"in O,get:O=>O._vignetteBlendMode,set:(O,Ie)=>{O._vignetteBlendMode=Ie}},metadata:Pe},K,we),te(null,null,Ut,{kind:"field",name:"_vignetteEnabled",static:!1,private:!1,access:{has:O=>"_vignetteEnabled"in O,get:O=>O._vignetteEnabled,set:(O,Ie)=>{O._vignetteEnabled=Ie}},metadata:Pe},yt,wt),te(null,null,Ot,{kind:"field",name:"_ditheringEnabled",static:!1,private:!1,access:{has:O=>"_ditheringEnabled"in O,get:O=>O._ditheringEnabled,set:(O,Ie)=>{O._ditheringEnabled=Ie}},metadata:Pe},Yt,Ft),te(null,null,ns,{kind:"field",name:"_ditheringIntensity",static:!1,private:!1,access:{has:O=>"_ditheringIntensity"in O,get:O=>O._ditheringIntensity,set:(O,Ie)=>{O._ditheringIntensity=Ie}},metadata:Pe},rs,zt),te(null,null,Ne,{kind:"field",name:"_skipFinalColorClamp",static:!1,private:!1,access:{has:O=>"_skipFinalColorClamp"in O,get:O=>O._skipFinalColorClamp,set:(O,Ie)=>{O._skipFinalColorClamp=Ie}},metadata:Pe},rt,vt),te(null,null,$s,{kind:"field",name:"_applyByPostProcess",static:!1,private:!1,access:{has:O=>"_applyByPostProcess"in O,get:O=>O._applyByPostProcess,set:(O,Ie)=>{O._applyByPostProcess=Ie}},metadata:Pe},ti,js),te(null,null,Gs,{kind:"field",name:"_isEnabled",static:!1,private:!1,access:{has:O=>"_isEnabled"in O,get:O=>O._isEnabled,set:(O,Ie)=>{O._isEnabled=Ie}},metadata:Pe},li,Js),te(null,null,hs,{kind:"field",name:"outputTextureWidth",static:!1,private:!1,access:{has:O=>"outputTextureWidth"in O,get:O=>O.outputTextureWidth,set:(O,Ie)=>{O.outputTextureWidth=Ie}},metadata:Pe},st,ke),te(null,null,w,{kind:"field",name:"outputTextureHeight",static:!1,private:!1,access:{has:O=>"outputTextureHeight"in O,get:O=>O.outputTextureHeight,set:(O,Ie)=>{O.outputTextureHeight=Ie}},metadata:Pe},me,lt),Pe&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Pe})})(),i.TONEMAPPING_STANDARD=0,i.TONEMAPPING_ACES=1,i.TONEMAPPING_KHR_PBR_NEUTRAL=2,i.PrepareUniforms=t4,i.PrepareSamplers=s4,i._VIGNETTEMODE_MULTIPLY=0,i._VIGNETTEMODE_OPAQUE=1,i})();class Vh{constructor(){this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.ray=null,this.originMesh=null,this.aimTransform=null,this.gripTransform=null}getNormal(e=!1,t=!0){if(!this.pickedMesh||t&&!this.pickedMesh.isVerticesDataPresent(Ue.NormalKind))return null;let s=this.pickedMesh.getIndices();s?.length===0&&(s=null);let n;const a=We.Vector3[0],l=We.Vector3[1],u=We.Vector3[2];if(t){const f=this.pickedMesh.getVerticesData(Ue.NormalKind);let m=s?I.FromArrayToRef(f,s[this.faceId*3]*3,a):a.copyFromFloats(f[this.faceId*3*3],f[this.faceId*3*3+1],f[this.faceId*3*3+2]),p=s?I.FromArrayToRef(f,s[this.faceId*3+1]*3,l):l.copyFromFloats(f[(this.faceId*3+1)*3],f[(this.faceId*3+1)*3+1],f[(this.faceId*3+1)*3+2]),b=s?I.FromArrayToRef(f,s[this.faceId*3+2]*3,u):u.copyFromFloats(f[(this.faceId*3+2)*3],f[(this.faceId*3+2)*3+1],f[(this.faceId*3+2)*3+2]);m=m.scale(this.bu),p=p.scale(this.bv),b=b.scale(1-this.bu-this.bv),n=new I(m.x+p.x+b.x,m.y+p.y+b.y,m.z+p.z+b.z)}else{const f=this.pickedMesh.getVerticesData(Ue.PositionKind),m=s?I.FromArrayToRef(f,s[this.faceId*3]*3,a):a.copyFromFloats(f[this.faceId*3*3],f[this.faceId*3*3+1],f[this.faceId*3*3+2]),p=s?I.FromArrayToRef(f,s[this.faceId*3+1]*3,l):l.copyFromFloats(f[(this.faceId*3+1)*3],f[(this.faceId*3+1)*3+1],f[(this.faceId*3+1)*3+2]),b=s?I.FromArrayToRef(f,s[this.faceId*3+2]*3,u):u.copyFromFloats(f[(this.faceId*3+2)*3],f[(this.faceId*3+2)*3+1],f[(this.faceId*3+2)*3+2]),v=m.subtract(p),R=b.subtract(p);n=I.Cross(v,R)}const h=(f,m)=>{if(this.thinInstanceIndex!==-1){const b=f._thinInstanceDataStorage.matrixData,v=this.thinInstanceIndex<<4;if(b&&b.length>v){const R=We.Matrix[0];ee.FromArrayToRef(b,v,R),I.TransformNormalToRef(m,R,m)}}let p=f.getWorldMatrix();
vendor: 56,789 bytes, line 474
474f.nonUniformScaling&&(We.Matrix[0].copyFrom(p),p=We.Matrix[0],p.setTranslationFromFloats(0,0,0),p.invert(),p.transposeToRef(We.Matrix[1]),p=We.Matrix[1]),I.TransformNormalToRef(m,p,m)};if(e&&h(this.pickedMesh,n),this.ray){const f=We.Vector3[0].copyFrom(n);e||h(this.pickedMesh,f),I.Dot(f,this.ray.direction)>0&&n.negateInPlace()}return n.normalize(),n}getTextureCoordinates(e=Ue.UVKind){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(e))return null;const t=this.pickedMesh.getIndices();if(!t)return null;const s=this.pickedMesh.getVerticesData(e);if(!s)return null;let n=Xe.FromArray(s,t[this.faceId*3]*2),a=Xe.FromArray(s,t[this.faceId*3+1]*2),l=Xe.FromArray(s,t[this.faceId*3+2]*2);return n=n.scale(this.bu),a=a.scale(this.bv),l=l.scale(1-this.bu-this.bv),new Xe(n.x+a.x+l.x,n.y+a.y+l.y)}}class Fs{constructor(e,t,s,n,a,l){this.source=e,this.pointerX=t,this.pointerY=s,this.meshUnderPointer=n,this.sourceEvent=a,this.additionalData=l}static CreateNew(e,t,s){const n=e.getScene();return new Fs(e,n.pointerX,n.pointerY,n.meshUnderPointer||e,t,s)}static CreateNewFromSprite(e,t,s,n){return new Fs(e,t.pointerX,t.pointerY,t.meshUnderPointer,s,n)}static CreateNewFromScene(e,t){return new Fs(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,s,n){return new Fs(e,t.x,t.y,null,s,n)}}class BR{constructor(e){this._vertexBuffers={},this._activePostProcesses=[],this.onBeforeRenderObservable=new xe,this._scene=e}_prepareBuffers(){if(this._vertexBuffers[Ue.PositionKind])return;const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[Ue.PositionKind]=new Ue(this._scene.getEngine(),e,Ue.PositionKind,!1,!1,2),this._buildIndexBuffer()}_buildIndexBuffer(){const e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}_getActivePostProcesses(e){const t=this._activePostProcesses;t.length=0;for(let s=0;s<e.length;s++){const n=e[s];n&&t.push(n)}return t}_rebuild(){const e=this._vertexBuffers[Ue.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){const s=this._scene.activeCamera;return!s||(t=t||this._getActivePostProcesses(s._postProcesses),!t||t.length===0||!this._scene.postProcessesEnabled)?!1:(t[0].activate(s,e,t!=null),!0)}directRender(e,t=null,s=!1,n=0,a=0,l=!1,u=e.length){const h=this._scene.getEngine();for(let f=0;f<u;f++){f<e.length-1?e[f+1].activate(this._scene.activeCamera||this._scene,t?.texture):(t?h.bindFramebuffer(t,n,void 0,void 0,s,a):l||h.restoreDefaultFramebuffer(),h._debugInsertMarker?.(`post process ${e[f].name} output`));const m=e[f],p=m.apply();p&&(m.onBeforeRenderObservable.notifyObservers(p),this._prepareBuffers(),h.bindBuffers(this._vertexBuffers,this._indexBuffer,p),h.drawElementsType(0,0,6),m.onAfterRenderObservable.notifyObservers(p))}h.setDepthBuffer(!0),h.setDepthWrite(!0)}_finalizeFrame(e,t,s,n,a=!1){const l=this._scene.activeCamera;if(!l||(this.onBeforeRenderObservable.notifyObservers(this),n=n||this._getActivePostProcesses(l._postProcesses),n.length===0||!this._scene.postProcessesEnabled))return;const u=this._scene.getEngine();for(let h=0,f=n.length;h<f;h++){const m=n[h];if(h<f-1?m._outputTexture=n[h+1].activate(l,t?.texture):(t?(u.bindFramebuffer(t,s,void 0,void 0,a),m._outputTexture=t):(u.restoreDefaultFramebuffer(),m._outputTexture=null),u._debugInsertMarker?.(`post process ${n[h].name} output`)),e)break;const p=m.apply();p&&(m.onBeforeRenderObservable.notifyObservers(p),this._prepareBuffers(),u.bindBuffers(this._vertexBuffers,this._indexBuffer,p),u.drawElementsType(0,0,6),m.onAfterRenderObservable.notifyObservers(p))}u.setDepthBuffer(!0),u.setDepthWrite(!0),u.setAlphaMode(0)}dispose(){const e=this._vertexBuffers[Ue.PositionKind];e&&(e.dispose(),this._vertexBuffers[Ue.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)}}class tn{set opaqueSortCompareFn(e){e?this._opaqueSortCompareFn=e:this._opaqueSortCompareFn=tn.PainterSortCompare,this._renderOpaque=this._renderOpaqueSorted}set alphaTestSortCompareFn(e){e?this._alphaTestSortCompareFn=e:this._alphaTestSortCompareFn=tn.PainterSortCompare,this._renderAlphaTest=this._renderAlphaTestSorted}set transparentSortCompareFn(e){e?this._transparentSortCompareFn=e:this._transparentSortCompareFn=tn.defaultTransparentSortCompare,this._renderTransparent=this._renderTransparentSorted}constructor(e,t,s=null,n=null,a=null){this.index=e,this._opaqueSubMeshes=new bi(256),this._transparentSubMeshes=new bi(256),this._alphaTestSubMeshes=new bi(256),this._depthOnlySubMeshes=new bi(256),this._particleSystems=new bi(256),this._spriteManagers=new bi(256),this._empty=!0,this._edgesRenderers=new pa(16),this.disableDepthPrePass=!1,this._scene=t,this.opaqueSortCompareFn=s,this.alphaTestSortCompareFn=n,this.transparentSortCompareFn=a}render(e,t,s,n,a=!0,l=!0,u=!0,h=!0,f){if(e){e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);return}const m=this._scene.getEngine();a&&this._depthOnlySubMeshes.length!==0&&(m.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),m.setColorWrite(!0)),l&&this._opaqueSubMeshes.length!==0&&this._renderOpaque(this._opaqueSubMeshes),u&&this._alphaTestSubMeshes.length!==0&&this._renderAlphaTest(this._alphaTestSubMeshes);const p=m.getStencilBuffer();if(m.setStencilBuffer(!1),t&&this._renderSprites(),s&&this._renderParticles(n),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),h&&(f||this._transparentSubMeshes.length!==0||this._scene.useOrderIndependentTransparency)){if(m.setStencilBuffer(p),f)f(this._transparentSubMeshes,this);else if(this._scene.useOrderIndependentTransparency){const b=this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);b.length&&this._renderTransparent(b)}else this._renderTransparent(this._transparentSubMeshes);m.setAlphaMode(0)}if(m.setStencilBuffer(!1),l&&this._edgesRenderers.length){for(let b=0;b<this._edgesRenderers.length;b++)this._edgesRenderers.data[b].render();m.setAlphaMode(0)}m.setStencilBuffer(p)}_renderOpaqueSorted(e){tn._RenderSorted(e,this._opaqueSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderAlphaTestSorted(e){tn._RenderSorted(e,this._alphaTestSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderTransparentSorted(e){tn._RenderSorted(e,this._transparentSortCompareFn,this._scene.activeCamera,!0,this.disableDepthPrePass)}static _RenderSorted(e,t,s,n,a){let l=0,u;const h=s?s.globalPosition:tn._ZeroVector;if(n)for(;l<e.length;l++)u=e.data[l],u._alphaIndex=u.getMesh().alphaIndex,u._distanceToCamera=I.Distance(u.getBoundingInfo().boundingSphere.centerWorld,h);const f=e.length===e.data.length?e.data:e.data.slice(0,e.length);t&&f.sort(t);const m=f[0].getMesh().getScene();for(l=0;l<f.length;l++)if(u=f[l],!(m._activeMeshesFrozenButKeepClipping&&!u.isInFrustum(m._frustumPlanes))){if(n){const p=u.getMaterial();if(p&&p.needDepthPrePass&&!a){const b=p.getScene().getEngine();b.setColorWrite(!1),b.setAlphaMode(0),u.render(!1),b.setColorWrite(!0)}}u.render(n)}}static defaultTransparentSortCompare(e,t){return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:tn.backToFrontSortCompare(e,t)}static backToFrontSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0}static frontToBackSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?-1:e._distanceToCamera>t._distanceToCamera?1:0}static PainterSortCompare(e,t){const s=e.getMesh(),n=t.getMesh();return s.material&&n.material?s.material.uniqueId-n.material.uniqueId:s.uniqueId-n.uniqueId}prepare(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this.prepareSprites(),this._edgesRenderers.reset(),this._empty=!0}prepareSprites(){this._spriteManagers.reset()}dispose(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()}dispatch(e,t,s){t===void 0&&(t=e.getMesh()),s===void 0&&(s=e.getMaterial()),s!=null&&(s.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):s.needAlphaTestingForMesh(t)?(s.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(s.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t.isEnabled()&&t.isVisible&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer),this._empty=!1)}dispatchSprites(e){this._spriteManagers.push(e),this._empty=!1}dispatchParticles(e){this._particleSystems.push(e),this._empty=!1}_renderParticles(e){if(this._particleSystems.length===0)return;const t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(let s=0;s<this._particleSystems.length;s++){const n=this._particleSystems.data[s];if((t&&t.layerMask&n.layerMask)===0)continue;const a=n.emitter;(!a.position||!e||e.indexOf(a)!==-1)&&this._scene._activeParticles.addCount(n.render(),!1)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}_renderSprites(){if(!this._scene.spritesEnabled||this._spriteManagers.length===0)return;const e=this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for(let t=0;t<this._spriteManagers.length;t++){const s=this._spriteManagers.data[t];(e&&e.layerMask&s.layerMask)!==0&&s.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}}tn._ZeroVector=I.Zero();class i4{}class Qs{get disableDepthPrePass(){return this._disableDepthPrePass}set disableDepthPrePass(e){this._disableDepthPrePass=e;for(const t of this._renderingGroups)t.disableDepthPrePass=e}get maintainStateBetweenFrames(){return this._maintainStateBetweenFrames}set maintainStateBetweenFrames(e){e!==this._maintainStateBetweenFrames&&(this._maintainStateBetweenFrames=e,this._maintainStateBetweenFrames||this.restoreDispachedFlags())}restoreDispachedFlags(){for(const e of this._scene.meshes)if(e.subMeshes)for(const t of e.subMeshes)t._wasDispatched=!1;if(this._scene.spriteManagers)for(const e of this._scene.spriteManagers)e._wasDispatched=!1;for(const e of this._scene.particleSystems)e._wasDispatched=!1}constructor(e){this._useSceneAutoClearSetup=!1,this._disableDepthPrePass=!1,this._renderingGroups=new Array,this._autoClearDepthStencil={},this._customOpaqueSortCompareFn={},this._customAlphaTestSortCompareFn={},this._customTransparentSortCompareFn={},this._renderingGroupInfo=new i4,this._maintainStateBetweenFrames=!1,this._scene=e;for(let t=Qs.MIN_RENDERINGGROUPS;t<Qs.MAX_RENDERINGGROUPS;t++)this._autoClearDepthStencil[t]={autoClear:!0,depth:!0,stencil:!0}}get renderingGroups(){return this._renderingGroups}getRenderingGroup(e){const t=e||0;return this._prepareRenderingGroup(t),this._renderingGroups[t]}_clearDepthStencilBuffer(e=!0,t=!0){this._depthStencilBufferAlreadyCleaned||(this._scene.getEngine().clear(null,!1,e,t),this._depthStencilBufferAlreadyCleaned=!0)}render(e,t,s,n,a=!0,l=!0,u=!0,h=!0,f){const m=this._renderingGroupInfo;if(m.scene=this._scene,m.camera=this._scene.activeCamera,m.renderingManager=this,this._scene.spriteManagers&&n)for(let p=0;p<this._scene.spriteManagers.length;p++){const b=this._scene.spriteManagers[p];this.dispatchSprites(b)}for(let p=Qs.MIN_RENDERINGGROUPS;p<Qs.MAX_RENDERINGGROUPS;p++){this._depthStencilBufferAlreadyCleaned=p===Qs.MIN_RENDERINGGROUPS;const b=this._renderingGroups[p];if(!b||b._empty)continue;const v=1<<p;if(m.renderingGroupId=p,this._scene.onBeforeRenderingGroupObservable.notifyObservers(m,v),Qs.AUTOCLEAR){const R=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(p):this._autoClearDepthStencil[p];R&&R.autoClear&&this._clearDepthStencilBuffer(R.depth,R.stencil)}for(const R of this._scene._beforeRenderingGroupDrawStage)R.action(p);b.render(e,n,s,t,a,l,u,h,f);for(const R of this._scene._afterRenderingGroupDrawStage)R.action(p);this._scene.onAfterRenderingGroupObservable.notifyObservers(m,v)}}reset(){if(!this.maintainStateBetweenFrames)for(let e=Qs.MIN_RENDERINGGROUPS;e<Qs.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepare()}}resetSprites(){if(!this.maintainStateBetweenFrames)for(let e=Qs.MIN_RENDERINGGROUPS;e<Qs.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepareSprites()}}dispose(){this.freeRenderingGroups(),this._renderingGroups.length=0,this._renderingGroupInfo=null}freeRenderingGroups(){for(let e=Qs.MIN_RENDERINGGROUPS;e<Qs.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.dispose()}}_prepareRenderingGroup(e){this._renderingGroups[e]===void 0&&(this._renderingGroups[e]=new tn(e,this._scene,this._customOpaqueSortCompareFn[e],this._customAlphaTestSortCompareFn[e],this._customTransparentSortCompareFn[e]),this._renderingGroups[e].disableDepthPrePass=this._disableDepthPrePass)}dispatchSprites(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchSprites(e))}dispatchParticles(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchParticles(e))}dispatch(e,t,s){t===void 0&&(t=e.getMesh()),!(this.maintainStateBetweenFrames&&e._wasDispatched)&&(e._wasDispatched=!0,this.getRenderingGroup(t.renderingGroupId).dispatch(e,t,s))}setRenderingOrder(e,t=null,s=null,n=null){if(this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=s,this._customTransparentSortCompareFn[e]=n,this._renderingGroups[e]){const a=this._renderingGroups[e];a.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],a.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],a.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}}setRenderingAutoClearDepthStencil(e,t,s=!0,n=!0){this._autoClearDepthStencil[e]={autoClear:t,depth:s,stencil:n}}getAutoClearDepthStencilSetup(e){return this._autoClearDepthStencil[e]}}Qs.MAX_RENDERINGGROUPS=4;Qs.MIN_RENDERINGGROUPS=0;Qs.AUTOCLEAR=!0;class Ii{constructor(){this.hoverCursor="",this.actions=[],this.isRecursive=!1,this.disposeWhenUnowned=!0}static get HasTriggers(){for(const e in Ii.Triggers)if(Object.prototype.hasOwnProperty.call(Ii.Triggers,e))return!0;return!1}static get HasPickTriggers(){for(const e in Ii.Triggers)if(Object.prototype.hasOwnProperty.call(Ii.Triggers,e)){const t=parseInt(e);if(t>=1&&t<=7)return!0}return!1}static HasSpecificTrigger(e){for(const t in Ii.Triggers)if(Object.prototype.hasOwnProperty.call(Ii.Triggers,t)&&parseInt(t)===e)return!0;return!1}}Ii.Triggers={};var Le;(function(i){i[i.Generic=0]="Generic",i[i.Keyboard=1]="Keyboard",i[i.Mouse=2]="Mouse",i[i.Touch=3]="Touch",i[i.DualShock=4]="DualShock",i[i.Xbox=5]="Xbox",i[i.Switch=6]="Switch",i[i.DualSense=7]="DualSense"})(Le||(Le={}));var Ve;(function(i){i[i.Horizontal=0]="Horizontal",i[i.Vertical=1]="Vertical",i[i.LeftClick=2]="LeftClick",i[i.MiddleClick=3]="MiddleClick",i[i.RightClick=4]="RightClick",i[i.BrowserBack=5]="BrowserBack",i[i.BrowserForward=6]="BrowserForward",i[i.MouseWheelX=7]="MouseWheelX",i[i.MouseWheelY=8]="MouseWheelY",i[i.MouseWheelZ=9]="MouseWheelZ",i[i.Move=12]="Move"})(Ve||(Ve={}));var NR;(function(i){i[i.Horizontal=0]="Horizontal",i[i.Vertical=1]="Vertical",i[i.LeftClick=2]="LeftClick",i[i.MiddleClick=3]="MiddleClick",i[i.RightClick=4]="RightClick",i[i.BrowserBack=5]="BrowserBack",i[i.BrowserForward=6]="BrowserForward",i[i.MouseWheelX=7]="MouseWheelX",i[i.MouseWheelY=8]="MouseWheelY",i[i.MouseWheelZ=9]="MouseWheelZ",i[i.DeltaHorizontal=10]="DeltaHorizontal",i[i.DeltaVertical=11]="DeltaVertical"})(NR||(NR={}));var UR;(function(i){i[i.Cross=0]="Cross",i[i.Circle=1]="Circle",i[i.Square=2]="Square",i[i.Triangle=3]="Triangle",i[i.L1=4]="L1",i[i.R1=5]="R1",i[i.L2=6]="L2",i[i.R2=7]="R2",i[i.Share=8]="Share",i[i.Options=9]="Options",i[i.L3=10]="L3",i[i.R3=11]="R3",i[i.DPadUp=12]="DPadUp",i[i.DPadDown=13]="DPadDown",i[i.DPadLeft=14]="DPadLeft",i[i.DPadRight=15]="DPadRight",i[i.Home=16]="Home",i[i.TouchPad=17]="TouchPad",i[i.LStickXAxis=18]="LStickXAxis",i[i.LStickYAxis=19]="LStickYAxis",i[i.RStickXAxis=20]="RStickXAxis",i[i.RStickYAxis=21]="RStickYAxis"})(UR||(UR={}));var jR;(function(i){i[i.Cross=0]="Cross",i[i.Circle=1]="Circle",i[i.Square=2]="Square",i[i.Triangle=3]="Triangle",i[i.L1=4]="L1",i[i.R1=5]="R1",i[i.L2=6]="L2",i[i.R2=7]="R2",i[i.Create=8]="Create",i[i.Options=9]="Options",i[i.L3=10]="L3",i[i.R3=11]="R3",i[i.DPadUp=12]="DPadUp",i[i.DPadDown=13]="DPadDown",i[i.DPadLeft=14]="DPadLeft",i[i.DPadRight=15]="DPadRight",i[i.Home=16]="Home",i[i.TouchPad=17]="TouchPad",i[i.LStickXAxis=18]="LStickXAxis",i[i.LStickYAxis=19]="LStickYAxis",i[i.RStickXAxis=20]="RStickXAxis",i[i.RStickYAxis=21]="RStickYAxis"})(jR||(jR={}));var GR;(function(i){i[i.A=0]="A",i[i.B=1]="B",i[i.X=2]="X",i[i.Y=3]="Y",i[i.LB=4]="LB",i[i.RB=5]="RB",i[i.LT=6]="LT",i[i.RT=7]="RT",i[i.Back=8]="Back",i[i.Start=9]="Start",i[i.LS=10]="LS",i[i.RS=11]="RS",i[i.DPadUp=12]="DPadUp",i[i.DPadDown=13]="DPadDown",i[i.DPadLeft=14]="DPadLeft",i[i.DPadRight=15]="DPadRight",i[i.Home=16]="Home",i[i.LStickXAxis=17]="LStickXAxis",i[i.LStickYAxis=18]="LStickYAxis",i[i.RStickXAxis=19]="RStickXAxis",i[i.RStickYAxis=20]="RStickYAxis"})(GR||(GR={}));var zR;(function(i){i[i.B=0]="B",i[i.A=1]="A",i[i.Y=2]="Y",i[i.X=3]="X",i[i.L=4]="L",i[i.R=5]="R",i[i.ZL=6]="ZL",i[i.ZR=7]="ZR",i[i.Minus=8]="Minus",i[i.Plus=9]="Plus",i[i.LS=10]="LS",i[i.RS=11]="RS",i[i.DPadUp=12]="DPadUp",i[i.DPadDown=13]="DPadDown",i[i.DPadLeft=14]="DPadLeft",i[i.DPadRight=15]="DPadRight",i[i.Home=16]="Home",i[i.Capture=17]="Capture",i[i.LStickXAxis=18]="LStickXAxis",i[i.LStickYAxis=19]="LStickYAxis",i[i.RStickXAxis=20]="RStickXAxis",i[i.RStickYAxis=21]="RStickYAxis"})(zR||(zR={}));class ma{static CreateDeviceEvent(e,t,s,n,a,l,u){switch(e){case Le.Keyboard:return this._CreateKeyboardEvent(s,n,a,l);case Le.Mouse:if(s===Ve.MouseWheelX||s===Ve.MouseWheelY||s===Ve.MouseWheelZ)return this._CreateWheelEvent(e,t,s,n,a,l);case Le.Touch:return this._CreatePointerEvent(e,t,s,n,a,l,u);default:throw`Unable to generate event for device ${Le[e]}`}}static _CreatePointerEvent(e,t,s,n,a,l,u){const h=this._CreateMouseEvent(e,t,s,n,a,l);e===Le.Mouse?(h.deviceType=Le.Mouse,h.pointerId=1,h.pointerType="mouse"):(h.deviceType=Le.Touch,h.pointerId=u??t,h.pointerType="touch");let f=0;return f+=a.pollInput(e,t,Ve.LeftClick),f+=a.pollInput(e,t,Ve.RightClick)*2,f+=a.pollInput(e,t,Ve.MiddleClick)*4,h.buttons=f,s===Ve.Move?h.type="pointermove":s>=Ve.LeftClick&&s<=Ve.RightClick&&(h.type=n===1?"pointerdown":"pointerup",h.button=s-2),h}static _CreateWheelEvent(e,t,s,n,a,l){const u=this._CreateMouseEvent(e,t,s,n,a,l);switch(u.pointerId=1,u.type="wheel",u.deltaMode=Ic.DOM_DELTA_PIXEL,u.deltaX=0,u.deltaY=0,u.deltaZ=0,s){case Ve.MouseWheelX:u.deltaX=n;break;case Ve.MouseWheelY:u.deltaY=n;break;case Ve.MouseWheelZ:u.deltaZ=n;break}return u}static _CreateMouseEvent(e,t,s,n,a,l){const u=this._CreateEvent(l),h=a.pollInput(e,t,Ve.Horizontal),f=a.pollInput(e,t,Ve.Vertical);return l?(u.movementX=0,u.movementY=0,u.offsetX=u.movementX-l.getBoundingClientRect().x,u.offsetY=u.movementY-l.getBoundingClientRect().y):(u.movementX=a.pollInput(e,t,10),u.movementY=a.pollInput(e,t,11),u.offsetX=0,u.offsetY=0),this._CheckNonCharacterKeys(u,a),u.clientX=h,u.clientY=f,u.x=h,u.y=f,u.deviceType=e,u.deviceSlot=t,u.inputIndex=s,u}static _CreateKeyboardEvent(e,t,s,n){const a=this._CreateEvent(n);return this._CheckNonCharacterKeys(a,s),a.deviceType=Le.Keyboard,a.deviceSlot=0,a.inputIndex=e,a.type=t===1?"keydown":"keyup",a.key=String.fromCharCode(e),a.keyCode=e,a}static _CheckNonCharacterKeys(e,t){const s=t.isDeviceAvailable(Le.Keyboard),n=s&&t.pollInput(Le.Keyboard,0,18)===1,a=s&&t.pollInput(Le.Keyboard,0,17)===1,l=s&&(t.pollInput(Le.Keyboard,0,91)===1||t.pollInput(Le.Keyboard,0,92)===1||t.pollInput(Le.Keyboard,0,93)===1),u=s&&t.pollInput(Le.Keyboard,0,16)===1;e.altKey=n,e.ctrlKey=a,e.metaKey=l,e.shiftKey=u}static _CreateEvent(e){const t={};return t.preventDefault=()=>{},t.target=e,t}}class n4{constructor(e,t,s){this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(n,a,l,u)=>{const h=ma.CreateDeviceEvent(n,a,l,u,this);s(n,a,h)}):this._createDummyNativeInput()}pollInput(e,t,s){return this._nativeInput.pollInput(e,t,s)}isDeviceAvailable(e){return e===Le.Mouse||e===Le.Touch}dispose(){this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}const HR=255,VR=Object.keys(Ve).length/2;class r4{constructor(e,t,s,n){this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=ft.IsSafari(),this._usingMacOs=Ao()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),this._keyboardDownEvent=a=>{},this._keyboardUpEvent=a=>{},this._keyboardBlurEvent=a=>{},this._pointerMoveEvent=a=>{},this._pointerDownEvent=a=>{},this._pointerUpEvent=a=>{},this._pointerCancelEvent=a=>{},this._pointerCancelTouch=a=>{},this._pointerLeaveEvent=a=>{},this._pointerWheelEvent=a=>{},this._pointerBlurEvent=a=>{},this._pointerMacOsChromeOutEvent=a=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=Ao()&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,this._isUsingChromium=Ao()&&navigator.userAgent&&navigator.userAgent.indexOf("Chrome")!==-1,this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=a=>{},this._gamepadDisconnectedEvent=a=>{},this._eventPrefix=ft.GetPointerPrefix(e),this._engine=e,this._onDeviceConnected=t,this._onDeviceDisconnected=s,this._onInputChanged=n,this._mouseId=this._isUsingFirefox?0:1,this._enableEvents(),this._usingMacOs&&(this._metaKeys=[]),this._engine._onEngineViewChanged||(this._engine._onEngineViewChanged=()=>{this._enableEvents()})}pollInput(e,t,s){const n=this._inputs[e][t];if(!n)throw`Unable to find device ${Le[e]}`;e>=Le.DualShock&&e<=Le.DualSense&&this._updateDevice(e,t,s);const a=n[s];if(a===void 0)throw`Unable to find input ${s} for device ${Le[e]} in slot ${t}`;return s===Ve.Move&&ft.Warn("Unable to provide information for PointerInput.Move.  Try using PointerInput.Horizontal or PointerInput.Vertical for move data."),a}isDeviceAvailable(e){return this._inputs[e]!==void 0}dispose(){this._onDeviceConnected=()=>{},this._onDeviceDisconnected=()=>{},this._onInputChanged=()=>{},delete this._engine._onEngineViewChanged,this._elementToAttachTo&&this._disableEvents()}_enableEvents(){const e=this?._engine.getInputElement();if(e&&(!this._eventsAttached||this._elementToAttachTo!==e)){if(this._disableEvents(),this._inputs){for(const t of this._inputs)if(t)for(const s in t){const n=+s,a=t[n];if(a)for(let l=0;l<a.length;l++)a[l]=0}}this._elementToAttachTo=e,this._elementToAttachTo.tabIndex=this._elementToAttachTo.tabIndex!==-1?this._elementToAttachTo.tabIndex:this._engine.canvasTabIndex,this._handleKeyActions(),this._handlePointerActions(),this._handleGamepadActions(),this._eventsAttached=!0,this._checkForConnectedDevices()}}_disableEvents(){this._elementToAttachTo&&(this._elementToAttachTo.removeEventListener("blur",this._keyboardBlurEvent),this._elementToAttachTo.removeEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.removeEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.removeEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.removeEventListener(this._wheelEventName,this._pointerWheelEvent),this._usingMacOs&&this._isUsingChromium&&this._elementToAttachTo.removeEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent),window.removeEventListener("gamepadconnected",this._gamepadConnectedEvent),window.removeEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)),this._pointerInputClearObserver&&this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver),this._eventsAttached=!1}_checkForConnectedDevices(){if(navigator.getGamepads){const e=navigator.getGamepads();for(const t of e)t&&this._addGamePad(t)}typeof matchMedia=="function"&&matchMedia("(pointer:fine)").matches&&this._addPointerDevice(Le.Mouse,0,0,0)}_addGamePad(e){const t=this._getGamepadDeviceType(e.id),s=e.index;this._gamepads=this._gamepads||new Array(e.index+1),this._registerDevice(t,s,e.buttons.length+e.axes.length),this._gamepads[s]=t}_addPointerDevice(e,t,s,n){this._pointerActive||(this._pointerActive=!0),this._registerDevice(e,t,VR);const a=this._inputs[e][t];a[0]=s,a[1]=n}_registerDevice(e,t,s){if(t===void 0)throw`Unable to register device ${Le[e]} to undefined slot.`;if(this._inputs[e]||(this._inputs[e]={}),!this._inputs[e][t]){const n=new Array(s);n.fill(0),this._inputs[e][t]=n,this._onDeviceConnected(e,t)}}_unregisterDevice(e,t){this._inputs[e][t]&&(delete this._inputs[e][t],this._onDeviceDisconnected(e,t))}_handleKeyActions(){this._keyboardDownEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(Le.Keyboard,0,HR));const t=this._inputs[Le.Keyboard][0];if(t){t[e.keyCode]=1;const s=e;s.inputIndex=e.keyCode,this._usingMacOs&&e.metaKey&&e.key!=="Meta"&&(this._metaKeys.includes(e.keyCode)||this._metaKeys.push(e.keyCode)),this._onInputChanged(Le.Keyboard,0,s)}},this._keyboardUpEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(Le.Keyboard,0,HR));const t=this._inputs[Le.Keyboard][0];if(t){t[e.keyCode]=0;const s=e;if(s.inputIndex=e.keyCode,this._usingMacOs&&e.key==="Meta"&&this._metaKeys.length>0){for(const n of this._metaKeys){const a=ma.CreateDeviceEvent(Le.Keyboard,0,n,0,this,this._elementToAttachTo);t[n]=0,this._onInputChanged(Le.Keyboard,0,a)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(Le.Keyboard,0,s)}},this._keyboardBlurEvent=()=>{if(this._keyboardActive){const e=this._inputs[Le.Keyboard][0];for(let t=0;t<e.length;t++)if(e[t]!==0){e[t]=0;const s=ma.CreateDeviceEvent(Le.Keyboard,0,t,0,this,this._elementToAttachTo);this._onInputChanged(Le.Keyboard,0,s)}this._usingMacOs&&this._metaKeys.splice(0,this._metaKeys.length)}},this._elementToAttachTo.addEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.addEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.addEventListener("blur",this._keyboardBlurEvent)}_handlePointerActions(){this._maxTouchPoints=Ao()&&navigator.maxTouchPoints||2,this._activeTouchIds||(this._activeTouchIds=new Array(this._maxTouchPoints));for(let s=0;s<this._maxTouchPoints;s++)this._activeTouchIds[s]=-1;this._pointerMoveEvent=s=>{const n=this._getPointerType(s);let a=n===Le.Mouse?0:this._activeTouchIds.indexOf(s.pointerId);if(n===Le.Touch&&a===-1){if(s.buttons===0)return;const u=this._activeTouchIds.indexOf(-1);if(u>=0)a=u,this._activeTouchIds[u]=s.pointerId,this._onDeviceConnected(n,a);else{ft.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);return}}this._inputs[n]||(this._inputs[n]={}),this._inputs[n][a]||this._addPointerDevice(n,a,s.clientX,s.clientY);const l=this._inputs[n][a];if(l){const u=s;u.inputIndex=Ve.Move,l[Ve.Horizontal]=s.clientX,l[Ve.Vertical]=s.clientY,n===Le.Touch&&l[Ve.LeftClick]===0&&(l[Ve.LeftClick]=1),s.pointerId===void 0&&(s.pointerId=this._mouseId),this._onInputChanged(n,a,u),!this._usingSafari&&s.button!==-1&&(u.inputIndex=s.button+2,l[s.button+2]=l[s.button+2]?0:1,this._onInputChanged(n,a,u))}},this._pointerDownEvent=s=>{const n=this._getPointerType(s);let a=n===Le.Mouse?0:s.pointerId;if(n===Le.Touch){let u=this._activeTouchIds.indexOf(s.pointerId);if(u===-1&&(u=this._activeTouchIds.indexOf(-1)),u>=0)a=u,this._activeTouchIds[u]=s.pointerId;else{ft.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);return}}this._inputs[n]||(this._inputs[n]={}),this._inputs[n][a]?n===Le.Touch&&this._onDeviceConnected(n,a):this._addPointerDevice(n,a,s.clientX,s.clientY);const l=this._inputs[n][a];if(l){const u=l[Ve.Horizontal],h=l[Ve.Vertical];if(n===Le.Mouse){if(s.pointerId===void 0&&(s.pointerId=this._mouseId),!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(this._mouseId)}catch{}}else if(s.pointerId&&!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(s.pointerId)}catch{}l[Ve.Horizontal]=s.clientX,l[Ve.Vertical]=s.clientY,l[s.button+2]=1;const f=s;f.inputIndex=s.button+2,this._onInputChanged(n,a,f),(u!==s.clientX||h!==s.clientY)&&(f.inputIndex=Ve.Move,this._onInputChanged(n,a,f))}},this._pointerUpEvent=s=>{const n=this._getPointerType(s),a=n===Le.Mouse?0:this._activeTouchIds.indexOf(s.pointerId);if(n===Le.Touch){if(a===-1)return;this._activeTouchIds[a]=-1}const l=this._inputs[n]?.[a];let u=s.button,h=l&&l[u+2]!==0;if(!h&&this._isUsingFirefox&&this._usingMacOs&&l&&(u=u===2?0:2,h=l[u+2]!==0),h){const f=l[Ve.Horizontal],m=l[Ve.Vertical];l[Ve.Horizontal]=s.clientX,l[Ve.Vertical]=s.clientY,l[u+2]=0;const p=s;s.pointerId===void 0&&(s.pointerId=this._mouseId),(f!==s.clientX||m!==s.clientY)&&(p.inputIndex=Ve.Move,this._onInputChanged(n,a,p)),p.inputIndex=u+2,n===Le.Mouse&&this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)?this._elementToAttachTo.releasePointerCapture(this._mouseId):s.pointerId&&this._elementToAttachTo.hasPointerCapture?.(s.pointerId)&&this._elementToAttachTo.releasePointerCapture(s.pointerId),this._onInputChanged(n,a,p),n===Le.Touch&&this._onDeviceDisconnected(n,a)}},this._pointerCancelTouch=s=>{const n=this._activeTouchIds.indexOf(s);if(n===-1)return;this._elementToAttachTo.hasPointerCapture?.(s)&&this._elementToAttachTo.releasePointerCapture(s),this._inputs[Le.Touch][n][Ve.LeftClick]=0;const a=ma.CreateDeviceEvent(Le.Touch,n,Ve.LeftClick,0,this,this._elementToAttachTo,s);this._onInputChanged(Le.Touch,n,a),this._activeTouchIds[n]=-1,this._onDeviceDisconnected(Le.Touch,n)},this._pointerCancelEvent=s=>{if(s.pointerType==="mouse"){const n=this._inputs[Le.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let a=Ve.LeftClick;a<=Ve.BrowserForward;a++)if(n[a]===1){n[a]=0;const l=ma.CreateDeviceEvent(Le.Mouse,0,a,0,this,this._elementToAttachTo);this._onInputChanged(Le.Mouse,0,l)}}else this._pointerCancelTouch(s.pointerId)},this._pointerLeaveEvent=s=>{s.pointerType==="pen"&&this._pointerCancelTouch(s.pointerId)},this._wheelEventName="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=!1;const t=function(){};try{const s=Object.defineProperty({},"passive",{get:function(){e=!0}});this._elementToAttachTo.addEventListener("test",t,s),this._elementToAttachTo.removeEventListener("test",t,s)}catch{}this._pointerBlurEvent=()=>{if(this.isDeviceAvailable(Le.Mouse)){const s=this._inputs[Le.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let n=Ve.LeftClick;n<=Ve.BrowserForward;n++)if(s[n]===1){s[n]=0;const a=ma.CreateDeviceEvent(Le.Mouse,0,n,0,this,this._elementToAttachTo);this._onInputChanged(Le.Mouse,0,a)}}if(this.isDeviceAvailable(Le.Touch)){const s=this._inputs[Le.Touch];for(let n=0;n<this._activeTouchIds.length;n++){const a=this._activeTouchIds[n];if(this._elementToAttachTo.hasPointerCapture?.(a)&&this._elementToAttachTo.releasePointerCapture(a),a!==-1&&s[n]?.[Ve.LeftClick]===1){s[n][Ve.LeftClick]=0;const l=ma.CreateDeviceEvent(Le.Touch,n,Ve.LeftClick,0,this,this._elementToAttachTo,a);this._onInputChanged(Le.Touch,n,l),this._activeTouchIds[n]=-1,this._onDeviceDisconnected(Le.Touch,n)}}}},this._pointerWheelEvent=s=>{const n=Le.Mouse,a=0;this._inputs[n]||(this._inputs[n]=[]),this._inputs[n][a]||(this._pointerActive=!0,this._registerDevice(n,a,VR));const l=this._inputs[n][a];if(l){l[Ve.MouseWheelX]=s.deltaX||0,l[Ve.MouseWheelY]=s.deltaY||s.wheelDelta||0,l[Ve.MouseWheelZ]=s.deltaZ||0;const u=s;s.pointerId===void 0&&(s.pointerId=this._mouseId),l[Ve.MouseWheelX]!==0&&(u.inputIndex=Ve.MouseWheelX,this._onInputChanged(n,a,u)),l[Ve.MouseWheelY]!==0&&(u.inputIndex=Ve.MouseWheelY,this._onInputChanged(n,a,u)),l[Ve.MouseWheelZ]!==0&&(u.inputIndex=Ve.MouseWheelZ,this._onInputChanged(n,a,u))}},this._usingMacOs&&this._isUsingChromium&&(this._pointerMacOsChromeOutEvent=s=>{s.buttons>1&&this._pointerCancelEvent(s)},this._elementToAttachTo.addEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent)),this._elementToAttachTo.addEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.addEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.addEventListener(this._wheelEventName,this._pointerWheelEvent,e?{passive:!1}:!1),this._pointerInputClearObserver=this._engine.onEndFrameObservable.add(()=>{if(this.isDeviceAvailable(Le.Mouse)){const s=this._inputs[Le.Mouse][0];s[Ve.MouseWheelX]=0,s[Ve.MouseWheelY]=0,s[Ve.MouseWheelZ]=0}})}_handleGamepadActions(){this._gamepadConnectedEvent=e=>{this._addGamePad(e.gamepad)},this._gamepadDisconnectedEvent=e=>{if(this._gamepads){const t=this._getGamepadDeviceType(e.gamepad.id),s=e.gamepad.index;this._unregisterDevice(t,s),delete this._gamepads[s]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)}_updateDevice(e,t,s){const n=navigator.getGamepads()[t];if(n&&e===this._gamepads[t]){const a=this._inputs[e][t];s>=n.buttons.length?a[s]=n.axes[s-n.buttons.length].valueOf():a[s]=n.buttons[s].value}}_getGamepadDeviceType(e){return e.indexOf("054c")!==-1?e.indexOf("0ce6")!==-1?Le.DualSense:Le.DualShock:e.indexOf("Xbox One")!==-1||e.search("Xbox 360")!==-1||e.search("xinput")!==-1||e.indexOf("045e")!==-1&&e.indexOf("Surface Dock")===-1?Le.Xbox:e.indexOf("057e")!==-1?Le.Switch:Le.Generic}_getPointerType(e){let t=Le.Mouse;return(e.pointerType==="touch"||e.pointerType==="pen"||e.touches)&&(t=Le.Touch),t}}class XR{constructor(e,t,s=0){this.deviceType=t,this.deviceSlot=s,this.onInputChangedObservable=new xe,this._deviceInputSystem=e}getInput(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}class a4{constructor(e){this._registeredManagers=new Array,this._refCount=0,this.registerManager=l=>{for(let u=0;u<this._devices.length;u++){const h=this._devices[u];for(const f in h){const m=+f;l._addDevice(new XR(this._deviceInputSystem,u,m))}}this._registeredManagers.push(l)},this.unregisterManager=l=>{const u=this._registeredManagers.indexOf(l);u>-1&&this._registeredManagers.splice(u,1)};const t=Object.keys(Le).length/2;this._devices=new Array(t);const s=(l,u)=>{this._devices[l]||(this._devices[l]=new Array),this._devices[l][u]||(this._devices[l][u]=u);for(const h of this._registeredManagers){const f=new XR(this._deviceInputSystem,l,u);h._addDevice(f)}},n=(l,u)=>{this._devices[l]?.[u]&&delete this._devices[l][u];for(const h of this._registeredManagers)h._removeDevice(l,u)},a=(l,u,h)=>{if(h)for(const f of this._registeredManagers)f._onInputChanged(l,u,h)};typeof _native<"u"?this._deviceInputSystem=new n4(s,n,a):this._deviceInputSystem=new r4(e,s,n,a)}dispose(){this._deviceInputSystem.dispose()}}class o4{getDeviceSource(e,t){if(t===void 0){if(this._firstDevice[e]===void 0)return null;t=this._firstDevice[e]}return!this._devices[e]||this._devices[e][t]===void 0?null:this._devices[e][t]}getDeviceSources(e){return this._devices[e]?this._devices[e].filter(t=>!!t):[]}constructor(e){const t=Object.keys(Le).length/2;this._devices=new Array(t),this._firstDevice=new Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new a4(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new xe(s=>{for(const n of this._devices)if(n)for(const a of n)a&&this.onDeviceConnectedObservable.notifyObserver(s,a)}),this.onDeviceDisconnectedObservable=new xe,this._engine._deviceSourceManager.registerManager(this),this._onDisposeObserver=e.onDisposeObservable.add(()=>{this.dispose()})}dispose(){this.onDeviceConnectedObservable.clear(),this.onDeviceDisconnectedObservable.clear(),this._engine._deviceSourceManager&&(this._engine._deviceSourceManager.unregisterManager(this),--this._engine._deviceSourceManager._refCount<1&&(this._engine._deviceSourceManager.dispose(),delete this._engine._deviceSourceManager)),this._engine.onDisposeObservable.remove(this._onDisposeObserver)}_addDevice(e){this._devices[e.deviceType]||(this._devices[e.deviceType]=[]),this._devices[e.deviceType][e.deviceSlot]||(this._devices[e.deviceType][e.deviceSlot]=e,this._updateFirstDevices(e.deviceType)),this.onDeviceConnectedObservable.notifyObservers(e)}_removeDevice(e,t){const s=this._devices[e]?.[t];this.onDeviceDisconnectedObservable.notifyObservers(s),this._devices[e]?.[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,s){this._devices[e]?.[t]?.onInputChangedObservable.notifyObservers(s)}_updateFirstDevices(e){switch(e){case Le.Keyboard:case Le.Mouse:this._firstDevice[e]=0;break;case Le.Touch:case Le.DualSense:case Le.DualShock:case Le.Xbox:case Le.Switch:case Le.Generic:{delete this._firstDevice[e];const t=this._devices[e];if(t){for(let s=0;s<t.length;s++)if(t[s]){this._firstDevice[e]=s;break}}break}}}}class NA{}NA._IsPickingAvailable=!1;class qR{constructor(){this._singleClick=!1,this._doubleClick=!1,this._hasSwiped=!1,this._ignore=!1}get singleClick(){return this._singleClick}get doubleClick(){return this._doubleClick}get hasSwiped(){return this._hasSwiped}get ignore(){return this._ignore}set singleClick(e){this._singleClick=e}set doubleClick(e){this._doubleClick=e}set hasSwiped(e){this._hasSwiped=e}set ignore(e){this._ignore=e}}class ss{constructor(e){this._alreadyAttached=!1,this._meshPickProceed=!1,this._currentPickResult=null,this._previousPickResult=null,this._activePointerIds=new Array,this._activePointerIdsCount=0,this._doubleClickOccured=!1,this._isSwiping=!1,this._swipeButtonPressed=-1,this._skipPointerTap=!1,this._isMultiTouchGesture=!1,this._pointerX=0,this._pointerY=0,this._startingPointerPosition=new Xe(0,0),this._previousStartingPointerPosition=new Xe(0,0),this._startingPointerTime=0,this._previousStartingPointerTime=0,this._pointerCaptures={},this._meshUnderPointerId={},this._movePointerInfo=null,this._cameraObserverCount=0,this._delayedClicks=[null,null,null,null,null],this._deviceSourceManager=null,this._scene=e||pt.LastCreatedScene,this._scene}get meshUnderPointer(){return this._movePointerInfo&&(this._movePointerInfo._generatePickInfo(),this._movePointerInfo=null),this._pointerOverMesh}getMeshUnderPointerByPointerId(e){return this._meshUnderPointerId[e]||null}get unTranslatedPointer(){return new Xe(this._unTranslatedPointerX,this._unTranslatedPointerY)}get pointerX(){return this._pointerX}set pointerX(e){this._pointerX=e}get pointerY(){return this._pointerY}set pointerY(e){this._pointerY=e}_updatePointerPosition(e){const t=this._scene.getEngine().getInputElementClientRect();t&&(this._pointerX=e.clientX-t.left,this._pointerY=e.clientY-t.top,this._unTranslatedPointerX=this._pointerX,this._unTranslatedPointerY=this._pointerY)}_processPointerMove(e,t){const s=this._scene,n=s.getEngine(),a=n.getInputElement();a&&(a.tabIndex=n.canvasTabIndex,s.doNotHandleCursors||(a.style.cursor=s.defaultCursor)),this._setCursorAndPointerOverMesh(e,t,s);for(const h of s._pointerMoveStage){e=e||this._pickMove(t);const f=!!e?.pickedMesh;e=h.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,f,a)}const l=t.inputIndex>=Ve.MouseWheelX&&t.inputIndex<=Ve.MouseWheelZ?at.POINTERWHEEL:at.POINTERMOVE;s.onPointerMove&&(e=e||this._pickMove(t),s.onPointerMove(t,e,l));let u;e?(u=new sr(l,t,e),this._setRayOnPointerInfo(e,t)):(u=new sr(l,t,null,this),this._movePointerInfo=u),s.onPointerObservable.hasObservers()&&s.onPointerObservable.notifyObservers(u,l)}_setRayOnPointerInfo(e,t){const s=this._scene;e&&NA._IsPickingAvailable&&(e.ray||(e.ray=s.createPickingRay(t.offsetX,t.offsetY,ee.Identity(),s.activeCamera)))}_addCameraPointerObserver(e,t){return this._cameraObserverCount++,this._scene.onPointerObservable.add(e,t)}_removeCameraPointerObserver(e){return this._cameraObserverCount--,this._scene.onPointerObservable.remove(e)}_checkForPicking(){return!!(this._scene.onPointerObservable.observers.length>this._cameraObserverCount||this._scene.onPointerPick)}_checkPrePointerObservable(e,t,s){const n=this._scene,a=new DG(s,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(a.originalPickingInfo=e,a.ray=e.ray,t.pointerType==="xr-near"&&e.originMesh&&(a.nearInteractionPickingInfo=e)),n.onPrePointerObservable.notifyObservers(a,s),!!a.skipOnPointerObservable}_pickMove(e){const t=this._scene,s=t.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,t.pointerMovePredicate,t.pointerMoveFastCheck,t.cameraToUseForPointers,t.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(s,e,t),s}_setCursorAndPointerOverMesh(e,t,s){const a=s.getEngine().getInputElement();if(e?.pickedMesh){if(this.setPointerOverMesh(e.pickedMesh,t.pointerId,e,t),!s.doNotHandleCursors&&a&&this._pointerOverMesh){const l=this._pointerOverMesh._getActionManagerForTrigger();l&&l.hasPointerTriggers&&(a.style.cursor=l.hoverCursor||s.hoverCursor)}}else this.setPointerOverMesh(null,t.pointerId,e,t)}simulatePointerMove(e,t){const s=new PointerEvent("pointermove",t);s.inputIndex=Ve.Move,!this._checkPrePointerObservable(e,s,at.POINTERMOVE)&&this._processPointerMove(e,s)}simulatePointerDown(e,t){const s=new PointerEvent("pointerdown",t);s.inputIndex=s.button+2,!this._checkPrePointerObservable(e,s,at.POINTERDOWN)&&this._processPointerDown(e,s)}_processPointerDown(e,t){const s=this._scene;if(e?.pickedMesh){this._pickedDownMesh=e.pickedMesh;const l=e.pickedMesh._getActionManagerForTrigger();if(l){if(l.hasPickTriggers)switch(l.processTrigger(5,new Fs(e.pickedMesh,s.pointerX,s.pointerY,e.pickedMesh,t,e)),t.button){case 0:l.processTrigger(2,new Fs(e.pickedMesh,s.pointerX,s.pointerY,e.pickedMesh,t,e));break;case 1:l.processTrigger(4,new Fs(e.pickedMesh,s.pointerX,s.pointerY,e.pickedMesh,t,e));break;case 2:l.processTrigger(3,new Fs(e.pickedMesh,s.pointerX,s.pointerY,e.pickedMesh,t,e));break}l.hasSpecificTrigger(8)&&window.setTimeout(()=>{const u=s.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,h=>h.isPickable&&h.isVisible&&h.isReady()&&h.actionManager&&h.actionManager.hasSpecificTrigger(8)&&h===this._pickedDownMesh,!1,s.cameraToUseForPointers);u?.pickedMesh&&l&&this._activePointerIdsCount!==0&&Date.now()-this._startingPointerTime>ss.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,l.processTrigger(8,Fs.CreateNew(u.pickedMesh,t)))},ss.LongPressDelay)}}else for(const l of s._pointerDownStage)e=l.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,!1);let n;const a=at.POINTERDOWN;e?(s.onPointerDown&&s.onPointerDown(t,e,a),n=new sr(a,t,e),this._setRayOnPointerInfo(e,t)):n=new sr(a,t,null,this),s.onPointerObservable.hasObservers()&&s.onPointerObservable.notifyObservers(n,a)}_isPointerSwiping(){return this._isSwiping}simulatePointerUp(e,t,s){const n=new PointerEvent("pointerup",t);n.inputIndex=Ve.Move;const a=new qR;s?a.doubleClick=!0:a.singleClick=!0,!this._checkPrePointerObservable(e,n,at.POINTERUP)&&this._processPointerUp(e,n,a)}_processPointerUp(e,t,s){const n=this._scene;if(e?.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(n.onPointerPick&&n.onPointerPick(t,e),s.singleClick&&!s.ignore&&n.onPointerObservable.observers.length>this._cameraObserverCount)){const l=at.POINTERPICK,u=new sr(l,t,e);this._setRayOnPointerInfo(e,t),n.onPointerObservable.notifyObservers(u,l)}const a=e.pickedMesh._getActionManagerForTrigger();if(a&&!s.ignore){a.processTrigger(7,Fs.CreateNew(e.pickedMesh,t,e)),!s.hasSwiped&&s.singleClick&&a.processTrigger(1,Fs.CreateNew(e.pickedMesh,t,e));const l=e.pickedMesh._getActionManagerForTrigger(6);s.doubleClick&&l&&l.processTrigger(6,Fs.CreateNew(e.pickedMesh,t,e))}}else if(!s.ignore)for(const a of n._pointerUpStage)e=a.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,s.doubleClick);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){const a=this._pickedDownMesh._getActionManagerForTrigger(16);a&&a.processTrigger(16,Fs.CreateNew(this._pickedDownMesh,t))}if(!s.ignore){const a=new sr(at.POINTERUP,t,e);if(this._setRayOnPointerInfo(e,t),n.onPointerObservable.notifyObservers(a,at.POINTERUP),n.onPointerUp&&n.onPointerUp(t,e,at.POINTERUP),!s.hasSwiped&&!this._skipPointerTap&&!this._isMultiTouchGesture){let l=0;if(s.singleClick?l=at.POINTERTAP:s.doubleClick&&(l=at.POINTERDOUBLETAP),l){const u=new sr(l,t,e);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(l)&&n.onPointerObservable.notifyObservers(u,l)}}}}isPointerCaptured(e=0){return this._pointerCaptures[e]}attachControl(e=!0,t=!0,s=!0,n=null){const a=this._scene,l=a.getEngine();n||(n=l.getInputElement()),this._alreadyAttached&&this.detachControl(),n&&(this._alreadyAttachedTo=n),this._deviceSourceManager=new o4(l),this._initActionManager=u=>{if(!this._meshPickProceed){const h=a.skipPointerUpPicking||a._registeredActions===0&&!this._checkForPicking()&&!a.onPointerUp?null:a.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,a.pointerUpPredicate,a.pointerUpFastCheck,a.cameraToUseForPointers,a.pointerUpTrianglePredicate);this._currentPickResult=h,h&&(u=h.hit&&h.pickedMesh?h.pickedMesh._getActionManagerForTrigger():null),this._meshPickProceed=!0}return u},this._delayedSimpleClick=(u,h,f)=>{if((Date.now()-this._previousStartingPointerTime>ss.DoubleClickDelay&&!this._doubleClickOccured||u!==this._previousButtonPressed)&&(this._doubleClickOccured=!1,h.singleClick=!0,h.ignore=!1,this._delayedClicks[u])){const m=this._delayedClicks[u].evt,p=at.POINTERTAP,b=new sr(p,m,this._currentPickResult);a.onPointerObservable.hasObservers()&&a.onPointerObservable.hasSpecificMask(p)&&a.onPointerObservable.notifyObservers(b,p),this._delayedClicks[u]=null}},this._initClickEvent=(u,h,f,m)=>{const p=new qR;this._currentPickResult=null;let b=null,v=u.hasSpecificMask(at.POINTERPICK)||h.hasSpecificMask(at.POINTERPICK)||u.hasSpecificMask(at.POINTERTAP)||h.hasSpecificMask(at.POINTERTAP)||u.hasSpecificMask(at.POINTERDOUBLETAP)||h.hasSpecificMask(at.POINTERDOUBLETAP);!v&&Ii&&(b=this._initActionManager(b,p),b&&(v=b.hasPickTriggers));let R=!1;if(v=v&&!this._isMultiTouchGesture,v){const x=f.button;if(p.hasSwiped=this._isPointerSwiping(),!p.hasSwiped){let T=!ss.ExclusiveDoubleClickMode;if(T||(T=!u.hasSpecificMask(at.POINTERDOUBLETAP)&&!h.hasSpecificMask(at.POINTERDOUBLETAP),T&&!Ii.HasSpecificTrigger(6)&&(b=this._initActionManager(b,p),b&&(T=!b.hasSpecificTrigger(6)))),T)(Date.now()-this._previousStartingPointerTime>ss.DoubleClickDelay||x!==this._previousButtonPressed)&&(p.singleClick=!0,m(p,this._currentPickResult),R=!0);else{const A={evt:f,clickInfo:p,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,x,p,m),ss.DoubleClickDelay)};this._delayedClicks[x]=A}let E=u.hasSpecificMask(at.POINTERDOUBLETAP)||h.hasSpecificMask(at.POINTERDOUBLETAP);!E&&Ii.HasSpecificTrigger(6)&&(b=this._initActionManager(b,p),b&&(E=b.hasSpecificTrigger(6))),E&&(x===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime<ss.DoubleClickDelay&&!this._doubleClickOccured?(!p.hasSwiped&&!this._isPointerSwiping()?(this._previousStartingPointerTime=0,this._doubleClickOccured=!0,p.doubleClick=!0,p.ignore=!1,ss.ExclusiveDoubleClickMode&&this._delayedClicks[x]&&(clearTimeout(this._delayedClicks[x]?.timeoutId),this._delayedClicks[x]=null),m(p,this._currentPickResult)):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=x,ss.ExclusiveDoubleClickMode?(this._delayedClicks[x]&&(clearTimeout(this._delayedClicks[x]?.timeoutId),this._delayedClicks[x]=null),m(p,this._previousPickResult)):m(p,this._currentPickResult)),R=!0):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=x))}}R||m(p,this._currentPickResult)},this._onPointerMove=u=>{if(this._updatePointerPosition(u),!this._isSwiping&&this._swipeButtonPressed!==-1&&(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>ss.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>ss.DragMovementThreshold),l.isPointerLock&&l._verifyPointerLock(),this._checkPrePointerObservable(null,u,u.inputIndex>=Ve.MouseWheelX&&u.inputIndex<=Ve.MouseWheelZ?at.POINTERWHEEL:at.POINTERMOVE)||!a.cameraToUseForPointers&&!a.activeCamera)return;if(a.skipPointerMovePicking){this._processPointerMove(new Vh,u);return}a.pointerMovePredicate||(a.pointerMovePredicate=f=>f.isPickable&&f.isVisible&&f.isReady()&&f.isEnabled()&&(f.enablePointerMoveEvents||a.constantlyUpdateMeshUnderPointer||f._getActionManagerForTrigger()!==null)&&(!a.cameraToUseForPointers||(a.cameraToUseForPointers.layerMask&f.layerMask)!==0));const h=a._registeredActions>0||a.constantlyUpdateMeshUnderPointer?this._pickMove(u):null;this._processPointerMove(h,u)},this._onPointerDown=u=>{const h=this._activePointerIds.indexOf(-1);if(h===-1?this._activePointerIds.push(u.pointerId):this._activePointerIds[h]=u.pointerId,this._activePointerIdsCount++,this._pickedDownMesh=null,this._meshPickProceed=!1,ss.ExclusiveDoubleClickMode){for(let m=0;m<this._delayedClicks.length;m++)if(this._delayedClicks[m])if(u.button===m)clearTimeout(this._delayedClicks[m]?.timeoutId);else{const p=this._delayedClicks[m].clickInfo;this._doubleClickOccured=!1,p.singleClick=!0,p.ignore=!1;const b=this._delayedClicks[m].evt,v=at.POINTERTAP,R=new sr(v,b,this._currentPickResult);a.onPointerObservable.hasObservers()&&a.onPointerObservable.hasSpecificMask(v)&&a.onPointerObservable.notifyObservers(R,v),this._delayedClicks[m]=null}}if(this._updatePointerPosition(u),this._swipeButtonPressed===-1&&(this._swipeButtonPressed=u.button),a.preventDefaultOnPointerDown&&n&&(u.preventDefault(),n.focus()),this._startingPointerPosition.x=this._pointerX,this._startingPointerPosition.y=this._pointerY,this._startingPointerTime=Date.now(),this._checkPrePointerObservable(null,u,at.POINTERDOWN)||!a.cameraToUseForPointers&&!a.activeCamera)return;this._pointerCaptures[u.pointerId]=!0,a.pointerDownPredicate||(a.pointerDownPredicate=m=>m.isPickable&&m.isVisible&&m.isReady()&&m.isEnabled()&&(!a.cameraToUseForPointers||(a.cameraToUseForPointers.layerMask&m.layerMask)!==0)),this._pickedDownMesh=null;let f;a.skipPointerDownPicking||a._registeredActions===0&&!this._checkForPicking()&&!a.onPointerDown?f=new Vh:f=a.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,a.pointerDownPredicate,a.pointerDownFastCheck,a.cameraToUseForPointers,a.pointerDownTrianglePredicate),this._processPointerDown(f,u)},this._onPointerUp=u=>{const h=this._activePointerIds.indexOf(u.pointerId);h!==-1&&(this._activePointerIds[h]=-1,this._activePointerIdsCount--,this._pickedUpMesh=null,this._meshPickProceed=!1,this._updatePointerPosition(u),a.preventDefaultOnPointerUp&&n&&(u.preventDefault(),n.focus()),this._initClickEvent(a.onPrePointerObservable,a.onPointerObservable,u,(f,m)=>{if(a.onPrePointerObservable.hasObservers()&&(this._skipPointerTap=!1,!f.ignore)){if(this._checkPrePointerObservable(null,u,at.POINTERUP)){this._swipeButtonPressed===u.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1),u.buttons===0&&(this._pointerCaptures[u.pointerId]=!1);return}f.hasSwiped||(f.singleClick&&a.onPrePointerObservable.hasSpecificMask(at.POINTERTAP)&&this._checkPrePointerObservable(null,u,at.POINTERTAP)&&(this._skipPointerTap=!0),f.doubleClick&&a.onPrePointerObservable.hasSpecificMask(at.POINTERDOUBLETAP)&&this._checkPrePointerObservable(null,u,at.POINTERDOUBLETAP)&&(this._skipPointerTap=!0))}if(!this._pointerCaptures[u.pointerId]){this._swipeButtonPressed===u.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1);return}u.buttons===0&&(this._pointerCaptures[u.pointerId]=!1),!(!a.cameraToUseForPointers&&!a.activeCamera)&&(a.pointerUpPredicate||(a.pointerUpPredicate=p=>p.isPickable&&p.isVisible&&p.isReady()&&p.isEnabled()&&(!a.cameraToUseForPointers||(a.cameraToUseForPointers.layerMask&p.layerMask)!==0)),!this._meshPickProceed&&(Ii&&Ii.HasTriggers||this._checkForPicking()||a.onPointerUp)&&this._initActionManager(null,f),m||(m=this._currentPickResult),this._processPointerUp(m,u,f),this._previousPickResult=this._currentPickResult,this._swipeButtonPressed===u.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1))}))},this._onKeyDown=u=>{const h=_c.KEYDOWN;if(a.onPreKeyboardObservable.hasObservers()){const f=new bR(h,u);if(a.onPreKeyboardObservable.notifyObservers(f,h),f.skipOnKeyboardObservable)return}if(a.onKeyboardObservable.hasObservers()){const f=new im(h,u);a.onKeyboardObservable.notifyObservers(f,h)}a.actionManager&&a.actionManager.processTrigger(14,Fs.CreateNewFromScene(a,u))},this._onKeyUp=u=>{const h=_c.KEYUP;if(a.onPreKeyboardObservable.hasObservers()){const f=new bR(h,u);if(a.onPreKeyboardObservable.notifyObservers(f,h),f.skipOnKeyboardObservable)return}if(a.onKeyboardObservable.hasObservers()){const f=new im(h,u);a.onKeyboardObservable.notifyObservers(f,h)}a.actionManager&&a.actionManager.processTrigger(15,Fs.CreateNewFromScene(a,u))},this._deviceSourceManager.onDeviceConnectedObservable.add(u=>{u.deviceType===Le.Mouse?u.onInputChangedObservable.add(h=>{this._originMouseEvent=h,h.inputIndex===Ve.LeftClick||h.inputIndex===Ve.MiddleClick||h.inputIndex===Ve.RightClick||h.inputIndex===Ve.BrowserBack||h.inputIndex===Ve.BrowserForward?t&&u.getInput(h.inputIndex)===1?this._onPointerDown(h):e&&u.getInput(h.inputIndex)===0&&this._onPointerUp(h):s&&(h.inputIndex===Ve.Move?this._onPointerMove(h):(h.inputIndex===Ve.MouseWheelX||h.inputIndex===Ve.MouseWheelY||h.inputIndex===Ve.MouseWheelZ)&&this._onPointerMove(h))}):u.deviceType===Le.Touch?u.onInputChangedObservable.add(h=>{h.inputIndex===Ve.LeftClick&&(t&&u.getInput(h.inputIndex)===1?(this._onPointerDown(h),this._activePointerIdsCount>1&&(this._isMultiTouchGesture=!0)):e&&u.getInput(h.inputIndex)===0&&(this._onPointerUp(h),this._activePointerIdsCount===0&&(this._isMultiTouchGesture=!1))),s&&h.inputIndex===Ve.Move&&this._onPointerMove(h)}):u.deviceType===Le.Keyboard&&u.onInputChangedObservable.add(h=>{h.type==="keydown"?this._onKeyDown(h):h.type==="keyup"&&this._onKeyUp(h)})}),this._alreadyAttached=!0}detachControl(){this._alreadyAttached&&(this._deviceSourceManager.dispose(),this._deviceSourceManager=null,this._alreadyAttachedTo&&!this._scene.doNotHandleCursors&&(this._alreadyAttachedTo.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1,this._alreadyAttachedTo=null)}setPointerOverMesh(e,t=0,s,n){if(this._meshUnderPointerId[t]===e&&(!e||!e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))return;const a=this._meshUnderPointerId[t];let l;a&&(l=a._getActionManagerForTrigger(10),l&&l.processTrigger(10,new Fs(a,this._pointerX,this._pointerY,e,n,{pointerId:t}))),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,l=e._getActionManagerForTrigger(9),l&&l.processTrigger(9,new Fs(e,this._pointerX,this._pointerY,e,n,{pointerId:t,pickResult:s}))):(delete this._meshUnderPointerId[t],this._pointerOverMesh=null),this._scene.onMeshUnderPointerUpdatedObservable.hasObservers()&&this._scene.onMeshUnderPointerUpdatedObservable.notifyObservers({mesh:e,pointerId:t})}getPointerOverMesh(){return this.meshUnderPointer}
474_invalidateMesh(e){this._pointerOverMesh===e&&(this._pointerOverMesh=null),this._pickedDownMesh===e&&(this._pickedDownMesh=null),this._pickedUpMesh===e&&(this._pickedUpMesh=null);for(const t in this._meshUnderPointerId)this._meshUnderPointerId[t]===e&&delete this._meshUnderPointerId[t]}}ss.DragMovementThreshold=10;ss.LongPressDelay=500;ss.DoubleClickDelay=300;ss.ExclusiveDoubleClickMode=!1;class UA{static get UniqueId(){const e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}UA._UniqueIdCounter=1;class l4{constructor(){this.pointerDownFastCheck=!1,this.pointerUpFastCheck=!1,this.pointerMoveFastCheck=!1,this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1}}var WR,YR,KR,ZR,QR,$R,JR,eT,tT,sT,iT,nT,rT,aT,oT,lT,cT,uT,hT,dT,fT,_T,pT,mT,gT,yT,bT,xT,vT,RT,TT,ET,ST,CT,AT,MT,wT,PT,OT,DT,IT,FT,kT,LT,BT,NT,UT,jT,GT,zT,HT,VT,XT;const c4=new ct,u4=new ct;var qT;(function(i){i[i.BackwardCompatible=0]="BackwardCompatible",i[i.Intermediate=1]="Intermediate",i[i.Aggressive=2]="Aggressive"})(qT||(qT={}));class be{static DefaultMaterialFactory(e){throw bt("StandardMaterial")}static CollisionCoordinatorFactory(){throw bt("DefaultCollisionCoordinator")}get clearColor(){return this._clearColor}set clearColor(e){e!==this._clearColor&&(this._clearColor=e,this.onClearColorChangedObservable.notifyObservers(this._clearColor))}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}get performancePriority(){return this._performancePriority}set performancePriority(e){if(e!==this._performancePriority){switch(this._performancePriority=e,e){case 0:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!1,this.autoClear=!0;break;case 1:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!0,this.autoClear=!1;break;case 2:this.skipFrustumClipping=!0,this._renderingManager.maintainStateBetweenFrames=!0,this.skipPointerMovePicking=!0,this.autoClear=!1;break}this.onScenePerformancePriorityChangedObservable.notifyObservers(e)}}set forceWireframe(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(16))}get forceWireframe(){return this._forceWireframe}set skipFrustumClipping(e){this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)}get skipFrustumClipping(){return this._skipFrustumClipping}set forcePointsCloud(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(16))}get forcePointsCloud(){return this._forcePointsCloud}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.onEnvironmentTextureChangedObservable.notifyObservers(e),this.markAllMaterialsAsDirty(1))}getNodes(){let e=[];e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes);for(const t of this.skeletons)e=e.concat(t.bones);return e}get animationPropertiesOverride(){return this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set beforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))}set afterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))}set beforeCameraRender(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)}set afterCameraRender(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)}get pointerDownPredicate(){return this._pointerPickingConfiguration.pointerDownPredicate}set pointerDownPredicate(e){this._pointerPickingConfiguration.pointerDownPredicate=e}get pointerUpPredicate(){return this._pointerPickingConfiguration.pointerUpPredicate}set pointerUpPredicate(e){this._pointerPickingConfiguration.pointerUpPredicate=e}get pointerMovePredicate(){return this._pointerPickingConfiguration.pointerMovePredicate}set pointerMovePredicate(e){this._pointerPickingConfiguration.pointerMovePredicate=e}get pointerDownFastCheck(){return this._pointerPickingConfiguration.pointerDownFastCheck}set pointerDownFastCheck(e){this._pointerPickingConfiguration.pointerDownFastCheck=e}get pointerUpFastCheck(){return this._pointerPickingConfiguration.pointerUpFastCheck}set pointerUpFastCheck(e){this._pointerPickingConfiguration.pointerUpFastCheck=e}get pointerMoveFastCheck(){return this._pointerPickingConfiguration.pointerMoveFastCheck}set pointerMoveFastCheck(e){this._pointerPickingConfiguration.pointerMoveFastCheck=e}get skipPointerMovePicking(){return this._pointerPickingConfiguration.skipPointerMovePicking}set skipPointerMovePicking(e){this._pointerPickingConfiguration.skipPointerMovePicking=e}get skipPointerDownPicking(){return this._pointerPickingConfiguration.skipPointerDownPicking}set skipPointerDownPicking(e){this._pointerPickingConfiguration.skipPointerDownPicking=e}get skipPointerUpPicking(){return this._pointerPickingConfiguration.skipPointerUpPicking}set skipPointerUpPicking(e){this._pointerPickingConfiguration.skipPointerUpPicking=e}get unTranslatedPointer(){return this._inputManager.unTranslatedPointer}static get DragMovementThreshold(){return ss.DragMovementThreshold}static set DragMovementThreshold(e){ss.DragMovementThreshold=e}static get LongPressDelay(){return ss.LongPressDelay}static set LongPressDelay(e){ss.LongPressDelay=e}static get DoubleClickDelay(){return ss.DoubleClickDelay}static set DoubleClickDelay(e){ss.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){return ss.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){ss.ExclusiveDoubleClickMode=e}get _eyePosition(){return this._forcedViewPosition??this.activeCamera?.globalPosition??I.ZeroReadOnly}bindEyePosition(e,t="vEyePosition",s=!1){const n=this._eyePosition,a=this.useRightHandedSystem===(this._mirroredCameraPosition!=null),l=this.floatingOriginOffset,u=c4.set(n.x,n.y,n.z,a?-1:1),h=u.subtractFromFloatsToRef(l.x,l.y,l.z,0,u4);return e&&(s?e.setFloat3(t,h.x,h.y,h.z):e.setVector4(t,h)),u}finalizeSceneUbo(){const e=this.getSceneUniformBuffer(),t=this.bindEyePosition(null),s=this.floatingOriginOffset;return e.updateFloat4("vEyePosition",t.x-s.x,t.y-s.y,t.z-s.z,t.w),e.update(
vendor: 4,193 bytes, line 474
474),e}set useRightHandedSystem(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(16))}get useRightHandedSystem(){return this._useRightHandedSystem}setStepId(e){this._currentStepId=e}getStepId(){return this._currentStepId}getInternalStep(){return this._currentInternalStep}set fogEnabled(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(16))}get fogEnabled(){return this._fogEnabled}set fogMode(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(16))}get fogMode(){return this._fogMode}get prePass(){return!!this.prePassRenderer&&this.prePassRenderer.defaultRT.enabled}set shadowsEnabled(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(2))}get shadowsEnabled(){return this._shadowsEnabled}set lightsEnabled(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(2))}get lightsEnabled(){return this._lightsEnabled}get activeCameras(){return this._activeCameras}set activeCameras(e){this._unObserveActiveCameras&&(this._unObserveActiveCameras(),this._unObserveActiveCameras=null),e&&(this._unObserveActiveCameras=Oj(e,()=>{this.onActiveCamerasChanged.notifyObservers(this)})),this._activeCameras=e}get activeCamera(){return this._activeCamera}set activeCamera(e){e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))}get _hasDefaultMaterial(){return be.DefaultMaterialFactory!==be._OriginalDefaultMaterialFactory}get defaultMaterial(){return this._defaultMaterial||(this._defaultMaterial=be.DefaultMaterialFactory(this)),this._defaultMaterial}set defaultMaterial(e){this._defaultMaterial=e}set texturesEnabled(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(1))}get texturesEnabled(){return this._texturesEnabled}get frameGraph(){return this._frameGraph}set frameGraph(e){if(this._frameGraph){this._frameGraph=e,e||(this.customRenderFunction=this._currentCustomRenderFunction);return}this._frameGraph=e,e&&(this._currentCustomRenderFunction=this.customRenderFunction,this.customRenderFunction=this._renderWithFrameGraph,this.activeCamera=null)}set skeletonsEnabled(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(8))}get skeletonsEnabled(){return this._skeletonsEnabled}get collisionCoordinator(){return this._collisionCoordinator||(this._collisionCoordinator=be.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator}get renderingManager(){return this._renderingManager}get frustumPlanes(){return this._frustumPlanes}_registerTransientComponents(){if(this._transientComponents.length>0){for(const e of this._transientComponents)e.register();this._transientComponents.length=0}}_addComponent(e){this._components.push(e),this._transientComponents.push(e);const t=e;t.addFromContainer&&t.serialize&&this._serializableComponents.push(t)}_getComponent(e){for(const t of this._components)if(t.name===e)return t;return null}get uniqueId(){return this._uniqueId}constructor(e,t){this._inputManager=new ss(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this._clearColor=new St(.2,.2,.3,1),this.onClearColorChangedObservable=new xe,this.ambientColor=new _t(0,0,0),this.environmentIntensity=1,this.iblIntensity=1,this._performancePriority=0,this.onScenePerformancePriorityChangedObservable=new xe,this._forceWireframe=!1,this._skipFrustumClipping=!1,this._forcePointsCloud=!1,this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.objectRenderers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.effectLayers=[],this.sounds=null,this.layers=[],this.lensFlareSystems=[],this.proceduralTextures=[],this.animationsEnabled=!0,this._animationPropertiesOverride=null,this.useConstantAnimationDeltaTime=!1,this.constantlyUpdateMeshUnderPointer=!1,this.hoverCurs
vendor: 10,361 bytes, line 474
474or="pointer",this.defaultCursor="",this.doNotHandleCursors=!1,this.preventDefaultOnPointerDown=!0,this.preventDefaultOnPointerUp=!0,this.metadata=null,this.reservedDataStore=null,this.disableOfflineSupportExceptionRules=[],this.onDisposeObservable=new xe,this._onDisposeObserver=null,this.onBeforeRenderObservable=new xe,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new xe,this.onAfterRenderCameraObservable=new xe,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new xe,this.onAfterAnimationsObservable=new xe,this.onBeforeDrawPhaseObservable=new xe,this.onAfterDrawPhaseObservable=new xe,this.onReadyObservable=new xe,this.onBeforeCameraRenderObservable=new xe,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new xe,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new xe,this.onAfterActiveMeshesEvaluationObservable=new xe,this.onBeforeParticlesRenderingObservable=new xe,this.onAfterParticlesRenderingObservable=new xe,this.onDataLoadedObservable=new xe,this.onNewCameraAddedObservable=new xe,this.onCameraRemovedObservable=new xe,this.onNewLightAddedObservable=new xe,this.onLightRemovedObservable=new xe,this.onNewGeometryAddedObservable=new xe,this.onGeometryRemovedObservable=new xe,this.onNewTransformNodeAddedObservable=new xe,this.onTransformNodeRemovedObservable=new xe,this.onNewMeshAddedObservable=new xe,this.onMeshRemovedObservable=new xe,this.onNewSkeletonAddedObservable=new xe,this.onSkeletonRemovedObservable=new xe,this.onNewParticleSystemAddedObservable=new xe,this.onParticleSystemRemovedObservable=new xe,this.onNewAnimationGroupAddedObservable=new xe,this.onAnimationGroupRemovedObservable=new xe,this.onNewMaterialAddedObservable=new xe,this.onNewMultiMaterialAddedObservable=new xe,this.onMaterialRemovedObservable=new xe,this.onMultiMaterialRemovedObservable=new xe,this.onNewTextureAddedObservable=new xe,this.onTextureRemovedObservable=new xe,this.onNewFrameGraphAddedObservable=new xe,this.onFrameGraphRemovedObservable=new xe,this.onNewObjectRendererAddedObservable=new xe,this.onObjectRendererRemovedObservable=new xe,this.onNewPostProcessAddedObservable=new xe,this.onPostProcessRemovedObservable=new xe,this.onNewEffectLayerAddedObservable=new xe,this.onEffectLayerRemovedObservable=new xe,this.onBeforeRenderTargetsRenderObservable=new xe,this.onAfterRenderTargetsRenderObservable=new xe,this.onBeforeStepObservable=new xe,this.onAfterStepObservable=new xe,this.onActiveCameraChanged=new xe,this.onActiveCamerasChanged=new xe,this.onBeforeRenderingGroupObservable=new xe,this.onAfterRenderingGroupObservable=new xe,this.onMeshImportedObservable=new xe,this.onAnimationFileImportedObservable=new xe,this.onEnvironmentTextureChangedObservable=new xe,this.onMeshUnderPointerUpdatedObservable=new xe,this._registeredForLateAnimationBindings=new pa(256),this._pointerPickingConfiguration=new l4,this.onPrePointerObservable=new xe,this.onPointerObservable=new xe,this.onPreKeyboardObservable=new xe,this.onKeyboardObservable=new xe,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=be.FOGMODE_NONE,this.fogColor=new _t(.2,.2,.3),this.fogDensity=.1,this.fogStart=0,this.fogEnd=1e3,this.needsPreviousWorldMatrices=!1,this._shadowsEnabled=!0,this._lightsEnabled=!0,this._unObserveActiveCameras=null,this._texturesEnabled=!0,this._frameGraph=null,this.frameGraphs=[],this.physicsEnabled=!0,this.particlesEnabled=!0,this.spritesEnabled=!0,this._skeletonsEnabled=!0,this.lensFlaresEnabled=!0,this.collisionsEnabled=!0,this.gravity=new I(0,-9.807,0),this.postProcessesEnabled=!0,this.renderTargetsEnabled=!0,this.dumpNextRenderTargets=!1,this.customRenderTargets=[],this.importedMeshesFiles=[],this.probesEnabled=!0,this._meshesForIntersections=new pa(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new nn,this._activeIndices=new nn,this._activeParticles=new nn,this._activeBones=new nn,this._animationTime=0,this.animationTimeScale=1,this._renderId=0,this._frameId=0,this._renderingMeshEvaluationDepth=0,this._executeWhenReadyTimeoutId=null,this._intermediateRendering=!1,this._defaultFrameBufferCleared=!1,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1,this._toBeDisposed=new Array(256),this._activeRequests=new Array,this._delayedFileRequests=null,this._pendingData=[],this._isDisposed=!1,this._isDisposing=!1,this._isReadyChecks=[],this.dispatchAllSubMeshesOfActiveMeshes=!1,this._activeMeshes=new bi(256),this._processedMaterials=new bi(256),this._renderTargets=new pa(256),this._materialsRenderTargets=new pa(256),this._activeParticleSystems=new bi(256),this._activeSkeletons=new pa(32),this._softwareSkinnedMeshes=new pa(32),this._activeAnimatables=new Array,this._transformMatrix=ee.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=ts.Create(),this._beforeClearStage=ts.Create(),this._beforeRenderTargetClearStage=ts.Create(),this._gatherRenderTargetsStage=ts.Create(),this._gatherActiveCameraRenderTargetsStage=ts.Create(),this._isReadyForMeshStage=ts.Create(),this._beforeEvaluateActiveMeshStage=ts.Create(),this._evaluateSubMeshStage=ts.Create(),this._preActiveMeshStage=ts.Create(),this._cameraDrawRenderTargetStage=ts.Create(),this._beforeCameraDrawStage=ts.Create(),this._beforeRenderTargetDrawStage=ts.Create(),this._beforeRenderingGroupDrawStage=ts.Create(),this._beforeRenderingMeshStage=ts.Create(),this._afterRenderingMeshStage=ts.Create(),this._afterRenderingGroupDrawStage=ts.Create(),this._afterCameraDrawStage=ts.Create(),this._afterCameraPostProcessStage=ts.Create(),this._afterRenderTargetDrawStage=ts.Create(),this._afterRenderTargetPostProcessStage=ts.Create(),this._afterRenderStage=ts.Create(),this._pointerMoveStage=ts.Create(),this._pointerDownStage=ts.Create(),this._pointerUpStage=ts.Create(),this._geometriesByUniqueId=null,this._uniqueId=0,this._defaultMeshCandidates={data:[],length:0},this._defaultSubMeshCandidates={data:[],length:0},this.onReadyTimeoutObservable=new xe,this.onReadyTimeoutDuration=120*1e3,this._timeoutChecksStartTime=0,this._floatingOriginScene=void 0,this._preventFreeActiveMeshesAndRenderingGroups=!1,this._activeMeshesFrozen=!1,this._activeMeshesFrozenButKeepClipping=!1,this._skipEvaluateActiveMeshesCompletely=!1,this._freezeActiveMeshesCancel=null,this._useCurrentFrameBuffer=!1,this._allowPostProcessClearColor=!0,this.getDeterministicFrameTime=()=>this._engine.getTimeStep(),this._getFloatingOriginScene=()=>this._floatingOriginScene,this._registeredActions=0,this._blockMaterialDirtyMechanism=!1,this._perfCollector=null,this.activeCameras=[],this._uniqueId=this.getUniqueId();const s={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,defaultCameraLayerMask:268435455,defaultRenderableLayerMask:268435455,...t};this.defaultCameraLayerMask=s.defaultCameraLayerMask,this.defaultRenderableLayerMask=s.defaultRenderableLayerMask,e=this._engine=e||pt.LastCreatedEngine,s.virtual?e._virtualScenes.push(this):(pt._LastCreatedScene=this,e.scenes.push(this)),(e.getCreationOptions().useLargeWorldRendering||t?.useFloatingOrigin)&&(GG(),this._floatingOriginScene=this,Uh.getScene=this._getFloatingOriginScene),this._uid=null,this._renderingManager=new Qs(this),BR&&(this.postProcessManager=new BR(this)),Bs()&&this.attachControl(),this._createUbo(),LR&&(this._imageProcessingConfiguration=new LR),this.setDefaultCandidateProviders(),s.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=s.useMaterialMeshMap,this.useClonedMeshMap=s.useClonedMeshMap,(!t||!t.virtual)&&e.onNewSceneAddedObservable.notifyObservers(this)}getClassName(){return"Scene"}_getDefaultMeshCandidates(){return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates}_getDefaultSubMeshCandidates(e){return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates}setDefaultCandidateProviders(){this.getActiveMeshCandidates=()=>this._getDefaultMeshCandidates(),this.getActiveSubMeshCandidates=e=>this._getDefaultSubMeshCandidates(e),this.getIntersectingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e),this.getCollidingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e)}get meshUnderPointer(){return this._inputManager.meshUnderPointer}get pointerX(){return this._inputManager.pointerX}set pointerX(e){this._inputManager.pointerX=e}get pointerY(){return this._inputManager.pointerY}set pointerY(e){this._inputManager.pointerY=e}getCachedMaterial(){return this._cachedMaterial}getCachedEffect(){return this._cachedEffect}getCachedVisibility(){return this._cachedVisibility}isCachedMaterialInvalid(e,t,s=1){return this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==s}getEngine(){return this._engine}getTotalVertices(){return this._totalVertices.current}get totalVerticesPerfCounter(){return this._totalVertices}getActiveIndices(){return this._activeIndices.current}get totalActiveIndicesPerfCounter(){return this._activeIndices}getActiveParticles(){return this._activeParticles.current}get activeParticlesPerfCounter(){return this._activeParticles}getActiveBones(){return this._activeBones.current}get activeBonesPerfCounter(){return this._activeBones}getActiveMeshes(){return this._activeMeshes}getAnimationRatio(){return this._animationRatio!==void 0?this._animationRatio:1}getRenderId(){return this._renderId}getFrameId(){return this._frameId}incrementRenderId(){this._renderId++}_createUbo(){this.setSceneUniformBuffer(this.createSceneUniformBuffer())}simulatePointerMove(e,t){return this._inputManager.simulatePointerMove(e,t),this}simulatePointerDown(e,t){return this._inputManager.simulatePointerDown(e,t),this}simulatePointerUp(e,t,s){return this._inputManager.simulatePointerUp(e,t,s),this}isPointerCaptured(e=0){return this._inputManager.isPointerCaptured(e)}attachControl(e=!0,t=!0,s=!0){this._inputManager.attachControl(e,t,s)}detachControl(){this._inputManager.detachControl()}isReady(e=!0){if(this._isDisposed)return!1;let t;const s=this.getEngine(),n=s.currentRenderPassId;s.currentRenderPassId=this.activeCamera?.renderPassId??n;let a=!0;
474for(this._pendingData.length>0&&(a=!1),this.prePassRenderer?.update(),this.useOrderIndependentTransparency&&this.depthPeelingRenderer&&a&&(a=this.depthPeelingRenderer.isReady()),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t<this.meshes.length;t++){const l=this.meshes[t];if(!l.subMeshes||l.subMeshes.length===0)continue;if(!l.isReady(!0)){a=!1;continue}const u=l.hasThinInstances||l.getClassName()==="InstancedMesh"||l.getClassName()==="InstancedLinesMesh"||s.getCaps().instancedArrays&&l.instances.length>0;for(const f of this._isReadyForMeshStage)f.action(l,u)||(a=!1);if(!e)continue;const h=l.material||this.defaultMaterial;if(h)if(h._storeEffectOnSubMeshes)for(const f of l.subMeshes){const m=f.getMaterial();m&&m.hasRenderTargetTextures&&m.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(m)===-1&&(this._processedMaterials.push(m),this._materialsRenderTargets.concatWithNoDuplicate(m.getRenderTargetTextures()))}else h.hasRenderTargetTextures&&h.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(h)===-1&&(this._processedMaterials.push(h),this._materialsRenderTargets.concatWithNoDuplicate(h.getRenderTargetTextures()))}if(e){for(t=0;t<this._materialsRenderTargets.length;++t)this._materialsRenderTargets.data[t].isReadyForRendering()||(a=!1);for(t=0;t<this.customRenderTargets.length;++t)this.customRenderTargets[t].isReadyForRendering()||(a=!1)}for(t=0;t<this.geometries.length;t++)this.geometries[t].delayLoadState===2&&(a=!1);if(this.activeCameras&&this.activeCameras.length>0)for(const l of this.activeCameras)l.isReady(!0)||(a=!1);else this.activeCamera&&(this.activeCamera.isReady(!0)||(a=!1));for(const l of this.particleSystems)l.isReady()||(a=!1);if(this.proceduralTexturesEnabled)for(const l of this.proceduralTextures)l.isReady()||(a=!1);if(this.layers)for(const l of this.layers)l.isReady()||(a=!1);if(this.effectLayers)for(const l of this.effectLayers)l.isLayerReady()||(a=!1);for(const l of this._isReadyChecks)l.isReady()||(a=!1);return s.areAllEffectsReady()||(a=!1),s.currentRenderPassId=n,a}resetCachedMaterial(){this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null}registerBeforeRender(e){this.onBeforeRenderObservable.add(e)}unregisterBeforeRender(e){this.onBeforeRenderObservable.removeCallback(e)}registerAfterRender(e){this.onAfterRenderObservable.add(e)}unregisterAfterRender(e){this.onAfterRenderObservable.removeCallback(e)}_executeOnceBeforeRender(e){const t=()=>{e(),setTimeout(()=>{this.unregisterBeforeRender(t)})};this.registerBeforeRender(t)}executeOnceBeforeRender(e,t){t!==void 0?setTimeout(()=>{this._executeOnceBeforeRender(e)},t):this._executeOnceBeforeRender(e)}addPendingData(e){this._pendingData.push(e)}removePendingData(e){const t=this.isLoading,s=this._pendingData.indexOf(e);s!==-1&&this._pendingData.splice(s,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)}getWaitingItemsCount(){return this._pendingData.length}get isLoading(){return this._pendingData.length>0}addIsReadyCheck(e){this._isReadyChecks.indexOf(e)===-1&&this._isReadyChecks.push(e)}removeIsReadyCheck(e){const t=this._isReadyChecks.indexOf(e);t!==-1&&this._isReadyChecks.splice(t,1)}executeWhenReady(e,t=!1){this.onReadyObservable.addOnce(e),this._executeWhenReadyTimeoutId===null&&this._checkIsReady(t)}async whenReadyAsync(e=!1){return await new Promise(t=>{this.executeWhenReady(()=>{t()},e)})}_clearReadynessChecksData(){this._timeoutChecksStartTime=0,this.onReadyTimeoutObservable.clear(),this.onReadyObservable.clear(),this._executeWhenReadyTimeoutId=null}_checkIsReady(e=!1){if(this._registerTransientComponents(),this._timeoutChecksStartTime===0)this._timeoutChecksStartTime=lr.Now;else if(this.onReadyTimeoutDuration>0&&lr.Now-this._timeoutChecksStartTime>this.onReadyTimeoutDuration){this.onReadyTimeoutObservable.notifyObservers(this),this._clearReadynessChecksData();return}if(this.isReady(e)){this.onReadyObservable.notifyObservers(this),this._clearReadynessChecksData();return}if(this._isDisposed){this._clearReadynessChecksData();return}this._executeWhenReadyTimeoutId=setTimeout(()=>{this.incrementRenderId(),this._checkIsReady(e)},100)}get animatables(){return this._activeAnimatables}resetLastAnimationTimeFrame(){this._animationTimeLast=lr.Now}getViewMatrix(){return this._viewMatrix}getProjectionMatrix(){return this._projectionMatrix}getInverseProjectionMatrix(){return this._inverseProjectionMatrix}getTransformMatrix(){return this._transformMatrix}setTransformMatrix(e,t,s,n){this._multiviewSceneUboIsActive=!!(s&&n&&this._multiviewSceneUbo),!(this._viewUpdateFlag===e.updateFlag&&this._projectionUpdateFlag===t.updateFlag)&&(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._inverseProjectionMatrix||(this._inverseProjectionMatrix=new ee),this._projectionMatrix.invertToRef(this._inverseProjectionMatrix),this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?Yi.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=Yi.GetPlanes(this._transformMatrix),this._multiviewSceneUboIsActive&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(s,n):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.updateMatrix("projection",this._projectionMatrix),this._sceneUbo.updateMatrix("inverseProjection",this._inverseProjectionMatrix)))}getSceneUniformBuffer(){return this._multiviewSceneUboIsActive&&this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo}createSceneUniformBuffer(e,t){const s=typeof t=="boolean"?t:t?.trackUBOsInFrame,n=new De(this._engine,void 0,!1,e??"scene",void 0,s);return n.addUniform("viewProjection",16),n.addUniform("view",16),n.addUniform("projection",16),n.addUniform("vEyePosition",4),n.addUniform("inverseProjection",16),n}setSceneUniformBuffer(e){this._sceneUbo=e,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1}get floatingOriginMode(){return this._floatingOriginScene!==void 0}get floatingOriginOffset(){return this.floatingOriginMode?this._eyePosition:I.ZeroReadOnly}getUniqueId(){return UA.UniqueId}
vendor: 12,399 bytes, line 474
474addMesh(e,t=!1){if(!this._blockEntityCollection&&(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),Vs.SetImmediate(()=>{this.onNewMeshAddedObservable.notifyObservers(e)}),t)){const s=e.getChildMeshes();for(const n of s)this.addMesh(n)}}removeMesh(e,t=!1){const s=this.meshes.indexOf(e);if(s!==-1&&(this.meshes.splice(s,1),e.parent||e._removeFromSceneRootNodes()),this._inputManager._invalidateMesh(e),this.onMeshRemovedObservable.notifyObservers(e),t){const n=e.getChildMeshes();for(const a of n)this.removeMesh(a)}return s}addTransformNode(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneTransformNodesArray!==-1||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))}removeTransformNode(e){const t=e._indexInSceneTransformNodesArray;if(t!==-1){if(t!==this.transformNodes.length-1){const s=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=s,s._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t}removeSkeleton(e){const t=this.skeletons.indexOf(e);return t!==-1&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e),this._executeActiveContainerCleanup(this._activeSkeletons)),t}removeMorphTargetManager(e){const t=this.morphTargetManagers.indexOf(e);return t!==-1&&this.morphTargetManagers.splice(t,1),t}removeLight(e){const t=this.lights.indexOf(e);if(t!==-1){for(const s of this.meshes)s._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes(),this.onLightRemovedObservable.notifyObservers(e)}return t}removeCamera(e){const t=this.cameras.indexOf(e);if(t!==-1&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes()),this.activeCameras){const s=this.activeCameras.indexOf(e);s!==-1&&this.activeCameras.splice(s,1)}return this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t}removeParticleSystem(e){const t=this.particleSystems.indexOf(e);return t!==-1&&(this.particleSystems.splice(t,1),this._executeActiveContainerCleanup(this._activeParticleSystems)),this.onParticleSystemRemovedObservable.notifyObservers(e),t}removeAnimation(e){const t=this.animations.indexOf(e);return t!==-1&&this.animations.splice(t,1),t}stopAnimation(e,t,s){}removeAnimationGroup(e){const t=this.animationGroups.indexOf(e);return t!==-1&&this.animationGroups.splice(t,1),this.onAnimationGroupRemovedObservable.notifyObservers(e),t}removeMultiMaterial(e){const t=this.multiMaterials.indexOf(e);return t!==-1&&this.multiMaterials.splice(t,1),this.onMultiMaterialRemovedObservable.notifyObservers(e),t}removeMaterial(e){const t=e._indexInSceneMaterialArray;if(t!==-1&&t<this.materials.length){if(t!==this.materials.length-1){const s=this.materials[this.materials.length-1];this.materials[t]=s,s._indexInSceneMaterialArray=t}e._indexInSceneMaterialArray=-1,this.materials.pop()}return this.onMaterialRemovedObservable.notifyObservers(e),t}removeActionManager(e){const t=this.actionManagers.indexOf(e);return t!==-1&&this.actionManagers.splice(t,1),t}removeTexture(e){const t=this.textures.indexOf(e);return t!==-1&&this.textures.splice(t,1),this.onTextureRemovedObservable.notifyObservers(e),t}removeFrameGraph(e){const t=this.frameGraphs.indexOf(e);return t!==-1&&this.frameGraphs.splice(t,1),this.onFrameGraphRemovedObservable.notifyObservers(e),t}removeObjectRenderer(e){const t=this.objectRenderers.indexOf(e);return t!==-1&&this.objectRenderers.splice(t,1),this.onObjectRendererRemovedObservable.notifyObservers(e),t}removePostProcess(e){const t=this.postProcesses.indexOf(e);return t!==-1&&this.postProcesses.splice(t,1),this.onPostProcessRemovedObservable.notifyObservers(e),t}removeEffectLayer(e){const t=this.effectLayers.indexOf(e);return t!==-1&&this.effectLayers.splice(t,1),this.onEffectLayerRemovedObservable.notifyObservers(e),t}addLight(e){if(!this._blockEntityCollection){this.lights.push(e),this.sortLightsByPriority(),e.parent||e._addToSceneRootNodes();for(const t of this.meshes)t.lightSources.indexOf(e)===-1&&(t.lightSources.push(e),t._resyncLightSources());Vs.SetImmediate(()=>{this.onNewLightAddedObservable.notifyObservers(e)})}}sortLightsByPriority(){this.requireLightSorting&&this.lights.sort(Us.CompareLightsPriority)}addCamera(e){this._blockEntityCollection||(this.cameras.push(e),Vs.SetImmediate(()=>{this.onNewCameraAddedObservable.notifyObservers(e)}),e.parent||e._addToSceneRootNodes())}addSkeleton(e){this._blockEntityCollection||(this.skeletons.push(e),Vs.SetImmediate(()=>{this.onNewSkeletonAddedObservable.notifyObservers(e)}))}addParticleSystem(e){this._blockEntityCollection||(this.particleSystems.push(e),Vs.SetImmediate(()=>{this.onNewParticleSystemAddedObservable.notifyObservers(e)}))}addAnimation(e){this._blockEntityCollection||this.animations.push(e)}addAnimationGroup(e){this._blockEntityCollection||(this.animationGroups.push(e),Vs.SetImmediate(()=>{this.onNewAnimationGroupAddedObservable.notifyObservers(e)}))}addMultiMaterial(e){this._blockEntityCollection||(this.multiMaterials.push(e),Vs.SetImmediate(()=>{this.onNewMultiMaterialAddedObservable.notifyObservers(e)}))}addMaterial(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneMaterialArray!==-1||(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),Vs.SetImmediate(()=>{this.onNewMaterialAddedObservable.notifyObservers(e)}))}addMorphTargetManager(e){this._blockEntityCollection||this.morphTargetManagers.push(e)}addGeometry(e){this._blockEntityCollection||(this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=this.geometries.length),this.geometries.push(e))}addActionManager(e){this.actionManagers.push(e)}addTexture(e){this._blockEntityCollection||(this.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e))}addFrameGraph(e){this.frameGraphs.push(e),Vs.SetImmediate(()=>{this.onNewFrameGraphAddedObservable.notifyObservers(e)})}addObjectRenderer(e){this.objectRenderers.push(e),Vs.SetImmediate(()=>{this.onNewObjectRendererAddedObservable.notifyObservers(e)})}addPostProcess(e){this._blockEntityCollection||(this.postProcesses.push(e),Vs.SetImmediate(()=>{this.onNewPostProcessAddedObservable.notifyObservers(e)}))}addEffectLayer(e){this._blockEntityCollection||(this.effectLayers.push(e),Vs.SetImmediate(()=>{this.onNewEffectLayerAddedObservable.notifyObservers(e)}))}switchActiveCamera(e,t=!0){this._engine.getInputElement()&&(this.activeCamera&&this.activeCamera.detachControl(),this.activeCamera=e,t&&e.attachControl())}setActiveCameraById(e){const t=this.getCameraById(e);return t?(this.activeCamera=t,t):null}setActiveCameraByName(e){const t=this.getCameraByName(e);return t?(this.activeCamera=t,t):null}getAnimationGroupByName(e){for(let t=0;t<this.animationGroups.length;t++)if(this.animationGroups[t].name===e)return this.animationGroups[t];return null}_getMaterial(e,t){for(let s=0;s<this.materials.length;s++){const n=this.materials[s];if(t(n))return n}if(e)for(let s=0;s<this.multiMaterials.length;s++){const n=this.multiMaterials[s];if(t(n))return n}return null}getMaterialByUniqueID(e,t=!1){return this.getMaterialByUniqueId(e,t)}getMaterialByUniqueId(e,t=!1){return this._getMaterial(t,s=>s.uniqueId===e)}getMaterialById(e,t=!1){return this._getMaterial(t,s=>s.id===e)}getMaterialByName(e,t=!1){return this._getMaterial(t,s=>s.name===e)}getLastMaterialById(e,t=!1){for(let s=this.materials.length-1;s>=0;s--)if(this.materials[s].id===e)return this.materials[s];if(t){for(let s=this.multiMaterials.length-1;s>=0;s--)if(this.multiMaterials[s].id===e)return this.multiMaterials[s]}return null}getTextureByUniqueId(e){for(let t=0;t<this.textures.length;t++)if(this.textures[t].uniqueId===e)return this.textures[t];return null}getTextureByName(e){for(let t=0;t<this.textures.length;t++)if(this.textures[t].name===e)return this.textures[t];return null}getCameraById(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].id===e)return this.cameras[t];return null}getCameraByUniqueId(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].uniqueId===e)return this.cameras[t];return null}getCameraByName(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].name===e)return this.cameras[t];return null}getBoneById(e){for(let t=0;t<this.skeletons.length;t++){const s=this.skeletons[t];for(let n=0;n<s.bones.length;n++)if(s.bones[n].id===e)return s.bones[n]}return null}getBoneByName(e){for(let t=0;t<this.skeletons.length;t++){const s=this.skeletons[t];for(let n=0;n<s.bones.length;n++)if(s.bones[n].name===e)return s.bones[n]}return null}getLightByName(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].name===e)return this.lights[t];return null}getLightById(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].id===e)return this.lights[t];return null}getLightByUniqueId(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].uniqueId===e)return this.lights[t];return null}getParticleSystemById(e){for(let t=0;t<this.particleSystems.length;t++)if(this.particleSystems[t].id===e)return this.particleSystems[t];return null}getGeometryById(e){for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].id===e)return this.geometries[t];return null}_getGeometryByUniqueId(e){if(this._geometriesByUniqueId){const t=this._geometriesByUniqueId[e];if(t!==void 0)return this.geometries[t]}else for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].uniqueId===e)return this.geometries[t];return null}getFrameGraphByName(e){for(let t=0;t<this.frameGraphs.length;t++)if(this.frameGraphs[t].name===e)return this.frameGraphs[t];return null}pushGeometry(e,t){return!t&&this._getGeometryByUniqueId(e.uniqueId)?!1:(this.addGeometry(e),Vs.SetImmediate(()=>{this.onNewGeometryAddedObservable.notifyObservers(e)}),!0)}removeGeometry(e){let t;if(this._geometriesByUniqueId){if(t=this._geometriesByUniqueId[e.uniqueId],t===void 0)return!1}else if(t=this.geometries.indexOf(e),t<0)return!1;if(t!==this.geometries.length-1){const s=this.geometries[this.geometries.length-1];s&&(this.geometries[t]=s,this._geometriesByUniqueId&&(this._geometriesByUniqueId[s.uniqueId]=t))}return this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=void 0),this.geometries.pop(),this.onGeometryRemovedObservable.notifyObservers(e),!0}getGeometries(){return this.geometries}getMeshById(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].id===e)return this.meshes[t];return null}getMeshesById(e){return this.meshes.filter(function(t){return t.id===e})}getTransformNodeById(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getTransformNodeByUniqueId(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].uniqueId===e)return this.transformNodes[t];return null}getTransformNodesById(e){return this.transformNodes.filter(function(t){return t.id===e})}getMeshByUniqueId(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].uniqueId===e)return this.meshes[t];return null}getLastMeshById(e){for(let t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null}getLastTransformNodeById(e){for(let t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getLastEntryById(e){let t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];for(t=this.skeletons.length-1;t>=0;t--){const s=this.skeletons[t];for(let n=s.bones.length-1;n>=0;n--)if(s.bones[n].id===e)return s.bones[n]}return null}getNodeById(e){const t=this.getMeshById(e);if(t)return t;const s=this.getTransformNodeById(e);if(s)return s;const n=this.getLightById(e);if(n)return n;const a=this.getCameraById(e);if(a)return a;const l=this.getBoneById(e);return l||null}getNodeByName(e){const t=this.getMeshByName(e);
474if(t)return t;const s=this.getTransformNodeByName(e);if(s)return s;const n=this.getLightByName(e);if(n)return n;const a=this.getCameraByName(e);if(a)return a;const l=this.getBoneByName(e);return l||null}getMeshByName(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].name===e)return this.meshes[t];return null}getTransformNodeByName(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].name===e)return this.transformNodes[t];return null}getLastSkeletonById(e){for(let t=this.skeletons.length-1;t>=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByUniqueId(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].uniqueId===e)return this.skeletons[t];return null}getSkeletonById(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByName(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].name===e)return this.skeletons[t];return null}getMorphTargetManagerById(e){for(let t=0;t<this.morphTargetManagers.length;t++)if(this.morphTargetManagers[t].uniqueId===e)return this.morphTargetManagers[t];return null}getMorphTargetById(e){for(let t=0;t<this.morphTargetManagers.length;++t){const s=this.morphTargetManagers[t];for(let n=0;n<s.numTargets;++n){const a=s.getTarget(n);if(a.id===e)return a}}return null}getMorphTargetByName(e){for(let t=0;t<this.morphTargetManagers.length;++t){const s=this.morphTargetManagers[t];for(let n=0;n<s.numTargets;++n){const a=s.getTarget(n);if(a.name===e)return a}}return null}getPostProcessByName(e){for(let t=0;t<this.postProcesses.length;++t){const s=this.postProcesses[t];if(s.name===e)return s}return null}isActiveMesh(e){return this._activeMeshes.indexOf(e)!==-1}get uid(){return this._uid||(this._uid=ft.RandomId()),this._uid}addExternalData(e,t){return this._externalData||(this._externalData=new kR),this._externalData.add(e,t)}getExternalData(e){return this._externalData?this._externalData.get(e):null}getOrAddExternalDataWithFactory(e,t){return this._externalData||(this._externalData=new kR),this._externalData.getOrAddWithFactory(e,t)}removeExternalData(e){return this._externalData.remove(e)}_evaluateSubMesh(e,t,s,n){if(n||e.isInFrustum(this._frustumPlanes)){for(const l of this._evaluateSubMeshStage)l.action(t,e);const a=e.getMaterial();a!=null&&(a.hasRenderTargetTextures&&a.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(a)===-1&&(this._processedMaterials.push(a),this._materialsRenderTargets.concatWithNoDuplicate(a.getRenderTargetTextures())),this._renderingManager.dispatch(e,t,a))}}freeProcessedMaterials(){this._processedMaterials.dispose()}get blockfreeActiveMeshesAndRenderingGroups(){return this._preventFreeActiveMeshesAndRenderingGroups}set blockfreeActiveMeshesAndRenderingGroups(e){this._preventFreeActiveMeshesAndRenderingGroups!==e&&(e&&(this.freeActiveMeshes(),this.freeRenderingGroups()),this._preventFreeActiveMeshesAndRenderingGroups=e)}freeActiveMeshes(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._activeMeshes.dispose(),this.activeCamera&&this.activeCamera._activeMeshes&&this.activeCamera._activeMeshes.dispose(),this.activeCameras))for(let e=0;e<this.activeCameras.length;e++){const t=this.activeCameras[e];t&&t._activeMeshes&&t._activeMeshes.dispose()}}freeRenderingGroups(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._renderingManager&&this._renderingManager.freeRenderingGroups(),this.textures))for(let e=0;e<this.textures.length;e++){const t=this.textures[e];t&&t.renderList&&t.freeRenderingGroups()}}_isInIntermediateRendering(){return this._intermediateRendering}_isInRenderingMeshEvaluation(){return this._renderingMeshEvaluationDepth>0}freezeActiveMeshes(e=!1,t,s,n=!0,a=!1){if(this.frameGraph){this._renderWithFrameGraph(!0,!1,!0);const l=this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]);for(const u of l)u.objectRenderer._freezeActiveMeshes(n);return this._freezeActiveMeshesCancel=ig(()=>{let u=!0,h=!0;for(const f of l)u&&(u=f.objectRenderer._isFrozen),h&&(h=f.objectRenderer._freezeActiveMeshesCancel!==null);if(u)return!0;
474if(!h)throw new Error("Freezing active meshes was cancelled");return!1},()=>{this._freezeActiveMeshesCancel=null,this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=a,this._skipEvaluateActiveMeshesCompletely=e,t?.()},(u,h)=>{if(this._freezeActiveMeshesCancel=null,this.unfreezeActiveMeshes(),h){const f="Scene: Timeout while waiting for meshes to be frozen.";s?s(f):(Re.Error(f),u&&Re.Error(u))}else{const f="Scene: An unexpected error occurred while trying to freeze active meshes.";s?s(f):(Re.Error(f),u&&(Re.Error(u),u.stack&&Re.Error(u.stack)))}}),this}return this.executeWhenReady(()=>{if(!this.activeCamera){s&&s("No active camera found");return}if(this._frustumPlanes||this.updateTransformMatrix(),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=a,this._skipEvaluateActiveMeshesCompletely=e,n)for(let l=0;l<this._activeMeshes.length;l++)this._activeMeshes.data[l]._freeze();t&&t()}),this}unfreezeActiveMeshes(){for(let e=0;e<this.meshes.length;e++){const t=this.meshes[e];t._internalAbstractMeshDataInfo&&(t._internalAbstractMeshDataInfo._isActive=!1)}if(this._freezeActiveMeshesCancel?.(),this._freezeActiveMeshesCancel=null,this.frameGraph){const e=this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]);for(const t of e)t.objectRenderer._unfreezeActiveMeshes()}else for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();return this._activeMeshesFrozen=!1,this}_executeActiveContainerCleanup(e){!(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1)&&this._activeMeshesFrozen&&this._activeMeshes.length||this.onBeforeRenderObservable.addOnce(()=>e.dispose())}_evaluateActiveMeshes(){if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1){this._activeMeshes.length>0&&(this.activeCamera?._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset());return}if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely){const s=this._activeMeshes.length;for(let n=0;n<s;n++)this._activeMeshes.data[n].computeWorldMatrix()}if(this._activeParticleSystems){const s=this._activeParticleSystems.length;for(let n=0;n<s;n++)this._activeParticleSystems.data[n].animate()}this._renderingManager.resetSprites();return}if(!this.activeCamera)return;this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this),this.activeCamera._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset(),this._materialsRenderTargets.reset();for(const s of this._beforeEvaluateActiveMeshStage)s.action();const e=this.getActiveMeshCandidates(),t=e.length;for(let s=0;s<t;s++){const n=e.data[s];let a=n._internalAbstractMeshDataInfo._currentLOD.get(this.activeCamera);if(a?a[1]=-1:(a=[n,-1],n._internalAbstractMeshDataInfo._currentLOD.set(this.activeCamera,a)),n.isBlocked||(this._totalVertices.addCount(n.getTotalVertices(),!1),!n.isReady()||!n.isEnabled()||n.scaling.hasAZeroComponent))continue;n.computeWorldMatrix(),n.actionManager&&n.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(n);let l=this.customLODSelector?this.customLODSelector(n,this.activeCamera):n.getLOD(this.activeCamera);if(a[0]=l,a[1]=this._frameId,l!=null&&(l!==n&&l.billboardMode!==0&&l.computeWorldMatrix(),n._preActivate(),n.isVisible&&n.visibility>0&&(n.layerMask&this.activeCamera.layerMask)!==0&&(this._skipFrustumClipping||n.alwaysSelectAsActiveMesh||n.isInFrustum(this._frustumPlanes)))){this._activeMeshes.push(n),this.activeCamera._activeMeshes.push(n),l!==n&&l._activate(this._renderId,!1);for(const u of this._preActiveMeshStage)u.action(n);n._activate(this._renderId,!1)&&(n.isAnInstance?n._internalAbstractMeshDataInfo._actAsRegularMesh&&(l=n):l._internalAbstractMeshDataInfo._onlyForInstances=!1,l._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(n,l)),n._postActivate()}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(let s=0;s<this.particleSystems.length;s++){const n=this.particleSystems[s];if(!n.isStarted()||!n.emitter)continue;const a=n.emitter;(!a.position||a.isEnabled())&&(this._activeParticleSystems.push(n),n.animate(),this._renderingManager.dispatchParticles(n))}this.onAfterParticlesRenderingObservable.notifyObservers(this)}}_prepareSkeleton(e){!this._skeletonsEnabled||!e.skeleton||(this._activeSkeletons.pushNo
vendor: 10,323 bytes, line 474
474Duplicate(e.skeleton)&&(e.skeleton.prepare(),this._activeBones.addCount(e.skeleton.bones.length,!1)),e.computeBonesUsingShaders||this._softwareSkinnedMeshes.pushNoDuplicate(e)&&this.frameGraph&&e.applySkeleton(e.skeleton))}_activeMesh(e,t){this._prepareSkeleton(t);let s=e.hasInstances||e.isAnInstance||this.dispatchAllSubMeshesOfActiveMeshes||this._skipFrustumClipping||t.alwaysSelectAsActiveMesh;if(t&&t.subMeshes&&t.subMeshes.length>0){const n=this.getActiveSubMeshCandidates(t),a=n.length;s=s||a===1;for(let l=0;l<a;l++){const u=n.data[l];this._evaluateSubMesh(u,t,e,s)}}}updateTransformMatrix(e){const t=this.activeCamera;if(t)if(t._renderingMultiview){const s=t._rigCameras[0],n=t._rigCameras[1];this.setTransformMatrix(s.getViewMatrix(),s.getProjectionMatrix(e),n.getViewMatrix(),n.getProjectionMatrix(e))}else this.setTransformMatrix(t.getViewMatrix(),t.getProjectionMatrix(e))}_bindFrameBuffer(e,t=!0){this._useCurrentFrameBuffer||(e&&e._multiviewTexture?e._multiviewTexture._bindFrameBuffer():e&&e.outputRenderTarget?e.outputRenderTarget._bindFrameBuffer():this._engine._currentFrameBufferIsDefaultFrameBuffer()||this._engine.restoreDefaultFramebuffer()),t&&this._clearFrameBuffer(e)}_clearFrameBuffer(e){if(!(e&&e._multiviewTexture))if(e&&e.outputRenderTarget&&!e._renderingMultiview){const t=e.outputRenderTarget;t.onClearObservable.hasObservers()?t.onClearObservable.notifyObservers(this._engine):!t.skipInitialClear&&!e.isRightCamera&&(this.autoClear&&this._engine.clear(t.clearColor||this._clearColor,!t._cleared,!0,!0),t._cleared=!0)}else this._defaultFrameBufferCleared?this._engine.clear(null,!1,!0,!0):(this._defaultFrameBufferCleared=!0,this._clear())}_renderForCamera(e,t,s=!0){if(e&&e._skipRendering)return;const n=this._engine;if(this._activeCamera=e,!this.activeCamera)throw new Error("Active camera not set");if(n.setViewport(this.activeCamera.viewport),this.resetCachedMaterial(),this._renderId++,!this.prePass&&s){let u=!0;e._renderingMultiview&&e.outputRenderTarget&&(u=e.outputRenderTarget.skipInitialClear,this.autoClear&&(this._defaultFrameBufferCleared=!1,e.outputRenderTarget.skipInitialClear=!1)),this._bindFrameBuffer(this._activeCamera),e._renderingMultiview&&e.outputRenderTarget&&(e.outputRenderTarget.skipInitialClear=u)}this.updateTransformMatrix(),this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera),this._engine.currentRenderPassId=e.outputRenderTarget?.renderPassId??e.renderPassId??0,this._evaluateActiveMeshes();for(let u=0;u<this._softwareSkinnedMeshes.length;u++){const h=this._softwareSkinnedMeshes.data[u];h.applySkeleton(h.skeleton)}this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets),e.customRenderTargets&&e.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets),this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture);for(const u of this._gatherActiveCameraRenderTargetsStage)u.action(this._renderTargets);let a=!1;if(this.renderTargetsEnabled){this._intermediateRendering=!0;let u;if(this._renderTargets.length>0){ft.StartPerformanceCounter("Render targets",this._renderTargets.length>0);const h=this.getBoundingBoxRenderer?.();for(let f=0;f<this._renderTargets.length;f++){const m=this._renderTargets.data[f];if(m._shouldRender()){this._renderId++;const p=m.activeCamera&&m.activeCamera!==this.activeCamera;h&&!u&&(u=h.renderList.length>0?h.renderList.data.slice():[],u.length=h.renderList.length),m.render(p,this.dumpNextRenderTargets),a=!0}}h&&u&&(h.renderList.data=u,h.renderList.length=u.length),ft.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}if(this._cameraDrawRenderTargetStage.length>0){const h=this.getBoundingBoxRenderer?.();h&&!u&&(u=h.renderList.length>0?h.renderList.data.slice():[],u.length=h.renderList.length);for(const f of this._cameraDrawRenderTargetStage)a=f.action(this.activeCamera)||a;h&&u&&(h.renderList.data=u,h.renderList.length=u.length)}this._intermediateRendering=!1}a&&!this.prePass&&(this._bindFrameBuffer(this._activeCamera,!1),this.updateTransformMatrix()),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.postProcessManager&&!e._multiviewTexture&&!this.prePass&&this.postProcessManager._prepareFrame();for(const u of this._beforeCameraDrawStage)u.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this);const l=n.snapshotRendering&&n.snapshotRenderingMode===1;l&&this.finalizeSceneUbo(),this._renderingManager.render(null,null,!0,!l),this.onAfterDrawPhaseObservable.notifyObservers(this);for(const u of this._afterCameraDrawStage)u.action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){const u=e.outputRenderTarget?e.outputRenderTarget.renderTarget:void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,u)}for(const u of this._afterCameraPostProcessStage)u.action(this.activeCamera);this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}_processSubCameras(e,t=!0){if(e.cameraRigMode===0||e._renderingMultiview){e._renderingMultiview&&!this._multiviewSceneUbo&&this._createMultiviewUbo(),this._renderForCamera(e,void 0,t),this.onAfterRenderCameraObservable.notifyObservers(e);return}if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else{this.onBeforeCameraRenderObservable.notifyObservers(e);for(let s=0;s<e._rigCameras.length;s++)this._renderForCamera(e._rigCameras[s],e)}this._activeCamera=e,this.updateTransformMatrix(),this.onAfterRenderCameraObservable.notifyObservers(e)}_checkIntersections(){for(let e=0;e<this._meshesForIntersections.length;e++){const t=this._meshesForIntersections.data[e];if(t.actionManager)for(let s=0;t.actionManager&&s<t.actionManager.actions.length;s++){const n=t.actionManager.actions[s];if(n.trigger===12||n.trigger===13){const a=n.getTriggerParameter(),l=a.mesh?a.mesh:a,u=l.intersectsMesh(t,a.usePreciseIntersection),h=t._intersectionsInProgress.indexOf(l);u&&h===-1?n.trigger===12?(n._executeCurrent(Fs.CreateNew(t,void 0,l)),t._intersectionsInProgress.push(l)):n.trigger===13&&t._intersectionsInProgress.push(l):!u&&h>-1&&(n.trigger===13&&n._executeCurrent(Fs.CreateNew(t,void 0,l)),(!t.actionManager.hasSpecificTrigger(13,f=>{const m=f.mesh?f.mesh:f;return l===m})||n.trigger===13)&&t._intersectionsInProgress.splice(h,1))}}}}_advancePhysicsEngineStep(e){}_animate(e){}animate(){if(this._engine.isDeterministicLockStep()){let e=Math.max(be.MinDeltaTime,Math.min(this._engine.getDeltaTime(),be.MaxDeltaTime))+this._timeAccumulator;const t=this._engine.getTimeStep(),s=1e3/t/1e3;let n=0;const a=this._engine.getLockstepMaxSteps();let l=Math.floor(e/t);for(l=Math.min(l,a);e>0&&n<l;)this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=t*s,this._animate(t),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(t),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,n++,e-=t;this._timeAccumulator=e<0?0:e}else{const e=this.useConstantAnimationDeltaTime?16:Math.max(be.MinDeltaTime,Math.min(this._engine.getDeltaTime(),be.MaxDeltaTime));this._animationRatio=e*(60/1e3),this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(e)}}_clear(){(this.autoClearDepthAndStencil||this.autoClear)&&this._engine.clear(this._clearColor,this.autoClear||this.forceWireframe||this.forcePointsCloud,this.autoClearDepthAndStencil,this.autoClearDepthAndStencil)}_checkCameraRenderTarget(e){if(e?.outputRenderTarget&&!e?.isRigCamera&&(e.outputRenderTarget._cleared=!1),e?.rigCameras?.length)for(let t=0;t<e.rigCameras.length;++t){const s=e.rigCameras[t].outputRenderTarget;s&&(s._cleared=!1)}}resetDrawCache(e){if(this.meshes)for(const t of this.meshes)t.resetDrawCache(e)}_renderWithFrameGraph(e=!0,t=!1,s=!1){if(this.activeCamera=null,this.activeCameras=null,e){for(const n of this.cameras)if(n.update(),n.cameraRigMode!==0)for(let a=0;a<n._rigCameras.length;a++)n._rigCameras[a].update()}this.onBeforeRenderObservable.notifyObservers(this),this._renderingMeshEvaluationDepth++;try{this._renderWithFrameGraphAfterBeforeRender(s)}finally{this._renderingMeshEvaluationDepth--}}_renderWithFrameGraphAfterBeforeRender(e){this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.reset();const t=this._frameGraph?.findMainCamera()??null;if(this.renderTargetsEnabled){this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture),this._renderTargets.concatWithNoDuplicate(this.customRenderTargets),ft.StartPerformanceCounter("Custom render targets",this._renderTargets.length>0);for(let s=0;s<this._renderTargets.length;s++){const n=this._renderTargets.data[s],a=n.activeCamera||t;this._renderRenderTarget(n,a,!0,this.dumpNextRenderTargets)}ft.EndPerformanceCounter("Custom render targets",this._renderTargets.length>0),this._renderId++}this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const s of this._beforeClearStage)s.action();if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1)this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();else{const s=this.getActiveMeshCandidates(),n=s.length;if(this._activeMeshesFrozen){if(!this._skipEvaluateActiveMeshesCompletely)for(let a=0;a<n;a++){const l=s.data[a];l._internalAbstractMeshDataInfo._wasActiveLastFrame&&l.computeWorldMatrix()}if(this.particlesEnabled){const a=this._activeParticleSystems.length;for(let l=0;l<a;l++)this._activeParticleSystems.data[l].animate()}}else{this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();for(let a=0;a<n;a++){const l=s.data[a];l._internalAbstractMeshDataInfo._wasActiveLastFrame=!1,!l.isBlocked&&(this._totalVertices.addCount(l.getTotalVertices(),!1),!(!l.isReady()||!l.isEnabled()||l.scaling.hasAZeroComponent)&&(l.computeWorldMatrix(e),l.actionManager&&l.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNo
vendor: 16,564 bytes, line 474
474Duplicate(l)))}if(this.particlesEnabled)for(let a=0;a<this.particleSystems.length;a++){const l=this.particleSystems[a];if(!l.isStarted()||!l.emitter)continue;const u=l.emitter;(!u.position||u.isEnabled())&&(this._activeParticleSystems.push(l),l.animate())}}}this.frameGraph?.execute()}_renderRenderTarget(e,t,s=!1,n=!1){if(this._intermediateRendering=!0,e._shouldRender()){if(this._renderId++,this.activeCamera=t,!this.activeCamera)throw new Error("Active camera not set");this._engine.setViewport(this.activeCamera.viewport),this.updateTransformMatrix(),e.render(s,n)}this._intermediateRendering=!1}render(e=!0,t=!1){if(this.isDisposed)return;const s=this._renderingMeshEvaluationDepth;try{this._renderFrame(e,t)}finally{this._renderingMeshEvaluationDepth=s}}_renderFrame(e,t){if(this.onReadyObservable.hasObservers()&&this._executeWhenReadyTimeoutId===null&&this._checkIsReady(),Uh.getScene=this._getFloatingOriginScene,this._frameId++,this._defaultFrameBufferCleared=!1,this._checkCameraRenderTarget(this.activeCamera),this.activeCameras?.length)for(const s of this.activeCameras)this._checkCameraRenderTarget(s);this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(11),t||this.animate();for(const s of this._beforeCameraUpdateStage)s.action();if(e){if(this.activeCameras&&this.activeCameras.length>0)for(let s=0;s<this.activeCameras.length;s++){const n=this.activeCameras[s];if(n.update(),n.cameraRigMode!==0)for(let a=0;a<n._rigCameras.length;a++)n._rigCameras[a].update()}else if(this.activeCamera&&(this.activeCamera.update(),this.activeCamera.cameraRigMode!==0))for(let s=0;s<this.activeCamera._rigCameras.length;s++)this.activeCamera._rigCameras[s].update()}if(this.customRenderFunction)this._renderId++,this._engine.currentRenderPassId=0,this._renderingMeshEvaluationDepth++,this.customRenderFunction(e,t);else{this.onBeforeRenderObservable.notifyObservers(this),this._renderingMeshEvaluationDepth++,this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);const s=this.activeCameras?.length?this.activeCameras[0]:this.activeCamera;if(this.renderTargetsEnabled){ft.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0);for(let n=0;n<this.customRenderTargets.length;n++){const a=this.customRenderTargets[n],l=a.activeCamera||this.activeCamera;this._renderRenderTarget(a,l,s!==l,this.dumpNextRenderTargets)}ft.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._renderId++}this._engine.currentRenderPassId=s?.renderPassId??0,this.activeCamera=s,this._activeCamera&&this._activeCamera.cameraRigMode!==22&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const n of this._beforeClearStage)n.action();this._clearFrameBuffer(this.activeCamera);for(const n of this._gatherRenderTargetsStage)n.action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(let n=0;n<this.activeCameras.length;n++)this._processSubCameras(this.activeCameras[n],n>0);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera,!!this.activeCamera.outputRenderTarget)}}this._checkIntersections();for(const s of this._afterRenderStage)s.action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(let s=0;s<this._toBeDisposed.length;s++){const n=this._toBeDisposed[s];n&&n.dispose()}this._toBeDisposed.length=0}this.dumpNextRenderTargets&&(this.dumpNextRenderTargets=!1),this._activeBones.addCount(0,!0),this._activeIndices.addCount(0,!0),this._activeParticles.addCount(0,!0),this._engine.restoreDefaultFramebuffer()}freezeMaterials(){for(let e=0;e<this.materials.length;e++)this.materials[e].freeze()}unfreezeMaterials(){for(let e=0;e<this.materials.length;e++)this.materials[e].unfreeze()}dispose(){if(this.isDisposed)return;if(this._isDisposing=!0,this.beforeRender=null,this.afterRender=null,this.metadata=null,this.skeletons.length=0,this.morphTargetManagers.length=0,this._transientComponents.length=0,this._isReadyForMeshStage.clear(),this._beforeEvaluateActiveMeshStage.clear(),this._evaluateSubMeshStage.clear(),this._preActiveMeshStage.clear(),this._cameraDrawRenderTargetStage.clear(),this._beforeCameraDrawStage.clear(),this._beforeRenderTargetDrawStage.clear(),this._beforeRenderingGroupDrawStage.clear(),this._beforeRenderingMeshStage.clear(),this._afterRenderingMeshStage.clear(),this._afterRenderingGroupDrawStage.clear(),this._afterCameraDrawStage.clear(),this._afterRenderTargetDrawStage.clear(),this._afterRenderStage.clear(),this._beforeCameraUpdateStage.clear(),this._beforeClearStage.clear(),this._gatherRenderTargetsStage.clear(),this._gatherActiveCameraRenderTargetsStage.clear(),this._pointerMoveStage.clear(),this._pointerDownStage.clear(),this._pointerUpStage.clear(),this._isReadyChecks.length=0,this.importedMeshesFiles=[],this._activeAnimatables&&g3(this.stopAllAnimations)){for(const a of this._activeAnimatables)a.onAnimationEndObservable.clear(),a.onAnimationEnd=null;this.stopAllAnimations()}this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this.activeCameras=null,this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._materialsRenderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed.length=0;const e=this._activeRequests.slice();for(const a of e)a.abort();this._activeRequests.length=0;try{this.onDisposeObservable.notifyObservers(this)}catch(a){Re.Error("An error occurred while calling onDisposeObservable!",a)}if(this.detachControl(),this._engine.getInputElement?.())for(let a=0;a<this.cameras.length;a++)this.cameras[a].detachControl();this._disposeList(this.animationGroups),this._disposeList(this.lights),this._defaultMaterial&&this._defaultMaterial.dispose(),this._disposeList(this.multiMaterials),this._disposeList(this.materials),this._disposeList(this.meshes,a=>a.dispose(!0)),this._disposeList(this.transformNodes,a=>a.dispose(!0));const s=this.cameras;this._disposeList(s),this._disposeList(this.particleSystems),this._disposeList(this.postProcesses),this._disposeList(this.textures),this._disposeList(this.morphTargetManagers),this._disposeList(this.frameGraphs),this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),this._disposeList(this._components);let n=this._engine.scenes.indexOf(this);if(n>-1&&this._engine.scenes.splice(n,1),this._floatingOriginScene=void 0,this._engine.scenes.length===0&&jG(),pt._LastCreatedScene===this){pt._LastCreatedScene=null;let a=pt.Instances.length-1;for(;a>=0;){const l=pt.Instances[a];if(l.scenes.length>0){pt._LastCreatedScene=l.scenes[this._engine.scenes.length-1];break}a--}}n=this._engine._virtualScenes.indexOf(this),n>-1&&this._engine._virtualScenes.splice(n,1),this._engine.wipeCaches(!0),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onAfterRenderCameraObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onNewMultiMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onMultiMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onNewFrameGraphAddedObservable.clear(),this.onFrameGraphRemovedObservable.clear(),this.onNewObjectRendererAddedObservable.clear(),this.onObjectRendererRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.onScenePerformancePriorityChangedObservable.clear(),this.onClearColorChangedObservable.clear(),this.onEnvironmentTextureChangedObservable.clear(),this.onMeshUnderPointerUpdatedObservable.clear(),this._isDisposed=!0}_disposeList(e,t){const s=e.slice(0);t=t??(n=>n.dispose());for(const n of s)t(n);e.length=0}get isDisposed(){return this._isDisposed}clearCachedVertexData(){for(let e=0;e<this.meshes.length;e++){const s=this.meshes[e].geometry;s&&s.clearCachedData()}}cleanCachedTextureBuffer(){for(const e of this.textures)e._buffer&&(e._buffer=null)}getWorldExtends(e){const t=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);e=e||(()=>!0);const n=this.meshes.filter(e);for(const a of n){if(a.computeWorldMatrix(!0),!a.subMeshes||a.subMeshes.length===0||a.infiniteDistance)continue;const l=a.getBoundingInfo(),u=l.boundingBox.minimumWorld,h=l.boundingBox.maximumWorld;I.CheckExtends(u,t,s),I.CheckExtends(h,t,s)}return t.x===Number.MAX_VALUE?{min:I.Zero(),max:I.Zero()}:{min:t,max:s}}createPickingRay(e,t,s,n,a=!1){throw bt("Ray")}createPickingRayToRef(e,t,s,n,a,l=!1,u=!1){throw bt("Ray")}createPickingRayInCameraSpace(e,t,s){throw bt("Ray")}createPickingRayInCameraSpaceToRef(e,t,s,n){throw bt("Ray")}pick(e,t,s,n,a,l){const u=bt("Ray",!0);return u&&Re.Warn(u),new Vh}pickWithBoundingInfo(e,t,s,n,a){const l=bt("Ray",!0);return l&&Re.Warn(l),new Vh}pickWithRay(e,t,s,n){throw bt("Ray")}multiPick(e,t,s,n,a){throw bt("Ray")}multiPickWithRay(e,t,s){throw bt("Ray")}setPointerOverMesh(e,t,s){this._inputManager.setPointerOverMesh(e,t,s)}getPointerOverMesh(){return this._inputManager.getPointerOverMesh()}_rebuildGeometries(){for(const e of this.geometries)e._rebuild();for(const e of this.meshes)e._rebuild();this.postProcessManager&&this.postProcessManager._rebuild();for(const e of this._components)e.rebuild();for(const e of this.particleSystems)e.rebuild();if(this.spriteManagers)for(const e of this.spriteManagers)e.rebuild()}_rebuildTextures(){for(const e of this.textures)e._rebuild(!0);this.markAllMaterialsAsDirty(1)}_getByTags(e,t,s){if(t===void 0)return e;const n=[];for(const a in e){const l=e[a];Cs&&Cs.MatchesQuery(l,t)&&(!s||s(l))&&n.push(l)}return n}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}setRenderingOrder(e,t=null,s=null,n=null){this._renderingManager.setRenderingOrder(e,t,s,n)}setRenderingAutoClearDepthStencil(e,t,s=!0,n=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,s,n)}getAutoClearDepthStencilSetup(e){return this._renderingManager.getAutoClearDepthStencilSetup(e)}_forceBlockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism=e}get blockMaterialDirtyMechanism(){return this._blockMaterialDirtyMechanism}set blockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(127))}markAllMaterialsAsDirty(e,t){if(!this._blockMaterialDirtyMechanism)for(const s of this.materials)t&&!t(s)||s.markAsDirty(e)}_loadFile(e,t,s,n,a,l,u){const h=zr(e,t,s,n?this.offlineProvider:void 0,a,l,u);return this._activeRequests.push(h),h.onCompleteObservable.add(f=>{this._activeRequests.splice(this._activeRequests.indexOf(f),1)}),h}async _loadFileAsync(e,t,s,n,a){return await new Promise((l,u)=>{this._loadFile(e,h=>{l(h)},t,s,n,(h,f)=>{u(f)},a)})}async _loadDelayedFileAsync(e,t,s){this._delayedFileRequests||(this._delayedFileRequests=new Map);const n=`${e}|${t?"binary":"string"}`;let a=this._delayedFileRequests.get(n);if(!a){a=t?this._loadFileAsync(e,void 0,s,!0):this._loadFileAsync(e,void 0,s,!1);const l=a;(async()=>{try{await l}catch{}this._delayedFileRequests?.delete(n)})(),this._delayedFileRequests.set(n,a)}return await a}_requestFile(e,t,s,n,a,l,u){const h=ug(e,t,s,n?this.offlineProvider:void 0,a,l,u);return this._activeRequests.push(h),h.onCompleteObservable.add(f=>{this._activeRequests.splice(this._activeRequests.indexOf(f),1)}),h}async _requestFileAsync(e,t,s,n,a){return await new Promise((l,u)=>{this._requestFile(e,h=>{l(h)},t,s,n,h=>{u(h)},a)})}_readFile(e,t,s,n,a){const l=fc(e,t,s,n,a);return this._activeRequests.push(l),l.onCompleteObservable.add(u=>{this._activeRequests.splice(this._activeRequests.indexOf(u),1)}),l}async _readFileAsync(e,t,s){return await new Promise((n,a)=>{this._readFile(e,l=>{n(l)},t,s,l=>{a(l)})})}getPerfCollector(){throw bt("performanceViewerSceneExtension")}setActiveCameraByID(e){return this.setActiveCameraById(e)}getMaterialByID(e){return this.getMaterialById(e)}getLastMaterialByID(e){return this.getLastMaterialById(e)}getTextureByUniqueID(e){return this.getTextureByUniqueId(e)}getCameraByID(e){return this.getCameraById(e)}getCameraByUniqueID(e){return this.getCameraByUniqueId(e)}getBoneByID(e){return this.getBoneById(e)}getLightByID(e){return this.getLightById(e)}getLightByUniqueID(e){return this.getLightByUniqueId(e)}getParticleSystemByID(e){return this.getParticleSystemById(e)}getGeometryByID(e){return this.getGeometryById(e)}getMeshByID(e){return this.getMeshById(e)}getMeshByUniqueID(e){return this.getMeshByUniqueId(e)}getLastMeshByID(e){return this.getLastMeshById(e)}getMeshesByID(e){return this.getMeshesById(e)}getTransformNodeByID(e){return this.getTransformNodeById(e)}getTransformNodeByUniqueID(e){return this.getTransformNodeByUniqueId(e)}getTransformNodesByID(e){return this.getTransformNodesById(e)}getNodeByID(e){return this.getNodeById(e)}getLastEntryByID(e){return this.getLastEntryById(e)}getLastSkeletonByID(e){return this.getLastSkeletonById(e)}}be.FOGMODE_NONE=0;be.FOGMODE_EXP=1;be.FOGMODE_EXP2=2;be.FOGMODE_LINEAR=3;be.MinDeltaTime=1;be.MaxDeltaTime=1e3;be._OriginalDefaultMaterialFactory=be.DefaultMaterialFactory;let WT=!1;function h4(){WT||(WT=!0,ar("BABYLON.Scene",be))}(WR=be.prototype).sortActiveAnimatables??(WR.sortActiveAnimatables=tt("Scene","sortActiveAnimatables"));(YR=be.prototype).beginWeightedAnimation??(YR.beginWeightedAnimation=tt("Scene","beginWeightedAnimation"));(KR=be.prototype).beginAnimation??(KR.beginAnimation=tt("Scene","beginAnimation"));(ZR=be.prototype).beginHierarchyAnimation??(ZR.beginHierarchyAnimation=tt("Scene","beginHierarchyAnimation"));(QR=be.prototype).beginDirectAnimation??(QR.beginDirectAnimation=tt("Scene","beginDirectAnimation"));($R=be.prototype).beginDirectHierarchyAnimation??($R.beginDirectHierarchyAnimation=tt("Scene","beginDirectHierarchyAnimation"));(JR=be.prototype).getAnimatableByTarget??(JR.getAnimatableByTarget=tt("Scene","getAnimatableByTarget"));(eT=be.prototype).getAllAnimatablesByTarget??(eT.getAllAnimatablesByTarget=tt("Scene","getAllAnimatablesByTarget"));(tT=be.prototype).stopAllAnimations??(tT.stopAllAnimations=tt("Scene","stopAllAnimations"));
474(sT=be.prototype).getSoundByName??(sT.getSoundByName=tt("Scene","getSoundByName"));(iT=be.prototype).createOrUpdateSelectionOctree??(iT.createOrUpdateSelectionOctree=tt("Scene","createOrUpdateSelectionOctree"));(nT=be.prototype).createDefaultLight??(nT.createDefaultLight=tt("Scene","createDefaultLight"));(rT=be.prototype).createDefaultCamera??(rT.createDefaultCamera=tt("Scene","createDefaultCamera"));(aT=be.prototype).createDefaultCameraOrLight??(aT.createDefaultCameraOrLight=tt("Scene","createDefaultCameraOrLight"));(oT=be.prototype).createDefaultSkybox??(oT.createDefaultSkybox=tt("Scene","createDefaultSkybox"));(lT=be.prototype).createDefaultEnvironment??(lT.createDefaultEnvironment=tt("Scene","createDefaultEnvironment"));(cT=be.prototype).createDefaultVRExperience??(cT.createDefaultVRExperience=tt("Scene","createDefaultVRExperience"));(uT=be.prototype).createDefaultXRExperienceAsync??(uT.createDefaultXRExperienceAsync=tt("Scene","createDefaultXRExperienceAsync"));(hT=be.prototype).getGlowLayerByName??(hT.getGlowLayerByName=tt("Scene","getGlowLayerByName"));(dT=be.prototype).getHighlightLayerByName??(dT.getHighlightLayerByName=tt("Scene","getHighlightLayerByName"));(fT=be.prototype).getSelectionOutlineLayerByName??(fT.getSelectionOutlineLayerByName=tt("Scene","getSelectionOutlineLayerByName"));(_T=be.prototype).removeLensFlareSystem??(_T.removeLensFlareSystem=tt("Scene","removeLensFlareSystem"));(pT=be.prototype).addLensFlareSystem??(pT.addLensFlareSystem=tt("Scene","addLensFlareSystem"));(mT=be.prototype).getLensFlareSystemByName??(mT.getLensFlareSystemByName=tt("Scene","getLensFlareSystemByName"));(gT=be.prototype).getLensFlareSystemByID??(gT.getLensFlareSystemByID=tt("Scene","getLensFlareSystemByID"));(yT=be.prototype).getLensFlareSystemById??(yT.getLensFlareSystemById=tt("Scene","getLensFlareSystemById"));(bT=be.prototype).getPhysicsEngine??(bT.getPhysicsEngine=tt("Scene","getPhysicsEngine"));(xT=be.prototype).enablePhysics??(xT.enablePhysics=tt("Scene","enablePhysics"));(vT=be.prototype).disablePhysicsEngine??(vT.disablePhysicsEngine=tt("Scene","disablePhysicsEngine"));(RT=be.prototype).isPhysicsEnabled??(RT.isPhysicsEnabled=tt("Scene","isPhysicsEnabled"));(TT=be.prototype).deleteCompoundImpostor??(TT.deleteCompoundImpostor=tt("Scene","deleteCompoundImpostor"));(ET=be.prototype).removeReflectionProbe??(ET.removeReflectionProbe=tt("Scene","removeReflectionProbe"));(ST=be.prototype).addReflectionProbe??(ST.addReflectionProbe=tt("Scene","addReflectionProbe"));(CT=be.prototype).getBoundingBoxRenderer??(CT.getBoundingBoxRenderer=tt("Scene","getBoundingBoxRenderer"));(AT=be.prototype).enableDepthRenderer??(AT.enableDepthRenderer=tt("Scene","enableDepthRenderer"));(MT=be.prototype).disableDepthRenderer??(MT.disableDepthRenderer=tt("Scene","disableDepthRenderer"));(wT=be.prototype).enableFluidRenderer??(wT.enableFluidRenderer=tt("Scene","enableFluidRenderer"));(PT=be.prototype).disableFluidRenderer??(PT.disableFluidRenderer=tt("Scene","disableFluidRenderer"));(OT=be.prototype).enableGeometryBufferRenderer??(OT.enableGeometryBufferRenderer=tt("Scene","enableGeometryBufferRenderer"));(DT=be.prototype).disableGeometryBufferRenderer??(DT.disableGeometryBufferRenderer=tt("Scene","disableGeometryBufferRenderer"));(IT=be.prototype).enableIblCdfGenerator??(IT.enableIblCdfGenerator=tt("Scene","enableIblCdfGenerator"));(FT=be.prototype).disableIblCdfGenerator??(FT.disableIblCdfGenerator=tt("Scene","disableIblCdfGenerator"));(kT=be.prototype).getOutlineRenderer??(kT.getOutlineRenderer=tt("Scene","getOutlineRenderer"));(LT=be.prototype).enablePrePassRenderer??(LT.enablePrePassRenderer=tt("Scene","enablePrePassRenderer"));(BT=be.prototype).disablePrePassRenderer??(BT.disablePrePassRenderer=tt("Scene","disablePrePassRenderer"));
474(NT=be.prototype).enableSubSurfaceForPrePass??(NT.enableSubSurfaceForPrePass=tt("Scene","enableSubSurfaceForPrePass"));(UT=be.prototype).disableSubSurfaceForPrePass??(UT.disableSubSurfaceForPrePass=tt("Scene","disableSubSurfaceForPrePass"));(jT=be.prototype).pickSprite??(jT.pickSprite=tt("Scene","pickSprite"));(GT=be.prototype).pickSpriteWithRay??(GT.pickSpriteWithRay=tt("Scene","pickSpriteWithRay"));(zT=be.prototype).multiPickSprite??(zT.multiPickSprite=tt("Scene","multiPickSprite"));(HT=be.prototype).multiPickSpriteWithRay??(HT.multiPickSpriteWithRay=tt("Scene","multiPickSpriteWithRay"));(VT=be.prototype).setPointerOverSprite??(VT.setPointerOverSprite=tt("Scene","setPointerOverSprite"));(XT=be.prototype).getPointerOverSprite??(XT.getPointerOverSprite=tt("Scene","getPointerOverSprite"));Object.getOwnPropertyDescriptor(be.prototype,"mainSoundTrack")||Object.defineProperty(be.prototype,"mainSoundTrack",Jt("Scene","mainSoundTrack"));Object.getOwnPropertyDescriptor(be.prototype,"soundTracks")||Object.defineProperty(be.prototype,"soundTracks",Jt("Scene","soundTracks"));Object.getOwnPropertyDescriptor(be.prototype,"audioEnabled")||Object.defineProperty(be.prototype,"audioEnabled",Jt("Scene","audioEnabled"));Object.getOwnPropertyDescriptor(be.prototype,"headphone")||Object.defineProperty(be.prototype,"headphone",Jt("Scene","headphone"));Object.getOwnPropertyDescriptor(be.prototype,"audioListenerPositionProvider")||Object.defineProperty(be.prototype,"audioListenerPositionProvider",Jt("Scene","audioListenerPositionProvider"));Object.getOwnPropertyDescriptor(be.prototype,"audioListenerRotationProvider")||Object.defineProperty(be.prototype,"audioListenerRotationProvider",Jt("Scene","audioListenerRotationProvider"));Object.getOwnPropertyDescriptor(be.prototype,"audioPositioningRefreshRate")||Object.defineProperty(be.prototype,"audioPositioningRefreshRate",Jt("Scene","audioPositioningRefreshRate"));Object.getOwnPropertyDescriptor(be.prototype,"selectionOctree")||Object.defineProperty(be.prototype,"selectionOctree",Jt("Scene","selectionOctree"));Object.getOwnPropertyDescriptor(be.prototype,"debugLayer")||Object.defineProperty(be.prototype,"debugLayer",Jt("Scene","debugL
474ayer"));Object.getOwnPropertyDescriptor(be.prototype,"gamepadManager")||Object.defineProperty(be.prototype,"gamepadManager",Jt("Scene","gamepadManager"));Object.getOwnPropertyDescriptor(be.prototype,"simplificationQueue")||Object.defineProperty(be.prototype,"simplificationQueue",Jt("Scene","simplificationQueue"));Object.getOwnPropertyDescriptor(be.prototype,"onBeforePhysicsObservable")||Object.defineProperty(be.prototype,"onBeforePhysicsObservable",Jt("Scene","onBeforePhysicsObservable"));Object.getOwnPropertyDescriptor(be.prototype,"onAfterPhysicsObservable")||Object.defineProperty(be.prototype,"onAfterPhysicsObservable",Jt("Scene","onAfterPhysicsObservable"));Object.getOwnPropertyDescriptor(be.prototype,"reflectionProbes")||Object.defineProperty(be.prototype,"reflectionProbes",Jt("Scene","reflectionProbes"));Object.getOwnPropertyDescriptor(be.prototype,"forceShowBoundingBoxes")||Object.defineProperty(be.prototype,"forceShowBoundingBoxes",Jt("Scene","forceShowBoundingBoxes"));Object.getOwnPropertyDescriptor(be.prototype,"depthPeelingRenderer")||Object.defineProperty(be.prototype,"depthPeelingRenderer",Jt("Scene","depthPeelingRenderer"));Object.getOwnPropertyDescriptor(be.prototype,"useOrderIndependentTransparency")||Object.defineProperty(be.prototype,"useOrderIndependentTransparency",Jt("Scene","useOrderIndependentTransparency"));Object.getOwnPropertyDescriptor(be.prototype,"fluidRenderer")||Object.defineProperty(be.prototype,"fluidRenderer",Jt("Scene","fluidRenderer"));Object.getOwnPropertyDescriptor(be.prototype,"geometryBufferRenderer")||Object.defineProperty(be.prototype,"geometryBufferRenderer",Jt("Scene","geometryBufferRenderer"));Object.getOwnPropertyDescriptor(be.prototype,"iblCdfGenerator")||Object.defineProperty(be.prototype,"iblCdfGenerator",Jt("Scene","iblCdfGenerator"));Object.getOwnPropertyDescriptor(be.prototype,"prePassRenderer")||Object.defineProperty(be.prototype,"prePassRenderer",Jt("Scene","prePassRenderer"));Object.getOwnPropertyDescriptor(be.prototype,"subSurfaceConfiguration")||Object.defineProperty(be.prototype,"subSurfaceConfiguration",Jt("Scene","subSurfaceConfiguration"));Object.getOwnPropertyDescriptor(be.prototype,"spriteManagers")||Object.defineProperty(be.prototype,"spriteManagers",Jt("Scene","spriteManagers"));Object.getOwnPropertyDescriptor(be.prototype,"onBeforeSpritesRenderingObservable")||Object.defineProperty(be.prototype,"onBeforeSpritesRenderingObservable",Jt("Scene","onBeforeSpritesRenderingObservable"));Object.getOwnPropertyDescriptor(be.prototype,"onAfterSpritesRenderingObservable")||Object.defineProperty(be.prototype,"onAfterSpritesRenderingObservable",Jt("Scene","onAfterSpritesRenderingObservable"));h4();XG();kj();const d4="/manus-storage/office-background_5ec14243.png";async function f4(i,e){const t=new be(i);t.clearColor=new St(.015,.024,.04,1);const s=new OA("editorial-camera",new I(0,0,-10),t);s.setTarget(I.Zero()),t.activeCamera=s;const n=new yc("office-background",d4,t,!0),a=n.texture;a.wrapU=gc.CLAMP_ADDRESSMODE,a.wrapV=gc.CLAMP_ADDRESSMODE,a.uScale=1.025,a.vScale=1.025,a.uOffset=-.0125,a.vOffset=-.0125,await new Promise(h=>{if(a.isReady()){h();return}const f=window.setTimeout(h,6e3);a.onLoadObservable.addOnce(()=>{window.clearTimeout(f),h()})});const l=new yc("cinematic-grade",null,t,!1,new St(.01,.025,.05,.34));l.alphaBlendingMode=2;const u=t.onBeforeRenderObservable.add(()=>{const h=performance.now()*8e-5;a.uOffset=-.0125+Math.sin(h)*.0025,a.vOffset=-.0125+Math.cos(h*.7)*.0015});return{scene:t,dispose(){t.onBeforeRenderObservable.remove(u),n.dispose(),l.dispose(),t.dispose()}}}class _4{constructor(){this.context=null,this.masterGain=null,this.ambientSource=null,this.ambientGain=null,this.rareAchievementAudio=null,this.volume=.58,this.muted=!1}getContext(){return typeof window>"u"||typeof AudioContext>"u"?null:(this.context||(this.context=new AudioContext,this.masterGain=this.context.createGain(),this.masterGain.connect(this.context.destination),this.syncMasterGain()),this.context.state==="suspended"&&this.context.resume(),this.context)}getDestination(){const e=this.getContext();return!e||!this.masterGain?null:{context:e,destination:this.masterGain}}syncMasterGain(){if(!this.context||!this.masterGain)return;const e=this.muted?1e-4:Math.max(1e-4,this.volume);this.masterGain.gain.setTargetAtTime(e,this.context.currentTime,.035)}unlock(){const e=this.getContext();e?.state==="suspended"&&e.resume()}setVolume(e){this.volume=Math.max(0,Math.min(1,e)),this.rareAchievementAudio&&(this.rareAchievementAudio.volume=Math.min(1,this.volume*.88)),this.syncMasterGain()}setMuted(e){this.muted=e,this.rareAchievementAudio&&(this.rareAchievementAudio.muted=e),this.syncMasterGain()}startAmbient(){const e=this.getDestination();if(!e||this.ambientSource)return;const{context:t,destination:s}
474=e,a=t.createBuffer(1,Math.floor(t.sampleRate*4),t.sampleRate),l=a.getChannelData(0);let u=0;for(let b=0;b<l.length;b+=1){const v=Math.random()*2-1;u=u*.86+v*.14;const R=.7+Math.sin(b/t.sampleRate*Math.PI*.7)*.18;l[b]=u*R}const h=t.createBufferSource(),f=t.createBiquadFilter(),m=t.createBiquadFilter(),p=t.createGain();h.buffer=a,h.loop=!0,f.type="highpass",f.frequency.value=180,m.type="lowpass",m.frequency.value=1450,p.gain.value=.035,h.connect(f).connect(m).connect(p).connect(s),h.start(),this.ambientSource=h,this.ambientGain=p}playPageTurn(){const e=this.getDestination();if(!e)return;const{context:t,destination:s}=e,n=.42,a=t.createBuffer(1,Math.floor(t.sampleRate*n),t.sampleRate),l=a.getChannelData(0);for(let p=0;p<l.length;p+=1){const b=p/l.length,v=Math.random()*2-1,R=Math.sin(b*Math.PI)*(1-b*.35);l[p]=v*R}const u=t.createBufferSource(),h=t.createBiquadFilter(),f=t.createGain(),m=t.currentTime;u.buffer=a,h.type="bandpass",h.Q.value=.7,h.frequency.setValueAtTime(1900,m),h.frequency.exponentialRampToValueAtTime(520,m+n),f.gain.setValueAtTime(1e-4,m),f.gain.exponentialRampToValueAtTime(.065,m+.07),f.gain.exponentialRampToValueAtTime(1e-4,m+n),u.connect(h).connect(f).connect(s),u.start(m),u.stop(m+n)}playStamp(){const e=this.getDestination();if(!e)return;const{context:t,destination:s}=e,n=t.currentTime,a=t.createOscillator(),l=t.createGain();a.type="sine",a.frequency.setValueAtTime(118,n),a.frequency.exponentialRampToValueAtTime(54,n+.13),l.gain.setValueAtTime(1e-4,n),l.gain.exponentialRampToValueAtTime(.13,n+.008),l.gain.exponentialRampToValueAtTime(1e-4,n+.17),a.connect(l).connect(s),a.start(n),a.stop(n+.18);const u=.11,h=t.createBuffer(1,Math.floor(t.sampleRate*u),t.sampleRate),f=h.getChannelData(0);for(let v=0;v<f.length;v+=1){const R=1-v/f.length;f[v]=(Math.random()*2-1)*R*R}const m=t.createBufferSource(),p=t.createBiquadFilter(),b=t.createGain();m.buffer=h,p.type="lowpass",p.frequency.value=1100,b.gain.setValueAtTime(.075,n),b.gain.exponentialRampToValueAtTime(1e-4,n+u),m.connect(p).connect(b).connect(s),m.start(n)}playCourtReminder(){const e=this.getDestination();if(!e)return;const{context:t,destination:s}=e,n=t.currentTime;[0,.2].forEach((a,l)=>{const u=t.createOscillator(),h=t.createGain();u.type="sine",u.frequency.value=l===0?740:988,h.gain.setValueAtTime(1e-4,n+a),h.gain.exponentialRampToValueAtTime(.055,n+a+.018),h.gain.exponentialRampToValueAtTime(1e-4,n+a+.34),u.connect(h).connect(s),u.start(n+a),u.stop(n+a+.36)})}playRareAchievement(){if(typeof Audio>"u"||this.muted||this.volume<=0)return;this.rareAchievementAudio?.pause();const e=new Audio("/manus-storage/rare-achievement_66dd0633.wav");e.volume=Math.min(1,this.volume*.88),e.addEventListener("ended",()=>{this.rareAchievementAudio===e&&(this.rareAchievementAudio=null)}),this.rareAchievementAudio=e,e.play().catch(()=>{this.rareAchievementAudio===e&&(this.rareAchievementAudio=null)})}dispose(){this.rareAchievementAudio?.pause(),this.rareAchievementAudio=null,this.ambientSource?.stop(),this.ambientSource=null,this.ambientGain=null,this.context&&this.context.state!=="closed"&&this.context.close(),this.masterGain=null,this.context=null}}const p4={commitMs:520,finishMs:3e3,sheetTurnMs:880},m4={commitMs:520,finishMs:5e3,sheetTurnMs:880},g4={commitMs:60,finishMs:1800,sheetTurnMs:0},y4={commitMs:60,finishMs:5e3,sheetTurnMs:0};function YT(i,e=!1){const t=i?e?y4:g4:e?m4:p4;return{...t,readableMs:t.finishMs-t.sheetTurnMs,interactive:e}}function b4(i,e){return Math.max(0,i-Math.max(0,e))}const vh={mentor:"/manus-storage/mentor_44cb58d3.png",client:"/manus-storage/client_00dc4333.png",intern:"/manus-storage/intern_46e1cc47.png"},am=[{code:"INTAKE",label:"委任範圍確認",mark:"收件",icon:Im,tone:"intake"},{code:"INTERVIEW",label:"人物陳述紀錄",mark:"訪談",icon:km,tone
474:"interview"},{code:"EVIDENCE",label:"證據與時間線",mark:"卷證",icon:fd,tone:"evidence"},{code:"STRATEGY",label:"爭點與法律策略",mark:"研究",icon:Dm,tone:"strategy"},{code:"PLEADING",label:"書狀版本管理",mark:"初稿",icon:dC,tone:"pleading"},{code:"REPORT",label:"風險與決策摘要",mark:"回報",icon:Da,tone:"report"},{code:"CLOSING",label:"今日案件工作紀錄",mark:"結案",icon:xi,tone:"closing"}],x4="依法解決:實習律師的一天|臺灣法律職涯模擬、案件推理、專業倫理、客戶訪談與書狀實務互動遊戲原型",_g=[{key:"facts",label:"事實掌握",short:"事實",icon:fd,tone:"teal"},{key:"reasoning",label:"法律推理",short:"推理",icon:Dm,tone:"gold"},{key:"trust",label:"客戶信任",short:"信任",icon:km,tone:"teal"},{key:"ethics",label:"專業倫理",short:"倫理",icon:Da,tone:"gold"},{key:"energy",label:"身心能量",short:"能量",icon:SL,tone:"slate"},{key:"deadline",label:"期限餘裕",short:"期限",icon:mh,tone:"red"}],jA={briefcase:Im,search:fd,evidence:gC,ethics:Da,trust:km,professional:xi,balance:xi,deadline:Fm,insight:mL},v4={status:"intro",stageIndex:0,metrics:{facts:22,reasoning:28,trust:48,ethics:62,energy:76,deadline:70},discoveredFacts:[],tags:[],feedback:null,selectedChoice:null,ending:null};function pg({metric:i,value:e,compact:t=!1}){const s=i.icon;return _.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:115",className:`metric metric--${i.tone} ${t?"metric--compact":""}`,children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:116",className:"metric__label",children:[_.jsx(s,{"data-loc":"client/src/components/GameCanvas.tsx:117","aria-hidden":"true"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:118",children:t?i.short:i.label}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:119",children:e})]}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:121",className:"metric__track","aria-label":`${i.label} ${e}`,children:_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:122",style:{transform:`scaleX(${e/100})`}})})]})}function R4({label:i}){return _.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:130",className:"legal-loader","aria-live":"polite","aria-label":"遊戲載入中",children:[_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:131",className:"legal-loader__glow","aria-hidden":"true"}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:132",className:"legal-loader__content",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:133",className:"legal-loader__seal","aria-hidden":"true",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:134",className:"legal-loader__scales",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:135",className:"scale-pillar"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:136",className:"scale-beam"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:137",className:"scale-pan scale-pan--left"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:138",className:"scale-pan scale-pan--right"})]}),_.jsx(xi,{"data-loc":"client/src/components/GameCanvas.tsx:140"})]}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:142",className:"eyebrow",children:"RESOLVE BY LAW · CASE INITIALIZATION"}),_.jsx("h1",{"data-loc":"client/src/components/GameCanvas.tsx:143",children:"依法解決"}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:144",className:"legal-loader__label",children:i}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:145",className:"legal-loader__files","aria-hidden":"true",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:146"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:147"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:148"}),_.jsx("i",{"data-loc":"client/src/components/GameCanvas.tsx:149"})]}),_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:151",children:"正在建立今日案件環境"})]})]})}function T4({stages:i,targetIndex:e,hold:t=!1,titleHold:s=!1,durationMs:n=3e3,interactive:a=!1,paused:l=!1,onTogglePaused:u}){const h=i[e],f=am[Math.min(e,am.length-1)],m=f.icon,p=a?{role:"button",tabIndex:0,onClick:u,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),u?.())},"aria-label":l?"大字報已暫停,點擊繼續":"點擊暫停大字報"}:{"aria-hidden":!0};return _.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:194",className:`page-turn page-turn--${f.tone} ${t?"page-turn--hold":""} ${s?"page-turn--title-hold":""} ${a?"page-turn--interactive":""} ${l?"is-paused":""}`,style:{"--page-turn-duration":`${n}ms`},...p,children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:199",className:"page-turn__underlay",children:[h?.phase!=="成果交付"&&_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:200",children:h?h.phase:"今日結算"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:201",children:h?h.title:"案件工作紀錄"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:202",children:h?h.kicker:"END OF DAY"}),a&&_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:204",className:"page-turn__pause-hint",children:[l?_.jsx(_L,{"data-loc":"client/src/components/GameCanvas.tsx:205"}):_.jsx(fL,{"data-loc":"client/src/components/GameCanvas.tsx:205"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:206",children:l?"已暫停 · 點擊繼續":"點擊畫面可暫停閱讀"})]})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:210",className:"page-turn__sheet",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:211",className:"page-turn__tab",children:[f.code," · 24-0917"]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:212",className:"page-turn__mark",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:212",children:f.mark}),_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:212",children:"衡岳法律事務所"})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:213",className:"page-turn__lines",children:[_.jsx("i",{"data-loc":"client/src/components/GameCanvas.tsx:213"}),_.jsx("i",{"data-loc":"client/src/components/GameCanvas.tsx:213"}),_.jsx("i",{"data-loc":"client/src/components/GameCanvas.tsx:213"}),_.jsx("i",{"data-loc":"client/src/components/GameCanvas.tsx:213"}),_.jsx("i",{"data-loc":"client/src/components/GameCanvas.tsx:213"})]}),_.jsx(m,{"data-loc":"client/src/components/GameCanvas.tsx:214"}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:215",children:f.label}),_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:216",children:"CONFIDENTIAL · INTERNAL WORK PRODUCT"})]}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:218",className:"page-turn__shadow"})]})}function E4(){return _.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:225",className:"decision-stamp","aria-hidden":"true",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:226",children:"已記錄"}),_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:227",children:"FILED"})]})}function S4({achievement:i,preview:e=!1}){const t=jA[i.icon];return _.jsxs("aside",{"data-loc":"client/src/components/GameCanvas.tsx:235",className:`achievement-toast achievement-toast--${i.rarity} ${e?"achievement-toast--preview":""}`,role:"status","aria-live":"assertive",children:[_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:236",className:"achievement-toast__flare","aria-hidden":"true"}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:237",className:"achievement-toast__icon",children:_.jsx(t,{"data-loc":"client/src/components/GameCanvas.tsx:237"})}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:238",children:[_.jsxs("small",{"data-loc":"client/src/components/GameCanvas.tsx:239",children:["ACHIEVEMENT UNLOCKED 
474· ",SA[i.rarity],"成就"]}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:240",children:i.title}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:241",children:i.description})]})]})}function GA({count:i,onClick:e,floating:t=!1}){return _.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:249",className:`achievement-button ${t?"achievement-button--floating":""}`,onClick:e,"aria-label":`查看成就,已解鎖 ${i} 項`,title:"成就圖鑑",children:[_.jsx(Pn,{"data-loc":"client/src/components/GameCanvas.tsx:255"}),_.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:256",children:[i,"/",An.length]})]})}function C4({unlockedIds:i,onClose:e,onClear:t}){const[s,n]=C.useState(!1),[a,l]=C.useState(!1),u=new Set(i),h=u.size/An.length*100;return _.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:275",className:"achievement-gallery",role:"dialog","aria-modal":"true","aria-labelledby":"achievement-gallery-title",children:[_.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:276",className:"achievement-gallery__backdrop",onClick:e,"aria-label":"關閉成就圖鑑"}),_.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:277",className:"achievement-gallery__panel",children:[_.jsxs("header",{"data-loc":"client/src/components/GameCanvas.tsx:278",children:[_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:279",className:"achievement-gallery__seal",children:_.jsx(Pn,{"data-loc":"client/src/components/GameCanvas.tsx:279"})}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:280",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:281",children:"CAREER RECORD · 實習律師的一天"}),_.jsx("h2",{"data-loc":"client/src/components/GameCanvas.tsx:282",id:"achievement-gallery-title",children:"成就圖鑑"}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:283",children:"每一枚徽章,都記錄你如何在期限與專業之間做出判斷。"})]}),_.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:285",className:"achievement-gallery__close",onClick:e,"aria-label":"關閉成就圖鑑",children:_.jsx(EC,{"data-loc":"client/src/components/GameCanvas.tsx:285"})})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:287",className:"achievement-progress",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:288",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:288",children:"解鎖進度"}),_.jsxs("strong",{"data-loc":"client/src/components/GameCanvas.tsx:288",children:[u.size," / ",An.length]})]}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:289",className:"achievement-progress__track",children:_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:289",style:{transform:`scaleX(${h/100})`}})})]}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:291",className:"achievement-grid",children:An.map((f,m)=>{const p=u.has(f.id),b=jA[f.icon],v=f.hidden&&!p;return _.jsxs("article",{"data-loc":"client/src/components/GameCanvas.tsx:297",className:`${p?"is-unlocked":"is-locked"} achievement-card--${f.rarity} ${v?"is-hidden":""}`,children:[_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:301",className:"achievement-card__number",children:String(m+1).padStart(2,"0")}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:302",className:"achievement-card__icon",children:p?_.jsx(b,{"data-loc":"client/src/components/GameCanvas.tsx:302"}):v?_.jsx(lL,{"data-loc":"client/src/components/GameCanvas.tsx:302"}):_.jsx(yC,{"data-loc":"client/src/components/GameCanvas.tsx:302"})}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:303",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:304",className:"achievement-card__meta",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:305",children:p?"ACHIEVED":v?"HIDDEN":"LOCKED"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:306",children:v?"隱藏":SA[f.rarity]})]}),_.jsx("h3",{"data-loc":"client/src/components/GameCanvas.tsx:308",children:v?"???":f.title}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:309",children:p?f.description:v?"完成遊戲中的特殊判斷,揭露這枚徽章。":f.conditionLabel})]})]},f.id)})}),_.jsxs("footer",{"data-loc":"client/src/components/GameCanvas.tsx:315",className:"achievement-settings",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:316",className:"achievement-settings__copy",children:[_.jsx(yL,{"data-loc":"client/src/components/GameCanvas.tsx:317"}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:318",children:[_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:318",children:"成就紀錄設定"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:318",children:"清除後,所有徽章將重新變為未解鎖。"})]})]}),s?_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:321",className:"achievement-settings__confirm",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:322",children:"確å
474®šæ¸…除?"}),_.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:323",onClick:()=>n(!1),children:"取消"}),_.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:324",className:"is-destructive",onClick:()=>{t(),n(!1),l(!0)},children:"確認清除"})]}):_.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:336",className:"achievement-settings__clear",onClick:()=>{l(!1),n(!0)},disabled:u.size===0,children:a?"已清除":"清除進度"})]})]})]})}function A4({onStart:i}){return _.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:355",className:"intro-screen","aria-labelledby":"game-title",children:[_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:356",className:"intro-screen__wash"}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:357",className:"intro-card",children:[_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:358",className:"brand-seal","aria-hidden":"true",children:_.jsx(xi,{"data-loc":"client/src/components/GameCanvas.tsx:359"})}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:361",className:"eyebrow",children:"律師生涯模擬 · 第三章"}),_.jsxs("h1",{"data-loc":"client/src/components/GameCanvas.tsx:362",id:"game-title",children:["依法解決 ",_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:363",children:"/"}),_.jsx("em",{"data-loc":"client/src/components/GameCanvas.tsx:364",children:"實習律師的一天"})]}),_.jsxs("h2",{"data-loc":"client/src/components/GameCanvas.tsx:366",className:"intro-card__lead",children:["今天 18:00 前,交出一份",_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:367",children:"能站得住腳"}),"的起訴狀。",_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:368",className:"sr-only",children:"體驗臺灣實習律師從客戶訪談、卷證分析到書狀交付的一日職涯挑戰"})]}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:370",className:"intro-card__copy",children:"你將訪談客戶、整理卷證、建立法律策略,並決定如何面對一項足以改變案件走向的不利事實。 沒有完美答案;每一個決定,都會進入你的生涯履歷。"}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:375",className:"work-model","aria-label":"法律任務三步驟",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:376",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:377",children:"01"}),_.jsx(fd,{"data-loc":"client/src/components/GameCanvas.tsx:378"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:379",children:"數據擷取"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:380",children:"問對問題,找到真正的事實"})]}),_.jsx(u0,{"data-loc":"client/src/components/GameCanvas.tsx:382","aria-hidden":"true"}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:383",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:384",children:"02"}),_.jsx(Dm,{"data-loc":"client/src/components/GameCanvas.tsx:385"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:386",children:"邏輯轉換"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:387",children:"把資料轉成爭點與策略"})]}),_.jsx(u0,{"data-loc":"client/src/components/GameCanvas.tsx:389","aria-hidden":"true"}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:390",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:391",children:"03"}),_.jsx(dC,{"data-loc":"client/src/components/GameCanvas.tsx:392"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:393",children:"成果交付"}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:394",children:"交付能被理解與決策的成果"})]})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:398",className:"intro-card__action",children:[_.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:399",className:"primary-action",onClick:i,children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:400",children:"開始第一天"}),_.jsx(Gp,{"data-loc":"client/src/components/GameCanvas.tsx:401","aria-hidden":"true"})]}),_.jsxs("p",{"data-loc":"client/src/components/GameCanvas.tsx:403",children:[_.jsx(pC,{"data-loc":"client/src/components/GameCanvas.tsx:404","aria-hidden":"true"})," 約 8–12 分鐘 · 所有內容均為虛構,不構成法律意見"]})]})]})]})}function M4({stages:i,snapshot:e,muted:t,volume:s,onToggleMuted:n,onVolumeChange:a,onReminder:l,achievementCount:u,onOpenAchievements:h}){const f=i[e.stageIndex];return _.jsxs("header",{"data-loc":"client/src/components/GameCanvas.tsx:435",className:"top-bar",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:436",className:"top-brand",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:437",className:"top-brand__mark",children:_.jsx(xi,{"data-loc":"client/src/components/GameCanvas.tsx:437"})}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:438",children:[_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:438",children:"依法解決"}),_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:438",children:"RESOLVE BY LAW"})]})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:440",className:"case-clock",children:[_.jsx(pC,{"data-loc":"client/src/components/GameCanvas.tsx:441","aria-hidden":"true"}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:442",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:442",children:"事務所時間"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:442",children:f.time})]}),_.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:443",children:["距初稿期限 ",Math.max(0,Math.round(e.metrics.deadline/7))," 小時"]})]}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:445",className:"top-metrics",children:_g.slice(0,4).map(m=>_.jsx(pg,{"data-loc":"client/src/components/GameCanvas.tsx:447",metric:m,value:e.metrics[m.key],compact:!0},m.key))}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:450",className:"top-utilities",children:[_.jsx(GA,{"data-loc":"client/src/components/GameCanvas.tsx:451",count:u,onClick:h}),_.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:452",className:"reminder-button",onClick:l,"aria-label":"播放開庭提示音",title:"播放開庭提示音",children:_.jsx(iL,{"data-loc":"client/src/components/GameCanvas.tsx:453"})}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:455",className:"audio-control",children:[_.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:456",onClick:n,"aria-label":t?"開啟音效":"關閉音效",title:t?"開啟音效":"關閉音效",children:t?_.jsx(EL,{"data-loc":"client/src/components/GameCanvas.tsx:457"}):_.jsx(TL,{"data-loc":"client/src/components/GameCanvas.tsx:457"})}),_.jsxs("label",{"data-loc":"client/src/components/GameCanvas.tsx:459",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:460",className:"sr-only",children:"主音量"}),_.jsx("input",{"data-loc":"client/src/components/GameCanvas.tsx:461",type:"range",min:"0",max:"100",value:Math.round(s*100),onChange:m=>a(Number(m.target.value)/100),"aria-label":`主音量 ${Math.round(s*100)}%`})]})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:471",className:"day-score",title:"六項能力平均",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:472",children:"狀態"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:473",children:RG(e.metrics)})]})]})]})}function w4({index:i,stages:e}){return _.jsxs("aside",{"data-loc":"client/src/components/GameCanvas.tsx:482",className:"phase-rail","aria-label":"今日任務進度",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:483",className:"phase-rail__heading",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:484",children:"CHAPTER 03"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:485",children:"實習律師"})]}),_.jsx("ol",{"data-loc":"client/src/components/GameCanvas.tsx:487",children:e.map((t,s)=>{const n=s<i,a=s===i;return _.jsxs("li",{"data-loc":"client/src/components/GameCanvas.tsx:492",className:a?"is-current":n?"is-complete":"",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:493",children:n?_.
474jsx(Cc,{"data-loc":"client/src/components/GameCanvas.tsx:493"}):s+1}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:494",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:494",children:t.phase}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:494",children:t.kicker.split(" · ")[1]})]})]},t.id)})})]})}function P4({snapshot:i}){const e=i.discoveredFacts.slice(-5);return _.jsxs("aside",{"data-loc":"client/src/components/GameCanvas.tsx:506",className:"case-memo",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:507",className:"case-memo__title",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:508",children:[_.jsx(Im,{"data-loc":"client/src/components/GameCanvas.tsx:508"}),_.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:508",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:508",children:"CASE FILE 24-0917"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:508",children:"晟光設計尾款案"})]})]}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:509",className:"confidential",children:"機密"})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:512",className:"memo-section",children:[_.jsxs("p",{"data-loc":"client/src/components/GameCanvas.tsx:513",className:"memo-label",children:[_.jsx(gC,{"data-loc":"client/src/components/GameCanvas.tsx:513"})," 已確認事實 ",_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:513",children:i.discoveredFacts.length})]}),_.jsx("ul",{"data-loc":"client/src/components/GameCanvas.tsx:514",children:e.map((t,s)=>_.jsxs("li",{"data-loc":"client/src/components/GameCanvas.tsx:516",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:516",children:String(s+1).padStart(2,"0")}),t]},t))})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:521",className:"memo-section memo-section--metrics",children:[_.jsxs("p",{"data-loc":"client/src/components/GameCanvas.tsx:522",className:"memo-label",children:[_.jsx(Um,{"data-loc":"client/src/components/GameCanvas.tsx:522"})," 工作狀態"]}),_g.slice(4).map(t=>_.jsx(pg,{"data-loc":"client/src/components/GameCanvas.tsx:524",metric:t,value:i.metrics[t.key]},t.key))]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:528",className:"memo-tags",children:[_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:529",className:"memo-label",children:"生涯紀錄"}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:530",children:i.tags.length===0?_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:531",className:"empty-tag",children:"尚無紀錄"}):i.tags.slice(-4).map(t=>_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:531",children:t},t))})]})]})}function O4({speaker:i}){const e=i==="narrator"?"intern":i;return _.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:541",className:"character-stage","aria-hidden":"true",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:542",className:`character character--mentor ${e==="mentor"?"is-active":""}`,children:[_.jsx("img",{"data-loc":"client/src/components/GameCanvas.tsx:543",src:vh.mentor,alt:""}),_.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:544",children:["周律師",_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:544",children:"指導律師"})]})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:546",className:`character character--client ${e==="client"?"is-active":""}`,children:[_.jsx("img",{"data-loc":"client/src/components/GameCanvas.tsx:547",src:vh.client,alt:""}),_.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:548",children:["陳雅雯",_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:548",children:"委任人"})]})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:550",className:`character character--intern ${e==="intern"?"is-active":""}`,children:[_.jsx("img",{"data-loc":"client/src/components/GameCanvas.tsx:551",src:vh.intern,alt:""}),_.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:552",children:["你",_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:552",children:"實習律師"})]})]})]})}function D4({stages:i,snapshot:e,onChoose:t,onContinue:s}){const n=i[e.stageIndex];return _.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:571",className:"decision-panel","aria-labelledby":"stage-title",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:572",className:"dialogue-block",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:573",className:"dialogue-meta",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:574",children:n.kicker}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:575",children:n.location}),_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:576",className:`phase-pill phase-pill--${n.phase==="數據擷取"?"data":n.phase==="邏輯轉換"?"logic":"output"}`,children:n.phase})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:578",className:"dialogue-copy",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:579",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:580",children:n.speakerName}),_.jsx("h2",{"data-loc":"client/src/components/GameCanvas.tsx:581",id:"stage-title",children:n.title})]}),_.jsxs("blockquote",{"data-loc":"client/src/components/GameCanvas.tsx:583",children:["「",n.dialogue,"」"]}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:584",children:n.brief})]})]}),e.feedback?_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:589",className:"feedback-panel",role:"status",children:[_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:590",className:"feedback-panel__icon",children:_.jsx(Cc,{"data-loc":"client/src/components/GameCanvas.tsx:590"})}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:591",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:591",children:"決定已寫入生涯履歷"}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:591",children:e.feedback})]}),_.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:592",onClick:s,className:"continue-action",children:[e.stageIndex===i.length-1?"查看今日結算":"進入下一任務",_.jsx(Gp,{"data-loc":"client/src/components/GameCanvas.tsx:594"})]})]}):_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:598",className:"choice-grid","aria-label":"請選擇行動",children:[n.choices.map((a,l)=>_.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:600",onClick:()=>t(a.id),className:`choice-card choice-card--${a.tone}`,children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:601",className:"choice-card__number",children:l+1}),_.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:602",className:"choice-card__copy",children:[_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:602",children:a.label}),_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:602",children:a.detail})]}),_.jsx(Gp,{"data-loc":"client/src/components/GameCanvas.tsx:603","aria-hidden":"true"})]},a.id)),_.jsxs("p",{"data-loc":"client/src/components/GameCanvas.tsx:606",className:"keyboard-hint",children:["按鍵 ",_.jsx("kbd",{"data-loc":"client/src/components/GameCanvas.tsx:606",children:"1"})," ",_.jsx("kbd",{"data-loc":"client/src/components/GameCanvas.tsx:606",children:"2"})," ",_.jsx("kbd",{"data-loc":"client/src/components/GameCanvas.tsx:606",children:"3"})," 可快速選擇"]})]})]})}function I4({snapshot:i,onReset:e}){const t=i.ending;return t?_.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:617",className:`ending-screen ending-screen--${t.color}`,"aria-labelledby":"ending-title",children:[_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:618",className:"ending-screen__backdrop"}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:619",className:"ending-card",children:[_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:620",className:"ending-grade",children:[_.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:620",children:"今日評等"}),_.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:620",children:t.grade})]}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:621",className:"ending-copy",children:[_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:622",className:"eyebrow",children:"18:03 · 初稿送出"}),_.jsx("h1",{"data-loc":"client/src/components/GameCanvas.tsx:623",id:"ending-title",children:t.title}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:624",className:"ending-summary",children:t.summary}),_.jsxs("blockquote",{"data-loc":"client/src/components/GameCanvas.tsx:625",children:[_.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:625",children:"周律師:"}),"「",t.mentorNote,"」"]}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:626",className:"career-tag",children:t.careerTag})]}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:628",className:"ending-metrics",children:_g.map(s=>_.jsx(pg,{"data-loc":"client/src/components/GameCanvas.tsx:629",metric:s,value:i.metrics[s.key]},s.key))}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:631",className:"ending-actions",children:[_.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:632",className:"primary-action",onClick:e,children:[_.jsx(Nm,{"data-loc":"client/src/components/GameCanvas.tsx:632"})," 重新挑戰這一天"]}),_.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:633",children:"不同選擇會留下不同的延遲後果。此原型已完成一個可重玩的案件循環。"})]})]})]}):null}
474function F4({stages:i=sm,initialAchievementIds:e=[],achievementStorageKey:t="resolve-by-law-achievements",onAchievementsChange:s,onAchievementsClear:n,onRunCompleted:a}){const l=C.useRef(null),u=C.useRef(!1),h=C.useRef(null),f=C.useRef([]),m=C.useRef(null),p=C.useRef(0),b=C.useRef(0),v=C.useRef(null),R=C.useRef(null),x=C.useRef(!1),[T,E]=C.useState(v4),[A,D]=C.useState(!0),[M,k]=C.useState("開啟案件卷宗"),[U,N]=C.useState(!1),[H,q]=C.useState(0),[re,ce]=C.useState(3e3),[ae,fe]=C.useState(!1),[_e,Te]=C.useState(!1),[z,J]=C.useState(!1),[Y]=C.useState(()=>{try{const Ne=JSON.parse(localStorage.getItem(t)??"[]"),rt=Array.isArray(Ne)?Ne.filter(vt=>typeof vt=="string"):[];return Array.from(new Set([...e,...rt]))}catch{return[...e]}}),[V,ge]=C.useState(Y),[L,B]=C.useState([]),[X,Q]=C.useState(null),[F,$]=C.useState(()=>new URLSearchParams(window.location.search).get("achievements")==="open"),[he,Ae]=C.useState(()=>localStorage.getItem("lawpath-muted")==="true"),[Oe,G]=C.useState(()=>{const Ne=Number(localStorage.getItem("lawpath-volume"));return Number.isFinite(Ne)&&Ne>=0&&Ne<=1?Ne:.58}),ie=C.useMemo(()=>{const Ne=new vG(i);return h.current=Ne,Ne},[i]),de=C.useMemo(()=>new _4,[]),Se=C.useMemo(()=>new bG(Y),[Y]),qe=C.useCallback(()=>{m.current=null,b.current=0,Te(!1),N(!1)},[]),Je=C.useCallback(Ne=>{b.current=Ne,p.current=performance.now();const rt=window.setTimeout(qe,Ne);m.current=rt,f.current.push(rt)},[qe]),Ct=C.useCallback(()=>{if(!U||!ae)return;if(_e){Te(!1),Je(b.current);return}const Ne=performance.now()-p.current;b.current=b4(b.current,Ne),m.current!==null&&(window.clearTimeout(m.current),m.current=null),Te(!0)},[U,ae,_e,Je]),es=C.useCallback(()=>{if(U)return;x.current=!1,v.current=Date.now(),R.current=null,de.unlock(),de.startAmbient(),de.playPageTurn(),q(0),N(!0);const Ne=window.matchMedia("(prefers-reduced-motion: reduce)").matches,rt=YT(Ne,!1);ce(rt.finishMs),fe(rt.interactive),Te(!1),f.current.push(window.setTimeout(()=>ie.start(),rt.commitMs)),Je(rt.finishMs)},[ie,U,Je,de]),ps=C.useCallback(()=>{de.unlock(),Ae(Ne=>!Ne)},[de]),Gt=C.useCallback(Ne=>{de.unlock(),G(Ne)},[de]),Rs=C.useCallback(()=>{de.unlock(),de.playCourtReminder()},[de]),ms=C.useCallback(Ne=>{de.unlock(),de.playStamp(),ie.choose(Ne),J(!0),f.current.push(window.setTimeout(()=>J(!1),620))},[ie,de]),et=C.useCallback(()=>{if(U)return;de.unlock(),de.playPageTurn();const Ne=Math.min(T.stageIndex+1,i.length),rt=i[Ne]?.phase==="成果交付";q(Ne),N(!0);const vt=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$s=YT(vt,rt);ce($s.finishMs),fe($s.interactive),Te(!1),f.current.push(window.setTimeout(()=>{ie.continue(),T.stageIndex===3&&de.playCourtReminder()},$s.commitMs)),Je($s.finishMs)},[ie,U,Je,T.stageIndex,de,i]),K=C.useCallback(()=>{de.unlock(),de.playPageTurn(),v.current=null,R.current=null,ie.reset()},[ie,de]),we=C.useCallback(()=>{x.current=!0,Se.clear(),ge([]),B([]),Q(null),localStorage.removeItem(t),n?.()},[Se,t,n]);C.useEffect(()=>{document.title=x4},[]),C.useEffect(()=>{de.setMuted(he),de.setVolume(Oe),localStorage.setItem("lawpath-muted",String(he)),localStorage.setItem("lawpath-volume",String(Oe))},[he,de,Oe]),C.useEffect(()=>()=>{f.current.forEach(Ne=>window.clearTimeout(Ne)),f.current=[],de.dispose()},[de]),C.useEffect(()=>ie.subscribe(E),[ie]),C.useEffect(()=>{if(x.current)return;const Ne=Se.evaluate(T);if(Ne.length===0)return;const rt=Se.getUnlockedIds();ge(rt),B(vt=>[...vt,...Ne]),localStorage.setItem(t,JSON.stringify(rt)),s?.(rt)},[Se,t,s,T]),C.useEffect(()=>{if(T.status!=="ending"||!T.ending||!a)return;const Ne=`${T.ending.id}:${T.tags.join("|")}`;if(R.current===Ne)return;R.current=Ne;const rt=v.current?Math.max(0,Math.round((Date.now()-v.current)/1e3)):0;a(T,rt)},[a,T]),C.useEffect(()=>{X||L.length===0||(Q(L[0]),B(Ne=>Ne.slice(1)))},[X,L]),C.useEffect(()=>{if(!X)return;X.rarity!=="common"&&de.playRareAchievement();const Ne=window.setTimeout(()=>Q(null),4200);return()=>window.clearTimeout(Ne)},[X,de]),C.useEffect(()=>{if(!F)return;const Ne=rt=>{rt.key==="Escape"&&$(!1)};return window.addEventListener("keydown",Ne),()=>window.removeEventListener("keydown",Ne)},[F]),C.useEffect(()=>{const Ne=l.current;if(!Ne||u.current)return;u.current=!0;let rt=!1,vt=null;const $s=performance.now(),ti=[],js=new URLSearchParams(window.location.search).get("loading")==="hold",Gs=new Ce(Ne,!0,{preserveDrawingBuffer:!0,stencil:!0,adaptToDeviceRatio:!0}),li=Promise.all(Object.values(vh).map(hs=>new Promise(st=>{const ke=new Image;ke.onload=()=>st(),ke.onerror=()=>st(),ke.src=hs})));ti.push(window.setTimeout(()=>k("核對人物與證據"),420),window.setTimeout(()=>k("建立法律爭點"),900)),Promise.all([f4(Gs),li]).then(([hs])=>{if(rt){hs.dispose();return}vt=hs,Gs.runRenderLoop(()=>hs.scene.render()),k("準備今日任務");const st=Math.max(0,1450-(performance.now()-$s));js||ti.push(window.setTimeout(()=>D(!1),st))});const Js=()=>Gs.resize();return window.addEventListener("resize",Js),()=>
474{rt=!0,ti.forEach(hs=>window.clearTimeout(hs)),window.removeEventListener("resize",Js),Gs.stopRenderLoop(),vt?.dispose(),Gs.dispose(),u.current=!1}},[]),C.useEffect(()=>{const Ne=new URLSearchParams(window.location.search).get("demo");if(Ne===null||A)return;const rt=window.setTimeout(()=>{if(T.status==="intro")ie.start();else if(T.status==="playing"&&!T.feedback){const vt=i[T.stageIndex]?.choices[0];vt&&ie.choose(vt.id)}else T.status==="playing"&&T.feedback&&ie.continue()},Ne==="fast"?70:T.status==="intro"?250:1500);return()=>window.clearTimeout(rt)},[ie,A,T,i]),C.useEffect(()=>{const Ne=rt=>{if(T.status==="intro"&&rt.key==="Enter"&&es(),T.status==="ending"&&rt.key.toLowerCase()==="r"&&K(),T.status==="playing"&&(T.feedback&&rt.key==="Enter"&&et(),!T.feedback&&["1","2","3"].includes(rt.key))){const vt=i[T.stageIndex]?.choices[Number(rt.key)-1];vt&&ms(vt.id)}};return window.addEventListener("keydown",Ne),()=>window.removeEventListener("keydown",Ne)},[ms,et,K,es,T,i]);const Ut=i[T.stageIndex],yt=new URLSearchParams(window.location.search).get("transition"),wt=yt==="hold"||yt==="title"||yt==="paused",Ot=Number(new URLSearchParams(window.location.search).get("cover")),Yt=Number.isInteger(Ot)?Math.max(0,Math.min(am.length-1,Ot)):1,Ft=wt?Yt:H,ns=i[Ft]?.phase==="成果交付",rs=new URLSearchParams(window.location.search).get("achievement"),zt=An.find(Ne=>Ne.id===rs);return _.jsxs("main",{"data-loc":"client/src/components/GameCanvas.tsx:1012",className:"game-shell",children:[_.jsx("canvas",{"data-loc":"client/src/components/GameCanvas.tsx:1013",ref:l,className:"game-canvas","aria-hidden":"true"}),_.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:1014",className:"game-grain","aria-hidden":"true"}),A&&_.jsx(R4,{"data-loc":"client/src/components/GameCanvas.tsx:1016",label:M}),!A&&T.status==="intro"&&_.jsx(A4,{"data-loc":"client/src/components/GameCanvas.tsx:1018",onStart:es}),!A&&T.status==="playing"&&_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:1021",className:"game-ui",children:[_.jsx(M4,{"data-loc":"client/src/components/GameCanvas.tsx:1022",stages:i,snapshot:T,muted:he,volume:Oe,onToggleMuted:ps,onVolumeChange:Gt,onReminder:Rs,achievementCount:V.length,onOpenAchievements:()=>$(!0)}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:1033",className:"play-space",children:[_.jsx(w4,{"data-loc":"client/src/components/GameCanvas.tsx:1034",index:T.stageIndex,stages:i}),_.jsx(O4,{"data-loc":"client/src/components/GameCanvas.tsx:1035",speaker:Ut.speaker}),_.jsx(P4,{"data-loc":"client/src/components/GameCanvas.tsx:1036",snapshot:T})]}),_.jsx(D4,{"data-loc":"client/src/components/GameCanvas.tsx:1038",stages:i,snapshot:T,onChoose:ms,onContinue:et})]}),!A&&T.status==="ending"&&_.jsx(I4,{"data-loc":"client/src/components/GameCanvas.tsx:1042",snapshot:T,onReset:K}),!A&&T.status!=="playing"&&_.jsx(GA,{"data-loc":"client/src/components/GameCanvas.tsx:1045",count:V.length,onClick:()=>$(!0),floating:!0}),!A&&(U||wt)&&_.jsx(T4,{"data-loc":"client/src/components/GameCanvas.tsx:1053",stages:i,targetIndex:Ft,hold:yt==="hold",titleHold:yt==="title"||yt==="paused",durationMs:wt&&ns?5e3:re,interactive:wt?ns:ae,paused:yt==="paused"||_e,onTogglePaused:Ct}),z&&_.jsx(E4,{"data-loc":"client/src/components/GameCanvas.tsx:1064"}),(X||zt)&&_.jsx(S4,{"data-loc":"client/src/components/GameCanvas.tsx:1066",achievement:zt??X,preview:!!zt}),F&&_.jsx(C4,{"data-loc":"client/src/components/GameCanvas.tsx:1072",unlockedIds:V,onClose:()=>$(!1),onClear:we}),_.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:1079",className:"prototype-note",children:[_.jsx(nL,{"data-loc":"client/src/components/GameCanvas.tsx:1079"})," 虛構教學原型 · 非法律意見"]})]})}function KT(){const i=Zi();return new URLSearchParams(window.location.search).get("preview")==="registration"?_.jsx(ZT,{"data-loc":"client/src/pages/GamePage.tsx:25"}):i.loading?_.jsx(zA,{"data-loc":"client/src/pages/GamePage.tsx:26"}):i.user?_.jsx(k4,{"data-loc":"client/src/pages/GamePage.tsx:28",user:i.user,onLogout:i.logout}):_.jsx(ZT,{"data-loc":"client/src/pages/GamePage.tsx:27"})}function zA(){return _.jsxs("main",{"data-loc":"client/src/pages/GamePage.tsx:32",className:"auth-loading",children:[_.jsx(xi,{"data-loc":"client/src/pages/GamePage.tsx:32"}),_.jsx(Yo,{"data-loc":"client/src/pages/GamePage.tsx:32",className:"is-spinning"}),_.jsx("p",{"data-loc":"client/src/pages/GamePage.tsx:32",children:"核對會員身分與測試資格"})]})}function ZT(){return _.jsxs("main",{"data-loc":"client/src/pages/GamePage.tsx:37",className:"registration-gate",children:[_.jsx("div",{"data-loc":"client/src/pages/GamePage.tsx:38",className:"registration-gate__grid"}),_.jsxs("section",{"data-loc":"client/src/pages/GamePage.tsx:39",className:"registration-gate__copy",children:[_.jsx("div",{"data-loc":"client/src/pages/GamePage.tsx:40",className:"registration-gate__seal",children:_.jsx(xi,{"data-loc":"client/src/pages/GamePage.tsx:40"})}),_.jsx("p",{"data-loc":"client/src/pages/GamePage.tsx:41",children:"RESOLVE BY LAW · CLOSED BETA"}),_.jsx("h1",{"data-loc":"client/src/pages/GamePage.tsx:42",children:"依法解決"}),_.jsx("h2",{"data-loc":"client/src/pages/GamePage.tsx:43",children:"註冊後,開始你的律師生涯紀錄。"}),_.jsx("p",{"data-loc":"client/src/pages/GamePage.tsx:44",className:"registration-gate__lead",children:"完成註冊或登入後,可使用邀請碼取得封閉測試資格,跨裝置保存結局、職涯等級、能力評分與九項成就。"}),_.jsxs("div",{"data-loc":"client/src/pages/GamePage.tsx:45",className:"registration-features",children:[_.jsxs("span",{"data-loc":"client/src/pages/GamePage.tsx:46",children:[_.jsx(jr,{"data-loc":"client/src/pages/GamePage.tsx:46"}),_.jsx("strong",{"data-loc":"client/src/pages/GamePage.tsx:46",children:"完整案件體驗"}),_.jsx("small",{"data-loc":"client/src/pages/GamePage.tsx:46",children:"六個法律工作決策場景"})]}),_.jsxs("span",{"data-loc":"client/src/pages/GamePage.tsx:47",children:[_.jsx(Pn,{"data-loc":"client/src/pages/GamePage.tsx:47"}),_.jsx("strong",{"data-loc":"client/src/pages/GamePage.tsx:47",children:"排行榜與職涯等級"}),_.jsx("small",{"data-loc":"client/src/pages/GamePage.tsx:47",children:"從研習生走向合夥人"})]}),_.jsxs("span",{"data-loc":"client/src/pages/GamePage.tsx:48",children:[_.jsx(Da,{"data-loc":"client/src/pages/GamePage.tsx:48"}),_.jsx("strong",{"data-loc":"client/src/pages/GamePage.tsx:48",children:"雲端生涯紀錄"}),_.jsx("small",{"data-loc":"client/src/pages/GamePage.tsx:48",children:"結局與稀有成就安全同步"})]})]}),_.jsxs(bd,{"data-loc":"client/src/pages/GamePage.tsx:50",className:"registration-gate__button",onClick:()=>_d(),children:[_.jsx(TC,{"data-loc":"client/src/pages/GamePage.tsx:50"})," 註冊/登入後驗證資格"]}),_.jsx("small",{"data-loc":"client/src/pages/GamePage.tsx:51",children:"使用 Manus 帳號安全登入;本站不會取得你的密碼。"})]}),_.jsxs("aside",{"data-loc":"client/src/pages/GamePage.tsx:53",className:"registration-gate__case",children:[_.jsx("span",{"data-loc":"client/src/pages/GamePage.tsx:54",children:"CASE FILE 24-0917"}),_.jsx("strong",{"data-loc":"client/src/pages/GamePage.tsx:54",children:"實習律師的一天"}),_.jsxs("div",{"data-loc":"client/src/pages/GamePage.tsx:55",children:[_.jsx("b",{"data-loc":"client/src/pages/GamePage.tsx:55",children:"01"})," 接案與訪談"]}),_.jsxs("div",{"data-loc":"client/src/pages/GamePage.tsx:55",children:[_.jsx("b",{"data-loc":"client/src/pages/GamePage.tsx:55",children:"02"})," 卷證與法律策略"]}),_.jsxs("div",{"data-loc":"client/src/pages/GamePage.tsx:55",children:[_.jsx("b",{"data-loc":"client/src/pages/GamePage.tsx:55",children:"03"})," 書狀與最終回報"]}),_.jsx("blockquote",{"data-loc":"client/src/pages/GamePage.tsx:56",children:"「每一個決定,都會進入你的生涯履歷。」"})]})]})}function k4({user:i,onLogout:e}){const[,t]=dd(),s=dt.useUtils(),n=dt.member.dashboard.useQuery(),a=dt.game.settings.useQuery(),l=dt.member.accessStatus.useQuery(),u=dt.game.content.useQuery(void 0,{enabled:l.data?.eligible===!0}),h=new URLSearchParams(window.location.search).get("preview")==="invite",f=dt.game.syncAchievements.useMutation({onSuccess:()=>void s.member.dashboard.invalidate()}),m=dt.member.clearAchievements.useMutation({onSuccess:()=>void s.member.dashboard.invalidate()}),p=dt.game.recordRun.useMutation({onSuccess:()=>{s.member.dashboard.invalidate(),s.member.leaderboard.invalidate(),s.admin.overview.invalidate(),s.admin.runs.invalidate(),s.admin.users.invalidate()}});if(h)return _.jsx(QT,{"data-loc":"client/src/pages/GamePage.tsx:85",userName:i.name,onLogout:e});if(n.isLoading||a.isLoading||l.isLoading||l.data?.eligible&&u.isLoading)return _.jsx(zA,{"data-loc":"client/src/pages/GamePage.tsx:86"});if(n.error||a.error||l.error||l.data?.eligible&&u.error)return _.jsx($T,{"data-loc":"client/src/pages/GamePage.tsx:87",message:"目前無法載入會員資料,請稍後重新整理。"});if(!l.data?.eligible)return _.jsx(QT,{"data-loc":"client/src/pages/GamePage.tsx:88",userName:i.name,onLogout:e});if(a.data&&!a.data.gameEnabled&&i.role!=="admin")return _.jsx($T,{"data-loc":"client/src/pages/GamePage.tsx:89",message:a.data.maintenanceMessage||"遊戲目前維護中,請稍後再試。"});const b=(v,R)=>{v.ending&&p.mutate({endingId:v.ending.id,endingTitle:v.ending.title,grade:v.ending.grade,metrics:v.metrics,tags:v.tags,durationSeconds:R})};return _.jsxs(_.Fragment,{children:[_.jsx(F4,{"data-loc":"client/src/pages/GamePage.tsx:105",stages:u.data?.stages,initialAchievementIds:n.data?.achievements??[],achievementStorageKey:`resolve-by-law-achievements:${i.id}
474`,onAchievementsChange:v=>f.mutate({achievementIds:v}),onAchievementsClear:()=>m.mutate(),onRunCompleted:b},`content-${u.data?.revision??0}`),_.jsxs("nav",{"data-loc":"client/src/pages/GamePage.tsx:114",className:"member-dock","aria-label":"會員功能",children:[_.jsxs("button",{"data-loc":"client/src/pages/GamePage.tsx:115",onClick:()=>t("/member"),children:[_.jsx(TC,{"data-loc":"client/src/pages/GamePage.tsx:115"}),_.jsx("span",{"data-loc":"client/src/pages/GamePage.tsx:115",children:i.name||"會員中心"})]}),_.jsxs("button",{"data-loc":"client/src/pages/GamePage.tsx:116",onClick:()=>t("/leaderboard"),children:[_.jsx(Pn,{"data-loc":"client/src/pages/GamePage.tsx:116"}),_.jsx("span",{"data-loc":"client/src/pages/GamePage.tsx:116",children:"排行榜"})]}),i.role==="admin"&&_.jsxs("button",{"data-loc":"client/src/pages/GamePage.tsx:117",onClick:()=>t("/admin"),children:[_.jsx(hL,{"data-loc":"client/src/pages/GamePage.tsx:117"}),_.jsx("span",{"data-loc":"client/src/pages/GamePage.tsx:117",children:"管理後台"})]}),_.jsx("button",{"data-loc":"client/src/pages/GamePage.tsx:118",onClick:()=>void e(),"aria-label":"登出",children:_.jsx(Lm,{"data-loc":"client/src/pages/GamePage.tsx:118"})})]}),a.data?.memberAnnouncement&&_.jsx("div",{"data-loc":"client/src/pages/GamePage.tsx:120",className:"member-announcement",children:a.data.memberAnnouncement})]})}function QT({userName:i,onLogout:e}){const[t,s]=C.useState(""),n=dt.useUtils(),a=dt.member.redeemInvitation.useMutation({onSuccess:async()=>{await n.member.accessStatus.invalidate(),await n.game.content.invalidate()}});return _.jsxs("main",{"data-loc":"client/src/pages/GamePage.tsx:136",className:"invitation-gate",children:[_.jsxs("section",{"data-loc":"client/src/pages/GamePage.tsx:137",children:[_.jsx("div",{"data-loc":"client/src/pages/GamePage.tsx:138",className:"invitation-gate__icon",children:_.jsx(yC,{"data-loc":"client/src/pages/GamePage.tsx:138"})}),_.jsx("p",{"data-loc":"client/src/pages/GamePage.tsx:139",children:"CLOSED BETA · ACCESS REVIEW"}),_.jsx("h1",{"data-loc":"client/src/pages/GamePage.tsx:140",children:"輸入封閉測試邀請碼"}),_.jsxs("span",{"data-loc":"client/src/pages/GamePage.tsx:141",children:[i||"會員",",你的帳號已註冊完成;取得邀請資格後即可進入「實習律師的一天」。"]}),_.jsxs("form",{"data-loc":"client/src/pages/GamePage.tsx:142",onSubmit:l=>{l.preventDefault(),a.mutate({code:t})},children:[_.jsx("label",{"data-loc":"client/src/pages/GamePage.tsx:143",htmlFor:"invitation-code",children:"邀請碼"}),_.jsxs("div",{"data-loc":"client/src/pages/GamePage.tsx:144",children:[_.jsx(nc,{"data-loc":"client/src/pages/GamePage.tsx:144"}),_.jsx("input",{"data-loc":"client/src/pages/GamePage.tsx:144",id:"invitation-code",value:t,onChange:l=>s(l.target.value.toUpperCase()),placeholder:"LAW-XXXXXXXXXX",maxLength:32,autoComplete:"one-time-code"})]}),a.error&&_.jsx("strong",{"data-loc":"client/src/pages/GamePage.tsx:145",role:"alert",children:a.error.message}),_.jsxs("button",{"data-loc":"client/src/pages/GamePage.tsx:146",className:"portal-primary",disabled:t.trim().length<6||a.isPending,children:[a.isPending?_.jsx(Yo,{"data-loc":"client/src/pages/GamePage.tsx:146"}):_.jsx(Da,{"data-loc":"client/src/pages/GamePage.tsx:146"}),a.isPending?"驗證中":"兌換測試資格"]})]}),_.jsx("small",{"data-loc":"client/src/pages/GamePage.tsx:148",children:"邀請碼可能有使用次數與有效期限,請向測試管理員索取。"}),_.jsxs("button",{"data-loc":"client/src/pages/GamePage.tsx:149",className:"invitation-gate__logout",onClick:()=>void e(),children:[_.jsx(Lm,{"data-loc":"client/src/pages/GamePage.tsx:149"})," 登出並更換帳號"]})]}),_.jsxs("aside",{"data-loc":"client/src/pages/GamePage.tsx:151",children:[_.jsx(xi,{"data-loc":"client/src/pages/GamePage.tsx:151"}),_.jsx("strong",{"data-loc":"client/src/pages/GamePage.tsx:151",children:"封閉測試規則"}),_.jsxs("ol",{"data-loc":"client/src/pages/GamePage.tsx:151",children:[_.jsx("li",{"data-loc":"client/src/pages/GamePage.tsx:151",children:"每組邀請碼依管理員設定限次使用。"}),_.jsx("li",{"data-loc":"client/src/pages/GamePage.tsx:151",children:"資格綁定會員帳號,不需每次輸入。"}),_.jsx("li",{"data-loc":"client/src/pages/GamePage.tsx:151",children:"管理員可暫停測試或撤銷個別資格。"})]})]})]})}function $T({message:i}){return _.jsxs("main",{"data-loc":"client/src/pages/GamePage.tsx:157",className:"portal-error",children:[_.jsx(xi,{"data-loc":"client/src/pages/GamePage.tsx:157"}),_.jsx("h1",{"data-loc":"client/src/pages/GamePage.tsx:157",children:"依法解決"}),_.jsx("p",{"data-loc":"client/src/pages/GamePage.tsx:157",children:i}),_.jsx(bd,{"data-loc":"client/src/pages/GamePage.tsx:157",onClick:()=>window.location.reload(),children:"重新整理"})]})}
474const JT=[{id:"all",label:"總榜",detail:"全期間職涯 XP"},{id:"week",label:"週榜",detail:"本週一至現在"},{id:"month",label:"月榜",detail:"本月一日至現在"},{id:"season",label:"賽季",detail:"目前賽季積分"}];function L4(){const[,i]=dd(),[e,t]=C.useState("all"),s=dt.member.leaderboard.useQuery({period:e}),n=JT.find(a=>a.id===e);return _.jsx(eg,{"data-loc":"client/src/pages/LeaderboardPage.tsx:23",children:_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:24",className:"portal-page",children:[_.jsxs("header",{"data-loc":"client/src/pages/LeaderboardPage.tsx:25",className:"portal-page__header",children:[_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:26",children:[_.jsx("p",{"data-loc":"client/src/pages/LeaderboardPage.tsx:26",children:"CAREER LEADERBOARD"}),_.jsx("h1",{"data-loc":"client/src/pages/LeaderboardPage.tsx:26",children:"律師職涯排行榜"}),_.jsx("span",{"data-loc":"client/src/pages/LeaderboardPage.tsx:26",children:"切換總榜、週榜、月榜與賽季榜;職涯等級仍以永久 XP 計算。"})]}),_.jsxs("button",{"data-loc":"client/src/pages/LeaderboardPage.tsx:27",className:"portal-primary",onClick:()=>i("/"),children:[_.jsx(jr,{"data-loc":"client/src/pages/LeaderboardPage.tsx:27"})," 返回遊戲"]})]}),_.jsx("nav",{"data-loc":"client/src/pages/LeaderboardPage.tsx:29",className:"leaderboard-periods","aria-label":"排行榜期間",children:JT.map(a=>_.jsxs("button",{"data-loc":"client/src/pages/LeaderboardPage.tsx:29",className:e===a.id?"is-active":"",onClick:()=>t(a.id),children:[_.jsx("strong",{"data-loc":"client/src/pages/LeaderboardPage.tsx:29",children:a.label}),_.jsx("small",{"data-loc":"client/src/pages/LeaderboardPage.tsx:29",children:a.detail})]},a.id))}),s.isLoading?_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:31",className:"portal-loading",children:[_.jsx(Yo,{"data-loc":"client/src/pages/LeaderboardPage.tsx:31"})," 計算",n.label,"排名"]}):s.error||!s.data?_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:32",className:"portal-empty",children:[_.jsx(xi,{"data-loc":"client/src/pages/LeaderboardPage.tsx:32"}),_.jsx("strong",{"data-loc":"client/src/pages/LeaderboardPage.tsx:32",children:"無法取得排行榜"})]}):_.jsxs(_.Fragment,{children:[s.data.season&&_.jsxs("section",{"data-loc":"client/src/pages/LeaderboardPage.tsx:35",className:"season-banner",children:[_.jsx(fC,{"data-loc":"client/src/pages/LeaderboardPage.tsx:35"}),_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:35",children:[_.jsx("small",{"data-loc":"client/src/pages/LeaderboardPage.tsx:35",children:"ACTIVE SEASON"}),_.jsx("strong",{"data-loc":"client/src/pages/LeaderboardPage.tsx:35",children:s.data.season.name}),_.jsxs("span",{"data-loc":"client/src/pages/LeaderboardPage.tsx:35",children:[new Date(s.data.season.startsAt).toLocaleDateString("zh-TW")," — ",new Date(s.data.season.endsAt).toLocaleDateString("zh-TW")]})]}),_.jsx("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:35",className:"season-reward-list",children:s.data.season.rewards.map((a,l)=>_.jsxs("span",{"data-loc":"client/src/pages/LeaderboardPage.tsx:35",children:["第 ",a.fromRank,a.toRank!==a.fromRank?`–${a.toRank}`:""," 名 · ",a.title," · +",a.xpBonus," XP"]},l))})]}),s.data.current&&_.jsxs("section",{"data-loc":"client/src/pages/LeaderboardPage.tsx:36",className:"career-current-rank",children:[_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:37",children:[_.jsx(Hp,{"data-loc":"client/src/pages/LeaderboardPage.tsx:37"}),_.jsxs("span",{"data-loc":"client/src/pages/LeaderboardPage.tsx:37",children:[_.jsxs("small",{"data-loc":"client/src/pages/LeaderboardPage.tsx:37",children:["YOUR ",n.label.toUpperCase()," RANK"]}),_.jsxs("strong",{"data-loc":"client/src/pages/LeaderboardPage.tsx:37",children:["第 ",s.data.current.rank," 名"]})]})]}),_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:38",children:[_.jsx("span",{"data-loc":"client/src/pages/LeaderboardPage.tsx:38",children:"職涯等級"}),_.jsxs("strong",{"data-loc":"client/src/pages/LeaderboardPage.tsx:38",children:["Lv.",s.data.current.career.level," · ",s.data.current.career.title]})]}),_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:39",children:[_.jsxs("span",{"data-loc":"client/src/pages/LeaderboardPage.tsx:39",children:[n.label,"積分"]}),_.jsxs("strong",{"data-loc":"client/src/pages/LeaderboardPage.tsx:39",children:[s.data.current.rankXp," XP"]})]})]}),_.jsxs("section",{"data-loc":"client/src/pages/LeaderboardPage.tsx:41",className:"portal-panel leaderboard-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:42",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:42",children:[_.jsxs("p",{"data-loc":"client/src/pages/LeaderboardPage.tsx:42",children:["TOP 50 · ",n.detail]}),_.jsxs("h2",{"data-loc":"client/src/pages/LeaderboardPage.tsx:42",children:[n.label,"排名"]})]}),_.jsx(Pn,{"data-loc":"client/src/pages/LeaderboardPage.tsx:42"})]}),_.jsx("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",className:"portal-table-wrap",children:_.jsxs("table",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",className:"portal-table leaderboard-table",children:[_.jsx("thead",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:_.jsxs("tr",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:[_.jsx("th",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:"名次"}),_.jsx("th",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:"會員"}),_.jsx("th",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:"職涯等級"}),_.jsxs("th",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:[n.label,"積分"]}),_.jsx("th",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:"完成局數"}),_.jsx("th",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:"最佳分數"}),_.jsx("th",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:"成就"})]})}),_.jsx("tbody",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",children:s.data.entries.map(a=>_.jsxs("tr",{"data-loc":"client/src/pages/LeaderboardPage.tsx:43",className:a.userId===s.data.current?.userId?"is-current":"",children:[_.jsx("td",{"data-loc":"client/src/pages/LeaderboardPage.tsx:44",children:_.jsx("span",{"data-loc":"client/src/pages/LeaderboardPage.tsx:44",className:`rank-mark rank-mark--${a.rank}`,children:a.rank<=3?a.rank===1?_.jsx(Hp,{"data-loc":"client/src/pages/LeaderboardPage.tsx:44"}):_.jsx(Bm,{"data-loc":"client/src/pages/LeaderboardPage.tsx:44"}):a.rank})}),_.jsxs("td",{"data-loc":"client/src/pages/LeaderboardPage.tsx:45",children:[_.jsx("strong",{"data-loc":"client/src/pages/LeaderboardPage.tsx:45",children:a.name}),a.userId===s.data.current?.userId&&_.jsx("small",{"data-loc":"client/src/pages/LeaderboardPage.tsx:45",children:"YOU"})]}),_.jsxs("td",{"data-loc":"client/src/pages/LeaderboardPage.tsx:46",children:[_.jsxs("b",{"data-loc":"client/src/pages/LeaderboardPage.tsx:46",children:["Lv.",a.career.level]}),_.jsx("small",{"data-loc":"client/src/pages/LeaderboardPage.tsx:46",children:a.career.title})]}),_.jsxs("td",{"data-loc":"client/src/pages/LeaderboardPage.tsx:47",children:[a.rankXp.toLocaleStr
474ing()," XP"]}),_.jsx("td",{"data-loc":"client/src/pages/LeaderboardPage.tsx:47",children:a.totalRuns}),_.jsx("td",{"data-loc":"client/src/pages/LeaderboardPage.tsx:47",children:a.bestScore}),_.jsxs("td",{"data-loc":"client/src/pages/LeaderboardPage.tsx:47",children:[_.jsx(hC,{"data-loc":"client/src/pages/LeaderboardPage.tsx:47"})," ",a.achievementCount]})]},a.userId))})]})}),!s.data.entries.length&&_.jsxs("div",{"data-loc":"client/src/pages/LeaderboardPage.tsx:49",className:"portal-empty portal-empty--compact",children:[_.jsx(Um,{"data-loc":"client/src/pages/LeaderboardPage.tsx:49"}),_.jsx("strong",{"data-loc":"client/src/pages/LeaderboardPage.tsx:49",children:e==="season"&&!s.data.season?"目前沒有進行中的賽季":"本期間等待第一位挑戰者"})]})]})]})]})})}function B4(){const{user:i}=Zi(),[,e]=dd(),t=dt.member.dashboard.useQuery();return _.jsx(eg,{"data-loc":"client/src/pages/MemberPage.tsx:14",children:_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:15",className:"portal-page",children:[_.jsxs("header",{"data-loc":"client/src/pages/MemberPage.tsx:16",className:"portal-page__header",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:17",children:[_.jsx("p",{"data-loc":"client/src/pages/MemberPage.tsx:17",children:"MEMBER CAREER RECORD"}),_.jsxs("h1",{"data-loc":"client/src/pages/MemberPage.tsx:17",children:[i?.name||"會員","的律師生涯紀錄"]}),_.jsx("span",{"data-loc":"client/src/pages/MemberPage.tsx:17",children:"每一次判斷,都會成為下一次更成熟的專業選擇。"})]}),_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:18",className:"portal-header-actions",children:[_.jsxs("button",{"data-loc":"client/src/pages/MemberPage.tsx:18",className:"portal-secondary",onClick:()=>e("/leaderboard"),children:[_.jsx(Pn,{"data-loc":"client/src/pages/MemberPage.tsx:18"})," 查看排行榜"]}),_.jsxs("button",{"data-loc":"client/src/pages/MemberPage.tsx:18",className:"portal-primary",onClick:()=>e("/"),children:[_.jsx(jr,{"data-loc":"client/src/pages/MemberPage.tsx:18"})," 繼續遊戲"]})]})]}),t.isLoading?_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:22",className:"portal-loading",children:[_.jsx(Yo,{"data-loc":"client/src/pages/MemberPage.tsx:22"})," 載入個人紀錄"]}):t.error||!t.data?_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:24",className:"portal-empty",children:[_.jsx(xi,{"data-loc":"client/src/pages/MemberPage.tsx:24"}),_.jsx("strong",{"data-loc":"client/src/pages/MemberPage.tsx:24",children:"無法取得會員紀錄"}),_.jsx("span",{"data-loc":"client/src/pages/MemberPage.tsx:24",children:"請稍後重新整理頁面。"})]}):_.jsxs(_.Fragment,{children:[_.jsxs("section",{"data-loc":"client/src/pages/MemberPage.tsx:27",className:"career-level-card",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:28",className:"career-level-card__seal",children:[_.jsx(Bm,{"data-loc":"client/src/pages/MemberPage.tsx:28"}),_.jsxs("span",{"data-loc":"client/src/pages/MemberPage.tsx:28",children:["LV.",t.data.career.level]})]}),_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:29",className:"career-level-card__copy",children:[_.jsx("small",{"data-loc":"client/src/pages/MemberPage.tsx:29",children:"CAREER LEVEL"}),_.jsx("h2",{"data-loc":"client/src/pages/MemberPage.tsx:29",children:t.data.career.title}),_.jsx("p",{"data-loc":"client/src/pages/MemberPage.tsx:29",children:t.data.career.nextLevel?`距離「${t.data.career.nextLevel.title}」尚需 ${t.data.career.xpToNext} XP`:"已抵達目前最高職涯等級"})]}),_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:30",className:"career-level-card__progress",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:30",children:[_.jsx("span",{"data-loc":"client/src/pages/MemberPage.tsx:30",children:"累積經驗"}),_.jsxs("strong",{"data-loc":"client/src/pages/MemberPage.tsx:30",children:[t.data.career.xp.toLocaleString()," XP"]})]}),_.jsx("i",{"data-loc":"client/src/pages/MemberPage.tsx:30",children:_.jsx("b",{"data-loc":"client/src/pages/MemberPage.tsx:30",style:{transform:`scaleX(${t.data.career.progress/100})`}})}),t.data.bonusXp>0&&_.jsxs("small",{"data-loc":"client/src/pages/MemberPage.tsx:30",children:["含賽季獎勵 +",t.data.bonusXp," XP"]})]})]}),_.jsxs("section",{"data-loc":"client/src/pages/MemberPage.tsx:32",className:"portal-stat-grid",children:[_.jsx(hh,{"data-loc":"client/src/pages/MemberPage.tsx:33",icon:jr,label:"完成挑戰",value:t.data.stats.totalRuns,unit:"次"}),_.jsx(hh,{"data-loc":"client/src/pages/MemberPage.tsx:34",icon:Fm,label:"最佳狀態",value:t.data.stats.bestScore,unit:"分"}),_.jsx(hh,{"data-loc":"client/src/pages/MemberPage.tsx:35",icon:Pn,label:"已解鎖成就",value:t.data.stats.achievementCount,unit:`/ ${An.length}`}),_.jsx(hh,{"data-loc":"client/src/pages/MemberPage.tsx:36",icon:fC,label:"最近遊玩",value:t.data.stats.lastPlayedAt?new Date(t.data.stats.lastPlayedAt).toLocaleDateString("zh-TW"):"尚未"})]}
474),t.data.seasonRewards.length>0&&_.jsxs("section",{"data-loc":"client/src/pages/MemberPage.tsx:39",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:40",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:40",children:[_.jsx("p",{"data-loc":"client/src/pages/MemberPage.tsx:40",children:"SEASON REWARDS"}),_.jsx("h2",{"data-loc":"client/src/pages/MemberPage.tsx:40",children:"賽季獎勵"})]}),_.jsx(Ah,{"data-loc":"client/src/pages/MemberPage.tsx:40"})]}),_.jsx("div",{"data-loc":"client/src/pages/MemberPage.tsx:41",className:"member-season-rewards",children:t.data.seasonRewards.map(s=>_.jsxs("article",{"data-loc":"client/src/pages/MemberPage.tsx:41",children:[_.jsx(Ah,{"data-loc":"client/src/pages/MemberPage.tsx:41"}),_.jsxs("span",{"data-loc":"client/src/pages/MemberPage.tsx:41",children:[_.jsxs("small",{"data-loc":"client/src/pages/MemberPage.tsx:41",children:["第 ",s.rank," 名 · ",new Date(s.grantedAt).toLocaleDateString("zh-TW")]}),_.jsx("strong",{"data-loc":"client/src/pages/MemberPage.tsx:41",children:s.rewardTitle})]}),_.jsxs("b",{"data-loc":"client/src/pages/MemberPage.tsx:41",children:["+",s.xpBonus," XP"]})]},s.id))})]}),_.jsxs("section",{"data-loc":"client/src/pages/MemberPage.tsx:44",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:45",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:45",children:[_.jsx("p",{"data-loc":"client/src/pages/MemberPage.tsx:45",children:"ACHIEVEMENTS"}),_.jsx("h2",{"data-loc":"client/src/pages/MemberPage.tsx:45",children:"成就徽章"})]}),_.jsxs("span",{"data-loc":"client/src/pages/MemberPage.tsx:45",children:[t.data.stats.achievementCount," / ",An.length]})]}),_.jsx("div",{"data-loc":"client/src/pages/MemberPage.tsx:46",className:"member-achievement-grid",children:An.map(s=>{const n=t.data.achievements.includes(s.id);return _.jsxs("article",{"data-loc":"client/src/pages/MemberPage.tsx:50",className:n?"is-unlocked":"is-locked",children:[_.jsx(hC,{"data-loc":"client/src/pages/MemberPage.tsx:51"}),_.jsxs("span",{"data-loc":"client/src/pages/MemberPage.tsx:52",children:[_.jsx("small",{"data-loc":"client/src/pages/MemberPage.tsx:52",children:n?s.rarity.toUpperCase():s.hidden?"HIDDEN":"LOCKED"}),_.jsx("strong",{"data-loc":"client/src/pages/MemberPage.tsx:52",children:n||!s.hidden?s.title:"???"})]})]},s.id)})})]}),_.jsxs("section",{"data-loc":"client/src/pages/MemberPage.tsx:59",className:"portal-panel",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:60",className:"portal-panel__heading",children:[_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:60",children:[_.jsx("p",{"data-loc":"client/src/pages/MemberPage.tsx:60",children:"RECENT RUNS"}),_.jsx("h2",{"data-loc":"client/src/pages/MemberPage.tsx:60",children:"最近遊玩紀錄"})]}),_.jsx(Um,{"data-loc":"client/src/pages/MemberPage.tsx:60"})]}),t.data.recentRuns.length===0?_.jsxs("div",{"data-loc":"client/src/pages/MemberPage.tsx:62",className:"portal-empty portal-empty--compact",children:[_.jsx(jr,{"data-loc":"client/src/pages/MemberPage.tsx:62"}),_.jsx("strong",{"data-loc":"client/src/pages/MemberPage.tsx:62",children:"尚無結局紀錄"}),_.jsx("span",{"data-loc":"client/src/pages/MemberPage.tsx:62",children:"完成第一次挑戰後,評等會出現在這裡。"})]}):_.jsx("div",{"data-loc":"client/src/pages/MemberPage.tsx:64",className:"portal-table-wrap",children:_.jsxs("table",{"data-loc":"client/src/pages/MemberPage.tsx:64",className:"portal-table",children:[_.jsx("thead",{"data-loc":"client/src/pages/MemberPage.tsx:64",children:_.jsxs("tr",{"data-loc":"client/src/pages/MemberPage.tsx:64",children:[_.jsx("th",{"data-loc":"client/src/pages/MemberPage.tsx:64",children:"完成時間"}),_.jsx("th",{"data-loc":"client/src/pages/MemberPage.tsx:64",children:"結局"}),_.jsx("th",{"data-loc":"client/src/pages/MemberPage.tsx:64",children:"評等"}),_.jsx("th",{"data-loc":"client/src/pages/MemberPage.tsx:64",children:"狀態分數"}),_.jsx("th",{"data-loc":"client/src/pages/MemberPage.tsx:64",children:"遊玩時間"})]})}),_.jsx("tbody",{"data-loc":"client/src/pages/MemberPage.tsx:64",children:t.data.recentRuns.map(s=>_.jsxs("tr",{"data-loc":"client/src/pages/MemberPage.tsx:65",children:[_.jsx("td",{"data-loc":"client/src/pages/MemberPage.tsx:65",children:new Date(s.completedAt).toLocaleStr
474ing("zh-TW")}),_.jsx("td",{"data-loc":"client/src/pages/MemberPage.tsx:65",children:s.endingTitle}),_.jsx("td",{"data-loc":"client/src/pages/MemberPage.tsx:65",children:_.jsx("b",{"data-loc":"client/src/pages/MemberPage.tsx:65",children:s.grade})}),_.jsx("td",{"data-loc":"client/src/pages/MemberPage.tsx:65",children:s.score}),_.jsxs("td",{"data-loc":"client/src/pages/MemberPage.tsx:65",children:[Math.max(1,Math.round(s.durationSeconds/60))," 分鐘"]})]},s.id))})]})})]})]})]})})}function hh({icon:i,label:e,value:t,unit:s}){return _.jsxs("article",{"data-loc":"client/src/pages/MemberPage.tsx:77",className:"portal-stat-card",children:[_.jsx(i,{"data-loc":"client/src/pages/MemberPage.tsx:77"}),_.jsx("span",{"data-loc":"client/src/pages/MemberPage.tsx:77",children:e}),_.jsxs("strong",{"data-loc":"client/src/pages/MemberPage.tsx:77",children:[t,_.jsx("small",{"data-loc":"client/src/pages/MemberPage.tsx:77",children:s})]})]})}function N4(){return _.jsx(CL,{"data-loc":"client/src/App.tsx:20",children:_.jsxs(wm,{"data-loc":"client/src/App.tsx:21",children:[_.jsxs(Qk,{"data-loc":"client/src/App.tsx:22",children:[_.jsx(en,{"data-loc":"client/src/App.tsx:23",path:"/",component:KT}),_.jsx(en,{"data-loc":"client/src/App.tsx:24",path:"/member",component:B4}),_.jsx(en,{"data-loc":"client/src/App.tsx:25",path:"/leaderboard",component:L4}),_.jsx(en,{"data-loc":"client/src/App.tsx:26",path:"/admin/invitations",component:l3}),_.jsx(en,{"data-loc":"client/src/App.tsx:27",path:"/admin/seasons",component:c3}),_.jsx(en,{"data-loc":"client/src/App.tsx:28",path:"/admin/content",component:a3}),_.jsx(en,{"data-loc":"client/src/App.tsx:29",path:"/admin/users",component:s3}),_.jsx(en,{"data-loc":"client/src/App.tsx:30",path:"/admin/runs",component:i3}),_.jsx(en,{"data-loc":"client/src/App.tsx:31",path:"/admin/settings",component:n3}),_.jsx(en,{"data-loc":"client/src/App.tsx:32",path:"/admin",component:t3}),_.jsx(en,{"data-loc":"client/src/App.tsx:33",children:_.jsx(KT,{"data-loc":"client/src/App.tsx:33"})})]}),_.jsx(D2,{"data-loc":"client/src/App.tsx:35"})]})})}const Xh=new DP,HA=i=>{!(i instanceof Bo)||typeof window>"u"||!(i.message===fD)||_d()};Xh.getQueryCache().subscribe(i=>{if(i.type==="updated"&&i.action.type==="error"){const e=i.query.state.error;HA(e),console.error("[API Query Error]",e)}});Xh.getMutationCache().subscribe(i=>{if(i.type==="updated"&&i.action.type==="error"){const e=i.mutation.state.error;HA(e),console.error("[API Mutation Error]",e)}});const U4=dt.createClient({links:[UO({url:"/api/trpc",transformer:hr,headers(){try{const i=sessionStorage.getItem("manus-cookie");if(i){const e=`${dD}=`,s=i.split(";").find(n=>n.trim().startsWith(e))?.trim().slice(e.length);if(s)return{Authorization:`Bearer ${s}`}}}catch{}return{}},fetch(i,e){return globalThis.fetch(i,{...e??{},credentials:"include"})}})]});vD.createRoot(document.getElementById("root")).render(_.jsx(dt.Provider,{"data-loc":"client/src/main.tsx:76",client:U4,queryClient:Xh,children:_.jsx(rP,{"data-loc":"client/src/main.tsx:77",client:Xh,children:_.jsx(N4,{"data-loc":"client/src/main.tsx:78"})})}));export{Be as A,dc as B,$t as C,dg as D,fs as E,sG as F,Qp as G,ai as I,Dj as L,q4 as M,xe as O,ar as R,_s as S,tG as T,Xe as V,gi as _,kh as a,Re as b,ft as c,gc as d,j as e,bi as f,It as g,hA as h,te as i,Hj as j,I as k,lh as l,V4 as m,aG as n,Fh as o,_t as p,Mj as q,ne as s};

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.