PageSourceSearch

https://duicheckpoint.manus.space/assets/index-nSxm2Zdt.js

js duicheckpoint.manus.space collected 2026-10-03 05:01:17 UTC 1,509,385 bytes, 311 lines download raw bytes

vendor: 6,536 bytes, lines 1-18
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dds.pure-CymLrjyl.js","assets/cubemapToSphericalPolynomial-CTcxgOfC.js","assets/ddsTextureLoader-DZF5A1nj.js","assets/envTextureLoader-mqxnLBeS.js","assets/color.vertex-DjkdNiry.js","assets/vertexColorMixing-DWusTyVw.js","assets/color.fragment-DdTeKgrn.js","assets/fogFragment-KT_muY2n.js","assets/color.vertex-BAaFmXnU.js","assets/vertexColorMixing-BU3W2AqR.js","assets/color.fragment-Oy0DhIu7.js","assets/fogFragment-BowY-5PP.js","assets/default.vertex--TKYAiUr.js","assets/logDepthDeclaration-BcIVCoE3.js","assets/helperFunctions-BA65VbGR.js","assets/default.fragment-C17VHVrm.js","assets/default.vertex-B-zwfN08.js","assets/logDepthDeclaration-DpIdFtCx.js","assets/helperFunctions-BOQMrb0b.js","assets/default.fragment-CYqHXNTR.js"])))=>i.map(i=>d[i]);
2function bA(a,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in a)){const n=Object.getOwnPropertyDescriptor(i,s);n&&Object.defineProperty(a,s,n.get?n:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const n of s)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const n={};return s.integrity&&(n.integrity=s.integrity),s.referrerPolicy&&(n.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?n.credentials="include":s.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(s){if(s.ep)return;s.ep=!0;const n=t(s);fetch(s.href,n)}})();function yA(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var x_={exports:{}},Sc={};/**
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 Nx;function TA(){if(Nx)return Sc;Nx=1;var a=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,s,n){var o=null;if(n!==void 0&&(o=""+n),s.key!==void 0&&(o=""+s.key),"key"in s){n={};for(var c in s)c!=="key"&&(n[c]=s[c])}else n=s;return s=n.ref,{$$typeof:a,type:i,key:o,ref:s!==void 0?s:null,props:n}}return Sc.Fragment=e,Sc.jsx=t,Sc.jsxs=t,Sc}var Ux;function vA(){return Ux||(Ux=1,x_.exports=TA()),x_.exports}var A=vA(),b_={exports:{}},Mc={},y_={exports:{}},T_={};/**
11 * @license React
12 * scheduler.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 zx;function EA(){return zx||(zx=1,(function(a){function e(Y,Z){var q=Y.length;Y.push(Z);e:for(;0<q;){var j=q-1>>>1,Q=Y[j];if(0<s(Q,Z))Y[j]=Z,Y[q]=Q,q=j;else break e}}function t(Y){return Y.length===0?null:Y[0]}function i(Y){if(Y.length===0)return null;var Z=Y[0],q=Y.pop();if(q!==Z){Y[0]=q;e:for(var j=0,Q=Y.length,w=Q>>>1;j<w;){var B=2*(j+1)-1,z=Y[B],K=B+1,ue=Y[K];if(0>s(z,q))K<Q&&0>s(ue,z)?(Y[j]=ue,Y[K]=q,j=K):(Y[j]=z,Y[B]=q,j=B);else if(K<Q&&0>s(ue,q))Y[j]=ue,Y[K]=q,j=K;else break e}}return Z}function s(Y,Z){var q=Y.sortIndex-Z.sortIndex;return q!==0?q:Y.id-Z.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;a.unstable_now=function(){return n.now()}}else{var o=Date,c=o.now();a.unstable_now=function(){return o.now()-c}}var h=[],f=[],_=1,m=null,g=3,x=!1,y=!1,b=!1,v=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function O(Y){for(var Z=t(f);Z!==null;){if(Z.callback===null)i(f);else if(Z.startTime<=Y)i(f),Z.sortIndex=Z.expirationTime,e(h,Z);else break;Z=t(f)}}function M(Y){if(b=!1,O(Y),!y)if(t(h)!==null)y=!0,I||(I=!0,ae());else{var Z=t(f);Z!==null&&te(M,Z.startTime-Y)}}var I=!1,P=-1,L=5,V=-1;function X(){return v?!0:!(a.unstable_now()-V<L)}function re(){if(v=!1,I){var Y=a.unstable_now();V=Y;var Z=!0;try{e:{y=!1,b&&(b=!1,R(P),P=-1),x=!0;var q=g;try{t:{for(O(Y),m=t(h);m!==null&&!(m.expirationTime>Y&&X());){var j=m.callback;if(typeof j=="function"){m.callback=null,g=m.priorityLevel;var Q=j(m.expirationTime<=Y);if(Y=a.unstable_now(),typeof Q=="function"){m.callback=Q,O(Y),Z=!0;break t}m===t(h)&&i(h),O(Y)}else i(h);m=t(h)}if(m!==null)Z=!0;else{var w=t(f);w!==null&&te(M,w.startTime-Y),Z=!1}}break e}finally{m=null,g=q,x=!1}Z=void 0}}finally{Z?ae():I=!1}}}var ae;if(typeof C=="function")ae=function(){C(re)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,U=de.port2;de.port1.onmessage=re,ae=function(){U.postMessage(null)}}else ae=function(){E(re,0)};function te(Y,Z){P=E(function(){Y(a.unstable_now())},Z)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(Y){Y.callback=null},a.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<Y?Math.floor(1e3/Y):5},a.unstable_getCurrentPriorityLevel=function(){return g},a.unstable_next=function(Y){switch(g){case 1:case 2:case 3:var Z=3;break;default:Z=g}var q=g;g=Z;try{return Y()}finally{g=q}},a.unstable_requestPaint=function(){v=!0},a.unstable_runWithPriority=function(Y,Z){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var q=g;g=Y;try{return Z()}finally{g=q}},a.unstable_scheduleCallback=function(Y,Z,q){var j=a.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?j+q:j):q=j,Y){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=q+Q,Y={id:_++,callback:Z,priorityLevel:Y,startTime:q,expirationTime:Q,sortIndex:-1},q>j?(Y.sortIndex=q,e(f,Y),t(h)===null&&Y===t(f)&&(b?(R(P),P=-1):b=!0,te(M,q-j))):(Y.sortIndex=Q,e(h,Y),y||x||(y=!0,I||(I=!0,ae()))),Y},a.unstable_shouldYield=X,a.unstable_wrapCallback=function(Y){var Z=g;return function(){var q=g;g=Z;try{return Y.apply(this,arguments)}finally{g=q}}}})(T_)),T_}var Gx;
vendor: 17,120 bytes, lines 18-44
18function AA(){return Gx||(Gx=1,y_.exports=EA()),y_.exports}var v_={exports:{}},yt={};/**
19 * @license React
20 * react.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 Vx;function RA(){if(Vx)return yt;Vx=1;var a=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),n=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function x(w){return w===null||typeof w!="object"?null:(w=g&&w[g]||w["@@iterator"],typeof w=="function"?w:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,v={};function E(w,B,z){this.props=w,this.context=B,this.refs=v,this.updater=z||y}E.prototype.isReactComponent={},E.prototype.setState=function(w,B){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,B,"setState")},E.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function R(){}R.prototype=E.prototype;function C(w,B,z){this.props=w,this.context=B,this.refs=v,this.updater=z||y}var O=C.prototype=new R;O.constructor=C,b(O,E.prototype),O.isPureReactComponent=!0;var M=Array.isArray;function I(){}var P={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function V(w,B,z){var K=z.ref;return{$$typeof:a,type:w,key:B,ref:K!==void 0?K:null,props:z}}function X(w,B){return V(w.type,B,w.props)}function re(w){return typeof w=="object"&&w!==null&&w.$$typeof===a}function ae(w){var B={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(z){return B[z]})}var de=/\/+/g;function U(w,B){return typeof w=="object"&&w!==null&&w.key!=null?ae(""+w.key):B.toString(36)}function te(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(I,I):(w.status="pending",w.then(function(B){w.status==="pending"&&(w.status="fulfilled",w.value=B)},function(B){w.status==="pending"&&(w.status="rejected",w.reason=B)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function Y(w,B,z,K,ue){var he=typeof w;(he==="undefined"||he==="boolean")&&(w=null);var ve=!1;if(w===null)ve=!0;else switch(he){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(w.$$typeof){case a:case e:ve=!0;break;case _:return ve=w._init,Y(ve(w._payload),B,z,K,ue)}}if(ve)return ue=ue(w),ve=K===""?"."+U(w,0):K,M(ue)?(z="",ve!=null&&(z=ve.replace(de,"$&/")+"/"),Y(ue,B,z,"",function(J){return J})):ue!=null&&(re(ue)&&(ue=X(ue,z+(ue.key==null||w&&w.key===ue.key?"":(""+ue.key).replace(de,"$&/")+"/")+ve)),B.push(ue)),1;ve=0;var Le=K===""?".":K+":";if(M(w))for(var ke=0;ke<w.length;ke++)K=w[ke],he=Le+U(K,ke),ve+=Y(K,B,z,he,ue);else if(ke=x(w),typeof ke=="function")for(w=ke.call(w),ke=0;!(K=w.next()).done;)K=K.value,he=Le+U(K,ke++),ve+=Y(K,B,z,he,ue);else if(he==="object"){if(typeof w.then=="function")return Y(te(w),B,z,K,ue);throw B=String(w),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ve}function Z(w,B,z){if(w==null)return w;var K=[],ue=0;return Y(w,K,"","",function(he){return B.call(z,he,ue++)}),K}function q(w){if(w._status===-1){var B=w._result;B=B(),B.then(function(z){(w._status===0||w._status===-1)&&(w._status=1,w._result=z)},function(z){(w._status===0||w._status===-1)&&(w._status=2,w._result=z)}),w._status===-1&&(w._status=0,w._result=B)}if(w._status===1)return w._result.default;throw w._result}var j=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},Q={map:Z,forEach:function(w,B,z){Z(w,function(){B.apply(this,arguments)},z)},count:function(w){var B=0;return Z(w,function(){B++}),B},toArray:function(w){return Z(w,function(B){return B})||[]},only:function(w){if(!re(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return yt.Activity=m,yt.Children=Q,yt.Component=E,yt.Fragment=t,yt.Profiler=s,yt.PureComponent=C,yt.StrictMode=i,yt.Suspense=h,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,yt.__COMPILER_RUNTIME={__proto__:null,c:function(w){return P.H.useMemoCache(w)}},yt.cache=function(w){return function(){return w.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(w,B,z){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var K=b({},w.props),ue=w.key;if(B!=null)for(he in B.key!==void 0&&(ue=""+B.key),B)!L.call(B,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&B.ref===void 0||(K[he]=B[he]);var he=arguments.length-2;if(he===1)K.children=z;else if(1<he){for(var ve=Array(he),Le=0;Le<he;Le++)ve[Le]=arguments[Le+2];K.children=ve}return V(w.type,ue,K)},yt.createContext=function(w){return w={$$typeof:o,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:n,_context:w},w},yt.createElement=function(w,B,z){var K,ue={},he=null;if(B!=null)for(K in B.key!==void 0&&(he=""+B.key),B)L.call(B,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(ue[K]=B[K]);var ve=arguments.length-2;if(ve===1)ue.children=z;else if(1<ve){for(var Le=Array(ve),ke=0;ke<ve;ke++)Le[ke]=arguments[ke+2];ue.children=Le}if(w&&w.defaultProps)for(K in ve=w.defaultProps,ve)ue[K]===void 0&&(ue[K]=ve[K]);return V(w,he,ue)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(w){return{$$typeof:c,render:w}},yt.isValidElement=re,yt.lazy=function(w){return{$$typeof:_,_payload:{_status:-1,_result:w},_init:q}},yt.memo=function(w,B){return{$$typeof:f,type:w,compare:B===void 0?null:B}},yt.startTransition=function(w){var B=P.T,z={};P.T=z;try{var K=w(),ue=P.S;ue!==null&&ue(z,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(I,j)}catch(he){j(he)}finally{B!==null&&z.types!==null&&(B.types=z.types),P.T=B}},yt.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},yt.use=function(w){return P.H.use(w)},yt.useActionState=function(w,B,z){return P.H.useActionState(w,B,z)},yt.useCallback=function(w,B){return P.H.useCallback(w,B)},yt.useContext=function(w){return P.H.useContext(w)},yt.useDebugValue=function(){},yt.useDeferredValue=function(w,B){return P.H.useDeferredValue(w,B)},yt.useEffect=function(w,B){return P.H.useEffect(w,B)},yt.useEffectEvent=function(w){return P.H.useEffectEvent(w)},yt.useId=function(){return P.H.useId()},yt.useImperativeHandle=function(w,B,z){return P.H.useImperativeHandle(w,B,z)},yt.useInsertionEffect=function(w,B){return P.H.useInsertionEffect(w,B)},yt.useLayoutEffect=function(w,B){return P.H.useLayoutEffect(w,B)},yt.useMemo=function(w,B){return P.H.useMemo(w,B)},yt.useOptimistic=function(w,B){return P.H.useOptimistic(w,B)},yt.useReducer=function(w,B,z){return P.H.useReducer(w,B,z)},yt.useRef=function(w){return P.H.useRef(w)},yt.useState=function(w){return P.H.useState(w)},yt.useSyncExternalStore=function(w,B,z){return P.H.useSyncExternalStore(w,B,z)},yt.useTransition=function(){return P.H.useTransition()},yt.version="19.2.1",yt}var Hx;function Rf(){return Hx||(Hx=1,v_.exports=RA()),v_.exports}var E_={exports:{}},us={};/**
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 jx;function SA(){if(jx)return us;jx=1;var a=Rf();function e(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)f+="&args[]="+encodeURIComponent(arguments[_])}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 i={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},s=Symbol.for("react.portal");function n(h,f,_){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:f,implementation:_}}var o=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return us.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,us.createPortal=function(h,f){var _=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 n(h,f,null,_)},us.flushSync=function(h){var f=o.T,_=i.p;try{if(o.T=null,i.p=2,h)return h()}finally{o.T=f,i.p=_,i.d.f()}},us.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(h,f))},us.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},us.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var _=f.as,m=c(_,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;_==="style"?i.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:x}):_==="script"&&i.d.X(h,{crossOrigin:m,integrity:g,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},us.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var _=c(f.as,f.crossOrigin);i.d.M(h,{crossOrigin:_,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(h)},us.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var _=f.as,m=c(_,f.crossOrigin);i.d.L(h,_,{crossOrigin:m,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})}},us.preloadModule=function(h,f){if(typeof h=="string")if(f){var _=c(f.as,f.crossOrigin);i.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:_,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(h)},us.requestFormReset=function(h){i.d.r(h)},us.unstable_batchedUpdates=function(h,f){return h(f)},us.useFormState=function(h,f,_){return o.H.useFormState(h,f,_)},us.useFormStatus=function(){return o.H.useHostTransitionStatus()},us.version="19.2.1",us}var Wx;function MA(){if(Wx)return E_.exports;Wx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(e){console.error(e)}}return a(),E_.exports=SA(),E_.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 Xx;function CA(){if(Xx)return Mc;Xx=1;var a=AA(),e=Rf(),t=MA();function i(r){var l="https://react.dev/errors/"+r;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function n(r){var l=r,u=r;if(r.alternate)for(;l.return;)l=l.return;else{r=l;do l=r,(l.flags&4098)!==0&&(u=l.return),r=l.return;while(r)}return l.tag===3?u:null}function o(r){if(r.tag===13){var l=r.memoizedState;if(l===null&&(r=r.alternate,r!==null&&(l=r.memoizedState)),l!==null)return l.dehydrated}return null}function c(r){if(r.tag===31){var l=r.memoizedState;if(l===null&&(r=r.alternate,r!==null&&(l=r.memoizedState)),l!==null)return l.dehydrated}return null}function h(r){if(n(r)!==r)throw Error(i(188))}function f(r){var l=r.alternate;if(!l){if(l=n(r),l===null)throw Error(i(188));return l!==r?null:r}for(var u=r,d=l;;){var p=u.return;if(p===null)break;var T=p.alternate;if(T===null){if(d=p.return,d!==null){u=d;continue}break}if(p.child===T.child){for(T=p.child;T;){if(T===u)return h(p),r;if(T===d)return h(p),l;T=T.sibling}throw Error(i(188))}if(u.return!==d.return)u=p,d=T;else{for(var F=!1,H=p.child;H;){if(H===u){F=!0,u=p,d=T;break}if(H===d){F=!0,d=p,u=T;break}H=H.sibling}if(!F){for(H=T.child;H;){if(H===u){F=!0,u=T,d=p;break}if(H===d){F=!0,d=T,u=p;break}H=H.sibling}if(!F)throw Error(i(189))}}if(u.alternate!==d)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?r:l}function _(r){var l=r.tag;if(l===5||l===26||l===27||l===6)return r;for(r=r.child;r!==null;){if(l=_(r),l!==null)return l;r=r.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),C=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function ae(r){return r===null||typeof r!="object"?null:(r=re&&r[re]||r["@@iterator"],typeof r=="function"?r:null)}var de=Symbol.for("react.client.reference");function U(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===de?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case b:return"Fragment";case E:return"Profiler";case v:return"StrictMode";case M:return"Suspense";case I:return"SuspenseList";case V:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case y:return"Portal";case C:return r.displayName||"Context";case R:return(r._context.displayName||"Context")+".Consumer";case O:var l=r.render;return r=r.displayName,r||(r=l.displayName||l.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case P:return l=r.displayName||null,l!==null?l:U(r.type)||"Memo";case L:l=r._payload,r=r._init;try{return U(r(l))}catch{}}return null}var te=Array.isArray,Y=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},j=[],Q=-1;function w(r){return{current:r}}function B(r){0>Q||(r.current=j[Q],j[Q]=null,Q--)}function z(r,l){Q++,j[Q]=r.current,r.current=l}var K=w(null),ue=w(null),he=w(null),ve=w(null);function Le(r,l){switch(z(he,l),z(ue,r),z(K,null),l.nodeType){case 9:case 11:r=(r=l.documentElement)&&(r=r.namespaceURI)?ox(r):0;break;default:if(r=l.tagName,l=l.namespaceURI)l=ox(l),r=lx(l,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}B(K),z(K,r)}function ke(){B(K),B(ue),B(he)}function J(r){r.memoizedState!==null&&z(ve,r);var l=K.current,u=lx(l,r.type);l!==u&&(z(ue,r),z(K,u))}function _e(r){ue.current===r&&(B(K),B(ue)),ve.current===r&&(B(ve),vc._currentValue=q)}var xe,Ne;function Qe(r){if(xe===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);xe=l&&l[1]||"",Ne=-1<u.stack.indexOf(`
43    at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44`+xe+r+Ne}var He=!1;function dt(r,l){if(!r||He)return"";He=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(l){var De=function(){throw Error()};if(Object.defineProperty(De.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(De,[])}catch(Ee){var Te=Ee}Reflect.construct(r,[],De)}else{try{De.call()}catch(Ee){Te=Ee}r.call(De.prototype)}}else{try{throw Error()}catch(Ee){Te=Ee}(De=r())&&typeof De.catch=="function"&&De.catch(function(){})}}
vendor: 10,891 bytes, lines 44-49
44catch(Ee){if(Ee&&Te&&typeof Ee.stack=="string")return[Ee.stack,Te.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=d.DetermineComponentFrameRoot(),F=T[0],H=T[1];if(F&&H){var ie=F.split(`
45`),ye=H.split(`
46`);for(p=d=0;d<ie.length&&!ie[d].includes("DetermineComponentFrameRoot");)d++;for(;p<ye.length&&!ye[p].includes("DetermineComponentFrameRoot");)p++;if(d===ie.length||p===ye.length)for(d=ie.length-1,p=ye.length-1;1<=d&&0<=p&&ie[d]!==ye[p];)p--;for(;1<=d&&0<=p;d--,p--)if(ie[d]!==ye[p]){if(d!==1||p!==1)do if(d--,p--,0>p||ie[d]!==ye[p]){var Se=`
47`+ie[d].replace(" at new "," at ");return r.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",r.displayName)),Se}while(1<=d&&0<=p);break}}}finally{He=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?Qe(u):""}function li(r,l){switch(r.tag){case 26:case 27:case 5:return Qe(r.type);case 16:return Qe("Lazy");case 13:return r.child!==l&&l!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return dt(r.type,!1);case 11:return dt(r.type.render,!1);case 1:return dt(r.type,!0);case 31:return Qe("Activity");default:return""}}function zt(r){try{var l="",u=null;do l+=li(r,u),u=r,r=r.return;while(r);return l}catch(d){return`
48Error generating stack: `+d.message+`
49`+d.stack}}var Ot=Object.prototype.hasOwnProperty,jt=a.unstable_scheduleCallback,Nt=a.unstable_cancelCallback,ut=a.unstable_shouldYield,ne=a.unstable_requestPaint,we=a.unstable_now,ti=a.unstable_getCurrentPriorityLevel,ci=a.unstable_ImmediatePriority,hi=a.unstable_UserBlockingPriority,ii=a.unstable_NormalPriority,ui=a.unstable_LowPriority,Gt=a.unstable_IdlePriority,fi=a.log,qt=a.unstable_setDisableYieldValue,Wt=null,si=null;function Si(r){if(typeof fi=="function"&&qt(r),si&&typeof si.setStrictMode=="function")try{si.setStrictMode(Wt,r)}catch{}}var Mi=Math.clz32?Math.clz32:xr,gr=Math.log,pr=Math.LN2;function xr(r){return r>>>=0,r===0?32:31-(gr(r)/pr|0)|0}var Os=256,ws=262144,Fs=4194304;function ns(r){var l=r&42;if(l!==0)return l;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 Bs(r,l,u){var d=r.pendingLanes;if(d===0)return 0;var p=0,T=r.suspendedLanes,F=r.pingedLanes;r=r.warmLanes;var H=d&134217727;return H!==0?(d=H&~T,d!==0?p=ns(d):(F&=H,F!==0?p=ns(F):u||(u=H&~r,u!==0&&(p=ns(u))))):(H=d&~T,H!==0?p=ns(H):F!==0?p=ns(F):u||(u=d&~r,u!==0&&(p=ns(u)))),p===0?0:l!==0&&l!==p&&(l&T)===0&&(T=p&-p,u=l&-l,T>=u||T===32&&(u&4194048)!==0)?l:p}function $e(r,l){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&l)===0}function G(r,l){switch(r){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 Re(){var r=Fs;return Fs<<=1,(Fs&62914560)===0&&(Fs=4194304),r}function pt(r){for(var l=[],u=0;31>u;u++)l.push(r);return l}function We(r,l){r.pendingLanes|=l,l!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function W(r,l,u,d,p,T){var F=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var H=r.entanglements,ie=r.expirationTimes,ye=r.hiddenUpdates;for(u=F&~u;0<u;){var Se=31-Mi(u),De=1<<Se;H[Se]=0,ie[Se]=-1;var Te=ye[Se];if(Te!==null)for(ye[Se]=null,Se=0;Se<Te.length;Se++){var Ee=Te[Se];Ee!==null&&(Ee.lane&=-536870913)}u&=~De}d!==0&&Ve(r,d,0),T!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=T&~(F&~l))}function Ve(r,l,u){r.pendingLanes|=l,r.suspendedLanes&=~l;var d=31-Mi(l);r.entangledLanes|=l,r.entanglements[d]=r.entanglements[d]|1073741824|u&261930}function Qt(r,l){var u=r.entangledLanes|=l;for(r=r.entanglements;u;){var d=31-Mi(u),p=1<<d;p&l|r[d]&l&&(r[d]|=l),u&=~p}}function as(r,l){var u=l&-l;return u=(u&42)!==0?1:br(u),(u&(r.suspendedLanes|l))!==0?0:u}function br(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 os(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ms(){var r=Z.p;return r!==0?r:(r=window.event,r===void 0?32:Px(r.type))}function ls(r,l){var u=Z.p;try{return Z.p=r,l()}finally{Z.p=u}}var Ls=Math.random().toString(36).slice(2),Li="__reactFiber$"+Ls,Ki="__reactProps$"+Ls,Ur="__reactContainer$"+Ls,Qa="__reactEvents$"+Ls,Kc="__reactListeners$"+Ls,Zc="__reactHandles$"+Ls,ol="__reactResources$"+Ls,An="__reactMarker$"+Ls;function $a(r){delete r[Li],delete r[Ki],delete r[Qa],delete r[Kc],delete r[Zc]}function zr(r){var l=r[Li];if(l)return l;for(var u=r.parentNode;u;){if(l=u[Ur]||u[Li]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(r=mx(r);r!==null;){if(u=r[Li])return u;r=mx(r)}return l}r=u,u=r.parentNode}return null}function Gr(r){if(r=r[Li]||r[Ur]){var l=r.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return r}return null}function Rn(r){var l=r.tag;if(l===5||l===26||l===27||l===6)return r.stateNode;throw Error(i(33))}function Vr(r){var l=r[ol];return l||(l=r[ol]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Oi(r){r[An]=!0}var ll=new Set,cl={};function yr(r,l){Hr(r,l),Hr(r+"Capture",l)}function Hr(r,l){for(cl[r]=l,r=0;r<l.length;r++)ll.add(l[r])}var Qc=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]*$"),hl={},ul={};function $c(r){return Ot.call(ul,r)?!0:Ot.call(hl,r)?!1:Qc.test(r)?ul[r]=!0:(hl[r]=!0,!1)}function ma(r,l,u){if($c(l))if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(l);return;case"boolean":var d=l.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(l);return}}r.setAttribute(l,""+u)}}function ga(r,l,u){if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttribute(l,""+u)}}function Ys(r,l,u,d){if(d===null)r.removeAttribute(u);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(l,u,""+d)}}function gs(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function fl(r){var l=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Jc(r,l,u){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,l);if(!r.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,T=d.set;return Object.defineProperty(r,l,{configurable:!0,get:function(){return p.call(this)},set:function(F){u=""+F,T.call(this,F)}}),Object.defineProperty(r,l,{enumerable:d.enumerable}),{getValue:function(){return u},setValue:function(F){u=""+F},stopTracking:function(){r._valueTracker=null,delete r[l]}}}}function Ja(r){if(!r._valueTracker){var l=fl(r)?"checked":"value";r._valueTracker=Jc(r,l,""+r[l])}}function dl(r){if(!r)return!1;var l=r._valueTracker;if(!l)return!0;var u=l.getValue(),d="";return r&&(d=fl(r)?r.checked?"true":"false":r.value),r=d,r!==u?(l.setValue(r),!0):!1}function pa(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 eh=/[\n"\\]/g;function ps(r){return r.replace(eh,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function eo(r,l,u,d,p,T,F,H){r.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?r.type=F:r.removeAttribute("type"),l!=null?F==="number"?(l===0&&r.value===""||r.value!=l)&&(r.value=""+gs(l)):r.value!==""+gs(l)&&(r.value=""+gs(l)):F!=="submit"&&F!=="reset"||r.removeAttribute("value"),l!=null?to(r,F,gs(l)):u!=null?to(r,F,gs(u)):d!=null&&r.removeAttribute("value"),p==null&&T!=null&&(r.defaultChecked=!!T),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?r.name=""+gs(H):r.removeAttribute("name")}function _l(r,l,u,d,p,T,F,H){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(r.type=T),l!=null||u!=null){if(!(T!=="submit"&&T!=="reset"||l!=null)){Ja(r);return}u=u!=null?""+gs(u):"",l=l!=null?""+gs(l):u,H||l===r.value||(r.value=l),r.defaultValue=l}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=H?r.checked:!!d,r.defaultChecked=!!d,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(r.name=F),Ja(r)}function to(r,l,u){l==="number"&&pa(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function jr(r,l,u,d){if(r=r.options,l){l={};for(var p=0;p<u.length;p++)l["$"+u[p]]=!0;for(u=0;u<r.length;u++)p=l.hasOwnProperty("$"+r[u].value),r[u].selected!==p&&(r[u].selected=p),p&&d&&(r[u].defaultSelected=!0)}else{for(u=""+gs(u),l=null,p=0;p<r.length;p++){if(r[p].value===u){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}l!==null||r[p].disabled||(l=r[p])}l!==null&&(l.selected=!0)}}function ml(r,l,u){if(l!=null&&(l=""+gs(l),l!==r.value&&(r.value=l),u==null)){r.defaultValue!==l&&(r.defaultValue=l);return}r.defaultValue=u!=null?""+gs(u):""}function gl(r,l,u,d){if(l==null){if(d!=null){if(u!=null)throw Error(i(92));if(te(d)){if(1<d.length)throw Error(i(93));d=d[0]}u=d}u==null&&(u=""),l=u}u=gs(l),r.defaultValue=u,d=r.textContent,d===u&&d!==""&&d!==null&&(r.value=d),Ja(r)}function Wr(r,l){if(l){var u=r.firstChild;
vendor: 4,140 bytes, line 49
49if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=l;return}}r.textContent=l}var th=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 pl(r,l,u){var d=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?d?r.setProperty(l,""):l==="float"?r.cssFloat="":r[l]="":d?r.setProperty(l,u):typeof u!="number"||u===0||th.has(l)?l==="float"?r.cssFloat=u:r[l]=(""+u).trim():r[l]=u+"px"}function xl(r,l,u){if(l!=null&&typeof l!="object")throw Error(i(62));if(r=r.style,u!=null){for(var d in u)!u.hasOwnProperty(d)||l!=null&&l.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in l)d=l[p],l.hasOwnProperty(p)&&u[p]!==d&&pl(r,p,d)}else for(var T in l)l.hasOwnProperty(T)&&pl(r,T,l[T])}function io(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 ih=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"],["colorRendering","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
49-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"]]),sh=/^[\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 xa(r){return sh.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function qs(){}var so=null;function ro(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Xr=null,Yr=null;function bl(r){var l=Gr(r);if(l&&(r=l.stateNode)){var u=r[Ki]||null;e:switch(r=l.stateNode,l.type){case"input":if(eo(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+ps(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var d=u[l];if(d!==r&&d.form===r.form){var p=d[Ki]||null;if(!p)throw Error(i(90));eo(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(l=0;l<u.length;l++)d=u[l],d.form===r.form&&dl(d)}break e;case"textarea":ml(r,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&jr(r,!!u.multiple,l,!1)}}}var no=!1;function yl(r,l,u){if(no)return r(l,u);no=!0;try{var d=r(l);return d}finally{if(no=!1,(Xr!==null||Yr!==null)&&(Tu(),Xr&&(l=Xr,r=Yr,Yr=Xr=null,bl(l),r)))for(l=0;l<r.length;l++)bl(r[l])}}function Sn(r,l){var u=r.stateNode;if(u===null)return null;var d=u[Ki]||null;if(d===null)return null;u=d[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(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(u&&typeof u!="function")throw Error(i(231,l,typeof u));return u}var Ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ao=!1;if(Ks)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){ao=!0}}),window.addEventListener("test",Mn,Mn),window.removeEventListener("test",Mn,Mn)}catch{ao=!1}var cr=null,oo=null,ba=null;function Tl(){if(ba)return ba;var r,l=oo,u=l.length,d,p="value"in cr?cr.value:cr.textContent,T=p.length;for(r=0;r<u&&l[r]===p[r];r++);var F=u-r;for(d=1;d<=F&&l[u-d]===p[T-d];d++);return ba=p.slice(r,1<d?1-d:void 0)}function ya(r){var l=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&l===13&&(r=13)):r=l,r===10&&(r=13),32<=r||r===13?r:0}function Ta(){return!0}function vl(){return!1}function Zi(r){function l(u,d,p,T,F){this._reactName=u,this._targetInst=p,this.type=d,this.nativeEvent=T,this.target=F,this.currentTarget=null;for(var H in r)r.hasOwnProperty(H)&&(u=r[H],this[H]=u?u(T):T[H]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Ta:vl,this.isPropagationStopped=vl,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ta)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ta)},persist:function(){},isPersistent:Ta}),l}var Tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},va=Zi(Tr),Cn=m({},Tr,{view:0,detail:0}),rh=Zi(Cn),lo,co,Dn,Ea=m({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uo,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!==Dn&&(Dn&&r.type==="mousemove"?(lo=r.screenX-Dn.screenX,co=r.screenY-Dn.screenY):co=lo=0,Dn=r),lo)},movementY:function(r){return"movementY"in r?r.movementY:co}}),El=Zi(Ea),nh=m({},Ea,{dataTransfer:0}),ah=Zi(nh),oh=m({},Cn,{relatedTarget:0}),ho=Zi(oh),lh=m({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),ch=Zi(lh),hh=m({},Tr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),uh=Zi(hh),fh=m({},Tr,{data:0}),Al=Zi(fh),dh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_h={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"},mh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gh(r){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(r):(r=mh[r])?!!l[r]:!1}function uo(){return gh}var ph=m({},Cn,{key:function(r){if(r.key){var l=dh[r.key]||r.key;if(l!=="Unidentified")return l}
vendor: 5,186 bytes, line 49
49return r.type==="keypress"?(r=ya(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?_h[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uo,charCode:function(r){return r.type==="keypress"?ya(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ya(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),xh=Zi(ph),bh=m({},Ea,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rl=Zi(bh),yh=m({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uo}),Th=Zi(yh),vh=m({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Eh=Zi(vh),Ah=m({},Ea,{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}),Rh=Zi(Ah),Sh=m({},Tr,{newState:0,oldState:0}),Mh=Zi(Sh),Ch=[9,13,27,32],fo=Ks&&"CompositionEvent"in window,In=null;Ks&&"documentMode"in document&&(In=document.documentMode);var Dh=Ks&&"TextEvent"in window&&!In,Sl=Ks&&(!fo||In&&8<In&&11>=In),Ml=" ",Cl=!1;function Dl(r,l){switch(r){case"keyup":return Ch.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Il(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var qr=!1;function Ih(r,l){switch(r){case"compositionend":return Il(l);case"keypress":return l.which!==32?null:(Cl=!0,Ml);case"textInput":return r=l.data,r===Ml&&Cl?null:r;default:return null}}function Ph(r,l){if(qr)return r==="compositionend"||!fo&&Dl(r,l)?(r=Tl(),ba=oo=cr=null,qr=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Sl&&l.locale!=="ko"?null:l.data;default:return null}}var Oh={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 Pl(r){var l=r&&r.nodeName&&r.nodeName.toLowerCase();return l==="input"?!!Oh[r.type]:l==="textarea"}function Ol(r,l,u,d){Xr?Yr?Yr.push(d):Yr=[d]:Xr=d,l=Cu(l,"onChange"),0<l.length&&(u=new va("onChange","change",null,u,d),r.push({event:u,listeners:l}))}var Pn=null,On=null;function wh(r){tx(r,0)}function Aa(r){var l=Rn(r);if(dl(l))return r}function wl(r,l){if(r==="change")return l}var Fl=!1;if(Ks){var _o;if(Ks){var mo="oninput"in document;if(!mo){var Bl=document.createElement("div");Bl.setAttribute("oninput","return;"),mo=typeof Bl.oninput=="function"}_o=mo}else _o=!1;Fl=_o&&(!document.documentMode||9<document.documentMode)}function Ll(){Pn&&(Pn.detachEvent("onpropertychange",kl),On=Pn=null)}function kl(r){if(r.propertyName==="value"&&Aa(On)){var l=[];Ol(l,On,r,ro(r)),yl(wh,l)}}function Fh(r,l,u){r==="focusin"?(Ll(),Pn=l,On=u,Pn.attachEvent("onpropertychange",kl)):r==="focusout"&&Ll()}function Bh(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Aa(On)}function Lh(r,l){if(r==="click")return Aa(l)}function kh(r,l){if(r==="input"||r==="change")return Aa(l)}function Nh(r,l){return r===l&&(r!==0||1/r===1/l)||r!==r&&l!==l}var cs=typeof Object.is=="function"?Object.is:Nh;function wn(r,l){if(cs(r,l))return!0;if(typeof r!="object"||r===null||typeof l!="object"||l===null)return!1;var u=Object.keys(r),d=Object.keys(l);if(u.length!==d.length)return!1;for(d=0;d<u.length;d++){var p=u[d];if(!Ot.call(l,p)||!cs(r[p],l[p]))return!1}return!0}function Nl(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Ul(r,l){var u=Nl(r);r=0;for(var d;u;){if(u.nodeType===3){if(d=r+u.textContent.length,r<=l&&d>=l)return{node:u,offset:l-r};r=d}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Nl(u)}}function zl(r,l){return r&&l?r===l?!0:r&&r.nodeType===3?!1:l&&l.nodeType===3?zl(r,l.parentNode):"contains"in r?r.contains(l):r.compareDocumentPosition?!!(r.compareDocumentPosition(l)&16):!1:!1}function Gl(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var l=pa(r.document);l instanceof r.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)r=l.contentWindow;else break;l=pa(r.document)}return l}function go(r){var l=r&&r.nodeName&&r.nodeName.toLowerCase();return l&&(l==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||l==="textarea"||r.contentEditable==="true")}var Uh=Ks&&"documentMode"in document&&11>=document.documentMode,Kr=null,po=null,Fn=null,xo=!1;function Vl(r,l,u){var d=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;xo||Kr==null||Kr!==pa(d)||(d=Kr,"selectionStart"in d&&go(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,848 bytes, line 49
49sNode:d.focusNode,focusOffset:d.focusOffset}),Fn&&wn(Fn,d)||(Fn=d,d=Cu(po,"onSelect"),0<d.length&&(l=new va("onSelect","select",null,l,u),r.push({event:l,listeners:d}),l.target=Kr)))}function vr(r,l){var u={};return u[r.toLowerCase()]=l.toLowerCase(),u["Webkit"+r]="webkit"+l,u["Moz"+r]="moz"+l,u}var Zr={animationend:vr("Animation","AnimationEnd"),animationiteration:vr("Animation","AnimationIteration"),animationstart:vr("Animation","AnimationStart"),transitionrun:vr("Transition","TransitionRun"),transitionstart:vr("Transition","TransitionStart"),transitioncancel:vr("Transition","TransitionCancel"),transitionend:vr("Transition","TransitionEnd")},bo={},Hl={};Ks&&(Hl=document.createElement("div").style,"AnimationEvent"in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),"TransitionEvent"in window||delete Zr.transitionend.transition);function Er(r){if(bo[r])return bo[r];if(!Zr[r])return r;var l=Zr[r],u;for(u in l)if(l.hasOwnProperty(u)&&u in Hl)return bo[r]=l[u];return r}var jl=Er("animationend"),Wl=Er("animationiteration"),Xl=Er("animationstart"),zh=Er("transitionrun"),Gh=Er("transitionstart"),Vh=Er("transitioncancel"),Ye=Er("transitionend"),S=new Map,le="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(" ");le.push("scrollEnd");function Kt(r,l){S.set(r,l),yr(l,[r])}var Et=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=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(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},At=[],me=0,ks=0;function Zs(){for(var r=me,l=ks=me=0;l<r;){var u=At[l];At[l++]=null;var d=At[l];At[l++]=null;var p=At[l];At[l++]=null;var T=At[l];if(At[l++]=null,d!==null&&p!==null){var F=d.pending;F===null?p.next=p:(p.next=F.next,F.next=p),d.pending=p}T!==0&&ki(u,p,T)}}function hr(r,l,u,d){At[me++]=r,At[me++]=l,At[me++]=u,At[me++]=d,ks|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function hs(r,l,u,d){return hr(r,l,u,d),ur(r)}function Ze(r,l){return hr(r,null,null,l),ur(r)}function ki(r,l,u){r.lanes|=u;var d=r.alternate;d!==null&&(d.lanes|=u);for(var p=!1,T=r.return;T!==null;)T.childLanes|=u,d=T.alternate,d!==null&&(d.childLanes|=u),T.tag===22&&(r=T.stateNode,r===null||r._visibility&1||(p=!0)),r=T,T=T.return;return r.tag===3?(T=r.stateNode,p&&l!==null&&(p=31-Mi(u),r=T.hiddenUpdates,d=r[p],d===null?r[p]=[l]:d.push(l),l.lane=u|536870912),T):null}function ur(r){if(50<mc)throw mc=0,Vd=null,Error(i(185));for(var l=r.return;l!==null;)r=l,l=r.return;return r.tag===3?r.stateNode:null}var Qi={};function Qr(r,l,u,d){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,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 Yi(r,l,u,d){return new Qr(r,l,u,d)}function yo(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Qs(r,l){var u=r.alternate;return u===null?(u=Yi(r.tag,l,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=l,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,l=r.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function Hh(r,l){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=l,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,l=u.dependencies,r.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),r}function To(r,l,u,d,p,T){var F=0;if(d=r,typeof r=="function")yo(r)&&(F=1);else if(typeof r=="string")F=oA(r,u,K.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case V:return r=Yi(31,u,l,p),r.elementType=V,r.lanes=T,r;case b:return $s(u.children,p,T,l);case v:F=8,p|=24;break;case E:return r=Yi(12,u,l,p|2),r.elementType=E,r.lanes=T,r;case M:return r=Yi(13,u,l,p),r.elementType=M,r.lanes=T,r;case I:return r=Yi(19,u,l,p),r.elementType=I,r.lanes=T,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:F=10;break e;case R:F=9;break e;case O:F=11;break e;case P:F=14;break e;case L:F=16,d=null;break e}F=29,u=Error(i(130,r===null?"null":typeof r,"")),d=null}return l=Yi(F,u,l,p),l.elementType=r,l.type=d,l.lanes=T,l}function $s(r,l,u,d){return r=Yi(7,r,d,l),r.lanes=u,r}function Ar(r,l,u){return r=Yi(6,r,null,l),r.lanes=u,r}function Yl(r){var l=Yi(18,null,null,0);return l.stateNode=r,l}function jh(r,l,u){return l=Yi(4,r.children!==null?r.children:[],r.key,l),l.lanes=u,l.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},l}var Wh=new WeakMap;function Js(r,l){if(typeof r=="object"&&r!==null){var u=Wh.get(r);return u!==void 0?u:(l={value:r,source:l,stack:zt(l)},Wh.set(r,l),l)}return{value:r,source:l,stack:zt(l)}}var vo=[],Eo=0,Xh=null,ql=0,er=[],tr=0,Bn=null,Rr=1,Sr="";function $r(r,l){vo[Eo++]=ql,vo[Eo++]=Xh,Xh=r,ql=l}function zm(r,l,u){er[tr++]=Rr,er[tr++]=Sr,er[tr++]=Bn,Bn=r;var d=Rr;r=Sr;var p=32-Mi(d)-1;d&=~(1<<p),u+=1;var T=32-Mi(l)+p;if(30<T){var F=p-p%5;T=(d&(1<<F)-1).toString(32),d>>=F,p-=F,Rr=1<<32-Mi(l)+p|u<<p|d,Sr=T+r}else Rr=1<<T|u<<p|d,Sr=r}function kf(r){r.return!==null&&($r(r,1),zm(r,1,0))}function Nf(r){for(;r===Xh;)Xh=vo[--Eo],vo[Eo]=null,ql=vo[--Eo],vo[Eo]=null;for(;r===Bn;)Bn=er[--tr],er[tr]=null,Sr=er[--tr],er[tr]=null,Rr=er[--tr],er[tr]=null}function Gm(r,l){er[tr++]=Rr,er[tr++]=Sr,er[tr++]=Bn,Rr=l.id,Sr=l.overflow,Bn=r}var $i=null,bi=null,wt=!1,Ln=null,ir=!1,Uf=Error(i(519));function kn(r){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Kl(Js(l,r)),Uf}function Vm(r){var l=r.stateNode,u=r.type,d=r.memoizedProps;switch(l[Li]=r,l[Ki]=d,u){case"dialog":Ct("cancel",l),Ct("close",l);break;case"iframe":case"object":case"embed":Ct("load",l);break;case"video":case"audio":for(u=0;u<pc.length;u++)Ct(pc[u],l);break;case"source":Ct("error",l);break;case"img":case"image":case"link":Ct("error",l),Ct("load",l);break;case"details":Ct("toggle",l);break;case"input":Ct("invalid",l),_l(l,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ct("invalid",l);break;case"textarea":Ct("invalid",l),gl(l,d.value,d.defaultValue,d.children)}u=d.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||d.suppressHydrationWarning===!0||nx(l.textContent,u)?(d.popover!=null&&(Ct("beforetoggle",l),Ct("toggle",l)),d.onScroll!=null&&Ct("scroll",l),d.onScrollEnd!=null&&Ct("scrollend",l),d.onClick!=null&&(l.onclick=qs),l=!0):l=!1,l||kn(r,!0)}function Hm(r){for($i=r.return;$i;)switch($i.tag){case 5:case 31:case 13:ir=!1;return;case 27:case 3:ir=!0;return;default:$i=$i.return}}function Ao(r){if(r!==$i)return!1;if(!wt)return Hm(r),wt=!0,!1;var l=r.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||s_(r.type,r.memoizedProps)),u=!u),u&&bi&&kn(r),Hm(r),l===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));bi=_x(r)}else if(l===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));bi=_x(r)}else l===27?(l=bi,Qn(r.type)?(r=l_,l_=null,bi=r):bi=l):bi=$i?rr(r.stateNode.nextSibling):null;return!0}function Ra(){bi=$i=null,wt=!1}function zf(){var r=Ln;return r!==null&&(Ms===null?Ms=r:Ms.push.apply(Ms,r),Ln=null),r}function Kl(r){Ln===null?Ln=[r]:Ln.push(r)}var Gf=w(null),Sa=null,Jr=null;function Nn(r,l,u){z(Gf,l._currentValue),l._currentValue=u}function en(r){r._currentValue=Gf.current,B(Gf)}function Vf(r,l,u){for(;r!==null;){var d=r.alternate;if((r.childLanes&l)!==l?(r.childLanes|=l,d!==null&&(d.childLanes|=l)):d!==null&&(d.childLanes&l)!==l&&(d.childLanes|=l),r===u)break;r=r.return}}function Hf(r,l,u,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var T=p.dependencies;if(T!==null){var F=p.child;T=T.firstContext;e:for(;T!==null;){var H=T;T=p;for(var ie=0;ie<l.length;ie++)if(H.context===l[ie]){T.lanes|=u,H=T.alternate,H!==null&&(H.lanes|=u),Vf(T.return,u,r),d||(F=null);break e}T=H.next}}else if(p.tag===18){if(F=p.return,F===null)throw Error(i(341));F.lanes|=u,T=F.alternate,T!==null&&(T.lanes|=u),Vf(F,u,r),F=null}else F=p.child;if(F!==null)F.return=p;else for(F=p;F!==null;){if(F===r){F=null;break}if(p=F.sibling,p!==null){p.return=F.return,F=p;break}F=F.return}p=F}}function Ro(r,l,u,d){r=null;for(var p=l,T=!1;p!==null;){if(!T){if((p.flags&524288)!==0)T=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var F=p.alternate;if(F===null)throw Error(i(387));if(F=F.memoizedProps,F!==null){var H=p.type;cs(p.pendingProps.value,F.value)||(r!==null?r.push(H):r=[H])}}else if(p===ve.current){if(F=p.alternate,F===null)throw Error(i(387));F.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(vc):r=[vc])}p=p.return}r!==null&&Hf(l,r,u,d),l.flags|=262144}function Yh(r){for(r=r.firstContext;r!==null;){if(!cs(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ma(r){Sa=r,Jr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Ji(r){return jm(Sa,r)}function qh(r,l){return Sa===null&&Ma(r),jm(r,l)}function jm(r,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},Jr===null){if(r===null)throw Error(i(308));Jr=l,r.dependencies={lanes:0,firstContext:l},r.flags|=524288}else Jr=Jr.next=l;return u}var sE=typeof AbortController<"u"?AbortController:function(){var r=[],l=this.signal={aborted:!1,addEventListener:function(u,d){r.push(d)}};this.abort=function(){l.aborted=!0,r.forEach(function(u){return u()})}},rE=a.unstable_scheduleCallback,nE=a.unstable_NormalPriority,Ni={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jf(){return{controller:new sE,data:new Map,refCount:0}}function Zl(r){r.refCount--,r.refCount===0&&rE(nE,function(){r.controller.abort()})}var Ql=null,Wf=0,So=0,Mo=null;function aE(r,l){if(Ql===null){var u=Ql=[];Wf=0,So=qd(),Mo={status:"pending",value:void 0,then:function(d){u.push(d)}}}return Wf++,l.then(Wm,Wm),l}function Wm(){if(--Wf===0&&Ql!==null){Mo!==null&&(Mo.status="fulfilled");var r=Ql;Ql=null,So=0,Mo=null;for(var l=0;l<r.length;l++)(0,r[l])()}}function oE(r,l){var u=[],d={status:"pending",value:null,reason:null,then:function(p){u.push(p)}};return r.then(function(){d.status="fulfilled",d.value=l;for(var p=0;p<u.length;p++)(0,u[p])(l)},function(p){for(d.status="rejected",d.reason=p,p=0;p<u.length;p++)(0,u[p])(void 0)}),d}var Xm=Y.S;Y.S=function(r,l){Dp=we(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&aE(r,l),Xm!==null&&Xm(r,l)};var Ca=w(null);function Xf(){var r=Ca.current;return r!==null?r:di.pooledCache}function Kh(r,l){l===null?z(Ca,Ca.current):z(Ca,l.pool)}function Ym(){var r=Xf();return r===null?null:{parent:Ni._currentValue,pool:r}}var Co=Error(i(460)),Yf=Error(i(474)),Zh=Error(i(542)),Qh={then:function(){}};function qm(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Km(r,l,u){switch(u=r[u],u===void 0?r.push(l):u!==l&&(l.then(qs,qs),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw r=l.reason,Qm(r),r;default:if(typeof l.status=="string")l.then(qs,qs);else{if(r=di,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=l,r.status="pending",r.then(function(d){if(l.status==="pending"){var p=l;p.status="fulfilled",p.value=d}},function(d){if(l.status==="pending"){var p=l;p.status="rejected",p.reason=d}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw r=l.reason,Qm(r),r}throw Ia=l,Co}}function Da(r){try{var l=r._init;return l(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ia=u,Co):u}}var Ia=null;function Zm(){if(Ia===null)throw Error(i(459));var r=Ia;return Ia=null,r}function Qm(r){if(r===Co||r===Zh)throw Error(i(483))}var Do=null,$l=0;function $h(r){var l=$l;return $l+=1,Do===null&&(Do=[]),Km(Do,r,l)}function Jl(r,l){l=l.props.ref,r.ref=l!==void 0?l:null}function Jh(r,l){throw l.$$typeof===g?Error(i(525)):(r=Object.prototype.toString.call(l),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":r)))}function $m(r){function l(fe,oe){if(r){var be=fe.deletions;be===null?(fe.deletions=[oe],fe.flags|=16):be.push(oe)}}function u(fe,oe){if(!r)return null;for(;oe!==null;)l(fe,oe),oe=oe.sibling;return null}function d(fe){for(var oe=new Map;fe!==null;)fe.key!==null?oe.set(fe.key,fe):oe.set(fe.index,fe),fe=fe.sibling;return oe}function p(fe,oe){return fe=Qs(fe,oe),fe.index=0,fe.sibling=null,fe}function T(fe,oe,be){return fe.index=be,r?(be=fe.alternate,be!==null?(be=be.index,be<oe?(fe.flags|=67108866,oe):be):(fe.flags|=67108866,oe)):(fe.flags|=1048576,oe)}function F(fe){return r&&fe.alternate===null&&(fe.flags|=67108866),fe}function H(fe,oe,be,Ce){return oe===null||oe.tag!==6?(oe=Ar(be,fe.mode,Ce),oe.return=fe,oe):(oe=p(oe,be),oe.return=fe,oe)}function ie(fe,oe,be,Ce){var lt=be.type;return lt===b?Se(fe,oe,be.props.children,Ce,be.key):oe!==null&&(oe.elementType===lt||typeof lt=="object"&&lt!==null&&lt.$$typeof===L&&Da(lt)===oe.type)?(oe=p(oe,be.props),Jl(oe,be),oe.return=fe,oe):(oe=To(be.type,be.key,be.props,null,fe.mode,Ce),Jl(oe,be),oe.return=fe,oe)}function ye(fe,oe,be,Ce){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==be.containerInfo||oe.stateNode.implementation!==be.implementation?(oe=jh(be,fe.mode,Ce),oe.return=fe,oe):(oe=p(oe,be.children||[]),oe.return=fe,oe)}function Se(fe,oe,be,Ce,lt){return oe===null||oe.tag!==7?(oe=$s(be,fe.mode,Ce,lt),oe.return=fe,oe):(oe=p(oe,be),oe.return=fe,oe)}function De(fe,oe,be){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return oe=Ar(""+oe,fe.mode,be),oe.return=fe,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return be=To(oe.type,oe.key,oe.props,null,fe.mode,be),Jl(be,oe),be.return=fe,be;case y:return oe=jh(oe,fe.mode,be),oe.return=fe,oe;case L:return oe=Da(oe),De(fe,oe,be)}if(te(oe)||ae(oe))return oe=$s(oe,fe.mode,be,null),oe.return=fe,oe;if(typeof oe.then=="function")return De(fe,$h(oe),be);if(oe.$$typeof===C)return De(fe,qh(fe,oe),be);Jh(fe,oe)}return null}function Te(fe,oe,be,Ce){var lt=oe!==null?oe.key:null;if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return lt!==null?null:H(fe,oe,""+be,Ce);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case x:return be.key===lt?ie(fe,oe,be,Ce):null;case y:return be.key===lt?ye(fe,oe,be,Ce):null;case L:return be=Da(be),Te(fe,oe,be,Ce)}if(te(be)||ae(be))return lt!==null?null:Se(fe,oe,be,Ce,null);if(typeof be.then=="function")return Te(fe,oe,$h(be),Ce);if(be.$$typeof===C)return Te(fe,oe,qh(fe,be),Ce);Jh(fe,be)}return null}function Ee(fe,oe,be,Ce,lt){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return fe=fe.get(be)||null,H(oe,fe,""+Ce,lt);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case x:return fe=fe.get(Ce.key===null?be:Ce.key)||null,ie(oe,fe,Ce,lt);case y:return fe=fe.get(Ce.key===null?be:Ce.key)||null,ye(oe,fe,Ce,lt);case L:return Ce=Da(Ce),Ee(fe,oe,be,Ce,lt)}if(te(Ce)||ae(Ce))return fe=fe.get(be)||null,Se(oe,fe,Ce,lt,null);if(typeof Ce.then=="function")return Ee(fe,oe,be,$h(Ce),lt);if(Ce.$$typeof===C)return Ee(fe,oe,be,qh(oe,Ce),lt);Jh(oe,Ce)}return null}function tt(fe,oe,be,Ce){for(var lt=null,Xt=null,nt=oe,vt=oe=0,Pt=null;nt!==null&&vt<be.length;vt++){nt.index>vt?(Pt=nt,nt=null):Pt=nt.sibling;var Yt=Te(fe,nt,be[vt],Ce);if(Yt===null){nt===null&&(nt=Pt);break}r&&nt&&Yt.alternate===null&&l(fe,nt),oe=T(Yt,oe,vt),Xt===null?lt=Yt:Xt.sibling=Yt,Xt=Yt,nt=Pt}if(vt===be.length)return u(fe,nt),wt&&$r(fe,vt),lt;if(nt===null){for(;vt<be.length;vt++)nt=De(fe,be[vt],Ce),nt!==null&&(oe=T(nt,oe,vt),Xt===null?lt=nt:Xt.sibling=nt,Xt=nt);return wt&&$r(fe,vt),lt}for(nt=d(nt);vt<be.length;vt++)Pt=Ee(nt,fe,vt,be[vt],Ce),Pt!==null&&(r&&Pt.alternate!==null&&nt.delete(Pt.key===null?vt:Pt.key),oe=T(Pt,oe,vt),Xt===null?lt=Pt:Xt.sibling=Pt,Xt=Pt);return r&&nt.forEach(function(ia){return l(fe,ia)}),wt&&$r(fe,vt),lt}function ft(fe,oe,be,Ce){if(be==null)throw Error(i(151));for(var lt=null,Xt=null,nt=oe,vt=oe=0,Pt=null,Yt=be.next();nt!==null&&!Yt.done;vt++,Yt=be.next()){nt.index>vt?(Pt=nt,nt=null):Pt=nt.sibling;var ia=Te(fe,nt,Yt.value,Ce);if(ia===null){nt===null&&(nt=Pt);break}r&&nt&&ia.alternate===null&&l(fe,nt),oe=T(ia,oe,vt),Xt===null?lt=ia:Xt.sibling=ia,Xt=ia,nt=Pt}if(Yt.done)return u(fe,nt),wt&&$r(fe,vt),lt;if(nt===null){for(;!Yt.done;vt++,Yt=be.next())Yt=De(fe,Yt.value,Ce),Yt!==null&&(oe=T(Yt,oe,vt),Xt===null?lt=Yt:Xt.sibling=Yt,Xt=Yt);return wt&&$r(fe,vt),lt}for(nt=d(nt);!Yt.done;vt++,Yt=be.next())Yt=Ee(nt,fe,vt,Yt.value,Ce),Yt!==null&&(r&&Yt.alternate!==null&&nt.delete(Yt.key===null?vt:Yt.key),oe=T(Yt,oe,vt),Xt===null?lt=Yt:Xt.sibling=Yt,Xt=Yt);return r&&nt.forEach(function(xA){return l(fe,xA)}),wt&&$r(fe,vt),lt}function ai(fe,oe,be,Ce){if(typeof be=="object"&&be!==null&&be.type===b&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case x:e:{for(var lt=be.key;oe!==null;){if(oe.key===lt){if(lt=be.type,lt===b){if(oe.tag===7){u(fe,oe.sibling),Ce=p(oe,be.props.children),Ce.return=fe,fe=Ce;break e}}else if(oe.elementType===lt||typeof lt=="object"&&lt!==null&&lt.$$typeof===L&&Da(lt)===oe.type){u(fe,oe.sibling),Ce=p(oe,be.props),Jl(Ce,be),Ce.return=fe,fe=Ce;break e}u(fe,oe);break}else l(fe,oe);oe=oe.sibling}be.type===b?(Ce=$s(be.props.children,fe.mode,Ce,be.key),Ce.return=fe,fe=Ce):(Ce=To(be.type,be.key,be.props,null,fe.mode,Ce),Jl(Ce,be),Ce.return=fe,fe=Ce)}return F(fe);case y:e:{for(lt=be.key;oe!==null;){if(oe.key===lt)if(oe.tag===4&&oe.stateNode.containerInfo===be.containerInfo&&oe.stateNode.implementation===be.implementation){u(fe,oe.sibling),Ce=p(oe,be.children||[]),Ce.return=fe,fe=Ce;break e}else{u(fe,oe);break}else l(fe,oe);oe=oe.sibling}Ce=jh(be,fe.mode,Ce),Ce.return=fe,fe=Ce}return F(fe);case L:return be=Da(be),ai(fe,oe,be,Ce)}if(te(be))return tt(fe,oe,be,Ce);if(ae(be)){if(lt=ae(be),typeof lt!="function")throw Error(i(150));return be=lt.call(be),ft(fe,oe,be,Ce)}if(typeof be.then=="function")return ai(fe,oe,$h(be),Ce);if(be.$$typeof===C)return ai(fe,oe,qh(fe,be),Ce);Jh(fe,be)}return typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint"?(be=""+be,oe!==null&&oe.tag===6?(u(fe,oe.sibling),Ce=p(oe,be),Ce.return=fe,fe=Ce):(u(fe,oe),Ce=Ar(be,fe.mode,Ce),Ce.return=fe,fe=Ce),F(fe)):u(fe,oe)}return function(fe,oe,be,Ce){try{$l=0;var lt=ai(fe,oe,be,Ce);return Do=null,lt}catch(nt){if(nt===Co||nt===Zh)throw nt;var Xt=Yi(29,nt,null,fe.mode);return Xt.lanes=Ce,Xt.return=fe,Xt}finally{}}}var Pa=$m(!0),Jm=$m(!1),Un=!1;function qf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(r,l){r=r.updateQueue,l.updateQueue===r&&(l.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function zn(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Gn(r,l,u){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Zt&2)!==0){var p=d.pending;return p===null?l.next=l:(l.next=p.next,p.next=l),d.pending=l,l=ur(r),ki(r,null,u),l}return hr(r,d,l,u),ur(r)}function ec(r,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var d=l.lanes;d&=r.pendingLanes,u|=d,l.lanes=u,Qt(r,u)}}function Zf(r,l){var u=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,u===d)){var p=null,T=null;if(u=u.firstBaseUpdate,u!==null){do{var F={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};T===null?p=T=F:T=T.next=F,u=u.next}while(u!==null);T===null?p=T=l:T=T.next=l}else p=T=l;u={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:T,shared:d.shared,callbacks:d.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=l:r.next=l,u.lastBaseUpdate=l}var Qf=!1;function tc(){if(Qf){var r=Mo;if(r!==null)throw r}}function ic(r,l,u,d){Qf=!1;var p=r.updateQueue;Un=!1;var T=p.firstBaseUpdate,F=p.lastBaseUpdate,H=p.shared.pending;if(H!==null){p.shared.pending=null;var ie=H,ye=ie.next;ie.next=null,F===null?T=ye:F.next=ye,F=ie;var Se=r.alternate;Se!==null&&(Se=Se.updateQueue,H=Se.lastBaseUpdate,H!==F&&(H===null?Se.firstBaseUpdate=ye:H.next=ye,Se.lastBaseUpdate=ie))}if(T!==null){var De=p.baseState;F=0,Se=ye=ie=null,H=T;do{var Te=H.lane&-536870913,Ee=Te!==H.lane;if(Ee?(It&Te)===Te:(d&Te)===Te){Te!==0&&Te===So&&(Qf=!0),Se!==null&&(Se=Se.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var tt=r,ft=H;Te=l;var ai=u;switch(ft.tag){case 1:if(tt=ft.payload,typeof tt=="function"){De=tt.call(ai,De,Te);break e}De=tt;break e;case 3:tt.flags=tt.flags&-65537|128;case 0:if(tt=ft.payload,Te=typeof tt=="function"?tt.call(ai,De,Te):tt,Te==null)break e;De=m({},De,Te);break e;case 2:Un=!0}}Te=H.callback,Te!==null&&(r.flags|=64,Ee&&(r.flags|=8192),Ee=p.callbacks,Ee===null?p.callbacks=[Te]:Ee.push(Te))}else Ee={lane:Te,tag:H.tag,payload:H.payload,callback:H.callback,next:null},Se===null?(ye=Se=Ee,ie=De):Se=Se.next=Ee,F|=Te;if(H=H.next,H===null){if(H=p.shared.pending,H===null)break;Ee=H,H=Ee.next,Ee.next=null,p.lastBaseUpdate=Ee,p.shared.pending=null}}while(!0);Se===null&&(ie=De),p.baseState=ie,p.firstBaseUpdate=ye,p.lastBaseUpdate=Se,T===null&&(p.shared.lanes=0),Xn|=F,r.lanes=F,r.memoizedState=De}}function eg(r,l){if(typeof r!="function")throw Error(i(191,r));r.call(l)}function tg(r,l){var u=r.callbacks;
vendor: 6,058 bytes, line 49
49if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)eg(u[r],l)}var Io=w(null),eu=w(0);function ig(r,l){r=hn,z(eu,r),z(Io,l),hn=r|l.baseLanes}function $f(){z(eu,hn),z(Io,Io.current)}function Jf(){hn=eu.current,B(Io),B(eu)}var Ns=w(null),sr=null;function Vn(r){var l=r.alternate;z(wi,wi.current&1),z(Ns,r),sr===null&&(l===null||Io.current!==null||l.memoizedState!==null)&&(sr=r)}function ed(r){z(wi,wi.current),z(Ns,r),sr===null&&(sr=r)}function sg(r){r.tag===22?(z(wi,wi.current),z(Ns,r),sr===null&&(sr=r)):Hn()}function Hn(){z(wi,wi.current),z(Ns,Ns.current)}function Us(r){B(Ns),sr===r&&(sr=null),B(wi)}var wi=w(0);function tu(r){for(var l=r;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||a_(u)||o_(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var tn=0,Tt=null,ri=null,Ui=null,iu=!1,Po=!1,Oa=!1,su=0,sc=0,Oo=null,lE=0;function Di(){throw Error(i(321))}function td(r,l){if(l===null)return!1;for(var u=0;u<l.length&&u<r.length;u++)if(!cs(r[u],l[u]))return!1;return!0}function id(r,l,u,d,p,T){return tn=T,Tt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Y.H=r===null||r.memoizedState===null?zg:pd,Oa=!1,T=u(d,p),Oa=!1,Po&&(T=ng(l,u,d,p)),rg(r),T}function rg(r){Y.H=ac;var l=ri!==null&&ri.next!==null;if(tn=0,Ui=ri=Tt=null,iu=!1,sc=0,Oo=null,l)throw Error(i(300));r===null||zi||(r=r.dependencies,r!==null&&Yh(r)&&(zi=!0))}function ng(r,l,u,d){Tt=r;var p=0;do{if(Po&&(Oo=null),sc=0,Po=!1,25<=p)throw Error(i(301));if(p+=1,Ui=ri=null,r.updateQueue!=null){var T=r.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}Y.H=Gg,T=l(u,d)}while(Po);return T}function cE(){var r=Y.H,l=r.useState()[0];return l=typeof l.then=="function"?rc(l):l,r=r.useState()[0],(ri!==null?ri.memoizedState:null)!==r&&(Tt.flags|=1024),l}function sd(){var r=su!==0;return su=0,r}function rd(r,l,u){l.updateQueue=r.updateQueue,l.flags&=-2053,r.lanes&=~u}function nd(r){if(iu){for(r=r.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}iu=!1}tn=0,Ui=ri=Tt=null,Po=!1,sc=su=0,Oo=null}function xs(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ui===null?Tt.memoizedState=Ui=r:Ui=Ui.next=r,Ui}function Fi(){if(ri===null){var r=Tt.alternate;r=r!==null?r.memoizedState:null}else r=ri.next;var l=Ui===null?Tt.memoizedState:Ui.next;if(l!==null)Ui=l,ri=r;else{if(r===null)throw Tt.alternate===null?Error(i(467)):Error(i(310));ri=r,r={memoizedState:ri.memoizedState,baseState:ri.baseState,baseQueue:ri.baseQueue,queue:ri.queue,next:null},Ui===null?Tt.memoizedState=Ui=r:Ui=Ui.next=r}return Ui}function ru(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rc(r){var l=sc;return sc+=1,Oo===null&&(Oo=[]),r=Km(Oo,r,l),l=Tt,(Ui===null?l.memoizedState:Ui.next)===null&&(l=l.alternate,Y.H=l===null||l.memoizedState===null?zg:pd),r}function nu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return rc(r);if(r.$$typeof===C)return Ji(r)}throw Error(i(438,String(r)))}function ad(r){var l=null,u=Tt.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var d=Tt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(l={data:d.data.map(function(p){return p.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=ru(),Tt.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(r),d=0;d<r;d++)u[d]=X;return l.index++,u}function sn(r,l){return typeof l=="function"?l(r):l}function au(r){var l=Fi();return od(l,ri,r)}function od(r,l,u){var d=r.queue;if(d===null)throw Error(i(311));d.lastRenderedReducer=u;var p=r.baseQueue,T=d.pending;if(T!==null){if(p!==null){var F=p.next;p.next=T.next,T.next=F}l.baseQueue=p=T,d.pending=null}if(T=r.baseState,p===null)r.memoizedState=T;else{l=p.next;var H=F=null,ie=null,ye=l,Se=!1;do{var De=ye.lane&-536870913;if(De!==ye.lane?(It&De)===De:(tn&De)===De){var Te=ye.revertLane;if(Te===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),De===So&&(Se=!0);else if((tn&Te)===Te){ye=ye.next,Te===So&&(Se=!0);continue}else De={lane:0,revertLane:ye.revertLane,gesture:null,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null},ie===null?(H=ie=De,F=T):ie=ie.next=De,Tt.lanes|=Te,Xn|=Te;De=ye.action,Oa&&u(T,De),T=ye.hasEagerState?ye.eagerState:u(T,De)}else Te={lane:De,revertLane:ye.revertLane,gesture:ye.gesture,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null},ie===null?(H=ie=Te,F=T):ie=ie.next=Te,Tt.lanes|=De,Xn|=De;ye=ye.next}while(ye!==null&&ye!==l);if(ie===null?F=T:ie.next=H,!cs(T,r.memoizedState)&&(zi=!0,Se&&(u=Mo,u!==null)))throw u;r.memoizedState=T,r.baseState=F,r.baseQueue=ie,d.lastRenderedState=T}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function ld(r){var l=Fi(),u=l.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=r;var d=u.dispatch,p=u.pending,T=l.memoizedState;if(p!==null){u.pending=null;var F=p=p.next;do T=r(T,F.action),F=F.next;while(F!==p);cs(T,l.memoizedState)||(zi=!0),l.memoizedState=T,l.baseQueue===null&&(l.baseState=T),u.lastRenderedState=T}return[T,d]}function ag(r,l,u){var d=Tt,p=Fi(),T=wt;if(T){if(u===void 0)throw Error(i(407));u=u()}else u=l();var F=!cs((ri||p).memoizedState,u);if(F&&(p.memoizedState=u,zi=!0),p=p.queue,ud(cg.bind(null,d,p,r),[r]),p.getSnapshot!==l||F||Ui!==null&&Ui.memoizedState.tag&1){if(d.flags|=2048,wo(9,{destroy:void 0},lg.bind(null,d,p,u,l),null),di===null)throw Error(i(349));T||(tn&127)!==0||og(d,l,u)}return u}function og(r,l,u){r.flags|=16384,r={getSnapshot:l,value:u}
vendor: 14,056 bytes, line 49
49,l=Tt.updateQueue,l===null?(l=ru(),Tt.updateQueue=l,l.stores=[r]):(u=l.stores,u===null?l.stores=[r]:u.push(r))}function lg(r,l,u,d){l.value=u,l.getSnapshot=d,hg(l)&&ug(r)}function cg(r,l,u){return u(function(){hg(l)&&ug(r)})}function hg(r){var l=r.getSnapshot;r=r.value;try{var u=l();return!cs(r,u)}catch{return!0}}function ug(r){var l=Ze(r,2);l!==null&&Cs(l,r,2)}function cd(r){var l=xs();if(typeof r=="function"){var u=r;if(r=u(),Oa){Si(!0);try{u()}finally{Si(!1)}}}return l.memoizedState=l.baseState=r,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:r},l}function fg(r,l,u,d){return r.baseState=u,od(r,ri,typeof d=="function"?d:sn)}function hE(r,l,u,d,p){if(cu(r))throw Error(i(485));if(r=l.action,r!==null){var T={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(F){T.listeners.push(F)}};Y.T!==null?u(!0):T.isTransition=!1,d(T),u=l.pending,u===null?(T.next=l.pending=T,dg(l,T)):(T.next=u.next,l.pending=u.next=T)}}function dg(r,l){var u=l.action,d=l.payload,p=r.state;if(l.isTransition){var T=Y.T,F={};Y.T=F;try{var H=u(p,d),ie=Y.S;ie!==null&&ie(F,H),_g(r,l,H)}catch(ye){hd(r,l,ye)}finally{T!==null&&F.types!==null&&(T.types=F.types),Y.T=T}}else try{T=u(p,d),_g(r,l,T)}catch(ye){hd(r,l,ye)}}function _g(r,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(d){mg(r,l,d)},function(d){return hd(r,l,d)}):mg(r,l,u)}function mg(r,l,u){l.status="fulfilled",l.value=u,gg(l),r.state=u,l=r.pending,l!==null&&(u=l.next,u===l?r.pending=null:(u=u.next,l.next=u,dg(r,u)))}function hd(r,l,u){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do l.status="rejected",l.reason=u,gg(l),l=l.next;while(l!==d)}r.action=null}function gg(r){r=r.listeners;for(var l=0;l<r.length;l++)(0,r[l])()}function pg(r,l){return l}function xg(r,l){if(wt){var u=di.formState;if(u!==null){e:{var d=Tt;if(wt){if(bi){t:{for(var p=bi,T=ir;p.nodeType!==8;){if(!T){p=null;break t}if(p=rr(p.nextSibling),p===null){p=null;break t}}T=p.data,p=T==="F!"||T==="F"?p:null}if(p){bi=rr(p.nextSibling),d=p.data==="F!";break e}}kn(d)}d=!1}d&&(l=u[0])}}return u=xs(),u.memoizedState=u.baseState=l,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pg,lastRenderedState:l},u.queue=d,u=kg.bind(null,Tt,d),d.dispatch=u,d=cd(!1),T=gd.bind(null,Tt,!1,d.queue),d=xs(),p={state:l,dispatch:null,action:r,pending:null},d.queue=p,u=hE.bind(null,Tt,p,T,u),p.dispatch=u,d.memoizedState=r,[l,u,!1]}function bg(r){var l=Fi();return yg(l,ri,r)}function yg(r,l,u){if(l=od(r,l,pg)[0],r=au(sn)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var d=rc(l)}catch(F){throw F===Co?Zh:F}else d=l;l=Fi();var p=l.queue,T=p.dispatch;return u!==l.memoizedState&&(Tt.flags|=2048,wo(9,{destroy:void 0},uE.bind(null,p,u),null)),[d,T,r]}function uE(r,l){r.action=l}function Tg(r){var l=Fi(),u=ri;if(u!==null)return yg(l,u,r);Fi(),l=l.memoizedState,u=Fi();var d=u.queue.dispatch;return u.memoizedState=r,[l,d,!1]}function wo(r,l,u,d){return r={tag:r,create:u,deps:d,inst:l,next:null},l=Tt.updateQueue,l===null&&(l=ru(),Tt.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=r.next=r:(d=u.next,u.next=r,r.next=d,l.lastEffect=r),r}function vg(){return Fi().memoizedState}function ou(r,l,u,d){var p=xs();Tt.flags|=r,p.memoizedState=wo(1|l,{destroy:void 0},u,d===void 0?null:d)}function lu(r,l,u,d){var p=Fi();d=d===void 0?null:d;var T=p.memoizedState.inst;ri!==null&&d!==null&&td(d,ri.memoizedState.deps)?p.memoizedState=wo(l,T,u,d):(Tt.flags|=r,p.memoizedState=wo(1|l,T,u,d))}function Eg(r,l){ou(8390656,8,r,l)}function ud(r,l){lu(2048,8,r,l)}function fE(r){Tt.flags|=4;var l=Tt.updateQueue;if(l===null)l=ru(),Tt.updateQueue=l,l.events=[r];else{var u=l.events;u===null?l.events=[r]:u.push(r)}}function Ag(r){var l=Fi().memoizedState;return fE({ref:l,nextImpl:r}),function(){if((Zt&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function Rg(r,l){return lu(4,2,r,l)}function Sg(r,l){return lu(4,4,r,l)}function Mg(r,l){if(typeof l=="function"){r=r();var u=l(r);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return r=r(),l.current=r,function(){l.current=null}}function Cg(r,l,u){u=u!=null?u.concat([r]):null,lu(4,4,Mg.bind(null,l,r),u)}function fd(){}function Dg(r,l){var u=Fi();l=l===void 0?null:l;var d=u.memoizedState;return l!==null&&td(l,d[1])?d[0]:(u.memoizedState=[r,l],r)}function Ig(r,l){var u=Fi();l=l===void 0?null:l;var d=u.memoizedState;if(l!==null&&td(l,d[1]))return d[0];if(d=r(),Oa){Si(!0);try{r()}finally{Si(!1)}}return u.memoizedState=[d,l],d}function dd(r,l,u){return u===void 0||(tn&1073741824)!==0&&(It&261930)===0?r.memoizedState=l:(r.memoizedState=u,r=Pp(),Tt.lanes|=r,Xn|=r,u)}function Pg(r,l,u,d){return cs(u,l)?u:Io.current!==null?(r=dd(r,u,d),cs(r,l)||(zi=!0),r):(tn&42)===0||(tn&1073741824)!==0&&(It&261930)===0?(zi=!0,r.memoizedState=u):(r=Pp(),Tt.lanes|=r,Xn|=r,l)}function Og(r,l,u,d,p){var T=Z.p;Z.p=T!==0&&8>T?T:8;var F=Y.T,H={};Y.T=H,gd(r,!1,l,u);try{var ie=p(),ye=Y.S;if(ye!==null&&ye(H,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Se=oE(ie,d);nc(r,l,Se,Vs(r))}else nc(r,l,d,Vs(r))}catch(De){nc(r,l,{then:function(){},status:"rejected",reason:De},Vs())}finally{Z.p=T,F!==null&&H.types!==null&&(F.types=H.types),Y.T=F}}function dE(){}function _d(r,l,u,d){if(r.tag!==5)throw Error(i(476));var p=wg(r).queue;Og(r,p,l,q,u===null?dE:function(){return Fg(r),u(d)})}function wg(r){var l=r.memoizedState;if(l!==null)return l;l={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:q},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sn,lastRenderedState:u},next:null},r.memoizedState=l,r=r.alternate,r!==null&&(r.memoizedState=l),l}function Fg(r){var l=wg(r);l.next===null&&(l=r.alternate.memoizedState),nc(r,l.next.queue,{},Vs())}function md(){return Ji(vc)}function Bg(){return Fi().memoizedState}function Lg(){return Fi().memoizedState}function _E(r){for(var l=r.return;l!==null;){switch(l.tag){case 24:case 3:var u=Vs();r=zn(u);var d=Gn(l,r,u);d!==null&&(Cs(d,l,u),ec(d,l,u)),l={cache:jf()},r.payload=l;return}l=l.return}}function mE(r,l,u){var d=Vs();u={lane:d,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},cu(r)?Ng(l,u):(u=hs(r,l,u,d),u!==null&&(Cs(u,r,d),Ug(u,l,d)))}function kg(r,l,u){var d=Vs();nc(r,l,u,d)}function nc(r,l,u,d){var p={lane:d,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(cu(r))Ng(l,p);else{var T=r.alternate;if(r.lanes===0&&(T===null||T.lanes===0)&&(T=l.lastRenderedReducer,T!==null))try{var F=l.lastRenderedState,H=T(F,u);if(p.hasEagerState=!0,p.eagerState=H,cs(H,F))return hr(r,l,p,0),di===null&&Zs(),!1}catch{}finally{}if(u=hs(r,l,p,d),u!==null)return Cs(u,r,d),Ug(u,l,d),!0}return!1}function gd(r,l,u,d){if(d={lane:2,revertLane:qd(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},cu(r)){if(l)throw Error(i(479))}else l=hs(r,u,d,2),l!==null&&Cs(l,r,2)}function cu(r){var l=r.alternate;return r===Tt||l!==null&&l===Tt}function Ng(r,l){Po=iu=!0;var u=r.pending;u===null?l.next=l:(l.next=u.next,u.next=l),r.pending=l}function Ug(r,l,u){if((u&4194048)!==0){var d=l.lanes;d&=r.pendingLanes,u|=d,l.lanes=u,Qt(r,u)}}var ac={readContext:Ji,use:nu,useCallback:Di,useContext:Di,useEffect:Di,useImperativeHandle:Di,useLayoutEffect:Di,useInsertionEffect:Di,useMemo:Di,useReducer:Di,useRef:Di,useState:Di,useDebugValue:Di,useDeferredValue:Di,useTransition:Di,useSyncExternalStore:Di,useId:Di,useHostTransitionStatus:Di,useFormState:Di,useActionState:Di,useOptimistic:Di,useMemoCache:Di,useCacheRefresh:Di};ac.useEffectEvent=Di;var zg={readContext:Ji,use:nu,useCallback:function(r,l){return xs().memoizedState=[r,l===void 0?null:l],r},useContext:Ji,useEffect:Eg,useImperativeHandle:function(r,l,u){u=u!=null?u.concat([r]):null,ou(4194308,4,Mg.bind(null,l,r),u)},useLayoutEffect:function(r,l){return ou(4194308,4,r,l)},useInsertionEffect:function(r,l){ou(4,2,r,l)},useMemo:function(r,l){var u=xs();l=l===void 0?null:l;var d=r();if(Oa){Si(!0);try{r()}finally{Si(!1)}}return u.memoizedState=[d,l],d},useReducer:function(r,l,u){var d=xs();if(u!==void 0){var p=u(l);if(Oa){Si(!0);try{u(l)}finally{Si(!1)}}}else p=l;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=mE.bind(null,Tt,r),[d.memoizedState,r]},useRef:function(r){var l=xs();return r={current:r},l.memoizedState=r},useState:function(r){r=cd(r);var l=r.queue,u=kg.bind(null,Tt,l);return l.dispatch=u,[r.memoizedState,u]},useDebugValue:fd,useDeferredValue:function(r,l){var u=xs();return dd(u,r,l)},useTransition:function(){var r=cd(!1);return r=Og.bind(null,Tt,r.queue,!0,!1),xs().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,l,u){var d=Tt,p=xs();if(wt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=l(),di===null)throw Error(i(349));(It&127)!==0||og(d,l,u)}p.memoizedState=u;var T={value:u,getSnapshot:l};return p.queue=T,Eg(cg.bind(null,d,T,r),[r]),d.flags|=2048,wo(9,{destroy:void 0},lg.bind(null,d,T,u,l),null),u},useId:function(){var r=xs(),l=di.identifierPrefix;if(wt){var u=Sr,d=Rr;u=(d&~(1<<32-Mi(d)-1)).toString(32)+u,l="_"+l+"R_"+u,u=su++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=lE++,l="_"+l+"r_"+u.toString(32)+"_";return r.memoizedState=l},useHostTransitionStatus:md,useFormState:xg,useActionState:xg,useOptimistic:function(r){var l=xs();l.memoizedState=l.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=gd.bind(null,Tt,!0,u),u.dispatch=l,[r,l]},useMemoCache:ad,useCacheRefresh:function(){return xs().memoizedState=_E.bind(null,Tt)},useEffectEvent:function(r){var l=xs(),u={impl:r};return l.memoizedState=u,function(){if((Zt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},pd={readContext:Ji,use:nu,useCallback:Dg,useContext:Ji,useEffect:ud,useImperativeHandle:Cg,useInsertionEffect:Rg,useLayoutEffect:Sg,useMemo:Ig,useReducer:au,useRef:vg,useState:function(){return au(sn)},useDebugValue:fd,useDeferredValue:function(r,l){var u=Fi();return Pg(u,ri.memoizedState,r,l)},useTransition:function(){var r=au(sn)[0],l=Fi().memoizedState;return[typeof r=="boolean"?r:rc(r),l]},useSyncExternalStore:ag,useId:Bg,useHostTransitionStatus:md,useFormState:bg,useActionState:bg,useOptimistic:function(r,l){var u=Fi();return fg(u,ri,r,l)},useMemoCache:ad,useCacheRefresh:Lg};pd.useEffectEvent=Ag;var Gg={readContext:Ji,use:nu,useCallback:Dg,useContext:Ji,useEffect:ud,useImperativeHandle:Cg,useInsertionEffect:Rg,useLayoutEffect:Sg,useMemo:Ig,useReducer:ld,useRef:vg,useState:function(){return ld(sn)},useDebugValue:fd,useDeferredValue:function(r,l){var u=Fi();return ri===null?dd(u,r,l):Pg(u,ri.memoizedState,r,l)},useTransition:function(){var r=ld(sn)[0],l=Fi().memoizedState;return[typeof r=="boolean"?r:rc(r),l]},useSyncExternalStore:ag,useId:Bg,useHostTransitionStatus:md,useFormState:Tg,useActionState:Tg,useOptimistic:function(r,l){var u=Fi();return ri!==null?fg(u,ri,r,l):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:ad,useCacheRefresh:Lg};Gg.useEffectEvent=Ag;function xd(r,l,u,d){l=r.memoizedState,u=u(d,l),u=u==null?l:m({},l,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var bd={enqueueSetState:function(r,l,u){r=r._reactInternals;var d=Vs(),p=zn(d);p.payload=l,u!=null&&(p.callback=u),l=Gn(r,p,d),l!==null&&(Cs(l,r,d),ec(l,r,d))},enqueueReplaceState:function(r,l,u){r=r._reactInternals;var d=Vs(),p=zn(d);p.tag=1,p.payload=l,u!=null&&(p.callback=u),l=Gn(r,p,d),l!==null&&(Cs(l,r,d),ec(l,r,d))},enqueueForceUpdate:function(r,l){r=r._reactInternals;var u=Vs(),d=zn(u);d.tag=2,l!=null&&(d.callback=l),l=Gn(r,d,u),l!==null&&(Cs(l,r,u),ec(l,r,u))}};function Vg(r,l,u,d,p,T,F){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,T,F):l.prototype&&l.prototype.isPureReactComponent?!wn(u,d)||!wn(p,T):!0}function Hg(r,l,u,d){r=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,d),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,d),l.state!==r&&bd.enqueueReplaceState(l,l.state,null)}function wa(r,l){var u=l;if("ref"in l){u={};for(var d in l)d!=="ref"&&(u[d]=l[d])}if(r=r.defaultProps){u===l&&(u=m({},u));for(var p in r)u[p]===void 0&&(u[p]=r[p])}return u}function jg(r){Et(r)}function Wg(r){console.error(r)}function Xg(r){Et(r)}function hu(r,l){try{var u=r.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(d){setTimeout(function(){throw d})}}function Yg(r,l,u){try{var d=r.onCaughtError;d(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function yd(r,l,u){return u=zn(u),u.tag=3,u.payload={element:null},u.callback=function(){hu(r,l)},u}function qg(r){return r=zn(r),r.tag=3,r}function Kg(r,l,u,d){var p=u.type.getDerivedStateFromError;if(typeof p=="function"){var T=d.value;r.payload=function(){return p(T)},r.callback=function(){Yg(l,u,d)}}var F=u.stateNode;F!==null&&typeof F.componentDidCatch=="function"&&(r.callback=function(){Yg(l,u,d),typeof p!="function"&&(Yn===null?Yn=new Set([this]):Yn.add(this));var H=d.stack;this.componentDidCatch(d.value,{componentStack:H!==null?H:""})})}function gE(r,l,u,d,p){if(u.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(l=u.alternate,l!==null&&Ro(l,u,p,!0),u=Ns.current,u!==null){switch(u.tag){case 31:case 13:return sr===null?vu():u.alternate===null&&Ii===0&&(Ii=3),u.flags&=-257,u.flags|=65536,u.lanes=p,d===Qh?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([d]):l.add(d),Wd(r,d,p)),!1;case 22:return u.flags|=65536,d===Qh?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([d])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([d]):u.add(d)),Wd(r,d,p)),!1}throw Error(i(435,u.tag))}return Wd(r,d,p),vu(),!1}
vendor: 13,910 bytes, line 49
49if(wt)return l=Ns.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=p,d!==Uf&&(r=Error(i(422),{cause:d}),Kl(Js(r,u)))):(d!==Uf&&(l=Error(i(423),{cause:d}),Kl(Js(l,u))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=Js(d,u),p=yd(r.stateNode,d,p),Zf(r,p),Ii!==4&&(Ii=2)),!1;var T=Error(i(520),{cause:d});if(T=Js(T,u),_c===null?_c=[T]:_c.push(T),Ii!==4&&(Ii=2),l===null)return!0;d=Js(d,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,r=p&-p,u.lanes|=r,r=yd(u.stateNode,d,r),Zf(u,r),!1;case 1:if(l=u.type,T=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Yn===null||!Yn.has(T))))return u.flags|=65536,p&=-p,u.lanes|=p,p=qg(p),Kg(p,r,u,d),Zf(u,p),!1}u=u.return}while(u!==null);return!1}var Td=Error(i(461)),zi=!1;function es(r,l,u,d){l.child=r===null?Jm(l,null,u,d):Pa(l,r.child,u,d)}function Zg(r,l,u,d,p){u=u.render;var T=l.ref;if("ref"in d){var F={};for(var H in d)H!=="ref"&&(F[H]=d[H])}else F=d;return Ma(l),d=id(r,l,u,F,T,p),H=sd(),r!==null&&!zi?(rd(r,l,p),rn(r,l,p)):(wt&&H&&kf(l),l.flags|=1,es(r,l,d,p),l.child)}function Qg(r,l,u,d,p){if(r===null){var T=u.type;return typeof T=="function"&&!yo(T)&&T.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=T,$g(r,l,T,d,p)):(r=To(u.type,null,d,l,l.mode,p),r.ref=l.ref,r.return=l,l.child=r)}if(T=r.child,!Dd(r,p)){var F=T.memoizedProps;if(u=u.compare,u=u!==null?u:wn,u(F,d)&&r.ref===l.ref)return rn(r,l,p)}return l.flags|=1,r=Qs(T,d),r.ref=l.ref,r.return=l,l.child=r}function $g(r,l,u,d,p){if(r!==null){var T=r.memoizedProps;if(wn(T,d)&&r.ref===l.ref)if(zi=!1,l.pendingProps=d=T,Dd(r,p))(r.flags&131072)!==0&&(zi=!0);else return l.lanes=r.lanes,rn(r,l,p)}return vd(r,l,u,d,p)}function Jg(r,l,u,d){var p=d.children,T=r!==null?r.memoizedState:null;if(r===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((l.flags&128)!==0){if(T=T!==null?T.baseLanes|u:u,r!==null){for(d=l.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~T}else d=0,l.child=null;return ep(r,l,T,u,d)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},r!==null&&Kh(l,T!==null?T.cachePool:null),T!==null?ig(l,T):$f(),sg(l);else return d=l.lanes=536870912,ep(r,l,T!==null?T.baseLanes|u:u,u,d)}else T!==null?(Kh(l,T.cachePool),ig(l,T),Hn(),l.memoizedState=null):(r!==null&&Kh(l,null),$f(),Hn());return es(r,l,p,u),l.child}function oc(r,l){return r!==null&&r.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function ep(r,l,u,d,p){var T=Xf();return T=T===null?null:{parent:Ni._currentValue,pool:T},l.memoizedState={baseLanes:u,cachePool:T},r!==null&&Kh(l,null),$f(),sg(l),r!==null&&Ro(r,l,d,!0),l.childLanes=p,null}function uu(r,l){return l=du({mode:l.mode,children:l.children},r.mode),l.ref=r.ref,r.child=l,l.return=r,l}function tp(r,l,u){return Pa(l,r.child,null,u),r=uu(l,l.pendingProps),r.flags|=2,Us(l),l.memoizedState=null,r}function pE(r,l,u){var d=l.pendingProps,p=(l.flags&128)!==0;if(l.flags&=-129,r===null){if(wt){if(d.mode==="hidden")return r=uu(l,d),l.lanes=536870912,oc(null,r);if(ed(l),(r=bi)?(r=dx(r,ir),r=r!==null&&r.data==="&"?r:null,r!==null&&(l.memoizedState={dehydrated:r,treeContext:Bn!==null?{id:Rr,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},u=Yl(r),u.return=l,l.child=u,$i=l,bi=null)):r=null,r===null)throw kn(l);return l.lanes=536870912,null}return uu(l,d)}var T=r.memoizedState;if(T!==null){var F=T.dehydrated;if(ed(l),p)if(l.flags&256)l.flags&=-257,l=tp(r,l,u);else if(l.memoizedState!==null)l.child=r.child,l.flags|=128,l=null;else throw Error(i(558));else if(zi||Ro(r,l,u,!1),p=(u&r.childLanes)!==0,zi||p){if(d=di,d!==null&&(F=as(d,u),F!==0&&F!==T.retryLane))throw T.retryLane=F,Ze(r,F),Cs(d,r,F),Td;vu(),l=tp(r,l,u)}else r=T.treeContext,bi=rr(F.nextSibling),$i=l,wt=!0,Ln=null,ir=!1,r!==null&&Gm(l,r),l=uu(l,d),l.flags|=4096;return l}return r=Qs(r.child,{mode:d.mode,children:d.children}),r.ref=l.ref,l.child=r,r.return=l,r}function fu(r,l){var u=l.ref;if(u===null)r!==null&&r.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(r===null||r.ref!==u)&&(l.flags|=4194816)}}function vd(r,l,u,d,p){return Ma(l),u=id(r,l,u,d,void 0,p),d=sd(),r!==null&&!zi?(rd(r,l,p),rn(r,l,p)):(wt&&d&&kf(l),l.flags|=1,es(r,l,u,p),l.child)}function ip(r,l,u,d,p,T){return Ma(l),l.updateQueue=null,u=ng(l,d,u,p),rg(r),d=sd(),r!==null&&!zi?(rd(r,l,T),rn(r,l,T)):(wt&&d&&kf(l),l.flags|=1,es(r,l,u,T),l.child)}function sp(r,l,u,d,p){if(Ma(l),l.stateNode===null){var T=Qi,F=u.contextType;typeof F=="object"&&F!==null&&(T=Ji(F)),T=new u(d,T),l.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=bd,l.stateNode=T,T._reactInternals=l,T=l.stateNode,T.props=d,T.state=l.memoizedState,T.refs={},qf(l),F=u.contextType,T.context=typeof F=="object"&&F!==null?Ji(F):Qi,T.state=l.memoizedState,F=u.getDerivedStateFromProps,typeof F=="function"&&(xd(l,u,F,d),T.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(F=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),F!==T.state&&bd.enqueueReplaceState(T,T.state,null),ic(l,d,T,p),tc(),T.state=l.memoizedState),typeof T.componentDidMount=="function"&&(l.flags|=4194308),d=!0}else if(r===null){T=l.stateNode;var H=l.memoizedProps,ie=wa(u,H);T.props=ie;var ye=T.context,Se=u.contextType;F=Qi,typeof Se=="object"&&Se!==null&&(F=Ji(Se));var De=u.getDerivedStateFromProps;Se=typeof De=="function"||typeof T.getSnapshotBeforeUpdate=="function",H=l.pendingProps!==H,Se||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(H||ye!==F)&&Hg(l,T,d,F),Un=!1;var Te=l.memoizedState;T.state=Te,ic(l,d,T,p),tc(),ye=l.memoizedState,H||Te!==ye||Un?(typeof De=="function"&&(xd(l,u,De,d),ye=l.memoizedState),(ie=Un||Vg(l,u,ie,d,Te,ye,F))?(Se||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(l.flags|=4194308)):(typeof T.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=d,l.memoizedState=ye),T.props=d,T.state=ye,T.context=F,d=ie):(typeof T.componentDidMount=="function"&&(l.flags|=4194308),d=!1)}else{T=l.stateNode,Kf(r,l),F=l.memoizedProps,Se=wa(u,F),T.props=Se,De=l.pendingProps,Te=T.context,ye=u.contextType,ie=Qi,typeof ye=="object"&&ye!==null&&(ie=Ji(ye)),H=u.getDerivedStateFromProps,(ye=typeof H=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(F!==De||Te!==ie)&&Hg(l,T,d,ie),Un=!1,Te=l.memoizedState,T.state=Te,ic(l,d,T,p),tc();var Ee=l.memoizedState;F!==De||Te!==Ee||Un||r!==null&&r.dependencies!==null&&Yh(r.dependencies)?(typeof H=="function"&&(xd(l,u,H,d),Ee=l.memoizedState),(Se=Un||Vg(l,u,Se,d,Te,Ee,ie)||r!==null&&r.dependencies!==null&&Yh(r.dependencies))?(ye||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(d,Ee,ie),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(d,Ee,ie)),typeof T.componentDidUpdate=="function"&&(l.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof T.componentDidUpdate!="function"||F===r.memoizedProps&&Te===r.memoizedState||(l.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&Te===r.memoizedState||(l.flags|=1024),l.memoizedProps=d,l.memoizedState=Ee),T.props=d,T.state=Ee,T.context=ie,d=Se):(typeof T.componentDidUpdate!="function"||F===r.memoizedProps&&Te===r.memoizedState||(l.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||F===r.memoizedProps&&Te===r.memoizedState||(l.flags|=1024),d=!1)}return T=d,fu(r,l),d=(l.flags&128)!==0,T||d?(T=l.stateNode,u=d&&typeof u.getDerivedStateFromError!="function"?null:T.render(),l.flags|=1,r!==null&&d?(l.child=Pa(l,r.child,null,p),l.child=Pa(l,null,u,p)):es(r,l,u,p),l.memoizedState=T.state,r=l.child):r=rn(r,l,p),r}function rp(r,l,u,d){return Ra(),l.flags|=256,es(r,l,u,d),l.child}var Ed={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ad(r){return{baseLanes:r,cachePool:Ym()}}function Rd(r,l,u){return r=r!==null?r.childLanes&~u:0,l&&(r|=Gs),r}function np(r,l,u){var d=l.pendingProps,p=!1,T=(l.flags&128)!==0,F;if((F=T)||(F=r!==null&&r.memoizedState===null?!1:(wi.current&2)!==0),F&&(p=!0,l.flags&=-129),F=(l.flags&32)!==0,l.flags&=-33,r===null){if(wt){if(p?Vn(l):Hn(),(r=bi)?(r=dx(r,ir),r=r!==null&&r.data!=="&"?r:null,r!==null&&(l.memoizedState={dehydrated:r,treeContext:Bn!==null?{id:Rr,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},u=Yl(r),u.return=l,l.child=u,$i=l,bi=null)):r=null,r===null)throw kn(l);return o_(r)?l.lanes=32:l.lanes=536870912,null}var H=d.children;return d=d.fallback,p?(Hn(),p=l.mode,H=du({mode:"hidden",children:H},p),d=$s(d,p,u,null),H.return=l,d.return=l,H.sibling=d,l.child=H,d=l.child,d.memoizedState=Ad(u),d.childLanes=Rd(r,F,u),l.memoizedState=Ed,oc(null,d)):(Vn(l),Sd(l,H))}var ie=r.memoizedState;if(ie!==null&&(H=ie.dehydrated,H!==null)){if(T)l.flags&256?(Vn(l),l.flags&=-257,l=Md(r,l,u)):l.memoizedState!==null?(Hn(),l.child=r.child,l.flags|=128,l=null):(Hn(),H=d.fallback,p=l.mode,d=du({mode:"visible",children:d.children},p),H=$s(H,p,u,null),H.flags|=2,d.return=l,H.return=l,d.sibling=H,l.child=d,Pa(l,r.child,null,u),d=l.child,d.memoizedState=Ad(u),d.childLanes=Rd(r,F,u),l.memoizedState=Ed,l=oc(null,d));else if(Vn(l),o_(H)){if(F=H.nextSibling&&H.nextSibling.dataset,F)var ye=F.dgst;F=ye,d=Error(i(419)),d.stack="",d.digest=F,Kl({value:d,source:null,stack:null}),l=Md(r,l,u)}else if(zi||Ro(r,l,u,!1),F=(u&r.childLanes)!==0,zi||F){if(F=di,F!==null&&(d=as(F,u),d!==0&&d!==ie.retryLane))throw ie.retryLane=d,Ze(r,d),Cs(F,r,d),Td;a_(H)||vu(),l=Md(r,l,u)}else a_(H)?(l.flags|=192,l.child=r.child,l=null):(r=ie.treeContext,bi=rr(H.nextSibling),$i=l,wt=!0,Ln=null,ir=!1,r!==null&&Gm(l,r),l=Sd(l,d.children),l.flags|=4096);return l}return p?(Hn(),H=d.fallback,p=l.mode,ie=r.child,ye=ie.sibling,d=Qs(ie,{mode:"hidden",children:d.children}),d.subtreeFlags=ie.subtreeFlags&65011712,ye!==null?H=Qs(ye,H):(H=$s(H,p,u,null),H.flags|=2),H.return=l,d.return=l,d.sibling=H,l.child=d,oc(null,d),d=l.child,H=r.child.memoizedState,H===null?H=Ad(u):(p=H.cachePool,p!==null?(ie=Ni._currentValue,p=p.parent!==ie?{parent:ie,pool:ie}:p):p=Ym(),H={baseLanes:H.baseLanes|u,cachePool:p}),d.memoizedState=H,d.childLanes=Rd(r,F,u),l.memoizedState=Ed,oc(r.child,d)):(Vn(l),u=r.child,r=u.sibling,u=Qs(u,{mode:"visible",children:d.children}),u.return=l,u.sibling=null,r!==null&&(F=l.deletions,F===null?(l.deletions=[r],l.flags|=16):F.push(r)),l.child=u,l.memoizedState=null,u)}function Sd(r,l){return l=du({mode:"visible",children:l},r.mode),l.return=r,r.child=l}function du(r,l){return r=Yi(22,r,null,l),r.lanes=0,r}function Md(r,l,u){return Pa(l,r.child,null,u),r=Sd(l,l.pendingProps.children),r.flags|=2,l.memoizedState=null,r}function ap(r,l,u){r.lanes|=l;var d=r.alternate;d!==null&&(d.lanes|=l),Vf(r.return,l,u)}function Cd(r,l,u,d,p,T){var F=r.memoizedState;F===null?r.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:d,tail:u,tailMode:p,treeForkCount:T}:(F.isBackwards=l,F.rendering=null,F.renderingStartTime=0,F.last=d,F.tail=u,F.tailMode=p,F.treeForkCount=T)}function op(r,l,u){var d=l.pendingProps,p=d.revealOrder,T=d.tail;d=d.children;var F=wi.current,H=(F&2)!==0;if(H?(F=F&1|2,l.flags|=128):F&=1,z(wi,F),es(r,l,d,u),d=wt?ql:0,!H&&r!==null&&(r.flags&128)!==0)e:for(r=l.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&ap(r,u,l);else if(r.tag===19)ap(r,u,l);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break e;for(;r.sibling===null;){if(r.return===null||r.return===l)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(u=l.child,p=null;u!==null;)r=u.alternate,r!==null&&tu(r)===null&&(p=u),u=u.sibling;u=p,u===null?(p=l.child,l.child=null):(p=u.sibling,u.sibling=null),Cd(l,!1,p,u,T,d);break;case"backwards":case"unstable_legacy-backwards":for(u=null,p=l.child,l.child=null;p!==null;){if(r=p.alternate,r!==null&&tu(r)===null){l.child=p;break}r=p.sibling,p.sibling=u,u=p,p=r}Cd(l,!0,u,null,T,d);break;case"together":Cd(l,!1,null,null,void 0,d);break;default:l.memoizedState=null}return l.child}function rn(r,l,u){if(r!==null&&(l.dependencies=r.dependencies),Xn|=l.lanes,(u&l.childLanes)===0)if(r!==null){if(Ro(r,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(r!==null&&l.child!==r.child)throw Error(i(153));if(l.child!==null){for(r=l.child,u=Qs(r,r.pendingProps),l.child=u,u.return=l;r.sibling!==null;)r=r.sibling,u=u.sibling=Qs(r,r.pendingProps),u.return=l;u.sibling=null}return l.child}function Dd(r,l){return(r.lanes&l)!==0?!0:(r=r.dependencies,!!(r!==null&&Yh(r)))}function xE(r,l,u){switch(l.tag){case 3:Le(l,l.stateNode.containerInfo),Nn(l,Ni,r.memoizedState.cache),Ra();break;case 27:case 5:J(l);break;case 4:Le(l,l.stateNode.containerInfo);break;case 10:Nn(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,ed(l),null;break;case 13:var d=l.memoizedState;if(d!==null)return d.dehydrated!==null?(Vn(l),l.flags|=128,null):(u&l.child.childLanes)!==0?np(r,l,u):(Vn(l),r=rn(r,l,u),r!==null?r.sibling:null);Vn(l);break;case 19:var p=(r.flags&128)!==0;if(d=(u&l.childLanes)!==0,d||(Ro(r,l,u,!1),d=(u&l.childLanes)!==0),p){
vendor: 3,241 bytes, line 49
49if(d)return op(r,l,u);l.flags|=128}if(p=l.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),z(wi,wi.current),d)break;return null;case 22:return l.lanes=0,Jg(r,l,u,l.pendingProps);case 24:Nn(l,Ni,r.memoizedState.cache)}return rn(r,l,u)}function lp(r,l,u){if(r!==null)if(r.memoizedProps!==l.pendingProps)zi=!0;else{if(!Dd(r,u)&&(l.flags&128)===0)return zi=!1,xE(r,l,u);zi=(r.flags&131072)!==0}else zi=!1,wt&&(l.flags&1048576)!==0&&zm(l,ql,l.index);switch(l.lanes=0,l.tag){case 16:e:{var d=l.pendingProps;if(r=Da(l.elementType),l.type=r,typeof r=="function")yo(r)?(d=wa(r,d),l.tag=1,l=sp(null,l,r,d,u)):(l.tag=0,l=vd(null,l,r,d,u));else{if(r!=null){var p=r.$$typeof;if(p===O){l.tag=11,l=Zg(null,l,r,d,u);break e}else if(p===P){l.tag=14,l=Qg(null,l,r,d,u);break e}}throw l=U(r)||r,Error(i(306,l,""))}}return l;case 0:return vd(r,l,l.type,l.pendingProps,u);case 1:return d=l.type,p=wa(d,l.pendingProps),sp(r,l,d,p,u);case 3:e:{if(Le(l,l.stateNode.containerInfo),r===null)throw Error(i(387));d=l.pendingProps;var T=l.memoizedState;p=T.element,Kf(r,l),ic(l,d,null,u);var F=l.memoizedState;if(d=F.cache,Nn(l,Ni,d),d!==T.cache&&Hf(l,[Ni],u,!0),tc(),d=F.element,T.isDehydrated)if(T={element:d,isDehydrated:!1,cache:F.cache},l.updateQueue.baseState=T,l.memoizedState=T,l.flags&256){l=rp(r,l,d,u);break e}else if(d!==p){p=Js(Error(i(424)),l),Kl(p),l=rp(r,l,d,u);break e}else{switch(r=l.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(bi=rr(r.firstChild),$i=l,wt=!0,Ln=null,ir=!0,u=Jm(l,null,d,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ra(),d===p){l=rn(r,l,u);break e}es(r,l,d,u)}l=l.child}return l;case 26:return fu(r,l),r===null?(u=bx(l.type,null,l.pendingProps,null))?l.memoizedState=u:wt||(u=l.type,r=l.pendingProps,d=Du(he.current).createElement(u),d[Li]=l,d[Ki]=r,ts(d,u,r),Oi(d),l.stateNode=d):l.memoizedState=bx(l.type,r.memoizedProps,l.pendingProps,r.memoizedState),null;case 27:return J(l),r===null&&wt&&(d=l.stateNode=gx(l.type,l.pendingProps,he.current),$i=l,ir=!0,p=bi,Qn(l.type)?(l_=p,bi=rr(d.firstChild)):bi=p),es(r,l,l.pendingProps.children,u),fu(r,l),r===null&&(l.flags|=4194304),l.child;case 5:return r===null&&wt&&((p=d=bi)&&(d=qE(d,l.type,l.pendingProps,ir),d!==null?(l.stateNode=d,$i=l,bi=rr(d.firstChild),ir=!1,p=!0):p=!1),p||kn(l)),J(l),p=l.type,T=l.pendingProps,F=r!==null?r.memoizedProps:null,d=T.children,s_(p,T)?d=null:F!==null&&s_(p,F)&&(l.flags|=32),l.memoizedState!==null&&(p=id(r,l,cE,null,null,u),vc._currentValue=p),fu(r,l),es(r,l,d,u),l.child;case 6:return r===null&&wt&&((r=u=bi)&&(u=KE(u,l.pendingProps,ir),u!==null?(l.stateNode=u,$i=l,bi=null,r=!0):r=!1),r||kn(l)),null;case 13:return np(r,l,u);case 4:return Le(l,l.stateNode.containerInfo),d=l.pendingProps,r===null?l.child=Pa(l,null,d,u):es(r,l,d,u),l.child;case 11:return Zg(r,l,l.type,l.pendingProps,u);case 7:return es(r,l,l.pendingProps,u),l.child;case 8:return es(r,l,l.pendingProps.children,u),l.child;case 12:return es(r,l,l.pendingProps.children,u),l.child;case 10:return d=l.pendingProps,Nn(l,l.type,d.value),es(r,l,d.children,u),l.child;case 9:return p=l.type._context,d=l.pendingProps.children,Ma(l),p=Ji(p),d=d(p),l.flags|=1,es(r,l,d,u),l.child;
vendor: 4,422 bytes, line 49
49case 14:return Qg(r,l,l.type,l.pendingProps,u);case 15:return $g(r,l,l.type,l.pendingProps,u);case 19:return op(r,l,u);case 31:return pE(r,l,u);case 22:return Jg(r,l,u,l.pendingProps);case 24:return Ma(l),d=Ji(Ni),r===null?(p=Xf(),p===null&&(p=di,T=jf(),p.pooledCache=T,T.refCount++,T!==null&&(p.pooledCacheLanes|=u),p=T),l.memoizedState={parent:d,cache:p},qf(l),Nn(l,Ni,p)):((r.lanes&u)!==0&&(Kf(r,l),ic(l,null,null,u),tc()),p=r.memoizedState,T=l.memoizedState,p.parent!==d?(p={parent:d,cache:d},l.memoizedState=p,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=p),Nn(l,Ni,d)):(d=T.cache,Nn(l,Ni,d),d!==p.cache&&Hf(l,[Ni],u,!0))),es(r,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function nn(r){r.flags|=4}function Id(r,l,u,d,p){if((l=(r.mode&32)!==0)&&(l=!1),l){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Bp())r.flags|=8192;else throw Ia=Qh,Yf}else r.flags&=-16777217}function cp(r,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Ax(l))if(Bp())r.flags|=8192;else throw Ia=Qh,Yf}function _u(r,l){l!==null&&(r.flags|=4),r.flags&16384&&(l=r.tag!==22?Re():536870912,r.lanes|=l,ko|=l)}function lc(r,l){if(!wt)switch(r.tailMode){case"hidden":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?l||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function yi(r){var l=r.alternate!==null&&r.alternate.child===r.child,u=0,d=0;if(l)for(var p=r.child;p!==null;)u|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)u|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=u,l}function bE(r,l,u){var d=l.pendingProps;switch(Nf(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yi(l),null;case 1:return yi(l),null;case 3:return u=l.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),en(Ni),ke(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Ao(l)?nn(l):r===null||r.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,zf())),yi(l),null;case 26:var p=l.type,T=l.memoizedState;return r===null?(nn(l),T!==null?(yi(l),cp(l,T)):(yi(l),Id(l,p,null,d,u))):T?T!==r.memoizedState?(nn(l),yi(l),cp(l,T)):(yi(l),l.flags&=-16777217):(r=r.memoizedProps,r!==d&&nn(l),yi(l),Id(l,p,r,d,u)),null;case 27:if(_e(l),u=he.current,p=l.type,r!==null&&l.stateNode!=null)r.memoizedProps!==d&&nn(l);else{if(!d){if(l.stateNode===null)throw Error(i(166));return yi(l),null}r=K.current,Ao(l)?Vm(l):(r=gx(p,d,u),l.stateNode=r,nn(l))}return yi(l),null;case 5:if(_e(l),p=l.type,r!==null&&l.stateNode!=null)r.memoizedProps!==d&&nn(l);else{if(!d){if(l.stateNode===null)throw Error(i(166));return yi(l),null}if(T=K.current,Ao(l))Vm(l);else{var F=Du(he.current);switch(T){case 1:T=F.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:T=F.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":T=F.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":T=F.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":T=F.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof d.is=="string"?F.createElement("select",{is:d.is}):F.createElement("select"),d.multiple?T.multiple=!0:d.size&&(T.size=d.size);break;default:T=typeof d.is=="string"?F.createElement(p,{is:d.is}):F.createElement(p)}}T[Li]=l,T[Ki]=d;e:for(F=l.child;F!==null;){if(F.tag===5||F.tag===6)T.appendChild(F.stateNode);else if(F.tag!==4&&F.tag!==27&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===l)break e;for(;F.sibling===null;){if(F.return===null||F.return===l)break e;F=F.return}F.sibling.return=F.return,F=F.sibling}l.stateNode=T;e:switch(ts(T,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&nn(l)}}return yi(l),Id(l,l.type,r===null?null:r.memoizedProps,l.pendingProps,u),null;case 6:if(r&&l.stateNode!=null)r.memoizedProps!==d&&nn(l);else{if(typeof d!="string"&&l.stateNode===null)throw Error(i(166));
vendor: 24,176 bytes, line 49
49if(r=he.current,Ao(l)){if(r=l.stateNode,u=l.memoizedProps,d=null,p=$i,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[Li]=l,r=!!(r.nodeValue===u||d!==null&&d.suppressHydrationWarning===!0||nx(r.nodeValue,u)),r||kn(l,!0)}else r=Du(r).createTextNode(d),r[Li]=l,l.stateNode=r}return yi(l),null;case 31:if(u=l.memoizedState,r===null||r.memoizedState!==null){if(d=Ao(l),u!==null){if(r===null){if(!d)throw Error(i(318));if(r=l.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[Li]=l}else Ra(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;yi(l),r=!1}else u=zf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return l.flags&256?(Us(l),l):(Us(l),null);if((l.flags&128)!==0)throw Error(i(558))}return yi(l),null;case 13:if(d=l.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Ao(l),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(i(318));if(p=l.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[Li]=l}else Ra(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;yi(l),p=!1}else p=zf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return l.flags&256?(Us(l),l):(Us(l),null)}return Us(l),(l.flags&128)!==0?(l.lanes=u,l):(u=d!==null,r=r!==null&&r.memoizedState!==null,u&&(d=l.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),T=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(T=d.memoizedState.cachePool.pool),T!==p&&(d.flags|=2048)),u!==r&&u&&(l.child.flags|=8192),_u(l,l.updateQueue),yi(l),null);case 4:return ke(),r===null&&$d(l.stateNode.containerInfo),yi(l),null;case 10:return en(l.type),yi(l),null;case 19:if(B(wi),d=l.memoizedState,d===null)return yi(l),null;if(p=(l.flags&128)!==0,T=d.rendering,T===null)if(p)lc(d,!1);else{if(Ii!==0||r!==null&&(r.flags&128)!==0)for(r=l.child;r!==null;){if(T=tu(r),T!==null){for(l.flags|=128,lc(d,!1),r=T.updateQueue,l.updateQueue=r,_u(l,r),l.subtreeFlags=0,r=u,u=l.child;u!==null;)Hh(u,r),u=u.sibling;return z(wi,wi.current&1|2),wt&&$r(l,d.treeForkCount),l.child}r=r.sibling}d.tail!==null&&we()>bu&&(l.flags|=128,p=!0,lc(d,!1),l.lanes=4194304)}else{if(!p)if(r=tu(T),r!==null){if(l.flags|=128,p=!0,r=r.updateQueue,l.updateQueue=r,_u(l,r),lc(d,!0),d.tail===null&&d.tailMode==="hidden"&&!T.alternate&&!wt)return yi(l),null}else 2*we()-d.renderingStartTime>bu&&u!==536870912&&(l.flags|=128,p=!0,lc(d,!1),l.lanes=4194304);d.isBackwards?(T.sibling=l.child,l.child=T):(r=d.last,r!==null?r.sibling=T:l.child=T,d.last=T)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=we(),r.sibling=null,u=wi.current,z(wi,p?u&1|2:u&1),wt&&$r(l,d.treeForkCount),r):(yi(l),null);case 22:case 23:return Us(l),Jf(),d=l.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(l.flags|=8192):d&&(l.flags|=8192),d?(u&536870912)!==0&&(l.flags&128)===0&&(yi(l),l.subtreeFlags&6&&(l.flags|=8192)):yi(l),u=l.updateQueue,u!==null&&_u(l,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==u&&(l.flags|=2048),r!==null&&B(Ca),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),en(Ni),yi(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function yE(r,l){switch(Nf(l),l.tag){case 1:return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 3:return en(Ni),ke(),r=l.flags,(r&65536)!==0&&(r&128)===0?(l.flags=r&-65537|128,l):null;case 26:case 27:case 5:return _e(l),null;case 31:if(l.memoizedState!==null){if(Us(l),l.alternate===null)throw Error(i(340));Ra()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 13:if(Us(l),r=l.memoizedState,r!==null&&r.dehydrated!==null){if(l.alternate===null)throw Error(i(340));Ra()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 19:return B(wi),null;case 4:return ke(),null;case 10:return en(l.type),null;case 22:case 23:return Us(l),Jf(),r!==null&&B(Ca),r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 24:return en(Ni),null;case 25:return null;default:return null}}function hp(r,l){switch(Nf(l),l.tag){case 3:en(Ni),ke();break;case 26:case 27:case 5:_e(l);break;case 4:ke();break;case 31:l.memoizedState!==null&&Us(l);break;case 13:Us(l);break;case 19:B(wi);break;case 10:en(l.type);break;case 22:case 23:Us(l),Jf(),r!==null&&B(Ca);break;case 24:en(Ni)}}function cc(r,l){try{var u=l.updateQueue,d=u!==null?u.lastEffect:null;if(d!==null){var p=d.next;u=p;do{if((u.tag&r)===r){d=void 0;var T=u.create,F=u.inst;d=T(),F.destroy=d}u=u.next}while(u!==p)}}catch(H){Jt(l,l.return,H)}}function jn(r,l,u){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var T=p.next;d=T;do{if((d.tag&r)===r){var F=d.inst,H=F.destroy;if(H!==void 0){F.destroy=void 0,p=l;var ie=u,ye=H;try{ye()}catch(Se){Jt(p,ie,Se)}}}d=d.next}while(d!==T)}}catch(Se){Jt(l,l.return,Se)}}function up(r){var l=r.updateQueue;if(l!==null){var u=r.stateNode;try{tg(l,u)}catch(d){Jt(r,r.return,d)}}}function fp(r,l,u){u.props=wa(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(d){Jt(r,l,d)}}function hc(r,l){try{var u=r.ref;if(u!==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 u=="function"?r.refCleanup=u(d):u.current=d}}catch(p){Jt(r,l,p)}}function Mr(r,l){var u=r.ref,d=r.refCleanup;if(u!==null)if(typeof d=="function")try{d()}catch(p){Jt(r,l,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(p){Jt(r,l,p)}else u.current=null}function dp(r){var l=r.type,u=r.memoizedProps,d=r.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&d.focus();break e;case"img":u.src?d.src=u.src:u.srcSet&&(d.srcset=u.srcSet)}}catch(p){Jt(r,r.return,p)}}function Pd(r,l,u){try{var d=r.stateNode;VE(d,r.type,u,l),d[Ki]=l}catch(p){Jt(r,r.return,p)}}function _p(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Qn(r.type)||r.tag===4}function Od(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||_p(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&&Qn(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 wd(r,l,u){var d=r.tag;if(d===5||d===6)r=r.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(r),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=qs));else if(d!==4&&(d===27&&Qn(r.type)&&(u=r.stateNode,l=null),r=r.child,r!==null))for(wd(r,l,u),r=r.sibling;r!==null;)wd(r,l,u),r=r.sibling}function mu(r,l,u){var d=r.tag;if(d===5||d===6)r=r.stateNode,l?u.insertBefore(r,l):u.appendChild(r);else if(d!==4&&(d===27&&Qn(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(mu(r,l,u),r=r.sibling;r!==null;)mu(r,l,u),r=r.sibling}function mp(r){var l=r.stateNode,u=r.memoizedProps;try{for(var d=r.type,p=l.attributes;p.length;)l.removeAttributeNode(p[0]);ts(l,d,u),l[Li]=r,l[Ki]=u}catch(T){Jt(r,r.return,T)}}var an=!1,Gi=!1,Fd=!1,gp=typeof WeakSet=="function"?WeakSet:Set,qi=null;function TE(r,l){if(r=r.containerInfo,t_=Lu,r=Gl(r),go(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var d=u.getSelection&&u.getSelection();if(d&&d.rangeCount!==0){u=d.anchorNode;var p=d.anchorOffset,T=d.focusNode;d=d.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var F=0,H=-1,ie=-1,ye=0,Se=0,De=r,Te=null;t:for(;;){for(var Ee;De!==u||p!==0&&De.nodeType!==3||(H=F+p),De!==T||d!==0&&De.nodeType!==3||(ie=F+d),De.nodeType===3&&(F+=De.nodeValue.length),(Ee=De.firstChild)!==null;)Te=De,De=Ee;for(;;){if(De===r)break t;if(Te===u&&++ye===p&&(H=F),Te===T&&++Se===d&&(ie=F),(Ee=De.nextSibling)!==null)break;De=Te,Te=De.parentNode}De=Ee}u=H===-1||ie===-1?null:{start:H,end:ie}}else u=null}u=u||{start:0,end:0}}else u=null;for(i_={focusedElem:r,selectionRange:u},Lu=!1,qi=l;qi!==null;)if(l=qi,r=l.child,(l.subtreeFlags&1028)!==0&&r!==null)r.return=l,qi=r;else for(;qi!==null;){switch(l=qi,T=l.alternate,r=l.flags,l.tag){case 0:if((r&4)!==0&&(r=l.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u<r.length;u++)p=r[u],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&T!==null){r=void 0,u=l,p=T.memoizedProps,T=T.memoizedState,d=u.stateNode;try{var tt=wa(u.type,p);r=d.getSnapshotBeforeUpdate(tt,T),d.__reactInternalSnapshotBeforeUpdate=r}catch(ft){Jt(u,u.return,ft)}}break;case 3:if((r&1024)!==0){if(r=l.stateNode.containerInfo,u=r.nodeType,u===9)n_(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":n_(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(i(163))}if(r=l.sibling,r!==null){r.return=l.return,qi=r;break}qi=l.return}}function pp(r,l,u){var d=u.flags;switch(u.tag){case 0:case 11:case 15:ln(r,u),d&4&&cc(5,u);break;case 1:if(ln(r,u),d&4)if(r=u.stateNode,l===null)try{r.componentDidMount()}catch(F){Jt(u,u.return,F)}else{var p=wa(u.type,l.memoizedProps);l=l.memoizedState;try{r.componentDidUpdate(p,l,r.__reactInternalSnapshotBeforeUpdate)}catch(F){Jt(u,u.return,F)}}d&64&&up(u),d&512&&hc(u,u.return);break;case 3:if(ln(r,u),d&64&&(r=u.updateQueue,r!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{tg(r,l)}catch(F){Jt(u,u.return,F)}}break;case 27:l===null&&d&4&&mp(u);case 26:case 5:ln(r,u),l===null&&d&4&&dp(u),d&512&&hc(u,u.return);break;case 12:ln(r,u);break;case 31:ln(r,u),d&4&&yp(r,u);break;case 13:ln(r,u),d&4&&Tp(r,u),d&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=IE.bind(null,u),ZE(r,u))));break;case 22:if(d=u.memoizedState!==null||an,!d){l=l!==null&&l.memoizedState!==null||Gi,p=an;var T=Gi;an=d,(Gi=l)&&!T?cn(r,u,(u.subtreeFlags&8772)!==0):ln(r,u),an=p,Gi=T}break;case 30:break;default:ln(r,u)}}function xp(r){var l=r.alternate;l!==null&&(r.alternate=null,xp(l)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(l=r.stateNode,l!==null&&$a(l)),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 vi=null,As=!1;function on(r,l,u){for(u=u.child;u!==null;)bp(r,l,u),u=u.sibling}function bp(r,l,u){if(si&&typeof si.onCommitFiberUnmount=="function")try{si.onCommitFiberUnmount(Wt,u)}catch{}switch(u.tag){case 26:Gi||Mr(u,l),on(r,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Gi||Mr(u,l);var d=vi,p=As;Qn(u.type)&&(vi=u.stateNode,As=!1),on(r,l,u),bc(u.stateNode),vi=d,As=p;break;case 5:Gi||Mr(u,l);case 6:if(d=vi,p=As,vi=null,on(r,l,u),vi=d,As=p,vi!==null)if(As)try{(vi.nodeType===9?vi.body:vi.nodeName==="HTML"?vi.ownerDocument.body:vi).removeChild(u.stateNode)}catch(T){Jt(u,l,T)}else try{vi.removeChild(u.stateNode)}catch(T){Jt(u,l,T)}break;case 18:vi!==null&&(As?(r=vi,ux(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),Wo(r)):ux(vi,u.stateNode));break;case 4:d=vi,p=As,vi=u.stateNode.containerInfo,As=!0,on(r,l,u),vi=d,As=p;break;case 0:case 11:case 14:case 15:jn(2,u,l),Gi||jn(4,u,l),on(r,l,u);break;case 1:Gi||(Mr(u,l),d=u.stateNode,typeof d.componentWillUnmount=="function"&&fp(u,l,d)),on(r,l,u);break;case 21:on(r,l,u);break;case 22:Gi=(d=Gi)||u.memoizedState!==null,on(r,l,u),Gi=d;break;default:on(r,l,u)}}function yp(r,l){if(l.memoizedState===null&&(r=l.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Wo(r)}catch(u){Jt(l,l.return,u)}}}function Tp(r,l){if(l.memoizedState===null&&(r=l.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Wo(r)}catch(u){Jt(l,l.return,u)}}function vE(r){switch(r.tag){case 31:case 13:case 19:var l=r.stateNode;return l===null&&(l=r.stateNode=new gp),l;case 22:return r=r.stateNode,l=r._retryCache,l===null&&(l=r._retryCache=new gp),l;default:throw Error(i(435,r.tag))}}function gu(r,l){var u=vE(r);l.forEach(function(d){if(!u.has(d)){u.add(d);var p=PE.bind(null,r,d);d.then(p,p)}})}function Rs(r,l){var u=l.deletions;if(u!==null)for(var d=0;d<u.length;d++){var p=u[d],T=r,F=l,H=F;e:for(;H!==null;){switch(H.tag){case 27:if(Qn(H.type)){vi=H.stateNode,As=!1;break e}break;case 5:vi=H.stateNode,As=!1;break e;case 3:case 4:vi=H.stateNode.containerInfo,As=!0;break e}H=H.return}if(vi===null)throw Error(i(160));bp(T,F,p),vi=null,As=!1,T=p.alternate,T!==null&&(T.return=null),p.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)vp(l,r),l=l.sibling}var fr=null;function vp(r,l){var u=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Rs(l,r),Ss(r),d&4&&(jn(3,r,r.return),cc(3,r),jn(5,r,r.return));break;case 1:Rs(l,r),Ss(r),d&512&&(Gi||u===null||Mr(u,u.return)),d&64&&an&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?d:u.concat(d))));break;case 26:var p=fr;if(Rs(l,r),Ss(r),d&512&&(Gi||u===null||Mr(u,u.return)),d&4){var T=u!==null?u.memoizedState:null;if(d=r.memoizedState,u===null)if(d===null)if(r.stateNode===null){e:{d=r.type,u=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":T=p.getElementsByTagName("title")[0],(!T||T[An]||T[Li]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=p.createElement(d),p.head.insertBefore(T,p.querySelector("head > title"))),ts(T,d,u),T[Li]=r,Oi(T),d=T;break e;case"link":var F=vx("link","href",p).get(d+(u.href||""));if(F){for(var H=0;H<F.length;H++)if(T=F[H],T.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&T.getAttribute("rel")===(u.rel==null?null:u.rel)&&T.getAttribute("title")===(u.title==null?null:u.title)&&T.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){F.splice(H,1);break t}}T=p.createElement(d),ts(T,d,u),p.head.appendChild(T);break;case"meta":if(F=vx("meta","content",p).get(d+(u.content||""))){for(H=0;H<F.length;H++)if(T=F[H],T.getAttribute("content")===(u.content==null?null:""+u.content)&&T.getAttribute("name")===(u.name==null?null:u.name)&&T.getAttribute("property")===(u.property==null?null:u.property)&&T.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&T.getAttribute("charset")===(u.charSet==null?null:u.charSet)){F.splice(H,1);break t}}T=p.createElement(d),ts(T,d,u),p.head.appendChild(T);break;default:throw Error(i(468,d))}T[Li]=r,Oi(T),d=T}r.stateNode=d}else Ex(p,r.type,r.stateNode);else r.stateNode=Tx(p,d,r.memoizedProps);else T!==d?(T===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):T.count--,d===null?Ex(p,r.type,r.stateNode):Tx(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&Pd(r,r.memoizedProps,u.memoizedProps)}break;case 27:Rs(l,r),Ss(r),d&512&&(Gi||u===null||Mr(u,u.return)),u!==null&&d&4&&Pd(r,r.memoizedProps,u.memoizedProps);break;case 5:if(Rs(l,r),Ss(r),d&512&&(Gi||u===null||Mr(u,u.return)),r.flags&32){p=r.stateNode;try{Wr(p,"")}catch(tt){Jt(r,r.return,tt)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,Pd(r,p,u!==null?u.memoizedProps:p)),d&1024&&(Fd=!0);break;case 6:if(Rs(l,r),Ss(r),d&4){if(r.stateNode===null)throw Error(i(162));d=r.memoizedProps,u=r.stateNode;try{u.nodeValue=d}catch(tt){Jt(r,r.return,tt)}}break;case 3:if(Ou=null,p=fr,fr=Iu(l.containerInfo),Rs(l,r),fr=p,Ss(r),d&4&&u!==null&&u.memoizedState.isDehydrated)try{Wo(l.containerInfo)}catch(tt){Jt(r,r.return,tt)}Fd&&(Fd=!1,Ep(r));break;case 4:d=fr,fr=Iu(r.stateNode.containerInfo),Rs(l,r),Ss(r),fr=d;break;case 12:Rs(l,r),Ss(r);break;case 31:Rs(l,r),Ss(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,gu(r,d)));break;case 13:Rs(l,r),Ss(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(xu=we()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,gu(r,d)));break;case 22:p=r.memoizedState!==null;var ie=u!==null&&u.memoizedState!==null,ye=an,Se=Gi;if(an=ye||p,Gi=Se||ie,Rs(l,r),Gi=Se,an=ye,Ss(r),d&8192)e:for(l=r.stateNode,l._visibility=p?l._visibility&-2:l._visibility|1,p&&(u===null||ie||an||Gi||Fa(r)),u=null,l=r;;){if(l.tag===5||l.tag===26){if(u===null){ie=u=l;try{if(T=ie.stateNode,p)F=T.style,typeof F.setProperty=="function"?F.setProperty("display","none","important"):F.display="none";else{H=ie.stateNode;var De=ie.memoizedProps.style,Te=De!=null&&De.hasOwnProperty("display")?De.display:null;H.style.display=Te==null||typeof Te=="boolean"?"":(""+Te).trim()}}catch(tt){Jt(ie,ie.return,tt)}}}else if(l.tag===6){if(u===null){ie=l;try{ie.stateNode.nodeValue=p?"":ie.memoizedProps}catch(tt){Jt(ie,ie.return,tt)}}}else if(l.tag===18){if(u===null){ie=l;try{var Ee=ie.stateNode;p?fx(Ee,!0):fx(ie.stateNode,!1)}catch(tt){Jt(ie,ie.return,tt)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===r)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break e;for(;l.sibling===null;){if(l.return===null||l.return===r)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}d&4&&(d=r.updateQueue,d!==null&&(u=d.retryQueue,u!==null&&(d.retryQueue=null,gu(r,u))));break;case 19:Rs(l,r),Ss(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,gu(r,d)));break;case 30:break;case 21:break;default:Rs(l,r),Ss(r)}}function Ss(r){var l=r.flags;if(l&2){try{for(var u,d=r.return;d!==null;){if(_p(d)){u=d;break}d=d.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var p=u.stateNode,T=Od(r);mu(r,T,p);break;case 5:var F=u.stateNode;u.flags&32&&(Wr(F,""),u.flags&=-33);var H=Od(r);mu(r,H,F);break;case 3:case 4:var ie=u.stateNode.containerInfo,ye=Od(r);wd(r,ye,ie);break;default:throw Error(i(161))}}catch(Se){Jt(r,r.return,Se)}r.flags&=-3}l&4096&&(r.flags&=-4097)}function Ep(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var l=r;Ep(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),r=r.sibling}}function ln(r,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)pp(r,l.alternate,l),l=l.sibling}function Fa(r){for(r=r.child;r!==null;){var l=r;switch(l.tag){case 0:case 11:case 14:case 15:jn(4,l,l.return),Fa(l);break;case 1:Mr(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&fp(l,l.return,u),Fa(l);break;case 27:bc(l.stateNode);case 26:case 5:Mr(l,l.return),Fa(l);break;case 22:l.memoizedState===null&&Fa(l);break;case 30:Fa(l);break;default:Fa(l)}r=r.sibling}}function cn(r,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var d=l.alternate,p=r,T=l,F=T.flags;switch(T.tag){case 0:case 11:case 15:cn(p,T,u),cc(4,T);break;case 1:if(cn(p,T,u),d=T,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ye){Jt(d,d.return,ye)}if(d=T,p=d.updateQueue,p!==null){var H=d.stateNode;try{var ie=p.shared.hiddenCallbacks;if(ie!==null)for(p.shared.hiddenCallbacks=null,p=0;p<ie.length;p++)eg(ie[p],H)}catch(ye){Jt(d,d.return,ye)}}u&&F&64&&up(T),hc(T,T.return);break;case 27:mp(T);case 26:case 5:cn(p,T,u),u&&d===null&&F&4&&dp(T),hc(T,T.return);break;case 12:cn(p,T,u);break;case 31:cn(p,T,u),u&&F&4&&yp(p,T);break;case 13:cn(p,T,u),u&&F&4&&Tp(p,T);break;case 22:T.memoizedState===null&&cn(p,T,u),hc(T,T.return);break;case 30:break;default:cn(p,T,u)}l=l.sibling}}function Bd(r,l){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(r=l.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&Zl(u))}function Ld(r,l){r=null,l.alternate!==null&&(r=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==r&&(l.refCount++,r!=null&&Zl(r))}function dr(r,l,u,d){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Ap(r,l,u,d),l=l.sibling}function Ap(r,l,u,d){var p=l.flags;switch(l.tag){case 0:case 11:case 15:dr(r,l,u,d),p&2048&&cc(9,l);break;case 1:dr(r,l,u,d);break;case 3:dr(r,l,u,d),p&2048&&(r=null,l.alternate!==null&&(r=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==r&&(l.refCount++,r!=null&&Zl(r)));break;case 12:if(p&2048){dr(r,l,u,d),r=l.stateNode;try{var T=l.memoizedProps,F=T.id,H=T.onPostCommit;typeof H=="function"&&H(F,l.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ie){Jt(l,l.return,ie)}}else dr(r,l,u,d);break;case 31:dr(r,l,u,d);break;case 13:dr(r,l,u,d);break;case 23:break;case 22:T=l.stateNode,F=l.alternate,l.memoizedState!==null?T._visibility&2?dr(r,l,u,d):uc(r,l):T._visibility&2?dr(r,l,u,d):(T._visibility|=2,Fo(r,l,u,d,(l.subtreeFlags&10256)!==0||!1)),p&2048&&Bd(F,l);break;case 24:dr(r,l,u,d),p&2048&&Ld(l.alternate,l);break;default:dr(r,l,u,d)}}function Fo(r,l,u,d,p){for(p=p&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var T=r,F=l,H=u,ie=d,ye=F.flags;switch(F.tag){case 0:case 11:case 15:Fo(T,F,H,ie,p),cc(8,F);break;case 23:break;case 22:var Se=F.stateNode;F.memoizedState!==null?Se._visibility&2?Fo(T,F,H,ie,p):uc(T,F):(Se._visibility|=2,Fo(T,F,H,ie,p)),p&&ye&2048&&Bd(F.alternate,F);break;case 24:Fo(T,F,H,ie,p),p&&ye&2048&&Ld(F.alternate,F);break;default:Fo(T,F,H,ie,p)}l=l.sibling}}function uc(r,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=r,d=l,p=d.flags;switch(d.tag){case 22:uc(u,d),p&2048&&Bd(d.alternate,d);break;case 24:uc(u,d),p&2048&&Ld(d.alternate,d);break;default:uc(u,d)}l=l.sibling}}var fc=8192;function Bo(r,l,u){if(r.subtreeFlags&fc)for(r=r.child;r!==null;)Rp(r,l,u),r=r.sibling}function Rp(r,l,u){switch(r.tag){case 26:Bo(r,l,u),r.flags&fc&&r.memoizedState!==null&&lA(u,fr,r.memoizedState,r.memoizedProps);break;case 5:Bo(r,l,u);break;case 3:case 4:var d=fr;fr=Iu(r.stateNode.containerInfo),Bo(r,l,u),fr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=fc,fc=16777216,Bo(r,l,u),fc=d):Bo(r,l,u));break;default:Bo(r,l,u)}}function Sp(r){var l=r.alternate;if(l!==null&&(r=l.child,r!==null)){l.child=null;do l=r.sibling,r.sibling=null,r=l;while(r!==null)}}function dc(r){var l=r.deletions;if((r.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var d=l[u];qi=d,Cp(d,r)}Sp(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Mp(r),r=r.sibling}function Mp(r){switch(r.tag){case 0:case 11:case 15:dc(r),r.flags&2048&&jn(9,r,r.return);break;case 3:dc(r);break;case 12:dc(r);break;case 22:var l=r.stateNode;r.memoizedState!==null&&l._visibility&2&&(r.return===null||r.return.tag!==13)?(l._visibility&=-3,pu(r)):dc(r);break;default:dc(r)}}function pu(r){var l=r.deletions;if((r.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var d=l[u];qi=d,Cp(d,r)}Sp(r)}for(r=r.child;r!==null;){switch(l=r,l.tag){case 0:case 11:case 15:jn(8,l,l.return),pu(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,pu(l));break;default:pu(l)}r=r.sibling}}function Cp(r,l){for(;qi!==null;){var u=qi;switch(u.tag){case 0:case 11:case 15:jn(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var d=u.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Zl(u.memoizedState.cache)}if(d=u.child,d!==null)d.return=u,qi=d;else e:for(u=r;qi!==null;){d=qi;var p=d.sibling,T=d.return;if(xp(d),d===u){qi=null;break e}if(p!==null){p.return=T,qi=p;break e}qi=T}}}var EE={getCacheForType:function(r){var l=Ji(Ni),u=l.data.get(r);return u===void 0&&(u=r(),l.data.set(r,u)),u},cacheSignal:function(){return Ji(Ni).controller.signal}},AE=typeof WeakMap=="function"?WeakMap:Map,Zt=0,di=null,Mt=null,It=0,$t=0,zs=null,Wn=!1,Lo=!1,kd=!1,hn=0,Ii=0,Xn=0,Ba=0,Nd=0,Gs=0,ko=0,_c=null,Ms=null,Ud=!1,xu=0,Dp=0,bu=1/0,yu=null,Yn=null,Hi=0,qn=null,No=null,un=0,zd=0,Gd=null,Ip=null,mc=0,Vd=null;function Vs(){return(Zt&2)!==0&&It!==0?It&-It:Y.T!==null?qd():ms()}function Pp(){if(Gs===0)if((It&536870912)===0||wt){var r=ws;ws<<=1,(ws&3932160)===0&&(ws=262144),Gs=r}else Gs=536870912;return r=Ns.current,r!==null&&(r.flags|=32),Gs}function Cs(r,l,u){(r===di&&($t===2||$t===9)||r.cancelPendingCommit!==null)&&(Uo(r,0),Kn(r,It,Gs,!1)),We(r,u),((
vendor: 14,357 bytes, line 49
49Zt&2)===0||r!==di)&&(r===di&&((Zt&2)===0&&(Ba|=u),Ii===4&&Kn(r,It,Gs,!1)),Cr(r))}function Op(r,l,u){if((Zt&6)!==0)throw Error(i(327));var d=!u&&(l&127)===0&&(l&r.expiredLanes)===0||$e(r,l),p=d?ME(r,l):jd(r,l,!0),T=d;do{if(p===0){Lo&&!d&&Kn(r,l,0,!1);break}else{if(u=r.current.alternate,T&&!RE(u)){p=jd(r,l,!1),T=!1;continue}if(p===2){if(T=l,r.errorRecoveryDisabledLanes&T)var F=0;else F=r.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){l=F;e:{var H=r;p=_c;var ie=H.current.memoizedState.isDehydrated;if(ie&&(Uo(H,F).flags|=256),F=jd(H,F,!1),F!==2){if(kd&&!ie){H.errorRecoveryDisabledLanes|=T,Ba|=T,p=4;break e}T=Ms,Ms=p,T!==null&&(Ms===null?Ms=T:Ms.push.apply(Ms,T))}p=F}if(T=!1,p!==2)continue}}if(p===1){Uo(r,0),Kn(r,l,0,!0);break}e:{switch(d=r,T=p,T){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:Kn(d,l,Gs,!Wn);break e;case 2:Ms=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(p=xu+300-we(),10<p)){if(Kn(d,l,Gs,!Wn),Bs(d,0,!0)!==0)break e;un=l,d.timeoutHandle=cx(wp.bind(null,d,u,Ms,yu,Ud,l,Gs,Ba,ko,Wn,T,"Throttled",-0,0),p);break e}wp(d,u,Ms,yu,Ud,l,Gs,Ba,ko,Wn,T,null,-0,0)}}break}while(!0);Cr(r)}function wp(r,l,u,d,p,T,F,H,ie,ye,Se,De,Te,Ee){if(r.timeoutHandle=-1,De=l.subtreeFlags,De&8192||(De&16785408)===16785408){De={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qs},Rp(l,T,De);var tt=(T&62914560)===T?xu-we():(T&4194048)===T?Dp-we():0;if(tt=cA(De,tt),tt!==null){un=T,r.cancelPendingCommit=tt(Gp.bind(null,r,l,T,u,d,p,F,H,ie,Se,De,null,Te,Ee)),Kn(r,T,F,!ye);return}}Gp(r,l,T,u,d,p,F,H,ie)}function RE(r){for(var l=r;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var d=0;d<u.length;d++){var p=u[d],T=p.getSnapshot;p=p.value;try{if(!cs(T(),p))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Kn(r,l,u,d){l&=~Nd,l&=~Ba,r.suspendedLanes|=l,r.pingedLanes&=~l,d&&(r.warmLanes|=l),d=r.expirationTimes;for(var p=l;0<p;){var T=31-Mi(p),F=1<<T;d[T]=-1,p&=~F}u!==0&&Ve(r,u,l)}function Tu(){return(Zt&6)===0?(gc(0),!1):!0}function Hd(){if(Mt!==null){if($t===0)var r=Mt.return;else r=Mt,Jr=Sa=null,nd(r),Do=null,$l=0,r=Mt;for(;r!==null;)hp(r.alternate,r),r=r.return;Mt=null}}function Uo(r,l){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,WE(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),un=0,Hd(),di=r,Mt=u=Qs(r.current,null),It=l,$t=0,zs=null,Wn=!1,Lo=$e(r,l),kd=!1,ko=Gs=Nd=Ba=Xn=Ii=0,Ms=_c=null,Ud=!1,(l&8)!==0&&(l|=l&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=l;0<d;){var p=31-Mi(d),T=1<<p;l|=r[p],d&=~T}return hn=l,Zs(),u}function Fp(r,l){Tt=null,Y.H=ac,l===Co||l===Zh?(l=Zm(),$t=3):l===Yf?(l=Zm(),$t=4):$t=l===Td?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,zs=l,Mt===null&&(Ii=1,hu(r,Js(l,r.current)))}function Bp(){var r=Ns.current;return r===null?!0:(It&4194048)===It?sr===null:(It&62914560)===It||(It&536870912)!==0?r===sr:!1}function Lp(){var r=Y.H;return Y.H=ac,r===null?ac:r}function kp(){var r=Y.A;return Y.A=EE,r}function vu(){Ii=4,Wn||(It&4194048)!==It&&Ns.current!==null||(Lo=!0),(Xn&134217727)===0&&(Ba&134217727)===0||di===null||Kn(di,It,Gs,!1)}function jd(r,l,u){var d=Zt;Zt|=2;var p=Lp(),T=kp();(di!==r||It!==l)&&(yu=null,Uo(r,l)),l=!1;var F=Ii;e:do try{if($t!==0&&Mt!==null){var H=Mt,ie=zs;switch($t){case 8:Hd(),F=6;break e;case 3:case 2:case 9:case 6:Ns.current===null&&(l=!0);var ye=$t;if($t=0,zs=null,zo(r,H,ie,ye),u&&Lo){F=0;break e}break;default:ye=$t,$t=0,zs=null,zo(r,H,ie,ye)}}SE(),F=Ii;break}catch(Se){Fp(r,Se)}while(!0);return l&&r.shellSuspendCounter++,Jr=Sa=null,Zt=d,Y.H=p,Y.A=T,Mt===null&&(di=null,It=0,Zs()),F}function SE(){for(;Mt!==null;)Np(Mt)}function ME(r,l){var u=Zt;Zt|=2;var d=Lp(),p=kp();di!==r||It!==l?(yu=null,bu=we()+500,Uo(r,l)):Lo=$e(r,l);e:do try{if($t!==0&&Mt!==null){l=Mt;var T=zs;t:switch($t){case 1:$t=0,zs=null,zo(r,l,T,1);break;case 2:case 9:if(qm(T)){$t=0,zs=null,Up(l);break}l=function(){$t!==2&&$t!==9||di!==r||($t=7),Cr(r)},T.then(l,l);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:qm(T)?($t=0,zs=null,Up(l)):($t=0,zs=null,zo(r,l,T,7));break;case 5:var F=null;switch(Mt.tag){case 26:F=Mt.memoizedState;case 5:case 27:var H=Mt;if(F?Ax(F):H.stateNode.complete){$t=0,zs=null;var ie=H.sibling;if(ie!==null)Mt=ie;else{var ye=H.return;ye!==null?(Mt=ye,Eu(ye)):Mt=null}break t}}$t=0,zs=null,zo(r,l,T,5);break;case 6:$t=0,zs=null,zo(r,l,T,6);break;case 8:Hd(),Ii=6;break e;default:throw Error(i(462))}}CE();break}catch(Se){Fp(r,Se)}while(!0);return Jr=Sa=null,Y.H=d,Y.A=p,Zt=u,Mt!==null?0:(di=null,It=0,Zs(),Ii)}function CE(){for(;Mt!==null&&!ut();)Np(Mt)}function Np(r){var l=lp(r.alternate,r,hn);r.memoizedProps=r.pendingProps,l===null?Eu(r):Mt=l}function Up(r){var l=r,u=l.alternate;switch(l.tag){case 15:case 0:l=ip(u,l,l.pendingProps,l.type,void 0,It);break;case 11:l=ip(u,l,l.pendingProps,l.type.render,l.ref,It);break;case 5:nd(l);default:hp(u,l),l=Mt=Hh(l,hn),l=lp(u,l,hn)}r.memoizedProps=r.pendingProps,l===null?Eu(r):Mt=l}function zo(r,l,u,d){Jr=Sa=null,nd(l),Do=null,$l=0;var p=l.return;try{if(gE(r,p,l,u,It)){Ii=1,hu(r,Js(u,r.current)),Mt=null;return}}catch(T){if(p!==null)throw Mt=p,T;Ii=1,hu(r,Js(u,r.current)),Mt=null;return}l.flags&32768?(wt||d===1?r=!0:Lo||(It&536870912)!==0?r=!1:(Wn=r=!0,(d===2||d===9||d===3||d===6)&&(d=Ns.current,d!==null&&d.tag===13&&(d.flags|=16384))),zp(l,r)):Eu(l)}function Eu(r){var l=r;do{if((l.flags&32768)!==0){zp(l,Wn);return}r=l.return;var u=bE(l.alternate,l,hn);if(u!==null){Mt=u;return}if(l=l.sibling,l!==null){Mt=l;return}Mt=l=r}while(l!==null);Ii===0&&(Ii=5)}function zp(r,l){do{var u=yE(r.alternate,r);if(u!==null){u.flags&=32767,Mt=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(r=r.sibling,r!==null)){Mt=r;return}Mt=r=u}while(r!==null);Ii=6,Mt=null}function Gp(r,l,u,d,p,T,F,H,ie){r.cancelPendingCommit=null;do Au();while(Hi!==0);if((Zt&6)!==0)throw Error(i(327));if(l!==null){if(l===r.current)throw Error(i(177));if(T=l.lanes|l.childLanes,T|=ks,W(r,u,T,F,H,ie),r===di&&(Mt=di=null,It=0),No=l,qn=r,un=u,zd=T,Gd=p,Ip=d,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,OE(ii,function(){return Xp(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||d){d=Y.T,Y.T=null,p=Z.p,Z.p=2,F=Zt,Zt|=4;try{TE(r,l,u)}finally{Zt=F,Z.p=p,Y.T=d}}Hi=1,Vp(),Hp(),jp()}}function Vp(){if(Hi===1){Hi=0;var r=qn,l=No,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=Y.T,Y.T=null;var d=Z.p;Z.p=2;var p=Zt;Zt|=4;try{vp(l,r);var T=i_,F=Gl(r.containerInfo),H=T.focusedElem,ie=T.selectionRange;if(F!==H&&H&&H.ownerDocument&&zl(H.ownerDocument.documentElement,H)){if(ie!==null&&go(H)){var ye=ie.start,Se=ie.end;if(Se===void 0&&(Se=ye),"selectionStart"in H)H.selectionStart=ye,H.selectionEnd=Math.min(Se,H.value.length);else{var De=H.ownerDocument||document,Te=De&&De.defaultView||window;if(Te.getSelection){var Ee=Te.getSelection(),tt=H.textContent.length,ft=Math.min(ie.start,tt),ai=ie.end===void 0?ft:Math.min(ie.end,tt);!Ee.extend&&ft>ai&&(F=ai,ai=ft,ft=F);var fe=Ul(H,ft),oe=Ul(H,ai);if(fe&&oe&&(Ee.rangeCount!==1||Ee.anchorNode!==fe.node||Ee.anchorOffset!==fe.offset||Ee.focusNode!==oe.node||Ee.focusOffset!==oe.offset)){var be=De.createRange();be.setStart(fe.node,fe.offset),Ee.removeAllRanges(),ft>ai?(Ee.addRange(be),Ee.extend(oe.node,oe.offset)):(be.setEnd(oe.node,oe.offset),Ee.addRange(be))}}}}for(De=[],Ee=H;Ee=Ee.parentNode;)Ee.nodeType===1&&De.push({element:Ee,left:Ee.scrollLeft,top:Ee.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<De.length;H++){var Ce=De[H];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}Lu=!!t_,i_=t_=null}finally{Zt=p,Z.p=d,Y.T=u}}r.current=l,Hi=2}}function Hp(){if(Hi===2){Hi=0;var r=qn,l=No,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=Y.T,Y.T=null;var d=Z.p;Z.p=2;var p=Zt;Zt|=4;try{pp(r,l.alternate,l)}finally{Zt=p,Z.p=d,Y.T=u}}Hi=3}}function jp(){if(Hi===4||Hi===3){Hi=0,ne();var r=qn,l=No,u=un,d=Ip;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Hi=5:(Hi=0,No=qn=null,Wp(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Yn=null),os(u),l=l.stateNode,si&&typeof si.onCommitFiberRoot=="function")try{si.onCommitFiberRoot(Wt,l,void 0,(l.current.flags&128)===128)}catch{}if(d!==null){l=Y.T,p=Z.p,Z.p=2,Y.T=null;try{for(var T=r.onRecoverableError,F=0;F<d.length;F++){var H=d[F];T(H.value,{componentStack:H.stack})}}finally{Y.T=l,Z.p=p}}(un&3)!==0&&Au(),Cr(r),p=r.pendingLanes,(u&261930)!==0&&(p&42)!==0?r===Vd?mc++:(mc=0,Vd=r):mc=0,gc(0)}}function Wp(r,l){(r.pooledCacheLanes&=l)===0&&(l=r.pooledCache,l!=null&&(r.pooledCache=null,Zl(l)))}function Au(){return Vp(),Hp(),jp(),Xp()}function Xp(){if(Hi!==5)return!1;var r=qn,l=zd;zd=0;var u=os(un),d=Y.T,p=Z.p;try{Z.p=32>u?32:u,Y.T=null,u=Gd,Gd=null;var T=qn,F=un;if(Hi=0,No=qn=null,un=0,(Zt&6)!==0)throw Error(i(331));var H=Zt;if(Zt|=4,Mp(T.current),Ap(T,T.current,F,u),Zt=H,gc(0,!1),si&&typeof si.onPostCommitFiberRoot=="function")try{si.onPostCommitFiberRoot(Wt,T)}catch{}return!0}finally{Z.p=p,Y.T=d,Wp(r,l)}}function Yp(r,l,u){l=Js(u,l),l=yd(r.stateNode,l,2),r=Gn(r,l,2),r!==null&&(We(r,2),Cr(r))}function Jt(r,l,u){if(r.tag===3)Yp(r,r,u);else for(;l!==null;){if(l.tag===3){Yp(l,r,u);break}else if(l.tag===1){var d=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Yn===null||!Yn.has(d))){r=Js(u,r),u=qg(2),d=Gn(l,u,2),d!==null&&(Kg(u,d,l,r),We(d,2),Cr(d));break}}l=l.return}}function Wd(r,l,u){var d=r.pingCache;if(d===null){d=r.pingCache=new AE;var p=new Set;d.set(l,p)}else p=d.get(l),p===void 0&&(p=new Set,d.set(l,p));p.has(u)||(kd=!0,p.add(u),r=DE.bind(null,r,l,u),l.then(r,r))}function DE(r,l,u){var d=r.pingCache;d!==null&&d.delete(l),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,di===r&&(It&u)===u&&(Ii===4||Ii===3&&(It&62914560)===It&&300>we()-xu?(Zt&2)===0&&Uo(r,0):Nd|=u,ko===It&&(ko=0)),Cr(r)}function qp(r,l){l===0&&(l=Re()),r=Ze(r,l),r!==null&&(We(r,l),Cr(r))}function IE(r){var l=r.memoizedState,u=0;l!==null&&(u=l.retryLane),qp(r,u)}function PE(r,l){var u=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(u=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(i(314))}d!==null&&d.delete(l),qp(r,u)}function OE(r,l){return jt(r,l)}var Ru=null,Go=null,Xd=!1,Su=!1,Yd=!1,Zn=0;function Cr(r){r!==Go&&r.next===null&&(Go===null?Ru=Go=r:Go=Go.next=r),Su=!0,Xd||(Xd=!0,FE())}function gc(r,l){if(!Yd&&Su){Yd=!0;do for(var u=!1,d=Ru;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var T=0;else{var F=d.suspendedLanes,H=d.pingedLanes;T=(1<<31-Mi(42|r)+1)-1,T&=p&~(F&~H),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(u=!0,$p(d,T))}else T=It,T=Bs(d,d===di?T:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(T&3)===0||$e(d,T)||(u=!0,$p(d,T));d=d.next}while(u);Yd=!1}}function wE(){Kp()}function Kp(){Su=Xd=!1;var r=0;Zn!==0&&jE()&&(r=Zn);for(var l=we(),u=null,d=Ru;d!==null;){var p=d.next,T=Zp(d,l);T===0?(d.next=null,u===null?Ru=p:u.next=p,p===null&&(Go=u)):(u=d,(r!==0||(T&3)!==0)&&(Su=!0)),d=p}Hi!==0&&Hi!==5||gc(r),Zn!==0&&(Zn=0)}function Zp(r,l){for(var u=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,T=r.pendingLanes&-62914561;0<T;){var F=31-Mi(T),H=1<<F,ie=p[F];ie===-1?((H&u)===0||(H&d)!==0)&&(p[F]=G(H,l)):ie<=l&&(r.expiredLanes|=H),T&=~H}if(l=di,u=It,u=Bs(r,r===l?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,u===0||r===l&&($t===2||$t===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Nt(d),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||$e(r,u)){if(l=u&-u,l===r.callbackPriority)return l;switch(d!==null&&Nt(d),os(u)){case 2:case 8:u=hi;break;case 32:u=ii;break;case 268435456:u=Gt;break;default:u=ii}return d=Qp.bind(null,r),u=jt(u,d),r.callbackPriority=l,r.callbackNode=u,l}return d!==null&&d!==null&&Nt(d),r.callbackPriority=2,r.callbackNode=null,2}function Qp(r,l){if(Hi!==0&&Hi!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(Au()&&r.callbackNode!==u)return null;var d=It;return d=Bs(r,r===di?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Op(r,d,l),Zp(r,we()),r.callbackNode!=null&&r.callbackNode===u?Qp.bind(null,r):null)}function $p(r,l){if(Au())return null;Op(r,l,!0)}function FE(){XE(function(){(Zt&6)!==0?jt(ci,wE):Kp()})}function qd(){if(Zn===0){var r=So;r===0&&(r=Os,Os<<=1,(Os&261888)===0&&(Os=256)),Zn=r}return Zn}function Jp(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:xa(""+r)}function ex(r,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,r.id&&u.setAttribute("form",r.id),l.parentNode.insertBefore(u,l),r=new FormData(r),u.parentNode.removeChild(u),r}function BE(r,l,u,d,p){if(l==="submit"&&u&&u.stateNode===p){var T=Jp((p[Ki]||null).action),F=d.submitter;F&&(l=(l=F[Ki]||null)?Jp(l.formAction):F.getAttribute("formAction"),l!==null&&(T=l,F=null));var H=new va("action","action",null,d,p);r.push({event:H,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Zn!==0){var ie=F?ex(p,F):new FormData(p);_d(u,{pending:!0,data:ie,method:p.method,action:T},null,ie)}}else typeof T=="function"&&(H.preventDefault(),ie=F?ex(p,F):new FormData(p),_d(u,{pending:!0,data:ie,method:p.method,action:T},T,ie))},currentTarget:p}]})}}for(var Kd=0;Kd<le.length;Kd++){var Zd=le[Kd],LE=Zd.toLowerCase(),kE=Zd[0].toUpperCase()+Zd.slice(1);Kt(LE,"on"+kE)}Kt(jl,"onAnimationEnd"),Kt(Wl,"onAnimationIteration"),Kt(Xl,"onAnimationStart"),Kt("dblclick","onDoubleClick"),Kt("focusin","onFocus"),Kt("focusout","onBlur"),Kt(zh,"onTransitionRun"),Kt(Gh,"onTransitionStart"),Kt(Vh,"onTransitionCancel"),Kt(Ye,"onTransitionEnd"),Hr("onMouseEnter",["mouseout","mouseover"]),Hr("onMouseLeave",["mouseout","mouseover"]),Hr("onPointerEnter",["pointerout","pointerover"]),Hr("onPointerLeave",["pointerout","pointerover"]),yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yr("onSelect","focusout contextmenu dragend focu
49sin keydown keyup mousedown mouseup selectionchange".split(" ")),yr("onBeforeInput",["compositionend","keypress","textInput","paste"]),yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pc="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(" "),NE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pc));function tx(r,l){l=(l&4)!==0;for(var u=0;u<r.length;u++){var d=r[u],p=d.event;d=d.listeners;e:{var T=void 0;if(l)for(var F=d.length-1;0<=F;F--){var H=d[F],ie=H.instance,ye=H.currentTarget;if(H=H.listener,ie!==T&&p.isPropagationStopped())break e;T=H,p.currentTarget=ye;try{T(p)}catch(Se){Et(Se)}p.currentTarget=null,T=ie}else for(F=0;F<d.length;F++){if(H=d[F],ie=H.instance,ye=H.currentTarget,H=H.listener,ie!==T&&p.isPropagationStopped())break e;T=H,p.currentTarget=ye;try{T(p)}catch(Se){Et(Se)}p.currentTarget=null,T=ie}}}}function Ct(r,l){var u=l[Qa];u===void 0&&(u=l[Qa]=new Set);var d=r+"__bubble";u.has(d)||(ix(l,r,2,!1),u.add(d))}function Qd(r,l,u){var d=0;l&&(d|=4),ix(u,r,d,l)}var Mu="_reactListening"+Math.random().toString(36).slice(2);function $d(r){if(!r[Mu]){r[Mu]=!0,ll.forEach(function(u){u!=="selectionchange"&&(NE.has(u)||Qd(u,!1,r),Qd(u,!0,r))});var l=r.nodeType===9?r:r.ownerDocument;l===null||l[Mu]||(l[Mu]=!0,Qd("selectionchange",!1,l))}}function ix(r,l,u,d){switch(Px(l)){case 2:var p=fA;break;case 8:p=dA;break;default:p=d_}u=p.bind(null,l,u,r),p=void 0,!ao||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(l,u,{capture:!0,passive:p}):r.addEventListener(l,u,!0):p!==void 0?r.addEventListener(l,u,{passive:p}):r.addEventListener(l,u,!1)}function Jd(r,l,u,d,p){var T=d;if((l&1)===0&&(l&2)===0&&d!==null)e:for(;;){if(d===null)return;var F=d.tag;if(F===3||F===4){var H=d.stateNode.containerInfo;if(H===p)break;if(F===4)for(F=d.return;F!==null;){var ie=F.tag;if((ie===3||ie===4)&&F.stateNode.containerInfo===p)return;F=F.return}for(;H!==null;){if(F=zr(H),F===null)return;if(ie=F.tag,ie===5||ie===6||ie===26||ie===27){d=T=F;continue e}H=H.parentNode}}d=d.return}yl(function(){var ye=T,Se=ro(u),De=[];e:{var Te=S.get(r);if(Te!==void 0){var Ee=va,tt=r;switch(r){case"keypress":if(ya(u)===0)break e;case"keydown":case"keyup":Ee=xh;break;case"focusin":tt="focus",Ee=ho;break;case"focusout":tt="blur",Ee=ho;break;case"beforeblur":case"afterblur":Ee=ho;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ee=El;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ee=ah;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ee=Th;break;case jl:case Wl:case Xl:Ee=ch;break;case Ye:Ee=Eh;break;case"scroll":case"scrollend":Ee=rh;break;case"wheel":Ee=Rh;break;case"copy":case"cut":case"paste":Ee=uh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ee=Rl;break;case"toggle":case"beforetoggle":Ee=Mh}var ft=(l&4)!==0,ai=!ft&&(r==="scroll"||r==="scrollend"),fe=ft?Te!==null?Te+"Capture":null:Te;ft=[];for(var oe=ye,be;oe!==null;){var Ce=oe;if(be=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||be===null||fe===null||(Ce=Sn(oe,fe),Ce!=null&&ft.push(xc(oe,Ce,be))),ai)break;oe=oe.return}0<ft.length&&(Te=new Ee(Te,tt,null,u,Se),De.push({event:Te,listeners:ft}))}}if((l&7)===0){e:{if(Te=r==="mouseover"||r==="pointerover",Ee=r==="mouseout"||r==="pointerout",Te&&u!==so&&(tt=u.relatedTarget||u.fromElement)&&(zr(tt)||tt[Ur]))break e;if((Ee||Te)&&(Te=Se.window===Se?Se:(Te=Se.ownerDocument)?Te.defaultView||Te.parentWindow:window,Ee?(tt=u.relatedTarget||u.toElement,Ee=ye,tt=tt?zr(tt):null,tt!==null&&(ai=n(tt),ft=tt.tag,tt!==ai||ft!==5&&ft!==27&&ft!==6)&&(tt=null)):(Ee=null,tt=ye),Ee!==tt)){if(ft=El,Ce="onMouseLeave",fe="onMouseEnter",oe="mouse",(r==="pointerout"||r==="pointerover")&&(ft=Rl,Ce="onPointerLeave",fe="onPointerEnter",oe="pointer"),ai=Ee==null?Te:Rn(Ee),be=tt==null?Te:Rn(tt),Te=new ft(Ce,oe+"leave",Ee,u,Se),Te.target=ai,Te.relatedTarget=be,Ce=null,zr(Se)===ye&&(ft=new ft(fe,oe+"enter",tt,u,Se),ft.target=be,ft.relatedTarget=ai,Ce=ft),ai=Ce,Ee&&tt)t:{for(ft=UE,fe=Ee,oe=tt,be=0,Ce=fe;Ce;Ce=ft(Ce))be++;Ce=0;for(var lt=oe;lt;lt=ft(lt))Ce++;for(;0<be-Ce;)fe=ft(fe),be--;for(;0<Ce-be;)oe=ft(oe),Ce--;for(;be--;){if(fe===oe||oe!==null&&fe===oe.alternate){ft=fe;break t}fe=ft(fe),oe=ft(oe)}ft=null}else ft=null;Ee!==null&&sx(De,Te,Ee,ft,!1),tt!==null&&ai!==null&&sx(De,ai,tt,ft,!0)}}
vendor: 2,627 bytes, lines 49-50
49e:{if(Te=ye?Rn(ye):window,Ee=Te.nodeName&&Te.nodeName.toLowerCase(),Ee==="select"||Ee==="input"&&Te.type==="file")var Xt=wl;else if(Pl(Te))if(Fl)Xt=kh;else{Xt=Bh;var nt=Fh}else Ee=Te.nodeName,!Ee||Ee.toLowerCase()!=="input"||Te.type!=="checkbox"&&Te.type!=="radio"?ye&&io(ye.elementType)&&(Xt=wl):Xt=Lh;if(Xt&&(Xt=Xt(r,ye))){Ol(De,Xt,u,Se);break e}nt&&nt(r,Te,ye),r==="focusout"&&ye&&Te.type==="number"&&ye.memoizedProps.value!=null&&to(Te,"number",Te.value)}switch(nt=ye?Rn(ye):window,r){case"focusin":(Pl(nt)||nt.contentEditable==="true")&&(Kr=nt,po=ye,Fn=null);break;case"focusout":Fn=po=Kr=null;break;case"mousedown":xo=!0;break;case"contextmenu":case"mouseup":case"dragend":xo=!1,Vl(De,u,Se);break;case"selectionchange":if(Uh)break;case"keydown":case"keyup":Vl(De,u,Se)}var vt;if(fo)e:{switch(r){case"compositionstart":var Pt="onCompositionStart";break e;case"compositionend":Pt="onCompositionEnd";break e;case"compositionupdate":Pt="onCompositionUpdate";break e}Pt=void 0}else qr?Dl(r,u)&&(Pt="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Pt="onCompositionStart");Pt&&(Sl&&u.locale!=="ko"&&(qr||Pt!=="onCompositionStart"?Pt==="onCompositionEnd"&&qr&&(vt=Tl()):(cr=Se,oo="value"in cr?cr.value:cr.textContent,qr=!0)),nt=Cu(ye,Pt),0<nt.length&&(Pt=new Al(Pt,r,null,u,Se),De.push({event:Pt,listeners:nt}),vt?Pt.data=vt:(vt=Il(u),vt!==null&&(Pt.data=vt)))),(vt=Dh?Ih(r,u):Ph(r,u))&&(Pt=Cu(ye,"onBeforeInput"),0<Pt.length&&(nt=new Al("onBeforeInput","beforeinput",null,u,Se),De.push({event:nt,listeners:Pt}),nt.data=vt)),BE(De,r,ye,u,Se)}tx(De,l)})}function xc(r,l,u){return{instance:r,listener:l,currentTarget:u}}function Cu(r,l){for(var u=l+"Capture",d=[];r!==null;){var p=r,T=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||T===null||(p=Sn(r,u),p!=null&&d.unshift(xc(r,p,T)),p=Sn(r,l),p!=null&&d.push(xc(r,p,T))),r.tag===3)return d;r=r.return}return[]}function UE(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function sx(r,l,u,d,p){for(var T=l._reactName,F=[];u!==null&&u!==d;){var H=u,ie=H.alternate,ye=H.stateNode;if(H=H.tag,ie!==null&&ie===d)break;H!==5&&H!==26&&H!==27||ye===null||(ie=ye,p?(ye=Sn(u,T),ye!=null&&F.unshift(xc(u,ye,ie))):p||(ye=Sn(u,T),ye!=null&&F.push(xc(u,ye,ie)))),u=u.return}F.length!==0&&r.push({event:l,listeners:F})}var zE=/\r\n?/g,GE=/\u0000|\uFFFD/g;function rx(r){return(typeof r=="string"?r:""+r).replace(zE,`
50`).replace(GE,"")}function nx(r,l){return l=rx(l),rx(r)===l}function ni(r,l,u,d,p,T){switch(u){case"children":typeof d=="string"?l==="body"||l==="textarea"&&d===""||Wr(r,d):(typeof d=="number"||typeof d=="bigint")&&l!=="body"&&Wr(r,""+d
vendor: 4,445 bytes, line 50
50);break;case"className":ga(r,"class",d);break;case"tabIndex":ga(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":ga(r,u,d);break;case"style":xl(r,d,T);break;case"data":if(l!=="object"){ga(r,"data",d);break}case"src":case"href":if(d===""&&(l!=="a"||u!=="href")){r.removeAttribute(u);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(u);break}d=xa(""+d),r.setAttribute(u,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(u,"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 T=="function"&&(u==="formAction"?(l!=="input"&&ni(r,l,"name",p.name,p,null),ni(r,l,"formEncType",p.formEncType,p,null),ni(r,l,"formMethod",p.formMethod,p,null),ni(r,l,"formTarget",p.formTarget,p,null)):(ni(r,l,"encType",p.encType,p,null),ni(r,l,"method",p.method,p,null),ni(r,l,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(u);break}d=xa(""+d),r.setAttribute(u,d);break;case"onClick":d!=null&&(r.onclick=qs);break;case"onScroll":d!=null&&Ct("scroll",r);break;case"onScrollEnd":d!=null&&Ct("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(i(61));if(u=d.__html,u!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=u}}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}u=xa(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);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(u,""+d):r.removeAttribute(u);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"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":d===!0?r.setAttribute(u,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(u,d):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(u,d):r.removeAttribute(u);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(u):r.setAttribute(u,d);break;case"popover":Ct("beforetoggle",r),Ct("toggle",r),ma(r,"popover",d);break;case"xlinkActuate":Ys(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ys(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ys(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ys(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ys(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ys(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ys(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ys(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ys(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":ma(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=ih.get(u)||u,ma(r,u,d))}}function e_(r,l,u,d,p,T){switch(u){case"style":xl(r,d,T);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(i(61));if(u=d.__html,u!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=u}}break;
vendor: 11,273 bytes, line 50
50case"children":typeof d=="string"?Wr(r,d):(typeof d=="number"||typeof d=="bigint")&&Wr(r,""+d);break;case"onScroll":d!=null&&Ct("scroll",r);break;case"onScrollEnd":d!=null&&Ct("scrollend",r);break;case"onClick":d!=null&&(r.onclick=qs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cl.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(p=u.endsWith("Capture"),l=u.slice(2,p?u.length-7:void 0),T=r[Ki]||null,T=T!=null?T[u]:null,typeof T=="function"&&r.removeEventListener(l,T,p),typeof d=="function")){typeof T!="function"&&T!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(l,d,p);break e}u in r?r[u]=d:d===!0?r.setAttribute(u,""):ma(r,u,d)}}}function ts(r,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ct("error",r),Ct("load",r);var d=!1,p=!1,T;for(T in u)if(u.hasOwnProperty(T)){var F=u[T];if(F!=null)switch(T){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:ni(r,l,T,F,u,null)}}p&&ni(r,l,"srcSet",u.srcSet,u,null),d&&ni(r,l,"src",u.src,u,null);return;case"input":Ct("invalid",r);var H=T=F=p=null,ie=null,ye=null;for(d in u)if(u.hasOwnProperty(d)){var Se=u[d];if(Se!=null)switch(d){case"name":p=Se;break;case"type":F=Se;break;case"checked":ie=Se;break;case"defaultChecked":ye=Se;break;case"value":T=Se;break;case"defaultValue":H=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(i(137,l));break;default:ni(r,l,d,Se,u,null)}}_l(r,T,H,ie,ye,F,p,!1);return;case"select":Ct("invalid",r),d=F=T=null;for(p in u)if(u.hasOwnProperty(p)&&(H=u[p],H!=null))switch(p){case"value":T=H;break;case"defaultValue":F=H;break;case"multiple":d=H;default:ni(r,l,p,H,u,null)}l=T,u=F,r.multiple=!!d,l!=null?jr(r,!!d,l,!1):u!=null&&jr(r,!!d,u,!0);return;case"textarea":Ct("invalid",r),T=p=d=null;for(F in u)if(u.hasOwnProperty(F)&&(H=u[F],H!=null))switch(F){case"value":d=H;break;case"defaultValue":p=H;break;case"children":T=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(i(91));break;default:ni(r,l,F,H,u,null)}gl(r,d,p,T);return;case"option":for(ie in u)if(u.hasOwnProperty(ie)&&(d=u[ie],d!=null))switch(ie){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:ni(r,l,ie,d,u,null)}return;case"dialog":Ct("beforetoggle",r),Ct("toggle",r),Ct("cancel",r),Ct("close",r);break;case"iframe":case"object":Ct("load",r);break;case"video":case"audio":for(d=0;d<pc.length;d++)Ct(pc[d],r);break;case"image":Ct("error",r),Ct("load",r);break;case"details":Ct("toggle",r);break;case"embed":case"source":case"link":Ct("error",r),Ct("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(ye in u)if(u.hasOwnProperty(ye)&&(d=u[ye],d!=null))switch(ye){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:ni(r,l,ye,d,u,null)}return;default:if(io(l)){for(Se in u)u.hasOwnProperty(Se)&&(d=u[Se],d!==void 0&&e_(r,l,Se,d,u,void 0));return}}for(H in u)u.hasOwnProperty(H)&&(d=u[H],d!=null&&ni(r,l,H,d,u,null))}function VE(r,l,u,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,T=null,F=null,H=null,ie=null,ye=null,Se=null;for(Ee in u){var De=u[Ee];if(u.hasOwnProperty(Ee)&&De!=null)switch(Ee){case"checked":break;case"value":break;case"defaultValue":ie=De;default:d.hasOwnProperty(Ee)||ni(r,l,Ee,null,d,De)}}for(var Te in d){var Ee=d[Te];if(De=u[Te],d.hasOwnProperty(Te)&&(Ee!=null||De!=null))switch(Te){case"type":T=Ee;break;case"name":p=Ee;break;case"checked":ye=Ee;break;case"defaultChecked":Se=Ee;break;case"value":F=Ee;break;case"defaultValue":H=Ee;break;case"children":case"dangerouslySetInnerHTML":if(Ee!=null)throw Error(i(137,l));break;default:Ee!==De&&ni(r,l,Te,Ee,d,De)}}eo(r,F,H,ie,ye,Se,T,p);return;case"select":Ee=F=H=Te=null;for(T in u)if(ie=u[T],u.hasOwnProperty(T)&&ie!=null)switch(T){case"value":break;case"multiple":Ee=ie;default:d.hasOwnProperty(T)||ni(r,l,T,null,d,ie)}for(p in d)if(T=d[p],ie=u[p],d.hasOwnProperty(p)&&(T!=null||ie!=null))switch(p){case"value":Te=T;break;case"defaultValue":H=T;break;case"multiple":F=T;default:T!==ie&&ni(r,l,p,T,d,ie)}l=H,u=F,d=Ee,Te!=null?jr(r,!!u,Te,!1):!!d!=!!u&&(l!=null?jr(r,!!u,l,!0):jr(r,!!u,u?[]:"",!1));return;case"textarea":Ee=Te=null;for(H in u)if(p=u[H],u.hasOwnProperty(H)&&p!=null&&!d.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:ni(r,l,H,null,d,p)}for(F in d)if(p=d[F],T=u[F],d.hasOwnProperty(F)&&(p!=null||T!=null))switch(F){case"value":Te=p;break;case"defaultValue":Ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==T&&ni(r,l,F,p,d,T)}ml(r,Te,Ee);return;case"option":for(var tt in u)if(Te=u[tt],u.hasOwnProperty(tt)&&Te!=null&&!d.hasOwnProperty(tt))switch(tt){case"selected":r.selected=!1;break;default:ni(r,l,tt,null,d,Te)}for(ie in d)if(Te=d[ie],Ee=u[ie],d.hasOwnProperty(ie)&&Te!==Ee&&(Te!=null||Ee!=null))switch(ie){case"selected":r.selected=Te&&typeof Te!="function"&&typeof Te!="symbol";break;default:ni(r,l,ie,Te,d,Ee)}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 ft in u)Te=u[ft],u.hasOwnProperty(ft)&&Te!=null&&!d.hasOwnProperty(ft)&&ni(r,l,ft,null,d,Te);for(ye in d)if(Te=d[ye],Ee=u[ye],d.hasOwnProperty(ye)&&Te!==Ee&&(Te!=null||Ee!=null))switch(ye){case"children":case"dangerouslySetInnerHTML":if(Te!=null)throw Error(i(137,l));break;default:ni(r,l,ye,Te,d,Ee)}return;default:if(io(l)){for(var ai in u)Te=u[ai],u.hasOwnProperty(ai)&&Te!==void 0&&!d.hasOwnProperty(ai)&&e_(r,l,ai,void 0,d,Te);for(Se in d)Te=d[Se],Ee=u[Se],!d.hasOwnProperty(Se)||Te===Ee||Te===void 0&&Ee===void 0||e_(r,l,Se,Te,d,Ee);return}}for(var fe in u)Te=u[fe],u.hasOwnProperty(fe)&&Te!=null&&!d.hasOwnProperty(fe)&&ni(r,l,fe,null,d,Te);for(De in d)Te=d[De],Ee=u[De],!d.hasOwnProperty(De)||Te===Ee||Te==null&&Ee==null||ni(r,l,De,Te,d,Ee)}function ax(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function HE(){if(typeof performance.getEntriesByType=="function"){for(var r=0,l=0,u=performance.getEntriesByType("resource"),d=0;d<u.length;d++){var p=u[d],T=p.transferSize,F=p.initiatorType,H=p.duration;if(T&&H&&ax(F)){for(F=0,H=p.responseEnd,d+=1;d<u.length;d++){var ie=u[d],ye=ie.startTime;if(ye>H)break;var Se=ie.transferSize,De=ie.initiatorType;Se&&ax(De)&&(ie=ie.responseEnd,F+=Se*(ie<H?1:(H-ye)/(ie-ye)))}if(--d,l+=8*(T+F)/(p.duration/1e3),r++,10<r)break}}if(0<r)return l/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var t_=null,i_=null;function Du(r){return r.nodeType===9?r:r.ownerDocument}function ox(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 lx(r,l){if(r===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&l==="foreignObject"?0:r}function s_(r,l){return r==="textarea"||r==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var r_=null;function jE(){var r=window.event;return r&&r.type==="popstate"?r===r_?!1:(r_=r,!0):(r_=null,!1)}var cx=typeof setTimeout=="function"?setTimeout:void 0,WE=typeof clearTimeout=="function"?clearTimeout:void 0,hx=typeof Promise=="function"?Promise:void 0,XE=typeof queueMicrotask=="function"?queueMicrotask:typeof hx<"u"?function(r){return hx.resolve(null).then(r).catch(YE)}:cx;function YE(r){setTimeout(function(){throw r})}function Qn(r){return r==="head"}function ux(r,l){var u=l,d=0;do{var p=u.nextSibling;if(r.removeChild(u),p&&p.nodeType===8)if(u=p.data,u==="/$"||u==="/&"){if(d===0){r.removeChild(p),Wo(l);return}d--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")d++;else if(u==="html")bc(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,bc(u);for(var T=u.firstChild;T;){var F=T.nextSibling,H=T.nodeName;T[An]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=F}}else u==="body"&&bc(r.ownerDocument.body);u=p}while(u);Wo(l)}function fx(r,l){var u=r;r=0;do{var d=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),d&&d.nodeType===8)if(u=d.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=d}while(u)}function n_(r){var l=r.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":n_(u),$a(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function qE(r,l,u,d){for(;r.nodeType===1;){var p=u;if(r.nodeName.toLowerCase()!==l.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[An])switch(l){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(T=r.getAttribute("rel"),T==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(T!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(T=r.getAttribute("src"),(T!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&T&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(l==="input"&&r.type==="hidden"){var T=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===T)return r}else return r;if(r=rr(r.nextSibling),r===null)break}return null}function KE(r,l,u){if(l==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=rr(r.nextSibling),r===null))return null;return r}function dx(r,l){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=rr(r.nextSibling),r===null))return null;return r}function a_(r){return r.data==="$?"||r.data==="$~"}function o_(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function ZE(r,l){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=l;else if(r.data!=="$?"||u.readyState!=="loading")l();else{var d=function(){l(),u.removeEventListener("DOMContentLoaded",d)};u.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function rr(r){for(;r!=null;r=r.nextSibling){var l=r.nodeType;if(l===1||l===3)break;if(l===8){if(l=r.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;
vendor: 12,047 bytes, line 50
50if(l==="/$"||l==="/&")return null}}return r}var l_=null;function _x(r){r=r.nextSibling;for(var l=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(l===0)return rr(r.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}r=r.nextSibling}return null}function mx(r){r=r.previousSibling;for(var l=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return r;l--}else u!=="/$"&&u!=="/&"||l++}r=r.previousSibling}return null}function gx(r,l,u){switch(l=Du(u),r){case"html":if(r=l.documentElement,!r)throw Error(i(452));return r;case"head":if(r=l.head,!r)throw Error(i(453));return r;case"body":if(r=l.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function bc(r){for(var l=r.attributes;l.length;)r.removeAttributeNode(l[0]);$a(r)}var nr=new Map,px=new Set;function Iu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var fn=Z.d;Z.d={f:QE,r:$E,D:JE,C:eA,L:tA,m:iA,X:rA,S:sA,M:nA};function QE(){var r=fn.f(),l=Tu();return r||l}function $E(r){var l=Gr(r);l!==null&&l.tag===5&&l.type==="form"?Fg(l):fn.r(r)}var Vo=typeof document>"u"?null:document;function xx(r,l,u){var d=Vo;if(d&&typeof l=="string"&&l){var p=ps(l);p='link[rel="'+r+'"][href="'+p+'"]',typeof u=="string"&&(p+='[crossorigin="'+u+'"]'),px.has(p)||(px.add(p),r={rel:r,crossOrigin:u,href:l},d.querySelector(p)===null&&(l=d.createElement("link"),ts(l,"link",r),Oi(l),d.head.appendChild(l)))}}function JE(r){fn.D(r),xx("dns-prefetch",r,null)}function eA(r,l){fn.C(r,l),xx("preconnect",r,l)}function tA(r,l,u){fn.L(r,l,u);var d=Vo;if(d&&r&&l){var p='link[rel="preload"][as="'+ps(l)+'"]';l==="image"&&u&&u.imageSrcSet?(p+='[imagesrcset="'+ps(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(p+='[imagesizes="'+ps(u.imageSizes)+'"]')):p+='[href="'+ps(r)+'"]';var T=p;switch(l){case"style":T=Ho(r);break;case"script":T=jo(r)}nr.has(T)||(r=m({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:r,as:l},u),nr.set(T,r),d.querySelector(p)!==null||l==="style"&&d.querySelector(yc(T))||l==="script"&&d.querySelector(Tc(T))||(l=d.createElement("link"),ts(l,"link",r),Oi(l),d.head.appendChild(l)))}}function iA(r,l){fn.m(r,l);var u=Vo;if(u&&r){var d=l&&typeof l.as=="string"?l.as:"script",p='link[rel="modulepreload"][as="'+ps(d)+'"][href="'+ps(r)+'"]',T=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=jo(r)}if(!nr.has(T)&&(r=m({rel:"modulepreload",href:r},l),nr.set(T,r),u.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Tc(T)))return}d=u.createElement("link"),ts(d,"link",r),Oi(d),u.head.appendChild(d)}}}function sA(r,l,u){fn.S(r,l,u);var d=Vo;if(d&&r){var p=Vr(d).hoistableStyles,T=Ho(r);l=l||"default";var F=p.get(T);if(!F){var H={loading:0,preload:null};if(F=d.querySelector(yc(T)))H.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":l},u),(u=nr.get(T))&&c_(r,u);var ie=F=d.createElement("link");Oi(ie),ts(ie,"link",r),ie._p=new Promise(function(ye,Se){ie.onload=ye,ie.onerror=Se}),ie.addEventListener("load",function(){H.loading|=1}),ie.addEventListener("error",function(){H.loading|=2}),H.loading|=4,Pu(F,l,d)}F={type:"stylesheet",instance:F,count:1,state:H},p.set(T,F)}}}function rA(r,l){fn.X(r,l);var u=Vo;if(u&&r){var d=Vr(u).hoistableScripts,p=jo(r),T=d.get(p);T||(T=u.querySelector(Tc(p)),T||(r=m({src:r,async:!0},l),(l=nr.get(p))&&h_(r,l),T=u.createElement("script"),Oi(T),ts(T,"link",r),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},d.set(p,T))}}function nA(r,l){fn.M(r,l);var u=Vo;if(u&&r){var d=Vr(u).hoistableScripts,p=jo(r),T=d.get(p);T||(T=u.querySelector(Tc(p)),T||(r=m({src:r,async:!0,type:"module"},l),(l=nr.get(p))&&h_(r,l),T=u.createElement("script"),Oi(T),ts(T,"link",r),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},d.set(p,T))}}function bx(r,l,u,d){var p=(p=he.current)?Iu(p):null;if(!p)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=Ho(u.href),u=Vr(p).hoistableStyles,d=u.get(l),d||(d={type:"style",instance:null,count:0,state:null},u.set(l,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=Ho(u.href);var T=Vr(p).hoistableStyles,F=T.get(r);if(F||(p=p.ownerDocument||p,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(r,F),(T=p.querySelector(yc(r)))&&!T._p&&(F.instance=T,F.state.loading=5),nr.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},nr.set(r,u),T||aA(p,r,u,F.state))),l&&d===null)throw Error(i(528,""));return F}if(l&&d!==null)throw Error(i(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=jo(u),u=Vr(p).hoistableScripts,d=u.get(l),d||(d={type:"script",instance:null,count:0,state:null},u.set(l,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Ho(r){return'href="'+ps(r)+'"'}function yc(r){return'link[rel="stylesheet"]['+r+"]"}function yx(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function aA(r,l,u,d){r.querySelector('link[rel="preload"][as="style"]['+l+"]")?d.loading=1:(l=r.createElement("link"),d.preload=l,l.addEventListener("load",function(){return d.loading|=1}),l.addEventListener("error",function(){return d.loading|=2}),ts(l,"link",u),Oi(l),r.head.appendChild(l))}function jo(r){return'[src="'+ps(r)+'"]'}function Tc(r){return"script[async]"+r}function Tx(r,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var d=r.querySelector('style[data-href~="'+ps(u.href)+'"]');if(d)return l.instance=d,Oi(d),d;var p=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),Oi(d),ts(d,"style",p),Pu(d,u.precedence,r),l.instance=d;case"stylesheet":p=Ho(u.href);var T=r.querySelector(yc(p));if(T)return l.state.loading|=4,l.instance=T,Oi(T),T;d=yx(u),(p=nr.get(p))&&c_(d,p),T=(r.ownerDocument||r).createElement("link"),Oi(T);var F=T;return F._p=new Promise(function(H,ie){F.onload=H,F.onerror=ie}),ts(T,"link",d),l.state.loading|=4,Pu(T,u.precedence,r),l.instance=T;case"script":return T=jo(u.src),(p=r.querySelector(Tc(T)))?(l.instance=p,Oi(p),p):(d=u,(p=nr.get(T))&&(d=m({},u),h_(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),Oi(p),ts(p,"link",d),r.head.appendChild(p),l.instance=p);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(d=l.instance,l.state.loading|=4,Pu(d,u.precedence,r));return l.instance}function Pu(r,l,u){for(var d=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,T=p,F=0;F<d.length;F++){var H=d[F];if(H.dataset.precedence===l)T=H;else if(T!==p)break}T?T.parentNode.insertBefore(r,T.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(r,l.firstChild))}function c_(r,l){r.crossOrigin==null&&(r.crossOrigin=l.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=l.referrerPolicy),r.title==null&&(r.title=l.title)}function h_(r,l){r.crossOrigin==null&&(r.crossOrigin=l.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=l.referrerPolicy),r.integrity==null&&(r.integrity=l.integrity)}var Ou=null;function vx(r,l,u){if(Ou===null){var d=new Map,p=Ou=new Map;p.set(u,d)}else p=Ou,d=p.get(u),d||(d=new Map,p.set(u,d));if(d.has(r))return d;for(d.set(r,null),u=u.getElementsByTagName(r),p=0;p<u.length;p++){var T=u[p];if(!(T[An]||T[Li]||r==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var F=T.getAttribute(l)||"";F=r+F;var H=d.get(F);H?H.push(T):d.set(F,[T])}}return d}function Ex(r,l,u){r=r.ownerDocument||r,r.head.insertBefore(u,l==="title"?r.querySelector("head > title"):null)}function oA(r,l,u){if(u===1||l.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return r=l.disabled,typeof l.precedence=="string"&&r==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Ax(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function lA(r,l,u,d){if(u.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var p=Ho(d.href),T=l.querySelector(yc(p));if(T){l=T._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(r.count++,r=wu.bind(r),l.then(r,r)),u.state.loading|=4,u.instance=T,Oi(T);return}T=l.ownerDocument||l,d=yx(d),(p=nr.get(p))&&c_(d,p),T=T.createElement("link"),Oi(T);var F=T;F._p=new Promise(function(H,ie){F.onload=H,F.onerror=ie}),ts(T,"link",d),u.instance=T}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=wu.bind(r),l.addEventListener("load",u),l.addEventListener("error",u))}}var u_=0;function cA(r,l){return r.stylesheets&&r.count===0&&Bu(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var d=setTimeout(function(){if(r.stylesheets&&Bu(r,r.stylesheets),r.unsuspend){var T=r.unsuspend;r.unsuspend=null,T()}},6e4+l);0<r.imgBytes&&u_===0&&(u_=62500*HE());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Bu(r,r.stylesheets),r.unsuspend)){var T=r.unsuspend;r.unsuspend=null,T()}},(r.imgBytes>u_?50:800)+l);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function wu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Fu=null;function Bu(r,l){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Fu=new Map,l.forEach(hA,r),Fu=null,wu.call(r))}function hA(r,l){if(!(l.state.loading&4)){var u=Fu.get(r);if(u)var d=u.get(null);else{u=new Map,Fu.set(r,u);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<p.length;T++){var F=p[T];(F.nodeName==="LINK"||F.getAttribute("media")!=="not all")&&(u.set(F.dataset.precedence,F),d=F)}d&&u.set(null,d)}p=l.instance,F=p.getAttribute("data-precedence"),T=u.get(F)||d,T===d&&u.set(null,p),u.set(F,p),this.count++,d=wu.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),T?T.parentNode.insertBefore(p,T.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),l.state.loading|=4}}var vc={$$typeof:C,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function uA(r,l,u,d,p,T,F,H,ie){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=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=T,this.onRecoverableError=F,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Rx(r,l,u,d,p,T,F,H,ie,ye,Se,De){return r=new uA(r,l,u,F,ie,ye,Se,De,H),l=1,T===!0&&(l|=24),T=Yi(3,null,null,l),r.current=T,T.stateNode=r,l=jf(),l.refCount++,r.pooledCache=l,l.refCount++,T.memoizedState={element:d,isDehydrated:u,cac
vendor: 5,219 bytes, line 50
50he:l},qf(T),r}function Sx(r){return r?(r=Qi,r):Qi}function Mx(r,l,u,d,p,T){p=Sx(p),d.context===null?d.context=p:d.pendingContext=p,d=zn(l),d.payload={element:u},T=T===void 0?null:T,T!==null&&(d.callback=T),u=Gn(r,d,l),u!==null&&(Cs(u,r,l),ec(u,r,l))}function Cx(r,l){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<l?u:l}}function f_(r,l){Cx(r,l),(r=r.alternate)&&Cx(r,l)}function Dx(r){if(r.tag===13||r.tag===31){var l=Ze(r,67108864);l!==null&&Cs(l,r,67108864),f_(r,67108864)}}function Ix(r){if(r.tag===13||r.tag===31){var l=Vs();l=br(l);var u=Ze(r,l);u!==null&&Cs(u,r,l),f_(r,l)}}var Lu=!0;function fA(r,l,u,d){var p=Y.T;Y.T=null;var T=Z.p;try{Z.p=2,d_(r,l,u,d)}finally{Z.p=T,Y.T=p}}function dA(r,l,u,d){var p=Y.T;Y.T=null;var T=Z.p;try{Z.p=8,d_(r,l,u,d)}finally{Z.p=T,Y.T=p}}function d_(r,l,u,d){if(Lu){var p=__(d);if(p===null)Jd(r,l,d,ku,u),Ox(r,d);else if(mA(p,r,l,u,d))d.stopPropagation();else if(Ox(r,d),l&4&&-1<_A.indexOf(r)){for(;p!==null;){var T=Gr(p);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var F=ns(T.pendingLanes);if(F!==0){var H=T;for(H.pendingLanes|=2,H.entangledLanes|=2;F;){var ie=1<<31-Mi(F);H.entanglements[1]|=ie,F&=~ie}Cr(T),(Zt&6)===0&&(bu=we()+500,gc(0))}}break;case 31:case 13:H=Ze(T,2),H!==null&&Cs(H,T,2),Tu(),f_(T,2)}if(T=__(d),T===null&&Jd(r,l,d,ku,u),T===p)break;p=T}p!==null&&d.stopPropagation()}else Jd(r,l,d,null,u)}}function __(r){return r=ro(r),m_(r)}var ku=null;function m_(r){if(ku=null,r=zr(r),r!==null){var l=n(r);if(l===null)r=null;else{var u=l.tag;if(u===13){if(r=o(l),r!==null)return r;r=null}else if(u===31){if(r=c(l),r!==null)return r;r=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;r=null}else l!==r&&(r=null)}}return ku=r,null}function Px(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(ti()){case ci:return 2;case hi:return 8;case ii:case ui:return 32;case Gt:return 268435456;default:return 32}default:return 32}}var g_=!1,$n=null,Jn=null,ea=null,Ec=new Map,Ac=new Map,ta=[],_A="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 Ox(r,l){switch(r){case"focusin":case"focusout":$n=null;break;case"dragenter":case"dragleave":Jn=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":Ec.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ac.delete(l.pointerId)}}function Rc(r,l,u,d,p,T){return r===null||r.nativeEvent!==T?(r={blockedOn:l,domEventName:u,eventSystemFlags:d,nativeEvent:T,targetContainers:[p]},l!==null&&(l=Gr(l),l!==null&&Dx(l)),r):(r.eventSystemFlags|=d,l=r.targetContainers,p!==null&&l.indexOf(p)===-1&&l.push(p),r)}function mA(r,l,u,d,p){switch(l){case"focusin":return $n=Rc($n,r,l,u,d,p),!0;case"dragenter":return Jn=Rc(Jn,r,l,u,d,p),!0;case"mouseover":return ea=Rc(ea,r,l,u,d,p),!0;case"pointerover":var T=p.pointerId;return Ec.set(T,Rc(Ec.get(T)||null,r,l,u,d,p)),!0;case"gotpointercapture":return T=p.pointerId,Ac.set(T,Rc(Ac.get(T)||null,r,l,u,d,p)),!0}return!1}function wx(r){var l=zr(r.target);if(l!==null){var u=n(l);if(u!==null){if(l=u.tag,l===13){if(l=o(u),l!==null){r.blockedOn=l,ls(r.priority,function(){Ix(u)});return}}else if(l===31){if(l=c(u),l!==null){r.blockedOn=l,ls(r.priority,function(){Ix(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Nu(r){if(r.blockedOn!==null)return!1;for(var l=r.targetContainers;0<l.length;){var u=__(r.nativeEvent);if(u===null){u=r.nativeEvent;var d=new u.constructor(u.type,u);so=d,u.target.dispatchEvent(d),so=null}else return l=Gr(u),l!==null&&Dx(l),r.blockedOn=u,!1;l.shift()}return!0}function Fx(r,l,u){Nu(r)&&u.delete(l)}function gA(){g_=!1,$n!==null&&Nu($n)&&($n=null),Jn!==null&&Nu(Jn)&&(Jn=null),ea!==null&&Nu(ea)&&(ea=null),Ec.forEach(Fx),Ac.forEac
vendor: 5,342 bytes, lines 50-58
50h(Fx)}function Uu(r,l){r.blockedOn===l&&(r.blockedOn=null,g_||(g_=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,gA)))}var zu=null;function Bx(r){zu!==r&&(zu=r,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){zu===r&&(zu=null);for(var l=0;l<r.length;l+=3){var u=r[l],d=r[l+1],p=r[l+2];if(typeof d!="function"){if(m_(d||u)===null)continue;break}var T=Gr(u);T!==null&&(r.splice(l,3),l-=3,_d(T,{pending:!0,data:p,method:u.method,action:d},d,p))}}))}function Wo(r){function l(ie){return Uu(ie,r)}$n!==null&&Uu($n,r),Jn!==null&&Uu(Jn,r),ea!==null&&Uu(ea,r),Ec.forEach(l),Ac.forEach(l);for(var u=0;u<ta.length;u++){var d=ta[u];d.blockedOn===r&&(d.blockedOn=null)}for(;0<ta.length&&(u=ta[0],u.blockedOn===null);)wx(u),u.blockedOn===null&&ta.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(d=0;d<u.length;d+=3){var p=u[d],T=u[d+1],F=p[Ki]||null;if(typeof T=="function")F||Bx(u);else if(F){var H=null;if(T&&T.hasAttribute("formAction")){if(p=T,F=T[Ki]||null)H=F.formAction;else if(m_(p)!==null)continue}else H=F.action;typeof H=="function"?u[d+1]=H:(u.splice(d,3),d-=3),Bx(u)}}}function Lx(){function r(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(F){return p=F})},focusReset:"manual",scroll:"manual"})}function l(){p!==null&&(p(),p=null),d||setTimeout(u,20)}function u(){if(!d&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),p!==null&&(p(),p=null)}}}function p_(r){this._internalRoot=r}Gu.prototype.render=p_.prototype.render=function(r){var l=this._internalRoot;if(l===null)throw Error(i(409));var u=l.current,d=Vs();Mx(u,d,r,l,null,null)},Gu.prototype.unmount=p_.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var l=r.containerInfo;Mx(r.current,2,null,r,null,null),Tu(),l[Ur]=null}};function Gu(r){this._internalRoot=r}Gu.prototype.unstable_scheduleHydration=function(r){if(r){var l=ms();r={blockedOn:null,target:r,priority:l};for(var u=0;u<ta.length&&l!==0&&l<ta[u].priority;u++);ta.splice(u,0,r),u===0&&wx(r)}};var kx=e.version;if(kx!=="19.2.1")throw Error(i(527,kx,"19.2.1"));Z.findDOMNode=function(r){var l=r._reactInternals;if(l===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=f(l),r=r!==null?_(r):null,r=r===null?null:r.stateNode,r};var pA={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vu.isDisabled&&Vu.supportsFiber)try{Wt=Vu.inject(pA),si=Vu}catch{}}return Mc.createRoot=function(r,l){if(!s(r))throw Error(i(299));var u=!1,d="",p=jg,T=Wg,F=Xg;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(p=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(F=l.onRecoverableError)),l=Rx(r,1,!1,null,null,u,d,null,p,T,F,Lx),r[Ur]=l.current,$d(r),new p_(l)},Mc.hydrateRoot=function(r,l,u){if(!s(r))throw Error(i(299));var d=!1,p="",T=jg,F=Wg,H=Xg,ie=null;return u!=null&&(u.unstable_strictMode===!0&&(d=!0),u.identifierPrefix!==void 0&&(p=u.identifierPrefix),u.onUncaughtError!==void 0&&(T=u.onUncaughtError),u.onCaughtError!==void 0&&(F=u.onCaughtError),u.onRecoverableError!==void 0&&(H=u.onRecoverableError),u.formState!==void 0&&(ie=u.formState)),l=Rx(r,1,!0,l,u??null,d,p,ie,T,F,H,Lx),l.context=Sx(null),u=l.current,d=Vs(),d=br(d),p=zn(d),p.callback=null,Gn(u,p,d),u=d,l.current.lanes=u,We(l,u),Cr(l),r[Ur]=l.current,$d(r),new Gu(l)},Mc.version="19.2.1",Mc}var Yx;function DA(){if(Yx)return b_.exports;Yx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(e){console.error(e)}}return a(),b_.exports=CA(),b_.exports}var IA=DA();function PA(a,e){if(a instanceof RegExp)return{keys:!1,pattern:a};var t,i,s,n,o=[],c="",h=a.split("/");for(h[0]||h.shift();s=h.shift();)t=s[0],t==="*"?(o.push(t),c+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):t===":"?(i=s.indexOf("?",1),n=s.indexOf(".",1),o.push(s.substring(1,~i?i:~n?n:s.length)),c+=~i&&!~n?"(?:/([^/]+?))?":"/([^/]+?)",~n&&(c+=(~i?"?":"")+"\\"+s.substring(n))):c+="/"+s;return{keys:o,pattern:new RegExp("^"+c+(e?"(?=$|/)":"/?$"),"i")}}var Ge=Rf();const OA=yA(Ge),wA=bA({__proto__:null,default:OA},[Ge]);var A_={exports:{}},R_={};/**
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 qx;function FA(){if(qx)return R_;qx=1;var a=Rf();function e(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}
58var t=typeof Object.is=="function"?Object.is:e,i=a.useState,s=a.useEffect,n=a.useLayoutEffect,o=a.useDebugValue;function c(m,g){var x=g(),y=i({inst:{value:x,getSnapshot:g}}),b=y[0].inst,v=y[1];return n(function(){b.value=x,b.getSnapshot=g,h(b)&&v({inst:b})},[m,x,g]),s(function(){return h(b)&&v({inst:b}),m(function(){h(b)&&v({inst:b})})},[m]),o(x),x}function h(m){var g=m.getSnapshot;m=m.value;try{var x=g();return!t(m,x)}catch{return!0}}function f(m,g){return g()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return R_.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:_,R_}var Kx;function BA(){return Kx||(Kx=1,A_.exports=FA()),A_.exports}var LA=BA();const kA=wA.useInsertionEffect,NA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",UA=NA?Ge.useLayoutEffect:Ge.useEffect,zA=kA||UA,RT=a=>{const e=Ge.useRef([a,(...t)=>e[0](...t)]).current;return zA(()=>{e[0]=a}),e[1]},GA="popstate",fm="pushState",dm="replaceState",VA="hashchange",Zx=[GA,fm,dm,VA],HA=a=>{for(const e of Zx)addEventListener(e,a);return()=>{for(const e of Zx)removeEventListener(e,a)}},ST=(a,e)=>LA.useSyncExternalStore(HA,a,e),jA=()=>location.search,WA=({ssrSearch:a=""}={})=>ST(jA,()=>a),Qx=()=>location.pathname,XA=({ssrPath:a}={})=>ST(Qx,a?()=>a:Qx),YA=(a,{replace:e=!1,state:t=null}={})=>history[e?dm:fm](t,"",a),qA=(a={})=>[XA(a),YA],$x=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[$x]>"u"){for(const a of[fm,dm]){const e=history[a];history[a]=function(){const t=e.apply(this,arguments),i=new Event(a);return i.arguments=arguments,dispatchEvent(i),t}}Object.defineProperty(window,$x,{value:!0})}const KA=(a,e)=>e.toLowerCase().indexOf(a.toLowerCase())?"~"+e:e.slice(a.length)||"/",MT=(a="")=>a==="/"?"":a,ZA=(a,e)=>a[0]==="~"?a.slice(1):MT(e)+a,QA=(a="",e)=>KA(Jx(MT(a)),Jx(e)),Jx=a=>{try{return decodeURI(a)}catch{return a}},CT={hook:qA,searchHook:WA,parser:PA,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:a=>a},DT=Ge.createContext(CT),Wc=()=>Ge.useContext(DT),IT={},PT=Ge.createContext(IT),$A=()=>Ge.useContext(PT),Sf=a=>{const[e,t]=a.hook(a);return[QA(a.base,e),RT((i,s)=>t(ZA(i,a.base),s))]},_m=()=>Sf(Wc()),OT=(a,e,t,i)=>{const{pattern:s,keys:n}=e instanceof RegExp?{keys:!1,pattern:e}:a(e||"*",i),o=s.exec(t)||[],[c,...h]=o;return c!==void 0?[!0,(()=>{const f=n!==!1?Object.fromEntries(n.map((m,g)=>[m,h[g]])):o.groups;let _={...h};return f&&Object.assign(_,f),_})(),...i?[c]:[]]:[!1,null]},JA=({children:a,...e})=>{const t=Wc(),i=e.hook?CT:t;let s=i;const[n,o]=e.ssrPath?.split("?")??[];o&&(e.ssrSearch=o,e.ssrPath=n),e.hrefs=e.hrefs??e.hook?.hrefs;let c=Ge.useRef({}),h=c.current,f=h;for(let _ in i){const m=_==="base"?i[_]+(e[_]||""):e[_]||i[_];h===f&&m!==f[_]&&(c.current=f={...f}),f[_]=m,(m!==i[_]||m!==s[_])&&(s=f)}return Ge.createElement(DT.Provider,{value:s,children:a})},eb=({children:a,component:e},t)=>e?Ge.createElement(e,{params:t}):typeof a=="function"?a(t):a,eR=a=>{let e=Ge.useRef(IT);const t=e.current;return e.current=Object.keys(a).length!==Object.keys(t).length||Object.entries(a).some(([i,s])=>s!==t[i])?a:t},Cc=({path:a,nest:e,match:t,...i})=>{const s=Wc(),[n]=Sf(s),[o,c,h]=t??OT(s.parser,a,n,e),f=eR({...$A(),...c});if(!o)return null;const _=h?Ge.createElement(JA,{base:h},eb(i,f)):eb(i,f);return Ge.createElement(PT.Provider,{value:f,children:_})},na=Ge.forwardRef((a,e)=>
vendor: 8,775 bytes, line 58
58{const t=Wc(),[i,s]=Sf(t),{to:n="",href:o=n,onClick:c,asChild:h,children:f,className:_,replace:m,state:g,...x}=a,y=RT(v=>{v.ctrlKey||v.metaKey||v.altKey||v.shiftKey||v.button!==0||(c?.(v),v.defaultPrevented||(v.preventDefault(),s(o,a)))}),b=t.hrefs(o[0]==="~"?o.slice(1):t.base+o,t);return h&&Ge.isValidElement(f)?Ge.cloneElement(f,{onClick:y,href:b}):Ge.createElement("a",{...x,onClick:y,href:b,className:_?.call?_(i===o):_,children:f,ref:e})}),X_=a=>Array.isArray(a)?a.flatMap(e=>X_(e&&e.type===Ge.Fragment?e.props.children:e)):[a],tR=({children:a,location:e})=>{const t=Wc(),[i]=Sf(t);typeof window<"u"&&(window.__WOUTER_ROUTES__||(window.__WOUTER_ROUTES__=[]),X_(a).forEach(n=>{if(Ge.isValidElement(n)&&n.props.path){const o=n.props.path;window.__WOUTER_ROUTES__.includes(o)||window.__WOUTER_ROUTES__.push(o)}}));for(const s of X_(a)){let n=0;if(Ge.isValidElement(s)&&(n=OT(t.parser,s.props.path,e||i,s.props.nest))[0])return Ge.cloneElement(s,{match:n})}return null};function wT(a){var e,t,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var s=a.length;for(e=0;e<s;e++)a[e]&&(t=wT(a[e]))&&(i&&(i+=" "),i+=t)}else for(t in a)a[t]&&(i&&(i+=" "),i+=t);return i}function iR(){for(var a,e,t=0,i="",s=arguments.length;t<s;t++)(a=arguments[t])&&(e=wT(a))&&(i&&(i+=" "),i+=e);return i}const mm="-",sR=a=>{const e=nR(a),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:o=>{const c=o.split(mm);return c[0]===""&&c.length!==1&&c.shift(),FT(c,e)||rR(o)},getConflictingClassGroupIds:(o,c)=>{const h=t[o]||[];return c&&i[o]?[...h,...i[o]]:h}}},FT=(a,e)=>{if(a.length===0)return e.classGroupId;const t=a[0],i=e.nextPart.get(t),s=i?FT(a.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;const n=a.join(mm);return e.validators.find(({validator:o})=>o(n))?.classGroupId},tb=/^\[(.+)\]$/,rR=a=>{if(tb.test(a)){const e=tb.exec(a)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},nR=a=>{const{theme:e,classGroups:t}=a,i={nextPart:new Map,validators:[]};for(const s in t)Y_(t[s],i,s,e);return i},Y_=(a,e,t,i)=>{a.forEach(s=>{if(typeof s=="string"){const n=s===""?e:ib(e,s);n.classGroupId=t;return}if(typeof s=="function"){if(aR(s)){Y_(s(i),e,t,i);return}e.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([n,o])=>{Y_(o,ib(e,n),t,i)})})},ib=(a,e)=>{let t=a;return e.split(mm).forEach(i=>{t.nextPart.has(i)||t.nextPart.set(i,{nextPart:new Map,validators:[]}),t=t.nextPart.get(i)}),t},aR=a=>a.isThemeGetter,oR=a=>{if(a<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,i=new Map;const s=(n,o)=>{t.set(n,o),e++,e>a&&(e=0,i=t,t=new Map)};return{get(n){let o=t.get(n);if(o!==void 0)return o;if((o=i.get(n))!==void 0)return s(n,o),o},set(n,o){t.has(n)?t.set(n,o):s(n,o)}}},q_="!",K_=":",lR=K_.length,cR=a=>{const{prefix:e,experimentalParseClassName:t}=a;let i=s=>{const n=[];let o=0,c=0,h=0,f;for(let y=0;y<s.length;y++){let b=s[y];if(o===0&&c===0){if(b===K_){n.push(s.slice(h,y)),h=y+lR;continue}if(b==="/"){f=y;continue}}b==="["?o++:b==="]"?o--:b==="("?c++:b===")"&&c--}const _=n.length===0?s:s.substring(h),m=hR(_),g=m!==_,x=f&&f>h?f-h:void 0;return{modifiers:n,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:x}};if(e){const s=e+K_,n=i;i=o=>o.startsWith(s)?n(o.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(t){const s=i;i=n=>t({className:n,parseClassName:s})}return i},hR=a=>a.endsWith(q_)?a.substring(0,a.length-1):a.startsWith(q_)?a.substring(1):a,uR=a=>{const e=Object.fromEntries(a.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const s=[];let n=[];return i.forEach(o=>{o[0]==="["||e[o]?(s.push(...n.sort(),o),n=[]):n.push(o)}),s.push(...n.sort()),s}},fR=a=>({cache:oR(a.cacheSize),parseClassName:cR(a),sortModifiers:uR(a),...sR(a)}),dR=/\s+/,_R=(a,e)=>{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:n}=e,o=[],c=a.trim().split(dR);let h="";for(let f=c.length-1;f>=0;f-=1){const _=c[f],{isExternal:m,modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:b}=t(_);if(m){h=_+(h.length>0?" "+h:h);continue}let v=!!b,E=i(v?y.substring(0,b):y);if(!E){if(!v){h=_+(h.length>0?" "+h:h);continue}if(E=i(y),!E){h=_+(h.length>0?" "+h:h);continue}v=!1}const R=n(g).join(":"),C=x?R+q_:R,O=C+E;if(o.includes(O))continue;o.push(O);const M=s(E,v);for(let I=0;I<M.length;++I){const P=M[I];o.push(C+P)}h=_+(h.length>0?" "+h:h)}return h};function mR(){let a=0,e,t,i="";for(;a<arguments.length;)(e=arguments[a++])&&(t=BT(e))&&(i&&(i+=" "),i+=t);return i}const BT=a=>{if(typeof a=="string")return a;let e,t="";for(let i=0;i<a.length;i++)a[i]&&(e=BT(a[i]))&&(t&&(t+=" "),t+=e);return t};function gR(a,...e){let t,i,s,n=o;function o(h){const f=e.reduce((_,m)=>m(_),a());return t=fR(f),i=t.cache.get,s=t.cache.set,n=c,c(h)}function c(h){const f=i(h);if(f)return f;const _=_R(h,t);return s(h,_),_}return function(){return n(mR.apply(null,arguments))}}const ji=a=>{const e=t=>t[a]||[];return e.isThemeGetter=!0,e},LT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pR=/^\d+\/\d+$/,xR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bR=/\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$/,yR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,TR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xo=a=>pR.test(a),St=a=>!!a&&!Number.isNaN(Number(a)),sa=a=>!!a&&Number.isInteger(Number(a)),S_=a=>a.endsWith("%")&&St(a.slice(0,-1)),dn=a=>xR.test(a),ER=()=>!0,AR=a=>bR.test(a)&&!yR.test(a),NT=()=>!1,RR=a=>TR.test(a),SR=a=>vR.test(a),MR=a=>!it(a)&&!st(a),CR=a=>sl(a,GT,NT),it=a=>LT.test(a),La=a=>sl(a,VT,AR),M_=a=>sl(a,wR,St),sb=a=>sl(a,UT,NT),DR=a=>sl(a,zT,SR),Hu=a=>sl(a,HT,RR),st=a=>kT.test(a),Dc=a=>rl(a,VT),IR=a=>rl(a,FR),rb=a=>rl(a,UT),PR=a=>rl(a,GT),OR=a=>rl(a,zT),ju=a=>rl(a,HT,!0),sl=(a,e,t)=>{const i=LT.exec(a);return i?i[1]?e(i[1]):t(i[2]):!1},rl=(a,e,t=!1)=>{const i=kT.exec(a);return i?i[1]?e(i[1]):t:!1},UT=a=>a==="position"||a==="percentage",zT=a=>a==="image"||a==="url",GT=a=>a==="length"||a==="size"||a==="bg-size",VT=a=>a==="length",wR=a=>a==="number",FR=a=>a==="family-name",HT=a=>a==="shadow",BR=()=>{const a=ji("color"),e=ji("font"),t=ji("text"),i=ji("font-weight"),s=ji("tracking"),n=ji("leading"),o=ji("breakpoint"),c=ji("container"),h=ji("spacing"),f=ji("radius"),_=ji("shadow"),m=ji("inset-shadow"),g=ji("text-shadow"),x=ji("drop-shadow"),y=ji("blur"),b=ji("perspective"),v=ji("aspect"),E=ji("ease"),R=ji("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...O(),st,it],I=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],L=()=>[st,it,h],V=()=>[Xo,"full","auto",...L()],X=()=>[sa,"none","subgrid",st,it],re=()=>["auto",{span:["full",sa,st,it]},sa,st,it],ae=()=>[sa,"auto",st,it],de=()=>["auto","min","max","fr",st,it],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...L()],Z=()=>[Xo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],q=()=>[a,st,it],j=()=>[...O(),rb,sb,{position:[st,it]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],w=()=>["auto","cover","contain",PR,CR,{size:[st,it]}],B=()=>[S_,Dc,La],z=()=>["","none","full",f,st,it],K=()=>["",St,Dc,La],ue=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[St,S_,rb,sb],Le=()=>["","none",y,st,it],ke=()=>["none",St,st,it],J=()=>["none",St,st,it],_e=()=>[St,st,it],xe=()=>[Xo,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[dn],breakpoint:[dn],color:[ER],container:[dn],"drop-shadow":[dn],ease:["in","out","in-out"],font:[MR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[dn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[dn],shadow:[dn],spacing:["px",St],text:[dn],"text-shadow":[dn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xo,it,st,v]}
vendor: 12,854 bytes, line 58
58],container:["container"],columns:[{columns:[St,it,st,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:M()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[sa,"auto",st,it]}],basis:[{basis:[Xo,"full","auto",c,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[St,Xo,"auto","initial","none",it]}],grow:[{grow:["",St,st,it]}],shrink:[{shrink:["",St,st,it]}],order:[{order:[sa,"first","last","none",st,it]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:re()}],"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":de()}],"auto-rows":[{"auto-rows":de()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[c,"screen",...Z()]}],"min-w":[{"min-w":[c,"screen","none",...Z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",t,Dc,La]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,st,M_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",S_,it]}],"font-family":[{font:[IR,it,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:[s,st,it]}],"line-clamp":[{"line-clamp":[St,"none",st,M_]}],leading:[{leading:[n,...L()]}],"list-image":[{"list-image":["none",st,it]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",st,it]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[St,"from-font","auto",st,La]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[St,"auto",st,it]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",st,it]}],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",st,it]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:w()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sa,st,it],radial:["",st,it],conic:[sa,st,it]},OR,DR]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[St,st,it]}],"outline-w":[{outline:["",St,Dc,La]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",_,ju,Hu]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",m,ju,Hu]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[St,La]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",g,ju,Hu]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[St,st,it]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"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":[St]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[st,it]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[St]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:w()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",st,it]}],filter:[{filter:["","none",st,it]}],blur:[{blur:Le()}],brightness:[{brightness:[St,st,it]}],contrast:[{contrast:[St,st,it]}],"drop-shadow":[{"drop-shadow":["","none",x,ju,Hu]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",St,st,it]}],"hue-rotate":[{"hue-rotate":[St,st,it]}],invert:[{invert:["",St,st,it]}],saturate:[{saturate:[St,st,it]}],sepia:[{sepia:["",St,st,it]}],"backdrop-filter":[{"backdrop-filter":["","none",st,it]}],"backdrop-blur":[{"backdrop-blur":Le()}],"backdrop-brightness":[{"backdrop-brightness":[St,st,it]}],"backdrop-contrast":[{"backdrop-contrast":[St,st,it]}],"backdrop-grayscale":[{"backdrop-grayscale":["",St,st,it]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[St,st,it]}],"backdrop-invert":[{"backdrop-invert":["",St,st,it]}],"backdrop-opacity":[{"backdrop-opacity":[St,st,it]}],"backdrop-saturate":[{"backdrop-saturate":[St,st,it]}],"backdrop-sepia":[{"backdrop-sepia":["",St,st,it]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",st,it]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[St,"initial",st,it]}],ease:[{ease:["linear","initial",E,st,it]}],delay:[{delay:[St,st,it]}],animate:[{animate:["none",R,st,it]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,st,it]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:J()}],"scale-x":[{"scale-x":J()}],"scale-y":[{"scale-y":J()}],"scale-z":[{"scale-z":J()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[st,it,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}
vendor: 7,033 bytes, lines 58-97
58],"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",st,it]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",st,it]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[St,Dc,La,M_]}],stroke:[{stroke:["none",...q()]}],"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"]}},LR=gR(BR);function kR(...a){return LR(iR(a))}/**
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 NR=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jT=(...a)=>a.filter((e,t,i)=>!!e&&i.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 UR={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 zR=Ge.forwardRef(({color:a="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:s="",children:n,iconNode:o,...c},h)=>Ge.createElement("svg",{ref:h,...UR,width:e,height:e,stroke:a,strokeWidth:i?Number(t)*24/Number(e):t,className:jT("lucide",s),...c},[...o.map(([f,_])=>Ge.createElement(f,_)),...Array.isArray(n)?n:[n]]));/**
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 Dt=(a,e)=>{const t=Ge.forwardRef(({className:i,...s},n)=>Ge.createElement(zR,{ref:n,iconNode:e,className:jT(`lucide-${NR(a)}`,i),...s}));return t.displayName=`${a}`,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 WT=Dt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
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 GR=Dt("ArrowRightFromLine",[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M21 12H7",key:"13ipq5"}],["path",{d:"m15 18 6-6-6-6",key:"6tx3qv"}]]);/**
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 C_=Dt("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 VR=Dt("BookOpenCheck",[["path",{d:"M12 21V7",key:"gj6g52"}],["path",{d:"m16 12 2 2 4-4",key:"mdajum"}],["path",{d:"M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3",key:"8arnkb"}]]);/**
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 HR=Dt("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"}]]);/**
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 rf=Dt("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"}]]);/**
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 Wa=Dt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 gm=Dt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 jR=Dt("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
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 WR=Dt("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
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 XR=Dt("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);/**
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 YR=Dt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
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 qR=Dt("FileCheck2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3 15 2 2 4-4",key:"1lhrkk"}]]);/**
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 KR=Dt("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
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 XT=Dt("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"}]]);/**
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 Ka=Dt("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
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 Z_=Dt("Gavel",[["path",{d:"m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8",key:"15492f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m9 7 8 8",key:"5jnvq1"}],["path",{d:"m21 11-8-8",key:"z4y7zo"}]]);/**
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 ZR=Dt("Grid2x2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
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 YT=Dt("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
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 QR=Dt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 pm=Dt("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"}]]);/**
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 $R=Dt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
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 JR=Dt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 xm=Dt("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"}]]);/**
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 Br=Dt("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"}
203],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
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 nl=Dt("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"}]]);/**
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 Mf=Dt("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"}]]);/**
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 nf=Dt("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"}]]);/**
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 Cf=Dt("Swords",[["polyline",{points:"14.5 17.5 3 6 3 3 6 3 17.5 14.5",key:"1hfsw2"}],["line",{x1:"13",x2:"19",y1:"19",y2:"13",key:"1vrmhu"}],["line",{x1:"16",x2:"20",y1:"16",y2:"20",key:"1bron3"}],["line",{x1:"19",x2:"21",y1:"21",y2:"19",key:"13pww6"}],["polyline",{points:"14.5 6.5 18 3 21 3 21 6 17.5 9.5",key:"hbey2j"}],["line",{x1:"5",x2:"9",y1:"14",y2:"18",key:"1hf58s"}],["line",{x1:"7",x2:"4",y1:"17",y2:"20",key:"pidxm4"}],["line",{x1:"3",x2:"5",y1:"19",y2:"21",key:"1pehsh"}]]);/**
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 qT=Dt("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"}]]);/**
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 KT=Dt("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"}]]);/**
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 eS=Dt("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
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 tS=Dt("Volume1",[["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"}]]);/**
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 iS=Dt("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"}]]);/**
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 sS=Dt("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"}]]);/**
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 ZT=Dt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 6,827 bytes, lines 258-263
258],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
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 Za=Dt("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 rS extends Ge.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?A.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:27",className:"flex items-center justify-center min-h-screen p-8 bg-background",children:A.jsxs("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:28",className:"flex flex-col items-center w-full max-w-2xl p-8",children:[A.jsx(qT,{"data-loc":"client/src/components/ErrorBoundary.tsx:29",size:48,className:"text-destructive mb-6 flex-shrink-0"}),A.jsx("h2",{"data-loc":"client/src/components/ErrorBoundary.tsx:34",className:"text-xl mb-4",children:"An unexpected error occurred."}),A.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:36",className:"p-4 w-full rounded bg-muted overflow-auto mb-6",children:A.jsx("pre",{"data-loc":"client/src/components/ErrorBoundary.tsx:37",className:"text-sm text-muted-foreground whitespace-break-spaces",children:this.state.error?.stack})}),A.jsxs("button",{"data-loc":"client/src/components/ErrorBoundary.tsx:42",onClick:()=>window.location.reload(),className:kR("flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground","hover:opacity-90 cursor-pointer"),children:[A.jsx(xm,{"data-loc":"client/src/components/ErrorBoundary.tsx:50",size:16}),"Reload Page"]})]})}):this.props.children}}const nS=typeof WeakRef<"u";class aS{constructor(e,t=!1,i,s){this.initialize(e,t,i,s)}initialize(e,t=!1,i,s){return this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=s,this}}class oS{constructor(e,t,i=null){this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(e=!1){this._remove&&this._remove(e)}}class Me{static FromPromise(e,t){const i=new Me;return e.then(s=>{i.notifyObservers(s)}).catch(s=>{if(t)t.notifyObservers(s);else throw s}),i}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 aS(0),e&&(this._onObserverAdded=e)}add(e,t=-1,i=!1,s=null,n=!1){if(!e)return null;const o=new oS(e,t,s);o.unregisterOnNextCall=n,i?this._observers.unshift(o):this._observers.push(o),this._onObserverAdded&&this._onObserverAdded(o),this._hasNotified&&this.notifyIfTriggered&&this.notifyObserver(o,this._lastNotifiedValue);const c=nS?new WeakRef(this):{deref:()=>this};return o._remove=(h=!1)=>{const f=c.deref();f&&(h?f.remove(o):f._remove(o))},o}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 i=0;i<this._observers.length;i++){const s=this._observers[i];if(!s._willBeUnregistered&&s.callback===e&&(!t||t===s.scope))return this._deferUnregister(s),!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 i=this._observers.indexOf(e);return i!==-1?(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,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,i,s,n){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;const o=this._eventState;o.mask=t,o.target=i,o.currentTarget=s,o.skipNextObservers=!1,o.lastReturnValue=e,o.userInfo=n;for(const c of this._observers)if(!c._willBeUnregistered&&(c.mask&t&&(c.unregisterOnNextCall&&this._deferUnregister(c),c.scope?o.lastReturnValue=c.callback.apply(c.scope,[e,o]):o.lastReturnValue=c.callback(e,o)),o.skipNextObservers))return!1;return!0}notifyObserver(e,t,i=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;const s=this._eventState;s.mask=i,s.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,s)}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 Me;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 lS{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,i=1,s=1,n=2,o=0){return this._cachedWrapU=e,this._cachedWrapV=t,this._cachedWrapR=i,this._cachedAnisotropicFilteringLevel=s,this.samplingMode=n,this._comparisonFunction=o,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 nb;(function(a){a[a.Unknown=0]="Unknown",a[a.Url=1]="Url",a[a.Temp=2]="Temp",a[a.Raw=3]="Raw",a[a.Dynamic=4]="Dynamic",a[a.RenderTarget=5]="RenderTarget",a[a.MultiRenderTarget=6]="MultiRenderTarget",a[a.Cube=7]="Cube",a[a.CubeRaw=8]="CubeRaw",a[a.CubePrefiltered=9]="CubePrefiltered",a[a.Raw3D=10]="Raw3D",a[a.Raw2DArray=11]="Raw2DArray",a[a.DepthStencil=12]="DepthStencil",a[a.CubeRawRGBD=13]="CubeRawRGBD",a[a.Depth=14]="Depth",a[a.External=15]="Exter
263nal"})(nb||(nb={}));class Es extends lS{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,i=!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 Me,this.onErrorObservable=new Me,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=Es._Counter++,i||(this._hardwareTexture=e._createHardwareTexture())}incrementReferences(){this._references++}updateSize(e,t,i=1){this._engine.updateTextureDimensions(this,e,t,i),this.width=e,this.height=t,this.depth=i,this.baseWidth=e,this.baseHeight=t,this.baseDepth=i,this._size=e*t*i}_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),i=s=>{s._swapAndDie(this,!1),this.isReady=t.isReady};t.isAsync?t.proxy.then(i):i(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 i=this._bufferViewArray[t];i&&this._engine.updateRawTexture(this,i,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 i=this._bufferViewArray[t];i&&this._engine.updateRawTexture2DArray(this,i,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(Es._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 i=this._engine.getLoadedTexturesCache();let s=i.indexOf(this);s!==-1&&i.splice(s,1),s=i.indexOf(e),s===-1&&i.push(e)}dispose(){this._references--,this._references===0&&(this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._engine._releaseTexture(this),this._hardwareTexture=null,this._dynamicTextureSource=null)}}Es._Counter=0;class mt{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}mt.Instances=[];mt.OnEnginesDisposedObservable=new Me;mt._LastCreatedScene=null;mt.UseFallbackTexture=!0;mt.FallbackTexture="";class pe{static _CheckLimit(e,t){let i=pe._LogLimitOutputs[e];return i?i.current++:(i={limit:t,current:1},pe._LogLimitOutputs[e]=i),i.current<=i.limit}static _GenerateLimitMessage(e,t=1){const i=pe._LogLimitOutputs[e];if(!i||!pe.MessageLimitReached)return;const s=this._Levels[t];i.current===i.limit&&pe[s.name](pe.MessageLimitReached.replace(/%LIMIT%/g,""+i.limit).replace(/%TYPE%/g,s.name??""))}static _AddLogEntry(e){pe._LogCache=e+pe._LogCache,pe.OnNewCacheEntry&&pe.OnNewCacheEntry(e)}static _FormatMessage(e){const t=s=>s<10?"0"+s:""+s,i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,t,i){const s=Array.isArray(t)?t[0]:t;if(i!==void 0&&!pe._CheckLimit(s,i))return;const n=pe._FormatMessage(s),o=this._Levels[e],c=Array.isArray(t)?t.slice(1):[];o.logFunc&&o.logFunc("BJS - "+n,...c);const h=`<div style='color:${o.color}'>${n}</div><br>`;pe._AddLogEntry(h),pe._GenerateLimitMessage(s,e)}static get LogCache(){return pe._LogCache}static ClearLogCache(){pe._LogCache="",pe._LogLimitOutputs={},pe.errorsCount=0}static set LogLevels(e){pe.Log=pe._LogDisabled,pe.Warn=pe._LogDisabled,pe.Error=pe._LogDisabled;const t=[pe.MessageLogLevel,pe.WarningLogLevel,pe.ErrorLogLevel];for(const i of t)if((e&i)===i){const s=this._Levels[i];pe[s.name]=pe._LogEnabled.bind(pe,i)}}}pe.NoneLogLevel=0;pe.MessageLogLevel=1;pe.WarningLogLevel=2;pe.ErrorLogLevel=4;pe.AllLogLevel=7;pe.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";pe._LogCache="";pe._LogLimitOutputs={};pe._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}];pe.errorsCount=0;pe.Log=pe._LogEnabled.bind(pe,pe.MessageLogLevel);pe.Warn=pe._LogEnabled.bind(pe,pe.WarningLogLevel);pe.Error=pe._LogEnabled.bind(pe,pe.ErrorLogLevel);class Ti{static GetShadersRepository(e=0){return e===0?Ti.ShadersRepository:Ti.ShadersRepositoryWGSL}static GetShadersStore(e=0){return e===0?Ti.ShadersStore:Ti.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){return e===0?Ti.IncludesShadersStore:Ti.IncludesShadersStoreWGSL}}Ti.ShadersRepository="src/Shaders/";Ti.ShadersStore={};Ti.IncludesShadersStore={};Ti.ShadersRepositoryWGSL="src/ShadersWGSL/";Ti.ShadersStoreWGSL={};Ti.IncludesShadersStoreWGSL={};function Xi(){return typeof window<"u"}function qo(){return typeof navigator<"u"}function Ha(){return typeof document<"u"}function QT(a){let e="",t=a.firstChild;for(;t;)t.nodeType===3&&(e+=t.textContent),t=t.nextSibling;return e}class cS{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,i,s,n,o,c,h){const f=this.engine;if(f.supportsUniformBuffers)for(const g in t)e.bindUniformBlock(g,t[g]);
vendor: 5,088 bytes, line 263
263this.engine.getUniforms(this,i).forEach((g,x)=>{s[i[x]]=g}),this._uniforms=s;let m;for(m=0;m<n.length;m++)e.getUniform(n[m])==null&&(n.splice(m,1),m--);n.forEach((g,x)=>{o[g]=x});for(const g of f.getAttributes(this,c))h.push(g)}dispose(){this._uniforms={},this._isDisposed=!0}_cacheMatrix(e,t){const i=this._valueCache[e],s=t.updateFlag;return i!==void 0&&i===s?!1:(this._valueCache[e]=s,!0)}_cacheFloat2(e,t,i){let s=this._valueCache[e];if(!s||s.length!==2)return s=[t,i],this._valueCache[e]=s,!0;let n=!1;return s[0]!==t&&(s[0]=t,n=!0),s[1]!==i&&(s[1]=i,n=!0),n}_cacheFloat3(e,t,i,s){let n=this._valueCache[e];if(!n||n.length!==3)return n=[t,i,s],this._valueCache[e]=n,!0;let o=!1;return n[0]!==t&&(n[0]=t,o=!0),n[1]!==i&&(n[1]=i,o=!0),n[2]!==s&&(n[2]=s,o=!0),o}_cacheFloat4(e,t,i,s,n){let o=this._valueCache[e];if(!o||o.length!==4)return o=[t,i,s,n],this._valueCache[e]=o,!0;let c=!1;return o[0]!==t&&(o[0]=t,c=!0),o[1]!==i&&(o[1]=i,c=!0),o[2]!==s&&(o[2]=s,c=!0),o[3]!==n&&(o[3]=n,c=!0),c}setInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setInt4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setInt4(this._uniforms[e],t,i,s,n)||(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 i=this._valueCache[e];i!==void 0&&i===t||this.engine.setUInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setUInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setUInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setUInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setUInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setUInt4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setUInt4(this._uniforms[e],t,i,s,n)||(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.setMatrices(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 i=this._valueCache[e];i!==void 0&&i===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,i){this._cacheFloat2(e,t,i)&&(this.engine.setFloat2(this._uniforms[e],t,i)||(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,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setFloat3(this._uniforms[e],t,i,s)||(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,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setFloat4(this._uniforms[e],t,i,s,n)||(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,i){this._cacheFloat4(e,t.r,t.g,t.b,i)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,i)||(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 ab={};
263function Je(a,e=!1){if(!(e&&ab[a]))return ab[a]=!0,`${a} needs to be imported before as it contains a side-effect required by your code.`}const ob={};let hS=!1,uS=0;function Xe(a,e,t=!1){const i=function(){if((t||hS)&&uS===0){const s=`${a}.${e}`;ob[s]||(ob[s]=!0,console.warn(`[Babylon.js] ${s}() requires a side-effect import. See: https://doc.babylonjs.com/setup/treeshaking`))}};return i.__isSideEffectStub=!0,i}function bm(a){return a?!a.__isSideEffectStub:!1}function gt(a,e){return{get(){},set(t){Object.defineProperty(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0}}const Ga={};function $T(a,e,t=""){return t+(e?e+`
264`:"")+a}function JT(a,e,t,i,s,n,o){const c=o||Ga.loadFile;if(!c)throw Je("FileTools");return c(a,e,t,i,s,n)}function ev(a,e,t,i){if(a){e?a.IS_NDC_HALF_ZRANGE="":delete a.IS_NDC_HALF_ZRANGE,t?a.USE_REVERSE_DEPTHBUFFER="":delete a.USE_REVERSE_DEPTHBUFFER,i?a.USE_EXACT_SRGB_CONVERSIONS="":delete a.USE_EXACT_SRGB_CONVERSIONS;return}else{let s="";return e&&(s+="#define IS_NDC_HALF_ZRANGE"),t&&(s&&(s+=`
265`),s+="#define USE_REVERSE_DEPTHBUFFER"),i&&(s&&(s+=`
266`),s+="#define USE_EXACT_SRGB_CONVERSIONS"),s}}function fS(a,e,t=!1,i){switch(a){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 Q_=new WeakMap,dS={_webGLVersion:2,cachedPipelines:{}};function Ps(a){let e=Q_.get(a);if(!e){if(!a)return dS;e={_webGLVersion:a.TEXTURE_BINDING_3D?2:1,_context:a,parallelShaderCompile:a.getExtension("KHR_parallel_shader_compile")||void 0,cachedPipelines:{}},Q_.set(a,e)}return e}function D_(a){Q_.delete(a)}function tv(a,e,t,i,s,n){const o=Ps(i);n||(n=o._createShaderProgramInjection??ym);const c=$_(e,"vertex",i,o._contextWasLost),h=$_(t,"fragment",i,o._contextWasLost);return n(a,c,h,i,s,o.validateShaderPrograms)}function iv(a,e,t,i,s,n=null,o){const c=Ps(s);o||(o=c._createShaderProgramInjection??ym);const h=c._webGLVersion>1?`#version 300 es
267#define WEBGL2 
268`:"",f=lb(e,"vertex",i,h,s,c._contextWasLost),_=lb(t,"fragment",i,h,s,c._contextWasLost);return o(a,f,_,s,n,c.validateShaderPrograms)}function _S(a,e){const t=new cS,i=Ps(a);return i.parallelShaderCompile&&!i.disableParallelShaderCompile&&(t.isParallelCompiled=!0),t.context=i._context,t}function ym(a,e,t,i,s=null,n){const o=i.createProgram();if(a.program=o,!o)throw new Error("Unable to create program");return i.attachShader(o,e),i.attachShader(o,t),i.linkProgram(o),a.context=i,a.vertexShader=e,a.fragmentShader=t,a.isParallelCompiled||Tm(a,i,n),o}function mS(a,e,t){const i=a;if(i._isDisposed)return!1;const s=Ps(e);return s&&s.parallelShaderCompile&&s.parallelShaderCompile.COMPLETION_STATUS_KHR&&i.program&&e.getProgramParameter(i.program,s.parallelShaderCompile.COMPLETION_STATUS_KHR)?(Tm(i,e,t),!0):!1}function Tm(a,e,t){const i=a.context,s=a.vertexShader,n=a.fragmentShader,o=a.program;if(!i.getProgramParameter(o,i.LINK_STATUS)){if(!e.getShaderParameter(s,e.COMPILE_STATUS)){const f=e.getShaderInfoLog(s);if(f)throw a.vertexCompilationError=f,new Error("VERTEX SHADER "+f)}if(!e.getShaderParameter(n,e.COMPILE_STATUS)){const f=e.getShaderInfoLog(n);if(f)throw a.fragmentCompilationError=f,new Error("FRAGMENT SHADER "+f)}const h=i.getProgramInfoLog(o);if(h)throw a.programLinkError=h,new Error(h)}if(t&&(i.validateProgram(o),!i.getProgramParameter(o,i.VALIDATE_STATUS))){const f=i.getProgramInfoLog(o);if(f)throw a.programValidationError=f,new Error(f)}i.deleteShader(s),i.deleteShader(n),a.vertexShader=void 0,a.fragmentShader=void 0,a.onCompiled&&(a.onCompiled(),a.onCompiled=void 0)}function gS(a,e,t,i,s,n,o,c,h,f="",_,m,g){const x=Ps(a.context);m||(m=x.createRawShaderProgramInjection??tv),g||(g=x.createShaderProgramInjection??iv);const y=a;i?y.program=m(y,e,t,y.context,h):y.program=g(y,e,t,c,y.context,h),y.program.__SPECTOR_rebuildProgram=o,_()}function lb(a,e,t,i,s,n){return $_($T(a,t,i),e,s,n)}function $_(a,e,t,i){const s=t.createShader(e==="vertex"?t.VERTEX_SHADER:t.FRAGMENT_SHADER);if(!s){let n=t.NO_ERROR,o;for(;(o=t.getError())!==t.NO_ERROR;)n=o;throw new Error(`Something went wrong while creating a gl ${e} shader object. gl error=${n}, gl isContextLost=${t.isContextLost()}, _contextWasLost=${i}`)}return t.shaderSource(s,a),t.compileShader(s),s}function pS(a,e){e.useProgram(a)}function xS(a,e){const t=a;if(!t.isParallelCompiled){e(a);return}const i=t.onCompiled;t.onCompiled=()=>{i?.(),e(a)}}const bS="attribute",yS="varying";class Xc{constructor(){this.children=[]}isValid(e){return!0}process(e,t,i){let s="";if(this.line){let n=this.line;const o=t.processor;if(o){o.lineProcessor&&(n=o.lineProcessor(n,t.isFragment,t.processingContext));const c=t.processor?.attributeKeywordName??bS,h=t.isFragment&&t.processor?.varyingFragmentKe
vendor: 37,284 bytes, lines 268-280
268ywordName?t.processor?.varyingFragmentKeywordName:!t.isFragment&&t.processor?.varyingVertexKeywordName?t.processor?.varyingVertexKeywordName:yS;!t.isFragment&&o.attributeProcessor&&this.line.startsWith(c)?n=o.attributeProcessor(this.line,e,t.processingContext):o.varyingProcessor&&(o.varyingCheck?.(this.line,t.isFragment)||!o.varyingCheck&&this.line.startsWith(h))?n=o.varyingProcessor(this.line,t.isFragment,e,t.processingContext):o.uniformProcessor&&o.uniformRegexp&&o.uniformRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(n=o.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):o.uniformBufferProcessor&&o.uniformBufferRegexp&&o.uniformBufferRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(n=o.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0):o.textureProcessor&&o.textureRegexp&&o.textureRegexp.test(this.line)?n=o.textureProcessor(this.line,t.isFragment,e,t.processingContext):(o.uniformProcessor||o.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer&&(/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?o.uniformProcessor&&(n=o.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):o.uniformBufferProcessor&&(n=o.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)),t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,o.endOfUniformBufferProcessor&&(n=o.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}s+=n+`
269`}for(const n of this.children)s+=n.process(e,t,i);return this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true",i[this.additionalDefineKey]=e[this.additionalDefineKey]),s}}class TS{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 i=t.trim();if(!i)continue;if(i.startsWith("//")){this._lines.push(t);continue}const s=i.indexOf(";");if(s===-1)this._lines.push(i);else if(s===i.length-1)i.length>1&&this._lines.push(i);else{const n=t.split(";");for(let o=0;o<n.length;o++){let c=n[o];c&&(c=c.trim(),c&&this._lines.push(c+(o!==n.length-1?";":"")))}}}}}class I_ extends Xc{process(e,t,i){for(let s=0;s<this.children.length;s++){const n=this.children[s];if(n.isValid(e))return n.process(e,t,i)}return""}}class vS extends Xc{isValid(e){return this.testExpression.isTrue(e)}}class _i{isTrue(e){return!0}static postfixToInfix(e){const t=[];for(const i of e)if(_i._OperatorPriority[i]===void 0)t.push(i);else{const s=t[t.length-1],n=t[t.length-2];t.length-=2,t.push(`(${n}${i}${s})`)}return t[t.length-1]}static infixToPostfix(e){const t=_i._InfixToPostfixCache.get(e);if(t)return t.accessTime=Date.now(),t.result;if(!e.includes("&&")&&!e.includes("||")&&!e.includes(")")&&!e.includes("("))return[e];const i=[];let s=-1;const n=()=>{_=_.trim(),_!==""&&(i.push(_),_="")},o=m=>{s<_i._Stack.length-1&&(_i._Stack[++s]=m)},c=()=>_i._Stack[s],h=()=>s===-1?"!!INVALID EXPRESSION!!":_i._Stack[s--];let f=0,_="";for(;f<e.length;){const m=e.charAt(f),g=f<e.length-1?e.substring(f,2+f):"";if(m==="(")_="",o(m);else if(m===")"){for(n();s!==-1&&c()!=="(";)i.push(h());h()}else if(_i._OperatorPriority[g]>1){for(n();s!==-1&&_i._OperatorPriority[c()]>=_i._OperatorPriority[g];)i.push(h());o(g),f++}else _+=m;f++}for(n();s!==-1;)c()==="("?h():i.push(h());return _i._InfixToPostfixCache.size>=_i.InfixToPostfixCacheLimitSize&&_i.ClearCache(),_i._InfixToPostfixCache.set(e,{result:i,accessTime:Date.now()}),i}static ClearCache(){const e=Array.from(_i._InfixToPostfixCache.entries()).sort((t,i)=>t[1].accessTime-i[1].accessTime);for(let t=0;t<_i.InfixToPostfixCacheCleanupSize;t++)_i._InfixToPostfixCache.delete(e[t][0])}}_i.InfixToPostfixCacheLimitSize=5e4;_i.InfixToPostfixCacheCleanupSize=25e3;_i._InfixToPostfixCache=new Map;_i._OperatorPriority={")":0,"(":1,"||":2,"&&":3};_i._Stack=["","","","","","","","","","","","","","","","","","","",""];class af extends _i{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 ES extends _i{isTrue(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)}}class AS extends _i{isTrue(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)}}class RS extends _i{constructor(e,t,i){super(),this.define=e,this.operand=t,this.testValue=i}toString(){return`${this.define} ${this.operand} ${this.testValue}`}isTrue(e){let t=!1;const i=parseInt(e[this.define]!=null?e[this.define]:this.define),s=parseInt(e[this.testValue]!=null?e[this.testValue]:this.testValue);if(isNaN(i)||isNaN(s))return!1;switch(this.operand){case">":t=i>s;break;case"<":t=i<s;break;case"<=":t=i<=s;break;case">=":t=i>=s;break;case"==":t=i===s;break;case"!=":t=i!==s;break}return t}}const SS=/defined\s*?\((.+?)\)/g,P_=/defined\s*?\[(.+?)\]/g,MS=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g,CS=/__decl__/,cb=/light\{X\}.(\w*)/g,hb=/\{X\}/g,Wu=[],DS=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;function IS(a){a.processor&&a.processor.initializeShaders&&a.processor.initializeShaders(a.processingContext)}function ub(a,e,t,i){e.processor?.preProcessShaderCode&&(a=e.processor.preProcessShaderCode(a,e.isFragment)),of(a,e,s=>{e.processCodeAfterIncludes&&(s=e.processCodeAfterIncludes(e.isFragment?"fragment":"vertex",s,e.defines));const n=LS(s,e,i);t(n,s)})}function PS(a,e,t){return!t.processor||!t.processor.finalizeShaders?{vertexCode:a,fragmentCode:e}:t.processor.finalizeShaders(a,e,t.processingContext)}function OS(a,e){if(e.processor?.noPrecision)return a;const t=e.shouldUseHighPrecisionShader;return a.indexOf("precision highp float")===-1?t?a=`precision highp float;
270`+a:a=`precision mediump float;
271`+a:t||(a=a.replace("precision highp float","precision mediump float")),a}function O_(a){const t=/defined\((.+)\)/.exec(a);if(t&&t.length)return new af(t[1].trim(),a[0]==="!");const i=["==","!=",">=","<=","<",">"];let s="",n=0;for(s of i)if(n=a.indexOf(s),n>-1)break;if(n===-1)return new af(a);const o=a.substring(0,n).trim(),c=a.substring(n+s.length).trim();return new RS(o,s,c)}function wS(a){a=a.replace(SS,"defined[$1]");const e=_i.infixToPostfix(a),t=[];for(const s of e)if(s!=="||"&&s!=="&&")t.push(s);else if(t.length>=2){let n=t[t.length-1],o=t[t.length-2];t.length-=2;const c=s=="&&"?new AS:new ES;typeof n=="string"&&(n=n.replace(P_,"defined($1)")),typeof o=="string"&&(o=o.replace(P_,"defined($1)")),c.leftOperand=typeof o=="string"?O_(o):o,c.rightOperand=typeof n=="string"?O_(n):n,t.push(c)}let i=t[t.length-1];return typeof i=="string"&&(i=i.replace(P_,"defined($1)")),typeof i=="string"?O_(i):i}function ef(a,e){const t=new vS,i=a.substring(0,e);let s=a.substring(e);return s=s.substring(0,(s.indexOf("//")+1||s.length+1)-1).trim(),i==="#ifdef"?t.testExpression=new af(s):i==="#ifndef"?t.testExpression=new af(s,!0):t.testExpression=wS(s),t}function w_(a,e,t,i){let s;for(;J_(a,t);){s=a.currentLine;const n=s.substring(0,5).toLowerCase();if(n==="#else"){const o=new Xc;e.children.push(o),J_(a,o);return}else if(n==="#elif"){const o=ef(s,5);e.children.push(o),t=o}}}function J_(a,e,t){for(;a.canRead;){a.lineIndex++;const i=a.currentLine;if(i.indexOf("#")>=0){const n=DS.exec(i);if(n&&n.length){switch(n[0]){case"#ifdef":{const c=new I_;e.children.push(c);const h=ef(i,6);c.children.push(h),w_(a,c,h);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{const c=new I_;e.children.push(c);const h=ef(i,7);c.children.push(h),w_(a,c,h);break}case"#if":{const c=new I_,h=ef(i,3);e.children.push(c),c.children.push(h),w_(a,c,h);break}}continue}}const s=new Xc;if(s.line=i,e.children.push(s),i[0]==="#"&&i[1]==="d"){const n=i.replace(";","").split(" ");s.additionalDefineKey=n[1],n.length===3&&(s.additionalDefineValue=n[2])}}return!1}function FS(a,e,t,i){const s=new Xc,n=new TS;return n.lineIndex=-1,n.lines=a.split(`
272`),J_(n,s),s.process(e,t,i)}function BS(a,e){const t=a.defines,i={};for(const s of t){const o=s.replace("#define","").replace(";","").trim().split(" ");i[o[0]]=o.length>1?o[1]:""}return a.processor?.shaderLanguage===0&&(i.GL_ES="true"),i.__VERSION__=a.version,i[a.platformName]="true",ev(i,e?.isNDCHalfZRange,e?.useReverseDepthBuffer,e?.useExactSrgbConversions),i}function LS(a,e,t){let i=OS(a,e);if(!e.processor||e.processor.shaderLanguage===0&&i.indexOf("#version 3")!==-1&&(i=i.replace("#version 300 es",""),!e.processor.parseGLES3))return i;const s=e.defines,n=BS(e,t);e.processor.preProcessor&&(i=e.processor.preProcessor(i,s,n,e.isFragment,e.processingContext));const o={};return i=FS(i,n,e,o),e.processor.postProcessor&&(i=e.processor.postProcessor(i,s,e.isFragment,e.processingContext,t?{drawBuffersExtensionDisabled:!t.getCaps().drawBuffersExtension}:{},n,o)),t?._features.needShaderCodeInlining&&(i=t.inlineShaderCode(i)),i}function of(a,e,t){Wu.length=0;let i;for(;(i=MS.exec(a))!==null;)Wu.push(i);let s=[a],n=!1;for(const c of Wu){let h=c[1];if(h.indexOf("__decl__")!==-1&&(h=h.replace(CS,""),e.supportsUniformBuffers&&(h=h.replace("Vertex","Ubo").replace("Fragment","Ubo")),h=h+"Declaration"),e.includesShadersStore[h]){let f=e.includesShadersStore[h];if(c[2]){const m=c[3].split(",");for(let g=0;g<m.length;g+=2){const x=new RegExp(m[g],"g"),y=m[g+1];f=f.replace(x,y)}}if(c[4]){const m=c[5];if(m.indexOf("..")!==-1){const g=m.split(".."),x=parseInt(g[0]);let y=parseInt(g[1]),b=f.slice(0);f="",isNaN(y)&&(y=e.indexParameters[g[1]]);for(let v=x;v<y;v++)e.supportsUniformBuffers||(b=b.replace(cb,(E,R)=>R+"{X}")),f+=b.replace(hb,v.toString())+`
273`}else e.supportsUniformBuffers||(f=f.replace(cb,(g,x)=>x+"{X}")),f=f.replace(hb,m)}const _=[];for(const m of s){const g=m.split(c[0]);for(let x=0;x<g.length-1;x++)_.push(g[x]),_.push(f);_.push(g[g.length-1])}s=_,n=n||f.indexOf("#include<")>=0||f.indexOf("#include <")>=0}else{const f=e.shadersRepository+"ShadersInclude/"+h+".fx";sv.loadFile(f,_=>{e.includesShadersStore[h]=_,of(s.join(""),e,t)});return}}Wu.length=0;const o=s.join("");n?of(o.toString(),e,t):t(o)}const sv={loadFile:(a,e,t,i,s,n)=>{throw Je("FileTools")}};function kS(a,e){return Ps(e).cachedPipelines[a]}function rv(a){const e=a._name,t=a.context;if(e&&t){const i=Ps(t);i.cachedPipelines[e]?.dispose(),delete i.cachedPipelines[e]}}function NS(a,e,t,i,s,n,o){let c,h;const f=Xi()?n?.getHostDocument():null;typeof e=="string"?c=e:typeof e.vertexSource=="string"?c="source:"+e.vertexSource:typeof e.vertexElement=="string"?c=f?.getElementById(e.vertexElement)||e.vertexElement:c=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 _=[void 0,void 0],m=()=>{if(_[0]&&_[1]){const[g,x]=_;IS(a),ub(g,a,(y,b)=>{o&&(o._vertexSourceCodeBeforeMigration=b),t&&(y=t("vertex",y)),a.isFragment=!0,ub(x,a,(v,E)=>{o&&(o._fragmentSourceCodeBeforeMigration=E),t&&(v=t("fragment",v));const R=PS(y,v,a);a=null;const C=US(R.vertexCode,R.fragmentCode,e,s);i?.(C.vertexSourceCode,C.fragmentSourceCode)},n)},n)}};fb(c,"Vertex","",g=>{o&&(o._rawVertexSourceCode=g),_[0]=g,m()},s),fb(h,"Fragment","Pixel",g=>{o&&(o._rawFragmentSourceCode=g),_[1]=g,m()},s)}function fb(a,e,t,i,s,n){if(typeof HTMLElement<"u"&&a instanceof HTMLElement){const h=QT(a);i(h);return}if(a.substring(0,7)==="source:"){i(a.substring(7));return}if(a.substring(0,7)==="base64:"){const h=window.atob(a.substring(7));i(h);return}const o=Ti.GetShadersStore(s);if(o[a+e+"Shader"]){i(o[a+e+"Shader"]);return}if(t&&o[a+t+"Shader"]){i(o[a+t+"Shader"]);return}let c;if(a[0]==="."||a[0]==="/"||a.indexOf("http")>-1?c=a:c=Ti.GetShadersRepository(s)+a,n=n||JT,!n)throw new Error("loadFileInjection is not defined");n(c+"."+e.toLowerCase()+".fx",i)}function US(a,e,t,i){if(t){const s=t.vertexElement||t.vertex||t.spectorName||t,n=t.fragmentElement||t.fragment||t.spectorName||t;return{vertexSourceCode:(i===1?"//":"")+"#define SHADER_NAME vertex:"+s+`
274`+a,fragmentSourceCode:(i===1?"//":"")+"#define SHADER_NAME fragment:"+n+`
275`+e}}else return{vertexSourceCode:a,fragmentSourceCode:e}}const zS=(a,e,t,i)=>{try{const s=a.context?Ps(a.context):null;s&&(s.disableParallelShaderCompile=a.disableParallelCompilation);const n=a.existingPipelineContext||e(a.shaderProcessingContext);return n._name=a.name,a.name&&s&&(s.cachedPipelines[a.name]=n),t(n,a.vertex,a.fragment,!!a.createAsRaw,"","",a.rebuildRebind,a.defines,a.transformFeedbackVaryings,"",()=>{i(n,()=>{a.onRenderingStateCompiled?.(n)})}),n}catch(s){throw pe.Error("Error compiling effect"),s}};let Xu=[];class fs{static SetImmediate(e){Xu.length===0&&setTimeout(()=>{const t=Xu;Xu=[];for(const i of t)i()},1),Xu.push(e)}}function db(a,e,t){try{if(a())return e(),!0}catch(i){return t?.(i),!0}return!1}const vm=(a,e,t,i=16,s=3e4,n=!0,o)=>{if(n&&db(a,e,t))return null;const c=setInterval(()=>{db(a,e,t)?clearInterval(c):(s-=i,s<0&&(clearInterval(c),t?.(new Error("Operation timed out after maximum retries. "+(o||"")),!0)))},i);return()=>clearInterval(c)};class Ci{static get ShadersRepository(){return Ti.ShadersRepository}static set ShadersRepository(e){Ti.ShadersRepository=e}get isDisposed(){return this._isDisposed}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new Me),this._onBindObservable}get shaderLanguage(){return this._shaderLanguage}constructor(e,t,i,s=null,n,o=null,c=null,h=null,f=null,_,m="",g=0,x){this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new Me,this.onErrorObservable=new Me,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=m;const y=this._key.replace(/\r/g,"").replace(/\n/g,"|");let b;if(t.attributes){const v=t;if(this._engine=i,this._attributesNames=v.attributes,this._uniformsNames=v.uniformsNames.concat(v.samplers),this._samplerList=v.samplers.slice(),this.defines=v.defines,this.onError=v.onError,this.onCompiled=v.onCompiled,this._fallbacks=v.fallbacks,this._indexParameters=v.indexParameters,this._transformFeedbackVaryings=v.transformFeedbackVaryings||null,this._multiTarget=!!v.multiTarget,this._shaderLanguage=v.shaderLanguage??0,this._disableParallelShaderCompilation=!!v.disableParallelShaderCompilation,v.uniformBuffersNames){this._uniformBuffersNamesList=v.uniformBuffersNames.slice();for(let E=0;E<v.uniformBuffersNames.length;E++)this._uniformBuffersNames[v.uniformBuffersNames[E]]=E}this._processFinalCode=v.processFinalCode??null,this._processCodeAfterIncludes=v.processCodeAfterIncludes??void 0,x=v.extraInitializationsAsync,b=v.existingPipelineContext}else this._engine=n,this.defines=o??"",this._uniformsNames=i.concat(s),this._samplerList=s?s.slice():[],this._attributesNames=t,this._uniformBuffersNamesList=[],this._shaderLanguage=g,this.onError=f,this.onCompiled=h,this._indexParameters=_,this._fallbacks=c;this._engine.shaderPlatformName==="WEBGL2"&&(b=kS(y,this._engine._gl)??b),this._attributeLocationByName={},this.uniqueId=Ci._UniqueIdSeed++,b?(this._pipelineContext=b,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,x).catch(v=>{const E=v?.message??String(v),R=new Error(`Effect async shader preparation failed for "${String(this.name)}": ${E}`);v&&typeof v.stack=="string"&&(R.stack=`${R.message}
276Caused by: ${v.stack}`),this._processCompilationErrors(R)}),this._onReleaseEffectsObserver=this._engine.onReleaseEffectsObservable.addOnce(()=>{this._onReleaseEffectsObserver=null,!this.isDisposed&&this.dispose(!0)})}async _processShaderCodeAsync(e=null,t=!1,i=null,s){s&&await s(),this._processingContext=i||this._engine._getShaderProcessingContext(this._shaderLanguage,!1);const n={defines:this.defines.split(`
277`),indexParameters:this._indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:e??this._engine._getShaderProcessor(this._shaderLanguage),supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:Ti.GetShadersRepository(this._shaderLanguage),includesShadersStore:Ti.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};NS(n,this.name,this._processFinalCode,(o,c)=>{this._vertexSourceCode=o,this._fragmentSourceCode=c,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){vm(()=>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(`
278`),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,i,s){this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=(n,o)=>{s&&s(o)},this.onCompiled=()=>{const n=this.getEngine().scenes;if(n)for(let o=0;o<n.length;o++)n[o].markAllMaterialsAsDirty(127);this._pipelineContext._handlesSpectorRebuildCallback?.(i)},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 i=this._attributesNames[t];this._attributeLocationByName[i]=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(),Ci.AutomaticallyClearCodeCache&&this.clearCodeCache()}_prepareEffect(e=!1){const t=this._pipelineContext;this._isReady=!1;try{const i=!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride),s=i?null:this.defines,n=i?this._vertexSourceCodeOverride:this._vertexSourceCode,o=i?this._fragmentSourceCodeOverride:this._fragmentSourceCode,c=this._engine;this._pipelineContext=zS({existingPipelineContext:e?t:null,vertex:n,fragment:o,context:c.shaderPlatformName==="WEBGL2"||c.shaderPlatformName==="WEBGL1"?c._gl:void 0,rebuildRebind:(h,f,_,m)=>this._rebuildProgram(h,f,_,m),defines:s,transformFeedbackVaryings:this._transformFeedbackVaryings,name:this._key.replace(/\r/g,"").replace(/\n/g,"|"),createAsRaw:i,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(i){this._processCompilationErrors(i,t)}}_getShaderCodeAndErrorLine(e,t,i){const s=i?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/;let n=null;if(t&&e){const o=t.match(s);if(o&&o.length===2){const c=parseInt(o[1]),h=e.split(`
279`,-1);h.length>=c&&(n=`Offending line [${c}] in ${i?"fragment":"vertex"} code: ${h[c-1]}`)}}return[e,n]}_processCompilationErrors(e,t=null){this._compilationError=typeof e?.stack=="string"?e.stack:e?.message??String(e);const i=this._attributesNames,s=this._fallbacks;if(pe.Error("Unable to compile effect:"),pe.Error(`Uniforms: ${this._uniformsNames.join(" ")}`),pe.Error(`Attributes: ${i.join(" ")}`),pe.Error(`Defines:
280`+this.defines),Ci.LogShaderCodeOnCompilationError){let o=null,c=null,h;this._pipelineContext?._getVertexShaderCode()&&([h,o]=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1),h&&(pe.Error("Vertex code:"),pe.Error(h))),this._pipelineContext?._getFragmentShaderCode()&&([h,c]=this._getShaderCodeAndErrorLine(this._pipelineContext?._getFragmentShaderCode(),this._compilationError,!0),h&&(pe.Error("Fragment code:"),pe.Error(h))),o&&pe.Error(o),c&&pe.Error(c)}pe.Error("Error: "+this._compilationError);const n=()=>{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,n()),s?(this._pipelineContext=null,s.hasMoreFallbacks?(this._allFallbacksProcessed=!1,pe.Error("Trying next fallback."),this.defines=s.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,n(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,t||n())}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 i=e+"Ex";if(this._samplerList.indexOf(i+"0")===-1){const s=this._samplerList.indexOf(e);for(let o=1;o<t.length;o++){const c=i+(o-1).toString();this._samplerList.splice(s+o,0,c)}let n=0;for(const o of this._samplerList)this._samplers[o]=n,n+=1}this._engine.setTextureArray(this._samplers[e],this._uniforms[e],t,e)}bindUniformBuffer(e,t){const i=this._uniformBuffersNames[t];i===void 0||Ci._BaseCache[i]===e&&this._engine._features.useUBOBindingCache||(Ci._BaseCache[i]=e,this._engine.bindUniformBufferBase(e,i,t))}bindUniformBlock(e,t){this._engine.bindUniformBlock(this._pipelineContext,e,t)}setInt(e,t){return this._pipelineContext.setInt(e,t),this}setInt2(e,t,i){return this._pipelineContext.setInt2(e,t,i),this}setInt3(e,t,i,s){return this._pipelineContext.setInt3(e,t,i,s),this}setInt4(e,t,i,s,n){return this._pipelineContext.setInt4(e,t,i,s,n),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,i){return this._pipelineContext.setUInt2(e,t,i),this}setUInt3(e,t,i,s){return this._pipelineContext.setUInt3(e,t,i,s),this}setUInt4(e,t,i,s,n){return this._pipelineContext.setUInt4(e,t,i,s,n),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,i){return this._pipelineContext.setFloat2(e,t,i),this}setVector3(e,t){return this._pipelineContext.setVector3(e,t),this}setFloat3(e,t,i,s){return this._pipelineContext.setFloat3(e,t,i,s),this}setVector4(e,t){return this._pipelineContext.setVector4(e,t),this}setQuaternion(e,t){return this._pipelineContext.setQuaternion(e,t),this}setFloat4(e,t,i,s,n){return this._pipelineContext.setFloat4(e,t,i,s,n),this}setColor3(e,t){return this._pipelineContext.setColor3(e,t),this}setColor4(e,t,i){return this._pipelineContext.setColor4(e,t,i),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(Ci.PersistentMode)return;this._refCount--}this._refCount>0||this._isDisposed||(this._onReleaseEffectsObserver&&(this._engine.onReleaseEffectsObservable.remove(this._onReleaseEffectsObserver),this._onReleaseEffectsObserver=null),this._pipelineContext&&rv(this._pipelineContext),this._engine._releaseEffect(this),this.clearCodeCache(),this._isDisposed=!0)}static RegisterShader(e,t,i,s=0){t&&(Ti.GetShadersStore(s)[`${e}PixelShader`]=t),i&&(Ti.GetShadersStore(s)[`${e}VertexShader`]=i)}static ResetCache(){Ci._BaseCache={}}}Ci.LogShaderCodeOnCompilationError=!0;Ci.PersistentMode=!1;Ci.AutomaticallyClearCodeCache=!1;Ci._UniqueIdSeed=0;Ci._BaseCache={};Ci.ShadersStore=Ti.ShadersStore;Ci.IncludesShadersStore=Ti.IncludesShadersStore;class Bi{static SetMatrixPrecision(e){if(Bi.MatrixTrackPrecisionChange=!1,e&&!Bi.MatrixUse64Bits&&Bi.MatrixTrackedMatrices)for(let t=0;t<Bi.MatrixTrackedMatrices.length;++t){const i=Bi.MatrixTrackedMatrices[t],s=i._m;i._m=new Array(16);for(let n=0;n<16;++n)i._m[n]=s[n]}Bi.MatrixUse64Bits=e,Bi.MatrixCurrentType=Bi.MatrixUse64Bits?Array:Float32Array,Bi.MatrixTrackedMatrices=null}}Bi.MatrixUse64Bits=!1;Bi.MatrixTrackPrecisionChange=!0;Bi.MatrixCurrentType=Float32Array;Bi.MatrixTrackedMatrices=[];class Tn{static get Now(){return Xi()&&window.performance&&window.performance.now?window.performance.now():Date.now()}}class GS{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 VS{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 Hs{constructor(){this.reset()}reset(){this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=Hs.ALWAYS,this.opStencilFail=Hs.KEEP,this.opDepthFail=Hs.KEEP,this.opStencilDepthPass=Hs.REPLACE,this.backFunc=Hs.ALWAYS,this.backOpStencilFail=Hs.KEEP,this.backOpDepthFail=Hs.KEEP,this.backOpStencilDepthPass=Hs.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}}Hs.ALWAYS=519;Hs.KEEP=7680;Hs.REPLACE=7681;
280class nv{constructor(e){this._supportBlendParametersPerTarget=e,this._blendFunctionParameters=new Array(32),this._blendEquationParameters=new Array(16),this._blendConstants=new Array(4),this._isBlendConstantsDirty=!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,i,s){this._blendConstants[0]===e&&this._blendConstants[1]===t&&this._blendConstants[2]===i&&this._blendConstants[3]===s||(this._blendConstants[0]=e,this._blendConstants[1]=t,this._blendConstants[2]=i,this._blendConstants[3]=s,this._isBlendConstantsDirty=!0)}setAlphaBlendFunctionParameters(e,t,i,s,n=0){const o=n*4;this._blendFunctionParameters[o+0]===e&&this._blendFunctionParameters[o+1]===t&&this._blendFunctionParameters[o+2]===i&&this._blendFunctionParameters[o+3]===s||(this._blendFunctionParameters[o+0]=e,this._blendFunctionParameters[o+1]=t,this._blendFunctionParameters[o+2]=i,this._blendFunctionParameters[o+3]=s,this._isBlendFunctionParametersDirty=!0)}setAlphaEquationParameters(e,t,i=0){const s=i*2;this._blendEquationParameters[s+0]===e&&this._blendEquationParameters[s+1]===t||(this._blendEquationParameters[s+0]=e,this._blendEquationParameters[s+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 i=e;if(this._isAlphaBlendDirty){for(let s=0;s<t;s++){const n=s<this._numTargetEnabled?s:0;this._alphaBlend[n]?i.enableIndexed(e.BLEND,s):i.disableIndexed(e.BLEND,s)}this._isAlphaBlendDirty=!1}if(this._isBlendFunctionParametersDirty){for(let s=0;s<t;s++){const n=s<this._numTargetEnabled?s*4:0;i.blendFuncSeparateIndexed(s,this._blendFunctionParameters[n+0],this._blendFunctionParameters[n+1],this._blendFunctionParameters[n+2],this._blendFunctionParameters[n+3])}this._isBlendFunctionParametersDirty=!1}if(this._isBlendEquationParametersDirty){for(let s=0;s<t;s++){const n=s<this._numTargetEnabled?s*2:0;i.blendEquationSeparateIndexed(s,this._blendEquationParameters[n+0],this._blendEquationParameters[n+1])}this._isBlendEquationParametersDirty=!1}}setAlphaMode(e,t){let i=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),i=32775;break;case 19:this.setAlphaBlendFunctionParameters(1,1,1,1,t),i=32776;break;case 20:this.setAlphaBlendFunctionParameters(1,35065,0,1,t);break;case 21:this.setAlphaBlendFunctionParameters(1,0,1,771,t);break}this.setAlphaEquationParameters(i,i,t)}}function av(a,e){if(e){const{requestAnimationFrame:t}=e;if(typeof t=="function")return t(a)}if(Xi()){const{requestAnimationFrame:t}=e||window;if(typeof t=="function")return t(a)}else if(typeof requestAnimationFrame=="function")return requestAnimationFrame(a);return setTimeout(a,16)}class Ie{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)}
280getColorWrite(){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+=`
281`),t+="#define USE_REVERSE_DEPTHBUFFER"),this.useExactSrgbConversions&&(t&&(t+=`
282`),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(i=>i.source===15)||t._rebuild()}_rebuildEffects(){for(const e in this._compiledEffects){const t=this._compiledEffects[e];t._pipelineContext=null,t._prepareEffect()}Ci.ResetCache()}_rebuildGraphicsResources(){this.wipeCaches(!0),this._rebuildEffects(),this._rebuildComputeEffects?.(),this._rebuildBuffers(),this._rebuildInternalTextures(),this._rebuildTextures(),this._rebuildRenderTargetWrappers(),this.wipeCaches(!0)}_flagContextRestored(){pe.Warn(this.name+" context successfully restored."),this.onContextRestoredObservable.notifyObservers(this),this._contextWasLost=!1}_restoreEngineAfterContextLost(e){setTimeout(()=>{this._clearEmptyResources();const t=this._depthCullingState.depthTest,i=this._depthCullingState.depthFunc,s=this._depthCullingState.depthMask,n=this._stencilState.stencilTest;e(),this._rebuildGraphicsResources(),this._depthCullingState.depthTest=t,this._depthCullingState.depthFunc=i,this._depthCullingState.depthMask=s,this._stencilState.stencilTest=n,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,Xi()){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: 11,963 bytes, line 282
282_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 av(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 Xi()?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,i){const s=t||this.getRenderWidth(),n=i||this.getRenderHeight(),o=e.x||0,c=e.y||0;this._cachedViewport=e,this._viewport(o*s,c*n,s*e.width,n*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,i,s,n=3,o=null,c=null,h,f,_=null,m=null,g=null,x=null,y,b,v){e=e||"";const E=e.substring(0,5)==="data:",R=e.substring(0,5)==="blob:",C=E&&e.indexOf(";base64,")!==-1,O=m||new Es(this,1);O!==m&&(O.label=e.substring(0,60));const M=e;this._transformTextureUrl&&!C&&!m&&!_&&(e=this._transformTextureUrl(e)),M!==e&&(O._originalUrl=M);const I=e.lastIndexOf(".");let P=x||(I>-1?e.substring(I).toLowerCase():"");P.indexOf("?")>-1&&(P=P.split("?")[0]);const V=Ie.GetCompatibleTextureLoader(P,y);s&&s.addPendingData(O),O.url=e,O.generateMipMaps=!t,O.samplingMode=n,O.invertY=i,O._useSRGBBuffer=this._getUseSRGBBuffer(!!v,t),this._doNotHandleContextLost||(O._buffer=_);let X=null;o&&!m&&(X=O.onLoadedObservable.add(o)),m||this._internalTexturesCache.push(O);const re=(ae,de)=>{s&&s.removePendingData(O),e===M?(X&&O.onLoadedObservable.remove(X),mt.UseFallbackTexture&&e!==mt.FallbackTexture&&this._createTextureBase(mt.FallbackTexture,t,O.invertY,s,n,null,c,h,f,_,O),ae=(ae||"Unknown error")+(mt.UseFallbackTexture?" - Fallback texture was used":""),O.onErrorObservable.notifyObservers({message:ae,exception:de}),c&&c(ae,de)):(pe.Warn(`Failed to load ${e}, falling back to ${M}`),this._createTextureBase(M,t,O.invertY,s,n,o,c,h,f,_,O,g,x,y,b,v))};if(V){const ae=async de=>{(await V).loadData(de,O,(te,Y,Z,q,j,Q)=>{Q?re("TextureLoader failed to load data"):h(O,P,s,{width:te,height:Y},O.invertY,!Z,q,()=>(j(),!1),n)},b)};if(!_)this._loadFile(e,async de=>{try{await ae(new Uint8Array(de))}catch(U){re("Failed to parse texture data",U)}},void 0,s?s.offlineProvider:void 0,!0,(de,U)=>{re("Unable to load "+(de&&de.responseURL,U))});else{const de=async U=>{try{await ae(U)}catch(te){re("Failed to parse texture data",te)}};_ instanceof ArrayBuffer?de(new Uint8Array(_)):ArrayBuffer.isView(_)?de(_):c&&c("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null)}}else{const ae=de=>{R&&!this._doNotHandleContextLost&&(O._buffer=de),h(O,P,s,de,O.invertY,t,!1,f,n)};!E||C?_&&(typeof _.decoding=="string"||_.close)?ae(_):Ie._FileToolsLoadImage(e||"",ae,re,s?s.offlineProvider:null,y,O.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):typeof _=="string"||_ instanceof ArrayBuffer||ArrayBuffer.isView(_)||_ instanceof Blob?Ie._FileToolsLoadImage(_,ae,re,s?s.offlineProvider:null,y,O.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):_&&ae(_)}return O}_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:Ha()?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,i){this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new GS,this._stencilStateComposer=new VS,this._stencilState=new Hs,this._alphaState=new nv(!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 Me,this.onCanvasFocusObservable=new Me,this.onNewSceneAddedObservable=new Me,this.onResizeObservable=new Me,this.onCanvasPointerOutObservable=new Me,this.onEffectErrorObservable=new Me,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 Me,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this._frameHandler=0,this._activeRenderLoops=new Array,this.customAnimationFrameRequester=null,this._windowIsBackground=!1,this._boundRenderFunction=o=>this._renderLoop(o),this._lastFrameTime=0,this._renderAccumulator=0,this.skipFrameRender=!1,this.onBeforeShaderCompilationObservable=new Me,this.onAfterShaderCompilationObservable=new Me,this.onBeginFrameObservable=new Me,this.onEndFrameObservable=new Me,this._transformTextureUrl=null,this._uniformBuffers=new Array,this._storageBuffers=new Array,this._highPrecisionShadersAllowed=!0,this.onContextLostObservable=new Me,this.onContextRestoredObservable=new Me,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 Me,this.onReleaseEffectsObservable=new Me,mt.Instances.push(this),this.startTime=Tn.Now,this._stencilStateComposer.stencilGlobal=this._stencilState,Bi.SetMatrixPrecision(!!t.useLargeWorldRendering||!!t.useHighPrecisionMatrix),qo()&&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 s=Xi()&&window.devicePixelRatio||1,n=t.limitDeviceRatio||s;i=i||t.adaptToDeviceRatio||!1,this.adaptToDeviceRatio=i,this._hardwareScalingLevel=i?1/Math.min(n,s):1,this._lastDevicePixelRatio=s,this._creationOptions=t}resize(e=!1){let t,i;if(this.adaptToDeviceRatio){const s=Xi()&&window.devicePixelRatio||1,n=this._lastDevicePixelRatio/s;this._lastDevicePixelRatio=s,this._hardwareScalingLevel*=n}if(Xi()&&Ha())if(this._renderingCanvas){const s=this._renderingCanvas.getBoundingClientRect?.();t=this._renderingCanvas.clientWidth||s?.width||this._renderingCanvas.width*this._hardwareScalingLevel||100,i=this._renderingCanvas.clientHeight||s?.height||this._renderingCanvas.height*this._hardwareScalingLevel||100}else t=window.innerWidth,i=window.innerHeight;else t=this._renderingCanvas?this._renderingCanvas.width:100,i=this._renderingCanvas?this._renderingCanvas.height:100;this.setSize(t/this._hardwareScalingLevel,i/this._hardwareScalingLevel,e)}setSize(e,t,i=!1){if(!this._renderingCanvas||(e=e|0,t=t|0,!i&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t))return!1;if(this._renderingCanvas.width=e,this._renderingCanvas.height=t,this.scenes){for(let s=0;s<this.scenes.length;s++){const n=this.scenes[s];for(let o=0;o<n.cameras.length;o++){const c=n.cameras[o];c._currentRenderId=0}}this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this)}return!0}createRawTexture(e,t,i,s,n,o,c,h,f,_,m,g){throw Je("engine.rawTexture")}createRawCubeTexture(e,t,i,s,n,o,c,h){throw Je("engine.rawTexture")}createRawTexture3D(e,t,i,s,n,o,c,h,f,_,m){throw Je("engine.rawTexture")}createRawTexture2DArray(e,t,i,s,n,o,c,h,f,_,m,g){throw Je("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&&Ha()&&"ontouchend"in document},this._checkForMobile(),Xi()&&window.addEventListener("resize",this._checkForMobile))}createVideoElement(e){return document.createElement("video")}_reportDrawCall(e=1){this._drawCalls?.addCount(e,!1)}getFps(){return this._fps}
282getDeltaTime(){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,i){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 i=document.createElement("canvas");return i.width=e,i.height=t,i}createCanvas(e,t){return Ie._CreateCanvas(e,t)}static _FileToolsLoadImage(e,t,i,s,n,o,c){if(!Ga.loadImage)throw Je("FileTools");return Ga.loadImage(e,t,i,s,n,o,c)}_loadFile(e,t,i,s,n,o){const c=JT(e,t,i,s,n,o);return this._activeRequests.push(c),c.onCompleteObservable.add(()=>{const h=this._activeRequests.indexOf(c);h!==-1&&this._activeRequests.splice(h,1)}),c}static _FileToolsLoadFile(e,t,i,s,n,o){if(Ga.loadFile)return Ga.loadFile(e,t,i,s,n,o);throw Je("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?.(),Ci.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(),Xi()&&window.removeEventListener("resize",this._checkForMobile);const e=mt.Instances.indexOf(this);e>=0&&mt.Instances.splice(e,1),mt.Instances.length||(mt.OnEnginesDisposedObservable.notifyObservers(this),mt.OnEnginesDisposedObservable.clear()),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()}static DefaultLoadingScreenFactory(e){throw Je("LoadingScreen")}static MarkAllMaterialsAsDirty(e,t){for(let i=0;i<mt.Instances.length;i++){const s=mt.Instances[i];for(let n=0;n<s.scenes.length;n++)s.scenes[n].markAllMaterialsAsDirty(e,t)}}static GetCompatibleTextureLoader(e,t){return null}}Ie._RenderPassIdCounter=0;Ie._RescalePostProcessFactory=null;Ie.CollisionsEpsilon=.001;Ie.QueueNewFrame=av;function ov(a){return a.getPipelineContext===void 0}class HS{constructor(){this.shaderLanguage=0}postProcessor(e,t,i,s,n){if(n.drawBuffersExtensionDisabled){const o=/#extension.+GL_EXT_draw_buffers.+(enable|require)/g;e=e.replace(o,"")}return e}}const jS=/(flat\s)?\s*varying\s*.*/;class WS{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,t){return jS.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,i){const s=e.search(/#extension.+GL_EXT_draw_buffers.+require/)!==-1,n=/#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(n,""),e=e.replace(/texture2D\s*\(/g,"texture("),i){const o=e.search(/layout *\(location *= *0\) *out/g)!==-1,c=t.indexOf("#define DUAL_SOURCE_BLENDING")!==-1,h=c?`layout(location = 0, index = 0) out vec4 glFragColor;
283layout(location = 0, index = 1) out vec4 glFragColor2;
284`:`layout(location = 0) out vec4 glFragColor;
285`;c&&(e=`#extension GL_EXT_blend_func_extended : require
286`+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,(s||o?"":h)+"void main(")}else if(t.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0&&(e=`invariant gl_Position;
287`+e),t.indexOf("#define MULTIVIEW")!==-1)return`#extension GL_OVR_multiview2 : require
288layout (num_views = 2) in;
289`+e;return e}}class Yc{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=Yc._Counter++}}Yc._Counter=0;class Bc extends Yc{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}function Yu(a){let e=1;do e*=2;while(e<a);return e===a}function _b(a,e,t){return a*(1-t)+e*t}function XS(a){const e=lv(a),t=cv(a);return e-a>a-t?t:e}function lv(a){return a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a}function cv(a){return a=a|a>>1,a=a|a>>2,a=a|a>>4,a=a|a>>8,a=a|a>>16,a-(a>>1)}function em(a,e,t=2){let i;switch(t){case 1:i=cv(a);break;case 2:i=XS(a);break;case 3:default:i=lv(a);break}return Math.min(i,e)}class tm{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 mb(a){return a===13||a===14||a===15||a===16||a===17||a===18||a===19}function Lc(a){return a===13||a===17||a===18||a===19}class YS{}class ot extends Ie{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return Ci.ShadersRepository}static set ShadersRepository(e){Ci.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,i,s){if(i=i||{},super(t??i.antialias,i,s),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 n;if(e.getContext){if(n=e,i.preserveDrawingBuffer===void 0&&(i.preserveDrawingBuffer=!1),i.xrCompatible===void 0&&(i.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const h=navigator.userAgent;for(const f of ot.ExceptionList){const _=f.key,m=f.targets;if(new RegExp(_).test(h)){if(f.capture&&f.captureConstraint){const x=f.capture,y=f.captureConstraint,v=new RegExp(x).exec(h);if(v&&v.length>0&&parseInt(v[v.length-1])>=y)continue}for(const x of m)switch(x){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":i.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1;break}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{D_(this._gl)}:(this._onContextLost=h=>{h.preventDefault(),this._contextWasLost=!0,D_(this._gl),pe.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},n.addEventListener("webglcontextrestored",this._onContextRestored,!1),i.powerPreference=i.powerPreference||"high-performance"),n.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(i.xrCompatible=!1),!i.disableWebGL2Support)try{this._gl=n.getContext("webgl2",i)||n.getContext("experimental-webgl2",i),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch{}if(!this._gl){if(!n)throw new Error("The provided canvas is null or undefined.");try{this._gl=n.getContext("webgl",i)||n.getContext("experimental-webgl",i)}catch(h){throw new Error("WebGL not supported",{cause:h})}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=e,n=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const h=this._gl.getContextAttributes();h&&(i.stencil=h.stencil)}this._sharedInit(n),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),i.useHighPrecisionFloats!==void 0&&(this._highPrecisionShadersAllowed=i.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let h=0;h<this._caps.maxVertexAttribs;h++)this._currentBufferPointers[h]=new YS;this._shaderProcessor=this.webGLVersion>1?new WS:new HS;const o=`Babylon.js v${ot.Version}`;pe.Log(o+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",o);const c=Ps(this._gl);c.validateShaderPrograms=this.validateShaderPrograms,c.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}
vendor: 8,888 bytes, line 289
289areAllEffectsReady(){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 nv(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
289der=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 i=this._gl.getExtension("WEBGL_draw_buffers");if(i!==null){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=i.drawBuffersWEBGL.bind(i),this._caps.maxDrawBuffers=this._gl.getParameter(i.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let s=0;s<16;s++)this._gl["COLOR_ATTACHMENT"+s+"_WEBGL"]=i["COLOR_ATTACHMENT"+s+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{const i=this._gl.getExtension("WEBGL_depth_texture");i!=null&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=i.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{const i=this._gl.getExtension("OES_vertex_array_object");i!=null&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=i.createVertexArrayOES.bind(i),this._gl.bindVertexArray=i.bindVertexArrayOES.bind(i),this._gl.deleteVertexArray=i.deleteVertexArrayOES.bind(i))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{const i=this._gl.getExtension("ANGLE_instanced_arrays");i!=null?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=i.drawArraysInstancedANGLE.bind(i),this._gl.drawElementsInstanced=i.drawElementsInstancedANGLE.bind(i),this._gl.vertexAttribDivisor=i.vertexAttribDivisorANGLE.bind(i)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){const i=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),s=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);if(i&&s&&(this._caps.highPrecisionShaderSupported=i.precision!==0&&s.precision!==0,this._caps.shaderFloatPrecision=Math.min(i.precision,s.precision)),!this._shouldUseHighPrecisionShader){const n=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.MEDIUM_FLOAT),o=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.MEDIUM_FLOAT);n&&o&&(this._caps.shaderFloatPrecision=Math.min(n.precision,o.precision))}this._caps.shaderFloatPrecision<10&&(this._caps.shaderFloatPrecision=10)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{const i=this._gl.getExtension("EXT_blend_minmax");i!=null&&(this._caps.blendMinMax=!0,this._gl.MAX=i.MAX_EXT,this._gl.MIN=i.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 i=this._gl.getExtension("EXT_sRGB");i!=null&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:i.SRGB_EXT,SRGB8:i.SRGB_ALPHA_EXT,SRGB8_ALPHA8:i.SRGB_ALPHA_EXT})}if(this._creationOptions){const i=this._creationOptions.forceSRGBBufferSupportState;i!==void 0&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&i)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let i=0;i<this._maxSimultaneousTextures;i++)this._nextFreeTextureSlots.push(i);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: 49,055 bytes, line 289
289der: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,i,s=!1,n=0){const o=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=o;let c=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 _=this._currentRenderTarget.texture?.type;_===7||_===5?(ot._TempClearColorUint32[0]=e.r*255,ot._TempClearColorUint32[1]=e.g*255,ot._TempClearColorUint32[2]=e.b*255,ot._TempClearColorUint32[3]=e.a*255,this._gl.clearBufferuiv(this._gl.COLOR,0,ot._TempClearColorUint32),h=!1):(ot._TempClearColorInt32[0]=e.r*255,ot._TempClearColorInt32[1]=e.g*255,ot._TempClearColorInt32[2]=e.b*255,ot._TempClearColorInt32[3]=e.a*255,this._gl.clearBufferiv(this._gl.COLOR,0,ot._TempClearColorInt32),h=!1)}}h&&(this._gl.clearColor(e.r,e.g,e.b,e.a!==void 0?e.a:1),c|=this._gl.COLOR_BUFFER_BIT)}i&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),c|=this._gl.DEPTH_BUFFER_BIT),s&&(this._gl.clearStencil(n),c|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(c)}_viewport(e,t,i,s){(e!==this._viewportCached.x||t!==this._viewportCached.y||i!==this._viewportCached.z||s!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=s,this._gl.viewport(e,t,i,s))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw new Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,i,s,n,o=0,c=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,o,c),h._currentLOD=o):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,o):h._currentLOD!==o&&(f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,o),h._currentLOD=o));const _=e._depthStencilTexture;if(_){e.is3D&&(e.texture.width!==_.width||e.texture.height!==_.height||e.texture.depth!==_.depth)&&pe.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");const m=e._depthStencilTextureWithStencil?f.DEPTH_STENCIL_ATTACHMENT:f.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?f.framebufferTextureLayer(f.FRAMEBUFFER,m,_._hardwareTexture?.underlyingResource,o,c):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,m,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,_._hardwareTexture?.underlyingResource,o):f.framebufferTexture2D(f.FRAMEBUFFER,m,f.TEXTURE_2D,_._hardwareTexture?.underlyingResource,o)}h._MSAAFramebuffer&&this._bindUnboundFramebuffer(h._MSAAFramebuffer),this._cachedViewport&&!n?this.setViewport(this._cachedViewport,i,s):(i||(i=e.width,o&&(i=i/Math.pow(2,o))),s||(s=e.height,o&&(s=s/Math.pow(2,o))),this._viewport(0,0,i,s)),this.wipeCaches()}setStateCullFaceType(e,t){const i=this.cullBackFaces??e??!0?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==i||t)&&(this._depthCullingState.cullFace=i)}setState(e,t=0,i,s=!1,n,o,c=0){(this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(n,i),this.setZOffset(t),this.setZOffsetUnits(c);const h=s?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==h||i)&&(this._depthCullingState.frontFace=h),this._stencilStateComposer.stencilMaterial=o}_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,i){const s=e;this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),i&&(s._MSAAFramebuffer&&this._bindUnboundFramebuffer(s._framebuffer),i()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){!e.isMulti&&e.texture?.generateMipMaps&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){const t=e,i=this._gl;if(!t._MSAAFramebuffer||t.isMulti)return;let s=t.resolveMSAAColors?i.COLOR_BUFFER_BIT:0;s|=t._generateDepthBuffer&&t.resolveMSAADepth?i.DEPTH_BUFFER_BIT:0,s|=t._generateStencilBuffer&&t.resolveMSAAStencil?i.STENCIL_BUFFER_BIT:0,i.bindFramebuffer(i.READ_FRAMEBUFFER,t._MSAAFramebuffer),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,t._framebuffer),i.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,s,i.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,i){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){const i=this._gl.createBuffer();if(!i)throw new Error("Unable to create vertex buffer");const s=new Bc(i);return this.bindArrayBuffer(s),typeof e!="number"?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),s.capacity=e.length*4):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),s.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),s.capacity=e),this._resetVertexBufferBinding(),s.references=1,s}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,i){const s=this._gl.createBuffer(),n=new Bc(s);if(!s)throw new Error("Unable to create index buffer");this.bindIndexBuffer(n);const o=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,o,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),n.references=1,n.is32Bits=o.BYTES_PER_ELEMENT===4,n}_normalizeIndexData(e){if(e.BYTES_PER_ELEMENT===2)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(let i=0;i<e.length;i++)if(e[i]>=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,i){const s=e.program,n=this._gl.getUniformBlockIndex(s,t);this._gl.uniformBlockBinding(s,n,i)}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,i,s,n,o,c){const h=this._currentBufferPointers[t];if(!h)return;let f=!1;h.active?(h.buffer!==e&&(h.buffer=e,f=!0),h.size!==i&&(h.size=i,f=!0),h.type!==s&&(h.type=s,f=!0),h.normalized!==n&&(h.normalized=n,f=!0),h.stride!==o&&(h.stride=o,f=!0),h.offset!==c&&(h.offset=c,f=!0)):(f=!0,h.active=!0,h.index=t,h.size=i,h.type=s,h.normalized=n,h.stride=o,h.offset=c,h.buffer=e),(f||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),s===this._gl.UNSIGNED_INT||s===this._gl.INT?this._gl.vertexAttribIPointer(t,i,s,o,c):this._gl.vertexAttribPointer(t,i,s,n,o,c))}_bindIndexBufferWithCache(e){e!=null&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,i){const s=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let n=0;n<s.length;n++){const o=t.getAttributeLocation(n);if(o>=0){const c=s[n];let h=null;if(i&&(h=i[c]),h||(h=e[c]),!h)continue;this._gl.enableVertexAttribArray(o),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[o]=!0);const f=h.getBuffer();f&&(this._vertexAttribPointer(f,o,h.getSize(),h.type,h.normalized,h.byteStride,h.byteOffset),h.getIsInstanced()&&(this._gl.vertexAttribDivisor(o,h.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(o),this._currentInstanceBuffers.push(f))))}}}recordVertexArrayObject(e,t,i,s){const n=this._gl.createVertexArray();if(!n)throw new Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(n),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i,s),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),n}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,i,s,n){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==n){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=n;const o=n.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let c=0;for(let h=0;h<o;h++)if(h<i.length){const f=n.getAttributeLocation(h);f>=0&&(this._gl.enableVertexAttribArray(f),this._vertexAttribArraysEnabled[f]=!0,this._vertexAttribPointer(e,f,i[h],this._gl.FLOAT,!1,s,c)),c+=i[h]*4}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,i,s){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==i)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i,s)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,i=this._currentInstanceLocations.length;t<i;t++){const s=this._currentInstanceBuffers[t];e!=s&&s.references&&(e=s,this.bindArrayBuffer(s));const n=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(n,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,i){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),i[0].index!==void 0)this.bindInstancesBuffer(e,i,!0);else for(let s=0;s<4;s++){const n=i[s];this._vertexAttribArraysEnabled[n]||(this._gl.enableVertexAttribArray(n),this._vertexAttribArraysEnabled[n]=!0),this._vertexAttribPointer(e,n,4,this._gl.FLOAT,!1,64,s*16),this._gl.vertexAttribDivisor(n,1),this._currentInstanceLocations.push(n),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,i=!0){this.bindArrayBuffer(e);let s=0;if(i)for(let n=0;n<t.length;n++){const o=t[n];s+=o.attributeSize*4}for(let n=0;n<t.length;n++){const o=t[n];o.index===void 0&&(o.index=this._currentEffect.getAttributeLocationByName(o.attributeName)),!(o.index<0)&&(this._vertexAttribArraysEnabled[o.index]||(this._gl.enableVertexAttribArray(o.index),this._vertexAttribArraysEnabled[o.index]=!0),this._vertexAttribPointer(e,o.index,o.attributeSize,o.attributeType||this._gl.FLOAT,o.normalized||!1,s,o.offset),this._gl.vertexAttribDivisor(o.index,o.divisor===void 0?1:o.divisor),this._currentInstanceLocations.push(o.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,i;for(;(i=this._currentInstanceLocations.indexOf(e))!==-1;)this._currentInstanceLocations.splice(i,1),this._currentInstanceBuffers.splice(i,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,i,s){this.drawElementsType(e?0:1,t,i,s)}drawPointClouds(e,t,i){this.drawArraysType(2,e,t,i)}drawUnIndexed(e,t,i,s){this.drawArraysType(e?0:1,t,i,s)}drawElementsType(e,t,i,s){this.applyStates(),this._reportDrawCall();const n=this._drawMode(e),o=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,c=this._uintIndicesCurrentlySet?4:2;s?this._gl.drawElementsInstanced(n,i,o,t*c,s):this._gl.drawElements(n,i,o,t*c)}drawArraysType(e,t,i,s){this.applyStates(),this._reportDrawCall();const n=this._drawMode(e);s?this._gl.drawArraysInstanced(n,t,i,s):this._gl.drawArrays(n,t,i)}_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,rv(t),this._gl&&(this._currentProgram===t.program&&this._setProgram(null),this._gl.deleteProgram(t.program)))}_getGlobalDefines(e){return ev(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,i,s,n,o,c,h,f,_=0,m){const g=typeof e=="string"?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,x=typeof e=="string"?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,y=this._getGlobalDefines(),b=t.attributes!==void 0;let v=n??t.defines??"";y&&(v+=y);const E=g+"+"+x+"@"+v;if(this._compiledEffects[E]){const C=this._compiledEffects[E];return c&&C.isReady()&&c(C),C._refCount++,C}this._gl&&Ps(this._gl);const R=new Ci(e,t,b?this:i,s,this,n,o,c,h,f,E,t.shaderLanguage??_,t.extraInitializationsAsync??m);return this._compiledEffects[E]=R,R}_getShaderSource(e){return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,i,s,n=null){const o=Ps(this._gl);return o._contextWasLost=this._contextWasLost,o.validateShaderPrograms=this.validateShaderPrograms,tv(e,t,i,s||this._gl,n)}createShaderProgram(e,t,i,s,n,o=null){const c=Ps(this._gl);return c._contextWasLost=this._contextWasLost,c.validateShaderPrograms=this.validateShaderPrograms,iv(e,t,i,s,n||this._gl,o)}inlineShaderCode(e){return e}createPipelineContext(e){if(this._gl){const i=Ps(this._gl);i.parallelShaderCompile=this._caps.parallelShaderCompile}const t=_S(this._gl);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){return Tm(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,i,s,n,o,c,h,f,_,m){const g=Ps(this._gl);return g._contextWasLost=this._contextWasLost,g.validateShaderPrograms=this.validateShaderPrograms,g._createShaderProgramInjection=this._createShaderProgram.bind(this),g.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),g.createShaderProgramInjection=this.createShaderProgram.bind(this),g.loadFileInjection=this._loadFile.bind(this),gS(e,t,i,s,n,o,c,h,f,_,m)}_createShaderProgram(e,t,i,s,n=null){return ym(e,t,i,s,n)}_isRenderingStateCompiled(e){return this._isDisposed?!1:mS(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){xS(e,t)}getUniforms(e,t){const i=new Array,s=e;for(let n=0;n<t.length;n++)i.push(this._gl.getUniformLocation(s.program,t[n]));return i}getAttributes(e,t){const i=[],s=e;for(let n=0;n<t.length;n++)try{i.push(this._gl.getAttribLocation(s.program,t[n]))}catch{i.push(-1)}return i}enableEffect(e){e=e!==null&&ov(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,i){return e?(this._gl.uniform2i(e,t,i),!0):!1}setInt3(e,t,i,s){return e?(this._gl.uniform3i(e,t,i,s),!0):!1}setInt4(e,t,i,s,n){return e?(this._gl.uniform4i(e,t,i,s,n),!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,i){return e?(this._gl.uniform2ui(e,t,i),!0):!1}setUInt3(e,t,i,s){return e?(this._gl.uniform3ui(e,t,i,s),!0):!1}setUInt4(e,t,i,s,n){return e?(this._gl.uniform4ui(e,t,i,s,n),!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,i){return e?(this._gl.uniform2f(e,t,i),!0):!1}setFloat3(e,t,i,s){return e?(this._gl.uniform3f(e,t,i,s),!0):!1}setFloat4(e,t,i,s,n){return e?(this._gl.uniform4f(e,t,i,s,n),!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 i=this._gl;let s=i.NEAREST,n=i.NEAREST,o=!1;switch(e){case 11:s=i.LINEAR,t?n=i.LINEAR_MIPMAP_NEAREST:n=i.LINEAR;break;case 3:s=i.LINEAR,o=!0,t?n=i.LINEAR_MIPMAP_LINEAR:n=i.LINEAR;break;case 8:o=!0,s=i.NEAREST,t?n=i.NEAREST_MIPMAP_LINEAR:n=i.NEAREST;break;case 4:s=i.NEAREST,t?n=i.NEAREST_MIPMAP_NEAREST:n=i.NEAREST;break;case 5:s=i.NEAREST,t?n=i.LINEAR_MIPMAP_NEAREST:n=i.LINEAR;break;case 6:o=!0,s=i.NEAREST,t?n=i.LINEAR_MIPMAP_LINEAR:n=i.LINEAR;break;case 7:s=i.NEAREST,n=i.LINEAR;break;case 1:s=i.NEAREST,n=i.NEAREST;break;case 9:s=i.LINEAR,t?n=i.NEAREST_MIPMAP_NEAREST:n=i.NEAREST;break;case 10:o=!0,s=i.LINEAR,t?n=i.NEAREST_MIPMAP_LINEAR:n=i.NEAREST;break;case 2:s=i.LINEAR,n=i.LINEAR;break;case 12:s=i.LINEAR,n=i.NEAREST;break}return{min:n,mag:s,hasMipMaps:o}}_createTexture(){const e=this._gl.createTexture();if(!e)throw new Error("Unable to create texture");return e}_createHardwareTexture(){return new tm(this._createTexture(),this._gl)}_createInternalTexture(e,t,i=!0,s=0){let n,o=!1,c=0,h=3,f=5,_=!1,m=1,g,x=!1,y=0,b=!1;t!==void 0&&typeof t=="object"?(n=!!t.generateMipMaps,o=!!t.createMipMaps,c=t.type===void 0?0:t.type,h=t.samplingMode===void 0?3:t.samplingMode,f=t.format===void 0?5:t.format,_=t.useSRGBBuffer===void 0?!1:t.useSRGBBuffer,m=t.samples??1,g=t.label,x=!!t.createMSAATexture,y=t.comparisonFunction||0,b=!!t.isCube):n=!!t,_&&(_=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(c===1&&!this._caps.textureFloatLinearFiltering||c===2&&!this._caps.textureHalfFloatLinearFiltering)&&(h=1),c===1&&!this._caps.textureFloat&&(c=0,pe.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const v=mb(f),E=Lc(f),R=this._gl,C=new Es(this,s),O=e.width||e,M=e.height||e,I=e.depth||0,P=e.layers||0,L=this._getSamplingParameters(h,(n||o)&&!v),V=P!==0?R.TEXTURE_2D_ARRAY:I!==0?R.TEXTURE_3D:b?R.TEXTURE_CUBE_MAP:R.TEXTURE_2D,X=v?this._getInternalFormatFromDepthTextureFormat(f,!0,E):this._getRGBABufferInternalSizedFormat(c,f,_),re=v?E?R.DEPTH_STENCIL:R.DEPTH_COMPONENT:this._getInternalFormat(f),ae=v?this._getWebGLTextureTypeFromDepthTextureFormat(f):this._getWebGLTextureType(c);if(this._bindTextureDirectly(V,C),P!==0)C.is2DArray=!0,R.texImage3D(V,0,X,O,M,P,0,re,ae,null);else if(I!==0)C.is3D=!0,R.texImage3D(V,0,X,O,M,I,0,re,ae,null);else if(b){C.isCube=!0;for(let de=0;de<6;de++)R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X+de,0,X,O,M,0,re,ae,null)}else R.texImage2D(V,0,X,O,M,0,re,ae,null);if(R.texParameteri(V,R.TEXTURE_MAG_FILTER,L.mag),R.texParameteri(V,R.TEXTURE_MIN_FILTER,L.min),R.texParameteri(V,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(V,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),v&&this.webGLVersion>1&&(y===0?(R.texParameteri(V,R.TEXTURE_COMPARE_FUNC,515),R.texParameteri(V,R.TEXTURE_COMPARE_MODE,R.NONE)):(R.texParameteri(V,R.TEXTURE_COMPARE_FUNC,y),R.texParameteri(V,R.TEXTURE_COMPARE_MODE,R.COMPARE_REF_TO_TEXTURE))),(n||o)&&this._gl.generateMipmap(V),this._bindTextureDirectly(V,null),C._useSRGBBuffer=_,C.baseWidth=O,C.baseHeight=M,C.width=O,C.height=M,C.depth=P||I,C.isReady=!0,C.samples=m,C.generateMipMaps=n,C.samplingMode=h,C.type=c,C.format=f,C.label=g,C.comparisonFunction=y,this._internalTexturesCache.push(C),x){let de;if(mb(C.format)?de=this._setupFramebufferDepthAttachments(Lc(C.format),C.format!==19,C.width,C.height,m,C.format,!0):de=this._createRenderBuffer(C.width,C.height,m,-1,this._getRGBABufferInternalSizedFormat(C.type,C.format,C._useSRGBBuffer),-1),!de)throw new Error("Unable to create render buffer");C._autoMSAAManagement=!0;let U=C._hardwareTexture;U||(U=C._hardwareTexture=this._createHardwareTexture()),U.addMSAARenderBuffer(de)}return C}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,i,s,n=3,o=null,c=null,h=null,f=null,_=null,m=null,g,x,y,b){return this._createTextureBase(e,t,i,s,n,o,c,(...v)=>this._prepareWebGLTexture(...v,_),(v,E,R,C,O,M)=>{const I=this._gl,P=R.width===v&&R.height===E;O._creationFlags=y??0;const L=this._getTexImageParametersForCreateTexture(O.format,O._useSRGBBuffer);if(P)return I.texImage2D(I.TEXTURE_2D,0,L.internalFormat,L.format,L.type,R),!1;const V=this._caps.maxTextureSize;if(R.width>V||R.height>V||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext||(this._workingCanvas.width=v,this._workingCanvas.height=E,this._workingContext.drawImage(R,0,0,R.width,R.height,0,0,v,E),I.texImage2D(I.TEXTURE_2D,0,L.internalFormat,L.format,L.type,this._workingCanvas),O.width=v,O.height=E),!1;{const X=new Es(this,2);this._bindTextureDirectly(I.TEXTURE_2D,X,!0),I.texImage2D(I.TEXTURE_2D,0,L.internalFormat,L.format,L.type,R),this._rescaleTexture(X,O,s,L.format,()=>{this._releaseTexture(X),this._bindTextureDirectly(I.TEXTURE_2D,O,!0),M()})}return!0},h,f,_,m,g,x,b)}_getTexImageParametersForCreateTexture(e,t){let i,s;return this.webGLVersion===1?(i=this._getInternalFormat(e,t),s=i):(i=this._getInternalFormat(e,!1),s=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:s,format:i,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,i,s,n){}_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,i=!1){const s=this._getTextureTarget(t),n=this._getSamplingParameters(e,t.useMipMaps||i);this._setTextureParameterInteger(s,this._gl.TEXTURE_MAG_FILTER,n.mag,t),this._setTextureParameterInteger(s,this._gl.TEXTURE_MIN_FILTER,n.min),i&&n.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(s)),this._bindTextureDirectly(s,null),t.samplingMode=e}updateTextureDimensions(e,t,i,s=1){}updateTextureWrappingMode(e,t,i=null,s=null){const n=this._getTextureTarget(e);t!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),i!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i),e),e._cachedWrapV=i),(e.is2DArray||e.is3D)&&s!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(s),e),e._cachedWrapR=s),this._bindTextureDirectly(n,null)}_uploadCompressedDataToTextureDirectly(e,t,i,s,n,o=0,c=0){const h=this._gl;let f=h.TEXTURE_2D;if(e.isCube&&(f=h.TEXTURE_CUBE_MAP_POSITIVE_X+o),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 _=e._hardwareTexture;_.memoryAllocated||(h.texStorage2D(e.isCube?h.TEXTURE_CUBE_MAP:h.TEXTURE_2D,Math.floor(Math.log2(Math.max(i,s)))+1,t,e.width,e.height),_.memoryAllocated=!0),this._gl.compressedTexSubImage2D(f,c,0,0,i,s,t,n)}else this._gl.compressedTexImage2D(f,c,t,i,s,0,n)}_uploadDataToTextureDirectly(e,t,i=0,s=0,n,o=!1){const c=this._gl,h=this._getWebGLTextureType(e.type),f=this._getInternalFormat(e.format),_=n===void 0?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(n,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let m=c.TEXTURE_2D;e.isCube&&(m=c.TEXTURE_CUBE_MAP_POSITIVE_X+i);const g=Math.round(Math.log(e.width)*Math.LOG2E),x=Math.round(Math.log(e.height)*Math.LOG2E),y=o?e.width:Math.pow(2,Math.max(g-s,0)),b=o?e.height:Math.pow(2,Math.max(x-s,0));c.texImage2D(m,s,_,y,b,0,f,h,t)}updateTextureData(e,t,i,s,n,o,c=0,h=0,f=!1){const _=this._gl,m=this._getWebGLTextureType(e.type),g=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let x=_.TEXTURE_2D,y=_.TEXTURE_2D;e.isCube&&(y=_.TEXTURE_CUBE_MAP_POSITIVE_X+c,x=_.TEXTURE_CUBE_MAP),this._bindTextureDirectly(x,e,!0),_.texSubImage2D(y,h,i,s,n,o,g,m,t),f&&this._gl.generateMipmap(y),this._bindTextureDirectly(x,null)}_uploadArrayBufferViewToTexture(e,t,i=0,s=0){const n=this._gl,o=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,i,s),this._bindTextureDirectly(o,null,!0)}_prepareWebGLTextureContinuation(e,t,i,s,n){const o=this._gl;if(!o)return;const c=this._getSamplingParameters(n,!i);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,c.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,c.min),!i&&!s&&o.generateMipmap(o.TEXTURE_2D),this._bindTextureDirectly(o.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,i,s,n,o,c,h,f,_){const m=this.getCaps().maxTextureSize,g=Math.min(m,this.needPOTTextures?em(s.width,m):s.width),x=Math.min(m,this.needPOTTextures?em(s.height,m):s.height),y=this._gl;if(y){if(!e._hardwareTexture){i&&i.removePendingData(e);return}this._bindTextureDirectly(y.TEXTURE_2D,e,!0),this._unpackFlipY(n===void 0?!0:!!n),e.baseWidth=s.width,e.baseHeight=s.height,e.width=g,e.height=x,e.isReady=!0,e.type=e.type!==-1?e.type:0,e.format=e.format!==-1?e.format:_??(t===".jpg"&&!e._useSRGBBuffer?4:5),!h(g,x,s,t,e,()=>{this._prepareWebGLTextureContinuation(e,i,o,c,f)})&&this._prepareWebGLTextureContinuation(e,i,o,c,f)}}_getInternalFormatFromDepthTextureFormat(e,t,i){const s=this._gl;if(!t)return s.STENCIL_INDEX8;let o=i?s.DEPTH_STENCIL:s.DEPTH_COMPONENT;return this.webGLVersion>1?e===15?o=s.DEPTH_COMPONENT16:e===16?o=s.DEPTH_COMPONENT24:e===17||e===13?o=i?s.DEPTH24_STENCIL8:s.DEPTH_COMPONENT24:e===14?o=s.DEPTH_COMPONENT32F:e===18&&(o=i?s.DEPTH32F_STENCIL8:s.DEPTH_COMPONENT32F):o=s.DEPTH_COMPONENT16,o}_getWebGLTextureTypeFromDepthTextureFormat(e){const t=this._gl;let i=t.UNSIGNED_INT;return e===15?i=t.UNSIGNED_SHORT:e===17||e===13?i=t.UNSIGNED_INT_24_8:e===14?i=t.FLOAT:e===18?i=t.FLOAT_32_UNSIGNED_INT_24_8_REV:e===19&&(i=t.UNSIGNED_BYTE),i}_setupFramebufferDepthAttachments(e,t,i,s,n=1,o,c=!1){const h=this._gl;o=o??(e?13:14);const f=this._getInternalFormatFromDepthTextureFormat(o,t,e);return e&&t?this._createRenderBuffer(i,s,n,h.DEPTH_STENCIL,f,c?-1:h.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(i,s,n,f,f,c?-1:h.DEPTH_ATTACHMENT):e?this._createRenderBuffer(i,s,n,f,f,c?-1:h.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,i,s,n,o,c=!0){const f=this._gl.createRenderbuffer();return this._updateRenderBuffer(f,e,t,i,s,n,o,c)}_updateRenderBuffer(e,t,i,s,n,o,c,h=!0){const f=this._gl;return f.bindRenderbuffer(f.RENDERBUFFER,e),s>1&&f.renderbufferStorageMultisample?f.renderbufferStorageMultisample(f.RENDERBUFFER,s,o,t,i):f.renderbufferStorage(f.RENDERBUFFER,n,t,i),c!==-1&&f.framebufferRenderbuffer(f.FRAMEBUFFER,c,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&&(pS(e,this._gl),this._currentProgram=e)}bindSamplers(e){const t=e.getPipelineContext();this._setProgram(t.program);const i=e.getSamplers();for(let s=0;s<i.length;s++){const n=e.getUniform(i[s]);n&&(this._boundUniforms[s]=n)}this._currentEffect=null}_activateCurrentTexture(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,i=!1,s=!1){let n=!1;const o=t&&t._associatedChannel>-1;if(i&&o&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||s){if(this._activateCurrentTexture(),t&&t.isMultiview)throw pe.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 i&&(n=!0,this._activateCurrentTexture());return o&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),n}_bindTexture(e,t,i){if(e===void 0)return;t&&(t._associatedChannel=e),this._activeChannel=e;const s=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(s,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,i,s){e!==void 0&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))}_bindSamplerUniformToChannel(e,t){const i=this._boundUniforms[e];!i||i._currentState===t||(this._gl.uniform1i(i,t),i._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,i=!1,s=!1,n=""){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 o;s?o=t.depthStencilTexture:t.isReady()?o=t.getInternalTexture():t.isCube?o=this.emptyCubeTexture:t.is3D?o=this.emptyTexture3D:t.is2DArray?o=this.emptyTexture2DArray:o=this.emptyTexture,!i&&o&&(o._associatedChannel=e);let c=!0;this._boundTexturesCache[e]===o&&(i||this._bindSamplerUniformToChannel(o._associatedChannel,e),c=!1),this._activeChannel=e;const h=this._getTextureTarget(o);if(c&&this._bindTextureDirectly(h,o,i),o&&!o.isMultiview){if(o.isCube&&o._cachedCoordinatesMode!==t.coordinatesMode){o._cachedCoordinatesMode=t.coordinatesMode;const f=t.coordinatesMode!==3&&t.coordinatesMode!==5?1:0;t.wrapU=f,t.wrapV=f}o._cachedWrapU!==t.wrapU&&(o._cachedWrapU=t.wrapU,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),o)),o._cachedWrapV!==t.wrapV&&(o._cachedWrapV=t.wrapV,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),o)),o.is3D&&o._cachedWrapR!==t.wrapR&&(o._cachedWrapR=t.wrapR,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),o)),this._setAnisotropicLevel(h,o,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,i,s){if(!(e===void 0||!t)){(!this._textureUnits||this._textureUnits.length!==i.length)&&(this._textureUnits=new Int32Array(i.length));for(let n=0;n<i.length;n++){const o=i[n].getInternalTexture();o?(this._textureUnits[n]=e+n,o._associatedChannel=e+n):this._textureUnits[n]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let n=0;n<i.length;n++)this._setTexture(this._textureUnits[n],i[n],!0)}}_setAnisotropicLevel(e,t,i){const s=this._caps.textureAnisotropicFilterExtension;t.samplingMode!==11&&t.samplingMode!==3&&t.samplingMode!==2&&(i=1),s&&t._cachedAnisotropicFilteringLevel!==i&&(this._setTextureParameterFloat(e,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(i,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=i)}_setTextureParameterFloat(e,t,i,s){this._bindTextureDirectly(e,s,!0,!0),this._gl.texParameterf(e,t,i)}_setTextureParameterInteger(e,t,i,s){s&&this._bindTextureDirectly(e,s,!0,!0),this._gl.texParameteri(e,t,i)}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(){Xi()&&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(),D_(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 i=!0;const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s),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 n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);const o=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i=i&&o===t.FRAMEBUFFER_COMPLETE,i=i&&t.getError()===t.NO_ERROR,i&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){t.bindFramebuffer(t.FRAMEBUFFER,null);const c=t.RGBA,h=t.UNSIGNED_BYTE,f=new Uint8Array(4);t.readPixels(0,0,1,1,c,h,f),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(s),t.deleteFramebuffer(n),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i}_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 i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:i=this._gl.ALPHA;break;case 1:i=this._gl.LUMINANCE;break;case 2:i=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:i=this._gl.RED;break;case 7:case 33324:case 36761:i=this._gl.RG;break;case 4:case 32852:case 36762:i=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;break}if(this._webGLVersion>1)switch(e){case 8:i=this._gl.RED_INTEGER;break;case 9:i=this._gl.RG_INTEGER;break;case 10:i=this._gl.RGB_INTEGER;break;case 11:i=this._gl.RGBA_INTEGER;break}return i}_getRGBABufferInternalSizedFormat(e,t,i=!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 i?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 i?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return i?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 i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,i,s,n=!0,o=!0,c=null){const h=n?4:3,f=n?this._gl.RGBA:this._gl.RGB,_=i*s*h;if(!c)c=new Uint8Array(_);else if(c.length<_)return pe.Error(`Data buffer is too small to store the read pixels (${c.length} should be more than ${_})`),Promise.resolve(c);return o&&this.flushFramebuffer(),this._gl.readPixels(e,t,i,s,f,this._gl.UNSIGNED_BYTE,c),Promise.resolve(c)}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=Ie._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=Ie._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}}ot._TempClearColorUint32=new Uint32Array(4);ot._TempClearColorInt32=new Int32Array(4);ot.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"]}];ot._ConcatenateShader=$T;ot._IsSupported=null;ot._HasMajorPerformanceCaveat=null;class qS{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new KS(e)}sampleFrame(e=Tn.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 KS{constructor(e){this._samples=new Array(e),this.reset()}add(e){let t;if(this.isSaturated()){const i=this._samples[this._pos];t=i-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(i-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 ZS(a){!a||!a.setAttribute||(a.setAttribute("touch-action","none"),a.style.touchAction="none",a.style.webkitTapHighlightColor="transparent")}function QS(a,e,t){a._onCanvasFocus=()=>{a.onCanvasFocusObservable.notifyObservers(a)},a._onCanvasBlur=()=>{a.onCanvasBlurObservable.notifyObservers(a)},a._onCanvasContextMenu=s=>{a.disableContextMenu&&s.preventDefault()}
289,e.addEventListener("focus",a._onCanvasFocus),e.addEventListener("blur",a._onCanvasBlur),e.addEventListener("contextmenu",a._onCanvasContextMenu),a._onBlur=()=>{a.disablePerformanceMonitorInBackground&&a.performanceMonitor.disable(),a._windowIsBackground=!0},a._onFocus=()=>{a.disablePerformanceMonitorInBackground&&a.performanceMonitor.enable(),a._windowIsBackground=!1},a._onCanvasPointerOut=s=>{document.elementFromPoint(s.clientX,s.clientY)!==e&&a.onCanvasPointerOutObservable.notifyObservers(s)};const i=a.getHostWindow();i&&typeof i.addEventListener=="function"&&(i.addEventListener("blur",a._onBlur),i.addEventListener("focus",a._onFocus)),e.addEventListener("pointerout",a._onCanvasPointerOut),t.doNotHandleTouchAction||ZS(e),!Ie.audioEngine&&t.audioEngine&&Ie.AudioEngineFactory&&(Ie.audioEngine=Ie.AudioEngineFactory(a.getRenderingCanvas(),a.getAudioContext(),a.getAudioDestination())),Ha()&&(a._onFullscreenChange=()=>{a.isFullscreen=!!document.fullscreenElement,a.isFullscreen&&a._pointerLockRequested&&e&&uv(e)},document.addEventListener("fullscreenchange",a._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",a._onFullscreenChange,!1),a._onPointerLockChange=()=>{a.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",a._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",a._onPointerLockChange,!1)),a.enableOfflineSupport=Ie.OfflineProviderFactory!==void 0,a._deterministicLockstep=!!t.deterministicLockstep,a._lockstepMaxSteps=t.lockstepMaxSteps||0,a._timeStep=t.timeStep||1/60}function $S(a,e){mt.Instances.length===1&&Ie.audioEngine&&(Ie.audioEngine.dispose(),Ie.audioEngine=null);const t=a.getHostWindow();t&&typeof t.removeEventListener=="function"&&(t.removeEventListener("blur",a._onBlur),t.removeEventListener("focus",a._onFocus)),e&&(e.removeEventListener("focus",a._onCanvasFocus),e.removeEventListener("blur",a._onCanvasBlur),e.removeEventListener("pointerout",a._onCanvasPointerOut),e.removeEventListener("contextmenu",a._onCanvasContextMenu)),Ha()&&(document.removeEventListener("fullscreenchange",a._onFullscreenChange),document.removeEventListener("mozfullscreenchange",a._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",a._onFullscreenChange),document.removeEventListener("msfullscreenchange",a._onFullscreenChange),document.removeEventListener("pointerlockchange",a._onPointerLockChange),document.removeEventListener("mspointerlockchange",a._onPointerLockChange),document.removeEventListener("mozpointerlockchange",a._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",a._onPointerLockChange))}function JS(a){const e=eM(a);if(e)return e;const t=tM(a);return t||iM(a)}function eM(a){if(!Ha()||!document.body)return null;const e=document.createElement("span");e.textContent="Hg",e.style.font=a;const t=document.createElement("div");t.style.display="inline-block",t.style.width="1px",t.style.height="0px",t.style.verticalAlign="bottom";const i=document.createElement("div");i.style.whiteSpace="nowrap",i.appendChild(e),i.appendChild(t),document.body.appendChild(i);let s,n;try{n=t.getBoundingClientRect().top-e.getBoundingClientRect().top,t.style.verticalAlign="baseline",s=t.getBoundingClientRect().top-e.getBoundingClientRect().top}finally{document.body.removeChild(i)}const o={ascent:s,height:n,descent:n-s};return hv(o)?o:null}function tM(a){let e=null;try{typeof OffscreenCanvas<"u"?e=new OffscreenCanvas(64,64):Ha()&&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=a;const i=t.measureText("Hg"),s=Number(i.actualBoundingBoxAscent??i.fontBoundingBoxAscent),n=Number(i.actualBoundingBoxDescent??i.fontBoundingBoxDescent),o={ascent:s,height:s+n,descent:n};return hv(o)?o:null}catch{return null}finally{const t=e;typeof t?.dispose=="function"&&t.dispose()}}function iM(a){const e=Math.max(1,sM(a)),t=e*.8,i=e*.2;return{ascent:t,height:t+i,descent:i}}function sM(a){const e=/(?:^|\s)([0-9]+(?:\.[0-9]+)?)px(?:\/|\s|$)/.exec(String(a||""));return e?Number(e[1]):16}function hv(a){return Number.isFinite(a.ascent)&&Number.isFinite(a.height)&&Number.isFinite(a.descent)&&a.height>0}async function rM(a,e,t){return await new Promise((i,s)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{a.createImageBitmap(n,t).then(o=>{i(o)})})},n.onerror=()=>{s(`Error loading image ${n.src}`)},n.src=e})}function nM(a,e,t,i){const n=a.createCanvas(t,i).getContext("2d");if(!n)throw new Error("Unable to get 2d context for resizeImageBitmap");return n.drawImage(e,0,0),n.getImageData(0,0,t,i).data}function aM(a){const e=a.requestFullscreen||a.webkitRequestFullscreen;e&&e.call(a)}function oM(){const a=document;document.exitFullscreen?document.exitFullscreen():a.webkitCancelFullScreen&&a.webkitCancelFullScreen()}function uv(a){if(a.requestPointerLock){const e=a.requestPointerLock();e instanceof Promise?e.then(()=>{a.focus()}).catch(()=>{}):a.focus()}}function lM(){document.exitPointerLock&&document.exitPointerLock()}class mr{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=mr.Enabled,this._lastSecValueCount++}
289addCount(e,t){mr.Enabled&&(this._current+=e,this._hasCurrentValue=!0,t&&this._fetchResult())}beginMonitoring(){mr.Enabled&&(this._startMonitoringTime=Tn.Now)}endMonitoring(e=!0){if(!mr.Enabled)return;e&&this.fetchNewFrame();const t=Tn.Now;this._current=t-this._startMonitoringTime,this._hasCurrentValue=!0,e&&this._fetchResult()}endFrame(){this._fetchResult()}_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=Tn.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}mr.Enabled=!0;let gb=!1;function fv(){gb||(gb=!0,Ie.prototype.getInputElement=function(){return this._renderingCanvas},Ie.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},Ie.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},Ie.prototype.getAspectRatio=function(a,e=!1){const t=a.viewport;return this.getRenderWidth(e)*t.width/(this.getRenderHeight(e)*t.height)},Ie.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},Ie.prototype._verifyPointerLock=function(){this._onPointerLockChange?.()})}let pb=!1;function Em(){pb||(pb=!0,Ie.prototype.getRenderPassNames=function(){return this._renderPassNames},Ie.prototype.getCurrentRenderPassName=function(){return this._renderPassNames[this.currentRenderPassId]},Ie.prototype.createRenderPassId=function(a){const e=++Ie._RenderPassIdCounter;return this._renderPassNames[e]=a??"NONAME",e},Ie.prototype.releaseRenderPassId=function(a){this._renderPassNames[a]=void 0;for(let e=0;e<this.scenes.length;++e){const t=this.scenes[e];for(let i=0;i<t.meshes.length;++i){const s=t.meshes[i];if(s._releaseRenderPassId(a),s.subMeshes)for(let n=0;n<s.subMeshes.length;++n)s.subMeshes[n]._removeDrawWrapper(a)}}})}class Pe extends ot{static get NpmPackage(){return Ie.NpmPackage}static get Version(){return Ie.Version}static get Instances(){return mt.Instances}static get LastCreatedEngine(){return mt.LastCreatedEngine}static get LastCreatedScene(){return mt.LastCreatedScene}static DefaultLoadingScreenFactory(e){return Ie.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){return!!Pe._RescalePostProcessFactory}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){return this._performanceMonitor}constructor(e,t,i,s=!1){fv(),Em(),super(e,t,i,s),this._performanceMonitor=new qS,this._drawCalls=new mr,e&&(this._features.supportRenderPasses=!0)}_initGLContext(){super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){super._sharedInit(e),QS(this,e,this._creationOptions)}resizeImageBitmap(e,t,i){return nM(this,e,t,i)}async _createImageBitmapFromSource(e,t){return await rM(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&aM(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&oM()}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,i,s){const n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,s),n}scissorClear(e,t,i,s,n){this.enableScissor(e,t,i,s),this.clear(n,!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 JS(e)}enterPointerlock(){this._renderingCanvas&&uv(this._renderingCanvas)}exitPointerlock(){lM()}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,i,s,n,o=null){n=n||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);const c=super.createShaderProgram(e,t,i,s,n,o);return this.onAfterShaderCompilationObservable.notifyObservers(this),c}_createShaderProgram(e,t,i,s,n=null){const o=s.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");if(s.attachShader(o,t),s.attachShader(o,i),this.webGLVersion>1&&n){const c=this.createTransformFeedback();this.bindTransformFeedback(c),this.setTranformFeedbackVaryings(o,n),e.transformFeedback=c}return s.linkProgram(o),this.webGLVersion>1&&n&&this.bindTransformFeedback(null),e.context=s,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),o}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){super._releaseRenderTargetWrapper(e);for(const t of this.scenes){for(const i of t.postProcesses)i._outputTexture===e&&(i._outputTexture=null);for(const i of t.cameras)for(const s of i._postProcesses)s&&s._outputTexture===e&&(s._outputTexture=null)}}_rescaleTexture(e,t,i,s,n){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 o=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&Pe._RescalePostProcessFactory&&(this._rescalePostProcess=Pe._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;const c=()=>{this._rescalePostProcess.onApply=function(_){_._bindTexture("textureSampler",e)};let f=i;f||(f=this.scenes[this.scenes.length-1]),f.postProcessManager.directRender([this._rescalePostProcess],o,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,s,0,0,t.width,t.height,0),this.unBindFramebuffer(o
vendor: 5,027 bytes, line 289
289),o.dispose(),n&&n()},h=this._rescalePostProcess.getEffect();h?h.executeWhenCompiled(c):this._rescalePostProcess.onEffectCreatedObservable.addOnce(f=>{f.executeWhenCompiled(c)})}}wrapWebGLTexture(e,t=!1,i=3,s=0,n=0){const o=new tm(e,this._gl),c=new Es(this,15,!0);return c._hardwareTexture=o,c.baseWidth=s,c.baseHeight=n,c.width=s,c.height=n,c.isReady=!0,c.useMipMaps=t,this.updateTextureSamplingMode(i,c),c}updateWrappedWebGLTexture(e,t){if(e.source!==15)throw new Error("updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.");for(const s of this._renderTargetWrapperCache)if(s.textures?.includes(e)){if(s.isMulti)throw new Error("updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.");if(s._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 tm(t,this._gl),e.isReady=!0,e._cachedCoordinatesMode=null,e._cachedWrapU=null,e._cachedWrapV=null,e._cachedWrapR=null,e._cachedAnisotropicFilteringLevel=null;for(const s in this._boundTexturesCache)this._boundTexturesCache[s]===e&&(this._boundTexturesCache[s]=null);this.updateTextureSamplingMode(e.samplingMode,e);const i=this._gl;for(const s of this._renderTargetWrapperCache){if(s.texture!==e)continue;const n=s,o=s.samples,c=o>1;n._framebuffer&&i.deleteFramebuffer(n._framebuffer),!c&&n._depthStencilBuffer&&(i.deleteRenderbuffer(n._depthStencilBuffer),n._depthStencilBuffer=null);const h=this._currentFramebuffer,f=i.createFramebuffer();this._bindUnboundFramebuffer(f),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0),c||(n._depthStencilBuffer=this._setupFramebufferDepthAttachments(s._generateStencilBuffer,s._generateDepthBuffer,s.width,s.height)),this._bindUnboundFramebuffer(h),n._framebuffer=f,c&&(s._samples=1,this.updateRenderTargetTextureSampleCount(n,o))}}_uploadImageToTexture(e,t,i=0,s=0){const n=this._gl,o=this._getWebGLTextureType(e.type),c=this._getInternalFormat(e.format),h=this._getRGBABufferInternalSizedFormat(e.type,c),f=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(f,e,!0),this._unpackFlipY(e.invertY);let _=n.TEXTURE_2D;e.isCube&&(_=n.TEXTURE_CUBE_MAP_POSITIVE_X+i),n.texImage2D(_,s,h,c,o,t),this._bindTextureDirectly(f,null,!0)}updateTextureComparisonFunction(e,t){if(this.webGLVersion===1){pe.Error("WebGL 1 does not support texture comparison.");return}const i=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),t===0?(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),t===0?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.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 i=new Bc(t);return i.capacity=e,this.bindArrayBuffer(i),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),i.references=1,i}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}async _clientWaitAsync(e,t=0,i=10){const s=this._gl;return await new Promise((n,o)=>{vm(()=>{const c=s.clientWaitSync(e,t,0);if(c==s.WAIT_FAILED)throw new Error("clientWaitSync failed");return c!=s.TIMEOUT_EXPIRED},n,o,i)})}_readPixelsAsync(e,t,i,s,n,o,c){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,c.byteLength,h.STREAM_READ),h.readPixels(e,t,i,s,n,o,0),h.bindBuffer(h.PIXEL_PACK_BUFFER,null);const _=h.fenceSync(h.SYNC_GPU_COMMANDS_COMPLETE,0);return _?(h.flush(),this._clientWaitAsync(_,0,10).then(()=>(h.deleteSync(_),h.bindBuffer(h.PIXEL_PACK_BUFFER,f),h.getBufferSubData(h.PIXEL_PACK_BUFFER,0,c),h.bindBuffer(h.PIXEL_PACK_BUFFER,null),h.deleteBuffer(f),c))):null}dispose(){this.hideLoadingUI?.(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),$S(this,this._renderingCanvas),super.dispose()}}Pe.ALPHA_DISABLE=0;Pe.ALPHA_ADD=1;Pe.ALPHA_COMBINE=2;Pe.ALPHA_SUBTRACT=3;Pe.ALPHA_MULTIPLY=4;Pe.ALPHA_MAXIMIZED=5;Pe.ALPHA_ONEONE=6;Pe.ALPHA_PREMULTIPLIED=7;Pe.ALPHA_PREMULTIPLIED_PORTERDUFF=8;Pe.ALPHA_INTERPOLATE=9;Pe.ALPHA_SCREENMODE=10;Pe.DELAYLOADSTATE_NONE=0;Pe.DELAYLOADSTATE_LOADED=1;Pe.DELAYLOADSTATE_LOADING=2;Pe.DELAYLOADSTATE_NOTLOADED=4;Pe.NEVER=512;Pe.ALWAYS=519;Pe.LESS=513;Pe.EQUAL=514;Pe.LEQUAL=515;Pe.GREATER=516;
289Pe.GEQUAL=518;Pe.NOTEQUAL=517;Pe.KEEP=7680;Pe.REPLACE=7681;Pe.INCR=7682;Pe.DECR=7683;Pe.INVERT=5386;Pe.INCR_WRAP=34055;Pe.DECR_WRAP=34056;Pe.TEXTURE_CLAMP_ADDRESSMODE=0;Pe.TEXTURE_WRAP_ADDRESSMODE=1;Pe.TEXTURE_MIRROR_ADDRESSMODE=2;Pe.TEXTUREFORMAT_ALPHA=0;Pe.TEXTUREFORMAT_LUMINANCE=1;Pe.TEXTUREFORMAT_LUMINANCE_ALPHA=2;Pe.TEXTUREFORMAT_RGB=4;Pe.TEXTUREFORMAT_RGBA=5;Pe.TEXTUREFORMAT_RED=6;Pe.TEXTUREFORMAT_R=6;Pe.TEXTUREFORMAT_R16_UNORM=33322;Pe.TEXTUREFORMAT_RG16_UNORM=33324;Pe.TEXTUREFORMAT_RGB16_UNORM=32852;Pe.TEXTUREFORMAT_RGBA16_UNORM=32859;Pe.TEXTUREFORMAT_R16_SNORM=36760;Pe.TEXTUREFORMAT_RG16_SNORM=36761;Pe.TEXTUREFORMAT_RGB16_SNORM=36762;Pe.TEXTUREFORMAT_RGBA16_SNORM=36763;Pe.TEXTUREFORMAT_RG=7;Pe.TEXTUREFORMAT_RED_INTEGER=8;Pe.TEXTUREFORMAT_R_INTEGER=8;Pe.TEXTUREFORMAT_RG_INTEGER=9;Pe.TEXTUREFORMAT_RGB_INTEGER=10;Pe.TEXTUREFORMAT_RGBA_INTEGER=11;Pe.TEXTURETYPE_UNSIGNED_BYTE=0;Pe.TEXTURETYPE_UNSIGNED_INT=0;Pe.TEXTURETYPE_FLOAT=1;Pe.TEXTURETYPE_HALF_FLOAT=2;Pe.TEXTURETYPE_BYTE=3;Pe.TEXTURETYPE_SHORT=4;Pe.TEXTURETYPE_UNSIGNED_SHORT=5;Pe.TEXTURETYPE_INT=6;Pe.TEXTURETYPE_UNSIGNED_INTEGER=7;Pe.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8;Pe.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9;Pe.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10;Pe.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11;Pe.TEXTURETYPE_UNSIGNED_INT_24_8=12;Pe.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13;Pe.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14;Pe.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15;Pe.TEXTURE_NEAREST_SAMPLINGMODE=1;Pe.TEXTURE_BILINEAR_SAMPLINGMODE=2;Pe.TEXTURE_TRILINEAR_SAMPLINGMODE=3;Pe.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8;Pe.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11;Pe.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3;Pe.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4;Pe.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5;Pe.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6;Pe.TEXTURE_NEAREST_LINEAR=7;Pe.TEXTURE_NEAREST_NEAREST=1;Pe.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9;Pe.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10;Pe.TEXTURE_LINEAR_LINEAR=2;Pe.TEXTURE_LINEAR_NEAREST=12;Pe.TEXTURE_EXPLICIT_MODE=0;Pe.TEXTURE_SPHERICAL_MODE=1;Pe.TEXTURE_PLANAR_MODE=2;Pe.TEXTURE_CUBIC_MODE=3;Pe.TEXTURE_PROJECTION_MODE=4;Pe.TEXTURE_SKYBOX_MODE=5;Pe.TEXTURE_INVCUBIC_MODE=6;Pe.TEXTURE_EQUIRECTANGULAR_MODE=7;Pe.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8;Pe.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;Pe.SCALEMODE_FLOOR=1;Pe.SCALEMODE_NEAREST=2;Pe.SCALEMODE_CEILING=3;let xb=!1;function cM(){xb||(xb=!0,ot.prototype.setAlphaMode=function(a,e=!1,t=0){if(this._alphaMode[t]===a){if(!e){const s=a===0;this.depthCullingState.depthMask!==s&&(this.depthCullingState.depthMask=s)}return}const i=a===0;this._alphaState.setAlphaBlend(!i,t),this._alphaState.setAlphaMode(a,t),e||(this.depthCullingState.depthMask=i),this._alphaMode[t]=a})}cM();let bb=!1;function hM(){if(bb)return;bb=!0;const a=new WeakMap,e=new WeakMap,t=new WeakMap,i=new WeakMap;ot.prototype.getAlphaToCoverage=function(){return a.get(this)??!1},ot.prototype.setAlphaToCoverage=function(s){a.get(this)===s&&(!this._gl||e.get(this)===this._gl)||(a.set(this,s),this._gl&&(s?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(ot.prototype,"currentSampleCount",{get:function(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._gl?(i.get(this)!==this._gl&&(t.set(this,this._gl.getContextAttributes()?.antialias?Math.max(1,this._gl.getParameter(this._gl.SAMPLES)):1),i.set(this,this._gl)),t.get(this)):1},enumerable:!1,configurable:!0})}hM();let yb=!1;function uM(){if(yb)return;yb=!0;function a(i,s,n,o){let c,h=1;o===1?c=new Float32Array(s*n*4):o===2?(c=new Uint16Array(s*n*4),h=15360):o===7?c=new Uint32Array(s*n*4):c=new Uint8Array(s*n*4);for(let f=0;f<s;f++)for(let _=0;_<n;_++){const m=(_*s+f)*3,g=(_*s+f)*4;c[g+0]=i[m+0],c[g+1]=i[m+1],c[g+2]=i[m+2],c[g+3]=h}return c}function e(i){return function(s,n,o,c,h,f,_,m,g=null,x=0){const y=i?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,b=i?10:11,v=new Es(this,b);v.baseWidth=n,v.baseHeight=o,v.baseDepth=c,v.width=n,v.height=o,v.depth=c,v.format=h,v.type=x,v.generateMipMaps=f,v.samplingMode=m,i?v.is3D=!0:v.is2DArray=!0,this._doNotHandleContextLost||(v._bufferView=s),i?this.updateRawTexture3D(v,s,h,_,g,x):this.updateRawTexture2DArray(v,s,h,_,g,x),this._bindTextureDirectly(y,v,!0);const E=this._getSamplingParameters(m,f);return this._gl.texParameteri(y,this._gl.TEXTURE_MAG_FILTER,E.mag),this._gl.texParameteri(y,this._gl.TEXTURE_MIN_FILTER,E.min),f&&this._gl.generateMipmap(y),this._bindTextureDirectly(y,null),this._internalTexturesCache.push(v),v}}function t(i){return function(s,n,o,c,h=null,f=0){const _=i?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,m=this._getWebGLTextureType(f),g=this._getInternalFormat(o),x=this._getRGBABufferInternalSizedFormat(f,o);this._bindTextureDirectly(_,s,!0),this._unpackFlipY(c===void 0?!0:!!c),this._doNotHandleContextLost||(s._bufferView=n,s.format=o,s.invertY=c,s._compression=h),s.width%4
vendor: 4,322 bytes, line 289
289!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),h&&n?this._gl.compressedTexImage3D(_,0,this.getCaps().s3tc[h],s.width,s.height,s.depth,0,n):this._gl.texImage3D(_,0,x,s.width,s.height,s.depth,0,g,m,n),s.generateMipMaps&&this._gl.generateMipmap(_),this._bindTextureDirectly(_,null),s.isReady=!0}}ot.prototype.updateRawTexture=function(i,s,n,o,c=null,h=0,f=!1){if(!i)return;const _=this._getRGBABufferInternalSizedFormat(h,n,f),m=this._getInternalFormat(n),g=this._getWebGLTextureType(h);this._bindTextureDirectly(this._gl.TEXTURE_2D,i,!0),this._unpackFlipY(o===void 0?!0:!!o),this._doNotHandleContextLost||(i._bufferView=s,i.format=n,i.type=h,i.invertY=o,i._compression=c),i.width%4!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),c&&s?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[c],i.width,i.height,0,s):this._gl.texImage2D(this._gl.TEXTURE_2D,0,_,i.width,i.height,0,m,g,s),i.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),i.isReady=!0},ot.prototype.createRawTexture=function(i,s,n,o,c,h,f,_=null,m=0,g=0,x=!1){const y=new Es(this,3);y.baseWidth=s,y.baseHeight=n,y.width=s,y.height=n,y.format=o,y.generateMipMaps=c,y.samplingMode=f,y.invertY=h,y._compression=_,y.type=m,y._useSRGBBuffer=this._getUseSRGBBuffer(x,!c),this._doNotHandleContextLost||(y._bufferView=i),this.updateRawTexture(y,i,o,h,_,m,y._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,y,!0);const b=this._getSamplingParameters(f,c);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,b.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,b.min),c&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(y),y},ot.prototype.createRawCubeTexture=function(i,s,n,o,c,h,f,_=null){const m=this._gl,g=new Es(this,8);g.isCube=!0,g.format=n,g.type=o,this._doNotHandleContextLost||(g._bufferViewArray=i);const x=this._getWebGLTextureType(o);let y=this._getInternalFormat(n);y===m.RGB&&(y=m.RGBA),x===m.FLOAT&&!this._caps.textureFloatLinearFiltering?(c=!1,f=1,pe.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):x===this._gl.HALF_FLOAT_OES&&!this._caps.textureHalfFloatLinearFiltering?(c=!1,f=1,pe.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):x===m.FLOAT&&!this._caps.textureFloatRender?(c=!1,pe.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):x===m.HALF_FLOAT&&!this._caps.colorBufferFloat&&(c=!1,pe.Warn("Render to half float textures is not supported. Mipmap generation forced to false."));const b=s,v=b;if(g.width=b,g.height=v,g.invertY=h,g._compression=_,!this.needPOTTextures||Yu(g.width)&&Yu(g.height)||(c=!1),i)this.updateRawCubeTexture(g,i,n,o,h,_);else{const C=this._getRGBABufferInternalSizedFormat(o),O=0;this._bindTextureDirectly(m.TEXTURE_CUBE_MAP,g,!0);for(let M=0;M<6;M++)_?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+M,O,this.getCaps().s3tc[_],g.width,g.height,0,void 0):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+M,O,C,g.width,g.height,0,y,x,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,g,!0),i&&c&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);const R=this._getSamplingParameters(f,c);return m.texParameteri(m.TEXTURE_CUBE_MAP,m.TEXTURE_MAG_FILTER,R.mag),m.texParameteri(m.TEXTURE_CUBE_MAP,m.TEXTURE_MIN_FILTER,R.min),m.texParameteri(m.TEXTURE_CUBE_MAP,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(m.TEXTURE_CUBE_MAP,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),this._bindTextureDirectly(m.TEXTURE_CUBE_MAP,null),g.generateMipMaps=c,g.samplingMode=f,g.isReady=!0,g},ot.prototype.updateRawCubeTexture=function(i,s,n,o,c,h=null,f=0){i._bufferViewArray=s,i.format=n,i.type=o,i.invertY=c,i._compression=h;const _=this._gl,m=this._getWebGLTextureType(o);let g=this._getInternalFormat(n);const x=this._getRGBABufferInternalSizedFormat(o);let y=!1;g===_.RGB&&(g=_.RGBA,y=!0),this._bindTextureDirectly(_.TEXTURE_CUBE_MAP,i,!0),this._unpackFlipY(c===void 0?!0:!!c),i.width%4
289!==0&&_.pixelStorei(_.UNPACK_ALIGNMENT,1);for(let v=0;v<6;v++){let E=s[v];h?_.compressedTexImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+v,f,this.getCaps().s3tc[h],i.width,i.height,0,E):(y&&(E=a(E,i.width,i.height,o)),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+v,f,x,i.width,i.height,0,g,m,E))}(!this.needPOTTextures||Yu(i.width)&&Yu(i.height))&&i.generateMipMaps&&f===0&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),i.isReady=!0},ot.prototype.createRawCubeTextureFromUrl=function(i,s,n,o,c,h,f,_,m=null,g=null,x=3,y=!1){const b=this._gl,v=this.createRawCubeTexture(null,n,o,c,!h,y,x,null);s?.addPendingData(v),v.url=i,v.isReady=!1,this._internalTexturesCache.push(v);const E=(C,O)=>{s?.removePendingData(v),g&&g(C?C.status+" "+C.statusText:"Failed to parse texture data",O)},R=async C=>{if(!v._hardwareTexture)return;const O=f(C);if(!O)return;const M=O instanceof Promise?await O:O,I=v.width;if(_){const P=this._getWebGLTextureType(c);let L=this._getInternalFormat(o);const V=this._getRGBABufferInternalSizedFormat(c);let X=!1;L===b.RGB&&(L=b.RGBA,X=!0),this._bindTextureDirectly(b.TEXTURE_CUBE_MAP,v,!0),this._unpackFlipY(!1);const re=_(M);for(let ae=0;ae<re.length;ae++){const de=I>>ae;for(let U=0;U<6;U++){let te=re[ae][U];X&&(te=a(te,de,de,c)),b.texImage2D(U,ae,V,de,de,0,L,P,te)}}this._bindTextureDirectly(b.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(v,M,o,c,y);v.isReady=!0,s?.removePendingData(v),v.onLoadedObservable.notifyObservers(v),v.onLoadedObservable.clear(),m&&m()};return this._loadFile(i,C=>{R(C).catch(O=>{E(void 0,O)})},void 0,s?.offlineProvider,!0,E),v},ot.prototype.createRawTexture2DArray=e(!1),ot.prototype.createRawTexture3D=e(!0),ot.prototype.updateRawTexture2DArray=t(!1),ot.prototype.updateRawTexture3D=t(!0)}uM();let Tb=!1;function fM(){Tb||(Tb=!0,ot.prototype._readTexturePixelsSync=function(a,e,t,i=-1,s=0,n=null,o=!0,c=!1,h=0,f=0){const _=this._gl;if(!_)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){const g=_.createFramebuffer();if(!g)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=g}_.bindFramebuffer(_.FRAMEBUFFER,this._dummyFramebuffer),i>-1&&(a.is2DArray||a.is3D)?_.framebufferTextureLayer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,a._hardwareTexture?.underlyingResource,s,i):i>-1?_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+i,a._hardwareTexture?.underlyingResource,s):_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,a._hardwareTexture?.underlyingResource,s);let m=a.type!==void 0?this._getWebGLTextureType(a.type):_.UNSIGNED_BYTE;if(c)n||(n=fS(a.type,4*e*t));else switch(m){case _.UNSIGNED_BYTE:n||(n=new Uint8Array(4*e*t)),m=_.UNSIGNED_BYTE;break;default:n||(n=new Float32Array(4*e*t)),m=_.FLOAT;break}return o&&this.flushFramebuffer(),_.readPixels(h,f,e,t,_.RGBA,m,n),_.bindFramebuffer(_.FRAMEBUFFER,this._currentFramebuffer),n},ot.prototype._readTexturePixels=function(a,e,t,i=-1,s=0,n=null,o=!0,c=!1,h=0,f=0){return Promise.resolve(this._readTexturePixelsSync(a,e,t,i,s,n,o,c,h,f))})}fM();let vb=!1;function dv(){vb||(vb=!0,ot.prototype.updateDynamicIndexBuffer=function(a,e,t=0){this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(a);let i;a.is32Bits?i=e instanceof Uint32Array?e:new Uint32Array(e):i=e instanceof Uint16Array?e:new Uint16Array(e),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},ot.prototype.updateDynamicVertexBuffer=function(a,e,t,i){this.bindArrayBuffer(a),t===void 0&&(t=0);const s=e.byteLength||e.length;i===void 0||i>=s&&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,i/4)):(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,i):e=new Uint8Array(e,0,i),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e)),this._resetVertexBufferBinding()})}dv();let Eb=!1;function dM(){Eb||(Eb=!0,ot.prototype._createDepthStencilCubeTexture=function(a,e){const t=new Es(this,12);if(t.isCube=!0,this.webGLVersion===1)return pe.Error("Depth cube texture is not supported by WebGL 1."),t;const i={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e},s=this._gl;this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,t,!0),this._setupDepthStencilTexture(t,a,i.bilinearFiltering,i.comparisonFunction);for(let n=0;n<6;n++)i.generateStencil?s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,s.DEPTH24_STENCIL8,a,a,0,s.DEPTH_STENCIL,s.UNSIGNED_INT_24_8,null):s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,s.DEPTH_COMPONENT24,a,a,
vendor: 18,608 bytes, line 289
2890,s.DEPTH_COMPONENT,s.UNSIGNED_INT,null);return this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(t),t},ot.prototype._setCubeMapTextureParams=function(a,e,t){const i=this._gl;i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,e?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),a.samplingMode=e?3:2,e&&this.getCaps().textureMaxLevel&&t!==void 0&&t>0&&(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_LEVEL,t),a._maxLodLevel=t),this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)},ot.prototype.createCubeTexture=function(a,e,t,i,s=null,n=null,o,c=null,h=!1,f=0,_=0,m=null,g,x=!1,y=null){const b=this._gl;return this.createCubeTextureBase(a,e,t,!!i,s,n,o,c,h,f,_,m,v=>this._bindTextureDirectly(b.TEXTURE_CUBE_MAP,v,!0),(v,E)=>{const R=this.needPOTTextures?em(E[0].width,this._caps.maxCubemapTextureSize):E[0].width,C=R,O=[b.TEXTURE_CUBE_MAP_POSITIVE_X,b.TEXTURE_CUBE_MAP_POSITIVE_Y,b.TEXTURE_CUBE_MAP_POSITIVE_Z,b.TEXTURE_CUBE_MAP_NEGATIVE_X,b.TEXTURE_CUBE_MAP_NEGATIVE_Y,b.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(b.TEXTURE_CUBE_MAP,v,!0),this._unpackFlipY(!1);const M=o?this._getInternalFormat(o,v._useSRGBBuffer):v._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:b.RGBA;let I=o?this._getInternalFormat(o):b.RGBA;v._useSRGBBuffer&&this.webGLVersion===1&&(I=M);for(let P=0;P<O.length;P++)if(E[P].width!==R||E[P].height!==C){if(this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext){pe.Warn("Cannot create canvas to resize texture.");return}this._workingCanvas.width=R,this._workingCanvas.height=C,this._workingContext.drawImage(E[P],0,0,E[P].width,E[P].height,0,0,R,C),b.texImage2D(O[P],0,M,I,b.UNSIGNED_BYTE,this._workingCanvas)}else b.texImage2D(O[P],0,M,I,b.UNSIGNED_BYTE,E[P]);i||b.generateMipmap(b.TEXTURE_CUBE_MAP),this._setCubeMapTextureParams(v,!i),v.width=R,v.height=C,v.isReady=!0,o&&(v.format=o),v.onLoadedObservable.notifyObservers(v),v.onLoadedObservable.clear(),s&&s()},!!x,y)},ot.prototype.generateMipMapsForCubemap=function(a,e=!0){if(a.generateMipMaps){const t=this._gl;this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,a,!0),t.generateMipmap(t.TEXTURE_CUBE_MAP),e&&this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,null)}})}dM();class _M{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],i=this._layerIndices?.[e]??0,s=this._faceIndices?.[e]??0;return t.isCube?i*6+s:t.is3D?0:i}get samples(){return this._samples}setSamples(e,t=!0,i=!1){if(this.samples===e&&!i)return e;const s=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,s}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,i,s,n){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=i,this._engine=s,this._depthStencilTexture=null,this.label=n}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,i=!0){this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&i&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,i){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),t!==void 0&&t>=0&&(this._layerIndices[e]=t),i!==void 0&&i>=0&&(this._faceIndices[e]=i)}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14,o){return this._depthStencilTexture?.dispose(),this._depthStencilTextureWithStencil=i,this._depthStencilTextureLabel=o,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:i,isCube:this._isCube,samples:s,depthTextureFormat:n,label:o},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 i=!1,s=t.length,n=-1;const o=t[t.length-1]._source;(o===14||o===12)&&(i=!0,n=t[t.length-1].format,s--);const c=[],h=[],f=[],_=[],m=[],g=[],x=[],y={};for(let E=0;E<s;++E){const R=t[E];c.push(R.samplingMode),h.push(R.type),f.push(R.format),y[R.uniqueId]!==void 0?(_.push(-1),x.push(0)):(y[R.uniqueId]=E,R.is2DArray?(_.push(35866),x.push(R.depth)):R.isCube?(_.push(34067),x.push(0)):R.is3D?(_.push(32879),x.push(R.depth)):(_.push(3553),x.push(0))),this._faceIndices&&m.push(this._faceIndices[E]??0),this._layerIndices&&g.push(this._layerIndices[E]??0)}const b={samplingModes:c,generateMipMaps:t[0].generateMipMaps,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:this._generateStencilBuffer,generateDepthTexture:i,depthTextureFormat:n,types:h,formats:f,textureCount:s,targetTypes:_,faceIndex:m,layerIndex:g,layerCounts:x,label:this.label},v={width:this.width,height:this.height,depth:this.depth};e=this._engine.createMultipleRenderTarget(v,b);for(let E=0;E<s;++E){if(_[E]!==-1)continue;const R=y[t[E].uniqueId];e.setTexture(e.textures[R],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 i={width:this.width,height:this.height,layers:this.is2DArray||this.is3D?this.texture?.depth:void 0};e=this._engine.createRenderTargetTexture(i,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,i=this._depthStencilTexture.format,s=t===2||t===3||t===11;e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction,s,this._depthStencilTextureWithStencil,this._depthStencilTexture.samples,i,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 mM extends _M{setDepthStencilTexture(e,t=!0){if(super.setDepthStencilTexture(e,t),!e)return;const i=this._engine,s=this._context,n=e._hardwareTexture;if(n&&e._autoMSAAManagement&&this._MSAAFramebuffer){const o=i._currentFramebuffer;i._bindUnboundFramebuffer(this._MSAAFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,Lc(e.format)?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n.getMSAARenderBuffer()),i._bindUnboundFramebuffer(o)}}constructor(e,t,i,s,n){super(e,t,i,s),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._disposeOnlyFramebuffers=!1,this._currentLOD=0,this._context=n}_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,i=!1,s=1,n=14,o){if(this._depthStencilBuffer){const c=this._engine,h=c._currentFramebuffer,f=this._context;c._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),c._bindUnboundFramebuffer(h),f.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,i,s,n,o)}shareDepth(e){super.shareDepth(e);const t=this._context,i=this._depthStencilBuffer,s=e._MSAAFramebuffer||e._framebuffer,n=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==i&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=i;const o=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;n._bindUnboundFramebuffer(s),t.framebufferRenderbuffer(t.FRAMEBUFFER,o,t.RENDERBUFFER,i),n._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,i,s=0){const n=e._hardwareTexture;if(!n)return;const o=this._framebuffer,c=this._engine,h=c._currentFramebuffer;c._bindUnboundFramebuffer(o);let f;if(c.webGLVersion>1){const _=this._context;f=_["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(i=i??this.layerIndices?.[t]??0,_.framebufferTextureLayer(_.FRAMEBUFFER,f,n.underlyingResource,s,i)):e.isCube?(i=i??this.faceIndices?.[t]??0,_.framebufferTexture2D(_.FRAMEBUFFER,f,_.TEXTURE_CUBE_MAP_POSITIVE_X+i,n.underlyingResource,s)):_.framebufferTexture2D(_.FRAMEBUFFER,f,_.TEXTURE_2D,n.underlyingResource,s)}else{const _=this._context;f=_["COLOR_ATTACHMENT"+t+"_WEBGL"];const m=i!==void 0?_.TEXTURE_CUBE_MAP_POSITIVE_X+i:_.TEXTURE_2D;_.framebufferTexture2D(_.FRAMEBUFFER,f,m,n.underlyingResource,s)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){const _=this._context;c._bindUnboundFramebuffer(this._MSAAFramebuffer),_.framebufferRenderbuffer(_.FRAMEBUFFER,f,_.RENDERBUFFER,n.getMSAARenderBuffer())}c._bindUnboundFramebuffer(h)}setTexture(e,t=0,i=!0){super.setTexture(e,t,i),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;const i=this._attachments?.length??this.textures.length;for(let s=0;s<i;s++){const n=this.textures[s];n&&(n.is2DArray||n.is3D?this._bindTextureRenderTarget(n,s,this.layerIndices[s]):n.isCube?this._bindTextureRenderTarget(n,s,this.faceIndices[s]):this._bindTextureRenderTarget(n,s))}}setLayerAndFaceIndex(e=0,t,i){if(super.setLayerAndFaceIndex(e,t,i),!this.textures||!this.layerIndices||!this.faceIndices)return;const s=this.textures[e];s.is2DArray||s.is3D?this._bindTextureRenderTarget(this.textures[e],e,this.layerIndices[e]):s.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 Ab=!1;function gM(){Ab||(Ab=!0,ot.prototype._createHardwareRenderTargetWrapper=function(a,e,t){const i=new mM(a,e,t,this,this._gl);return this._renderTargetWrapperCache.push(i),i},ot.prototype.createRenderTargetTexture=function(a,e){const t=this._createHardwareRenderTargetWrapper(!1,!1,a);let i=!0,s=!1,n=!1,o,c=1,h;e!==void 0&&typeof e=="object"&&(i=e.generateDepthBuffer??!0,s=!!e.generateStencilBuffer,n=!!e.noColorAttachment,o=e.colorAttachment,c=e.samples??1,h=e.label);const f=o||(n?null:this._createInternalTexture(a,e,!0,5)),_=a.width||a,m=a.height||a,g=this._currentFramebuffer,x=this._gl,y=x.createFramebuffer();if(this._bindUnboundFramebuffer(y),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(s,i,_,m),f&&!f.is2DArray&&!f.is3D&&x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,f._hardwareTexture.underlyingResource,0),this._bindUnboundFramebuffer(g),t.label=h??"RenderTargetWrapper",t._framebuffer=y,t._generateDepthBuffer=i,t._generateStencilBuffer=s,t.setTextures(f),!o)this.updateRenderTargetTextureSampleCount(t,c);else if(t._samples=o.samples,o.samples>1){const b=o._hardwareTexture.getMSAARenderBuffer(0);t._MSAAFramebuffer=x.createFramebuffer(),this._bindUnboundFramebuffer(t._MSAAFramebuffer),x.framebufferRenderbuffer(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.RENDERBUFFER,b),this._bindUnboundFramebuffer(null)}return t},ot.prototype._createDepthStencilTexture=function(a,e,t){const i=this._gl,s=a.layers||0,n=a.depth||0;let o=i.TEXTURE_2D;s!==0?o=i.TEXTURE_2D_ARRAY:n!==0&&(o=i.TEXTURE_3D);const c=new Es(this,12);if(c.label=e.label,!this._caps.depthTextureExtension)return pe.Error("Depth texture is not supported by your browser or hardware."),c;const h={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e};if(this._bindTextureDirectly(o,c,!0),this._setupDepthStencilTexture(c,a,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 pe.Error(`Depth texture ${h.depthTextureFormat} format is not supported.`),c;c.format=h.depthTextureFormat}else c.format=h.generateStencil?13:16;const f=Lc(c.format),_=this._getWebGLTextureTypeFromDepthTextureFormat(c.format),m=f?i.DEPTH_STENCIL:i.DEPTH_COMPONENT,g=this._getInternalFormatFromDepthTextureFormat(c.format,!0,f);return c.is2DArray?i.texImage3D(o,0,g,c.width,c.height,s,0,m,_,null):c.is3D?i.texImage3D(o,0,g,c.width,c.height,n,0,m,_,null):i.texImage2D(o,0,g,c.width,c.height,0,m,_,null),this._bindTextureDirectly(o,null),this._internalTexturesCache.push(c),t._depthStencilBuffer&&(i.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,c.format),this._bindUnboundFramebuffer(null),c},ot.prototype.updateRenderTargetTextureSampleCount=function(a,e){if(this.webGLVersion<2||!a)return 1;if(a.samples===e)return e;const t=this._gl;e=Math.min(e,this.getCaps().maxMSAASamples),a._depthStencilBuffer&&(t.deleteRenderbuffer(a._depthStencilBuffer),a._depthStencilBuffer=null),a._MSAAFramebuffer&&(t.deleteFramebuffer(a._MSAAFramebuffer),a._MSAAFramebuffer=null);const i=a.texture?._hardwareTexture;if(i?.releaseMSAARenderBuffers(),a.texture&&e>1&&typeof t.renderbufferStorageMultisample=="function"){const n=t.createFramebuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");a._MSAAFramebuffer=n,this._bindUnboundFramebuffer(a._MSAAFramebuffer);const o=this._createRenderBuffer(a.texture.width,a.texture.height,e,-1,this._getRGBABufferInternalSizedFormat(a.texture.type,a.texture.format,a.texture._useSRGBBuffer),t.COLOR_ATTACHMENT0,!1);if(!o)throw new Error("Unable to create multi sampled framebuffer");i?.addMSAARenderBuffer(o)}this._bindUnboundFramebuffer(a._MSAAFramebuffer??a._framebuffer),a.texture&&(a.texture.samples=e),a._samples=e;const s=a._depthStencilTexture?a._depthStencilTexture.format:void 0;return a._depthStencilBuffer=this._setupFramebufferDepthAttachments(a._generateStencilBuffer,a._generateDepthBuffer,a.width,a.height,e,s),this._bindUnboundFramebuffer(null),e},ot.prototype._setupDepthStencilTexture=function(a,e,t,i,s=1){const n=e.width??e,o=e.height??e,c=e.layers||0,h=e.depth||0;a.baseWidth=n,a.baseHeight=o,a.width=n,a.height=o,a.is2DArray=c>0,a.depth=c||h,a.isReady=!0,a.samples=s,a.generateMipMaps=!1,a.samplingMode=t?2:1,a.type=0,a._c
289omparisonFunction=i;const f=this._gl,_=this._getTextureTarget(a),m=this._getSamplingParameters(a.samplingMode,!1);f.texParameteri(_,f.TEXTURE_MAG_FILTER,m.mag),f.texParameteri(_,f.TEXTURE_MIN_FILTER,m.min),f.texParameteri(_,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(_,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),this.webGLVersion>1&&(i===0?(f.texParameteri(_,f.TEXTURE_COMPARE_FUNC,515),f.texParameteri(_,f.TEXTURE_COMPARE_MODE,f.NONE)):(f.texParameteri(_,f.TEXTURE_COMPARE_FUNC,i),f.texParameteri(_,f.TEXTURE_COMPARE_MODE,f.COMPARE_REF_TO_TEXTURE)))})}gM();let Rb=!1;function pM(){Rb||(Rb=!0,ot.prototype.setDepthStencilTexture=function(a,e,t,i){a!==void 0&&(e&&(this._boundUniforms[a]=e),!t||!t.depthStencilTexture?this._setTexture(a,null,void 0,void 0,i):this._setTexture(a,t,!1,!0,i))})}pM();let Sb=!1;function xM(){Sb||(Sb=!0,ot.prototype.createRenderTargetCubeTexture=function(a,e){const t=this._createHardwareRenderTargetWrapper(!1,!0,a),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...e};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(i.type===1&&!this._caps.textureFloatLinearFiltering||i.type===2&&!this._caps.textureHalfFloatLinearFiltering)&&(i.samplingMode=1);const s=this._gl,n=new Es(this,5);this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,n,!0);const o=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);i.type===1&&!this._caps.textureFloat&&(i.type=0,pe.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,o.mag),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,o.min),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);for(let h=0;h<6;h++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),a,a,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);const c=s.createFramebuffer();return this._bindUnboundFramebuffer(c),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,a,a),i.generateMipMaps&&s.generateMipmap(s.TEXTURE_CUBE_MAP),this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),t._framebuffer=c,t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=i.generateStencilBuffer,n.width=a,n.height=a,n.isReady=!0,n.isCube=!0,n.samples=1,n.generateMipMaps=i.generateMipMaps,n.samplingMode=i.samplingMode,n.type=i.type,n.format=i.format,this._internalTexturesCache.push(n),t.setTextures(n),t})}xM();const bM="modulepreload",yM=function(a){return"/"+a},Mb={},Wi=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let h=function(f){return Promise.all(f.map(_=>Promise.resolve(_).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");s=h(t.map(f=>{if(f=yM(f),f in Mb)return;Mb[f]=!0;const _=f.endsWith(".css"),m=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const g=document.createElement("link");if(g.rel=_?"stylesheet":bM,_||(g.as="script"),g.crossOrigin="",g.href=f,c&&g.setAttribute("nonce",c),document.head.appendChild(g),_)return new Promise((x,y)=>{g.addEventListener("load",x),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${f}`)))})}))}function n(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return s.then(o=>{for(const c of o||[])c.status==="rejected"&&n(c.reason);return e().catch(n)})},TM=1/2.2,vM=2.2,Ai=(1+Math.sqrt(5))/2;let Vt=.001;function vn(a,e){const t=[];for(let i=0;i<a;++i)t.push(e());return t}function _a(a,e){return vn(a,e)}function EM(a,e,t){const i=a[e];if(typeof i!="function")return null;const s=function(){const n=a.length,o=s.previous.apply(a,arguments);return t(e,n),o};return i.next=s,s.previous=i,a[e]=s,()=>{const n=s.previous;if(!n)return;const o=s.next;o?(n.next=o,o.previous=n):(n.next=void 0,a[e]=n),s.next=void 0,s.previous=void 0}}const AM=["push","splice","pop","shift","unshift"];function RM(a,e){const t=AM.map(i=>EM(a,i,e));return()=>{for(const i of t)i?.()}}function kt(a,e,t=1401298e-51){return Math.abs(a-e)<=t}function xi(a,e){return a===e?a:Math.random()*(e-a)+a}function im(a,e,t){return a+(e-a)*t}function oi(a,e=0,t=1){return Math.min(t,Math.max(e,a))}function SM(a){return a-=Math.PI*2*Math.floor((a+Math.PI)/(Math.PI*2)),a}function Pr(a){const e=a.toString(16);return a<=15?("0"+e).toUpperCase():e.toUpperCase()}function UP(a){if(Math.log2)return Math.floor(Math.log2(a));if(a<0)return NaN;if(a===0)return-1/0;let e=0;if(a<1){for(;a<1;)e++,a=a*2;e=-e}else if(a>1)for(;a>1;)e++,a=Math.floor(a/2);return e}function sm(a,e){const t=a%e;return t===0?e:sm(e,t)}class Am{}Am._UpdateFlagSeed=0;function _v(a){a.updateFlag=Am._UpdateFlagSeed++}function mv(a,e,t,i=0){const s=a.asArray(),n=e.asArray(),o=s[0],c=s[1],h=s[2],f=s[3],_=s[4],m=s[5],g=s[6],x=s[7],y=s[8],b=s[9],v=s[10],E=s[11],R=s[12],C=s[13],O=s[14],M=s[15],I=n[0],P=n[1],L=n[2],V=n[3],X=n[4],re=n[5],ae=n[6],de=n[7],U=n[8],te=n[9],Y=n[10],Z=n[11],q=n[12],j=n[13],Q=n[14],w=n[15];
vendor: 1,049 bytes, line 289
289t[i]=o*I+c*X+h*U+f*q,t[i+1]=o*P+c*re+h*te+f*j,t[i+2]=o*L+c*ae+h*Y+f*Q,t[i+3]=o*V+c*de+h*Z+f*w,t[i+4]=_*I+m*X+g*U+x*q,t[i+5]=_*P+m*re+g*te+x*j,t[i+6]=_*L+m*ae+g*Y+x*Q,t[i+7]=_*V+m*de+g*Z+x*w,t[i+8]=y*I+b*X+v*U+E*q,t[i+9]=y*P+b*re+v*te+E*j,t[i+10]=y*L+b*ae+v*Y+E*Q,t[i+11]=y*V+b*de+v*Z+E*w,t[i+12]=R*I+C*X+O*U+M*q,t[i+13]=R*P+C*re+O*te+M*j,t[i+14]=R*L+C*ae+O*Y+M*Q,t[i+15]=R*V+C*de+O*Z+M*w}function kc(a,e,t,i=0){mv(a,e,t.asArray(),i),_v(t)}function MM(a,e,t=0){const i=a.asArray();e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15]}function lf(a,e){const t=gv(a,e.asArray());return t&&_v(e),t}function gv(a,e){const t=a.asArray(),i=t[0],s=t[1],n=t[2],o=t[3],c=t[4],h=t[5],f=t[6],_=t[7],m=t[8],g=t[9],x=t[10],y=t[11],b=t[12],v=t[13],E=t[14],R=t[15],C=x*R-E*y,O=g*R-v*y,M=g*E-v*x,I=m*R-b*y,P=m*E-x*b,L=m*v-b*g,V=+(h*C-f*O+_*M),X=-(c*C-f*I+_*P),re=+(c*O-h*I+_*L),ae=-(c*M-h*P+f*L),de=i*V+s*X+n*re+o*ae;
vendor: 19,117 bytes, line 289
289if(de===0)return!1;const U=1/de,te=f*R-E*_,Y=h*R-v*_,Z=h*E-v*f,q=c*R-b*_,j=c*E-b*f,Q=c*v-b*h,w=f*y-x*_,B=h*y-g*_,z=h*x-g*f,K=c*y-m*_,ue=c*x-m*f,he=c*g-m*h,ve=-(s*C-n*O+o*M),Le=+(i*C-n*I+o*P),ke=-(i*O-s*I+o*L),J=+(i*M-s*P+n*L),_e=+(s*te-n*Y+o*Z),xe=-(i*te-n*q+o*j),Ne=+(i*Y-s*q+o*Q),Qe=-(i*Z-s*j+n*Q),He=-(s*w-n*B+o*z),dt=+(i*w-n*K+o*ue),li=-(i*B-s*K+o*he),zt=+(i*z-s*ue+n*he);return e[0]=V*U,e[1]=ve*U,e[2]=_e*U,e[3]=He*U,e[4]=X*U,e[5]=Le*U,e[6]=xe*U,e[7]=dt*U,e[8]=re*U,e[9]=ke*U,e[10]=Ne*U,e[11]=li*U,e[12]=ae*U,e[13]=J*U,e[14]=Qe*U,e[15]=zt*U,!0}const pv={};function Lr(a,e){pv[a]=e}function cf(a){return pv[a]}const vs=a=>parseInt(a.toString().replace(/\W/g,""));class Fe{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=vs(this.x),t=vs(this.y);let i=e;return i=i*397^t,i}toArray(e,t=0){return e[t]=this.x,e[t+1]=this.y,this}fromArray(e,t=0){return Fe.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 Fe(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 Fe(this.x+e.x,this.y+e.y)}subtract(e){return new Fe(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 Fe(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 Fe(this.x*e,this.y*t)}divide(e){return new Fe(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 Fe(this.x-e,this.y-t)}subtractFromFloatsToRef(e,t,i){return i.x=this.x-e,i.y=this.y-t,i}negate(){return new Fe(-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 Fe(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=Vt){return e&&kt(this.x,e.x,t)&&kt(this.y,e.y,t)}equalsToFloats(e,t){return this.x===e&&this.y===t}floor(){return new Fe(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 Fe(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 Fe)}rotateToRef(e,t){const i=Math.cos(e),s=Math.sin(e);return t.x=i*this.x-s*this.y,t.y=s*this.x+i*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 Fe;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 Fe(this.x,this.y)}dot(e){return this.x*e.x+this.y*e.y}static Zero(){return new Fe(0,0)}static One(){return new Fe(1,1)}static Random(e=0,t=1){return new Fe(xi(e,t),xi(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(xi(e,t),xi(e,t))}static get ZeroReadOnly(){return Fe._ZeroReadOnly}static FromArray(e,t=0){return new Fe(e[t],e[t+1])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i}static FromFloatsToRef(e,t,i){return i.copyFromFloats(e,t),i}static CatmullRom(e,t,i,s,n){const o=n*n,c=n*o,h=.5*(2*t.x+(-e.x+i.x)*n+(2*e.x-5*t.x+4*i.x-s.x)*o+(-e.x+3*t.x-3*i.x+s.x)*c),f=.5*(2*t.y+(-e.y+i.y)*n+(2*e.y-5*t.y+4*i.y-s.y)*o+(-e.y+3*t.y-3*i.y+s.y)*c);return new Fe(h,f)}static ClampToRef(e,t,i,s){return s.x=oi(e.x,t.x,i.x),s.y=oi(e.y,t.y,i.y),s}static Clamp(e,t,i){const s=oi(e.x,t.x,i.x),n=oi(e.y,t.y,i.y);return new Fe(s,n)}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,m=c-o,g=e.x*h+i.x*f+t.x*_+s.x*m,x=e.y*h+i.y*f+t.y*_+s.y*m;return new Fe(g,x)}static Hermite1stDerivative(e,t,i,s,n){return this.Hermite1stDerivativeToRef(e,t,i,s,n,new Fe)}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;return o.x=(c-n)*6*e.x+(3*c-4*n+1)*t.x+(-c+n)*6*i.x+(3*c-2*n)*s.x,o.y=(c-n)*6*e.y+(3*c-4*n+1)*t.y+(-c+n)*6*i.y+(3*c-2*n)*s.y,o}static Lerp(e,t,i){return Fe.LerpToRef(e,t,i,new Fe)}static LerpToRef(e,t,i,s){return s.x=e.x+(t.x-e.x)*i,s.y=e.y+(t.y-e.y)*i,s}static Dot(e,t){return e.x*t.x+e.y*t.y}static Normalize(e){return Fe.NormalizeToRef(e,new Fe)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=e.x<t.x?e.x:t.x,s=e.y<t.y?e.y:t.y;return new Fe(i,s)}static Maximize(e,t){const i=e.x>t.x?e.x:t.x,s=e.y>t.y?e.y:t.y;return new Fe(i,s)}static Transform(e,t){return Fe.TransformToRef(e,t,new Fe)}static TransformToRef(e,t,i){const s=t.m,n=e.x*s[0]+e.y*s[4]+s[12],o=e.x*s[1]+e.y*s[5]+s[13];return i.x=n,i.y=o,i}static PointInTriangle(e,t,i,s){const n=.5*(-i.y*s.x+t.y*(-i.x+s.x)+t.x*(i.y-s.y)+i.x*s.y),o=n<0?-1:1,c=(t.y*s.x-t.x*s.y+(s.y-t.y)*e.x+(t.x-s.x)*e.y)*o,h=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*o;return c>0&&h>0&&c+h<2*n*o}static Distance(e,t){return Math.sqrt(Fe.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y;return i*i+s*s}static Center(e,t){return Fe.CenterToRef(e,t,new Fe)}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2)}static DistanceOfPointFromSegment(e,t,i){const s=Fe.DistanceSquared(t,i);if(s===0)return Fe.Distance(e,t);const n=i.subtract(t),o=Math.max(0,Math.min(1,Fe.Dot(e.subtract(t),n)/s)),c=t.add(n.multiplyByFloats(o,o));return Fe.Distance(e,c)}}Fe._V8PerformanceHack=new Fe(.5,.5);Fe._ZeroReadOnly=Fe.Zero();class D{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,i=0){this._isDirty=!0,this._x=e,this._y=t,this._z=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){const e=vs(this._x),t=vs(this._y),i=vs(this._z);let s=e;return s=s*397^t,s=s*397^i,s}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 D.FromArrayToRef(e,t,this),this}toQuaternion(){return Be.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,i){return this._x+=e,this._y+=t,this._z+=i,this._isDirty=!0,this}add(e){return new D(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 D(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,i){return new D(this._x-e,this._y-t,this._z-i)}subtractFromFloatsToRef(e,t,i,s){return s._x=this._x-e,s._y=this._y-t,s._z=this._z-i,s._isDirty=!0,s}negate(){return new D(-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 D(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 i=Math.acos(this._y/t);const s=Math.atan2(this._z,this._x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;const n=t*Math.sin(i)*Math.cos(s),o=t*Math.cos(i),c=t*Math.sin(i)*Math.sin(s);return e.set(n,o,c),e}applyRotationQuaternionToRef(e,t){const i=this._x,s=this._y,n=this._z,o=e._x,c=e._y,h=e._z,f=e._w,_=2*(c*n-h*s),m=2*(h*i-o*n),g=2*(o*s-c*i);return t._x=i+f*_+c*g-h*m,t._y=s+f*m+h*_-o*g,t._z=n+f*g+o*m-c*_,t._isDirty=!0,t}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new D)}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 D)}projectOnPlaneToRef(e,t,i){const s=e.normal,n=e.d,o=Oe.Vector3[0];this.subtractToRef(t,o),o.normalize();const c=D.Dot(o,s);if(Math.abs(c)<1e-10)i.setAll(1/0);else{const h=-(D.Dot(t,s)+n)/c,f=o.scaleInPlace(h);t.addToRef(f,i)}return i}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,t=Vt){return e&&kt(this._x,e._x,t)&&kt(this._y,e._y,t)&&kt(this._z,e._z,t)}equalsToFloats(e,t,i){return this._x===e&&this._y===t&&this._z===i}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,i){return new D(this._x*e,this._y*t,this._z*i)}divide(e){return new D(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,i){return e<this._x&&(this.x=e),t<this._y&&(this.y=t),i<this._z&&(this.z=i),this}maximizeInPlaceFromFloats(e,t,i){return e>this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this}isNonUniformWithinEpsilon(e){const t=Math.abs(this._x),i=Math.abs(this._y);if(!kt(t,i,e))return!0;const s=Math.abs(this._z);return!kt(t,s,e)||!kt(i,s,e)}get isNonUniform(){const e=Math.abs(this._x),t=Math.abs(this._y);if(e!==t)return!0;const i=Math.abs(this._z);return e!==i}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 D(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 D(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=Oe.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(Oe.Matrix[0]),D.TransformCoordinatesToRef(this,Oe.Matrix[0],t),t}rotateByQuaternionAroundPointToRef(e,t,i){return this.subtractToRef(t,Oe.Vector3[0]),Oe.Vector3[0].rotateByQuaternionToRef(e,Oe.Vector3[0]),t.addToRef(Oe.Vector3[0],i),i}cross(e){return D.CrossToRef(this,e,new D)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new D)}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 D(this._x,this._y,this._z)}copyFrom(e){return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,t,i){return this._x=e,this._y=t,this._z=i,this._isDirty=!0,this}set(e,t,i){return this.copyFromFloats(e,t,i)}setAll(e){return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,t,i,s){const n=D.Dot(e,i),o=D.Dot(t,i);return(n-s)/(n-o)}static GetAngleBetweenVectors(e,t,i){const s=e.normalizeToRef(Oe.Vector3[1]),n=t.normalizeToRef(Oe.Vector3[2]);let o=D.Dot(s,n);o=oi(o,-1,1);const c=Math.acos(o),h=Oe.Vector3[3];return D.CrossToRef(s,n,h),D.Dot(h,i)>0?isNaN(c)?0:c:isNaN(c)?-Math.PI:-Math.acos(o)}static GetAngleBetweenVectorsOnPlane(e,t,i){Oe.Vector3[0].copyFrom(e);const s=Oe.Vector3[0];Oe.Vector3[1].copyFrom(t);const n=Oe.Vector3[1];Oe.Vector3[2].copyFrom(i);const o=Oe.Vector3[2],c=Oe.Vector3[3],h=Oe.Vector3[4];s.normalize(),n.normalize(),o.normalize(),D.CrossToRef(o,s,c),D.CrossToRef(c,o,h);const f=Math.atan2(D.Dot(n,c),D.Dot(n,h));return SM(f)}static PitchYawRollToMoveBetweenPointsToRef(e,t,i){const s=ge.Vector3[0];return t.subtractToRef(e,s),i._y=Math.atan2(s.x,s.z)||0,i._x=Math.atan2(Math.sqrt(s.x**2+s.z**2),s.y)||0,i._z=0,i._isDirty=!0,i}static PitchYawRollToMoveBetweenPoints(e,t){const i=D.Zero();return D.PitchYawRollToMoveBetweenPointsToRef(e,t,i)}static SlerpToRef(e,t,i,s){i=oi(i,0,1);const n=Oe.Vector3[0],o=Oe.Vector3[1];n.copyFrom(e);const c=n.length();n.normalizeFromLength(c),o.copyFrom(t);const h=o.length();o.normalizeFromLength(h);const f=D.Dot(n,o);let _,m;if(f<1-Vt){const g=Math.acos(f),x=1/Math.sin(g);_=Math.sin((1-i)*g)*x,m=Math.sin(i*g)*x}else _=1-i,m=i;return n.scaleInPlace(_),o.scaleInPlace(m),s.copyFrom(n).addInPlace(o),s.scaleInPlace(im(c,h,i)),s}static SmoothToRef(e,t,i,s,n){return D.SlerpToRef(e,t,s===0?1:i/s,n),n}static FromArray(e,t=0){return new D(e[t],e[t+1],e[t+2])}static FromFloatArray(e,t){return D.FromArray(e,t)}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._isDirty=!0,i}static FromFloatArrayToRef(e,t,i){return D.FromArrayToRef(e,t,i)}static FromFloatsToRef(e,t,i,s){return s.copyFromFloats(e,t,i),s}static Zero(){return new D(0,0,0)}static One(){return new D(1,1,1)}static Up(){return new D(0,1,0)}static get UpReadOnly(){return D._UpReadOnly}static get DownReadOnly(){return D._DownReadOnly}static get RightReadOnly(){return D._RightReadOnly}static get LeftReadOnly(){return D._LeftReadOnly}static get LeftHandedForwardReadOnly(){return D._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return D._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return D._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return D._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return D._ZeroReadOnly}static get OneReadOnly(){return D._OneReadOnly}static Down(){return new D(0,-1,0)}static Forward(e=!1){return new D(0,0,e?-1:1)}static Backward(e=!1){return new D(0,0,e?1:-1)}static Right(){return new D(1,0,0)}static Left(){return new D(-1,0,0)}static Random(e=0,t=1){return new D(xi(e,t),xi(e,t),xi(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(xi(e,t),xi(e,t),xi(e,t))}static TransformCoordinates(e,t){const i=D.Zero();return D.TransformCoordinatesToRef(e,t,i),i}static TransformCoordinatesToRef(e,t,i){return D.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,n){const o=s.m,c=e*o[0]+t*o[4]+i*o[8]+o[12],h=e*o[1]+t*o[5]+i*o[9]+o[13],f=e*o[2]+t*o[6]+i*o[10]+o[14],_=1/(e*o[3]+t*o[7]+i*o[11]+o[15]);return n._x=c*_,n._y=h*_,n._z=f*_,n._isDirty=!0,n}static TransformNormal(e,t){const i=D.Zero();return D.TransformNormalToRef(e,t,i),i}static TransformNormalToRef(e,t,i){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformNormalFromFloatsToRef(e,t,i,s,n){const o=s.m;return n._x=e*o[0]+t*o[4]+i*o[8],n._y=e*o[1]+t*o[5]+i*o[9],n._z=e*o[2]+t*o[6]+i*o[10],n._isDirty=!0,n}static CatmullRom(e,t,i,s,n){const o=n*n,c=n*o,h=.5*(2*t._x+(-e._x+i._x)*n+(2*e._x-5*t._x+4*i._x-s._x)*o+(-e._x+3*t._x-3*i._x+s._x)*c),f=.5*(2*t._y+(-e._y+i._y)*n+(2*e._y-5*t._y+4*i._y-s._y)*o+(-e._y+3*t._y-3*i._y+s._y)*c),_=.5*(2*t._z+(-e._z+i._z)*n+(2*e._z-5*t._z+4*i._z-s._z)*o+(-e._z+3*t._z-3*i._z+s._z)*c);return new D(h,f,_)}static Clamp(e,t,i){const s=new D;return D.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){let n=e._x;n=n>i._x?i._x:n,n=n<t._x?t._x:n;let o=e._y;o=o>i._y?i._y:o,o=o<t._y?t._y:o;let c=e._z;return c=c>i._z?i._z:c,c=c<t._z?t._z:c,s.copyFromFloats(n,o,c),s}static CheckExtends(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,m=c-o,g=e._x*h+i._x*f+t._x*_+s._x*m,x=e._y*h+i._y*f+t._y*_+s._y*m,y=e._z*h+i._z*f+t._z*_+s._z*m;return new D(g,x,y)}static Hermite1stDerivative(e,t,i,s,n){const o=new D;return this.Hermite1stDerivativeToRef(e,t,i,s,n,o),o}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;return o._x=(c-n)*6*e._x+(3*c-4*n+1)*t._x+(-c+n)*6*i._x+(3*c-2*n)*s._x,o._y=(c-n)*6*e._y+(3*c-4*n+1)*t._y+(-c+n)*6*i._y+(3*c-2*n)*s._y,o._z=(c-n)*6*e._z+(3*c-4*n+1)*t._z+(-c+n)*6*i._z+(3*c-2*n)*s._z,o._isDirty=!0,o}static Lerp(e,t,i){const s=new D(0,0,0);return D.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){return s._x=e._x+(t._x-e._x)*i,s._y=e._y+(t._y-e._y)*i,s._z=e._z+(t._z-e._z)*i,s._isDirty=!0,s}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 i=new D;return D.CrossToRef(e,t,i),i}static CrossToRef(e,t,i){const s=e._y*t._z-e._z*t._y,n=e._z*t._x-e._x*t._z,o=e._x*t._y-e._y*t._x;return i.copyFromFloats(s,n,o),i}static Normalize(e){const t=D.Zero();return D.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Project(e,t,i,s){const n=new D;return D.ProjectToRef(e,t,i,s,n),n}static ProjectToRef(e,t,i,s,n){const o=s.width,c=s.height,h=s.x,f=s.y,_=Oe.Matrix[1],m=mt.LastCreatedEngine?.isNDCHalfZRange,g=m?1:.5,x=m?0:.5;se.FromValuesToRef(o/2,0,0,0,0,-c/2,0,0,0,0,g,0,h+o/2,c/2+f,x,1,_);const y=Oe.Matrix[0];return t.multiplyToRef(i,y),y.multiplyToRef(_,y),D.TransformCoordinatesToRef(e,y,n),n}static Reflect(e,t){return this.ReflectToRef(e,t,new D)}static ReflectToRef(e,t,i){const s=ge.Vector3[0];return s.copyFrom(t).scaleInPlace(2*D.Dot(e,t)),i.copyFrom(e).subtractInPlace(s)}static UnprojectFromTransform(e,t,i,s,n){return this.Unproject(e,t,i,s,n,se.IdentityReadOnly)}static Unproject(e,t,i,s,n,o){const c=new D;return D.UnprojectToRef(e,t,i,s,n,o,c),c}static UnprojectToRef(e,t,i,s,n,o,c){return D.UnprojectFloatsToRef(e._x,e._y,e._z,t,i,s,n,o,c),c}static UnprojectFloatsToRef(e,t,i,s,n,o,c,h,f){const _=Oe.Matrix[0];o.multiplyToRef(c,_),_.multiplyToRef(h,_),_.invert();const m=Oe.Vector3[0];return m.x=e/s*2-1,m.y=-(t/n*2-1),mt.LastCreatedEngine?.isNDCHalfZRange?m.z=i:m.z=2*i-1,D.TransformCoordinatesToRef(m,_,f),f}
vendor: 1,566 bytes, line 289
289static Minimize(e,t){const i=new D;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new D;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(D.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e._x-t._x,s=e._y-t._y,n=e._z-t._z;return i*i+s*s+n*n}static ProjectOnTriangleToRef(e,t,i,s,n){const o=Oe.Vector3[0],c=Oe.Vector3[1],h=Oe.Vector3[2],f=Oe.Vector3[3],_=Oe.Vector3[4];i.subtractToRef(t,o),s.subtractToRef(t,c),s.subtractToRef(i,h);const m=o.length(),g=c.length(),x=h.length();if(m<Vt||g<Vt||x<Vt)return n.copyFrom(t),D.Distance(e,t);e.subtractToRef(t,_),D.CrossToRef(o,c,f);const y=f.length();if(y<Vt)return n.copyFrom(t),D.Distance(e,t);f.normalizeFromLength(y);let b=_.length();if(b<Vt)return n.copyFrom(t),0;_.normalizeFromLength(b);const v=D.Dot(f,_),E=Oe.Vector3[5],R=Oe.Vector3[6];E.copyFrom(f).scaleInPlace(-b*v),R.copyFrom(e).addInPlace(E);const C=Oe.Vector3[4],O=Oe.Vector3[5],M=Oe.Vector3[7],I=Oe.Vector3[8];C.copyFrom(o).scaleInPlace(1/m),I.copyFrom(c).scaleInPlace(1/g),C.addInPlace(I).scaleInPlace(-1),O.copyFrom(o).scaleInPlace(-1/m),I.copyFrom(h).scaleInPlace(1/x),O.addInPlace(I).scaleInPlace(-1),M.copyFrom(h).scaleInPlace(-1/x),I.copyFrom(c).scaleInPlace(-1/g),M.addInPlace(I).scaleInPlace(-1);const P=Oe.Vector3[9];let L;P.copyFrom(R).subtractInPlace(t),D.CrossToRef(C,P,I),L=D.Dot(I,f);const V=L;P.copyFrom(R).subtractInPlace(i),D.CrossToRef(O,P,I),L=D.Dot(I,f);const X=L;P.copyFrom(R).subtractInPlace(s),D.CrossToRef(M,P,I),L=D.Dot(I,f);const re=L,ae=Oe.Vector3[10];let de,U;V>
vendor: 54,487 bytes, lines 289-292
2890&&X<0?(ae.copyFrom(o),de=t,U=i):X>0&&re<0?(ae.copyFrom(h),de=i,U=s):(ae.copyFrom(c).scaleInPlace(-1),de=s,U=t);const te=Oe.Vector3[9],Y=Oe.Vector3[4];if(de.subtractToRef(R,I),U.subtractToRef(R,te),D.CrossToRef(I,te,Y),!(D.Dot(Y,f)<0))return n.copyFrom(R),Math.abs(b*v);const q=Oe.Vector3[5];D.CrossToRef(ae,Y,q),q.normalize();const j=Oe.Vector3[9];j.copyFrom(de).subtractInPlace(R);const Q=j.length();if(Q<Vt)return n.copyFrom(de),D.Distance(e,de);j.normalizeFromLength(Q);const w=D.Dot(q,j),B=Oe.Vector3[7];B.copyFrom(R).addInPlace(q.scaleInPlace(Q*w)),I.copyFrom(B).subtractInPlace(de),b=ae.length(),ae.normalizeFromLength(b);let z=D.Dot(I,ae)/Math.max(b,Vt);return z=oi(z,0,1),B.copyFrom(de).addInPlace(ae.scaleInPlace(z*b)),n.copyFrom(B),D.Distance(e,B)}static Center(e,t){return D.CenterToRef(e,t,D.Zero())}static CenterToRef(e,t,i){return i.copyFromFloats((e._x+t._x)/2,(e._y+t._y)/2,(e._z+t._z)/2)}static RotationFromAxis(e,t,i){const s=new D;return D.RotationFromAxisToRef(e,t,i,s),s}static RotationFromAxisToRef(e,t,i,s){const n=Oe.Quaternion[0];return Be.RotationQuaternionFromAxisToRef(e,t,i,n),n.toEulerAnglesToRef(s),s}}D._V8PerformanceHack=new D(.5,.5,.5);D._UpReadOnly=D.Up();D._DownReadOnly=D.Down();D._LeftHandedForwardReadOnly=D.Forward(!1);D._RightHandedForwardReadOnly=D.Forward(!0);D._LeftHandedBackwardReadOnly=D.Backward(!1);D._RightHandedBackwardReadOnly=D.Backward(!0);D._RightReadOnly=D.Right();D._LeftReadOnly=D.Left();D._ZeroReadOnly=D.Zero();D._OneReadOnly=D.One();class at{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,i=0,s=0){this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=s}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Vector4"}getHashCode(){const e=vs(this._x),t=vs(this._y),i=vs(this._z),s=vs(this._w);let n=e;return n=n*397^t,n=n*397^i,n=n*397^s,n}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 at.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,i,s){return this.x+=e,this.y+=t,this.z+=i,this.w+=s,this}add(e){return new at(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 at(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,i,s){return new at(this._x-e,this._y-t,this._z-i,this._w-s)}subtractFromFloatsToRef(e,t,i,s,n){return n.x=this._x-e,n.y=this._y-t,n.z=this._z-i,n.w=this._w-s,n}negate(){return new at(-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 at(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=Vt){return e&&kt(this._x,e.x,t)&&kt(this._y,e.y,t)&&kt(this._z,e.z,t)&&kt(this._w,e.w,t)}equalsToFloats(e,t,i,s){return this._x===e&&this._y===t&&this._z===i&&this._w===s}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiply(e){return new at(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,i,s){return new at(this._x*e,this._y*t,this._z*i,this._w*s)}divide(e){return new at(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,i,s){return this.x=Math.min(e,this._x),this.y=Math.min(t,this._y),this.z=Math.min(i,this._z),this.w=Math.min(s,this._w),this}maximizeInPlaceFromFloats(e,t,i,s){return this.x=Math.max(e,this._x),this.y=Math.max(t,this._y),this.z=Math.max(i,this._z),this.w=Math.max(s,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 at(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 at(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 at)}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 D(this._x,this._y,this._z)}clone(){return new at(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,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}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 at(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i}static FromFloatArrayToRef(e,t,i){return at.FromArrayToRef(e,t,i),i}static FromFloatsToRef(e,t,i,s,n){return n.x=e,n.y=t,n.z=i,n.w=s,n}static Zero(){return new at(0,0,0,0)}static One(){return new at(1,1,1,1)}static Random(e=0,t=1){return new at(xi(e,t),xi(e,t),xi(e,t),xi(e,t))}static RandomToRef(e=0,t=1,i){return i.x=xi(e,t),i.y=xi(e,t),i.z=xi(e,t),i.w=xi(e,t),i}static Clamp(e,t,i){return at.ClampToRef(e,t,i,new at)}static ClampToRef(e,t,i,s){return s.x=oi(e.x,t.x,i.x),s.y=oi(e.y,t.y,i.y),s.z=oi(e.z,t.z,i.z),s.w=oi(e.w,t.w,i.w),s}static CheckExtends(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)}static get ZeroReadOnly(){return at._ZeroReadOnly}static Normalize(e){return at.NormalizeToRef(e,new at)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=new at;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new at;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(at.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,n=e.z-t.z,o=e.w-t.w;return i*i+s*s+n*n+o*o}static Center(e,t){return at.CenterToRef(e,t,new at)}static CenterToRef(e,t,i){return i.x=(e.x+t.x)/2,i.y=(e.y+t.y)/2,i.z=(e.z+t.z)/2,i.w=(e.w+t.w)/2,i}static TransformCoordinates(e,t){return at.TransformCoordinatesToRef(e,t,new at)}static TransformCoordinatesToRef(e,t,i){return at.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,n){const o=s.m,c=e*o[0]+t*o[4]+i*o[8]+o[12],h=e*o[1]+t*o[5]+i*o[9]+o[13],f=e*o[2]+t*o[6]+i*o[10]+o[14],_=e*o[3]+t*o[7]+i*o[11]+o[15];return n.x=c,n.y=h,n.z=f,n.w=_,n}static TransformNormal(e,t){return at.TransformNormalToRef(e,t,new at)}static TransformNormalToRef(e,t,i){const s=t.m,n=e.x*s[0]+e.y*s[4]+e.z*s[8],o=e.x*s[1]+e.y*s[5]+e.z*s[9],c=e.x*s[2]+e.y*s[6]+e.z*s[10];return i.x=n,i.y=o,i.z=c,i.w=e.w,i}static TransformNormalFromFloatsToRef(e,t,i,s,n,o){const c=n.m;return o.x=e*c[0]+t*c[4]+i*c[8],o.y=e*c[1]+t*c[5]+i*c[9],o.z=e*c[2]+t*c[6]+i*c[10],o.w=s,o}static FromVector3(e,t=0){return new at(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}}at._V8PerformanceHack=new at(.5,.5,.5,.5);at._ZeroReadOnly=at.Zero();class Be{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,i=0,s=1){this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=s}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){const e=vs(this._x),t=vs(this._y),i=vs(this._z),s=vs(this._w);let n=e;return n=n*397^t,n=n*397^i,n=n*397^s,n}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 Be.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=Vt){return e&&kt(this._x,e._x,t)&&kt(this._y,e._y,t)&&kt(this._z,e._z,t)&&kt(this._w,e._w,t)}isApprox(e,t=Vt){return e&&(kt(this._x,e._x,t)&&kt(this._y,e._y,t)&&kt(this._z,e._z,t)&&kt(this._w,e._w,t)||kt(this._x,-e._x,t)&&kt(this._y,-e._y,t)&&kt(this._z,-e._z,t)&&kt(this._w,-e._w,t))}clone(){return new Be(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,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._isDirty=!0,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.copyFromFloats(e,e,e,e)}add(e){return new Be(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,i,s){return this._x+=e,this._y+=t,this._z+=i,this._w+=s,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,i,s){return this.subtractFromFloatsToRef(e,t,i,s,new Be)}subtractFromFloatsToRef(e,t,i,s,n){return n._x=this._x-e,n._y=this._y-t,n._z=this._z-i,n._w=this._w-s,n._isDirty=!0,n}subtract(e){return new Be(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 Be(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 Be(0,0,0,1);return this.multiplyToRef(e,t),t}multiplyToRef(e,t){const i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,s=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,n=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,o=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,s,n,o),t}multiplyInPlace(e){return this.multiplyToRef(e,this)}multiplyByFloats(e,t,i,s){return this._x*=e,this._y*=t,this._z*=i,this._w*=s,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 Be)}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,i,s){return this._x===e&&this._y===t&&this._z===i&&this._w===s}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 Be(-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 Be(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=D.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){const t=this._z,i=this._x,s=this._y,n=this._w,o=s*t-i*n,c=.4999999;if(o<-c)e._y=2*Math.atan2(s,n),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(o>c)e._y=2*Math.atan2(s,n),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{const h=n*n,f=t*t,_=i*i,m=s*s;e._z=Math.atan2(2*(i*s+t*n),-f-_+m+h),e._x=Math.asin(-2*o),e._y=Math.atan2(2*(t*i+s*n),f-_-m+h),e._isDirty=!0}return e}toAlphaBetaGammaToRef(e){const t=this._z,i=this._x,s=this._y,n=this._w,o=Math.sqrt(i*i+s*s),c=Math.sqrt(t*t+n*n),h=2*Math.atan2(o,c),f=2*Math.atan2(t,n),_=2*Math.atan2(s,i),m=(f+_)/2,g=(f-_)/2;return e.set(g,h,m),e}toRotationMatrix(e){return se.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return Be.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=D.Zero(),t=this.toAxisAngleToRef(e);return{axis:e,angle:t}}toAxisAngleToRef(e){let t;const i=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),s=this._w;return i>0?(t=2*Math.atan2(i,s),e.set(this._x/i,this._y/i,this._z/i)):(t=0,e.set(1,0,0)),t}static FromRotationMatrix(e){const t=new Be;return Be.FromRotationMatrixToRef(e,t),t}static FromRotationMatrixToRef(e,t){const i=e.m,s=i[0],n=i[4],o=i[8],c=i[1],h=i[5],f=i[9],_=i[2],m=i[6],g=i[10],x=s+h+g;let y;return x>0?(y=.5/Math.sqrt(x+1),t._w=.25/y,t._x=(m-f)*y,t._y=(o-_)*y,t._z=(c-n)*y,t._isDirty=!0):s>h&&s>g?(y=2*Math.sqrt(1+s-h-g),t._w=(m-f)/y,t._x=.25*y,t._y=(n+c)/y,t._z=(o+_)/y,t._isDirty=!0):h>g?(y=2*Math.sqrt(1+h-s-g),t._w=(o-_)/y,t._x=(n+c)/y,t._y=.25*y,t._z=(f+m)/y,t._isDirty=!0):(y=2*Math.sqrt(1+g-s-h),t._w=(c-n)/y,t._x=(o+_)/y,t._y=(f+m)/y,t._z=.25*y,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,i=.1){const s=Be.Dot(e,t);return 1-s*s<=i}static SmoothToRef(e,t,i,s,n){let o=s===0?1:i/s;return o=oi(o,0,1),Be.SlerpToRef(e,t,o,n),n}static Zero(){return new Be(0,0,0,0)}static Inverse(e){return new Be(-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 Be(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 Be.RotationAxisToRef(e,t,new Be)}static RotationAxisToRef(e,t,i){i._w=Math.cos(t/2);const s=Math.sin(t/2)/e.length();return i._x=e._x*s,i._y=e._y*s,i._z=e._z*s,i._isDirty=!0,i}static FromArray(e,t){return t||(t=0),new Be(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._w=e[t+3],i._isDirty=!0,i}static FromFloatsToRef(e,t,i,s,n){return n.copyFromFloats(e,t,i,s),n}static FromEulerAngles(e,t,i){const s=new Be;return Be.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerAnglesToRef(e,t,i,s){return Be.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerVector(e){const t=new Be;return Be.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromEulerVectorToRef(e,t){return Be.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromUnitVectorsToRef(e,t,i,s=Vt){const n=D.Dot(e,t)+1;return n<s?Math.abs(e.x)>Math.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(D.CrossToRef(e,t,ge.Vector3[0]),i.set(ge.Vector3[0].x,ge.Vector3[0].y,ge.Vector3[0].z,n)),i.normalize()}static RotationYawPitchRoll(e,t,i){const s=new Be;return Be.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){const n=i*.5,o=t*.5,c=e*.5,h=Math.sin(n),f=Math.cos(n),_=Math.sin(o),m=Math.cos(o),g=Math.sin(c),x=Math.cos(c);return s._x=x*_*f+g*m*h,s._y=g*m*f-x*_*h,s._z=x*m*h-g*_*f,s._w=x*m*f+g*_*h,s._isDirty=!0,s}static RotationAlphaBetaGamma(e,t,i){const s=new Be;return Be.RotationAlphaBetaGammaToRef(e,t,i,s),s}static RotationAlphaBetaGammaToRef(e,t,i,s){const n=(i+e)*.5,o=(i-e)*.5,c=t*.5;return s._x=Math.cos(o)*Math.sin(c),s._y=Math.sin(o)*Math.sin(c),s._z=Math.sin(n)*Math.cos(c),s._w=Math.cos(n)*Math.cos(c),s._isDirty=!0,s}static RotationQuaternionFromAxis(e,t,i){const s=new Be(0,0,0,0);return Be.RotationQuaternionFromAxisToRef(e,t,i,s),s}static RotationQuaternionFromAxisToRef(e,t,i,s){const n=Oe.Matrix[0];return e=e.normalizeToRef(Oe.Vector3[0]),t=t.normalizeToRef(Oe.Vector3[1]),i=i.normalizeToRef(Oe.Vector3[2]),se.FromXYZAxesToRef(e,t,i,n),Be.FromRotationMatrixToRef(n,s),s}static FromLookDirectionLH(e,t){const i=new Be;return Be.FromLookDirectionLHToRef(e,t,i),i}static FromLookDirectionLHToRef(e,t,i){const s=Oe.Matrix[0];return se.LookDirectionLHToRef(e,t,s),Be.FromRotationMatrixToRef(s,i),i}static FromLookDirectionRH(e,t){const i=new Be;return Be.FromLookDirectionRHToRef(e,t,i),i}static FromLookDirectionRHToRef(e,t,i){const s=Oe.Matrix[0];return se.LookDirectionRHToRef(e,t,s),Be.FromRotationMatrixToRef(s,i)}static Slerp(e,t,i){const s=Be.Identity();return Be.SlerpToRef(e,t,i,s),s}static SlerpToRef(e,t,i,s){let n,o,c=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,h=!1;if(c<0&&(h=!0,c=-c),c>.999999)o=1-i,n=h?-i:i;else{const f=Math.acos(c),_=1/Math.sin(f);o=Math.sin((1-i)*f)*_,n=h?-Math.sin(i*f)*_:Math.sin(i*f)*_}return s._x=o*e._x+n*t._x,s._y=o*e._y+n*t._y,s._z=o*e._z+n*t._z,s._w=o*e._w+n*t._w,s._isDirty=!0,s}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,m=c-o,g=e._x*h+i._x*f+t._x*_+s._x*m,x=e._y*h+i._y*f+t._y*_+s._y*m,y=e._z*h+i._z*f+t._z*_+s._z*m,b=e._w*h+i._w*f+t._w*_+s._w*m;return new Be(g,x,y,b)}static Hermite1stDerivative(e,t,i,s,n){const o=new Be;return this.Hermite1stDerivativeToRef(e,t,i,s,n,o),o}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;return o._x=(c-n)*6*e._x+(3*c-4*n+1)*t._x+(-c+n)*6*i._x+(3*c-2*n)*s._x,o._y=(c-n)*6*e._y+(3*c-4*n+1)*t._y+(-c+n)*6*i._y+(3*c-2*n)*s._y,o._z=(c-n)*6*e._z+(3*c-4*n+1)*t._z+(-c+n)*6*i._z+(3*c-2*n)*s._z,o._w=(c-n)*6*e._w+(3*c-4*n+1)*t._w+(-c+n)*6*i._w+(3*c-2*n)*s._w,o._isDirty=!0,o}static Normalize(e){const t=Be.Zero();return Be.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Clamp(e,t,i){const s=new Be;return Be.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){return s.copyFromFloats(oi(e.x,t.x,i.x),oi(e.y,t.y,i.y),oi(e.z,t.z,i.z),oi(e.w,t.w,i.w))}static Random(e=0,t=1){return new Be(xi(e,t),xi(e,t),xi(e,t),xi(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(xi(e,t),xi(e,t),xi(e,t),xi(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(Be.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,n=e.z-t.z,o=e.w-t.w;return i*i+s*s+n*n+o*o}static Center(e,t){return Be.CenterToRef(e,t,Be.Zero())}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2,(e.w+t.w)/2)}}Be._V8PerformanceHack=new Be(.5,.5,.5,.5);class se{static get Use64Bits(){return Bi.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=Am._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,t=!1,i=!1,s=!0){this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:t,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:s}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,Bi.MatrixTrackPrecisionChange&&Bi.MatrixTrackedMatrices.push(this),this._m=new Bi.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],i=e[1],s=e[2],n=e[3],o=e[4],c=e[5],h=e[6],f=e[7],_=e[8],m=e[9],g=e[10],x=e[11],y=e[12],b=e[13],v=e[14],E=e[15],R=g*E-v*x,C=m*E-b*x,O=m*v-b*g,M=_*E-y*x,I=_*v-g*y,P=_*b-y*m,L=+(c*R-h*C+f*O),V=-(o*R-h*M+f*I),X=+(o*C-c*M+f*P),re=-(o*O-c*I+h*P);return t*L+i*V+s*X+n*re}toString(){return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
290${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}
291${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}
292${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`}toArray(e=null,t=0){if(!e)return this._m;const i=this._m;for(let s=0;s<16;s++)e[t+s]=i[s];return this}asArray(){return this._m}fromArray(e,t=0){return se.FromArrayToRef(e,t,this)}copyFromFloats(...e){return se.FromArrayToRef(e,0,this)}set(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=e[i];return this.markAsUpdated(),this}setAll(e){const t=this._m;for(let i=0;i<16;i++)t[i]=e;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return se.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 se;return this.addToRef(e,t),t}addToRef(e,t){const i=this._m,s=t._m,n=e.m;for(let o=0;o<16;o++)s[o]=i[o]+n[o];return t.markAsUpdated(),t}addToSelf(e){const t=this._m,i=e.m;return t[0]+=i[0],t[1]+=i[1],t[2]+=i[2],t[3]+=i[3],t[4]+=i[4],t[5]+=i[5],t[6]+=i[6],t[7]+=i[7],t[8]+=i[8],t[9]+=i[9],t[10]+=i[10],t[11]+=i[11],t[12]+=i[12],t[13]+=i[13],t[14]+=i[14],t[15]+=i[15],this.markAsUpdated(),this}addInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]+=i[s];return this.markAsUpdated(),this}addInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]+=e[i];return this.markAsUpdated(),this}subtract(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractToRef(e,t){const i=this._m,s=e.m,n=t._m;for(let o=0;o<16;o++)n[o]=i[o]-s[o];return t.markAsUpdated(),t}subtractInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractFromFloats(...e){return this.subtractFromFloatsToRef(...e,new se)}subtractFromFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,n=e;for(let o=0;o<16;o++)s[o]=i[o]-n[o];return t.markAsUpdated(),t}invertToRef(e){return this._isIdentity===!0?(se.IdentityToRef(e),e):(gv(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,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this.markAsUpdated(),this}addTranslationFromFloats(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this.markAsUpdated(),this}setTranslation(e){return this.setTranslationFromFloats(e._x,e._y,e._z)}getTranslation(){return new D(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 se.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 MM(this,e,t),this}multiply(e){const t=new se;return this.multiplyToRef(e,t),t}multiplyInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]*=i[s];return this.markAsUpdated(),this}multiplyByFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e[i];return this.markAsUpdated(),this}multiplyByFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,n=e;for(let o=0;o<16;o++)s[o]=i[o]*n[o];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,i){return mv(this,e,t,i),this}divide(e){return this.divideToRef(e,new se)}divideToRef(e,t){const i=this._m,s=e.m,n=t._m;for(let o=0;o<16;o++)n[o]=i[o]/s[o];return t.markAsUpdated(),t}divideInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]/=i[s];return this.markAsUpdated(),this}minimizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}maximizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.max(t[s],i[s]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.max(t[i],e[i]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new se)}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,i=e._m;for(let s=0;s<16;s++)i[s]=-t[s];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 i=this.m,s=t.m;return i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]&&i[3]===s[3]&&i[4]===s[4]&&i[5]===s[5]&&i[6]===s[6]&&i[7]===s[7]&&i[8]===s[8]&&i[9]===s[9]&&i[10]===s[10]&&i[11]===s[11]&&i[12]===s[12]&&i[13]===s[13]&&i[14]===s[14]&&i[15]===s[15]}equalsWithEpsilon(e,t=0){const i=this._m,s=e.m;for(let n=0;n<16;n++)if(!kt(i[n],s[n],t))return!1;return!0}equalsToFloats(...e){const t=this._m;for(let i=0;i<16;i++)if(t[i]!=e[i])return!1;return!0}floor(){return this.floorToRef(new se)}floorToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=Math.floor(t[s]);return e.markAsUpdated(),e}fract(){return this.fractToRef(new se)}fractToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=t[s]-Math.floor(t[s]);return e.markAsUpdated(),e}clone(){const e=new se;return e.copyFrom(this),e}getClassName(){return"Matrix"}getHashCode(){let e=vs(this._m[0]);for(let t=1;t<16;t++)e=e*397^vs(this._m[t]);return e}decomposeToTransformNode(e){return e.rotationQuaternion=e.rotationQuaternion||new Be,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,t,i,s,n=!0){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;const o=this._m;if(i&&i.copyFromFloats(o[12],o[13],o[14]),e=e||Oe.Vector3[0],e.x=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]),e.y=Math.sqrt(o[4]*o[4]+o[5]*o[5]+o[6]*o[6]),e.z=Math.sqrt(o[8]*o[8]+o[9]*o[9]+o[10]*o[10]),s){const c=(n?s.absoluteScaling.x:s.scaling.x)<0?-1:1,h=(n?s.absoluteScaling.y:s.scaling.y)<0?-1:1,f=(n?s.absoluteScaling.z:s.scaling.z)<0?-1:1;e.x*=c,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 c=1/e._x,h=1/e._y,f=1/e._z;se.FromValuesToRef(o[0]*c,o[1]*c,o[2]*c,0,o[4]*h,o[5]*h,o[6]*h,0,o[8]*f,o[9]*f,o[10]*f,0,0,0,0,1,Oe.Matrix[0]),Be.FromRotationMatrixToRef(Oe.Matrix[0],t)}return!0}getRow(e){if(e<0||e>3)return null;const t=e*4;return new at(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 i=e*4;t.x=this._m[i+0],t.y=this._m[i+1],t.z=this._m[i+2],t.w=this._m[i+3]}return t}setRow(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)}transpose(){const e=new se;return se.TransposeToRef(this,e),e}transposeToRef(e){return se.TransposeToRef(this,e),e}setRowFromFloats(e,t,i,s,n){if(e<0||e>3)return this;const o=e*4;return this._m[o+0]=t,this._m[o+1]=i,this._m[o+2]=s,this._m[o+3]=n,this.markAsUpdated(),this}scale(e){const t=new se;return this.scaleToRef(e,t),t}scaleToRef(e,t){for(let i=0;i<16;i++)t._m[i]=this._m[i]*e;return t.markAsUpdated(),t}scaleAndAddToRef(e,t){for(let i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t.markAsUpdated(),t}scaleInPlace(e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e;return this.markAsUpdated(),this}toNormalMatrix(e){const t=Oe.Matrix[0];this.invertToRef(t),t.transposeToRef(e);const i=e._m;return se.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,e),e}getRotationMatrix(){const e=new se;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){const t=Oe.Vector3[0];if(!this.decompose(t))return se.IdentityToRef(e),e;const i=this._m,s=1/t._x,n=1/t._y,o=1/t._z;return se.FromValuesToRef(i[0]*s,i[1]*s,i[2]*s,0,i[4]*n,i[5]*n,i[6]*n,0,i[8]*o,i[9]*o,i[10]*o,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(ra,this),this}static FromArray(e,t=0){const i=new se;return se.FromArrayToRef(e,t,i),i}static FromArrayToRef(e,t,i){for(let s=0;s<16;s++)i._m[s]=e[s+t];return i.markAsUpdated(),i}static FromFloat32ArrayToRefScaled(e,t,i,s){return s._m[0]=e[0+t]*i,s._m[1]=e[1+t]*i,s._m[2]=e[2+t]*i,s._m[3]=e[3+t]*i,s._m[4]=e[4+t]*i,s._m[5]=e[5+t]*i,s._m[6]=e[6+t]*i,s._m[7]=e[7+t]*i,s._m[8]=e[8+t]*i,s._m[9]=e[9+t]*i,s._m[10]=e[10+t]*i,s._m[11]=e[11+t]*i,s._m[12]=e[12+t]*i,s._m[13]=e[13+t]*i,s._m[14]=e[14+t]*i,s._m[15]=e[15+t]*i,s.markAsUpdated(),s}static get IdentityReadOnly(){return se._IdentityReadOnly}static FromValuesToRef(e,t,i,s,n,o,c,h,f,_,m,g,x,y,b,v,E){const R=E._m;R[0]=e,R[1]=t,R[2]=i,R[3]=s,R[4]=n,R[5]=o,R[6]=c,R[7]=h,R[8]=f,R[9]=_,R[10]=m,R[11]=g,R[12]=x,R[13]=y,R[14]=b,R[15]=v,E.markAsUpdated()}static FromValues(e,t,i,s,n,o,c,h,f,_,m,g,x,y,b,v){const E=new se,R=E._m;return R[0]=e,R[1]=t,R[2]=i,R[3]=s,R[4]=n,R[5]=o,R[6]=c,R[7]=h,R[8]=f,R[9]=_,R[10]=m,R[11]=g,R[12]=x,R[13]=y,R[14]=b,R[15]=v,E.markAsUpdated(),E}static Compose(e,t,i){const s=new se;return se.ComposeToRef(e,t,i,s),s}static ComposeToRef(e,t,i,s){const n=s._m,o=t._x,c=t._y,h=t._z,f=t._w,_=o+o,m=c+c,g=h+h,x=o*_,y=o*m,b=o*g,v=c*m,E=c*g,R=h*g,C=f*_,O=f*m,M=f*g,I=e._x,P=e._y,L=e._z;return n[0]=(1-(v+R))*I,n[1]=(y+M)*I,n[2]=(b-O)*I,n[3]=0,n[4]=(y-M)*P,n[5]=(1-(x+R))*P,n[6]=(E+C)*P,n[7]=0,n[8]=(b+O)*L,n[9]=(E-C)*L,n[10]=(1-(x+v))*L,n[11]=0,n[12]=i._x,n[13]=i._y,n[14]=i._z,n[15]=1,s.markAsUpdated(),s}static Identity(){const e=se.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 se.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=se.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 se;return se.RotationXToRef(e,t),t}static Invert(e){const t=new se;return e.invertToRef(t),t}static RotationXToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return se.FromValuesToRef(1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationY(e){const t=new se;return se.RotationYToRef(e,t),t}static RotationYToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return se.FromValuesToRef(s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationZ(e){const t=new se;return se.RotationZToRef(e,t),t}static RotationZToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return se.FromValuesToRef(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationAxis(e,t){const i=new se;return se.RotationAxisToRef(e,t,i),i}static RotationAxisToRef(e,t,i){const s=Math.sin(-t),n=Math.cos(-t),o=1-n;e=e.normalizeToRef(Oe.Vector3[0]);const c=i._m;return c[0]=e._x*e._x*o+n,c[1]=e._x*e._y*o-e._z*s,c[2]=e._x*e._z*o+e._y*s,c[3]=0,c[4]=e._y*e._x*o+e._z*s,c[5]=e._y*e._y*o+n,c[6]=e._y*e._z*o-e._x*s,c[7]=0,c[8]=e._z*e._x*o-e._y*s,c[9]=e._z*e._y*o+e._x*s,c[10]=e._z*e._z*o+n,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,i.markAsUpdated(),i}static RotationAlignToRef(e,t,i,s=!1){const n=D.Dot(t,e),o=i._m;if(n<-1+Vt)o[0]=-1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s?1:-1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s?-1:1,o[11]=0;else{const c=D.Cross(t,e),h=1/(1+n);o[0]=c._x*c._x*h+n,o[1]=c._y*c._x*h-c._z,o[2]=c._z*c._x*h+c._y,o[3]=0,o[4]=c._x*c._y*h+c._z,o[5]=c._y*c._y*h+n,o[6]=c._z*c._y*h-c._x,o[7]=0,o[8]=c._x*c._z*h-c._y,o[9]=c._y*c._z*h+c._x,o[10]=c._z*c._z*h+n,o[11]=0}return o[12]=0,o[13]=0,o[14]=0,o[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(e,t,i){const s=new se;return se.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){return Be.RotationYawPitchRollToRef(e,t,i,Oe.Quaternion[0]),Oe.Quaternion[0].toRotationMatrix(s),s}static Scaling(e,t,i){const s=new se;return se.ScalingToRef(e,t,i,s),s}static ScalingToRef(e,t,i,s){return se.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1,s),s._updateIdentityStatus(e===1&&t===1&&i===1),s}static Translation(e,t,i){const s=new se;return se.TranslationToRef(e,t,i,s),s}static TranslationToRef(e,t,i,s){return se.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1,s),s._updateIdentityStatus(e===0&&t===0&&i===0),s}static Lerp(e,t,i){const s=new se;return se.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){const n=s._m,o=e.m,c=t.m;for(let h=0;h<16;h++)n[h]=o[h]*(1-i)+c[h]*i;return s.markAsUpdated(),s}static DecomposeLerp(e,t,i){const s=new se;return se.DecomposeLerpToRef(e,t,i,s),s}static DecomposeLerpToRef(e,t,i,s){const n=Oe.Vector3[0],o=Oe.Quaternion[0],c=Oe.Vector3[1];e.decompose(n,o,c);const h=Oe.Vector3[2],f=Oe.Quaternion[1],_=Oe.Vector3[3];t.decompose(h,f,_);const m=Oe.Vector3[4];D.LerpToRef(n,h,i,m);const g=Oe.Quaternion[2];Be.SlerpToRef(o,f,i,g);const x=Oe.Vector3[5];return D.LerpToRef(c,_,i,x),se.ComposeToRef(m,g,x,s),s}static LookAtLH(e,t,i){const s=new se;return se.LookAtLHToRef(e,t,i,s),s}static LookAtLHToRef(e,t,i,s){const n=Oe.Vector3[0],o=Oe.Vector3[1],c=Oe.Vector3[2];t.subtractToRef(e,c),c.normalize(),D.CrossToRef(i,c,n);const h=n.lengthSquared();h===0?n.x=1:n.normalizeFromLength(Math.sqrt(h)),D.CrossToRef(c,n,o),o.normalize();const f=-D.Dot(n,e),_=-D.Dot(o,e),m=-D.Dot(c,e);return se.FromValuesToRef(n._x,o._x,c._x,0,n._y,o._y,c._y,0,n._z,o._z,c._z,0,f,_,m,1,s),s}static LookAtRH(e,t,i){const s=new se;return se.LookAtRHToRef(e,t,i,s),s}static LookAtRHToRef(e,t,i,s){const n=Oe.Vector3[0],o=Oe.Vector3[1],c=Oe.Vector3[2];e.subtractToRef(t,c),c.normalize(),D.CrossToRef(i,c,n);const h=n.lengthSquared();h===0?n.x=1:n.normalizeFromLength(Math.sqrt(h)),D.CrossToRef(c,n,o),o.normalize();const f=-D.Dot(n,e),_=-D.Dot(o,e),m=-D.Dot(c,e);return se.FromValuesToRef(n._x,o._x,c._x,0,n._y,o._y,c._y,0,n._z,o._z,c._z,0,f,_,m,1,s),s}static LookDirectionLH(e,t){const i=new se;return se.LookDirectionLHToRef(e,t,i),i}static LookDirectionLHToRef(e,t,i){const s=Oe.Vector3[0];s.copyFrom(e),s.scaleInPlace(-1);const n=Oe.Vector3[1];return D.CrossToRef(t,s,n),se.FromValuesToRef(n._x,n._y,n._z,0,t._x,t._y,t._z,0,s._x,s._y,s._z,0,0,0,0,1,i),i}static LookDirectionRH(e,t){const i=new se;return se.LookDirectionRHToRef(e,t,i),i}static LookDirectionRHToRef(e,t,i){const s=Oe.Vector3[2];return D.CrossToRef(t,e,s),se.FromValuesToRef(s._x,s._y,s._z,0,t._x,t._y,t._z,0,e._x,e._y,e._z,0,0,0,0,1,i),i}static OrthoLH(e,t,i,s,n){const o=new se;return se.OrthoLHToRef(e,t,i,s,o,n),o}static OrthoLHToRef(e,t,i,s,n,o){const c=i,h=s,f=2/e,_=2/t,m=2/(h-c),g=-(h+c)/(h-c);return se.FromValuesToRef(f,0,0,0,0,_,0,0,0,0,m,0,0,0,g,1,n),o&&n.multiplyToRef(ra,n),n._updateIdentityStatus(f===1&&_===1&&m===1&&g===0),n}static OrthoOffCenterLH(e,t,i,s,n,o,c){const h=new se;return se.OrthoOffCenterLHToRef(e,t,i,s,n,o,h,c),h}static OrthoOffCenterLHToRef(e,t,i,s,n,o,c,h){const f=n,_=o,m=2/(t-e),g=2/(s-i),x=2/(_-f),y=-(_+f)/(_-f),b=(e+t)/(e-t),v=(s+i)/(i-s);return se.FromValuesToRef(m,0,0,0,0,g,0,0,0,0,x,0,b,v,y,1,c),h&&c.multiplyToRef(ra,c),c.markAsUpdated(),c}static ObliqueOffCenterLHToRef(e,t,i,s,n,o,c,h,f,_,m){const g=-c*Math.cos(h),x=-c*Math.sin(h);return se.TranslationToRef(0,0,-f,Oe.Matrix[1]),se.FromValuesToRef(1,0,0,0,0,1,0,0,g,x,1,0,0,0,0,1,Oe.Matrix[0]),Oe.Matrix[1].multiplyToRef(Oe.Matrix[0],Oe.Matrix[0]),se.TranslationToRef(0,0,f,Oe.Matrix[1]),Oe.Matrix[0].multiplyToRef(Oe.Matrix[1],Oe.Matrix[0]),se.OrthoOffCenterLHToRef(e,t,i,s,n,o,_,m),Oe.Matrix[0].multiplyToRef(_,_),_}static OrthoOffCenterRH(e,t,i,s,n,o,c){const h=new se;return se.OrthoOffCenterRHToRef(e,t,i,s,n,o,h,c),h}static OrthoOffCenterRHToRef(e,t,i,s,n,o,c,h){return se.OrthoOffCenterLHToRef(e,t,i,s,n,o,c,h),c._m[10]*=-1,c}static ObliqueOffCenterRHToRef(e,t,i,s,n,o,c,h,f,_,m){const g=c*Math.cos(h),x=c*Math.sin(h);return se.TranslationToRef(0,0,f,Oe.Matrix[1]),se.FromValuesToRef(1,0,0,0,0,1,0,0,g,x,1,0,0,0,0,1,Oe.Matrix[0]),Oe.Matrix[1].multiplyToRef(Oe.Matrix[0],Oe.Matrix[0]),se.TranslationToRef(0,0,-f,Oe.Matrix[1]),Oe.Matrix[0].multiplyToRef(Oe.Matrix[1],Oe.Matrix[0]),se.OrthoOffCenterRHToRef(e,t,i,s,n,o,_,m),Oe.Matrix[0].multiplyToRef(_,_),_}static PerspectiveLH(e,t,i,s,n,o=0){const c=new se,h=i,f=s,_=2*h/e,m=2*h/t,g=(f+h)/(f-h),x=-2*f*h/(f-h),y=Math.tan(o);return se.FromValuesToRef(_,0,0,0,0,m,0,y,0,0,g,1,0,0,x,0,c),n&&c.multiplyToRef(ra,c),c._updateIdentityStatus(!1),c}static PerspectiveFovLH(e,t,i,s,n,o=0,c=!1){const h=new se;return se.PerspectiveFovLHToRef(e,t,i,s,h,!0,n,o,c),h}static PerspectiveFovLHToRef(e,t,i,s,n,o=!0,c,h=0,f=!1){const _=i,m=s,g=1/Math.tan(e*.5),x=o?g/t:g,y=o?g:g*t,b=f&&_===0?-1:m!==0?(m+_)/(m-_):1,v=f&&_===0?2*m:m!==0?-2*m*_/(m-_):-2*_,E=Math.tan(h);return se.FromValuesToRef(x,0,0,0,0,y,0,E,0,0,b,1,0,0,v,0,n),c&&n.multiplyToRef(ra,n),n._updateIdentityStatus(!1),n}static PerspectiveFovReverseLHToRef(e,t,i,s,n,o=!0,c,h=0){const f=1/Math.tan(e*.5),_=o?f/t:f,m=o?f:f*t,g=Math.tan(h);return se.FromValuesToRef(_,0,0,0,0,m,0,g,0,0,-i,1,0,0,1,0,n),c&&n.multiplyToRef(ra,n),n._updateIdentityStatus(!1),n}static PerspectiveFovRH(e,t,i,s,n,o=0,c=!1){const h=new se;return se.PerspectiveFovRHToRef(e,t,i,s,h,!0,n,o,c),h}static PerspectiveFovRHToRef(e,t,i,s,n,o=!0,c,h=0,f=!1){const _=i,m=s,g=1/Math.tan(e*.5),x=o?g/t:g,y=o?g:g*t,b=f&&_===0?1:m!==0?-(m+_)/(m-_):-1,v=f&&_===0?2*m:m!==0?-2*m*_/(m-_):-2*_,E=Math.tan(h);return se.FromValuesToRef(x,0,0,0,0,y,0,E,0,0,b,-1,0,0,v,0,n),c&&n.multiplyToRef(ra,n),n._updateIdentityStatus(!1),n}static PerspectiveFovReverseRHToRef(e,t,i,s,n,o=!0,c,h=0){const f=1/Math.tan(e*.5),_=o?f/t:f,m=o?f:f*t,g=Math.tan(h);return se.FromValuesToRef(_,0,0,0,0,m,0,g,0,0,-i,-1,0,0,-1,0,n),c&&n.multiplyToRef(ra,n),n._updateIdentityStatus(!1),n}static GetFinalMatrix(e,t,i,s,n,o){const c=e.width,h=e.height,f=e.x,_=e.y,m=se.FromValues(c/2,0,0,0,0,-h/2,0,0,0,0,o-n,0,f+c/2,h/2+_,n,1),g=new se;return t.multiplyToRef(i,g),g.multiplyToRef(s,g),g.multiplyToRef(m,g)}static GetAsMatrix2x2(e){const t=e.m,i=[t[0],t[1],t[4],t[5]];return Bi.MatrixUse64Bits?i:new Float32Array(i)}static GetAsMatrix3x3(e){const t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return Bi.MatrixUse64Bits?i:new Float32Array(i)}static Transpose(e){const t=new se;return se.TransposeToRef(e,t),t}static TransposeToRef(e,t){const i=e.m,s=i[0],n=i[4],o=i[8],c=i[12],h=i[1],f=i[5],_=i[9],m=i[13],g=i[2],x=i[6],y=i[10],b=i[14],v=i[3],E=i[7],R=i[11],C=i[15],O=t._m;return O[0]=s,O[1]=n,O[2]=o,O[3]=c,O[4]=h,O[5]=f,O[6]=_,O[7]=m,O[8]=g,O[9]=x,O[10]=y,O[11]=b,O[12]=v,O[13]=E,O[14]=R,O[15]=C,t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t}static Reflection(e){const t=new se;return se.ReflectionToRef(e,t),t}static ReflectionToRef(e,t){e.normalize();const i=e.normal.x,s=e.normal.y,n=e.normal.z,o=-2*i,c=-2*s,h=-2*n;return se.FromValuesToRef(o*i+1,c*i,h*i,0,o*s,c*s+1,h*s,0,o*n,c*n,h*n+1,0,o*e.d,c*e.d,h*e.d,1,t),t}static FromXYZAxesToRef(e,t,i,s){return se.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,i._x,i._y,i._z,0,0,0,0,1,s),s}static FromQuaternionToRef(e,t){const i=e._x*e._x,s=e._y*e._y,n=e._z*e._z,o=e._x*e._y,c=e._z*e._w,h=e._z*e._x,f=e._y*e._w,_=e._y*e._z,m=e._x*e._w;return t._m[0]=1-2*(s+n),t._m[1]=2*(o+c),t._m[2]=2*(h-f),t._m[3]=0,t._m[4]=2*(o-c),t._m[5]=1-2*(n+i),t._m[6]=2*(_+m),t._m[7]=0,t._m[8]=2*(h+f),t._m[9]=2*(_-m),t._m[10]=1-2*(s+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t.markAsUpdated(),t}}se._IdentityReadOnly=se.Identity();class Oe{}Oe.Vector3=_a(11,D.Zero);Oe.Matrix=_a(2,se.Identity);Oe.Quaternion=_a(3,Be.Zero);class ge{}ge.Vector2=_a(3,Fe.Zero);ge.Vector3=_a(13,D.Zero);ge.Vector4=_a(3,at.Zero);ge.Quaternion=_a(3,Be.Zero);ge.Matrix=_a(8,se.Identity);const ra=se.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1);let Cb=!1;function CM(){Cb||(Cb=!0,Object.defineProperties(Fe.prototype,{dimension:{value:[2]},rank:{value:1}}),Object.defineProperties(D.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(at.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(Be.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(se.prototype,{dimension:{value:[4,4]},rank:{value:2}}),Lr("BABYLON.Vector2",Fe),Lr("BABYLON.Vector3",D),Lr("BABYLON.Vector4",at),Lr("BABYLON.Matrix",se))}var Db;(function(a){a[a.LOCAL=0]="LOCAL",a[a.WORLD=1]="WORLD",a[a.BONE=2]="BONE"})(Db||(Db={}));class Xa{}Xa.X=new D(1,0,0);Xa.Y=new D(0,1,0);Xa.Z=new D(0,0,1);var Ib;(function(a){a[a.X=0]="X",a[a.Y=1]="Y",a[a.Z=2]="Z"})(Ib||(Ib={}));function Ko(a){return Math.pow(a,vM)}function Zo(a){return a<=.04045?.0773993808*a:Math.pow(.947867299*(a+.055),2.4)}function Qo(a){return Math.pow(a,TM)}function $o(a){return a<=.0031308?12.92*a:1.055*Math.pow(a,.41666)-.055}class rt{constructor(e=0,t=0,i=0){this.r=e,this.g=t,this.b=i}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 rt.FromArrayToRef(e,t,this),this}toColor4(e=1){return new _t(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 rt(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,i){return new rt(this.r*e,this.g*t,this.b*i)}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,i){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this}maximizeInPlaceFromFloats(e,t,i){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,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,i){return this.equalsToFloats(e,t,i)}equalsToFloats(e,t,i){return this.r===e&&this.g===t&&this.b===i}equalsWithEpsilon(e,t=Vt){return kt(this.r,e.r,t)&&kt(this.g,e.g,t)&&kt(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 rt(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,i){return i.r=oi(this.r,e,t),i.g=oi(this.g,e,t),i.b=oi(this.b,e,t),i}add(e){return new rt(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,i){return this.r+=e,this.g+=t,this.b+=i,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 rt(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,i){return new rt(this.r-e,this.g-t,this.b-i)}subtractFromFloatsToRef(e,t,i,s){return s.r=this.r-e,s.g=this.g-t,s.b=this.b-i,s}clone(){return new rt(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,i){return this.r=e,this.g=t,this.b=i,this}set(e,t,i){return this.copyFromFloats(e,t,i)}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),i=Math.round(this.b*255);return"#"+Pr(e)+Pr(t)+Pr(i)}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 rt)}toHSVToRef(e){const t=this.r,i=this.g,s=this.b,n=Math.max(t,i,s),o=Math.min(t,i,s);let c=0,h=0;const f=n,_=n-o;return n!==0&&(h=_/n),n!=o&&(n==t?(c=(i-s)/_,i<s&&(c+=6)):n==i?c=(s-t)/_+2:n==s&&(c=(t-i)/_+4),c*=60),e.r=c,e.g=h,e.b=f,e}toLinearSpace(e=!1){const t=new rt;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=Zo(this.r),e.g=Zo(this.g),e.b=Zo(this.b)):(e.r=Ko(this.r),e.g=Ko(this.g),e.b=Ko(this.b)),this}toGammaSpace(e=!1){const t=new rt;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=$o(this.r),e.g=$o(this.g),e.b=$o(this.b)):(e.r=Qo(this.r),e.g=Qo(this.g),e.b=Qo(this.b)),this}static HSVtoRGBToRef(e,t,i,s){const n=i*t,o=e/60,c=n*(1-Math.abs(o%2-1));let h=0,f=0,_=0;o>=0&&o<=1?(h=n,f=c):o>=1&&o<=2?(h=c,f=n):o>=2&&o<=3?(f=n,_=c):o>=3&&o<=4?(f=c,_=n):o>=4&&o<=5?(h=c,_=n):o>=5&&o<=6&&(h=n,_=c);const m=i-n;return s.r=h+m,s.g=f+m,s.b=_+m,s}static FromHSV(e,t,i){const s=new rt(0,0,0);return rt.HSVtoRGBToRef(e,t,i,s),s}static FromHexString(e){return new rt(0,0,0).fromHexString(e)}static FromArray(e,t=0){return new rt(e[t],e[t+1],e[t+2])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2]}static FromInts(e,t,i){return new rt(e/255,t/255,i/255)}static Lerp(e,t,i){const s=new rt(0,0,0);return rt.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,m=c-o,g=e.r*h+i.r*f+t.r*_+s.r*m,x=e.g*h+i.g*f+t.g*_+s.g*m,y=e.b*h+i.b*f+t.b*_+s.b*m;return new rt(g,x,y)}static Hermite1stDerivative(e,t,i,s,n){const o=rt.Black();return this.Hermite1stDerivativeToRef(e,t,i,s,n,o),o}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;o.r=(c-n)*6*e.r+(3*c-4*n+1)*t.r+(-c+n)*6*i.r+(3*c-2*n)*s.r,o.g=(c-n)*6*e.g+(3*c-4*n+1)*t.g+(-c+n)*6*i.g+(3*c-2*n)*s.g,o.b=(c-n)*6*e.b+(3*c-4*n+1)*t.b+(-c+n)*6*i.b+(3*c-2*n)*s.b}static Red(){return new rt(1,0,0)}static Green(){return new rt(0,1,0)}static Blue(){return new rt(0,0,1)}static Black(){return new rt(0,0,0)}static get BlackReadOnly(){return rt._BlackReadOnly}static White(){return new rt(1,1,1)}static Purple(){return new rt(.5,0,.5)}static Magenta(){return new rt(1,0,1)}static Yellow(){return new rt(1,1,0)}static Gray(){return new rt(.5,.5,.5)}static Teal(){return new rt(0,1,1)}static Random(){return new rt(Math.random(),Math.random(),Math.random())}}rt._V8PerformanceHack=new rt(.5,.5,.5);rt._BlackReadOnly=rt.Black();class _t{constructor(e=0,t=0,i=0,s=1){this.r=e,this.g=t,this.b=i,this.a=s}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 _t(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,i,s){return this.r+=e,this.g+=t,this.b+=i,this.a+=s,this}subtract(e){return new _t(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,i,s){return new _t(this.r-e,this.g-t,this.b-i,this.a-s)}subtractFromFloatsToRef(e,t,i,s,n){return n.r=this.r-e,n.g=this.g-t,n.b=this.b-i,n.a=this.a-s,n}scale(e){return new _t(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,i){return i.r=oi(this.r,e,t),i.g=oi(this.g,e,t),i.b=oi(this.b,e,t),i.a=oi(this.a,e,t),i}multiply(e){return new _t(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,i,s){return new _t(this.r*e,this.g*t,this.b*i,this.a*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.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,i,s){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this.a=Math.min(s,this.a),this}maximizeInPlaceFromFloats(e,t,i,s){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this.a=Math.max(s,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=Vt){return kt(this.r,e.r,t)&&kt(this.g,e.g,t)&&kt(this.b,e.b,t)&&kt(this.a,e.a,t)}equalsToFloats(e,t,i,s){return this.r===e&&this.g===t&&this.b===i&&this.a===s}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 _t().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,i,s){return this.r=e,this.g=t,this.b=i,this.a=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.r=this.g=this.b=this.a=e,this}toHexString(e=!1){const t=Math.round(this.r*255),i=Math.round(this.g*255),s=Math.round(this.b*255);if(e)return"#"+Pr(t)+Pr(i)+Pr(s);const n=Math.round(this.a*255);return"#"+Pr(t)+Pr(i)+Pr(s)+Pr(n)}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 _t;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=Zo(this.r),e.g=Zo(this.g),e.b=Zo(this.b)):(e.r=Ko(this.r),e.g=Ko(this.g),e.b=Ko(this.b)),e.a=this.a,this}toGammaSpace(e=!1){const t=new _t;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=$o(this.r),e.g=$o(this.g),e.b=$o(this.b)):(e.r=Qo(this.r),e.g=Qo(this.g),e.b=Qo(this.b)),e.a=this.a,this}static FromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?new _t(0,0,0,0):new _t(0,0,0,1).fromHexString(e)}static Lerp(e,t,i){return _t.LerpToRef(e,t,i,new _t)}static LerpToRef(e,t,i,s){return s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i,s.a=e.a+(t.a-e.a)*i,s}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,m=c-o,g=e.r*h+i.r*f+t.r*_+s.r*m,x=e.g*h+i.g*f
292+t.g*_+s.g*m,y=e.b*h+i.b*f+t.b*_+s.b*m,b=e.a*h+i.a*f+t.a*_+s.a*m;return new _t(g,x,y,b)}static Hermite1stDerivative(e,t,i,s,n){const o=new _t;return this.Hermite1stDerivativeToRef(e,t,i,s,n,o),o}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;o.r=(c-n)*6*e.r+(3*c-4*n+1)*t.r+(-c+n)*6*i.r+(3*c-2*n)*s.r,o.g=(c-n)*6*e.g+(3*c-4*n+1)*t.g+(-c+n)*6*i.g+(3*c-2*n)*s.g,o.b=(c-n)*6*e.b+(3*c-4*n+1)*t.b+(-c+n)*6*i.b+(3*c-2*n)*s.b,o.a=(c-n)*6*e.a+(3*c-4*n+1)*t.a+(-c+n)*6*i.a+(3*c-2*n)*s.a}static FromColor3(e,t=1){return new _t(e.r,e.g,e.b,t)}static FromArray(e,t=0){return new _t(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]}static FromInts(e,t,i,s){return new _t(e/255,t/255,i/255,s/255)}static CheckColors4(e,t){if(e.length===t*3){const i=[];for(let s=0;s<e.length;s+=3){const n=s/3*4;i[n]=e[s],i[n+1]=e[s+1],i[n+2]=e[s+2],i[n+3]=1}return i}return e}}_t._V8PerformanceHack=new _t(.5,.5,.5,.5);class Rm{}Rm.Color3=vn(3,rt.Black);Rm.Color4=vn(3,()=>new _t(0,0,0,0));let Pb=!1;function DM(){Pb||(Pb=!0,Object.defineProperties(rt.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(_t.prototype,{dimension:{value:[4]},rank:{value:1}}),Lr("BABYLON.Color3",rt),Lr("BABYLON.Color4",_t))}class wr{constructor(e,t,i,s){this.normal=new D(e,t,i),this.d=s}asArray(){return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){return new wr(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=wr._TmpMatrix;e.invertToRef(t);const i=t.m,s=this.normal.x,n=this.normal.y,o=this.normal.z,c=this.d,h=s*i[0]+n*i[1]+o*i[2]+c*i[3],f=s*i[4]+n*i[5]+o*i[6]+c*i[7],_=s*i[8]+n*i[9]+o*i[10]+c*i[11],m=s*i[12]+n*i[13]+o*i[14]+c*i[15];return new wr(h,f,_,m)}dotCoordinate(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d}copyFromPoints(e,t,i){const s=t.x-e.x,n=t.y-e.y,o=t.z-e.z,c=i.x-e.x,h=i.y-e.y,f=i.z-e.z,_=n*f-o*h,m=o*c-s*f,g=s*h-n*c,x=Math.sqrt(_*_+m*m+g*g);let y;return x!==0?y=1/x:y=0,this.normal.x=_*y,this.normal.y=m*y,this.normal.z=g*y,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this}isFrontFacingTo(e,t){return D.Dot(this.normal,e)<=t}signedDistanceTo(e){return D.Dot(e,this.normal)+this.d}static FromArray(e){return new wr(e[0],e[1],e[2],e[3])}static FromPoints(e,t,i){const s=new wr(0,0,0,0);return s.copyFromPoints(e,t,i),s}static FromPositionAndNormal(e,t){const i=new wr(0,0,0,0);return this.FromPositionAndNormalToRef(e,t,i)}static FromPositionAndNormalToRef(e,t,i){return i.normal.copyFrom(t),i.normal.normalize(),i.d=-e.dot(i.normal),i}static SignedDistanceToPlaneFromPositionAndNormal(e,t,i){const s=-(t.x*e.x+t.y*e.y+t.z*e.z);return D.Dot(i,t)+s}}wr._TmpMatrix=se.Identity();class lr{static GetPlanes(e){const t=[];for(let i=0;i<6;i++)t.push(new wr(0,0,0,0));return lr.GetPlanesToRef(e,t),t}static GetNearPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[2],t.normal.y=i[7]+i[6],t.normal.z=i[11]+i[10],t.d=i[15]+i[14],t.normalize()}static GetFarPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[2],t.normal.y=i[7]-i[6],t.normal.z=i[11]-i[10],t.d=i[15]-i[14],t.normalize()}static GetLeftPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[0],t.normal.y=i[7]+i[4],t.normal.z=i[11]+i[8],t.d=i[15]+i[12],t.normalize()}static GetRightPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[0],t.normal.y=i[7]-i[4],t.normal.z=i[11]-i[8],t.d=i[15]-i[12],t.normalize()}static GetTopPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[1],t.normal.y=i[7]-i[5],t.normal.z=i[11]-i[9],t.d=i[15]-i[13],t.normalize()}static GetBottomPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[1],t.normal.y=i[7]+i[5],t.normal.z=i[11]+i[9],t.d=i[15]+i[13],t.normalize()}static GetPlanesToRef(e,t){lr.GetNearPlaneToRef(e,t[0]),lr.GetFarPlaneToRef(e,t[1]),lr.GetLeftPlaneToRef(e,t[2]),lr.GetRightPlaneToRef(e,t[3]),lr.GetTopPlaneToRef(e,t[4]),lr.GetBottomPlaneToRef(e,t[5])}static IsPointInFrustum(e,t){for(let i=0;i<6;i++)if(t[i].dotCoordinate(e)<0)return!1;return!0}}var Ob;(function(a){a[a.CW=0]="CW",a[a.CCW=1]="CCW"})(Ob||(Ob={}));class Fr{constructor(e){this._radians=e,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return this._radians*180/Math.PI}radians(){return this._radians}static BetweenTwoPoints(e,t){const i=t.subtract(e),s=Math.atan2(i.y,i.x);return new Fr(s)}static BetweenTwoVectors(e,t){let i=e.lengthSquared()*t.lengthSquared();if(i===0)return new Fr(Math.PI/2);i=Math.sqrt(i);let s=e.dot(t)/i;s=oi(s,-1,1);const n=Math.acos(s);return new Fr(n)}static FromRadians(e){return new Fr(e)}static FromDegrees(e){return new Fr(e*Math.PI/180)}}class IM{constructor(e,t,i){this.startPoint=e,this.midPoint=t,this.endPoint=i;const s=Math.pow(t.x,2)+Math.pow(t.y,2),n=(Math.pow(e.x,2)+Math.pow(e.y,2)-s)/2,o=(s-Math.pow(i.x,2)-Math.pow(i.y,2))/2,c=(e.x-t.x)*(t.y-i.y)-(t.x-i.x)*(e.y-t.y);this.centerPoint=new Fe((n*(t.y-i.y)-o*(e.y-t.y))/c,((e.x-t.x)*o-(t.x-i.x)*n)/c),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=Fr.BetweenTwoPoints(this.centerPoint,this.startPoint);const h=this.startAngle.degrees();let f=Fr.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),_=Fr.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();f-h>180&&(f-=360),f-h<-180&&(f+=360),_-f>180&&(_-=360),_-f<-180&&(_+=360),this.orientation=f-h<0?0:1,this.angle=Fr.FromDegrees(this.orientation===0?h-_
292:_-h)}}class Df{constructor(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new Fe(e,t))}addLineTo(e,t){if(this.closed)return this;const i=new Fe(e,t),s=this._points[this._points.length-1];return this._points.push(i),this._length+=i.subtract(s).length(),this}addArcTo(e,t,i,s,n=36){if(this.closed)return this;const o=this._points[this._points.length-1],c=new Fe(e,t),h=new Fe(i,s),f=new IM(o,c,h);let _=f.angle.radians()/n;f.orientation===0&&(_*=-1);let m=f.startAngle.radians()+_;for(let g=0;g<n;g++){const x=Math.cos(m)*f.radius+f.centerPoint.x,y=Math.sin(m)*f.radius+f.centerPoint.y;this.addLineTo(x,y),m+=_}return this}addQuadraticCurveTo(e,t,i,s,n=36){if(this.closed)return this;const o=(h,f,_,m)=>(1-h)*(1-h)*f+2*h*(1-h)*_+h*h*m,c=this._points[this._points.length-1];for(let h=0;h<=n;h++){const f=h/n,_=o(f,c.x,e,i),m=o(f,c.y,t,s);this.addLineTo(_,m)}return this}addBezierCurveTo(e,t,i,s,n,o,c=36){if(this.closed)return this;const h=(_,m,g,x,y)=>(1-_)*(1-_)*(1-_)*m+3*_*(1-_)*(1-_)*g+3*_*_*(1-_)*x+_*_*_*y,f=this._points[this._points.length-1];for(let _=0;_<=c;_++){const m=_/c,g=h(m,f.x,e,i,n),x=h(m,f.y,t,s,o);this.addLineTo(g,x)}return this}isPointInside(e){let t=!1;const i=this._points.length;for(let s=i-1,n=0;n<i;s=n++){let o=this._points[s],c=this._points[n],h=c.x-o.x,f=c.y-o.y;if(Math.abs(f)>Number.EPSILON){if(f<0&&(o=this._points[n],h=-h,c=this._points[s],f=-f),e.y<o.y||e.y>c.y)continue;if(e.y===o.y&&e.x===o.x)return!0;{const _=f*(e.x-o.x)-h*(e.y-o.y);if(_===0)return!0;if(_<0)continue;t=!t}}else{if(e.y!==o.y)continue;if(c.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=c.x)return!0}}return t}close(){return this.closed=!0,this}length(){let e=this._length;if(this.closed){const t=this._points[this._points.length-1],i=this._points[0];e+=i.subtract(t).length()}return e}area(){const e=this._points.length;let t=0;for(let i=e-1,s=0;s<e;i=s++)t+=this._points[i].x*this._points[s].y-this._points[s].x*this._points[i].y;return t*.5}getPoints(){return this._points}getPointAtLengthPosition(e){if(e<0||e>1)return Fe.Zero();const t=e*this.length();let i=0;for(let s=0;s<this._points.length;s++){const n=(s+1)%this._points.length,o=this._points[s],h=this._points[n].subtract(o),f=h.length()+i;if(t>=i&&t<=f){const _=h.normalize(),m=t-i;return new Fe(o.x+_.x*m,o.y+_.y*m)}i=f}return Fe.Zero()}static StartingAt(e,t){return new Df(e,t)}}class Nc{constructor(e,t=null,i,s=!1){this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:D.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:se.Identity()};for(let n=0;n<e.length;n++)this._curve[n]=e[n].clone();this._raw=i||!1,this._alignTangentsWithPath=s,this._compute(t,s)}getCurve(){return this._curve}getPoints(){return this._curve}length(){return this._distances[this._distances.length-1]}getTangents(){return this._tangents}getNormals(){return this._normals}getBinormals(){return this._binormals}getDistances(){return this._distances}getPointAt(e){return this._updatePointAtData(e).point}getTangentAt(e,t=!1){return this._updatePointAtData(e,t),t?D.TransformCoordinates(D.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]}getNormalAt(e,t=!1){return this._updatePointAtData(e,t),t?D.TransformCoordinates(D.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]}getBinormalAt(e,t=!1){return this._updatePointAtData(e,t),t?D.TransformCoordinates(D.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]}getDistanceAt(e){return this.length()*e}getPreviousPointIndexAt(e){return this._updatePointAtData(e),this._pointAtData.previousPointArrayIndex}getSubPositionAt(e){return this._updatePointAtData(e),this._pointAtData.subPosition}getClosestPositionTo(e){let t=Number.MAX_VALUE,i=0;for(let s=0;s<this._curve.length-1;s++){const n=this._curve[s+0],o=this._curve[s+1].subtract(n).normalize(),c=this._distances[s+1]-this._distances[s+0],h=Math.min(Math.max(D.Dot(o,e.subtract(n).normalize()),0)*D.Distance(n,e)/c,1),f=D.Distance(n.add(o.scale(h*c)),e);f<t&&(t=f,i=(this._distances[s+0]+c*h)/this.length())}return i}slice(e=0,t=1){if(e<0&&(e=1-e*-1%1),t<0&&(t=1-t*-1%1),e>t){const f=e;e=t,t=f}
292const i=this.getCurve(),s=this.getPointAt(e);let n=this.getPreviousPointIndexAt(e);const o=this.getPointAt(t),c=this.getPreviousPointIndexAt(t)+1,h=[];return e!==0&&(n++,h.push(s)),h.push(...i.slice(n,c)),(t!==1||e===1)&&h.push(o),new Nc(h,this.getNormalAt(e),this._raw,this._alignTangentsWithPath)}update(e,t=null,i=!1){for(let s=0;s<e.length;s++)this._curve[s].x=e[s].x,this._curve[s].y=e[s].y,this._curve[s].z=e[s].z;return this._compute(t,i),this}_compute(e,t=!1){const i=this._curve.length;if(i<2)return;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[i-1]=this._curve[i-1].subtract(this._curve[i-2]),this._raw||this._tangents[i-1].normalize();const s=this._tangents[0],n=this._normalVector(s,e);this._normals[0]=n,this._raw||this._normals[0].normalize(),this._binormals[0]=D.Cross(s,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;let o,c,h,f,_;for(let m=1;m<i;m++)o=this._getLastNonNullVector(m),m<i-1&&(c=this._getFirstNonNullVector(m),this._tangents[m]=t?c:o.add(c),this._tangents[m].normalize()),this._distances[m]=this._distances[m-1]+this._curve[m].subtract(this._curve[m-1]).length(),h=this._tangents[m],_=this._binormals[m-1],this._normals[m]=D.Cross(_,h),this._raw||(this._normals[m].length()===0?(f=this._normals[m-1],this._normals[m]=f.clone()):this._normals[m].normalize()),this._binormals[m]=D.Cross(h,this._normals[m]),this._raw||this._binormals[m].normalize();this._pointAtData.id=NaN}_getFirstNonNullVector(e){let t=1,i=this._curve[e+t].subtract(this._curve[e]);for(;i.length()===0&&e+t+1<this._curve.length;)t++,i=this._curve[e+t].subtract(this._curve[e]);return i}_getLastNonNullVector(e){let t=1,i=this._curve[e].subtract(this._curve[e-t]);for(;i.length()===0&&e>t;)t++,i=this._curve[e].subtract(this._curve[e-t]);return i}_normalVector(e,t){let i,s=e.length();if(s===0&&(s=1),t==null){let n;kt(Math.abs(e.y)/s,1,Vt)?kt(Math.abs(e.x)/s,1,Vt)?kt(Math.abs(e.z)/s,1,Vt)?n=D.Zero():n=new D(0,0,1):n=new D(1,0,0):n=new D(0,-1,0),i=D.Cross(e,n)}else i=D.Cross(e,t),D.CrossToRef(i,e,i);return i.normalize(),i}_updatePointAtData(e,t=!1){if(this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;const i=this.getPoints();if(e<=0)return this._setPointAtData(0,0,i[0],0,t);if(e>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,t);let s=i[0],n,o=0;const c=e*this.length();for(let h=1;h<i.length;h++){n=i[h];const f=D.Distance(s,n);if(o+=f,o===c)return this._setPointAtData(e,1,n,h,t);if(o>c){const m=(o-c)/f,g=s.subtract(n),x=n.add(g.scaleInPlace(m));return this._setPointAtData(e,1-m,x,h-1,t)}s=n}return this._pointAtData}_setPointAtData(e,t,i,s,n){return this._pointAtData.point=i,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=s,this._pointAtData.interpolateReady=n,n&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=se.Identity();const e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){const t=e+1,i=this._tangents[e].clone(),s=this._normals[e].clone(),n=this._binormals[e].clone(),o=this._tangents[t].clone(),c=this._normals[t].clone(),h=this._binormals[t].clone(),f=Be.RotationQuaternionFromAxis(s,n,i),_=Be.RotationQuaternionFromAxis(c,h,o);Be.Slerp(f,_,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class Or{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 Or(this.width*e,this.height*t)}clone(){return new Or(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 Or(0,0)}add(e){return new Or(this.width+e.width,this.height+e.height)}subtract(e){return new Or(this.width-e.width,this.height-e.height)}scale(e){return new Or(this.width*e,this.height*e)}
vendor: 6,448 bytes, line 292
292static Lerp(e,t,i){const s=e.width+(t.width-e.width)*i,n=e.height+(t.height-e.height)*i;return new Or(s,n)}}class hf{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,t){return new hf(this.x*e,this.y*t,this.width*e,this.height*t)}toGlobalToRef(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){return new hf(this.x,this.y,this.width,this.height)}}const Ir=[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))],PM=[()=>1,a=>a.y,a=>a.z,a=>a.x,a=>a.x*a.y,a=>a.y*a.z,a=>3*a.z*a.z-1,a=>a.x*a.z,a=>a.x*a.x-a.y*a.y],_n=(a,e)=>Ir[a]*PM[a](e),mn=[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 uf{constructor(){this.preScaled=!1,this.l00=D.Zero(),this.l1_1=D.Zero(),this.l10=D.Zero(),this.l11=D.Zero(),this.l2_2=D.Zero(),this.l2_1=D.Zero(),this.l20=D.Zero(),this.l21=D.Zero(),this.l22=D.Zero()}addLight(e,t,i){ge.Vector3[0].set(t.r,t.g,t.b);const s=ge.Vector3[0],n=ge.Vector3[1];s.scaleToRef(i,n),n.scaleToRef(_n(0,e),ge.Vector3[2]),this.l00.addInPlace(ge.Vector3[2]),n.scaleToRef(_n(1,e),ge.Vector3[2]),this.l1_1.addInPlace(ge.Vector3[2]),n.scaleToRef(_n(2,e),ge.Vector3[2]),this.l10.addInPlace(ge.Vector3[2]),n.scaleToRef(_n(3,e),ge.Vector3[2]),this.l11.addInPlace(ge.Vector3[2]),n.scaleToRef(_n(4,e),ge.Vector3[2]),this.l2_2.addInPlace(ge.Vector3[2]),n.scaleToRef(_n(5,e),ge.Vector3[2]),this.l2_1.addInPlace(ge.Vector3[2]),n.scaleToRef(_n(6,e),ge.Vector3[2]),this.l20.addInPlace(ge.Vector3[2]),n.scaleToRef(_n(7,e),ge.Vector3[2]),this.l21.addInPlace(ge.Vector3[2]),n.scaleToRef(_n(8,e),ge.Vector3[2]),this.l22.addInPlace(ge.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(mn[0]),this.l1_1.scaleInPlace(mn[1]),this.l10.scaleInPlace(mn[2]),this.l11.scaleInPlace(mn[3]),this.l2_2.scaleInPlace(mn[4]),this.l2_1.scaleInPlace(mn[5]),this.l20.scaleInPlace(mn[6]),this.l21.scaleInPlace(mn[7]),this.l22.scaleInPlace(mn[8])}convertIrradianceToLambertianRadiance(){this.scaleInPlace(1/Math.PI)}preScaleForRendering(){this.preScaled=!0,this.l00.scaleInPlace(Ir[0]),this.l1_1.scaleInPlace(Ir[1]),this.l10.scaleInPlace(Ir[2]),this.l11.scaleInPlace(Ir[3]),this.l2_2.scaleInPlace(Ir[4]),this.l2_1.scaleInPlace(Ir[5]),this.l20.scaleInPlace(Ir[6]),this.l21.scaleInPlace(Ir[7]),this.l22.scaleInPlace(Ir[8])}updateFromArray(e){return D.FromArrayToRef(e[0],0,this.l00),D.FromArrayToRef(e[1],0,this.l1_1),D.FromArrayToRef(e[2],0,this.l10),D.FromArrayToRef(e[3],0,this.l11),D.FromArrayToRef(e[4],0,this.l2_2),D.FromArrayToRef(e[5],0,this.l2_1),D.FromArrayToRef(e[6],0,this.l20),D.FromArrayToRef(e[7],0,this.l21),D.FromArrayToRef(e[8],0,this.l22),this}updateFromFloatsArray(e){return D.FromFloatsToRef(e[0],e[1],e[2],this.l00),D.FromFloatsToRef(e[3],e[4],e[5],this.l1_1),D.FromFloatsToRef(e[6],e[7],e[8],this.l10),D.FromFloatsToRef(e[9],e[10],e[11],this.l11),D.FromFloatsToRef(e[12],e[13],e[14],this.l2_2),D.FromFloatsToRef(e[15],e[16],e[17],this.l2_1),D.FromFloatsToRef(e[18],e[19],e[20],this.l20),D.FromFloatsToRef(e[21],e[22],e[23],this.l21),D.FromFloatsToRef(e[24],e[25],e[26],this.l22),this}static FromArray(e){return new uf().updateFromArray(e)}static FromPolynomial(e){const t=new uf;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 ff{constructor(){this.x=D.Zero(),this.y=D.Zero(),this.z=D.Zero(),this.xx=D.Zero(),this.yy=D.Zero(),this.zz=D.Zero(),this.xy=D.Zero(),this.yz=D.Zero(),this.zx=D.Zero()}get preScaledHarmonics(){return this._harmonics||(this._harmonics=uf.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics}addAmbient(e){ge.Vector3[0].copyFromFloats(e.r,e.g,e.b);const t=ge.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),ge.Vector3[0].copyFrom(e.l20).scaleInPlace(.247708),ge.Vector3[1].copyFrom(e.l22).scaleInPlace(.429043),this.xx.scaleInPlace(.886277).subtractInPlace(ge.Vector3[0]).addInPlace(ge.Vector3[1]),this.yy.copyFrom(e.l00),this.yy.scaleInPlace(.886277).subtractInPlace(ge.Vector3[0]).subtractInPlace(ge.Vector3[1]),this.zz.copyFrom(e.l00),ge.Vector3[0].copyFrom(e.l20).scaleInPlace(.495417),this.zz.scaleInPlace(.886277).addInPlace(ge.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 ff().updateFromHarmonics(e)}static FromArray(e){const t=new ff;return D.FromArrayToRef(e[0],0,t.x),D.FromArrayToRef(e[1],0,t.y),D.FromArrayToRef(e[2],0,t.z),D.FromArrayToRef(e[3],0,t.xx),D.FromArrayToRef(e[4],0,t.yy),D.FromArrayToRef(e[5],0,t.zz),D.FromArrayToRef(e[6],0,t.yz),D.FromArrayToRef(e[7],0,t.zx),D.FromArrayToRef(e[8],0,t.xy),t}}function ee(a,e,t,i,s,n){function o(E){if(E!==void 0&&typeof E!="function")throw new TypeError("Function expected");return E}for(var c=i.kind,h=c==="getter"?"get":c==="setter"?"set":"value",f=!e&&a?i.static?a:a.prototype:null,_=e||(f?Object.getOwnPropertyDescriptor(f,i.name):{}
292),m,g=!1,x=t.length-1;x>=0;x--){var y={};for(var b in i)y[b]=b==="access"?{}:i[b];for(var b in i.access)y.access[b]=i.access[b];y.addInitializer=function(E){if(g)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(E||null))};var v=(0,t[x])(c==="accessor"?{get:_.get,set:_.set}:_[h],y);if(c==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(m=o(v.get))&&(_.get=m),(m=o(v.set))&&(_.set=m),(m=o(v.init))&&s.unshift(m)}else(m=o(v))&&(c==="field"?s.unshift(m):_[h]=m)}f&&Object.defineProperty(f,i.name,_),g=!0}function N(a,e,t){for(var i=arguments.length>2,s=0;s<e.length;s++)t=i?e[s].call(a,t):e[s].call(a);return i?t:void 0}function Ft(a,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?a!==e||!i:!e.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(a):i?i.value:e.get(a)}function Bt(a,e,t,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?a!==e||!s:!e.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(a,t):s?s.value=t:e.set(a,t),t}const Oc="__bjs_serializable__",wb=new WeakMap;function xv(a,e){return Object.prototype.hasOwnProperty.call(a,e)}function OM(){let a=Symbol.metadata;return a||(a=Symbol("Symbol.metadata"),Object.defineProperty(Symbol,"metadata",{configurable:!0,writable:!0,value:a})),a}const bv=OM();function wM(a){return typeof a=="function"?a:a?.constructor}function yv(a){if(!a)throw new Error(`Decorator metadata is unavailable; the Symbol.metadata (${String(bv)}) polyfill must run before decorated classes are evaluated.`);return xv(a,Oc)||(a[Oc]={}),a[Oc]}function rm(a){const e=wM(a),t=e?e[bv]:void 0;if(!t)return{};const i=wb.get(t);if(i)return i;const s={},n=[];let o=t;for(;o;)n.push(o),o=Object.getPrototypeOf(o);for(const c of n)if(xv(c,Oc)){const h=c[Oc];for(const f in h)s[f]=h[f]}return wb.set(t,s),s}function En(a,e){return(t,i)=>{if(!i.metadata)return;const s=String(i.name),n=yv(i.metadata);n[s]||(n[s]={type:a,sourceName:e})}}function FM(a,e=null){return(t,i)=>{const s=e||"_"+String(i.name);return{init(n){return(n!==void 0||!(s in this))&&(this[s]=n),n},get(){return this[s]},set(n){typeof this[s]?.equals=="function"&&this[s].equals(n)||this[s]!==n&&(this[s]=n,this[a]())}}}}function Lt(a,e=null){return FM(a,e)}function ce(a){return En(0,a)}function or(a){return En(1,a)}function qu(a){return En(2,a)}function Ic(a){return En(3,a)}function ua(a){return En(5,a)}function BM(a){return En(6,a)}function LM(a){return En(7,a)}function kM(a){return En(8,a)}function NM(a){return En(10,a)}function Tv(a,e,t){const i=String(e.name);let s=null;const n=function(...o){if(s===null){s=a,typeof _native<"u"&&_native[i]&&(s=t(_native[i],a));const c=this&&(e.static?this:Object.getPrototypeOf(this));c?.[i]===n&&(c[i]=s)}return s.apply(this,o)};return n}function la(a,e){return Tv(a,e,t=>t)}la.filter=function(a){return(e,t)=>Tv(e,t,(i,s)=>function(...n){return a(...n)?i(...n):s.apply(this,n)})};function vv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const e=Math.random()*16|0;return(a==="x"?e:e&3|8).toString(16)})}class Sm{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=Or.Zero(),this._cachedBaseSize=Or.Zero(),this._initialSamplingMode=2,this._texture=Sm._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.
vendor: 13,674 bytes, line 292
292width=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 za{static Eval(e,t){return e.match(/\([^()]*\)/g)?e=e.replace(/\([^()]*\)/g,i=>(i=i.slice(1,i.length-1),za._HandleParenthesisContent(i,t))):e=za._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:za.Eval(e,t)}static _HandleParenthesisContent(e,t){t=t||(n=>n==="true");let i;const s=e.split("||");for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)){let o=za._SimplifyNegation(s[n].trim());const c=o.split("&&");if(c.length>1)for(let h=0;h<c.length;++h){const f=za._SimplifyNegation(c[h].trim());if(f!=="true"&&f!=="false"?f[0]==="!"?i=!t(f.substring(1)):i=t(f):i=f==="true",!i){o="false";break}}if(i||o==="true"){i=!0;break}o!=="true"&&o!=="false"?o[0]==="!"?i=!t(o.substring(1)):i=t(o):i=o==="true"}return i?"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 Rt{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>Rt.HasTags(e),e.addTags=t=>Rt.AddTagsTo(e,t),e.removeTags=t=>Rt.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>Rt.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 i in t)if(Object.prototype.hasOwnProperty.call(t,i))return!0;return!1}static GetTags(e,t=!0){if(!e._tags)return null;if(t){const i=[];for(const s in e._tags)Object.prototype.hasOwnProperty.call(e._tags,s)&&e._tags[s]===!0&&i.push(s);return i.join(" ")}else return e._tags}static AddTagsTo(e,t){if(!t||typeof t!="string")return;const i=t.split(" ");for(const s of i)Rt._AddTagTo(e,s)}static _AddTagTo(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(Rt.EnableFor(e),e._tags[t]=!0))}static RemoveTagsFrom(e,t){if(!Rt.HasTags(e))return;const i=t.split(" ");for(const s in i)Rt._RemoveTagFrom(e,i[s])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return t===void 0?!0:t===""?Rt.HasTags(e):za.Eval(t,i=>Rt.HasTags(e)&&e._tags[i])}}const Fb=function(a,e,t,i={}){const s=a();Rt&&Rt.HasTags(e)&&Rt.AddTagsTo(s,Rt.GetTags(e,!0));const n=rm(s),o={};for(const c in n){const h=n[c],f=e[c],_=h.type;if(f!=null&&(c!=="uniqueId"||xt.AllowLoadingUniqueId))switch(_){case 0:case 6:case 9:case 11:typeof f.slice=="function"?s[c]=f.slice():s[c]=f;break;case 1:i.cloneTexturesOnlyOnce&&o[f.uniqueId]?s[c]=o[f.uniqueId]:(s[c]=t||f.isRenderTarget?f:f.clone(),o[f.uniqueId]=s[c]);break;case 2:case 3:case 4:case 5:case 7:case 8:case 10:case 12:case 13:s[c]=t?f:f.clone();break}}return s};class xt{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let i=0;i<e.animations.length;i++){const s=e.animations[i];t.animations.push(s.serialize())}}}static Serialize(e,t){t||(t={}),Rt&&(t.tags=Rt.GetTags(e));const i=rm(e);for(const s in i){const n=i[s],o=n.sourceName||s,c=n.type,h=e[s];if(h!=null&&(s!=="uniqueId"||xt.AllowLoadingUniqueId))switch(c){case 0:Array.isArray(h)?t[o]=h.slice():t[o]=h;break;case 1:t[o]=h.serialize();break;case 2:t[o]=h.asArray();break;case 3:t[o]=h.serialize();break;case 4:t[o]=h.asArray();break;case 5:t[o]=h.asArray();break;case 6:t[o]=h.id;break;case 7:t[o]=h.serialize();break;case 8:t[o]=h.asArray();break;case 9:t[o]=h.serialize();break;case 10:t[o]=h.asArray();break;case 11:t[o]=h.id;break;case 12:t[o]=h.asArray();break;case 13:t[o]=h.asArray();break}}return t}static ParseProperties(e,t,i,s){s||(s="");const n=rm(t);for(const o in n){const c=n[o],h=e[c.sourceName||o],f=c.type;if(h!=null&&(o!=="uniqueId"||xt.AllowLoadingUniqueId)){const _=t;switch(f){case 0:_[o]=h;break;case 1:i&&(_[o]=xt._TextureParser(h,i,s));break;case 2:_[o]=rt.FromArray(h);break;case 3:_[o]=xt._FresnelParametersParser(h);break;case 4:_[o]=Fe.FromArray(h);break;case 5:_[o]=D.FromArray(h);break;case 6:i&&(_[o]=i.getLastMeshById(h));break;case 7:_[o]=xt._ColorCurvesParser(h);break;case 8:_[o]=_t.FromArray(h);break;case 9:_[o]=xt._ImageProcessingConfigurationParser(h);break;case 10:_[o]=Be.FromArray(h);break;case 11:i&&(_[o]=i.getCameraById(h));break;case 12:_[o]=se.FromArray(h);break;case 13:_[o]=at.FromArray(h);break}}}}static Parse(e,t,i,s=null){const n=e();return Rt&&Rt.AddTagsTo(n,t.tags),xt.ParseProperties(t,n,i,s),n}static Clone(e,t,i={}){return Fb(e,t,!1,i)}static Instanciate(e,t){return Fb(e,t,!0)}}xt.AllowLoadingUniqueId=!1;xt._ImageProcessingConfigurationParser=a=>{throw Je("ImageProcessingConfiguration")};xt._FresnelParametersParser=a=>{throw Je("FresnelParameters")};xt._ColorCurvesParser=a=>{throw Je("ColorCurves")};xt._TextureParser=(a,e,t)=>{throw Je("Texture")};var Bb;let df=(()=>{var a;let e=Sm,t=[],i,s=[],n=[],o,c=[],h=[],f,_=[],m=[],g,x=[],y=[],b,v=[],E=[],R,C=[],O=[],M,I=[],P=[],L,V=[],X=[],re,ae=[],de=[],U,te=[],Y=[],Z,q,j,Q=[],w=[],B,z=[],K=[],ue,he,ve,Le,ke,J=[],_e=[],xe,Ne=[],Qe=[],He,dt,li,zt,Ot,jt=[],Nt=[];return a=class extends e{set hasAlpha(ne){this._hasAlpha!==ne&&(this._hasAlpha=ne,this._scene&&this._scene.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get hasAlpha(){return this._hasAlpha}set getAlphaFromRGB(ne){this._getAlphaFromRGB!==ne&&(this._getAlphaFromRGB=ne,this._scene&&this._scene.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get getAlphaFromRGB(){return this._getAlphaFromRGB}set coordinatesIndex(ne){this._coordinatesIndex!==ne&&(this._coordinatesIndex=ne,this._scene&&this._scene.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get coordinatesIndex(){return this._coordinatesIndex}set coordinatesMode(ne){this._coordinatesMode!==ne&&(this._coordinatesMode=ne,this._scene&&this._scene.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get coordinatesMode(){return this._coordinatesMode}get wrapU(){return this._wrapU}set wrapU(ne){this._wrapU=ne}get wrapV(){return this._wrapV}set wrapV(ne){this._wrapV=ne}get isCube(){return this._texture?this._texture.isCube:this._isCube}set isCube(ne){this._texture?this._texture.isCube=ne:this._isCube=ne}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(ne){this._texture&&(this._texture.is3D=ne)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(ne){this._texture&&(this._texture.is2DArray=ne)}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(ne){if(this._texture){if(this._texture._gammaSpace===ne)return;this._texture._gammaSpace=ne}else{if(this._gammaSpace===ne)return;this._gammaSpace=ne}this.getScene()?.markAllMaterialsAsDirty(1,we=>we.hasTexture(this))}get isRGBD(){return this._texture!=null&&this._texture._isRGBD}set isRGBD(ne){ne!==this.isRGBD&&(this._texture&&(this._texture._isRGBD=ne),this.getScene()?.markAllMaterialsAsDirty(1,we=>we.hasTexture(this)))}get noMipmap(){return!1}get lodGenerationOffset(){return this._texture?this._texture._lodGenerationOffset:0}set lodGenerationOffset(ne){this._texture&&(this._texture._lodGenerationOffset=ne)}get lodGenerationScale(){return this._texture?this._texture._lodGenerationScale:0}set lodGenerationScale(ne){this._texture&&(this._texture._lodGenerationScale=ne)}get linearSpecularLOD(){return this._texture?this._texture._linearSpecularLOD:!1}set linearSpecularLOD(ne){this._texture&&(this._texture._linearSpecularLOD=ne)}get irradianceTexture(){return this._texture?this._texture._irradianceTexture:null}set irradianceTexture(ne){this._texture&&(this._texture._irradianceTexture=ne)}get uid(){return this._uid||(this._uid=vv()),this._uid}toString(){return this.name}getClassName(){return"BaseTexture"}set onDispose(ne){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(ne)}get isBlocking(){return!0}get loadingError(){return this._loadingError}get errorObject(){return this._errorObject}constructor(ne,we=null){super(null),this.uniqueId=(N(this,t),N(this,s,void 0)),this.name=(N(this,n),N(this,c,void 0)),this.displayName=(N(this,h),N(this,_,void 0)),this.metadata=(N(this,m),N(this,x,null)),this._internalMetadata=N(this,y),this.reservedDataStore=null,this._hasAlpha=N(this,v,!1),this._getAlphaFromRGB=(N(this,E),N(this,C,!1)),this.level=(N(this,O),N(this,I,1)),this._coordinatesIndex=(N(this,P),N(this,V,0)),this.optimizeUVAllocation=(N(this,X),N(this,ae,!0)),this._coordinatesMode=(N(this,de),N(this,te,0)),this.wrapR=(N(this,Y),N(this,Q,1)),this.anisotropicFilteringLevel=(N(this,w),N(this,z,a.DEFAULT_ANISOTROPIC_FILTERING_LEVEL)),this._isCube=(N(this,K),!1),this._gammaSpace=!0,this.invertZ=N(this,J,!1),this.lodLevelInAlpha=(N(this,_e),N(this,Ne,!1)),this._dominantDirection=(N(this,Qe),null),this.isRenderTarget=N(this,jt,!1),this._prefiltered=(N(this,Nt),!1),this._forceSerialize=!1,this.animations=[],this.onDisposeObservable=new Me,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,ne?a._IsScene(ne)?this._scene=ne:this._engine=ne:this._scene=mt.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 se.IdentityReadOnly}getReflectionTextureMatrix(){return se.IdentityReadOnly}getRefractionTextureMatrix(){return this.getReflectionTextureMatrix()}isReadyOrNotBlocking(){return!this.isBlocking||this.isReady()||this.loadingError}scale(ne){}get canRescale(){return!1}_getFromCache(ne,we,ti,ci,hi,ii){const ui=this._getEngine();if(!ui)return null;const Gt=ui._getUseSRGBBuffer(!!hi,we),fi=ui.getLoadedTexturesCache();for(let qt=0;qt<fi.length;qt++){const Wt=fi[qt];if((hi===void 0||Gt===Wt._useSRGBBuffer)&&(ci===void 0||ci===Wt.invertY)&&Wt.url===ne&&Wt.generateMipMaps===!we&&(!ti||ti===Wt.samplingMode)&&(ii===void 0||ii===Wt.isCube))return Wt.incrementReferences(),Wt}return null}_rebuild(ne=!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 ne=this.getScene();ne&&ne.markAllMaterialsAsDirty(1)}readPixels(ne=0,we=0,ti=null,ci=!0,hi=!1,ii=0,ui=0,Gt=Number.MAX_VALUE,fi=Number.MAX_VALUE){if(!this._texture)return null;const qt=this._getEngine();if(!qt)return null;const Wt=this.getSize();let si=Wt.width,Si=Wt.height;we!==0&&(si=si/Math.pow(2,we),Si=Si/Math.pow(2,we),si=Math.round(si),Si=Math.round(Si)),Gt=Math.min(si,Gt),fi=Math.min(Si,fi);try{return this._texture.isCube||this._texture.is2DArray?qt._readTexturePixels(this._texture,Gt,fi,ne,we,ti,ci,hi,ii,ui):qt._readTexturePixels(this._texture,Gt,fi,-1,we,ti,ci,hi,ii,ui)}catch{return null}}_readPixelsSync(ne=0,we=0,ti=null,ci=!0,hi=!1){if(!this._texture)return null;const ii=this.getSize();let ui=ii.width,Gt=ii.height;const fi=this._getEngine();if(!fi)return null;we!=0&&(ui=ui/Math.pow(2,we),Gt=Gt/Math.pow(2,we),ui=Math.round(ui),Gt=Math.round(Gt));try{return this._texture.isCube?fi._readTexturePixelsSync(this._texture,ui,Gt,ne,we,ti,ci,hi):fi._readTexturePixelsSync(this._texture,ui,Gt,-1,we,ti,ci,hi)}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 ne=this._scene.textures.indexOf(this);if(ne>=0&&this._scene.textures.splice(ne,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(ne=!1){if(!this.name&&!ne)return null;const we=xt.Serialize(this);return xt.AppendSerializedAnimations(this,we),we}static WhenAllReady(ne,we){let ti=ne.length;if(ti===0){we();return}for(let ci=0;ci<ne.length;ci++){const hi=ne[ci];if(hi.isReady())--ti===0&&we();else{const ii=hi.onLoadObservable;ii?ii.addOnce(()=>{--ti===0&&we()}):--ti===0&&we()}}}static _IsScene(ne){return ne.getClassName()==="Scene"}},(()=>{const ut=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;
vendor: 4,429 bytes, line 292
292i=[ce()],o=[ce()],f=[ce()],g=[ce()],b=[ce("hasAlpha")],R=[ce("getAlphaFromRGB")],M=[ce()],L=[ce("coordinatesIndex")],re=[ce()],U=[ce("coordinatesMode")],Z=[ce()],q=[ce()],j=[ce()],B=[ce()],ue=[ce()],he=[ce()],ve=[ce()],Le=[ce()],ke=[ce()],xe=[ce()],He=[ce()],dt=[ce()],li=[ce()],zt=[or()],Ot=[ce()],ee(a,null,Z,{kind:"getter",name:"wrapU",static:!1,private:!1,access:{has:ne=>"wrapU"in ne,get:ne=>ne.wrapU},metadata:ut},null,t),ee(a,null,q,{kind:"getter",name:"wrapV",static:!1,private:!1,access:{has:ne=>"wrapV"in ne,get:ne=>ne.wrapV},metadata:ut},null,t),ee(a,null,ue,{kind:"getter",name:"isCube",static:!1,private:!1,access:{has:ne=>"isCube"in ne,get:ne=>ne.isCube},metadata:ut},null,t),ee(a,null,he,{kind:"getter",name:"is3D",static:!1,private:!1,access:{has:ne=>"is3D"in ne,get:ne=>ne.is3D},metadata:ut},null,t),ee(a,null,ve,{kind:"getter",name:"is2DArray",static:!1,private:!1,access:{has:ne=>"is2DArray"in ne,get:ne=>ne.is2DArray},metadata:ut},null,t),ee(a,null,Le,{kind:"getter",name:"gammaSpace",static:!1,private:!1,access:{has:ne=>"gammaSpace"in ne,get:ne=>ne.gammaSpace},metadata:ut},null,t),ee(a,null,He,{kind:"getter",name:"lodGenerationOffset",static:!1,private:!1,access:{has:ne=>"lodGenerationOffset"in ne,get:ne=>ne.lodGenerationOffset},metadata:ut},null,t),ee(a,null,dt,{kind:"getter",name:"lodGenerationScale",static:!1,private:!1,access:{has:ne=>"lodGenerationScale"in ne,get:ne=>ne.lodGenerationScale},metadata:ut},null,t),ee(a,null,li,{kind:"getter",name:"linearSpecularLOD",static:!1,private:!1,access:{has:ne=>"linearSpecularLOD"in ne,get:ne=>ne.linearSpecularLOD},metadata:ut},null,t),ee(a,null,zt,{kind:"getter",name:"irradianceTexture",static:!1,private:!1,access:{has:ne=>"irradianceTexture"in ne,get:ne=>ne.irradianceTexture},metadata:ut},null,t),ee(null,null,i,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:ne=>"uniqueId"in ne,get:ne=>ne.uniqueId,set:(ne,we)=>{ne.uniqueId=we}},metadata:ut},s,n),ee(null,null,o,{kind:"field",name:"name",static:!1,private:!1,access:{has:ne=>"name"in ne,get:ne=>ne.name,set:(ne,we)=>{ne.name=we}},metadata:ut},c,h),ee(null,null,f,{kind:"field",name:"displayName",static:!1,private:!1,access:{has:ne=>"displayName"in ne,get:ne=>ne.displayName,set:(ne,we)=>{ne.displayName=we}},metadata:ut},_,m),ee(null,null,g,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:ne=>"metadata"in ne,get:ne=>ne.metadata,set:(ne,we)=>{ne.metadata=we}},metadata:ut},x,y),ee(null,null,b,{kind:"field",name:"_hasAlpha",static:!1,private:!1,access:{has:ne=>"_hasAlpha"in ne,get:ne=>ne._hasAlpha,set:(ne,we)=>{ne._hasAlpha=we}},metadata:ut},v,E),ee(null,null,R,{kind:"field",name:"_getAlphaFromRGB",static:!1,private:!1,access:{has:ne=>"_getAlphaFromRGB"in ne,get:ne=>ne._getAlphaFromRGB,set:(ne,we)=>{ne._getAlphaFromRGB=we}},metadata:ut},C,O),ee(null,null,M,{kind:"field",name:"level",static:!1,private:!1,access:{has:ne=>"level"in ne,get:ne=>ne.level,set:(ne,we)=>{ne.level=we}},metadata:ut},I,P),ee(null,null,L,{kind:"field",name:"_coordinatesIndex",static:!1,private:!1,access:{has:ne=>"_coordinatesIndex"in ne,get:ne=>ne._coordinatesIndex,set:(ne,we)=>{ne._coordinatesIndex=we}},metadata:ut},V,X),ee(null,null,re,{kind:"field",name:"optimizeUVAllocation",static:!1,private:!1,access:{has:ne=>"optimizeUVAllocation"in ne,get:ne=>ne.optimizeUVAllocation,set:(ne,we)=>{ne.optimizeUVAllocation=we}},metadata:ut},ae,de),ee(null,null,U,{kind:"field",name:"_coordinatesMode",static:!1,private:!1,access:{has:ne=>"_coordinatesMode"in ne,get:ne=>ne._coordinatesMode,set:(ne,we)=>{ne._coordinatesMode=we}},metadata:ut},te,Y),ee(null,null,j,{kind:"field",name:"wrapR",static:!1,private:!1,access:{has:ne=>"wrapR"in ne,get:ne=>ne.wrapR,set:(ne,we)=>{ne.wrapR=we}},metadata:ut},Q,w),ee(null,null,B,{kind:"field",name:"anisotropicFilteringLevel",static:!1,private:!1,access:{has:ne=>"anisotropicFilteringLevel"in ne,get:ne=>ne.anisotropicFilteringLevel,set:(ne,we)=>{ne.anisotropicFilteringLevel=we}},metadata:ut},z,K),ee(null,null,ke,{kind:"field",name:"invertZ",static:!1,private:!1,access:{has:ne=>"invertZ"in ne,get:ne=>ne.invertZ,set:(ne,we)=>{ne.invertZ=we}},metadata:ut},J,_e),ee(null,null,xe,{kind:"field",name:"lodLevelInAlpha",static:!1,private:!1,access:{has:ne=>"lodLevelInAlpha"in ne,get:ne=>ne.lodLevelInAlpha,set:(ne,we)=>{ne.lodLevelInAlpha=we}},metadata:ut},Ne,Qe),ee(null,null,Ot,{kind:"field",name:"isRenderTarget",static:!1,private:!1,access:{has:ne=>
292"isRenderTarget"in ne,get:ne=>ne.isRenderTarget,set:(ne,we)=>{ne.isRenderTarget=we}},metadata:ut},jt,Nt),ut&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ut})})(),a.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,a})();(Bb=df.prototype).forceSphericalPolynomialsRecompute??(Bb.forceSphericalPolynomialsRecompute=Xe("BaseTexture","forceSphericalPolynomialsRecompute"));Object.getOwnPropertyDescriptor(df.prototype,"sphericalPolynomial")||Object.defineProperty(df.prototype,"sphericalPolynomial",gt("BaseTexture","sphericalPolynomial"));let Lb=!1;function UM(){Lb||(Lb=!0,ot.prototype.createPrefilteredCubeTexture=function(a,e,t,i,s=null,n=null,o,c=null,h=!0){const f=async _=>{if(!_){s&&s(null);return}const m=_.texture;if(h?_.info.sphericalPolynomial&&(m._sphericalPolynomial=_.info.sphericalPolynomial):m._sphericalPolynomial=m._sphericalPolynomial??new ff,m._source=9,this.getCaps().textureLOD){s&&s(m);return}const g=3,x=this._gl,y=_.width;if(!y)return;const{DDSTools:b}=await Wi(async()=>{const{DDSTools:E}=await import("./dds.pure-CymLrjyl.js");return{DDSTools:E}},__vite__mapDeps([0,1])),v=[];for(let E=0;E<g;E++){const C=1-E/(g-1),O=i,M=Math.log2(y)*t+i,I=O+(M-O)*C,P=Math.round(Math.min(Math.max(I,0),M)),L=new Es(this,2);if(L.type=m.type,L.format=m.format,L.width=Math.pow(2,Math.max(Math.log2(y)-P,0)),L.height=L.width,L.isCube=!0,L._cachedWrapU=0,L._cachedWrapV=0,this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,L,!0),L.samplingMode=2,x.texParameteri(x.TEXTURE_CUBE_MAP,x.TEXTURE_MAG_FILTER,x.LINEAR),x.texParameteri(x.TEXTURE_CUBE_MAP,x.TEXTURE_MIN_FILTER,x.LINEAR),x.texParameteri(x.TEXTURE_CUBE_MAP,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_CUBE_MAP,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),_.isDDS){const X=_.info,re=_.data;this._unpackFlipY(X.isCompressed),b.UploadDDSLevels(this,L,re,X,!0,6,P)}else pe.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,null);const V=new df(e);V._isCube=!0,V._texture=L,L.isReady=!0,v.push(V)}m._lodTextureHigh=v[2],m._lodTextureMid=v[1],m._lodTextureLow=v[0],s&&s(m)};return this.createCubeTexture(a,e,null,!1,f,n,o,c,h,t,i)})}UM();let kb=!1;function zM(){kb||(kb=!0,ot.prototype.createUniformBuffer=function(a,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");const i=new Bc(t);return this.bindUniformBuffer(i),a instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,a,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(a),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},ot.prototype.createDynamicUniformBuffer=function(a,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");const i=new Bc(t);return this.bindUniformBuffer(i),a instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,a,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(a),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},ot.prototype.updateUniformBuffer=function(a,e,t,i){this.bindUniformBuffer(a),t===void 0&&(t=0),i===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+i)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(e).subarray(t,t+i)),this.bindUniformBuffer(null)},ot.prototype.bindUniformBuffer=function(a){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,a?a.underlyingResource:null)},ot.prototype.bindUniformBufferBase=function(a,e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,e,a?a.underlyingResource:null)},ot.prototype.bindUniformBlock=function(a,e,t){const i=a.program,s=this._gl.getUniformBlockIndex(i,e);s!==4294967295&&this._gl.uniformBlockBinding(i,s,t)})}zM();let Nb=!1;function GM(){Nb||(Nb=!0,Ie.prototype.displayLoadingUI=function(){if(!Xi())return;const a=this.loadingScreen;a&&a.displayLoadingUI()},Ie.prototype.hideLoadingUI=function(){if(!Xi())return;const a=this._loadingScreen;a&&a.hideLoadingUI()},Object.defineProperty(Ie.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=Ie.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(a){this._loadingScreen=a},enumerable:!0,configurable:!0}),Object.defineProperty(Ie.prototype,"loadingUIText",{set:function(a){this.loadingScreen.loadingUIText=a},enumerable:!0,configurable:!0}
292),Object.defineProperty(Ie.prototype,"loadingUIBackgroundColor",{set:function(a){this.loadingScreen.loadingUIBackgroundColor=a},enumerable:!0,configurable:!0}))}GM();fv();let Ub=!1;function VM(){Ub||(Ub=!0,Ie.prototype.getInputElement=function(){return this._renderingCanvas},Ie.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},Ie.prototype.setDepthFunction=function(a){this._depthCullingState.depthFunc=a},Ie.prototype.setDepthFunctionToGreater=function(){this.setDepthFunction(516)},Ie.prototype.setDepthFunctionToGreaterOrEqual=function(){this.setDepthFunction(518)},Ie.prototype.setDepthFunctionToLess=function(){this.setDepthFunction(513)},Ie.prototype.setDepthFunctionToLessOrEqual=function(){this.setDepthFunction(515)},Ie.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},Ie.prototype.setDepthWrite=function(a){this._depthCullingState.depthMask=a},Ie.prototype.setAlphaConstants=function(a,e,t,i){this._alphaState.setAlphaBlendConstants(a,e,t,i)},Ie.prototype.getAlphaMode=function(a=0){return this._alphaMode[a]},Ie.prototype.getAlphaEquation=function(a=0){return this._alphaEquation[a]})}VM();let zb=!1;function HM(){zb||(zb=!0,Ie.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},Ie.prototype.setStencilBuffer=function(a){this._stencilState.stencilTest=a},Ie.prototype.getStencilMask=function(){return this._stencilState.stencilMask},Ie.prototype.setStencilMask=function(a){this._stencilState.stencilMask=a},Ie.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},Ie.prototype.getStencilBackFunction=function(){return this._stencilState.stencilBackFunc},Ie.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},Ie.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},Ie.prototype.setStencilFunction=function(a){this._stencilState.stencilFunc=a},Ie.prototype.setStencilBackFunction=function(a){this._stencilState.stencilBackFunc=a},Ie.prototype.setStencilFunctionReference=function(a){this._stencilState.stencilFuncRef=a},Ie.prototype.setStencilFunctionMask=function(a){this._stencilState.stencilFuncMask=a},Ie.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},Ie.prototype.getStencilBackOperationFail=function(){return this._stencilState.stencilBackOpStencilFail},Ie.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},Ie.prototype.getStencilBackOperationDepthFail=function(){return this._stencilState.stencilBackOpDepthFail},Ie.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},Ie.prototype.getStencilBackOperationPass=function(){return this._stencilState.stencilBackOpStencilDepthPass},Ie.prototype.setStencilOperationFail=function(a){this._stencilState.stencilOpStencilFail=a},Ie.prototype.setStencilBackOperationFail=function(a){this._stencilState.stencilBackOpStencilFail=a},Ie.prototype.setStencilOperationDepthFail=function(a){this._stencilState.stencilOpDepthFail=a},Ie.prototype.setStencilBackOperationDepthFail=function(a){this._stencilState.stencilBackOpDepthFail=a},Ie.prototype.setStencilOperationPass=function(a){this._stencilState.stencilOpStencilDepthPass=a},Ie.prototype.setStencilBackOperationPass=function(a){this._stencilState.stencilBackOpStencilDepthPass=a},Ie.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()},Ie.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)})}HM();Em();let Gb=!1;function jM(){Gb||(Gb=!0,Ie.prototype.createDepthStencilTexture=function(a,e,t){if(e.isCube){const i=a.width||a;return this._createDepthStencilCubeTexture(i,e)}else return this._createDepthStencilTexture(a,e,t)})}jM();function WM(){return typeof _native<"u"&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}class Pi{constructor(){this._xhr=WM(),this._requestURL=""}static get IsCustomRequestAvailable(){return Object.keys(Pi.CustomRequestHeaders).length>0||Pi.CustomRequestModifiers.length>0}static _CleanUrl(e){return e=e.replace("file:http:","http:"),e=e.replace("file:https:","https:"),e}static _ShouldSkipRequestModifications(e){return Pi.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}static _CollectCustomizations(e,t={}){const i={...t};if(Pi._ShouldSkipRequestModifications(e))return{url:e,headers:i};for(const n in Pi.CustomRequestHeaders){const o=Pi.CustomRequestHeaders[n];o&&(i[n]=o)}const s={setRequestHeader:(n,o)=>{i[n]=o}};for(const n of Pi.CustomRequestModifiers){if(Pi._ShouldSkipRequestModifications(e))break;const o=n(s,e);
292typeof o=="string"&&(e=o)}return{url:e,headers:i}}static async FetchAsync(e,t={}){const i=t.method??"GET";if(typeof fetch<"u"){const{url:s,headers:n}=Pi._CollectCustomizations(Pi._CleanUrl(e),t.headers??{});return await fetch(s,{method:i,headers:n,body:t.body??void 0})}return await new Promise((s,n)=>{const o=new Pi;o.responseType="arraybuffer",o.addEventListener("readystatechange",()=>{if(o.readyState===4)if(o.status>=200&&o.status<300){const c=typeof Headers<"u"?new Headers:void 0,h=o.getResponseHeader("Content-Type");h&&c&&c.set("Content-Type",h),s(typeof Response<"u"?new Response(o.response,{status:o.status,statusText:o.statusText,headers:c}):{ok:!0,status:o.status,statusText:o.statusText,headers:{get:f=>o.getResponseHeader(f)},arrayBuffer:async()=>await Promise.resolve(o.response)})}else n(new Error(`HTTP ${o.status} loading '${o.requestURL}': ${o.statusText}`))}),o.open(i,e,t.headers),o.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,i){this._xhr.addEventListener(e,t,i)}removeEventListener(e,t,i){this._xhr.removeEventListener(e,t,i)}abort(){this._xhr.abort()}send(e){this._xhr.send(e)}open(e,t,i){const{url:s,headers:n}=Pi._CollectCustomizations(t,i);this._requestURL=Pi._CleanUrl(s),this._xhr.open(e,this._requestURL,!0);for(const o in n)this._xhr.setRequestHeader(o,n[o])}setRequestHeader(e,t){this._xhr.setRequestHeader(e,t)}getResponseHeader(e){return this._xhr.getResponseHeader(e)}}Pi.CustomRequestHeaders={};Pi.CustomRequestModifiers=new Array;Pi.SkipRequestModificationForBabylonCDN=!0;class wc{}wc.FilesToLoad={};class XM{static ExponentialBackoff(e=3,t=500){return(i,s,n)=>s.status!==0||n>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,n)*t}}
292class Jo extends Error{}Jo._setPrototypeOf=Object.setPrototypeOf||((a,e)=>(a.__proto__=e,a));const If={MeshInvalidPositionsError:0,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class al extends Jo{constructor(e,t,i){super(e),this.errorCode=t,this.innerError=i,this.name="RuntimeError",Jo._setPrototypeOf(this,al.prototype)}}function YM(a){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",i,s,n,o,c,h,f,_=0;for(;_<a.length;)i=a[_++],s=_<a.length?a[_++]:Number.NaN,n=_<a.length?a[_++]:Number.NaN,o=i>>2,c=(i&3)<<4|s>>4,h=(s&15)<<2|n>>6,f=n&63,isNaN(s)?h=f=64:isNaN(n)&&(f=64),t+=e.charAt(o)+e.charAt(c)+e.charAt(h)+e.charAt(f);return t}function qM(a){const e=Ev(a),t=e.length,i=new Uint8Array(new ArrayBuffer(t));for(let s=0;s<t;s++)i[s]=e.charCodeAt(s);return i.buffer}const KM=a=>{const e=ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a);return typeof e.toBase64=="function"?e.toBase64():YM(e)},Ev=a=>atob(a),ZM=a=>typeof Uint8Array.fromBase64=="function"?Uint8Array.fromBase64(a).buffer:qM(a);let Ku=null;function Av(){if(Ku)return Ku;const a=new ArrayBuffer(4),e=new Float32Array(a),t=new Uint32Array(a),i=new Uint32Array(512),s=new Uint32Array(512);for(let h=0;h<256;++h){const f=h-127;f<-24?(i[h]=0,i[h|256]=32768,s[h]=24,s[h|256]=24):f<-14?(i[h]=1024>>-f-14,i[h|256]=1024>>-f-14|32768,s[h]=-f-1,s[h|256]=-f-1):f<=15?(i[h]=f+15<<10,i[h|256]=f+15<<10|32768,s[h]=13,s[h|256]=13):f<128?(i[h]=31744,i[h|256]=64512,s[h]=24,s[h|256]=24):(i[h]=31744,i[h|256]=64512,s[h]=13,s[h|256]=13)}const n=new Uint32Array(2048),o=new Uint32Array(64),c=new Uint32Array(64);for(let h=1;h<1024;++h){let f=h<<13,_=0;for(;(f&8388608)===0;)f<<=1,_-=8388608;f&=-8388609,_+=947912704,n[h]=f|_}for(let h=1024;h<2048;++h)n[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(c[h]=1024);return Ku={floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:n,exponentTable:o,offsetTable:c},Ku}const GP=65504;function QM(a){const e=Av();e.floatView[0]=a;const t=e.uint32View[0],i=t>>23&511;return e.baseTable[i]+((t&8388607)>>e.shiftTable[i])}function is(a){const e=Av();return e.uint32View[0]=e.mantissaTable[e.offsetTable[a>>10]+(a&1023)]+e.exponentTable[a>>10],e.floatView[0]}function $M(a,e,t,i){switch(e){case 5120:{let s=a.getInt8(t);return i&&(s=Math.max(s/127,-1)),s}case 5121:{let s=a.getUint8(t);return i&&(s=s/255),s}case 5122:{let s=a.getInt16(t,!0);return i&&(s=Math.max(s/32767,-1)),s}case 5123:{let s=a.getUint16(t,!0);return i&&(s=s/65535),s}case 5131:return is(a.getUint16(t,!0));case 5124:return a.getInt32(t,!0);case 5125:return a.getUint32(t,!0);case 5126:return a.getFloat32(t,!0);default:throw new Error(`Invalid component type ${e}`)}}function JM(a,e,t,i,s){switch(e){case 5120:{i&&(s=Math.round(s*127)),a.setInt8(t,s);break}case 5121:{i&&(s=Math.round(s*255)),a.setUint8(t,s);break}case 5122:{i&&(s=Math.round(s*32767)),a.setInt16(t,s,!0);break}case 5123:{i&&(s=Math.round(s*65535)),a.setUint16(t,s,!0);break}case 5131:{a.setUint16(t,QM(s),!0);break}case 5124:{a.setInt32(t,s,!0);break}case 5125:{a.setUint32(t,s,!0);break}case 5126:{a.setFloat32(t,s,!0);break}default:throw new Error(`Invalid component type ${e}`)}}function ca(a){switch(a){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 '${a}'`)}}function eC(a){switch(a){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5131:return Uint16Array;case 5124:return Int32Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(`Invalid component type '${a}'`)}}function Pf(a,e,t,i,s,n,o,c){const h=new Array(i),f=new Array(i);if(a instanceof Array){let _=e/4;const m=t/4;for(let g=0;g<n;g+=i){for(let x=0;x<i;x++)h[x]=f[x]=a[_+x];c(f,g);for(let x=0;x<i;x++)h[x]!==f[x]&&(a[_+x]=f[x]);_+=m}}else{const _=ArrayBuffer.isView(a)?new DataView(a.buffer,a.byteOffset,a.byteLength):new DataView(a),m=ca(s);for(let g=0;g<n;g+=i){for(let x=0,y=e;x<i;x++,y+=m)h[x]=f[x]=$M(_,s,y,o);c(f,g);for(let x=0,y=e;x<i;x++,y+=m)h[x]!==f[x]&&JM(_,s,y,o,f[x]);e+=t}}}function tC(a,e,t,i,s,n,o,c){const h=e*ca(t),f=o*e;if(t!==5126||s!==h){const _=new Float32Array(f);return Pf(a,i,s,e,t,f,n,(m,g)=>{for(let x=0;x<e;x++)_[g+x]=m[x]}),_}if(!(a instanceof Array||a instanceof Float32Array)||i!==0||a.length!==f)if(a instanceof Array){const _=i/4;return a.slice(_,_+f)}else if(ArrayBuffer.isView(a)){const _=a.byteOffset+i;return(_&3)!==0&&(pe.Warn("Float array must be aligned to 4-bytes border"),c=!0),c?new Float32Array(a.buffer.slice(_,_+f*Float32Array.BYTES_PER_ELEMENT)):new Float32Array(a.buffer,_,f)}else return new Float32Array(a,i,f);return c?a.slice():a}function iC(a,e,t,i,s,n,o){const c=ca(t),h=eC(t),f=n*e;if(Array.isArray(a)){if((i&3)!==0||(s&3)!==0)throw new Error("byteOffset and byteStride must be a multiple of 4 for number[] data.");const y=i/4,b=s/4;if(y+(n-1)*b+e>a.length)throw new Error("Last accessed index is out of bounds.");
292if(b<e)throw new Error("Data stride cannot be smaller than the component size.");if(b!==e){const E=new h(f);return Pf(a,i,s,e,t,f,!1,(R,C)=>{for(let O=0;O<e;O++)E[C+O]=R[O]}),E}return new h(a.slice(y,y+f))}let _,m=i;if(ArrayBuffer.isView(a)?(_=a.buffer,m+=a.byteOffset):_=a,m+(n-1)*s+e*c>_.byteLength)throw new Error("Last accessed byte is out of bounds.");const x=e*c;if(s<x)throw new Error("Byte stride cannot be smaller than the component's byte size.");if(s!==x){const y=new h(f),b=new Uint8Array(_,m),v=new Uint8Array(y.buffer),E=e*c;for(let R=0,C=0,O=0;R<n;R++,C+=s,O+=E)v.set(b.subarray(C,C+E),O);return y}return c!==1&&(m&c-1)!==0&&(pe.Warn("Array must be aligned to border of element size. Data will be copied."),o=!0),o?new h(_.slice(m,m+f*c)):new h(_,m,f)}function sC(a,e,t,i,s,n,o,c){const h=e*ca(t),f=o*e;if(c.length!==f)throw new Error("Output length is not valid");if(t!==5126||s!==h){Pf(a,i,s,e,t,f,n,(_,m)=>{for(let g=0;g<e;g++)c[m+g]=_[g]});return}if(a instanceof Array){const _=i/4;c.set(a,_)}else if(ArrayBuffer.isView(a)){const _=a.byteOffset+i;if((_&3)!==0){pe.Warn("Float array must be aligned to 4-bytes border"),c.set(new Float32Array(a.buffer.slice(_,_+f*Float32Array.BYTES_PER_ELEMENT)));return}const m=new Float32Array(a.buffer,_,f);c.set(m)}else{const _=new Float32Array(a,i,f);c.set(_)}}function rC(a){const e=a.buffer;if(e instanceof ArrayBuffer)return a;const t=new ArrayBuffer(a.byteLength);return new Uint8Array(t).set(new Uint8Array(e,a.byteOffset,a.byteLength)),t}const Rv=new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);class _f extends al{constructor(e,t){super(e,If.LoadFileError),this.name="LoadFileError",Jo._setPrototypeOf(this,_f.prototype),t instanceof Pi?this.request=t:this.file=t}}class mf extends al{constructor(e,t){super(e,If.RequestFileError),this.request=t,this.name="RequestFileError",Jo._setPrototypeOf(this,mf.prototype)}}class Mm extends al{constructor(e,t){super(e,If.ReadFileError),this.file=t,this.name="ReadFileError",Jo._setPrototypeOf(this,Mm.prototype)}}const nC=a=>(a=a.replace(/#/gm,"%23"),a),mi={DefaultRetryStrategy:XM.ExponentialBackoff(),BaseUrl:"",CorsBehavior:"anonymous",PreprocessUrl:a=>a,ScriptBaseUrl:"",ScriptPreprocessUrl:a=>a,CleanUrl:nC},Cm=(a,e)=>{if(!(a&&a.indexOf("data:")===0)&&mi.CorsBehavior)if(typeof mi.CorsBehavior=="string"||mi.CorsBehavior instanceof String)e.crossOrigin=mi.CorsBehavior;else{const t=mi.CorsBehavior(a);t&&(e.crossOrigin=t)}},gf=(a,e,t,i,s="",n,o=mt.LastCreatedEngine)=>{if(typeof HTMLImageElement>"u"&&!o?._features.forceBitmapOverHTMLImageElement)return t("LoadImage is only supported in web or BabylonNative environments."),null;let c,h=!1;if(a instanceof ArrayBuffer||ArrayBuffer.isView(a))if(typeof Blob<"u"&&typeof URL<"u"){let M;a instanceof ArrayBuffer?M=a:M=rC(a),c=URL.createObjectURL(new Blob([M],{type:s})),h=!0}else c=`data:${s};base64,`+KM(a);else a instanceof Blob?(c=URL.createObjectURL(a),h=!0):(c=mi.CleanUrl(a),c=mi.PreprocessUrl(c));const f=M=>{if(t){const I=c||a.toString();t(`Error while trying to load image: ${I.indexOf("http")===0||I.length<=128?I:I.slice(0,128)+"..."}`,M)}};if(o?._features.forceBitmapOverHTMLImageElement)return fa(c,M=>{o.createImageBitmap(new Blob([M],{type:s}),{premultiplyAlpha:"none",colorSpaceConversion:"none",...n}).then(I=>{e(I),h&&URL.revokeObjectURL(c)}).catch(I=>{t&&t("Error while trying to load image: "+a,I)})},void 0,i||void 0,!0,(M,I)=>{f(I)}),null;const _=new Image;Cm(c,_);const m=[],g=()=>{for(const M of m)M.target.addEventListener(M.name,M.handler)},x=()=>{for(const M of m)M.target.removeEventListener(M.name,M.handler);m.length=0},y=()=>{x(),e(_),h&&_.src&&URL.revokeObjectURL(_.src)},b=M=>{x(),f(M),h&&_.src&&URL.revokeObjectURL(_.src)},v=M=>{if(M.blockedURI!==_.src||M.disposition==="report")return;x();const I=new Error(`CSP violation of policy ${M.effectiveDirective} ${M.blockedURI}. Current policy is ${M.originalPolicy}`);mt.UseFallbackTexture=!1,f(I),h&&_.src&&URL.revokeObjectURL(_.src),_.src=""};m.push({target:_,name:"load",handler:y}),m.push({target:_,name:"error",handler:b}),m.push({target:document,name:"securitypolicyviolation",handler:v}),g();const E=c.substring(0,5)==="blob:",R=c.substring(0,5)==="data:",C=()=>{E||R||!Pi.IsCustomRequestAvailable?_.src=c:fa(c,(M,I,P)=>{const L=!s&&P?P:s,V=new Blob([M],{type:L}),X=URL.createObjectURL(V);h=!0,_.src=X},void 0,i||void 0,!0,(M,I)=>{f(I)})},O=()=>{i&&i.loadImage(c,_)};if(!E&&!R&&i&&i.enableTexturesOffline)i.open(O,C);else{if(c.indexOf("file:")!==-1){const M=decodeURIComponent(c.substring(5).toLowerCase());if(wc.FilesToLoad[M]&&typeof URL<"u"){try{let I;try{I=URL.createObjectURL(wc.FilesToLoad[M])}catch{I=URL.createObjectURL(wc.FilesToLoad[M])}_.src=I,h=!0}catch{_.src=""}return _}}C()}return _},Uc=(a,e,t,i,s)=>{const n=new FileReader,o={onCompleteObservable:new Me,abort:()=>n.abort()};return n.onloadend=()=>o.onCompleteObservable.notifyObservers(o),s&&(n.onerror=()=>{s(new Mm(`Unable to read ${a.name}`,a))}),n.onload=c=>{e(c.target.result)},t&&(n.onprogress=t),i?n.readAsArrayBuffer(a):n.readAsText(a),o},fa=(a,e,t,i,s,n,o)=>
vendor: 4,575 bytes, line 292
292{if(a.name)return Uc(a,e,t,s,n?_=>{n(void 0,_)}:void 0);const c=a;if(c.indexOf("file:")!==-1){let _=decodeURIComponent(c.substring(5).toLowerCase());_.indexOf("./")===0&&(_=_.substring(2));const m=wc.FilesToLoad[_];if(m)return Uc(m,e,t,s,n?g=>n(void 0,new _f(g.message,g.file)):void 0)}const{match:h,type:f}=aC(c);if(h){const _={onCompleteObservable:new Me,abort:()=>()=>{}};try{const m=s?Im(c):Cv(c);e(m,void 0,f)}catch(m){n?n(void 0,m):pe.Error(m.message||"Failed to parse the Data URL")}return fs.SetImmediate(()=>{_.onCompleteObservable.notifyObservers(_)}),_}return Dm(c,(_,m)=>{e(_,m?.responseURL,m?.getResponseHeader("content-type"))},t,i,s,n?_=>{n(_.request,new _f(_.message,_.request))}:void 0,o)},Dm=(a,e,t,i,s,n,o)=>{i!==null&&(i??(i=mt.LastCreatedScene?.offlineProvider)),a=mi.CleanUrl(a),a=mi.PreprocessUrl(a);const c=mi.BaseUrl+a;let h=!1;const f={onCompleteObservable:new Me,abort:()=>h=!0},_=()=>{let m=new Pi,g=null,x;const y=()=>{m&&(t&&m.removeEventListener("progress",t),x&&m.removeEventListener("readystatechange",x),m.removeEventListener("loadend",b))};let b=()=>{y(),f.onCompleteObservable.notifyObservers(f),f.onCompleteObservable.clear(),t=void 0,x=null,b=null,n=void 0,o=void 0,e=void 0};f.abort=()=>{h=!0,b&&b(),m&&m.readyState!==(XMLHttpRequest.DONE||4)&&m.abort(),g!==null&&(clearTimeout(g),g=null),m=null};const v=R=>{const C=R.message||"Unknown error";n&&m?n(new mf(C,m)):pe.Error(C)},E=R=>{if(m){if(m.open("GET",c),o)try{o(m)}catch(C){v(C);return}s&&(m.responseType="arraybuffer"),t&&m.addEventListener("progress",t),b&&m.addEventListener("loadend",b),x=()=>{if(!(h||!m)&&m.readyState===(XMLHttpRequest.DONE||4)){if(x&&m.removeEventListener("readystatechange",x),m.status>=200&&m.status<300||m.status===0&&(!Xi()||Sv())){const M=s?m.response:m.responseText;if(M!==null){try{e&&e(M,m)}catch(I){v(I)}return}}const C=mi.DefaultRetryStrategy;if(C){const M=C(c,m,R);if(M!==-1){y(),m=new Pi,g=setTimeout(()=>E(R+1),M);return}}const O=new mf("Error status: "+m.status+" "+m.statusText+" - Unable to load "+c,m);n&&n(O)}},m.addEventListener("readystatechange",x),m.send()}};E(0)};if(i&&i.enableSceneOffline&&!a.startsWith("blob:")){const m=x=>{x&&x.status>400?n&&n(x):_()},g=()=>{i&&i.loadFile(mi.BaseUrl+a,x=>{!h&&e&&e(x),f.onCompleteObservable.notifyObservers(f)},t?x=>{!h&&t&&t(x)}:void 0,m,s)};i.open(g,m)}else _();return f},Sv=()=>typeof location<"u"&&location.protocol==="file:",Mv=a=>Rv.test(a),aC=a=>{const e=Rv.exec(a);return e===null||e.length===0?{match:!1,type:""}:{match:!0,type:e[0].replace("data:","").replace(";base64,","")}};function Im(a){return ZM(a.split(",")[1])}const Cv=a=>Ev(a.split(",")[1]);let Pc;const oC=(a,e,t,i,s,n,o,c,h,f)=>{Pc={DecodeBase64UrlToBinary:a,DecodeBase64UrlToString:e,DefaultRetryStrategy:t.DefaultRetryStrategy,BaseUrl:t.BaseUrl,CorsBehavior:t.CorsBehavior,PreprocessUrl:t.PreprocessUrl,IsBase64DataUrl:i,IsFileURL:s,LoadFile:n,LoadImage:o,ReadFile:c,RequestFile:h,SetCorsBehavior:f},Object.defineProperty(Pc,"DefaultRetryStrategy",{get:function(){return t.DefaultRetryStrategy},set:function(_){t.DefaultRetryStrategy=_}}),Object.defineProperty(Pc,"BaseUrl",{get:function(){return t.BaseUrl},set:function(_){t.BaseUrl=_}}),Object.defineProperty(Pc,"PreprocessUrl",{get:function(){return t.PreprocessUrl},set:function(_){t.PreprocessUrl=_}}),Object.defineProperty(Pc,"CorsBehavior",{get:function(){return t.CorsBehavior},set:function(_){t.CorsBehavior=_}})};let Vb=!1;function lC(){Vb||(Vb=!0,oC(Im,Cv,mi,Mv,Sv,fa,gf,Uc,Dm,Cm),Ga.loadFile=fa,Ga.loadImage=gf,sv.loadFile=fa)}let Hb=!1;function cC(){Hb||(Hb=!0,lC(),Ie.prototype._loadFileAsync=async function(a,e,t){return await new Promise((i,s)=>{this._loadFile(a,n=>{i(n)},void 0,e,t,(n,o)=>{s(o)})})})}cC();const pf=new Map;function gn(a,e){hC(a)&&pe.Warn(`Extension with the name '${a}' already exists`),pf.set(a,e)}function hC(a){return pf.delete(a)}function uC(a,e){(e==="image/ktx"||e==="image/ktx2")&&(a=".ktx"),pf.has(a)||(a.endsWith(".ies")&&gn(".ies",async()=>await Wi(()=>import("./iesTextureLoader-ByrfkC_3.js"),[]).then(i=>new i._IESTextureLoader)),a.endsWith(".dds")&&gn(".dds",async()=>await Wi(()=>import("./ddsTextureLoader-DZF5A1nj.js"),__vite__mapDeps([2,0,1])).then(i=>new i._DDSTextureLoader)),a.endsWith(".basis")&&gn(".basis",async()=>await Wi(()=>import("./basisTextureLoader-B0HQp8SI.js"),[]).then(i=>new i._BasisTextureLoader)),a.endsWith(".env")&&gn(".env",async()=>await Wi(()=>import("./envTextureLoader-mqxnLBeS.js"),__vite__mapDeps([3,1])).then(i=>new i._ENVTextureLoader)),a.endsWith(".hdr")&&gn(".hdr",async()=>await Wi(()=>
292import("./hdrTextureLoader-BGQvgh0h.js"),[]).then(i=>new i._HDRTextureLoader)),(a.endsWith(".ktx")||a.endsWith(".ktx2"))&&(gn(".ktx",async()=>await Wi(()=>import("./ktxTextureLoader-DXcEZg9P.js"),[]).then(i=>new i._KTXTextureLoader)),gn(".ktx2",async()=>await Wi(()=>import("./ktxTextureLoader-DXcEZg9P.js"),[]).then(i=>new i._KTXTextureLoader))),a.endsWith(".tga")&&gn(".tga",async()=>await Wi(()=>import("./tgaTextureLoader-DVELOaqt.js"),[]).then(i=>new i._TGATextureLoader)),a.endsWith(".exr")&&gn(".exr",async()=>await Wi(()=>import("./exrTextureLoader-DlI_6Qpo.js"),[]).then(i=>new i._ExrTextureLoader)));const t=pf.get(a);return t?Promise.resolve(t(e)):null}let jb=!1;function fC(){jb||(jb=!0,Ie.GetCompatibleTextureLoader=uC)}fC();let Wb=!1;function dC(){Wb||(Wb=!0,ot.prototype.enableScissor=function(a,e,t,i){const s=this._gl;s.enable(s.SCISSOR_TEST),s.scissor(a,e,t,i)},ot.prototype.disableScissor=function(){const a=this._gl;a.disable(a.SCISSOR_TEST)})}dC();const _C={authority:5,procedure:5,proportionality:5,evidence:5,safety:5,reasoning:5},Ya=[{id:"traffic-stop",docket:"最高法院107年度台上字第3416號",year:"2018",title:"凌晨轉彎與酒味",shortTitle:"夜間攔停",subtitle:"合理懷疑如何由行政查證轉入刑事調查?",sceneUrl:"/manus-storage/scene-traffic_6f698574.png",accent:"#3ddbc5",summary:"巡邏員警觀察到機車左轉幅度較大、速度稍快,在紅燈前攔停。查證身分時聞到濃厚酒味,騎士同意吐氣測試。",trueHolding:"法院接受具體行車狀態與員警取締酒駕經驗形成合理懷疑;查證中出現酒味後可轉入刑事調查,且本案認定受檢者同意吐氣,程序無違法。",proceduralResult:"被告第三審上訴駁回,二審有罪結果維持。這不表示最高法院重新完成全部事實調查。",favoredSide:"本審級:檢察官/國家一方有利",sourceUrl:"https://tps.judicial.gov.tw/tw/dl-11931-6d235d07f2dd4cb5a4a6d32f2f3f4b5d.html",nodes:[{id:"traffic-observe",nodeIndices:[0,1],kicker:"第一回合|資訊取得 × 合理懷疑",prompt:"你看見機車左轉幅度較大、速度稍快。此刻應如何處理?",knownFacts:["凌晨2至4時執行一般巡邏","機車左轉路徑較大、速度稍快","尚未聞到酒味,也沒有酒測數值"],contest:"警方必須提出可被檢驗的當下事實;辯方可主張這只是主觀直覺。",options:[{id:"observe-first",title:"保持觀察,確認更多行車狀態",subtitle:"最小侵害,但可能錯失即時查證時機",tone:"measured",legalBasis:"比例原則與侵害最小方法",defenseChallenge:"若沒有新的客觀事實,不能無限尾隨或製造嫌疑。",explanation:"先觀察可降低任意攔停疑慮,但在已存在具體異常且車輛即將離開時,仍須衡量公共安全。",effects:{proportionality:2,authority:1,safety:-1,reasoning:1},reveals:["前方紅燈提供安全接觸位置"]},{id:"stop-document",title:"在紅燈安全攔停,立即記錄客觀理由",subtitle:"以行車狀態與勤務經驗建立合理懷疑",tone:"assertive",legalBasis:"警察職權行使法第6條、第7條",defenseChallenge:"左轉幅度與速度仍可能是正常駕駛,須說明判斷標準。",explanation:"本案裁判接受具體行車狀態結合專業經驗形成合理懷疑。重點不是『看起來可疑』,而是留下可回看的觀察。",effects:{authority:3,procedure:1,safety:2,reasoning:2},reveals:["勤務表與員警觀察紀錄","查證期間可接近騎士"],recommended:!0},{id:"random-stop",title:"以例行臨檢名義隨機攔停",subtitle:"不記錄轉彎、速度或危害連結",tone:"risky",legalBasis:"僅以一般巡邏勤務作為依據",defenseChallenge:"釋字第535號禁止不問時間、地點、對象的任意臨檢。",explanation:"勤務存在不等於空白授權。欠缺個別化、可檢驗理由,後續發現的酒味不能反向補足攔停門檻。",effects:{authority:-4,procedure:-2,proportionality:-2,reasoning:-2},reveals:["攔停紀錄僅寫『例行臨檢』"],criticalViolation:"攔停欠缺個別化合理懷疑紀錄"}]},{id:"traffic-transition",nodeIndices:[2,3],kicker:"第二回合|措施強度 × 程序告知",prompt:"查證身分時聞到濃厚酒味。你要如何把程序轉入酒駕調查?",knownFacts:["合法接觸後出現濃厚酒味","尚未取得吐氣數值","密錄器電力不足風險"],contest:"新的犯罪跡象可使任務轉換,但受檢者必須知道此刻措施的性質。",options:[{id:"explain-consent",title:"說明轉入酒駕調查並請求吐氣",subtitle:"記錄同意、設備狀態與每次吹測",tone:"assertive",legalBasis:"行政查證轉為刑事調查;本案認定同意吐氣",defenseChallenge:"『可以』是否出於自由意志,仍要看語氣、告知與現場壓力。",explanation:"把轉換時間點與同意過程固定下來,可避免把查證身分與犯罪取證混為一談。",effects:{authority:2,procedure:4,evidence:2,reasoning:2},reveals:["酒測器檢定合格證書","騎士口頭同意吐氣"],recommended:!0},{id:"ask-without-record",title:"口頭詢問後立即測試",subtitle:"有同意,但不特別記錄告知內容",tone:"measured",legalBasis:"以口頭同意為主要依據",defenseChallenge:"錄影不完整時,法院難以重建同意是å
292¦çœŸæ‘¯ã€‚",explanation:"本案仍有員警證言與其他卷證,但紀錄缺口會把可避免的爭點留到法庭。",effects:{authority:1,procedure:-1,evidence:-1,reasoning:0},reveals:["錄影只保留部分過程"]},{id:"force-test",title:"不說明理由,直接要求完成吹測",subtitle:"把查證身分視為當然包含犯罪取證",tone:"risky",legalBasis:"未提出獨立同意或強制測試要件",defenseChallenge:"行政查證不能自動轉成無限制刑事取證。",explanation:"即使最後數值很高,仍不能以結果倒推取證程序合法。",effects:{authority:-3,procedure:-4,evidence:-3,reasoning:-2},reveals:["騎士對測試提出異議"],criticalViolation:"未說明程序轉換且欠缺可證明的同意"}]},{id:"traffic-evidence",nodeIndices:[4,5],kicker:"第三回合|比例原則 × 證據能力",prompt:"錄影不完整,騎士又主張曾出現0.06。你如何保全並提出證據?",knownFacts:["最後紀錄值0.27mg/L","多次吹測失敗","一支密錄器電力不足"],contest:"程序合法性與讀值證明力必須分開;不能只拿最後數字作答。",options:[{id:"preserve-chain",title:"完整保存設備、紀錄與失敗吹測說明",subtitle:"以多來源卷證補強最後讀值",tone:"assertive",legalBasis:"刑事訴訟法第155條證明力判斷",defenseChallenge:"仍可比對職務報告、證言與影片是否矛盾。",explanation:"本案以酒測紀錄、檢定證書、員警證言、勤務資料與勘驗結果綜合判斷。",effects:{evidence:4,procedure:2,reasoning:3,safety:1},reveals:["酒精測定紀錄表","舉發通知單","影片勘驗筆錄"],recommended:!0},{id:"keep-final-only",title:"只保留最後0.27讀值",subtitle:"忽略失敗測試與錄影缺口",tone:"risky",legalBasis:"只依單一結果紀錄",defenseChallenge:"程序與設備爭點沒有可供法院檢驗的材料。",explanation:"最終讀值可能仍有證明力,但不完整的證據鏈會削弱可信度並增加排除或無法證明風險。",effects:{evidence:-4,procedure:-2,reasoning:-2},reveals:["0.06爭議無從釐清"],criticalViolation:"關鍵測試過程未充分保存"},{id:"exclude-now",title:"直接認為錄影不全即應排除",subtitle:"跳過合法性、能力與證明力的分層",tone:"measured",legalBasis:"嘗試直接援引第158條之4",defenseChallenge:"影像缺口不當然等於違法取證,也不當然決定證明力。",explanation:"應先判斷攔停與同意是å
292¦åˆæ³•,再判證據能力,最後才評估數值是否可信。",effects:{reasoning:-2,evidence:-1,proportionality:1},reveals:["法院要求分層判斷"]}]}]},{id:"cybercafe-bag",docket:"最高法院99年度台上字第4117號",year:"2010",title:"網咖腳邊的包包",shortTitle:"封閉包包",subtitle:"臨檢能否直接開啟有合理隱私期待的容器?",sceneUrl:"/manus-storage/scene-cybercafe_e1ca78cd.png",accent:"#d0aa69",summary:"匿名情資指向網咖特定桌位。被告坐在第46號桌,腳邊包包內容未外露;員警要求拿出或打開包包。",trueHolding:"最高法院要求釐清包包究竟是經真摯同意搜索、逮捕後附帶搜索,或警察逕行搜索;在搜索法律性質與程序未確定前,不能直接完成證據能力權衡。",proceduralResult:"原有罪判決撤銷並發回更審。這是程序上對被告有利,不是實體無罪,也不是證據已確定排除。",favoredSide:"本審級:被告取得程序上有利結果",sourceUrl:"https://law.judicial.gov.tw/EXPORTFILE/reformat.aspx?type=JD&id=TPSM%2c99%2c%E5%8F%B0%E4%B8%8A%2c4117%2c20100630%2c1&lawpara=&ispdf=0",nodes:[{id:"cafe-suspicion",nodeIndices:[0,1],kicker:"第一回合|資訊取得 × 合理懷疑",prompt:"匿名情資指向第44至46號桌,被告在第46號桌。你能做什麼?",knownFacts:["匿名販毒情資","對象位於特定桌位","員警記得其曾涉施用愷他命"],contest:"情資可支持接觸與查證,但是否足以打開包包是另一個門檻。",options:[{id:"verify-identity",title:"先表明身分、告知事由並查證身分",subtitle:"核對情資,觀察是否有外露犯罪或危險跡象",tone:"assertive",legalBasis:"警察職權行使法第6條、第7條",defenseChallenge:"前科與匿名情資不能自動建立搜索權。",explanation:"臨檢原則在查明身分;包包內容未外露,尚不能把臨檢直接升級為搜索。",effects:{authority:3,procedure:2,proportionality:2,reasoning:2},reveals:["包包仍封閉且在腳邊","沒有外露危險物"],recommended:!0},{id:"ask-voluntary",title:"說明懷疑並詢問是否願意配合",subtitle:"不宣稱有權強制開包",tone:"measured",legalBasis:"自願接觸;後續仍須另驗證同意搜索",defenseChallenge:"警力、語氣及現場壓力可能使配合不是真正自願。",explanation:"請求合作可以先做,但若要檢視內容,必須把同意權限、自願、認知、範圍與紀錄補齊。",effects:{authority:1,procedure:1,proportionality:2,reasoning:1},reveals:["受檢者詢問是否可以拒絕"]},{id:"open-as-frisk",title:"以安全檢查名義要求立即開包",subtitle:"未提出足以自傷或傷人的明顯事實",tone:"risky",legalBasis:"誤用警察職權行使法第7條第1項第4款",defenseChallenge:"封閉包包不是臨檢當然內容,且本案物品未外露。",explanation:"安全檢查有特定門檻;不能以抽象安全理由搜索犯罪證據。",effects:{authority:-4,proportionality:-3,procedure:-2,reasoning:-2},reveals:["包內物品係開啟後才看見"],criticalViolation:"以臨檢名義直接搜索封閉包包"}]},{id:"cafe-consent",nodeIndices:[2,3],kicker:"第二回合|措施強度 × 程序告知",prompt:"被告可能願意自己打開包包。如何建立可驗證的同意?",knownFacts:["包包由被告掌控","內容未外露","扣押筆錄之後可能出現簽名與指印"],contest:"簽名、沉默或自行取物不當然等於真摯、自願、知情的搜索同意。",options:[{id:"document-consent",title:"明確告知目的、可拒絕及搜索範圍",subtitle:"先記錄同意,再由本人開啟",tone:"assertive",legalBasis:"刑事訴訟法第131條之1",defenseChallenge:"仍要檢查警察人數、語氣、反覆要求與實際自由。",explanation:"真摯同意要看整體情狀;筆錄是證據,不是自動通行證。",effects:{authority:3,procedure:4,proportionality:2,evidence:2},reveals:["同意筆錄時間戳","被告親自打開包包"],recommended:!0},{id:"signature-after",title:"先看包內物,再補簽同意欄",subtitle:"以事後簽名補正先行搜索",tone
292:"risky",legalBasis:"事後形式記載",defenseChallenge:"事後簽名不能回溯使先前搜索變成自願。",explanation:"同意必須先於或至少伴隨搜索決定;事後文件只會造成程序版本衝突。",effects:{authority:-4,procedure:-5,evidence:-3,reasoning:-2},reveals:["筆錄時間晚於包包開啟"],criticalViolation:"事後補作同意,無法治癒先行搜索"},{id:"seek-warrant",title:"保全現場並循令狀程序",subtitle:"在沒有急迫或真正同意時停止升級",tone:"measured",legalBasis:"搜索票原則與最小侵害",defenseChallenge:"保全措施本身仍不得不當延長拘束。",explanation:"若欠缺緊急例外與真摯同意,搜索票是最穩定路徑,但須注意時間與拘束範圍。",effects:{authority:3,procedure:3,proportionality:2,safety:-1,reasoning:2},reveals:["搜索票聲請所需事實不足或待補"]}]},{id:"cafe-reconstruct",nodeIndices:[4,5],kicker:"第三回合|比例原則 × 證據能力",prompt:"警員稱臨檢查獲、筆錄卻寫同意搜索,逮捕通知又是另一版本。法庭如何處理?",knownFacts:["程序版本衝突","搜索似早於逮捕","原審只把未陳報稱為些許瑕疵"],contest:"先確定搜索法律性質與時間順序,才能進行第158條之4權衡。",options:[{id:"remand-investigate",title:"要求補查並逐一重建程序",subtitle:"釐清同意、逮捕、搜索、陳報與證據鏈",tone:"assertive",legalBasis:"調查職責、理由義務及第158條之4",defenseChallenge:"控方不能以嚴重犯罪取代每一程序前提的證明。",explanation:"這最接近本案最高法院處理:撤銷發回補查,而非直接宣布無罪或證據必然排除。",effects:{reasoning:5,evidence:2,procedure:2,proportionality:2},reveals:["更審須先決定搜索法律性質"],recommended:!0},{id:"admit-public-interest",title:"因毒品犯罪重大,直接留用全部證據",subtitle:"跳過搜索性質與同意事實",tone:"risky",legalBasis:"抽象公共利益權衡",defenseChallenge:"第158條之4不是跳過合法性前提的萬用補丁。",explanation:"未確定違法樣態、權利侵害與主觀意圖,就無法客觀權衡。",effects:{reasoning:-5,procedure:-2,proportionality:-3,evidence:-2},reveals:["裁判理由無法對應卷證矛盾"],criticalViolation:"未釐清取證路徑即概括留用證據"},{id:"exclude-all",title:"因有瑕疵,直接排除全部證據",subtitle:"不調查違法程度與其他法定路徑",tone:"measured",legalBasis:"將排除法則誤作自動效果",defenseChallenge:"本案最高法院沒有終局宣告全部排除。",explanation:"違法取證仍須個案權衡;在前提未明時,較適當的是補查而非預斷。",effects:{reasoning:-3,evidence:-1,proportionality:1},reveals:["證據能力仍屬未決"]}]}]},{id:"hotel-door",docket:"最高法院110年度台上字第576號",year:"2021",title:"旅館房門前的氣味",shortTitle:"旅館門檻",subtitle:"合法盤查如何因新事實轉入緊急搜索?",sceneUrl:"/manus-storage/scene-hotel_e2b0e06a.png",accent:"#9ad8ff",summary:"員警在旅館外盤查後,二人同意同行至房門;第三人開門,員警在門口看到桌上毒品及器具並聞到氣味。",trueHolding:"法院認為本案盤查非恣意;到房門的同意不等於同意搜索,但門口新出現的目視、氣味與急迫性足以轉入刑事訴訟法第131條緊急搜索,並完成三日內陳報。",proceduralResult:"最高法院駁回上訴,二審轉讓禁藥二罪結果維持。",favoredSide:"本審級:檢察官/國家一方有利",sourceUrl:"https://tps.judicial.gov.tw/tw/dl-65998-9c857d392e3142c580149f919f5df629.html",nodes:[{id:"hotel-contact",nodeIndices:[0,1],kicker:"第一回合|資訊取得 × 合理懷疑",prompt:"兒少保護勤務中,二人在旅館外形跡可疑、供述歧異且有毒品前科。如何開始?",knownFacts:["旅館外的勤務觀察","二人回答互有歧異","尚未看到房內物品"],contest:"前科不能單獨支撐措施,但可與當下客觀情狀共同評價。",options:[{id:"identify-outside",title:"在公共區域表明身分並查證",subtitle:"記錄供述差異,不直接進房",tone:"assertive",legalBasis:"警察職權行使法第6條、第7條",defenseChallenge:"須指出真正可疑的當下行為,不能只有前科。",explanation:"先把接觸限制在公共區域,讓合理懷疑建立在可見事實與供述差異上。",effects:{authority:3,procedure:2,proportionality:2,reasoning:2},reveals:["二人表示可帶警員到房門"],recommended:!0},{id:"demand-room",title:"以臨檢名義要求立即進入房間",subtitle:"把旅館公共性延伸到已出租房間",tone
292:"risky",legalBasis:"無獨立住宅進入或搜索依據",defenseChallenge:"私人居住空間受住宅同等保障。",explanation:"旅館是營業場所,不表示已出租客房可以任意進入。後來看到物品不能倒推進入合法。",effects:{authority:-5,procedure:-3,proportionality:-3},reveals:["房客對房間具有隱私期待"],criticalViolation:"以臨檢名義直接進入私人房間"},{id:"end-contact",title:"身分查明後立即結束接觸",subtitle:"完全不追問供述差異",tone:"measured",legalBasis:"身分查明且無其他事由時應放行",defenseChallenge:"若客觀可疑情狀仍存在,警方可在必要範圍繼續釐清。",explanation:"這是權利保守選項,但可能沒有充分利用已出現、仍可依法詢問的具體矛盾。",effects:{proportionality:3,authority:1,safety:-2,reasoning:0},reveals:["案件在此終止,沒有取得新事實"]}]},{id:"hotel-threshold",nodeIndices:[2,3],kicker:"第二回合|措施強度 × 程序告知",prompt:"二人表示可同行至房門。如何確保你沒有越過同意範圍?",knownFacts:["同意內容僅是同行至門口","房內仍屬受保障空間","門由房內第三人控制"],contest:"同意到門口,不等於同意入內搜索。警方必須保持在合法視野。",options:[{id:"stay-threshold",title:"留在門外,記錄同行同意與開門者",subtitle:"不跨越門檻、不伸手或改變視角",tone:"assertive",legalBasis:"同意範圍與合法在場原則",defenseChallenge:"仍須確認同行沒有受到警力壓迫。",explanation:"把物理門檻變成程序門檻,才能判斷後續看見的物品是否來自合法位置。",effects:{procedure:4,authority:2,proportionality:3,reasoning:2},reveals:["第三人自行開門","門外自然視線進入房內"],recommended:!0},{id:"follow-inside",title:"跟著房客跨入房內再觀察",subtitle:"把同行同意擴張為入內同意",tone:"risky",legalBasis:"超出已表達的同行範圍",defenseChallenge:"進入本身可能已是侵害住宅隱私的搜索前置。",explanation:"若沒有獨立進入依據,入內後才看到的物品不能輕易主張一目瞭然。",effects:{authority:-4,procedure:-4,proportionality:-3,evidence:-2},reveals:["物品只有進房後才清楚可辨"],criticalViolation:"超出同行至門口的同意範圍"},{id:"request-search-consent",title:"另行請求房間搜索同意",subtitle:"查明同意權與自願性後再決定",tone:"measured",legalBasis:"刑事訴訟法第131條之1",defenseChallenge:"誰有權同意整個房間,以及現場壓力,仍須具體證明。",explanation:"把同行與搜索拆成兩個意思表示是正確方向,但需要完整同意紀錄。",effects:{authority:2,procedure:3,proportionality:2,reasoning:2},reveals:["開門者是否為房客有待確認"]}]},{id:"hotel-emergency",nodeIndices:[4,5],kicker:"第三回合|比例原則 × 證據能力",prompt:"門開後,在門外看到桌上疑似毒品與器具,並聞到施用氣味。下一步?",knownFacts:["有直接目視與嗅覺資料","房內可能有人正在犯罪","證物可能迅速移動或滅失"],contest:"緊急搜索要同時證明明顯事實、急迫性、必要範圍及事後陳報。",options:[{id:"emergency-report",title:"依明顯事實與急迫性入內,限制範圍並陳報",subtitle:"扣押目視所及物,三日內完成司法監督",tone:"assertive",legalBasis:"刑事訴訟法第131條第1項第3款、第3項",defenseChallenge:"控方仍須證明聲請票確實來不及,且搜索沒有擴張。",explanation:"這重現本案法院接受的路徑:合法門外位置、新明顯事實、急迫性、必要範圍與事後陳報。",effects:{authority:4,procedure:4,proportionality:3,evidence:4,safety:2},reveals:["桌上甲基安非他命與吸食器具","三日內報告並獲准備查"],recommended:!0},{id:"search-whole-room",title:"以緊急為由全面翻找房間",subtitle:"不區分目視範圍與密閉空間",tone:"risky",legalBasis:"將緊急搜索概括化",defenseChallenge:"搜索仍不得超過發現人犯或阻止犯罪所必要。",explanation:"緊急性不是全面搜索授權;超過必要範圍的物品需另行評價。",effects:{authority:-2,proportionality:-5,procedure:-2,evidence:-2},reveals:["搜索範圍超出桌面與立即控制區"],criticalViolation:"緊急搜索超過必要範圍"}
292,{id:"wait-warrant",title:"保全門口並聲請搜索票",subtitle:"降低侵害,但承擔人員與證物離開風險",tone:"measured",legalBasis:"搜索票原則與現場保全",defenseChallenge:"保全措施不能等同長時間、無依據拘束房內人。",explanation:"若急迫性不足,令狀路徑最穩定;若情況確實迅速變化,等待可能無法及時阻止犯罪。",effects:{authority:3,procedure:3,proportionality:3,safety:-2,evidence:-1},reveals:["等待期間房內動靜增加"]}]}]},{id:"dark-car",docket:"最高法院113年度台上字第502號",year:"2024",title:"道路中央的深色車窗",shortTitle:"危害車輛",subtitle:"何時是行政危害處置,何時轉成刑事搜索?",sceneUrl:"/manus-storage/scene-car_c82490a3.png",accent:"#ef6970",summary:"未熄火車輛停在道路中央妨礙通行;深色車窗、敲窗無反應、車主失聯,員警擔心車內有人需要急救。",trueHolding:"本案具體危害與緊急情境,使開啟未上鎖車門成為查證或強制離車的必要附隨行為;合法在場後直接看見槍枝,可一目瞭然扣押,現行犯逮捕後才搜索立即可觸及背包。",proceduralResult:"被告第三審上訴駁回;有罪判決及扣案槍彈證據能力維持。",favoredSide:"本審級:檢察官/國家一方有利",sourceUrl:"https://tps.judicial.gov.tw/tw/dl-135532-e6c1b41ca15e48ee898fd6b609769873.html",nodes:[{id:"car-danger",nodeIndices:[0,1],kicker:"第一回合|資訊取得 × 合理懷疑",prompt:"車輛未熄火停在道路中央,深色車窗且敲窗無反應。如何判斷?",knownFacts:["已妨礙其他車輛通行","外部看不清車內","多次敲窗與聯絡車主均無回應"],contest:"是否已發生或易生危害,決定警方能否從觀察升級為必要處置。",options:[{id:"assess-rescue",title:"記錄交通危害並同步評估急救需求",subtitle:"持續敲窗、聯絡、請求支援與救護",tone:"assertive",legalBasis:"警察職權行使法第8條及比例原則",defenseChallenge:"必須說明為何等待或其他替代手段不足。",explanation:"本案合法性依賴一組累積事實,而不是單靠深色車窗或停車位置。",effects:{authority:3,procedure:2,proportionality:3,safety:3,reasoning:2},reveals:["車門未上鎖","車內可能有人需要急救"],recommended:!0},{id:"wait-owner",title:"只等待車主回電,不處理車內狀況",subtitle:"侵害較低,但忽略交通與生命風險",tone:"measured",legalBasis:"以最小侵害為主要考量",defenseChallenge:"比例原則也包含有效保護生命與公共安全。",explanation:"最小侵害不是消極不作為;明顯危害持續時,警方須選擇能有效處理的必要方法。",effects:{proportionality:1,authority:0,safety:-4,reasoning:-1},reveals:["交通持續受阻"]},{id:"search-car-now",title:"直接以可疑車輛為由搜索車內",subtitle:"尚未有特定犯罪嫌疑或搜索依據",tone:"risky",legalBasis:"將危害處置誤作犯罪搜索授權",defenseChallenge:"行政處置不得以找證據為目的翻找車內。",explanation:"此刻可處理危害與確認人員狀況,但不能提前開啟背包或置物空間。",effects:{authority:-5,procedure:-3,proportionality:-4,evidence:-2},reveals:["尚未出現特定槍砲犯罪嫌疑"],criticalViolation:"在犯罪嫌疑浮現前先行搜索車內"}]},{id:"car-door",nodeIndices:[2,3],kicker:"第二回合|措施強度 × 程序告知",prompt:"敲窗、聯絡均無效且有急救疑慮。你要如何接觸車內?",knownFacts:["車門未上鎖","車內人員沒有反應","處置目的仍是查證或救援"],contest:"開門的合法性取決於目的、必要性、緊急性與是否採最小侵害。",options:[{id:"open-driver-door",title:"說明事由後開啟未上鎖駕駛座車門",subtitle:"只確認人員狀況,不翻動車內物品",tone:"assertive",legalBasis:"查證身分或強制離車的必要附隨行為",defenseChallenge:"若實際目的在找證據,仍可能構成違法搜索。",explanation:"本案法院接受這個高度事實依賴的最低限度處置;合法性不能推廣到所有車輛。",effects:{authority:4,procedure:3,proportionality:4,safety:3,reasoning:2},reveals:["駕駛垂頭沉睡","駕駛單手持握胯下手槍"],recommended:!0},{id:"break-window",title:"立即擊破車窗並全面控制車內",subtitle:"沒有先使用未上鎖車門或其他較小侵害方式",tone:"risky",legalBasis:"以緊急救援為名採取高強度手段",defenseChallenge:"已有侵害更小且可達目的的替代方案。",explanation:"必要性要求先考慮能否用未上鎖車門確認狀況;過度手段會降低比例性。",effects:{proportionality:-5,procedure:-2,safety:1,authority:-1},reveals:["車門原本未上鎖"],criticalViolation:"未採取可行的較小侵害方法"},{id:"open-passenger-bag",title:"先開副駕駛座背包尋找身分資料",subtitle:"在逮捕前開啟密封物",tone:"risky",legalBasis:"沒有一目瞭然或附帶搜索前提",defenseChallenge:"身分查證不當然授權開啟封閉背包。",explanation:"本案判決清楚區分必要開門與後續背包搜索;搜索背包必須等到合法逮捕後另行判斷。",effects:{authority:-5,procedure:-4,proportionality:-4,evidence:-4},reveals:["背包內容只有開啟後才可見"],criticalViolation:"逮捕前違法開啟封閉背包"}]},{id:"car-plainview",nodeIndices:[4,5],kicker:"第三回合|比例原則 × 證據能力",prompt:"門開後直接看到駕駛持槍。你要如何處理槍枝與副駕駛座背包?",knownFacts:["警察因危害處置合法在場","槍枝自然進入視線","背包仍然封閉"],contest:"一目瞭然只能處理直接可見物;開啟背包必須建立在合法逮捕與立即可觸及範圍。",options:[{id:"seize-arrest-search",title:"先扣押明顯槍枝、逮捕,再搜索立
292即可觸及背包",subtitle:"嚴格保留行為先後與空間範圍",tone:"assertive",legalBasis:"一目瞭然原則;刑訴法第88、130、133條",defenseChallenge:"控方仍須證明槍枝確實直接可見、逮捕先於開包且背包可立即觸及。",explanation:"這重現本案四段式結構:合法在場、目視槍枝、現行犯逮捕、附帶搜索背包。",effects:{authority:5,procedure:3,proportionality:3,evidence:5,safety:4,reasoning:4},reveals:["槍內7顆子彈","背包內29顆子彈","密錄器勘驗與鑑定書"],recommended:!0},{id:"plainview-all",title:"以一目瞭然為由同時打開背包",subtitle:"把直接看見擴張到密封物內容",tone:"risky",legalBasis:"錯誤擴張一目瞭然原則",defenseChallenge:"目視發現不得靠開啟皮包、背包或置物箱完成。",explanation:"槍枝與背包內容的法律路徑不同;混用會讓子彈證據面臨爭議。",effects:{authority:-3,procedure:-3,evidence:-4,reasoning:-4},reveals:["背包搜索時間早於逮捕紀錄"],criticalViolation:"以一目瞭然名義開啟密封背包"},{id:"secure-warrant",title:"扣押槍枝並控制現場,另聲請搜索票",subtitle:"放棄立即附帶搜索,採較保守路徑",tone:"measured",legalBasis:"令狀原則與現場保全",defenseChallenge:"若人已被合法逮捕且背包可立即觸及,第130條本可能容許必要搜索。",explanation:"這仍是程序安全的路徑,但要避免保全措施過度延長;也可能增加證物移動風險。",effects:{authority:3,procedure:4,proportionality:3,evidence:1,safety:-1,reasoning:2},reveals:["搜索票聲請流程啟動"]}]}]}],mC=(a,e=0,t=16)=>Math.min(t,Math.max(e,a)),gC=a=>Math.min(100,Math.max(0,a));class pC{constructor(e=0){this.listeners=new Set,this.snapshot=this.makeSnapshot(e,"intro")}subscribe(e){return this.listeners.add(e),e(this.snapshot),()=>{this.listeners.delete(e)}}getSnapshot(){return this.snapshot}selectCase(e){const t=Math.min(Ya.length-1,Math.max(0,e));this.snapshot=this.makeSnapshot(t,"intro"),this.emit()}start(){this.snapshot.mode==="intro"&&(this.snapshot={...this.snapshot,mode:"playing",decisionIndex:0,currentNode:this.snapshot.currentCase.nodes[0]},this.emit())}choose(e){if(this.snapshot.mode!=="playing"||!this.snapshot.currentNode)return;const t=this.snapshot.currentNode.options.find(m=>m.id===e);if(!t)return;const i={...this.snapshot.scores};for(const[m,g]of Object.entries(t.effects)){const x=m,y=g??0;i[x]=mC(i[x]+y)}const s=this.calculateCardImpact(t),n={nodeId:this.snapshot.currentNode.id,nodeTitle:this.snapshot.currentNode.kicker,optionId:t.id,optionTitle:t.title,explanation:t.explanation,legalBasis:t.legalBasis,defenseChallenge:t.defenseChallenge,criticalViolation:t.criticalViolation,turnPoints:s.points,riskDelta:s.riskDelta,riskAfter:s.riskAfter,comboAfter:s.combo,streakAfter:s.streak},o=this.snapshot.decisionIndex+1,c=o>=this.snapshot.currentCase.nodes.length,h=t.criticalViolation?[...this.snapshot.criticalViolations,t.criticalViolation]:this.snapshot.criticalViolations,f=this.snapshot.battleScore+s.points,_=Math.max(this.snapshot.maxCombo,s.combo);this.snapshot={...this.snapshot,decisionIndex:o,currentNode:c?null:this.snapshot.currentCase.nodes[o],scores:i,history:[...this.snapshot.history,n],revealedEvidence:[...this.snapshot.revealedEvidence,...t.reveals.filter(m=>!this.snapshot.revealedEvidence.includes(m))],criticalViolations:h,battleScore:f,risk:s.riskAfter,combo:s.combo,streak:s.streak,maxCombo:_,lastImpact:s,mode:c?"result":"playing",outcome:c?this.calculateOutcome(i,h,f,s.riskAfter,_):null},this.emit()}restart(){this.snapshot=this.makeSnapshot(this.snapshot.caseIndex,"intro"),this.emit()}autoPlayRecommended(){this.snapshot.mode==="intro"&&this.start();let e=0;for(;this.snapshot.mode==="playing"&&e<8;){const t=this.snapshot.currentNode?.options.find(i=>i.recommended)??this.snapshot.currentNode?.options[0];if(!t)break;this.choose(t.id),e+=1}}calculateCardImpact(e){const t=Object.values(e.effects).filter(R=>typeof R=="number"),i=t.filter(R=>R>0).reduce((R,C)=>R+C,0),s=t.filter(R=>R<0).reduce((R,C)=>R+Math.abs(C),0),n=!!e.recommended&&!e.criticalViolation,o=e.tone==="assertive"&&i>=s+4&&!e.criticalViolation,c=n||o,h=c?this.snapshot.streak+1:0,f=c?Math.min(5,this.snapshot.combo+1):1;let _=e.tone==="measured"?4:e.tone==="risky"?16:-3;_+=Math.min(16,Math.ceil(s*1.4)),n&&(_-=7),e.criticalViolation&&(_+=24),this.snapshot.risk===0&&_<0&&(_=0);const m=gC(this.snapshot.risk+_),g=Math.max(-8,Math.min(18,i-s)),x=n?20:e.tone==="assertive"?14:e.tone==="measured"?9:4,y=Math.max(0,f-1)*4,b=e.criticalViolation?Math.max(0,4-s):Math.max(0,x+g+y),v=e.criticalViolation?"breach":_>5||s>i?"contested":"clean",E=v==="clean"?f>=3?"程序連擊成立":"合法攻勢成立":v==="contested"?"攻勢成立但遭反擊":"程序破口・連擊中斷";return{points:b,riskDelta:_,riskAfter:m,combo:f,streak:h,grade:v,label:E}}makeSnapshot(e,t){const i=Ya[e];return{mode:t,caseIndex:e,decisionIndex:0,currentCase:i,currentNode:t==="playing"?i.nodes[0]:null,scores:{..._C},history:[],revealedEvidence:[],criticalViolations:[],battleScore:0,risk:0,combo:1,streak:0,maxCombo:1,lastImpact:null,outcome:null}}calculateOutcome(e,t,i,s,n){const o=Object.values(e).reduce((x,y)=>x+y,0),c=Math.min(100,Math.max(0,Math.round(o/66*100))),h=e.authority+e.procedure+e.proportionality;let f="程序合法性仍有待補查";t.length>0?f="高度違法疑義":h>=33?f="程序基礎穩固":h>=25&&(f="合法性可辯護");let _="須依第158條之4個案權衡";t.length===0&&e.evidence>=11?_="證據原則上可進入審判評價":(t.length>=2||e.evidence<=3)&&(_="排除風險高,並應檢查衍生證據");const m=e.evidence+e.reasoning>=20?"證據鏈較完整;證明力仍須獨立判斷":"證據鏈或理由仍有缺口,不能僅憑查獲結果定罪",g=c>=82&&s<=20?"三回合法律攻勢完成,程序連擊未被有效破解。":c>=62?"攻防仍具可辯護基礎,但風險標記會成為法庭反擊點。":"連擊遭程序破口中斷;查獲結果不能治癒前段違法風險。";return{score:c,battleScore:i,risk:s,maxCombo:n,legality:f,admissibility:_,proof:m,summary:g}}
vendor: 23,959 bytes, line 292
292emit(){this.listeners.forEach(e=>e(this.snapshot))}}DM();CM();const Xb=(a,e,t)=>!a||a.getClassName&&a.getClassName()==="Mesh"?null:a.getClassName&&(a.getClassName()==="SubMesh"||a.getClassName()==="PhysicsBody")?a.clone(e):a.clone?a.clone():Array.isArray(a)?a.slice():t&&typeof a=="object"?{...a}:null;function xC(a){const e=[];do{const t=Object.getOwnPropertyNames(a);for(const i of t)e.indexOf(i)===-1&&e.push(i)}while(a=Object.getPrototypeOf(a));return e}class Pm{static DeepCopy(e,t,i,s,n=!1){const o=xC(e);for(const c of o){if(c[0]==="_"&&(!s||s.indexOf(c)===-1)||c.endsWith("Observable")||i&&i.indexOf(c)!==-1)continue;const h=e[c],f=typeof h;if(f!=="function")try{if(f==="object")if(h instanceof Uint8Array)t[c]=Uint8Array.from(h);else if(h instanceof Array){if(t[c]=[],h.length>0)if(typeof h[0]=="object")for(let _=0;_<h.length;_++){const m=Xb(h[_],t,n);t[c].indexOf(m)===-1&&t[c].push(m)}else t[c]=h.slice(0)}else t[c]=Xb(h,t,n);else t[c]=h}catch(_){pe.Warn(_.message)}}}}class tf{static Instantiate(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];const t=cf(e);if(t)return t;pe.Warn(e+" not found, you may have missed an import.");const i=e.split(".");let s=typeof window<"u"?window:typeof globalThis<"u"?globalThis:this;for(let n=0,o=i.length;n<o;n++)s=s[i[n]];return typeof s!="function"?null:s}}tf.RegisteredExternalClasses={};var qe;class bt{static get BaseUrl(){return mi.BaseUrl}static set BaseUrl(e){mi.BaseUrl=e}static get CleanUrl(){return mi.CleanUrl}static set CleanUrl(e){mi.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){mi.ScriptBaseUrl=e}static get ScriptBaseUrl(){return mi.ScriptBaseUrl}static set CDNBaseUrl(e){qe.ScriptBaseUrl=e,qe.AssetBaseUrl=e}static set ScriptPreprocessUrl(e){mi.ScriptPreprocessUrl=e}static get ScriptPreprocessUrl(){return mi.ScriptPreprocessUrl}static get DefaultRetryStrategy(){return mi.DefaultRetryStrategy}static set DefaultRetryStrategy(e){mi.DefaultRetryStrategy=e}static get CorsBehavior(){return mi.CorsBehavior}static set CorsBehavior(e){mi.CorsBehavior=e}static get UseFallbackTexture(){return mt.UseFallbackTexture}static set UseFallbackTexture(e){mt.UseFallbackTexture=e}static get RegisteredExternalClasses(){return tf.RegisteredExternalClasses}static set RegisteredExternalClasses(e){tf.RegisteredExternalClasses=e}static get fallbackTexture(){return mt.FallbackTexture}static set fallbackTexture(e){mt.FallbackTexture=e}static FetchToRef(e,t,i,s,n,o){const c=Math.abs(e)*i%i|0,h=Math.abs(t)*s%s|0,f=(c+h*i)*4;o.r=n[f]/255,o.g=n[f+1]/255,o.b=n[f+2]/255,o.a=n[f+3]/255}static Mix(e,t,i){return 0}static Instantiate(e){return tf.Instantiate(e)}static SetImmediate(e){fs.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 i=e.lastIndexOf("/");return i<0?t?e:"":e.substring(0,i+1)}static ToDegrees(e){return e*180/Math.PI}static ToRadians(e){return e*Math.PI/180}static SmoothAngleChange(e,t,i=.9){const s=this.ToRadians(e),n=this.ToRadians(t);return this.ToDegrees(Math.atan2((1-i)*Math.sin(n)+i*Math.sin(s),(1-i)*Math.cos(n)+i*Math.cos(s)))}static MakeArray(e,t){return t!==!0&&(e===void 0||e==null)?null:Array.isArray(e)?e:[e]}static GetPointerPrefix(e){return Xi()&&!window.PointerEvent?"mouse":"pointer"}static SetCorsBehavior(e,t){Cm(e,t)}static SetReferrerPolicyBehavior(e,t){t.referrerPolicy=e}static get PreprocessUrl(){return mi.PreprocessUrl}static set PreprocessUrl(e){mi.PreprocessUrl=e}static LoadImage(e,t,i,s,n,o){return gf(e,t,i,s,n,o)}static LoadFile(e,t,i,s,n,o){return fa(e,t,i,s,n,o)}static async LoadFileAsync(e,t=!0){return await new Promise((i,s)=>{fa(e,n=>{i(n)},void 0,void 0,t,(n,o)=>{s(o)})})}static GetAssetUrl(e){if(!e)return"";if(qe.AssetBaseUrl&&e.startsWith(qe._DefaultAssetsUrl)){const t=qe.AssetBaseUrl.endsWith("/")?qe.AssetBaseUrl.slice(0,-1):qe.AssetBaseUrl;return e.replace(qe._DefaultAssetsUrl,t)}return e}static GetBabylonScriptURL(e,t){if(!e)return"";if(e.startsWith(qe._DefaultCdnUrl)){if(qe.ScriptBaseUrl){const i=qe.ScriptBaseUrl.endsWith("/")?qe.ScriptBaseUrl.slice(0,-1):qe.ScriptBaseUrl;e=e.replace(qe._DefaultCdnUrl,i)}else if(qe._CdnVersion){const i=`${qe._DefaultCdnUrl}/v${qe._CdnVersion}`;e.startsWith(i)||(e=e.replace(qe._DefaultCdnUrl,i))}}return e=qe.ScriptPreprocessUrl(e),t&&!qe.IsAbsoluteUrl(e)&&(e=qe.GetAbsoluteUrl(e)),e}static LoadBabylonScript(e,t,i,s){e=qe.GetBabylonScriptURL(e),qe.LoadScript(e,t,i)}static async LoadBabylonScriptAsync(e){return e=qe.GetBabylonScriptURL(e),await qe.LoadScriptAsync(e)}static _LoadScriptNative(e,t,i,s,n=!1){if(_native){if(n){const o="Loading a script as an ES module is not supported in Babylon Native";i?.(o,new Error(o));return}qe.LoadFile(e,o=>{try{Function(o).apply(null),t&&t()}catch(c){i&&i("LoadScript Error",c)}},void 0,void 0,!1,(o,c)=>{i&&i("LoadScript Error",c)})}}static _LoadScriptWeb(e,t,i,s,n=!1){if(typeof importScripts=="function"){try{importScripts(e),t&&t()}catch(h){i?.(`Unable to load script '${e}' in worker`,h)}return}else if(!Xi()){i?.(`Cannot load script '${e}' outside of a window or a worker`);return}const o=document.getElementsByTagName("head")[0],c=document.createElement("script");n?(c.setAttribute("type","module"),c.innerText=e):(c.setAttribute("type","text/javascript"),c.setAttribute("src",e)),s&&(c.id=s),c.onload=()=>{t&&t()},c.onerror=h=>{i&&i(`Unable to load script '${e}'`,h)},o.appendChild(c)}static async LoadScriptAsync(e,t){return await new Promise((i,s)=>{this.LoadScript(e,()=>{i()},(n,o)=>{s(o||new Error(n))},t)})}static ReadFileAsDataURL(e,t,i){const s=new FileReader,n={onCompleteObservable:new Me,abort:()=>s.abort()};return s.onloadend=()=>{n.onCompleteObservable.notifyObservers(n)},s.onload=o=>{t(o.target.result)},s.onprogress=i,s.readAsDataURL(e),n}static ReadFile(e,t,i,s,n){return Uc(e,t,i,s,n)}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,i,s){Pm.DeepCopy(e,t,i,s)}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 i=0;i<t.length;i++){const s=t[i];e.addEventListener(s.name,s.handler,!1);try{window.parent&&window.parent.addEventListener(s.name,s.handler,!1)}catch{}}}static UnregisterTopRootEvents(e,t){for(let i=0;i<t.length;i++){const s=t[i];e.removeEventListener(s.name,s.handler);try{e.parent&&e.parent.removeEventListener(s.name,s.handler)}catch{}}}static async DumpFramebuffer(e,t,i,s,n="image/png",o,c){throw Je("DumpTools")}static DumpData(e,t,i,s,n="image/png",o,c=!1,h=!1,f){throw Je("DumpTools")}static async DumpDataAsync(e,t,i,s="image/png",n,o=!1,c=!1,h){throw Je("DumpTools")}static _IsOffScreenCanvas(e){return e.convertToBlob!==void 0}static ToBlob(e,t,i="image/png",s){!qe._IsOffScreenCanvas(e)&&!e.toBlob&&(e.toBlob=function(n,o,c){setTimeout(()=>{const h=atob(this.toDataURL(o,c).split(",")[1]),f=h.length,_=new Uint8Array(f);for(let m=0;m<f;m++)_[m]=h.charCodeAt(m);n(new Blob([_]))})}),qe._IsOffScreenCanvas(e)?e.convertToBlob({type:i,quality:s}).then(n=>t(n)):e.toBlob(function(n){t(n)},i,s)}static DownloadBlob(e,t){if("download"in document.createElement("a")){if(!t){const i=new Date;t="screenshot_"+((i.getFullYear()+"-"+(i.getMonth()+1)).slice(2)+"-"+i.getDate()+"_"+i.getHours()+"-"+("0"+i.getMinutes()).slice(-2))+".png"}qe.Download(e,t)}else if(e&&typeof URL<"u"){const i=URL.createObjectURL(e),s=window.open("");if(!s)return;const n=s.document.createElement("img");n.onload=function(){URL.revokeObjectURL(i)},n.src=i,s.document.body.appendChild(n)}}static EncodeScreenshotCanvasData(e,t,i="image/png",s,n){if(typeof s=="string"||!t)this.ToBlob(e,function(o){o&&qe.DownloadBlob(o,s),t&&t("")},i,n);else if(t){if(qe._IsOffScreenCanvas(e)){e.convertToBlob({type:i,quality:n}).then(c=>{const h=new FileReader;h.readAsDataURL(c),h.onloadend=()=>{const f=h.result;t(f)}});return}const o=e.toDataURL(i,n);t(o)}}static Download(e,t){if(typeof URL>"u")return;const i=window.URL.createObjectURL(e),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=i,s.download=t,s.addEventListener("click",()=>{s.parentElement&&s.parentElement.removeChild(s)}),s.click(),window.URL.revokeObjectURL(i)}static BackCompatCameraNoPreventDefault(e){return typeof e[0]=="boolean"?e[0]:typeof e[1]=="boolean"?e[1]:!1}static CreateScreenshot(e,t,i,s,n="image/png",o=!1,c){throw Je("ScreenshotTools")}static async CreateScreenshotAsync(e,t,i,s="image/png",n){throw Je("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,i,s,n="image/png",o=1,c=!1,h,f=!1,_=!1,m=!0,g,x){throw Je("ScreenshotTools")}static async CreateScreenshotUsingRenderTargetAsync(e,t,i,s="image/png",n=1,o=!1,c,h=!1,f=!1,_=!0,m,g){throw Je("ScreenshotTools")}static RandomId(){return vv()}static IsBase64(e){return Mv(e)}static DecodeBase64(e){return Im(e)}static get errorsCount(){return pe.errorsCount}static Log(e){pe.Log(e)}static Warn(e){pe.Warn(e)}static Error(e){pe.Error(e)}static get LogCache(){return pe.LogCache}static ClearLogCache(){pe.ClearLogCache()}static set LogLevels(e){pe.LogLevels=e}static set PerformanceLogLevel(e){if((e&qe.PerformanceUserMarkLogLevel)===qe.PerformanceUserMarkLogLevel){_native?.enablePerformanceLogging?(_native.enablePerformanceLogging(1),qe.StartPerformanceCounter=qe._StartMarkNative,qe.EndPerformanceCounter=qe._EndMarkNative):(qe.StartPerformanceCounter=qe._StartUserMark,qe.EndPerformanceCounter=qe._EndUserMark);return}if((e&qe.PerformanceConsoleLogLevel)===qe.PerformanceConsoleLogLevel){_native?.enablePerformanceLogging?(_native.enablePerformanceLogging(2),qe.StartPerformanceCounter=qe._StartMarkNative,qe.EndPerformanceCounter=qe._EndMarkNative):(qe.StartPerformanceCounter=qe._StartPerformanceConsole,qe.EndPerformanceCounter=qe._EndPerformanceConsole);return}qe.StartPerformanceCounter=qe._StartPerformanceCounterDisabled,qe.EndPerformanceCounter=qe._EndPerformanceCounterDisabled,_native?.disablePerformanceLogging?.()}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,t=!0){if(!qe._Performance){if(!Xi())return;qe._Performance=window.performance}!t||!qe._Performance.mark||qe._Performance.mark(e+"-Begin")}static _EndUserMark(e,t=!0){!t||!qe._Performance.mark||(qe._Performance.mark(e+"-End"),qe._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,t=!0){t&&(qe._StartUserMark(e,t),console.time&&console.time(e))}static _EndPerformanceConsole(e,t=!0){t&&(qe._EndUserMark(e,t),console.timeEnd(e))}static _StartMarkNative(e,t=!0){if(t&&_native?.startPerformanceCounter)if(qe._NativePerformanceCounterHandles.has(e))qe.Warn(`Performance counter with name ${e} is already started.`);else{const i=_native.startPerformanceCounter(e);qe._NativePerformanceCounterHandles.set(e,i)}}static _EndMarkNative(e,t=!0){if(t&&_native?.endPerformanceCounter){const i=qe._NativePerformanceCounterHandles.get(e);i?(_native.endPerformanceCounter(i),qe._NativePerformanceCounterHandles.delete(e)):qe.Warn(`Performance counter with name ${e} was not started.`)}}static get Now(){return Tn.Now}static GetClassName(e,t=!1){let i=null;return!t&&e.getClassName?i=e.getClassName():(e instanceof Object&&(i=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),i||(i=typeof e)),i}static First(e,t){for(const i of e)if(t(i))return i;return null}static getFullClassName(e,t=!1){let i=null,s=null;if(!t&&e.getClassName)i=e.getClassName();else{if(e instanceof Object){const n=t?e:Object.getPrototypeOf(e);i=n.constructor.__bjsclassName__,s=n.constructor.__bjsmoduleName__}i||(i=typeof e)}return i?(s!=null?s+".":"")+i:null}static async DelayAsync(e){await new Promise(t=>{setTimeout(()=>{t()},e)})}static IsSafari(){return qo()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}}qe=bt;bt.AssetBaseUrl="";bt.UseCustomRequestHeaders=!1;bt.CustomRequestHeaders=Pi.CustomRequestHeaders;bt.GetDOMTextContent=QT;bt._DefaultCdnUrl="https://cdn.babylonjs.com";bt._CdnVersion="9.25.0";bt._DefaultAssetsUrl="https://assets.babylonjs.com/core";bt.LoadScript=typeof _native>"u"?qe._LoadScriptWeb:qe._LoadScriptNative;bt.GetAbsoluteUrl=typeof document=="object"?a=>{const e=document.createElement("a");return e.href=a,e.href}:typeof URL=="function"&&typeof location=="object"?a=>new URL(a,location.origin).href:()=>{throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.")};bt.NoneLogLevel=pe.NoneLogLevel;bt.MessageLogLevel=pe.MessageLogLevel;bt.WarningLogLevel=pe.WarningLogLevel;bt.ErrorLogLevel=pe.ErrorLogLevel;bt.AllLogLevel=pe.AllLogLevel;bt.IsWindowObjectExist=Xi;bt.PerformanceNoneLogLevel=0;bt.PerformanceUserMarkLogLevel=1;bt.PerformanceConsoleLogLevel=2;bt._NativePerformanceCounterHandles=new Map;bt.StartPerformanceCounter=qe._StartPerformanceCounterDisabled;bt.EndPerformanceCounter=qe._EndPerformanceCounterDisabled;class xf{constructor(e,t,i,s=0){this.iterations=e,this.index=s-1,this._done=!1,this._fn=t,this._successCallback=i}executeNext(){this._done||(this.index+1<this.iterations?(++this.index,this._fn(this)):this.breakLoop())}breakLoop(){this._done=!0,this._successCallback()}static Run(e,t,i,s=0){const n=new xf(e,t,i,s);return n.executeNext(),n}static SyncAsyncForLoop(e,t,i,s,n,o=0){return xf.Run(Math.ceil(e/t),c=>{n&&n()?c.breakLoop():setTimeout(()=>{for(let h=0;h<t;++h){const f=c.index*t+h;if(f>=e)break;if(i(f),n&&n()){c.breakLoop();break}}c.executeNext()},o)},s)}}function nm(a,e,t){try{const i=a.next();i.done?e(i):i.value?i.value.then(()=>{i.value=void 0,e(i)},t):e(i)}catch(i){t(i)}}function bC(a=25){let e;return(t,i,s)=>{const n=performance.now();e===void 0||n-e>a?(e=n,setTimeout(()=>{nm(t,i,s)},0)):nm(t,i,s)}}function Dv(a,e,t,i,s){const n=()=>{let o;const c=h=>{h.done?t(h.value):o===void 0?o=!0:n()};do o=void 0,e(a,c,i),o===void 0&&(o=!1);while(o)};n()}function Om(a,e){let t;return Dv(a,nm,i=>t=i,i=>{throw i}),t}async function yC(a,e,t){return await new Promise((i,s)=>{Dv(a,e,i,s)})}function TC(a,e){return(...t)=>Om(a(...t))}class Ts{constructor(e){this.length=0,this.data=new Array(e),this._id=Ts._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}}Ts._GlobalId=0;class Na extends Ts{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 i=(e.data||e)[t];this.pushNoDuplicate(i)}}}}class vC{constructor(){this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new Me,this._onEffectiveEnabledStateChangedObservable=null,this._onClonedObservable=new Me,this._inheritVisibility=!1,this._isVisible=!0}}let el=(()=>{var a;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,m=[],g=[],x,y=[],b=[];return a=class{static AddNodeConstructor(E,R){this._NodeConstructors[E]=R}static Construct(E,R,C,O){const M=this._NodeConstructors[E];return M?M(R,C,O):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 R=this._parentNode;if(this._parentNode&&this._parentNode._children!==void 0&&this._parentNode._children!==null){const C=this._parentNode._children.indexOf(this);C!==-1&&this._parentNode._children.splice(C,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),R||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,R=E.length-1;E[this._nodeDataStorage._sceneRootNodesIndex]=E[R],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 Me)}get onClonedObservable(){return this._nodeDataStorage._onClonedObservable}constructor(E,R=null,C=!0){this._isDirty=!1,this._nodeDataStorage=new vC,this.name=N(this,t,void 0),this.id=(N(this,i),N(this,n,void 0)),this.uniqueId=(N(this,o),N(this,h,void 0)),this.state=(N(this,f),N(this,m,"")),this.metadata=(N(this,g),N(this,y,null)),this._internalMetadata=N(this,b),this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new Me,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=se.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new Me,this._onDisposeObserver=null,this._behaviors=new Array,this.name=E,this.id=E,this._scene=R||mt.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),C&&this._addToSceneRootNodes()}getScene(){return this._scene}getEngine(){return this._scene.getEngine()}addBehavior(E,R=!1){return this._behaviors.indexOf(E)!==-1?this:(E.init(),this._scene.isLoading&&!R?this._scene.onDataLoadedObservable.addOnce(()=>{this._behaviors.includes(E)&&E.attach(this)}):E.attach(this),this._behaviors.push(E),this)}removeBehavior(E){const R=this._behaviors.indexOf(E);return R===-1?this:(this._behaviors.splice(R,1),E.detach(),this)}get behaviors(){return this._behaviors}getBehaviorByName(E){for(const R of this._behaviors)if(R.name===E)return R;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,R=!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(),R=E?this.isEnabled():null;if(this._nodeDataStorage._isParentEnabled=this._parentNode?this._parentNode.isEnabled():!0,this._children)for(const C of this._children)C._syncParentEnabledState();if(E){const C=this.isEnabled();C!==R&&this._nodeDataStorage._onEffectiveEnabledStateChangedObservable.notifyObservers(C)}}setEnabled(E){if(this._nodeDataStorage._isEnabled===E)return;const R=this._hasEffectiveEnabledStateObservers(),C=R?this.isEnabled():null;if(this._nodeDataStorage._isEnabled=E,this._syncParentEnabledState(),this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(E),R){const O=this.isEnabled();O!==C&&this._nodeDataStorage._onEffectiveEnabledStateChangedObservable.notifyObservers(O)}}isDescendantOf(E){return this.parent?this.parent===E?!0:this.parent.isDescendantOf(E):!1}_getDescendants(E,R=!1,C){if(this._children)for(let O=0;O<this._children.length;O++){const M=this._children[O];(!C||C(M))&&E.push(M),R||M._getDescendants(E,!1,C)}}getDescendants(E,R){const C=[];return this._getDescendants(C,E,R),C}getChildMeshes(E,R){const C=[];return this._getDescendants(C,E,O=>(!R||R(O))&&O.cullingStrategy!==void 0),C}getChildren(E,R=!0){return this.getDescendants(R,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 R=0;R<this.animations.length;R++){const C=this.animations[R];if(C.name===E)return C}return null}createAnimationRange(E,R,C){if(!this._ranges[E]){this._ranges[E]=a._AnimationRangeFactory(E,R,C);for(let O=0,M=this.animations.length;O<M;O++)this.animations[O]&&this.animations[O].createRange(E,R,C)}}deleteAnimationRange(E,R=!0){for(let C=0,O=this.animations.length;C<O;C++)this.animations[C]&&this.animations[C].deleteRange(E,R);this._ranges[E]=null}getAnimationRange(E){return this._ranges[E]||null}clone(E,R,C){const O=xt.Clone(()=>
vendor: 6,210 bytes, line 292
292new a(E,this.getScene()),this);if(R&&(O.parent=R),!C){const M=this.getDescendants(!0);for(let I=0;I<M.length;I++){const P=M[I];P.clone(E+"."+P.name,O)}}return O}getAnimationRanges(){const E=[];let R;for(R in this._ranges)E.push(this._ranges[R]);return E}beginAnimation(E,R,C,O){const M=this.getAnimationRange(E);return M?this._scene.beginAnimation(this,M.from,M.to,R,C,O):null}serializeAnimationRanges(){const E=[];for(const R in this._ranges){const C=this._ranges[R];if(!C)continue;const O={};O.name=R,O.from=C.from,O.to=C.to,E.push(O)}return E}computeWorldMatrix(E){return this._worldMatrix||(this._worldMatrix=se.Identity()),this._worldMatrix}dispose(E,R=!1){if(this._nodeDataStorage._isDisposed=!0,!E){const C=this.getDescendants(!0);for(const O of C)O.dispose(E,R)}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 C of this._behaviors)C.detach();this._behaviors.length=0,this.metadata=null}static ParseAnimationRanges(E,R,C){if(R.ranges)for(let O=0;O<R.ranges.length;O++){const M=R.ranges[O];E.createAnimationRange(M.name,M.from,M.to)}}getHierarchyBoundingVectors(E=!0,R=null){this.getScene().incrementRenderId(),this.computeWorldMatrix(!0);let C,O;const M=this;if(M.getBoundingInfo&&M.subMeshes){const I=M.getBoundingInfo();C=I.boundingBox.minimumWorld.clone(),O=I.boundingBox.maximumWorld.clone()}else C=new D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),O=new D(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(E){const I=this.getDescendants(!1);for(const P of I){const L=P;if(L.computeWorldMatrix(!0),R&&!R(L)||!L.getBoundingInfo||L.getTotalVertices()===0)continue;const X=L.getBoundingInfo().boundingBox,re=X.minimumWorld,ae=X.maximumWorld;D.CheckExtends(re,C,O),D.CheckExtends(ae,C,O)}}return{min:C,max:O}}},(()=>{const v=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ce()],s=[ce()],c=[ce()],_=[ce()],x=[ce()],ee(null,null,e,{kind:"field",name:"name",static:!1,private:!1,access:{has:E=>"name"in E,get:E=>E.name,set:(E,R)=>{E.name=R}},metadata:v},t,i),ee(null,null,s,{kind:"field",name:"id",static:!1,private:!1,access:{has:E=>"id"in E,get:E=>E.id,set:(E,R)=>{E.id=R}},metadata:v},n,o),ee(null,null,c,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:E=>"uniqueId"in E,get:E=>E.uniqueId,set:(E,R)=>{E.uniqueId=R}},metadata:v},h,f),ee(null,null,_,{kind:"field",name:"state",static:!1,private:!1,access:{has:E=>"state"in E,get:E=>E.state,set:(E,R)=>{E.state=R}},metadata:v},m,g),ee(null,null,x,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:E=>"metadata"in E,get:E=>E.metadata,set:(E,R)=>{E.metadata=R}},metadata:v},y,b),v&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v})})(),a._AnimationRangeFactory=(v,E,R)=>{throw Je("AnimationRange")},a._NodeConstructors={},a})(),ds=(()=>{var a;let e=el,t=[],i,s=[],n=[],o,c=[],h=[],f,_,m,g,x,y=[],b=[],v,E=[],R=[],C,O=[],M=[],I,P=[],L=[],V,X,re,ae=[],de=[],U,te=[],Y=[],Z,q=[],j=[],Q,w=[],B=[],z,K=[],ue=[],he,ve=[],Le=[];return a=class extends e{get position(){return this._position}set position(J){this._position=J}set upVector(J){this._upVector=J}get upVector(){return this._upVector}get screenArea(){let J,_e;if(this.mode===a.PERSPECTIVE_CAMERA)this.fovMode===a.FOVMODE_VERTICAL_FIXED?(_e=this.minZ*2*Math.tan(this.fov/2),J=this.getEngine().getAspectRatio(this)*_e):(J=this.minZ*2*Math.tan(this.fov/2),_e=J/this.getEngine().getAspectRatio(this));else{const xe=this.getEngine().getRenderWidth()/2,Ne=this.getEngine().getRenderHeight()/2;J=(this.orthoRight??xe)-(this.orthoLeft??-xe),_e=(this.orthoTop??Ne)-(this.orthoBottom??-Ne)}return J*_e}set orthoLeft(J){this._orthoLeft=J;for(const _e of this._rigCameras)_e.orthoLeft=J}get orthoLeft(){return this._orthoLeft}set orthoRight(J){this._orthoRight=J;for(const _e of this._rigCameras)_e.orthoRight=J}get orthoRight(){return this._orthoRight}set orthoBottom(J){this._orthoBottom=J;for(const _e of this._rigCameras)_e.orthoBottom=J}get orthoBottom(){return this._orthoBottom}set orthoTop(J){this._orthoTop=J;for(const _e of this._rigCameras)_e.orthoTop=J}get orthoTop(){return this._orthoTop}setFocalLength(J,_e=36){this.fov=2*Math.atan(_e/(2*J))}get inertia(){return this._baseInertia}set inertia(J){this._baseInertia=J}set mode(J){this._mode=J;for(const _e of this._rigCameras)_e.mode=J}get mode(){return this._mode}get hasMoved(){return this._hasMoved}constructor(J,_e,xe,Ne=!0){Em(),super(J,xe,!1),this.inputs=N(this,t),this._position=N(this,s,D.Zero()),this._upVector=(N(this,n),N(this,c,D.Up())),this.oblique=(N(this,h),null),this._orthoLeft=null,this._orthoRight=null,this._orthoBottom=null,this._orthoTop=null,this.fov=N(this,y,.8),this.projectionPlaneTilt=(N(this,b),N(this,E,0)),this.minZ=(N(this,R),N(this,O,1)),this.maxZ=(N(this,M),N(this,P,1e4)),this._baseInertia=(N(this,L),.9),this._mode=a.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new hf(0,0,1,1),this.layerMask=N(this,ae,268435455),this.fovMode=(N(this,de),N(this,te,a.FOVMODE_VERTICAL_FIXED)),this.cameraRigMode=(N(this,Y),N(this,q,a.RIG_MODE_NONE)),this.interaxialDistance=(N(this,j),N(this,w,void 0)),this.isStereoscopicSideBySide=(N(this,B),N(this,K,void 0)),this.ignoreCameraMaxZ=(N(this,ue),N(this,ve,!1)),this.customRenderTargets=(N(this,Le),[]),this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new Me,this.onProjectionMatrixChangedObservable=new Me,this.onAfterCheckInputsObservable=new Me,this.onRestoreStateObservable=new Me,this.isRigCamera=!1,this._hasMoved=!1,this._rigCameras=new Array,this._skipRendering=!1,this._projectionMatrix=new se,this._postProcesses=new Array,this._activeMeshes=new Ts(256),this._globalPosition=D.Zero(),this._computedViewMatrix=se.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=se.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=Be.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.layerMask=this.getScene().defaultCameraLayerMask,this.get
vendor: 9,215 bytes, line 292
292Scene().addCamera(this),Ne&&!this.getScene().activeCamera&&(this.getScene().activeCamera=this),this.position=_e,this.renderPassId=this.getScene().getEngine().createRenderPassId(`Camera ${J}`)}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(J){let _e="Name: "+this.name;if(_e+=", type: "+this.getClassName(),this.animations)for(let xe=0;xe<this.animations.length;xe++)_e+=", animation[0]: "+this.animations[xe].toString(J);return _e}applyVerticalCorrection(){const J=this.absoluteRotation.toEulerAngles();this.projectionPlaneTilt=this._scene.useRightHandedSystem?-J.x:J.x}get globalPosition(){return this._globalPosition}getActiveMeshes(){return this._activeMeshes}isActiveMesh(J){return this._activeMeshes.indexOf(J)!==-1}isReady(J=!1){if(J){for(const _e of this._postProcesses)if(_e&&!_e.isReady())return!1}return super.isReady(J)}_initCache(){super._initCache(),this._cache.position=new D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new D(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(J){J||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 J=this.ignoreCameraMaxZ?0:this.maxZ;let _e=this._cache.mode===this.mode&&this._cache.minZ===this.minZ&&this._cache.maxZ===J;if(!_e)return!1;const xe=this.getEngine();return this.mode===a.PERSPECTIVE_CAMERA?_e=this._cache.fov===this.fov&&this._cache.fovMode===this.fovMode&&this._cache.aspectRatio===xe.getAspectRatio(this)&&this._cache.projectionPlaneTilt===this.projectionPlaneTilt:(_e=this._cache.orthoLeft===this.orthoLeft&&this._cache.orthoRight===this.orthoRight&&this._cache.orthoBottom===this.orthoBottom&&this._cache.orthoTop===this.orthoTop&&this._cache.renderWidth===xe.getRenderWidth()&&this._cache.renderHeight===xe.getRenderHeight(),this.oblique&&(_e=_e&&this._cache.obliqueAngle===this.oblique.angle&&this._cache.obliqueLength===this.oblique.length&&this._cache.obliqueOffset===this.oblique.offset)),_e}attachControl(J,_e){}detachControl(J){}update(){this._hasMoved=!1,this._checkInputs(),this.cameraRigMode!==a.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 J=0;J<this._postProcesses.length;J++)if(this._postProcesses[J]!==null)return this._postProcesses[J];return null}_cascadePostProcessesToRigCams(){const J=this._getFirstPostProcess();J&&J.markTextureDirty();for(let _e=0,xe=this._rigCameras.length;_e<xe;_e++){const Ne=this._rigCameras[_e],Qe=Ne._rigPostProcess;Qe?(Qe.getEffectName()==="pass"&&(Ne.isIntermediate=this._postProcesses.length===0),Ne._postProcesses=this._postProcesses.slice(0).concat(Qe),Qe.markTextureDirty()):Ne._postProcesses=this._postProcesses.slice(0)}}attachPostProcess(J,_e=null){return!J.isReusable()&&this._postProcesses.indexOf(J)>-1?(pe.Error("You're trying to reuse a post process not defined as reusable."),0):(_e==null||_e<0?this._postProcesses.push(J):this._postProcesses[_e]===null?this._postProcesses[_e]=J:this._postProcesses.splice(_e,0,J),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(J))}detachPostProcess(J){const _e=this._postProcesses.indexOf(J);_e!==-1&&(this._postProcesses[_e]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()}getWorldMatrix(){return this._isSynchronizedViewMatrix()?this._worldMatrix:(this.getViewMatrix(),this._worldMatrix)}_getViewMatrix(){return se.Identity()}getViewMatrix(J){return!J&&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(J){this._doNotComputeProjectionMatrix=!0,J!==void 0&&(this._projectionMatrix=J)}unfreezeProjectionMatrix(){this._doNotComputeProjectionMatrix=!1}getProjectionMatrix(J){if(this._doNotComputeProjectionMatrix||!J&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;const _e=this.ignoreCameraMaxZ?0:this.maxZ;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=_e,this._refreshFrustumPlanes=!0;const xe=this.getEngine(),Ne=this.getScene(),Qe=xe.useReverseDepthBuffer;if(this.mode===a.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=xe.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1);let He;Ne.useRightHandedSystem?He=se.PerspectiveFovRHToRef:He=se.PerspectiveFovLHToRef,He(this.fov,xe.getAspectRatio(this),Qe?_e:this.minZ,Qe?this.minZ:_e,this._projectionMatrix,this.fovMode===a.FOVMODE_VERTICAL_FIXED,xe.isNDCHalfZRange,this.projectionPlaneTilt,Qe)}else{const He=xe.getRenderWidth()/2,dt=xe.getRenderHeight()/2;Ne.useRightHandedSystem?this.oblique?se.ObliqueOffCenterRHToRef(this.orthoLeft??-He,this.orthoRight??He,this.orthoBottom??-dt,this.orthoTop??dt,Qe?_e:this.minZ,Qe?this.minZ:_e,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,xe.isNDCHalfZRange):se.OrthoOffCenterRHToRef(this.orthoLeft??-He,this.orthoRight??He,this.orthoBottom??-dt,this.orthoTop??dt,Qe?_e:this.minZ,Qe?this.minZ:_e,this._projectionMatrix,xe.isNDCHalfZRange):this.oblique?se.ObliqueOffCenterLHToRef(this.orthoLeft??-He,this.orthoRight??He,this.orthoBottom??-dt,this.orthoTop??dt,Qe?_e:this.minZ,Qe?this.minZ:_e,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,xe.isNDCHalfZRange):se.OrthoOffCenterLHToRef(this.orthoLeft??-He,this.orthoRight??He,this.orthoBottom??-dt,this.orthoTop??dt,Qe?_e:this.minZ,Qe?this.minZ:_e,this._projectionMatrix,xe.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=xe.getRenderWidth(),this._cache.renderHeight=xe.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_computeObliqueDistance(J){const _e=this,xe=this;return(_e.radius||(xe.target?D.Distance(this.position,xe.target):this.position.length()))+J}_updateFrustumPlanes(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?lr.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=lr.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)}isInFrustum(J,_e=!1){if(this._updateFrustumPlanes(),_e&&this.rigCameras.length>0){let xe=!1;for(const Ne of this.rigCameras)Ne._updateFrustumPlanes(),xe=xe||J.isInFrustum(Ne._frustumPlanes);return xe}else return J.isInFrustum(this._frustumPlanes)}isCompletelyInFrustum(J){return this._updateFrustumPlanes(),J.isCompletelyInFrustum(this._frustumPlanes)}getForwardRay(J=100,_e,xe){throw Je("Ray")}getForwardRayToRef(J,_e=100,xe,Ne){throw Je("Ray")}dispose(J,_e=!1){for(this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.get
vendor: 9,130 bytes, line 292
292Scene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){const Ne=this._rigCameras.pop();Ne&&Ne.dispose()}if(this._parentContainer){const Ne=this._parentContainer.cameras.indexOf(this);Ne>-1&&this._parentContainer.cameras.splice(Ne,1),this._parentContainer=null}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses.length=0;else if(this.cameraRigMode!==a.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses.length=0;else{let Ne=this._postProcesses.length;for(;--Ne>=0;){const Qe=this._postProcesses[Ne];Qe&&Qe.dispose(this)}}let xe=this.customRenderTargets.length;for(;--xe>=0;)this.customRenderTargets[xe].dispose();this.customRenderTargets.length=0,this._activeMeshes.dispose(),this.getScene().getEngine().releaseRenderPassId(this.renderPassId),super.dispose(J,_e)}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(J,_e){if(this.cameraRigMode!==J){for(;this._rigCameras.length>0;){const xe=this._rigCameras.pop();xe&&xe.dispose()}if(this.cameraRigMode=J,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=_e.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=this._cameraRigParams.interaxialDistance/.0637*(Math.PI/180),this.cameraRigMode!==a.RIG_MODE_NONE){const xe=this.createRigCamera(this.name+"_L",0);xe&&(xe._isLeftCamera=!0);const Ne=this.createRigCamera(this.name+"_R",1);Ne&&(Ne._isRightCamera=!0),xe&&Ne&&(this._rigCameras.push(xe),this._rigCameras.push(Ne))}this._setRigMode(_e),this._cascadePostProcessesToRigCams(),this.update()}}_setRigMode(J){}_getVRProjectionMatrix(){return se.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(J,_e){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[J]=_e,J==="interaxialDistance"&&(this._cameraRigParams.stereoHalfAngle=_e/.0637*(Math.PI/180))}createRigCamera(J,_e){return null}_updateRigCameras(){for(let J=0;J<this._rigCameras.length;J++)this._rigCameras[J].minZ=this.minZ,this._rigCameras[J].maxZ=this.ignoreCameraMaxZ?0:this.maxZ,this._rigCameras[J].fov=this.fov,this._rigCameras[J].upVector.copyFrom(this.upVector);this.cameraRigMode===a.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)}_setupInputs(){}serialize(){const J=xt.Serialize(this);return J.uniqueId=this.uniqueId,J.type=this.getClassName(),this.parent&&this.parent._serializeAsParent(J),this.inputs&&this.inputs.serialize(J),xt.AppendSerializedAnimations(this,J),J.ranges=this.serializeAnimationRanges(),J.isEnabled=this.isEnabled(),J}clone(J,_e=null){const xe=xt.Clone(a.GetConstructorFromName(this.getClassName(),J,this.getScene(),this.interaxialDistance,this.isStereoscopicSideBySide),this);return xe.name=J,xe.parent=_e,this.onClonedObservable.notifyObservers(xe),xe}getDirection(J){const _e=D.Zero();return this.getDirectionToRef(J,_e),_e}get absoluteRotation(){return this.getWorldMatrix().decompose(void 0,this._absoluteRotation),this._absoluteRotation}getDirectionToRef(J,_e){D.TransformNormalToRef(J,this.getWorldMatrix(),_e)}static GetConstructorFromName(J,_e,xe,Ne=0,Qe=!0){const He=el.Construct(J,_e,xe,{interaxial_distance:Ne,isStereoscopicSideBySide:Qe});return He||(()=>a._CreateDefaultParsedCamera(_e,xe))}computeWorldMatrix(){return this.getWorldMatrix()}_calculateHandednessMultiplier(){let J=this.getScene().useRightHandedSystem?-1:1;return this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(J*=-1),J}},(()=>{const ke=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[ua("position")],o=[ua("upVector")],f=[ce()],_=[ce()],m=[ce()],g=[ce()],x=[ce()],v=[ce()],C=[ce()],I=[ce()],V=[ce()],X=[ce()],re=[ce()],U=[ce()],Z=[ce()],Q=[ce()],z=[ce()],he=[ce()],ee(a,null,f,{kind:"getter",name:"orthoLeft",static:!1,private:!1,access:{has:J=>"orthoLeft"in J,get:J=>J.orthoLeft},metadata:ke},null,t),ee(a,null,_,{kind:"getter",name:"orthoRight",static:!1,private:!1,access:{has:J=>"orthoRight"in J,get:J=>J.orthoRight},metadata:ke},null,t),ee(a,null,m,{kind:"getter",name:"orthoBottom",static:!1,private:!1,access:{has:J=>"orthoBottom"in J,get:J=>J.orthoBottom},metadata:ke},null,t),ee(a,null,g,{kind:"getter",name:"orthoTop",static:!1,private:!1,access:{has:J=>"orthoTop"in J,get:J=>J.orthoTop},metadata:ke},null,t),ee(a,null,V,{kind:"getter",name:"inertia",static:!1,private:!1,access:{has:J=>"inertia"in J,get:J=>J.inertia},metadata:ke},null,t),ee(a,null,X,{kind:"getter",name:"mode",static:!1,private:!1,access:{has:J=>"mode"in J,get:J=>J.mode},metadata:ke},null,t),ee(null,null,i,{kind:"field",name:"_position",static:!1,private:!1,access:{has:J=>"_position"in J,get:J=>J._position,set:(J,_e)=>{J._position=_e}},metadata:ke},s,n),ee(null,null,o,{kind:"field",name:"_upVector",static:!1,private:!1,access:{has:J=>"_upVector"in J,get:J=>J._upVector,set:(J,_e)=>{J._upVector=_e}},metadata:ke},c,h),ee(null,null,x,{kind:"field",name:"fov",static:!1,private:!1,access:{has:J=>"fov"in J,get:J=>J.fov,set:(J,_e)=>{J.fov=_e}},metadata:ke},y,b),ee(null,null,v,{kind:"field",name:"projectionPlaneTilt",static:!1,private:!1,access:{has:J=>"projectionPlaneTilt"in J,get:J=>J.projectionPlaneTilt,set:(J,_e)=>{J.projectionPlaneTilt=_e}},metadata:ke},E,R),ee(null,null,C,{kind:"field",name:"minZ",static:!1,private:!1,access:{has:J=>"minZ"in J,get:J=>J.minZ,set:(J,_e)=>{J.minZ=_e}},metadata:ke},O,M),ee(null,null,I,{kind:"field",name:"maxZ",static:!1,private:!1,access:{has:J=>"maxZ"in J,get:J=>J.maxZ,set:(J,_e)=>{J.maxZ=_e}},metadata:ke},P,L),ee(null,null,re,{kind:"field",name:"layerMask",static:!1,private:!1,access:{has:J=>"layerMask"in J,get:J=>J.layerMask,set:(J,_e)=>{J.layerMask=_e}},metadata:ke},ae,de),ee(null,null,U,{kind:"field",name:"fovMode",static:!1,private:!1,access:{has:J=>"fovMode"in J,get:J=>J.fovMode,set:(J,_e)=>{J.fovMode=_e}},metadata:ke},te,Y),ee(null,null,Z,{kind:"field",name:"cameraRigMode",static:!1,private:!1,access:{has:J=>"cameraRigMode"in J,get:J=>J.cameraRigMode,set:(J,_e)=>{J.cameraRigMode=_e}},metadata:ke},q,j),ee(null,null,Q,{kind:"field",name:"interaxialDistance",static:!1,private:!1,access:{has:J=>"interaxialDistance"in J,get:J=>J.interaxialDistance,set:(J,_e)=>{J.interaxialDistance=_e}},metadata:ke},w,B),ee(null,null,z,{kind:"field",name:"isStereoscopicSideBySide",static:!1,private:!1,access:{has:J=>"isStereoscopicSideBySide"in J,get:J=>J.isStereoscopicSideBySide,set:(J,_e)=>{J.isStereoscopicSideBySide=_e}},metadata:ke},K,ue),ee(null,null,he,{kind:"field",name:"ignoreCameraMaxZ",static:!1,private:!1,access:{has:J=>"ignoreCameraMaxZ"in J,get:J=>J.ignoreCameraMaxZ,set:(J,_e)=>{J.ignoreCameraMaxZ=_e}},metadata:ke},ve,Le),ke&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ke})})(),a._CreateDefaultParsedCamera=(ke,J)=>{throw Je("UniversalCamera")},a.PERSPECTIVE_CAMERA=0,a.ORTHOGRAPHIC_CAMERA=1,a.FOVMODE_VERTICAL_FIXED=0,a.FOVMODE_HORIZONTAL_FIXED=1,a.RIG_MODE_NONE=0,a.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,a.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,a.RIG_MODE_STEREOSCOPIC_INTERLACED=14,a.RIG_MODE_VR=20,a.RIG_MODE_CUSTOM=22,a.ForceAttachControlToAlwaysPreventDefault=!1,a})();function EC(a,e){const t=a.type,i=ds.GetConstructorFromName(t,a.name,e,a.interaxial_distance,a.isStereoscopicSideBySide),s=xt.Parse(i,a,e);if(a.parentId!==void 0&&(s._waitingParentId=a.parentId),a.parentInstanceIndex!==void 0&&(s._waitingParentInstanceIndex=a.parentInstanceIndex),s.inputs&&(s.inputs.parse(a),s._setupInputs()),a.upVector&&(s.upVector=D.FromArray(a.upVector)),s.setPosition&&(s.position.copyFromFloats(0,0,0),s.setPosition(D.FromArray(a.position))),a.target&&s.setTarget&&s.setTarget(D.FromArray(a.target)),a.cameraRigMode){const n=a.interaxial_distance?{interaxialDistance:a.interaxial_distance}:{};s.setCameraRigMode(a.cameraRigMode,n)}if(a.animations){for(let n=0;n<a.animations.length;n++){const o=a.animations[n],c=cf("BABYLON.Animation");c&&s.animations.push(c.Parse(o))}el.ParseAnimationRanges(s,a,e)}return a.autoAnimate&&e.beginAnimation(s,a.autoAnimateFrom,a.autoAnimateTo,a.autoAnimateLoop,a.autoAnimateSpeed||1),a.isEnabled!==void 0&&s.setEnabled(a.isEnabled),s}let Yb=!1;function AC(){Yb||(Yb=!0,ds.Parse=EC)}class bf{get isDisposed(){return this._isDisposed}constructor(e,t,i,s=0,n=!1,o=!1,c=!1,h,f){this._isAlreadyOwned=!1,this._isDisposed=!1,dv(),e&&e.getSce
vendor: 46,576 bytes, line 292
292ne?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=i,this._instanced=o,this._divisor=h||1,this._label=f,t instanceof Yc?(this._data=null,this._buffer=t):(this._data=t,this._buffer=null),this.byteStride=c?s:s*Float32Array.BYTES_PER_ELEMENT,n||this.create()}createVertexBuffer(e,t,i,s,n,o=!1,c){const h=o?t:t*Float32Array.BYTES_PER_ELEMENT,f=s?o?s:s*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new k(this._engine,this,e,this._updatable,!0,f,n===void 0?this._instanced:n,h,i,void 0,void 0,!0,this._divisor||c)}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}pe.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,i,s=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,s?t:t*Float32Array.BYTES_PER_ELEMENT,i?i*this.byteStride:void 0),t===0&&i===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 k{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,i,s,n,o,c,h,f,_,m=!1,g=!1,x=1,y=!1){this._isDisposed=!1;let b;if(this.engine=e,typeof s=="object"&&s!==null?(b=s.updatable??!1,n=s.postponeInternalCreation,o=s.stride,c=s.instanced,h=s.offset,f=s.size,_=s.type,m=s.normalized??!1,g=s.useBytes??!1,x=s.divisor??1,y=s.takeBufferOwnership??!1,this._label=s.label):b=!!s,t instanceof bf?(this._buffer=t,this._ownsBuffer=y):(this._buffer=new bf(e,t,b,o,n,c,g,x,this._label),this._ownsBuffer=!0),this.uniqueId=k._Counter++,this._kind=i,_===void 0){const E=this.getData();this.type=E?RC(E):k.FLOAT}else this.type=_;const v=ca(this.type);g?(this._size=f||(o?o/v:am(i)),this.byteStride=o||this._buffer.byteStride||this._size*v,this.byteOffset=h||0):(this._size=f||o||am(i),this.byteStride=o?o*v:this._buffer.byteStride||this._size*v,this.byteOffset=(h||0)*v),this.normalized=m,this._instanced=c!==void 0?c:!1,this._instanceDivisor=c?x:0,this._alignBuffer(),this._computeHashCode()}static _GetTypeHashIndex(e){switch(e){case k.BYTE:return 0;case k.UNSIGNED_BYTE:return 1;case k.SHORT:return 2;case k.UNSIGNED_SHORT:return 3;case k.INT:return 4;case k.UNSIGNED_INT:return 5;case k.FLOAT:return 6;case k.HALF_FLOAT:return 7;default:throw new Error(`Invalid vertex buffer type '${e}'`)}}_computeHashCode(){this.hashCode=(k._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 i=this.getData();return i?tC(i,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/ca(this.type)}getOffset(){return this.byteOffset/ca(this.type)}getSize(e=!1){return e?this._size*ca(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,i=!1){this._buffer.updateDirectly(e,t,void 0,i),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(e,t){Pf(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,e,this.normalized,(i,s)=>{for(let n=0;n<this._size;n++)t(i[n],s+n)})}_alignBuffer(){}}k._Counter=0;k.BYTE=5120;k.UNSIGNED_BYTE=5121;k.SHORT=5122;k.UNSIGNED_SHORT=5123;k.INT=5124;k.UNSIGNED_INT=5125;k.FLOAT=5126;k.HALF_FLOAT=5131;k.PositionKind="position";k.NormalKind="normal";k.TangentKind="tangent";k.UVKind="uv";k.UV2Kind="uv2";k.UV3Kind="uv3";k.UV4Kind="uv4";k.UV5Kind="uv5";k.UV6Kind="uv6";k.ColorKind="color";k.ColorInstanceKind="instanceColor";k.MatricesIndicesKind="matricesIndices";k.MatricesWeightsKind="matricesWeights";k.MatricesIndicesExtraKind="matricesIndicesExtra";k.MatricesWeightsExtraKind="matricesWeightsExtra";function am(a){switch(a){case k.UVKind:case k.UV2Kind:case k.UV3Kind:case k.UV4Kind:case k.UV5Kind:case k.UV6Kind:return 2;case k.NormalKind:case k.PositionKind:return 3;case k.ColorKind:case k.ColorInstanceKind:case k.MatricesIndicesKind:case k.MatricesIndicesExtraKind:case k.MatricesWeightsKind:case k.MatricesWeightsExtraKind:case k.TangentKind:return 4;default:throw new Error("Invalid kind '"+a+"'")}}function RC(a){return a instanceof Int8Array?k.BYTE:a instanceof Uint8Array?k.UNSIGNED_BYTE:a instanceof Int16Array?k.SHORT:a instanceof Uint16Array?k.UNSIGNED_SHORT:a instanceof Int32Array?k.INT:a instanceof Uint32Array?k.UNSIGNED_INT:k.FLOAT}class qb{constructor(e,t,i){this.bu=e,this.bv=t,this.distance=i,this.faceId=0,this.subMeshId=0,this._internalSubMeshId=0}}class bn{constructor(e,t,i){this.vectors=vn(8,D.Zero),this.center=D.Zero(),this.centerWorld=D.Zero(),this.extendSize=D.Zero(),this.extendSizeWorld=D.Zero(),this.directions=vn(3,D.Zero),this.vectorsWorld=vn(8,D.Zero),this.minimumWorld=D.Zero(),this.maximumWorld=D.Zero(),this.minimum=D.Zero(),this.maximum=D.Zero(),this._drawWrapperFront=null,this._drawWrapperBack=null,this.reConstruct(e,t,i)}reConstruct(e,t,i){const s=e.x,n=e.y,o=e.z,c=t.x,h=t.y,f=t.z,_=this.vectors;this.minimum.copyFromFloats(s,n,o),this.maximum.copyFromFloats(c,h,f),_[0].copyFromFloats(s,n,o),_[1].copyFromFloats(c,h,f),_[2].copyFromFloats(c,n,o),_[3].copyFromFloats(s,h,o),_[4].copyFromFloats(s,n,f),_[5].copyFromFloats(c,h,o),_[6].copyFromFloats(s,h,f),_[7].copyFromFloats(c,n,f),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=i||se.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){const t=bn._TmpVector3,i=this.maximum.subtractToRef(this.minimum,t[0]),s=i.length();i.normalizeFromLength(s);const n=s*e,o=i.scaleInPlace(n*.5),c=this.center.subtractToRef(o,t[1]),h=this.center.addToRef(o,t[2]);return this.reConstruct(c,h,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){const t=this.minimumWorld,i=this.maximumWorld,s=this.directions,n=this.vectorsWorld,o=this.vectors;if(e.isIdentity()){t.copyFrom(this.minimum),i.copyFrom(this.maximum);for(let c=0;c<8;++c)n[c].copyFrom(o[c]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),i.setAll(-Number.MAX_VALUE);for(let c=0;c<8;++c){const h=n[c];D.TransformCoordinatesToRef(o[c],e,h),t.minimizeInPlace(h),i.maximizeInPlace(h)}i.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),i.addToRef(t,this.centerWorld).scaleInPlace(.5)}D.FromArrayToRef(e.m,0,s[0]),D.FromArrayToRef(e.m,4,s[1]),D.FromArrayToRef(e.m,8,s[2]),this._worldMatrix=e}isInFrustum(e){return bn.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){return bn.IsCompletelyInFrustum(this.vectorsWorld,e)}intersectsPoint(e){const t=this.minimumWorld,i=this.maximumWorld,s=t.x,n=t.y,o=t.z,c=i.x,h=i.y,f=i.z,_=e.x,m=e.y,g=e.z,x=-Vt;return!(c-_<x||x>_-s||h-m<x||x>m-n||f-g<x||x>g-o)}intersectsSphere(e){return bn.IntersectsSphere(this.minimumWorld,this.maximumWorld,e.centerWorld,e.radiusWorld)}intersectsMinMax(e,t){const i=this.minimumWorld,s=this.maximumWorld,n=i.x,o=i.y,c=i.z,h=s.x,f=s.y,_=s.z,m=e.x,g=e.y,x=e.z,y=t.x,b=t.y,v=t.z;return!(h<m||n>y||f<g||o>b||_<x||c>v)}dispose(){this._drawWrapperFront?.dispose(),this._drawWrapperBack?.dispose()}static Intersects(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,i,s){const n=bn._TmpVector3[0];return D.ClampToRef(i,e,t,n),D.DistanceSquared(i,n)<=s*s}static IsCompletelyInFrustum(e,t){for(let i=0;i<6;++i){const s=t[i];for(let n=0;n<8;++n)if(s.dotCoordinate(e[n])<0)return!1}return!0}static IsInFrustum(e,t){for(let i=0;i<6;++i){let s=!0;const n=t[i];for(let o=0;o<8;++o)if(n.dotCoordinate(e[o])>=0){s=!1;break}if(s)return!1}return!0}}bn._TmpVector3=vn(3,D.Zero);class ja{constructor(e,t,i){this.center=D.Zero(),this.centerWorld=D.Zero(),this.minimum=D.Zero(),this.maximum=D.Zero(),this.reConstruct(e,t,i)}reConstruct(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);const s=D.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=s*.5,this._update(i||se.IdentityReadOnly)}scale(e){const t=ja._TmpVector3,i=this.maximum.subtractToRef(this.minimum,t[0]),s=i.length();i.normalizeFromLength(s);const n=s*e,o=i.scaleInPlace(n*.5),c=this.center.subtractToRef(o,t[1]),h=this.center.addToRef(o,t[2]);return this.reConstruct(c,h,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){if(e.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{D.TransformCoordinatesToRef(this.center,e,this.centerWorld);const t=ja._TmpVector3[0];D.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,i=this.radiusWorld;for(let s=0;s<6;s++)if(e[s].dotCoordinate(t)<=-i)return!1;return!0}isCenterInFrustum(e){const t=this.centerWorld;for(let i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0}intersectsPoint(e){const t=D.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld<t)}static Intersects(e,t){const i=D.DistanceSquared(e.centerWorld,t.centerWorld),s=e.radiusWorld+t.radiusWorld;return!(s*s<i)}static CreateFromCenterAndRadius(e,t,i){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 s=new ja(this._TmpVector3[0],this._TmpVector3[2]);return i?s._worldMatrix=i:s._worldMatrix=se.Identity(),s}}ja._TmpVector3=vn(3,D.Zero);const F_={min:0,max:0},B_={min:0,max:0},Kb=(a,e,t)=>{const i=D.Dot(e.centerWorld,a),s=Math.abs(D.Dot(e.directions[0],a))*e.extendSize.x,n=Math.abs(D.Dot(e.directions[1],a))*e.extendSize.y,o=Math.abs(D.Dot(e.directions[2],a))*e.extendSize.z,c=s+n+o;t.min=i-c,t.max=i+c},bs=(a,e,t)=>(Kb(a,e,F_),Kb(a,t,B_),!(F_.min>B_.max||B_.min>F_.max));class Ws{constructor(e,t,i){this._isLocked=!1,this.boundingBox=new bn(e,t,i),this.boundingSphere=new ja(e,t,i)}reConstruct(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)}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 i=Ws._TmpVector3[0].copyFrom(e).subtractInPlace(t),s=Ws._TmpVector3[1].copyFrom(e).addInPlace(t);return this.boundingBox.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this}encapsulate(e){const t=D.Minimize(this.minimum,e),i=D.Maximize(this.maximum,e);return this.reConstruct(t,i,this.boundingBox.getWorldMatrix()),this}encapsulateBoundingInfo(e){const t=ge.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);const i=ge.Vector3[0];return D.TransformCoordinatesToRef(e.boundingBox.minimumWorld,t,i),this.encapsulate(i),D.TransformCoordinatesToRef(e.boundingBox.maximumWorld,t,i),this.encapsulate(i),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,Ws._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(!ja.Intersects(this.boundingSphere,e.boundingSphere)||!bn.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;const i=this.boundingBox,s=e.boundingBox;return!(!bs(i.directions[0],i,s)||!bs(i.directions[1],i,s)||!bs(i.directions[2],i,s)||!bs(s.directions[0],i,s)||!bs(s.directions[1],i,s)||!bs(s.directions[2],i,s)||!bs(D.Cross(i.directions[0],s.directions[0]),i,s)||!bs(D.Cross(i.directions[0],s.directions[1]),i,s)||!bs(D.Cross(i.directions[0],s.directions[2]),i,s)||!bs(D.Cross(i.directions[1],s.directions[0]),i,s)||!bs(D.Cross(i.directions[1],s.directions[1]),i,s)||!bs(D.Cross(i.directions[1],s.directions[2]),i,s)||!bs(D.Cross(i.directions[2],s.directions[0]),i,s)||!bs(D.Cross(i.directions[2],s.directions[1]),i,s)||!bs(D.Cross(i.directions[2],s.directions[2]),i,s))}}Ws._TmpVector3=vn(2,D.Zero);let Iv=(()=>{var a;let e=[],t,i;return a=class{static extractMinAndMaxIndexed(n,o,c,h,f,_){for(let m=c;m<c+h;m++){const g=o[m]*3,x=n[g],y=n[g+1],b=n[g+2];f.minimizeInPlaceFromFloats(x,y,b),_.maximizeInPlaceFromFloats(x,y,b)}}static extractMinAndMax(n,o,c,h,f,_){for(let m=o,g=o*h;m<o+c;m++,g+=h){const x=n[g],y=n[g+1],b=n[g+2];f.minimizeInPlaceFromFloats(x,y,b),_.maximizeInPlaceFromFloats(x,y,b)}}},(()=>{const s=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[la.filter((...n)=>!Array.isArray(n[0])&&!Array.isArray(n[1]))],i=[la.filter((...n)=>!Array.isArray(n[0]))],ee(a,null,t,{kind:"method",name:"extractMinAndMaxIndexed",static:!0,private:!1,access:{has:n=>"extractMinAndMaxIndexed"in n,get:n=>n.extractMinAndMaxIndexed},metadata:s},null,e),ee(a,null,i,{kind:"method",name:"extractMinAndMax",static:!0,private:!1,access:{has:n=>"extractMinAndMax"in n,get:n=>n.extractMinAndMax},metadata:s},null,e),s&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),N(a,e)})(),a})();function SC(a,e,t,i,s=null){const n=new D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o=new D(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return Iv.extractMinAndMaxIndexed(a,e,t,i,n,o),s&&(n.x-=n.x*s.x+s.y,n.y-=n.y*s.x+s.y,n.z-=n.z*s.x+s.y,o.x+=o.x*s.x+s.y,o.y+=o.y*s.x+s.y,o.z+=o.z*s.x+s.y),{minimum:n,maximum:o}}function Pv(a,e,t,i=null,s){const n=new D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o=new D(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return s||(s=3),Iv.extractMinAndMax(a,e,t,s,n,o),i&&(n.x-=n.x*i.x+i.y,n.y-=n.y*i.x+i.y,n.z-=n.z*i.x+i.y,o.x+=o.x*i.x+i.y,o.y+=o.y*i.x+i.y,o.z+=o.z*i.x+i.y),{minimum:n,maximum:o}}class Ov{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,i=!0){this.effect=e,t!==void 0&&(this.defines=t),i&&this.drawContext?.reset()}dispose(e=!1){if(this.effect){const t=this.effect;e?t.dispose():fs.SetImmediate(()=>{t.getEngine().onEndFrameObservable.addOnce(()=>{t.dispose()})}),this.effect=null}this.drawContext?.dispose()}}var Zb;class Xs{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 i=this._drawWrappers[e];return!i&&t&&(this._drawWrappers[e]=i=new Ov(this._mesh.getScene().getEngine())),i}_removeDrawWrapper(e,t=!0,i=!1){t&&this._drawWrappers[e]?.dispose(i),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,i,s=!0){const n=this._drawWrapper;n.setEffect(e,t,s),i!==void 0&&(n.materialContext=i),e||(n.defines=null,n.materialContext=void 0)}resetDrawCache(e,t=!1){if(this._drawWrappers)if(e!==void 0){this._removeDrawWrapper(e,!0,t);return}else for(const i of this._drawWrappers)i?.dispose(t);this._drawWrappers=[]}static AddToMesh(e,t,i,s,n,o,c,h=!0){return new Xs(e,t,i,s,n,o,c,h)}constructor(e,t,i,s,n,o,c,h=!0,f=!0){this.materialIndex=e,this.verticesStart=t,this.verticesCount=i,this.indexStart=s,this.indexCount=n,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=o,this._renderingMesh=c||o,f&&o.subMeshes.push(this),this._engine=this._mesh.getScene().getEngine(),this.resetDrawCache(),this._trianglePlanes=[],this._id=o.subMeshes.length-1,h&&(this.refreshBoundingInfo(),o.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 i=t.getSubMaterial(this.materialIndex);return this._currentMaterial!==i&&(this._currentMaterial=i,this.resetDrawCache()),i}}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(k.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;const t=this._renderingMesh.getIndices();let i;if(this.indexStart===0&&this.indexCount===t.length){const s=this._renderingMesh.getBoundingInfo();i={minimum:s.minimum.clone(),maximum:s.maximum.clone()}}else i=SC(e,t,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new Ws(i.minimum,i.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 i=Math.floor(this.indexCount/3)*6,n=this.verticesStart+this.verticesCount>65535?new Uint32Array(i):new Uint16Array(i);let o=0;if(e.length===0)for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=3)n[o++]=c,n[o++]=c+1,n[o++]=c+1,n[o++]=c+2,n[o++]=c+2,n[o++]=c;else for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=3)n[o++]=e[c],n[o++]=e[c+1],n[o++]=e[c+1],n[o++]=e[c+2],n[o++]=e[c+2],n[o++]=e[c];this._linesIndexBuffer=t.createIndexBuffer(n),this._linesIndexCount=n.length}return this._linesIndexBuffer}canIntersects(e){const t=this.getBoundingInfo();return t?e.intersectsBox(t.boundingBox):!1}intersects(e,t,i,s,n){const o=this.getMaterial();if(!o)return null;let c=3,h=!1;switch(o.fillMode){case 3:case 5:case 6:case 8:return null;case 7:c=1,h=!0;break}return o.fillMode===4?i.length?this._intersectLines(e,t,i,this._mesh.intersectionThreshold,s):this._intersectUnIndexedLines(e,t,i,this._mesh.intersectionThreshold,s):!i.length&&this._mesh._unIndexed?this._intersectUnIndexedTriangles(e,t,i,s,n):this._intersectTriangles(e,t,i,c,h,s,n)}_intersectLines(e,t,i,s,n){let o=null;for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=2){const h=t[i[c]],f=t[i[c+1]],_=e.intersectionSegment(h,f,s);if(!(_<0)&&(n||!o||_<o.distance)&&(o=new qb(null,null,_),o.faceId=c/2,n))break}return o}_intersectUnIndexedLines(e,t,i,s,n){let o=null;for(let c=this.verticesStart;c<this.verticesStart+this.verticesCount;c+=2){const h=t[c],f=t[c+1],_=e.intersectionSegment(h,f,s);if(!(_<0)&&(n||!o||_<o.distance)&&(o=new qb(null,null,_),o.faceId=c/2,n))break}return o}_intersectTriangles(e,t,i,s,n,o,c){let h=null,f=-1;for(let _=this.indexStart;_<this.indexStart+this.indexCount-(3-s);_+=s){f++;const m=i[_],g=i[_+1],x=i[_+2];if(n&&x===4294967295){_+=2;continue}const y=t[m],b=t[g],v=t[x];if(!y||!b||!v||c&&!c(y,b,v,e,m,g,x))continue;const E=e.intersectsTriangle(y,b,v);if(E){if(E.distance<0)continue;if((o||!h||E.distance<h.distance)&&(h=E,h.faceId=f,o))break}}return h}_intersectUnIndexedTriangles(e,t,i,s,n){let o=null;for(let c=this.verticesStart;c<this.verticesStart+this.verticesCount;c+=3){const h=t[c],f=t[c+1],_=t[c+2];if(n&&!n(h,f,_,e,-1,-1,-1))continue;const m=e.intersectsTriangle(h,f,_);if(m){if(m.distance<0)continue;if((s||!o||m.distance<o.distance)&&(o=m,o.faceId=c/3,s))break}}return o}_rebuild(){this._linesIndexBuffer&&(this._linesIndexBuffer=null)}clone(e,t){const i=new Xs(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,e,t,!1);if(!this.IsGlobal){const s=this.getBoundingInfo();if(!s)return i;i._boundingInfo=new Ws(s.minimum,s.maximum)}return i}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,i,s,n,o=!0){let c=Number.MAX_VALUE,h=-Number.MAX_VALUE;const _=(n||s).getIndices();for(let m=t;m<t+i;m++){const g=_[m];g<c&&(c=g),g>h&&(h=g)}return new Xs(e,c,h-c+1,t,i,s,n,o)}}(Zb=Xs.prototype).projectToRef??(Zb.projectToRef=Xe("SubMesh","projectToRef"));class L_{}let Ue=(()=>{var a;let e=[],t,i,s,n;return a=class{constructor(){this.uniqueId=0,this.metadata={},this._applyTo=TC(this._applyToCoroutine.bind(this)),this.uniqueId=a._UniqueIdGenerator,a._UniqueIdGenerator++}set(c,h){switch(c.length||pe.Warn(`Setting vertex data kind '${h}' with an empty array`),h){case k.PositionKind:this.positions=c;break;case k.NormalKind:this.normals=c;break;case k.TangentKind:this.tangents=c;break;case k.UVKind:this.uvs=c;break;case k.UV2Kind:this.uvs2=c;break;case k.UV3Kind:this.uvs3=c;break;case k.UV4Kind:this.uvs4=c;break;case k.UV5Kind:this.uvs5=c;break;case k.UV6Kind:this.uvs6=c;break;case k.ColorKind:this.colors=c;break;case k.MatricesIndicesKind:this.matricesIndices=c;break;case k.MatricesWeightsKind:this.matricesWeights=c;break;case k.MatricesIndicesExtraKind:this.matricesIndicesExtra=c;break;case k.MatricesWeightsExtraKind:this.matricesWeightsExtra=c;break}}applyToMesh(c,h){return this._applyTo(c,h,!1),this}applyToGeometry(c,h){return this._applyTo(c,h,!1),this}updateMesh(c){return this._update(c),this}updateGeometry(c){return this._update(c),this}*_applyToCoroutine(c,h=!1,f){if(this.positions&&(c.setVerticesData(k.PositionKind,this.positions,h),f&&(yield)),this.normals&&(c.setVerticesData(k.NormalKind,this.normals,h),f&&(yield)),this.tangents&&(c.setVerticesData(k.TangentKind,this.tangents,h),f&&(yield)),this.uvs&&(c.setVerticesData(k.UVKind,this.uvs,h),f&&(yield)),this.uvs2&&(c.setVerticesData(k.UV2Kind,this.uvs2,h),f&&(yield)),this.uvs3&&(c.setVerticesData(k.UV3Kind,this.uvs3,h),f&&(yield)),this.uvs4&&(c.setVerticesData(k.UV4Kind,this.uvs4,h),f&&(yield)),this.uvs5&&(c.setVerticesData(k.UV5Kind,this.uvs5,h),f&&(yield)),this.uvs6&&(c.setVerticesData(k.UV6Kind,this.uvs6,h),f&&(yield)),this.colors){const _=this.positions&&this.colors.length===this.positions.length?3:4;c.setVerticesData(k.ColorKind,this.colors,h,_),this.hasVertexAlpha&&c.hasVertexAlpha!==void 0&&(c.hasVertexAlpha=!0),f&&(yield)}if(this.matricesIndices&&(c.setVerticesData(k.MatricesIndicesKind,this.matricesIndices,h),f&&(yield)),this.matricesWeights&&(c.setVerticesData(k.MatricesWeightsKind,this.matricesWeights,h),f&&(yield)),this.matricesIndicesExtra&&(c.setVerticesData(k.MatricesIndicesExtraKind,this.matricesIndicesExtra,h),f&&(yield)),this.matricesWeightsExtra&&(c.setVerticesData(k.MatricesWeightsExtraKind,this.matricesWeightsExtra,h),f&&(yield)),this.indices?(c.setIndices(this.indices,null,h),f&&(yield)):c.setIndices([],null),c.subMeshes&&this.materialInfos&&this.materialInfos.length>1){const _=c;_.subMeshes=[];for(const m of this.materialInfos)new Xs(m.materialIndex,m.verticesStart,m.verticesCount,m.indexStart,m.indexCount,_)}return this}_update(c,h,f){return this.positions&&c.updateVerticesData(k.PositionKind,this.positions,h,f),this.normals&&c.updateVerticesData(k.NormalKind,this.normals,h,f),this.tangents&&c.updateVerticesData(k.TangentKind,this.tangents,h,f),this.uvs&&c.updateVerticesData(k.UVKind,this.uvs,h,f),this.uvs2&&c.updateVerticesData(k.UV2Kind,this.uvs2,h,f),this.uvs3&&c.updateVerticesData(k.UV3Kind,this.uvs3,h,f),this.uvs4&&c.updateVerticesData(k.UV4Kind,this.uvs4,h,f),this.uvs5&&c.updateVerticesData(k.UV5Kind,this.uvs5,h,f),this.uvs6&&c.updateVerticesData(k.UV6Kind,this.uvs6,h,f),this.colors&&c.updateVerticesData(k.ColorKind,this.colors,h,f),this.matricesIndices&&c.updateVerticesData(k.MatricesIndicesKind,this.matricesIndices,h,f),this.matricesWeights&&c.updateVerticesData(k.MatricesWeightsKind,this.matricesWeights,h,f),this.matricesIndicesExtra&&c.updateVerticesData(k.MatricesIndicesExtraKind,this.matricesIndicesExtra,h,f),this.matricesWeightsExtra&&c.updateVerticesData(k.MatricesWeightsExtraKind,this.matricesWeightsExtra,h,f),this.indices&&c.setIndices(this.indices,null),this}static _TransformVector3Coordinates(c,h,f=0,_=c.length){const m=ge.Vector3[0],g=ge.Vector3[1];for(let x=f;x<f+_;x+=3)D.FromArrayToRef(c,x,m),D.TransformCoordinatesToRef(m,h,g),c[x]=g.x,c[x+1]=g.y,c[x+2]=g.z}static _TransformVector3Normals(c,h,f=0,_=c.length){const m=ge.Vector3[0],g=ge.Vector3[1];for(let x=f;x<f+_;x+=3)D.FromArrayToRef(c,x,m),D.TransformNormalToRef(m,h,g),c[x]=g.x,c[x+1]=g.y,c[x+2]=g.z}static _TransformVector4Normals(c,h,f=0,_=c.length){const m=ge.Vector4[0],g=ge.Vector4[1];for(let x=f;x<f+_;x+=4)at.FromArrayToRef(c,x,m),at.TransformNormalToRef(m,h,g),c[x]=g.x,c[x+1]=g.y,c[x+2]=g.z,c[x+3]=g.w}static _FlipFaces(c,h=0,f=c.length){for(let _=h;_<h+f;_+=3){const m=c[_+1];c[_+1]=c[_+2],c[_+2]=m}}transform(c){const h=c.determinant()<0;return this.positions&&a._TransformVector3Coordinates(this.positions,c),this.normals&&a._TransformVector3Normals(this.normals,c),this.tangents&&a._TransformVector4Normals(this.tangents,c),h&&this.indices&&a._FlipFaces(this.indices),this}splitBasedOnMaterialID(){if(!this.materialInfos||this.materialInfos.length<2)return[this];const c=[];for(const h of this.materialInfos){const f=new a;if(this.positions&&(f.positions=this.positions.slice(h.verticesStart*3,(h.verticesCount+h.verticesStart)*3)),this.normals&&(f.normals=this.normals.slice(h.verticesStart*3,(h.verticesCount+h.verticesStart)*3)),this.tangents&&(f.tangents=this.tangents.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.colors&&(f.colors=this.colors.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.uvs&&(f.uvs=this.uvs.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs2&&(f.uvs2=this.uvs2.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs3&&(f.uvs3=this.uvs3.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs4&&(f.uvs4=this.uvs4.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs5&&(f.uvs5=this.uvs5.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs6&&(f.uvs6=this.uvs6.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.matricesIndices&&(f.matricesIndices=this.matricesIndices.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesIndicesExtra&&(f.matricesIndicesExtra=this.matricesIndicesExtra.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesWeights&&(f.matricesWeights=this.matricesWeights.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesWeightsExtra&&(f.matricesWeightsExtra=this.matricesWeightsExtra.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.indices){f.indices=[];for(let m=h.indexStart;m<h.indexStart+h.indexCount;m++)f.indices.push(this.indices[m]-h.verticesStart)}const _=new L_;_.indexStart=0,_.indexCount=f.indices?f.indices.length:0,_.materialIndex=h.materialIndex,_.verticesStart=0,_.verticesCount=(f.positions?f.positions.length:0)/3,f.materialInfos=[_],c.push(f)}return c}merge(c,h=!1,f=!1,_=!1,m=!1){const g=Array.isArray(c)?c.map(x=>({vertexData:x})):[{vertexData:c}];return Om(this._mergeCoroutine(void 0,g,h,!1,f,_,m))}*_mergeCoroutine(c,h,f=!1,_,m,g=!1,x=!1){this._validate();let y=h.map(C=>C.vertexData),b=this;if(x)for(const C of y)C&&(C._validate(),!this.normals&&C.normals&&(this.normals=new Float32Array(this.positions.length)),!this.tangents&&C.tangents&&(this.tangents=new Float32Array(this.positions.length/3*4)),!this.uvs&&C.uvs&&(this.uvs=new Float32Array(this.positions.length/3*2)),!this.uvs2&&C.uvs2&&(this.uvs2=new Float32Array(this.positions.length/3*2)),!this.uvs3&&C.uvs3&&(this.uvs3=new Float32Array(this.positions.length/3*2)),!this.uvs4&&C.uvs4&&(this.uvs4=new Float32Array(this.positions.length/3*2)),!this.uvs5&&C.uvs5&&(this.uvs5=new Float32Array(this.positions.length/3*2)),!this.uvs6&&C.uvs6&&(this.uvs6=new Float32Array(this.positions.length/3*2)),!this.colors&&C.colors&&(this.colors=new Float32Array(this.positions.length/3*4),this.colors.fill(1)),!this.matricesIndices&&C.matricesIndices&&(this.matricesIndices=new Float32Array(this.positions.length/3*4)),!this.matricesWeights&&C.matricesWeights&&(this.matricesWeights=new Float32Array(this.positions.length/3*4)),!this.matricesIndicesExtra&&C.matricesIndicesExtra&&(this.matricesIndicesExtra=new Float32Array(this.positions.length/3*4)),!this.matricesWeightsExtra&&C.matricesWeightsExtra&&(this.matricesWeightsExtra=new Float32Array(this.positions.length/3*4)));for(const C of y)if(C){if(x)this.normals&&!C.normals&&(C.normals=new Float32Array(C.positions.length)),this.tangents&&!C.tangents&&(C.tangents=new Float32Array(C.positions.length/3*4)),this.uvs&&!C.uvs&&(C.uvs=new Float32Array(C.positions.length/3*2)),this.uvs2&&!C.uvs2&&(C.uvs2=new Float32Array(C.positions.length/3*2)),this.uvs3&&!C.uvs3&&(C.uvs3=new Float32Array(C.positions.length/3*2)),this.uvs4&&!C.uvs4&&(C.uvs4=new Float32Array(C.positions.length/3*2)),this.uvs5&&!C.uvs5&&(C.uvs5=new Float32Array(C.positions.length/3*2)),this.uvs6&&!C.uvs6&&(C.uvs6=new Float32Array(C.positions.length/3*2)),this.colors&&!C.colors&&(C.colors=new Float32Array(C.positions.length/3*4),C.colors.fill(1)),this.matricesIndices&&!C.matricesIndices&&(C.matricesIndices=new Float32Array(C.positions.length/3*4)),this.matricesWeights&&!C.matricesWeights&&(C.matricesWeights=new Float32Array(C.positions.length/3*4)),this.matricesIndicesExtra&&!C.matricesIndicesExtra&&(C.matricesIndicesExtra=new Float32Array(C.positions.length/3*4)),this.matricesWeightsExtra&&!C.matricesWeightsExtra&&(C.matricesWeightsExtra=new Float32Array(C.positions.length/3*4));else if(C._validate(),!this.normals!=!C.normals||!this.tangents!=!C.tangents||!this.uvs!=!C.uvs||!this.uvs2!=!C.uvs2||!this.uvs3!=!C.uvs3||!this.uvs4!=!C.uvs4||!this.uvs5!=!C.uvs5||!this.uvs6!=!C.uvs6||!this.colors!=!C.colors||!this.matricesIndices!=!C.matricesIndices||!this.matricesWeights!=!C.matricesWeights||!this.matricesIndicesExtra!=!C.matricesIndicesExtra||!this.matricesWeightsExtra!=!C.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes")}if(g){let C,O=0,M=0;const I=[];let P=null;const L=[];for(const X of this.splitBasedOnMaterialID())L.push({vertexData:X,transform:c});for(const X of h)if(X.vertexData)for(const re of X.vertexData.splitBasedOnMaterialID())L.push({vertexData:re,transform:X.transform});L.sort((X,re)=>{const ae=X.vertexData.materialInfos?X.vertexData.materialInfos[0].materialIndex:0,de=re.vertexData.materialInfos?re.vertexData.materialInfos[0].materialIndex:0;return ae>de?1:ae===de?0:-1});for(const X of L){const re=X.vertexData;if(re.materialInfos?C=re.materialInfos[0].materialIndex:C=0,P&&P.materialIndex===C)P.indexCount+=re.indices.length,P.verticesCount+=re.positions.length/3;else{const ae=new L_;ae.materialIndex=C,ae.indexStart=O,ae.indexCount=re.indices.length,ae.verticesStart=M,ae.verticesCount=re.positions.length/3,I.push(ae),P=ae}O+=re.indices.length,M+=re.positions.length/3}const V=L.splice(0,1)[0];b=V.vertexData,c=V.transform,y=L.map(X=>X.vertexData),h=L,this.materialInfos=I}const v=y.reduce((C,O)=>C+(O.indices?.length??0),b.indices?.length??0);let R=m||y.some(C=>C.indices===b.indices)?b.indices?.slice():b.indices;if(v>0){let C=R?.length??0;if(R||(R=new Array(v)),R.length!==v){if(Array.isArray(R))R.length=v;else{const M=f||R instanceof Uint32Array?new Uint32Array(v):new Uint16Array(v);M.set(R),R=M}c&&c.determinant()<0&&a._FlipFaces(R,0,C)}let O=b.positions?b.positions.length/3:0;for(const{vertexData:M,transform:I}of h)if(M.indices){for(let P=0;P<M.indices.length;P++)R[C+P]=M.indices[P]+O;I&&I.determinant()<0&&a._FlipFaces(R,C,M.indices.length),O+=M.positions.length/3,C+=M.indices.length,_&&(yield)}}return this.indices=R,this.positions=a._MergeElement(k.PositionKind,b.positions,c,h.map(C=>[C.vertexData.positions,C.transform])),_&&(yield),b.normals&&(this.normals=a._MergeElement(k.NormalKind,b.normals,c,h.map(C=>[C.vertexData.normals,C.transform])),_&&(yield)),b.tangents&&(this.tangents=a._MergeElement(k.TangentKind,b.tangents,c,h.map(C=>[C.vertexData.tangents,C.transform])),_&&(yield)),b.uvs&&(this.uvs=a._MergeElement(k.UVKind,b.uvs,c,h.map(C=>[C.vertexData.uvs,C.transform])),_&&(yield)),b.uvs2&&(this.uvs2=a._MergeElement(k.UV2Kind,b.uvs2,c,h.map(C=>[C.vertexData.uvs2,C.transform])),_&&(yield)),b.uvs3&&(this.uvs3=a._MergeElement(k.UV3Kind,b.uvs3,c,h.map(C=>[C.vertexData.uvs3,C.transform])),_&&(yield)),b.uvs4&&(this.uvs4=a._MergeElement(k.UV4Kind,b.uvs4,c,h.map(C=>[C.vertexData.uvs4,C.transform])),_&&(yield)),b.uvs5&&(this.uvs5=a._MergeElement(k.UV5Kind,b.uvs5,c,h.map(C=>[C.vertexData.uvs5,C.transform])),_&&(yield)),b.uvs6&&(this.uvs6=a._MergeElement(k.UV6Kind,b.uvs6,c,h.map(C=>[C.vertexData.uvs6,C.transform])),_&&(yield)),b.colors&&(this.colors=a._MergeElement(k.ColorKind,b.colors,c,h.map(C=>[C.vertexData.colors,C.transform])),(b.hasVertexAlpha!==void 0||h.some(C=>C.vertexData.hasVertexAlpha!==void 0))&&(this.hasVertexAlpha=b.hasVertexAlpha||h.some(C=>C.vertexData.hasVertexAlpha)),_&&(yield)),b.matricesIndices&&(this.matricesIndices=a._MergeElement(k.MatricesIndicesKind,b.matricesIndices,c,h.map(C=>[C.vertexData.matricesIndices,C.transform])),_&&(yield)),b.matricesWeights&&(this.matricesWeights=a._MergeElement(k.MatricesWeightsKind,b.matricesWeights,c,h.map(C=>[C.vertexData.matricesWeights,C.transform])),_&&(yield)),b.matricesIndicesExtra&&(this.matricesIndicesExtra=a._MergeElement(k.MatricesIndicesExtraKind,b.matricesIndicesExtra,c,h.map(C=>[C.vertexData.matricesIndicesExtra,C.transform])),_&&(yield)),b.matricesWeightsExtra&&(this.matricesWeightsExtra=a._MergeElement(k.MatricesWeightsExtraKind,b.matricesWeightsExtra,c,h.map(C=>[C.vertexData.matricesWeightsExtra,C.transform]))),this}static _MergeElement(c,h,f,_){const m=_.filter(y=>y[0]!==null&&y[0]!==void 0);if(!h&&m.length==0)return h;if(!h)return this._MergeElement(c,m[0][0],m[0][1],m.slice(1));const g=m.reduce((y,b)=>y+b[0].length,h.length),x=c===k.PositionKind?a._TransformVector3Coordinates:c===k.NormalKind?a._TransformVector3Normals:c===k.TangentKind?a._TransformVector4Normals:()=>{};if(h instanceof Float32Array){const y=new Float32Array(g);y.set(h),f&&x(y,f,0,h.length);let b=h.length;for(const[v,E]of m)y.set(v,b),E&&x(y,E,b,v.length),b+=v.length;return y}else{const y=new Array(g);for(let v=0;v<h.length;v++)y[v]=h[v];f&&x(y,f,0,h.length);let b=h.length;for(const[v,E]of m){for(let R=0;R<v.length;R++)y[b+R]=v[R];E&&x(y,E,b,v.length),b+=v.length}return y}}_validate(){if(!this.positions)throw new al("Positions are required",If.MeshInvalidPositionsError);const c=(_,m)=>{const g=am(_);if(m.length%g!==0)throw new Error("The "+_+"s array count must be a multiple of "+g);return m.length/g},h=c(k.PositionKind,this.positions),f=(_,m)=>{const g=c(_,m);if(g!==h)throw new Error("The "+_+"s element count ("+g+") does not match the positions count ("+h+")")};this.normals&&f(k.NormalKind,this.normals),this.tangents&&f(k.TangentKind,this.tangents),this.uvs&&f(k.UVKind,this.uvs),this.uvs2&&f(k.UV2Kind,this.uvs2),this.uvs3&&f(k.UV3Kind,this.uvs3),this.uvs4&&f(k.UV4Kind,this.uvs4),this.uvs5&&f(k.UV5Kind,this.uvs5),this.uvs6&&f(k.UV6Kind,this.uvs6),this.colors&&f(k.ColorKind,this.colors),this.matricesIndices&&f(k.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&f(k.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&f(k.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&f(k.MatricesWeightsExtraKind,this.matricesWeightsExtra)}clone(){const c=this.serialize();return a.Parse(c)}serialize(){const c={};if(this.positions&&(c.positions=Array.from(this.positions)),this.normals&&(c.normals=Array.from(this.normals)),this.tangents&&(c.tangents=Array.from(this.tangents)),this.uvs&&(c.uvs=Array.from(this.uvs)),this.uvs2&&(c.uvs2=Array.from(this.uvs2)),this.uvs3&&(c.uvs3=Array.from(this.uvs3)),this.uvs4&&(c.uvs4=Array.from(this.uvs4)),this.uvs5&&(c.uvs5=Array.from(this.uvs5)),this.uvs6&&(c.uvs6=Array.from(this.uvs6)),this.colors&&(c.colors=Array.from(this.colors),c.hasVertexAlpha=this.hasVertexAlpha),this.matricesIndices&&(c.matricesIndices=Array.from(this.matricesIndices),c.matricesIndicesExpanded=!0),this.matricesWeights&&(c.matricesWeights=Array.from(this.matricesWeights)),this.matricesIndicesExtra&&(c.matricesIndicesExtra=Array.from(this.matricesIndicesExtra),c.matricesIndicesExtraExpanded=!0),this.matricesWeightsExtra&&(c.matricesWeightsExtra=Array.from(this.matricesWeightsExtra)),c.indices=this.indices?Array.from(this.indices):[],this.materialInfos){c.materialInfos=[];for(const h of this.materialInfos){const f={indexStart:h.indexStart,indexCount:h.indexCount,materialIndex:h.materialIndex,verticesStart:h.verticesStart,verticesCount:h.verticesCount};c.materialInfos.push(f)}}return c}static ExtractFromMesh(c,h,f){return a._ExtractFrom(c,h,f)}static ExtractFromGeometry(c,h,f){return a._ExtractFrom(c,h,f)}static _ExtractFrom(c,h,f){const _=new a;if(c.isVerticesDataPresent(k.PositionKind)&&(_.positions=c.getVerticesData(k.PositionKind,h,f)),c.isVerticesDataPresent(k.NormalKind)&&(_.normals=c.getVerticesData(k.NormalKind,h,f)),c.isVerticesDataPresent(k.TangentKind)&&(_.tangents=c.getVerticesData(k.TangentKind,h,f)),c.isVerticesDataPresent(k.UVKind)&&(_.uvs=c.getVerticesData(k.UVKind,h,f)),c.isVerticesDataPresent(k.UV2Kind)&&(_.uvs2=c.getVerticesData(k.UV2Kind,h,f)),c.isVerticesDataPresent(k.UV3Kind)&&(_.uvs3=c.getVerticesData(k.UV3Kind,h,f)),c.isVerticesDataPresent(k.UV4Kind)&&(_.uvs4=c.getVerticesData(k.UV4Kind,h,f)),c.isVerticesDataPresent(k.UV5Kind)&&(_.uvs5=c.getVerticesData(k.UV5Kind,h,f)),c.isVerticesDataPresent(k.UV6Kind)&&(_.uvs6=c.getVerticesData(k.UV6Kind,h,f)),c.isVerticesDataPresent(k.ColorKind)){const m=c.geometry||c,g=m.getVertexBuffer(k.ColorKind),x=m.getVerticesData(k.ColorKind,h,f);if(g.getSize()===3){const y=new Float32Array(x.length*4/3);for(let b=0,v=0;b<x.length;b+=3,v+=4)y[v]=x[b],y[v+1]=x[b+1],y[v+2]=x[b+2],y[v+3]=1;_.colors=y}else if(g.getSize()===4)_.colors=x;else throw new Error(`Unexpected number of color components: ${g.getSize()}`)}return c.isVerticesDataPresent(k.MatricesIndicesKind)&&(_.matricesIndices=c.getVerticesData(k.MatricesIndicesKind,h,f)),c.isVerticesDataPresent(k.MatricesWeightsKind)&&(_.matricesWeights=c.getVerticesData(k.MatricesWeightsKind,h,f)),c.isVerticesDataPresent(k.MatricesIndicesExtraKind)&&(_.matricesIndicesExtra=c.getVerticesData(k.MatricesIndicesExtraKind,h,f)),c.isVerticesDataPresent(k.MatricesWeightsExtraKind)&&(_.matricesWeightsExtra=c.getVerticesData(k.MatricesWeightsExtraKind,h,f)),_.indices=c.getIndices(h,f),_}static CreateRibbon(c){throw Je("ribbonBuilder")}static CreateBox(c){throw Je("boxBuilder")}static CreateTiledBox(c){throw Je("tiledBoxBuilder")}static CreateTiledPlane(c){throw Je("tiledPlaneBuilder")}static CreateSphere(c){throw Je("sphereBuilder")}static CreateCylinder(c){throw Je("cylinderBuilder")}static CreateTorus(c){throw Je("torusBuilder")}static CreateLineSystem(c){throw Je("linesBuilder")}static CreateDashedLines(c){throw Je("linesBuilder")}static CreateGround(c){throw Je("groundBuilder")}static CreateTiledGround(c){throw Je("groundBuilder")}static CreateGroundFromHeightMap(c){throw Je("groundBuilder")}static CreatePlane(c){throw Je("planeBuilder")}static CreateDisc(c){throw Je("discBuilder")}static CreatePolygon(c,h,f,_,m,g,x){throw Je("polygonBuilder")}static CreateIcoSphere(c){throw Je("icoSphereBuilder")}static CreatePolyhedron(c){throw Je("polyhedronBuilder")}static CreateCapsule(c={orientation:D.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){throw Je("capsuleBuilder")}static CreateTorusKnot(c){throw Je("torusKnotBuilder")}static ComputeNormals(c,h,f,_){let m,g,x,y,b,v,E,R,C,O,M,I,P,L,V,X,re,ae,de,U,te=!1,Y=!1,Z=!1,q=!1,j=1,Q=0,w=null;_&&(te=!!_.facetNormals,Y=!!_.facetPositions,Z=!!_.facetPartitioning,j=_.useRightHandedSystem===!0?-1:1,Q=_.ratio||0,q=!!_.depthSort,w=_.distanceTo,q&&w===void 0&&(w=D.Zero()));let B=0,z=0,K=0,ue=0;for(Z&&_&&_.bbSize&&(B=_.subDiv.X*Q/_.bbSize.x,z=_.subDiv.Y*Q/_.bbSize.y,K=_.subDiv.Z*Q/_.bbSize.z,ue=_.subDiv.max*_.subDiv.max,_.facetPartitioning.length=0),m=0;m<c.length;m++)f[m]=0;const he=h.length/3|0;for(m=0;m<he;m++){if(I=h[m*3]*3,P=I+1,L=I+2,V=h[m*3+1]*3,X=V+1,re=V+2,ae=h[m*3+2]*3,de=ae+1,U=ae+2,g=c[I]-c[V],x=c[P]-c[X],y=c[L]-c[re],b=c[ae]-c[V],v=c[de]-c[X],E=c[U]-c[re],R=j*(x*E-y*v),C=j*(y*b-g*E),O=j*(g*v-x*b),M=Math.sqrt(R*R+C*C+O*O),M=M===0?1:M,R/=M,C/=M,O/=M,te&&_&&(_.facetNormals[m].x=R,_.facetNormals[m].y=C,_.facetNormals[m].z=O),Y&&_&&(_.facetPositions[m].x=(c[I]+c[V]+c[ae])/3,_.facetPositions[m].y=(c[P]+c[X]+c[de])/3,_.facetPositions[m].z=(c[L]+c[re]+c[U])/3),Z&&_){const ve=Math.floor((_.facetPositions[m].x-_.bInfo.minimum.x*Q)*B),Le=Math.floor((_.facetPositions[m].y-_.bInfo.minimum.y*Q)*z),ke=Math.floor((_.facetPositions[m].z-_.bInfo.minimum.z*Q)*K),J=Math.floor((c[I]-_.bInfo.minimum.x*Q)*B),_e=Math.floor((c[P]-_.bInfo.minimum.y*Q)*z),xe=Math.floor((c[L]-_.bInfo.minimum.z*Q)*K),Ne=Math.floor((c[V]-_.bInfo.minimum.x*Q)*B),Qe=Math.floor((c[X]-_.bInfo.minimum.y*Q)*z),He=Math.floor((c[re]-_.bInfo.minimum.z*Q)*K),dt=Math.floor((c[ae]-_.bInfo.minimum.x*Q)*B),li=Math.floor((c[de]-_.bInfo.minimum.y*Q)*z),zt=Math.floor((c[U]-_.bInfo.minimum.z*Q)*K),Ot=J+_.subDiv.max*_e+ue*xe,jt=Ne+_.subDiv.max*Qe+ue*He,Nt=dt+_.subDiv.max*li+ue*zt,ut=ve+_.subDiv.max*Le+ue*ke;_.facetPartitioning[ut]=_.facetPartitioning[ut]?_.facetPartitioning[ut]:[],_.facetPartitioning[Ot]=_.facetPartitioning[Ot]?_.facetPartitioning[Ot]:[],_.facetPartitioning[jt]=_.facetPartitioning[jt]?_.facetPartitioning[jt]:[],_.facetPartitioning[Nt]=_.facetPartitioning[Nt]?_.facetPartitioning[Nt]:[],_.facetPartitioning[Ot].push(m),jt!=Ot&&_.facetPartitioning[jt].push(m),Nt==jt||Nt==Ot||_.facetPartitioning[Nt].push(m),ut==Ot||ut==jt||ut==Nt||_.facetPartitioning[ut].push(m)}if(q&&_&&_.facetPositions){const ve=_.depthSortedFacets[m];ve.ind=m*3,ve.sqDistance=D.DistanceSquared(_.facetPositions[m],w)}f[I]+=R,f[P]+=C,f[L]+=O,f[V]+=R,f[X]+=C,f[re]+=O,f[ae]+=R,f[de]+=C,f[U]+=O}for(m=0;m<f.length/3;m++)R=f[m*3],C=f[m*3+1],O=f[m*3+2],M=Math.sqrt(R*R+C*C+O*O),M=M===0?1:M,R/=M,C/=M,O/=M,f[m*3]=R,f[m*3+1]=C,f[m*3+2]=O}static _ComputeSides(c,h,f,_,m,g,x){const y=f.length,b=_.length;let v,E;switch(c=c||a.DEFAULTSIDE,c){case a.FRONTSIDE:break;case a.BACKSIDE:for(v=0;v<y;v+=3){const R=f[v];f[v]=f[v+2],f[v+2]=R}for(E=0;E<b;E++)_[E]=-_[E];break;case a.DOUBLESIDE:{const R=h.length,C=R/3;for(let I=0;I<R;I++)h[R+I]=h[I];for(v=0;v<y;v+=3)f[v+y]=f[v+2]+C,f[v+1+y]=f[v+1]+C,f[v+2+y]=f[v]+C;for(E=0;E<b;E++)_[b+E]=-_[E];const O=m.length;let M;for(M=0;M<O;M++)m[M+O]=m[M];for(g=g||new at(0,0,1,1),x=x||new at(0,0,1,1),M=0,v=0;v<O/2;v++)m[M]=g.x+(g.z-g.x)*m[M],m[M+1]=g.y+(g.w-g.y)*m[M+1],m[M+O]=x.x+(x.z-x.x)
vendor: 6,713 bytes, line 292
292*m[M+O],m[M+O+1]=x.y+(x.w-x.y)*m[M+O+1],M+=2;break}}}static Parse(c){const h=new a,f=c.positions;f&&h.set(f,k.PositionKind);const _=c.normals;_&&h.set(_,k.NormalKind);const m=c.tangents;m&&h.set(m,k.TangentKind);const g=c.uvs;g&&h.set(g,k.UVKind);const x=c.uvs2;x&&h.set(x,k.UV2Kind);const y=c.uvs3;y&&h.set(y,k.UV3Kind);const b=c.uvs4;b&&h.set(b,k.UV4Kind);const v=c.uvs5;v&&h.set(v,k.UV5Kind);const E=c.uvs6;E&&h.set(E,k.UV6Kind);const R=c.colors;R&&(h.set(_t.CheckColors4(R,f.length/3),k.ColorKind),c.hasVertexAlpha!==void 0&&(h.hasVertexAlpha=c.hasVertexAlpha));const C=c.matricesIndices;C&&h.set(C,k.MatricesIndicesKind);const O=c.matricesWeights;O&&h.set(O,k.MatricesWeightsKind);const M=c.indices;M&&(h.indices=M);const I=c.materialInfos;if(I){h.materialInfos=[];for(const P of I){const L=new L_;L.indexCount=P.indexCount,L.indexStart=P.indexStart,L.verticesCount=P.verticesCount,L.verticesStart=P.verticesStart,L.materialIndex=P.materialIndex,h.materialInfos.push(L)}}return h}static ImportVertexData(c,h){const f=a.Parse(c);h.setAllVerticesData(f,c.updatable)}},(()=>{const o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[la.filter((...c)=>!Array.isArray(c[0]))],i=[la.filter((...c)=>!Array.isArray(c[0]))],s=[la.filter((...c)=>!Array.isArray(c[0]))],n=[la.filter((...c)=>!Array.isArray(c[0]))],ee(a,null,t,{kind:"method",name:"_TransformVector3Coordinates",static:!0,private:!1,access:{has:c=>"_TransformVector3Coordinates"in c,get:c=>c._TransformVector3Coordinates},metadata:o},null,e),ee(a,null,i,{kind:"method",name:"_TransformVector3Normals",static:!0,private:!1,access:{has:c=>"_TransformVector3Normals"in c,get:c=>c._TransformVector3Normals},metadata:o},null,e),ee(a,null,s,{kind:"method",name:"_TransformVector4Normals",static:!0,private:!1,access:{has:c=>"_TransformVector4Normals"in c,get:c=>c._TransformVector4Normals},metadata:o},null,e),ee(a,null,n,{kind:"method",name:"_FlipFaces",static:!0,private:!1,access:{has:c=>"_FlipFaces"in c,get:c=>c._FlipFaces},metadata:o},null,e),o&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),a.FRONTSIDE=(N(a,e),0),a.BACKSIDE=1,a.DOUBLESIDE=2,a.DEFAULTSIDE=0,a._UniqueIdGenerator=0,a})();class ys{static get ForceFullSceneLoadingForIncremental(){return ys._ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){ys._ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){return ys._ShowLoadingScreen}static set ShowLoadingScreen(e){ys._ShowLoadingScreen=e}static get loggingLevel(){return ys._LoggingLevel}static set loggingLevel(e){ys._LoggingLevel=e}static get CleanBoneMatrixWeights(){return ys._CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){ys._CleanBoneMatrixWeights=e}}ys._ForceFullSceneLoadingForIncremental=!1;ys._ShowLoadingScreen=!0;ys._CleanBoneMatrixWeights=!1;ys._LoggingLevel=0;class _s{get boundingBias(){return this._boundingBias}set boundingBias(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)}static CreateGeometryForMesh(e){const t=new _s(_s.RandomId(),e.getScene());return t.applyToMesh(e),t}get meshes(){return this._meshes}constructor(e,t,i,s=!1,n=null,o=null){this.delayLoadState=0,this._totalVertices=0,this._isDisposed=!1,this._extend={minimum:new D(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),maximum:new D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},this._indexBufferIsUpdatable=!1,this._positionsCache=[],this._parentContainer=null,this.useBoundingInfoFromGeometry=!1,this._scene=t||mt.LastCreatedScene,this._scene&&(this.id=e,this.uniqueId=this._scene.getUniqueId(),this._engine=this._scene.getEngine(),this._meshes=[],this._vertexBuffers={},this._indices=[],this._updatable=s,o!==null&&(this._totalVertices=o),i?this.setAllVerticesData(i,s):o===null&&(this._totalVertices=0),this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),n&&(this.applyToMesh(n),n.computeWorldMatrix(!0)))}get extend(){return this._extend}getScene(){return this._scene}getEngine(){return this._engine}isReady(){return this.delayLoadState===1||this.delayLoadState===0}get doNotSerialize(){for(let e=0;e<this._meshes.length;e++)if(!this._meshes[e].doNotSerialize)return!1;return!0}_rebuild(){this._vertexArrayObjects&&(this._vertexArrayObjects={}),this._meshes.length!==0&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer"));const e=new Set;for(const t in this._vertexBuffers)e.add(this._vertexBuffers[t].getWrapperBuffer());e.forEach(t=>{t._rebuild()})}setAllVerticesData(e,t){e.applyToGeometry(this,t),this._notifyUpdate()}setVerticesData(e,t,i=!1,s){i&&Array.isArray(t)&&(t=new Float32Array(t));const n=new k(this._engine,t,e,{updatable:i,postponeInternalCreation:this._meshes.length===0,stride:s,label:"Geometry_"+this.id+"_"+e});this.setVerticesBuffer(n)}removeVerticesData(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e]),this._vertexArrayObjects&&this._disposeVertexArrayObjects()}setVerticesBuffer(e,t=null,i=!0){const s=e.getKind();this._vertexBuffers[s]&&i&&this._vertexBuffers[s].dispose(),e._buffer&&e._ownsBuffer&&e._buffer._increaseReferences(),this._vertexBuffers[s]=e;const n=this._meshes,o=n.length;if(s===k.PositionKind){this._totalVertices=t??e._maxVerticesCount,this._updateExtend(this.useBoundingInfoFromGeometry&&this._boundingInfo?null:e.getFloatData(this._totalVertices)),this._resetPointsArrayCache();const c=this._extend&&this._extend.minimum||new D(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=this._extend&&this._extend.maximum||new D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let f=0;f<o;f++){const _=n[f];_.buildBoundingInfo(c,h),_._createGlobalSubMesh(_.isUnIndexed),_.computeWorldMatrix(!0),_.synchronizeInstances()}}this._notifyUpdate(s)}updateVerticesDataDirectly(e,t,i,s=!1){const n=this.getVertexBuffer(e);n&&(n.updateDirectly(t,i,s),this._notifyUpdate(e))}updateVerticesData(e,t,i=!1){const s=this.getVertexBuffer(e);s&&(s.update(t),e===k.PositionKind&&this._updateBoundingInfo(i,t),this._notifyUpdate(e))}_updateBoundingInfo(e,t){if(e&&this._updateExtend(t),this._resetPointsArrayCache(),e){const i=this._meshes;for(const s of i){s.hasBoundingInfo?s.getBoundingInfo().reConstruct(this._extend.minimum,this._extend.maximum):s.buildBoundingInfo(this._extend.minimum,this._extend.maximum);const n=s.subMeshes;for(const o of n)o.refreshBoundingInfo()}}}_bind(e,t,i,s){if(!e)return;t===void 0&&(t=this._indexBuffer);const n=this.getVertexBuffers();if(!n)return;if(t!=this._indexBuffer||!this._vertexArrayObjects&&!s){this._engine.b
vendor: 9,806 bytes, line 292
292indBuffers(n,t,e,i);return}const o=s||this._vertexArrayObjects,c=this._engine;o[e.key]||(o[e.key]=c.recordVertexArrayObject(n,t,e,i)),c.bindVertexArrayObject(o[e.key],t)}getTotalVertices(){return this.isReady()?this._totalVertices:0}getVerticesData(e,t,i){const s=this.getVertexBuffer(e);return s?s.getFloatData(this._totalVertices,i||t&&this._meshes.length!==1):null}copyVerticesData(e,t){const i=this.getVertexBuffer(e);if(!i)return;t[e]||(t[e]=new Float32Array(this._totalVertices*i.getSize()));const s=i.getData();s&&sC(s,i.getSize(),i.type,i.byteOffset,i.byteStride,i.normalized,this._totalVertices,t[e])}isVertexBufferUpdatable(e){const t=this._vertexBuffers[e];return t?t.isUpdatable():!1}getVertexBuffer(e){return this.isReady()?this._vertexBuffers[e]:null}getVertexBuffers(){return this.isReady()?this._vertexBuffers:null}isVerticesDataPresent(e){return this._vertexBuffers?this._vertexBuffers[e]!==void 0:this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1}getVerticesDataKinds(){const e=[];let t;if(!this._vertexBuffers&&this._delayInfo)for(t in this._delayInfo)e.push(t);else for(t in this._vertexBuffers)e.push(t);return e}updateIndices(e,t,i=!1){if(this._indexBuffer)if(!this._indexBufferIsUpdatable)this.setIndices(e,null,!0);else{const s=e.length!==this._indices.length;if(i||(this._indices=e.slice()),this._engine.updateDynamicIndexBuffer(this._indexBuffer,e,t),s)for(const n of this._meshes)n._createGlobalSubMesh(!0)}}setIndexBuffer(e,t,i,s=null){this._indices=[],this._indexBufferIsUpdatable=!1,this._indexBuffer=e,this._totalVertices=t,this._totalIndices=i,s===null?e.is32Bits=t>65535:e.is32Bits=s;for(const n of this._meshes)n._createGlobalSubMesh(!0),n.synchronizeInstances();this._notifyUpdate()}setIndices(e,t=null,i=!1,s=!1){this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indices=e,this._indexBufferIsUpdatable=i,this._meshes.length!==0&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i,"Geometry_"+this.id+"_IndexBuffer")),t!=null&&(this._totalVertices=t);for(const n of this._meshes)n._createGlobalSubMesh(!s),n.synchronizeInstances();this._notifyUpdate()}getTotalIndices(){return this.isReady()?this._totalIndices!==void 0?this._totalIndices:this._indices.length:0}getIndices(e,t){if(!this.isReady())return null;const i=this._indices;return!t&&(!e||this._meshes.length===1)?i:i.slice()}getIndexBuffer(){return this.isReady()?this._indexBuffer:null}_releaseVertexArrayObject(e=null){!e||!this._vertexArrayObjects||this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])}releaseForMesh(e,t){const i=this._meshes,s=i.indexOf(e);s!==-1&&(i.splice(s,1),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject(),e._geometry=null,i.length===0&&t&&this.dispose())}applyToMesh(e){if(e._geometry===this)return;const t=e._geometry;t&&t.releaseForMesh(e),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject();const i=this._meshes;e._geometry=this,e._internalAbstractMeshDataInfo._positions=null,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):this._boundingInfo&&e.setBoundingInfo(this._boundingInfo)}_updateExtend(e=null){if(this.useBoundingInfoFromGeometry&&this._boundingInfo)this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()};else{if(!e&&(e=this.getVerticesData(k.PositionKind),!e))return;this._extend=Pv(e,0,this._totalVertices,this.boundingBias,3)}}_applyToMesh(e){for(const t in this._vertexBuffers){const i=this._vertexBuffers[t];i._buffer.getBuffer()||i.create(),t===k.PositionKind&&(this._extend||this._updateExtend(),e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(e.isUnIndexed),e._updateBoundingInfo())}!this._indexBuffer&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer")),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()}_notifyUpdate(e){this.onGeometryUpdated&&this.onGeometryUpdated(this,e),this._vertexArrayObjects&&this._disposeVertexArrayObjects();for(const t of this._meshes)t._markSubMeshesAsAttributesDirty()}load(e,t){if(this.delayLoadState!==2){if(this.isReady()){t&&t();return}this.delayLoadState=2,this._queueLoad(e,t)}}_queueLoad(e,t){this.delayLoadingFile&&(e.addPendingData(this),(async()=>{try{const i=await e._loadDelayedFileAsync(this.delayLoadingFile,!1,!0);if(!this._delayLoadingFunction){e.removePendingData(this);return}this._delayLoadingFunction(JSON.parse(i),this),this.delayLoadState=1,this._delayInfo=[],e.removePendingData(this);const s=this._meshes,n=s.length;for(let o=0;o<n;o++)this._applyToMesh(s[o]);t&&t()}catch(i){e.removePendingData(this),e.isDisposed||pe.Error(`Unable to delay load geometry "${this.id}" from "${this.delayLoadingFile}": ${i}`)}})())}toLeftHanded(){const e=this.getIndices(!1);if(e!=null&&e.length>0){for(let s=0;s<e.length;s+=3){const n=e[s+0];e[s+0]=e[s+2],e[s+2]=n}this.setIndices(e)}const t=this.getVerticesData(k.PositionKind,!1);if(t!=null&&t.length>0){for(let s=0;s<t.length;s+=3)t[s+2]=-t[s+2];this.setVerticesData(k.PositionKind,t,!1)}const i=this.getVerticesData(k.NormalKind,!1);if(i!=null&&i.length>0){for(let s=0;s<i.length;s+=3)i[s+2]=-i[s+2];this.setVerticesData(k.NormalKind,i,!1)}}_resetPointsArrayCache(){this._positions=null}_generatePointsArray(){if(this._positions)return!0;const e=this.getVerticesData(k.PositionKind);if(!e||e.length===0)return!1;for(let t=this._positionsCache.length*3,i=this._positionsCache.length;t<e.length;t+=3,++i)this._positionsCache[i]=D.FromArray(e,t);for(let t=0,i=0;t<e.length;t+=3,++i)this._positionsCache[i].set(e[0+t],e[1+t],e[2+t]);return this._positionsCache.length=e.length/3,this._positions=this._positionsCache,!0}isDisposed(){return this._isDisposed}_disposeVertexArrayObjects(){if(this._vertexArrayObjects){for(const i in this._vertexArrayObjects)this._engine.releaseVertexArrayObject(this._vertexArrayObjects[i]);this._vertexArrayObjects={};const e=this._meshes,t=e.length;for(let i=0;i<t;i++)e[i]._invalidateInstanceVertexArrayObject()}}dispose(){const e=this._meshes,t=e.length;let i;for(i=0;i<t;i++)this.releaseForMesh(e[i]);this._meshes.length=0,this._disposeVertexArrayObjects();for(const s in this._vertexBuffers)this._vertexBuffers[s].dispose();if(this._vertexBuffers={},this._totalVertices=0,this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null,this._indices=[],this.delayLoadState=0,this.delayLoadingFile=null,this._delayLoadingFunction=null,this._delayInfo=[],this._boundingInfo=null,this._scene.removeGeometry(this),this._parentContainer){const s=this._parentContainer.geometries.indexOf(this);s>-1&&this._parentContainer.geometries.splice(s,1),this._parentContainer=null}this._isDisposed=!0}copy(e){const t=new _s(e,this._scene),i=this.getIndices(void 0,!0);i&&t.setIndices(i);let s=!1,n;for(n in this._vertexBuffers){const o=this.getVertexBuffer(n),c=o.getData();if(!c)continue;const h=o.isUpdatable(),f=o.getSize(),{type:_,byteOffset:m,byteStride:g,normalized:x}=o;s=s||h;let y=this._totalVertices;if(o.getIsInstanced()){let E;c instanceof Array?E=c.length*4:E=c.byteLength,y=E/g}const b=iC(c,f,_,m,g,y,!0),v=new k(this._engine,b,n,{updatable:h,useBytes:!1,stride:f,size:f,offset:0,type:_,normalized:x,takeBufferOwnership:!0,instanced:o.getIsInstanced()});t.setVerticesBuffer(v,y)}t._updatable=s,t.delayLoadState=this.delayLoadState,t.delayLoadingFile=this.delayLoadingFile,t._delayLoadingFunction=this._delayLoadingFunction;for(n in this._delayInfo)t._delayInfo=t._delayInfo||[],t._delayInfo.push(n);return t._boundingInfo=new Ws(this._extend.minimum,this._extend.maximum),t}serialize(){const e={};return e.id=this.id,e.uniqueId=this.uniqueId,e.updatable=this._updatable,Rt&&Rt.HasTags(this)&&(e.tags=Rt.GetTags(this)),e}_toNumberArray(e){return Array.isArray(e)?e:Array.prototype.slice.call(e)}clearCachedData(){this._totalIndices=this._indices.length,this._indices=[],this._resetPointsArrayCache();for(const e in this._vertexBuffers)Object.prototype.hasOwnProperty.call(this._vertexBuffers,e)&&(this._vertexBuffers[e]._buffer._data=null)}serializeVerticeData(){const e=this.serialize();return this.isVerticesDataPresent(k.PositionKind)&&(e.positions=this._toNumberArray(this.getVerticesData(k.PositionKind)),this.isVertexBufferUpdatable(k.PositionKind)&&(e.positionsUpdatable=!0)),this.isVerticesDataPresent(k.NormalKind)&&(e.normals=this._toNumberArray(this.getVerticesData(k.NormalKind)),this.isVertexBufferUpdatable(k.NormalKind)&&(e.normalsUpdatable=!0)),this.isVerticesDataPresent(k.TangentKind)&&(e.tangents=this._toNumberArray(this.getVerticesData(k.TangentKind)),this.isVertexBufferUpdatable(k.TangentKind)&&(e.tangentsUpdatable=!0)),this.isVerticesDataPresent(k.UVKind)&&(e.uvs=this._toNumberArray(this.getVerticesData(k.UVKind)),this.isVertexBufferUpdatable(k.UVKind)&&(e.uvsUpdatable=!0)),this.isVerticesDataPresent(k.UV2Kind)&&(e.uvs2=this._toNumberArray(this.getVerticesData(k.UV2Kind)),this.isVertexBufferUpdatable(k.UV2Kind)&&(e.uvs2Updatable=!0)),this.isVerticesDataPresent(k.UV3Kind)&&(e.uvs3=this._toNumberArray(this.getVerticesData(k.UV3Kind)),this.isVertexBufferUpdatable(k.UV3Kind)&&(e.uvs3Updatable=!0)),this.isVerticesDataPresent(k.UV4Kind)&&(e.uvs4=this._toNumberArray(this.getVerticesData(k.UV4Kind)),this.isVertexBufferUpdatable(k.UV4Kind)&&(e.uvs4Updatable=!0)),this.isVerticesDataPresent(k.UV5Kind)&&(e.uvs5=this._toNumberArray(this.getVerticesData(k.UV5Kind)),this.isVertexBufferUpdatable(k.UV5Kind)&&(e.uvs5Updatable=!0)),this.isVerticesDataPresent(k.UV6Kind)&&(e.uvs6=this._toNumberArray(this.getVerticesData(k.UV6Kind)),this.isVertexBufferUpdatable(k.UV6Kind)&&(e.uvs6Up
292datable=!0)),this.isVerticesDataPresent(k.ColorKind)&&(e.colors=this._toNumberArray(this.getVerticesData(k.ColorKind)),this.isVertexBufferUpdatable(k.ColorKind)&&(e.colorsUpdatable=!0)),this.isVerticesDataPresent(k.MatricesIndicesKind)&&(e.matricesIndices=this._toNumberArray(this.getVerticesData(k.MatricesIndicesKind)),e.matricesIndicesExpanded=!0,this.isVertexBufferUpdatable(k.MatricesIndicesKind)&&(e.matricesIndicesUpdatable=!0)),this.isVerticesDataPresent(k.MatricesWeightsKind)&&(e.matricesWeights=this._toNumberArray(this.getVerticesData(k.MatricesWeightsKind)),this.isVertexBufferUpdatable(k.MatricesWeightsKind)&&(e.matricesWeightsUpdatable=!0)),e.indices=this._toNumberArray(this.getIndices()),e}static ExtractFromMesh(e,t){const i=e._geometry;return i?i.copy(t):null}static RandomId(){return bt.RandomId()}static _GetGeometryByLoadedUniqueId(e,t){for(let i=0;i<t.geometries.length;i++)if(t.geometries[i]._loadedUniqueId===e)return t.geometries[i];return null}static _ImportGeometry(e,t){const i=t.getScene(),s=e.geometryUniqueId,n=e.geometryId;if(s||n){const o=s?this._GetGeometryByLoadedUniqueId(s,i):i.getGeometryById(n);o&&o.applyToMesh(t)}else if(e instanceof ArrayBuffer){const o=t._binaryInfo;if(o.positionsAttrDesc&&o.positionsAttrDesc.count>0){const c=new Float32Array(e,o.positionsAttrDesc.offset,o.positionsAttrDesc.count);t.setVerticesData(k.PositionKind,c,!1)}if(o.normalsAttrDesc&&o.normalsAttrDesc.count>0){const c=new Float32Array(e,o.normalsAttrDesc.offset,o.normalsAttrDesc.count);t.setVerticesData(k.NormalKind,c,!1)}if(o.tangetsAttrDesc&&o.tangetsAttrDesc.count>0){const c=new Float32Array(e,o.tangetsAttrDesc.offset,o.tangetsAttrDesc.count);t.setVerticesData(k.TangentKind,c,!1)}if(o.uvsAttrDesc&&o.uvsAttrDesc.count>0){const c=new Float32Array(e,o.uvsAttrDesc.offset,o.uvsAttrDesc.count);t.setVerticesData(k.UVKind,c,!1)}if(o.uvs2AttrDesc&&o.uvs2AttrDesc.count>0){const c=new Float32Array(e,o.uvs2AttrDesc.offset,o.uvs2AttrDesc.count);t.setVerticesData(k.UV2Kind,c,!1)}if(o.uvs3AttrDesc&&o.uvs3AttrDesc.count>0){const c=new Float32Array(e,o.uvs3AttrDesc.offset,o.uvs3AttrDesc.count);t.setVerticesData(k.UV3Kind,c,!1)}if(o.uvs4AttrDesc&&o.uvs4AttrDesc.count>0){const c=new Float32Array(e,o.uvs4AttrDesc.offset,o.uvs4AttrDesc.count);t.setVerticesData(k.UV4Kind,c,!1)}if(o.uvs5AttrDesc&&o.uvs5AttrDesc.count>0){const c=new Float32Array(e,o.uvs5AttrDesc.offset,o.uvs5AttrDesc.count);t.setVerticesData(k.UV5Kind,c,!1)}if(o.uvs6AttrDesc&&o.uvs6AttrDesc.count>0){const c=new Float32Array(e,o.uvs6AttrDesc.offset,o.uvs6AttrDesc.count);t.setVerticesData(k.UV6Kind,c,!1)}if(o.colorsAttrDesc&&o.colorsAttrDesc.count>0){const c=new Float32Array(e,o.colorsAttrDesc.offset,o.colorsAttrDesc.count);t.setVerticesData(k.ColorKind,c,!1,o.colorsAttrDesc.stride)}if(o.matricesIndicesAttrDesc&&o.matricesIndicesAttrDesc.count>0){const c=new Int32Array(e,o.matricesIndicesAttrDesc.offset,o.matricesIndicesAttrDesc.count),h=[];for(let f=0;f<c.length;f++){const _=c[f];h.push(_&255),h.push((_&65280)>>8),h.push((_&16711680)>>16),h.push(_>>24&255)}t.setVerticesData(k.MatricesIndicesKind,h,!1)}if(o.matricesIndicesExtraAttrDesc&&o.matricesIndicesExtraAttrDesc.count>0){const c=new Int32Array(e,o.matricesIndicesExtraAttrDesc.offset,o.matricesIndicesExtraAttrDesc.count),h=[];for(let f=0;f<c.length;f++){const _=c[f];h.push(_&255),h.push((_&65280)>>8),h.push((_&16711680)>>16),h.push(_>>24&255)}t.setVerticesData(k.MatricesIndicesExtraKind,h,!1)}if(o.matricesWeightsAttrDesc&&o.matricesWeightsAttrDesc.count>0){const c=new Float32Array(e,o.matricesWeightsAttrDesc.offset,o.matricesWeightsAttrDesc.count);t.setVerticesData(k.MatricesWeightsKind,c,!1)}if(o.indicesAttrDesc&&o.indicesAttrDesc.count>0){const c=new Int32Array(e,o.indicesAttrDesc.offset,o.indicesAttrDesc.count);t.setIndices(c,null)}if(o.subMeshesAttrDesc&&o.subMeshesAttrDesc.count>0){const c=new Int32Array(e,o.subMeshesAttrDesc.offset,o.subMeshesAttrDesc.count*5);t.subMeshes=[];for(let h=0;h<o.subMeshesAttrDesc.count;h++){const f=c[h*5+0],_=c[h*5+1],m=c[h*5+2],g=c[h*5+3],x=c[h*5+4];Xs.AddToMesh(f,_,m,g,x,t)}}}else if(e.positions&&e.normals&&e.indices){if(t.setVerticesData(k.PositionKind,e.positions,e.positions._updatable||e.positionsUpdatable),t.setVerticesData(k.NormalKind,e.normals,e.normals._updatable||e.normalsUpdatable),e.tangents&&t.setVerticesData(k.TangentKind,e.tangents,e.tangents._updatable||e.tangentsUpdatable),e.uvs&&t.setVerticesData(k.UVKind,e.uvs,e.uvs._updatable||e.uvsUpdatable),e.uvs2&&t.setVerticesData(k.UV2Kind,e.uvs2,e.uvs2._updatable||e.uvs2Updatable),e.uvs3&&t.setVerticesData(k.UV3Kind,e.uvs3,e.uvs3._updatable||e.uvs3Updatable),e.uvs4&&t.setVerticesData(k.UV4Kind,e.uvs4,e.uvs4._updatable||e.uvs4Updatable),e.uvs5&&t.setVerticesData(k.UV5Kind,e.uvs5,e.uvs5._updatable||e.uvs5Updatable),e.uvs6&&t.setVerticesData(k.UV6Kind,e.uvs6,e.uvs6._updatable||e.uvs6Updatable),e.colors&&t.setVerticesData(k.ColorKind,_t.CheckColors4(e.colors,e.positions.length/3),e.colors._updatable),e.matricesIndices)if(!e.matricesIndices._isExpanded&&!e.matricesIndicesExpanded){const o=[];for(let c=0;c<e.matricesIndices.length;c++){const h=e.matricesIndices[c];o.push(h&255),o.push((h&65280)>>8),o.push((h&16711680)>>16),o.push(h>>24&255)}t.setVerticesData(k.MatricesIndicesKind,o,e.matricesIndices._updatable||e.matricesIndicesUpdatable)}else delete e.matricesIndices._isExpanded,delete e.matricesIndicesExpanded,t.setVerticesData(k.MatricesIndicesKind,e.matricesIndices,e.matricesIndices._updatable||e.matricesIndicesUpdatable);if(e.matricesIndicesExtra)if(e.matricesIndicesExtraExpanded||e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExtraExpanded,t.setVerticesData(k.MatricesIndicesExtraKind,e.matricesIndicesExtra,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable);else{const o=[];for(let c=0;c<e.matricesIndicesExtra.length;c++){const h=e.matricesIndicesExtra[c];o.push(h&255),o.push((h&65280)>>8),o.push((h&16711680)>>16),o.push(h>>24&255)}t.setVerticesData(k.MatricesIndicesExtraKind,o,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable)}e.matricesWeights&&(_s._CleanMatricesWeights(e,t),t.setVerticesData(k.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(k.MatricesWeightsExtraKind,e.matricesWeightsExtra,e.matricesWeights._updatable),t.setIndices(e.indices,null)}if(e.subMeshes){t.subMeshes=[];for(let o=0;o<e.subMeshes.length;o++){const c=e.subMeshes[o];Xs.AddToMesh(c.materialIndex,c.verticesStart,c.verticesCount,c.indexStart,c.indexCount,t)}}t._shouldGenerateFlatShading&&(t.convertToFlatShadedMesh(),t._shouldGenerateFlatShading=!1),t.computeWorldMatrix(!0),i.onMeshImportedObservable.notifyObservers(t)}static _CleanMatricesWeights(e,t){if(!ys.CleanBoneMatrixWeights)return;let s;if(e.skeletonId>
vendor: 6,627 bytes, line 292
292-1){const m=t.getScene().getLastSkeletonById(e.skeletonId);if(!m)return;s=m.bones.length}else return;const n=t.getVerticesData(k.MatricesIndicesKind),o=t.getVerticesData(k.MatricesIndicesExtraKind),c=e.matricesWeights,h=e.matricesWeightsExtra,f=e.numBoneInfluencer,_=c.length;for(let m=0;m<_;m+=4){let g=0,x=-1;for(let y=0;y<4;y++){const b=c[m+y];g+=b,b<.001&&x<0&&(x=y)}if(h)for(let y=0;y<4;y++){const b=h[m+y];g+=b,b<.001&&x<0&&(x=y+4)}if((x<0||x>f-1)&&(x=f-1),g>.001){const y=1/g;for(let b=0;b<4;b++)c[m+b]*=y;if(h)for(let b=0;b<4;b++)h[m+b]*=y}else x>=4?(h[m+x-4]=1-g,o[m+x-4]=s):(c[m+x]=1-g,n[m+x]=s)}t.setVerticesData(k.MatricesIndicesKind,n),e.matricesWeightsExtra&&t.setVerticesData(k.MatricesIndicesExtraKind,o)}static Parse(e,t,i){const s=new _s(e.id,t,void 0,e.updatable);return s._loadedUniqueId=e.uniqueId,Rt&&Rt.AddTagsTo(s,e.tags),e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s._boundingInfo=new Ws(D.FromArray(e.boundingBoxMinimum),D.FromArray(e.boundingBoxMaximum)),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(k.UVKind),e.hasUVs2&&s._delayInfo.push(k.UV2Kind),e.hasUVs3&&s._delayInfo.push(k.UV3Kind),e.hasUVs4&&s._delayInfo.push(k.UV4Kind),e.hasUVs5&&s._delayInfo.push(k.UV5Kind),e.hasUVs6&&s._delayInfo.push(k.UV6Kind),e.hasColors&&s._delayInfo.push(k.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(k.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(k.MatricesWeightsKind),s._delayLoadingFunction=Ue.ImportVertexData):Ue.ImportVertexData(e,s),t.pushGeometry(s,!0),s}}var Qb,$b,Jb,ey;let rs=(()=>{var a;let e=el,t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],m,g=[],x=[],y,b=[],v=[],E,R=[],C=[],O,M=[],I=[],P,L=[],V=[],X,re=[],ae=[];return a=class extends e{get billboardMode(){return this._billboardMode}set billboardMode(U){this._billboardMode!==U&&(this._billboardMode=U,this._cache.useBillboardPosition=(this._billboardMode&a.BILLBOARDMODE_USE_POSITION)!==0)}get infiniteDistance(){return this._infiniteDistance}set infiniteDistance(U){this._infiniteDistance!==U&&(this._infiniteDistance=U)}constructor(U,te=null,Y=!0){super(U,te,!1),this._forward=new D(0,0,1),this._up=new D(0,1,0),this._right=new D(1,0,0),this._position=N(this,i,D.Zero()),this._rotation=(N(this,s),N(this,o,D.Zero())),this._rotationQuaternion=(N(this,c),N(this,f,null)),this._scaling=(N(this,_),N(this,g,D.One())),this._transformToBoneReferal=(N(this,x),null),this._isAbsoluteSynced=!1,this._billboardMode=N(this,b,a.BILLBOARDMODE_NONE),this.scalingDeterminant=(N(this,v),N(this,R,1)),this._infiniteDistance=(N(this,C),N(this,M,!1)),this.ignoreNonUniformScaling=(N(this,I),N(this,L,!1)),this.reIntegrateRotationIntoRotationQuaternion=(N(this,V),N(this,re,!1)),this._poseMatrix=(N(this,ae),null),this._localMatrix=se.Zero(),this._usePivotMatrix=!1,this._absolutePosition=D.Zero(),this._absoluteScaling=D.Zero(),this._absoluteRotationQuaternion=Be.Identity(),this._pivotMatrix=se.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new Me,this._nonUniformScaling=!1,Y&&this.getScene().addTransformNode(this)}getClassName(){return"TransformNode"}get position(){return this._position}set position(U){this._position=U,this._markAsDirtyInternal()}isUsingPivotMatrix(){return this._usePivotMatrix}isUsingPostMultiplyPivotMatrix(){return this._postMultiplyPivotMatrix}get rotation(){return this._rotation}set rotation(U){this._rotation=U,this._rotationQuaternion=null,this._markAsDirtyInternal()}get scaling(){return this._scaling}set scaling(U){this._scaling=U,this._markAsDirtyInternal()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(U){this._rotationQuaternion=U,U&&this._rotation.setAll(0),this._markAsDirtyInternal()}_markAsDirtyInternal(){this._isDirty||(this._isDirty=!0,this.customMarkAsDirty&&this.customMarkAsDirty())}get forward(){return D.TransformNormalFromFloatsToRef(0,0,this.getScene().useRightHandedSystem?-1:1,this.getWorldMatrix(),this._forward),this._forward.normalize()}get up(){return D.TransformNormalFromFloatsToRef(0,1,0,this.getWorldMatrix(),this._up),this._up.normalize()}get right(){return D.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem?-1:1,0,0,this.getWorldMatrix(),this._right),this._right.normalize()}updatePoseMatrix(U){return this._poseMatrix?(this._poseMatrix.copyFrom(U),this):(this._poseMatrix=U.clone(),this)}getPoseMatrix(){return this._poseMatrix||(this._poseMatrix=se.Identity()),this._poseMatrix}_isSynchronized(){const U=this._cache;return!(this._billboardMode!==U.billboardMode||this._billboardMode!==a.BILLBOARDMODE_NONE||U.pivotMatrixUpdated||this._infiniteDistance||this._position._isDirty||this._scaling._isDirty||this._rotationQuaternion&&this._rotationQuaternion._isDirty||this._rotation._isDirty)}_initCache(){super._initCache();const U=this._cache;U.localMatrixUpdated=!1,U.billboardMode=-1,U.infiniteDistance=!1,U.useBillboardPosition=!1}get absolutePosition(){return this.getAbsolutePosition()}get absoluteScaling(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling}get absoluteRotationQuaternion(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion}setPreTransformMatrix(U){return this.setPivotMatrix(U,!1)}setPivotMatrix(U,te=!0){return this._pivotMatrix.copyFrom(U),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=te,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=se.Invert(this._pivotMatrix)),this}getPivotMatrix(){return this._pivotMatrix}instantiateHierarchy(U=null,te,Y){const Z=this.clone("Clone of "+(this.name||this.id),U||this.parent,!0);Z&&Y&&Y(this,Z);for(const q of this.getChildTransformNodes(!0))q.instantiateHierarchy(Z,te,Y);return Z}freezeWorldMatrix(U=null,te=!1){return U?te?(this._rotation.setAll(0),this._rotationQuaternion=this._rotationQuaternion||Be.Identity(),U.decompose(this._scaling,this._rotationQuaternion,this._position),this.computeWorldMatrix(!0)):(this._worldMatrix=U,this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._afterComputeWorldMatrix()):(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this}unfreezeWorldMatrix(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this}get isWorldMatrixFrozen(){return this._isWorldMatrixFrozen}getAbsolutePosition(){return this.computeWorldMatrix(),this._absolutePosition}
vendor: 9,901 bytes, line 292
292setAbsolutePosition(U){if(!U)return this;let te,Y,Z;if(U.x===void 0){if(arguments.length<3)return this;te=arguments[0],Y=arguments[1],Z=arguments[2]}else te=U.x,Y=U.y,Z=U.z;if(this.parent){const q=ge.Matrix[0];this.parent.getWorldMatrix().invertToRef(q),D.TransformCoordinatesFromFloatsToRef(te,Y,Z,q,this.position)}else this.position.x=te,this.position.y=Y,this.position.z=Z;return this._absolutePosition.copyFrom(U),this}setPositionWithLocalVector(U){return this.computeWorldMatrix(),this.position=D.TransformNormal(U,this._localMatrix),this}getPositionExpressedInLocalSpace(){this.computeWorldMatrix();const U=ge.Matrix[0];return this._localMatrix.invertToRef(U),D.TransformNormal(this.position,U)}locallyTranslate(U){return this.computeWorldMatrix(!0),this.position=D.TransformCoordinates(U,this._localMatrix),this}lookAt(U,te=0,Y=0,Z=0,q=0){const j=a._LookAtVectorCache,Q=q===0?this.position:this.getAbsolutePosition();if(U.subtractToRef(Q,j),this.setDirection(j,te,Y,Z),q===1&&this.parent)if(this.rotationQuaternion){const w=ge.Matrix[0];this.rotationQuaternion.toRotationMatrix(w);const B=ge.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(B),B.invert(),w.multiplyToRef(B,w),this.rotationQuaternion.fromRotationMatrix(w)}else{const w=ge.Quaternion[0];Be.FromEulerVectorToRef(this.rotation,w);const B=ge.Matrix[0];w.toRotationMatrix(B);const z=ge.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(z),z.invert(),B.multiplyToRef(z,B),w.fromRotationMatrix(B),w.toEulerAnglesToRef(this.rotation)}return this}getDirection(U){const te=D.Zero();return this.getDirectionToRef(U,te),te}getDirectionToRef(U,te){return D.TransformNormalToRef(U,this.getWorldMatrix(),te),this}setDirection(U,te=0,Y=0,Z=0){const q=-Math.atan2(U.z,U.x)+Math.PI/2,j=Math.sqrt(U.x*U.x+U.z*U.z),Q=-Math.atan2(U.y,j);return this.rotationQuaternion?Be.RotationYawPitchRollToRef(q+te,Q+Y,Z,this.rotationQuaternion):(this.rotation.x=Q+Y,this.rotation.y=q+te,this.rotation.z=Z),this}setPivotPoint(U,te=0){this.getScene().getRenderId()==0&&this.computeWorldMatrix(!0);const Y=this.getWorldMatrix();if(te==1){const Z=ge.Matrix[0];Y.invertToRef(Z),U=D.TransformCoordinates(U,Z)}return this.setPivotMatrix(se.Translation(-U.x,-U.y,-U.z),!0)}getPivotPoint(){const U=D.Zero();return this.getPivotPointToRef(U),U}getPivotPointToRef(U){return U.x=-this._pivotMatrix.m[12],U.y=-this._pivotMatrix.m[13],U.z=-this._pivotMatrix.m[14],this}getAbsolutePivotPoint(){const U=D.Zero();return this.getAbsolutePivotPointToRef(U),U}getAbsolutePivotPointToRef(U){return this.getPivotPointToRef(U),D.TransformCoordinatesToRef(U,this.getWorldMatrix(),U),this}markAsDirty(U){if(this._isDirty)return this;if(this._children)for(const te of this._children)te.markAsDirty(U);return super.markAsDirty(U)}setParent(U,te=!1,Y=!1){if(!U&&!this.parent)return this;const Z=ge.Quaternion[0],q=ge.Vector3[0],j=ge.Vector3[1],Q=ge.Matrix[1];se.IdentityToRef(Q);const w=ge.Matrix[0];this.computeWorldMatrix(!0);let B=this.rotationQuaternion;return B||(B=a._TmpRotation,Be.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,B)),se.ComposeToRef(this.scaling,B,this.position,w),this.parent&&w.multiplyToRef(this.parent.computeWorldMatrix(!0),w),U&&(U.computeWorldMatrix(!0).invertToRef(Q),w.multiplyToRef(Q,w)),w.decompose(j,Z,q,te?this:void 0),this.rotationQuaternion?this.rotationQuaternion.copyFrom(Z):Z.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(j),this.position.copyFrom(q),this.parent=U,Y&&this.setPivotMatrix(se.Identity()),this}addChild(U,te=!1){return U.setParent(this,te),this}removeChild(U,te=!1){return U.parent!==this?this:(U.setParent(null,te),this)}get nonUniformScaling(){return this._nonUniformScaling}_updateNonUniformScalingState(U){return this._nonUniformScaling===U?!1:(this._nonUniformScaling=U,!0)}attachToBone(U,te){return this._currentParentWhenAttachingToBone=this.parent,this._transformToBoneReferal=te,this.parent=U,U.getSkeleton().prepare(!0),U.getFinalMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this}detachFromBone(U=!1){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,U?this.parent=this._currentParentWhenAttachingToBone:this.parent=null,this):(U&&(this.parent=this._currentParentWhenAttachingToBone),this)}rotate(U,te,Y){U.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0));let Z;if(!Y||Y===0)Z=Be.RotationAxisToRef(U,te,a._RotationAxisCache),this.rotationQuaternion.multiplyToRef(Z,this.rotationQuaternion);else{if(this.parent){const q=this.parent.getWorldMatrix(),j=ge.Matrix[0];q.invertToRef(j),U=D.TransformNormal(U,j),q.determinant()<0&&(te*=-1)}Z=Be.RotationAxisToRef(U,te,a._RotationAxisCache),Z.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}return this}rotateAround(U,te,Y){te.normalize(),this.rotationQuaternion||(this.rotationQuaternion=Be.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));const Z=ge.Vector3[0],q=ge.Vector3[1],j=ge.Vector3[2],Q=ge.Quaternion[0],w=ge.Matrix[0],B=ge.Matrix[1],z=ge.Matrix[2],K=ge.Matrix[3];return U.subtractToRef(this.position,Z),se.TranslationToRef(Z.x,Z.y,Z.z,w),se.TranslationToRef(-Z.x,-Z.y,-Z.z,B),se.RotationAxisToRef(te,Y,z),B.multiplyToRef(z,K),K.multiplyToRef(w,K),K.decompose(q,Q,j),this.position.addInPlace(j),Q.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this}translate(U,te,Y){const Z=U.scale(te);if(!Y||Y===0){const q=this.getPositionExpressedInLocalSpace().add(Z);this.setPositionWithLocalVector(q)}else this.setAbsolutePosition(this.getAbsolutePosition().add(Z));return this}addRotation(U,te,Y){let Z;this.rotationQuaternion?Z=this.rotationQuaternion:(Z=ge.Quaternion[1],Be.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,Z));const q=ge.Quaternion[0];return Be.RotationYawPitchRollToRef(te,U,Y,q),Z.multiplyInPlace(q),this.rotationQuaternion||Z.toEulerAnglesToRef(this.rotation),this}_getEffectiveParent(){return this.parent}isWorldMatrixCameraDependent(){return this._infiniteDistance&&!this.parent||this._billboardMode!==a.BILLBOARDMODE_NONE}computeWorldMatrix(U=!1,te=null){if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;const Y=this.getScene().getRenderId();if(!this._isDirty&&!U&&(this._currentRenderId===Y||this.isSynchronized()))return this._currentRenderId=Y,this._worldMatrix;te=te||this.getScene().activeCamera,this._updateCache();const Z=this._cache;Z.pivotMatrixUpdated=!1,Z.billboardMode=this.billboardMode,Z.infiniteDistance=this.infiniteDistance,Z.parent=this._parentNode,this._currentRenderId=Y,this._childUpdateId+=1,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;const q=this._getEffectiveParent(),j=a._TmpScaling;let Q=this._position;if(this._infiniteDistance&&!this.parent&&te){const z=te.getWorldMatrix().m;Q=a._TmpTranslation,Q.copyFromFloats(this._position.x+z[12],this._position.y+z[13],this._position.z+z[14])}j.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant);let w;if(this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,w=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(Be.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(w=a._TmpRotation,Be.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,w)),this._usePivotMatrix){const B=ge.Matrix[1];se.ScalingToRef(j.x,j.y,j.z,B);const z=ge.Matrix[0];w.toRotationMatrix(z),this._pivotMatrix.multiplyToRef(B,ge.Matrix[4]),ge.Matrix[4].multiplyToRef(z,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(Q.x,Q.y,Q.z)}else se.ComposeToRef(j,w,Q,this._localMatrix);if(q&&q.getWorldMatrix){if(U&&q.computeWorldMatrix(U),this.billboardMode){if(this._transformToBoneReferal){const ue=this.parent;ue.getSkeleton().prepare(),ue.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),ge.Matrix[7])}else ge.Matrix[7].copyFrom(q.getWorldMatrix());const B=ge.Vector3[5],z=ge.Vector3[6],K=ge.Quaternion[0];ge.Matrix[7].decompose(z,K,B),se.ScalingToRef(z.x,z.y,z.z,ge.Matrix[7]),ge.Matrix[7].setTranslation(B),a.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(K,B),this._localMatrix.setTranslation(B)),this._localMatrix.multiplyToRef(ge.Matrix[7],this._worldMatrix)}else if(this._transformToBoneReferal){const B=this.parent;B.getSkeleton().prepare(),this._localMatrix.multiplyToRef(B.getFinalMatrix(),ge.Matrix[6]),ge.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)}else this._localMatrix.multiplyToRef(q.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(te&&this.billboardMode)if(Z.useBillboardPosition){const B=ge.Vector3[0];this._worldMatrix.getTranslationToRef(B);const z=te.globalPosition;this._worldMatrix.invertToRef(ge.Matrix[1]);const K=ge.Vector3[1];D.TransformCoordinatesToRef(z,ge.Matrix[1],K),K.normalize();const ue=-Math.atan2(K.z,K.x)+Math.PI/2,he=Math.sqrt(K.x*K.x+K.z*K.z),ve=-Math.atan2(K.y,he);if(Be.RotationYawPitchRollToRef(ue,ve,0,ge.Quaternion[0]),(this.billboardMode&a.BILLBOARDMODE_ALL)!==a.BILLBOARDMODE_ALL){const Le=ge.Vector3[1];ge.Quaternion[0].toEulerAnglesToRef(Le),(this.billboardMode&a.BILLBOARDMODE_X)!==a.BILLBOARDMODE_X&&(Le.x=0),(this.billboardMode&a.BILLBOARDMODE_Y)!==a.BILLBOARDMODE_Y&&(Le.y=0),(this.billboardMode&a.BILLBOARDMODE_Z)!==a.BILLBOARDMODE_Z&&(Le.z=0),se.RotationYawPitchRollToRef(Le.y,Le.x,Le.z,ge.Matrix[0])}
vendor: 9,565 bytes, line 292
292else se.FromQuaternionToRef(ge.Quaternion[0],ge.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(ge.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(ge.Vector3[0])}else{const B=ge.Vector3[0];this._worldMatrix.getTranslationToRef(B),ge.Matrix[1].copyFrom(te.getViewMatrix());const z=this.getScene().useRightHandedSystem;if(z&&ge.Matrix[1].multiplyToRef(a._TmpRHRestore,ge.Matrix[1]),ge.Matrix[1].setTranslationFromFloats(0,0,0),ge.Matrix[1].invertToRef(ge.Matrix[0]),(this.billboardMode&a.BILLBOARDMODE_ALL)!==a.BILLBOARDMODE_ALL){ge.Matrix[0].decompose(void 0,ge.Quaternion[0],void 0);const K=ge.Vector3[1];ge.Quaternion[0].toEulerAnglesToRef(K),(this.billboardMode&a.BILLBOARDMODE_X)!==a.BILLBOARDMODE_X&&(K.x=0),(this.billboardMode&a.BILLBOARDMODE_Y)!==a.BILLBOARDMODE_Y&&(K.y=0),(this.billboardMode&a.BILLBOARDMODE_Z)!==a.BILLBOARDMODE_Z&&(K.z=0),z&&(K.y+=Math.PI),se.RotationYawPitchRollToRef(K.y,K.x,K.z,ge.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(ge.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(ge.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):q&&q._nonUniformScaling?this._updateNonUniformScalingState(q._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=se.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(U=!0){if(this.computeWorldMatrix(),U){const te=this.getChildren();for(let Y=0;Y<te.length;++Y){const Z=te[Y];if(Z){Z.computeWorldMatrix();const q=ge.Matrix[0];Z._localMatrix.multiplyToRef(this._localMatrix,q);const j=ge.Quaternion[0];q.decompose(Z.scaling,j,Z.position),Z.rotationQuaternion?Z.rotationQuaternion.copyFrom(j):j.toEulerAnglesToRef(Z.rotation)}}}this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=Be.Identity()),this._worldMatrix=se.Identity()}_afterComputeWorldMatrix(){}registerAfterWorldMatrixUpdate(U){return this.onAfterWorldMatrixUpdateObservable.add(U),this}unregisterAfterWorldMatrixUpdate(U){return this.onAfterWorldMatrixUpdateObservable.removeCallback(U),this}getPositionInCameraSpace(U=null){return U||(U=this.getScene().activeCamera),D.TransformCoordinates(this.getAbsolutePosition(),U.getViewMatrix())}getDistanceToCamera(U=null){return U||(U=this.getScene().activeCamera),this.getAbsolutePosition().subtract(U.globalPosition).length()}clone(U,te,Y){const Z=xt.Clone(()=>new a(U,this.getScene()),this);if(Z.name=U,Z.id=U,te&&(Z.parent=te),!Y){const q=this.getDescendants(!0);for(let j=0;j<q.length;j++){const Q=q[j];Q.clone&&Q.clone(U+"."+Q.name,Z)}}return Z}serialize(U){const te=xt.Serialize(this,U);return te.type=this.getClassName(),te.uniqueId=this.uniqueId,this.parent&&this.parent._serializeAsParent(te),te.localMatrix=this.getPivotMatrix().asArray(),te.isEnabled=this.isEnabled(),this._isWorldMatrixFrozen&&(te.freezeWorldMatrix=!0),xt.AppendSerializedAnimations(this,te),te.ranges=this.serializeAnimationRanges(),te}getChildTransformNodes(U,te){const Y=[];return this._getDescendants(Y,U,Z=>(!te||te(Z))&&Z instanceof a),Y}dispose(U,te=!1){if(this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this._parentContainer){const Y=this._parentContainer.transformNodes.indexOf(this);Y>-1&&this._parentContainer.transformNodes.splice(Y,1),this._parentContainer=null}if(this.onAfterWorldMatrixUpdateObservable.clear(),U){const Y=this.getChildTransformNodes(!0);for(const Z of Y)Z.parent=null,Z.computeWorldMatrix(!0)}super.dispose(U,te)}normalizeToUnitCube(U=!0,te=!1,Y){let Z=null,q=null;te&&(this.rotationQuaternion?(q=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(Z=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));const j=this.getHierarchyBoundingVectors(U,Y),Q=j.max.subtract(j.min),w=Math.max(Q.x,Q.y,Q.z);if(w===0)return this;const B=1/w;return this.scaling.scaleInPlace(B),te&&(this.rotationQuaternion&&q?this.rotationQuaternion.copyFrom(q):this.rotation&&Z&&this.rotation.copyFrom(Z)),this}_syncAbsoluteScalingAndRotation(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)}},(()=>{const de=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[ua("position")],n=[ua("rotation")],h=[NM("rotationQuaternion")],m=[ua("scaling")],y=[ce("billboardMode")],E=[ce()],O=[ce("infiniteDistance")],P=[ce()],X=[ce()],ee(null,null,t,{kind:"field",name:"_position",static:!1,private:!1,access:{has:U=>"_position"in U,get:U=>U._position,set:(U,te)=>{U._position=te}},metadata:de},i,s),ee(null,null,n,{kind:"field",name:"_rotation",static:!1,private:!1,access:{has:U=>"_rotation"in U,get:U=>U._rotation,set:(U,te)=>{U._rotation=te}},metadata:de},o,c),ee(null,null,h,{kind:"field",name:"_rotationQuaternion",static:!1,private:!1,access:{has:U=>"_rotationQuaternion"in U,get:U=>U._rotationQuaternion,set:(U,te)=>{U._rotationQuaternion=te}},metadata:de},f,_),ee(null,null,m,{kind:"field",name:"_scaling",static:!1,private:!1,access:{has:U=>"_scaling"in U,get:U=>U._scaling,set:(U,te)=>{U._scaling=te}},metadata:de},g,x),ee(null,null,y,{kind:"field",name:"_billboardMode",static:!1,private:!1,access:{has:U=>"_billboardMode"in U,get:U=>U._billboardMode,set:(U,te)=>{U._billboardMode=te}},metadata:de},b,v),ee(null,null,E,{kind:"field",name:"scalingDeterminant",static:!1,private:!1,access:{has:U=>"scalingDeterminant"in U,get:U=>U.scalingDeterminant,set:(U,te)=>{U.scalingDeterminant=te}},metadata:de},R,C),ee(null,null,O,{kind:"field",name:"_infiniteDistance",static:!1,private:!1,access:{has:U=>"_infiniteDistance"in U,get:U=>U._infiniteDistance,set:(U,te)=>{U._infiniteDistance=te}},metadata:de},M,I),ee(null,null,P,{kind:"field",name:"ignoreNonUniformScaling",static:!1,private:!1,access:{has:U=>"ignoreNonUniformScaling"in U,get:U=>U.ignoreNonUniformScaling,set:(U,te)=>{U.ignoreNonUniformScaling=te}},metadata:de},L,V),ee(null,null,X,{kind:"field",name:"reIntegrateRotationIntoRotationQuaternion",static:!1,private:!1,access:{has:U=>"reIntegrateRotationIntoRotationQuaternion"in U,get:U=>U.reIntegrateRotationIntoRotationQuaternion,set:(U,te)=>{U.reIntegrateRotationIntoRotationQuaternion=te}},metadata:de},re,ae),de&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:de})})(),a.BILLBOARDMODE_NONE=0,a.BILLBOARDMODE_X=1,a.BILLBOARDMODE_Y=2,a.BILLBOARDMODE_Z=4,a.BILLBOARDMODE_ALL=7,a.BILLBOARDMODE_USE_POSITION=128,a.BillboardUseParentOrientation=!1,a._TmpRotation=Be.Zero(),a._TmpScaling=D.Zero(),a._TmpTranslation=D.Zero(),a._TmpRHRestore=se.Scaling(1,1,-1),a._LookAtVectorCache=new D(0,0,0),a._RotationAxisCache=new Be,a})();(Qb=rs.prototype).getPhysicsBody??(Qb.getPhysicsBody=Xe("TransformNode","getPhysicsBody"));($b=rs.prototype).applyImpulse??($b.applyImpulse=Xe("TransformNode","applyImpulse"));(Jb=rs.prototype).applyAngularImpulse??(Jb.applyAngularImpulse=Xe("TransformNode","applyAngularImpulse"));(ey=rs.prototype).applyTorque??(ey.applyTorque=Xe("TransformNode","applyTorque"));Object.getOwnPropertyDescriptor(rs.prototype,"physicsBody")||Object.defineProperty(rs.prototype,"physicsBody",gt("TransformNode","physicsBody"));class zc{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(k.NormalKind))return null;let i=this.pickedMesh.getIndices();i?.length===0&&(i=null);let s;const n=ge.Vector3[0],o=ge.Vector3[1],c=ge.Vector3[2];if(t){const f=this.pickedMesh.getVerticesData(k.NormalKind);let _=i?D.FromArrayToRef(f,i[this.faceId*3]*3,n):n.copyFromFloats(f[this.faceId*3*3],f[this.faceId*3*3+1],f[this.faceId*3*3+2]),m=i?D.FromArrayToRef(f,i[this.faceId*3+1]*3,o):o.copyFromFloats(f[(this.faceId*3+1)*3],f[(this.faceId*3+1)*3+1],f[(this.faceId*3+1)*3+2]),g=i?D.FromArrayToRef(f,i[this.faceId*3+2]*3,c):c.copyFromFloats(f[(this.faceId*3+2)*3],f[(this.faceId*3+2)*3+1],f[(this.faceId*3+2)*3+2]);_=_.scale(this.bu),m=m.scale(this.bv),g=g.scale(1-this.bu-this.bv),s=new D(_.x+m.x+g.x,_.y+m.y+g.y,_.z+m.z+g.z)}else{const f=this.pickedMesh.getVerticesData(k.PositionKind),_=i?D.FromArrayToRef(f,i[this.faceId*3]*3,n):n.copyFromFloats(f[this.faceId*3*3],f[this.faceId*3*3+1],f[this.faceId*3*3+2]),m=i?D.FromArrayToRef(f,i[this.faceId*3+1]*3,o):o.copyFromFloats(f[(this.faceId*3+1)*3],f[(this.faceId*3+1)*3+1],f[(this.faceId*3+1)*3+2]),g=i?D.FromArrayToRef(f,i[this.faceId*3+2]*3,c):c.copyFromFloats(f[(this.faceId*3+2)*3],f[(this.faceId*3+2)*3+1],f[(this.faceId*3+2)*3+2]),x=_.subtract(m),y=g.subtract(m);s=D.Cross(x,y)}const h=(f,_)=>{if(this.thinInstanceIndex!==-1){const g=f._thinInstanceDataStorage.matrixData,x=this.thinInstanceIndex<<4;if(g&&g.length>x){const y=ge.Matrix[0];se.FromArrayToRef(g,x,y),D.TransformNormalToRef(_,y,_)}}let m=f.getWorldMatrix();
vendor: 4,243 bytes, line 292
292f.nonUniformScaling&&(ge.Matrix[0].copyFrom(m),m=ge.Matrix[0],m.setTranslationFromFloats(0,0,0),m.invert(),m.transposeToRef(ge.Matrix[1]),m=ge.Matrix[1]),D.TransformNormalToRef(_,m,_)};if(e&&h(this.pickedMesh,s),this.ray){const f=ge.Vector3[0].copyFrom(s);e||h(this.pickedMesh,f),D.Dot(f,this.ray.direction)>0&&s.negateInPlace()}return s.normalize(),s}getTextureCoordinates(e=k.UVKind){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(e))return null;const t=this.pickedMesh.getIndices();if(!t)return null;const i=this.pickedMesh.getVerticesData(e);if(!i)return null;let s=Fe.FromArray(i,t[this.faceId*3]*2),n=Fe.FromArray(i,t[this.faceId*3+1]*2),o=Fe.FromArray(i,t[this.faceId*3+2]*2);return s=s.scale(this.bu),n=n.scale(this.bv),o=o.scale(1-this.bu-this.bv),new Fe(s.x+n.x+o.x,s.y+n.y+o.y)}}class ze{constructor(e,t,i=!1,s,n=!1,o){this._uniformNames=[],this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||n,this._dynamic=i,this._name=s??"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(o===void 0&&this._engine._features.trackUbosInFrame||o===!0)&&(this._buffers=[],this._bufferIndex=-1,this._bufferUpdatedLastFrame=!1,this._createBufferOnWrite=!1,this._currentFrameId=0,this._trackUBOsInFrame=!0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,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 i=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;const s=this._uniformLocationPointer-i;for(let n=0;n<s;n++)this._data.push(0)}}
292addUniform(e,t,i=0){if(i>0&&typeof t=="number"&&(this._uniformArraySizes[e]={strideSize:t,arraySize:i}),this._uniformLocations[e]!==void 0||(this._uniformNames.push(e),this._noUBO))return;let s;if(i>0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),t==16)t=t*i;else{const o=(4-t)*i;t=t*i+o}s=[];for(let n=0;n<t;n++)s.push(0)}else{if(t instanceof Array)s=t,t=s.length;else{s=[];for(let n=0;n<t;n++)s.push(0)}this._fillAlignment(t)}this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t;for(let n=0;n<t;n++)this._data.push(s[n]);this._needSync=!0}addMatrix(e,t){this.addUniform(e,Array.prototype.slice.call(t.asArray()))}addFloat2(e,t,i){const s=[t,i];this.addUniform(e,s)}addFloat3(e,t,i,s){const n=[t,i,s];this.addUniform(e,n)}addColor3(e,t){const i=[t.r,t.g,t.b];this.addUniform(e,i)}addColor4(e,t,i){const s=[t.r,t.g,t.b,i];this.addUniform(e,s)}addVector3(e,t){const i=[t.x,t.y,t.z];this.addUniform(e,i)}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 i in this._uniformLocations)if(e.push(i),++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 i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}_copyBuffer(e,t){for(let i=0;i<e.length;++i)t[i]=e[i]}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][0],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,i){this._checkNewFrame();let s=this._uniformLocations[e];if(s===void 0){if(this._buffer){pe.Error("Cannot add an uniform after UBO has been created. uniformName="+e);return}this.addUniform(e,i),s=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let n=0;n<i;n++)this._bufferData[s+n]=t[n];else{let n=!1;for(let o=0;o<i;o++)(i===16&&!this._engine._features.uniformBufferHardCheckMatrix||this._bufferData[s+o]!==Math.fround(t[o]))&&(n=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+o]=t[o]);this._needSync=this._needSync||n}}updateUniformArray(e,t,i){this._checkNewFrame();const s=this._uniformLocations[e];if(s===void 0){pe.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 n=this._uniformArraySizes[e];if(this._dynamic)for(let o=0;o<i;o++)this._bufferData[s+o]=t[o];else{let o=!1,c=0,h=0;for(let f=0;f<i;
vendor: 4,122 bytes, line 292
292f++)if(this._bufferData[s+h*4+c]!==bt.FloatRound(t[f])&&(o=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+h*4+c]=t[f]),c++,c===n.strideSize){for(;c<4;c++)this._bufferData[s+h*4+c]=0;c=0,h++}this._needSync=this._needSync||o}}_cacheMatrix(e,t){this._checkNewFrame();const i=this._valueCache[e],s=t.updateFlag;return i!==void 0&&i===s?!1:(this._valueCache[e]=s,!0)}_updateMatrix3x3ForUniform(e,t){for(let i=0;i<3;i++)ze._TempBuffer[i*4]=t[i*3],ze._TempBuffer[i*4+1]=t[i*3+1],ze._TempBuffer[i*4+2]=t[i*3+2],ze._TempBuffer[i*4+3]=0;this.updateUniform(e,ze._TempBuffer,12)}_updateMatrix3x3ForEffect(e,t){this._currentEffect.setMatrix3x3(e,t)}_updateMatrix2x2ForEffect(e,t){this._currentEffect.setMatrix2x2(e,t)}_updateMatrix2x2ForUniform(e,t){for(let i=0;i<2;i++)ze._TempBuffer[i*4]=t[i*2],ze._TempBuffer[i*4+1]=t[i*2+1],ze._TempBuffer[i*4+2]=0,ze._TempBuffer[i*4+3]=0;this.updateUniform(e,ze._TempBuffer,8)}_updateFloatForEffect(e,t,i=""){this._currentEffect.setFloat(e+i,t)}_updateFloatForUniform(e,t){ze._TempBuffer[0]=t,this.updateUniform(e,ze._TempBuffer,1)}_updateFloat2ForEffect(e,t,i,s=""){this._currentEffect.setFloat2(e+s,t,i)}_updateFloat2ForUniform(e,t,i){ze._TempBuffer[0]=t,ze._TempBuffer[1]=i,this.updateUniform(e,ze._TempBuffer,2)}_updateFloat3ForEffect(e,t,i,s,n=""){this._currentEffect.setFloat3(e+n,t,i,s)}_updateFloat3ForUniform(e,t,i,s){ze._TempBuffer[0]=t,ze._TempBuffer[1]=i,ze._TempBuffer[2]=s,this.updateUniform(e,ze._TempBuffer,3)}_updateFloat4ForEffect(e,t,i,s,n,o=""){this._currentEffect.setFloat4(e+o,t,i,s,n)}_updateFloat4ForUniform(e,t,i,s,n){ze._TempBuffer[0]=t,ze._TempBuffer[1]=i,ze._TempBuffer[2]=s,ze._TempBuffer[3]=n,this.updateUniform(e,ze._TempBuffer,4)}_updateFloatArrayForEffect(e,t,i=""){switch(this._uniformArraySizes[e]?.strideSize){case 2:this._currentEffect.setFloatArray2(e+i,t);break;case 3:this._currentEffect.setFloatArray3(e+i,t);break;case 4:this._currentEffect.setFloatArray4(e+i,t);break;default:this._currentEffect.setFloatArray(e+i,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){ze._TempBufferInt32View.set(t),this.updateUniformArray(e,ze._TempBuffer,t.length)}_updateUIntArrayForEffect(e,t){this._currentEffect.setUIntArray(e,t)}_updateUIntArrayForUniform(e,t){ze._TempBufferUInt32View.set(t),this.updateUniformArray(e,ze._TempBuffer,t.length)}_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){ze._TempBuffer[0]=t.x,ze._TempBuffer[1]=t.y,ze._TempBuffer[2]=t.z,this.updateUniform(e,ze._TempBuffer,3)}_updateVector4ForEffect(e,t){this._currentEffect.setVector4(e,t)}_updateVector4ForUniform(e,t){ze._TempBuffer[0]=t.x,ze._TempBuffer[1]=t.y,ze._TempBuffer[2]=t.z,ze._TempBuffer[3]=t.w,this.updateUniform(e,ze._TempBuffer,4)}_updateColor3ForEffect(e,t,i=""){this._currentEffect.setColor3(e+i,t)}_updateColor3ForUniform(e,t){ze._TempBuffer[0]=t.r,ze._TempBuffer[1]=t.g,ze._TempBuffer[2]=t.b,this.updateUniform(e,ze._TempBuffer,3)}_updateColor4ForEffect(e,t,i,s=""){this._currentEffect.setColor4(e+s,t,i)}_updateDirectColor4ForEffect(e,t,i=""){this._currentEffect.setDirectColor4(e+i,t)}_updateColor4ForUniform(e,t,i){ze._TempBuffer[0]=t.r,ze._TempBuffer[1]=t.g,ze._TempBuffer[2]=t.b,ze._TempBuffer[3]=i,this.updateUniform(e,ze._TempBuffer,4)}_updateDirectColor4ForUniform(e,t){ze._TempBuffer[0]=t.r,ze._TempBuffer[1]=t.g,ze._TempBuffer[2]=t.b,ze._TempBuffer[3]=t.a,this.updateUniform(e,ze._TempBuffer,4)}_updateIntForEffect(e,t,i=""){this._currentEffect.setInt(e+i,t)}_updateIntForUniform(e,t){ze._TempBufferInt32View[0]=t,this.updateUniform(e,ze._TempBuffer,1)}
vendor: 14,655 bytes, line 292
292_updateInt2ForEffect(e,t,i,s=""){this._currentEffect.setInt2(e+s,t,i)}_updateInt2ForUniform(e,t,i){ze._TempBufferInt32View[0]=t,ze._TempBufferInt32View[1]=i,this.updateUniform(e,ze._TempBuffer,2)}_updateInt3ForEffect(e,t,i,s,n=""){this._currentEffect.setInt3(e+n,t,i,s)}_updateInt3ForUniform(e,t,i,s){ze._TempBufferInt32View[0]=t,ze._TempBufferInt32View[1]=i,ze._TempBufferInt32View[2]=s,this.updateUniform(e,ze._TempBuffer,3)}_updateInt4ForEffect(e,t,i,s,n,o=""){this._currentEffect.setInt4(e+o,t,i,s,n)}_updateInt4ForUniform(e,t,i,s,n){ze._TempBufferInt32View[0]=t,ze._TempBufferInt32View[1]=i,ze._TempBufferInt32View[2]=s,ze._TempBufferInt32View[3]=n,this.updateUniform(e,ze._TempBuffer,4)}_updateUIntForEffect(e,t,i=""){this._currentEffect.setUInt(e+i,t)}_updateUIntForUniform(e,t){ze._TempBufferUInt32View[0]=t,this.updateUniform(e,ze._TempBuffer,1)}_updateUInt2ForEffect(e,t,i,s=""){this._currentEffect.setUInt2(e+s,t,i)}_updateUInt2ForUniform(e,t,i){ze._TempBufferUInt32View[0]=t,ze._TempBufferUInt32View[1]=i,this.updateUniform(e,ze._TempBuffer,2)}_updateUInt3ForEffect(e,t,i,s,n=""){this._currentEffect.setUInt3(e+n,t,i,s)}_updateUInt3ForUniform(e,t,i,s){ze._TempBufferUInt32View[0]=t,ze._TempBufferUInt32View[1]=i,ze._TempBufferUInt32View[2]=s,this.updateUniform(e,ze._TempBuffer,3)}_updateUInt4ForEffect(e,t,i,s,n,o=""){this._currentEffect.setUInt4(e+o,t,i,s,n)}_updateUInt4ForUniform(e,t,i,s,n){ze._TempBufferUInt32View[0]=t,ze._TempBufferUInt32View[1]=i,ze._TempBufferUInt32View[2]=s,ze._TempBufferUInt32View[3]=n,this.updateUniform(e,ze._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 i=0;i<this._buffers.length;++i){const s=this._buffers[i][0];this._engine._releaseBuffer(s)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}ze._MAX_UNIFORM_SIZE=256;ze._TempBuffer=new Float32Array(ze._MAX_UNIFORM_SIZE);ze._TempBufferInt32View=new Int32Array(ze._TempBuffer.buffer);ze._TempBufferUInt32View=new Uint32Array(ze._TempBuffer.buffer);class MC{constructor(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new D(0,0,0),this._diffPositionForCollisions=new D(0,0,0),this._collisionResponse=!0}}var ty,iy,sy;function CC(a,e,t){let i;switch(e){case k.PositionKind:i=s=>s.getPositions();break;case k.NormalKind:i=s=>s.getNormals();break;case k.TangentKind:i=s=>s.getTangents();break;case k.UVKind:i=s=>s.getUVs();break;case k.UV2Kind:i=s=>s.getUV2s();break;case k.ColorKind:i=s=>s.getColors();break;default:return}for(let s=0;s<a.length;s++){let n=a[s];for(let o=0;o<t.numTargets;o++){const c=t.getTarget(o),h=c.influence;if(h!==0){const f=i(c);f&&(n+=(f[s]-a[s])*h)}}a[s]=n}}function DC(a,e,t,i,s,n,o){const c=ge.Vector3[0],h=ge.Matrix[0],f=ge.Matrix[1],_=e===k.NormalKind?D.TransformNormalFromFloatsToRef:D.TransformCoordinatesFromFloatsToRef;for(let m=0,g=0;m<a.length;m+=3,g+=4){h.reset();let x,y;for(x=0;x<4;x++)y=s[g+x],y>0&&(se.FromFloat32ArrayToRefScaled(t,Math.floor(i[g+x]*16),y,f),h.addToSelf(f));if(n&&o)for(x=0;x<4;x++)y=o[g+x],y>0&&(se.FromFloat32ArrayToRefScaled(t,Math.floor(n[g+x]*16),y,f),h.addToSelf(f));_(a[m],a[m+1],a[m+2],h,c),c.toArray(a,m)}}function ry(a,e){return a-Math.floor(a/e)*e}function IC(a,e){const t=a.y-a.x+1,i=e*a.w/t,s=i<1?0:1,n=t-s;let o=ry(i-Math.floor(i),1)*n;return o=ry(o+a.z,n),Math.floor(o)+a.x+s}function ny(a,e,t){if(a instanceof Float32Array){se.FromArrayToRef(a,e,t);return}t.copyFromFloats(is(a[e]),is(a[e+1]),is(a[e+2]),is(a[e+3]),is(a[e+4]),is(a[e+5]),is(a[e+6]),is(a[e+7]),is(a[e+8]),is(a[e+9]),is(a[e+10]),is(a[e+11]),is(a[e+12]),is(a[e+13]),is(a[e+14]),is(a[e+15]))}function PC(a,e,t,i,s,n,o,c,h){const f=t.texture,m=f?.getInternalTexture()?._bufferView;if(!(m instanceof Float32Array)&&!(m instanceof Uint16Array))return pe.Warn("Baked vertex animation bounding info requires CPU-readable Float32Array or Uint16Array texture data.",1),!1;const g=f.getSize(),x=IC(i,t.time);if(!isFinite(x)||x<0||x>=g.height)return pe.Warn("Baked vertex animation bounding info could not be refreshed because the computed frame is outside the texture.",1),!1;const y=ge.Vector3[0],b=ge.Matrix[0],v=ge.Matrix[1],E=x*g.width*4,R=e===k.NormalKind?D.TransformNormalFromFloatsToRef:D.TransformCoordinatesFromFloatsToRef;for(let C=0,O=0;C<a.length;C+=3,O+=4){b.reset();let M,I;for(M=0;M<4&&M<h;M++)I=n[O+M],I>0&&(ny(m,E+Math.floor(s[O+M])*16,v),v.scaleAndAddToRef(I,b));if(o&&c)for(M=0;M<4&&M+4<h;M++)I=c[O+M],I>0&&(ny(m,E+Math.floor(o[O+M])*16,v),v.scaleAndAddToRef(I,b));R(a[C],a[C+1],a[C+2],b,y),y.toArray(a,C)}return!0}class OC{constructor(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=D.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1}}class wC{constructor(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new OC,this._visibility=1,this._skeleton=null,this._layerMask=268435455,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=new Map,this._collisionRetryCount=3,this._morphTargetManager=null,this._renderingGroupId=0,this._bakedVertexAnimationManager=null,this._material=null,this._positions=null,this._pointerOverDisableMeshTesting=!1,this._meshCollisionData=new MC,this._enableDistantPicking=!1,this._rawBoundingInfo=null,this._sideOrientationHint=!1,this._wasActiveLastFrame=!1}}let Ht=(()=>{var a;let e=rs,t=[],i;return a=class extends e{static get BILLBOARDMODE_NONE(){return rs.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){return rs.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){return rs.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){return rs.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){return rs.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){return rs.BILLBOARDMODE_USE_POSITION}get facetNb(){return this._internalAbstractMeshDataInfo._facetData.facetNb}get partitioningSubdivisions(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions}set partitioningSubdivisions(n){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=n}get partitioningBBoxRatio(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio}set partitioningBBoxRatio(n){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=n}get mustDepthSortFacets(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort}set mustDepthSortFacets(n){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=n}get facetDepthSortFrom(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom}set facetDepthSortFrom(n){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=n}get collisionRetryCount(){return this._internalAbstractMeshDataInfo._collisionRetryCount}set collisionRetryCount(n){this._internalAbstractMeshDataInfo._collisionRetryCount=n}get isFacetDataEnabled(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled}get morphTargetManager(){return this._internalAbstractMeshDataInfo._morphTargetManager}set morphTargetManager(n){this._internalAbstractMeshDataInfo._morphTargetManager!==n&&(this._internalAbstractMeshDataInfo._morphTargetManager=n,this._syncGeometryWithMorphTargetManager())}get bakedVertexAnimationManager(){return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager}set bakedVertexAnimationManager(n){this._internalAbstractMeshDataInfo._bakedVertexAnimationManager!==n&&(this._internalAbstractMeshDataInfo._bakedVertexAnimationManager=n,this._markSubMeshesAsAttributesDirty())}_syncGeometryWithMorphTargetManager(){}_updateNonUniformScalingState(n){return super._updateNonUniformScalingState(n)?(this._markSubMeshesAsMiscDirty(),!0):!1}get rawBoundingInfo(){return this._internalAbstractMeshDataInfo._rawBoundingInfo}set rawBoundingInfo(n){this._internalAbstractMeshDataInfo._rawBoundingInfo=n}set onCollide(n){this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver=this.onCollideObservable.add(n)}set onCollisionPositionChange(n){this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(n)}get visibility(){return this._internalAbstractMeshDataInfo._visibility}set visibility(n){if(this._internalAbstractMeshDataInfo._visibility===n)return;const o=this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility=n,(o===1&&n!==1||o!==1&&n===1)&&this._markSubMeshesAsDirty(c=>{c.markAsMiscDirty(),c.markAsPrePassDirty()})}get pointerOverDisableMeshTesting(){return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting}set pointerOverDisableMeshTesting(n){this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting=n}get renderingGroupId(){return this._internalAbstractMeshDataInfo._renderingGroupId}set renderingGroupId(n){this._internalAbstractMeshDataInfo._renderingGroupId=n}get material(){return this._internalAbstractMeshDataInfo._material}set material(n){this._setMaterial(n)}_setMaterial(n){this._internalAbstractMeshDataInfo._material!==n&&(this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._material=n,n&&n.meshMap&&(n.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&(this.resetDrawCache(void 0,n==null),this._unBindEffect()))}getMaterialForRenderPass(n){return this._internalAbstractMeshDataInfo._materialForRenderPass?.[n]}setMaterialForRenderPass(n,o){this.resetDrawCache(n),this._internalAbstractMeshDataInfo._materialForRenderPass||(this._internalAbstractMeshDataInfo._materialForRenderPass=[]);const c=this._internalAbstractMeshDataInfo._materialForRenderPass[n];c?.meshMap?.[this.uniqueId]&&(c.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._materialForRenderPass[n]=o,o&&o.meshMap&&(o.meshMap[this.uniqueId]=this)}get receiveShadows(){return this._internalAbstractMeshDataInfo._receiveShadows}set receiveShadows(n){this._internalAbstractMeshDataInfo._receiveShadows!==n&&(this._internalAbstractMeshDataInfo._receiveShadows=n,this._markSubMeshesAsLightDirty())}get hasVertexAlpha(){return this._internalAbstractMeshDataInfo._hasVertexAlpha}set hasVertexAlpha(n){this._internalAbstractMeshDataInfo._hasVertexAlpha!==n&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=n,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())}get useVertexColors(){return this._internalAbstractMeshDataInfo._useVertexColors}set useVertexColors(n){this._internalAbstractMeshDataInfo._useVertexColors!==n&&(this._internalAbstractMeshDataInfo._useVertexColors=n,this._markSubMeshesAsAttributesDirty())}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(n){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==n&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=n,this._markSubMeshesAsAttributesDirty())}get numBoneInfluencers(){return this._internalAbstractMeshDataInfo._numBoneInfluencers}set numBoneInfluencers(n){this._internalAbstractMeshDataInfo._numBoneInfluencers!==n&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=n,this._markSubMeshesAsAttributesDirty())}get applyFog(){return this._internalAbstractMeshDataInfo._applyFog}set applyFog(n){this._internalAbstractMeshDataInfo._applyFog!==n&&(this._internalAbstractMeshDataInfo._applyFog=n,this._markSubMeshesAsMiscDirty())}get enableDistantPicking(){return this._internalAbstractMeshDataInfo._enableDistantPicking}set enableDistantPicking(n){this._internalAbstractMeshDataInfo._enableDistantPicking=n}get layerMask(){return this._internalAbstractMeshDataInfo._layerMask}set layerMask(n){n!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=n,this._resyncLightSources())}get collisionMask(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask}set collisionMask(n){this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask=isNaN(n)?-1:n}get collisionResponse(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse}set collisionResponse(n){this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse=n}get collisionGroup(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup}set collisionGroup(n){this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup=isNaN(n)?-1:n}get surroundingMeshes(){return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes}set surroundingMeshes(n){this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes=n}get lightSources(){return this._lightSources}set skeleton(n){const o=this._internalAbstractMeshDataInfo._skeleton;
vendor: 7,531 bytes, line 292
292o&&o.needInitialSkinMatrix&&o._unregisterMeshWithPoseMatrix(this),n&&n.needInitialSkinMatrix&&n._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=n,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()}get skeleton(){return this._internalAbstractMeshDataInfo._skeleton}constructor(n,o=null){switch(super(n,o,!1),this._internalAbstractMeshDataInfo=new wC,this._waitingMaterialId=null,this._waitingMorphTargetManagerId=null,this._waitingSkeletonId=null,this._waitingSkeletonUniqueId=null,this.cullingStrategy=a.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new Me,this.onCollisionPositionChangeObservable=new Me,this.onMaterialChangedObservable=new Me,this.definedFacingForward=!0,this._occlusionQuery=null,this._renderingGroup=null,this.alphaIndex=Number.MAX_VALUE,this.isPickable=a.DefaultIsPickable,this.isNearPickable=!1,this.isNearGrabbable=!1,this.showSubMeshesBoundingBox=!1,this.isBlocker=!1,this.enablePointerMoveEvents=!1,this.outlineColor=rt.Red(),this.outlineWidth=.02,this.overlayColor=rt.Red(),this.overlayAlpha=.5,this.useOctreeForRenderingSelection=!0,this.useOctreeForPicking=!0,this.useOctreeForCollisions=!0,this.alwaysSelectAsActiveMesh=!1,this.doNotSyncBoundingInfo=!1,this.actionManager=null,this.ellipsoid=new D(.5,1,.5),this.ellipsoidOffset=new D(0,0,0),this.edgesWidth=1,this.edgesColor=new _t(1,0,0,1),this._edgesRenderer=null,this._masterMesh=null,this._boundingInfo=null,this._boundingInfoIsDirty=!0,this._renderId=0,this._intersectionsInProgress=new Array,this._unIndexed=!1,this._lightSources=new Array,this._waitingData={lods:null,actions:null,freezeWorldMatrix:null},this._bonesTransformMatrices=null,this._transformMatrixTexture=null,this.onRebuildObservable=new Me,this._onCollisionPositionChange=(c,h,f=null)=>{h.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>Ie.CollisionsEpsilon&&this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),f&&this.onCollideObservable.notifyObservers(f),this.onCollisionPositionChangeObservable.notifyObservers(this.position)},o=this.getScene(),this.layerMask=o.defaultRenderableLayerMask,o.addMesh(this),this._resyncLightSources(),this._uniformBuffer=new ze(this.getScene().getEngine(),void 0,void 0,n,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),o.performancePriority){case 2:this.doNotSyncBoundingInfo=!0;case 1:this.alwaysSelectAsActiveMesh=!0,this.isPickable=!1;break}}_buildUniformLayout(){this._uniformBuffer.addUniform("world",16),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.create()}transferToEffect(n){const o=this._uniformBuffer;o.updateMatrix("world",n),o.updateFloat("visibility",this._internalAbstractMeshDataInfo._visibility),o.update()}getMeshUniformBuffer(){return this._uniformBuffer}getClassName(){return"AbstractMesh"}toString(n){let o="Name: "+this.name+", isInstance: "+(this.getClassName()==="InstancedMesh"?"YES":"NO");o+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);const c=this._internalAbstractMeshDataInfo._skeleton;return c&&(o+=", skeleton: "+c.name),n&&(o+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],o+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),o}_getEffectiveParent(){return this._masterMesh&&this.billboardMode!==rs.BILLBOARDMODE_NONE?this._masterMesh:super._getEffectiveParent()}_getActionManagerForTrigger(n,o=!0){if(this.actionManager&&(o||this.actionManager.isRecursive))if(n){if(this.actionManager.hasSpecificTrigger(n))return this.actionManager}else return this.actionManager;return this.parent?this.parent._getActionManagerForTrigger(n,!1):null}_releaseRenderPassId(n){}_rebuild(n=!1){if(this.onRebuildObservable.notifyObservers(this),this._occlusionQuery!==null&&(this._occlusionQuery=null),!!this.subMeshes){for(const o of this.subMeshes)o._rebuild();this.resetDrawCache()}}_resyncLightSources(){this._lightSources.length=0;for(const n of this.getScene().lights)n.isEnabled()&&n.canAffectMesh(this)&&this._lightSources.push(n);this._markSubMeshesAsLightDirty()}_resyncLightSource(n){const o=n.isEnabled()&&n.canAffectMesh(this),c=this._lightSources.indexOf(n);let h=!1;if(c===-1){if(!o)return;this._lightSources.push(n)}else{if(o)return;h=!0,this._lightSources.splice(c,1)}this._markSubMeshesAsLightDirty(h)}_unBindEffect(){for(const n of this.subMeshes)n.setEffect(null)}_removeLightSource(n,o){const c=this._lightSources.indexOf(n);c!==-1&&(this._lightSources.splice(c,1),this._markSubMeshesAsLightDirty(o))}_markSubMeshesAsDirty(n){if(this.subMeshes)for(const o of this.subMeshes)for(let c=0;c<o._drawWrappers.length;++c){const h=o._drawWrappers[c];!h||!h.defines||!h.defines.markAllAsDirty||n(h.defines)}}_markSubMeshesAsLightDirty(n=!1){this._markSubMeshesAsDirty(o=>o.markAsLightDirty(n))}_markSubMeshesAsAttributesDirty(){this._markSubMeshesAsDirty(n=>n.markAsAttributesDirty())}_markSubMeshesAsMiscDirty(){this._markSubMeshesAsDirty(n=>n.markAsMiscDirty())}markAsDirty(n){return this._currentRenderId=Number.MAX_VALUE,super.markAsDirty(n),this._isDirty=!0,this}resetDrawCache(n,o=!1){if(this.subMeshes)for(const c of this.subMeshes)c.resetDrawCache(n,o)}get isBlocked(){return!1}getLOD(n){return this}getTotalVertices(){return 0}getTotalIndices(){return 0}getIndices(){return null}getVerticesData(n){return null}setVerticesData(n,o,c,h){return this}updateVerticesData(n,o,c,h){return this}setIndices(n,o){return this}isVerticesDataPresent(n){return!1}getBoundingInfo(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfoIsDirty&&(this._boundingInfoIsDirty=!1,this._updateBoundingInfo()),this._boundingInfo)}getRawBoundingInfo(){return this.rawBoundingInfo??this.getBoundingInfo()}setBoundingInfo(n){return this._boundingInfo=n,this}get hasBoundingInfo(){return this._boundingInfo!==null}buildBoundingInfo(n,o,c){return this._boundingInfo=new Ws(n,o,c),this._boundingInfo}normalizeToUnitCube(n=!0,o=!1,c){return super.normalizeToUnitCube(n,o,c)}get useBones(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(k.MatricesIndicesKind)&&this.isVerticesDataPresent(k.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(n){}_activate(n,o){return this._renderId=n,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){return this._masterMesh&&this.billboardMode===rs.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():super.getWorldMatrix()}_getWorldMatrixDeterminant(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():super._getWorldMatrixDeterminant()}get isAnInstance(){return!1}get hasInstances(){return!1}get hasThinInstances(){return!1}movePOV(n,o,c){return this.position.addInPlace(this.calcMovePOV(n,o,c)),this}calcMovePOV(n,o,c){const h=new se;(this.rotationQuaternion?this.rotationQuaternion:Be.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(h);const _=D.Zero(),m=this.definedFacingForward?-1:1;return D.TransformCoordinatesFromFloatsToRef(n*m,o,c*m,h,_),_}rotatePOV(n,o,c){return this.rotation.addInPlace(this.calcRotatePOV(n,o,c)),this}calcRotatePOV(n,o,c){const h=this.definedFacingForward?1:-1;return new D(n*h,o,c*h)}
vendor: 4,518 bytes, line 292
292_refreshBoundingInfo(n,o){if(n){const c=Pv(n,0,this.getTotalVertices(),o);this._boundingInfo?this._boundingInfo.reConstruct(c.minimum,c.maximum):this._boundingInfo=new Ws(c.minimum,c.maximum)}if(this.subMeshes)for(let c=0;c<this.subMeshes.length;c++)this.subMeshes[c].refreshBoundingInfo(n);this._updateBoundingInfo()}_refreshBoundingInfoDirect(n){if(this._boundingInfo?this._boundingInfo.reConstruct(n.minimum,n.maximum):this._boundingInfo=new Ws(n.minimum,n.maximum),this.subMeshes)for(let o=0;o<this.subMeshes.length;o++)this.subMeshes[o].refreshBoundingInfo(null);this._updateBoundingInfo()}static _ApplySkeleton(n,o,c,h,f,_,m){DC(n,o,c,h,f,_,m)}_getData(n,o,c=k.PositionKind){const h=n.cache,f=g=>{if(h){const x=h._vertexData||(h._vertexData={});return x[g]||this.copyVerticesData(g,x),x[g]}return this.getVerticesData(g)};if(o||(o=f(c)),!o)return null;h?(h._outputData?h._outputData.set(o):h._outputData=new Float32Array(o),o=h._outputData):(n.applyMorph&&this.morphTargetManager||n.applySkeleton&&this.skeleton||n.applyBakedVertexAnimation&&this.bakedVertexAnimationManager?.isEnabled)&&(o=o.slice()),n.applyMorph&&this.morphTargetManager&&CC(o,c,this.morphTargetManager);const _=this.bakedVertexAnimationManager;let m=!1;if(n.applyBakedVertexAnimation&&_?.isEnabled){const g=f(k.MatricesIndicesKind),x=f(k.MatricesWeightsKind);if(x&&g){const y=this.numBoneInfluencers>4,b=y?f(k.MatricesIndicesExtraKind):null,v=y?f(k.MatricesWeightsExtraKind):null;m=PC(o,c,_,n.bakedVertexAnimationSettings??_.animationParameters,g,x,b,v,this.numBoneInfluencers)}}if(!m&&n.applySkeleton&&this.skeleton){const g=f(k.MatricesIndicesKind),x=f(k.MatricesWeightsKind);if(x&&g){const y=this.numBoneInfluencers>4,b=y?f(k.MatricesIndicesExtraKind):null,v=y?f(k.MatricesWeightsExtraKind):null,E=this.skeleton.getTransformMatrices(this);a._ApplySkeleton(o,c,E,g,x,b,v)}}if(n.updatePositionsArray!==!1&&c===k.PositionKind){const g=this._internalAbstractMeshDataInfo._positions||[],x=g.length;if(g.length=o.length/3,x<g.length)for(let y=x;y<g.length;y++)g[y]=new D;for(let y=0,b=0;y<g.length;y++,b+=3)g[y].copyFromFloats(o[b],o[b+1],o[b+2]);this._internalAbstractMeshDataInfo._positions=g}return o}getNormalsData(n=!1,o=!1){return this._getData({applySkeleton:n,applyMorph:o,updatePositionsArray:!1},null,k.NormalKind)}getPositionData(n=!1,o=!1,c=null){return this._getData({applySkeleton:n,applyMorph:o,updatePositionsArray:!1},c,k.PositionKind)}_updateBoundingInfo(){return this._boundingInfo?this._boundingInfo.update(this.worldMatrixFromCache):this._boundingInfo=new Ws(D.Zero(),D.Zero(),this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}_updateSubMeshesBoundingInfo(n){if(!this.subMeshes)return this;const o=this.subMeshes.length;for(let c=0;c<o;c++){const h=this.subMeshes[c];(o>1||!h.IsGlobal)&&h.updateBoundingInfo(n)}return this}_afterComputeWorldMatrix(){this.doNotSyncBoundingInfo||(this._boundingInfoIsDirty=!0)}isInFrustum(n){return this.getBoundingInfo().isInFrustum(n,this.cullingStrategy)}isCompletelyInFrustum(n){return this.getBoundingInfo().isCompletelyInFrustum(n)}intersectsMesh(n,o=!1,c){const h=this.getBoundingInfo(),f=n.getBoundingInfo();if(h.intersects(f,o))return!0;if(c){for(const _ of this.getChildMeshes())if(_.intersectsMesh(n,o,!0))return!0}return!1}intersectsPoint(n){return this.getBoundingInfo().intersectsPoint(n)}get checkCollisions(){return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions}set checkCollisions(n){this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions=n}get collider(){return this._internalAbstractMeshDataInfo._meshCollisionData._collider}moveWithCollisions(n,o=!0){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);const h=this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider||(this._internalAbstractMeshDataInfo._meshCollisionData._collider=h.createCollider()),this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius=this.ellipsoid,h.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,n,this._internalAbstractMeshDataInfo._meshCollisionData._collider,this.collisionRetryCount,this,this._onCollisionPositionChange,this.uniqueId,o),this}_collideForSubMesh(n,o,c){if(this._generatePointsArray(),!this._positions)return this;if(!n._lastColliderWorldVertices||!n._lastColliderTransformMatrix.equals(o)){
vendor: 16,384 bytes, line 292
292n._lastColliderTransformMatrix=o.clone(),n._lastColliderWorldVertices=[],n._trianglePlanes=[];const h=n.verticesStart,f=n.verticesStart+n.verticesCount;for(let _=h;_<f;_++)n._lastColliderWorldVertices.push(D.TransformCoordinates(this._positions[_],o))}return c._collide(n._trianglePlanes,n._lastColliderWorldVertices,this.getIndices(),n.indexStart,n.indexStart+n.indexCount,n.verticesStart,!!n.getMaterial(),this,this._shouldConvertRHS(),n.getMaterial()?.fillMode===7),this}_processCollisionsForSubMeshes(n,o){const c=this._scene.getCollidingSubMeshCandidates(this,n),h=c.length;for(let f=0;f<h;f++){const _=c.data[f];h>1&&!_._checkCollision(n)||this._collideForSubMesh(_,o,n)}return this}_shouldConvertRHS(){return!1}_checkCollision(n){if(!this.getBoundingInfo()._checkCollision(n))return this;const o=ge.Matrix[0],c=ge.Matrix[1];return se.ScalingToRef(1/n._radius.x,1/n._radius.y,1/n._radius.z,o),this.worldMatrixFromCache.multiplyToRef(o,c),this._processCollisionsForSubMeshes(n,c),this}_generatePointsArray(){return!1}intersects(n,o,c,h=!1,f,_=!1){const m=new zc,g=this.getClassName(),x=g==="InstancedLinesMesh"||g==="LinesMesh"||g==="GreasedLineMesh"?this.intersectionThreshold:0,y=this.getBoundingInfo();if(!this.subMeshes||!_&&(!n.intersectsSphere(y.boundingSphere,x)||!n.intersectsBox(y.boundingBox,x)))return m;if(h)return m.hit=!_,m.pickedMesh=_?null:this,m.distance=_?0:D.Distance(n.origin,y.boundingSphere.center),m.subMeshId=0,m;if(!this._generatePointsArray())return m;let b=null;const v=this._scene.getIntersectingSubMeshCandidates(this,n),E=v.length;let R=!1;for(let C=0;C<E;C++){const M=v.data[C].getMaterial();if(M&&(M.fillMode==7||M.fillMode==0||M.fillMode==1||M.fillMode==2||M.fillMode==4)){R=!0;break}}if(!R)return m.hit=!0,m.pickedMesh=this,m.distance=D.Distance(n.origin,y.boundingSphere.center),m.subMeshId=-1,m;for(let C=0;C<E;C++){const O=v.data[C];if(E>1&&!_&&!O.canIntersects(n))continue;const M=O.intersects(n,this._positions,this.getIndices(),o,c);if(M&&(o||!b||M.distance<b.distance)&&(b=M,b.subMeshId=O._id,b._internalSubMeshId=C,o))break}if(b){const C=f??this.getWorldMatrix(),O=ge.Vector3[0],M=ge.Vector3[1];D.TransformCoordinatesToRef(n.origin,C,O),n.direction.scaleToRef(b.distance,M);const P=D.TransformNormal(M,C).addInPlace(O);return m.hit=!0,m.distance=D.Distance(O,P),m.pickedPoint=P,m.pickedMesh=this,m.bu=b.bu||0,m.bv=b.bv||0,m.subMeshFaceId=b.faceId,m.faceId=b.faceId+v.data[b._internalSubMeshId].indexStart/(this.getClassName().indexOf("LinesMesh")!==-1?2:3),m.subMeshId=b.subMeshId,m}return m}clone(n,o,c){return null}releaseSubMeshes(n=!1){if(this.subMeshes)for(;this.subMeshes.length;)this.subMeshes[0].dispose(n);else this.subMeshes=[];return this}dispose(n,o=!1){let c;const h=this.getScene();for(this._scene.useMaterialMeshMap&&this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),h.freeActiveMeshes(),h.freeRenderingGroups(),h.renderingManager.maintainStateBetweenFrames&&h.renderingManager.restoreDispachedFlags(),this.actionManager!==void 0&&this.actionManager!==null&&(this.actionManager.disposeWhenUnowned&&!this._scene.meshes.some(m=>m!==this&&m.actionManager===this.actionManager)&&this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),c=0;c<this._intersectionsInProgress.length;c++){const m=this._intersectionsInProgress[c],g=m._intersectionsInProgress.indexOf(this);m._intersectionsInProgress.splice(g,1)}this._intersectionsInProgress.length=0;const f=h.lights;for(const m of f){let g=m.includedOnlyMeshes.indexOf(this);g!==-1&&m.includedOnlyMeshes.splice(g,1),g=m.excludedMeshes.indexOf(this),g!==-1&&m.excludedMeshes.splice(g,1);const x=m.getShadowGenerators();if(x){const y=x.values();for(let b=y.next();b.done!==!0;b=y.next()){const E=b.value.getShadowMap();E&&E.renderList&&(g=E.renderList.indexOf(this),g!==-1&&E.renderList.splice(g,1))}}}this.releaseSubMeshes(h._isDisposing);const _=h.getEngine();if(this._occlusionQuery!==null&&(this.isOcclusionQueryInProgress=!1,_.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),_.wipeCaches(),h.removeMesh(this),this._parentContainer){const m=this._parentContainer.meshes.indexOf(this);m>-1&&this._parentContainer.meshes.splice(m,1),this._parentContainer=null}if(o&&this.material&&(this.material.getClassName()==="MultiMaterial"?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!n)for(c=0;c<h.particleSystems.length;c++)h.particleSystems[c].emitter===this&&(h.particleSystems[c].dispose(),c--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled&&this.disableFacetData(),this._uniformBuffer.dispose(),this.onAfterWorldMatrixUpdateObservable.clear(),this.onCollideObservable.clear(),this.onCollisionPositionChangeObservable.clear(),this.onRebuildObservable.clear(),super.dispose(n,o)}_initFacetData(){const n=this._internalAbstractMeshDataInfo._facetData;n.facetNormals||(n.facetNormals=[]),n.facetPositions||(n.facetPositions=[]),n.facetPartitioning||(n.facetPartitioning=new Array),n.facetNb=this.getIndices().length/3|0,n.partitioningSubdivisions=n.partitioningSubdivisions?n.partitioningSubdivisions:10,n.partitioningBBoxRatio=n.partitioningBBoxRatio?n.partitioningBBoxRatio:1.01;for(let o=0;o<n.facetNb;o++)n.facetNormals[o]=D.Zero(),n.facetPositions[o]=D.Zero();return n.facetDataEnabled=!0,this}updateFacetData(){const n=this._internalAbstractMeshDataInfo._facetData;n.facetDataEnabled||this._initFacetData();const o=this.getVerticesData(k.PositionKind),c=this.getIndices(),h=this.getVerticesData(k.NormalKind)?.slice(),f=this.getBoundingInfo();if(n.facetDepthSort&&!n.facetDepthSortEnabled){if(n.facetDepthSortEnabled=!0,c instanceof Uint16Array)n.depthSortedIndices=new Uint16Array(c);else if(c instanceof Uint32Array)n.depthSortedIndices=new Uint32Array(c);else{let m=!1;for(let g=0;g<c.length;g++)if(c[g]>65535){m=!0;break}m?n.depthSortedIndices=new Uint32Array(c):n.depthSortedIndices=new Uint16Array(c)}if(n.facetDepthSortFunction=function(m,g){return g.sqDistance-m.sqDistance},!n.facetDepthSortFrom){const m=this.getScene().activeCamera;n.facetDepthSortFrom=m?m.position:D.Zero()}n.depthSortedFacets=[];for(let m=0;m<n.facetNb;m++){const g={ind:m*3,sqDistance:0};n.depthSortedFacets.push(g)}n.invertedMatrix=se.Identity(),n.facetDepthSortOrigin=D.Zero()}n.bbSize.x=f.maximum.x-f.minimum.x>Vt?f.maximum.x-f.minimum.x:Vt,n.bbSize.y=f.maximum.y-f.minimum.y>Vt?f.maximum.y-f.minimum.y:Vt,n.bbSize.z=f.maximum.z-f.minimum.z>Vt?f.maximum.z-f.minimum.z:Vt;let _=n.bbSize.x>n.bbSize.y?n.bbSize.x:n.bbSize.y;if(_=_>n.bbSize.z?_:n.bbSize.z,n.subDiv.max=n.partitioningSubdivisions,n.subDiv.X=Math.floor(n.subDiv.max*n.bbSize.x/_),n.subDiv.Y=Math.floor(n.subDiv.max*n.bbSize.y/_),n.subDiv.Z=Math.floor(n.subDiv.max*n.bbSize.z/_),n.subDiv.X=n.subDiv.X<1?1:n.subDiv.X,n.subDiv.Y=n.subDiv.Y<1?1:n.subDiv.Y,n.subDiv.Z=n.subDiv.Z<1?1:n.subDiv.Z,n.facetParameters.facetNormals=this.getFacetLocalNormals(),n.facetParameters.facetPositions=this.getFacetLocalPositions(),n.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),n.facetParameters.bInfo=f,n.facetParameters.bbSize=n.bbSize,n.facetParameters.subDiv=n.subDiv,n.facetParameters.ratio=this.partitioningBBoxRatio,n.facetParameters.depthSort=n.facetDepthSort,n.facetDepthSort&&n.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(n.invertedMatrix),D.TransformCoordinatesToRef(n.facetDepthSortFrom,n.invertedMatrix,n.facetDepthSortOrigin),n.facetParameters.distanceTo=n.facetDepthSortOrigin),n.facetParameters.depthSortedFacets=n.depthSortedFacets,h&&Ue.ComputeNormals(o,c,h,n.facetParameters),n.facetDepthSort&&n.facetDepthSortEnabled){n.depthSortedFacets.sort(n.facetDepthSortFunction);const m=n.depthSortedIndices.length/3|0;for(let g=0;g<m;g++){const x=n.depthSortedFacets[g].ind;n.depthSortedIndices[g*3]=c[x],n.depthSortedIndices[g*3+1]=c[x+1],n.depthSortedIndices[g*3+2]=c[x+2]}this.updateIndices(n.depthSortedIndices,void 0,!0)}return this}getFacetLocalNormals(){const n=this._internalAbstractMeshDataInfo._facetData;return n.facetNormals||this.updateFacetData(),n.facetNormals}getFacetLocalPositions(){const n=this._internalAbstractMeshDataInfo._facetData;return n.facetPositions||this.updateFacetData(),n.facetPositions}getFacetLocalPartitioning(){const n=this._internalAbstractMeshDataInfo._facetData;return n.facetPartitioning||this.updateFacetData(),n.facetPartitioning}getFacetPosition(n){const o=D.Zero();return this.getFacetPositionToRef(n,o),o}getFacetPositionToRef(n,o){const c=this.getFacetLocalPositions()[n],h=this.getWorldMatrix();return D.TransformCoordinatesToRef(c,h,o),this}getFacetNormal(n){const o=D.Zero();return this.getFacetNormalToRef(n,o),o}getFacetNormalToRef(n,o){const c=this.getFacetLocalNormals()[n];return D.TransformNormalToRef(c,this.getWorldMatrix(),o),this}getFacetsAtLocalCoordinates(n,o,c){const h=this.getBoundingInfo(),f=this._internalAbstractMeshDataInfo._facetData,_=Math.floor((n-h.minimum.x*f.partitioningBBoxRatio)*f.subDiv.X*f.partitioningBBoxRatio/f.bbSize.x),m=Math.floor((o-h.minimum.y*f.partitioningBBoxRatio)*f.subDiv.Y*f.partitioningBBoxRatio/f.bbSize.y),g=Math.floor((c-h.minimum.z*f.partitioningBBoxRatio)*f.subDiv.Z*f.partitioningBBoxRatio/f.bbSize.z);return _<0||_>f.subDiv.max||m<0||m>f.subDiv.max||g<0||g>f.subDiv.max?null:f.facetPartitioning[_+f.subDiv.max*m+f.subDiv.max*f.subDiv.max*g]}getClosestFacetAtCoordinates(n,o,c,h,f=!1,_=!0){const m=this.getWorldMatrix(),g=ge.Matrix[5];m.invertToRef(g);const x=ge.Vector3[8];D.TransformCoordinatesFromFloatsToRef(n,o,c,g,x);const y=this.getClosestFacetAtLocalCoordinates(x.x,x.y,x.z,h,f,_);return h&&D.TransformCoordinatesFromFloatsToRef(h.x,h.y,h.z,m,h),y}getClosestFacetAtLocalCoordinates(n,o,c,h,f=!1,_=!0){let m=null,g,x,y,b,v,E,R,C;const O=this.getFacetLocalPositions(),M=this.getFacetLocalNormals(),I=this.getFacetsAtLocalCoordinates(n,o,c);if(!I)return null;let P=Number.MAX_VALUE,L,V,X,re;for(let ae=0;ae<I.length;ae++)V=I[ae],X=M[V],re=O[V],b=(n-re.x)*X.x+(o-re.y)*X.y+(c-re.z)*X.z,(!f||f&&_&&b>=0||f&&!_&&b<=0)&&(b=X.x*re.x+X.y*re.y+X.z*re.z,v=-(X.x*n+X.y*o+X.z*c-b)/(X.x*X.x+X.y*X.y+X.z*X.z),E=n+X.x*v,R=o+X.y*v,C=c+X.z*v,g=E-n,x=R-o,y=C-c,L=g*g+x*x+y*y,L<P&&(P=L,m=V,h&&(h.x=E,h.y=R,h.z=C)));return m}getFacetDataParameters(){return this._internalAbstractMeshDataInfo._facetData.facetParameters}disableFacetData(){const n=this._internalAbstractMeshDataInfo._facetData;return n.facetDataEnabled&&(n.facetDataEnabled=!1,n.facetPositions=[],n.facetNormals=[],n.facetPartitioning=new Array,n.facetParameters={},n.depthSortedIndices=new Uint32Array(0)),this}updateIndices(n,o,c=!1){return this}createNormals(n){const o=this.getVerticesData(k.PositionKind),c=this.getIndices();let h;return this.isVerticesDataPresent(k.NormalKind)?h=this.getVerticesData(k.NormalKind):h=[],Ue.ComputeNormals(o,c,h,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(k.NormalKind,h,n),this}async optimizeIndicesAsync(){const n=this.getIndices();if(!n)return this;const{OptimizeIndices:o}=await Wi(async()=>{const{OptimizeIndices:c}=await import("./mesh.vertexData.functions-ayNlGC5K.js");return{OptimizeIndices:c}},[]);return o(n),this.setIndices(n,this.getTotalVertices()),this}alignWithNormal(n,o){o||(o=Xa.Y);const c=ge.Vector3[0],h=ge.Vector3[1];return D.CrossToRef(o,n,h),D.CrossToRef(n,h,c),this.rotationQuaternion?Be.RotationQuaternionFromAxisToRef(c,n,h,this.rotationQuaternion):D.RotationFromAxisToRef(c,n,h,this.rotation),this}_checkOcclusionQuery(n=!1){return!1}disableEdgesRendering(){throw Je("EdgesRenderer")}enableEdgesRendering(n,o,c){throw Je("EdgesRenderer")}getConnectedParticleSystems(){return this._scene.particleSystems.filter(n=>n.emitter===this)}},(()=>{const s=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[la.filter((...n)=>!Array.isArray(n[0])&&!Array.isArray(n[3])&&!Array.isArray(n[4])&&!Array.isArray(n[5])&&!Array.isArray(n[6]))],ee(a,null,i,{kind:"method",name:"_ApplySkeleton",static:!0,private:!1,access:{has:n=>"_ApplySkeleton"in n,get:n=>n._ApplySkeleton},metadata:s},null,t),s&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),a.OCCLUSION_TYPE_NONE=(N(a,t),0),a.OCCLUSION_TYPE_OPTIMISTIC=1,a.OCCLUSION_TYPE_STRICT=2,a.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0,a.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1,a.CULLINGSTRATEGY_STANDARD=0,a.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,a.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,a.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,a.DefaultIsPickable=!0,a})();(ty=Ht.prototype).createOrUpdateSubmeshesOctree??(ty.createOrUpdateSubmeshesOctree=Xe("AbstractMesh","createOrUpdateSubmeshesOctree"));(iy=Ht.prototype).getPhysicsImpostor??(iy.getPhysicsImpostor=Xe("AbstractMesh","getPhysicsImpostor"));(sy=Ht.prototype).setPhysicsLinkWith??(sy.setPhysicsLinkWith=Xe("AbstractMesh","setPhysicsLinkWith"));Object.getOwnPropertyDescriptor(Ht.prototype,"occlusionRetryCount")||Object.defineProperty(Ht.prototype,"occlusionRetryCount",gt("AbstractMesh","occlusionRetryCount"));Object.getOwnPropertyDescriptor(Ht.prototype,"occlusionType")||Object.defineProperty(Ht.prototype,"occlusionType",gt("AbstractMesh","occlusionType"));Object.getOwnPropertyDescriptor(Ht.prototype,"occlusionQueryAlgorithmType")||Object.defineProperty(Ht.prototype,"occlusionQueryAlgorithmType",gt("AbstractMesh","occlusionQueryAlgorithmType"));Object.getOwnPropertyDescriptor(Ht.prototype,"isOccluded")||Object.defineProperty(Ht.prototype,"isOccluded",gt("AbstractMesh","isOccluded"));Object.getOwnPropertyDescriptor(Ht.prototype,"isOcclusionQueryInProgress")||Object.defineProperty(Ht.prototype,"isOcclusionQueryInProgress",gt("AbstractMesh","isOcclusionQueryInProgress"));Object.getOwnPropertyDescriptor(Ht.prototype,"forceRenderingWhenOccluded")||Object.defineProperty(Ht.prototype,"forceRenderingWhenOccluded",gt("AbstractMesh","forceRenderingWhenOccluded"));Object.getOwnPropertyDescriptor(Ht.prototype,"occlusionForRenderPassId")||Object.defineProperty(Ht.prototype,"occlusionForRenderPassId",gt("AbstractMesh","occlusionForRenderPassId"));Object.getOwnPropertyDescriptor(Ht.prototype,"decalMap")||Object.defineProperty(Ht.prototype,"decalMap",gt("AbstractMesh","decalMap"));Object.getOwnPropertyDescriptor(Ht.prototype,"instancedBuffers")||Object.defineProperty(Ht.prototype,"instancedBuffers",gt("AbstractMesh","instancedBuffers"));Object.getOwnPropertyDescriptor(Ht.prototype,"physicsImpostor")||Object.defineProperty(Ht.prototype,"physicsImpostor",gt("AbstractMesh","physicsImpostor"));Object.getOwnPropertyDescriptor(Ht.prototype,"showBoundingBox")||Object.defineProperty(Ht.prototype,"showBoundingBox",gt("AbstractMesh","showBoundingBox"));Object.getOwnPropertyDescriptor(Ht.prototype,"edgesRenderer")||Object.defineProperty(Ht.prototype,"edgesRenderer",gt("AbstractMesh","edgesRenderer"));Object.getOwnPropertyDescriptor(Ht.prototype,"renderOutline")||Object.defineProperty(Ht.prototype,"renderOutline",gt("AbstractMesh","renderOutline"));Object.getOwnPropertyDescriptor(Ht.prototype,"renderOverlay")||Object.defineProperty(Ht.prototype,"renderOverlay",gt("AbstractMesh","renderOverlay"));let FC=(()=>{var a;let e=[],t,i,s,n,o,c,h,f,_,m,g,x;return a=class{constructor(){this._func=N(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(b){this._func=b}get backFunc(){return this._backFunc}set backFunc(b){this._backFunc=b}get funcRef(){return this._funcRef}set funcRef(b){this._funcRef=b}get funcMask(){return this._funcMask}set funcMask(b){this._funcMask=b}get opStencilFail(){return this._opStencilFail}set opStencilFail(b){this._opStencilFail=b}get opDepthFail(){return this._opDepthFail}set opDepthFail(b){this._opDepthFail=b}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(b){this._opStencilDepthPass=b}get backOpStencilFail(){return this._backOpStencilFail}set backOpStencilFail(b){this.
vendor: 4,814 bytes, line 292
292_backOpStencilFail=b}get backOpDepthFail(){return this._backOpDepthFail}set backOpDepthFail(b){this._backOpDepthFail=b}get backOpStencilDepthPass(){return this._backOpStencilDepthPass}set backOpStencilDepthPass(b){this._backOpStencilDepthPass=b}get mask(){return this._mask}set mask(b){this._mask=b}get enabled(){return this._enabled}set enabled(b){this._enabled=b}getClassName(){return"MaterialStencilState"}copyTo(b){xt.Clone(()=>b,this)}serialize(){return xt.Serialize(this)}parse(b,v,E){xt.Parse(()=>this,b,v,E)}},(()=>{const y=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[ce()],i=[ce()],s=[ce()],n=[ce()],o=[ce()],c=[ce()],h=[ce()],f=[ce()],_=[ce()],m=[ce()],g=[ce()],x=[ce()],ee(a,null,t,{kind:"getter",name:"func",static:!1,private:!1,access:{has:b=>"func"in b,get:b=>b.func},metadata:y},null,e),ee(a,null,i,{kind:"getter",name:"backFunc",static:!1,private:!1,access:{has:b=>"backFunc"in b,get:b=>b.backFunc},metadata:y},null,e),ee(a,null,s,{kind:"getter",name:"funcRef",static:!1,private:!1,access:{has:b=>"funcRef"in b,get:b=>b.funcRef},metadata:y},null,e),ee(a,null,n,{kind:"getter",name:"funcMask",static:!1,private:!1,access:{has:b=>"funcMask"in b,get:b=>b.funcMask},metadata:y},null,e),ee(a,null,o,{kind:"getter",name:"opStencilFail",static:!1,private:!1,access:{has:b=>"opStencilFail"in b,get:b=>b.opStencilFail},metadata:y},null,e),ee(a,null,c,{kind:"getter",name:"opDepthFail",static:!1,private:!1,access:{has:b=>"opDepthFail"in b,get:b=>b.opDepthFail},metadata:y},null,e),ee(a,null,h,{kind:"getter",name:"opStencilDepthPass",static:!1,private:!1,access:{has:b=>"opStencilDepthPass"in b,get:b=>b.opStencilDepthPass},metadata:y},null,e),ee(a,null,f,{kind:"getter",name:"backOpStencilFail",static:!1,private:!1,access:{has:b=>"backOpStencilFail"in b,get:b=>b.backOpStencilFail},metadata:y},null,e),ee(a,null,_,{kind:"getter",name:"backOpDepthFail",static:!1,private:!1,access:{has:b=>"backOpDepthFail"in b,get:b=>b.backOpDepthFail},metadata:y},null,e),ee(a,null,m,{kind:"getter",name:"backOpStencilDepthPass",static:!1,private:!1,access:{has:b=>"backOpStencilDepthPass"in b,get:b=>b.backOpStencilDepthPass},metadata:y},null,e),ee(a,null,g,{kind:"getter",name:"mask",static:!1,private:!1,access:{has:b=>"mask"in b,get:b=>b.mask},metadata:y},null,e),ee(a,null,x,{kind:"getter",name:"enabled",static:!1,private:!1,access:{has:b=>"enabled"in b,get:b=>b.enabled},metadata:y},null,e),y&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})})(),a})();class Ri{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority}}Ri.FALLOFF_DEFAULT=0;Ri.FALLOFF_PHYSICAL=1;Ri.FALLOFF_GLTF=2;Ri.FALLOFF_STANDARD=3;Ri.LIGHTMAP_DEFAULT=0;Ri.LIGHTMAP_SPECULAR=1;Ri.LIGHTMAP_SHADOWSONLY=2;Ri.INTENSITYMODE_AUTOMATIC=0;Ri.INTENSITYMODE_LUMINOUSPOWER=1;Ri.INTENSITYMODE_LUMINOUSINTENSITY=2;Ri.INTENSITYMODE_ILLUMINANCE=3;Ri.INTENSITYMODE_LUMINANCE=4;Ri.LIGHTTYPEID_POINTLIGHT=0;Ri.LIGHTTYPEID_DIRECTIONALLIGHT=1;Ri.LIGHTTYPEID_SPOTLIGHT=2;Ri.LIGHTTYPEID_HEMISPHERICLIGHT=3;Ri.LIGHTTYPEID_RECT_AREALIGHT=4;Ri.LIGHTTYPEID_CLUSTERED_CONTAINER=5;const ar=new se,kr=new se,Nr=new se,Gc={getScene:()=>{},eyeAtCamera:!0};function Vc(a,e,t){const i=t.asArray(),s=e.asArray();for(let n=0;n<16;n++)i[n]=s[n];return i[12]-=a.x,i[13]-=a.y,i[14]-=a.z,t.markAsUpdated(),t}function BC(a,e,t){return lf(e,kr),Vc(a,kr,Nr),lf(Nr,t),t}function yf(a,e,t){if(!Gc.eyeAtCamera)return BC(a,e,t);const i=t.asArray(),s=e.asArray();for(let n=0;n<16;n++)i[n]=s[n];return i[12]=0,i[13]=0,i[14]=0,t.markAsUpdated(),t}function om(a,e,t,i){return kc(yf(a,e,i),t,i),i}function ay(a,e,t,i){return lf(t,kr),kc(e,kr,Nr),Vc(a,Nr,kr),yf(a,t,Nr),kc(kr,Nr,i),i}function oy(a,e,t,i,s,n){return lf(t,kr),kc(e,kr,Nr),Vc(a,Nr,kr),om(a,i,s,Nr),kc(kr,Nr,n),n}function ly(a,e){const t=Gc.getScene();if(!t||ar===e)return e;ar.updateFlag=e.updateFlag;const i=t.floatingOriginOffset;switch(a){case"world":return Vc(i,e,ar);case"view":return yf(i,e,ar);case"worldView":return ay(i,e,t.getViewMatrix(),ar);case"viewProjection":return om(i,t.getViewMatrix(),t.getProjectionMatrix(),ar);case"worldViewProjection":return oy(i,e,t.getTransformMatrix(),t.getViewMatrix(),t.getProjectionMatrix(),ar);default:if(a.startsWith("u_")){const s=a.toLowerCase();if(s.startsWith("u_worldviewprojection"))return oy(i,e,t.getTransformMatrix(),t.getViewMatrix(),t.getProjectionMatrix(),ar);if(s.startsWith("u_viewprojection"))return om(i,t.getViewMatrix(),t.getProjectionMatrix(),ar);if(s.startsWith("u_worldview"))return ay(i,e,t.getViewMatrix(),ar);if(s.startsWith("u_world"))return Vc(i,e,ar);if(s.startsWith("u_view"))return yf(i,e,ar)}return e}}const Hc=ze,lm=Ci,wv=Hc.prototype._updateMatrixForUniform,Fv=Ci.prototype.setMatr
292ix;function LC(){Ci.prototype.setMatrix=Fv,lm._setMatrixOverride=void 0,Hc.prototype._updateMatrixForUniform=wv,Hc.prototype._updateMatrixForUniformOverride=void 0}function kC(){lm.prototype._setMatrixOverride=Fv,lm.prototype.setMatrix=function(a,e){return this._setMatrixOverride(a,ly(a,e)),this},Hc.prototype._updateMatrixForUniformOverride=wv,Hc.prototype._updateMatrixForUniform=function(a,e){this._updateMatrixForUniformOverride(a,ly(a,e))}}function Bv(a){a.indexOf("vClipPlane")===-1&&a.push("vClipPlane"),a.indexOf("vClipPlane2")===-1&&a.push("vClipPlane2"),a.indexOf("vClipPlane3")===-1&&a.push("vClipPlane3"),a.indexOf("vClipPlane4")===-1&&a.push("vClipPlane4"),a.indexOf("vClipPlane5")===-1&&a.push("vClipPlane5"),a.indexOf("vClipPlane6")===-1&&a.push("vClipPlane6")}function NC(a,e,t){const i=!!(a.clipPlane??e.clipPlane),s=!!(a.clipPlane2??e.clipPlane2),n=!!(a.clipPlane3??e.clipPlane3),o=!!(a.clipPlane4??e.clipPlane4),c=!!(a.clipPlane5??e.clipPlane5),h=!!(a.clipPlane6??e.clipPlane6);i&&t.push("#define CLIPPLANE"),s&&t.push("#define CLIPPLANE2"),n&&t.push("#define CLIPPLANE3"),o&&t.push("#define CLIPPLANE4"),c&&t.pu
vendor: 8,567 bytes, line 292
292sh("#define CLIPPLANE5"),h&&t.push("#define CLIPPLANE6")}function UC(a,e,t){let i=!1;const s=!!(a.clipPlane??e.clipPlane),n=!!(a.clipPlane2??e.clipPlane2),o=!!(a.clipPlane3??e.clipPlane3),c=!!(a.clipPlane4??e.clipPlane4),h=!!(a.clipPlane5??e.clipPlane5),f=!!(a.clipPlane6??e.clipPlane6);return t.CLIPPLANE!==s&&(t.CLIPPLANE=s,i=!0),t.CLIPPLANE2!==n&&(t.CLIPPLANE2=n,i=!0),t.CLIPPLANE3!==o&&(t.CLIPPLANE3=o,i=!0),t.CLIPPLANE4!==c&&(t.CLIPPLANE4=c,i=!0),t.CLIPPLANE5!==h&&(t.CLIPPLANE5=h,i=!0),t.CLIPPLANE6!==f&&(t.CLIPPLANE6=f,i=!0),i}function Lv(a,e,t){let i=e.clipPlane??t.clipPlane;Yo(a,"vClipPlane",i),i=e.clipPlane2??t.clipPlane2,Yo(a,"vClipPlane2",i),i=e.clipPlane3??t.clipPlane3,Yo(a,"vClipPlane3",i),i=e.clipPlane4??t.clipPlane4,Yo(a,"vClipPlane4",i),i=e.clipPlane5??t.clipPlane5,Yo(a,"vClipPlane5",i),i=e.clipPlane6??t.clipPlane6,Yo(a,"vClipPlane6",i)}function Yo(a,e,t){if(t){const i=Gc.getScene()?.floatingOriginOffset||D.ZeroReadOnly;a.setFloat4(e,t.normal.x,t.normal.y,t.normal.z,t.d+D.Dot(t.normal,i))}}class ct{static get DiffuseTextureEnabled(){return this._DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){this._DiffuseTextureEnabled!==e&&(this._DiffuseTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get BaseWeightTextureEnabled(){return this._BaseWeightTextureEnabled}static set BaseWeightTextureEnabled(e){this._BaseWeightTextureEnabled!==e&&(this._BaseWeightTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get BaseDiffuseRoughnessTextureEnabled(){return this._BaseDiffuseRoughnessTextureEnabled}static set BaseDiffuseRoughnessTextureEnabled(e){this._BaseDiffuseRoughnessTextureEnabled!==e&&(this._BaseDiffuseRoughnessTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get DetailTextureEnabled(){return this._DetailTextureEnabled}static set DetailTextureEnabled(e){this._DetailTextureEnabled!==e&&(this._DetailTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get DecalMapEnabled(){return this._DecalMapEnabled}static set DecalMapEnabled(e){this._DecalMapEnabled!==e&&(this._DecalMapEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get AmbientTextureEnabled(){return this._AmbientTextureEnabled}static set AmbientTextureEnabled(e){this._AmbientTextureEnabled!==e&&(this._AmbientTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get OpacityTextureEnabled(){return this._OpacityTextureEnabled}static set OpacityTextureEnabled(e){this._OpacityTextureEnabled!==e&&(this._OpacityTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get ReflectionTextureEnabled(){return this._ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){this._ReflectionTextureEnabled!==e&&(this._ReflectionTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get EmissiveTextureEnabled(){return this._EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){this._EmissiveTextureEnabled!==e&&(this._EmissiveTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get SpecularTextureEnabled(){return this._SpecularTextureEnabled}static set SpecularTextureEnabled(e){this._SpecularTextureEnabled!==e&&(this._SpecularTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get BumpTextureEnabled(){return this._BumpTextureEnabled}static set BumpTextureEnabled(e){this._BumpTextureEnabled!==e&&(this._BumpTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get LightmapTextureEnabled(){return this._LightmapTextureEnabled}static set LightmapTextureEnabled(e){this._LightmapTextureEnabled!==e&&(this._LightmapTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get RefractionTextureEnabled(){return this._RefractionTextureEnabled}static set RefractionTextureEnabled(e){this._RefractionTextureEnabled!==e&&(this._RefractionTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get ColorGradingTextureEnabled(){return this._ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){this._ColorGradingTextureEnabled!==e&&(this._ColorGradingTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get FresnelEnabled(){return this._FresnelEnabled}static set FresnelEnabled(e){this._FresnelEnabled!==e&&(this._FresnelEnabled=e,Ie.MarkAllMaterialsAsDirty(4))}static get ClearCoatTextureEnabled(){return this._ClearCoatTextureEnabled}static set ClearCoatTextureEnabled(e){this._ClearCoatTextureEnabled!==e&&(this._ClearCoatTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get ClearCoatBumpTextureEnabled(){return this._ClearCoatBumpTextureEnabled}static set ClearCoatBumpTextureEnabled(e){this._ClearCoatBumpTextureEnabled!==e&&(this._ClearCoatBumpTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get ClearCoatTintTextureEnabled(){return this._ClearCoatTintTextureEnabled}static set ClearCoatTintTextureEnabled(e){this._ClearCoatTintTextureEnabled!==e&&(this._ClearCoatTintTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get SheenTextureEnabled(){return this._SheenTextureEnabled}static set SheenTextureEnabled(e){this._SheenTextureEnabled!==e&&(this._SheenTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get AnisotropicTextureEnabled(){return this._AnisotropicTextureEnabled}static set AnisotropicTextureEnabled(e){this._AnisotropicTextureEnabled!==e&&(this._AnisotropicTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get ThicknessTextureEnabled(){return this._ThicknessTextureEnabled}static set ThicknessTextureEnabled(e){this._ThicknessTextureEnabled!==e&&(this._ThicknessTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get RefractionIntensityTextureEnabled(){return this._ThicknessTextureEnabled}static set RefractionIntensityTextureEnabled(e){this._RefractionIntensityTextureEnabled!==e&&(this._RefractionIntensityTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get TranslucencyIntensityTextureEnabled(){return this._TranslucencyIntensityTextureEnabled}static set TranslucencyIntensityTextureEnabled(e){this._TranslucencyIntensityTextureEnabled!==e&&(this._TranslucencyIntensityTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get TranslucencyColorTextureEnabled(){return this._TranslucencyColorTextureEnabled}static set TranslucencyColorTextureEnabled(e){this._TranslucencyColorTextureEnabled!==e&&(this._TranslucencyColorTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}static get IridescenceTextureEnabled(){return this._IridescenceTextureEnabled}static set IridescenceTextureEnabled(e){this._IridescenceTextureEnabled!==e&&(this._IridescenceTextureEnabled=e,Ie.MarkAllMaterialsAsDirty(1))}}ct._DiffuseTextureEnabled=!0;ct._BaseWeightTextureEnabled=!0;ct._BaseDiffuseRoughnessTextureEnabled=!0;ct._DetailTextureEnabled=!0;ct._DecalMapEnabled=!0;ct._AmbientTextureEnabled=!0;ct._OpacityTextureEnabled=!0;ct._ReflectionTextureEnabled=!0;ct._EmissiveTextureEnabled=!0;ct._SpecularTextureEnabled=!0;ct._BumpTextureEnabled=!0;ct._LightmapTextureEnabled=!0;ct._RefractionTextureEnabled=!0;ct._ColorGradingTextureEnabled=!0;ct._FresnelEnabled=!0;ct._ClearCoatTextureEnabled=!0;ct._ClearCoatBumpTextureEnabled=!0;ct._ClearCoatTintTextureEnabled=!0;ct._SheenTextureEnabled=!0;ct._AnisotropicTextureEnabled=!0;ct._ThicknessTextureEnabled=!0;ct._RefractionIntensityTextureEnabled=!0;ct._TranslucencyIntensityTextureEnabled=!0;ct._TranslucencyColorTextureEnabled=!0;ct._IridescenceTextureEnabled=!0;function kv(a,e,t){if(!a||a.LOGARITHMICDEPTH||a.indexOf&&a.indexOf("LOGARITHMICDEPTH")>=0){const i=t.activeCamera;i.mode===1&&pe.Error("Logarithmic depth is not compatible with orthographic cameras!",20),e.setFloat("logarithmicDepthConstant",2/(Math.log(i.maxZ+1)/Math.LN2))}}const cy={r:0,g:0,b:0},ka={NUM_MORPH_INFLUENCERS:0,NORMAL:!1,TANGENT:!1,UV:!1,UV2:!1,COLOR:!1};function Nv(a,e,t,i=!1){t&&a.fogEnabled&&(!e||e.applyFog)&&a.fogMode!==0&&(t.setFloat4("vFogInfos",a.fogMode,a.fogStart,a.fogEnd,a.fogDensity),i?(a.fogColor.toLinearSpaceToRef(cy,a.getEngine().useExactSrgbConversions),t.setColor3("vFogColor",cy)):t.setColor3("vFogColor",a.fogColor))}function zC(a,e,t,i,s,n,o,c,h,f){const _=a.numMaxInfluencers||a.numInfluencers;return _<=0?0:(e.push("#define MORPHTARGETS"),a.hasPositions&&e.push("#define MORPHTARGETTEXTURE_HASPOSITIONS"),a.hasNormals&&e.push("#define MORPHTARGETTEXTURE_HASNORMALS"),a.hasTangents&&e.push("#define MORPHTARGETTEXTURE_HASTANGENTS"),a.hasUVs&&e.push("#define MORPHTARGETTEXTURE_HASUVS"),a.hasUV2s&&e.push("#define MORPHTARGETTEXTURE_HASUV2S"),a.hasColors&&e.push("#define MORPHTARGETTEXTURE_HASCOLORS"),a.supportsPositions&&s&&e.push("#define MORPHTARGETS_POSITION"),a.supportsNormals&&n&&e.push("#define MORPHTARGETS_NORMAL"),a.supportsTangents&&o&&e.push("#define MORPHTARGETS_TANGENT"),a.supportsUVs&&c&&e.push("#define MORPHTARGETS_
292UV"),a.supportsUV2s&&h&&e.push("#define MORPHTARGETS_UV2"),a.supportsColors&&f&&e.push("#define MORPHTARGETS_COLOR"),e.push("#define NUM_MORPH_INFLUENCERS "+_),a.isUsingTextureForTargets&&e.push("#define MORPHTARGETS_TEXTURE"),ka.NUM_MORPH_INFLUENCERS=_,ka.NORMAL=n,ka.TANGENT=o,ka.UV=c,ka.UV2=h,ka.COLOR=f,Uv(t,i,ka,s),_)}function Uv(a,e,t,i=!0){const s=t.NUM_MORPH_INFLUENCERS;if(s>0&&mt.LastCreatedEngine){const n=mt.LastCreatedEngine.getCaps().maxVertexAttribs,o=e.morphTargetManager;if(o?.isUsingTextureForTargets)return;const c=o&&o.supportsPositions&&i,h=o&&o.supportsNormals&&t.NORMAL,f=o&&o.supportsTangents&&t.TANGENT,_=o&&o.supportsUVs&&t.UV1,m=o&&o.supportsUV2s&&t.UV2,g=o&&o.supportsColors&&t.VERTEXCOLOR;for(let x=0;x<s;x++)c&&a.push("position"+x),h&&a.push("normal"+x),f&&a.push("tangent"+x),_&&a.push("uv_"+x),m&&a.push("uv2_"+x),g&&a.push("color"+x),a.length>n&&pe.Error("Cannot add more vertex attributes for mesh "+e.name)}}function zv(a,e=!1){a.push("world0"),a.push("world1"),a.push("world2"),a.push("world3"),e&&(a.push("previousWorld0"),a.push("previousWorld1"),a.push("previousWorld2"),a.push("previousWorld3"))}function Gv(a,e){const t=a.morphTargetManager;!a||!t||e.setFloatArray("morphTargetInfluences",t.influences)}function Vv(a,e){e.bindToEffect(a,"Scene")}function GC(a,e,t,i,s=null,n=!1,o=!1,c=!1,h=!1,f=!1,_=!1,m=0){if(a.texturesEnabled&&s&&ct.ReflectionTextureEnabled){if(t.updateMatrix("reflectionMatrix",s.getReflectionTextureMatrix()),t.updateFloat2("vReflectionInfos",s.level*a.iblIntensity,m),c&&s.boundingBoxSize){const g=s;t.updateVector3("vReflectionPosition",g.boundingBoxPosition),t.updateVector3("vReflectionSize",g.boundingBoxSize)}if(n){const g=s.getSize().width;t.updateFloat2("vReflectionFilteringInfo",g,Math.log2(g))}if(f&&!e.USEIRRADIANCEMAP){const g=s.sphericalPolynomial;if(e.USESPHERICALFROMREFLECTIONMAP&&g)if(e.SPHERICAL_HARMONICS){const x=g.preScaledHarmonics;t.updateVector3("vSphericalL00",x.l00),t.updateVector3("vSphericalL1_1",x.l1_1),t.updateVector3("vSphericalL10",x.l10),t.updateVector3("vSphericalL11",x.l11),t.updateVector3("vSphericalL2_2",x.l2_2),t.updateVector3("vSphericalL2_1",x.l2_1),t.updateVector3("vSphericalL20",x.l20),t.updateVector3("vSphericalL21",x.l21),t.updateVector3("vSphericalL22",x.l22)}else t.updateFloat3("vSphericalX",g.x.x,g.x.y,g.x.z),t.updateFloat3("vSphericalY",g.y.x,g.y.y,g.y.z),t.updateFloat3("vSphericalZ",g.z.x,g.z.y,g.z.z),t.updateFloat3("vSphericalXX_ZZ",g.xx.x-g.zz.x,g.xx.y-g.zz.y,g.xx.z-g.zz.z),t.updateFloat3("vSphericalYY_ZZ",g.yy.x-g.zz.x,g.yy.y-g.zz.y,g.yy.z-g.zz.z),t.updateFloat3("vSphericalZZ",g.zz.x,g.zz.y,g.zz.z),t.updateFloat3("vSphericalXY",g.xy.x,g.xy.y,g.xy.z),t.updateFloat3("vSphericalYZ",g.yz.x,g.yz.y,g.yz.z),t.updateFloat3("vSphericalZX",g.zx.x,g.zx.y,g.zx.z)}else h&&e.USEIRRADIANCEMAP&&e.USE_IRRADIANCE_DOMINANT_DIRECTION&&s.irradianceTexture&&t.updateVector3("vReflectionDominantDirection",s.irradianceTexture._dominantDirection);o&&t.updateFloat3("vReflectionMicrosurfaceInfos",s.getSize().width,s.lodGenerationScale,s.lodGenerationOffset)}_&&t.updateColor3("vReflectionColor",i)}function aa(a,e,t){e._needUVs=!0,e[t]=!0,a.optimizeUVAllocation&&a.getTextureMatrix().isIdentityAs3x2()?(e[t+"DIRECTUV"]=a.coordinatesIndex+1,e["MAINUV"+(a.coordinatesIndex+1)]=!0):e[t+"DIRECTUV"]=0}function oa(a,e,t){const i=a.getTextureMatrix();e.updateMatrix(t+"Matrix",i)}function VC(a,e,t){t.BAKED_VERTEX_ANIMATION_TEXTURE&&t.INSTANCES&&a.push("bakedVertexAnimationSettingsInstanced")}function Hv(a,e,t){if(!(!e||!a)&&(a.computeBonesUsingShaders&&e._bonesComputationForcedToCPU&&(a.computeBonesUsingShaders=!1),a.useBones&&a.computeBonesUsingShaders&&a.skeleton)){const i=a.skeleton;if(i.isUsingTextureForMatrices&&e.getUniformIndex("boneTextureInfo")>-1){const s=i.getTransformMatrixTexture(a);e.setTexture("boneSampler",s),e.setFloat2("boneTextureInfo",i._textureWidth,i._textureHeight)}else{const s=i.getTransformMatrices(a);s&&e.setMatrices("mBones",s)}}}function HC(a,e,t,i,s,n=!0){a._bindLight(e,t,i,s,n)}const jv=4,hy=new WeakMap;function jC(a,e){const t=a.getEngine().getCaps().maxUniformBuffersPerShaderStage;if(t==null)return e;const i=Math.max(t-jv,1);return Math.min(e,i)}function WC(a,e,t,i){let s=hy.get(a);s||(s=new Set,hy.set(a,s)),!s.has(i)&&(s.add(i),pe.Warn(`maxSimultaneousLights is ${e} but this engine supports at most ${t} simultaneous lights. Each light declares its own uniform buffer in the vertex shader, so the ${i} lights affecting this mesh plus the scene, mesh, material and leftover buffers would need ${i+jv} uniform buffers, over the device limit of ${a.getCaps().maxUniformBuffersPerShaderStage} per shader stage. The light count has been clamped to ${t}, so the extra lights will not contribute to the render. Set maxSimultaneousLights to ${t} or less to silence this warning.`))}function XC(a,e,t,i,s=4){const n=Math.min(e.lightSources.length,s);for(let o=0;o<n;o++){const c=e.lightSources[o];HC(c,o,a,t,typeof i=="boolean"?i:i.SPECULARTERM,e.receiveShadows)}}function YC(a,e,t,i){t.NUM_BONE_INFLUENCERS>0&&(i.addCPUSkinningFallback(0,e),a.push("matricesIndices"),a.push("matricesWeights"),t.NUM_BONE_INFLUENCERS>4&&(a.push("matricesIndicesExtra"),a.push("matricesWeightsExtra")))}function qC(a,e){(e.INSTANCES||e.THIN_INSTANCES)&&zv(a,!!e.PREPASS_VELOCITY),e.INSTANCESCOLOR&&a.push("instanceColor")}function KC(a,e,t=4,i=0){let s=0;for(let n=0;n<t&&a["LIGHT"+n];n++)n>0&&(s=i+n,e.addFallback(s,"LIGHT"+n)),a.SHADOWS||(a["SHADOW"+n]&&e.addFallback(i,"SHADOW"+n),a["SHADOWPCF"+n]&&e.addFallback(i,"SHADOWPCF"+n),a["SHADOWPCSS"+n]&&e.addFallback(i,"SHADOWPCSS"+n),a["SHADOWPOISSON"+n]&&e.addFallback(i,"SHADOWPOISSON"+n),a["SHADOWESM"+n]&&e.addFallback(i,"SHADOWESM"+n),a["SHADOWCLOSEESM"+n]&&e.addFallback(i,"SHADOWCLOSEESM"+n));return s}function ZC(a,e){return e.fogEnabled&&a.applyFog&&e.fogMode!==0}function QC(a,e,t,i,s,n,o,c=!1,h=!1,f,_){if(o._areMiscDirty){o.LOGARITHMICDEPTH=t,o.POINTSIZE=i,o.FOG=s&&ZC(a,e),o.NONUNIFORMSCALING=a.nonUniformScaling,o.ALPHATEST=n,o.DECAL_AFTER_DETAIL=c,o.USE_VERTEX_PULLING=h,o.RIGHT_HANDED=e.useRightHandedSystem;const m=f?.geometry?.getIndexBuffer(),g=f?f.isUnIndexed:!1;o.VERTEX_PULLING_USE_INDEX_BUFFER=!!m&&!g,o.VERTEX_PULLING_INDEX_BUFFER_32BITS=m&&!g?m.is32Bits:!1,o.VERTEXOUTPUT_INVARIANT=!!_}}function $C(a,e,t,i=!1){if(!a.lightsEnabled||i)return!0;const s=e.lightSources,n=Math.min(s.length,t);for(let o=0;o<n;o++)if(!s[o].areLightTexturesReady())return!1;return!0}
292function JC(a,e,t,i,s=4,n=!1){if(!t._areLightsDirty)return t._needNormals;const o=s;s=jC(a,s);let c=0;const h={needNormals:t._needNormals,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(a.lightsEnabled&&!n){e.lightSources.length>s&&s<o&&WC(a.getEngine(),o,s,Math.min(e.lightSources.length,o));for(const m of e.lightSources)if(tD(a,e,m,c,t,i,h),c++,c===s)break}t.SPECULARTERM=h.specularEnabled,t.SHADOWS=h.shadowEnabled;const f=Math.max(s,t.MAXLIGHTCOUNT||0);for(let m=c;m<f;m++)t["LIGHT"+m]!==void 0&&(t["LIGHT"+m]=!1,t["HEMILIGHT"+m]=!1,t["POINTLIGHT"+m]=!1,t["DIRLIGHT"+m]=!1,t["SPOTLIGHT"+m]=!1,t["AREALIGHT"+m]=!1,t["CLUSTLIGHT"+m]=!1,t["SHADOW"+m]=!1,t["SHADOWCSM"+m]=!1,t["SHADOWCSMDEBUG"+m]=!1,t["SHADOWCSMNUM_CASCADES"+m]=!1,t["SHADOWCSMUSESHADOWMAXZ"+m]=!1,t["SHADOWCSMNOBLEND"+m]=!1,t["SHADOWCSM_RIGHTHANDED"+m]=!1,t["SHADOWPCF"+m]=!1,t["SHADOWPCSS"+m]=!1,t["SHADOWPOISSON"+m]=!1,t["SHADOWESM"+m]=!1,t["SHADOWCLOSEESM"+m]=!1,t["SHADOWCUBE"+m]=!1,t["SHADOWLOWQUALITY"+m]=!1,t["SHADOWMEDIUMQUALITY"+m]=!1);t.LIGHTCOUNT=c,t.MAXLIGHTCOUNT=s;const _=a.getEngine().getCaps();return t.SHADOWFLOAT===void 0&&(h.needRebuild=!0),t.SHADOWFLOAT=h.shadowEnabled&&(_.textureFloatRender&&_.textureFloatLinearFiltering||_.textureHalfFloatRender&&_.textureHalfFloatLinearFiltering),t.LIGHTMAPEXCLUDED=h.lightmapMode,h.needRebuild&&t.rebuild(),h.needNormals}function eD(a,e,t,i=!1,s=8,n=!1){if(e&&ct.ReflectionTextureEnabled){if(!e.isReadyOrNotBlocking())return!1;t._needNormals=!0,t.REFLECTION=!0,t.GAMMAREFLECTION=e.gammaSpace,t.RGBDREFLECTION=e.isRGBD,t.LODINREFLECTIONALPHA=e.lodLevelInAlpha,t.LINEARSPECULARREFLECTION=e.linearSpecularLOD,t.USEIRRADIANCEMAP=!1,t.LODBASEDMICROSFURACE=a.getEngine().getCaps().textureLOD;const o=a.getEngine();switch(i&&s>0?(t.NUM_SAMPLES=""+s,o._features.needTypeSuffixInShaderConstants&&(t.NUM_SAMPLES=t.NUM_SAMPLES+"u"),t.REALTIME_FILTERING=!0,a.iblCdfGenerator&&(t.IBL_CDF_FILTERING=!0)):t.REALTIME_FILTERING=!1,t.INVERTCUBICMAP=e.coordinatesMode===6,t.REFLECTIONMAP_3D=e.isCube,t.REFLECTIONMAP_OPPOSITEZ=t.REFLECTIONMAP_3D&&a.useRightHandedSystem?!e.invertZ:e.invertZ,t.REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,e.coordinatesMode){case 0:t.REFLECTIONMAP_EXPLICIT=!0;break;case 2:t.REFLECTIONMAP_PLANAR=!0;break;case 4:t.REFLECTIONMAP_PROJECTION=!0;break;case 5:t.REFLECTIONMAP_SKYBOX=!0;break;case 1:t.REFLECTIONMAP_SPHERICAL=!0;break;case 7:t.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case 8:t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case 9:t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case 3:case 6:default:t.REFLECTIONMAP_CUBIC=!0,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!!e.boundingBoxSize;break}e.coordinatesMode!==5&&(e.irradianceTexture?(t.USEIRRADIANCEMAP=!0,t.USESPHERICALFROMREFLECTIONMAP=!1,t.USESPHERICALINVERTEX=!1,e.irradianceTexture._dominantDirection?t.USE_IRRADIANCE_DOMINANT_DIRECTION=!0:t.USE_IRRADIANCE_DOMINANT_DIRECTION=!1):e.isCube&&(t.USESPHERICALFROMREFLECTIONMAP=!0,t.USEIRRADIANCEMAP=!1,t.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,t.USESPHERICALINVERTEX=n))}else t.REFLECTION=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.USESPHERICALFROMREFLECTIONMAP=!1,t.USEIRRADIANCEMAP=!1,t.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,t.USESPHERICALINVERTEX=!1,t.REFLECTIONMAP_OPPOSITEZ=!1,t.LODINREFLECTIONALPHA=!1,t.GAMMAREFLECTION=!1,t.RGBDREFLECTION=!1,t.LINEARSPECULARREFLECTION=!1;return!0}function tD(a,e,t,i,s,n,o){switch(o.needNormals=!0,s["LIGHT"+i]===void 0&&(o.needRebuild=!0),s["LIGHT"+i]=!0,s["SPOTLIGHT"+i]=!1,s["HEMILIGHT"+i]=!1,s["POINTLIGHT"+i]=!1,s["DIRLIGHT"+i]=!1,s["AREALIGHT"+i]=!1,s["CLUSTLIGHT"+i]=!1,t.prepareLightSpecificDefines(s,i),s["LIGHT_FALLOFF_PHYSICAL"+i]=!1,s["LIGHT_FALLOFF_GLTF"+i]=!1,s["LIGHT_FALLOFF_STANDARD"+i]=!1,t.falloffType){case Ri.FALLOFF_GLTF:s["LIGHT_FALLOFF_GLTF"+i]=!0;break;case Ri.FALLOFF_PHYSICAL:s["LIGHT_FALLOFF_PHYSICAL"+i]=!0;break;case Ri.FALLOFF_STANDARD:s["LIGHT_FALLOFF_STANDARD"+i]=!0;break}if(t.specular.equalsFloats(0,0,0)||(o.specularEnabled=!0),s["SHADOW"+i]=!1,s["SHADOWCSM"+i]=!1,s["SHADOWCSMDEBUG"+i]=!1,s["SHADOWCSMNUM_CASCADES"+i]=!1,s["SHADOWCSMUSESHADOWMAXZ"+i]=!1,s["SHADOWCSMNOBLEND"+i]=!1,s["SHADOWCSM_RIGHTHANDED"+i]=!1,s["SHADOWPCF"+i]=!1,s["SHADOWPCSS"+i]=!1,s["SHADOWPOISSON"+i]=!1,s["SHADOWESM"+i]=!1,s["SHADOWCLOSEESM"+i]=!1,s["SHADOWCUBE"+i]=!1,s["SHADOWLOWQUALITY"+i]=!1,s["SHADOWMEDIUMQUALITY"+i]=!1,e&&e.receiveShadows&&a.shadowsEnabled&&t.shadowEnabled){const c=t.getShadowGenerator(a.activeCamera)??t.getShadowGenerator();if(c){const h=c.getShadowMap();h&&h.renderList&&h.renderList.length>0&&(o.shadowEnabled=!0,c.prepareDefines(s,i))}}t.lightmapMode!=Ri.LIGHTMAP_DEFAULT?(o.lightmapMode=!0,s["LIGHTMAPEXCLUDED"+i]=!0,s["LIGHTMAPNOSPECULAR"
292+i]=t.lightmapMode==Ri.LIGHTMAP_SHADOWSONLY):(s["LIGHTMAPEXCLUDED"+i]=!1,s["LIGHTMAPNOSPECULAR"+i]=!1)}function iD(a,e,t,i,s,n=null,o=!1){let c=fD(a,i);n!==!1&&(c=UC(t,a,i)),i.DEPTHPREPASS!==!e.getColorWrite()&&(i.DEPTHPREPASS=!i.DEPTHPREPASS,c=!0),i.INSTANCES!==s&&(i.INSTANCES=s,c=!0),i.THIN_INSTANCES!==o&&(i.THIN_INSTANCES=o,c=!0),c&&i.markAsUnprocessed()}const sD=40,rD=64,uy=new WeakMap,fy=new WeakSet;function nD(a,e){if(a.useBones&&a.computeBonesUsingShaders&&a.skeleton){e.NUM_BONE_INFLUENCERS=a.numBoneInfluencers;const t=e.BONETEXTURE!==void 0;if(a.skeleton.isUsingTextureForMatrices&&t)e.BONETEXTURE=!0;else{e.BonesPerMesh=a.skeleton.bones.length+1,e.BONETEXTURE=t?!1:void 0;const i=a.getScene(),s=i.prePassRenderer;if(s&&s.enabled){const c=s.excludedSkinnedMesh.indexOf(a)===-1;e.BONES_VELOCITY_ENABLED=c}const n=e.MULTIVIEW===!0,o=e.BonesPerMesh*2+(n?1:0);if(uy.get(a.skeleton)!==o){uy.set(a.skeleton,o);const c=i.getEngine().getCaps().maxVertexUniformVectors;if(c&&!fy.has(a.skeleton)){const h=e.BonesPerMesh*4,_=Math.max(c-(n?rD:sD),0);(h>_||n&&h*3>c)&&(fy.add(a.skeleton),pe.Warn(`Skeleton "${a.skeleton.name}": ${a.skeleton.bones.length} bones stored as vertex uniforms use ${h} of ~${_} usable uniform vectors${n?" (multiview)":""} on a device reporting ${c}. This can exceed the GPU vertex-uniform limit and make the mesh silently fail to render. Set skeleton.useTextureToStoreBoneMatrices = true to store bone matrices in a texture.`))}}}}else e.NUM_BONE_INFLUENCERS=0,e.BonesPerMesh=0,e.BONETEXTURE!==void 0&&(e.BONETEXTURE=!1)}function aD(a,e){const t=a.morphTargetManager;t?(e.MORPHTARGETS_UV=t.supportsUVs&&e.UV1,e.MORPHTARGETS_UV2=t.supportsUV2s&&e.UV2,e.MORPHTARGETS_TANGENT=t.supportsTangents&&e.TANGENT,e.MORPHTARGETS_NORMAL=t.supportsNormals&&e.NORMAL,e.MORPHTARGETS_POSITION=t.supportsPositions,e.MORPHTARGETS_COLOR=t.supportsColors,e.MORPHTARGETTEXTURE_HASUVS=t.hasUVs,e.MORPHTARGETTEXTURE_HASUV2S=t.hasUV2s,e.MORPHTARGETTEXTURE_HASTANGENTS=t.hasTangents,e.MORPHTARGETTEXTURE_HASNORMALS=t.hasNormals,e.MORPHTARGETTEXTURE_HASPOSITIONS=t.hasPositions,e.MORPHTARGETTEXTURE_HASCOLORS=t.hasColors,e.NUM_MORPH_INFLUENCERS=t.numMaxInfluencers||t.numInfluencers,e.MORPHTARGETS=e.NUM_MORPH_INFLUENCERS>0,e.MORPHTARGETS_TEXTURE=t.isUsingTextureForTargets):(e.MORPHTARGETS_UV=!1,e.MORPHTARGETS_UV2=!1,e.MORPHTARGETS_TANGENT=!1,e.MORPHTARGETS_NORMAL=!1,e.MORPHTARGETS_POSITION=!1,e.MORPHTARGETS_COLOR=!1,e.MORPHTARGETTEXTURE_HASUVS=!1,e.MORPHTARGETTEXTURE_HASUV2S=!1,e.MORPHTARGETTEXTURE_HASTANGENTS=!1,e.MORPHTARGETTEXTURE_HASNORMALS=!1,e.MORPHTARGETTEXTURE_HASPOSITIONS=!1,e.MORPHTARGETTEXTURE_HAS_COLORS=!1,e.MORPHTARGETS=!1,e.NUM_MORPH_INFLUENCERS=0)}function oD(a,e){const t=a.bakedVertexAnimationManager;e.BAKED_VERTEX_ANIMATION_TEXTURE=!!(t&&t.isEnabled)}function lD(a,e,t,i,s=!1,n=!0,o=!0){if(!e._areAttributesDirty&&e._needNormals===e._normals&&e._needUVs===e._uvs)return!1;e._normals=e._needNormals,e._uvs=e._needUVs,e.NORMAL=e._needNormals&&a.isVerticesDataPresent("normal"),e._needNormals&&a.isVerticesDataPresent("tangent")&&(e.TANGENT=!0);for(let c=1;c<=6;++c)e["UV"+c]=e._needUVs?a.isVerticesDataPresent(`uv${c===1?"":c}`):!1;{const c=a.useVertexColors&&a.isVerticesDataPresent("color");e.VERTEXCOLOR=c,e.VERTEXALPHA=a.hasVertexAlpha&&c&&n}return a.isVerticesDataPresent("instanceColor")&&(a.hasInstances||a.hasThinInstances)&&(e.INSTANCESCOLOR=!0),nD(a,e),s&&aD(a,e),o&&oD(a,e),!0}function cD(a,e){if(a.activeCamera){const t=e.MULTIVIEW;e.MULTIVIEW=a.activeCamera.outputRenderTarget!==null&&a.activeCamera.outputRenderTarget.getViewCount()>1,e.MULTIVIEW!=t&&e.markAsUnprocessed()}}function hD(a,e,t){const i=e.ORDER_INDEPENDENT_TRANSPARENCY,s=e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;e.ORDER_INDEPENDENT_TRANSPARENCY=a.useOrderIndependentTransparency&&t,e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!a.getEngine().getCaps().textureFloatLinearFiltering,(i!==e.ORDER_INDEPENDENT_TRANSPARENCY||s!==e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS)&&e.markAsUnprocessed()}function uD(a,e,t){const i=e.PREPASS;if(!e._arePrePassDirty)return;const s=[{type:1,define:"PREPASS_POSITION",index:"PREPASS_POSITION_INDEX"},{type:9,define:"PREPASS_LOCAL_POSITION",index:"PREPASS_LOCAL_POSITION_INDEX"},{type:2,define:"PREPASS_VELOCITY",index:"PREPASS_VELOCITY_INDEX"},{type:11,define:"PREPASS_VELOCITY_LINEAR",index:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:3,define:"PREPASS_REFLECTIVITY",index:"PREPASS_REFLECTIVITY_INDEX"},{type:0,define:"PREPASS_IRRADIANCE_LEGACY",index:"PREPASS_IRRADIANCE_LEGACY_INDEX"},{type:7,define:"PREPASS_ALBEDO_SQRT",index:"PREPASS_ALBEDO_SQRT_INDEX"},{type:5,define:"PREPASS_DEPTH",index:"PREPASS_DEPTH_INDEX"},{type:10,define:"PREPASS_SCREENSPACE_DEPTH",index:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:6,define:"PREPASS_NORMAL",index:"PREPASS_NORMAL_INDEX"},{type:8,define:"PREPASS_WORLD_NORMAL",index:"PREPASS_WORLD_NORMAL_INDEX"},{type:14,define:"PREPASS_IRRADIANCE",index:"PREPASS_IRRADIANCE_INDEX"}];if(a.prePassRenderer&&a.prePassRenderer.enabled&&t){e.PREPASS=!0,e.SCENE_MRT_COUNT=a.prePassRenderer.mrtCount,e.PREPASS_NORMAL_WORLDSPACE=a.prePassRenderer.generateNormalsInWorldSpace,e.PREPASS_COLOR=!0,e.PREPASS_COLOR_INDEX=0;for(let n=0;n<s.length;n++){const o=a.prePassRenderer.getIndex(s[n].type);o!==-1?(e[s[n].define]=!0,e[s[n].index]=o):e[s[n].define]=!1}}else{e.PREPASS=!1;for(let n=0;n<s.length;n++)e[s[n].define]=!1}e.PREPASS!=i&&(e.markAsUnprocessed(),e.markAsImageProcessingDirty())}function fD(a,e){let t=!1;if(a.activeCamera){const i=e.CAMERA_ORTHOGRAPHIC?1:0,s=e.CAMERA_PERSPECTIVE?1:0,n=a.activeCamera.mode===1?1:0,o=a.activeCamera.mode===0?1:0;(i^n||s^o)&&(e.CAMERA_ORTHOGRAPHIC=n===1,e.CAMERA_PERSPECTIVE=o===1,t=!0)}return t}function dD(a,e,t,i,s=null,n=!1,o=!1,c=!1,h=!1,f=!1){s&&s.push("Light"+a),!n&&(e.push("vLightData"+a,"vLightDiffuse"+a,"vLightSpecular"+a,"vLightDirection"+a,"vLightWidth"+a,"vLightHeight"+a,"vLightFalloff"+a,"vLightGround"+a,"vSliceData"+a,"vSliceRanges"+a,"lightMatrix"+a,"shadowsInfo"+a,"depthValues"+a),t.push("shadowTexture"+a),t.push("depthTexture"+a),e.push("viewFrustumZ"+a,"cascadeBlendFactor"+a,"lightSizeUVCorrection"+a,"depthCorrection"+a,"penumbraDarkness"+a,"frustumLengths"+a),i&&(t.push("projectionLightTexture"+a),e.push("textureProjectionMatrix"+a)),o&&t.push("iesLightTexture"+a),h&&t.push("rectAreaLightEmissionTexture"+a),c&&(t.push("lightDataTexture"+a),f||t.push("tileMaskTexture"+a)))}function _D(a,e,t){const i=["vReflectionMicrosurfaceInfos","vReflectionDominantDirection","reflectionMatrix","vReflectionInfos","vReflectionPosition","vReflectionSize","vReflectionColor","vReflectionFilteringInfo"];a.push(...i);const s=["reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","irradianceSampler","icdfSampler"];e.push(...s)}function mD(a,e,t,i=4){let s,n,o=null;if(a.uniformsNames){const c=a;s=c.uniformsNames,n=c.uniformBuffersNames,e=c.samplers,t=c.defines,i=c.maxSimultaneousLights||0,o=c.shaderLanguage??null}else s=a,e||(e=[]);for(let c=0;c<i&&t["LIGHT"+c];
vendor: 12,769 bytes, line 292
292c++)dD(c,s,e,t["PROJECTEDLIGHTTEXTURE"+c],n,!1,t["IESLIGHTTEXTURE"+c],t["CLUSTLIGHT"+c],t["RECTAREALIGHTEMISSIONTEXTURE"+c],o===1);t.NUM_MORPH_INFLUENCERS&&(s.push("morphTargetInfluences"),s.push("morphTargetCount")),t.BAKED_VERTEX_ANIMATION_TEXTURE&&(s.push("bakedVertexAnimationSettings"),s.push("bakedVertexAnimationTextureSizeInverted"),s.push("bakedVertexAnimationTime"),e.push("bakedVertexAnimationTexture"))}function gD(a,e=!1,t=!1,i=!1,s=!1,n=!1){a.addUniform("vReflectionInfos",2),a.addUniform("reflectionMatrix",16),e&&a.addUniform("vReflectionMicrosurfaceInfos",3),t&&(a.addUniform("vReflectionPosition",3),a.addUniform("vReflectionSize",3)),i&&(a.addUniform("vReflectionFilteringInfo",2),a.addUniform("vReflectionDominantDirection",3)),n&&a.addUniform("vReflectionColor",3),s&&(a.addUniform("vSphericalL00",3),a.addUniform("vSphericalL1_1",3),a.addUniform("vSphericalL10",3),a.addUniform("vSphericalL11",3),a.addUniform("vSphericalL2_2",3),a.addUniform("vSphericalL2_1",3),a.addUniform("vSphericalL20",3),a.addUniform("vSphericalL21",3),a.addUniform("vSphericalL22",3),a.addUniform("vSphericalX",3),a.addUniform("vSphericalY",3),a.addUniform("vSphericalZ",3),a.addUniform("vSphericalXX_ZZ",3),a.addUniform("vSphericalYY_ZZ",3),a.addUniform("vSphericalZZ",3),a.addUniform("vSphericalXY",3),a.addUniform("vSphericalYZ",3),a.addUniform("vSphericalZX",3))}let Ei=(()=>{var a;let e=[],t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],m,g=[],x=[],y,b=[],v=[],E,R=[],C=[],O,M=[],I=[],P,L=[],V=[],X,re=[],ae=[],de,U=[],te=[],Y,Z=[],q=[],j,Q=[],w=[],B,z=[],K=[],ue,he=[],ve=[],Le,ke=[],J=[],_e,xe=[],Ne=[],Qe,He=[],dt=[],li,zt=[],Ot=[],jt,Nt=[],ut=[],ne,we=[],ti=[],ci,hi=[],ii=[],ui,Gt=[],fi=[],qt,Wt=[],si=[],Si,Mi=[],gr=[],pr,xr,Os,ws,Fs=[],ns=[],Bs;return a=class{get useVertexPulling(){return this._useVertexPulling}set useVertexPulling(G){this._useVertexPulling!==G&&(this._useVertexPulling=G,this.markAsDirty(a.MiscDirtyFlag))}get _supportGlowLayer(){return!1}set _glowModeEnabled(G){}get shaderLanguage(){return this._shaderLanguage}get canRenderToMRT(){return!1}set alpha(G){if(this._alpha===G)return;const Re=this._alpha;this._alpha=G,(Re===1||G===1)&&this.markAsDirty(a.MiscDirtyFlag+a.PrePassDirtyFlag)}get alpha(){return this._alpha}set backFaceCulling(G){this._backFaceCulling!==G&&(this._backFaceCulling=G,this.markAsDirty(a.TextureDirtyFlag))}get backFaceCulling(){return this._backFaceCulling}set textureRepetitionMode(G){const Re=Math.max(0,Math.min(G|0,4));this._textureRepetitionMode!==Re&&(this._textureRepetitionMode=Re,this.markAsDirty(a.TextureDirtyFlag))}get textureRepetitionMode(){return this._textureRepetitionMode}set cullBackFaces(G){this._cullBackFaces!==G&&(this._cullBackFaces=G,this.markAsDirty(a.TextureDirtyFlag))}get cullBackFaces(){return this._cullBackFaces}get blockDirtyMechanism(){return this._blockDirtyMechanism}set blockDirtyMechanism(G){this._blockDirtyMechanism!==G&&(this._blockDirtyMechanism=G,G||this.markDirty())}atomicMaterialsUpdate(G){this.blockDirtyMechanism=!0;try{G(this)}finally{this.blockDirtyMechanism=!1}}get hasRenderTargetTextures(){return this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._eventInfo.hasRenderTargetTextures}set onDispose(G){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(G)}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new Me),this._onBindObservable}set onBind(G){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(G)}get onUnBindObservable(){return this._onUnBindObservable||(this._onUnBindObservable=new Me),this._onUnBindObservable}get onEffectCreatedObservable(){return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new Me),this._onEffectCreatedObservable}set alphaMode(G){this._alphaMode[0]!==G&&(this._alphaMode[0]=G,this.markAsDirty(a.TextureDirtyFlag))}get alphaMode(){return this._alphaMode[0]}get alphaModes(){return this._alphaMode}setAlphaMode(G,Re=0){this._alphaMode[Re]!==G&&(this._alphaMode[Re]=G,this.markAsDirty(a.TextureDirtyFlag))}set needDepthPrePass(G){this._needDepthPrePass!==G&&(this._needDepthPrePass=G,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))}get needDepthPrePass(){return this._needDepthPrePass}get isPrePassCapable(){return!1}set fogEnabled(G){this._fogEnabled!==G&&(this._fogEnabled=G,this.markAsDirty(a.MiscDirtyFlag))}get fogEnabled(){return this._fogEnabled}get wireframe(){switch(this._fillMode){case a.WireFrameFillMode:case a.LineListDrawMode:case a.LineLoopDrawMode:case a.LineStripDrawMode:return!0}return this._scene.forceWireframe}set wireframe(G){this.fillMode=G?a.WireFrameFillMode:a.TriangleFillMode}get pointsCloud(){switch(this._fillMode){case a.PointFillMode:case a.PointListDrawMode:return!0}return this._scene.forcePointsCloud}set pointsCloud(G){this.fillMode=G?a.PointFillMode:a.TriangleFillMode}get fillMode(){return this._fillMode}set fillMode(G){this._fillMode!==G&&(this._fillMode=G,this.markAsDirty(a.MiscDirtyFlag))}get useLogarithmicDepth(){return this._useLogarithmicDepth}set useLogarithmicDepth(G){const Re=this.getScene().getEngine().getCaps().fragmentDepthSupported;G&&!Re&&pe.Warn("Logarithmic depth has been requested for a material on a device that doesn't support it."),this._useLogarithmicDepth=G&&Re,this._markAllSubMeshesAsMiscDirty()}get isVertexOutputInvariant(){return this._isVertexOutputInvariant}set isVertexOutputInvariant(G){this._isVertexOutputInvariant!==G&&(this._isVertexOutputInvariant=G,this._markAllSubMeshesAsMiscDirty())}_getDrawWrapper(){return this._drawWrapper}_setDrawWrapper(G){this._drawWrapper=G}constructor(G,Re,pt,We=!1){this.customShaderNameResolve=N(this,e),this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this._shaderLanguage=0,this._forceGLSL=!1,this._useVertexPulling=!1,this.id=N(this,i,void 0),this.uniqueId=(N(this,s),N(this,o,void 0)),this._loadedUniqueId=N(this,c),this.name=N(this,f,void 0),this.metadata=(N(this,_),N(this,g,null)),this._internalMetadata=N(this,x),this.reservedDataStore=null,this.checkReadyOnEveryCall=N(this,b,!1),this.checkReadyOnlyOnce=(N(this,v),N(this,R,!1)),this.state=(N(this,C),N(this,M,"")),this._alpha=(N(this,I),N(this,L,1)),this.inspectableCustomProperties=N(this,V),this._backFaceCulling=N(this,re,!0),this._textureRepetitionMode=(N(this,ae),N(this,U,0)),this.textureRepetitionHexTilingParams=(N(this,te),N(this,Z,[1,.6,7,.5])),this._cullBackFaces=(N(this,q),N(this,Q,!0)),this._blockDirtyMechanism=(N(this,w),!1),this.sideOrientation=N(this,z,null),this.onCompiled=(N(this,K),null),this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new Me,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=N(this,he,[2]),this._needDepthPrePass=(N(this,ve),N(this,ke,!1)),this.disableDepthWrite=(N(this,J),N(this,xe,!1)),this.disableColorWrite=(N(this,Ne),N(this,He,!1)),this.forceDepthWrite=(N(this,dt),N(this,zt,!1)),this.depthFunction=(N(this,Ot),N(this,Nt,0)),this.separateCullingPass=(N(this,ut),N(this,we,!1)),this._fogEnabled=(N(this,ti),N(this,hi,!0)),this.pointSize=(N(this,ii),N(this,Gt,1)),this.zOffset=(N(this,fi),N(this,Wt,0)),this.zOffsetUnits=(N(this,si),N(this,Mi,0)),this.clipPlane=N(this,gr),this.stencil=new FC,this._isVertexOutputInvariant=N(this,Fs,a.ForceVertexOutputInvariant),this._materialContext=N(this,ns),this._useUBO=!1,this._fillMode=a.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=()=>{},this._callbackPluginEventFillRenderTargetTextures=()=>{},this._transparencyMode=null,this.name=G;const W=Re||mt.LastCreatedScene;W&&(this._scene=W,this._dirtyCallbacks={},this._forceGLSL=We,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=G||bt.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new Ov(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._uniformBuffer=new ze(this._scene.getEngine(),void 0,void 0,G),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,this._createUniformBuffer(),pt||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),a.OnEventObservable.notifyObservers(this,1))}_createUniformBuffer(){const G=this.getScene().getEngine();this._uniformBuffer?.dispose(),G.isWebGPU&&!this._forceGLSL?(this._uniformBuffer=new ze(G,void 0,void 0,this.name,!0),this._shaderLanguage=1):this._uniformBuffer=new ze(this._scene.getEngine(),void 0,void 0,this.name),this._uniformBufferLayoutBuilt=!1}toString(G){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(G,Re){return!0}isReadyForSubMesh(G,Re,pt){const We=Re.materialDefines;return We?(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=We,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),this._eventInfo.isReadyForSubMesh):!1}getEffect(){return this._drawWrapper.effect}getScene(){return this._scene}_getEffectiveOrientation(G){return this.sideOrientation!==null?this.sideOrientation:G.sideOrientation}get transparencyMode(){return this._transparencyMode}set transparencyMode(G){this._transparencyMode!==G&&(this._transparencyMode=G,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _hasTransparencyMode(){return this._transparencyMode!=null}get _transparencyModeIsBlend(){return this._transparencyMode===a.MATERIAL_ALPHABLEND||this._transparencyMode===a.MATERIAL_ALPHATESTANDBLEND}get _transparencyModeIsTest(){return this._transparencyMode===a.MATERIAL_ALPHATEST||this._transparencyMode===a.MATERIAL_ALPHATESTANDBLEND}get _disableAlphaBlending(){return this._transparencyMode===a.MATERIAL_OPAQUE||this._transparencyMode===a.MATERIAL_ALPHATEST}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:this._disableAlphaBlending?!1:this.alpha<1}needAlphaBlendingForMesh(G){return this._hasTransparencyMode?this._transparencyModeIsBlend:G.visibility<1?!0:this._disableAlphaBlending?!1:G.hasVertexAlpha||this.needAlphaBlending()}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:!1}needAlphaTestingForMesh(G){return this._hasTransparencyMode?this._transparencyModeIsTest:!this.needAlphaBlendingForMesh(G)&&this.needAlphaTesting()}getAlphaTestTexture(){return null}markDirty(G=!1){const Re=this.getScene().meshes;for(const pt of Re)if(pt.subMeshes){for(const We of pt.subMeshes)if(We.getMaterial()===this)for(const W of We._drawWrappers)W&&this._materialContext===W.materialContext&&(W._wasPreviouslyReady=!1,W._wasPreviouslyUsingInstances=null,W._forceRebindOnNextCall=G)}G&&this.markAsDirty(a.AllDirtyFlag)}_preBind(G,Re=null){const pt=this._scene.getEngine(),W=(Re??this.sideOrientation)===a.ClockWiseSideOrientation,Ve=G||this._getDrawWrapper();return ov(Ve)&&Ve.materialContext&&(Ve.materialContext.useVertexPulling=this.useVertexPulling),pt.enableEffect(Ve),pt.setState(this.backFaceCulling,this.zOffset,!1,W,this._scene._mirroredCameraPosition?!this.cullBackFaces:this.cullBackFaces,this.stencil,this.zOffsetUnits),W}bind(G,Re){}buildUniformLayout(){const G=this._uniformBuffer;this._eventInfo.ubo=G,this._callbackPluginEventGeneric(8,this._eventInfo),G.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(G,Re,pt){const We=pt._drawWrapper;this._eventInfo.subMesh=pt,this._callbackPluginEventBindForSubMesh(this._eventInfo),We._forceRebindOnNextCall=!1}bindOnlyWorldMatrix(G){}
vendor: 4,196 bytes, line 292
292bindView(G){this._useUBO?this._needToBindSceneUbo=!0:G.setMatrix("view",this.getScene().getViewMatrix())}bindViewProjection(G){this._useUBO?this._needToBindSceneUbo=!0:(G.setMatrix("viewProjection",this.getScene().getTransformMatrix()),G.setMatrix("projection",this.getScene().getProjectionMatrix()),G.setMatrix("inverseProjection",this.getScene().getInverseProjectionMatrix()))}bindEyePosition(G,Re){this._useUBO?this._needToBindSceneUbo=!0:this._scene.bindEyePosition(G,Re)}_afterBind(G,Re=null,pt){if(this._scene._cachedMaterial=this,this._needToBindSceneUbo&&Re&&(this._needToBindSceneUbo=!1,Vv(Re,this.getScene().getSceneUniformBuffer()),this._scene.finalizeSceneUbo()),G?this._scene._cachedVisibility=G.visibility:this._scene._cachedVisibility=1,this._onBindObservable&&G&&this._onBindObservable.notifyObservers(G),this.disableDepthWrite){const We=this._scene.getEngine();this._cachedDepthWriteState=We.getDepthWrite(),We.setDepthWrite(!1)}if(this.disableColorWrite){const We=this._scene.getEngine();this._cachedColorWriteState=We.getColorWrite(),We.setColorWrite(!1)}if(this.depthFunction!==0){const We=this._scene.getEngine();this._cachedDepthFunctionState=We.getDepthFunction()||0,We.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(G){return this._eventInfo.hasTexture=!1,this._eventInfo.texture=G,this._callbackPluginEventGeneric(1024,this._eventInfo),this._eventInfo.hasTexture}clone(G){return null}_clonePlugins(G,Re){const pt={};if(this._serializePlugins(pt),a._ParsePlugins(pt,G,this._scene,Re),this.pluginManager)for(const We of this.pluginManager._plugins){const W=G.pluginManager.getPlugin(We.name);W&&We.copyTo(W)}}getBindedMeshes(){if(this.meshMap){const G=[];for(const Re in this.meshMap){const pt=this.meshMap[Re];pt&&G.push(pt)}return G}else return this._scene.meshes.filter(Re=>Re.material===this)}forceCompilation(G,Re,pt,We){const W={clipPlane:!1,useInstances:!1,...pt},Ve=this.getScene(),Qt=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;const as=()=>{if(!this._scene||!this._scene.getEngine())return;const br=Ve.clipPlane;if(W.clipPlane&&(Ve.clipPlane=new wr(0,0,0,1)),this._storeEffectOnSubMeshes){let os=!0,ms=null;if(G.subMeshes){const ls=new Xs(0,0,0,0,0,G,void 0,!1,!1);ls.materialDefines&&(ls.materialDefines._renderId=-1),this.isReadyForSubMesh(G,ls,W.useInstances)||(ls.effect&&ls.effect.getCompilationError()&&ls.effect.allFallbacksProcessed()?ms=ls.effect.getCompilationError():(os=!1,setTimeout(as,16)))}os&&(this.allowShaderHotSwapping=Qt,ms&&We&&We(ms),Re&&Re(this))}else this.isReady()?(this.allowShaderHotSwapping=Qt,Re&&Re(this)):setTimeout(as,16);W.clipPlane&&(Ve.clipPlane=br)};as()}async forceCompilationAsync(G,Re){return await new Promise((pt,We)=>{this.forceCompilation(G,()=>{pt()},Re,W=>{We(W)})})}markAsDirty(G){this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism||(a._DirtyCallbackArray.length=0,G&a.ImageProcessingDirtyFlag&&a._DirtyCallbackArray.push(a._ImageProcessingDirtyCallBack),G&a.TextureDirtyFlag&&a._DirtyCallbackArray.push(a._TextureDirtyCallBack),G&a.LightDirtyFlag&&a._DirtyCallbackArray.push(a._LightsDirtyCallBack),G&a.FresnelDirtyFlag&&a._DirtyCallbackArray.push(a._FresnelDirtyCallBack),G&a.AttributesDirtyFlag&&a._DirtyCallbackArray.push(a._AttributeDirtyCallBack),G&a.MiscDirtyFlag&&a._DirtyCallbackArray.push(a._MiscDirtyCallBack),G&a.PrePassDirtyFlag&&a._DirtyCallbackArray.push(a._PrePassDirtyCallBack),a._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(a._RunDirtyCallBacks),this.get
vendor: 15,811 bytes, line 292
292Scene().resetCachedMaterial())}resetDrawCache(){const G=this.getScene().meshes;for(const Re of G)if(Re.subMeshes)for(const pt of Re.subMeshes)pt.getMaterial()===this&&pt.resetDrawCache()}_markAllSubMeshesAsDirty(G){const Re=this.getScene();if(Re.blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const pt=Re.meshes;for(const We of pt)if(We.subMeshes){for(const W of We.subMeshes)if((W.getMaterial()||(Re._hasDefaultMaterial?Re.defaultMaterial:null))===this)for(const Qt of W._drawWrappers)!Qt||!Qt.defines||!Qt.defines.markAllAsDirty||this._materialContext===Qt.materialContext&&G(Qt.defines)}}_markScenePrePassDirty(){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const G=this.getScene().enablePrePassRenderer();G&&G.markAsDirty()}_markAllSubMeshesAsAllDirty(){this._markAllSubMeshesAsDirty(a._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){this._markAllSubMeshesAsDirty(a._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){this._markAllSubMeshesAsDirty(a._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){this._markAllSubMeshesAsDirty(a._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){this._markAllSubMeshesAsDirty(a._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){this._markAllSubMeshesAsDirty(a._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){this._markAllSubMeshesAsDirty(a._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){this._markAllSubMeshesAsDirty(a._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){this._markAllSubMeshesAsDirty(a._PrePassDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){this._markAllSubMeshesAsDirty(a._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){if(this._scene.performancePriority!==0){this.checkReadyOnlyOnce=!0;const G=this._scene.onScenePerformancePriorityChangedObservable.addOnce(()=>{this.checkReadyOnlyOnce=!1});this.onDisposeObservable.add(()=>{this._scene.onScenePerformancePriorityChangedObservable.remove(G)})}}setPrePassRenderer(G){return!1}dispose(G,Re,pt){const We=this.getScene();if(We.stopAnimation(this),We.freeProcessedMaterials(),We.removeMaterial(this),this._eventInfo.forceDisposeTextures=Re,this._callbackPluginEventGeneric(2,this._eventInfo),this._parentContainer){const W=this._parentContainer.materials.indexOf(this);W>-1&&this._parentContainer.materials.splice(W,1),this._parentContainer=null}if(pt!==!0)if(this.meshMap)for(const W in this.meshMap){const Ve=this.meshMap[W];this._disposeMeshResources(Ve)}else{const W=We.meshes;for(const Ve of W)this._disposeMeshResources(Ve)}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(G){if(!G)return;const Re=G.geometry,pt=G._internalAbstractMeshDataInfo._materialForRenderPass;if(this._storeEffectOnSubMeshes){if(G.subMeshes&&pt)for(const We of G.subMeshes){const W=We._drawWrappers;for(let Ve=0;Ve<W.length;Ve++){const Qt=W[Ve]?.effect;if(!Qt)continue;pt[Ve]===this&&(Re?._releaseVertexArrayObject(Qt),We._removeDrawWrapper(Ve,!0,!0))}}}else Re?._releaseVertexArrayObject(this._drawWrapper.effect);G.material===this&&!G.sourceMesh&&(G.material=null)}serialize(){const G=xt.Serialize(this);return G.stencil=this.stencil.serialize(),G.uniqueId=this.uniqueId,this._serializePlugins(G),G}_serializePlugins(G){if(G.plugins={},this.pluginManager)for(const Re of this.pluginManager._plugins)Re.doNotSerialize||(G.plugins[Re.getClassName()]=Re.serialize())}static ParseAlphaMode(G,Re){G._alphaMode!==void 0?Re._alphaMode=Array.isArray(G._alphaMode)?[...G._alphaMode]:[G._alphaMode]:G.alphaMode!==void 0?Re._alphaMode=Array.isArray(G.alphaMode)?[...G.alphaMode]:[G.alphaMode]:Re._alphaMode=[2]}static Parse(G,Re,pt){if(!G.customType)G.customType="BABYLON.StandardMaterial";else if(G.customType==="BABYLON.PBRMaterial"&&G.overloadedAlbedo&&(G.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return pe.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null;const W=bt.Instantiate(G.customType).Parse(G,Re,pt);return W._loadedUniqueId=G.uniqueId,a.ParseAlphaMode(G,W),W}static _ParsePlugins(G,Re,pt,We){if(G.plugins)for(const W in G.plugins){const Ve=G.plugins[W];let Qt=Re.pluginManager?.getPlugin(Ve.name);if(!Qt){const as=bt.Instantiate("BABYLON."+W);as&&(Qt=new as(Re))}Qt?.parse(Ve,pt,We)}}},(()=>{const $e=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[ce()],n=[ce()],h=[ce()],m=[ce()],y=[ce()],E=[ce()],O=[ce()],P=[ce("alpha")],X=[ce("backFaceCulling")],de=[ce("textureRepetitionMode")],Y=[ce("textureRepetitionHexTilingParams")],j=[ce("cullBackFaces")],B=[ce()],ue=[ce()],Le=[ce()],_e=[ce()],Qe=[ce()],li=[ce()],jt=[ce()],ne=[ce()],ci=[ce("fogEnabled")],ui=[ce()],qt=[ce()],Si=[ce()],pr=[ce()],xr=[ce()],Os=[ce()],ws=[ce()],Bs=[ce()],ee(a,null,pr,{kind:"getter",name:"pointsCloud",static:!1,private:!1,access:{has:G=>"pointsCloud"in G,get:G=>G.pointsCloud},metadata:$e},null,e),ee(a,null,xr,{kind:"getter",name:"fillMode",static:!1,private:!1,access:{has:G=>"fillMode"in G,get:G=>G.fillMode},metadata:$e},null,e),ee(a,null,Os,{kind:"getter",name:"useLogarithmicDepth",static:!1,private:!1,access:{has:G=>"useLogarithmicDepth"in G,get:G=>G.useLogarithmicDepth},metadata:$e},null,e),ee(a,null,Bs,{kind:"getter",name:"transparencyMode",static:!1,private:!1,access:{has:G=>"transparencyMode"in G,get:G=>G.transparencyMode},metadata:$e},null,e),ee(null,null,t,{kind:"field",name:"id",static:!1,private:!1,access:{has:G=>"id"in G,get:G=>G.id,set:(G,Re)=>{G.id=Re}},metadata:$e},i,s),ee(null,null,n,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:G=>"uniqueId"in G,get:G=>G.uniqueId,set:(G,Re)=>{G.uniqueId=Re}},metadata:$e},o,c),ee(null,null,h,{kind:"field",name:"name",static:!1,private:!1,access:{has:G=>"name"in G,get:G=>G.name,set:(G,Re)=>{G.name=Re}},metadata:$e},f,_),ee(null,null,m,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:G=>"metadata"in G,get:G=>G.metadata,set:(G,Re)=>{G.metadata=Re}},metadata:$e},g,x),ee(null,null,y,{kind:"field",name:"checkReadyOnEveryCall",static:!1,private:!1,access:{has:G=>"checkReadyOnEveryCall"in G,get:G=>G.checkReadyOnEveryCall,set:(G,Re)=>{G.checkReadyOnEveryCall=Re}},metadata:$e},b,v),ee(null,null,E,{kind:"field",name:"checkReadyOnlyOnce",static:!1,private:!1,access:{has:G=>"checkReadyOnlyOnce"in G,get:G=>G.checkReadyOnlyOnce,set:(G,Re)=>{G.checkReadyOnlyOnce=Re}},metadata:$e},R,C),ee(null,null,O,{kind:"field",name:"state",static:!1,private:!1,access:{has:G=>"state"in G,get:G=>G.state,set:(G,Re)=>{G.state=Re}},metadata:$e},M,I),ee(null,null,P,{kind:"field",name:"_alpha",static:!1,private:!1,access:{has:G=>"_alpha"in G,get:G=>G._alpha,set:(G,Re)=>{G._alpha=Re}},metadata:$e},L,V),ee(null,null,X,{kind:"field",name:"_backFaceCulling",static:!1,private:!1,access:{has:G=>"_backFaceCulling"in G,get:G=>G._backFaceCulling,set:(G,Re)=>{G._backFaceCulling=Re}},metadata:$e},re,ae),ee(null,null,de,{kind:"field",name:"_textureRepetitionMode",static:!1,private:!1,access:{has:G=>"_textureRepetitionMode"in G,get:G=>G._textureRepetitionMode,set:(G,Re)=>{G._textureRepetitionMode=Re}},metadata:$e},U,te),ee(null,null,Y,{kind:"field",name:"textureRepetitionHexTilingParams",static:!1,private:!1,access:{has:G=>"textureRepetitionHexTilingParams"in G,get:G=>G.textureRepetitionHexTilingParams,set:(G,Re)=>{G.textureRepetitionHexTilingParams=Re}},metadata:$e},Z,q),ee(null,null,j,{kind:"field",name:"_cullBackFaces",static:!1,private:!1,access:{has:G=>"_cullBackFaces"in G,get:G=>G._cullBackFaces,set:(G,Re)=>{G._cullBackFaces=Re}},metadata:$e},Q,w),ee(null,null,B,{kind:"field",name:"sideOrientation",static:!1,private:!1,access:{has:G=>"sideOrientation"in G,get:G=>G.sideOrientation,set:(G,Re)=>{G.sideOrientation=Re}},metadata:$e},z,K),ee(null,null,ue,{kind:"field",name:"_alphaMode",static:!1,private:!1,access:{has:G=>"_alphaMode"in G,get:G=>G._alphaMode,set:(G,Re)=>{G._alphaMode=Re}},metadata:$e},he,ve),ee(null,null,Le,{kind:"field",name:"_needDepthPrePass",static:!1,private:!1,access:{has:G=>"_needDepthPrePass"in G,get:G=>G._needDepthPrePass,set:(G,Re)=>{G._needDepthPrePass=Re}},metadata:$e},ke,J),ee(null,null,_e,{kind:"field",name:"disableDepthWrite",static:!1,private:!1,access:{has:G=>"disableDepthWrite"in G,get:G=>G.disableDepthWrite,set:(G,Re)=>{G.disableDepthWrite=Re}},metadata:$e},xe,Ne),ee(null,null,Qe,{kind:"field",name:"disableColorWrite",static:!1,private:!1,access:{has:G=>"disableColorWrite"in G,get:G=>G.disableColorWrite,set:(G,Re)=>{G.disableColorWrite=Re}},metadata:$e},He,dt),ee(null,null,li,{kind:"field",name:"forceDepthWrite",static:!1,private:!1,access:{has:G=>"forceDepthWrite"in G,get:G=>G.forceDepthWrite,set:(G,Re)=>{G.forceDepthWrite=Re}},metadata:$e},zt,Ot),ee(null,null,jt,{kind:"field",name:"depthFunction",static:!1,private:!1,access:{has:G=>"depthFunction"in G,get:G=>G.depthFunction,set:(G,Re)=>{G.depthFunction=Re}},metadata:$e},Nt,ut),ee(null,null,ne,{kind:"field",name:"separateCullingPass",static:!1,private:!1,access:{has:G=>"separateCullingPass"in G,get:G=>G.separateCullingPass,set:(G,Re)=>{G.separateCullingPass=Re}},metadata:$e},we,ti),ee(null,null,ci,{kind:"field",name:"_fogEnabled",static:!1,private:!1,access:{has:G=>"_fogEnabled"in G,get:G=>G._fogEnabled,set:(G,Re)=>{G._fogEnabled=Re}},metadata:$e},hi,ii),ee(null,null,ui,{kind:"field",name:"pointSize",static:!1,private:!1,access:{has:G=>"pointSize"in G,get:G=>G.pointSize,set:(G,Re)=>{G.pointSize=Re}},metadata:$e},Gt,fi),ee(null,null,qt,{kind:"field",name:"zOffset",static:!1,private:!1,access:{has:G=>"zOffset"in G,get:G=>G.zOffset,set:(G,Re)=>{G.zOffset=Re}},metadata:$e},Wt,si),ee(null,null,Si,{kind:"field",name:"zOffsetUnits",static:!1,private:!1,access:{has:G=>"zOffsetUnits"in G,get:G=>G.zOffsetUnits,set:(G,Re)=>{G.zOffsetUnits=Re}},metadata:$e},Mi,gr),ee(null,null,ws,{kind:"field",name:"_isVertexOutputInvariant",static:!1,private:!1,access:{has:G=>"_isVertexOutputInvariant"in G,get:G=>G._isVertexOutputInvariant,set:(G,Re)=>{G._isVertexOutputInvariant=Re}},metadata:$e},Fs,ns),$e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$e})})(),a.TriangleFillMode=0,a.WireFrameFillMode=1,a.PointFillMode=2,a.PointListDrawMode=3,a.LineListDrawMode=4,a.LineLoopDrawMode=5,a.LineStripDrawMode=6,a.TriangleStripDrawMode=7,a.TriangleFanDrawMode=8,a.ClockWiseSideOrientation=0,a.CounterClockWiseSideOrientation=1,a.ImageProcessingDirtyFlag=64,a.TextureDirtyFlag=1,a.LightDirtyFlag=2,a.FresnelDirtyFlag=4,a.AttributesDirtyFlag=8,a.MiscDirtyFlag=16,a.PrePassDirtyFlag=32,a.AllDirtyFlag=127,a.MATERIAL_OPAQUE=0,a.MATERIAL_ALPHATEST=1,a.MATERIAL_ALPHABLEND=2,a.MATERIAL_ALPHATESTANDBLEND=3,a.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0,a.MATERIAL_NORMALBLENDMETHOD_RNM=1,a.LIGHTFALLOFF_PHYSICAL=0,a.LIGHTFALLOFF_GLTF=1,a.LIGHTFALLOFF_STANDARD=2,a.OnEventObservable=new Me,a.ForceVertexOutputInvariant=!1,a._AllDirtyCallBack=$e=>$e.markAllAsDirty(),a._ImageProcessingDirtyCallBack=$e=>$e.markAsImageProcessingDirty(),a._TextureDirtyCallBack=$e=>$e.markAsTexturesDirty(),a._FresnelDirtyCallBack=$e=>$e.markAsFresnelDirty(),a._MiscDirtyCallBack=$e=>$e.markAsMiscDirty(),a._PrePassDirtyCallBack=$e=>$e.markAsPrePassDirty(),a._LightsDirtyCallBack=$e=>$e.markAsLightDirty(),a._AttributeDirtyCallBack=$e=>$e.markAsAttributesDirty(),a._FresnelAndMiscDirtyCallBack=$e=>{a._FresnelDirtyCallBack($e),a._MiscDirtyCallBack($e)},a._TextureAndMiscDirtyCallBack=$e=>{a._TextureDirtyCallBack($e),a._MiscDirtyCallBack($e)},a._DirtyCallbackArray=[],a._RunDirtyCallBacks=$e=>{for(const G of a._DirtyCallbackArray)G($e)},a})();Object.getOwnPropertyDescriptor(Ei.prototype,"pluginManager")||Object.defineProperty(Ei.prototype,"pluginManager",gt("Material","pluginManager"));class Tf extends Ei{get subMaterials(){return this._subMaterials}set subMaterials(e){this._subMaterials=e,this._hookArray(e)}getChildren(){return this.subMaterials}constructor(e,t){super(e,t,!0),this._waitingSubMaterialsUniqueIds=[],this.getScene().addMultiMaterial(this),this.subMaterials=[],this._storeEffectOnSubMeshes=!0}_hookArray(e){const t=e.push;e.push=(...s)=>{const n=t.apply(e,s);return this._markAllSubMeshesAsTexturesDirty(),n};const i=e.splice;e.splice=(s,n)=>{const o=i.call(e,s,n??e.length);return this._markAllSubMeshesAsTexturesDirty(),o}}getSubMaterial(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]}getActiveTextures(){return super.getActiveTextures().concat(...this.subMaterials.map(e=>e?e.getActiveTextures():[]))}hasTexture(e){if(super.hasTexture(e))return!0;for(let t=0;t<this.subMaterials.length;t++)if(this.subMaterials[t]?.hasTexture(e))return!0;return!1}getClassName(){return"MultiMaterial"}isReadyForSubMesh(e,t,i){for(let s=0;s<this.subMaterials.length;s++){const n=this.subMaterials[s];if(n){if(n._storeEffectOnSubMeshes){if(!n.isReadyForSubMesh(e,t,i))return!1;continue}if(!n.isReady(e))return!1}}return!0}clone(e,t){const i=new Tf(e,this.getScene());for(let s=0;s<this.subMaterials.length;s++){let n;const o=this.subMaterials[s];t&&o?n=o.clone(e+"-"+o.name):n=this.subMaterials[s],i.subMaterials.push(n)}return i}serialize(){const e={};e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,Rt&&(e.tags=Rt.GetTags(this)),e.materialsUniqueIds=[],e.materials=[];for(let t=0;t<this.subMaterials.length;t++){const i=this.subMaterials[t];i?(e.materialsUniqueIds.push(i.uniqueId),e.materials.push(i.id)):(e.materialsUniqueIds.push(null),e.materials.push(null))}return e}dispose(e,t,i){const s=this.getScene();if(!s)return;if(i)for(let o=0;o<this.subMaterials.length;o++){const c=this.subMaterials[o];c&&c.dispose(e,t)}const n=s.multiMaterials.indexOf(this);n>=0&&s.multiMaterials.splice(n,1),super.dispose(e,t)}}class et{}et.NAME_EFFECTLAYER="EffectLayer";et.NAME_LAYER="Layer";et.NAME_LENSFLARESYSTEM="LensFlareSystem";et.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer";et.NAME_PARTICLESYSTEM="ParticleSystem";et.NAME_GAMEPAD="Gamepad";et.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue";et.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer";et.NAME_PREPASSRENDERER="PrePassRenderer";et.NAME_DEPTHRENDERER="DepthRenderer";et.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer";et.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager";et.NAME_SPRITE="Sprite";et.NAME_SUBSURFACE="SubSurface";et.NAME_OUTLINERENDERER="Outline";et.NAME_PROCEDURALTEXTURE="ProceduralTexture";et.NAME_SHADOWGENERATOR="ShadowGenerator";et.NAME_OCTREE="Octree";et.NAME_PHYSICSENGINE="PhysicsEngine";et.NAME_AUDIO="Audio";et.NAME_FLUIDRENDERER="FluidRenderer";et.NAME_IBLCDFGENERATOR="iblCDFGenerator";et.NAME_CLUSTEREDLIGHTING="ClusteredLighting";et.STEP_ISREADYFORMESH_EFFECTLAYER=0;et.STEP_ISREADYFORMESH_DEPTHRENDERER=1;et.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0;et.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0;et.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0;et.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1;et.STEP_BEFORECAMERADRAW_PREPASS=0;et.STEP_BEFORECAMERADRAW_EFFECTLAYER=1;et.STEP_BEFORECAMERADRAW_LAYER=2;et.STEP_BEFORERENDERTARGETDRAW_PREPASS=0;et.STEP_BEFORERENDERTARGETDRAW_LAYER=1;et.STEP_BEFORERENDERINGMESH_PREPASS=0;et.STEP_BEFORERENDERINGMESH_OUTLINE=1;et.STEP_AFTERRENDERINGMESH_PREPASS=0;et.STEP_AFTERRENDERINGMESH_OUTLINE=1;et.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0;et.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1;
292et.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0;et.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0;et.STEP_BEFORECLEAR_PREPASS=1;et.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0;et.STEP_AFTERRENDERTARGETDRAW_PREPASS=0;et.STEP_AFTERRENDERTARGETDRAW_LAYER=1;et.STEP_AFTERCAMERADRAW_PREPASS=0;et.STEP_AFTERCAMERADRAW_EFFECTLAYER=1;et.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2;et.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3;et.STEP_AFTERCAMERADRAW_LAYER=4;et.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5;et.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0;et.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0;et.STEP_AFTERRENDER_AUDIO=0;et.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0;et.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1;et.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2;et.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3;et.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0;et.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1;et.STEP_GATHERACTIVECAMERARENDERTARGETS_CLUSTEREDLIGHTING=2;et.STEP_POINTERMOVE_SPRITE=0;et.STEP_POINTERDOWN_SPRITE=0;et.STEP_POINTERUP_SPRITE=0;class gi extends Array{constructor(e){super(...e)}static Create(){return Object.create(gi.prototype)}registerStep(e,t,i){let s=0,n;for(;s<this.length&&(n=this[s].index,!(e<n));s++);this.splice(s,0,{index:e,component:t,action:i.bind(t)})}clear(){this.length=0}}class pD{constructor(e,t){this.distanceOrScreenCoverage=e,this.mesh=t}}var dy,_y,my,gy,py,xy,by,yy,Ty,vy,Ey,Ay,Ry,Sy;class Wv{}class My{constructor(){this.batchCache=new Cy(this),this.batchCacheReplacementModeInFrozenMode=new Cy(this),this.instancesBufferSize=512*4}}class xD{constructor(){this.renderPasses={}}}class Cy{constructor(e){this.parent=e,this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=[],this.hardwareInstancedRendering=[]}}class bD{constructor(){this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=512,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class yD{constructor(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=new Array,this._useLODScreenCoverage=!1,this._effectiveMaterial=null,this._forcedInstanceCount=0,this._overrideRenderingFillMode=null}}const Dr={source:null,parent:null,doNotCloneChildren:!1,clonePhysicsImpostor:!0,cloneThinInstances:!1};class $ extends Ht{static _GetDefaultSideOrientation(e){return e||$.FRONTSIDE}get useLODScreenCoverage(){return this._internalMeshDataInfo._useLODScreenCoverage}set useLODScreenCoverage(e){this._internalMeshDataInfo._useLODScreenCoverage=e,this._sortLODLevels()}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(k.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(k.NormalKind,this._internalMeshDataInfo._sourceNormals,!0),this._internalMeshDataInfo._sourcePositions=null,this._internalMeshDataInfo._sourceNormals=null),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get onBeforeRenderObservable(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new Me),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new Me),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new Me),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new Me),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new Me),this._internalMeshDataInfo._onBeforeDrawObservable}set onBeforeDraw(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)}get hasInstances(){return this.instances.length>0}get hasThinInstances(){return(this.forcedInstanceCount||this._thinInstanceDataStorage.
vendor: 15,229 bytes, line 292
292instancesCount||0)>0}get forcedInstanceCount(){return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){this._internalMeshDataInfo._forcedInstanceCount=e}get sideOrientation(){return this._internalMeshDataInfo._sideOrientation}set sideOrientation(e){this._internalMeshDataInfo._sideOrientation=e,this._internalAbstractMeshDataInfo._sideOrientationHint=this._scene.useRightHandedSystem&&e===1||!this._scene.useRightHandedSystem&&e===0}get _effectiveSideOrientation(){return this._internalMeshDataInfo._effectiveSideOrientation}get overrideMaterialSideOrientation(){return this.sideOrientation}set overrideMaterialSideOrientation(e){this.sideOrientation=e,this.material&&(this.material.sideOrientation=null)}get overrideRenderingFillMode(){return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){this._internalMeshDataInfo._overrideRenderingFillMode=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){e&&(this.material&&this.material.sideOrientation===null||this._internalAbstractMeshDataInfo._sideOrientationHint)&&(e.sideOrientation=null),this._setMaterial(e)}get source(){return this._internalMeshDataInfo._source}get cloneMeshMap(){return this._internalMeshDataInfo.meshMap}get isUnIndexed(){return this._unIndexed}set isUnIndexed(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())}get worldMatrixInstancedBuffer(){const e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesData:void 0}get previousWorldMatrixInstancedBuffer(){const e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesPreviousData:void 0}get manualUpdateOfWorldMatrixInstancedBuffer(){return this._instanceDataStorage.manualUpdate}set manualUpdateOfWorldMatrixInstancedBuffer(e){this._instanceDataStorage.manualUpdate=e}get manualUpdateOfPreviousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.previousManualUpdate}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e){this._instanceDataStorage.previousManualUpdate=e}get forceWorldMatrixInstancedBufferUpdate(){return this._instanceDataStorage.forceMatrixUpdates}set forceWorldMatrixInstancedBufferUpdate(e){this._instanceDataStorage.forceMatrixUpdates=e}_copySource(e,t,i=!0,s=!1){const n=this.getScene();if(e._geometry&&e._geometry.applyToMesh(this),Pm.DeepCopy(e,this,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","worldMatrixInstancedBuffer","previousWorldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap","hasBoundingInfo","physicsBody","physicsImpostor"],["_poseMatrix"]),this._internalMeshDataInfo._source=e,n.useClonedMeshMap&&(e._internalMeshDataInfo.meshMap||(e._internalMeshDataInfo.meshMap={}),e._internalMeshDataInfo.meshMap[this.uniqueId]=this),this._originalBuilderSideOrientation=e._originalBuilderSideOrientation,this._creationDataStorage=e._creationDataStorage,e._ranges){const o=e._ranges;for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&this.createAnimationRange(c,o[c].from,o[c].to)}if(e.metadata&&e.metadata.clone?this.metadata=e.metadata.clone():this.metadata=e.metadata,this._internalMetadata=e._internalMetadata,Rt&&Rt.HasTags(e)&&Rt.AddTagsTo(this,Rt.GetTags(e,!0)),this.setEnabled(e.isEnabled(!1)),this.parent=e.parent,this.setPivotMatrix(e.getPivotMatrix(),this._postMultiplyPivotMatrix),this.id=this.name+"."+e.id,this.material=e.material,!t){const o=e.getDescendants(!0);for(let c=0;c<o.length;c++){const h=o[c];h._isMesh?(Dr.parent=this,Dr.doNotCloneChildren=t,Dr.clonePhysicsImpostor=i,Dr.cloneThinInstances=s,h.clone(this.name+"."+h.name,Dr)):h.clone&&h.clone(this.name+"."+h.name,this)}}if(e.morphTargetManager&&(this.morphTargetManager=e.morphTargetManager),bm(n.getPhysicsEngine)){const o=n.getPhysicsEngine();if(i&&o)if(o.getPluginVersion()===1){const c=o.getImpostorForPhysicsObject(e);c&&(this.physicsImpostor=c.clone(this))}else o.getPluginVersion()===2&&e.physicsBody&&e.physicsBody.clone(this)}for(let o=0;o<n.particleSystems.length;o++){const c=n.particleSystems[o];c.emitter===e&&c.clone(c.name,this)}if(this.skeleton=e.skeleton,s&&(e._thinInstanceDataStorage.matrixData?(this.thinInstanceSetBuffer("matrix",new Float32Array(e._thinInstanceDataStorage.matrixData),16,!e._thinInstanceDataStorage.matrixBuffer.isUpdatable()),this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,this._thinInstanceDataStorage.instancesCount=e._thinInstanceDataStorage.instancesCount):this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,e._userThinInstanceBuffersStorage)){const o=e._userThinInstanceBuffersStorage;for(const c in o.data)this.thinInstanceSetBuffer(c,new Float32Array(o.data[c]),o.strides[c],!o.vertexBuffers?.[c]?.isUpdatable()),this._userThinInstanceBuffersStorage.sizes[c]=o.sizes[c]}this.refreshBoundingInfo(!0,!0),this.computeWorldMatrix(!0)}constructor(e,t=null,i=null,s=null,n,o=!0){super(e,t),this._internalMeshDataInfo=new yD,this.delayLoadState=0,this.instances=[],this._creationDataStorage=null,this._geometry=null,this._thinInstanceDataStorage=new bD,this._shouldGenerateFlatShading=!1,this._originalBuilderSideOrientation=$.DEFAULTSIDE,this.ignoreCameraMaxZ=!1,t=this.getScene(),this._instanceDataStorage=new xD,this._instanceDataStorage.engine=t.getEngine(),this._instanceDataStorage.useMonoDataStorageRenderPass=!this._instanceDataStorage.engine.isWebGPU,this._instanceDataStorage.useMonoDataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass=new My),this._scene.useRightHandedSystem?this.sideOrientation=0:this.sideOrientation=1,this._onBeforeDraw=(f,_,m)=>{f&&m&&(this._uniformBuffer?this.transferToEffect(_):m.bindOnlyWorldMatrix(_))};let c,h=!1;if(i&&i._addToSceneRootNodes===void 0){const f=i;c=f.parent??null,s=f.source??null,n=f.doNotCloneChildren??!1,o=f.clonePhysicsImpostor??!0,h=f.cloneThinInstances??!1}else c=i;s&&this._copySource(s,n,o,h),c!==null&&(this.parent=c),this._instanceDataStorage.hardwareInstancedRendering=this.getEngine().getCaps().instancedArrays,this._internalMeshDataInfo._onMeshReadyObserverAdded=f=>{f.unregisterOnNextCall=!0,this.isReady(!0)?this.onMeshReadyObservable.notifyObservers(this):this._internalMeshDataInfo._checkReadinessObserver||(this._internalMeshDataInfo._checkReadinessObserver=this._scene.onBeforeRenderObservable.add(()=>{this.isReady(!0)&&(this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),this._internalMeshDataInfo._checkReadinessObserver=null,this.onMeshReadyObservable.notifyObservers(this))}))},this.onMeshReadyObservable=new Me(this._internalMeshDataInfo._onMeshReadyObserverAdded),s&&s.onClonedObservable.notifyObservers(this)}instantiateHierarchy(e=null,t,i){const s=this.getTotalVertices()===0||t&&t.doNotInstantiate&&(t.doNotInstantiate===!0||t.doNotInstantiate(this))?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));s.parent=e||this.parent,s.position=this.position.clone(),s.scaling=this.scaling.clone(),this.rotationQuaternion?s.rotationQuaternion=this.rotationQuaternion.clone():s.rotation=this.rotation.clone(),i&&i(this,s);for(const n of this.getChildTransformNodes(!0))n.getClassName()==="InstancedMesh"&&s.getClassName()==="Mesh"&&n.sourceMesh===this?n.instantiateHierarchy(s,{doNotInstantiate:t&&t.doNotInstantiate||!1,newSourcedMesh:s},i):n.instantiateHierarchy(s,t,i);return s}getClassName(){return"Mesh"}get _isMesh(){return!0}toString(e){let t=super.toString(e);if(t+=", n vertices: "+this.getTotalVertices(),t+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);if(e)if(this._geometry){const i=this.getIndices(),s=this.getVerticesData(k.PositionKind);s&&i&&(t+=", flat shading: "+(s.length/3===i.length?"YES":"NO"))}else t+=", flat shading: UNKNOWN";return t}_unBindEffect(){super._unBindEffect();for(const e of this.instances)e._unBindEffect()}get hasLODLevels(){return this._internalMeshDataInfo._LODLevels.length>0}getLODLevels(){return this._internalMeshDataInfo._LODLevels}_sortLODLevels(){const e=this._internalMeshDataInfo._useLODScreenCoverage?-1:1;this._internalMeshDataInfo._LODLevels.sort((t,i)=>t.distanceOrScreenCoverage<i.distanceOrScreenCoverage?e:t.distanceOrScreenCoverage>i.distanceOrScreenCoverage?-e:0)}addLODLevel(e,t){if(t&&t._masterMesh)return pe.Warn("You cannot use a mesh as LOD level twice"),this;const i=new pD(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this}getLODLevelAtDistance(e){const t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++){const s=t._LODLevels[i];if(s.distanceOrScreenCoverage===e)return s.mesh}return null}removeLODLevel(e){const t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++)t._LODLevels[i].mesh===e&&(t._LODLevels.splice(i,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this}getLOD(e,t){const i=this._internalMeshDataInfo;if(!i._LODLevels||i._LODLevels.length===0)return this;const s=t||this.getBoundingInfo().boundingSphere,n=e.mode===ds.ORTHOGRAPHIC_CAMERA?e.minZ:s.centerWorld.subtract(e.globalPosition).length();let o=n,c=1;if(i._useLODScreenCoverage){const h=e.screenArea;let f=s.radiusWorld*e.minZ/n;f=f*f*Math.PI,o=f/h,c=-1}if(c*i._LODLevels[i._LODLevels.length-1].distanceOrScreenCoverage>c*o)return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,this),this;for(let h=0;h<i._LODLevels.length;h++){const f=i._LODLevels[h];if(c*f.distanceOrScreenCoverage<c*o){if(f.mesh){if(f.mesh.delayLoadState===4)return f.mesh._checkDelayState(),this;if(f.mesh.delayLoadState===2)return this;f.mesh._preActivate(),f.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)}return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,f.mesh),f.mesh}}return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,this),this}get geometry(){return this._geometry}getTotalVertices(){return this._geometry===null||this._geometry===void 0?0:this._geometry.getTotalVertices()}getVerticesData(e,t,i,s){if(!this._geometry)return null;let n=s?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e]?.getFloatData(this.instances.length+1,i||t&&this._geometry.meshes.length!==1);return n||(n=this._geometry.getVerticesData(e,t,i)),n}copyVerticesData(e,t){this._geometry&&this._geometry.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._geometry?(t?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e])??this._geometry.getVertexBuffer(e):null}isVerticesDataPresent(e,t){return this._geometry?!t&&this._userInstancedBuffersStorage?.vertexBuffers[e]!==void 0||this._geometry.isVerticesDataPresent(e):this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1}isVertexBufferUpdatable(e,t){if(!this._geometry)return this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1;if(!t){const i=this._userInstancedBuffersStorage?.vertexBuffers[e];if(i)return i.isUpdatable()}return this._geometry.isVertexBufferUpdatable(e)}getVerticesDataKinds(e){if(!this._geometry){const i=[];if(this._delayInfo)for(const s of this._delayInfo)i.push(s);return i}const t=this._geometry.getVerticesDataKinds();if(!e&&this._userInstancedBuffersStorage)for(const i in this._userInstancedBuffersStorage.vertexBuffers)t.indexOf(i)===-1&&t.push(i);return t}getTotalIndices(){return this._geometry?this._geometry.getTotalIndices():0}getIndices(e,t){return this._geometry?this._geometry.getIndices(e,t):[]}get isBlocked(){return this._masterMesh!==null&&this._masterMesh!==void 0}isReady(e=!1,t=!1){if(this.delayLoadState===2||!super.isReady(e))return!1;if(!this.subMeshes||this.subMeshes.length===0||!e)return!0;const i=this.getEngine(),s=this.getScene(),n=t||i.getCaps().instancedArrays&&(this.instances.length>0||this.hasThinInstances);this.computeWorldMatrix();const o=this.material||s.defaultMaterial;if(o){if(o._storeEffectOnSubMeshes)for(const h of this.subMeshes){const f=h.getMaterial();if(f){if(f._storeEffectOnSubMeshes){if(!f.isReadyForSubMesh(this,h,n))return!1}else if(!f.isReady(this,n))return!1}}else if(!o.isReady(this,n))return!1}const c=i.currentRenderPassId;for(const h of this.lightSources){const f=h.getShadowGenerators();if(!f)continue;const _=f.values();for(let m=_.next();m.done!==!0;m=_.next()){const g=m.value;if(g&&(!g.getShadowMap()?.renderList||g.getShadowMap()?.renderList&&g.getShadowMap()?.renderList?.indexOf(this)!==-1)){const y=g.getShadowMap().renderPassIds??[i.currentRenderPassId];for(let b=0;b<y.length;++b){i.currentRenderPassId=y[b];for(const v of this.subMeshes)if(!g.isReady(v,n,v.getMaterial()?.needAlphaBlendingForMesh(this)??!1))return i.currentRenderPassId=c,!1}i.currentRenderPassId=c}}}for(const h of this._internalMeshDataInfo._LODLevels)if(h.mesh&&!h.mesh.isReady(n))return!1;return!0}get areNormalsFrozen(){return this._internalMeshDataInfo._areNormalsFrozen}freezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!0,this}unfreezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!1,this}set overridenInstanceCount(e){this._instanceDataStorage.overridenInstanceCount=e}_getInstanceDataStorage(){if(this._instanceDataStorage.useMonoDataStorageRenderPass)return this._instanceDataStorage.dataStorageRenderPass;const e=this._instanceDataStorage.engine.currentRenderPassId;let t=this._instanceDataStorage.renderPasses[e];return t||(t=new My,this._instanceDataStorage.renderPasses[e]=t),t}_preActivate(){const e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t?this:(e._preActivateId=t,this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass.visibleInstances=null:this._getInstanceDataStorage().visibleInstances=null,this)}_preActivateForIntermediateRendering(e){const t=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return t.visibleInstances&&(t.visibleInstances.intermediateDefaultRenderId=e),this}_registerInstanceForRenderId(e,t){const i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return i.visibleInstances||(i.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId,intermediateDefaultRenderId:-1}),i.visibleInstances[t]||(i.previousRenderId!==void 0&&(!this._instanceDataStorage.useMonoDataStorageRenderPass||this._instanceDataStorage.
vendor: 5,868 bytes, line 292
292isFrozen)&&delete i.visibleInstances[i.previousRenderId],i.previousRenderId=t,i.visibleInstances[t]=new Array),i.visibleInstances[t].push(e),this}_afterComputeWorldMatrix(){super._afterComputeWorldMatrix(),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))}_postActivate(){this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;typeof e=="object"?i=e:i={applySkeleton:e,applyMorph:t};const s=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getData(i,null,k.PositionKind),s),this}_createGlobalSubMesh(e){const t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){const i=this.getIndices();if(!i)return null;const s=i.length;let n=!1;if(e)n=!0;else for(const o of this.subMeshes){if(o.indexStart+o.indexCount>s){n=!0;break}if(o.verticesStart+o.verticesCount>t){n=!0;break}}if(!n)return this.subMeshes[0]}return this.releaseSubMeshes(),new Xs(0,0,t,0,this.getTotalIndices()||(this.isUnIndexed?t:0),this)}subdivide(e){if(e<1)return;const t=this.getTotalIndices();let i=t/e|0,s=0;for(;i%3!==0;)i++;this.releaseSubMeshes();for(let n=0;n<e&&!(s>=t);n++)Xs.CreateFromIndices(0,s,s+i>=t?t-s:i,this,void 0,!1),s+=i;this.refreshBoundingInfo(),this.synchronizeInstances()}setVerticesData(e,t,i=!1,s){if(this._geometry)this._geometry.setVerticesData(e,t,i,s);else{const n=new Ue;n.set(t,e);const o=this.getScene();new _s(_s.RandomId(),o,n,i,this)}return this}removeVerticesData(e){this._geometry&&this._geometry.removeVerticesData(e)}markVerticesDataAsUpdatable(e,t=!0){const i=this.getVertexBuffer(e);!i||i.isUpdatable()===t||this.setVerticesData(e,this.getVerticesData(e),t)}setVerticesBuffer(e,t=!0,i=null){return this._geometry||(this._geometry=_s.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e,i,t),this}updateVerticesData(e,t,i,s){return this._geometry?(s?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this}updateMeshPositions(e,t=!0){const i=this.getVerticesData(k.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(k.PositionKind,i,!1,!1),t){const s=this.getIndices(),n=this.getVerticesData(k.NormalKind);if(!n)return this;Ue.ComputeNormals(i,s,n),this.updateVerticesData(k.NormalKind,n,!1,!1)}return this}makeGeometryUnique(){if(!this._geometry)return this;if(this._geometry.meshes.length===1)return this;const e=this._geometry,t=this._geometry.copy(_s.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndexBuffer(e,t,i,s=null){let n=this._geometry;n||(n=new _s(_s.RandomId(),this.getScene(),void 0,void 0,this)),n.setIndexBuffer(e,t,i,s)}setIndices(e,t=null,i=!1,s=!1){if(this._geometry)this._geometry.setIndices(e,t,i,s);else{const n=new Ue;n.indices=e;const o=this.getScene();new _s(_s.RandomId(),o,n,i,this,t)}return this}updateIndices(e,t,i=!1){return this._geometry?(this._geometry.updateIndices(e,t,i),this):this}toLeftHanded(){return this._geometry?(this._geometry.toLeftHanded(),this):this}_bind(e,t,i,s=!0){if(!this._geometry)return this;const n=this.getScene().getEngine();let o;if(this._unIndexed)switch(this._getRenderingFillMode(i)){case Ei.WireFrameFillMode:o=e._getLinesIndexBuffer(this.getIndices(),n);break;default:o=null;break}else switch(this._getRenderingFillMode(i)){case Ei.PointFillMode:o=null;break;case Ei.WireFrameFillMode:o=e._getLinesIndexBuffer(this.getIndices(),n);break;default:case Ei.TriangleFillMode:o=this._geometry.getIndexBuffer();break}return this._bindDirect(t,o,s)}_bindDirect(e,t,i=!0){if(!this._geometry)return this;if(this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(e),!i||!this._userInstancedBuffersStorage||this.hasThinInstances)this._geometry._bind(e,t);else{if(!this._instanceDataStorage.useMonoDataStorageRenderPass&&this._userInstancedBuffersStorage.renderPasses&&this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId]){const s=this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];for(const n in s)this._userInstancedBuffersStorage.vertexBuffers[n]=s[n]}this._geometry._bind(e,t,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects)}return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);const n=this.getScene().getEngine(),o=n._currentMaterialContext,c=o&&o.useVertexPulling;return this._unIndexed&&t!==Ei.WireFrameFillMode||t==Ei.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==Ei.WireFrameFillMode?n.drawElementsType(t,0,e._linesIndexCount,this.forcedInstanceCount||i):c?n.drawArraysType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i):n.drawElementsType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i),this}registerBeforeRender(e){return this.onBeforeRenderObservable.add(e),this}unregisterBeforeRender(e){return this.onBeforeRenderObservable.removeCallback(e),this}registerAfterRender(e){return this.onAfterRenderObservable.add(e),this}unregisterAfterRender(e){return this.onAfterRenderObservable.removeCallback(e),this}_getInstancesRenderList(e,t=!1){const i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();
292if(this._instanceDataStorage.isFrozen){if(t)return i.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e]=!1,i.batchCacheReplacementModeInFrozenMode.renderSelf[e]=!0,i.batchCacheReplacementModeInFrozenMode;if(i.previousBatch)return i.previousBatch}const s=this.getScene(),n=s._isInIntermediateRendering(),o=n?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,c=i.batchCache;if(c.mustReturn=!1,c.renderSelf[e]=t||!o&&this.isEnabled()&&this.isVisible,c.visibleInstances[e]=null,i.visibleInstances&&!t){const h=i.visibleInstances,f=s.getRenderId(),_=n?h.intermediateDefaultRenderId:h.defaultRenderId;c.visibleInstances[e]=h[f],!c.visibleInstances[e]&&_&&(c.visibleInstances[e]=h[_])}return c.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&c.visibleInstances[e]!==null&&c.visibleInstances[e]!==void 0,i.previousBatch=c,c}_updateInstancedBuffers(e,t,i,s,n,o){const c=t.visibleInstances[e._id],h=c?c.length:0,f=t.parent,_=this._instanceDataStorage;let m=f.instancesBuffer,g=f.instancesPreviousBuffer,x=0,y=0;const b=t.renderSelf[e._id],v=this._scene.floatingOriginOffset,E=!m||i!==f.instancesBufferSize||this._scene.needsPreviousWorldMatrices&&!f.instancesPreviousBuffer;if(!this._instanceDataStorage.manualUpdate&&(!_.isFrozen||E)){const R=this.getWorldMatrix();if(b){this._scene.needsPreviousWorldMatrices&&(_.masterMeshPreviousWorldMatrix?(_.masterMeshPreviousWorldMatrix.copyToArray(f.instancesPreviousData,x),_.masterMeshPreviousWorldMatrix.copyFrom(R)):(_.masterMeshPreviousWorldMatrix=R.clone(),_.masterMeshPreviousWorldMatrix.copyToArray(f.instancesPreviousData,x))),R.copyToArray(f.instancesData,x);const C=R.asArray();f.instancesData[x+12]=C[12]-v.x,f.instancesData[x+13]=C[13]-v.y,f.instancesData[x+14]=C[14]-v.z,x+=16,y++}if(c){if($.INSTANCEDMESH_SORT_TRANSPARENT&&this._scene.activeCamera&&e.getMaterial()?.needAlphaBlendingForMesh(e.getRenderingMesh())){const C=this._scene.activeCamera.globalPosition;for(let O=0;O<c.length;O++){const M=c[O];M._distanceToCamera=D.Distance(M.getBoundingInfo().boundingSphere.centerWorld,C)}c.sort((O,M)=>O._distanceToCamera>M._distanceToCamera?-1:O._distanceToCamera<M._distanceToCamera?1:0)}for(let C=0;C<c.length;C++){const O=c[C],M=O.getWorldMatrix();M.copyToArray(f.instancesData,x),this._scene.needsPreviousWorldMatrices&&(O._previousWorldMatrix?(O._previousWorldMatrix.copyToArray(f.instancesPreviousData,x),O._previousWorldMatrix.copyFrom(M)):(O._previousWorldMatrix=M.clone(),O._previousWorldMatrix.copyToArray(f.instancesPreviousData,x)));const I=M.asArray();f.instancesData[x+12]=I[12]-v.x,f.instancesData[x+13]=I[13]-v.y,f.instancesData[x+14]=I[14]-v.z,x+=16,y++}}}else y=(b?1:0)+h;if(E){m&&m.dispose(),g&&g.dispose(),m=new bf(s,f.instancesData,!0,16,!1,!0),f.instancesBuffer=m,this._userInstancedBuffersStorage||(this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{},vertexArrayObjects:this.getEngine().getCaps().vertexArrayObject?{}:void 0});let R;if(this._instanceDataStorage.useMonoDataStorageRenderPass)R=this._userInstancedBuffersStorage.vertexBuffers;else{this._userInstancedBuffersStorage.renderPasses||(this._userInstancedBuffersStorage.renderPasses={});const C=this._instanceDataStorage.engine.currentRenderPassId;R=this._userInstancedBuffersStorage.renderPasses[C],R||(this._userInstancedBuffersStorage.renderPasses[C]=R={})}R.world0=m.createVertexBuffer("world0",0,4),R.world1=m.createVertexBuffer("world1",4,4),R.world2=m.createVertexBuffer("world2",8,4),R.world3=m.createVertexBuffer("world3",12,4),this._scene.needsPreviousWorldMatrices&&(g=new bf(s,f.instancesPreviousData,!0,16,!1,!0),f.instancesPreviousBuffer=g,R.previousWorld0=g.createVertexBuffer("previousWorld0",0,4),R.previousWorld1=g.createVertexBuffer("previousWorld1",4,4),R.previousWorld2=g.createVertexBuffer("previousWorld2",8,4),R.previousWorld3=g.createVertexBuffer("previousWorld3",12,4)),this._invalidateInstanceVertexArrayObject()}else(!this._instanceDataStorage.isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&(m.updateDirectly(f.instancesData,0,y),this._scene.needsPreviousWorldMatrices&&(!this._instanceDataStorage.manualUpdate||this._instanceDataStorage.previousManualUpdate)&&g.updateDirectly(f.instancesPreviousData,0,y));this._processInstancedBuffers(c,b),o&&n!==void 0&&(this.getScene()._activeIndices.addCount(e.indexCount*y,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,o,n),this._draw(e,n,y)),this._scene.needsPreviousWorldMatrices&&!E&&this._instanceDataStorage.manualUpdate&&(!this._instanceDataStorage.
vendor: 4,252 bytes, line 292
292isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&!this._instanceDataStorage.previousManualUpdate&&g.updateDirectly(f.instancesData,0,y)}_renderWithInstances(e,t,i,s,n){const o=i.visibleInstances[e._id],c=o?o.length:0,h=i.parent,f=h.instancesBufferSize,m=(c+1)*16*4;for(;h.instancesBufferSize<m;)h.instancesBufferSize*=2;return(!h.instancesData||f!=h.instancesBufferSize)&&(h.instancesData=new Float32Array(h.instancesBufferSize/4)),(this._scene.needsPreviousWorldMatrices&&!h.instancesPreviousData||f!=h.instancesBufferSize)&&(h.instancesPreviousData=new Float32Array(h.instancesBufferSize/4)),this._updateInstancedBuffers(e,i,f,n,t,s),n.unbindInstanceAttributes(),this}_renderWithThinInstances(e,t,i,s){const n=this._thinInstanceDataStorage?.instancesCount??0;this.getScene()._activeIndices.addCount(e.indexCount*n,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,i,t),this._draw(e,t,n),this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&this._thinInstanceDataStorage.matrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData,0,n):this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.matrixData,!1)),s.unbindInstanceAttributes()}_processInstancedBuffers(e,t){}_processRendering(e,t,i,s,n,o,c,h){const f=this.getScene(),_=f.getEngine();if(s=this._getRenderingFillMode(s),o&&t.getRenderingMesh().hasThinInstances)return this._renderWithThinInstances(t,s,i,_),this;if(o)this._renderWithInstances(t,s,n,i,_);else{_._currentDrawContext&&(_._currentDrawContext.useInstancing=!1);let m=0;n.renderSelf[t._id]&&(c&&c(!1,e.getWorldMatrix(),h),m++,this._draw(t,s,this._instanceDataStorage.overridenInstanceCount));const g=n.visibleInstances[t._id];if(g){const x=g.length;m+=x;for(let y=0;y<x;y++){const v=g[y].getWorldMatrix();c&&c(!0,v,h),this._draw(t,s)}}f._activeIndices.addCount(t.indexCount*m,!1)}return this}_disposeInstanceDataStorageRenderPass(e,t=!1){e?.instancesBuffer&&(t&&e.instancesBuffer.dispose(),e.instancesBuffer=null),e?.instancesPreviousBuffer&&(t&&e.instancesPreviousBuffer.dispose(),e.instancesPreviousBuffer=null)}_rebuild(e=!1){for(const t in this._instanceDataStorage.renderPasses){const i=this._instanceDataStorage.renderPasses[t];this._disposeInstanceDataStorageRenderPass(i,e)}if(this._disposeInstanceDataStorageRenderPass(this._instanceDataStorage.dataStorageRenderPass,e),this._userInstancedBuffersStorage){for(const t in this._userInstancedBuffersStorage.vertexBuffers){const i=this._userInstancedBuffersStorage.vertexBuffers[t];i&&(e&&i.dispose(),this._userInstancedBuffersStorage.vertexBuffers[t]=null)}this._userInstancedBuffersStorage.vertexArrayObjects&&(this._userInstancedBuffersStorage.vertexArrayObjects={})}this._internalMeshDataInfo._effectiveMaterial=null,super._rebuild(e)}_releaseRenderPassId(e){const t=this._instanceDataStorage.renderPasses[e];if(t&&(this._disposeInstanceDataStorageRenderPass(t,!0),delete this._instanceDataStorage.renderPasses[e]),this._userInstancedBuffersStorage?.renderPasses){const i=this._userInstancedBuffersStorage.renderPasses[e];if(i)for(const s in i)i[s]?.dispose();delete this._userInstancedBuffersStorage.renderPasses[e]}}_freeze(){if(this.subMeshes){for(let e=0;e<this.subMeshes.length;e++)this._getInstancesRenderList(e);this._internalMeshDataInfo._effectiveMaterial=null,this._instanceDataStorage.isFrozen=!0}}_unFreeze(){this._instanceDataStorage.isFrozen=!1;for(const e in this._instanceDataStorage.renderPasses){const t=this._instanceDataStorage.renderPasses[e];t.previousBatch=null}this._instanceDataStorage.dataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass.previousBatch=null)}renderWithRenderPassId(e,t,i,s,n=!0){const o=this._scene.getEngine(),c=o.currentRenderPassId;if(e!==void 0&&(o.currentRenderPassId=e),s)(!n||n&&s.isInFrustum(this._scene._frustumPlanes))&&this.render(s,!!t,i);else for(let h=0;h<this.subMeshes.length;h++){const f=this.subMeshes[h];(!n||n&&f.isInFrustum(this._scene._frustumPlanes))&&this.render(f,!!t,i)}return e!==void 0&&(o.currentRenderPassId=c),this}
vendor: 30,459 bytes, lines 292-299
292directRender(){if(!this.subMeshes)return this;for(const e of this.subMeshes)this.render(e,!1);return this}render(e,t,i){const s=this.getScene(),n=s.getEngine();this._internalAbstractMeshDataInfo._isActiveIntermediate?this._internalAbstractMeshDataInfo._isActiveIntermediate=!1:this._internalAbstractMeshDataInfo._isActive=!1;const o=s.activeCameras?.length??0,c=o>1&&s.activeCamera===s.activeCameras[0]||o<=1,h=this._occlusionDataStorage&&this._occlusionDataStorage.occlusionForRenderPassId!==-1&&this._occlusionDataStorage.occlusionForRenderPassId!==n.currentRenderPassId;if(c&&this._checkOcclusionQuery(h)&&!this._occlusionDataStorage.forceRenderingWhenOccluded)return this;const f=this._getInstancesRenderList(e._id,!!i);if(f.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;let _=0,m=null;this.ignoreCameraMaxZ&&s.activeCamera&&!s._isInIntermediateRendering()&&(_=s.activeCamera.maxZ,m=s.activeCamera,s.activeCamera.maxZ=0,s.updateTransformMatrix(!0)),this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);const g=e.getRenderingMesh(),x=f.hardwareInstancedRendering[e._id]||g.hasThinInstances||!!this._userInstancedBuffersStorage&&!e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,y=this._instanceDataStorage,b=e.getMaterial();if(!b)return m&&(m.maxZ=_,s.updateTransformMatrix(!0)),this;if(!y.isFrozen||!this._internalMeshDataInfo._effectiveMaterial||this._internalMeshDataInfo._effectiveMaterial!==b){if(b._storeEffectOnSubMeshes){if(!b.isReadyForSubMesh(this,e,x))return m&&(m.maxZ=_,s.updateTransformMatrix(!0)),this}else if(!b.isReady(this,x))return m&&(m.maxZ=_,s.updateTransformMatrix(!0)),this;this._internalMeshDataInfo._effectiveMaterial=b}else if(b._storeEffectOnSubMeshes&&!e._drawWrapper?._wasPreviouslyReady||!b._storeEffectOnSubMeshes&&!b._getDrawWrapper()._wasPreviouslyReady)return m&&(m.maxZ=_,s.updateTransformMatrix(!0)),this;if(t){const L=this._internalMeshDataInfo._effectiveMaterial;if(L.alphaModes.length===1)n.setAlphaMode(L.alphaMode);else for(let V=0;V<L.alphaModes.length;V++){const X=L.alphaModes[V];n.setAlphaMode(X!==void 0?X:2,!1,V)}}let v;this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes?v=e._drawWrapper:v=this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();const E=v?.effect??null;for(const L of s._beforeRenderingMeshStage)L.action(this,e,f,E);if(!v||!E)return m&&(m.maxZ=_,s.updateTransformMatrix(!0)),this;const R=i||this;let C;if(!y.isFrozen&&(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling||this._internalMeshDataInfo._effectiveMaterial.sideOrientation!==null||this._internalMeshDataInfo._effectiveMaterial._twoSidedLighting)){const L=R._getWorldMatrixDeterminant();C=this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this),L<0&&(C=C===Ei.ClockWiseSideOrientation?Ei.CounterClockWiseSideOrientation:Ei.ClockWiseSideOrientation),this._internalMeshDataInfo._effectiveSideOrientation=C}const O=this._internalMeshDataInfo._effectiveMaterial._preBind(v,this._internalMeshDataInfo._effectiveSideOrientation);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite&&n.setDepthWrite(!0);const M=this._internalMeshDataInfo._effectiveMaterial,I=M.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),x||this._bind(e,E,I,!1);const P=R.getWorldMatrix();M._storeEffectOnSubMeshes?M.bindForSubMesh(P,this,e):M.bind(P,this),!M.backFaceCulling&&M.separateCullingPass&&(n.setState(!0,M.zOffset,!1,!O,M.cullBackFaces,M.stencil,M.zOffsetUnits),this._processRendering(this,e,E,I,f,x,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),n.setState(!0,M.zOffset,!1,O,M.cullBackFaces,M.stencil,M.zOffsetUnits),this._internalMeshDataInfo._onBetweenPassObservable&&this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)),this._processRendering(this,e,E,I,f,x,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),this._internalMeshDataInfo._effectiveMaterial.unbind();for(const L of s._afterRenderingMeshStage)L.action(this,e,f,E);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),m&&(m.maxZ=_,s.updateTransformMatrix(!0)),s.performancePriority===2&&!y.isFrozen&&this._freeze(),this}cleanMatrixWeights(){this.isVerticesDataPresent(k.MatricesWeightsKind)&&(this.isVerticesDataPresent(k.MatricesWeightsExtraKind)?this._normalizeSkinWeightsAndExtra():this._normalizeSkinFourWeights())}_normalizeSkinFourWeights(){const e=this.getVerticesData(k.MatricesWeightsKind),t=e.length;for(let i=0;i<t;i+=4){const s=e[i]+e[i+1]+e[i+2]+e[i+3];if(s===0)e[i]=1;else{const n=1/s;e[i]*=n,e[i+1]*=n,e[i+2]*=n,e[i+3]*=n}}this.setVerticesData(k.MatricesWeightsKind,e)}_normalizeSkinWeightsAndExtra(){const e=this.getVerticesData(k.MatricesWeightsExtraKind),t=this.getVerticesData(k.MatricesWeightsKind),i=t.length;for(let s=0;s<i;s+=4){let n=t[s]+t[s+1]+t[s+2]+t[s+3];if(n+=e[s]+e[s+1]+e[s+2]+e[s+3],n===0)t[s]=1;else{const o=1/n;t[s]*=o,t[s+1]*=o,t[s+2]*=o,t[s+3]*=o,e[s]*=o,e[s+1]*=o,e[s+2]*=o,e[s+3]*=o}}this.setVerticesData(k.MatricesWeightsKind,t),this.setVerticesData(k.MatricesWeightsKind,e)}validateSkinning(){const e=this.getVerticesData(k.MatricesWeightsExtraKind),t=this.getVerticesData(k.MatricesWeightsKind);if(t===null||this.skeleton==null)return{skinned:!1,valid:!0,report:"not skinned"};const i=t.length;let s=0,n=0,o=0,c=0;const h=e===null?4:8,f=[];for(let v=0;v<=h;v++)f[v]=0;const _=.001;for(let v=0;v<i;v+=4){let E=t[v],R=E,C=R===0?0:1;for(let O=1;O<h;O++){const M=O<4?t[v+O]:e[v+O-4];M>E&&s++,M!==0&&C++,R+=M,E=M}if(f[C]++,C>o&&(o=C),R===0)n++;else{const O=1/R;let M=0;for(let I=0;I<h;I++)I<4?M+=Math.abs(t[v+I]-t[v+I]*O):M+=Math.abs(e[v+I-4]-e[v+I-4]*O);M>_&&c++}}const m=this.skeleton.bones.length,g=this.getVerticesData(k.MatricesIndicesKind),x=this.getVerticesData(k.MatricesIndicesExtraKind);let y=0;for(let v=0;v<i;v+=4)for(let E=0;E<h;E++){const R=E<4?g[v+E]:x[v+E-4];(R>=m||R<0)&&y++}const b="Number of Weights = "+i/4+`
293Maximum influences = `+o+`
294Missing Weights = `+n+`
295Not Sorted = `+s+`
296Not Normalized = `+c+`
297WeightCounts = [`+f+`]
298Number of bones = `+m+`
299Bad Bone Indices = `+y;return{skinned:!0,valid:n===0&&c===0&&y===0,report:b}}_checkDelayState(){const e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===4&&(this.delayLoadState=2,this._queueLoad(e)),this}_queueLoad(e){e.addPendingData(this);const t=this.delayLoadingFile.indexOf(".babylonbinarymeshdata")!==-1;return(async()=>{try{const i=await e._loadDelayedFileAsync(this.delayLoadingFile,t,!0);i instanceof ArrayBuffer?this._delayLoadingFunction(i,this):this._delayLoadingFunction(JSON.parse(i),this);for(const s of this.instances)s.refreshBoundingInfo(),s._syncSubMeshes();this.delayLoadState=1,e.removePendingData(this)}catch(i){e.removePendingData(this),e.isDisposed||pe.Error(`Unable to delay load geometry data for mesh "${this.name}" from "${this.delayLoadingFile}": ${i}`)}})(),this}isInFrustum(e){return this.delayLoadState===2||!super.isInFrustum(e)?!1:(this._checkDelayState(),!0)}setMaterialById(e){const t=this.getScene().materials;let i;for(i=t.length-1;i>-1;i--)if(t[i].id===e)return this.material=t[i],this;const s=this.getScene().multiMaterials;for(i=s.length-1;i>-1;i--)if(s[i].id===e)return this.material=s[i],this;return this}getAnimatables(){const e=[];return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){if(!this.isVerticesDataPresent(k.PositionKind))return this;const t=this.subMeshes.splice(0);this._resetPointsArrayCache();let i=this.getVerticesData(k.PositionKind);const s=D.Zero();let n;for(n=0;n<i.length;n+=3)D.TransformCoordinatesFromFloatsToRef(i[n],i[n+1],i[n+2],e,s).toArray(i,n);if(this.setVerticesData(k.PositionKind,i,this.getVertexBuffer(k.PositionKind).isUpdatable()),this.isVerticesDataPresent(k.NormalKind)){for(i=this.getVerticesData(k.NormalKind),n=0;n<i.length;n+=3)D.TransformNormalFromFloatsToRef(i[n],i[n+1],i[n+2],e,s).normalize().toArray(i,n);this.setVerticesData(k.NormalKind,i,this.getVertexBuffer(k.NormalKind).isUpdatable())}if(this.isVerticesDataPresent(k.TangentKind)){for(i=this.getVerticesData(k.TangentKind),n=0;n<i.length;n+=4)D.TransformNormalFromFloatsToRef(i[n],i[n+1],i[n+2],e,s).normalize().toArray(i,n);this.setVerticesData(k.TangentKind,i,this.getVertexBuffer(k.TangentKind).isUpdatable())}return e.determinant()<0&&this.flipFaces(),this.releaseSubMeshes(),this.subMeshes=t,this}bakeCurrentTransformIntoVertices(e=!0,t=!1){return t&&this.makeGeometryUnique(),this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.resetLocalMatrix(e),this}get _positions(){return this._internalAbstractMeshDataInfo._positions||this._geometry&&this._geometry._positions||null}_resetPointsArrayCache(){return this._geometry&&this._geometry._resetPointsArrayCache(),this}_generatePointsArray(){return this._geometry?this._geometry._generatePointsArray():!1}clone(e="",t=null,i,s=!0){if(t&&t._addToSceneRootNodes===void 0){const n=t;return Dr.source=this,Dr.doNotCloneChildren=n.doNotCloneChildren,Dr.clonePhysicsImpostor=n.clonePhysicsImpostor,Dr.cloneThinInstances=n.cloneThinInstances,new $(e,this.getScene(),Dr)}return new $(e,this.getScene(),t,this,i,s)}dispose(e,t=!1){this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0);const i=this._internalMeshDataInfo;if(i._onBeforeDrawObservable&&i._onBeforeDrawObservable.clear(),i._onBeforeBindObservable&&i._onBeforeBindObservable.clear(),i._onBeforeRenderObservable&&i._onBeforeRenderObservable.clear(),i._onAfterRenderObservable&&i._onAfterRenderObservable.clear(),i._onBetweenPassObservable&&i._onBetweenPassObservable.clear(),this._scene.useClonedMeshMap){if(i.meshMap)for(const s in i.meshMap){const n=i.meshMap[s];n&&(n._internalMeshDataInfo._source=null,i.meshMap[s]=void 0)}i._source&&i._source._internalMeshDataInfo.meshMap&&(i._source._internalMeshDataInfo.meshMap[this.uniqueId]=void 0)}else{const s=this.getScene().meshes;for(const n of s){const o=n;o._internalMeshDataInfo&&o._internalMeshDataInfo._source&&o._internalMeshDataInfo._source===this&&(o._internalMeshDataInfo._source=null)}}i._source=null,this._disposeInstanceSpecificData(),this._disposeThinInstanceSpecificData(),this._internalMeshDataInfo._checkReadinessObserver&&this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),super.dispose(e,t)}_disposeInstanceSpecificData(){}_disposeThinInstanceSpecificData(){}_invalidateInstanceVertexArrayObject(){}applyDisplacementMap(e,t,i,s,n,o,c=!1,h){const f=this.getScene();return gf(e,m=>{const g=m.width,x=m.height,b=this.getEngine().createCanvas(g,x).getContext("2d");b.drawImage(m,0,0);const v=b.getImageData(0,0,g,x).data;this.applyDisplacementMapFromBuffer(v,g,x,t,i,n,o,c),s&&s(this)},h||(()=>{}),f.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,s,n,o,c,h=!1){if(!this.isVerticesDataPresent(k.PositionKind)||!this.isVerticesDataPresent(k.NormalKind)||!this.isVerticesDataPresent(k.UVKind))return pe.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;const f=this.getVerticesData(k.PositionKind,!0,!0),_=this.getVerticesData(k.NormalKind),m=this.getVerticesData(k.UVKind);let g=D.Zero();const x=D.Zero(),y=Fe.Zero();o=o||Fe.Zero(),c=c||new Fe(1,1);for(let b=0;b<f.length;b+=3){D.FromArrayToRef(f,b,g),D.FromArrayToRef(_,b,x),Fe.FromArrayToRef(m,b/3*2,y);const v=Math.abs(y.x*c.x+o.x%1)*(t-1)%t|0,E=Math.abs(y.y*c.y+o.y%1)*(i-1)%i|0,R=(v+E*t)*4,C=e[R]/255,O=e[R+1]/255,M=e[R+2]/255,I=C*.3+O*.59+M*.11;x.normalize(),x.scaleInPlace(s+(n-s)*I),g=g.add(x),g.toArray(f,b)}return Ue.ComputeNormals(f,this.getIndices(),_),h?(this.setVerticesData(k.PositionKind,f),this.setVerticesData(k.NormalKind,_),this.setVerticesData(k.UVKind,m)):(this.updateVerticesData(k.PositionKind,f),this.updateVerticesData(k.NormalKind,_)),this}_getFlattenedNormals(e,t){const i=new Float32Array(e.length*3);let s=0;const n=this.sideOrientation===(this._scene.useRightHandedSystem?1:0);for(let o=0;o<e.length;o+=3){const c=D.FromArray(t,e[o]*3),h=D.FromArray(t,e[o+1]*3),f=D.FromArray(t,e[o+2]*3),_=c.subtract(h),m=f.subtract(h),g=D.Normalize(D.Cross(_,m));n&&g.scaleInPlace(-1);for(let x=0;x<3;x++)i[s++]=g.x,i[s++]=g.y,i[s++]=g.z}return i}_convertToUnIndexedMesh(e=!1){const t=this.getVerticesDataKinds().filter(h=>!this.getVertexBuffer(h)?.getIsInstanced()),i=this.getIndices(!1,!0),s={},n=(h,f)=>{const _=new Float32Array(i.length*f);let m=0;for(let g=0;g<i.length;g++)for(let x=0;x<f;x++)_[m++]=h[i[g]*f+x];return _},o=this.getBoundingInfo(),c=this.geometry?this.subMeshes.slice(0):[];for(const h of t)s[h]=this.getVerticesData(h);for(const h of t){const f=this.getVertexBuffer(h),_=f.getSize();if(e&&h===k.NormalKind){const m=this._getFlattenedNormals(i,s[k.PositionKind]);this.setVerticesData(k.NormalKind,m,f.isUpdatable(),_)}else this.setVerticesData(h,n(s[h],_),f.isUpdatable(),_)}if(this.morphTargetManager){for(let h=0;h<this.morphTargetManager.numTargets;h++){const f=this.morphTargetManager.getTarget(h),_=f.getPositions();f.setPositions(n(_,3));const m=f.getNormals();m&&f.setNormals(e?this._getFlattenedNormals(i,_):n(m,3));const g=f.getTangents();g&&f.setTangents(n(g,3));const x=f.getUVs();x&&f.setUVs(n(x,2));const y=f.getColors();y&&f.setColors(n(y,4))}this.morphTargetManager.synchronize()}for(let h=0;h<i.length;h++)i[h]=h;this.setIndices(i),this._unIndexed=!0,this.releaseSubMeshes();for(const h of c){const f=h.getBoundingInfo();Xs.AddToMesh(h.materialIndex,h.indexStart,h.indexCount,h.indexStart,h.indexCount,this).setBoundingInfo(f)}return this.setBoundingInfo(o),this.synchronizeInstances(),this}convertToFlatShadedMesh(){return this._convertToUnIndexedMesh(!0)}convertToUnIndexedMesh(){return this._convertToUnIndexedMesh()}flipFaces(e=!1){const t=Ue.ExtractFromMesh(this);let i;if(e&&this.isVerticesDataPresent(k.NormalKind)&&t.normals){for(i=0;i<t.normals.length;i++)t.normals[i]*=-1;this.setVerticesData(k.NormalKind,t.normals,this.isVertexBufferUpdatable(k.NormalKind))}if(t.indices){let s;for(i=0;i<t.indices.length;i+=3)s=t.indices[i+1],t.indices[i+1]=t.indices[i+2],t.indices[i+2]=s;this.setIndices(t.indices,null,this.isVertexBufferUpdatable(k.PositionKind),!0)}return this}increaseVertices(e=1){const t=Ue.ExtractFromMesh(this),i=t.indices&&!Array.isArray(t.indices)&&Array.from?Array.from(t.indices):t.indices,s=t.positions&&!Array.isArray(t.positions)&&Array.from?Array.from(t.positions):t.positions,n=t.uvs&&!Array.isArray(t.uvs)&&Array.from?Array.from(t.uvs):t.uvs,o=t.normals&&!Array.isArray(t.normals)&&Array.from?Array.from(t.normals):t.normals;if(!i||!s)pe.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions");else{t.indices=i,t.positions=s,n&&(t.uvs=n),o&&(t.normals=o);const c=e+1,h=[];for(let M=0;M<c+1;M++)h[M]=[];let f,_;const m=new D(0,0,0),g=new D(0,0,0),x=new Fe(0,0),y=[],b=[],v=[];let E,R=s.length,C;n&&(C=n.length);let O;o&&(O=o.length);for(let M=0;M<i.length;M+=3){b[0]=i[M],b[1]=i[M+1],b[2]=i[M+2];for(let I=0;I<3;I++)if(f=b[I],_=b[(I+1)%3],v[f]===void 0&&v[_]===void 0?(v[f]=[],v[_]=[]):(v[f]===void 0&&(v[f]=[]),v[_]===void 0&&(v[_]=[])),v[f][_]===void 0&&v[_][f]===void 0){v[f][_]=[],m.x=(s[3*_]-s[3*f])/c,m.y=(s[3*_+1]-s[3*f+1])/c,m.z=(s[3*_+2]-s[3*f+2])/c,o&&(g.x=(o[3*_]-o[3*f])/c,g.y=(o[3*_+1]-o[3*f+1])/c,g.z=(o[3*_+2]-o[3*f+2])/c),n&&(x.x=(n[2*_]-n[2*f])/c,x.y=(n[2*_+1]-n[2*f+1])/c),v[f][_].push(f);for(let P=1;P<c;P++)v[f][_].push(s.length/3),s[R++]=s[3*f]+P*m.x,s[R++]=s[3*f+1]+P*m.y,s[R++]=s[3*f+2]+P*m.z,o&&(o[O++]=o[3*f]+P*g.x,o[O++]=o[3*f+1]+P*g.y,o[O++]=o[3*f+2]+P*g.z),n&&(n[C++]=n[2*f]+P*x.x,n[C++]=n[2*f+1]+P*x.y);v[f][_].push(_),v[_][f]=[],E=v[f][_].length;for(let P=0;P<E;P++)v[_][f][P]=v[f][_][E-1-P]}h[0][0]=i[M],h[1][0]=v[i[M]][i[M+1]][1],h[1][1]=v[i[M]][i[M+2]][1];for(let I=2;I<c;I++){h[I][0]=v[i[M]][i[M+1]][I],h[I][I]=v[i[M]][i[M+2]][I],m.x=(s[3*h[I][I]]-s[3*h[I][0]])/I,m.y=(s[3*h[I][I]+1]-s[3*h[I][0]+1])/I,m.z=(s[3*h[I][I]+2]-s[3*h[I][0]+2])/I,o&&(g.x=(o[3*h[I][I]]-o[3*h[I][0]])/I,g.y=(o[3*h[I][I]+1]-o[3*h[I][0]+1])/I,g.z=(o[3*h[I][I]+2]-o[3*h[I][0]+2])/I),n&&(x.x=(n[2*h[I][I]]-n[2*h[I][0]])/I,x.y=(n[2*h[I][I]+1]-n[2*h[I][0]+1])/I);for(let P=1;P<I;P++)h[I][P]=s.length/3,s[R++]=s[3*h[I][0]]+P*m.x,s[R++]=s[3*h[I][0]+1]+P*m.y,s[R++]=s[3*h[I][0]+2]+P*m.z,o&&(o[O++]=o[3*h[I][0]]+P*g.x,o[O++]=o[3*h[I][0]+1]+P*g.y,o[O++]=o[3*h[I][0]+2]+P*g.z),n&&(n[C++]=n[2*h[I][0]]+P*x.x,n[C++]=n[2*h[I][0]+1]+P*x.y)}h[c]=v[i[M+1]][i[M+2]],y.push(h[0][0],h[1][0],h[1][1]);for(let I=1;I<c;I++){let P;for(P=0;P<I;P++)y.push(h[I][P],h[I+1][P],h[I+1][P+1]),y.push(h[I][P],h[I+1][P+1],h[I][P+1]);y.push(h[I][P],h[I+1][P],h[I+1][P+1])}}t.indices=y,t.applyToMesh(this,this.isVertexBufferUpdatable(k.PositionKind))}}forceSharedVertices(){const e=Ue.ExtractFromMesh(this),t=e.uvs,i=e.indices,s=e.positions,n=e.colors,o=e.matricesIndices,c=e.matricesWeights,h=e.matricesIndicesExtra,f=e.matricesWeightsExtra;if(i===void 0||s===void 0||i===null||s===null)pe.Warn("VertexData contains empty entries");else{const _=[],m=[],g=[],x=[],y=[],b=[],v=[],E=[];let R,C=0;const O={};let M,I;for(let L=0;L<i.length;L+=3){I=[i[L],i[L+1],i[L+2]],R=[];for(let V=0;V<3;V++){R[V]="";for(let X=0;X<3;X++)Math.abs(s[3*I[V]+X])<1e-8&&(s[3*I[V]+X]=0),R[V]+=s[3*I[V]+X]+"|"}if(!(R[0]==R[1]||R[0]==R[2]||R[1]==R[2]))for(let V=0;V<3;V++){if(M=O[R[V]],M===void 0){O[R[V]]=C,M=C++;for(let X=0;X<3;X++)_.push(s[3*I[V]+X]);if(n!=null)for(let X=0;X<4;X++)x.push(n[4*I[V]+X]);if(t!=null)for(let X=0;X<2;X++)g.push(t[2*I[V]+X]);if(o!=null)for(let X=0;X<4;X++)y.push(o[4*I[V]+X]);if(c!=null)for(let X=0;X<4;X++)b.push(c[4*I[V]+X]);if(h!=null)for(let X=0;X<4;X++)v.push(h[4*I[V]+X]);if(f!=null)for(let X=0;X<4;X++)E.push(f[4*I[V]+X])}m.push(M)}}const P=[];Ue.ComputeNormals(_,m,P),e.positions=_,e.indices=m,e.normals=P,t!=null&&(e.uvs=g),n!=null&&(e.colors=x),o!=null&&(e.matricesIndices=y),c!=null&&(e.matricesWeights=b),h!=null&&(e.matricesIndicesExtra=v),c!=null&&(e.matricesWeightsExtra=E),e.applyToMesh(this,this.isVertexBufferUpdatable(k.PositionKind))}}static _instancedMeshFactory(e,t){throw Je("InstancedMesh")}static _PhysicsImpostorParser(e,t,i){throw Je("PhysicsImpostor")}createInstance(e){const t=$._instancedMeshFactory(e,this);return t.parent=this.parent,t}synchronizeInstances(){for(let e=0;e<this.instances.length;e++)this.instances[e]._syncSubMeshes();return this}optimizeIndices(e){const t=this.getIndices(),i=this.getVerticesData(k.PositionKind);if(!i||!t)return this;const s=[];for(let o=0;o<i.length;o=o+3)s.push(D.FromArray(i,o));const n=[];return xf.SyncAsyncForLoop(s.length,40,o=>{const c=s.length-1-o,h=s[c];for(let f=0;f<c;++f){const _=s[f];if(h.equals(_)){n[c]=f;break}}},()=>{for(let c=0;c<t.length;++c)t[c]=n[t[c]]||t[c];const o=this.subMeshes.slice(0);this.setIndices(t),this.subMeshes=o,e&&e(this)}),this}serialize(e={}){e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,e.type=this.getClassName(),Rt&&Rt.HasTags(this)&&(e.tags=Rt.GetTags(this)),e.position=this.position.asArray(),this.rotationQuaternion?e.rotationQuaternion=this.rotationQuaternion.asArray():this.rotation&&(e.rotation=this.rotation.asArray()),e.scaling=this.scaling.asArray(),this._postMultiplyPivotMatrix?e.pivotMatrix=this.getPivotMatrix().asArray():e.localMatrix=this.getPivotMatrix().asArray(),e.isEnabled=this.isEnabled(!1),e.isVisible=this.isVisible,e.infiniteDistance=this.infiniteDistance,e.pickable=this.isPickable,e.receiveShadows=this.receiveShadows,e.billboardMode=this.billboardMode,e.visibility=this.visibility,e.alwaysSelectAsActiveMesh=this.alwaysSelectAsActiveMesh,e.checkCollisions=this.checkCollisions,e.ellipsoid=this.ellipsoid.asArray(),e.ellipsoidOffset=this.ellipsoidOffset.asArray(),e.doNotSyncBoundingInfo=this.doNotSyncBoundingInfo,e.isBlocker=this.isBlocker,e.sideOrientation=this.sideOrientation,this._isWorldMatrixFrozen&&(e.freezeWorldMatrix=!0),this.parent&&this.parent._serializeAsParent(e),e.isUnIndexed=this.isUnIndexed;const t=this._geometry;if(t&&this.subMeshes){e.geometryUniqueId=t.uniqueId,e.geometryId=t.id,e.subMeshes=[];for(let i=0;i<this.subMeshes.length;i++){const s=this.subMeshes[i];e.subMeshes.push({materialIndex:s.materialIndex,verticesStart:s.verticesStart,verticesCount:s.verticesCount,indexStart:s.indexStart,indexCount:s.indexCount})}}if(this.material?this.material.doNotSerialize||(e.materialUniqueId=this.material.uniqueId,e.materialId=this.material.id):(this.material=null,e.materialUniqueId=this._scene.defaultMaterial.uniqueId,e.materialId=this._scene.defaultMaterial.id),this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id,e.skeletonUniqueId=this.skeleton.uniqueId,e.numBoneInfluencers=this.numBoneInfluencers),this.getScene()._getComponent(et.NAME_PHYSICSENGINE)){const i=this.getPhysicsImpostor?.();i&&(e.physicsMass=i.getParam("mass"),e.physicsFriction=i.getParam("friction"),e.physicsRestitution=i.getParam("mass"),e.physicsImpostor=i.type)}this.metadata&&(e.metadata=this.metadata),e.instances=[];for(let i=0;i<this.instances.length;i++){const s=this.instances[i];if(s.doNotSerialize)continue;const n={name:s.name,id:s.id,isEnabled:s.isEnabled(!1),isVisible:s.isVisible,isPickable:s.isPickable,checkCollisions:s.checkCollisions,position:s.position.asArray(),scaling:s.scaling.asArray()};if(s.parent&&s.parent._serializeAsParent(n),s.rotationQuaternion?n.rotationQuaternion=s.rotationQuaternion.asArray():s.rotation&&(n.rotation=s.rotation.asArray()),this.getScene()._getComponent(et.NAME_PHYSICSENGINE)){const o=s.getPhysicsImpostor?.();o&&(n.physicsMass=o.getParam("mass"),n.physicsFriction=o.getParam("friction"),n.physicsRestitution=o.getParam("mass"),n.physicsImpostor=o.type)}s.metadata&&(n.metadata=s.metadata),s.actionManager&&(n.actions=s.actionManager.serialize(s.name)),e.instances.push(n),xt.AppendSerializedAnimations(s,n),n.ranges=s.serializeAnimationRanges()}if(this._thinInstanceDataStorage.instancesCount&&this._thinInstanceDataStorage.matrixData&&(e.thinInstances={instancesCount:this._thinInstanceDataStorage.instancesCount,matrixData:Array.from(this._thinInstanceDataStorage.matrixData),matrixBufferSize:this._thinInstanceDataStorage.matrixBufferSize,enablePicking:this.thinInstanceEnablePicking},this._userThinInstanceBuffersStorage)){const i={data:{},sizes:{},strides:{}};for(const s in this._userThinInstanceBuffersStorage.data)i.data[s]=Array.from(this._userThinInstanceBuffersStorage.data[s]),i.sizes[s]=this._userThinInstanceBuffersStorage.sizes[s],i.strides[s]=this._userThinInstanceBuffersStorage.strides[s];e.thinInstances.userThinInstance=i}return xt.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.layerMask=this.layerMask,e.alphaIndex=this.alphaIndex,e.hasVertexAlpha=this.hasVertexAlpha,e.overlayAlpha=this.overlayAlpha,e.overlayColor=this.overlayColor.asArray(),e.renderOverlay=this.renderOverlay,e.applyFog=this.applyFog,this.actionManager&&(e.actions=this.actionManager.serialize(this.name)),e}_syncGeometryWithMorphTargetManager(){if(!this.geometry)return;this._markSubMeshesAsAttributesDirty();const e=this._internalAbstractMeshDataInfo._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices()){pe.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."),this.morphTargetManager=null;return}if(e.isUsingTextureForTargets)return;for(let t=0;t<e.numInfluencers;t++){const i=e.getActiveTarget(t),s=i.getPositions();if(!s){pe.Error("Invalid morph target. Target must have positions.");return}this.geometry.setVerticesData(k.PositionKind+t,s,!1,3);const n=i.getNormals();n&&this.geometry.setVerticesData(k.NormalKind+t,n,!1,3);const o=i.getTangents();o&&this.geometry.setVerticesData(k.TangentKind+t,o,!1,3);const c=i.getUVs();c&&this.geometry.setVerticesData(k.UVKind+"_"+t,c,!1,2);const h=i.getUV2s();h&&this.geometry.setVerticesData(k.UV2Kind+"_"+t,h,!1,2);const f=i.getColors();f&&this.geometry.setVerticesData(k.ColorKind+t,f,!1,4)}}else{let t=0;for(;this.geometry.isVerticesDataPresent(k.PositionKind+t);)this.geometry.removeVerticesData(k.PositionKind+t),this.geometry.isVerticesDataPresent(k.NormalKind+t)&&this.geometry.removeVerticesData(k.NormalKind+t),this.geometry.isVerticesDataPresent(k.TangentKind+t)&&this.geometry.removeVerticesData(k.TangentKind+t),this.geometry.isVerticesDataPresent(k.UVKind+"_"+t)&&this.geometry.removeVerticesData(k.UVKind+"_"+t),this.geometry.isVerticesDataPresent(k.UV2Kind+"_"+t)&&this.geometry.removeVerticesData(k.UV2Kind+"_"+t),this.geometry.isVerticesDataPresent(k.ColorKind+t)&&this.geometry.removeVerticesData(k.ColorKind+t),t++}}static Parse(e,t,i){let s,n=!1;if(e.type&&e.type==="LinesMesh"?s=$._LinesMeshParser(e,t):e.type&&e.type==="GroundMesh"?s=$._GroundMeshParser(e,t):e.type&&e.type==="GoldbergMesh"?s=$._GoldbergMeshParser(e,t):e.type&&e.type==="GreasedLineMesh"?s=$._GreasedLineMeshParser(e,t):e.type&&e.type==="TrailMesh"?s=$._TrailMeshParser(e,t):e.type&&e.type==="GaussianSplattingMesh"?(e._isCompound?s=$._GaussianSplattingCompoundMeshParser(e,t):s=$._GaussianSplattingMeshParser(e,t),n=!0):e.type&&e.type==="GaussianSplattingPartProxyMesh"?(s=$._GaussianSplattingPartProxyMeshParser(e,t),n=!0):s=new $(e.name,t),s.id=e.id,s._waitingParsedUniqueId=e.uniqueId,Rt&&Rt.AddTagsTo(s,e.tags),s.position=D.FromArray(e.position),e.metadata!==void 0&&(s.metadata=e.metadata),e.rotationQuaternion?s.rotationQuaternion=Be.FromArray(e.rotationQuaternion):e.rotation&&(s.rotation=D.FromArray(e.rotation)),s.scaling=D.FromArray(e.scaling),e.localMatrix?s.setPreTransformMatrix(se.FromArray(e.localMatrix)):e.pivotMatrix&&s.setPivotMatrix(se.FromArray(e.pivotMatrix)),s.setEnabled(e.isEnabled),s.isVisible=e.isVisible,s.infiniteDistance=e.infiniteDistance,s.alwaysSelectAsActiveMesh=!!e.alwaysSelectAsActiveMesh,s.showBoundingBox=e.showBoundingBox,s.showSubMeshesBoundingBox=e.showSubMeshesBoundingBox,e.applyFog!==void 0&&(s.applyFog=e.applyFog),e.pickable!==void 0&&(s.isPickable=e.pickable),e.alphaIndex!==void 0&&(s.alphaIndex=e.alphaIndex),s.receiveShadows=e.receiveShadows,e.billboardMode!==void 0&&(s.billboardMode=e.billboardMode),e.visibility!==void 0&&(s.visibility=e.visibility),s.checkCollisions=e.checkCollisions,s.doNotSyncBoundingInfo=!!e.doNotSyncBoundingInfo,e.ellipsoid&&(s.ellipsoid=D.FromArray(e.ellipsoid)),e.ellipsoidOffset&&(s.ellipsoidOffset=D.FromArray(e.ellipsoidOffset)),e.overrideMaterialSideOrientation!=null&&(s.sideOrientation=e.overrideMaterialSideOrientation),e.sideOrientation!==void 0&&(s.sideOrientation=e.sideOrientation),e.isBlocker!==void 0&&(s.isBlocker=e.isBlocker),s._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(s._waitingData.freezeWorldMatrix=e.freezeWorldMatrix),e.parentId!==void 0&&(s._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),e.actions!==void 0&&(s._waitingData.actions=e.actions),e.overlayAlpha!==void 0&&(s.overlayAlpha=e.overlayAlpha),e.overlayColor!==void 0&&(s.overlayColor=rt.FromArray(e.overlayColor)),e.renderOverlay!==void 0&&(s.renderOverlay=e.renderOverlay),s.isUnIndexed=!!e.isUnIndexed,s.hasVertexAlpha=e.hasVertexAlpha,e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s.buildBoundingInfo(D.FromArray(e.boundingBoxMinimum),D.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(s._binaryInfo=e._binaryInfo),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(k.UVKind),e.hasUVs2&&s._delayInfo.push(k.UV2Kind),e.hasUVs3&&s._delayInfo.push(k.UV3Kind),e.hasUVs4&&s._delayInfo.push(k.UV4Kind),e.hasUVs5&&s._delayInfo.push(k.UV5Kind),e.hasUVs6&&s._delayInfo.push(k.UV6Kind),e.hasColors&&s._delayInfo.push(k.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(k.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(k.MatricesWeightsKind),s._delayLoadingFunction=_s._ImportGeometry,ys.ForceFullSceneLoadingForIncremental&&s._checkDelayState()):n||_s._ImportGeometry(e,s),e.materialUniqueId?s._waitingMaterialId=e.materialUniqueId:e.materialId&&(s._waitingMaterialId=e.materialId),e.morphTargetManagerId>-1&&(s._waitingMorphTargetManagerId=e.morphTargetManagerId),e.skeletonId!==void 0&&e.skeletonId!==null&&(s.skeleton=t.getLastSkeletonById(e.skeletonId),s._waitingSkeletonId=e.skeletonId,e.numBoneInfluencers&&(s.numBoneInfluencers=e.numBoneInfluencers)),e.skeletonUniqueId!==void 0&&e.skeletonUniqueId!==null&&(s._waitingSkeletonUniqueId=e.skeletonUniqueId),e.animations){for(let o=0;o<e.animations.length;o++){const c=e.animations[o],h=cf("BABYLON.Animation");h&&s.animations.push(h.Parse(c))}el.ParseAnimationRanges(s,e,t)}if(e.autoAnimate&&t.beginAnimation(s,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),e.layerMask&&!isNaN(e.layerMask)?s.layerMask=Math.abs(parseInt(e.layerMask)):s.layerMask=268435455,e.physicsImpostor&&(s.physicsImpostor=$._PhysicsImpostorParser(t,s,e)),e.lodMeshIds&&(s._waitingData.lods={ids:e.lodMeshIds,distances:e.lodDistances?e.lodDistances:null,coverages:e.lodCoverages?e.lodCoverages:null}),e.instances)for(let o=0;o<e.instances.length;o++){const c=e.instances[o],h=s.createInstance(c.name);if(c.id&&(h.id=c.id),Rt&&(c.tags?Rt.AddTagsTo(h,c.tags):Rt.AddTagsTo(h,e.tags)),h.position=D.FromArray(c.position),c.metadata!==void 0&&(h.metadata=c.metadata),c.parentId!==void 0&&(h._waitingParentId=c.parentId),c.parentInstanceIndex!==void 0&&(h._waitingParentInstanceIndex=c.parentInstanceIndex),c.isEnabled!==void 0&&c.isEnabled!==null&&h.setEnabled(c.isEnabled),c.isVisible!==void 0&&c.isVisible!==null&&(h.isVisible=c.isVisible),c.isPickable!==void 0&&c.isPickable!==null&&(h.isPickable=c.isPickable),c.rotationQuaternion?h.rotationQuaternion=Be.FromArray(c.rotationQuaternion):c.rotation&&(h.rotation=D.FromArray(c.rotation)),h.scaling=D.FromArray(c.scaling),c.checkCollisions!=null&&c.checkCollisions!=null&&(h.checkCollisions=c.checkCollisions),c.pickable!=null&&c.pickable!=null&&(h.isPickable=c.pickable),c.showBoundingBox!=null&&c.showBoundingBox!=null&&(h.showBoundingBox=c.showBoundingBox),c.showSubMeshesBoundingBox!=null&&c.showSubMeshesBoundingBox!=null&&(h.showSubMeshesBoundingBox=c.showSubMeshesBoundingBox),c.alph
vendor: 6,664 bytes, line 299
299aIndex!=null&&c.showSubMeshesBoundingBox!=null&&(h.alphaIndex=c.alphaIndex),c.physicsImpostor&&(h.physicsImpostor=$._PhysicsImpostorParser(t,h,c)),c.actions!==void 0&&(h._waitingData.actions=c.actions),c.animations){for(let f=0;f<c.animations.length;f++){const _=c.animations[f],m=cf("BABYLON.Animation");m&&h.animations.push(m.Parse(_))}el.ParseAnimationRanges(h,c,t),c.autoAnimate&&t.beginAnimation(h,c.autoAnimateFrom,c.autoAnimateTo,c.autoAnimateLoop,c.autoAnimateSpeed||1)}}if(e.thinInstances){const o=e.thinInstances;if(s.thinInstanceEnablePicking=!!o.enablePicking,o.matrixData?(s.thinInstanceSetBuffer("matrix",new Float32Array(o.matrixData),16,!1),s._thinInstanceDataStorage.matrixBufferSize=o.matrixBufferSize,s._thinInstanceDataStorage.instancesCount=o.instancesCount):s._thinInstanceDataStorage.matrixBufferSize=o.matrixBufferSize,e.thinInstances.userThinInstance){const c=e.thinInstances.userThinInstance;for(const h in c.data)s.thinInstanceSetBuffer(h,new Float32Array(c.data[h]),c.strides[h],!1),s._userThinInstanceBuffersStorage.sizes[h]=c.sizes[h]}}return s}setPositionsForCPUSkinning(){const e=this._internalMeshDataInfo;if(!e._sourcePositions){const t=this.getVerticesData(k.PositionKind);if(!t)return e._sourcePositions;e._sourcePositions=new Float32Array(t),this.isVertexBufferUpdatable(k.PositionKind)||this.setVerticesData(k.PositionKind,t,!0)}return e._sourcePositions}setNormalsForCPUSkinning(){const e=this._internalMeshDataInfo;if(!e._sourceNormals){const t=this.getVerticesData(k.NormalKind);if(!t)return e._sourceNormals;e._sourceNormals=new Float32Array(t),this.isVertexBufferUpdatable(k.NormalKind)||this.setVerticesData(k.NormalKind,t,!0)}return e._sourceNormals}applySkeleton(e){if(!this.geometry)return this;if(this.geometry._softwareSkinningFrameId==this.getScene().getFrameId())return this;if(this.geometry._softwareSkinningFrameId=this.getScene().getFrameId(),!this.isVerticesDataPresent(k.PositionKind))return this;if(!this.isVerticesDataPresent(k.MatricesIndicesKind))return this;if(!this.isVerticesDataPresent(k.MatricesWeightsKind))return this;const t=this.isVerticesDataPresent(k.NormalKind),i=this._internalMeshDataInfo;if(!i._sourcePositions){const E=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=E}t&&!i._sourceNormals&&this.setNormalsForCPUSkinning();let s=this.getVerticesData(k.PositionKind);if(!s)return this;s instanceof Float32Array||(s=new Float32Array(s));let n=this.getVerticesData(k.NormalKind);if(t){if(!n)return this;n instanceof Float32Array||(n=new Float32Array(n))}const o=this.getVerticesData(k.MatricesIndicesKind),c=this.getVerticesData(k.MatricesWeightsKind);if(!c||!o)return this;const h=this.numBoneInfluencers>4,f=h?this.getVerticesData(k.MatricesIndicesExtraKind):null,_=h?this.getVerticesData(k.MatricesWeightsExtraKind):null,m=e.getTransformMatrices(this),g=D.Zero(),x=new se,y=new se;let b=0,v;for(let E=0;E<s.length;E+=3,b+=4){let R;for(v=0;v<4;v++)R=c[b+v],R>0&&(se.FromFloat32ArrayToRefScaled(m,Math.floor(o[b+v]*16),R,y),x.addToSelf(y));if(h)for(v=0;v<4;v++)R=_[b+v],R>0&&(se.FromFloat32ArrayToRefScaled(m,Math.floor(f[b+v]*16),R,y),x.addToSelf(y));D.TransformCoordinatesFromFloatsToRef(i._sourcePositions[E],i._sourcePositions[E+1],i._sourcePositions[E+2],x,g),g.toArray(s,E),t&&(D.TransformNormalFromFloatsToRef(i._sourceNormals[E],i._sourceNormals[E+1],i._sourceNormals[E+2],x,g),g.toArray(n,E)),x.reset()}return this.updateVerticesData(k.PositionKind,s),t&&this.updateVerticesData(k.NormalKind,n),this}static MinMax(e){let t=null,i=null;for(const s of e){const o=s.getBoundingInfo().boundingBox;!t||!i?(t=o.minimumWorld.clone(),i=o.maximumWorld.clone()):(t.minimizeInPlace(o.minimumWorld),i.maximizeInPlace(o.maximumWorld))}return!t||!i?{min:D.Zero(),max:D.Zero()}:{min:t,max:i}}static Center(e){const t=e instanceof Array?$.MinMax(e):e;return D.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,s,n,o){return Om($._MergeMeshesCoroutine(e,t,i,s,n,o,!1))}static async MergeMeshesAsync(e,t=!0,i,s,n,o){return await yC($._MergeMeshesCoroutine(e,t,i,s,n,o,!0),bC())}static*_MergeMeshesCoroutine(e,t=!0,i,s,n,o,c){if(e=e.filter(Boolean),e.length===0)return null;let h;if(!i){let P=0;for(h=0;h<e.length;h++)if(P+=e[h].getTotalVertices(),P>=65536)return pe.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}const f=e[0];o&&(n=!1,e.sort((P,L)=>(P.material?.uniqueId??-1)-(L.material?.uniqueId??-1)));const _=new Array,m=new Array,g=new Array,x=e[0].sideOrientation;for(h=0;h<e.length;h++){const P=e[h];if(P.isAnInstance)return pe.Warn("Cannot merge instance meshes."),null;if(x!==P.sideOrientation)return pe.Warn("Cannot merge meshes with different sideOrientation values."),null;if(n||o){const L=g.reduce((V,X)=>Math.max(V,X.start+X.count),0);if(o)if(P.material){const V=P.material;if(V instanceof Tf){for(let X=0;X<V.subMaterials.length;X++)_.indexOf(V.subMaterials[X])<0&&_.push(V.subMaterials[X]);for(let X=0;X<P.subMeshes.length;X++)m.push(_.indexOf(V.subMaterials[P.subMeshes[X].materialIndex])),g.push({start:L+P.subMeshes[X].indexStart,count:P.subMeshes[X].indexCount})}else{_.indexOf(V)<0&&_.push(V);for(let X=0;X<P.subMeshes.length;X++)m.push(_.indexOf(V)),g.push({start:L+P.subMeshes[X].indexStart,count:P.subMeshes[X].indexCount})}}else for(let V=0;V<P.subMeshes.length;V++)m.push(0),g.push({start:L+P.subMeshes[V].indexStart,count:P.subMeshes[V].indexCount});else g.push({start:L,count:P.getTotalIndices()})}}if(o&&g.length>1){let P=0;for(let L=1;L<g.length;L++){const V=g[P],X=g[L];m[L]===m[P]&&V.start+V.count===X.start?V.count+=X.count:(P++,g[P]=X,m[P]=m[L])}g.length=P+1,m.length=P+1}const y=P=>{const L=P.computeWorldMatrix(!0);return{vertexData:Ue.ExtractFromMesh(P,!1,!1),transform:L}},{vertexData:b,transform:v}=y(e[0]);c&&(yield);const E=new Array(e.length-1);for(let P=1;P<e.length;P++)E[P-1]=y(e[P]),c&&(yield);const R=b._mergeCoroutine(v,E,i,c,!t);let C=R.next();for(;!C.done;)c&&(yield),C=R.next();const O=C.value;s||(s=new $(f.name+"_merged",f.getScene()));const M=O._applyToCoroutine(s,void 0,c);let I=M.next();for(;!I.done;)c&&(yield),I=M.next();if(s.checkCollisions=f.checkCollisions,s.sideOrientation=f.sideOrientation,t)for(h=0;h<e.length;h++)e[h].dispose();if(n||o){for(s.releaseSubMeshes(),h=0;h<g.length;)Xs.CreateFromIndices(0,g[h].start,g[h].count,s,void 0,!1),h++;for(const P of s.subMeshes)P.refreshBoundingInfo();s.computeWorldMatrix(!0)}if(o){const P=new Tf(f.name+"_merged",f.getScene());P.subMaterials=_;for(let L=0;L<s.subMeshes.length;L++)s.subMeshes[L].materialIndex=m[L];s.material=P}else s.material=f.material;return s}
vendor: 4,629 bytes, line 299
299addInstance(e){e._indexInSourceMeshInstanceArray=this.instances.length,this.instances.push(e)}removeInstance(e){const t=e._indexInSourceMeshInstanceArray;if(t!=-1){if(t!==this.instances.length-1){const i=this.instances[this.instances.length-1];this.instances[t]=i,i._indexInSourceMeshInstanceArray=t}e._indexInSourceMeshInstanceArray=-1,this.instances.pop()}}_shouldConvertRHS(){return this._scene.useRightHandedSystem&&this.sideOrientation===Ei.CounterClockWiseSideOrientation}_getRenderingFillMode(e){const t=this.getScene();return t.forcePointsCloud?Ei.PointFillMode:t.forceWireframe?Ei.WireFrameFillMode:this.overrideRenderingFillMode??e}setMaterialByID(e){return this.setMaterialById(e)}static CreateRibbon(e,t,i,s,n,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateDisc(e,t,i,s,n,o){throw new Error("Import MeshBuilder to populate this function")}static CreateBox(e,t,i,s,n){throw new Error("Import MeshBuilder to populate this function")}static CreateSphere(e,t,i,s,n,o){throw new Error("Import MeshBuilder to populate this function")}static CreateHemisphere(e,t,i,s){throw new Error("Import MeshBuilder to populate this function")}static CreateCylinder(e,t,i,s,n,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateTorus(e,t,i,s,n,o,c){throw new Error("Import MeshBuilder to populate this function")}static CreateTorusKnot(e,t,i,s,n,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static CreateLines(e,t,i,s,n){throw new Error("Import MeshBuilder to populate this function")}static CreateDashedLines(e,t,i,s,n,o,c,h){throw new Error("Import MeshBuilder to populate this function")}static CreatePolygon(e,t,i,s,n,o,c){throw new Error("Import MeshBuilder to populate this function")}static ExtrudePolygon(e,t,i,s,n,o,c,h){throw new Error("Import MeshBuilder to populate this function")}static ExtrudeShape(e,t,i,s,n,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static ExtrudeShapeCustom(e,t,i,s,n,o,c,h,f,_,m,g){throw new Error("Import MeshBuilder to populate this function")}static CreateLathe(e,t,i,s,n,o,c){throw new Error("Import MeshBuilder to populate this function")}static CreatePlane(e,t,i,s,n){throw new Error("Import MeshBuilder to populate this function")}static CreateGround(e,t,i,s,n,o){throw new Error("Import MeshBuilder to populate this function")}static CreateTiledGround(e,t,i,s,n,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateGroundFromHeightMap(e,t,i,s,n,o,c,h,f,_,m){throw new Error("Import MeshBuilder to populate this function")}static CreateTube(e,t,i,s,n,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static CreatePolyhedron(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static CreateIcoSphere(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static CreateDecal(e,t,i,s,n,o){throw new Error("Import MeshBuilder to populate this function")}static CreateCapsule(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static ExtendToGoldberg(e){throw new Error("Import MeshBuilder to populate this function")}}$.FRONTSIDE=Ue.FRONTSIDE;$.BACKSIDE=Ue.BACKSIDE;$.DOUBLESIDE=Ue.DOUBLESIDE;$.DEFAULTSIDE=Ue.DEFAULTSIDE;$.NO_CAP=0;$.CAP_START=1;$.CAP_END=2;$.CAP_ALL=3;$.NO_FLIP=0;$.FLIP_TILE=1;$.ROTATE_TILE=2;$.FLIP_ROW=3;$.ROTATE_ROW=4;$.FLIP_N_ROTATE_TILE=5;$.FLIP_N_ROTATE_ROW=6;$.CENTER=0;$.LEFT=1;$.RIGHT=2;$.TOP=3;$.BOTTOM=4;$.INSTANCEDMESH_SORT_TRANSPARENT=!1;$._GroundMeshParser=(a,e)=>{throw Je("GroundMesh")};$._GoldbergMeshParser=(a,e)=>{throw Je("GoldbergMesh")};$._LinesMeshParser=(a,e)=>{throw Je("LinesMesh")};$._GreasedLineMeshParser=(a,e)=>{throw Je("GreasedLineMesh")};$._GreasedLineRibbonMeshParser=(a,e)=>{throw Je("GreasedLineRibbonMesh")};$._TrailMeshParser=(a,e)=>{throw Je("TrailMesh")};$._GaussianSplattingMeshParser=(a,e)=>{throw Je("GaussianSplattingMesh")};$._GaussianSplattingPartProxyMeshParser=(a,e)=>{throw Je("GaussianSplattingPartProxyMesh")};$._GaussianSplattingCompoundMeshParser=(a,e)=>{throw Je("GaussianSplattingCompoundMesh")};(dy=$.prototype).registerInstancedBuffer??(dy.registerInstancedBuffer=Xe("Mesh","registerInstancedBuffer"));(_y=$.prototype).simplify??(_y.simplify=Xe("Mesh","simplify"));(my=$.prototype).thinInstanceAdd??(my.thinInstanceAdd=Xe("Mesh","thinInstanceAdd"));(gy=$.prototype).thinInstanceAddSelf??(gy.thinInstanceAddSelf=Xe("Mesh","thinInstanceAddSelf"));(py=$.prototype).thinInstanceRegisterAttribute??(py.thinInstanceRegisterAttribute=Xe("Mesh","thinInstanceRegisterAttribute"));
299(xy=$.prototype).thinInstanceSetMatrixAt??(xy.thinInstanceSetMatrixAt=Xe("Mesh","thinInstanceSetMatrixAt"));(by=$.prototype).thinInstanceSetAttributeAt??(by.thinInstanceSetAttributeAt=Xe("Mesh","thinInstanceSetAttributeAt"));(yy=$.prototype).thinInstanceSetBuffer??(yy.thinInstanceSetBuffer=Xe("Mesh","thinInstanceSetBuffer"));(Ty=$.prototype).thinInstanceGetWorldMatrices??(Ty.thinInstanceGetWorldMatrices=Xe("Mesh","thinInstanceGetWorldMatrices"));(vy=$.prototype).thinInstanceBufferUpdated??(vy.thinInstanceBufferUpdated=Xe("Mesh","thinInstanceBufferUpdated"));(Ey=$.prototype).thinInstancePartialBufferUpdate??(Ey.thinInstancePartialBufferUpdate=Xe("Mesh","thinInstancePartialBufferUpdate"));(Ay=$.prototype).thinInstanceRefreshBoundingInfo??(Ay.thinInstanceRefreshBoundingInfo=Xe("Mesh","thinInstanceRefreshBoundingInfo"));(Ry=$.prototype).getEmittedParticleSystems??(Ry.getEmittedParticleSystems=Xe("Mesh","getEmittedParticleSystems"));(Sy=$.prototype).getHierarchyEmittedParticleSystems??(Sy.getHierarchyEmittedParticleSystems=Xe("Mesh","getHierarchyEmittedParticleSystems"));Object.getOwnPropertyDescriptor($.prototype,"edgesShareWithInstances")||Object.defineProperty($.prototype,"edgesShareWithInstances",gt("Mesh","edgesShareWithInstances"));Object.getOwnPropertyDescriptor($.prototype,"thinInstanceEnablePicking")||Object.defineProperty($.prototype,"thinInstanceEnablePicking",gt("Mesh","thinInstanceEnablePicking"));Object.getOwnPropertyDescriptor($.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation")||Object.defineProperty($.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation",gt("Mesh","thinInstanceAllowAutomaticStaticBufferRecreation"));Object.getOwnPropertyDescriptor($.prototype,"thinInstanceCount")||Object.defineProperty($.prototype,"thinInstanceCount",gt("Mesh","thinInstanceCount"));function Xv(a){let e=a.pathArray;const t=a.closeArray||!1,i=a.closePath||!1,s=a.invertUV||!1,n=Math.floor(e[0].length/2);let o=a.offset||n;o=o>n?n:Math.floor(o);const c=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,h=a.uvs,f=a.colors,_=[],m=[],g=[],x=[],y=[],b=[],v=[],E=[];let R;const C=[],O=[];let M,I,P;if(e.length<2){const xe=[],Ne=[];for(I=0;I<e[0].length-o;I++)xe.push(e[0][I]),Ne.push(e[0][I+o]);e=[xe,Ne]}let L=0;const V=i?1:0,X=t?1:0;let re,ae;R=e[0].length;let de,U;for(M=0;M<e.length+X;M++){for(v[M]=0,y[M]=[0],re=M===e.length?e[0]:e[M],ae=re.length,R=R<ae?R:ae,P=0;P<ae;)_.push(re[P].x,re[P].y,re[P].z),P>0&&(de=re[P].subtract(re[P-1]).length(),U=de+v[M],y[M].push(U),v[M]=U),P++;i&&(P--,_.push(re[0].x,re[0].y,re[0].z),de=re[P].subtract(re[0]).length(),U=de+v[M],y[M].push(U),v[M]=U),C[M]=ae+V,O[M]=L,L+=ae+V}let te,Y,Z,q;for(I=0;I<R+V;I++)for(E[I]=0,b[I]=[0],M=0;M<e.length-1+X;M++)te=e[M],Y=M===e.length-1?e[0]:e[M+1],I===R?(Z=te[0],q=Y[0]):(Z=te[I],q=Y[I]),de=q.subtract(Z).length(),U=de+E[I],b[I].push(U),E[I]=U;let j,Q;if(h)for(M=0;M<h.length;M++)x.push(h[M].x,h[M].y);else for(M=0;M<e.length+X;M++)for(I=0;I<R+V;I++)j=v[M]!=0?y[M][I]/v[M]:0,Q=E[I]!=0?b[I][M]/E[I]:0,s?x.push(Q,j):x.push(j,Q);M=0;let w=0,B=C[M]-1,z=C[M+1]-1,K=B<z?B:z,ue=O[1]-O[0];const he=C.length-1;for(;w<=K&&M<he;)m.push(w,w+ue,w+1),m.push(w+ue+1,w+1,w+ue),w+=1,w===K&&(M++,ue=O[M+1]-O[M],B=C[M]-1,z=C[M+1]-1,w=O[M],K=B<z?B+w:z+w);if(Ue.ComputeNormals(_,m,g),i){let xe,Ne;for(M=0;M<e.length;M++){xe=O[M]*3,M+1<e.length?Ne=(O[M+1]-1)*3:Ne=g.length-3,g[xe]=(g[xe]+g[Ne])*.5,g[xe+1]=(g[xe+1]+g[Ne+1])*.5,g[xe+2]=(g[xe+2]+g[Ne+2])*.5;const Qe=Math.sqrt(g[xe]*g[xe]+g[xe+1]*g[xe+1]+g[xe+2]*g[xe+2]);g[xe]/=Qe,g[xe+1]/=Qe,g[xe+2]/=Qe,g[Ne]=g[xe],g[Ne+1]=g[xe+1],g[Ne+2]=g[xe+2]}}if(t){let xe=O[0]*3,Ne=O[e.length]*3;for(I=0;I<R+V;I++){g[xe]=(g[xe]+g[Ne])*.5,g[xe+1]=(g[xe+1]+g[Ne+1])*.5,g[xe+2]=(g[xe+2]+g[Ne+2])*.5;const Qe=Math.sqrt(g[xe]*g[xe]+g[xe+1]*g[xe+1]+g[xe+2]*g[xe+2]);g[xe]/=Qe,g[xe+1]/=Qe,g[xe+2]/=Qe,g[Ne]=g[xe],g[Ne+1]=g[xe+1],g[Ne+2]=g[xe+2],xe+=3,Ne+=3}}Ue._ComputeSides(c,_,m,g,x,a.frontUVs,a.backUVs);let ve=null;if(f){ve=new Float32Array(f.length*4);for(let xe=0;xe<f.length;xe++)ve[xe*4]=f[xe].r,ve[xe*4+1]=f[xe].g,ve[xe*4+2]=f[xe].b,ve[xe*4+3]=f[xe].a}const Le=new Ue,ke=new Float32Array(_),J=new Float32Array(g),_e=new Float32Array(x);return Le.indices=m,Le.positions=ke,Le.normals=J,Le.uvs=_e,ve&&Le.set(ve,k.ColorKind),i&&(Le._idx=O),Le}function qa(a,e,t=null){const i=e.pathArray,s=e.closeArray,n=e.closePath,o=$._GetDefaultSideOrientation(e.sideOrientation),c=e.instance,h=e.updatable;if(c){const f=ge.Vector3[0].setAll(Number.MAX_VALUE),_=ge.Vector3[1].setAll(-Number.MAX_VALUE),m=x=>{let y=i[0].length;const b=c;let v=0;const E=b._originalBuilderSideOrientation===$.DOUBLESIDE?2:1;for(let R=1;R<=E;++R)for(let C=0;C<i.length;++C){const O=i[C],M=O.length;
299y=y<M?y:M;for(let I=0;I<y;++I){const P=O[I];x[v]=P.x,x[v+1]=P.y,x[v+2]=P.z,f.minimizeInPlaceFromFloats(P.x,P.y,P.z),_.maximizeInPlaceFromFloats(P.x,P.y,P.z),v+=3}if(b._creationDataStorage&&b._creationDataStorage.closePath){const I=O[0];x[v]=I.x,x[v+1]=I.y,x[v+2]=I.z,v+=3}}},g=c.getVerticesData(k.PositionKind);if(m(g),c.hasBoundingInfo?c.getBoundingInfo().reConstruct(f,_,c._worldMatrix):c.buildBoundingInfo(f,_,c._worldMatrix),c.updateVerticesData(k.PositionKind,g,!1,!1),e.colors){const x=c.getVerticesData(k.ColorKind);for(let y=0,b=0;y<e.colors.length;y++,b+=4){const v=e.colors[y];x[b]=v.r,x[b+1]=v.g,x[b+2]=v.b,x[b+3]=v.a}c.updateVerticesData(k.ColorKind,x,!1,!1)}if(e.uvs){const x=c.getVerticesData(k.UVKind);for(let y=0;y<e.uvs.length;y++)x[y*2]=e.uvs[y].x,x[y*2+1]=e.uvs[y].y;c.updateVerticesData(k.UVKind,x,!1,!1)}if(!c.areNormalsFrozen||c.isFacetDataEnabled){const x=c.getIndices(),y=c.getVerticesData(k.NormalKind),b=c.isFacetDataEnabled?c.getFacetDataParameters():null;if(Ue.ComputeNormals(g,x,y,b),c._creationDataStorage&&c._creationDataStorage.closePath){let v,E;for(let R=0;R<i.length;R++)v=c._creationDataStorage.idx[R]*3,R+1<i.length?E=(c._creationDataStorage.idx[R+1]-1)*3:E=y.length-3,y[v]=(y[v]+y[E])*.5,y[v+1]=(y[v+1]+y[E+1])*.5,y[v+2]=(y[v+2]+y[E+2])*.5,y[E]=y[v],y[E+1]=y[v+1],y[E+2]=y[v+2]}c.areNormalsFrozen||c.updateVerticesData(k.NormalKind,y,!1,!1)}return c}else{const f=new $(a,t);f._originalBuilderSideOrientation=o,f._creationDataStorage=new Wv;const _=Xv(e);return n&&(f._creationDataStorage.idx=_._idx),f._creationDataStorage.closePath=n,f._creationDataStorage.closeArray=s,_.applyToMesh(f,h),f}}let Dy=!1;function TD(){Dy||(Dy=!0,Ue.CreateRibbon=Xv,$.CreateRibbon=(a,e,t=!1,i,s,n,o=!1,c,h)=>qa(a,{pathArray:e,closeArray:t,closePath:i,offset:s,updatable:o,sideOrientation:c,instance:h},n))}function Yv(a){const e=[],t=[],i=[],s=[],n=a.radius||.5,o=a.tessellation||64,c=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,h=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE;e.push(0,0,0),s.push(.5,.5);const f=Math.PI*2*c,_=c===1?f/o:f/(o-1);let m=0;for(let y=0;y<o;y++){const b=Math.cos(m),v=Math.sin(m),E=(b+1)/2,R=(1-v)/2;e.push(n*b,n*v,0),s.push(E,R),m+=_}c===1&&(e.push(e[3],e[4],e[5]),s.push(s[2],s[3]));const g=e.length/3;for(let y=1;y<g-1;y++)t.push(y+1,0,y);Ue.ComputeNormals(e,t,i),Ue._ComputeSides(h,e,t,i,s,a.frontUVs,a.backUVs);const x=new Ue;return x.indices=t,x.positions=e,x.normals=i,x.uvs=s,x}function qv(a,e={},t=null){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Yv(e).applyToMesh(i,e.updatable),i}let Iy=!1;function vD(){Iy||(Iy=!0,Ue.CreateDisc=Yv,$.CreateDisc=(a,e,t,i=null,s,n)=>qv(a,{radius:e,tessellation:t,sideOrientation:n,updatable:s},i))}class Of extends ${constructor(e,t){super(e,t),this.generateOctree=!1}getClassName(){return"GroundMesh"}get subdivisions(){return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){return this._subdivisionsX}get subdivisionsY(){return this._subdivisionsY}optimize(e,t=32){this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e);const i=this;bm(i.createOrUpdateSubmeshesOctree)&&i.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){const i=this.getWorldMatrix(),s=ge.Matrix[5];i.invertToRef(s);const n=ge.Vector3[8];if(D.TransformCoordinatesFromFloatsToRef(e,0,t,s,n),e=n.x,t=n.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const o=this._getFacetAt(e,t),c=-(o.x*e+o.z*t+o.w)/o.y;return D.TransformCoordinatesFromFloatsToRef(0,c,0,i,n),n.y}getNormalAtCoordinates(e,t){const i=new D(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i}getNormalAtCoordinatesToRef(e,t,i){const s=this.getWorldMatrix(),n=ge.Matrix[5];s.invertToRef(n);const o=ge.Vector3[8];if(D.TransformCoordinatesFromFloatsToRef(e,0,t,n,o),e=o.x,t=o.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const c=this._getFacetAt(e,t);return D.TransformNormalFromFloatsToRef(c.x,c.y,c.z,s,i),this}updateCoordinateHeights(){return(!this._heightQuads||this._heightQuads.length==0)&&this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){const i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),s=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),n=this._heightQuads[s*this._subdivisionsX+i];let o;return t<n.slope.x*e+n.slope.y?o=n.facet1:o=n.facet2,o}_initHeightQuads(){const e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=[];for(let i=0;i<t;i++)for(let s=0;s<e;s++){const n={slope:Fe.Zero(),facet1:new at(0,0,0,0),facet2:new at(0,0,0,0)};this._heightQuads[i*e+s]=n}return this}_computeHeightQuads(){const e=this.getVerticesData(k.PositionKind);if(!e)return this;const t=ge.Vector3[3],i=ge.Vector3[2],s=ge.Vector3[1],n=ge.Vector3[0],o=ge.Vector3[4],c=ge.Vector3[5],h=ge.Vector3[6],f=ge.Vector3[7],_=ge.Vector3[8];let m,g,x,y,b,v,E;const R=this._subdivisionsX,C=this._subdivisionsY;for(let O=0;O<C;O++)for(let M=0;M<R;M++){m=M*3,g=O*(R+1)*3,x=(O+1)*(R+1)*3,t.x=e[g+m],t.y=e[g+m+1],t.z=e[g+m+2],i.x=e[g+m+3],i.y=e[g+m+4],i.z=e[g+m+5],s.x=e[x+m],s.y=e[x+m+1],s.z=e[x+m+2],n.x=e[x+m+3],n.y=e[x+m+4],n.z=e[x+m+5],y=(n.z-t.z)/(n.x-t.x),b=t.z-y*t.x,i.subtractToRef(t,o),s.subtractToRef(t,c),n.subtractToRef(t,h),D.CrossToRef(h,c,f),D.CrossToRef(o,h,_),f.normalize(),_.normalize(),v=-(f.x*t.x+f.y*t.y+f.z*t.z),E=-(_.x*i.x+_.y*i.y+_.z*i.z);const I=this._heightQuads[O*R+M];I.slope.copyFromFloats(y,b),I.facet1.copyFromFloats(f.x,f.y,f.z,v),I.facet2.copyFromFloats(_.x,_.y,_.z,E)}return this}serialize(e){super.serialize(e),e.subdivisionsX=this._subdivisionsX,e.subdivisionsY=this._subdivisionsY,e.minX=this._minX,e.maxX=this._maxX,e.minZ=this._minZ,e.maxZ=this._maxZ,e.width=this._width,e.height=this._height}static Parse(e,t){const i=new Of(e.name,t);return i._subdivisionsX=e.subdivisionsX||1,i._subdivisionsY=e.subdivisionsY||1,i._minX=e.minX,i._maxX=e.maxX,i._minZ=e.minZ,i._maxZ=e.maxZ,i._width=e.width,i._height=e.height,i}}function Kv(a){const e=[],t=[],i=[],s=[];let n,o;const c=a.width||a.size||1,h=a.height||a.size||1,f=(a.subdivisionsX||a.subdivisions||1)|0,_=(a.subdivisionsY||a.subdivisions||1)|0;for(n=0;n<=_;n++)for(o=0;o<=f;o++){const g=new D(o*c/f-c/2,0,(_-n)*h/_-h/2),x=new D(0,1,0);t.push(g.x,g.y,g.z),i.push(x.x,x.y,x.z),s.push(o/f,1-n/_)}for(n=0;n<_;n++)for(o=0;o<f;
vendor: 5,204 bytes, line 299
299o++)e.push(o+1+(n+1)*(f+1)),e.push(o+1+n*(f+1)),e.push(o+n*(f+1)),e.push(o+(n+1)*(f+1)),e.push(o+1+(n+1)*(f+1)),e.push(o+n*(f+1));const m=new Ue;return m.indices=e,m.positions=t,m.normals=i,m.uvs=s,m}function Zv(a){const e=a.xmin!==void 0&&a.xmin!==null?a.xmin:-1,t=a.zmin!==void 0&&a.zmin!==null?a.zmin:-1,i=a.xmax!==void 0&&a.xmax!==null?a.xmax:1,s=a.zmax!==void 0&&a.zmax!==null?a.zmax:1,n=a.subdivisions||{w:1,h:1},o=a.precision||{w:1,h:1},c=[],h=[],f=[],_=[];let m,g,x,y;n.h=n.h<1?1:n.h,n.w=n.w<1?1:n.w,o.w=o.w<1?1:o.w,o.h=o.h<1?1:o.h;const b={w:(i-e)/n.w,h:(s-t)/n.h};function v(R,C,O,M){const I=h.length/3,P=o.w+1;for(m=0;m<o.h;m++)for(g=0;g<o.w;g++){const X=[I+g+m*P,I+(g+1)+m*P,I+(g+1)+(m+1)*P,I+g+(m+1)*P];c.push(X[1]),c.push(X[2]),c.push(X[3]),c.push(X[0]),c.push(X[1]),c.push(X[3])}const L=D.Zero(),V=new D(0,1,0);for(m=0;m<=o.h;m++)for(L.z=m*(M-C)/o.h+C,g=0;g<=o.w;g++)L.x=g*(O-R)/o.w+R,L.y=0,h.push(L.x,L.y,L.z),f.push(V.x,V.y,V.z),_.push(g/o.w,m/o.h)}for(x=0;x<n.h;x++)for(y=0;y<n.w;y++)v(e+y*b.w,t+x*b.h,e+(y+1)*b.w,t+(x+1)*b.h);const E=new Ue;return E.indices=c,E.positions=h,E.normals=f,E.uvs=_,E}function Qv(a){const e=[],t=[],i=[],s=[];let n,o;const c=a.colorFilter||new rt(.3,.59,.11),h=a.alphaFilter||0;let f=!1;if(a.minHeight>a.maxHeight){f=!0;const m=a.maxHeight;a.maxHeight=a.minHeight,a.minHeight=m}for(n=0;n<=a.subdivisions;n++)for(o=0;o<=a.subdivisions;o++){const m=new D(o*a.width/a.subdivisions-a.width/2,0,(a.subdivisions-n)*a.height/a.subdivisions-a.height/2),g=(m.x+a.width/2)/a.width*(a.bufferWidth-1)|0,x=(1-(m.z+a.height/2)/a.height)*(a.bufferHeight-1)|0,y=(g+x*a.bufferWidth)*4;let b=a.buffer[y]/255,v=a.buffer[y+1]/255,E=a.buffer[y+2]/255;const R=a.buffer[y+3]/255;f&&(b=1-b,v=1-v,E=1-E);const C=b*c.r+v*c.g+E*c.b;R>=h?m.y=a.minHeight+(a.maxHeight-a.minHeight)*C:m.y=a.minHeight-Vt,a.heightBuffer&&(a.heightBuffer[n*(a.subdivisions+1)+o]=m.y),t.push(m.x,m.y,m.z),i.push(0,0,0),s.push(o/a.subdivisions,1-n/a.subdivisions)}for(n=0;n<a.subdivisions;n++)for(o=0;o<a.subdivisions;o++){const m=o+1+(n+1)*(a.subdivisions+1),g=o+1+n*(a.subdivisions+1),x=o+n*(a.subdivisions+1),y=o+(n+1)*(a.subdivisions+1),b=t[m*3+1]>=a.minHeight,v=t[g*3+1]>=a.minHeight,E=t[x*3+1]>=a.minHeight;b&&v&&E&&(e.push(m),e.push(g),e.push(x)),t[y*3+1]>=a.minHeight&&b&&E&&(e.push(y),e.push(m),e.push(x))}Ue.ComputeNormals(t,e,i);const _=new Ue;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function $v(a,e={},t){const i=new Of(a,t);return i._setReady(!1),i._subdivisionsX=e.subdivisionsX||e.subdivisions||1,i._subdivisionsY=e.subdivisionsY||e.subdivisions||1,i._width=e.width||1,i._height=e.height||1,i._maxX=i._width/2,i._maxZ=i._height/2,i._minX=-i._maxX,i._minZ=-i._maxZ,Kv(e).applyToMesh(i,e.updatable),i._setReady(!0),i}function Jv(a,e,t=null){const i=new $(a,t);return Zv(e).applyToMesh(i,e.updatable),i}function e1(a,e,t={},i=null){const s=t.width||10,n=t.height||10,o=t.subdivisions||1,c=t.minHeight||0,h=t.maxHeight||1,f=t.colorFilter||new rt(.3,.59,.11),_=t.alphaFilter||0,m=t.updatable,g=t.onReady;i=i||mt.LastCreatedScene;const x=new Of(a,i);x._subdivisionsX=o,x._subdivisionsY=o,x._width=s,x._height=n,x._maxX=x._width/2,x._maxZ=x._height/2,x._minX=-x._maxX,x._minZ=-x._maxZ,x._setReady(!1);let y;t.passHeightBufferInCallback&&(y=new Float32Array((o+1)*(o+1)));const b=(v,E,R)=>{Qv({width:s,height:n,subdivisions:o,minHeight:c,maxHeight:h,colorFilter:f,buffer:v,bufferWidth:E,bufferHeight:R,alphaFilter:_,heightBuffer:y}).applyToMesh(x,m),g&&g(x,y),x._setReady(!0)};if(typeof e=="string"){i.addPendingData(x);const v=R=>{const C=R.width,O=R.height;if(i.isDisposed){i.removePendingData(x);return}const M=i?.getEngine().resizeImageBitmap(R,C,O);b(M,C,O),i.removePendingData(x)},E=(R,C)=>{i.removePendingData(x),t.onError&&t.onError(R,C)};bt.LoadImage(e,v,E,i.offlineProvider)}else b(e.data,e.width,e.height);return x}let Py=!1;function ED(){Py||(Py=!0,Ue.CreateGround=Kv,Ue.CreateTiledGround=Zv,Ue.CreateGroundFromHeightMap=Qv,$.CreateGround=(a,e,t,i,s,n)=>$v(a,{width:e,height:t,subdivisions:i,updatable:n},s),$.CreateTiledGround=(a,e,t,i,s,n,o,c,h)=>Jv(a,{xmin:e,zmin:t,xmax:i,zmax:s,subdivisions:n,precision:o,updatable:h},c),$.CreateGroundFromHeightMap=(a,e,t,i,s,n,o,c,h,f,_)=>e1(a,e,{width:t,height:i,subdivisions:s,minHeight:n,maxHeight:o,updatable:h,onReady:f,alphaFilter:_},c))}function t1(a){let t=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23];const i=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],s=[],n=a.width||a.size||1,o=a.height||a.size||1,c=a.depth||a.size||1,h=a.wrap||!1;let f=a.topBaseAt===void 0?1:a.topBaseAt,_=a.bottomBaseAt===void 0?0:a.bottomBaseAt;f=(f+4)%4,_=(_+4)%4;const m=[2,0,3,1],g=[2,0,1,3];let x=m[f],y=g[_],b=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(h){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],b=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];
299let P=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],L=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]];const V=[17,18,19,16],X=[22,23,20,21];for(;x>0;)P.unshift(P.pop()),V.unshift(V.pop()),x--;for(;y>0;)L.unshift(L.pop()),X.unshift(X.pop()),y--;P=P.flat(),L=L.flat(),b=b.concat(P).concat(L),t.push(V[0],V[2],V[3],V[0],V[1],V[2]),t.push(X[0],X[2],X[3],X[0],X[1],X[2])}const v=[n/2,o/2,c/2],E=b.reduce((P,L,V)=>P.concat(L*v[V%3]),[]),R=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,C=a.faceUV||new Array(6),O=a.faceColors,M=[];for(let P=0;P<6;P++)C[P]===void 0&&(C[P]=new at(0,0,1,1)),O&&O[P]===void 0&&(O[P]=new _t(1,1,1,1));for(let P=0;P<6;P++)if(s.push(C[P].z,C[P].w),s.push(C[P].x,C[P].w),s.push(C[P].x,C[P].y),s.push(C[P].z,C[P].y),O)for(let L=0;L<4;L++)M.push(O[P].r,O[P].g,O[P].b,O[P].a);Ue._ComputeSides(R,E,t,i,s,a.frontUVs,a.backUVs);const I=new Ue;if(I.indices=t,I.positions=E,I.normals=i,I.uvs=s,O){const P=R===Ue.DOUBLESIDE?M.concat(M):M;I.colors=P}return I}function i1(a,e={},t=null){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,t1(e).applyToMesh(i,e.updatable),i}let Oy=!1;function AD(){Oy||(Oy=!0,Ue.CreateBox=t1,$.CreateBox=(a,e,t=null,i,s)=>i1(a,{size:e,sideOrientation:s,updatable:i},t))}function Fc(a){const e=a.pattern||$.NO_FLIP,t=a.tileWidth||a.tileSize||1,i=a.tileHeight||a.tileSize||1,s=a.alignHorizontal||0,n=a.alignVertical||0,o=a.width||a.size||1,c=Math.floor(o/t);let h=o-c*t;const f=a.height||a.size||1,_=Math.floor(f/i);let m=f-_*i;const g=t*c/2,x=i*_/2;let y=0,b=0,v=0,E=0,R=0,C=0;if(h>0||m>0){switch(v=-g,E=-x,R=g,C=x,s){case $.CENTER:h/=2,v-=h,R+=h;break;case $.LEFT:R+=h,y=-h/2;break;case $.RIGHT:v-=h,y=h/2;break}switch(n){case $.CENTER:m/=2,E-=m,C+=m;break;case $.BOTTOM:C+=m,b=-m/2;break;case $.TOP:E-=m,b=m/2;break}}const O=[],M=[],I=[];I[0]=[0,0,1,0,1,1,0,1],I[1]=[0,0,1,0,1,1,0,1],(e===$.ROTATE_TILE||e===$.ROTATE_ROW)&&(I[1]=[1,1,0,1,0,0,1,0]),(e===$.FLIP_TILE||e===$.FLIP_ROW)&&(I[1]=[1,0,0,0,0,1,1,1]),(e===$.FLIP_N_ROTATE_TILE||e===$.FLIP_N_ROTATE_ROW)&&(I[1]=[0,1,1,1,1,0,0,0]);let P=[];const L=[],V=[];let X=0;for(let U=0;U<_;U++)for(let te=0;te<c;te++)O.push(-g+te*t+y,-x+U*i+b,0),O.push(-g+(te+1)*t+y,-x+U*i+b,0),O.push(-g+(te+1)*t+y,-x+(U+1)*i+b,0),O.push(-g+te*t+y,-x+(U+1)*i+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),e===$.FLIP_TILE||e===$.ROTATE_TILE||e===$.FLIP_N_ROTATE_TILE?P=P.concat(I[(te%2+U%2)%2]):e===$.FLIP_ROW||e===$.ROTATE_ROW||e===$.FLIP_N_ROTATE_ROW?P=P.concat(I[U%2]):P=P.concat(I[0]),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),X+=4;if(h>0||m>0){const U=m>0&&(n===$.CENTER||n===$.TOP),te=m>0&&(n===$.CENTER||n===$.BOTTOM),Y=h>0&&(s===$.CENTER||s===$.RIGHT),Z=h>0&&(s===$.CENTER||s===$.LEFT);let q,j,Q,w,B;if(U&&Y&&(O.push(v+y,E+b,0),O.push(-g+y,E+b,0),O.push(-g+y,E+m+b,0),O.push(v+y,E+m+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),X+=4,j=1-h/t,Q=1-m/i,w=1,B=1,q=[j,Q,w,Q,w,B,j,B],e===$.ROTATE_ROW&&(q=[1-j,1-Q,1-w,1-Q,1-w,1-B,1-j,1-B]),e===$.FLIP_ROW&&(q=[1-j,Q,1-w,Q,1-w,B,1-j,B]),e===$.FLIP_N_ROTATE_ROW&&(q=[j,1-Q,w,1-Q,w,1-B,j,1-B]),P=P.concat(q),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),U&&Z&&(O.push(g+y,E+b,0),O.push(R+y,E+b,0),O.push(R+y,E+m+b,0),O.push(g+y,E+m+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),X+=4,j=0,Q=1-m/i,w=h/t,B=1,q=[j,Q,w,Q,w,B,j,B],(e===$.ROTATE_ROW||e===$.ROTATE_TILE&&c%2===0)&&(q=[1-j,1-Q,1-w,1-Q,1-w,1-B,1-j,1-B]),(e===$.FLIP_ROW||e===$.FLIP_TILE&&c%2===0)&&(q=[1-j,Q,1-w,Q,1-w,B,1-j,B]),(e===$.FLIP_N_ROTATE_ROW||e===$.FLIP_N_ROTATE_TILE&&c%2===0)&&(q=[j,1-Q,w,1-Q,w,1-B,j,1-B]),P=P.concat(q),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),te&&Y&&(O.push(v+y,x+b,0),O.push(-g+y,x+b,0),O.push(-g+y,C+b,0),O.push(v+y,C+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),X+=4,j=1-h/t,Q=0,w=1,B=m/i,q=[j,Q,w,Q,w,B,j,B],(e===$.ROTATE_ROW&&_%2===1||e===$.ROTATE_TILE&&_%1===0)&&(q=[1-j,1-Q,1-w,1-Q,1-w,1-B,1-j,1-B]),(e===$.FLIP_ROW&&_%2===1||e===$.FLIP_TILE&&_%2===0)&&(q=[1-j,Q,1-w,Q,1-w,B,1-j,B]),(e===$.FLIP_N_ROTATE_ROW&&_%2===1||e===$.FLIP_N_ROTATE_TILE&&_%2===0)&&(q=[j,1-Q,w,1-Q,w,1-B,j,1-B]),P=P.concat(q),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),te&&Z&&(O.push(g+y,x+b,0),O.push(R+y,x+b,0),O.push(R+y,C+b,0),O.push(g+y,C+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),X+=4,j=0,Q=0,w=h/t,B=m/i,q=[j,Q,w,Q,w,B,j,B],(e===$.ROTATE_ROW&&_%2===1||e===$.ROTATE_TILE&&(_+c)%2===1)&&(q=[1-j,1-Q,1-w,1-Q,1-w,1-B,1-j,1-B]),(e===$.FLIP_ROW&&_%2===1||e===$.FLIP_TILE&&(_+c)%2===1)&&(q=[1-j,Q,1-w,Q,1-w,B,1-j,B]),(e===$.FLIP_N_ROTATE_ROW&&_%2===1||e===$.FLIP_N_ROTATE_TILE&&(_+c)%2===1)&&(q=[j,1-Q,w,1-Q,w,1-B,j,1-B]),P=P.concat(q),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),U){const z=[];j=0,Q=1-m/i,w=1,B=1,z[0]=[j,Q,w,Q,w,B,j,B],z[1]=[j,Q,w,Q,w,B,j,B],(e===$.ROTATE_TILE||e===$.ROTATE_ROW)&&(z[1]=[1-j,1-Q,1-w,1-Q,1-w,1-B,1-j,1-B]),(e===$.FLIP_TILE||e===$.FLIP_ROW)&&(z[1]=[1-j,Q,1-w,Q,1-w,B,1-j,B]),(e===$.FLIP_N_ROTATE_TILE||e===$.FLIP_N_ROTATE_ROW)&&(z[1]=[j,1-Q,w,1-Q,w,1-B,j,1-B]);for(let K=0;K<c;K++)O.push(-g+K*t+y,E+b,0),O.push(-g+(K+1)*t+y,E+b,0),O.push(-g+(K+1)*t+y,E+m+b,0),O.push(-g+K*t+y,E+m+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),X+=4,e===$.FLIP_TILE||e===$.ROTATE_TILE||e===$.FLIP_N_ROTATE_TILE?P=P.concat(z[(K+1)%2]):e===$.FLIP_ROW||e===$.ROTATE_ROW||e===$.FLIP_N_ROTATE_ROW?P=P.concat(z[1]):P=P.concat(z[0]),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(te){const z=[];j=0,Q=0,w=1,B=m/i,z[0]=[j,Q,w,Q,w,B,j,B],z[1]=[j,Q,w,Q,w,B,j,B],(e===$.ROTATE_TILE||e===$.ROTATE_ROW)&&(z[1]=[1-j,1-Q,1-w,1-Q,1-w,1-B,1-j,1-B]),(e===$.FLIP_TILE||e===$.FLIP_ROW)&&(z[1]=[1-j,Q,1-w,Q,1-w,B,1-j,B]),(e===$.FLIP_N_ROTATE_TILE||e===$.FLIP_N_ROTATE_ROW)&&(z[1]=[j,1-Q,w,1-Q,w,1-B,j,1-B]);for(let K=0;K<c;K++)O.push(-g+K*t+y,C-m+b,0),O.push(-g+(K+1)*t+y,C-m+b,0),O.push(-g+(K+1)*t+y,C+b,0),O.push(-g+K*t+y,C+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),X+=4,e===$.FLIP_TILE||e===$.ROTATE_TILE||e===$.FLIP_N_ROTATE_TILE?P=P.concat(z[(K+_)%2]):e===$.FLIP_ROW||e===$.ROTATE_ROW||e===$.FLIP_N_ROTATE_ROW?P=P.concat(z[_%2]):P=P.concat(z[0]),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(Y){const z=[];j=1-h/t,Q=0,w=1,B=1,z[0]=[j,Q,w,Q,w,B,j,B],z[1]=[j,Q,w,Q,w,B,j,B],(e===$.ROTATE_TILE||e===$.ROTATE_ROW)&&(z[1]=[1-j,1-Q,1-w,1-Q,1-w,1-B,1-j,1-B]),(e===$.FLIP_TILE||e===$.FLIP_ROW)&&(z[1]=[1-j,Q,1-w,Q,1-w,B,1-j,B]),(e===$.FLIP_N_ROTATE_TILE||e===$.FLIP_N_ROTATE_ROW)&&(z[1]=[j,1-Q,w,1-Q,w,1-B,j,1-B]);for(let K=0;K<_;K++)O.push(v+y,-x+K*i+b,0),O.push(v+h+y,-x+K*i+b,0),O.push(v+h+y,-x+(K+1)*i+b,0),O.push(v+y,-x+(K+1)*i+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),X+=4,e===$.FLIP_TILE||e===$.ROTATE_TILE||e===$.FLIP_N_ROTATE_TILE?P=P.concat(z[(K+1)%2]):e===$.FLIP_ROW||e===$.ROTATE_ROW||e===$.FLIP_N_ROTATE_ROW?P=P.concat(z[K%2]):P=P.concat(z[0]),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(Z){const z=[];j=0,Q=0,w=h/i,B=1,z[0]=[j,Q,w,Q,w,B,j,B],z[1]=[j,Q,w,Q,w,B,j,B],(e===$.ROTATE_TILE||e===$.ROTATE_ROW)&&(z[1]=[1-j,1-Q,1-w,1-Q,1-w,1-B,1-j,1-B]),(e===$.FLIP_TILE||e===$.FLIP_ROW)&&(z[1]=[1-j,Q,1-w,Q,1-w,B,1-j,B]),(e===$.FLIP_N_ROTATE_TILE||e===$.FLIP_N_ROTATE_ROW)&&(z[1]=[j,1-Q,w,1-Q,w,1-B,j,1-B]);for(let K=0;K<_;K++)O.push(R-h+y,-x+K*i+b,0),O.push(R+y,-x+K*i+b,0),O.push(R+y,-x+(K+1)*i+b,0),O.push(R-h+y,-x+(K+1)*i+b,0),V.push(X,X+1,X+3,X+1,X+2,X+3),X+=4,e===$.FLIP_TILE||e===$.ROTATE_TILE||e===$.FLIP_N_ROTATE_TILE?P=P.concat(z[(K+c)%2]):e===$.FLIP_ROW||e===$.ROTATE_ROW||e===$.FLIP_N_ROTATE_ROW?P=P.concat(z[K%2]):P=P.concat(z[0]),L.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}const re=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE;Ue._ComputeSides(re,O,V,M,P,a.frontUVs,a.backUVs);const ae=new Ue;ae.indices=V,ae.positions=O,ae.normals=M,ae.uvs=P;const de=re===Ue.DOUBLESIDE?L.concat(L):L;return ae.colors=de,ae}function RD(a,e,t=null){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,Fc(e).applyToMesh(i,e.updatable),i}let wy=!1;function s1(){wy||(wy=!0,Ue.CreateTiledPlane=Fc)}const Zu=1,k_=-1;function r1(a){const t=a.faceUV||new Array(6),i=a.faceColors,s=a.pattern||$.NO_FLIP,n=a.width||a.size||1,o=a.height||a.size||1,c=a.depth||a.size||1,h=a.tileWidth||a.tileSize||1,f=a.tileHeight||a.tileSize||1,_=a.alignHorizontal||0,m=a.alignVertical||0,g=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE;for(let U=0;U<6;U++)t[U]===void 0&&(t[U]=new at(0,0,1,1)),i&&i[U]===void 0&&(i[U]=new _t(1,1,1,1));const x=n/2,y=o/2,b=c/2,v=[];for(let U=0;U<2;U++)v[U]=Fc({pattern:s,tileWidth:h,tileHeight:f,width:n,height:o,alignVertical:m,alignHorizontal:_,sideOrientation:g});for(let U=2;U<4;U++)v[U]=Fc({pattern:s,tileWidth:h,tileHeight:f,width:c,height:o,alignVertical:m,alignHorizontal:_,sideOrientation:g});let E=m;m===$.BOTTOM?E=$.TOP:m===$.TOP&&(E=$.BOTTOM);for(let U=4;U<6;U++)v[U]=Fc({pattern:s,tileWidth:h,tileHeight:f,width:n,height:c,alignVertical:E,alignHorizontal:_,sideOrientation:g});const R=[],C=[];let O=[],M=[];const I=[],P=[],L=[],V=[];let X,re=0;for(let U=0;U<6;U++){const te=v[U].positions.length;P[U]=[],L[U]=[];for(let Y=0;Y<te/3;Y++)P[U].push(new D(v[U].positions[3*Y],v[U].positions[3*Y+1],v[U].positions[3*Y+2])),L[U].push(new D(v[U].normals[3*Y],v[U].normals[3*Y+1],v[U].normals[3*Y+2]));X=v[U].uvs.length,V[U]=[];for(let Y=0;Y<X;Y+=2)V[U][Y]=t[U].x+(t[U].z-t[U].x)*v[U].uvs[Y],V[U][Y+1]=t[U].y+(t[U].w-t[U].y)*v[U].uvs[Y+1];if(O=O.concat(V[U]),M=M.concat(v[U].indices.map(Y=>Y+re)),re+=P[U].length,i){const Y=i[U];for(let Z=0;Z<P[U].length;Z++)I.push(Y.r,Y.g,Y.b,Y.a)}}const ae=[{m:se.RotationY(Math.PI),t:new D(0,0,b),op:Zu},{m:se.Identity(),t:new D(0,0,b),op:k_},{m:se.RotationY(-Math.PI/2),t:new D(x,0,0),op:Zu},{m:se.RotationY(Math.PI/2),t:new D(x,0,0),op:k_},{m:se.RotationX(Math.PI/2),t:new D(0,y,0),op:Zu},{m:se.RotationX(-Math.PI/2),t:new D(0,y,0),op:k_}];for(let U=0;U<6;U++){const{m:te,t:Y,op:Z}=ae[U];for(const q of P[U]){const j=D.TransformCoordinates(q,te),Q=Z===Zu?j.add(Y):j.subtract(Y);R.push(Q.x,Q.y,Q.z)}for(const q of L[U]){const j=D.TransformNormal(q,te);C.push(j.x,j.y,j.z)}}const de=new Ue;
299if(de.indices=M,de.positions=R,de.normals=C,de.uvs=O,i){const U=g===Ue.DOUBLESIDE?I.concat(I):I;de.colors=U}return de}function SD(a,e,t=null){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,r1(e).applyToMesh(i,e.updatable),i}let Fy=!1;function MD(){Fy||(Fy=!0,s1(),Ue.CreateTiledBox=r1)}function n1(a){const e=(a.segments||32)|0,t=a.diameterX||a.diameter||1,i=a.diameterY||a.diameter||1,s=a.diameterZ||a.diameter||1,n=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,o=a.slice&&a.slice<=0?1:a.slice||1,c=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,h=!!a.dedupTopBottomIndices,f=new D(t/2,i/2,s/2),_=2+e,m=2*_,g=[],x=[],y=[],b=[];for(let E=0;E<=_;E++){const R=E/_,C=R*Math.PI*o;for(let O=0;O<=m;O++){const M=O/m,I=M*Math.PI*2*n,P=se.RotationZ(-C),L=se.RotationY(I),V=D.TransformCoordinates(D.Up(),P),X=D.TransformCoordinates(V,L),re=X.multiply(f),ae=X.divide(f).normalize();x.push(re.x,re.y,re.z),y.push(ae.x,ae.y,ae.z),b.push(M,R)}if(E>0){const O=x.length/3;for(let M=O-2*(m+1);M+m+2<O;M++)h?(E>1&&(g.push(M),g.push(M+1),g.push(M+m+1)),(E<_||o<1)&&(g.push(M+m+1),g.push(M+1),g.push(M+m+2))):(g.push(M),g.push(M+1),g.push(M+m+1),g.push(M+m+1),g.push(M+1),g.push(M+m+2))}}Ue._ComputeSides(c,x,g,y,b,a.frontUVs,a.backUVs);const v=new Ue;return v.indices=g,v.positions=x,v.normals=y,v.uvs=b,v}function a1(a,e={},t=null){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,n1(e).applyToMesh(i,e.updatable),i}let By=!1;function CD(){By||(By=!0,Ue.CreateSphere=n1,$.CreateSphere=(a,e,t,i,s,n)=>a1(a,{segments:e,diameterX:t,diameterY:t,diameterZ:t,sideOrientation:n,updatable:s},i))}class Ly{constructor(){this._count=0,this._data={}}copyFrom(e){this.clear(),e.forEach((t,i)=>this.add(t,i))}get(e){const t=this._data[e];if(t!==void 0)return t}getOrAddWithFactory(e,t){let i=this.get(e);return i!==void 0||(i=t(e),i&&this.add(e,i)),i}getOrAdd(e,t){const i=this.get(e);return i!==void 0?i:(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 i=this._data[t];e(t,i)}}first(e){for(const t in this._data){const i=this._data[t],s=e(t,i);if(s)return s}return null}}const xn=[[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]],vf=1e6/xn[xn.length-1][0],Ef=150;function o1(a,e){const t=Number.isNaN(a)?vf:Math.max(a,vf),i=oi(1e6/t,xn[0][0],xn[xn.length-1][0]);let s=0,n=xn.length-1;for(;n-s>1;){const L=s+n>>1;xn[L][0]<=i?s=L:n=L}const o=s,[c,h,f,_]=xn[o],[m,g,x,y]=xn[o+1],b=(i-c)/(m-c),v=Fe.Lerp(new Fe(h,f),new Fe(g,x),b),E=Fe.Normalize(new Fe(1,_)),R=Fe.Normalize(new Fe(1,y)),C=Fe.Normalize(Fe.Lerp(E,R,b)),O=oi(e,-Ef,Ef);v.subtractInPlace(C.scale(O/3e3));const M=2*v.x-8*v.y+4,I=3*v.x/M,P=2*v.y/M;return new D(I/P,1,(1-I-P)/P)}const sf=se.FromArray([.8951,-.7502,.0389,0,.2664,1.7135,-.0685,0,-.1614,.0367,1.0296,0,0,0,0,1]),DD=se.Invert(sf);function N_(a,e){const t=e>0?a/e:10;return oi(t,.1,10)}function l1(a,e){const t=D.TransformNormal(a,sf),i=D.TransformNormal(e,sf),s=se.FromArray([N_(i.x,t.x),0,0,0,0,N_(i.y,t.y),0,0,0,0,N_(i.z,t.z),0,0,0,0,1]);
vendor: 23,625 bytes, line 299
299return sf.multiply(s).multiply(DD)}const ID=new D(.95047,1,1.08883),PD=se.FromArray([.4124564,.2126729,.0193339,0,.3575761,.7151522,.119192,0,.1804375,.072175,.9503041,0,0,0,0,1]),wm=PD.multiply(l1(ID,o1(6500,0))),OD=se.Invert(wm),wD=D.TransformNormal(new D(1,1,1),wm);function FD(a,e){const t=o1(a,e),i=l1(t,wD),n=wm.multiply(i).multiply(OD);return se.GetAsMatrix3x3(n)}function c1(a){a.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")}let BD=(()=>{var a;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,m=[],g=[],x,y=[],b=[],v,E=[],R=[],C,O=[],M=[],I,P=[],L=[],V,X=[],re=[],ae,de=[],U=[],te,Y=[],Z=[],q,j=[],Q=[];return a=class{constructor(){this._dirty=!0,this._tempColor=new _t(0,0,0,0),this._globalCurve=new _t(0,0,0,0),this._highlightsCurve=new _t(0,0,0,0),this._midtonesCurve=new _t(0,0,0,0),this._shadowsCurve=new _t(0,0,0,0),this._positiveCurve=new _t(0,0,0,0),this._negativeCurve=new _t(0,0,0,0),this._globalHue=N(this,t,30),this._globalDensity=(N(this,i),N(this,n,0)),this._globalSaturation=(N(this,o),N(this,h,0)),this._globalExposure=(N(this,f),N(this,m,0)),this._highlightsHue=(N(this,g),N(this,y,30)),this._highlightsDensity=(N(this,b),N(this,E,0)),this._highlightsSaturation=(N(this,R),N(this,O,0)),this._highlightsExposure=(N(this,M),N(this,P,0)),this._midtonesHue=(N(this,L),N(this,X,30)),this._midtonesDensity=(N(this,re),N(this,de,0)),this._midtonesSaturation=(N(this,U),N(this,Y,0)),this._midtonesExposure=(N(this,Z),N(this,j,0)),this._shadowsHue=(N(this,Q),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,z,K,ue,he){B!=null&&(B=a._Clamp(B,0,360),z=a._Clamp(z,-100,100),K=a._Clamp(K,-100,100),ue=a._Clamp(ue,-100,100),z=a._ApplyColorGradingSliderNonlinear(z),z*=.5,ue=a._ApplyColorGradingSliderNonlinear(ue),z<0&&(z*=-1,B=(B+180)%360),a._FromHSBToRef(B,z,50+.25*ue,he),he.scaleToRef(2,he),he.a=1+.01*K)}static _ApplyColorGradingSliderNonlinear(B){B/=100;let z=Math.abs(B);return z=Math.pow(z,2),B<0&&(z*=-1),z*=100,z}static _FromHSBToRef(B,z,K,ue){let he=a._Clamp(B,0,360);const ve=a._Clamp(z/100,0,1),Le=a._Clamp(K/100,0,1);if(ve===0)ue.r=Le,ue.g=Le,ue.b=Le;else{he/=60;const ke=Math.floor(he),J=he-ke,_e=Le*(1-ve),xe=Le*(1-ve*J),Ne=Le*(1-ve*(1-J));switch(ke){case 0:ue.r=Le,ue.g=Ne,ue.b=_e;break;case 1:ue.r=xe,ue.g=Le,ue.b=_e;break;case 2:ue.r=_e,ue.g=Le,ue.b=Ne;break;case 3:ue.r=_e,ue.g=xe,ue.b=Le;break;case 4:ue.r=Ne,ue.g=_e,ue.b=Le;break;default:ue.r=Le,ue.g=_e,ue.b=xe;break}}ue.a=1}static _Clamp(B,z,K){return Math.min(Math.max(B,z),K)}clone(){return xt.Clone(()=>new a,this)}serialize(){return xt.Serialize(this)}_bind(B,z="vCameraColorCurvePositive",K="vCameraColorCurveNeutral",ue="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(z,this._positiveCurve.r,this._positiveCurve.g,this._positiveCurve.b,this._positiveCurve.a),B.setFloat4(K,this._midtonesCurve.r,this._midtonesCurve.g,this._midtonesCurve.b,this._midtonesCurve.a),B.setFloat4(ue,this._negativeCurve.r,this._negativeCurve.g,this._negativeCurve.b,this._negativeCurve.a))}},(()=>{const w=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ce()],s=[ce()],c=[ce()],_=[ce()],x=[ce()],v=[ce()],C=[ce()],I=[ce()],V=[ce()],ae=[ce()],te=[ce()],q=[ce()],ee(null,null,e,{kind:"field",name:"_globalHue",static:!1,private:!1,access:{has:B=>"_globalHue"in B,get:B=>B._globalHue,set:(B,z)=>{B._globalHue=z}},metadata:w},t,i),ee(null,null,s,{kind:"field",name:"_globalDensity",static:!1,private:!1,access:{has:B=>"_globalDensity"in B,get:B=>B._globalDensity,set:(B,z)=>{B._globalDensity=z}},metadata:w},n,o),ee(null,null,c,{kind:"field",name:"_globalSaturation",static:!1,private:!1,access:{has:B=>"_globalSaturation"in B,get:B=>B._globalSaturation,set:(B,z)=>{B._globalSaturation=z}},metadata:w},h,f),ee(null,null,_,{kind:"field",name:"_globalExposure",static:!1,private:!1,access:{has:B=>"_globalExposure"in B,get:B=>B._globalExposure,set:(B,z)=>{B._globalExposure=z}},metadata:w},m,g),ee(null,null,x,{kind:"field",name:"_highlightsHue",static:!1,private:!1,access:{has:B=>"_highlightsHue"in B,get:B=>B._highlightsHue,set:(B,z)=>{B._highlightsHue=z}},metadata:w},y,b),ee(null,null,v,{kind:"field",name:"_highlightsDensity",static:!1,private:!1,access:{has:B=>"_highlightsDensity"in B,get:B=>B._highlightsDensity,set:(B,z)=>{B._highlightsDensity=z}},metadata:w},E,R),ee(null,null,C,{kind:"field",name:"_highlightsSaturation",static:!1,private:!1,access:{has:B=>"_highlightsSaturation"in B,get:B=>B._highlightsSaturation,set:(B,z)=>{B._highlightsSaturation=z}},metadata:w},O,M),ee(null,null,I,{kind:"field",name:"_highlightsExposure",static:!1,private:!1,access:{has:B=>"_highlightsExposure"in B,get:B=>B._highlightsExposure,set:(B,z)=>{B._highlightsExposure=z}},metadata:w},P,L),ee(null,null,V,{kind:"field",name:"_midtonesHue",static:!1,private:!1,access:{has:B=>"_midtonesHue"in B,get:B=>B._midtonesHue,set:(B,z)=>{B._midtonesHue=z}},metadata:w},X,re),ee(null,null,ae,{kind:"field",name:"_midtonesDensity",static:!1,private:!1,access:{has:B=>"_midtonesDensity"in B,get:B=>B._midtonesDensity,set:(B,z)=>{B._midtonesDensity=z}},metadata:w},de,U),ee(null,null,te,{kind:"field",name:"_midtonesSaturation",static:!1,private:!1,access:{has:B=>"_midtonesSaturation"in B,get:B=>B._midtonesSaturation,set:(B,z)=>{B._midtonesSaturation=z}},metadata:w},Y,Z),ee(null,null,q,{kind:"field",name:"_midtonesExposure",static:!1,private:!1,access:{has:B=>"_midtonesExposure"in B,get:B=>B._midtonesExposure,set:(B,z)=>{B._midtonesExposure=z}},metadata:w},j,Q),w&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w})})(),a.PrepareUniforms=c1,a})();function LD(a,e,t="vCameraColorCurvePositive",i="vCameraColorCurveNeutral",s="vCameraColorCurveNegative"){a._bind(e,t,i,s)}function kD(a,e){e.WHITEBALANCE&&a.push("whiteBalanceMatrix"),e.EXPOSURE&&a.push("exposureLinear"),e.CONTRAST&&a.push("contrast"),e.COLORGRADING&&a.push("colorTransformSettings"),(e.VIGNETTE||e.DITHER)&&a.push("vInverseScreenSize"),e.VIGNETTE&&(a.push("vignetteSettings1"),a.push("vignetteSettings2")),e.COLORCURVES&&c1(a),e.DITHER&&a.push("ditherIntensity")}function ND(a,e){e.COLORGRADING&&a.push("txColorTransform")}let da=(()=>{var a;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,m=[],g=[],x,y=[],b=[],v,E=[],R=[],C,O=[],M=[],I,P=[],L=[],V,X=[],re=[],ae,de=[],U=[],te,Y=[],Z=[],q,j=[],Q=[],w,B=[],z=[],K,ue=[],he=[],ve,Le=[],ke=[],J,_e=[],xe=[],Ne,Qe=[],He=[],dt,li=[],zt=[],Ot,jt=[],Nt=[],ut,ne=[],we=[],ti,ci=[],hi=[],ii,ui=[],Gt=[],fi,qt=[],Wt=[],si,Si=[],Mi=[],gr,pr=[],xr=[],Os,ws=[],Fs=[],ns,Bs=[],$e=[],G,Re=[],pt=[];return a=class{constructor(){this.colorCurves=N(this,t,new BD),this._colorCurvesEnabled=(N(this,i),N(this,n,!1)),this._colorGradingTexture=(N(this,o),N(this,h,void 0)),this._colorGradingEnabled=(N(this,f),N(this,m,!1)),this._colorGradingWithGreenDepth=(N(this,g),N(this,y,!0)),this._colorGradingBGR=(N(this,b),N(this,E,!0)),this._exposure=(N(this,R),N(this,O,1)),this._toneMappingEnabled=(N(this,M),N(this,P,!1)),this._toneMappingType=(N(this,L),N(this,X,a.TONEMAPPING_STANDARD)),this._contrast=(N(this,re),N(this,de,1)),this._whiteBalanceEnabled=(N(this,U),N(this,Y,!1)),this._temperature=(N(this,Z),N(this,j,6500)),this._tint=(N(this,Q),N(this,B,0)),this._whiteBalanceMatrix=(N(this,z),null),this._whiteBalanceMatrixTemperature=null,this._whiteBalanceMatrixTint=null,this.vignetteStretch=N(this,ue,0),this.vignetteCenterX=(N(this,he),N(this,Le,0)),this.vignetteCenterY=(N(this,ke),N(this,_e,0)),this.vignetteWeight=(N(this,xe),N(this,Qe,1.5)),this.vignetteColor=(N(this,He),N(this,li,new _t(0,0,0,0))),this.vignetteCameraFov=(N(this,zt),N(this,jt,.5)),this._vignetteBlendMode=(N(this,Nt),N(this,ne,a.VIGNETTEMODE_MULTIPLY)),this._vignetteEnabled=(N(this,we),N(this,ci,!1)),this._ditheringEnabled=(N(this,hi),N(this,ui,!1)),this._ditheringIntensity=(N(this,Gt),N(this,qt,1/255)),this._skipFinalColorClamp=(N(this,Wt),N(this,Si,!1)),this._applyByPostProcess=(N(this,Mi),N(this,pr,!1)),this._isEnabled=(N(this,xr),N(this,ws,!0)),this.outputTextureWidth=(N(this,Fs),N(this,Bs,0)),this.outputTextureHeight=(N(this,$e),N(this,Re,0)),this.onUpdateParameters=(N(this,pt),new Me)}get colorCurvesEnabled(){return this._colorCurvesEnabled}set colorCurvesEnabled(W){this._colorCurvesEnabled!==W&&(this._colorCurvesEnabled=W,this._updateParameters())}get colorGradingTexture(){return this._colorGradingTexture}set colorGradingTexture(W){this._colorGradingTexture!==W&&(this._colorGradingTexture=W,this._updateParameters())}get colorGradingEnabled(){return this._colorGradingEnabled}set colorGradingEnabled(W){this._colorGradingEnabled!==W&&(this._colorGradingEnabled=W,this._updateParameters())}get colorGradingWithGreenDepth(){return this._colorGradingWithGreenDepth}set colorGradingWithGreenDepth(W){this._colorGradingWithGreenDepth!==W&&(this._colorGradingWithGreenDepth=W,this._updateParameters())}get colorGradingBGR(){return this._colorGradingBGR}set colorGradingBGR(W){this._colorGradingBGR!==W&&(this._colorGradingBGR=W,this._updateParameters())}get exposure(){return this._exposure}set exposure(W){this._exposure!==W&&(this._exposure=W,this._updateParameters())}get toneMappingEnabled(){return this._toneMappingEnabled}set toneMappingEnabled(W){this._toneMappingEnabled!==W&&(this._toneMappingEnabled=W,this._updateParameters())}get toneMappingType(){return this._toneMappingType}set toneMappingType(W){this._toneMappingType!==W&&(this._toneMappingType=W,this._updateParameters())}get contrast(){return this._contrast}set contrast(W){this._contrast!==W&&(this._contrast=W,this._updateParameters())}get whiteBalanceEnabled(){return this._whiteBalanceEnabled}set whiteBalanceEnabled(W){this._whiteBalanceEnabled!==W&&(this._whiteBalanceEnabled=W,this._updateParameters())}get temperature(){return this._temperature}set temperature(W){W=Number.isNaN(W)?vf:Math.max(W,vf),this._temperature!==W&&(this._temperature=W,this._updateParameters())}get tint(){return this._tint}set tint(W){W=oi(W,-Ef,Ef),this._tint!==W&&(this._tint=W,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=FD(this._temperature,this._tint)),this._whiteBalanceMatrix}get vignetteCentreY(){return this.vignetteCenterY}set vignetteCentreY(W){this.vignetteCenterY=W}get vignetteCentreX(){return this.vignetteCenterX}set vignetteCentreX(W){this.vignetteCenterX=W}get vignetteBlendMode(){return this._vignetteBlendMode}set vignetteBlendMode(W){this._vignetteBlendMode!==W&&(this._vignetteBlendMode=W,this._updateParameters())}get vignetteEnabled(){return this._vignetteEnabled}set vignetteEnabled(W){this._vignetteEnabled!==W&&(this._vignetteEnabled=W,this._updateParameters())}get ditheringEnabled(){return this._ditheringEnabled}set ditheringEnabled(W){this._ditheringEnabled!==W&&(this._ditheringEnabled=W,this._updateParameters())}get ditheringIntensity(){return this._ditheringIntensity}set ditheringIntensity(W){this._ditheringIntensity!==W&&(this._ditheringIntensity=W,this._updateParameters())}get skipFinalColorClamp(){return this._skipFinalColorClamp}set skipFinalColorClamp(W){this._skipFinalColorClamp!==W&&(this._skipFinalColorClamp=W,this._updateParameters())}get applyByPostProcess(){return this._applyByPostProcess}set applyByPostProcess(W){this._applyByPostProcess!==W&&(this._applyByPostProcess=W,this._updateParameters())}get isEnabled(){return this._isEnabled}set isEnabled(W){this._isEnabled!==W&&(this._isEnabled=W,this._updateParameters())}_updateParameters(){this.onUpdateParameters.notifyObservers(this)}getClassName(){return"ImageProcessingConfiguration"}prepareDefines(W,Ve=!1){if(Ve!==this.applyByPostProcess||!this._isEnabled){W.WHITEBALANCE=!1,W.VIGNETTE=!1,W.TONEMAPPING=0,W.CONTRAST=!1,W.EXPOSURE=!1,W.COLORCURVES=!1,W.COLORGRADING=!1,W.COLORGRADING3D=!1,W.DITHER=!1,W.IMAGEPROCESSING=!1,W.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,W.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled;return}if(W.WHITEBALANCE=this._whiteBalanceEnabled,W.VIGNETTE=this.vignetteEnabled,W.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===a._VIGNETTEMODE_MULTIPLY,W.VIGNETTEBLENDMODEOPAQUE=!W.VIGNETTEBLENDMODEMULTIPLY,!this._toneMappingEnabled)W.TONEMAPPING=0;else switch(this._toneMappingType){case a.TONEMAPPING_KHR_PBR_NEUTRAL:W.TONEMAPPING=3;break;case a.TONEMAPPING_ACES:W.TONEMAPPING=2;break;default:W.TONEMAPPING=1;break}W.CONTRAST=this.contrast!==1,W.EXPOSURE=this.exposure!==1,W.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,W.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,W.COLORGRADING?W.COLORGRADING3D=this.colorGradingTexture.is3D:W.COLORGRADING3D=!1,W.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,W.SAMPLER3DBGRMAP=this.colorGradingBGR,W.DITHER=this._ditheringEnabled,W.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,W.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,W.IMAGEPROCESSING=W.WHITEBALANCE||W.VIGNETTE||!!W.TONEMAPPING||W.CONTRAST||W.EXPOSURE||W.COLORCURVES||W.COLORGRADING||W.DITHER}isReady(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()}bind(W,Ve){if(this._whiteBalanceEnabled&&W.setMatrix3x3("whiteBalanceMatrix",this._getWhiteBalanceMatrix()),this._colorCurvesEnabled&&this.colorCurves&&LD(this.colorCurves,W),this._vignetteEnabled||this._ditheringEnabled){const Qt=1/(this.outputTextureWidth||W.getEngine().getRenderWidth()),as=1/(this.outputTextureHeight||W.getEngine().getRenderHeight());if(W.setFloat2("vInverseScreenSize",Qt,as),this._ditheringEnabled&&W.setFloat("ditherIntensity",.5*this._ditheringIntensity),this._vignetteEnabled){const br=Ve??as/Qt;let os=Math.tan(this.vignetteCameraFov*.5),ms=os*br;const ls=Math.sqrt(ms*os);ms=_b(ms,ls,this.vignetteStretch),os=_b(os,ls,this.vignetteStretch),W.setFloat4("vignetteSettings1",ms,os,-ms*this.vignetteCenterX,-os*this.vignetteCenterY);const Ls=-2*this.vignetteWeight;W.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,Ls)}}if(W.setFloat("exposureLinear",this.exposure),W.setFloat("contrast",this.contrast),this.colorGradingTexture){W.setTexture("txColorTransform",this.colorGradingTexture);const Qt=this.colorGradingTexture.getSize().height;W.setFloat4("colorTransformSettings",(Qt-1)/Qt,.5/Qt,Qt,this.colorGradingTexture.level)}}clone(){return xt.Clone(()=>new a,this)}serialize(){return xt.Serialize(this)}static get VIGNETTEMODE_MULTIPLY(){return this._VIGNETTEMODE_MULTIPLY}static get VIGNETTEMODE_OPAQUE(){return this._VIGNETTEMODE_OPAQUE}},(()=>{const We=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[LM()],s=[ce()],c=[or("colorGradingTexture")],_=[ce()],x=[ce()],v=[ce()],C=[ce()],I=[ce()],V=[ce()],ae=[ce()],te=[ce()],q=[ce()],w=[ce()],K=[ce()],ve=[ce()],J=[ce()],Ne=[ce()],dt=[kM()],Ot=[ce()],ut=[ce()],ti=[ce()],ii=[ce()],fi=[ce()],si=[ce()],gr=[ce()],Os=[ce()],ns=[ce()],G=[ce()],ee(null,null,e,{kind:"field",name:"colorCurves",static:!1,private:!1,access:{has:W=>"colorCurves"in W,get:W=>W.colorCurves,set:(W,Ve)=>{W.colorCurves=Ve}},metadata:We},t,i),ee(null,null,s,{kind:"field",name:"_colorCurvesEnabled",static:!1,private:!1,access:{has:W=>"_colorCurvesEnabled"in W,get:W=>W._colorCurvesEnabled,set:(W,Ve)=>{W._colorCurvesEnabled=Ve}},metadata:We},n,o),ee(null,null,c,{kind:"field",name:"_colorGradingTexture",static:!1,private:!1,access:{has:W=>"_colorGradingTexture"in W,get:W=>W._colorGradingTexture,set:(W,Ve)=>{W._colorGradingTexture=Ve}},metadata:We},h,f),ee(null,null,_,{kind:"field",name:"_colorGradingEnabled",static:!1,private:!1,access:{has:W=>"_colorGradingEnabled"in W,get:W=>W._colorGradingEnabled,set:(W,Ve)=>{W._colorGradingEnabled=Ve}},metadata:We},m,g),ee(null,null,x,{kind:"field",name:"_colorGradingWithGreenDepth",static:!1,private:!1,access:{has:W=>"_colorGradingWithGreenDepth"in W,get:W=>W._colorGradingWithGreenDepth,set:(W,Ve)=>{W._colorGradingWithGreenDepth=Ve}},metadata:We},y,b),ee(null,null,v,{kind:"field",name:"_colorGradingBGR",static:!1,private:!1,access:{has:W=>"_colorGradingBGR"in W,get:W=>W._colorGradingBGR,set:(W,Ve)=>{W._colorGradingBGR=Ve}},metadata:We},E,R),ee(null,null,C,{kind:"field",name:"_exposure",static:!1,private:!1,access:{has:W=>"_exposure"in W,get:W=>W._exposure,set:(W,Ve)=>{W._exposure=Ve}},metadata:We},O,M),ee(null,null,I,{kind:"field",name:"_toneMappingEnabled",static:!1,private:!1,access:{has:W=>"_toneMappingEnabled"in W,get:W=>W._toneMappingEnabled,set:(W,Ve)=>{W._toneMappingEnabled=Ve}},metadata:We},P,L),ee(null,null,V,{kind:"field",name:"_toneMappingType",static:!1,private:!1,access:{has:W=>"_toneMappingType"in W,get:W=>W._toneMappingType,set:(W,Ve)=>{W._toneMappingType=Ve}},metadata:We},X,re),ee(null,null,ae,{kind:"field",name:"_contrast",static:!1,private:!1,access:{has:W=>"_contrast"in W,get:W=>W._contrast,set:(W,Ve)=>{W._contrast=Ve}},metadata:We},de,U),ee(null,null,te,{kind:"field",name:"_whiteBalanceEnabled",static:!1,private:!1,access:{has:W=>"_whiteBalanceEnabled"in W,get:W=>W._whiteBalanceEnabled,set:(W,Ve)=>{W._whiteBalanceEnabled=Ve}},metadata:We},Y,Z),ee(null,null,q,{kind:"field",name:"_temperature",static:!1,private:!1,access:{has:W=>"_temperature"in W,get:W=>W._temperature,set:(W,Ve)=>{W._temperature=Ve}},metadata:We},j,Q),ee(null,null,w,{kind:"field",name:"_tint",static:!1,private:!1,access:{has:W=>"_tint"in W,get:W=>W._tint,set:(W,Ve)=>{W._tint=Ve}},metadata:We},B,z),ee(null,null,K,{kind:"field",name:"vignetteStretch",static:!1,private:!1,access:{has:W=>"vignetteStretch"in W,get:W=>W.vignetteStretch,set:(W,Ve)=>{W.vignetteStretch=Ve}},metadata:We},ue,he),ee(null,null,ve,{kind:"field",name:"vignetteCenterX",static:!1,private:!1,access:{has:W=>"vignetteCenterX"in W,get:W=>W.vignetteCenterX,set:(W,Ve)=>{W.vignetteCenterX=Ve}},metadata:We},Le,ke),ee(null,null,J,{kind:"field",name:"vignetteCenterY",static:!1,private:!1,access:{has:W=>"vignetteCenterY"in W,get:W=>W.vignetteCenterY,set:(W,Ve)=>{W.vignetteCenterY=Ve}},metadata:We},_e,xe),ee(null,null,Ne,{kind:"field",name:"vignetteWeight",static:!1,private:!1,access:{has:W=>"vignetteWeight"in W,get:W=>W.vignetteWeight,set:(W,Ve)=>{W.vignetteWeight=Ve}},metadata:We},Qe,He),ee(null,null,dt,{kind:"field",name:"vignetteColor",static:!1,private:!1,access:{has:W=>"vignetteColor"in W,get:W=>W.vignetteColor,set:(W,Ve)=>{W.vignetteColor=Ve}},metadata:We},li,zt),ee(null,null,Ot,{kind:"field",name:"vignetteCameraFov",static:!1,private:!1,access:{has:W=>"vignetteCameraFov"in W,get:W=>W.vignetteCameraFov,set:(W,Ve)=>{W.vignetteCameraFov=Ve}},metadata:We},jt,Nt),ee(null,null,ut,{kind:"field",name:"_vignetteBlendMode",static:!1,private:!1,access:{has:W=>"_vignetteBlendMode"in W,get:W=>W._vignetteBlendMode,set:(W,Ve)=>{W._vignetteBlendMode=Ve}},metadata:We},ne,we),ee(null,null,ti,{kind:"field",name:"_vignetteEnabled",static:!1,private:!1,access:{has:W=>"_vignetteEnabled"in W,get:W=>W._vignetteEnabled,set:(W,Ve)=>{W._vignetteEnabled=Ve}},metadata:We},ci,hi),ee(null,null,ii,{kind:"field",name:"_ditheringEnabled",static:!1,private:!1,access:{has:W=>"_ditheringEnabled"in W,get:W=>W._ditheringEnabled,set:(W,Ve)=>{W._ditheringEnabled=Ve}},metadata:We},ui,Gt),ee(null,null,fi,{kind:"field",name:"_ditheringIntensity",static:!1,private:!1,access:{has:W=>"_ditheringIntensity"in W,get:W=>W._ditheringIntensity,set:(W,Ve)=>{W._ditheringIntensity=Ve}},metadata:We},qt,Wt),ee(null,null,si,{kind:"field",name:"_skipFinalColorClamp",static:!1,private:!1,access:{has:W=>"_skipFinalColorClamp"in W,get:W=>W._skipFinalColorClamp,set:(W,Ve)=>{W._skipFinalColorClamp=Ve}},metadata:We},Si,Mi),ee(null,null,gr,{kind:"field",name:"_applyByPostProcess",static:!1,private:!1,access:{has:W=>"_applyByPostProcess"in W,get:W=>W._applyByPostProcess,set:(W,Ve)=>{W._applyByPostProcess=Ve}},metadata:We},pr,xr),ee(null,null,Os,{kind:"field",name:"_isEnabled",static:!1,private:!1,access:{has:W=>"_isEnabled"in W,get:W=>W._isEnabled,set:(W,Ve)=>{W._isEnabled=Ve}},metadata:We},ws,Fs),ee(null,null,ns,{kind:"field",name:"outputTextureWidth",static:!1,private:!1,access:{has:W=>"outputTextureWidth"in W,get:W=>W.outputTextureWidth,set:(W,Ve)=>{W.outputTextureWidth=Ve}},metadata:We},Bs,$e),ee(null,null,G,{kind:"field",name:"outputTextureHeight",static:!1,private:!1,access:{has:W=>"outputTextureHeight"in W,get:W=>W.outputTextureHeight,set:(W,Ve)=>{W.outputTextureHeight=Ve}},metadata:We},Re,pt),We&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:We})})(),a.TONEMAPPING_STANDARD=0,a.TONEMAPPING_ACES=1,a.TONEMAPPING_KHR_PBR_NEUTRAL=2,a.PrepareUniforms=kD,a.PrepareSamplers=ND,a._VIGNETTEMODE_MULTIPLY=0,a._VIGNETTEMODE_OPAQUE=1,a})(),ky=!1;function Ny(a){const e=xt.Parse(()=>
vendor: 68,491 bytes, line 299
299new da,a,null,null);return a.vignetteCentreX!==void 0&&(e.vignetteCenterX=a.vignetteCentreX),a.vignetteCentreY!==void 0&&(e.vignetteCenterY=a.vignetteCentreY),e}function UD(){ky||(ky=!0,da.Parse=Ny,xt._ImageProcessingConfigurationParser=Ny,Lr("BABYLON.ImageProcessingConfiguration",da))}class Vi{constructor(e,t,i,s,n,o){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=s,this.sourceEvent=n,this.additionalData=o}static CreateNew(e,t,i){const s=e.getScene();return new Vi(e,s.pointerX,s.pointerY,s.meshUnderPointer||e,t,i)}static CreateNewFromSprite(e,t,i,s){return new Vi(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,s)}static CreateNewFromScene(e,t){return new Vi(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,i,s){return new Vi(e,t.x,t.y,null,i,s)}}class Uy{constructor(e){this._vertexBuffers={},this._activePostProcesses=[],this.onBeforeRenderObservable=new Me,this._scene=e}_prepareBuffers(){if(this._vertexBuffers[k.PositionKind])return;const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[k.PositionKind]=new k(this._scene.getEngine(),e,k.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 i=0;i<e.length;i++){const s=e[i];s&&t.push(s)}return t}_rebuild(){const e=this._vertexBuffers[k.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){const i=this._scene.activeCamera;return!i||(t=t||this._getActivePostProcesses(i._postProcesses),!t||t.length===0||!this._scene.postProcessesEnabled)?!1:(t[0].activate(i,e,t!=null),!0)}directRender(e,t=null,i=!1,s=0,n=0,o=!1,c=e.length){const h=this._scene.getEngine();for(let f=0;f<c;f++){f<e.length-1?e[f+1].activate(this._scene.activeCamera||this._scene,t?.texture):(t?h.bindFramebuffer(t,s,void 0,void 0,i,n):o||h.restoreDefaultFramebuffer(),h._debugInsertMarker?.(`post process ${e[f].name} output`));const _=e[f],m=_.apply();m&&(_.onBeforeRenderObservable.notifyObservers(m),this._prepareBuffers(),h.bindBuffers(this._vertexBuffers,this._indexBuffer,m),h.drawElementsType(0,0,6),_.onAfterRenderObservable.notifyObservers(m))}h.setDepthBuffer(!0),h.setDepthWrite(!0)}_finalizeFrame(e,t,i,s,n=!1){const o=this._scene.activeCamera;if(!o||(this.onBeforeRenderObservable.notifyObservers(this),s=s||this._getActivePostProcesses(o._postProcesses),s.length===0||!this._scene.postProcessesEnabled))return;const c=this._scene.getEngine();for(let h=0,f=s.length;h<f;h++){const _=s[h];if(h<f-1?_._outputTexture=s[h+1].activate(o,t?.texture):(t?(c.bindFramebuffer(t,i,void 0,void 0,n),_._outputTexture=t):(c.restoreDefaultFramebuffer(),_._outputTexture=null),c._debugInsertMarker?.(`post process ${s[h].name} output`)),e)break;const m=_.apply();m&&(_.onBeforeRenderObservable.notifyObservers(m),this._prepareBuffers(),c.bindBuffers(this._vertexBuffers,this._indexBuffer,m),c.drawElementsType(0,0,6),_.onAfterRenderObservable.notifyObservers(m))}c.setDepthBuffer(!0),c.setDepthWrite(!0),c.setAlphaMode(0)}dispose(){const e=this._vertexBuffers[k.PositionKind];e&&(e.dispose(),this._vertexBuffers[k.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)}}class _r{set opaqueSortCompareFn(e){e?this._opaqueSortCompareFn=e:this._opaqueSortCompareFn=_r.PainterSortCompare,this._renderOpaque=this._renderOpaqueSorted}set alphaTestSortCompareFn(e){e?this._alphaTestSortCompareFn=e:this._alphaTestSortCompareFn=_r.PainterSortCompare,this._renderAlphaTest=this._renderAlphaTestSorted}set transparentSortCompareFn(e){e?this._transparentSortCompareFn=e:this._transparentSortCompareFn=_r.defaultTransparentSortCompare,this._renderTransparent=this._renderTransparentSorted}constructor(e,t,i=null,s=null,n=null){this.index=e,this._opaqueSubMeshes=new Ts(256),this._transparentSubMeshes=new Ts(256),this._alphaTestSubMeshes=new Ts(256),this._depthOnlySubMeshes=new Ts(256),this._particleSystems=new Ts(256),this._spriteManagers=new Ts(256),this._empty=!0,this._edgesRenderers=new Na(16),this.disableDepthPrePass=!1,this._scene=t,this.opaqueSortCompareFn=i,this.alphaTestSortCompareFn=s,this.transparentSortCompareFn=n}render(e,t,i,s,n=!0,o=!0,c=!0,h=!0,f){if(e){e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);return}const _=this._scene.getEngine();n&&this._depthOnlySubMeshes.length!==0&&(_.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),_.setColorWrite(!0)),o&&this._opaqueSubMeshes.length!==0&&this._renderOpaque(this._opaqueSubMeshes),c&&this._alphaTestSubMeshes.length!==0&&this._renderAlphaTest(this._alphaTestSubMeshes);const m=_.getStencilBuffer();if(_.setStencilBuffer(!1),t&&this._renderSprites(),i&&this._renderParticles(s),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),h&&(f||this._transparentSubMeshes.length!==0||this._scene.useOrderIndependentTransparency)){if(_.setStencilBuffer(m),f)f(this._transparentSubMeshes,this);else if(this._scene.useOrderIndependentTransparency){const g=this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);g.length&&this._renderTransparent(g)}else this._renderTransparent(this._transparentSubMeshes);_.setAlphaMode(0)}if(_.setStencilBuffer(!1),o&&this._edgesRenderers.length){for(let g=0;g<this._edgesRenderers.length;g++)this._edgesRenderers.data[g].render();_.setAlphaMode(0)}_.setStencilBuffer(m)}_renderOpaqueSorted(e){_r._RenderSorted(e,this._opaqueSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderAlphaTestSorted(e){_r._RenderSorted(e,this._alphaTestSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderTransparentSorted(e){_r._RenderSorted(e,this._transparentSortCompareFn,this._scene.activeCamera,!0,this.disableDepthPrePass)}static _RenderSorted(e,t,i,s,n){let o=0,c;const h=i?i.globalPosition:_r._ZeroVector;if(s)for(;o<e.length;o++)c=e.data[o],c._alphaIndex=c.getMesh().alphaIndex,c._distanceToCamera=D.Distance(c.getBoundingInfo().boundingSphere.centerWorld,h);const f=e.length===e.data.length?e.data:e.data.slice(0,e.length);t&&f.sort(t);const _=f[0].getMesh().getScene();for(o=0;o<f.length;o++)if(c=f[o],!(_._activeMeshesFrozenButKeepClipping&&!c.isInFrustum(_._frustumPlanes))){if(s){const m=c.getMaterial();if(m&&m.needDepthPrePass&&!n){const g=m.getScene().getEngine();g.setColorWrite(!1),g.setAlphaMode(0),c.render(!1),g.setColorWrite(!0)}}c.render(s)}}static defaultTransparentSortCompare(e,t){return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:_r.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 i=e.getMesh(),s=t.getMesh();return i.material&&s.material?i.material.uniqueId-s.material.uniqueId:i.uniqueId-s.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,i){t===void 0&&(t=e.getMesh()),i===void 0&&(i=e.getMaterial()),i!=null&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTestingForMesh(t)?(i.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.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 i=0;i<this._particleSystems.length;i++){const s=this._particleSystems.data[i];if((t&&t.layerMask&s.layerMask)===0)continue;const n=s.emitter;(!n.position||!e||e.indexOf(n)!==-1)&&this._scene._activeParticles.addCount(s.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 i=this._spriteManagers.data[t];(e&&e.layerMask&i.layerMask)!==0&&i.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}}_r._ZeroVector=D.Zero();class zD{}class ss{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 zD,this._maintainStateBetweenFrames=!1,this._scene=e;for(let t=ss.MIN_RENDERINGGROUPS;t<ss.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,i,s,n=!0,o=!0,c=!0,h=!0,f){const _=this._renderingGroupInfo;if(_.scene=this._scene,_.camera=this._scene.activeCamera,_.renderingManager=this,this._scene.spriteManagers&&s)for(let m=0;m<this._scene.spriteManagers.length;m++){const g=this._scene.spriteManagers[m];this.dispatchSprites(g)}for(let m=ss.MIN_RENDERINGGROUPS;m<ss.MAX_RENDERINGGROUPS;m++){this._depthStencilBufferAlreadyCleaned=m===ss.MIN_RENDERINGGROUPS;const g=this._renderingGroups[m];if(!g||g._empty)continue;const x=1<<m;if(_.renderingGroupId=m,this._scene.onBeforeRenderingGroupObservable.notifyObservers(_,x),ss.AUTOCLEAR){const y=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(m):this._autoClearDepthStencil[m];y&&y.autoClear&&this._clearDepthStencilBuffer(y.depth,y.stencil)}for(const y of this._scene._beforeRenderingGroupDrawStage)y.action(m);g.render(e,s,i,t,n,o,c,h,f);for(const y of this._scene._afterRenderingGroupDrawStage)y.action(m);this._scene.onAfterRenderingGroupObservable.notifyObservers(_,x)}}reset(){if(!this.maintainStateBetweenFrames)for(let e=ss.MIN_RENDERINGGROUPS;e<ss.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepare()}}resetSprites(){if(!this.maintainStateBetweenFrames)for(let e=ss.MIN_RENDERINGGROUPS;e<ss.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=ss.MIN_RENDERINGGROUPS;e<ss.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.dispose()}}_prepareRenderingGroup(e){this._renderingGroups[e]===void 0&&(this._renderingGroups[e]=new _r(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,i){t===void 0&&(t=e.getMesh()),!(this.maintainStateBetweenFrames&&e._wasDispatched)&&(e._wasDispatched=!0,this.getRenderingGroup(t.renderingGroupId).dispatch(e,t,i))}setRenderingOrder(e,t=null,i=null,s=null){if(this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=i,this._customTransparentSortCompareFn[e]=s,this._renderingGroups[e]){const n=this._renderingGroups[e];n.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],n.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],n.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._autoClearDepthStencil[e]={autoClear:t,depth:i,stencil:s}}getAutoClearDepthStencilSetup(e){return this._autoClearDepthStencil[e]}}ss.MAX_RENDERINGGROUPS=4;ss.MIN_RENDERINGGROUPS=0;ss.AUTOCLEAR=!0;class ht{}ht.POINTERDOWN=1;ht.POINTERUP=2;ht.POINTERMOVE=4;ht.POINTERWHEEL=8;ht.POINTERPICK=16;ht.POINTERTAP=32;ht.POINTERDOUBLETAP=64;class h1{constructor(e,t){this.type=e,this.event=t}}class GD extends h1{constructor(e,t,i,s){super(e,t),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new Fe(i,s)}}class pn extends h1{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(e,t,i,s=null){super(e,t),this._pickInfo=i,this._inputManager=s}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}}class js{constructor(){this.hoverCursor="",this.actions=[],this.isRecursive=!1,this.disposeWhenUnowned=!0}static get HasTriggers(){for(const e in js.Triggers)if(Object.prototype.hasOwnProperty.call(js.Triggers,e))return!0;return!1}static get HasPickTriggers(){for(const e in js.Triggers)if(Object.prototype.hasOwnProperty.call(js.Triggers,e)){const t=parseInt(e);if(t>=1&&t<=7)return!0}return!1}static HasSpecificTrigger(e){for(const t in js.Triggers)if(Object.prototype.hasOwnProperty.call(js.Triggers,t)&&parseInt(t)===e)return!0;return!1}}js.Triggers={};class jc{}jc.KEYDOWN=1;jc.KEYUP=2;class cm{constructor(e,t){this.type=e,this.event=t}}class zy extends cm{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}}var je;(function(a){a[a.Generic=0]="Generic",a[a.Keyboard=1]="Keyboard",a[a.Mouse=2]="Mouse",a[a.Touch=3]="Touch",a[a.DualShock=4]="DualShock",a[a.Xbox=5]="Xbox",a[a.Switch=6]="Switch",a[a.DualSense=7]="DualSense"})(je||(je={}));var Ke;(function(a){a[a.Horizontal=0]="Horizontal",a[a.Vertical=1]="Vertical",a[a.LeftClick=2]="LeftClick",a[a.MiddleClick=3]="MiddleClick",a[a.RightClick=4]="RightClick",a[a.BrowserBack=5]="BrowserBack",a[a.BrowserForward=6]="BrowserForward",a[a.MouseWheelX=7]="MouseWheelX",a[a.MouseWheelY=8]="MouseWheelY",a[a.MouseWheelZ=9]="MouseWheelZ",a[a.Move=12]="Move"})(Ke||(Ke={}));var Gy;(function(a){a[a.Horizontal=0]="Horizontal",a[a.Vertical=1]="Vertical",a[a.LeftClick=2]="LeftClick",a[a.MiddleClick=3]="MiddleClick",a[a.RightClick=4]="RightClick",a[a.BrowserBack=5]="BrowserBack",a[a.BrowserForward=6]="BrowserForward",a[a.MouseWheelX=7]="MouseWheelX",a[a.MouseWheelY=8]="MouseWheelY",a[a.MouseWheelZ=9]="MouseWheelZ",a[a.DeltaHorizontal=10]="DeltaHorizontal",a[a.DeltaVertical=11]="DeltaVertical"})(Gy||(Gy={}));var Vy;(function(a){a[a.Cross=0]="Cross",a[a.Circle=1]="Circle",a[a.Square=2]="Square",a[a.Triangle=3]="Triangle",a[a.L1=4]="L1",a[a.R1=5]="R1",a[a.L2=6]="L2",a[a.R2=7]="R2",a[a.Share=8]="Share",a[a.Options=9]="Options",a[a.L3=10]="L3",a[a.R3=11]="R3",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.TouchPad=17]="TouchPad",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(Vy||(Vy={}));var Hy;(function(a){a[a.Cross=0]="Cross",a[a.Circle=1]="Circle",a[a.Square=2]="Square",a[a.Triangle=3]="Triangle",a[a.L1=4]="L1",a[a.R1=5]="R1",a[a.L2=6]="L2",a[a.R2=7]="R2",a[a.Create=8]="Create",a[a.Options=9]="Options",a[a.L3=10]="L3",a[a.R3=11]="R3",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.TouchPad=17]="TouchPad",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(Hy||(Hy={}));var jy;(function(a){a[a.A=0]="A",a[a.B=1]="B",a[a.X=2]="X",a[a.Y=3]="Y",a[a.LB=4]="LB",a[a.RB=5]="RB",a[a.LT=6]="LT",a[a.RT=7]="RT",a[a.Back=8]="Back",a[a.Start=9]="Start",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.LStickXAxis=17]="LStickXAxis",a[a.LStickYAxis=18]="LStickYAxis",a[a.RStickXAxis=19]="RStickXAxis",a[a.RStickYAxis=20]="RStickYAxis"})(jy||(jy={}));var Wy;(function(a){a[a.B=0]="B",a[a.A=1]="A",a[a.Y=2]="Y",a[a.X=3]="X",a[a.L=4]="L",a[a.R=5]="R",a[a.ZL=6]="ZL",a[a.ZR=7]="ZR",a[a.Minus=8]="Minus",a[a.Plus=9]="Plus",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.Capture=17]="Capture",a[a.LStickXAxis=18]="LStickXAxis",a[a.LStickYAxis=19]="LStickYAxis",a[a.RStickXAxis=20]="RStickXAxis",a[a.RStickYAxis=21]="RStickYAxis"})(Wy||(Wy={}));var Xy;(function(a){a[a.PointerMove=0]="PointerMove",a[a.PointerDown=1]="PointerDown",a[a.PointerUp=2]="PointerUp"})(Xy||(Xy={}));class qc{}qc.DOM_DELTA_PIXEL=0;qc.DOM_DELTA_LINE=1;qc.DOM_DELTA_PAGE=2;class Ua{static CreateDeviceEvent(e,t,i,s,n,o,c){switch(e){case je.Keyboard:return this._CreateKeyboardEvent(i,s,n,o);case je.Mouse:if(i===Ke.MouseWheelX||i===Ke.MouseWheelY||i===Ke.MouseWheelZ)return this._CreateWheelEvent(e,t,i,s,n,o);case je.Touch:return this._CreatePointerEvent(e,t,i,s,n,o,c);default:throw`Unable to generate event for device ${je[e]}`}}static _CreatePointerEvent(e,t,i,s,n,o,c){const h=this._CreateMouseEvent(e,t,i,s,n,o);e===je.Mouse?(h.deviceType=je.Mouse,h.pointerId=1,h.pointerType="mouse"):(h.deviceType=je.Touch,h.pointerId=c??t,h.pointerType="touch");let f=0;return f+=n.pollInput(e,t,Ke.LeftClick),f+=n.pollInput(e,t,Ke.RightClick)*2,f+=n.pollInput(e,t,Ke.MiddleClick)*4,h.buttons=f,i===Ke.Move?h.type="pointermove":i>=Ke.LeftClick&&i<=Ke.RightClick&&(h.type=s===1?"pointerdown":"pointerup",h.button=i-2),h}static _CreateWheelEvent(e,t,i,s,n,o){const c=this._CreateMouseEvent(e,t,i,s,n,o);switch(c.pointerId=1,c.type="wheel",c.deltaMode=qc.DOM_DELTA_PIXEL,c.deltaX=0,c.deltaY=0,c.deltaZ=0,i){case Ke.MouseWheelX:c.deltaX=s;break;case Ke.MouseWheelY:c.deltaY=s;break;case Ke.MouseWheelZ:c.deltaZ=s;break}return c}static _CreateMouseEvent(e,t,i,s,n,o){const c=this._CreateEvent(o),h=n.pollInput(e,t,Ke.Horizontal),f=n.pollInput(e,t,Ke.Vertical);return o?(c.movementX=0,c.movementY=0,c.offsetX=c.movementX-o.getBoundingClientRect().x,c.offsetY=c.movementY-o.getBoundingClientRect().y):(c.movementX=n.pollInput(e,t,10),c.movementY=n.pollInput(e,t,11),c.offsetX=0,c.offsetY=0),this._CheckNonCharacterKeys(c,n),c.clientX=h,c.clientY=f,c.x=h,c.y=f,c.deviceType=e,c.deviceSlot=t,c.inputIndex=i,c}static _CreateKeyboardEvent(e,t,i,s){const n=this._CreateEvent(s);return this._CheckNonCharacterKeys(n,i),n.deviceType=je.Keyboard,n.deviceSlot=0,n.inputIndex=e,n.type=t===1?"keydown":"keyup",n.key=String.fromCharCode(e),n.keyCode=e,n}static _CheckNonCharacterKeys(e,t){const i=t.isDeviceAvailable(je.Keyboard),s=i&&t.pollInput(je.Keyboard,0,18)===1,n=i&&t.pollInput(je.Keyboard,0,17)===1,o=i&&(t.pollInput(je.Keyboard,0,91)===1||t.pollInput(je.Keyboard,0,92)===1||t.pollInput(je.Keyboard,0,93)===1),c=i&&t.pollInput(je.Keyboard,0,16)===1;e.altKey=s,e.ctrlKey=n,e.metaKey=o,e.shiftKey=c}static _CreateEvent(e){const t={};return t.preventDefault=()=>{},t.target=e,t}}class VD{constructor(e,t,i){this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(s,n,o,c)=>{const h=Ua.CreateDeviceEvent(s,n,o,c,this);i(s,n,h)}):this._createDummyNativeInput()}pollInput(e,t,i){return this._nativeInput.pollInput(e,t,i)}isDeviceAvailable(e){return e===je.Mouse||e===je.Touch}dispose(){this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}const Yy=255,qy=Object.keys(Ke).length/2;class HD{constructor(e,t,i,s){this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=bt.IsSafari(),this._usingMacOs=qo()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),this._keyboardDownEvent=n=>{},this._keyboardUpEvent=n=>{},this._keyboardBlurEvent=n=>{},this._pointerMoveEvent=n=>{},this._pointerDownEvent=n=>{},this._pointerUpEvent=n=>{},this._pointerCancelEvent=n=>{},this._pointerCancelTouch=n=>{},this._pointerLeaveEvent=n=>{},this._pointerWheelEvent=n=>{},this._pointerBlurEvent=n=>{},this._pointerMacOsChromeOutEvent=n=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=qo()&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,this._isUsingChromium=qo()&&navigator.userAgent&&navigator.userAgent.indexOf("Chrome")!==-1,this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=n=>{},this._gamepadDisconnectedEvent=n=>{},this._eventPrefix=bt.GetPointerPrefix(e),this._engine=e,this._onDeviceConnected=t,this._onDeviceDisconnected=i,this._onInputChanged=s,this._mouseId=this._isUsingFirefox?0:1,this._enableEvents(),this._usingMacOs&&(this._metaKeys=[]),this._engine._onEngineViewChanged||(this._engine._onEngineViewChanged=()=>{this._enableEvents()})}pollInput(e,t,i){const s=this._inputs[e][t];if(!s)throw`Unable to find device ${je[e]}`;e>=je.DualShock&&e<=je.DualSense&&this._updateDevice(e,t,i);const n=s[i];if(n===void 0)throw`Unable to find input ${i} for device ${je[e]} in slot ${t}`;return i===Ke.Move&&bt.Warn("Unable to provide information for PointerInput.Move.  Try using PointerInput.Horizontal or PointerInput.Vertical for move data."),n}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 i in t){const s=+i,n=t[s];if(n)for(let o=0;o<n.length;o++)n[o]=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(je.Mouse,0,0,0)}_addGamePad(e){const t=this._getGamepadDeviceType(e.id),i=e.index;this._gamepads=this._gamepads||new Array(e.index+1),this._registerDevice(t,i,e.buttons.length+e.axes.length),this._gamepads[i]=t}_addPointerDevice(e,t,i,s){this._pointerActive||(this._pointerActive=!0),this._registerDevice(e,t,qy);const n=this._inputs[e][t];n[0]=i,n[1]=s}_registerDevice(e,t,i){if(t===void 0)throw`Unable to register device ${je[e]} to undefined slot.`;if(this._inputs[e]||(this._inputs[e]={}),!this._inputs[e][t]){const s=new Array(i);s.fill(0),this._inputs[e][t]=s,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(je.Keyboard,0,Yy));const t=this._inputs[je.Keyboard][0];if(t){t[e.keyCode]=1;const i=e;i.inputIndex=e.keyCode,this._usingMacOs&&e.metaKey&&e.key!=="Meta"&&(this._metaKeys.includes(e.keyCode)||this._metaKeys.push(e.keyCode)),this._onInputChanged(je.Keyboard,0,i)}},this._keyboardUpEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(je.Keyboard,0,Yy));const t=this._inputs[je.Keyboard][0];if(t){t[e.keyCode]=0;const i=e;if(i.inputIndex=e.keyCode,this._usingMacOs&&e.key==="Meta"&&this._metaKeys.length>0){for(const s of this._metaKeys){const n=Ua.CreateDeviceEvent(je.Keyboard,0,s,0,this,this._elementToAttachTo);t[s]=0,this._onInputChanged(je.Keyboard,0,n)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(je.Keyboard,0,i)}},this._keyboardBlurEvent=()=>{if(this._keyboardActive){const e=this._inputs[je.Keyboard][0];for(let t=0;t<e.length;t++)if(e[t]!==0){e[t]=0;const i=Ua.CreateDeviceEvent(je.Keyboard,0,t,0,this,this._elementToAttachTo);this._onInputChanged(je.Keyboard,0,i)}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=qo()&&navigator.maxTouchPoints||2,this._activeTouchIds||(this._activeTouchIds=new Array(this._maxTouchPoints));for(let i=0;i<this._maxTouchPoints;i++)this._activeTouchIds[i]=-1;this._pointerMoveEvent=i=>{const s=this._getPointerType(i);let n=s===je.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===je.Touch&&n===-1){if(i.buttons===0)return;const c=this._activeTouchIds.indexOf(-1);if(c>=0)n=c,this._activeTouchIds[c]=i.pointerId,this._onDeviceConnected(s,n);else{bt.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][n]||this._addPointerDevice(s,n,i.clientX,i.clientY);const o=this._inputs[s][n];if(o){const c=i;c.inputIndex=Ke.Move,o[Ke.Horizontal]=i.clientX,o[Ke.Vertical]=i.clientY,s===je.Touch&&o[Ke.LeftClick]===0&&(o[Ke.LeftClick]=1),i.pointerId===void 0&&(i.pointerId=this._mouseId),this._onInputChanged(s,n,c),!this._usingSafari&&i.button!==-1&&(c.inputIndex=i.button+2,o[i.button+2]=o[i.button+2]?0:1,this._onInputChanged(s,n,c))}},this._pointerDownEvent=i=>{const s=this._getPointerType(i);let n=s===je.Mouse?0:i.pointerId;if(s===je.Touch){let c=this._activeTouchIds.indexOf(i.pointerId);if(c===-1&&(c=this._activeTouchIds.indexOf(-1)),c>=0)n=c,this._activeTouchIds[c]=i.pointerId;else{bt.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][n]?s===je.Touch&&this._onDeviceConnected(s,n):this._addPointerDevice(s,n,i.clientX,i.clientY);const o=this._inputs[s][n];if(o){const c=o[Ke.Horizontal],h=o[Ke.Vertical];if(s===je.Mouse){if(i.pointerId===void 0&&(i.pointerId=this._mouseId),!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(this._mouseId)}catch{}}else if(i.pointerId&&!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(i.pointerId)}catch{}o[Ke.Horizontal]=i.clientX,o[Ke.Vertical]=i.clientY,o[i.button+2]=1;const f=i;f.inputIndex=i.button+2,this._onInputChanged(s,n,f),(c!==i.clientX||h!==i.clientY)&&(f.inputIndex=Ke.Move,this._onInputChanged(s,n,f))}},this._pointerUpEvent=i=>{const s=this._getPointerType(i),n=s===je.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===je.Touch){if(n===-1)return;this._activeTouchIds[n]=-1}const o=this._inputs[s]?.[n];let c=i.button,h=o&&o[c+2]!==0;if(!h&&this._isUsingFirefox&&this._usingMacOs&&o&&(c=c===2?0:2,h=o[c+2]!==0),h){const f=o[Ke.Horizontal],_=o[Ke.Vertical];o[Ke.Horizontal]=i.clientX,o[Ke.Vertical]=i.clientY,o[c+2]=0;const m=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),(f!==i.clientX||_!==i.clientY)&&(m.inputIndex=Ke.Move,this._onInputChanged(s,n,m)),m.inputIndex=c+2,s===je.Mouse&&this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)?this._elementToAttachTo.releasePointerCapture(this._mouseId):i.pointerId&&this._elementToAttachTo.hasPointerCapture?.(i.pointerId)&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._onInputChanged(s,n,m),s===je.Touch&&this._onDeviceDisconnected(s,n)}},this._pointerCancelTouch=i=>{const s=this._activeTouchIds.indexOf(i);if(s===-1)return;this._elementToAttachTo.hasPointerCapture?.(i)&&this._elementToAttachTo.releasePointerCapture(i),this._inputs[je.Touch][s][Ke.LeftClick]=0;const n=Ua.CreateDeviceEvent(je.Touch,s,Ke.LeftClick,0,this,this._elementToAttachTo,i);this._onInputChanged(je.Touch,s,n),this._activeTouchIds[s]=-1,this._onDeviceDisconnected(je.Touch,s)},this._pointerCancelEvent=i=>{if(i.pointerType==="mouse"){const s=this._inputs[je.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let n=Ke.LeftClick;n<=Ke.BrowserForward;n++)if(s[n]===1){s[n]=0;const o=Ua.CreateDeviceEvent(je.Mouse,0,n,0,this,this._elementToAttachTo);this._onInputChanged(je.Mouse,0,o)}}else this._pointerCancelTouch(i.pointerId)},this._pointerLeaveEvent=i=>{i.pointerType==="pen"&&this._pointerCancelTouch(i.pointerId)},this._wheelEventName="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=!1;const t=function(){};try{const i=Object.defineProperty({},"passive",{get:function(){e=!0}});this._elementToAttachTo.addEventListener("test",t,i),this._elementToAttachTo.removeEventListener("test",t,i)}catch{}this._pointerBlurEvent=()=>{if(this.isDeviceAvailable(je.Mouse)){const i=this._inputs[je.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let s=Ke.LeftClick;s<=Ke.BrowserForward;s++)if(i[s]===1){i[s]=0;const n=Ua.CreateDeviceEvent(je.Mouse,0,s,0,this,this._elementToAttachTo);this._onInputChanged(je.Mouse,0,n)}}if(this.isDeviceAvailable(je.Touch)){const i=this._inputs[je.Touch];for(let s=0;s<this._activeTouchIds.length;s++){const n=this._activeTouchIds[s];if(this._elementToAttachTo.hasPointerCapture?.(n)&&this._elementToAttachTo.releasePointerCapture(n),n!==-1&&i[s]?.[Ke.LeftClick]===1){i[s][Ke.LeftClick]=0;const o=Ua.CreateDeviceEvent(je.Touch,s,Ke.LeftClick,0,this,this._elementToAttachTo,n);this._onInputChanged(je.Touch,s,o),this._activeTouchIds[s]=-1,this._onDeviceDisconnected(je.Touch,s)}}}},this._pointerWheelEvent=i=>{const s=je.Mouse,n=0;this._inputs[s]||(this._inputs[s]=[]),this._inputs[s][n]||(this._pointerActive=!0,this._registerDevice(s,n,qy));const o=this._inputs[s][n];if(o){o[Ke.MouseWheelX]=i.deltaX||0,o[Ke.MouseWheelY]=i.deltaY||i.wheelDelta||0,o[Ke.MouseWheelZ]=i.deltaZ||0;const c=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),o[Ke.MouseWheelX]!==0&&(c.inputIndex=Ke.MouseWheelX,this._onInputChanged(s,n,c)),o[Ke.MouseWheelY]!==0&&(c.inputIndex=Ke.MouseWheelY,this._onInputChanged(s,n,c)),o[Ke.MouseWheelZ]!==0&&(c.inputIndex=Ke.MouseWheelZ,this._onInputChanged(s,n,c))}},this._usingMacOs&&this._isUsingChromium&&(this._pointerMacOsChromeOutEvent=i=>{i.buttons>1&&this._pointerCancelEvent(i)},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(je.Mouse)){const i=this._inputs[je.Mouse][0];i[Ke.MouseWheelX]=0,i[Ke.MouseWheelY]=0,i[Ke.MouseWheelZ]=0}})}_handleGamepadActions(){this._gamepadConnectedEvent=e=>{this._addGamePad(e.gamepad)},this._gamepadDisconnectedEvent=e=>{if(this._gamepads){const t=this._getGamepadDeviceType(e.gamepad.id),i=e.gamepad.index;this._unregisterDevice(t,i),delete this._gamepads[i]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)}_updateDevice(e,t,i){const s=navigator.getGamepads()[t];if(s&&e===this._gamepads[t]){const n=this._inputs[e][t];i>=s.buttons.length?n[i]=s.axes[i-s.buttons.length].valueOf():n[i]=s.buttons[i].value}}_getGamepadDeviceType(e){return e.indexOf("054c")!==-1?e.indexOf("0ce6")!==-1?je.DualSense:je.DualShock:e.indexOf("Xbox One")!==-1||e.search("Xbox 360")!==-1||e.search("xinput")!==-1||e.indexOf("045e")!==-1&&e.indexOf("Surface Dock")===-1?je.Xbox:e.indexOf("057e")!==-1?je.Switch:je.Generic}_getPointerType(e){let t=je.Mouse;return(e.pointerType==="touch"||e.pointerType==="pen"||e.touches)&&(t=je.Touch),t}}class Ky{constructor(e,t,i=0){this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new Me,this._deviceInputSystem=e}getInput(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}class jD{constructor(e){this._registeredManagers=new Array,this._refCount=0,this.registerManager=o=>{for(let c=0;c<this._devices.length;c++){const h=this._devices[c];for(const f in h){const _=+f;o._addDevice(new Ky(this._deviceInputSystem,c,_))}}this._registeredManagers.push(o)},this.unregisterManager=o=>{const c=this._registeredManagers.indexOf(o);c>-1&&this._registeredManagers.splice(c,1)};const t=Object.keys(je).length/2;this._devices=new Array(t);const i=(o,c)=>{this._devices[o]||(this._devices[o]=new Array),this._devices[o][c]||(this._devices[o][c]=c);for(const h of this._registeredManagers){const f=new Ky(this._deviceInputSystem,o,c);h._addDevice(f)}},s=(o,c)=>{this._devices[o]?.[c]&&delete this._devices[o][c];for(const h of this._registeredManagers)h._removeDevice(o,c)},n=(o,c,h)=>{if(h)for(const f of this._registeredManagers)f._onInputChanged(o,c,h)};typeof _native<"u"?this._deviceInputSystem=new VD(i,s,n):this._deviceInputSystem=new HD(e,i,s,n)}dispose(){this._deviceInputSystem.dispose()}}class WD{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(je).length/2;this._devices=new Array(t),this._firstDevice=new Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new jD(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new Me(i=>{for(const s of this._devices)if(s)for(const n of s)n&&this.onDeviceConnectedObservable.notifyObserver(i,n)}),this.onDeviceDisconnectedObservable=new Me,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 i=this._devices[e]?.[t];this.onDeviceDisconnectedObservable.notifyObservers(i),this._devices[e]?.[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,i){this._devices[e]?.[t]?.onInputChangedObservable.notifyObservers(i)}_updateFirstDevices(e){switch(e){case je.Keyboard:case je.Mouse:this._firstDevice[e]=0;break;case je.Touch:case je.DualSense:case je.DualShock:case je.Xbox:case je.Switch:case je.Generic:{delete this._firstDevice[e];const t=this._devices[e];if(t){for(let i=0;i<t.length;i++)if(t[i]){this._firstDevice[e]=i;break}}break}}}}class u1{}u1._IsPickingAvailable=!1;class Zy{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 pi{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 Fe(0,0),this._previousStartingPointerPosition=new Fe(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||mt.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 Fe(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 i=this._scene,s=i.getEngine(),n=s.getInputElement();n&&(n.tabIndex=s.canvasTabIndex,i.doNotHandleCursors||(n.style.cursor=i.defaultCursor)),this._setCursorAndPointerOverMesh(e,t,i);for(const h of i._pointerMoveStage){e=e||this._pickMove(t);const f=!!e?.pickedMesh;e=h.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,f,n)}const o=t.inputIndex>=Ke.MouseWheelX&&t.inputIndex<=Ke.MouseWheelZ?ht.POINTERWHEEL:ht.POINTERMOVE;i.onPointerMove&&(e=e||this._pickMove(t),i.onPointerMove(t,e,o));let c;e?(c=new pn(o,t,e),this._setRayOnPointerInfo(e,t)):(c=new pn(o,t,null,this),this._movePointerInfo=c),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(c,o)}_setRayOnPointerInfo(e,t){const i=this._scene;e&&u1._IsPickingAvailable&&(e.ray||(e.ray=i.createPickingRay(t.offsetX,t.offsetY,se.Identity(),i.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,i){const s=this._scene,n=new GD(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(n.originalPickingInfo=e,n.ray=e.ray,t.pointerType==="xr-near"&&e.originMesh&&(n.nearInteractionPickingInfo=e)),s.onPrePointerObservable.notifyObservers(n,i),!!n.skipOnPointerObservable}_pickMove(e){const t=this._scene,i=t.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,t.pointerMovePredicate,t.pointerMoveFastCheck,t.cameraToUseForPointers,t.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(i,e,t),i}_setCursorAndPointerOverMesh(e,t,i){const n=i.getEngine().getInputElement();if(e?.pickedMesh){if(this.setPointerOverMesh(e.pickedMesh,t.pointerId,e,t),!i.doNotHandleCursors&&n&&this._pointerOverMesh){const o=this._pointerOverMesh._getActionManagerForTrigger();o&&o.hasPointerTriggers&&(n.style.cursor=o.hoverCursor||i.hoverCursor)}}else this.setPointerOverMesh(null,t.pointerId,e,t)}simulatePointerMove(e,t){const i=new PointerEvent("pointermove",t);i.inputIndex=Ke.Move,!this._checkPrePointerObservable(e,i,ht.POINTERMOVE)&&this._processPointerMove(e,i)}simulatePointerDown(e,t){const i=new PointerEvent("pointerdown",t);i.inputIndex=i.button+2,!this._checkPrePointerObservable(e,i,ht.POINTERDOWN)&&this._processPointerDown(e,i)}_processPointerDown(e,t){const i=this._scene;if(e?.pickedMesh){this._pickedDownMesh=e.pickedMesh;const o=e.pickedMesh._getActionManagerForTrigger();if(o){if(o.hasPickTriggers)switch(o.processTrigger(5,new Vi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e)),t.button){case 0:o.processTrigger(2,new Vi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break;case 1:o.processTrigger(4,new Vi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break;case 2:o.processTrigger(3,new Vi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break}o.hasSpecificTrigger(8)&&window.setTimeout(()=>{const c=i.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,h=>h.isPickable&&h.isVisible&&h.isReady()&&h.actionManager&&h.actionManager.hasSpecificTrigger(8)&&h===this._pickedDownMesh,!1,i.cameraToUseForPointers);c?.pickedMesh&&o&&this._activePointerIdsCount!==0&&Date.now()-this._startingPointerTime>pi.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,o.processTrigger(8,Vi.CreateNew(c.pickedMesh,t)))},pi.LongPressDelay)}}else for(const o of i._pointerDownStage)e=o.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,!1);let s;const n=ht.POINTERDOWN;e?(i.onPointerDown&&i.onPointerDown(t,e,n),s=new pn(n,t,e),this._setRayOnPointerInfo(e,t)):s=new pn(n,t,null,this),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(s,n)}_isPointerSwiping(){return this._isSwiping}simulatePointerUp(e,t,i){const s=new PointerEvent("pointerup",t);s.inputIndex=Ke.Move;const n=new Zy;i?n.doubleClick=!0:n.singleClick=!0,!this._checkPrePointerObservable(e,s,ht.POINTERUP)&&this._processPointerUp(e,s,n)}_processPointerUp(e,t,i){const s=this._scene;if(e?.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(s.onPointerPick&&s.onPointerPick(t,e),i.singleClick&&!i.ignore&&s.onPointerObservable.observers.length>this._cameraObserverCount)){const o=ht.POINTERPICK,c=new pn(o,t,e);this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(c,o)}const n=e.pickedMesh._getActionManagerForTrigger();if(n&&!i.ignore){n.processTrigger(7,Vi.CreateNew(e.pickedMesh,t,e)),!i.hasSwiped&&i.singleClick&&n.processTrigger(1,Vi.CreateNew(e.pickedMesh,t,e));const o=e.pickedMesh._getActionManagerForTrigger(6);i.doubleClick&&o&&o.processTrigger(6,Vi.CreateNew(e.pickedMesh,t,e))}}else if(!i.ignore)for(const n of s._pointerUpStage)e=n.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,i.doubleClick);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){const n=this._pickedDownMesh._getActionManagerForTrigger(16);n&&n.processTrigger(16,Vi.CreateNew(this._pickedDownMesh,t))}if(!i.ignore){const n=new pn(ht.POINTERUP,t,e);if(this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(n,ht.POINTERUP),s.onPointerUp&&s.onPointerUp(t,e,ht.POINTERUP),!i.hasSwiped&&!this._skipPointerTap&&!this._isMultiTouchGesture){let o=0;if(i.singleClick?o=ht.POINTERTAP:i.doubleClick&&(o=ht.POINTERDOUBLETAP),o){const c=new pn(o,t,e);s.onPointerObservable.hasObservers()&&s.onPointerObservable.hasSpecificMask(o)&&s.onPointerObservable.notifyObservers(c,o)}}}}isPointerCaptured(e=0){return this._pointerCaptures[e]}attachControl(e=!0,t=!0,i=!0,s=null){const n=this._scene,o=n.getEngine();s||(s=o.getInputElement()),this._alreadyAttached&&this.detachControl(),s&&(this._alreadyAttachedTo=s),this._deviceSourceManager=new WD(o),this._initActionManager=c=>{if(!this._meshPickProceed){const h=n.skipPointerUpPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerUp?null:n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerUpPredicate,n.pointerUpFastCheck,n.cameraToUseForPointers,n.pointerUpTrianglePredicate);this._currentPickResult=h,h&&(c=h.hit&&h.pickedMesh?h.pickedMesh._getActionManagerForTrigger():null),this._meshPickProceed=!0}return c},this._delayedSimpleClick=(c,h,f)=>{if((Date.now()-this._previousStartingPointerTime>pi.DoubleClickDelay&&!this._doubleClickOccured||c!==this._previousButtonPressed)&&(this._doubleClickOccured=!1,h.singleClick=!0,h.ignore=!1,this._delayedClicks[c])){const _=this._delayedClicks[c].evt,m=ht.POINTERTAP,g=new pn(m,_,this._currentPickResult);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(m)&&n.onPointerObservable.notifyObservers(g,m),this._delayedClicks[c]=null}},this._initClickEvent=(c,h,f,_)=>{const m=new Zy;this._currentPickResult=null;let g=null,x=c.hasSpecificMask(ht.POINTERPICK)||h.hasSpecificMask(ht.POINTERPICK)||c.hasSpecificMask(ht.POINTERTAP)||h.hasSpecificMask(ht.POINTERTAP)||c.hasSpecificMask(ht.POINTERDOUBLETAP)||h.hasSpecificMask(ht.POINTERDOUBLETAP);!x&&js&&(g=this._initActionManager(g,m),g&&(x=g.hasPickTriggers));let y=!1;if(x=x&&!this._isMultiTouchGesture,x){const b=f.button;if(m.hasSwiped=this._isPointerSwiping(),!m.hasSwiped){let v=!pi.ExclusiveDoubleClickMode;if(v||(v=!c.hasSpecificMask(ht.POINTERDOUBLETAP)&&!h.hasSpecificMask(ht.POINTERDOUBLETAP),v&&!js.HasSpecificTrigger(6)&&(g=this._initActionManager(g,m),g&&(v=!g.hasSpecificTrigger(6)))),v)(Date.now()-this._previousStartingPointerTime>pi.DoubleClickDelay||b!==this._previousButtonPressed)&&(m.singleClick=!0,_(m,this._currentPickResult),y=!0);else{const R={evt:f,clickInfo:m,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,b,m,_),pi.DoubleClickDelay)};this._delayedClicks[b]=R}let E=c.hasSpecificMask(ht.POINTERDOUBLETAP)||h.hasSpecificMask(ht.POINTERDOUBLETAP);!E&&js.HasSpecificTrigger(6)&&(g=this._initActionManager(g,m),g&&(E=g.hasSpecificTrigger(6))),E&&(b===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime<pi.DoubleClickDelay&&!this._doubleClickOccured?(!m.hasSwiped&&!this._isPointerSwiping()?(this._previousStartingPointerTime=0,this._doubleClickOccured=!0,m.doubleClick=!0,m.ignore=!1,pi.ExclusiveDoubleClickMode&&this._delayedClicks[b]&&(clearTimeout(this._delayedClicks[b]?.timeoutId),this._delayedClicks[b]=null),_(m,this._currentPickResult)):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=b,pi.ExclusiveDoubleClickMode?(this._delayedClicks[b]&&(clearTimeout(this._delayedClicks[b]?.timeoutId),this._delayedClicks[b]=null),_(m,this._previousPickResult)):_(m,this._currentPickResult)),y=!0):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=b))}}y||_(m,this._currentPickResult)},this._onPointerMove=c=>{if(this._updatePointerPosition(c),!this._isSwiping&&this._swipeButtonPressed!==-1&&(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>pi.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>pi.DragMovementThreshold),o.isPointerLock&&o._verifyPointerLock(),this._checkPrePointerObservable(null,c,c.inputIndex>=Ke.MouseWheelX&&c.inputIndex<=Ke.MouseWheelZ?ht.POINTERWHEEL:ht.POINTERMOVE)||!n.cameraToUseForPointers&&!n.activeCamera)return;if(n.skipPointerMovePicking){this._processPointerMove(new zc,c);return}n.pointerMovePredicate||(n.pointerMovePredicate=f=>f.isPickable&&f.isVisible&&f.isReady()&&f.isEnabled()&&(f.enablePointerMoveEvents||n.constantlyUpdateMeshUnderPointer||f._getActionManagerForTrigger()!==null)&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&f.layerMask)!==0));const h=n._registeredActions>0||n.constantlyUpdateMeshUnderPointer?this._pickMove(c):null;this._processPointerMove(h,c)},this._onPointerDown=c=>{const h=this._activePointerIds.indexOf(-1);if(h===-1?this._activePointerIds.push(c.pointerId):this._activePointerIds[h]=c.pointerId,this._activePointerIdsCount++,this._pickedDownMesh=null,this._meshPickProceed=!1,pi.ExclusiveDoubleClickMode){for(let _=0;_<this._delayedClicks.length;_++)if(this._delayedClicks[_])if(c.button===_)clearTimeout(this._delayedClicks[_]?.timeoutId);else{const m=this._delayedClicks[_].clickInfo;this._doubleClickOccured=!1,m.singleClick=!0,m.ignore=!1;const g=this._delayedClicks[_].evt,x=ht.POINTERTAP,y=new pn(x,g,this._currentPickResult);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(x)&&n.onPointerObservable.notifyObservers(y,x),this._delayedClicks[_]=null}}if(this._updatePointerPosition(c),this._swipeButtonPressed===-1&&(this._swipeButtonPressed=c.button),n.preventDefaultOnPointerDown&&s&&(c.preventDefault(),s.focus()),this._startingPointerPosition.x=this._pointerX,this._startingPointerPosition.y=this._pointerY,this._startingPointerTime=Date.now(),this._checkPrePointerObservable(null,c,ht.POINTERDOWN)||!n.cameraToUseForPointers&&!n.activeCamera)return;this._pointerCaptures[c.pointerId]=!0,n.pointerDownPredicate||(n.pointerDownPredicate=_=>_.isPickable&&_.isVisible&&_.isReady()&&_.isEnabled()&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&_.layerMask)!==0)),this._pickedDownMesh=null;let f;n.skipPointerDownPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerDown?f=new zc:f=n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerDownPredicate,n.pointerDownFastCheck,n.cameraToUseForPointers,n.pointerDownTrianglePredicate),this._processPointerDown(f,c)},this._onPointerUp=c=>{const h=this._activePointerIds.indexOf(c.pointerId);h!==-1&&(this._activePointerIds[h]=-1,this._activePointerIdsCount--,this._pickedUpMesh=null,this._meshPickProceed=!1,this._updatePointerPosition(c),n.preventDefaultOnPointerUp&&s&&(c.preventDefault(),s.focus()),this._initClickEvent(n.onPrePointerObservable,n.onPointerObservable,c,(f,_)=>{if(n.onPrePointerObservable.hasObservers()&&(this._skipPointerTap=!1,!f.ignore)){if(this._checkPrePointerObservable(null,c,ht.POINTERUP)){this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1),c.buttons===0&&(this._pointerCaptures[c.pointerId]=!1);return}f.hasSwiped||(f.singleClick&&n.onPrePointerObservable.hasSpecificMask(ht.POINTERTAP)&&this._checkPrePointerObservable(null,c,ht.POINTERTAP)&&(this._skipPointerTap=!0),f.doubleClick&&n.onPrePointerObservable.hasSpecificMask(ht.POINTERDOUBLETAP)&&this._checkPrePointerObservable(null,c,ht.POINTERDOUBLETAP)&&(this._skipPointerTap=!0))}if(!this._pointerCaptures[c.pointerId]){this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1);return}c.buttons===0&&(this._pointerCaptures[c.pointerId]=!1),!(!n.cameraToUseForPointers&&!n.activeCamera)&&(n.pointerUpPredicate||(n.pointerUpPredicate=m=>m.isPickable&&m.isVisible&&m.isReady()&&m.isEnabled()&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&m.layerMask)!==0)),!this._meshPickProceed&&(js&&js.HasTriggers||this._checkForPicking()||n.onPointerUp)&&this._initActionManager(null,f),_||(_=this._currentPickResult),this._processPointerUp(_,c,f),this._previousPickResult=this._currentPickResult,this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1))}))},this._onKeyDown=c=>{const h=jc.KEYDOWN;if(n.onPreKeyboardObservable.hasObservers()){const f=new zy(h,c);if(n.onPreKeyboardObservable.notifyObservers(f,h),f.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const f=new cm(h,c);n.onKeyboardObservable.notifyObservers(f,h)}n.actionManager&&n.actionManager.processTrigger(14,Vi.CreateNewFromScene(n,c))},this._onKeyUp=c=>{const h=jc.KEYUP;if(n.onPreKeyboardObservable.hasObservers()){const f=new zy(h,c);if(n.onPreKeyboardObservable.notifyObservers(f,h),f.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const f=new cm(h,c);n.onKeyboardObservable.notifyObservers(f,h)}n.actionManager&&n.actionManager.processTrigger(15,Vi.CreateNewFromScene(n,c))},this._deviceSourceManager.onDeviceConnectedObservable.add(c=>{c.deviceType===je.Mouse?c.onInputChangedObservable.add(h=>{this._originMouseEvent=h,h.inputIndex===Ke.LeftClick||h.inputIndex===Ke.MiddleClick||h.inputIndex===Ke.RightClick||h.inputIndex===Ke.BrowserBack||h.inputIndex===Ke.BrowserForward?t&&c.getInput(h.inputIndex)===1?this._onPointerDown(h):e&&c.getInput(h.inputIndex)===0&&this._onPointerUp(h):i&&(h.inputIndex===Ke.Move?this._onPointerMove(h):(h.inputIndex===Ke.MouseWheelX||h.inputIndex===Ke.MouseWheelY||h.inputIndex===Ke.MouseWheelZ)&&this._onPointerMove(h))}):c.deviceType===je.Touch?c.onInputChangedObservable.add(h=>{h.inputIndex===Ke.LeftClick&&(t&&c.getInput(h.inputIndex)===1?(this._onPointerDown(h),this._activePointerIdsCount>1&&(this._isMultiTouchGesture=!0)):e&&c.getInput(h.inputIndex)===0&&(this._onPointerUp(h),this._activePointerIdsCount===0&&(this._isMultiTouchGesture=!1))),i&&h.inputIndex===Ke.Move&&this._onPointerMove(h)}):c.deviceType===je.Keyboard&&c.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,i,s){if(this._meshUnderPointerId[t]===e&&(!e||!e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))return;const n=this._meshUnderPointerId[t];let o;n&&(o=n._getActionManagerForTrigger(10),o&&o.processTrigger(10,new Vi(n,this._pointerX,this._pointerY,e,s,{pointerId:t}))),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,o=e._getActionManagerForTrigger(9),o&&o.processTrigger(9,new Vi(e,this._pointerX,this._pointerY,e,s,{pointerId:t,pickResult:i}))):(delete this._meshUnderPointerId[t],this._pointerOverMesh=null),this._scene.onMeshUnderPointerUpdatedObservable.hasObservers()&&this._scene.onMeshUnderPointerUpdatedObservable.notifyObservers({mesh:e,pointerId:t})}getPointerOverMesh(){return this.meshUnderPointer}_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]}}pi.DragMovementThreshold=10;pi.LongPressDelay=500;pi.DoubleClickDelay=300;pi.ExclusiveDoubleClickMode=!1;class f1{static get UniqueId(){const e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}f1._UniqueIdCounter=1;class XD{constructor(){this.pointerDownFastCheck=!1,this.pointerUpFastCheck=!1,this.pointerMoveFastCheck=!1,this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1}}var Qy,$y,Jy,e0,t0,i0,s0,r0,n0,a0,o0,l0,c0,h0,u0,f0,d0,_0,m0,g0,p0,x0,b0,y0,T0,v0,E0,A0,R0,S0,M0,C0,D0,I0,P0,O0,w0,F0,B0,L0,k0,N0,U0,z0,G0,V0,H0,j0,W0,X0,Y0,q0,K0;const YD=new at,qD=new at;var Z0;(function(a){a[a.BackwardCompatible=0]="BackwardCompatible",a[a.Intermediate=1]="Intermediate",a[a.Aggressive=2]="Aggressive"})(Z0||(Z0={}));class Ae{static DefaultMaterialFactory(e){throw Je("StandardMaterial")}static CollisionCoordinatorFactory(){throw Je("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 pi.DragMovementThreshold}static set DragMovementThreshold(e){pi.DragMovementThreshold=e}static get LongPressDelay(){return pi.LongPressDelay}static set LongPressDelay(e){pi.LongPressDelay=e}static get DoubleClickDelay(){return pi.DoubleClickDelay}static set DoubleClickDelay(e){pi.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){return pi.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){pi.ExclusiveDoubleClickMode=e}get _eyePosition(){return this._forcedViewPosition??this.activeCamera?.globalPosition??D.ZeroReadOnly}bindEyePosition(e,t="vEyePosition",i=!1){const s=this._eyePosition,n=this.useRightHandedSystem===(this._mirroredCameraPosition!=null),o=this.floatingOriginOffset,c=YD.set(s.x,s.y,s.z,n?-1:1),h=c.subtractFromFloatsToRef(o.x,o.y,o.z,0,qD);return e&&(i?e.setFloat3(t,h.x,h.y,h.z):e.setVector4(t,h)),c}finalizeSceneUbo(){const e=this.getSceneUniformBuffer(),t=this.bindEyePosition(null),i=this.floatingOriginOffset;return e.updateFloat4("vEyePosition",t.x-i.x,t.y-i.y,t.z-i.z,t.w),e.update(),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=RM(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 Ae.DefaultMaterialFactory!==Ae._OriginalDefaultMaterialFactory}get defaultMaterial(){return this._defaultMaterial||(this._defaultMaterial=Ae.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=Ae.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 pi(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this._clearColor=new _t(.2,.2,.3,1),this.onClearColorChangedObservable=new Me,this.ambientColor=new rt(0,0,0),this.environmentIntensity=1,this.iblIntensity=1,this._performancePriority=0,this.onScenePerformancePriorityChangedObservable=new Me,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: 7,407 bytes, line 299
299or="pointer",this.defaultCursor="",this.doNotHandleCursors=!1,this.preventDefaultOnPointerDown=!0,this.preventDefaultOnPointerUp=!0,this.metadata=null,this.reservedDataStore=null,this.disableOfflineSupportExceptionRules=[],this.onDisposeObservable=new Me,this._onDisposeObserver=null,this.onBeforeRenderObservable=new Me,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new Me,this.onAfterRenderCameraObservable=new Me,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new Me,this.onAfterAnimationsObservable=new Me,this.onBeforeDrawPhaseObservable=new Me,this.onAfterDrawPhaseObservable=new Me,this.onReadyObservable=new Me,this.onBeforeCameraRenderObservable=new Me,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new Me,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new Me,this.onAfterActiveMeshesEvaluationObservable=new Me,this.onBeforeParticlesRenderingObservable=new Me,this.onAfterParticlesRenderingObservable=new Me,this.onDataLoadedObservable=new Me,this.onNewCameraAddedObservable=new Me,this.onCameraRemovedObservable=new Me,this.onNewLightAddedObservable=new Me,this.onLightRemovedObservable=new Me,this.onNewGeometryAddedObservable=new Me,this.onGeometryRemovedObservable=new Me,this.onNewTransformNodeAddedObservable=new Me,this.onTransformNodeRemovedObservable=new Me,this.onNewMeshAddedObservable=new Me,this.onMeshRemovedObservable=new Me,this.onNewSkeletonAddedObservable=new Me,this.onSkeletonRemovedObservable=new Me,this.onNewParticleSystemAddedObservable=new Me,this.onParticleSystemRemovedObservable=new Me,this.onNewAnimationGroupAddedObservable=new Me,this.onAnimationGroupRemovedObservable=new Me,this.onNewMaterialAddedObservable=new Me,this.onNewMultiMaterialAddedObservable=new Me,this.onMaterialRemovedObservable=new Me,this.onMultiMaterialRemovedObservable=new Me,this.onNewTextureAddedObservable=new Me,this.onTextureRemovedObservable=new Me,this.onNewFrameGraphAddedObservable=new Me,this.onFrameGraphRemovedObservable=new Me,this.onNewObjectRendererAddedObservable=new Me,this.onObjectRendererRemovedObservable=new Me,this.onNewPostProcessAddedObservable=new Me,this.onPostProcessRemovedObservable=new Me,this.onNewEffectLayerAddedObservable=new Me,this.onEffectLayerRemovedObservable=new Me,this.onBeforeRenderTargetsRenderObservable=new Me,this.onAfterRenderTargetsRenderObservable=new Me,this.onBeforeStepObservable=new Me,this.onAfterStepObservable=new Me,this.onActiveCameraChanged=new Me,this.onActiveCamerasChanged=new Me,this.onBeforeRenderingGroupObservable=new Me,this.onAfterRenderingGroupObservable=new Me,this.onMeshImportedObservable=new Me,this.onAnimationFileImportedObservable=new Me,this.onEnvironmentTextureChangedObservable=new Me,this.onMeshUnderPointerUpdatedObservable=new Me,this._registeredForLateAnimationBindings=new Na(256),this._pointerPickingConfiguration=new XD,this.onPrePointerObservable=new Me,this.onPointerObservable=new Me,this.onPreKeyboardObservable=new Me,this.onKeyboardObservable=new Me,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=Ae.FOGMODE_NONE,this.fogColor=new rt(.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 D(0,-9.807,0),this.postProcessesEnabled=!0,this.renderTargetsEnabled=!0,this.dumpNextRenderTargets=!1,this.customRenderTargets=[],this.importedMeshesFiles=[],this.probesEnabled=!0,this._meshesForIntersections=new Na(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new mr,this._activeIndices=new mr,this._activeParticles=new mr,this._activeBones=new mr,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 Ts(256),this._processedMaterials=new Ts(256),this._renderTargets=new Na(256),this._materialsRenderTargets=new Na(256),this._activeParticleSystems=new Ts(256),this._activeSkeletons=new Na(32),this._softwareSkinnedMeshes=new Na(32),this._activeAnimatables=new Array,this._transformMatrix=se.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=gi.Create(),this._beforeClearStage=gi.Create(),this._beforeRenderTargetClearStage=gi.Create(),this._gatherRenderTargetsStage=gi.Create(),this._gatherActiveCameraRenderTargetsStage=gi.Create(),this._isReadyForMeshStage=gi.Create(),this._beforeEvaluateActiveMeshStage=gi.Create(),this._evaluateSubMeshStage=gi.Create(),this._preActiveMeshStage=gi.Create(),this._cameraDrawRenderTargetStage=gi.Create(),this._beforeCameraDrawStage=gi.Create(),this._beforeRenderTargetDrawStage=gi.Create(),this._beforeRenderingGroupDrawStage=gi.Create(),this._beforeRenderingMeshStage=gi.Create(),this._afterRenderingMeshStage=gi.Create(),this._afterRenderingGroupDrawStage=gi.Create(),this._afterCameraDrawStage=gi.Create(),this._afterCameraPostProcessStage=gi.Create(),this._afterRenderTargetDrawStage=gi.Create(),this._afterRenderTargetPostProcessStage=gi.Create(),this._afterRenderStage=gi.Create(),this._pointerMoveStage=gi.Create(),this._pointerDownStage=gi.Create(),this._pointerUpStage=gi.Create(),this._geometriesByUniqueId=null,this._uniqueId=0,this._defaultMeshCandidates={data:[],length:0},this._defaultSubMeshCandidates={data:[],length:0},this.onReadyTimeoutObservable=new Me,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 i={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,defaultCameraLayerMask:268435455,defaultRenderableLayerMask:268435455,...t};this.defaultCameraLayerMask=i.defaultCameraLayerMask,this.defaultRenderableLayerMask=i.defaultRenderableLayerMask,e=this._engine=e||mt.LastCreatedEngine,i.virtual?e._virtualScenes.push(this):(mt._LastCreatedScene=this,e.scenes.push(this)),(e.getCreationOptions().useLargeWorldRendering||t?.useFloatingOrigin)&&(kC(),this._floatingOriginScene=this,Gc.getScene=this._getFloatingOriginScene),this._uid=null,this._renderingManager=new ss(this),Uy&&(this.postProcessManager=new 
vendor: 4,970 bytes, line 299
299Uy(this)),Xi()&&this.attachControl(),this._createUbo(),da&&(this._imageProcessingConfiguration=new da),this.setDefaultCandidateProviders(),i.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=i.useMaterialMeshMap,this.useClonedMeshMap=i.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,i=1){return this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==i}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,i){return this._inputManager.simulatePointerUp(e,t,i),this}isPointerCaptured(e=0){return this._inputManager.isPointerCaptured(e)}attachControl(e=!0,t=!0,i=!0){this._inputManager.attachControl(e,t,i)}detachControl(){this._inputManager.detachControl()}isReady(e=!0){if(this._isDisposed)return!1;let t;const i=this.getEngine(),s=i.currentRenderPassId;i.currentRenderPassId=this.activeCamera?.renderPassId??s;let n=!0;for(this._pendingData.length>0&&(n=!1),this.prePassRenderer?.update(),this.useOrderIndependentTransparency&&this.depthPeelingRenderer&&n&&(n=this.depthPeelingRenderer.isReady()),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t<this.meshes.length;t++){const o=this.meshes[t];if(!o.subMeshes||o.subMeshes.length===0)continue;if(!o.isReady(!0)){n=!1;continue}const c=o.hasThinInstances||o.getClassName()==="InstancedMesh"||o.getClassName()==="InstancedLinesMesh"||i.getCaps().instancedArrays&&o.instances.length>0;for(const f of this._isReadyForMeshStage)f.action(o,c)||(n=!1);if(!e)continue;const h=o.material||this.defaultMaterial;if(h)if(h._storeEffectOnSubMeshes)for(const f of o.subMeshes){const _=f.getMaterial();_&&_.hasRenderTargetTextures&&_.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(_)===-1&&(this._processedMaterials.push(_),this._materialsRenderTargets.concatWithNoDuplicate(_.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()||(n=!1);for(t=0;t<this.customRenderTargets.length;++t)this.customRenderTargets[t].isReadyForRendering()||(n=!1)}for(t=0;t<this.geometries.length;t++)this.geometries[t].delayLoadState===2&&(n=!1);if(this.activeCameras&&this.activeCameras.length>0)for(const o of this.activeCameras)o.isReady(!0)||(n=!1);else this.activeCamera&&(this.activeCamera.isReady(!0)||(n=!1));for(const o of this.particleSystems)o.isReady()||(n=!1);if(this.proceduralTexturesEnabled)for(const o of this.proceduralTextures)o.isReady()||(n=!1);if(this.layers)for(const o of this.layers)o.isReady()||(n=!1);if(this.effectLayers)for(const o of this.effectLayers)o.isLayerReady()||(n=!1);for(const o of this._isReadyChecks)o.isReady()||(n=!1);
299return i.areAllEffectsReady()||(n=!1),i.currentRenderPassId=s,n}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,i=this._pendingData.indexOf(e);i!==-1&&this._pendingData.splice(i,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=Tn.Now;else if(this.onReadyTimeoutDuration>0&&Tn.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=Tn.Now}getViewMatrix(){return this._viewMatrix}getProjectionMatrix(){return this._projectionMatrix}getInverseProjectionMatrix(){return this._inverseProjectionMatrix}getTransformMatrix(){return this._transformMatrix}setTransformMatrix(e,t,i,s){this._multiviewSceneUboIsActive=!!(i&&s&&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 se),this._projectionMatrix.invertToRef(this._inverseProjectionMatrix),this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?lr.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=lr.GetPlanes(this._transformMatrix),this._multiviewSceneUboIsActive&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(i,s):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 i=typeof t=="boolean"?t:t?.trackUBOsInFrame,s=new ze(this._engine,void 0,!1,e??"scene",void 0,i);return s.addUniform("viewProjection",16),s.addUniform("view",16),s.addUniform("projection",16),s.addUniform("vEyePosition",4),s.addUniform("inverseProjection",16),s}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:D.ZeroReadOnly}getUniqueId(){return f1.UniqueId}
vendor: 12,399 bytes, line 299
299addMesh(e,t=!1){if(!this._blockEntityCollection&&(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),fs.SetImmediate(()=>{this.onNewMeshAddedObservable.notifyObservers(e)}),t)){const i=e.getChildMeshes();for(const s of i)this.addMesh(s)}}removeMesh(e,t=!1){const i=this.meshes.indexOf(e);if(i!==-1&&(this.meshes.splice(i,1),e.parent||e._removeFromSceneRootNodes()),this._inputManager._invalidateMesh(e),this.onMeshRemovedObservable.notifyObservers(e),t){const s=e.getChildMeshes();for(const n of s)this.removeMesh(n)}return i}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 i=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=i,i._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 i of this.meshes)i._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 i=this.activeCameras.indexOf(e);i!==-1&&this.activeCameras.splice(i,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,i){}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 i=this.materials[this.materials.length-1];this.materials[t]=i,i._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());fs.SetImmediate(()=>{this.onNewLightAddedObservable.notifyObservers(e)})}}sortLightsByPriority(){this.requireLightSorting&&this.lights.sort(Ri.CompareLightsPriority)}addCamera(e){this._blockEntityCollection||(this.cameras.push(e),fs.SetImmediate(()=>{this.onNewCameraAddedObservable.notifyObservers(e)}),e.parent||e._addToSceneRootNodes())}addSkeleton(e){this._blockEntityCollection||(this.skeletons.push(e),fs.SetImmediate(()=>{this.onNewSkeletonAddedObservable.notifyObservers(e)}))}addParticleSystem(e){this._blockEntityCollection||(this.particleSystems.push(e),fs.SetImmediate(()=>{this.onNewParticleSystemAddedObservable.notifyObservers(e)}))}addAnimation(e){this._blockEntityCollection||this.animations.push(e)}addAnimationGroup(e){this._blockEntityCollection||(this.animationGroups.push(e),fs.SetImmediate(()=>{this.onNewAnimationGroupAddedObservable.notifyObservers(e)}))}addMultiMaterial(e){this._blockEntityCollection||(this.multiMaterials.push(e),fs.SetImmediate(()=>{this.onNewMultiMaterialAddedObservable.notifyObservers(e)}))}addMaterial(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneMaterialArray!==-1||(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),fs.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),fs.SetImmediate(()=>{this.onNewFrameGraphAddedObservable.notifyObservers(e)})}addObjectRenderer(e){this.objectRenderers.push(e),fs.SetImmediate(()=>{this.onNewObjectRendererAddedObservable.notifyObservers(e)})}addPostProcess(e){this._blockEntityCollection||(this.postProcesses.push(e),fs.SetImmediate(()=>{this.onNewPostProcessAddedObservable.notifyObservers(e)}))}addEffectLayer(e){this._blockEntityCollection||(this.effectLayers.push(e),fs.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 i=0;i<this.materials.length;i++){const s=this.materials[i];if(t(s))return s}if(e)for(let i=0;i<this.multiMaterials.length;i++){const s=this.multiMaterials[i];if(t(s))return s}return null}getMaterialByUniqueID(e,t=!1){return this.getMaterialByUniqueId(e,t)}getMaterialByUniqueId(e,t=!1){return this._getMaterial(t,i=>i.uniqueId===e)}getMaterialById(e,t=!1){return this._getMaterial(t,i=>i.id===e)}getMaterialByName(e,t=!1){return this._getMaterial(t,i=>i.name===e)}getLastMaterialById(e,t=!1){for(let i=this.materials.length-1;i>=0;i--)if(this.materials[i].id===e)return this.materials[i];if(t){for(let i=this.multiMaterials.length-1;i>=0;i--)if(this.multiMaterials[i].id===e)return this.multiMaterials[i]}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 i=this.skeletons[t];for(let s=0;s<i.bones.length;s++)if(i.bones[s].id===e)return i.bones[s]}return null}getBoneByName(e){for(let t=0;t<this.skeletons.length;t++){const i=this.skeletons[t];for(let s=0;s<i.bones.length;s++)if(i.bones[s].name===e)return i.bones[s]}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),fs.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 i=this.geometries[this.geometries.length-1];i&&(this.geometries[t]=i,this._geometriesByUniqueId&&(this._geometriesByUniqueId[i.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 i=this.skeletons[t];for(let s=i.bones.length-1;s>=0;s--)if(i.bones[s].id===e)return i.bones[s]}return null}getNodeById(e){const t=this.getMeshById(e);if(t)return t;const i=this.getTransformNodeById(e);if(i)return i;const s=this.getLightById(e);if(s)return s;const n=this.getCameraById(e);if(n)return n;const o=this.getBoneById(e);return o||null}getNodeByName(e){const t=this.getMeshByName(e);
299if(t)return t;const i=this.getTransformNodeByName(e);if(i)return i;const s=this.getLightByName(e);if(s)return s;const n=this.getCameraByName(e);if(n)return n;const o=this.getBoneByName(e);return o||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 i=this.morphTargetManagers[t];for(let s=0;s<i.numTargets;++s){const n=i.getTarget(s);if(n.id===e)return n}}return null}getMorphTargetByName(e){for(let t=0;t<this.morphTargetManagers.length;++t){const i=this.morphTargetManagers[t];for(let s=0;s<i.numTargets;++s){const n=i.getTarget(s);if(n.name===e)return n}}return null}getPostProcessByName(e){for(let t=0;t<this.postProcesses.length;++t){const i=this.postProcesses[t];if(i.name===e)return i}return null}isActiveMesh(e){return this._activeMeshes.indexOf(e)!==-1}get uid(){return this._uid||(this._uid=bt.RandomId()),this._uid}addExternalData(e,t){return this._externalData||(this._externalData=new Ly),this._externalData.add(e,t)}getExternalData(e){return this._externalData?this._externalData.get(e):null}getOrAddExternalDataWithFactory(e,t){return this._externalData||(this._externalData=new Ly),this._externalData.getOrAddWithFactory(e,t)}removeExternalData(e){return this._externalData.remove(e)}_evaluateSubMesh(e,t,i,s){if(s||e.isInFrustum(this._frustumPlanes)){for(const o of this._evaluateSubMeshStage)o.action(t,e);const n=e.getMaterial();n!=null&&(n.hasRenderTargetTextures&&n.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(n)===-1&&(this._processedMaterials.push(n),this._materialsRenderTargets.concatWithNoDuplicate(n.getRenderTargetTextures())),this._renderingManager.dispatch(e,t,n))}}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,i,s=!0,n=!1){if(this.frameGraph){this._renderWithFrameGraph(!0,!1,!0);const o=this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]);for(const c of o)c.objectRenderer._freezeActiveMeshes(s);return this._freezeActiveMeshesCancel=vm(()=>{let c=!0,h=!0;for(const f of o)c&&(c=f.objectRenderer._isFrozen),h&&(h=f.objectRenderer._freezeActiveMeshesCancel!==null);if(c)return!0;
299if(!h)throw new Error("Freezing active meshes was cancelled");return!1},()=>{this._freezeActiveMeshesCancel=null,this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=n,this._skipEvaluateActiveMeshesCompletely=e,t?.()},(c,h)=>{if(this._freezeActiveMeshesCancel=null,this.unfreezeActiveMeshes(),h){const f="Scene: Timeout while waiting for meshes to be frozen.";i?i(f):(pe.Error(f),c&&pe.Error(c))}else{const f="Scene: An unexpected error occurred while trying to freeze active meshes.";i?i(f):(pe.Error(f),c&&(pe.Error(c),c.stack&&pe.Error(c.stack)))}}),this}return this.executeWhenReady(()=>{if(!this.activeCamera){i&&i("No active camera found");return}if(this._frustumPlanes||this.updateTransformMatrix(),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=n,this._skipEvaluateActiveMeshesCompletely=e,s)for(let o=0;o<this._activeMeshes.length;o++)this._activeMeshes.data[o]._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 i=this._activeMeshes.length;for(let s=0;s<i;s++)this._activeMeshes.data[s].computeWorldMatrix()}if(this._activeParticleSystems){const i=this._activeParticleSystems.length;for(let s=0;s<i;s++)this._activeParticleSystems.data[s].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 i of this._beforeEvaluateActiveMeshStage)i.action();const e=this.getActiveMeshCandidates(),t=e.length;for(let i=0;i<t;i++){const s=e.data[i];let n=s._internalAbstractMeshDataInfo._currentLOD.get(this.activeCamera);if(n?n[1]=-1:(n=[s,-1],s._internalAbstractMeshDataInfo._currentLOD.set(this.activeCamera,n)),s.isBlocked||(this._totalVertices.addCount(s.getTotalVertices(),!1),!s.isReady()||!s.isEnabled()||s.scaling.hasAZeroComponent))continue;s.computeWorldMatrix(),s.actionManager&&s.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(s);let o=this.customLODSelector?this.customLODSelector(s,this.activeCamera):s.getLOD(this.activeCamera);if(n[0]=o,n[1]=this._frameId,o!=null&&(o!==s&&o.billboardMode!==0&&o.computeWorldMatrix(),s._preActivate(),s.isVisible&&s.visibility>0&&(s.layerMask&this.activeCamera.layerMask)!==0&&(this._skipFrustumClipping||s.alwaysSelectAsActiveMesh||s.isInFrustum(this._frustumPlanes)))){this._activeMeshes.push(s),this.activeCamera._activeMeshes.push(s),o!==s&&o._activate(this._renderId,!1);for(const c of this._preActiveMeshStage)c.action(s);s._activate(this._renderId,!1)&&(s.isAnInstance?s._internalAbstractMeshDataInfo._actAsRegularMesh&&(o=s):o._internalAbstractMeshDataInfo._onlyForInstances=!1,o._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(s,o)),s._postActivate()}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(let i=0;i<this.particleSystems.length;i++){const s=this.particleSystems[i];if(!s.isStarted()||!s.emitter)continue;const n=s.emitter;(!n.position||n.isEnabled())&&(this._activeParticleSystems.push(s),s.animate(),this._renderingManager.dispatchParticles(s))}this.onAfterParticlesRenderingObservable.notifyObservers(this)}}_prepareSkeleton(e){!this._skeletonsEnabled||!e.skeleton||(this._activeSkeletons.pushNo
vendor: 6,139 bytes, line 299
299Duplicate(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 i=e.hasInstances||e.isAnInstance||this.dispatchAllSubMeshesOfActiveMeshes||this._skipFrustumClipping||t.alwaysSelectAsActiveMesh;if(t&&t.subMeshes&&t.subMeshes.length>0){const s=this.getActiveSubMeshCandidates(t),n=s.length;i=i||n===1;for(let o=0;o<n;o++){const c=s.data[o];this._evaluateSubMesh(c,t,e,i)}}}updateTransformMatrix(e){const t=this.activeCamera;if(t)if(t._renderingMultiview){const i=t._rigCameras[0],s=t._rigCameras[1];this.setTransformMatrix(i.getViewMatrix(),i.getProjectionMatrix(e),s.getViewMatrix(),s.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,i=!0){if(e&&e._skipRendering)return;const s=this._engine;if(this._activeCamera=e,!this.activeCamera)throw new Error("Active camera not set");if(s.setViewport(this.activeCamera.viewport),this.resetCachedMaterial(),this._renderId++,!this.prePass&&i){let c=!0;e._renderingMultiview&&e.outputRenderTarget&&(c=e.outputRenderTarget.skipInitialClear,this.autoClear&&(this._defaultFrameBufferCleared=!1,e.outputRenderTarget.skipInitialClear=!1)),this._bindFrameBuffer(this._activeCamera),e._renderingMultiview&&e.outputRenderTarget&&(e.outputRenderTarget.skipInitialClear=c)}this.updateTransformMatrix(),this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera),this._engine.currentRenderPassId=e.outputRenderTarget?.renderPassId??e.renderPassId??0,this._evaluateActiveMeshes();for(let c=0;c<this._softwareSkinnedMeshes.length;c++){const h=this._softwareSkinnedMeshes.data[c];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 c of this._gatherActiveCameraRenderTargetsStage)c.action(this._renderTargets);let n=!1;if(this.renderTargetsEnabled){this._intermediateRendering=!0;let c;if(this._renderTargets.length>0){bt.StartPerformanceCounter("Render targets",this._renderTargets.length>0);const h=this.getBoundingBoxRenderer?.();for(let f=0;f<this._renderTargets.length;f++){const _=this._renderTargets.data[f];if(_._shouldRender()){this._renderId++;const m=_.activeCamera&&_.activeCamera!==this.activeCamera;h&&!c&&(c=h.renderList.length>0?h.renderList.data.slice():[],c.length=h.renderList.length),_.render(m,this.dumpNextRenderTargets),n=!0}}h&&c&&(h.renderList.data=c,h.renderList.length=c.length),bt.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}if(this._cameraDrawRenderTargetStage.length>0){const h=this.getBoundingBoxRenderer?.();h&&!c&&(c=h.renderList.length>0?h.renderList.data.slice():[],c.length=h.renderList.length);for(const f of this._cameraDrawRenderTargetStage)n=f.action(this.activeCamera)||n;h&&c&&(h.renderList.data=c,h.renderList.length=c.length)}this._intermediateRendering=!1}n&&!this.prePass&&(this._bindFrameBuffer(this._activeCamera,!1),this.updateTransformMatrix()),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.postProcessManager&&!e._multiviewTexture&&!this.prePass&&this.postProcessManager._prepareFrame();for(const c of this._beforeCameraDrawStage)c.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this);const o=s.snapshotRendering&&s.snapshotRenderingMode===1;o&&this.finalizeSceneUbo(),this._renderingManager.render(null,null,!0,!o),this.onAfterDrawPhaseObservable.notifyObservers(this);for(const c of this._afterCameraDrawStage)c.action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){const c=e.outputRenderTarget?e.outputRenderTarget.renderTarget:void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,c)}for(const c of this._afterCameraPostProcessStage)c.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 i=0;i<e._rigCameras.length;i++)this._renderForCamera(e._rigCameras[i],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 i=0;t.actionManager&&i<t.actionManager.actions.length;i++){const s=t.actionManager.actions[i];if(s.trigger===12||s.trigger===13){const n=s.getTriggerParameter(),o=n.mesh?n.mesh:n,c=o.intersectsMesh(t,n.usePre
299ciseIntersection),h=t._intersectionsInProgress.indexOf(o);c&&h===-1?s.trigger===12?(s._executeCurrent(Vi.CreateNew(t,void 0,o)),t._intersectionsInProgress.push(o)):s.trigger===13&&t._intersectionsInProgress.push(o):!c&&h>-1&&(s.trigger===13&&s._executeCurrent(Vi.CreateNew(t,void 0,o)),(!t.actionManager.hasSpecificTrigger(13,f=>{const _=f.mesh?f.mesh:f;return o===_})||s.trigger===13)&&t._intersectionsInProgress.splice(h,1))}}}}_advancePhysicsEngineStep(e){}_animate(e){}animate(){if(this._engine.isDeterministicLockStep()){let e=Math.max(Ae.MinDeltaTime,Math.min(this._engine.getDeltaTime(),Ae.MaxDeltaTime))+this._timeAccumulator;const t=this._engine.getTimeStep(),i=1e3/t/1e3;let s=0;const n=this._engine.getLockstepMaxSteps();let o=Math.floor(e/t);for(o=Math.min(o,n);e>0&&s<o;)this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=t*i,this._animate(t),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(t),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,s++,e-=t;this._timeAccumulator=e<0?0:e}else{const e=this.useConstantAnimationDeltaTime?16:Math.max(Ae.MinDeltaTime,Math.min(this._engine.getDeltaTime(),Ae.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 i=e.rigCameras[t].outputRenderTarget;i&&(i._cleared=!1)}}resetDrawCache(e){if(this.meshes)for(const t of this.meshes)t.resetDrawCache(e)}_renderWithFrameGraph(e=!0,t=!1,i=!1){if(this.activeCamera=null,this.activeCameras=null,e){for(const s of this.cameras)if(s.update(),s.cameraRigMode!==0)for(let n=0;n<s._rigCameras.length;n++)s._rigCameras[n].update()}this.onBeforeRenderObservable.notifyObservers(this),this._renderingMeshEvaluationDepth++;try{this._renderWithFrameGraphAfterBeforeRender(i)}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),bt.StartPerformanceCounter("Custom render targets",this._renderTargets.length>0);for(let i=0;i<this._renderTargets.length;i++){const s=this._renderTargets.data[i],n=s.activeCamera||t;this._renderRenderTarget(s,n,!0,this.dumpNextRenderTargets)}bt.EndPerformanceCounter("Custom render targets",this._renderTargets.length>0),this._renderId++}this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const i of this._beforeClearStage)i.action();if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1)this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();else{const i=this.getActiveMeshCandidates(),s=i.length;if(this._activeMeshesFrozen){if(!this._skipEvaluateActiveMeshesCompletely)for(let n=0;n<s;n++){const o=i.data[n];o._internalAbstractMeshDataInfo._wasActiveLastFrame&&o.computeWorldMatrix()}if(this.particlesEnabled){const n=this._activeParticleSystems.length;for(let o=0;o<n;o++)this._activeParticleSystems.data[o].animate()}}else{this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();for(let n=0;n<s;n++){const o=i.data[n];o._internalAbstractMeshDataInfo._wasActiveLastFrame=!1,!o.isBlocked&&(this._totalVertices.addCount(o.getTotalVertices(),!1),!(!o.isReady()||!o.isEnabled()||o.scaling.hasAZeroComponent)&&(o.computeWorldMatrix(e),o.actionManager&&o.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNo
vendor: 16,564 bytes, line 299
299Duplicate(o)))}if(this.particlesEnabled)for(let n=0;n<this.particleSystems.length;n++){const o=this.particleSystems[n];if(!o.isStarted()||!o.emitter)continue;const c=o.emitter;(!c.position||c.isEnabled())&&(this._activeParticleSystems.push(o),o.animate())}}}this.frameGraph?.execute()}_renderRenderTarget(e,t,i=!1,s=!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(i,s)}this._intermediateRendering=!1}render(e=!0,t=!1){if(this.isDisposed)return;const i=this._renderingMeshEvaluationDepth;try{this._renderFrame(e,t)}finally{this._renderingMeshEvaluationDepth=i}}_renderFrame(e,t){if(this.onReadyObservable.hasObservers()&&this._executeWhenReadyTimeoutId===null&&this._checkIsReady(),Gc.getScene=this._getFloatingOriginScene,this._frameId++,this._defaultFrameBufferCleared=!1,this._checkCameraRenderTarget(this.activeCamera),this.activeCameras?.length)for(const i of this.activeCameras)this._checkCameraRenderTarget(i);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 i of this._beforeCameraUpdateStage)i.action();if(e){if(this.activeCameras&&this.activeCameras.length>0)for(let i=0;i<this.activeCameras.length;i++){const s=this.activeCameras[i];if(s.update(),s.cameraRigMode!==0)for(let n=0;n<s._rigCameras.length;n++)s._rigCameras[n].update()}else if(this.activeCamera&&(this.activeCamera.update(),this.activeCamera.cameraRigMode!==0))for(let i=0;i<this.activeCamera._rigCameras.length;i++)this.activeCamera._rigCameras[i].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 i=this.activeCameras?.length?this.activeCameras[0]:this.activeCamera;if(this.renderTargetsEnabled){bt.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0);for(let s=0;s<this.customRenderTargets.length;s++){const n=this.customRenderTargets[s],o=n.activeCamera||this.activeCamera;this._renderRenderTarget(n,o,i!==o,this.dumpNextRenderTargets)}bt.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._renderId++}this._engine.currentRenderPassId=i?.renderPassId??0,this.activeCamera=i,this._activeCamera&&this._activeCamera.cameraRigMode!==22&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const s of this._beforeClearStage)s.action();this._clearFrameBuffer(this.activeCamera);for(const s of this._gatherRenderTargetsStage)s.action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(let s=0;s<this.activeCameras.length;s++)this._processSubCameras(this.activeCameras[s],s>0);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera,!!this.activeCamera.outputRenderTarget)}}this._checkIntersections();for(const i of this._afterRenderStage)i.action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(let i=0;i<this._toBeDisposed.length;i++){const s=this._toBeDisposed[i];s&&s.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&&bm(this.stopAllAnimations)){for(const n of this._activeAnimatables)n.onAnimationEndObservable.clear(),n.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 n of e)n.abort();this._activeRequests.length=0;try{this.onDisposeObservable.notifyObservers(this)}catch(n){pe.Error("An error occurred while calling onDisposeObservable!",n)}if(this.detachControl(),this._engine.getInputElement?.())for(let n=0;n<this.cameras.length;n++)this.cameras[n].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,n=>n.dispose(!0)),this._disposeList(this.transformNodes,n=>n.dispose(!0));const i=this.cameras;this._disposeList(i),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 s=this._engine.scenes.indexOf(this);if(s>-1&&this._engine.scenes.splice(s,1),this._floatingOriginScene=void 0,this._engine.scenes.length===0&&LC(),mt._LastCreatedScene===this){mt._LastCreatedScene=null;let n=mt.Instances.length-1;for(;n>=0;){const o=mt.Instances[n];if(o.scenes.length>0){mt._LastCreatedScene=o.scenes[this._engine.scenes.length-1];break}n--}}s=this._engine._virtualScenes.indexOf(this),s>-1&&this._engine._virtualScenes.splice(s,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 i=e.slice(0);t=t??(s=>s.dispose());for(const s of i)t(s);e.length=0}get isDisposed(){return this._isDisposed}clearCachedVertexData(){for(let e=0;e<this.meshes.length;e++){const i=this.meshes[e].geometry;i&&i.clearCachedData()}}cleanCachedTextureBuffer(){for(const e of this.textures)e._buffer&&(e._buffer=null)}getWorldExtends(e){const t=new D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new D(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);e=e||(()=>!0);const s=this.meshes.filter(e);for(const n of s){if(n.computeWorldMatrix(!0),!n.subMeshes||n.subMeshes.length===0||n.infiniteDistance)continue;const o=n.getBoundingInfo(),c=o.boundingBox.minimumWorld,h=o.boundingBox.maximumWorld;D.CheckExtends(c,t,i),D.CheckExtends(h,t,i)}return t.x===Number.MAX_VALUE?{min:D.Zero(),max:D.Zero()}:{min:t,max:i}}createPickingRay(e,t,i,s,n=!1){throw Je("Ray")}createPickingRayToRef(e,t,i,s,n,o=!1,c=!1){throw Je("Ray")}createPickingRayInCameraSpace(e,t,i){throw Je("Ray")}createPickingRayInCameraSpaceToRef(e,t,i,s){throw Je("Ray")}pick(e,t,i,s,n,o){const c=Je("Ray",!0);return c&&pe.Warn(c),new zc}pickWithBoundingInfo(e,t,i,s,n){const o=Je("Ray",!0);return o&&pe.Warn(o),new zc}pickWithRay(e,t,i,s){throw Je("Ray")}multiPick(e,t,i,s,n){throw Je("Ray")}multiPickWithRay(e,t,i){throw Je("Ray")}setPointerOverMesh(e,t,i){this._inputManager.setPointerOverMesh(e,t,i)}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,i){if(t===void 0)return e;const s=[];for(const n in e){const o=e[n];Rt&&Rt.MatchesQuery(o,t)&&(!i||i(o))&&s.push(o)}return s}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,i=null,s=null){this._renderingManager.setRenderingOrder(e,t,i,s)}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,s)}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 i of this.materials)t&&!t(i)||i.markAsDirty(e)}_loadFile(e,t,i,s,n,o,c){const h=fa(e,t,i,s?this.offlineProvider:void 0,n,o,c);return this._activeRequests.push(h),h.onCompleteObservable.add(f=>{this._activeRequests.splice(this._activeRequests.indexOf(f),1)}),h}async _loadFileAsync(e,t,i,s,n){return await new Promise((o,c)=>{this._loadFile(e,h=>{o(h)},t,i,s,(h,f)=>{c(f)},n)})}async _loadDelayedFileAsync(e,t,i){this._delayedFileRequests||(this._delayedFileRequests=new Map);const s=`${e}|${t?"binary":"string"}`;let n=this._delayedFileRequests.get(s);if(!n){n=t?this._loadFileAsync(e,void 0,i,!0):this._loadFileAsync(e,void 0,i,!1);const o=n;(async()=>{try{await o}catch{}this._delayedFileRequests?.delete(s)})(),this._delayedFileRequests.set(s,n)}return await n}_requestFile(e,t,i,s,n,o,c){const h=Dm(e,t,i,s?this.offlineProvider:void 0,n,o,c);return this._activeRequests.push(h),h.onCompleteObservable.add(f=>{this._activeRequests.splice(this._activeRequests.indexOf(f),1)}),h}async _requestFileAsync(e,t,i,s,n){return await new Promise((o,c)=>{this._requestFile(e,h=>{o(h)},t,i,s,h=>{c(h)},n)})}_readFile(e,t,i,s,n){const o=Uc(e,t,i,s,n);return this._activeRequests.push(o),o.onCompleteObservable.add(c=>{this._activeRequests.splice(this._activeRequests.indexOf(c),1)}),o}async _readFileAsync(e,t,i){return await new Promise((s,n)=>{this._readFile(e,o=>{s(o)},t,i,o=>{n(o)})})}getPerfCollector(){throw Je("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)}}Ae.FOGMODE_NONE=0;Ae.FOGMODE_EXP=1;Ae.FOGMODE_EXP2=2;Ae.FOGMODE_LINEAR=3;Ae.MinDeltaTime=1;Ae.MaxDeltaTime=1e3;Ae._OriginalDefaultMaterialFactory=Ae.DefaultMaterialFactory;let Q0=!1;function KD(){Q0||(Q0=!0,Lr("BABYLON.Scene",Ae))}(Qy=Ae.prototype).sortActiveAnimatables??(Qy.sortActiveAnimatables=Xe("Scene","sortActiveAnimatables"));($y=Ae.prototype).beginWeightedAnimation??($y.beginWeightedAnimation=Xe("Scene","beginWeightedAnimation"));(Jy=Ae.prototype).beginAnimation??(Jy.beginAnimation=Xe("Scene","beginAnimation"));(e0=Ae.prototype).beginHierarchyAnimation??(e0.beginHierarchyAnimation=Xe("Scene","beginHierarchyAnimation"));(t0=Ae.prototype).beginDirectAnimation??(t0.beginDirectAnimation=Xe("Scene","beginDirectAnimation"));(i0=Ae.prototype).beginDirectHierarchyAnimation??(i0.beginDirectHierarchyAnimation=Xe("Scene","beginDirectHierarchyAnimation"));(s0=Ae.prototype).getAnimatableByTarget??(s0.getAnimatableByTarget=Xe("Scene","getAnimatableByTarget"));(r0=Ae.prototype).getAllAnimatablesByTarget??(r0.getAllAnimatablesByTarget=Xe("Scene","getAllAnimatablesByTarget"));(n0=Ae.prototype).stopAllAnimations??(n0.stopAllAnimations=Xe("Scene","stopAllAnimations"));
299(a0=Ae.prototype).getSoundByName??(a0.getSoundByName=Xe("Scene","getSoundByName"));(o0=Ae.prototype).createOrUpdateSelectionOctree??(o0.createOrUpdateSelectionOctree=Xe("Scene","createOrUpdateSelectionOctree"));(l0=Ae.prototype).createDefaultLight??(l0.createDefaultLight=Xe("Scene","createDefaultLight"));(c0=Ae.prototype).createDefaultCamera??(c0.createDefaultCamera=Xe("Scene","createDefaultCamera"));(h0=Ae.prototype).createDefaultCameraOrLight??(h0.createDefaultCameraOrLight=Xe("Scene","createDefaultCameraOrLight"));(u0=Ae.prototype).createDefaultSkybox??(u0.createDefaultSkybox=Xe("Scene","createDefaultSkybox"));(f0=Ae.prototype).createDefaultEnvironment??(f0.createDefaultEnvironment=Xe("Scene","createDefaultEnvironment"));(d0=Ae.prototype).createDefaultVRExperience??(d0.createDefaultVRExperience=Xe("Scene","createDefaultVRExperience"));(_0=Ae.prototype).createDefaultXRExperienceAsync??(_0.createDefaultXRExperienceAsync=Xe("Scene","createDefaultXRExperienceAsync"));(m0=Ae.prototype).getGlowLayerByName??(m0.getGlowLayerByName=Xe("Scene","getGlowLayerByName"));(g0=Ae.prototype).getHighlightLayerByName??(g0.getHighlightLayerByName=Xe("Scene","getHighlightLayerByName"));(p0=Ae.prototype).getSelectionOutlineLayerByName??(p0.getSelectionOutlineLayerByName=Xe("Scene","getSelectionOutlineLayerByName"));(x0=Ae.prototype).removeLensFlareSystem??(x0.removeLensFlareSystem=Xe("Scene","removeLensFlareSystem"));(b0=Ae.prototype).addLensFlareSystem??(b0.addLensFlareSystem=Xe("Scene","addLensFlareSystem"));(y0=Ae.prototype).getLensFlareSystemByName??(y0.getLensFlareSystemByName=Xe("Scene","getLensFlareSystemByName"));(T0=Ae.prototype).getLensFlareSystemByID??(T0.getLensFlareSystemByID=Xe("Scene","getLensFlareSystemByID"));(v0=Ae.prototype).getLensFlareSystemById??(v0.getLensFlareSystemById=Xe("Scene","getLensFlareSystemById"));(E0=Ae.prototype).getPhysicsEngine??(E0.getPhysicsEngine=Xe("Scene","getPhysicsEngine"));(A0=Ae.prototype).enablePhysics??(A0.enablePhysics=Xe("Scene","enablePhysics"));(R0=Ae.prototype).disablePhysicsEngine??(R0.disablePhysicsEngine=Xe("Scene","disablePhysicsEngine"));(S0=Ae.prototype).isPhysicsEnabled??(S0.isPhysicsEnabled=Xe("Scene","isPhysicsEnabled"));(M0=Ae.prototype).deleteCompoundImpostor??(M0.deleteCompoundImpostor=Xe("Scene","deleteCompoundImpostor"));(C0=Ae.prototype).removeReflectionProbe??(C0.removeReflectionProbe=Xe("Scene","removeReflectionProbe"));(D0=Ae.prototype).addReflectionProbe??(D0.addReflectionProbe=Xe("Scene","addReflectionProbe"));(I0=Ae.prototype).getBoundingBoxRenderer??(I0.getBoundingBoxRenderer=Xe("Scene","getBoundingBoxRenderer"));(P0=Ae.prototype).enableDepthRenderer??(P0.enableDepthRenderer=Xe("Scene","enableDepthRenderer"));(O0=Ae.prototype).disableDepthRenderer??(O0.disableDepthRenderer=Xe("Scene","disableDepthRenderer"));(w0=Ae.prototype).enableFluidRenderer??(w0.enableFluidRenderer=Xe("Scene","enableFluidRenderer"));(F0=Ae.prototype).disableFluidRenderer??(F0.disableFluidRenderer=Xe("Scene","disableFluidRenderer"));(B0=Ae.prototype).enableGeometryBufferRenderer??(B0.enableGeometryBufferRenderer=Xe("Scene","enableGeometryBufferRenderer"));(L0=Ae.prototype).disableGeometryBufferRenderer??(L0.disableGeometryBufferRenderer=Xe("Scene","disableGeometryBufferRenderer"));(k0=Ae.prototype).enableIblCdfGenerator??(k0.enableIblCdfGenerator=Xe("Scene","enableIblCdfGenerator"));(N0=Ae.prototype).disableIblCdfGenerator??(N0.disableIblCdfGenerator=Xe("Scene","disableIblCdfGenerator"));(U0=Ae.prototype).getOutlineRenderer??(U0.getOutlineRenderer=Xe("Scene","getOutlineRenderer"));(z0=Ae.prototype).enablePrePassRenderer??(z0.enablePrePassRenderer=Xe("Scene","enablePrePassRenderer"));(G0=Ae.prototype).disablePrePassRenderer??(G0.disablePrePassRenderer=Xe("Scene","disablePrePassRenderer"));
299(V0=Ae.prototype).enableSubSurfaceForPrePass??(V0.enableSubSurfaceForPrePass=Xe("Scene","enableSubSurfaceForPrePass"));(H0=Ae.prototype).disableSubSurfaceForPrePass??(H0.disableSubSurfaceForPrePass=Xe("Scene","disableSubSurfaceForPrePass"));(j0=Ae.prototype).pickSprite??(j0.pickSprite=Xe("Scene","pickSprite"));(W0=Ae.prototype).pickSpriteWithRay??(W0.pickSpriteWithRay=Xe("Scene","pickSpriteWithRay"));(X0=Ae.prototype).multiPickSprite??(X0.multiPickSprite=Xe("Scene","multiPickSprite"));(Y0=Ae.prototype).multiPickSpriteWithRay??(Y0.multiPickSpriteWithRay=Xe("Scene","multiPickSpriteWithRay"));(q0=Ae.prototype).setPointerOverSprite??(q0.setPointerOverSprite=Xe("Scene","setPointerOverSprite"));(K0=Ae.prototype).getPointerOverSprite??(K0.getPointerOverSprite=Xe("Scene","getPointerOverSprite"));Object.getOwnPropertyDescriptor(Ae.prototype,"mainSoundTrack")||Object.defineProperty(Ae.prototype,"mainSoundTrack",gt("Scene","mainSoundTrack"));Object.getOwnPropertyDescriptor(Ae.prototype,"soundTracks")||Object.defineProperty(Ae.prototype,"soundTracks",gt("Scene","soundTracks"));Object.getOwnPropertyDescriptor(Ae.prototype,"audioEnabled")||Object.defineProperty(Ae.prototype,"audioEnabled",gt("Scene","audioEnabled"));Object.getOwnPropertyDescriptor(Ae.prototype,"headphone")||Object.defineProperty(Ae.prototype,"headphone",gt("Scene","headphone"));Object.getOwnPropertyDescriptor(Ae.prototype,"audioListenerPositionProvider")||Object.defineProperty(Ae.prototype,"audioListenerPositionProvider",gt("Scene","audioListenerPositionProvider"));Object.getOwnPropertyDescriptor(Ae.prototype,"audioListenerRotationProvider")||Object.defineProperty(Ae.prototype,"audioListenerRotationProvider",gt("Scene","audioListenerRotationProvider"));Object.getOwnPropertyDescriptor(Ae.prototype,"audioPositioningRefreshRate")||Object.defineProperty(Ae.prototype,"audioPositioningRefreshRate",gt("Scene","audioPositioningRefreshRate"));Object.getOwnPropertyDescriptor(Ae.prototype,"selectionOctree")||Object.defineProperty(Ae.prototype,"selectionOctree",gt("Scene","selectionOctree"));Object.getOwnPropertyDescriptor(Ae.prototype,"debugLayer")||Object.defineProperty(Ae.prototype,"debugLayer",gt("Scene","debugL
299ayer"));Object.getOwnPropertyDescriptor(Ae.prototype,"gamepadManager")||Object.defineProperty(Ae.prototype,"gamepadManager",gt("Scene","gamepadManager"));Object.getOwnPropertyDescriptor(Ae.prototype,"simplificationQueue")||Object.defineProperty(Ae.prototype,"simplificationQueue",gt("Scene","simplificationQueue"));Object.getOwnPropertyDescriptor(Ae.prototype,"onBeforePhysicsObservable")||Object.defineProperty(Ae.prototype,"onBeforePhysicsObservable",gt("Scene","onBeforePhysicsObservable"));Object.getOwnPropertyDescriptor(Ae.prototype,"onAfterPhysicsObservable")||Object.defineProperty(Ae.prototype,"onAfterPhysicsObservable",gt("Scene","onAfterPhysicsObservable"));Object.getOwnPropertyDescriptor(Ae.prototype,"reflectionProbes")||Object.defineProperty(Ae.prototype,"reflectionProbes",gt("Scene","reflectionProbes"));Object.getOwnPropertyDescriptor(Ae.prototype,"forceShowBoundingBoxes")||Object.defineProperty(Ae.prototype,"forceShowBoundingBoxes",gt("Scene","forceShowBoundingBoxes"));Object.getOwnPropertyDescriptor(Ae.prototype,"depthPeelingRenderer")||Object.defineProperty(Ae.prototype,"depthPeelingRenderer",gt("Scene","depthPeelingRenderer"));Object.getOwnPropertyDescriptor(Ae.prototype,"useOrderIndependentTransparency")||Object.defineProperty(Ae.prototype,"useOrderIndependentTransparency",gt("Scene","useOrderIndependentTransparency"));Object.getOwnPropertyDescriptor(Ae.prototype,"fluidRenderer")||Object.defineProperty(Ae.prototype,"fluidRenderer",gt("Scene","fluidRenderer"));Object.getOwnPropertyDescriptor(Ae.prototype,"geometryBufferRenderer")||Object.defineProperty(Ae.prototype,"geometryBufferRenderer",gt("Scene","geometryBufferRenderer"));Object.getOwnPropertyDescriptor(Ae.prototype,"iblCdfGenerator")||Object.defineProperty(Ae.prototype,"iblCdfGenerator",gt("Scene","iblCdfGenerator"));Object.getOwnPropertyDescriptor(Ae.prototype,"prePassRenderer")||Object.defineProperty(Ae.prototype,"prePassRenderer",gt("Scene","prePassRenderer"));Object.getOwnPropertyDescriptor(Ae.prototype,"subSurfaceConfiguration")||Object.defineProperty(Ae.prototype,"subSurfaceConfiguration",gt("Scene","subSurfaceConfiguration"));Object.getOwnPropertyDescriptor(Ae.prototype,"spriteManagers")||Object.defineProperty(Ae.prototype,"spriteManagers",gt("Scene","spriteManagers"));Object.getOwnPropertyDescriptor(Ae.prototype,"onBeforeSpritesRenderingObservable")||Object.defineProperty(Ae.prototype,"onBeforeSpritesRenderingObservable",gt("Scene","onBeforeSpritesRenderingObservable"));Object.getOwnPropertyDescriptor(Ae.prototype,"onAfterSpritesRenderingObservable")||Object.defineProperty(Ae.prototype,"onAfterSpritesRenderingObservable",gt("Scene","onAfterSpritesRenderingObservable"));function d1(a){const e=a.height||2;let t=a.diameterTop===0?0:a.diameterTop||a.diameter||1,i=a.diameterBottom===0?0:a.diameterBottom||a.diameter||1;t=t||1e-5,i=i||1e-5;const s=(a.tessellation||24)|0,n=(a.subdivisions||1)|0,o=!!a.hasRings,c=!!a.enclose,h=a.cap===0?0:a.cap||$.CAP_ALL,f=a.arc&&(a.arc<=0||a.arc>1)?1:a.arc||1,_=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,m=a.faceUV||new Array(3),g=a.faceColors,x=f!==1&&c?2:0,y=o?n:1,b=2+(1+x)*y;let v;for(v=0;v<b;v++)g&&g[v]===void 0&&(g[v]=new _t(1,1,1,1));for(v=0;v<b;v++)m&&m[v]===void 0&&(m[v]=new at(0,0,1,1));const E=[],R=[],C=[],O=[],M=[],I=Math.PI*2*f/s;let P,L,V;const X=(i-t)/2/e,re=D.Zero(),ae=D.Zero(),de=D.Zero(),U=D.Zero(),te=D.Zero(),Y=Xa.Y;let Z,q,j,Q,w=1,B=0,z;for(Z=0;Z<=n;Z++)for(L=Z/n,V=(L*(t-i)+i)/2,Q=o&&Z!==0&&Z!==n?2:1,j=0;j<Q;j++){for(o&&(w+=j),c&&(w+=2*j),q=0;q<=s;q++)P=q*I,re.x=Math.cos(-P)*V,re.y=-e/2+L*e,re.z=Math.sin(-P)*V,t===0&&Z===n?(ae.x=C[C.length-(s+1)*3],ae.y=C[C.length-(s+1)*3+1],ae.z=C[C.length-(s+1)*3+2]):(ae.x=re.x,ae.z=re.z,ae.y=Math.sqrt(ae.x*ae.x+ae.z*ae.z)*X,ae.normalize()),q===0&&(de.copyFrom(re),U.copyFrom(ae)),R.push(re.x,re.y,re.z),C.push(ae.x,ae.y,ae.z),o?z=B!==w?m[w].y:m[w].w:z=m[w].y+(m[w].w-m[w].y)*L,O.push(m[w].x+(m[w].z-m[w].x)*q/s,z),g&&M.push(g[w].r,g[w].g,g[w].b,g[w].a);f!==1&&c&&(R.push(re.x,re.y,re.z),R.push(0,re.y,0),R.push(0,re.y,0),R.push(de.x,de.y,de.z),D.CrossToRef(Y,ae,te),te.normalize(),C.push(te.x,te.y,te.z,te.x,te.y,te.z),D.CrossToRef(U,Y,te),te.normalize(),C.push(te.x,te.y,te.z,te.x,te.y,te.z),o?z=B!==w?m[w+1].y:m[
299w+1].w:z=m[w+1].y+(m[w+1].w-m[w+1].y)*L,O.push(m[w+1].x,z),O.push(m[w+1].z,z),o?z=B!==w?m[w+2].y:m[w+2].w:z=m[w+2].y+(m[w+2].w-m[w+2].y)*L,O.push(m[w+2].x,z),O.push(m[w+2].z,z),g&&(M.push(g[w+1].r,g[w+1].g,g[w+1].b,g[w+1].a),M.push(g[w+1].r,g[w+1].g,g[w+1].b,g[w+1].a),M.push(g[w+2].r,g[w+2].g,g[w+2].b,g[w+2].a),M.push(g[w+2].r,g[w+2].g,g[w+2].b,g[w+2].a))),B!==w&&(B=w)}const K=f!==1&&c?s+4:s;for(Z=0,w=0;w<n;w++){let ve=0,Le=0,ke=0,J=0;for(q=0;q<s;q++)ve=Z*(K+1)+q,Le=(Z+1)*(K+1)+q,ke=Z*(K+1)+(q+1),J=(Z+1)*(K+1)+(q+1),E.push(ve,Le,ke),E.push(J,ke,Le);f!==1&&c&&(E.push(ve+2,Le+2,ke+2),E.push(J+2,ke+2,Le+2),E.push(ve+4,Le+4,ke+4),E.push(J+4,ke+4,Le+4)),Z=o?Z+2:Z+1}const ue=ve=>{const Le=ve?t/2:i/2;if(Le===0)return;let ke,J,_e;const xe=ve?m[b-1]:m[0];let Ne=null;g&&(Ne=ve?g[b-1]:g[0]);const Qe=R.length/3,He=ve?e/2:-e/2,dt=new D(0,He,0);R.push(dt.x,dt.y,dt.z),C.push(0,ve?1:-1,0);const li=xe.y+(xe.w-xe.y)*.5;O.push(xe.x+(xe.z-xe.x)*.5,li),Ne&&M.push(Ne.r,Ne.g,Ne.b,Ne.a);const zt=new Fe(.5,.5);for(_e=0;_e<=s;_e++){ke=Math.PI*2*_e*f/s;const Ot=Math.cos(-ke),jt=Math.sin(-ke);J=new D(Ot*Le,He,jt*Le);const Nt=new Fe(Ot*zt.x+.5,jt*zt.y+.5);R.push(J.x,J.y,J.z),C.push(0,ve?1:-1,0);const ut=xe.y+(xe.w-xe.y)*Nt.y;O.push(xe.x+(xe.z-xe.x)*Nt.x,ut),Ne&&M.push(Ne.r,Ne.g,Ne.b,Ne.a)}for(_e=0;_e<s;_e++)ve?(E.push(Qe),E.push(Qe+(_e+2)),E.push(Qe+(_e+1))):(E.push(Qe),E.push(Qe+(_e+1)),E.push(Qe+(_e+2)))};(h===$.CAP_START||h===$.CAP_ALL)&&ue(!1),(h===$.CAP_END||h===$.CAP_ALL)&&ue(!0),Ue._ComputeSides(_,R,E,C,O,a.frontUVs,a.backUVs);const he=new Ue;return he.indices=E,he.positions=R,he.normals=C,he.uvs=O,g&&(he.colors=M),he}function _1(a,e={},t){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,d1(e).applyToMesh(i,e.updatable),i}let $0=!1;function ZD(){$0||($0=!0,Ue.CreateCylinder=d1,$.CreateCylinder=(a,e,t,i,s,n,o,c,h)=>((o===void 0||!(o instanceof Ae))&&(o!==void 0&&(h=c||$.DEFAULTSIDE,c=o),o=n,n=1),_1(a,{height:e,diameterTop:t,diameterBottom:i,tessellation:s,subdivisions:n,sideOrientation:h,updatable:c},o)))}function m1(a){const e=[],t=[],i=[],s=[],n=a.diameter||1,o=a.thickness||.5,c=(a.tessellation||16)|0,h=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,f=c+1;for(let m=0;m<=c;m++){const g=m/c,x=m*Math.PI*2/c-Math.PI/2,y=se.Translation(n/2,0,0).multiply(se.RotationY(x));for(let b=0;b<=c;b++){const v=1-b/c,E=b*Math.PI*2/c+Math.PI,R=Math.cos(E),C=Math.sin(E);let O=new D(R,C,0),M=O.scale(o/2);const I=new Fe(g,v);M=D.TransformCoordinates(M,y),O=D.TransformNormal(O,y),t.push(M.x,M.y,M.z),i.push(O.x,O.y,O.z),s.push(I.x,I.y);const P=(m+1)%f,L=(b+1)%f;e.push(m*f+b),e.push(m*f+L),e.push(P*f+b),e.push(m*f+L),e.push(P*f+L),e.push(P*f+b)}}Ue._ComputeSides(h,t,e,i,s,a.frontUVs,a.backUVs);const _=new Ue;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function g1(a,e={},t){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,m1(e).applyToMesh(i,e.updatable),i}let J0=!1;function QD(){J0||(J0=!0,Ue.CreateTorus=m1,$.CreateTorus=(a,e,t,i,s,n,o)=>g1(a,{diameter:e,thickness:t,tessellation:i,sideOrientation:o,updatable:n},s))}function p1(a){const e=[],t=[],i=[],s=[],n=a.radius||2,o=a.tube||.5,c=a.radialSegments||32,h=a.tubularSegments||32,f=a.p||2,_=a.q||3,m=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,g=v=>{const E=Math.cos(v),R=Math.sin(v),C=_/f*v,O=Math.cos(C),M=n*(2+O)*.5*E,I=n*(2+O)*R*.5,P=n*Math.sin(C)*.5;return new D(M,I,P)};let x,y;for(x=0;x<=c;x++){const E=x%c/c*2*f*Math.PI,R=g(E),C=g(E+.01),O=C.subtract(R);let M=C.add(R);const I=D.Cross(O,M);for(M=D.Cross(I,O),I.normalize(),M.normalize(),y=0;y<h;y++){const L=y%h/h*2*Math.PI,V=-o*Math.cos(L),X=o*Math.sin(L);t.push(R.x+V*M.x+X*I.x),t.push(R.y+V*M.y+X*I.y),t.push(R.z+V*M.z+X*I.z),s.push(x/c),s.push(y/h)}}for(x=0;x<c;x++)for(y=0;y<h;y++){const v=(y+1)%h,E=x*h+y,R=(x+1)*h+y,C=(x+1)*h+v,O=x*h+v;e.push(O),e.push(R),e.push(E),e.push(O),e.push(C),e.push(R)}Ue.ComputeNormals(t,e,i),Ue._ComputeSides(m,t,e,i,s,a.frontUVs,a.backUVs);const b=new Ue;return b.indices=e,b.positions=t,b.normals=i,b.uvs=s,b}function x1(a,e={},t){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,p1(e).applyToMesh(i,e.updatable),i}let eT=!1;function $D(){eT||(eT=!0,Ue.CreateTorusKnot=p1,$.CreateTorusKnot=(a,e,t,i,s,n,o,c,h,f)=>x1(a,{radius:e,tube:t,radialSegments:i,tubularSegments:s,p:n,q:o,sideOrientation:f,updatable:h},c))}class JD extends Ht{constructor(e,t){super(e,t.getScene()),this._indexInSourceMe
vendor: 6,918 bytes, line 299
299shInstanceArray=-1,this._distanceToCamera=0,t.addInstance(this),this._sourceMesh=t,this._unIndexed=t._unIndexed,this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scaling.copyFrom(t.scaling),t.rotationQuaternion&&(this.rotationQuaternion=t.rotationQuaternion.clone()),this.animations=t.animations.slice();for(const i of t.getAnimationRanges())i!=null&&this.createAnimationRange(i.name,i.from,i.to);if(this.infiniteDistance=t.infiniteDistance,this.setPivotMatrix(t.getPivotMatrix()),!t.skeleton&&!t.morphTargetManager&&t.hasBoundingInfo){const i=t.getBoundingInfo();this.buildBoundingInfo(i.minimum,i.maximum)}else this.refreshBoundingInfo(!0,!0);this._syncSubMeshes()}getClassName(){return"InstancedMesh"}get lightSources(){return this._sourceMesh._lightSources}_resyncLightSources(){}_resyncLightSource(){}_removeLightSource(){}get receiveShadows(){return this._sourceMesh.receiveShadows}set receiveShadows(e){this._sourceMesh?.receiveShadows!==e&&pe.Warn("Setting receiveShadows on an instanced mesh has no effect")}get material(){return this._sourceMesh.material}set material(e){this._sourceMesh?.material!==e&&pe.Warn("Setting material on an instanced mesh has no effect")}get visibility(){return this._sourceMesh.visibility}set visibility(e){this._sourceMesh?.visibility!==e&&pe.Warn("Setting visibility on an instanced mesh has no effect")}get skeleton(){return this._sourceMesh.skeleton}set skeleton(e){this._sourceMesh?.skeleton!==e&&pe.Warn("Setting skeleton on an instanced mesh has no effect")}get renderingGroupId(){return this._sourceMesh.renderingGroupId}set renderingGroupId(e){!this._sourceMesh||e===this._sourceMesh.renderingGroupId||pe.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")}getTotalVertices(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0}getTotalIndices(){return this._sourceMesh.getTotalIndices()}get sourceMesh(){return this._sourceMesh}get geometry(){return this._sourceMesh._geometry}createInstance(e){return this._sourceMesh.createInstance(e)}isReady(e=!1){return this._sourceMesh.isReady(e,!0)}getVerticesData(e,t,i){return this._sourceMesh.getVerticesData(e,t,i)}copyVerticesData(e,t){this._sourceMesh.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._sourceMesh.getVertexBuffer(e,t)}setVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,i,s),this.sourceMesh}updateVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,i,s),this.sourceMesh}setIndices(e,t=null){return this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh}isVerticesDataPresent(e){return this._sourceMesh.isVerticesDataPresent(e)}getIndices(){return this._sourceMesh.getIndices()}get _positions(){return this._sourceMesh._positions}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;typeof e=="object"?i=e:i={applySkeleton:e,applyMorph:t};const s=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getData(i,null,k.PositionKind),s),this}_preActivate(){return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if(super._activate(e,t),this._sourceMesh.subMeshes||pe.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>=0!=this._getWorldMatrixDeterminant()>=0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1}_postActivate(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)}getWorldMatrix(){if(this._currentLOD&&this._currentLOD!==this._sourceMesh&&this._currentLOD.billboardMode!==rs.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new se);const e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,ge.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(ge.Vector3[7]),this._currentLOD._masterMesh=e,this._billboardWorldMatrix}return super.getWorldMatrix()}get isAnInstance(){return!0}getLOD(e){if(!e)return this;const t=this.sourceMesh.getLODLevels();if(!t||t.length===0)this._currentLOD=this.sourceMesh;else{const i=this.getBoundingInfo();this._currentLOD=this.sourceMesh.getLOD(e,i.boundingSphere)}return this._currentLOD}_preActivateForIntermediateRendering(e){return this.sourceMesh._preActivateForIntermediateRendering(e)}_syncSubMeshes(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(let e=0;e<this._sourceMesh.subMeshes.length;e++)this._sourceMesh.subMeshes[e].clone(this,this._sourceMesh);return this}_generatePointsArray(){return this._sourceMesh._generatePointsArray()}_updateBoundingInfo(){return this.hasBoundingInfo?this.getBoundingInfo().update(this.worldMatrixFromCache):this.buildBoundingInfo(this.absolutePosition,this.absolutePosition,this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}clone(e,t=null,i,s){const n=(s||this._sourceMesh).createInstance(e);if(Pm.DeepCopy(this,n,["name","subMeshes","uniqueId","parent","lightSources","receiveShadows","material","visibility","skeleton","sourceMesh","isAnInstance","facetNb","isFacetDataEnabled","isBlocked","useBones","hasInstances","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","hasBoundingInfo","geometry"],[]),t&&(n.parent=t),!i)for(let o=0;o<this.getScene().meshes.length;o++){const c=this.getScene().meshes[o];c.parent===this&&c.clone(c.name,n)}return n.computeWorldMatrix(!0),this.onClonedObservable.notifyObservers(n),n}dispose(e,t=!1){this._sourceMesh.removeInstance(this),super.dispose(e,t)}_serializeAsParent(e){super._serializeAsParent(e),e.parentId=this._sourceMesh.uniqueId,e.parentInstanceIndex=this._indexInSourceMe
299shInstanceArray}instantiateHierarchy(e=null,t,i){const s=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0,t&&t.newSourcedMesh);s&&i&&i(this,s);for(const n of this.getChildTransformNodes(!0))n.instantiateHierarchy(s,t,i);return s}}class b1{constructor(){this._defines={},this._currentRank=32,this._maxRank=-1,this._mesh=null}unBindMesh(){this._mesh=null}addFallback(e,t){this._defines[e]||(e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)}addCPUSkinningFallback(e,t){this._mesh=t,e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e)}get hasMoreFallbacks(){return this._currentRank<=this._maxRank}reduce(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;const i=this._mesh.getScene();for(let s=0;s<i.meshes.length;s++){const n=i.meshes[s];if(!n.material){!this._mesh.material&&n.computeBonesUsingShaders&&n.numBoneInfluencers>0&&(n.computeBonesUsingShaders=!1);continue}if(!(!n.computeBonesUsingShaders||n.numBoneInfluencers===0)){if(n.material.getEffect()===t)n.computeBonesUsingShaders=!1;else if(n.subMeshes){for(const o of n.subMeshes)if(o.effect===t){n.computeBonesUsingShaders=!1;break}}}}}else{const i=this._defines[this._currentRank];if(i)for(let s=0;s<i.length;s++)e=e.replace("#define "+i[s],"");this._currentRank++}return e}}class y1 extends Ei{constructor(e,t,i=!0,s=!1){super(e,t,void 0,s),this._normalMatrix=new se,this._storeEffectOnSubMeshes=i}getEffect(){return this._storeEffectOnSubMeshes?this._activeEffect:super.getEffect()}isReady(e,t){return e?!this._storeEffectOnSubMeshes||!e.subMeshes||e.subMeshes.length===0?!0:this.isReadyForSubMesh(e,e.subMeshes[0],t):!1}_isReadyForSubMesh(e){const t=e.materialDefines;return!!(!this.checkReadyOnEveryCall&&e.effect&&t&&t._renderId===this.getScene().getRenderId())}bindOnlyWorldMatrix(e){this._activeEffect.setMatrix("world",e)}bindOnlyNormalMatrix(e){this._activeEffect.setMatrix("normalMatrix",e)}bind(e,t){t&&this.bindForSubMesh(e,t,t.subMeshes[0])}_afterBind(e,t=null,i){super._afterBind(e,t,i),this.getScene()._cachedEffect=t,i?i._drawWrapper._forceRebindOnNextCall=!1:this._drawWrapper._forceRebindOnNextCall=!1}_mustRebind(e,t,i,s=1){return i._drawWrapper._forceRebindOnNextCall||e.isCachedMaterialInvalid(this,t,s)}dispose(e,t,i){this._activeEffect=void 0,super.dispose(e,t,i)}}const tT=new WeakMap;function T1(a){const e=a.getVertexBuffers();if(!e)return null;let t=tT.get(a);if(!t)t=new Map,tT.set(a,t);else{let i=!1;for(const s in e)if(!t.has(s)){i=!0;break}if(!i)return t}for(const i in e){const s=e[i];if(s){const n=s.byteOffset,o=s.byteStride,c=s.type,h=s.normalized;t.set(i,{offset:n,stride:o,type:c,normalized:h})}}return t}function v1(a,e){e.forEach((t,i)=>{const s=`vp_${i}_info`;a.setFloat4(s,t.offset,t.stride,t.type,t.normalized?1:0)})}const U_={effect:null,subMesh:null};class wf extends y1{constructor(e,t,i,s={},n=!0){super(e,t,n),this._textures={},this._internalTextures={},this._textureArrays={},this._externalTextures={},this._floats={},this._ints={},this._uints={},this._floatsArrays={},this._colors3={},this._colors3Arrays={},this._colors4={},this._colors4Arrays={},this._vectors2={},this._vectors3={},this._vectors4={},this._quaternions={},this._quaternionsArrays={},this._matrices={},this._matrixArrays={},this._matrices3x3={},this._matrices2x2={},this._vectors2Arrays={},this._vectors3Arrays={},this._vectors4Arrays={},this._uniformBuffers={},this._textureSamplers={},this._storageBuffers={},this._cachedWorldViewMatrix=new se,this._cachedWorldViewProjectionMatrix=new se,this._multiview=!1,this._vertexPullingMetadata=null,this._materialHelperNeedsPreviousMatrices=!1,this._shaderPath=i,this._options={needAlphaBlending:!1,needAlphaTesting:!1,attributes:["position","normal","uv"],uniforms:["worldViewProjection"],uniformBuffers:[],samplers:[],externalTextures:[],samplerObjects:[],storageBuffers:[],defines:[],useClipPlane:!1,...s}}get shaderPath(){return this._shaderPath}set shaderPath(e){this._shaderPath=e}get options(){return this._options}get isMultiview(){return this._multiview}getClassName(){return"ShaderMaterial"}needAlphaBlending(){return this.alpha<1||this._options.needAlphaBlending}needAlphaTesting(){return this._options.needAlphaTesting}_checkUniform(e){this._options.uniforms.indexOf(e)===-1&&this._options.uniforms.push(e)}setTexture(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._textures[e]=t,this}setInternalTexture(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._internalTextures[e]=t,this}removeTexture(e){delete this._textures[e]}setTextureArray(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._checkUniform(e),this._textureArrays[e]=t,this}setExternalTexture(e,t){return this._options.externalTextures.indexOf(e)===-1&&this._options.externalTextures.push(e),this._externalTextures[e]=t,this}setFloat(e,t){return this._checkUniform(e),this._floats[e]=t,this}setInt(e,t){return this._checkUniform(e),this._ints[e]=t,this}setUInt(e,t){return this._checkUniform(e),this._uints[e]=t,this}setFloats(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this}setColor3(e,t){return this._checkUniform(e),this._colors3[e]=t,this}setColor3Array(e,t){return this._checkUniform(e),this._colors3Arrays[e]=t.reduce((i,s)=>(i.push(s.r,s.g,s.b),i),[]),this}setColor4(e,t){return this._checkUniform(e),this._colors4[e]=t,this}setColor4Array(e,t){return this._checkUniform(e),this._colors4Arrays[e]=t.reduce((i,s)=>(i.push(s.r,s.g,s.b,s.a),i),[]),this}setVector2(e,t){return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){return this._checkUniform(e),this._vectors4[e]=t,this}setQuaternion(e,t){return this._checkUniform(e),this._quaternions[e]=t,this}setQuaternionArray(e,t){return this._checkUniform(e),this._quaternionsArrays[e]=t.reduce((i,s)=>(s.toArray(i,i.length),i),[]),this}setMatrix(e,t){return this._checkUniform(e),this._matrices[e]=t,this}setMatrices(e,t){this._checkUniform(e);const i=new Float32Array(t.length*16);for(let s=0;s<t.length;s++)t[s].copyToArray(i,s*16);return this._matrixArrays[e]=i,this}setMatrix3x3(e,t){return this._checkUniform(e),this._matrices3x3[e]=t,this}setMatrix2x2(e,t){return this._checkUniform(e),this._matrices2x2[e]=t,this}setArray2(e,t){return this._checkUniform(e),this._vectors2Arrays[e]=t,this}setArray3(e,t){return this._checkUniform(e),this._vectors3Arrays[e]=t,this}setArray4(e,t){return this._checkUniform(e),this._vectors4Arrays[e]=t,this}setUniformBuffer(e,t){return this._options.uniformBuffers.indexOf(e)===-1&&this._options.uniformBuffers.push(e),this._uniformBuffers[e]=t,this}setTextureSampler(e,t){return this._options.samplerObjects.indexOf(e)===-1&&this._options.samplerObjects.push(e),this._textureSamplers[e]=t,this}setStorageBuffer(e,t){return this._options.storageBuffers.indexOf(e)===-1&&this._options.storageBuffers.push(e),this._storageBuffers[e]=t,this}setDefine(e,t){const i=e.trimEnd()+" ",s=this.options.defines.findIndex(n=>n===e||n.startsWith(i));return s>=0&&this.options.defines.splice(s,1),(typeof t!="boolean"||t)&&this.options.defines.push(i+t),this}isReadyForSubMesh(e,t,i){return this.isReady(e,i,t)}isReady(e,t,i){const s=i&&this._storeEffectOnSubMeshes;if(this.isFrozen){const I=s?i._drawWrapper:this._drawWrapper;if(I.effect&&I._wasPreviouslyReady&&I._wasPreviouslyUsingInstances===t)return!0}const n=this.getScene(),o=n.getEngine(),c=[],h=[];let f=null,_=this._shaderPath,m=this._options.uniforms,g=this._options.uniformBuffers,x=this._options.samplers;o.getCaps().multiview&&n.activeCamera&&n.activeCamera.outputRenderTarget&&n.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,c.push("#define MULTIVIEW"),m.indexOf("viewProjection")!==-1&&m.indexOf("viewProjectionR")===-1&&m.push("viewProjectionR"));for(let I=0;I<this._options.defines.length;I++){const P=this._options.defines[I].indexOf("#define")===0?this._options.defines[I]:`#define ${this._options.defines[I]}`;c.push(P)}for(let I=0;I<this._options.attributes.length;I++)h.push(this._options.attributes[I]);if(e&&e.isVerticesDataPresent(k.ColorKind)&&(h.indexOf(k.ColorKind)===-1&&h.push(k.ColorKind),c.push("#define VERTEXCOLOR")),t&&(c.push("#define INSTANCES"),zv(h,this._materialHelperNeedsPreviousMatrices),e?.hasThinInstances&&(c.push("#define THIN_INSTANCES"),e&&e.isVerticesDataPresent(k.ColorInstanceKind)&&(h.push(k.ColorInstanceKind),c.push("#define INSTANCESCOLOR")))),e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton){h.push(k.MatricesIndicesKind),h.push(k.MatricesWeightsKind),e.numBoneInfluencers>4&&(h.push(k.MatricesIndicesExtraKind),h.push(k.MatricesWeightsExtraKind)
299);const I=e.skeleton;c.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),f=new b1,f.addCPUSkinningFallback(0,e),I.isUsingTextureForMatrices?(c.push("#define BONETEXTURE"),m.indexOf("boneTextureInfo")===-1&&m.push("boneTextureInfo"),this._options.samplers.indexOf("boneSampler")===-1&&this._options.samplers.push("boneSampler")):(c.push("#define BonesPerMesh "+(I.bones.length+1)),m.indexOf("mBones")===-1&&m.push("mBones"))}else c.push("#define NUM_BONE_INFLUENCERS 0");let y=0;const b=e?e.morphTargetManager:null;if(b){const I=c.indexOf("#define UV1")!==-1,P=c.indexOf("#define UV2")!==-1,L=c.indexOf("#define TANGENT")!==-1,V=c.indexOf("#define NORMAL")!==-1,X=c.indexOf("#define VERTEXCOLOR")!==-1;y=zC(b,c,h,e,!0,V,L,I,P,X),b.isUsingTextureForTargets&&(m.indexOf("morphTargetTextureIndices")===-1&&m.push("morphTargetTextureIndices"),this._options.samplers.indexOf("morphTargets")===-1&&this._options.samplers.push("morphTargets")),y>0&&(m=m.slice(),m.push("morphTargetInfluences"),m.push("morphTargetCount"),m.push("morphTargetTextureInfo"),m.push("morphTargetTextureIndices"))}else c.push("#define NUM_MORPH_INFLUENCERS 0");if(e){const I=e.bakedVertexAnimationManager;I&&I.isEnabled&&(c.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),m.indexOf("bakedVertexAnimationSettings")===-1&&m.push("bakedVertexAnimationSettings"),m.indexOf("bakedVertexAnimationTextureSizeInverted")===-1&&m.push("bakedVertexAnimationTextureSizeInverted"),m.indexOf("bakedVertexAnimationTime")===-1&&m.push("bakedVertexAnimationTime"),this._options.samplers.indexOf("bakedVertexAnimationTexture")===-1&&this._options.samplers.push("bakedVertexAnimationTexture"),t&&h.push("bakedVertexAnimationSettingsInstanced"))}for(const I in this._textures)if(!this._textures[I].isReady())return!1;for(const I in this._internalTextures)if(!this._internalTextures[I].isReady)return!1;e&&this.needAlphaTestingForMesh(e)&&c.push("#define ALPHATEST"),this._options.useClipPlane!==!1&&(Bv(m),NC(this,n,c)),n.fogEnabled&&e?.applyFog&&n.fogMode!==Ae.FOGMODE_NONE&&(c.push("#define FOG"),m.indexOf("view")===-1&&m.push("view"),m.indexOf("vFogInfos")===-1&&m.push("vFogInfos"),m.indexOf("vFogColor")===-1&&m.push("vFogColor")),this._useLogarithmicDepth&&(c.push("#define LOGARITHMICDEPTH"),m.indexOf("logarithmicDepthConstant")===-1&&m.push("logarithmicDepthConstant"));const v=i?i.getRenderingMesh():e;if(v&&this.useVertexPulling){const I=v.geometry;I&&(this._vertexPullingMetadata=T1(I),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((L,V)=>{m.push(`vp_${V}_info`)})),c.push("#define USE_VERTEX_PULLING");const P=v.geometry?.getIndexBuffer();P&&!v.isUnIndexed&&(c.push("#define VERTEX_PULLING_USE_INDEX_BUFFER"),P.is32Bits&&c.push("#define VERTEX_PULLING_INDEX_BUFFER_32BITS"))}this.customShaderNameResolve&&(m=m.slice(),g=g.slice(),x=x.slice(),_=this.customShaderNameResolve(this.name,m,g,x,c,h));const E=s?i._getDrawWrapper(void 0,!0):this._drawWrapper,R=E?.effect??null,C=E?.defines??null,O=c.join(`
300`);let M=R;return C!==O&&(M=o.createEffect(_,{attributes:h,uniformsNames:m,uniformBuffersNames:g,samplers:x,defines:O,fallbacks:f,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:y},shaderLanguage:this._options.shaderLanguage,extraInitializationsAsync:this._options.extraInitializationsAsync},o),s?i.setEffect(M,O,this._materialContext):E&&E.setEffect(M,O),this._onEffectCreatedObservable&&(U_.effect=M,U_.subMesh=i??e?.subMeshes[0]??null,this._onEffectCreatedObservable.notifyObservers(U_))),E._wasPreviouslyUsingInstances=!!t,M?.isReady()?(R!==M&&n.resetCachedMaterial(),E._wasPreviouslyReady=!0,!0):!1}bindOnlyWorldMatrix(e,t){const i=t??this.getEffect();if(!i)return;const s=this._options.uniforms;s.indexOf("world")!==-1&&i.setMatrix("world",e);const n=this.getScene();s.indexOf("worldView")!==-1&&(e.multiplyToRef(n.getViewMatrix(),this._cachedWorldViewMatrix),i.setMatrix("worldView",this._cachedWorldViewMatrix)),s.indexOf("worldViewProjection")!==-1&&(e.multiplyToRef(n.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),i.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)),s.indexOf("view")!==-1&&i.setMatrix("view",n.getViewMatrix())}bindForSubMesh(e,t,i){this.bind(e,t,i._drawWrapperOverride?.effect,i)}bind(e,t,i,s){const n=s&&this._storeEffectOnSubMeshes,o=i??(n?s.effect:this.getEffect());if(!o)return;const c=this.getScene();this._activeEffect=o,this.bindOnlyWorldMatrix(e,i);const h=this._options.uniformBuffers;let f=!1;if(o&&h&&h.length>0&&c.getEngine().supportsUniformBuffers)for(let m=0;m<h.length;++m)switch(h[m]){case"Mesh":t&&(t.getMeshUniformBuffer().bindToEffect(o,"Mesh"),t.transferToEffect(e));break;case"Scene":Vv(o,c.getSceneUniformBuffer()),c.finalizeSceneUbo(),f=!0;break}const _=t&&n?this._mustRebind(c,o,s,t.visibility):c.getCachedMaterial()!==this;if(o&&_){!f&&this._options.uniforms.indexOf("view")!==-1&&o.setMatrix("view",c.getViewMatrix()),!f&&this._options.uniforms.indexOf("projection")!==-1&&o.setMatrix("projection",c.getProjectionMatrix()),!f&&this._options.uniforms.indexOf("viewProjection")!==-1&&(o.setMatrix("viewProjection",c.getTransformMatrix()),this._multiview&&o.setMatrix("viewProjectionR",c._transformMatrixR)),c.activeCamera&&this._options.uniforms.indexOf("cameraPosition")!==-1&&o.setVector3("cameraPosition",c.activeCamera.globalPosition),Hv(t,o),Lv(o,this,c),this._vertexPullingMetadata&&v1(o,this._vertexPullingMetadata),this._useLogarithmicDepth&&kv(n?s.materialDefines:o.defines,o,c),t&&Nv(c,t,o);let m;
vendor: 5,569 bytes, line 300
300for(m in this._textures)o.setTexture(m,this._textures[m]);for(m in this._internalTextures)o._bindTexture(m,this._internalTextures[m]);for(m in this._textureArrays)o.setTextureArray(m,this._textureArrays[m]);for(m in this._ints)o.setInt(m,this._ints[m]);for(m in this._uints)o.setUInt(m,this._uints[m]);for(m in this._floats)o.setFloat(m,this._floats[m]);for(m in this._floatsArrays)o.setArray(m,this._floatsArrays[m]);for(m in this._colors3)o.setColor3(m,this._colors3[m]);for(m in this._colors3Arrays)o.setArray3(m,this._colors3Arrays[m]);for(m in this._colors4){const v=this._colors4[m];o.setFloat4(m,v.r,v.g,v.b,v.a)}for(m in this._colors4Arrays)o.setArray4(m,this._colors4Arrays[m]);for(m in this._vectors2)o.setVector2(m,this._vectors2[m]);for(m in this._vectors3)o.setVector3(m,this._vectors3[m]);for(m in this._vectors4)o.setVector4(m,this._vectors4[m]);for(m in this._quaternions)o.setQuaternion(m,this._quaternions[m]);for(m in this._matrices)o.setMatrix(m,this._matrices[m]);for(m in this._matrixArrays)o.setMatrices(m,this._matrixArrays[m]);for(m in this._matrices3x3)o.setMatrix3x3(m,this._matrices3x3[m]);for(m in this._matrices2x2)o.setMatrix2x2(m,this._matrices2x2[m]);for(m in this._vectors2Arrays)o.setArray2(m,this._vectors2Arrays[m]);for(m in this._vectors3Arrays)o.setArray3(m,this._vectors3Arrays[m]);for(m in this._vectors4Arrays)o.setArray4(m,this._vectors4Arrays[m]);for(m in this._quaternionsArrays)o.setArray4(m,this._quaternionsArrays[m]);for(m in this._uniformBuffers){const v=this._uniformBuffers[m].getBuffer();v&&o.bindUniformBuffer(v,m)}const g=c.getEngine(),x=g.setExternalTexture;if(x)for(m in this._externalTextures)x.call(g,m,this._externalTextures[m]);const y=g.setTextureSampler;if(y)for(m in this._textureSamplers)y.call(g,m,this._textureSamplers[m]);const b=g.setStorageBuffer;if(b)for(m in this._storageBuffers)b.call(g,m,this._storageBuffers[m])}if(o&&t&&(_||!this.isFrozen)){Gv(t,o),t.morphTargetManager&&t.morphTargetManager.isUsingTextureForTargets&&t.morphTargetManager._bind(o);const m=t.bakedVertexAnimationManager;if(m&&m.isEnabled){const g=n?s._drawWrapper:this._drawWrapper;t.bakedVertexAnimationManager?.bind(o,!!g._wasPreviouslyUsingInstances)}}this._afterBind(t,o,s)}getActiveTextures(){const e=super.getActiveTextures();for(const t in this._textures)e.push(this._textures[t]);for(const t in this._textureArrays){const i=this._textureArrays[t];for(let s=0;s<i.length;s++)e.push(i[s])}return e}hasTexture(e){if(super.hasTexture(e))return!0;for(const i in this._textures)if(this._textures[i]===e)return!0;const t=e.getInternalTexture();for(const i in this._internalTextures)if(this._internalTextures[i]===t)return!0;for(const i in this._textureArrays){const s=this._textureArrays[i];for(let n=0;n<s.length;n++)if(s[n]===e)return!0}return!1}clone(e){const t=xt.Clone(()=>new wf(e,this.getScene(),this._shaderPath,this._options,this._storeEffectOnSubMeshes),this);t.name=e,t.id=e,typeof t._shaderPath=="object"&&(t._shaderPath={...t._shaderPath}),this._options={...this._options};const i=Object.keys(this._options);for(const s of i){const n=this._options[s];Array.isArray(n)&&(this._options[s]=n.slice(0))}this.stencil.copyTo(t.stencil);for(const s in this._textures)t.setTexture(s,this._textures[s]);for(const s in this._internalTextures)t.setInternalTexture(s,this._internalTextures[s]);for(const s in this._textureArrays)t.setTextureArray(s,this._textureArrays[s]);for(const s in this._externalTextures)t.setExternalTexture(s,this._externalTextures[s]);for(const s in this._ints)t.setInt(s,this._ints[s]);for(const s in this._uints)t.setUInt(s,this._uints[s]);for(const s in this._floats)t.setFloat(s,this._floats[s]);for(const s in this._floatsArrays)t.setFloats(s,this._floatsArrays[s]);for(const s in this._colors3)t.setColor3(s,this._colors3[s]);for(const s in this._colors3Arrays)t._colors3Arrays[s]=this._colors3Arrays[s];for(const s in this._colors4)t.setColor4(s,this._colors4[s]);for(const s in this._colors4Arrays)t._colors4Arrays[s]=this._colors4Arrays[s];for(const s in this._vectors2)t.setVector2(s,this._vectors2[s]);for(const s in this._vectors3)t.setVector3(s,this._vectors3[s]);for(const s in this._vectors4)t.setVector4(s,this._vectors4[s]);for(const s in this._quaternions)t.setQuaternion(s,this._quaternions[s]);for(const s in this._quaternionsArrays)t._quaternionsArrays[s]=this._quaternionsArrays[s];for(const s in this._matrices)t.setMatrix(s,this._matrices[s]);for(const s in this._matrixArrays)t._matrixArrays[s]=this._matrixArrays[s].slice();for(const s in this._matrices3x3)t.setMatrix3x3(s,this._matrices3x3[s]);for(const s in this._matrices2x2)t.setMatrix2x2(s,this._matrices2x2[s]);for(const s in this._vectors2Arrays)t.setArray2(s,this._vectors2Arrays[s]);for(const s in this._vectors3Arrays)t.setArray3(s,this._vectors3Arrays[s]);for(const s in this._vectors4Arrays)t.setArray4(s,this._vectors4Arrays[s]);for(const s in this._uniformBuffers)t.setUniformBuffer(s,this._uniformBuffers[s]);for(const s in this._textureSamplers)t.setTextureSampler(s,this._textureSamplers[s]);for(const s in this._storageBuffers)t.setStorageBuffer(s,this._storageBuffers[s]);return t}dispose(e,t,i){if(t){let s;for(s in this._textures)this._textures[s].dispose();for(s in this._internalTextures)this._internalTextures[s].dispose();for(s in this._textureArrays){const n=this._textureArrays[s];for(let o=0;o<n.length;o++)n[o].dispose()}}this._textures={},this._internalTextures={},super.dispose(e,t,i)}serialize(){const e=xt.Serialize(this);e.customType="BABYLON.ShaderMaterial",e.uniqueId=this.uniqueId,e.o
300ptions=this._options,e.shaderPath=this._shaderPath,e.storeEffectOnSubMeshes=this._storeEffectOnSubMeshes;let t;e.stencil=this.stencil.serialize(),e.textures={};for(t in this._textures)e.textures[t]=this._textures[t].serialize();e.textureArrays={};for(t in this._textureArrays){e.textureArrays[t]=[];const i=this._textureArrays[t];for(let s=0;s<i.length;s++)e.textureArrays[t].push(i[s].serialize())}e.ints={};for(t in this._ints)e.ints[t]=this._ints[t];e.uints={};for(t in this._uints)e.uints[t]=this._uints[t];e.floats={};for(t in this._floats)e.floats[t]=this._floats[t];e.floatsArrays={};for(t in this._floatsArrays)e.floatsArrays[t]=this._floatsArrays[t];e.colors3={};for(t in this._colors3){const i=this._colors3[t];e.colors3[t]=[i.r,i.g,i.b]}e.colors3Arrays={};for(t in this._colors3Arrays)e.colors3Arrays[t]=this._colors3Arrays[t];e.colors4={};for(t in this._colors4){const i=this._colors4[t];e.colors4[t]=[i.r,i.g,i.b,i.a]}e.colors4Arrays={};for(t in this._colors4Arrays)e.colors4Arrays[t]=this._colors4Arrays[t];e.vectors2={};for(t in this._vectors2){const i=this._vectors2[t];e.vectors2[t]=[i.x,i.y]}e.vectors3={};for(t in this._vectors3){const i=this._vectors3[t];e.vectors3[t]=[i.x,i.y,i.z]}e.vectors4={};for(t in this._vectors4){const i=this._vectors4[t];e.vectors4[t]=[i.x,i.y,i.z,i.w]}e.quaternions={};for(t in this._quaternions)e.quaternions[t]=this._quaternions[t].asArray();e.matrices={};for(t in this._matrices)e.matrices[t]=this._matrices[t].asArray();e.matrixArray={};for(t in this._matrixArrays)e.matrixArray[t]=this._matrixArrays[t];e.matrices3x3={};for(t in this._matrices3x3)e.matrices3x3[t]=this._matrices3x3[t];e.matrices2x2={};for(t in this._matrices2x2)e.matrices2x2[t]=this._matrices2x2[t];e.vectors2Arrays={};for(t in this._vectors2Arrays)e.vectors2Arrays[t]=this._vectors2Arrays[t];e.vectors3Arrays={};for(t in this._vectors3Arrays)e.vectors3Arrays[t]=this._vectors3Arrays[t];e.vectors4Arrays={};for(t in this._vectors4Arrays)e.vectors4Arrays[t]=this._vectors4Arrays[t];e.quaternionsArrays={};for(t in this._quaternionsArrays)e.quaternionsArrays[t]=this._quaternionsArrays[t];return e}}wf.SnippetUrl="https://snippet.babylonjs.com";var iT,sT;class yn extends ${_isShaderMaterial(e){return e?e.getClassName()==="ShaderMaterial":!1}constructor(e,t=null,i=null,s=null,n,o,c,h){super(e,t,i,s,n),this.useVertexColor=o,this.useVertexAlpha=c,this.color=new rt(1,1,1),this.alpha=1,this._shaderLanguage=0,this._ownsMaterial=!1,s&&(this.color=s.color.clone(),this.alpha=s.alpha,this.useVertexColor=s.useVertexColor,this.useVertexAlpha=s.useVertexAlpha),this.intersectionThreshold=.1;const f=[],_={attributes:[k.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:f,useClipPlane:null,shaderLanguage:0};if(this.useVertexAlpha?_.defines.push("#define VERTEXALPHA"):_.needAlphaBlending=!1,this.useVertexColor?(_.defines.push("#define VERTEXCOLOR"),_.attributes.push(k.ColorKind)):(_.uniforms.push("color"),this._color4=new _t),h)this.material=h;else{this.getScene().getEngine().isWebGPU&&!yn.ForceGLSL&&(this._shaderLanguage=1),_.shaderLanguage=this._shaderLanguage,_.extraInitializationsAsync=async()=>{this._shaderLanguage===1?await Promise.all([Wi(()=>import("./color.vertex-DjkdNiry.js"),__vite__mapDeps([4,5])),Wi(()=>import("./color.fragment-DdTeKgrn.js"),__vite__mapDeps([6,7]))]):await Promise.all([Wi(()=>import("./color.vertex-BAaFmXnU.js"),__vite__mapDeps([8,9])),Wi(()=>import("./color.fragment-Oy0DhIu7.js"),__vite__mapDeps([10,11]))])};const g=new wf("colorShader",this.getScene(),"color",_,!1);g.doNotSerialize=!0,this._ownsMaterial=!0,this._setInternalMaterial(g)}}getClassName(){return"LinesMesh"}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){const t=this.material;if(t===e)return;const i=t&&this._ownsMaterial;this._ownsMaterial=!1,this._setInternalMaterial(e),i&&t?.dispose()}_setInternalMaterial(e){this._setMaterial(e),this.material&&(this.material.fillMode=Ei.LineListDrawMode,this.material.disableLighting=!0)}get checkCollisions(){return!1}set checkCollisions(e){}_bind(e,t){if(!this._geometry)return this;const i=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,i):this._geometry._bind(t,i,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!this.useVertexColor&&this._isShaderMaterial(this.material)){const{r:s,g:n,b:o}=this.color;this._color4.set(s,n,o,this.alpha),this.material.setColor4("color",this._color4)}return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const s=this.getScene().getEngine();
300return this._unIndexed?s.drawArraysType(Ei.LineListDrawMode,e.verticesStart,e.verticesCount,i):s.drawElementsType(Ei.LineListDrawMode,e.indexStart,e.indexCount,i),this}dispose(e,t=!1,i){i||(this._ownsMaterial?this.material?.dispose(!1,!1,!0):t&&this.material?.dispose(!1,!1,!0)),super.dispose(e)}clone(e,t=null,i){if(t&&t._addToSceneRootNodes===void 0){const s=t;return s.source=this,new yn(e,this.getScene(),s.parent,s.source,s.doNotCloneChildren)}return new yn(e,this.getScene(),t,this,i)}createInstance(e){const t=new E1(e,this);if(this.instancedBuffers){t.instancedBuffers={};for(const i in this.instancedBuffers)t.instancedBuffers[i]=this.instancedBuffers[i]}return t}serialize(e){super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){const i=new yn(e.name,t);return i.color=rt.FromArray(e.color),i.alpha=e.alpha,i}}yn.ForceGLSL=!1;class E1 extends JD{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}(iT=yn.prototype).enableEdgesRendering??(iT.enableEdgesRendering=Xe("LinesMesh","enableEdgesRendering"));(sT=E1.prototype).enableEdgesRendering??(sT.enableEdgesRendering=Xe("InstancedLinesMesh","enableEdgesRendering"));function A1(a){const e=[],t=[],i=a.lines,s=a.colors,n=[];let o=0;for(let h=0;h<i.length;h++){const f=i[h];for(let _=0;_<f.length;_++){const{x:m,y:g,z:x}=f[_];if(t.push(m,g,x),s){const y=s[h],{r:b,g:v,b:E,a:R}=y[_];n.push(b,v,E,R)}_>0&&(e.push(o-1),e.push(o)),o++}}const c=new Ue;return c.indices=e,c.positions=t,s&&(c.colors=n),c}function R1(a){const e=a.dashSize||3,t=a.gapSize||1,i=a.dashNb||200,s=a.points,n=[],o=[],c=D.Zero();let h=0,f,_,m=0,g;for(g=0;g<s.length-1;g++)s[g+1].subtractToRef(s[g],c),h+=c.length();const x=h/i,y=e*x/(e+t);for(g=0;g<s.length-1;g++){s[g+1].subtractToRef(s[g],c),f=Math.floor(c.length()/x),c.normalize();for(let v=0;v<f;v++)_=x*v,n.push(s[g].x+_*c.x,s[g].y+_*c.y,s[g].z+_*c.z),n.push(s[g].x+(_+y)*c.x,s[g].y+(_+y)*c.y,s[g].z+(_+y)*c.z),o.push(m,m+1),m+=2}const b=new Ue;return b.positions=n,b.indices=o,b}function S1(a,e,t=null){const i=e.instance,s=e.lines,n=e.colors;if(i){const f=i.getVerticesData(k.PositionKind);let _,m;n&&(_=i.getVerticesData(k.ColorKind));let g=0,x=0;for(let y=0;y<s.length;y++){const b=s[y];for(let v=0;v<b.length;v++)f[g]=b[v].x,f[g+1]=b[v].y,f[g+2]=b[v].z,n&&_&&(m=n[y],_[x]=m[v].r,_[x+1]=m[v].g,_[x+2]=m[v].b,_[x+3]=m[v].a,x+=4),g+=3}return i.updateVerticesData(k.PositionKind,f,!1,!1),n&&_&&i.updateVerticesData(k.ColorKind,_,!1,!1),i.refreshBoundingInfo(),i}const o=!!n,c=new yn(a,t,null,void 0,void 0,o,e.useVertexAlpha,e.material);return A1(e).applyToMesh(c,e.updatable),c}function M1(a,e,t=null){const i=e.colors?[e.colors]:null;return S1(a,{lines:[e.points],updatable:e.updatable,instance:e.instance,colors:i,useVertexAlpha:e.useVertexAlpha,material:e.material},t)}function C1(a,e,t=null){const i=e.points,s=e.instance,n=e.gapSize||1,o=e.dashSize||3;if(s){const f=_=>{const m=D.Zero(),g=_.length/6;let x=0,y,b,v=0,E,R;for(E=0;E<i.length-1;E++)i[E+1].subtractToRef(i[E],m),x+=m.length();const C=x/g,O=s._creationDataStorage.dashSize,M=s._creationDataStorage.gapSize,I=O*C/(O+M);for(E=0;E<i.length-1;E++)for(i[E+1].subtractToRef(i[E],m),y=Math.floor(m.length()/C),m.normalize(),R=0;R<y&&v<_.length;)b=C*R,_[v]=i[E].x+b*m.x,_[v+1]=i[E].y+b*m.y,_[v+2]=i[E].z+b*m.z,_[v+3]=i[E].x+(b+I)*m.x,_[v+4]=i[E].y+(b+I)*m.y,_[v+5]=i[E].z+(b+I)*m.z,v+=6,R++;for(;v<_.length;)_[v]=i[E].x,_[v+1]=i[E].y,_[v+2]=i[E].z,v+=3};return(e.dashNb||e.dashSize||e.gapSize||e.useVertexAlpha||e.material)&&pe.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."),s.updateMeshPositions(f,!1),s}const c=new yn(a,t,null,void 0,void 0,void 0,e.useVertexAlpha,e.material);return R1(e).applyToMesh(c,e.updatable),c._creationDataStorage=new Wv,c._creationDataStorage.dashSize=o,c._creationDataStorage.gapSize=n,c}let rT=!1;function eI(){rT||(rT=!0,Ue.CreateLineSystem=A1,Ue.CreateDashedLines=R1,$.CreateLines=(a,e,t=null,i=!1,s=null)=>M1(a,{points:e,updatable:i,instance:s},t),$.CreateDashedLines=(a,e,t,i,s,n=null,o,c)=>C1(a,{points:e,dashSize:t,gapSize:i,dashNb:s,updatable:o,instance:c},n))}class tI extends Fe{constructor(e,t){super(e.x,e.y),this.index=t}}class z_{constructor(){this.elements=[]}add(e){const t=[];for(const i of e){const s=new tI(i,this.elements.length);t.push(s),this.elements.push(s)}return t}computeBounds(){const e=new Fe(this.elements[0].x,this.elements[0].y),t=new Fe(this.elements[0].x,this.elements[0].y);for(const i of this.elements)i.x<e.x?e.x=i.x:i.x>t.x&&(t.x=i.x),i.y<e.y?e.y=i.y:i.y>t.y&&(t.y=i.y);return{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class iI{_addToepoint(e){for(const t of e)this._epoints.push(t.x,t.y)}constructor(e,t,i,s=earcut){this._points=new z_,this._outlinepoints=new z_,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=s,this._name=e,this._scene=i||mt.LastCreatedScene;let n;t instanceof Df?n=t.getPoints():n=t,this._addToepoint(n),this._points.add(n),this._outlinepoints.add(n),typeof this.bjsEarcut>"u"&&pe.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);const t=new z_;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,i=2){const s=new $(this._name,this._scene),n=this.buildVertexData(t,i);return s.setVerticesData(k.PositionKind,n.positions,e),s.setVerticesData(k.NormalKind,n.normals,e),s.setVerticesData(k.UVKind,n.uvs,e),s.setIndices(n.indices),s}buildVertexData(e=0,t=2){const i=new Ue,s=[],n=[],o=[],c=this._points.computeBounds();for(const _ of this._points.elements)s.push(0,1,0),n.push(_.x,0,_.y),o.push((_.x-c.min.x)/c.width,(_.y-c.min.y)/c.height);const h=[],f=this.bjsEarcut(this._epoints,this._eholes,2);for(let _=0;_<f.length;_++)h.push(f[_]);if(e>0){const _=n.length/3;for(const g of this._points.elements)s.push(0,-1,0),n.push(g.x,-e,g.y),o.push(1-(g.x-c.min.x)/c.width,1-(g.y-c.min.y)/c.height);const m=h.length;for(let g=0;g<m;g+=3){const x=h[g+0],y=h[g+1],b=h[g+2];h.push(b+_),h.push(y+_),h.push(x+_)}this._addSide(n,s,o,h,c,this._outlinepoints,e,!1,t);for(const g of this._holes)this._addSide(n,s,o,h,c,g,e,!0,t)}return i.indices=h,i.positions=n,i.normals=s,i.uvs=o,i}_addSide(e,t,i,s,n,o,c,h,f){let _=e.length/3,m=0;for(let g=0;g<o.elements.length;g++){const x=o.elements[g],y=o.elements[(g+1)%o.elements.length];e.push(x.x,0,x.y),e.push(x.x,-c,x.y),e.push(y.x,0,y.y),e.push(y.x,-c,y.y);const b=o.elements[(g+o.elements.length-1)%o.elements.length],v=o.elements[(g+2)%o.elements.length];let E=new D(-(y.y-x.y),0,y.x-x.x),R=new D(-(x.y-b.y),0,x.x-b.x),C=new D(-(v.y-y.y),0,v.x-y.x);h||(E=E.scale(-1),R=R.scale(-1),C=C.scale(-1));const O=E.normalizeToNew();let M=R.normalizeToNew(),I;const P=D.Dot(M,O);P>f?P<Vt-1?M=new D(x.x,0,x.y).subtract(new D(y.x,0,y.y)).normalize():M=R.add(E).normalize():M=O;const L=D.Dot(C,E);L>f?L<Vt-1?I=new D(y.x,0,y.y).subtract(new D(x.x,0,x.y)).normalize():I=C.add(E).normalize():I=O,i.push(m/n.width,0),i.push(m/n.width,1),m+=E.length(),i.push(m/n.width,0),i.push(m/n.width,1),t.push(M.x,M.y,M.z),t.pu
300sh(M.x,M.y,M.z),t.push(I.x,I.y,I.z),t.push(I.x,I.y,I.z),h?(s.push(_),s.push(_+2),s.push(_+1),s.push(_+1),s.push(_+2),s.push(_+3)):(s.push(_),s.push(_+1),s.push(_+2),s.push(_+1),s.push(_+3),s.push(_+2)),_+=4}}}function D1(a,e,t,i,s,n,o){const c=t||new Array(3),h=i,f=[],_=o||!1;for(let V=0;V<3;V++)c[V]===void 0&&(c[V]=new at(0,0,1,1)),h&&h[V]===void 0&&(h[V]=new _t(1,1,1,1));const m=a.getVerticesData(k.PositionKind),g=a.getVerticesData(k.NormalKind),x=a.getVerticesData(k.UVKind),y=a.getIndices(),b=m.length/9;let v,E,R,C,O=0;const M=[0];if(_)for(let V=b;V<m.length/3;V+=4)E=m[3*(V+2)]-m[3*V],R=m[3*(V+2)+2]-m[3*V+2],C=Math.sqrt(E*E+R*R),O+=C,M.push(O);let I,P=0;for(let V=0;V<g.length;V+=3)Math.abs(g[V+1])<.001&&(P=1),Math.abs(g[V+1]-1)<.001&&(P=0),Math.abs(g[V+1]+1)<.001&&(P=2),I=V/3,P===1?(v=I-b,v%4<1.5?_?x[2*I]=c[P].x+(c[P].z-c[P].x)*M[Math.floor(v/4)]/O:x[2*I]=c[P].x:_?x[2*I]=c[P].x+(c[P].z-c[P].x)*M[Math.floor(v/4)+1]/O:x[2*I]=c[P].z,v%2===0?x[2*I+1]=c[P].w:x[2*I+1]=c[P].y):(x[2*I]=(1-x[2*I])*c[P].x+x[2*I]*c[P].z,x[2*I+1]=(1-x[2*I+1])*c[P].y+x[2*I+1]*c[P].w),h&&f.push(h[P].r,h[P].g,h[P].b,h[P].a);Ue._ComputeSides(e,m,y,g,x,s,n);const L=new Ue;if(L.indices=y,L.positions=m,L.normals=g,L.uvs=x,h){const V=e===Ue.DOUBLESIDE?f.concat(f):f;L.colors=V}return L}function Fm(a,e,t=null,i=earcut){e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation);const s=e.shape,n=e.holes||[],o=e.depth||0,c=e.smoothingThreshold||2,h=[];let f;for(let y=0;y<s.length;y++)h[y]=new Fe(s[y].x,s[y].z);h[0].equalsWithEpsilon(h[h.length-1],1e-8)&&h.pop();const m=new iI(a,h,t||mt.LastCreatedScene,i);for(let y=0;y<n.length;y++){f=[];for(let b=0;b<n[y].length;b++)f.push(new Fe(n[y][b].x,n[y][b].z));m.addHole(f)}const g=m.build(!1,o,c);return g._originalBuilderSideOrientation=e.sideOrientation,D1(g,e.sideOrientation,e.faceUV,e.faceColors,e.frontUVs,e.backUVs,e.wrap).applyToMesh(g,e.updatable),g}function Bm(a,e,t=null,i=earcut){return Fm(a,e,t,i)}let nT=!1;function sI(){nT||(nT=!0,Ue.CreatePolygon=D1,$.CreatePolygon=(a,e,t,i,s,n,o=earcut)=>Fm(a,{shape:e,holes:i,updatable:s,sideOrientation:n},t,o),$.ExtrudePolygon=(a,e,t,i,s,n,o,c=earcut)=>Bm(a,{shape:e,holes:s,depth:t,updatable:n,sideOrientation:o},i,c))}function I1(a,e,t=null){const i=e.path,s=e.shape,n=e.scale||1,o=e.rotation||0,c=e.cap===0?0:e.cap||$.NO_CAP,h=e.updatable,f=$._GetDefaultSideOrientation(e.sideOrientation),_=e.instance||null,m=e.invertUV||!1,g=e.closeShape||!1,x=e.closePath||!1,y=e.capFunction||null;return O1(a,s,i,n,o,null,null,x,g,c,!1,t,!!h,f,_,m,e.frontUVs||null,e.backUVs||null,e.firstNormal||null,!!e.adjustFrame,y)}function P1(a,e,t=null){const i=e.path,s=e.shape,n=D.Zero(),o=(R,C)=>{const O=e.scaleFunction?.(R,C)??1;return n.copyFromFloats(O,O,O)},c=e.rotationFunction||(()=>0),h=e.closePath||e.ribbonCloseArray||!1,f=e.closeShape||e.ribbonClosePath||!1,_=e.cap===0?0:e.cap||$.NO_CAP,m=e.updatable,g=e.firstNormal||null,x=e.adjustFrame||!1,y=$._GetDefaultSideOrientation(e.sideOrientation),b=e.instance,v=e.invertUV||!1,E=e.capFunction||null;return O1(a,s,i,null,null,e.scaleVectorFunction??o,c,h,f,_,!0,t,!!m,y,b||null,v,e.frontUVs||null,e.backUVs||null,g,x,E||null)}function O1(a,e,t,i,s,n,o,c,h,f,_,m,g,x,y,b,v,E,R,C,O){const M=(re,ae,de,U,te,Y,Z,q,j,Q,w)=>{const B=de.getTangents(),z=de.getNormals(),K=de.getBinormals(),ue=de.getDistances();if(w){for(let He=0;He<B.length;He++)if(B[He].x==0&&B[He].y==0&&B[He].z==0&&B[He].copyFrom(B[He-1]),z[He].x==0&&z[He].y==0&&z[He].z==0&&z[He].copyFrom(z[He-1]),K[He].x==0&&K[He].y==0&&K[He].z==0&&K[He].copyFrom(K[He-1]),He>0){let dt=B[He-1];D.Dot(dt,B[He])<0&&B[He].scaleInPlace(-1),dt=z[He-1],D.Dot(dt,z[He])<0&&z[He].scaleInPlace(-1),dt=K[He-1],D.Dot(dt,K[He])<0&&K[He].scaleInPlace(-1)}}let he=0;const ve=()=>te!==null?te:D.OneReadOnly,ke=Q&&q?q:()=>Y!==null?Y:0,J=Q&&Z?Z:ve;let _e=j===$.NO_CAP||j===$.CAP_END?0:2;const xe=ge.Matrix[0];for(let He=0;He<ae.length;He++){const dt=[],li=ke(He,ue[He]),zt=J(He,ue[He]);se.RotationAxisToRef(B[He],he,xe);for(let Ot=0;Ot<re.length;Ot++){const jt=B[He].scale(re[Ot].z).add(z[He].scale(re[Ot].x)).add(K[He].scale(re[Ot].y)),Nt=D.Zero();D.TransformCoordinatesToRef(jt,xe,Nt),Nt.multiplyInPlace(zt).addInPlace(ae[He]),dt[Ot]=Nt}U[_e]=dt,he+=li,_e++}const Qe=O||(He=>{const dt=Array(),li=D.Zero();let zt;for(zt=0;zt<He.length;zt++)li.addInPlace(He[zt]);for(li.scaleInPlace(1/He.length),zt=0;zt<He.length;zt++)dt.push(li);return dt});switch(j){case $.NO_CAP:break;case $.CAP_START:U[0]=Qe(U[2]),U[1]=U[2];break;case $.CAP_END:U[_e]=U[_e-1],U[_e+1]=Qe(U[_e-1]);break;case $.CAP_ALL:U[0]=Qe(U[2]),U[1]=U[2],U[_e]=U[_e-1],U[_e+1]=Qe(U[_e-1]);break}return U},I=i!==null?new D(i,i,i):null;let P;if(y){const re=y._creationDataStorage;return R?re.path3D.update(t,R):re.path3D.update(t),P=M(e,t,re.path3D,re.pathArray,I,s,n,o,re.cap,_,C),y=qa("",{pathArray:P,closeArray:!1,closePath:!1,offset:0,updatable:!1,sideOrientation:0,instance:y},m||void 0),y}const L=R?new Nc(t,R):new Nc(t),V=new Array;f=f<0||f>3?0:f,P=M(e,t,L,V,I,s,n,o,f,_,C);const X=qa(a,{pathArray:P,closeArray:c,closePath:h,updatable:g,sideOrientation:x,invertUV:b,frontUVs:v||void 0,backUVs:E||void 0},m);return X._creationDataStorage.pathArray=P,X._creationDataStorage.path3D=L,X._creationDataStorage.cap=f,X}let aT=!1;function rI(){aT||(aT=!0,$.ExtrudeShape=(a,e,t,i,s,n,o=null,c,h,f)=>{const _={shape:e,path:t,scale:i,rotation:s,cap:n===0?0:n||$.NO_CAP,sideOrientation:h,instance:f,updatable:c};return I1(a,_,o)},$.ExtrudeShapeCustom=(a,e,t,i,s,n,o,c,h,f,_,m)=>{const g={shape:e,path:t,scaleFunction:i,rotationFunction:s,ribbonCloseArray:n,ribbonClosePath:o,cap:c===0?0:c||$.NO_CAP,sideOrientation:_,instance:m,updatable:f};return P1(a,g,h)})}function w1(a,e,t=null){const i=e.arc?e.arc<=0||e.arc>1?1:e.arc:1,s=e.closed===void 0?!0:e.closed,n=e.shape,o=e.radius||1,c=e.tessellation||64,h=e.clip||0,f=e.updatable,_=$._GetDefaultSideOrientation(e.sideOrientation),m=e.cap||$.NO_CAP,g=Math.PI*2,x=[],y=e.invertUV||!1;let b,v;const E=g/c*i;let R,C;for(b=0;b<=c-h;b++){for(C=[],(m==$.CAP_START||m==$.CAP_ALL)&&(C.push(new D(0,n[0].y,0)),C.push(new D(Math.cos(b*E)*n[0].x*o,n[0].y,Math.sin(b*E)*n[0].x*o))),v=0;v<n.length;v++)R=new D(Math.cos(b*E)*n[v].x*o,n[v].y,Math.sin(b*E)*n[v].x*o),C.push(R);(m==$.CAP_END||m==$.CAP_ALL)&&(C.push(new D(Math.cos(b*E)*n[n.length-1].x*o,n[n.length-1].y,Math.sin(b*E)*n[n.length-1].x*o)),C.push(new D(0,n[n.length-1].y,0))),x.push(C)}return qa(a,{pathArray:x,closeArray:s,sideOrientation:_,updatable:f,invertUV:y,frontUVs:e.frontUVs,backUVs:e.backUVs},t)}let oT=!1;function nI(){oT||(oT=!0,$.CreateLathe=(a,e,t,i,s,n,o)=>w1(a,{shape:e,radius:t,tessellation:i,sideOrientation:o,updatable:n},s))}function F1(a){const e=[],t=[],i=[],s=[],n=a.width!==void 0?a.width:a.size!==void 0?a.size:1,o=a.height!==void 0?a.height:a.size!==void 0?a.size:1,c=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,h=n/2,f=o/2;t.push(-h,-f,0),i.push(0,0,-1),s.push(0,0),t.push(h,-f,0),i.push(0,0,-1),s.push(1,0),t.push(h,f,0),i.push(0,0,-1),s.push(1,1),t.push(-h,f,0),i.push(0,0,-1),s.push(0,1),e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),Ue._ComputeSides(c,t,e,i,s,a.frontUVs,a.backUVs);const _=new Ue;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function B1(a,e={},t=null){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,F1(e).applyToMesh(i,e.updatable),e.sourcePlane&&(i.translate(e.sourcePlane.normal,-e.sourcePlane.d),i.setDirection(e.sourcePlane.normal.scale(-1))),i}let lT=!1;function aI(){lT||(lT=!0,Ue.CreatePlane=F1,$.CreatePlane=(a,e,t,i,s)=>B1(a,{size:e,width:e,height:e,sideOrientation:s,updatable:i},t))}function L1(a,e,t=null){const i=e.path;let s=e.instance,n=1;e.radius!==void 0?n=e.radius:s&&(n=s._creationDataStorage.radius);const o=e.tessellation||64,c=e.radiusFunction||null;let h=e.cap||$.NO_CAP;const f=e.invertUV||!1,_=e.updatable,m=$._GetDefaultSideOrientation(e.sideOrientation);
300e.arc=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1;const g=(E,R,C,O,M,I,P,L)=>{const V=R.getTangents(),X=R.getNormals(),re=R.getDistances(),de=Math.PI*2/M*L,te=I||(()=>O);let Y,Z,q,j;const Q=ge.Matrix[0];let w=P===$.NO_CAP||P===$.CAP_END?0:2;for(let z=0;z<E.length;z++){Z=te(z,re[z]),Y=Array(),q=X[z];for(let K=0;K<M;K++)se.RotationAxisToRef(V[z],de*K,Q),j=Y[K]?Y[K]:D.Zero(),D.TransformCoordinatesToRef(q,Q,j),j.scaleInPlace(Z).addInPlace(E[z]),Y[K]=j;C[w]=Y,w++}const B=(z,K)=>{const ue=Array();for(let he=0;he<z;he++)ue.push(E[K]);return ue};switch(P){case $.NO_CAP:break;case $.CAP_START:C[0]=B(M,0),C[1]=C[2].slice(0);break;case $.CAP_END:C[w]=C[w-1].slice(0),C[w+1]=B(M,E.length-1);break;case $.CAP_ALL:C[0]=B(M,0),C[1]=C[2].slice(0),C[w]=C[w-1].slice(0),C[w+1]=B(M,E.length-1);break}return C};let x,y;if(s){const E=s._creationDataStorage,R=e.arc||E.arc;return x=E.path3D.update(i),y=g(i,x,E.pathArray,n,E.tessellation,c,E.cap,R),s=qa("",{pathArray:y,instance:s}),E.path3D=x,E.pathArray=y,E.arc=R,E.radius=n,s}x=new Nc(i);const b=new Array;h=h<0||h>3?0:h,y=g(i,x,b,n,o,c,h,e.arc);const v=qa(a,{pathArray:y,closePath:!0,closeArray:!1,updatable:_,sideOrientation:m,invertUV:f,frontUVs:e.frontUVs,backUVs:e.backUVs},t);return v._creationDataStorage.pathArray=y,v._creationDataStorage.path3D=x,v._creationDataStorage.tessellation=o,v._creationDataStorage.cap=h,v._creationDataStorage.arc=e.arc,v._creationDataStorage.radius=n,v}let cT=!1;function oI(){cT||(cT=!0,$.CreateTube=(a,e,t,i,s,n,o,c,h,f)=>L1(a,{path:e,radius:t,tessellation:i,radiusFunction:s,arc:1,cap:n,updatable:c,sideOrientation:h,instance:f},o))}function k1(a){const e=[];e[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},e[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},e[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},e[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},e[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},e[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},e[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},e[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},e[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},e[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},e[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},e[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},e[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},e[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},e[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.9
30069981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};const t=a.type&&(a.type<0||a.type>=e.length)?0:a.type||0,i=a.size,s=a.sizeX||i||1,n=a.sizeY||i||1,o=a.sizeZ||i||1,c=a.custom||e[t],h=c.face.length,f=a.faceUV||new Array(h),_=a.faceColors,m=a.flat===void 0?!0:a.flat,g=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,x=[],y=[],b=[],v=[],E=[];let R=0,C=0;const O=[];let M,I,P,L,V,X,re,ae;if(m)for(I=0;I<h;I++)_&&_[I]===void 0&&(_[I]=new _t(1,1,1,1)),f&&f[I]===void 0&&(f[I]=new at(0,0,1,1));if(m)for(I=0;I<h;I++){const U=c.face[I].length;for(V=2*Math.PI/U,X=.5*Math.tan(V/2),re=.5,M=0;M<U;M++)x.push(c.vertex[c.face[I][M]][0]*s,c.vertex[c.face[I][M]][1]*n,c.vertex[c.face[I][M]][2]*o),O.push(R),R++,P=f[I].x+(f[I].z-f[I].x)*(.5+X),L=f[I].y+(f[I].w-f[I].y)*(re-.5),v.push(P,L),ae=X*Math.cos(V)-re*Math.sin(V),re=X*Math.sin(V)+re*Math.cos(V),X=ae,_&&E.push(_[I].r,_[I].g,_[I].b,_[I].a);for(M=0;M<U-2;M++)y.push(O[0+C],O[M+2+C],O[M+1+C]);C+=U}else{for(M=0;M<c.vertex.length;M++)x.push(c.vertex[M][0]*s,c.vertex[M][1]*n,c.vertex[M][2]*o),v.push(0,0);for(I=0;I<h;I++)for(M=0;M<c.face[I].length-2;M++)y.push(c.face[I][0],c.face[I][M+2],c.face[I][M+1])}Ue.ComputeNormals(x,y,b),Ue._ComputeSides(g,x,y,b,v,a.frontUVs,a.backUVs);const de=new Ue;return de.positions=x,de.indices=y,de.normals=b,de.uvs=v,_&&m&&(de.colors=E),de}function Lm(a,e={},t=null){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,k1(e).applyToMesh(i,e.updatable),i}let hT=!1;function lI(){hT||(hT=!0,Ue.CreatePolyhedron=k1,$.CreatePolyhedron=(a,e,t)=>Lm(a,e,t))}function N1(a){const e=a.sideOrientation||Ue.DEFAULTSIDE,t=a.radius||1,i=a.flat===void 0?!0:a.flat,s=(a.subdivisions||4)|0,n=a.radiusX||t,o=a.radiusY||t,c=a.radiusZ||t,h=(1+Math.sqrt(5))/2,f=[-1,h,-0,1,h,0,-1,-h,0,1,-h,0,0,-1,-h,0,1,-h,0,-1,h,0,1,h,h,0,1,h,0,-1,-h,0,1,-h,0,-1],_=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],m=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],g=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],x=138/1024,y=239/1024,b=60/1024,v=26/1024,E=-40/1024,R=20/1024,C=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],O=[],M=[],I=[],P=[];let L=0;const V=new Array(3),X=new Array(3);let re;for(re=0;re<3;re++)V[re]=D.Zero(),X[re]=Fe.Zero();for(let de=0;de<20;de++){for(re=0;re<3;re++){const te=_[3*de+re];V[re].copyFromFloats(f[3*m[te]],f[3*m[te]+1],f[3*m[te]+2]),V[re].normalize(),X[re].copyFromFloats(g[2*te]*x+b+C[de]*E,g[2*te+1]*y+v+C[de]*R)}const U=(te,Y,Z,q)=>{const j=D.Lerp(V[0],V[2],Y/s),Q=D.Lerp(V[1],V[2],Y/s),w=s===Y?V[2]:D.Lerp(j,Q,te/(s-Y));w.normalize();let B;if(i){const he=D.Lerp(V[0],V[2],q/s),ve=D.Lerp(V[1],V[2],q/s);B=D.Lerp(he,ve,Z/(s-q))}else B=new D(w.x,w.y,w.z);B.x/=n,B.y/=o,B.z/=c,B.normalize();const z=Fe.Lerp(X[0],X[2],Y/s),K=Fe.Lerp(X[1],X[2],Y/s),ue=s===Y?X[2]:Fe.Lerp(z,K,te/(s-Y));M.push(w.x*n,w.y*o,w.z*c),I.push(B.x,B.y,B.z),P.push(ue.x,ue.y),O.push(L),L++};for(let te=0;te<s;te++)for(let Y=0;Y+te<s;Y++)U(Y,te,Y+1/3,te+1/3),U(Y+1,te,Y+1/3,te+1/3),U(Y,te+1,Y+1/3,te+1/3),Y+te+1<s&&(U(Y+1,te,Y+2/3,te+2/3),U(Y+1,te+1,Y+2/3,te+2/3),U(Y,te+1,Y+2/3,te+2/3))}Ue._ComputeSides(e,M,O,I,P,a.frontUVs,a.backUVs);const ae=new Ue;return ae.indices=O,ae.positions=M,ae.normals=I,ae.uvs=P,ae}function U1(a,e={},t=null){const i=new $(a,t);return e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,N1(e).applyToMesh(i,e.updatable),i}let uT=!1;function cI(){uT||(uT=!0,Ue.CreateIcoSphere=N1,$.CreateIcoSphere=(a,e,t)=>U1(a,e,t))}const hI=new D(1,0,0),uI=new D(-1,0,0),fI=new D(0,1,0),dI=new D(0,-1,0),_I=new D(0,0,1),mI=new D(0,0,-1);class Af{constructor(e=D.Zero(),t=D.Up(),i=Fe.Zero(),s=0,n=0,o=null,c=null,h=null,f=null){this.position=e,this.normal=t,this.uv=i,this.vertexIdx=s,this.vertexIdxForBones=n,this.localPositionOverride=o,this.localNormalOverride=c,this.matrixIndicesOverride=h,this.matrixWeightsOverride=f}clone(){return new Af(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,this.localPositionOverride?.slice(),this.localNormalOverride?.slice(),this.matrixIndicesOverride?.slice(),this.matrixWeightsOverride?.slice())}}function z1(a,e,t){const i=!!e.skeleton,s=!!e.morphTargetManager?.numTargets,n=t.localMode||i,o=e.getIndices(),c=i||s?e.getPositionData(!0,!0):e.getVerticesData(k.PositionKind),h=i||s?e.getNormalsData(!0,!0):e.getVerticesData(k.NormalKind),f=n?i?e.getVerticesData(k.PositionKind):c:null,_=n?i?e.getVerticesData(k.NormalKind):h:null,m=e.getVerticesData(k.UVKind),g=i?e.getVerticesData(k.MatricesIndicesKind):null,x=i?e.getVerticesData(k.MatricesWeightsKind):null,y=i?e.getVerticesData(k.MatricesIndicesExtraKind):null,b=i?e.getVerticesData(k.MatricesWeightsExtraKind):null,v=t.position||D.Zero();let E=t.normal||D.Up();const R=t.size||D.One(),C=t.angle||0;if(!E){const Z=new D(0,0,1),q=e.getScene().activeCamera,j=D.TransformCoordinates(Z,q.getWorldMatrix());E=q.globalPosition.subtract(j)}const O=-Math.atan2(E.z,E.x)-Math.PI/2,M=Math.sqrt(E.x*E.x+E.z*E.z),I=Math.atan2(E.y,M),P=new Ue;P.indices=[],P.positions=[],P.normals=[],P.uvs=[],P.matricesIndices=i?[]:null,P.matricesWeights=i?[]:null,P.matricesIndicesExtra=y?[]:null,P.matricesWeightsExtra=b?[]:null;let L=0;const V=(Z,q)=>{const j=new Af;if(!o||!c||!h)return j;const Q=o[Z];if(j.vertexIdx=Q*3,j.vertexIdxForBones=Q*4,j.position=new D(c[Q*3],c[Q*3+1],c[Q*3+2]),D.TransformCoordinatesToRef(j.position,q,j.position),j.normal=new D(h[Q*3],h[Q*3+1],h[Q*3+2]),D.TransformNormalToRef(j.normal,q,j.normal),t.captureUVS&&m){const w=m[Q*2+1];j.uv=new Fe(m[Q*2],w)}return j},X=[0,0,0,0],re=(Z,q)=>{if(Z.length===0)return Z;const j=.5*Math.abs(D.Dot(R,q)),Q=(z,K,ue,he)=>{for(let ve=0;ve<he;++ve)if(z[ue+ve]===K)return ue+ve;return-1},w=(z,K)=>{const ue=D.GetClipFactor(z.position,K.position,q,j);let he=X,ve=X;if(g&&x){const we=z.matrixIndicesOverride?0:z.vertexIdxForBones,ti=z.matrixIndicesOverride??g,ci=z.matrixWeightsOverride??x,hi=K.matrixIndicesOverride?0:K.vertexIdxForBones,ii=K.matrixIndicesOverride??g,ui=K.matrixWeightsOverride??x;he=[0,0,0,0],ve=[0,0,0,0];let Gt=0;for(let qt=0;qt<4;++qt)if(ci[we+qt]>0){const Wt=Q(ii,ti[we+qt],hi,4);he[Gt]=ti[we+qt],ve[Gt]=im(ci[we+qt],Wt>=0?ui[Wt]:0,ue),Gt++}for(let qt=0;qt<4&&Gt<4;++qt){const Wt=ii[hi+qt];Q(ti,Wt,we,4)===-1&&(he[Gt]=Wt,ve[Gt]=im(0,ui[hi+qt],ue),Gt++)}const fi=ve[0]+ve[1]+ve[2]+ve[3];ve[0]/=fi,ve[1]/=fi,ve[2]/=fi,ve[3]/=fi}const Le=z.localPositionOverride?z.localPositionOverride[0]:f?.[z.vertexIdx]??
3000,ke=z.localPositionOverride?z.localPositionOverride[1]:f?.[z.vertexIdx+1]??0,J=z.localPositionOverride?z.localPositionOverride[2]:f?.[z.vertexIdx+2]??0,_e=K.localPositionOverride?K.localPositionOverride[0]:f?.[K.vertexIdx]??0,xe=K.localPositionOverride?K.localPositionOverride[1]:f?.[K.vertexIdx+1]??0,Ne=K.localPositionOverride?K.localPositionOverride[2]:f?.[K.vertexIdx+2]??0,Qe=z.localNormalOverride?z.localNormalOverride[0]:_?.[z.vertexIdx]??0,He=z.localNormalOverride?z.localNormalOverride[1]:_?.[z.vertexIdx+1]??0,dt=z.localNormalOverride?z.localNormalOverride[2]:_?.[z.vertexIdx+2]??0,li=K.localNormalOverride?K.localNormalOverride[0]:_?.[K.vertexIdx]??0,zt=K.localNormalOverride?K.localNormalOverride[1]:_?.[K.vertexIdx+1]??0,Ot=K.localNormalOverride?K.localNormalOverride[2]:_?.[K.vertexIdx+2]??0,jt=Qe+(li-Qe)*ue,Nt=He+(zt-He)*ue,ut=dt+(Ot-dt)*ue,ne=Math.sqrt(jt*jt+Nt*Nt+ut*ut);return new Af(D.Lerp(z.position,K.position,ue),D.Lerp(z.normal,K.normal,ue).normalize(),Fe.Lerp(z.uv,K.uv,ue),-1,-1,f?[Le+(_e-Le)*ue,ke+(xe-ke)*ue,J+(Ne-J)*ue]:null,_?[jt/ne,Nt/ne,ut/ne]:null,he,ve)};let B=null;Z.length>3&&(B=[]);for(let z=0;z<Z.length;z+=3){let K=null,ue=null,he=null,ve=null;const Le=D.Dot(Z[z].position,q)-j,ke=D.Dot(Z[z+1].position,q)-j,J=D.Dot(Z[z+2].position,q)-j,_e=Le>0,xe=ke>0,Ne=J>0;switch((_e?1:0)+(xe?1:0)+(Ne?1:0)){case 0:Z.length>3?(B.push(Z[z]),B.push(Z[z+1]),B.push(Z[z+2])):B=Z;break;case 1:if(B=B??new Array,_e&&(K=Z[z+1],ue=Z[z+2],he=w(Z[z],K),ve=w(Z[z],ue)),xe){K=Z[z],ue=Z[z+2],he=w(Z[z+1],K),ve=w(Z[z+1],ue),B.push(he),B.push(ue.clone()),B.push(K.clone()),B.push(ue.clone()),B.push(he.clone()),B.push(ve);break}Ne&&(K=Z[z],ue=Z[z+1],he=w(Z[z+2],K),ve=w(Z[z+2],ue)),K&&ue&&he&&ve&&(B.push(K.clone()),B.push(ue.clone()),B.push(he),B.push(ve),B.push(he.clone()),B.push(ue.clone()));break;case 2:B=B??new Array,_e||(K=Z[z].clone(),ue=w(K,Z[z+1]),he=w(K,Z[z+2]),B.push(K),B.push(ue),B.push(he)),xe||(K=Z[z+1].clone(),ue=w(K,Z[z+2]),he=w(K,Z[z]),B.push(K),B.push(ue),B.push(he)),Ne||(K=Z[z+2].clone(),ue=w(K,Z[z]),he=w(K,Z[z+1]),B.push(K),B.push(ue),B.push(he));break}}return B},ae=e instanceof $?e:null,de=ae?._thinInstanceDataStorage.matrixData,U=ae?.thinInstanceCount||1,te=ge.Matrix[0];te.copyFrom(se.IdentityReadOnly);for(let Z=0;Z<U;++Z){if(ae?.hasThinInstances&&de){const z=Z*16;te.setRowFromFloats(0,de[z+0],de[z+1],de[z+2],de[z+3]),te.setRowFromFloats(1,de[z+4],de[z+5],de[z+6],de[z+7]),te.setRowFromFloats(2,de[z+8],de[z+9],de[z+10],de[z+11]),te.setRowFromFloats(3,de[z+12],de[z+13],de[z+14],de[z+15])}const q=se.RotationYawPitchRoll(O,I,C).multiply(se.Translation(v.x,v.y,v.z)),j=se.Invert(q),Q=e.getWorldMatrix(),w=te.multiply(Q).multiply(j),B=new Array(3);for(let z=0;z<o.length;z+=3){let K=B;if(K[0]=V(z,w),K[1]=V(z+1,w),K[2]=V(z+2,w),!(t.cullBackFaces&&-K[0].normal.z<=0&&-K[1].normal.z<=0&&-K[2].normal.z<=0)&&(K=re(K,hI),!!K&&(K=re(K,uI),!!K&&(K=re(K,fI),!!K&&(K=re(K,dI),!!K&&(K=re(K,_I),!!K&&(K=re(K,mI),!!K)))))))for(let ue=0;ue<K.length;ue++){const he=K[ue];if(P.indices.push(L),n?(he.localPositionOverride?(P.positions[L*3]=he.localPositionOverride[0],P.positions[L*3+1]=he.localPositionOverride[1],P.positions[L*3+2]=he.localPositionOverride[2]):f&&(P.positions[L*3]=f[he.vertexIdx],P.positions[L*3+1]=f[he.vertexIdx+1],P.positions[L*3+2]=f[he.vertexIdx+2]),he.localNormalOverride?(P.normals[L*3]=he.localNormalOverride[0],P.normals[L*3+1]=he.localNormalOverride[1],P.normals[L*3+2]=he.localNormalOverride[2]):_&&(P.normals[L*3]=_[he.vertexIdx],P.normals[L*3+1]=_[he.vertexIdx+1],P.normals[L*3+2]=_[he.vertexIdx+2])):(he.position.toArray(P.positions,L*3),he.normal.toArray(P.normals,L*3)),P.matricesIndices&&P.matricesWeights&&(he.matrixIndicesOverride?(P.matricesIndices[L*4]=
300he.matrixIndicesOverride[0],P.matricesIndices[L*4+1]=he.matrixIndicesOverride[1],P.matricesIndices[L*4+2]=he.matrixIndicesOverride[2],P.matricesIndices[L*4+3]=he.matrixIndicesOverride[3]):(g&&(P.matricesIndices[L*4]=g[he.vertexIdxForBones],P.matricesIndices[L*4+1]=g[he.vertexIdxForBones+1],P.matricesIndices[L*4+2]=g[he.vertexIdxForBones+2],P.matricesIndices[L*4+3]=g[he.vertexIdxForBones+3]),y&&P.matricesIndicesExtra&&(P.matricesIndicesExtra[L*4]=y[he.vertexIdxForBones],P.matricesIndicesExtra[L*4+1]=y[he.vertexIdxForBones+1],P.matricesIndicesExtra[L*4+2]=y[he.vertexIdxForBones+2],P.matricesIndicesExtra[L*4+3]=y[he.vertexIdxForBones+3])),he.matrixWeightsOverride?(P.matricesWeights[L*4]=he.matrixWeightsOverride[0],P.matricesWeights[L*4+1]=he.matrixWeightsOverride[1],P.matricesWeights[L*4+2]=he.matrixWeightsOverride[2],P.matricesWeights[L*4+3]=he.matrixWeightsOverride[3]):(x&&(P.matricesWeights[L*4]=x[he.vertexIdxForBones],P.matricesWeights[L*4+1]=x[he.vertexIdxForBones+1],P.matricesWeights[L*4+2]=x[he.vertexIdxForBones+2],P.matricesWeights[L*4+3]=x[he.vertexIdxForBones+3]),b&&P.matricesWeightsExtra&&(P.matricesWeightsExtra[L*4]=b[he.vertexIdxForBones],P.matricesWeightsExtra[L*4+1]=b[he.vertexIdxForBones+1],P.matricesWeightsExtra[L*4+2]=b[he.vertexIdxForBones+2],P.matricesWeightsExtra[L*4+3]=b[he.vertexIdxForBones+3]))),t.captureUVS)he.uv.toArray(P.uvs,L*2);else{P.uvs.push(.5+he.position.x/R.x);const ve=.5+he.position.y/R.y;P.uvs.push(ve)}L++}}}P.indices.length===0&&(P.indices=null),P.positions.length===0&&(P.positions=null),P.normals.length===0&&(P.normals=null),P.uvs.length===0&&(P.uvs=null),P.matricesIndices?.length===0&&(P.matricesIndices=null),P.matricesWeights?.length===0&&(P.matricesWeights=null),P.matricesIndicesExtra?.length===0&&(P.matricesIndicesExtra=null),P.matricesWeightsExtra?.length===0&&(P.matricesWeightsExtra=null);const Y=new $(a,e.getScene());return P.applyToMesh(Y),n?(Y.skeleton=e.skeleton,Y.parent=e):(Y.position=v.clone(),Y.rotation=new D(I,O,C)),Y.computeWorldMatrix(!0),Y.refreshBoundingInfo(!0,!0),Y}let fT=!1;function gI(){fT||(fT=!0,$.CreateDecal=(a,e,t,i,s,n)=>z1(a,e,{position:t,normal:i,size:s,angle:n}))}function G1(a={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){const e=Math.max(a.subdivisions?a.subdivisions:2,1)|0,t=Math.max(a.tessellation?a.tessellation:16,3)|0,i=Math.max(a.height?a.height:1,0),s=Math.max(a.radius?a.radius:.25,0),n=Math.max(a.capSubdivisions?a.capSubdivisions:6,1)|0,o=t,c=e,h=Math.max(a.radiusTop?a.radiusTop:s,0),f=Math.max(a.radiusBottom?a.radiusBottom:s,0),_=i-(h+f),m=0,g=2*Math.PI,x=Math.max(a.topCapSubdivisions?a.topCapSubdivisions:n,1),y=Math.max(a.bottomCapSubdivisions?a.bottomCapSubdivisions:n,1),b=Math.acos((f-h)/i);let v=[];const E=[],R=[],C=[];let O=0;const M=[],I=_*.5,P=Math.PI*.5;let L,V;const X=D.Zero(),re=D.Zero(),ae=Math.cos(b),de=Math.sin(b),U=new Fe(h*de,I+h*ae).subtract(new Fe(f*de,-I+f*ae)).length(),te=h*b+U+f*(P-b);let Y=0;for(V=0;V<=x;V++){const Q=[],w=P-b*(V/x);Y+=h*b/x;const B=Math.cos(w),z=Math.sin(w),K=B*h;for(L=0;L<=o;L++){const ue=L/o,he=ue*g+m,ve=Math.sin(he),Le=Math.cos(he);re.x=K*ve,re.y=I+z*h,re.z=K*Le,E.push(re.x,re.y,re.z),X.set(B*ve,z,B*Le),R.push(X.x,X.y,X.z),C.push(ue,1-Y/te),Q.push(O),O++}M.push(Q)}const Z=i-h-f+ae*h-ae*f,q=de*(f-h)/Z;for(V=1;V<=c;V++){const Q=[];Y+=U/c;const w=de*(V*(f-h)/c+h);for(L=0;L<=o;L++){const B=L/o,z=B*g+m,K=Math.sin(z),ue=Math.cos(z);re.x=w*K,re.y=I+ae*h-V*Z/c,re.z=w*ue,E.push(re.x,re.y,re.z),X.set(K,q,ue).normalize(),R.push(X.x,X.y,X.z),C.push(B,1-Y/te),Q.push(O),O++}M.push(Q)}for(V=1;V<=y;V++){const Q=[],w=P-b-(Math.PI-b)*(V/y);Y+=f*b/y;const B=Math.cos(w),z=Math.sin(w),K=B*f;for(L=0;L<=o;L++){const ue=L/o,he=ue*g+m,ve=Math.sin(he),Le=Math.cos(he);re.x=K*ve,re.y=-I+z*f,re.z=K*Le,E.push(re.x,re.y,re.z),X.set(B*ve,z,B*Le),R.push(X.x,X.y,X.z),C.push(ue,1-Y/te),Q.push(O),O++}M.push(Q)}for(L=0;L<o;L++)for(V=0;V<x+c+y;V++){const Q=M[V][L],w=M[V+1][L],B=M[V+1][L+1],z=M[V][L+1];v.push(Q),v.push(w),v.push(z),v.push(w),v.push(B),v.push(z)}if(v=v.reverse(),a.orientation&&!a.orientation.equals(D.Up())){const Q=new se;a.orientation.clone().scale(Math.PI*.5).cross(D.Up()).toQuaternion().toRotationMatrix(Q);const w=D.Zero();for(let B=0;B<E.length;B+=3)w.set(E[B],E[B+1],E[B+2]),D.TransformCoordinatesToRef(w.clone(),Q,w),E[B]=w.x,E[B+1]=w.y,E[B+2]=w.z}const j=new Ue;return j.positions=E,j.normals=R,j.uvs=C,j.indices=v,j}function V1(a,e={orientation:D.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6,updatable:!1},t=null){const i=new $(a,t);return G1(e).applyToMesh(i,e.updatable),i}let dT=!1;function pI(){dT||(dT=!0,$.CreateCapsule=(a,e,t)=>V1(a,e,t),Ue.CreateCapsule=G1)}class ei{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&(e=Math.floor(e),pe.Warn("x is not an integer, floor(x) used")),t!==Math.floor(t)&&(t=Math.floor(t),pe.Warn("y is not an integer, floor(y) used"))}clone(){return new ei(this.x,this.y)}rotate60About(e){const t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){const t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),pe.Warn("m not an integer only floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),pe.Warn("n not an integer only floor(n) used"));const i=this.x;return this.x=e-i-this.y,this.y=t+i,this}rotateNeg120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),pe.Warn("m is not an integer, floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),pe.Warn("n is not an integer,   floor(n) used"));const i=this.x;return this.x=this.y-t,this.y=e+t-i-this.y,this}toCartesianOrigin(e,t){const i=D.Zero();return i.x=e.x+2*this.x*t+this.y*t,i.y=e.y+Math.sqrt(3)*this.y*t,i}static Zero(){return new ei(0,0)}}class H1{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new hm("icosahedron","Regular",[[0,Ai,-1],[-Ai,1,0],[-1,0,-Ai],[1,0,-Ai],[Ai,1,0],[0,Ai,1],[-1,0,Ai],[-Ai,-1,0],[0,-Ai,-1],[Ai,-1,0],[1,0,Ai],[0,-Ai,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,
3006]])}setIndices(){let e=12;const t={},i=this.m,s=this.n;let n=i;s!==0&&(n=sm(i,s));const o=i/n,c=s/n;let h,f,_,m,g;const x=ei.Zero(),y=new ei(i,s),b=new ei(-s,i+s),v=ei.Zero(),E=ei.Zero(),R=ei.Zero();let C=[],O,M,I,P;const L=[],V=this.vertByDist,X=(re,ae,de,U)=>{O=re+"|"+de,M=ae+"|"+U,O in t||M in t?O in t&&!(M in t)?t[M]=t[O]:M in t&&!(O in t)&&(t[O]=t[M]):(t[O]=e,t[M]=e,e++),V[de][0]>2?L[t[O]]=[-V[de][0],V[de][1],t[O]]:L[t[O]]=[C[V[de][0]],V[de][1],t[O]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let re=0;re<20;re++){if(C=this.IDATA.face[re],_=C[2],m=C[1],g=C[0],I=x.x+"|"+x.y,O=re+"|"+I,O in t||(t[O]=_,L[_]=[C[V[I][0]],V[I][1]]),I=y.x+"|"+y.y,O=re+"|"+I,O in t||(t[O]=m,L[m]=[C[V[I][0]],V[I][1]]),I=b.x+"|"+b.y,O=re+"|"+I,O in t||(t[O]=g,L[g]=[C[V[I][0]],V[I][1]]),h=this.IDATA.edgematch[re][0],f=this.IDATA.edgematch[re][1],f==="B")for(let ae=1;ae<n;ae++)E.x=i-ae*(o+c),E.y=s+ae*o,R.x=-ae*c,R.y=ae*(o+c),I=E.x+"|"+E.y,P=R.x+"|"+R.y,X(re,h,I,P);if(f==="O")for(let ae=1;ae<n;ae++)R.x=-ae*c,R.y=ae*(o+c),v.x=ae*o,v.y=ae*c,I=R.x+"|"+R.y,P=v.x+"|"+v.y,X(re,h,I,P);if(h=this.IDATA.edgematch[re][2],f=this.IDATA.edgematch[re][3],f&&f==="A")for(let ae=1;ae<n;ae++)v.x=ae*o,v.y=ae*c,E.x=i-(n-ae)*(o+c),E.y=s+(n-ae)*o,I=v.x+"|"+v.y,P=E.x+"|"+E.y,X(re,h,I,P);for(let ae=0;ae<this.vertices.length;ae++)I=this.vertices[ae].x+"|"+this.vertices[ae].y,O=re+"|"+I,O in t||(t[O]=e++,V[I][0]>2?L[t[O]]=[-V[I][0],V[I][1],t[O]]:L[t[O]]=[C[V[I][0]],V[I][1],t[O]])}this.closestTo=L,this.vecToidx=t}calcCoeffs(){const e=this.m,t=this.n,i=Math.sqrt(3)/3,s=e*e+t*t+e*t;this.coau=(e+t)/s,this.cobu=-t/s,this.coav=-i*(e-t)/s,this.cobv=i*(2*e+t)/s}createInnerFacets(){const e=this.m,t=this.n;for(let i=0;i<t+e+1;i++)for(let s=this.min[i];s<this.max[i]+1;s++)s<this.max[i]&&s<this.max[i+1]+1&&this.innerFacets.push(["|"+s+"|"+i,"|"+s+"|"+(i+1),"|"+(s+1)+"|"+i]),i>0&&s<this.max[i-1]&&s+1<this.max[i]+1&&this.innerFacets.push(["|"+s+"|"+i,"|"+(s+1)+"|"+i,"|"+(s+1)+"|"+(i-1)])}edgeVecsABOB(){const e=this.m,t=this.n,i=new ei(-t,e+t);for(let s=1;s<e+t;s++){const n=new ei(this.min[s],s),o=new ei(this.min[s-1],s-1),c=new ei(this.min[s+1],s+1),h=n.clone(),f=o.clone(),_=c.clone();h.rotate60About(i),f.rotate60About(i),_.rotate60About(i);const m=new ei(this.max[h.y],h.y),g=new ei(this.max[h.y-1],h.y-1),x=new ei(this.max[h.y-1]-1,h.y-1);(h.x!==m.x||h.y!==m.y)&&(h.x!==g.x?(this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([n,g,x]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([n,x,m])):h.y===_.y?(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([n,o,g]),this.vertexTypes.push([1,0,1]),this.isoVecsABOB.push([n,g,c])):(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([n,o,g]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([n,g,m])))}}mapABOBtoOBOA(){const e=new ei(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){const i=[];for(let s=0;s<3;s++)e.x=this.isoVecsABOB[t][s].x,e.y=this.isoVecsABOB[t][s].y,this.vertexTypes[t][s]===0&&e.rotateNeg120(this.m,this.n),i.push(e.clone());this.isoVecsOBOA.push(i)}}mapABOBtoBAOA(){const e=new ei(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){const i=[];for(let s=0;s<3;s++)e.x=this.isoVecsABOB[t][s].x,e.y=this.isoVecsABOB[t][s].y,this.vertexTypes[t][s]===1&&e.rotate120(this.m,this.n),i.push(e.clone());this.isoVecsBAOA.push(i)}}MapToFace(e,t){const i=this.IDATA.face[e],s=i[2],n=i[1],o=i[0],c=D.FromArray(this.IDATA.vertex[s]),h=D.FromArray(this.IDATA.vertex[n]),f=D.FromArray(this.IDATA.vertex[o]),_=h.subtract(c),m=f.subtract(c),g=_.scale(this.coau).add(m.scale(this.cobu)),x=_.scale(this.coav).add(m.scale(this.cobv));let y,b;for(let v=0;v<this.cartesian.length;v++)b=g.scale(this.cartesian[v].x).add(x.scale(this.cartesian[v].y)).add(c),b.x,b.y,b.z,y=e+"|"+this.vertices[v].x+"|"+this.vertices[v].y,t.vertex[this.vecToidx[y]]=[b.x,b.y,b.z]}build(e,t){const i=[],s=ei.Zero(),n=new ei(e,t),o=new ei(-t,e+t);i.push(s,n,o);for(let M=t;M<e+1;M++)for(let I=0;I<e+1-M;I++)i.push(new ei(I,M));if(t>0){const M=sm(e,t),I=e/M,P=t/M;for(let V=1;V<M;V++)i.push(new ei(V*I,V*P)),i.push(new ei(-V*P,V*(I+P))),i.push(new ei(e-V*(I+P),t+V*I));const L=e/t;for(let V=1;V<t;V++)for(let X=0;X<V*L;X++)i.push(new ei(X,V)),i.push(new ei(X,V).rotate120(e,t)),i.push(new ei(X,V).rotateNeg120(e,t))}i.sort((M,I)=>M.x-I.x),i.sort((M,I)=>M.y-I.y);const c=new Array(e+t+1),h=new Array(e+t+1);for(let M=0;M<c.length;M++)c[M]=1/0,h[M]=-1/0;let f,_;const m=i.length;for(let M=0;M<m;M++)_=i[M].x,f=i[M].y,c[f]=Math.min(_,c[f]),h[f]=Math.max(_,h[f]);const g=(M,I)=>{const P=M.clone();return I==="A"&&P.rotateNeg120(e,t),I==="B"&&P.rotate120(e,t),P.x<0?P.y:P.x+P.y},x=[],y=[],b=[],v=[],E={},R=[];let C=-1,O=-1;for(let M=0;M<m;M++)x[M]=i[M].toCartesianOrigin(new ei(0,0),.5),y[M]=g(i[M],"O"),b[M]=g(i[M],"A"),v[M]=g(i[M],"B"),y[M]===b[M]&&b[M]===v[M]?(C=3,O=y[M]):y[M]===b[M]?(C=4,O=y[M]):b[M]===v[M]?(C=5,O=b[M]):v[M]===y[M]&&(C=6,O=y[M]),y[M]<b[M]&&y[M]<v[M]&&(C=2,O=y[M]),b[M]<y[M]&&b[M]<v[M]&&(C=1,O=b[M]),v[M]<b[M]&&v[M]<y[M]&&(C=0,O=v[M]),R.push([C,O,i[M].x,i[M].y]);R.sort((M,I)=>M[2]-I[2]),R.sort((M,I)=>M[3]-I[3]),R.sort((M,I)=>M[1]-I[1]),R.sort((M,I)=>M[0]-I[0]);for(let M=0;M<R.length;M++)E[R[M][2]+"|"+R[M][3]]=[R[M][0],R[M][1],M];return this.m=e,this.n=t,this.vertices=i,this.vertByDist=E,this.cartesian=x,this.min=c,this.max=h,this}}class hm{constructor(e,t,i,s){this.name=e,this.category=t,this.vertex=i,this.face=s}}class Ff extends hm{innerToData(e,t){for(let i=0;i<t.innerFacets.length;i++)this.face.push(t.innerFacets[i].map(s=>t.vecToidx[e+s]))}mapABOBtoDATA(e,t){const i=t.IDATA.edgematch[e][0];for(let s=0;s<t.isoVecsABOB.length;s++){const n=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===0?n.push(e+"|"+t.isoVecsABOB[s][o].x+"|"+t.isoVecsABOB[s][o].y):n.push(i+"|"+t.isoVecsABOB[s][o].x+"|"+t.isoVecsABOB[s][o].y);this.face.push([t.vecToidx[n[0]],t.vecToidx[n[1]],t.vecToidx[n[2]]])}}mapOBOAtoDATA(e,t){const i=t.IDATA.edgematch[e][0];for(let s=0;s<t.isoVecsOBOA.length;s++){const n=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===1?n.push(e+"|"+t.isoVecsOBOA[s][o].x+"|"+t.isoVecsOBOA[s][o].y):n.push(i+"|"+t.isoVecsOBOA[s][o].x+"|"+t.isoVecsOBOA[s][o].y);this.face.push([t.vecToidx[n[0]],t.vecToidx[n[1]],t.vecToidx[n[2]]])}}mapBAOAtoDATA(e,t){const i=t.IDATA.edgematch[e][2];for(let s=0;s<t.isoVecsBAOA.length;s++){const n=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===1?n.push(e+"|"+t.isoVecsBAOA[s][o].x+"|"+t.isoVecsBAOA[s][o].y):n.push(i+"|"+t.isoVecsBAOA[s][o].x+"|"+t.isoVecsBAOA[s][o].y);this.face.push([t.vecToidx[n[0]],t.vecToidx[n[1]],t.vecToidx[n[2]]])}}orderData(e){const t=[];for(let o=0;o<13;o++)t[o]=[];const i=e.closestTo;for(let o=0;o<i.length;o++)i[o][0]>-1?i[o][1]>0&&t[i[o][0]].push([o,i[o][1]]):t[12].push([o,i[o][0]]);const s=[];for(let o=0;o<12;o++)s[o]=o;let n=12;for(let o=0;o<12;o++){t[o].sort((c,h)=>c[1]-h[1]);for(let c=0;c<t[o].length;c++)s[t[o][c][0]]=n++}for(let o=0;o<t[12].length;o++)s[t[12][o][0]]=n++;for(let o=0;o<this.vertex.length;o++)this.vertex[o].push(s[o]);this.vertex.sort((o,c)=>o[3]-c[3]);for(let o=0;o<this.vertex.length;o++)this.vertex[o].pop();for(let o=0;o<this.face.length;o++)for(let c=0;c<this.face[o].length;c++)this.face[o][c]=s[this.face[o][c]];this.sharedNodes=t[12].length,this.poleNodes=this.vertex.length-this.sharedNodes}setOrder(e,t){const i=[],s=[];let n=t.pop();s.push(n);let o=this.face[n].indexOf(e);o=(o+2)%3;let c=this.face[n][o];i.push(c);let h=0;for(;t.length>0;)n=t[h],this.face[n].indexOf(c)>-1?(o=(this.face[n].indexOf(c)+1)%3,c=this.face[n][o],i.push(c),s.push(n),t.splice(h,1),h=0):h++;return this.adjacentFaces.push(i),s}toGoldbergPolyhedronData(){const e=new hm("GeoDual","Goldberg",[],[]);e.name="GD dual";const t=this.vertex.length,i=new Array(t);for(let f=0;f<t;f++)i[f]=[];for(let f=0;f<this.face.length;f++)for(let _=0;_<3;_++)i[this.face[f][_]].push(f);let s,n,o,c,h;this.adjacentFaces=[];for(let f=0;f<i.length;f++){e.face[f]=this.setOrder(f,i[f].concat([]));for(const _ of i[f]){s=0,n=0,o=0,c=this.face[_];for(let m=0;m<3;m++)h=this.vertex[c[m]],s+=h[0],n+=h[1],o+=h[2];e.vertex[_]=[s/3,n/3,o/3]}}return e}static BuildGeodesicData(e){const t=new Ff("Geodesic-m-n","Geodesic",[[0,Ai,-1],[-Ai,1,0],[-1,0,-Ai],[1,0,-Ai],[Ai,1,0],[0,Ai,1],[-1,0,Ai],[-Ai,-1,0],[0,-Ai,-1],[Ai,-1,0],[1,0,Ai],[0,-Ai,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let s=0;s<e.IDATA.face.length;s++)e.MapToFace(s,t),t.innerToData(s,e),e.IDATA.edgematch[s][1]==="B"&&t.mapABOBtoDATA(s,e),e.IDATA.edgematch[s][1]==="O"&&t.mapOBOAtoDATA(s,e),e.IDATA.edgematch[s][3]==="A"&&t.mapBAOAtoDATA(s,e);t.orderData(e);const i=1;return t.vertex=t.vertex.map(function(s){const n=s[0],o=s[1],c=s[2],h=Math.sqrt(n*n+o*o+c*c);return s[0]*=i/h,s[1]*=i/h,s[2]*=i/h,s}),t}}function xI(a,e,t=null){let i=e.m||1;i!==Math.floor(i)&&(i=Math.floor(i),pe.Warn("m not an integer only floor(m) used"));let s=e.n||0;if(s!==Math.floor(s)&&(s=Math.floor(s),pe.Warn("n not an integer only floor(n) used")),s>i){const f=s;s=i,i=f,pe.Warn("n > m therefore m and n swapped")}const n=new H1;n.build(i,s);
300const c={custom:Ff.BuildGeodesicData(n),size:e.size,sizeX:e.sizeX,sizeY:e.sizeY,sizeZ:e.sizeZ,faceUV:e.faceUV,faceColors:e.faceColors,flat:e.flat,updatable:e.updatable,sideOrientation:e.sideOrientation,frontUVs:e.frontUVs,backUVs:e.backUVs};return Lm(a,c,t)}class km extends ${constructor(){super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){return t===void 0?(e>this.goldbergData.nbUnsharedFaces-1&&(pe.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(pe.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(pe.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){for(let i=0;i<e.length;i++){const s=e[i][0],n=e[i][1],o=e[i][2];for(let c=s;c<n+1;c++)this.goldbergData.faceColors[c]=o}const t=[];for(let i=0;i<12;i++)for(let s=0;s<5;s++)t.push(this.goldbergData.faceColors[i].r,this.goldbergData.faceColors[i].g,this.goldbergData.faceColors[i].b,this.goldbergData.faceColors[i].a);for(let i=12;i<this.goldbergData.faceColors.length;i++)for(let s=0;s<6;s++)t.push(this.goldbergData.faceColors[i].r,this.goldbergData.faceColors[i].g,this.goldbergData.faceColors[i].b,this.goldbergData.faceColors[i].a);return t}setGoldbergFaceColors(e){const t=this._changeGoldbergFaceColors(e);this.setVerticesData(k.ColorKind,t)}updateGoldbergFaceColors(e){const t=this._changeGoldbergFaceColors(e);this.updateVerticesData(k.ColorKind,t)}_changeGoldbergFaceUVs(e){const t=this.getVerticesData(k.UVKind);for(let i=0;i<e.length;i++){const s=e[i][0],n=e[i][1],o=e[i][2],c=e[i][3],h=e[i][4],f=[],_=[];let m,g;for(let x=0;x<5;x++)m=o.x+c*Math.cos(h+x*Math.PI/2.5),g=o.y+c*Math.sin(h+x*Math.PI/2.5),m<0&&(m=0),m>1&&(m=1),f.push(m,g);for(let x=0;x<6;x++)m=o.x+c*Math.cos(h+x*Math.PI/3),g=o.y+c*Math.sin(h+x*Math.PI/3),m<0&&(m=0),m>1&&(m=1),_.push(m,g);for(let x=s;x<Math.min(12,n+1);x++)for(let y=0;y<5;y++)t[10*x+2*y]=f[2*y],t[10*x+2*y+1]=f[2*y+1];for(let x=Math.max(12,s);x<n+1;x++)for(let y=0;y<6;y++)t[12*x-24+2*y]=_[2*y],t[12*x-23+2*y]=_[2*y+1]}return t}setGoldbergFaceUVs(e){const t=this._changeGoldbergFaceUVs(e);this.setVerticesData(k.UVKind,t)}updateGoldbergFaceUVs(e){const t=this._changeGoldbergFaceUVs(e);this.updateVerticesData(k.UVKind,t)}placeOnGoldbergFaceAt(e,t,i){const s=D.RotationFromAxis(this.goldbergData.faceXaxis[t],this.goldbergData.faceYaxis[t],this.goldbergData.faceZaxis[t]);e.rotation=s,e.position=this.goldbergData.faceCenters[t].add(this.goldbergData.faceXaxis[t].scale(i.x)).add(this.goldbergData.faceYaxis[t].scale(i.y)).add(this.goldbergData.faceZaxis[t].scale(i.z))}serialize(e){super.serialize(e),e.type="GoldbergMesh";const t={};if(t.adjacentFaces=this.goldbergData.adjacentFaces,t.nbSharedFaces=this.goldbergData.nbSharedFaces,t.nbUnsharedFaces=this.goldbergData.nbUnsharedFaces,t.nbFaces=this.goldbergData.nbFaces,t.nbFacesAtPole=this.goldbergData.nbFacesAtPole,this.goldbergData.faceColors){t.faceColors=[];for(const i of this.goldbergData.faceColors)t.faceColors.push(i.asArray())}if(this.goldbergData.faceCenters){t.faceCenters=[];for(const i of this.goldbergData.faceCenters)t.faceCenters.push(i.asArray())}if(this.goldbergData.faceZaxis){t.faceZaxis=[];for(const i of this.goldbergData.faceZaxis)t.faceZaxis.push(i.asArray())}if(this.goldbergData.faceYaxis){t.faceYaxis=[];for(const i of this.goldbergData.faceYaxis)t.faceYaxis.push(i.asArray())}if(this.goldbergData.faceXaxis){t.faceXaxis=[];for(const i of this.goldbergData.faceXaxis)t.faceXaxis.push(i.asArray())}e.goldbergData=t}static Parse(e,t){const i=e.goldbergData;i.faceColors=i.faceColors.map(n=>_t.FromArray(n)),i.faceCenters=i.faceCenters.map(n=>D.FromArray(n)),i.faceZaxis=i.faceZaxis.map(n=>D.FromArray(n)),i.faceXaxis=i.faceXaxis.map(n=>D.FromArray(n)),i.faceYaxis=i.faceYaxis.map(n=>D.FromArray(n));const s=new km(e.name,t);return s.goldbergData=i,s}}function bI(a,e){const t=a.size,i=a.sizeX||t||1,s=a.sizeY||t||1,n=a.sizeZ||t||1,o=a.sideOrientation===0?0:a.sideOrientation||Ue.DEFAULTSIDE,c=[],h=[],f=[],_=[];let m=1/0,g=-1/0,x=1/0,y=-1/0;for(let E=0;E<e.vertex.length;E++)m=Math.min(m,e.vertex[E][0]*i),g=Math.max(g,e.vertex[E][0]*i),x=Math.min(x,e.vertex[E][1]*s),y=Math.max(y,e.vertex[E][1]*s);let b=0;for(let E=0;E<e.face.length;E++){const R=e.face[E],C=D.FromArray(e.vertex[R[0]]),O=D.FromArray(e.vertex[R[2]]),M=D.FromArray(e.vertex[R[1]]),I=O.subtract(C),P=M.subtract(C),L=D.Cross(P,I).normalize();for(let V=0;V<R.length;V++){f.push(L.x,L.y,L.z);const X=e.vertex[R[V]];
300c.push(X[0]*i,X[1]*s,X[2]*n);const re=(X[1]*s-x)/(y-x);_.push((X[0]*i-m)/(g-m),re)}for(let V=0;V<R.length-2;V++)h.push(b,b+V+2,b+V+1);b+=R.length}Ue._ComputeSides(o,c,h,f,_);const v=new Ue;return v.positions=c,v.indices=h,v.normals=f,v.uvs=_,v}function yI(a,e,t=null){const i=e.size,s=e.sizeX||i||1,n=e.sizeY||i||1,o=e.sizeZ||i||1;let c=e.m||1;c!==Math.floor(c)&&(c=Math.floor(c),pe.Warn("m not an integer only floor(m) used"));let h=e.n||0;if(h!==Math.floor(h)&&(h=Math.floor(h),pe.Warn("n not an integer only floor(n) used")),h>c){const y=h;h=c,c=y,pe.Warn("n > m therefore m and n swapped")}const f=new H1;f.build(c,h);const _=Ff.BuildGeodesicData(f),m=_.toGoldbergPolyhedronData(),g=new km(a,t);e.sideOrientation=$._GetDefaultSideOrientation(e.sideOrientation),g._originalBuilderSideOrientation=e.sideOrientation,bI(e,m).applyToMesh(g,e.updatable),g.goldbergData.nbSharedFaces=_.sharedNodes,g.goldbergData.nbUnsharedFaces=_.poleNodes,g.goldbergData.adjacentFaces=_.adjacentFaces,g.goldbergData.nbFaces=g.goldbergData.nbSharedFaces+g.goldbergData.nbUnsharedFaces,g.goldbergData.nbFacesAtPole=(g.goldbergData.nbUnsharedFaces-12)/12;for(let y=0;y<_.vertex.length;y++)g.goldbergData.faceCenters.push(D.FromArray(_.vertex[y])),g.goldbergData.faceCenters[y].x*=s,g.goldbergData.faceCenters[y].y*=n,g.goldbergData.faceCenters[y].z*=o,g.goldbergData.faceColors.push(new _t(1,1,1,1));for(let y=0;y<m.face.length;y++){const b=m.face[y],v=D.FromArray(m.vertex[b[0]]),E=D.FromArray(m.vertex[b[2]]),R=D.FromArray(m.vertex[b[1]]),C=E.subtract(v),O=R.subtract(v),M=D.Cross(O,C).normalize(),I=D.Cross(O,M).normalize();g.goldbergData.faceXaxis.push(O.normalize()),g.goldbergData.faceYaxis.push(M),g.goldbergData.faceZaxis.push(I)}return g}class TI{constructor(e){this._paths=[],this._tempPaths=[],this._holes=[],this._resolution=e}moveTo(e,t){this._currentPath=new Df(e,t),this._tempPaths.push(this._currentPath)}lineTo(e,t){this._currentPath.addLineTo(e,t)}quadraticCurveTo(e,t,i,s){this._currentPath.addQuadraticCurveTo(e,t,i,s,this._resolution)}bezierCurveTo(e,t,i,s,n,o){this._currentPath.addBezierCurveTo(e,t,i,s,n,o,this._resolution)}extractHoles(){for(const e of this._tempPaths)e.area()>0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){const e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){return this._paths}get holes(){return this._holes}}function vI(a,e,t,i,s,n){const o=n.glyphs[a]||n.glyphs["?"];if(!o)return null;const c=new TI(s);if(o.o){const h=o.o.split(" ");for(let f=0,_=h.length;f<_;)switch(h[f++]){case"m":{const g=parseInt(h[f++])*e+t,x=parseInt(h[f++])*e+i;c.moveTo(g,x);break}case"l":{const g=parseInt(h[f++])*e+t,x=parseInt(h[f++])*e+i;c.lineTo(g,x);break}case"q":{const g=parseInt(h[f++])*e+t,x=parseInt(h[f++])*e+i,y=parseInt(h[f++])*e+t,b=parseInt(h[f++])*e+i;c.quadraticCurveTo(y,b,g,x);break}case"b":{const g=parseInt(h[f++])*e+t,x=parseInt(h[f++])*e+i,y=parseInt(h[f++])*e+t,b=parseInt(h[f++])*e+i,v=parseInt(h[f++])*e+t,E=parseInt(h[f++])*e+i;c.bezierCurveTo(y,b,v,E,g,x);break}}}return c.extractHoles(),{offsetX:o.ha*e,shapePath:c}}function EI(a,e,t,i){const s=Array.from(a),n=e/i.resolution,o=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*n,c=[];let h=0,f=0;for(let _=0;_<s.length;_++){const m=s[_];if(m===`
301`)h=0,f-=o;else{const g=vI(m,n,h,f,t,i);g&&(h+=g.offsetX,c.push(g.shapePath))}}return c}function AI(a,e,t,i={size:50,resolution:8,depth:1},s=null,n=earcut){const o=EI(e,i.size||50,i.resolution||8,t),c=[];let h=0;for(const _ of o){if(!_.paths.length)continue;const m=_.holes.slice();for(const g of _.paths){const x=[],y=[],b=g.getPoints();for(const R of b)y.push(new D(R.x,0,R.y));const v=m.slice();for(const R of v){const C=R.getPoints();let O=!1;for(const I of C)if(g.isPointInside(I)){O=!0;break}if(!O)continue;const M=[];for(const I of C)M.push(new D(I.x,0,I.y));x.push(M),m.splice(m.indexOf(R),1)}if(!x.length&&m.length)for(const R of m){const C=R.getPoints(),O=[];for(const M of C)O.push(new D(M.x,0,M.y));x.push(O)}const E=Bm(a,{shape:y,holes:x.length?x:void 0,depth:i.depth||1,faceUV:i.faceUV||i.perLetterFaceUV?.(h),faceColors:i.faceColors||i.perLetterFaceColors?.(h),sideOrientation:$._GetDefaultSideOrientation(i.sideOrientation||$.DOUBLESIDE)},s,n);c.push(E),h++}}const f=$.MergeMeshes(c,!0,!0);if(f){const _=f.getBoundingInfo().boundingBox;f.position.x+=-(_.minimumWorld.x+_.maximumWorld.x)/2,f.position.y+=-(_.minimumWorld.y+_.maximumWorld.y)/2,f.position.z+=-(_.minimumWorld.z+_.maximumWorld.z)/2+_.extendSize.z,f.name=a;const m=new rs("pivot",s);m.rotation.x=-Math.PI/2,f.parent=m,f.bakeCurrentTransformIntoVertices(),f.parent=null,m.dispose()}return f}const Qu={CreateBox:i1,CreateTiledBox:SD,CreateSphere:a1,CreateDisc:qv,CreateIcoSphere:U1,CreateRibbon:qa,CreateCylinder:_1,CreateTorus:g1,CreateTorusKnot:x1,CreateLineSystem:S1,CreateLines:M1,CreateDashedLines:C1,ExtrudeShape:I1,ExtrudeShapeCustom:P1,CreateLathe:w1,CreateTiledPlane:RD,CreatePlane:B1,CreateGround:$v,CreateTiledGround:Jv,CreateGroundFromHeightMap:e1,CreatePolygon:Fm,ExtrudePolygon:Bm,CreateTube:L1,CreatePolyhedron:Lm,CreateGeodesic:xI,CreateGoldberg:yI,CreateDecal:z1,CreateCapsule:V1,CreateText:AI};TD();vD();AD();MD();CD();ZD();QD();$D();eI();sI();rI();nI();aI();s1();ED();oI();lI();cI();gI();pI();class _T{constructor(){this.previousWorldMatrices={},this.previousBones={}}static AddUniforms(e){e.push("previousWorld","previousViewProjection","mPreviousBones")}static AddSamplers(e){}bindForSubMesh(e,t,i,s,n){if(t.prePassRenderer&&t.prePassRenderer.enabled&&t.prePassRenderer.currentRTisSceneRT&&(t.prePassRenderer.getIndex(2)!==-1||t.prePassRenderer.getIndex(11)!==-1)){this.previousWorldMatrices[i.uniqueId]||(this.previousWorldMatrices[i.uniqueId]=s.clone()),this.previousViewProjection||(this.previousViewProjection=t.getTransformMatrix().clone(),this.currentViewProjection=t.getTransformMatrix().clone());const o=t.getEngine();this.currentViewProjection.updateFlag!==t.getTransformMatrix().updateFlag?(this._lastUpdateFrameId=o.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection),this.currentViewProjection.copyFrom(t.getTransformMatrix())):this._lastUpdateFrameId!==o.frameId&&(this._lastUpdateFrameId=o.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection)),e.setMatr
vendor: 5,360 bytes, lines 301-303
301ix("previousWorld",this.previousWorldMatrices[i.uniqueId]),e.setMatrix("previousViewProjection",this.previousViewProjection),this.previousWorldMatrices[i.uniqueId]=s.clone()}}}class j1{constructor(e){if(this.VERTEXOUTPUT_INVARIANT=!1,this._keys=[],this._isDirty=!0,this._areLightsDirty=!0,this._areLightsDisposed=!1,this._areAttributesDirty=!0,this._areTexturesDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._normals=!1,this._uvs=!1,this._needNormals=!1,this._needUVs=!1,this._externalProperties=e,e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this._setDefaultValue(t)}get isDirty(){return this._isDirty}markAsProcessed(){this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirty=!1,this._areLightsDisposed=!1,this._areMiscDirty=!1,this._arePrePassDirty=!1,this._areImageProcessingDirty=!1}markAsUnprocessed(){this._isDirty=!0}markAllAsDirty(){this._areTexturesDirty=!0,this._areAttributesDirty=!0,this._areLightsDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._isDirty=!0}markAsImageProcessingDirty(){this._areImageProcessingDirty=!0,this._isDirty=!0}markAsLightDirty(e=!1){this._areLightsDirty=!0,this._areLightsDisposed=this._areLightsDisposed||e,this._isDirty=!0}markAsAttributesDirty(){this._areAttributesDirty=!0,this._isDirty=!0}markAsTexturesDirty(){this._areTexturesDirty=!0,this._isDirty=!0}markAsFresnelDirty(){this._areFresnelDirty=!0,this._isDirty=!0}markAsMiscDirty(){this._areMiscDirty=!0,this._isDirty=!0}markAsPrePassDirty(){this._arePrePassDirty=!0,this._isDirty=!0}rebuild(){this._keys.length=0;for(const e of Object.keys(this))e[0]!=="_"&&this._keys.push(e);if(this._externalProperties)for(const e in this._externalProperties)this._keys.indexOf(e)===-1&&this._keys.push(e)}isEqual(e){if(this._keys.length!==e._keys.length)return!1;for(let t=0;t<this._keys.length;t++){const i=this._keys[t];if(this[i]!==e[i])return!1}return!0}cloneTo(e){this._keys.length!==e._keys.length&&(e._keys=this._keys.slice(0));for(let t=0;t<this._keys.length;t++){const i=this._keys[t];e[i]=this[i]}}reset(){for(const e of this._keys)this._setDefaultValue(e)}_setDefaultValue(e){const t=this._externalProperties?.[e]?.type??typeof this[e],i=this._externalProperties?.[e]?.default;switch(t){case"number":this[e]=i??0;break;case"string":this[e]=i??"";break;default:this[e]=i??!1;break}}toString(){let e="";for(let t=0;t<this._keys.length;t++){const i=this._keys[t],s=this[i];switch(typeof s){case"number":case"string":e+="#define "+i+" "+s+`
302`;break;default:s&&(e+="#define "+i+`
303`);break}}return e}}function RI(a){return class extends a{constructor(){super(...arguments),this.IMAGEPROCESSING=!1,this.WHITEBALANCE=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=0,this.CONTRAST=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.EXPOSURE=!1}}}const SI=new RegExp("^([gimus]+)!");class ha{constructor(e){this._plugins=[],this._activePlugins=[],this._activePluginsForExtraEvents=[],this._material=e,this._scene=e.getScene(),this._engine=this._scene.getEngine()}_addPlugin(e){for(let s=0;s<this._plugins.length;++s)if(this._plugins[s].name===e.name)return!1;if(this._material._uniformBufferLayoutBuilt&&(this._material.resetDrawCache(),this._material._createUniformBuffer()),!e.isCompatible(this._material.shaderLanguage))throw`The plugin "${e.name}" can't be added to the material "${this._material.name}" because the plugin is not compatible with the shader language of the material.`;const t=e.getClassName();ha._MaterialPluginClassToMainDefine[t]||(ha._MaterialPluginClassToMainDefine[t]="MATERIALPLUGIN_"+ ++ha._MaterialPluginCounter),this._material._callbackPluginEventGeneric=(s,n)=>this._handlePluginEvent(s,n),this._plugins.push(e),this._plugins.sort((s,n)=>s.priority-n.priority),this._codeInjectionPoints={};const i={};i[ha._MaterialPluginClassToMainDefine[t]]={type:"boolean",default:!0};for(const s of this._plugins)s.collectDefines(i),this._collectPointNames("vertex",s.getCustomCode("vertex",this._material.shaderLanguage)),this._collectPointNames("fragment",s.getCustomCode("fragment",this._material.shaderLanguage));return this._defineNamesFromPlugins=i,!0}_activatePlugin(e){this._activePlugins.indexOf(e)===-1&&(this._activePlugins.push(e),this._activePlugins.sort((t,i)=>t.priority-i.priority),this._material._callbackPluginEventIsReadyForSubMesh=this._handlePluginEventIsReadyForSubMesh.bind(this),this._material._callbackPluginEventPrepareDefinesBeforeAttributes=this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this),this._material._callbackPluginEventPrepareDefines=this._handlePluginEventPrepareDefines.bind(this),this._material._callbackPluginEventBindForSubMesh=this._handlePluginEventBindForSubMesh.bind(this),e.registerForExtraEvents&&(this._activePluginsForExtraEvents.push(e),this._activePluginsForExtraEvents.sort((t,i)=>t.priority-i.priority),this._material._callbackPluginEventHasRenderTargetTextures=this._handlePluginEventHasRenderTargetTextures.bind(this),this._material._callbackPluginEventFillRen
vendor: 10,942 bytes, lines 303-311
303derTargetTextures=this._handlePluginEventFillRenderTargetTextures.bind(this),this._material._callbackPluginEventHardBindForSubMesh=this._handlePluginEventHardBindForSubMesh.bind(this)))}getPlugin(e){for(let t=0;t<this._plugins.length;++t)if(this._plugins[t].name===e)return this._plugins[t];return null}_handlePluginEventIsReadyForSubMesh(e){let t=!0;for(const i of this._activePlugins)t=t&&i.isReadyForSubMesh(e.defines,this._scene,this._engine,e.subMesh);e.isReadyForSubMesh=t}_handlePluginEventPrepareDefinesBeforeAttributes(e){for(const t of this._activePlugins)t.prepareDefinesBeforeAttributes(e.defines,this._scene,e.mesh)}_handlePluginEventPrepareDefines(e){for(const t of this._activePlugins)t.prepareDefines(e.defines,this._scene,e.mesh)}_handlePluginEventHardBindForSubMesh(e){for(const t of this._activePluginsForExtraEvents)t.hardBindForSubMesh(this._material._uniformBuffer,this._scene,this._engine,e.subMesh)}_handlePluginEventBindForSubMesh(e){for(const t of this._activePlugins)t.bindForSubMesh(this._material._uniformBuffer,this._scene,this._engine,e.subMesh)}_handlePluginEventHasRenderTargetTextures(e){let t=!1;for(const i of this._activePluginsForExtraEvents)if(t=i.hasRenderTargetTextures(),t)break;e.hasRenderTargetTextures=t}_handlePluginEventFillRenderTargetTextures(e){for(const t of this._activePluginsForExtraEvents)t.fillRenderTargetTextures(e.renderTargets)}_handlePluginEvent(e,t){switch(e){case 512:{const i=t;for(const s of this._activePlugins)s.getActiveTextures(i.activeTextures);break}case 256:{const i=t;for(const s of this._activePlugins)s.getAnimatables(i.animatables);break}case 1024:{const i=t;let s=!1;for(const n of this._activePlugins)if(s=n.hasTexture(i.texture),s)break;i.hasTexture=s;break}case 2:{const i=t;for(const s of this._plugins)s.dispose(i.forceDisposeTextures);break}case 4:{const i=t;i.defineNames=this._defineNamesFromPlugins;break}case 128:{const i=t;for(const s of this._activePlugins)i.fallbackRank=s.addFallbacks(i.defines,i.fallbacks,i.fallbackRank),s.getAttributes(i.attributes,this._scene,i.mesh);this._uniformList.length>0&&i.uniforms.push(...this._uniformList),this._samplerList.length>0&&i.samplers.push(...this._samplerList),this._uboList.length>0&&i.uniformBuffersNames.push(...this._uboList),i.customCode=this._injectCustomCode(i,i.customCode);break}case 8:{const i=t;this._uboDeclaration="",this._vertexDeclaration="",this._fragmentDeclaration="",this._uniformList=[],this._samplerList=[],this._uboList=[];const s=this._material.shaderLanguage===1;for(const n of this._plugins){const o=n.getUniforms(this._material.shaderLanguage);if(o){if(o.ubo)for(const c of o.ubo){if(c.size&&c.type){const h=c.arraySize??0;if(i.ubo.addUniform(c.name,c.size,h),s){let f;switch(c.type){case"mat4":f="mat4x4f";break;case"float":f="f32";break;default:f=`${c.type}f`;break}h>0?this._uboDeclaration+=`uniform ${c.name}: array<${f}, ${h}>;
304`:this._uboDeclaration+=`uniform ${c.name}: ${f};
305`}else this._uboDeclaration+=`${c.type} ${c.name}${h>0?`[${h}]`:""};
306`}this._uniformList.push(c.name)}o.vertex&&(this._vertexDeclaration+=o.vertex+`
307`),o.fragment&&(this._fragmentDeclaration+=o.fragment+`
308`),o.externalUniforms&&this._uniformList.push(...o.externalUniforms)}n.getSamplers(this._samplerList),n.getUniformBuffersNames(this._uboList)}break}}}_collectPointNames(e,t){if(t)for(const i in t)this._codeInjectionPoints[e]||(this._codeInjectionPoints[e]={}),this._codeInjectionPoints[e][i]=!0}_injectCustomCode(e,t){return(i,s)=>{t&&(s=t(i,s)),this._uboDeclaration&&(s=s.replace("#define ADDITIONAL_UBO_DECLARATION",this._uboDeclaration)),this._vertexDeclaration&&(s=s.replace("#define ADDITIONAL_VERTEX_DECLARATION",this._vertexDeclaration)),this._fragmentDeclaration&&(s=s.replace("#define ADDITIONAL_FRAGMENT_DECLARATION",this._fragmentDeclaration));const n=this._codeInjectionPoints?.[i];if(!n)return s;let o=null;for(let c in n){let h="";for(const f of this._activePlugins){const _=this._material.shaderLanguage;let m=f.getCustomCode(i,_)?.[c];m&&(f.resolveIncludes&&(o===null&&(o={defines:[],indexParameters:e.indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:void 0,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:Ti.GetShadersRepository(_),includesShadersStore:Ti.GetIncludesShadersStore(_),version:void 0,platformName:this._engine.shaderPlatformName,processingContext:void 0,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:void 0}),o.isFragment=i==="fragment",of(m,o,g=>m=g)),h+=m+`
309`)}if(h.length>0)if(c.charAt(0)==="!"){c=c.substring(1);let f="g";if(c.charAt(0)==="!")f="",c=c.substring(1);else{const g=SI.exec(c);g&&g.length>=2&&(f=g[1],c=c.substring(f.length+1))}f.indexOf("g")<0&&(f+="g");const _=new RegExp(c,f);let m=_.exec(s);for(;m!==null;){const{index:g}=m,x=MI(h,m);s=s.substring(0,g)+x+s.substring(g+m[0].length),_.lastIndex=g+x.length,m=_.exec(s)}}else{const f="#define "+c;s=s.replace(f,`
310`+h+`
311`+f)}}return s}}}ha._MaterialPluginClassToMainDefine={};ha._MaterialPluginCounter=0;function MI(a,e){return a.replace(/\$(\d+)/g,(t,i)=>{const s=Number(i);return s<e.length?e[s]:""})}let CI=(()=>{var a;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,m=[],g=[];return a=class{isCompatible(y){switch(y){case 0:return!0;default:return!1}}_enable(y){y&&this._pluginManager._activatePlugin(this)}constructor(y,b,v,E,R=!0,C=!1,O=!1){this.name=N(this,t,void 0),this.priority=(N(this,i),N(this,n,500)),this.resolveIncludes=(N(this,o),N(this,h,!1)),this.registerForExtraEvents=(N(this,f),N(this,m,!1)),this.doNotSerialize=(N(this,g),!1),this._material=y,this.name=b,this.priority=v,this.resolveIncludes=O,y.pluginManager||(y.pluginManager=new ha(y),y.onDisposeObservable.add(()=>{y.pluginManager=void 0})),this._pluginDefineNames=E,this._pluginManager=y.pluginManager,R&&this._pluginManager._addPlugin(this),C&&this._enable(!0),this.markAllDefinesAsDirty=y._dirtyCallbacks[127]}getClassName(){return"MaterialPluginBase"}isReadyForSubMesh(y,b,v,E){return!0}hardBindForSubMesh(y,b,v,E){}bindForSubMesh(y,b,v,E){}dispose(y){}getCustomCode(y,b=0){return null}collectDefines(y){if(this._pluginDefineNames)for(const b of Object.keys(this._pluginDefineNames)){if(b[0]==="_")continue;const v=typeof this._pluginDefineNames[b];y[b]={type:v==="number"?"number":v==="string"?"string":v==="boolean"?"boolean":"object",default:this._pluginDefineNames[b]}}}prepareDefinesBeforeAttributes(y,b,v){}prepareDefines(y,b,v){}hasTexture(y){return!1}hasRenderTargetTextures(){return!1}fillRenderTargetTextures(y){}getActiveTextures(y){}getAnimatables(y){}addFallbacks(y,b,v){return v}getSamplers(y){}getAttributes(y,b,v){}getUniformBuffersNames(y){}getUniforms(y=0){return{}}copyTo(y){xt.Clone(()=>y,this)}serialize(){return xt.Serialize(this)}parse(y,b,v){xt.Parse(()=>this,y,b,v)}},(()=>{const x=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ce()],s=[ce()],c=[ce()],_=[ce()],ee(null,null,e,{kind:"field",name:"name",static:!1,private:!1,access:{has:y=>"name"in y,get:y=>y.name,set:(y,b)=>{y.name=b}},metadata:x},t,i),ee(null,null,s,{kind:"field",name:"priority",static:!1,private:!1,access:{has:y=>"priority"in y,get:y=>y.priority,set:(y,b)=>{y.priority=b}},metadata:x},n,o),ee(null,null,c,{kind:"field",name:"resolveIncludes",static:!1,private:!1,access:{has:y=>"resolveIncludes"in y,get:y=>y.resolveIncludes,set:(y,b)=>{y.resolveIncludes=b}},metadata:x},h,f),ee(null,null,_,{kind:"field",name:"registerForExtraEvents",static:!1,private:!1,access:{has:y=>"registerForExtraEvents"in y,get:y=>y.registerForExtraEvents,set:(y,b)=>{y.registerForExtraEvents=b}},metadata:x},m,g),x&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:x})})(),a})();class DI extends j1{constructor(){super(...arguments),this.DETAIL=!1,this.DETAILDIRECTUV=0,this.DETAIL_NORMALBLENDMETHOD=0}}let II=(()=>{var a,e,t,i;let s=CI,n,o=[],c=[],h,f=[],_=[],m,g=[],x=[],y,b=[],v=[],E,R=[],C=[],O,M=[],I=[];return a=class extends s{get texture(){return Ft(this,e,"f")}set texture(L){Bt(this,e,L,"f")}get normalBlendMethod(){return Ft(this,t,"f")}set normalBlendMethod(L){Bt(this,t,L,"f")}get isEnabled(){return Ft(this,i,"f")}set isEnabled(L){Bt(this,i,L,"f")}_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(L,V=!0){super(L,"DetailMap",140,new DI,V),this._texture=null,e.set(this,N(this,o,void 0)),this.diffuseBlendLevel=(N(this,c),N(this,f,1)),this.roughnessBlendLevel=(N(this,_),N(this,g,1)),this.bumpLevel=(N(this,x),N(this,b,1)),this._normalBlendMethod=(N(this,v),Ei.MATERIAL_NORMALBLENDMETHOD_WHITEOUT),t.set(this,N(this,R,void 0)),this._isEnabled=(N(this,C),!1),i.set(this,N(this,M,!1)),this._internalMarkAllSubMeshesAsTexturesDirty=N(this,I),this._internalMarkAllSubMeshesAsTexturesDirty=L._dirtyCallbacks[1]}isReadyForSubMesh(L,V,X){return this._isEnabled?!(L._areTexturesDirty&&V.texturesEnabled&&X.getCaps().standardDerivatives&&this._texture&&ct.DetailTextureEnabled&&!this._texture.isReady()):!0}prepareDefines(L,V){if(this._isEnabled){L.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod;const X=V.getEngine();L._areTexturesDirty&&(X.getCaps().standardDerivatives&&this._texture&&ct.DetailTextureEnabled&&this._isEnabled?(aa(this._texture,L,"DETAIL"),L.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod):L.DETAIL=!1)}else L.DETAIL=!1}bindForSubMesh(L,V){if(!this._isEnabled)return;const X=this._material.isFrozen;(!L.useUbo||!X||!L.isSync)&&this._texture&&ct.DetailTextureEnabled&&(L.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),oa(this._texture,L,"detail")),V.texturesEnabled&&this._texture&&ct.DetailTextureEnabled&&L.setTexture("detailSampler",this._texture)}hasTexture(L){return this._texture===L}getActiveTextures(L){this._texture&&L.push(this._texture)}getAnimatables(L){this._texture&&this._texture.animations&&this._texture.animations.length>0&&L.push(this._texture)}dispose(L){L&&this._texture?.dispose()}getClassName(){return"DetailMapConfiguration"}getSamplers(L){L.push("detailSampler")}getUniforms(){return{ubo:[{name:"vDetailInfos",size:4,type:"vec4"},{name:"detailMatrix",size:16,type:"mat4"}]}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,(()=>{const P=typeof Symbol=="function"&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;n=[or("detailTexture"),Lt("_markAllSubMeshesAsTexturesDirty")],h=[ce()],m=[ce()],y=[ce()],E=[ce(),Lt("_markAllSubMeshesAsTexturesDirty")],O=[ce(),Lt("_markAllSubMeshesAsTexturesDirty")],ee(a,null,n,{kind:"accessor",name:"texture",static:!1,private:!1,access:{has:L=>"texture"in L,get:L=>L.texture,set:(L,V)=>{L.texture=V}},metadata:P},o,c),ee(a,null,E,{kind:"accessor",name:"normalBlendMethod",static:!1,private:!1,access:{has:L=>"normalBlendMethod"in L,get:L=>
311L.normalBlendMethod,set:(L,V)=>{L.normalBlendMethod=V}},metadata:P},R,C),ee(a,null,O,{kind:"accessor",name:"isEnabled",static:!1,private:!1,access:{has:L=>"isEnabled"in L,get:L=>L.isEnabled,set:(L,V)=>{L.isEnabled=V}},metadata:P},M,I),ee(null,null,h,{kind:"field",name:"diffuseBlendLevel",static:!1,private:!1,access:{has:L=>"diffuseBlendLevel"in L,get:L=>L.diffuseBlendLevel,set:(L,V)=>{L.diffuseBlendLevel=V}},metadata:P},f,_),ee(null,null,m,{kind:"field",name:"roughnessBlendLevel",static:!1,private:!1,access:{has:L=>"roughnessBlendLevel"in L,get:L=>L.roughnessBlendLevel,set:(L,V)=>{L.roughnessBlendLevel=V}},metadata:P},g,x),ee(null,null,y,{kind:"field",name:"bumpLevel",static:!1,private:!1,access:{has:L=>"bumpLevel"in L,get:L=>L.bumpLevel,set:(L,V)=>{L.bumpLevel=V}},metadata:P},b,v),P&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:P})})(),a})();class PI{constructor(e,t){this._webGL={load:e,loaded:!1,loadPromise:null},this._webGPU={load:t,loaded:!1,loadPromise:null}}getLoadCallback(e){const t=e===1?this._webGPU:this._webGL;return t.loaded?void 0:async()=>{await this._loadAsync(t)}}async _loadAsync(e){if(e.loaded)return;let t=e.loadPromise;const i=t===null;i&&(t=Promise.all(e.load()),e.loadPromise=t);let s=!1;try{await t,s=!0}finally{i&&this._completeLoad(e,s)}}_completeLoad(e,t){e.loaded=t,e.loadPromise=null}}var mT;(function(a){a[a.Zero=0]="Zero",a[a.One=1]="One",a[a.MaxViewZ=2]="MaxViewZ",a[a.NoClear=3]="NoClear"})(mT||(mT={}));class Is{static CreateConfiguration(e){return Is._Configurations[e]={defines:{},previousWorldMatrices:{},previousViewProjection:se.Zero(),currentViewProjection:se.Zero(),previousBones:{},lastUpdateFrameId:-1,excludedSkinnedMesh:[],reverseCulling:!1},Is._Configurations[e]}static DeleteConfiguration(e){delete Is._Configurations[e]}static GetConfiguration(e){return Is._Configurations[e]}static AddUniformsAndSamplers(e,t){e.push("previousWorld","previousViewProjection","mPreviousBones")}static MarkAsDirty(e,t){for(const i of t)if(i.subMeshes)for(const s of i.subMeshes)s._removeDrawWrapper(e)}static PrepareDefines(e,t,i){if(!i._arePrePassDirty)return;const s=Is._Configurations[e];if(!s)return;i.PREPASS=!0;let n=0;for(let o=0;o<Is.GeometryTextureDescriptions.length;o++){const c=Is.GeometryTextureDescriptions[o],h=c.define,f=c.defineIndex,_=s.defines[f];_!==void 0?(i[h]=!0,i[f]=_,n++):(i[h]=!1,delete i[f])}i.SCENE_MRT_COUNT=n,i.BONES_VELOCITY_ENABLED=t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&!t.skeleton.isUsingTextureForMatrices&&s.excludedSkinnedMesh.indexOf(t)===-1}static Bind(e,t,i,s,n){const o=Is._Configurations[e];if(!o)return;const c=i.getScene(),h=c.getEngine();if(o.reverseCulling&&h.setStateCullFaceType(c._mirroredCameraPosition?n.cullBackFaces:!n.cullBackFaces),(o.defines.PREPASS_VELOCITY_INDEX!==void 0||o.defines.PREPASS_VELOCITY_LINEAR_INDEX!==void 0)&&(o.previousWorldMatrices[i.uniqueId]||(o.previousWorldMatrices[i.uniqueId]=s.clone()),o.previousViewProjection||(o.previousViewProjection=c.getTransformMatrix().clone(),o.currentViewProjection=c.getTransformMatrix().clone()),o.currentViewProjection.updateFlag!==c.getTransformMatrix().updateFlag?(o.lastUpdateFrameId=h.frameId,o.previousViewProjection.copyFrom(o.currentViewProjection),o.currentViewProjection.copyFrom(c.getTransformMatrix())):o.lastUpdateFrameId!==h.frameId&&(o.lastUpdateFrameId=h.frameId,o.previousViewProjection.copyFrom(o.currentViewProjection)),t.setMatrix("previousWorld",o.previousWorldMatrices[i.uniqueId]),t.setMatrix("previousViewProjection",o.previousViewProjection),o.previousWorldMatrices[i.uniqueId]=s.clone(),i.useBones&&i.computeBonesUsingShaders&&i.skeleton)){const f=i.skeleton;if(!f.isUsingTextureForMatrices||t.getUniformIndex("boneTextureInfo")===-1){const _=f.getTransformMatrices(i);_&&(o.previousBones[i.uniqueId]||(o.previousBones[i.uniqueId]=_.slice()),t.setMatrices("mPreviousBones",o.previousBones[i.uniqueId]),o.previousBones[i.uniqueId].set(_))}}}}Is.GeometryTextureDescriptions=[{type:0,name:"IrradianceLegacy",clearType:0,define:"PREPASS_IRRADIANCE_LEGACY",defineIndex:"PREPASS_IRRADIANCE_LEGACY_INDEX"},{type:1,name:"WorldPosition",clearType:0,define:"PREPASS_POSITION",defineIndex:"PREPASS_POSITION_INDEX"},{type:2,name:"Velocity",clearType:0,define:"PREPASS_VELOCITY",defineIndex:"PREPASS_VELOCITY_INDEX"},{type:3,name:"Reflectivity",clearType:0,define:"PREPASS_REFLECTIVITY",defineIndex:"PREPASS_REFLECTIVITY_INDEX"},{type:5,name:"ViewDepth",clearType:2,define:"PREPASS_DEPTH",defineIndex:"PREPASS_DEPTH_INDEX"},{type:6,name:"ViewNormal",clearType:0,define:"PREPASS_NORMAL",defineIndex:"PREPASS_NORMAL_INDEX"},{type:7,name:"AlbedoSqrt",clearType:0,define:"PREPASS_ALBEDO_SQRT",defineIndex:"PREPASS_ALBEDO_SQRT_INDEX"},{type:8,name:"WorldNormal",clearType:0,define:"PREPASS_WORLD_NORMAL",defineIndex:"PREPASS_WORLD_NORMAL_INDEX"},{type:9,name:"LocalPosition",clearType:0,define:"PREPASS_LOCAL_POSITION",defineIndex:"PREPASS_LOCAL_POSITION_INDEX"},{type:10,name:"ScreenDepth",clearType:1,define:"PREPASS_SCREENSPACE_DEPTH",defineIndex:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:11,name:"LinearVelocity",clearType:0,define:"PREPASS_VELOCITY_LINEAR",defineIndex:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:12,name:"Albedo",clearType:0,define:"PREPASS_ALBEDO",defineIndex:"PREPASS_ALBEDO_INDEX"}
311,{type:13,name:"NormalizedViewDepth",clearType:1,define:"PREPASS_NORMALIZED_VIEW_DEPTH",defineIndex:"PREPASS_NORMALIZED_VIEW_DEPTH_INDEX"},{type:4,name:"Color",clearType:3,define:"PREPASS_COLOR",defineIndex:"PREPASS_COLOR_INDEX"},{type:14,name:"Irradiance",clearType:0,define:"PREPASS_IRRADIANCE",defineIndex:"PREPASS_IRRADIANCE_INDEX"}];Is._Configurations={};function OI(a){return class extends a{constructor(){super(...arguments),this.MAINUV1=!1,this.MAINUV2=!1,this.MAINUV3=!1,this.MAINUV4=!1,this.MAINUV5=!1,this.MAINUV6=!1,this.UV1=!1,this.UV2=!1,this.UV3=!1,this.UV4=!1,this.UV5=!1,this.UV6=!1}}}function wI(a){return class extends a{constructor(){super(...arguments),this.PREPASS=!1,this.PREPASS_COLOR=!1,this.PREPASS_COLOR_INDEX=-1,this.PREPASS_IRRADIANCE_LEGACY=!1,this.PREPASS_IRRADIANCE_LEGACY_INDEX=-1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO=!1,this.PREPASS_ALBEDO_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.PREPASS_NORMALIZED_VIEW_DEPTH=!1,this.PREPASS_NORMALIZED_VIEW_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_NORMAL_WORLDSPACE=!1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_VELOCITY_LINEAR=!1,this.PREPASS_VELOCITY_LINEAR_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0}}}function FI(a){return class extends a{constructor(...e){super(...e);const t=new.target;if(!t[Symbol.metadata]){const s=Object.getPrototypeOf(t)?.[Symbol.metadata];t[Symbol.metadata]=s?Object.create(s):{}}const i=yv(t[Symbol.metadata]);i._imageProcessingConfiguration||(i._imageProcessingConfiguration={type:9,sourceName:void 0})}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsImageProcessingDirty&&this._markAllSubMeshesAsImageProcessingDirty()}_attachImageProcessingConfiguration(e){e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),
311!e&&this.getScene?this._imageProcessingConfiguration=this.getScene().imageProcessingConfiguration:e&&(this._imageProcessingConfiguration=e),this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{this._markAllSubMeshesAsImageProcessingDirty&&this._markAllSubMeshesAsImageProcessingDirty()})))}get cameraColorCurvesEnabled(){return this.imageProcessingConfiguration.colorCurvesEnabled}set cameraColorCurvesEnabled(e){this.imageProcessingConfiguration.colorCurvesEnabled=e}get cameraColorGradingEnabled(){return this.imageProcessingConfiguration.colorGradingEnabled}set cameraColorGradingEnabled(e){this.imageProcessingConfiguration.colorGradingEnabled=e}get cameraToneMappingEnabled(){return this._imageProcessingConfiguration.toneMappingEnabled}set cameraToneMappingEnabled(e){this._imageProcessingConfiguration.toneMappingEnabled=e}get cameraExposure(){return this._imageProcessingConfiguration.exposure}set cameraExposure(e){this._imageProcessingConfiguration.exposure=e}get cameraContrast(){return this._imageProcessingConfiguration.contrast}set cameraContrast(e){this._imageProcessingConfiguration.contrast=e}get cameraColorGradingTexture(){return this._imageProcessingConfiguration.colorGradingTexture}set cameraColorGradingTexture(e){this._imageProcessingConfiguration.colorGradingTexture=e}get cameraColorCurves(){return this._imageProcessingConfiguration.colorCurves}set cameraColorCurves(e){this._imageProcessingConfiguration.colorCurves=e}}}const G_={effect:null,subMesh:null};class BI extends wI(OI(j1)){}class LI extends RI(BI){constructor(e){super(e),this.DIFFUSE=!1,this.DIFFUSEDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.OPACITY=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.REFLECTION=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.SPECULAR=!1,this.SPECULARDIRECTUV=0,this.BUMP=!1,this.BUMPDIRECTUV=0,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.SPECULAROVERALPHA=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHAFROMDIFFUSE=!1,this.POINTSIZE=!1,this.FOG=!1,this.SPECULARTERM=!1,this.DIFFUSEFRESNEL=!1,this.OPACITYFRESNEL=!1,this.REFLECTIONFRESNEL=!1,this.REFRACTIONFRESNEL=!1,this.EMISSIVEFRESNEL=!1,this.FRESNEL=!1,this.NORMAL=!1,this.TANGENT=!1,this.VERTEXCOLOR=!1,this.VERTEXALPHA=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.GLOSSINESS=!1,this.ROUGHNESS=!1,this.EMISSIVEASILLUMINATION=!1,this.LINKEMISSIVEWITHDIFFUSE=!1,this.REFLECTIONFRESNELFROMSPECULAR=!1,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.USELIGHTMAPASSHADOWMAP=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.INVERTCUBICMAP=!1,this.LOGARITHMICDEPTH=!1,this.REFRACTION=!1,this.REFRACTIONMAP_3D=!1,this.REFLECTIONOVERALPHA=!1,this.TWOSIDEDLIGHTING=!1,this.SHADOWFLOAT=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.NONUNIFORMSCALING=!1,this.PREMULTIPLYALPHA=!1,this.ALPHATEST_AFTERALLALPHACOMPUTATIONS=!1,this.ALPHABLEND=!0,this.RGBDLIGHTMAP=!1,this.RGBDREFLECTION=!1,this.RGBDREFRACTION=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.USE_VERTEX_PULLING=!1,this.VERTEX_PULLING_USE_INDEX_BUFFER=!1,this.VERTEX_PULLING_INDEX_BUFFER_32BITS=!1,this.RIGHT_HANDED=!1,this.CLUSTLIGHT_SLICES=0,this.CLUSTLIGHT_BATCH=0,this.IS_REFLECTION_LINEAR=!1,this.IS_REFRACTION_LINEAR=!1,this.DECAL_AFTER_DETAIL=!1,this.TEXTURE_REPETITION_MODE=0,this.rebuild()}}class kI extends FI(y1){}let tl=(()=>{var a,e,t,i,s,n,o,c,h,f,_,m,g,x,y,b,v,E,R,C,O,M,I,P,L,V,X,re,ae,de,U,te,Y;let Z=kI,q,j=[],Q=[],w,B=[],z=[],K,ue=[],he=[],ve,Le=[],ke=[],J,_e=[],xe=[],Ne,Qe=[],He=[],dt,li=[],zt=[],Ot,jt=[],Nt=[],ut,ne=[],we=[],ti,ci=[],hi=[],ii,ui=[],Gt=[],fi,qt=[],Wt=[],si,Si=[],Mi=[],gr,pr=[],xr=[],Os,ws=[],Fs=[],ns,Bs=[],$e=[],G,Re=[],pt=[],We,W=[],Ve=[],Qt,as=[],br=[],os,ms=[],ls=[],Ls,Li=[],Ki=[],Ur,Qa=[],Kc=[],Zc,ol=[],An=[],$a,zr=[],Gr=[],Rn,Vr=[],Oi=[],ll,cl=[],yr=[],Hr,Qc=[],hl=[],ul,$c=[],ma=[],ga,Ys=[],gs=[],fl,Jc=[],Ja=[],dl,pa=[],eh=[],ps,eo=[],_l=[],to,jr=[],ml=[],gl,Wr=[],th=[],pl,xl=[],io=[],ih,sh=[],xa=[],qs,so=[],ro=[],Xr,Yr=[],bl=[],no,yl=[],Sn=[],Ks,ao=[],Mn=[],cr,oo=[],ba=[],Tl,ya=[],Ta=[],vl,Zi=[],Tr=[],va,Cn=[],rh=[],lo,
vendor: 7,889 bytes, line 311
311co=[],Dn=[],Ea,El=[],nh=[],ah,oh=[],ho=[],lh,ch=[],hh=[],uh,fh=[],Al=[],dh,_h=[],mh=[],gh,uo=[],ph=[],xh,bh=[],Rl=[],yh,Th=[],vh=[],Eh,Ah=[],Rh=[],Sh,Mh=[],Ch=[],fo,In=[],Dh=[],Sl,Ml=[],Cl=[],Dl,Il=[],qr=[],Ih,Ph=[],Oh=[],Pl,Ol=[],Pn=[],On,wh=[],Aa=[],wl,Fl=[],_o=[],mo,Bl=[],Ll=[],kl,Fh=[],Bh=[],Lh,kh=[],Nh=[],cs,wn=[],Nl=[],Ul,zl=[],Gl=[],go,Uh=[],Kr=[],po,Fn=[],xo=[],Vl,vr=[],Zr=[],bo,Hl=[],Er=[],jl,Wl=[],Xl=[],zh,Gh=[],Vh=[];return a=class extends Z{get diffuseTexture(){return Ft(this,e,"f")}set diffuseTexture(S){Bt(this,e,S,"f")}get ambientTexture(){return Ft(this,t,"f")}set ambientTexture(S){Bt(this,t,S,"f")}get opacityTexture(){return Ft(this,i,"f")}set opacityTexture(S){Bt(this,i,S,"f")}get reflectionTexture(){return Ft(this,s,"f")}set reflectionTexture(S){Bt(this,s,S,"f")}get emissiveTexture(){return Ft(this,n,"f")}set emissiveTexture(S){Bt(this,n,S,"f")}get specularTexture(){return Ft(this,o,"f")}set specularTexture(S){Bt(this,o,S,"f")}get bumpTexture(){return Ft(this,c,"f")}set bumpTexture(S){Bt(this,c,S,"f")}get lightmapTexture(){return Ft(this,h,"f")}set lightmapTexture(S){Bt(this,h,S,"f")}get refractionTexture(){return Ft(this,f,"f")}set refractionTexture(S){Bt(this,f,S,"f")}get useAlphaFromDiffuseTexture(){return Ft(this,_,"f")}set useAlphaFromDiffuseTexture(S){Bt(this,_,S,"f")}get useEmissiveAsIllumination(){return Ft(this,m,"f")}set useEmissiveAsIllumination(S){Bt(this,m,S,"f")}get linkEmissiveWithDiffuse(){return Ft(this,g,"f")}set linkEmissiveWithDiffuse(S){Bt(this,g,S,"f")}get useSpecularOverAlpha(){return Ft(this,x,"f")}set useSpecularOverAlpha(S){Bt(this,x,S,"f")}get useReflectionOverAlpha(){return Ft(this,y,"f")}set useReflectionOverAlpha(S){Bt(this,y,S,"f")}get disableLighting(){return Ft(this,b,"f")}set disableLighting(S){Bt(this,b,S,"f")}get useObjectSpaceNormalMap(){return Ft(this,v,"f")}set useObjectSpaceNormalMap(S){Bt(this,v,S,"f")}get useParallax(){return Ft(this,E,"f")}set useParallax(S){Bt(this,E,S,"f")}get useParallaxOcclusion(){return Ft(this,R,"f")}set useParallaxOcclusion(S){Bt(this,R,S,"f")}get roughness(){return Ft(this,C,"f")}set roughness(S){Bt(this,C,S,"f")}get useLightmapAsShadowmap(){return Ft(this,O,"f")}set useLightmapAsShadowmap(S){Bt(this,O,S,"f")}get diffuseFresnelParameters(){return Ft(this,M,"f")}set diffuseFresnelParameters(S){Bt(this,M,S,"f")}get opacityFresnelParameters(){return Ft(this,I,"f")}set opacityFresnelParameters(S){Bt(this,I,S,"f")}get reflectionFresnelParameters(){return Ft(this,P,"f")}set reflectionFresnelParameters(S){Bt(this,P,S,"f")}get refractionFresnelParameters(){return Ft(this,L,"f")}set refractionFresnelParameters(S){Bt(this,L,S,"f")}get emissiveFresnelParameters(){return Ft(this,V,"f")}set emissiveFresnelParameters(S){Bt(this,V,S,"f")}get useReflectionFresnelFromSpecular(){return Ft(this,X,"f")}set useReflectionFresnelFromSpecular(S){Bt(this,X,S,"f")}get useGlossinessFromSpecularMapAlpha(){return Ft(this,re,"f")}set useGlossinessFromSpecularMapAlpha(S){Bt(this,re,S,"f")}get maxSimultaneousLights(){return Ft(this,ae,"f")}set maxSimultaneousLights(S){Bt(this,ae,S,"f")}get invertNormalMapX(){return Ft(this,de,"f")}set invertNormalMapX(S){Bt(this,de,S,"f")}get invertNormalMapY(){return Ft(this,U,"f")}set invertNormalMapY(S){Bt(this,U,S,"f")}get twoSidedLighting(){return Ft(this,te,"f")}set twoSidedLighting(S){Bt(this,te,S,"f")}get applyDecalMapAfterDetailMap(){return Ft(this,Y,"f")}set applyDecalMapAfterDetailMap(S){Bt(this,Y,S,"f")}get isPrePassCapable(){return!this.disableDepthWrite}get canRenderToMRT(){return!0}constructor(S,le,Kt=!1){super(S,le,void 0,Kt||a.ForceGLSL),this._diffuseTexture=N(this,j,null),e.set(this,(N(this,Q),N(this,B,void 0))),this._ambientTexture=(N(this,z),N(this,ue,null)),t.set(this,(N(this,he),N(this,Le,void 0))),this._opacityTexture=(N(this,ke),N(this,_e,null)),i.set(this,(N(this,xe),N(this,Qe,void 0))),this._reflectionTexture=(N(this,He),N(this,li,null)),s.set(this,(N(this,zt),N(this,jt,void 0))),this._emissiveTexture=(N(this,Nt),N(this,ne,null)),n.set(this,(N(this,we),N(this,ci,void 0))),this._specularTexture=(N(this,hi),N(this,ui,null)),o.set(this,(N(this,Gt),N(this,qt,void 0))),this._bumpTexture=(N(this,Wt),N(this,Si,null)),c.set(this,(N(this,Mi),N(this,pr,void 0))),this._lightmapTexture=(N(this,xr),N(this,ws,null)),h.set(this,(N(this,Fs),N(this,Bs,void 0))),this._refractionTexture=(N(this,$e),N(this,Re,null)),f.set(this,(N(this,pt),N(this,W,void 0))),this.ambientColor=(N(this,Ve),N(this,as,new rt(0,0,0))),this.diffuseColor=(N(this,br),N(this,ms,new rt(1,1,1))),this.specularColor=(N(this,ls),N(this,Li,new rt(1,1,1))),this.emissiveColor=(N(this,Ki),N(this,Qa,new rt(0,0,0))),this.specularPower=(N(this,Kc),N(this,ol,64)),this._useAlphaFromDiffuseTexture=(N(this,An),N(this,zr,!1)),_.set(this,(N(this,Gr),N(this,Vr,void 0))),this._useEmissiveAsIllumination=(N(this,Oi),N(this,cl,!1)),m.set(this,(N(this,yr),N(this,Qc,void 0))),this._linkEmissiveWithDiffuse=(N(this,hl),N(this,$c,!1)),g.set(this,(N(this,ma),N(this,Ys,void 0))),this._useSpecularOverAlpha=(N(this,gs),N(this,Jc,!1)),x.set(this,(N(this,Ja),N(this,pa,void 0))),this._useReflectionOverAlpha=(N(this,eh),N(this,eo,!1)),y.set(this,(N(this,_l),N(this,jr,void 0))),this._disableLighting=(N(this,ml),N(this,Wr,!1)),b.set(this,(N(this,th),N(this,xl,void 0))),this._useObjectSpaceNormalMap=(N(this,io),N(this,sh,!1)),v.set(this,(N(this,xa),N(this,so,void 0))),this._useParallax=(N(this,ro),N(this,Yr,!1)),E.set(this,(N(this,bl),N(this,yl,void 0))),this._useParallaxOcclusion=(N(this,Sn),N(this,ao,!1)),R.set(this,(N(this,Mn),N(this,oo,void 0))),this.parallaxScaleBias=(N(this,ba),N(this,ya,.05)),this._roughness=(N(this,Ta),N(this,Zi,0)),C.set(this,(N(this,Tr),N(this,Cn,void 0))),this.indexOfRefraction=(N(this,rh),N(this,co,.98)),this.invertRefractionY=(N(this,Dn),N(this,El,!0)),this.alphaCutOff=(N(this,nh),N(this,oh,.4)),this._useLightmapAsShadowmap=(N(this,ho),N(this,ch,!1)),O.set(this,(N(this,hh),N(this,fh,void 0))),this._diffuseFresnelParameters=(N(this,Al),N(this,_h,void 0)),M.set(this,(N(this,mh),N(this,uo,void 0))),this._opacityFresnelParameters=(N(this,ph),N(this,bh,void 0)),I.set(this,(N(this,Rl),N(this,Th,void 0))),this._reflectionFresnelParameters=(N(this,vh),N(this,Ah,void 0)),P.set(this,(N(this,Rh),N(this,Mh,void 0))),this._refractionFresnelParameters=(N(this,Ch),N(this,In,void 0)),L.set(this,(N(this,Dh),N(this,Ml,void 0))),this._emissiveFresnelParameters=(N(this,Cl),N(this,Il,void 0)),V.set(this,(N(this,qr),N(this,Ph,void 0))),this._useReflectionFresnelFromSpecular=(N(this,Oh),N(this,Ol,!1)),X.set(this,(N(this,Pn),N(this,wh,void 0))),this._useGlossinessFromSpecularMapAlpha=(N(this,Aa),N(this,Fl,!1)),re.set(this,(N(this,_o),N(this,Bl,void 0))),this._maxSimultaneousLights=(N(this,Ll),N(this,Fh,4)),ae.set(this,(N(this,Bh),N(this,kh,void 0))),this._invertNormalMapX=(N(this,Nh),N(this,wn,!1)),de.set(this,(N(this,Nl),N(this,zl,void 0))),this._invertNormalMapY=(N(this,Gl),N(this,Uh,!1)),U.set(this,(N(this,Kr),N(this,Fn,void 0))),this._twoSidedLighting=(N(this,xo),N(this,vr,!1)),te.set(this,(N(this,Zr),N(this,Hl,void 0))),this._applyDecalMapAfterDetailMap=(N(this,Er),N(this,Wl,!1)),Y.set(this,(N(this,Xl),N(this,Gh,void 0))),this._vertexPullingMetadata=(N(this,Vh),null),this._renderTargets=new Ts(16),this._globalAmbientColor=new rt(0,0,0),this._cacheHasRenderTargetTextures=!1,this.detailMap=new II(this),this._attachImageProcessingConfiguration(null),this.prePassConfiguration=new _T,this.getRenderTargetTextures=()=>(this._renderTargets.reset(),a.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),a.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._renderTargets.push(this._refractionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRen
vendor: 10,901 bytes, line 311
311derTargetTextures(this._eventInfo),this._renderTargets)}get hasRenderTargetTextures(){return a.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget||a.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}getClassName(){return"StandardMaterial"}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:this._disableAlphaBlending?!1:this.alpha<1||this._opacityTexture!=null||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:this._hasAlphaChannel()&&(this._transparencyMode==null||this._transparencyMode===Ei.MATERIAL_ALPHATEST)}_shouldUseAlphaFromDiffuseTexture(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==Ei.MATERIAL_OPAQUE}_hasAlphaChannel(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha||this._opacityTexture!=null}getAlphaTestTexture(){return this._diffuseTexture}isReadyForSubMesh(S,le,Kt=!1){this._uniformBufferLayoutBuilt||this.buildUniformLayout();const Et=le._drawWrapper;if(Et.effect&&this.isFrozen&&Et._wasPreviouslyReady&&Et._wasPreviouslyUsingInstances===Kt)return!0;le.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),le.materialDefines=new LI(this._eventInfo.defineNames));const At=this.getScene(),me=le.materialDefines;if(this._isReadyForSubMesh(le))return!0;const ks=At.getEngine();if(me._needNormals=JC(At,S,me,!0,this._maxSimultaneousLights,this._disableLighting),!$C(At,S,this._maxSimultaneousLights,this._disableLighting))return!1;cD(At,me);const Zs=this.needAlphaBlendingForMesh(S)&&this.getScene().useOrderIndependentTransparency;if(uD(At,me,this.canRenderToMRT&&!Zs),hD(At,me,Zs),Is.PrepareDefines(ks.currentRenderPassId,S,me),me._areTexturesDirty){this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,me._needUVs=!1;for(let hs=1;hs<=6;++hs)me["MAINUV"+hs]=!1;if(At.texturesEnabled){if(me.DIFFUSEDIRECTUV=0,me.BUMPDIRECTUV=0,me.AMBIENTDIRECTUV=0,me.OPACITYDIRECTUV=0,me.EMISSIVEDIRECTUV=0,me.SPECULARDIRECTUV=0,me.LIGHTMAPDIRECTUV=0,this._diffuseTexture&&a.DiffuseTextureEnabled)if(this._diffuseTexture.isReadyOrNotBlocking())aa(this._diffuseTexture,me,"DIFFUSE");else return!1;else me.DIFFUSE=!1;if(this._ambientTexture&&a.AmbientTextureEnabled)if(this._ambientTexture.isReadyOrNotBlocking())aa(this._ambientTexture,me,"AMBIENT");else return!1;else me.AMBIENT=!1;if(this._opacityTexture&&a.OpacityTextureEnabled)if(this._opacityTexture.isReadyOrNotBlocking())aa(this._opacityTexture,me,"OPACITY"),me.OPACITYRGB=this._opacityTexture.getAlphaFromRGB;else return!1;else me.OPACITY=!1;if(this._reflectionTexture&&a.ReflectionTextureEnabled?(me.ROUGHNESS=this._roughness>0,me.REFLECTIONOVERALPHA=this._useReflectionOverAlpha):(me.ROUGHNESS=!1,me.REFLECTIONOVERALPHA=!1),!eD(At,this._reflectionTexture,me))return!1;if(this._emissiveTexture&&a.EmissiveTextureEnabled)if(this._emissiveTexture.isReadyOrNotBlocking())aa(this._emissiveTexture,me,"EMISSIVE");else return!1;else me.EMISSIVE=!1;if(this._lightmapTexture&&a.LightmapTextureEnabled)if(this._lightmapTexture.isReadyOrNotBlocking())aa(this._lightmapTexture,me,"LIGHTMAP"),me.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,me.RGBDLIGHTMAP=this._lightmapTexture.isRGBD;else return!1;else me.LIGHTMAP=!1;if(this._specularTexture&&a.SpecularTextureEnabled)if(this._specularTexture.isReadyOrNotBlocking())aa(this._specularTexture,me,"SPECULAR"),me.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha;else return!1;else me.SPECULAR=!1;if(At.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&a.BumpTextureEnabled){if(this._bumpTexture.isReady())aa(this._bumpTexture,me,"BUMP"),me.PARALLAX=this._useParallax,me.PARALLAX_RHS=At.useRightHandedSystem,me.PARALLAXOCCLUSION=this._useParallaxOcclusion;else return!1;me.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else me.BUMP=!1,me.PARALLAX=!1,me.PARALLAX_RHS=!1,me.PARALLAXOCCLUSION=!1;if(this._refractionTexture&&a.RefractionTextureEnabled)if(this._refractionTexture.isReadyOrNotBlocking())me._needUVs=!0,me.REFRACTION=!0,me.REFRACTIONMAP_3D=this._refractionTexture.isCube,me.RGBDREFRACTION=this._refractionTexture.isRGBD,me.USE_LOCAL_REFRACTIONMAP_CUBIC=!!this._refractionTexture.boundingBoxSize;else return!1;else me.REFRACTION=!1;me.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else me.DIFFUSE=!1,me.AMBIENT=!1,me.OPACITY=!1,me.REFLECTION=!1,me.EMISSIVE=!1,me.LIGHTMAP=!1,me.BUMP=!1,me.REFRACTION=!1;me.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),me.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,me.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,me.SPECULAROVERALPHA=this._useSpecularOverAlpha,me.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,me.ALPHATEST_AFTERALLALPHACOMPUTATIONS=this.transparencyMode!==null,me.ALPHABLEND=this.transparencyMode===null||this.needAlphaBlendingForMesh(S),me.TEXTURE_REPETITION_MODE=ks.version>1||ks.isWebGPU?this.textureRepetitionMode:0}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=me,this._eventInfo.subMesh=le,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(me._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(me),me.IS_REFLECTION_LINEAR=this.reflectionTexture!=null&&!this.reflectionTexture.gammaSpace,me.IS_REFRACTION_LINEAR=this.refractionTexture!=null&&!this.refractionTexture.gammaSpace}if(me._areFresnelDirty&&(a.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(me.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,me.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,me.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,me.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,me.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,me.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,me._needNormals=!0,me.FRESNEL=!0):me.FRESNEL=!1),me.AREALIGHTUSED||me.CLUSTLIGHT_BATCH){for(let hs=0;hs<S.lightSources.length;hs++)if(!S.lightSources[hs]._isReady())return!1}QC(S,At,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(S),me,this._applyDecalMapAfterDetailMap,this._useVertexPulling,le.getRenderingMesh(),this._isVertexOutputInvariant),iD(At,ks,this,me,Kt,null,le.getRenderingMesh().hasThinInstances),this._eventInfo.defines=me,this._eventInfo.mesh=S,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),lD(S,me,!0,!0,!0),this._callbackPluginEventPrepareDefines(this._eventInfo);let hr=!1;if(me.isDirty){const hs=me._areLightsDisposed;me.markAsProcessed();const Ze=new b1;me.REFLECTION&&Ze.addFallback(0,"REFLECTION"),me.SPECULAR&&Ze.addFallback(0,"SPECULAR"),me.BUMP&&Ze.addFallback(0,"BUMP"),me.PARALLAX&&Ze.addFallback(1,"PARALLAX"),me.PARALLAX_RHS&&Ze.addFallback(1,"PARALLAX_RHS"),me.PARALLAXOCCLUSION&&Ze.addFallback(0,"PARALLAXOCCLUSION"),me.SPECULAROVERALPHA&&Ze.addFallback(0,"SPECULAROVERALPHA"),me.FOG&&Ze.addFallback(1,"FOG"),me.POINTSIZE&&Ze.addFallback(0,"POINTSIZE"),me.LOGARITHMICDEPTH&&Ze.addFallback(0,"LOGARITHMICDEPTH"),KC(me,Ze,this._maxSimultaneousLights),me.SPECULARTERM&&Ze.addFallback(0,"SPECULARTERM"),me.DIFFUSEFRESNEL&&Ze.addFallback(1,"DIFFUSEFRESNEL"),me.OPACITYFRESNEL&&Ze.addFallback(2,"OPACITYFRESNEL"),me.REFLECTIONFRESNEL&&Ze.addFallback(3,"REFLECTIONFRESNEL"),me.EMISSIVEFRESNEL&&Ze.addFallback(4,"EMISSIVEFRESNEL"),me.FRESNEL&&Ze.addFallback(4,"FRESNEL"),me.MULTIVIEW&&Ze.addFallback(0,"MULTIVIEW");const ki=[k.PositionKind];me.NORMAL&&ki.push(k.NormalKind),me.TANGENT&&ki.push(k.TangentKind);for(let Ar=1;Ar<=6;++Ar)me["UV"+Ar]&&ki.push(`uv${Ar===1?"":Ar}`);me.VERTEXCOLOR&&ki.push(k.ColorKind),YC(ki,S,me,Ze),qC(ki,me),Uv(ki,S,me),VC(ki,S,me);let ur="default";const Qi=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","diffuseMatrix","ambientMatrix","opacityMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vRefractionPosition","vRefractionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureInfo","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo","vTextureRepetitionHexTilingParams"],Qr=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"];_D(Qi,Qr);const Yi=["Material","Scene","Mesh"],yo={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:me.NUM_MORPH_INFLUENCERS};if(this._eventInfo.fallbacks=Ze,this._eventInfo.fallbackRank=0,this._eventInfo.defines=me,this._eventInfo.uniforms=Qi,this._eventInfo.attributes=ki,this._eventInfo.samplers=Qr,this._eventInfo.uniformBuffersNames=Yi,this._eventInfo.customCode=void 0,this._eventInfo.mesh=S,this._eventInfo.indexParameters=yo,this._callbackPluginEventGeneric(128,this._eventInfo),Is.AddUniformsAndSamplers(Qi,Qr),_T.AddUniforms(Qi),da&&(da.PrepareUniforms(Qi,me),da.PrepareSamplers(Qr,me)),mD({uniformsNames:Qi,uniformBuffersNames:Yi,samplers:Qr,defines:me,maxSimultaneousLights:this._maxSimultaneousLights,shaderLanguage:this._shaderLanguage}),Bv(Qi),this._useVertexPulling){const Yl=le.getRenderingMesh()?.geometry;Yl&&(this._vertexPullingMetadata=T1(Yl),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((jh,Wh)=>{Qi.push(`vp_${Wh}_info`)}))}else this._vertexPullingMetadata=null;const Qs={};this.customShaderNameResolve&&(ur=this.customShaderNameResolve(ur,Qi,Yi,Qr,me,ki,Qs));const Hh=me.toString(),To=le.effect,$s=At.getEngine().createEffe
vendor: 9,152 bytes, line 311
311ct(ur,{attributes:ki,uniformsNames:Qi,uniformBuffersNames:Yi,samplers:Qr,defines:Hh,fallbacks:Ze,onCompiled:this.onCompiled,onError:this.onError,indexParameters:yo,processFinalCode:Qs.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:me.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:a._ShaderLoader.getLoadCallback(this._shaderLanguage)},ks);if(this._eventInfo.customCode=void 0,$s)if(this._onEffectCreatedObservable&&(G_.effect=$s,G_.subMesh=le,this._onEffectCreatedObservable.notifyObservers(G_)),this.allowShaderHotSwapping&&To&&!$s.isReady()){if(me.markAsUnprocessed(),hr=this.isFrozen,hs)return me._areLightsDisposed=!0,!1}else At.resetCachedMaterial(),le.setEffect($s,me,this._materialContext)}return!le.effect||!le.effect.isReady()?!1:(me._renderId=At.getRenderId(),Et._wasPreviouslyReady=!hr,Et._wasPreviouslyUsingInstances=Kt,this._checkScenePerformancePriority(),!0)}buildUniformLayout(){const S=this._uniformBuffer;S.addUniform("diffuseLeftColor",4),S.addUniform("diffuseRightColor",4),S.addUniform("opacityParts",4),S.addUniform("reflectionLeftColor",4),S.addUniform("reflectionRightColor",4),S.addUniform("refractionLeftColor",4),S.addUniform("refractionRightColor",4),S.addUniform("emissiveLeftColor",4),S.addUniform("emissiveRightColor",4),S.addUniform("vDiffuseInfos",2),S.addUniform("vAmbientInfos",2),S.addUniform("vOpacityInfos",2),S.addUniform("vEmissiveInfos",2),S.addUniform("vLightmapInfos",2),S.addUniform("vSpecularInfos",2),S.addUniform("vBumpInfos",3),S.addUniform("diffuseMatrix",16),S.addUniform("ambientMatrix",16),S.addUniform("opacityMatrix",16),S.addUniform("emissiveMatrix",16),S.addUniform("lightmapMatrix",16),S.addUniform("specularMatrix",16),S.addUniform("bumpMatrix",16),S.addUniform("vTangentSpaceParams",2),S.addUniform("pointSize",1),S.addUniform("alphaCutOff",1),S.addUniform("refractionMatrix",16),S.addUniform("vRefractionInfos",4),S.addUniform("vRefractionPosition",3),S.addUniform("vRefractionSize",3),S.addUniform("vSpecularColor",4),S.addUniform("vEmissiveColor",3),S.addUniform("vDiffuseColor",4),S.addUniform("vAmbientColor",3),S.addUniform("cameraInfo",4),S.addUniform("vTextureRepetitionHexTilingParams",4),gD(S,!1,!0),super.buildUniformLayout()}bindForSubMesh(S,le,Kt){const Et=this.getScene(),At=Kt.materialDefines;if(!At)return;const me=Kt.effect;if(!me)return;this._activeEffect=me,le.getMeshUniformBuffer().bindToEffect(me,"Mesh"),le.transferToEffect(S),this._uniformBuffer.bindToEffect(me,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,Et,le,S,this.isFrozen),Is.Bind(Et.getEngine().currentRenderPassId,this._activeEffect,le,S,this);const ks=Et.activeCamera;ks?this._uniformBuffer.updateFloat4("cameraInfo",ks.minZ,ks.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0);const Zs=this.textureRepetitionHexTilingParams;this._uniformBuffer.updateFloat4("vTextureRepetitionHexTilingParams",Zs[0],Zs[1],Zs[2],Zs[3]),this._eventInfo.subMesh=Kt,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),At.OBJECTSPACE_NORMALMAP&&(S.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const hr=this._mustRebind(Et,me,Kt,le.visibility),hs=Et.getEngine()._features.needToAlwaysBindUniformBuffers;Hv(le,me),this._vertexPullingMetadata&&v1(me,this._vertexPullingMetadata);const Ze=this._uniformBuffer;if(hr){if(this.bindViewProjection(me),!Ze.useUbo||!this.isFrozen||!Ze.isSync||Kt._drawWrapper._forceRebindOnNextCall){if(a.FresnelEnabled&&At.FRESNEL){if(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(Ze.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),Ze.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled){const ki=Rm.Color3[0];ki.set(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),Ze.updateColor4("opacityParts",ki,this.opacityFresnelParameters.power)}this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(Ze.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),Ze.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(Ze.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),Ze.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(Ze.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),Ze.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))}if(Et.texturesEnabled&&(this._diffuseTexture&&a.DiffuseTextureEnabled&&(Ze.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),oa(this._diffuseTexture,Ze,"diffuse")),this._ambientTexture&&a.AmbientTextureEnabled&&(Ze.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),oa(this._ambientTexture,Ze,"ambient")),this._opacityTexture&&a.OpacityTextureEnabled&&(Ze.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),oa(this._opacityTexture,Ze,"opacity")),this._hasAlphaChannel()&&Ze.updateFloat("alphaCutOff",this.alphaCutOff),GC(Et,At,Ze,rt.White(),this._reflectionTexture,!1,!1,!0,!1,!1,!1,this.roughness),(!this._reflectionTexture||!a.ReflectionTextureEnabled)&&Ze.updateFloat2("vReflectionInfos",0,this.roughness),this._emissiveTexture&&a.EmissiveTextureEnabled&&(Ze.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),oa(this._emissiveTexture,Ze,"emissive")),this._lightmapTexture&&a.LightmapTextureEnabled&&(Ze.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),oa(this._lightmapTexture,Ze,"lightmap")),this._specularTexture&&a.SpecularTextureEnabled&&(Ze.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),oa(this._specularTexture,Ze,"specular")),this._bumpTexture&&Et.getEngine().getCaps().standardDerivatives&&a.BumpTextureEnabled&&(Ze.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),oa(this._bumpTexture,Ze,"bump"),Et._mirroredCameraPosition?Ze.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):Ze.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&a.RefractionTextureEnabled)){let ki=1;if(this._refractionTexture.isCube||(Ze.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(ki=this._refractionTexture.depth)),Ze.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,ki,this.invertRefractionY?-1:1),this._refractionTexture.boundingBoxSize){const ur=this._refractionTexture;Ze.updateVector3("vRefractionPosition",ur.boundingBoxPosition),Ze.updateVector3("vRefractionSize",ur.boundingBoxSize)}}this.pointsCloud&&Ze.updateFloat("pointSize",this.pointSize),Ze.updateColor4("vSpecularColor",this.specularColor,this.specularPower),Ze.updateColor3("vEmissiveColor",a.EmissiveTextureEnabled?this.emissiveColor:rt.BlackReadOnly),Ze.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha),Et.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),Ze.updateColor3("vAmbientColor",this._globalAmbientColor)}Et.texturesEnabled&&(this._diffuseTexture&&a.DiffuseTextureEnabled&&me.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&a.AmbientTextureEnabled&&me.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&a.OpacityTextureEnabled&&me.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&a.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?me.setTexture("reflectionCubeSampler",this._reflectionTexture):me.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&a.EmissiveTextureEnabled&&me.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&a.LightmapTextureEnabled&&me.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&a.SpecularTextureEnabled&&me.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&Et.getEngine().getCaps().standardDerivatives&&a.BumpTextureEnabled&&me.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&a.RefractionTextureEnabled&&(this._refractionTexture.isCube?me.setTexture("refractionCubeSampler",this._refractionTexture):me.setTexture("refraction2DSampler",this._refractionTexture))),this.get
vendor: 5,867 bytes, line 311
311Scene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(le)&&this.getScene().depthPeelingRenderer.bind(me),this._eventInfo.subMesh=Kt,this._callbackPluginEventBindForSubMesh(this._eventInfo),Lv(me,this,Et),this.bindEyePosition(me)}else hs&&(this._needToBindSceneUbo=!0);(hr||!this.isFrozen||hs)&&Et.lightsEnabled&&!this._disableLighting&&XC(Et,le,me,At,this._maxSimultaneousLights),(hr||!this.isFrozen)&&((Et.fogEnabled&&le.applyFog&&Et.fogMode!==Ae.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture||le.receiveShadows||At.PREPASS||At.CLUSTLIGHT_BATCH)&&this.bindView(me),Nv(Et,le,me),At.NUM_MORPH_INFLUENCERS&&Gv(le,me),At.BAKED_VERTEX_ANIMATION_TEXTURE&&le.bakedVertexAnimationManager?.bind(me,At.INSTANCES),this.useLogarithmicDepth&&kv(At,me,Et),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(le,this._activeEffect,Kt),Ze.update()}getAnimatables(){const S=super.getAnimatables();return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&S.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&S.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&S.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&S.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&S.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&S.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&S.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&S.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&S.push(this._refractionTexture),S}getActiveTextures(){const S=super.getActiveTextures();return this._diffuseTexture&&S.push(this._diffuseTexture),this._ambientTexture&&S.push(this._ambientTexture),this._opacityTexture&&S.push(this._opacityTexture),this._reflectionTexture&&S.push(this._reflectionTexture),this._emissiveTexture&&S.push(this._emissiveTexture),this._specularTexture&&S.push(this._specularTexture),this._bumpTexture&&S.push(this._bumpTexture),this._lightmapTexture&&S.push(this._lightmapTexture),this._refractionTexture&&S.push(this._refractionTexture),S}hasTexture(S){return!!(super.hasTexture(S)||this._diffuseTexture===S||this._ambientTexture===S||this._opacityTexture===S||this._reflectionTexture===S||this._emissiveTexture===S||this._specularTexture===S||this._bumpTexture===S||this._lightmapTexture===S||this._refractionTexture===S)}dispose(S,le){le&&(this._diffuseTexture?.dispose(),this._ambientTexture?.dispose(),this._opacityTexture?.dispose(),this._reflectionTexture?.dispose(),this._emissiveTexture?.dispose(),this._specularTexture?.dispose(),this._bumpTexture?.dispose(),this._lightmapTexture?.dispose(),this._refractionTexture?.dispose()),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(S,le)}clone(S,le=!0,Kt=""){const Et=xt.Clone(()=>new a(S,this.getScene()),this,{cloneTexturesOnlyOnce:le});return Et.name=S,Et.id=S,this.stencil.copyTo(Et.stencil),this._clonePlugins(Et,Kt),Et}static Parse(S,le,Kt){const Et=xt.Parse(()=>new a(S.name,le),S,le,Kt);return S.stencil&&Et.stencil.parse(S.stencil,le,Kt),Ei._ParsePlugins(S,Et,le,Kt),Et}static get DiffuseTextureEnabled(){return ct.DiffuseTextureEnabled}static set DiffuseTextureEnabled(S){ct.DiffuseTextureEnabled=S}static get DetailTextureEnabled(){return ct.DetailTextureEnabled}static set DetailTextureEnabled(S){ct.DetailTextureEnabled=S}static get AmbientTextureEnabled(){return ct.AmbientTextureEnabled}static set AmbientTextureEnabled(S){ct.AmbientTextureEnabled=S}static get OpacityTextureEnabled(){return ct.OpacityTextureEnabled}static set OpacityTextureEnabled(S){ct.OpacityTextureEnabled=S}static get ReflectionTextureEnabled(){return ct.ReflectionTextureEnabled}static set ReflectionTextureEnabled(S){ct.ReflectionTextureEnabled=S}static get EmissiveTextureEnabled(){return ct.EmissiveTextureEnabled}static set EmissiveTextureEnabled(S){ct.EmissiveTextureEnabled=S}static get SpecularTextureEnabled(){return ct.SpecularTextureEnabled}static set SpecularTextureEnabled(S){ct.SpecularTextureEnabled=S}static get BumpTextureEnabled(){return ct.BumpTextureEnabled}static set BumpTextureEnabled(S){ct.BumpTextureEnabled=S}static get LightmapTextureEnabled(){return ct.LightmapTextureEnabled}static set LightmapTextureEnabled(S){ct.LightmapTextureEnabled=S}static get RefractionTextureEnabled(){return ct.RefractionTextureEnabled}static set RefractionTextureEnabled(S){ct.RefractionTextureEnabled=S}static get ColorGradingTextureEnabled(){return ct.ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(S){ct.ColorGradingTextureEnabled=S}static get FresnelEnabled(){return ct.FresnelEnabled}static set FresnelEnabled(S){ct.FresnelEnabled=S}},e=new WeakMap,t=new WeakMap,i=new WeakMap,s=new WeakMap,n=new WeakMap,o=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakMap,_=new WeakMap,m=new WeakMap,g=new WeakMap,x=new WeakMap,y=new WeakMap,b=new WeakMap,v=new WeakMap,E=new WeakMap,R=new WeakMap,C=new WeakMap,O=new WeakMap,M=new WeakMap,I=new WeakMap,P=new WeakMap,L=new WeakMap,V=new WeakMap,X=new WeakMap,re=new WeakMap,ae=new WeakMap,de=new WeakMap,U=new WeakMap,te=new WeakMap,Y=ne
vendor: 12,901 bytes, line 311
311w WeakMap,(()=>{const Ye=typeof Symbol=="function"&&Symbol.metadata?Object.create(Z[Symbol.metadata]??null):void 0;q=[or("diffuseTexture")],w=[Lt("_markAllSubMeshesAsTexturesAndMiscDirty")],K=[or("ambientTexture")],ve=[Lt("_markAllSubMeshesAsTexturesDirty")],J=[or("opacityTexture")],Ne=[Lt("_markAllSubMeshesAsTexturesAndMiscDirty")],dt=[or("reflectionTexture")],Ot=[Lt("_markAllSubMeshesAsTexturesDirty")],ut=[or("emissiveTexture")],ti=[Lt("_markAllSubMeshesAsTexturesDirty")],ii=[or("specularTexture")],fi=[Lt("_markAllSubMeshesAsTexturesDirty")],si=[or("bumpTexture")],gr=[Lt("_markAllSubMeshesAsTexturesDirty")],Os=[or("lightmapTexture")],ns=[Lt("_markAllSubMeshesAsTexturesDirty")],G=[or("refractionTexture")],We=[Lt("_markAllSubMeshesAsTexturesDirty")],Qt=[qu("ambient")],os=[qu("diffuse")],Ls=[qu("specular")],Ur=[qu("emissive")],Zc=[ce()],$a=[ce("useAlphaFromDiffuseTexture")],Rn=[Lt("_markAllSubMeshesAsTexturesAndMiscDirty")],ll=[ce("useEmissiveAsIllumination")],Hr=[Lt("_markAllSubMeshesAsTexturesDirty")],ul=[ce("linkEmissiveWithDiffuse")],ga=[Lt("_markAllSubMeshesAsTexturesDirty")],fl=[ce("useSpecularOverAlpha")],dl=[Lt("_markAllSubMeshesAsTexturesDirty")],ps=[ce("useReflectionOverAlpha")],to=[Lt("_markAllSubMeshesAsTexturesDirty")],gl=[ce("disableLighting")],pl=[Lt("_markAllSubMeshesAsLightsDirty")],ih=[ce("useObjectSpaceNormalMap")],qs=[Lt("_markAllSubMeshesAsTexturesDirty")],Xr=[ce("useParallax")],no=[Lt("_markAllSubMeshesAsTexturesDirty")],Ks=[ce("useParallaxOcclusion")],cr=[Lt("_markAllSubMeshesAsTexturesDirty")],Tl=[ce()],vl=[ce("roughness")],va=[Lt("_markAllSubMeshesAsTexturesDirty")],lo=[ce()],Ea=[ce()],ah=[ce()],lh=[ce("useLightmapAsShadowmap")],uh=[Lt("_markAllSubMeshesAsTexturesDirty")],dh=[Ic("diffuseFresnelParameters")],gh=[Lt("_markAllSubMeshesAsFresnelDirty")],xh=[Ic("opacityFresnelParameters")],yh=[Lt("_markAllSubMeshesAsFresnelAndMiscDirty")],Eh=[Ic("reflectionFresnelParameters")],Sh=[Lt("_markAllSubMeshesAsFresnelDirty")],fo=[Ic("refractionFresnelParameters")],Sl=[Lt("_markAllSubMeshesAsFresnelDirty")],Dl=[Ic("emissiveFresnelParameters")],Ih=[Lt("_markAllSubMeshesAsFresnelDirty")],Pl=[ce("useReflectionFresnelFromSpecular")],On=[Lt("_markAllSubMeshesAsFresnelDirty")],wl=[ce("useGlossinessFromSpecularMapAlpha")],mo=[Lt("_markAllSubMeshesAsTexturesDirty")],kl=[ce("maxSimultaneousLights")],Lh=[Lt("_markAllSubMeshesAsLightsDirty")],cs=[ce("invertNormalMapX")],Ul=[Lt("_markAllSubMeshesAsTexturesDirty")],go=[ce("invertNormalMapY")],po=[Lt("_markAllSubMeshesAsTexturesDirty")],Vl=[ce("twoSidedLighting")],bo=[Lt("_markAllSubMeshesAsTexturesDirty")],jl=[ce("applyDecalMapAfterDetailMap")],zh=[Lt("_markAllSubMeshesAsMiscDirty")],ee(a,null,w,{kind:"accessor",name:"diffuseTexture",static:!1,private:!1,access:{has:S=>"diffuseTexture"in S,get:S=>S.diffuseTexture,set:(S,le)=>{S.diffuseTexture=le}},metadata:Ye},B,z),ee(a,null,ve,{kind:"accessor",name:"ambientTexture",static:!1,private:!1,access:{has:S=>"ambientTexture"in S,get:S=>S.ambientTexture,set:(S,le)=>{S.ambientTexture=le}},metadata:Ye},Le,ke),ee(a,null,Ne,{kind:"accessor",name:"opacityTexture",static:!1,private:!1,access:{has:S=>"opacityTexture"in S,get:S=>S.opacityTexture,set:(S,le)=>{S.opacityTexture=le}},metadata:Ye},Qe,He),ee(a,null,Ot,{kind:"accessor",name:"reflectionTexture",static:!1,private:!1,access:{has:S=>"reflectionTexture"in S,get:S=>S.reflectionTexture,set:(S,le)=>{S.reflectionTexture=le}},metadata:Ye},jt,Nt),ee(a,null,ti,{kind:"accessor",name:"emissiveTexture",static:!1,private:!1,access:{has:S=>"emissiveTexture"in S,get:S=>S.emissiveTexture,set:(S,le)=>{S.emissiveTexture=le}},metadata:Ye},ci,hi),ee(a,null,fi,{kind:"accessor",name:"specularTexture",static:!1,private:!1,access:{has:S=>"specularTexture"in S,get:S=>S.specularTexture,set:(S,le)=>{S.specularTexture=le}},metadata:Ye},qt,Wt),ee(a,null,gr,{kind:"accessor",name:"bumpTexture",static:!1,private:!1,access:{has:S=>"bumpTexture"in S,get:S=>S.bumpTexture,set:(S,le)=>{S.bumpTexture=le}},metadata:Ye},pr,xr),ee(a,null,ns,{kind:"accessor",name:"lightmapTexture",static:!1,private:!1,access:{has:S=>"lightmapTexture"in S,get:S=>S.lightmapTexture,set:(S,le)=>{S.lightmapTexture=le}},metadata:Ye},Bs,$e),ee(a,null,We,{kind:"accessor",name:"refractionTexture",static:!1,private:!1,access:{has:S=>"refractionTexture"in S,get:S=>S.refractionTexture,set:(S,le)=>{S.refractionTexture=le}},metadata:Ye},W,Ve),ee(a,null,Rn,{kind:"accessor",name:"useAlphaFromDiffuseTexture",static:!1,private:!1,access:{has:S=>"useAlphaFromDiffuseTexture"in S,get:S=>S.useAlphaFromDiffuseTexture,set:(S,le)=>{S.useAlphaFromDiffuseTexture=le}},metadata:Ye},Vr,Oi),ee(a,null,Hr,{kind:"accessor",name:"useEmissiveAsIllumination",static:!1,private:!1,access:{has:S=>"useEmissiveAsIllumination"in S,get:S=>S.useEmissiveAsIllumination,set:(S,le)=>{S.useEmissiveAsIllumination=le}},metadata:Ye},Qc,hl),ee(a,null,ga,{kind:"accessor",name:"linkEmissiveWithDiffuse",static:!1,private:!1,access:{has:S=>"linkEmissiveWithDiffuse"in S,get:S=>S.linkEmissiveWithDiffuse,set:(S,le)=>{S.linkEmissiveWithDiffuse=le}},metadata:Ye},Ys,gs),ee(a,null,dl,{kind:"accessor",name:"useSpecularOverAlpha",static:!1,private:!1,access:{has:S=>"useSpecularOverAlpha"in S,get:S=>S.useSpecularOverAlpha,set:(S,le)=>{S.useSpecularOverAlpha=le}},metadata:Ye},pa,eh),ee(a,null,to,{kind:"accessor",name:"useReflectionOverAlpha",static:!1,private:!1,access:{has:S=>"useReflectionOverAlpha"in S,get:S=>S.useReflectionOverAlpha,set:(S,le)=>{S.useReflectionOverAlpha=le}},metadata:Ye},jr,ml),ee(a,null,pl,{kind:"accessor",name:"disableLighting",static:!1,private:!1,access:{has:S=>"disableLighting"in S,get:S=>S.disableLighting,set:(S,le)=>{S.disableLighting=le}},metadata:Ye},xl,io),ee(a,null,qs,{kind:"accessor",name:"useObjectSpaceNormalMap",static:!1,private:!1,access:{has:S=>"useObjectSpaceNormalMap"in S,get:S=>S.useObjectSpaceNormalMap,set:(S,le)=>{S.useObjectSpaceNormalMap=le}},metadata:Ye},so,ro),ee(a,null,no,{kind:"accessor",name:"useParallax",static:!1,private:!1,access:{has:S=>"useParallax"in S,get:S=>S.useParallax,set:(S,le)=>{S.useParallax=le}},metadata:Ye},yl,Sn),ee(a,null,cr,{kind:"accessor",name:"useParallaxOcclusion",static:!1,private:!1,access:{has:S=>"useParallaxOcclusion"in S,get:S=>S.useParallaxOcclusion,set:(S,le)=>{S.useParallaxOcclusion=le}},metadata:Ye},oo,ba),ee(a,null,va,{kind:"accessor",name:"roughness",static:!1,private:!1,access:{has:S=>"roughness"in S,get:S=>S.roughness,set:(S,le)=>{S.roughness=le}},metadata:Ye},Cn,rh),ee(a,null,uh,{kind:"accessor",name:"useLightmapAsShadowmap",static:!1,private:!1,access:{has:S=>"useLightmapAsShadowmap"in S,get:S=>S.useLightmapAsShadowmap,set:(S,le)=>{S.useLightmapAsShadowmap=le}},metadata:Ye},fh,Al),ee(a,null,gh,{kind:"accessor",name:"diffuseFresnelParameters",static:!1,private:!1,access:{has:S=>"diffuseFresnelParameters"in S,get:S=>S.diffuseFresnelParameters,set:(S,le)=>{S.diffuseFresnelParameters=le}},metadata:Ye},uo,ph),ee(a,null,yh,{kind:"accessor",name:"opacityFresnelParameters",static:!1,private:!1,access:{has:S=>"opacityFresnelParameters"in S,get:S=>S.opacityFresnelParameters,set:(S,le)=>{S.opacityFresnelParameters=le}},metadata:Ye},Th,vh),ee(a,null,Sh,{kind:"accessor",name:"reflectionFresnelParameters",static:!1,private:!1,access:{has:S=>"reflectionFresnelParameters"in S,get:S=>S.reflectionFresnelParameters,set:(S,le)=>{S.reflectionFresnelParameters=le}},metadata:Ye},Mh,Ch),ee(a,null,Sl,{kind:"accessor",name:"refractionFresnelParameters",static:!1,private:!1,access:{has:S=>"refractionFresnelParameters"in S,get:S=>S.refractionFresnelParameters,set:(S,le)=>{S.refractionFresnelParameters=le}},metadata:Ye},Ml,Cl),ee(a,null,Ih,{kind:"accessor",name:"emissiveFresnelParameters",static:!1,private:!1,access:{has:S=>"emissiveFresnelParameters"in S,get:S=>S.emissiveFresnelParameters,set:(S,le)=>{S.emissiveFresnelParameters=le}},metadata:Ye},Ph,Oh),ee(a,null,On,{kind:"accessor",name:"useReflectionFresnelFromSpecular",static:!1,private:!1,access:{has:S=>"useReflectionFresnelFromSpecular"in S,get:S=>S.useReflectionFresnelFromSpecular,set:(S,le)=>{S.useReflectionFresnelFromSpecular=le}},metadata:Ye},wh,Aa),ee(a,null,mo,{kind:"accessor",name:"useGlossinessFromSpecularMapAlpha",static:!1,private:!1,access:{has:S=>"useGlossinessFromSpecularMapAlpha"in S,get:S=>S.useGlossinessFromSpecularMapAlpha,set:(S,le)=>{S.useGlossinessFromSpecularMapAlpha=le}},metadata:Ye},Bl,Ll),ee(a,null,Lh,{kind:"accessor",name:"maxSimultaneousLights",static:!1,private:!1,access:{has:S=>"maxSimultaneousLights"in S,get:S=>S.maxSimultaneousLights,set:(S,le)=>{S.maxSimultaneousLights=le}},metadata:Ye},kh,Nh),ee(a,null,Ul,{kind:"accessor",name:"invertNormalMapX",static:!1,private:!1,access:{has:S=>"invertNormalMapX"in S,get:S=>S.invertNormalMapX,set:(S,le)=>{S.invertNormalMapX=le}},metadata:Ye},zl,Gl),ee(a,null,po,{kind:"accessor",name:"invertNormalMapY",static:!1,private:!1,access:{has:S=>"invertNormalMapY"in S,get:S=>S.invertNormalMapY,set:(S,le)=>{S.invertNormalMapY=le}},metadata:Ye},Fn,xo),ee(a,null,bo,{kind:"accessor",name:"twoSidedLighting",static:!1,private:!1,access:{has:S=>"twoSidedLighting"in S,get:S=>S.twoSidedLighting,set:(S,le)=>{S.twoSidedLighting=le}},metadata:Ye},Hl,Er),ee(a,null,zh,{kind:"accessor",name:"applyDecalMapAfterDetailMap",static:!1,private:!1,access:{has:S=>"applyDecalMapAfterDetailMap"in S,get:S=>S.applyDecalMapAfterDetailMap,set:(S,le)=>{S.applyDecalMapAfterDetailMap=le}},metadata:Ye},Gh,Vh),ee(null,null,q,{kind:"field",name:"_diffuseTexture",static:!1,private:!1,access:{has:S=>"_diffuseTexture"in S,get:S=>S._diffuseTexture,set:(S,le)=>{S._diffuseTexture=le}},metadata:Ye},j,Q),ee(null,null,K,{kind:"field",name:"_ambientTexture",static:!1,private:!1,access:{has:S=>"_ambientTexture"in S,get:S=>S._ambientTexture,set:(S,le)=>{S._ambientTexture=le}},metadata:Ye},ue,he),ee(null,null,J,{kind:"field",name:"_opacityTexture",static:!1,private:!1,access:{has:S=>"_opacityTexture"in S,get:S=>S._opacityTexture,set:(S,le)=>{S._opacityTexture=le}},metadata:Ye},_e,xe),ee(null,null,dt,{kind:"field",name:"_reflectionTexture",static:!1,private:!1,access:{has:S=>"_reflectionTexture"in S,get:S=>S._reflectionTexture,set:(S,le)=>{S._reflectionTexture=le}},metadata:Ye},li,zt),ee(null,null,ut,{kind:"field",name:"_emissiveTexture",static:!1,private:!1,access:{has:S=>"_emissiveTexture"in S,get:S=>S._emissiveTexture,set:(S,le)=>{S._emissiveTexture=le}},metadata:Ye},ne,we),ee(null,null,ii,{kind:"field",name:"_specularTexture",static:!1,private:!1,access:{has:S=>"_specularTexture"in S,get:S=>S._specularTexture,set:(S,le)=>{S._specularTexture=le}},metadata:Ye},ui,Gt),ee(null,null,si,{kind:"field",name:"_bumpTexture",static:!1,private:!1,access:{has:S=>"_bumpTexture"in S,get:S=>S._bumpTexture,set:(S,le)=>{S._bumpTexture=le}},metadata:Ye},Si,Mi),ee(null,null,Os,{kind:"field",name:"_lightmapTexture",static:!1,private:!1,access:{has:S=>"_lightmapTexture"in S,get:S=>S._lightmapTexture,set:(S,le)=>{S._lightmapTexture=le}},metadata:Ye},ws,Fs),ee(null,null,G,{kind:"field",name:"_refractionTexture",static:!1,private:!1,access:{has:S=>"_refractionTexture"in S,get:S=>S._refractionTexture,set:(S,le)=>{S._refractionTexture=le}},metadata:Ye},Re,pt),ee(null,null,Qt,{kind:"field",name:"ambientColor",static:!1,private:!1,access:{has:S=>"ambientColor"in S,get:S=>S.ambientColor,set:(S,le)=>{S.ambientColor=le}},metadata:Ye},as,br),ee(null,null,os,{kind:"field",name:"diffuseColor",static:!1,private:!1,access:{has:S=>"diffuseColor"in S,get:S=>S.diffuseColor,set:(S,le)=>{S.diffuseColor=le}},metadata:Ye},ms,ls),ee(null,null,Ls,{kind:"field",name:"specularColor",static:!1,private:!1,access:{has:S=>"specularColor"in S,get:S=>S.specularColor,set:(S,le)=>{S.specularColor=le}},metadata:Ye},Li,Ki),ee(null,null,Ur,{kind:"field",name:"emissiveColor",static:!1,private:!1,access:{has:S=>"emissiveColor"in S,get:S=>S.emissiveColor,set:(S,le)=>{S.emissiveColor=le}},metadata:Ye},Qa,Kc),ee(null,null,Zc,{kind:"field",name:"specularPower",static:!1,private:!1,access:{has:S=>"specularPower"in S,get:S=>S.specularPower,set:(S,le)=>{S.specularPower=le}},metadata:Ye},ol,An),ee(null,null,$a,{kind:"field",name:"_useAlphaFromDiffuseTexture",static:!1,private:!1,access:{has:S=>"_useAlphaFromDiffuseTexture"in S,get:S=>S._useAlphaFromDiffuseTexture,set:(S,le)=>{S._useAlphaFromDiffuseTexture=le}},metadata:Ye},zr,Gr),ee(null,null,ll,{kind:"field",name:"_useEmissiveAsIllumination",static:!1,private:!1,access:{has:S=>"_useEmissiveAsIllumination"in S,get:S=>S._useEmissiveAsIllumination,set:(S,le)=>{S._useEmissiveAsIllumination=le}},metadata:Ye},cl,yr),ee(null,null,ul,{kind:"field",name:"_linkEmissiveWithDiffuse",static:!1,private:!1,access:{has:S=>"_linkEmissiveWithDiffuse"in S,get:S=>S._linkEmissiveWithDiffuse,set:(S,le)=>{S._linkEmissiveWithDiffuse=le}},metadata:Ye},$c,ma),ee(null,null,fl,{kind:"field",name:"_useSpecularOverAlpha",static:!1,private:!1,access:{has:S=>
311"_useSpecularOverAlpha"in S,get:S=>S._useSpecularOverAlpha,set:(S,le)=>{S._useSpecularOverAlpha=le}},metadata:Ye},Jc,Ja),ee(null,null,ps,{kind:"field",name:"_useReflectionOverAlpha",static:!1,private:!1,access:{has:S=>"_useReflectionOverAlpha"in S,get:S=>S._useReflectionOverAlpha,set:(S,le)=>{S._useReflectionOverAlpha=le}},metadata:Ye},eo,_l),ee(null,null,gl,{kind:"field",name:"_disableLighting",static:!1,private:!1,access:{has:S=>"_disableLighting"in S,get:S=>S._disableLighting,set:(S,le)=>{S._disableLighting=le}},metadata:Ye},Wr,th),ee(null,null,ih,{kind:"field",name:"_useObjectSpaceNormalMap",static:!1,private:!1,access:{has:S=>"_useObjectSpaceNormalMap"in S,get:S=>S._useObjectSpaceNormalMap,set:(S,le)=>{S._useObjectSpaceNormalMap=le}},metadata:Ye},sh,xa),ee(null,null,Xr,{kind:"field",name:"_useParallax",static:!1,private:!1,access:{has:S=>"_useParallax"in S,get:S=>S._useParallax,set:(S,le)=>{S._useParallax=le}},metadata:Ye},Yr,bl),ee(null,null,Ks,{kind:"field",name:"_useParallaxOcclusion",static:!1,private:!1,access:{has:S=>"_useParallaxOcclusion"in S,get:S=>S._useParallaxOcclusion,set:(S,le)=>{S._useParallaxOcclusion=le}},metadata:Ye},ao,Mn),ee(null,null,Tl,{kind:"field",name:"parallaxScaleBias",static:!1,private:!1,access:{has:S=>"parallaxScaleBias"in S,get:S=>S.parallaxScaleBias,set:(S,le)=>{S.parallaxScaleBias=le}},metadata:Ye},ya,Ta),ee(null,null,vl,{kind:"field",name:"_roughness",static:!1,private:!1,access:{has:S=>"_roughness"in S,get:S=>S._roughness,set:(S,le)=>{S._roughness=le}},metadata:Ye},Zi,Tr),ee(null,null,lo,{kind:"field",name:"indexOfRefraction",static:!1,private:!1,access:{has:S=>"indexOfRefraction"in S,get:S=>S.indexOfRefraction,set:(S,le)=>{S.indexOfRefraction=le}},metadata:Ye},co,Dn),ee(null,null,Ea,{kind:"field",name:"invertRefractionY",static:!1,private:!1,access:{has:S=>"invertRefractionY"in S,get:S=>S.invertRefractionY,set:(S,le)=>{S.invertRefractionY=le}},metadata:Ye},El,nh),ee(null,null,ah,{kind:"field",name:"alphaCutOff",static:!1,private:!1,access:{has:S=>"alphaCutOff"in S,get:S=>S.alphaCutOff,set:(S,le)=>{S.alphaCutOff=le}},metadata:Ye},oh,ho),ee(null,null,lh,{kind:"field",name:"_useLightmapAsShadowmap",static:!1,private:!1,access:{has:S=>"_useLightmapAsShadowmap"in S,get:S=>S._useLightmapAsShadowmap,set:(S,le)=>{S._useLightmapAsShadowmap=le}},metadata:Ye},ch,hh),ee(null,null,dh,{kind:"field",name:"_diffuseFresnelParameters",static:!1,private:!1,access:{has:S=>"_diffuseFresnelParameters"in S,get:S=>S._diffuseFresnelParameters,set:(S,le)=>{S._diffuseFresnelParameters=le}},metadata:Ye},_h,mh),ee(null,null,xh,{kind:"field",name:"_opacityFresnelParameters",static:!1,private:!1,access:{has:S=>"_opacityFresnelParameters"in S,get:S=>S._opacityFresnelParameters,set:(S,le)=>{S._opacityFresnelParameters=le}},metadata:Ye},bh,Rl),ee(null,null,Eh,{kind:"field",name:"_reflectionFresnelParameters",static:!1,private:!1,access:{has:S=>"_reflectionFresnelParameters"in S,get:S=>S._reflectionFresnelParameters,set:(S,le)=>{S._reflectionFresnelParameters=le}},metadata:Ye},Ah,Rh),ee(null,null,fo,{kind:"field",name:"_refractionFresnelParameters",static:!1,private:!1,access:{has:S=>"_refractionFresnelParameters"in S,get:S=>S._refractionFresnelParameters,set:(S,le)=>{S._refractionFresnelParameters=le}},metadata:Ye},In,Dh),ee(null,null,Dl,{kind:"field",name:"_emissiveFresnelParameters",static:!1,private:!1,access:{has:S=>"_emissiveFresnelParameters"in S,get:S=>S._emissiveFresnelParameters,set:(S,le)=>{S._emissiveFresnelParameters=le}},metadata:Ye},Il,qr),ee(null,null,Pl,{kind:"field",name:"_useReflectionFresnelFromSpecular",static:!1,private:!1,access:{has:S=>"_useReflectionFresnelFromSpecular"in S,get:S=>S._useReflectionFresnelFromSpecular,set:(S,le)=>{S._useReflectionFresnelFromSpecular=le}},metadata:Ye},Ol,Pn),ee(null,null,wl,{kind:"field",name:"_useGlossinessFromSpecularMapAlpha",static:!1,private:!1,access:{has:S=>"_useGlossinessFromSpecularMapAlpha"in S,get:S=>S._useGlossinessFromSpecularMapAlpha,set:(S,le)=>{S._useGlossinessFromSpecularMapAlpha=le}},metadata:Ye},Fl,_o),ee(null,null,kl,{kind:"field",name:"_maxSimultaneousLights",static:!1,private:!1,access:{has:S=>"_maxSimultaneousLights"in S,get:S=>S._maxSimultaneousLights,set:(S,le)=>{S._maxSimultaneousLights=le}},metadata:Ye},Fh,Bh),ee(null,null,cs,{kind:"field",name:"_invertNormalMapX",static:!1,private:!1,access:{has:S=>"_invertNormalMapX"in S,get:S=>S._invertNormalMapX,set:(S,le)=>{S._invertNormalMapX=le}},metadata:Ye},wn,Nl),ee(null,null,go,{kind:"field",name:"_invertNormalMapY",static:!1,private:!1,access:{has:S=>"_invertNormalMapY"in S,get:S=>S._invertNormalMapY,set:(S,le)=>{S._invertNormalMapY=le}},metadata:Ye},Uh,Kr),ee(null,null,Vl,{kind:"field",name:"_twoSidedLighting",static:!1,private:!1,access:{has:S=>"_twoSidedLighting"in S,get:S=>S._twoSidedLighting,set:(S,le)=>{S._twoSidedLighting=le}},metadata:Ye},vr,Zr),ee(null,null,jl,{kind:"field",name:"_applyDecalMapAfterDetailMap",static:!1,private:!1,access:{has:S=>"_applyDecalMapAfterDetailMap"in S,get:S=>S._applyDecalMapAfterDetailMap,set:(S,le)=>{S._applyDecalMapAfterDetailMap=le}},metadata:Ye},Wl,Xl),Ye&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Ye})})(),a.ForceGLSL=!1,a._ShaderLoader=new PI(()=>[Wi(()=>import("./default.vertex--TKYAiUr.js"),__vite__mapDeps([12,13,14,9])),Wi(()=>import("./default.fragment-C17VHVrm.js"),__vite__mapDeps([15,13,14,11]))],()=>[Wi(()=>import("./default.vertex-B-zwfN08.js"),__vite__mapDeps([16,17,18,5])),Wi(()=>import("./default.fragment-CYqHXNTR.js"),__vite__mapDeps([19,17,18,7]))]),a})(),gT=!1;function NI(){gT||(gT=!0,UD(),Lr("BABYLON.StandardMaterial",tl),Ae.DefaultMaterialFactory=a=>new tl("default material",a))}Object.getOwnPropertyDescriptor(tl.prototype,"decalMap")||Object.defineProperty(tl.prototype,"decalMap",gt("StandardMaterial","decalMap"));NI();const UI=60;class zI{constructor(e,t,i){this._cameraPosition=t,this._behavior=i,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 D,this.rotationAccumulatedPixels=new D,this.zoomDeltaCurrentFrame=0,this.panDeltaCurrentFrame=D.Zero(),this.rotationDeltaCurrentFrame=D.Zero(),this._zoomVelocity=0,this._panVelocity=new D,this.referenceFrameRate=UI,this._rotationVelocity=new D,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}
311get isInterpolating(){return!!this._behavior?.isInterpolating}getFrameIndependentDecay(e){const t=this._scene.getEngine().getDeltaTime(),i=this._getEffectiveDeltaMs(t),s=1e3/this.referenceFrameRate;return Math.pow(e,i/s)}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,i){let s=e;const n=this._scene.getEngine().getDeltaTime(),o=this._getEffectiveDeltaMs(n);if(o===0)return s;const c=this.getFrameIndependentDecay(i);if(s*=c,t!==0||this.activeInput){const h=1-i,f=h>0?(1-c)/h:1;s+=t/o*f}else Math.abs(s)<1e-6&&(s=0);return s}}class GI{constructor(e,t){this.inputMap=[],this.handlers=e,this._createDefaultEntries=t,this.resetInputMap()}resolveInteraction(e,t){for(const i of this.inputMap)if(i.source===e&&this._entryMatches(i,t))return i;return null}resetInputMap(){this.inputMap=this._createDefaultEntries?.()??[]}getEntry(e,t,i){const s=this.inputMap;for(let n=0;n<s.length;n++){const o=s[n];if(o.source===e&&o.interaction===t&&this._entryConditionsMatch(o,i))return o}}getEntries(e,t,i){const s=[],n=this.inputMap;for(let o=0;o<n.length;o++){const c=n[o];c.source===e&&c.interaction===t&&this._entryConditionsMatch(c,i)&&s.push(c)}return s}addEntry(e){const t=this._entrySpecificity(e);let i=this.inputMap.length;for(let s=0;s<this.inputMap.length;s++)if(this._entrySpecificity(this.inputMap[s])<t){i=s;break}this.inputMap.splice(i,0,e)}setInteraction(e,t,i){const s=this.resolveInteraction(e,t);return s&&this._entryCoversAllConditionsOf(s,t)?(s.interaction=i,!0):(this.addEntry({source:e,...t??{},interaction:i}),!0)}_entryCoversAllConditionsOf(e,t){if(!t)return!0;const i=e;for(const s of Object.keys(t)){const n=t[s];if(n!==void 0){if(s==="modifiers"){const o=i.modifiers??{};for(const c of Object.keys(n))if(n[c]!==void 0&&o[c]===void 0)return!1}else if(i[s]===void 0)return!1}}return!0}setInteractions(e,t,i){let s=0;const n=this.inputMap;for(let o=0;o<n.length;o++){const c=n[o];c.source===e&&this._entryMatches(c,t)&&(c.interaction=i,s++)}return s}_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 VI extends zI{constructor(e,t,i){super(e,t,i),this.input=new GI({translate:(s,n,o)=>{this.panAccumulatedPixels.x+=s,this.panAccumulatedPixels.y+=n,this.panAccumulatedPixels.z+=o},rotate:(s,n)=>{this.rotationAccumulatedPixels.x+=s,this.rotationAccumulatedPixels.y+=n}},()=>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 $u=se.Zero(),V_=Be.Identity();let HI=(()=>{var a;let e=ds,t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],m,g=[],x=[];return a=class extends e{get inertia(){return this._targetInertia}set inertia(b){this._targetInertia=b,this.movement&&(this.movement.panInertia=b,this.movement.rotationInertia=b)}constructor(b,v,E,R=!0){super(b,v,E,R),this.cameraDirection=new D(0,0,0),this.cameraRotation=new Fe(0,0),this._targetInertia=.9,this.updateUpVectorFromRotation=N(this,i,!1),this.rotation=(N(this,s),N(this,o,void 0)),this.rotationQuaternion=N(this,c),this.speed=N(this,f,2),this.noRotationConstraint=(N(this,_),!1),this.invertRotation=!1,this.inverseRotationSpeed=.2,this._panningEpsilon=Vt,this._rotationEpsilon=Vt,this.lockedTarget=N(this,g,null),this._currentTarget=(N(this,x),D.Zero()),this._initialFocalDistance=1,this._viewMatrix=se.Zero(),this._cameraTransformMatrix=se.Zero(),this._cameraRotationMatrix=se.Zero(),this._transformedReferencePoint=D.Zero(),this._deferredPositionUpdate=new D,this._deferredRotationQuaternionUpdate=new Be,this._deferredRotationUpdate=new D,this._deferredUpdated=!1,this._deferOnly=!1,this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0,this._referencePoint=D.Forward(this.getScene().useRightHandedSystem),this.rotation=new D(0,this.get
vendor: 11,991 bytes, line 311
311Scene().useRightHandedSystem?Math.PI:0,0),this.movement=new VI(this.getScene(),this.position),this.movement.panInertia=this.inertia,this.movement.rotationInertia=this.inertia}getFrontPosition(b){this.getWorldMatrix();const v=ge.Vector3[0],E=ge.Vector3[1];return E.set(0,0,this._scene.useRightHandedSystem?-1:1),this.getDirectionToRef(E,v),v.scaleInPlace(b),this.globalPosition.add(v)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){const b=this.lockedTarget;b.computeWorldMatrix().getTranslationToRef(b.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 D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new D(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new Be(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(b){b||super._updateCache();const v=this._getLockedTargetPosition();v?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(v):this._cache.lockedTarget=v.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 b=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(b):!b)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){const b=this.getEngine();return this.speed*Math.sqrt(b.getDeltaTime()/(b.getFps()*100))}setTarget(b){this.upVector.normalize(),this._initialFocalDistance=b.subtract(this.position).length(),this.position.z===b.z&&(this.position.z+=Vt),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),this.getScene().useRightHandedSystem?se.LookAtRHToRef(this.position,b,D.UpReadOnly,$u):se.LookAtLHToRef(this.position,b,D.UpReadOnly,$u),$u.invert();const v=this.rotationQuaternion||V_;Be.FromRotationMatrixToRef($u,v),v.toEulerAnglesToRef(this.rotation),this.rotation.z=0}get target(){return this.getTarget()}set target(b){this.setTarget(b)}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(ge.Matrix[0]),D.TransformNormalToRef(this.cameraDirection,ge.Matrix[0],ge.Vector3[0]),this._deferredPositionUpdate.addInPlace(ge.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 b=this.movement,v=this.cameraDirection.x!==0||this.cameraDirection.y!==0||this.cameraDirection.z!==0;b.panAccumulatedPixels.addInPlace(this.cameraDirection),b.rotationAccumulatedPixels.x+=this.cameraRotation.x,b.rotationAccumulatedPixels.y+=this.cameraRotation.y,b.computeCurrentFrameDeltas(),this.cameraDirection.copyFrom(b.panDeltaCurrentFrame),this.cameraRotation.set(b.rotationDeltaCurrentFrame.x,b.rotationDeltaCurrentFrame.y);const E=this.speed*this._panningEpsilon;!v&&Math.abs(this.cameraDirection.x)<E&&Math.abs(this.cameraDirection.y)<E&&Math.abs(this.cameraDirection.z)<E&&(this.cameraDirection.setAll(0),b.resetPanVelocity());const R=this.invertRotation?-this.inverseRotationSpeed:1,C=this._decideIfNeedsToMove(),O=!!(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),C&&this._updatePosition(),O&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*R,this._deferredRotationUpdate.y+=this.cameraRotation.y*R,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()&&(Be.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):se.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)}_rotateUpVectorWithCameraRotationMatrix(){return D.TransformNormalToRef(D.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),D.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?Xa.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(Be.FromEulerVectorToRef(this.rotation,V_),Xa.Y.rotateByQuaternionToRef(V_,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix}_computeViewMatrix(b,v,E){if(this.getScene().useRightHandedSystem?se.LookAtRHToRef(b,v,E,this._viewMatrix):se.LookAtLHToRef(b,v,E,this._viewMatrix),this.parent){const R=this.parent.getWorldMatrix();this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(R,this._viewMatrix),this._viewMatrix.invert(),this._markSyncedWithParent()}}createRigCamera(b,v){if(this.cameraRigMode!==ds.RIG_MODE_NONE){const E=new a(b,this.position.clone(),this.getScene());return E.isRigCamera=!0,E.rigParent=this,this.cameraRigMode===ds.RIG_MODE_VR&&(this.rotationQuaternion||(this.rotationQuaternion=new Be),E._cameraRigParams={},E.rotationQuaternion=new Be),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 b=this._rigCameras[0],v=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case ds.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case ds.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case ds.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case ds.RIG_MODE_STEREOSCOPIC_OVERUNDER:case ds.RIG_MODE_STEREOSCOPIC_INTERLACED:{const E=this.cameraRigMode===ds.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,R=this.cameraRigMode===ds.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*E,b),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*R,v);break}case ds.RIG_MODE_VR:b.rotationQuaternion&&v.rotationQuaternion&&this.rotationQuaternion?(b.rotationQuaternion.copyFrom(this.rotationQuaternion),v.rotationQuaternion.copyFrom(this.rotationQuaternion)):(b.rotation.copyFrom(this.rotation),v.rotation.copyFrom(this.rotation)),b.position.copyFrom(this.position),v.position.copyFrom(this.position);break}super._updateRigCameras()}_getRigCamPositionAndTarget(b,v){this.getTarget().subtractToRef(this.position,a._TargetFocalPoint),a._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);const R=a._TargetFocalPoint.addInPlace(this.position);se.TranslationToRef(-R.x,-R.y,-R.z,a._TargetTransformMatrix),a._TargetTransformMatrix.multiplyToRef(se.RotationAxis(v.upVector,b),a._RigCamTransformMatrix),se.TranslationToRef(R.x,R.y,R.z,a._TargetTransformMatrix),a._RigCamTransformMatrix.multiplyToRef(a._TargetTransformMatrix,a._RigCamTransformMatrix),D.TransformCoordinatesToRef(this.position,a._RigCamTransformMatrix,v.position),v.setTarget(R)}getClassName(){return"TargetCamera"}},(()=>{const y=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[ce()],n=[ua()],h=[ce()],m=[BM("lockedTargetId")],ee(null,null,t,{kind:"field",name:"updateUpVectorFromRotation",static:!1,private:!1,access:{has:b=>"updateUpVectorFromRotation"in b,get:b=>b.updateUpVectorFromRotation,set:(b,v)=>{b.updateUpVectorFromRotation=v}},metadata:y},i,s),ee(null,null,n,{kind:"field",name:"rotation",static:!1,private:!1,access:{has:b=>"rotation"in b,get:b=>b.rotation,set:(b,v)=>{b.rotation=v}},metadata:y},o,c),ee(null,null,h,{kind:"field",name:"speed",static:!1,private:!1,access:{has:b=>"speed"in b,get:b=>b.speed,set:(b,v)=>{b.speed=v}},metadata:y},f,_),ee(null,null,m,{kind:"field",name:"lockedTarget",static:!1,private:!1,access:{has:b=>"lockedTarget"in b,get:b=>b.lockedTarget,set:(b,v)=>{b.lockedTarget=v}},metadata:y},g,x),y&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})})(),a._RigCamTransformMatrix=new se,a._TargetTransformMatrix=new se,a._TargetFocalPoint=new D,a})();var il={};class jI{constructor(e){this.attachedToElement=!1,this.attached={},this.camera=e,this.checkInputs=()=>{}}add(e){const t=e.getSimpleName();if(this.attached[t]){pe.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 i=this.attached[t];if(i===e){i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck();return}}}removeByType(e){for(const t in this.attached){const i=this.attached[t];i.getClassName()===e&&(i.detachControl(),i.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=ds.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 i in this.attached){const s=this.attached[i],n=xt.Serialize(s);t[s.getClassName()]=n}
311e.inputsmgr=t}parse(e){const t=e.inputsmgr;if(t){this.clear();for(const i in t){const s=il[i];if(s){const n=t[i],o=xt.Parse(()=>new s,n,null);this.add(o)}}}else for(const i in this.attached){const s=il[this.attached[i].getClassName()];if(s){const n=xt.Parse(()=>new s,e,null);this.remove(this.attached[i]),this.add(n)}}}}let W1=(()=>{var a;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,m=[],g=[],x,y=[],b=[],v,E=[],R=[],C,O=[],M=[],I,P=[],L=[],V,X=[],re=[],ae,de=[],U=[],te,Y=[],Z=[];return a=class{constructor(){this.keysUp=N(this,t,[38]),this.keysUpward=(N(this,i),N(this,n,[33])),this.keysDown=(N(this,o),N(this,h,[40])),this.keysDownward=(N(this,f),N(this,m,[34])),this.keysLeft=(N(this,g),N(this,y,[37])),this.keysRight=(N(this,b),N(this,E,[39])),this.rotationSpeed=(N(this,R),N(this,O,.5)),this.keysRotateLeft=(N(this,M),N(this,P,[])),this.keysRotateRight=(N(this,L),N(this,X,[])),this.keysRotateUp=(N(this,re),N(this,de,[])),this.keysRotateDown=(N(this,U),N(this,Y,[])),this._keys=(N(this,Z),new Array)}attachControl(j){j=bt.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(Q=>{const w=Q.event;if(!w.metaKey){if(Q.type===jc.KEYDOWN)(this.keysUp.indexOf(w.keyCode)!==-1||this.keysDown.indexOf(w.keyCode)!==-1||this.keysLeft.indexOf(w.keyCode)!==-1||this.keysRight.indexOf(w.keyCode)!==-1||this.keysUpward.indexOf(w.keyCode)!==-1||this.keysDownward.indexOf(w.keyCode)!==-1||this.keysRotateLeft.indexOf(w.keyCode)!==-1||this.keysRotateRight.indexOf(w.keyCode)!==-1||this.keysRotateUp.indexOf(w.keyCode)!==-1||this.keysRotateDown.indexOf(w.keyCode)!==-1)&&(this._keys.indexOf(w.keyCode)===-1&&this._keys.push(w.keyCode),j||w.preventDefault());else if(this.keysUp.indexOf(w.keyCode)!==-1||this.keysDown.indexOf(w.keyCode)!==-1||this.keysLeft.indexOf(w.keyCode)!==-1||this.keysRight.indexOf(w.keyCode)!==-1||this.keysUpward.indexOf(w.keyCode)!==-1||this.keysDownward.indexOf(w.keyCode)!==-1||this.keysRotateLeft.indexOf(w.keyCode)!==-1||this.keysRotateRight.indexOf(w.keyCode)!==-1||this.keysRotateUp.indexOf(w.keyCode)!==-1||this.keysRotateDown.indexOf(w.keyCode)!==-1){const B=this._keys.indexOf(w.keyCode);B>=0&&this._keys.splice(B,1),j||w.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 j=this.camera,Q=j.movement.input,w=Q.getEntry("keyboard","translate"),B=Q.getEntry("keyboard","rotate"),z=B?.sensitivity??1,K=j._localDirection.copyFromFloats(0,0,0);for(let ue=0;ue<this._keys.length;ue++){const he=this._keys[ue];this.keysLeft.indexOf(he)!==-1?K.x-=1:this.keysUp.indexOf(he)!==-1?K.z+=1:this.keysRight.indexOf(he)!==-1?K.x+=1:this.keysDown.indexOf(he)!==-1?K.z-=1:this.keysUpward.indexOf(he)!==-1?K.y+=1:this.keysDownward.indexOf(he)!==-1?K.y-=1:this.keysRotateLeft.indexOf(he)!==-1?B&&(j.cameraRotation.y-=this._getLocalRotation()*z):this.keysRotateRight.indexOf(he)!==-1?B&&(j.cameraRotation.y+=this._getLocalRotation()*z):this.keysRotateUp.indexOf(he)!==-1?B&&(j.cameraRotation.x-=this._getLocalRotation()*z):this.keysRotateDown.indexOf(he)!==-1&&B&&(j.cameraRotation.x+=this._getLocalRotation()*z)}if(w&&(K.x!==0||K.y!==0||K.z!==0)){const ue=j._computeLocalCameraSpeed()*(w.sensitivity??1);K.normalize().scaleInPlace(ue),j.getScene().useRightHandedSystem&&(K.z*=-1),j.getViewMatrix().invertToRef(j._cameraTransformMatrix),D.TransformNormalToRef(K,j._cameraTransformMatrix,j._transformedDirection),j.cameraDirection.addInPlace(j._transformedDirection)}}}getClassName(){return"FreeCameraKeyboardMoveInput"}_onLostFocus(){this._keys.length=0}getSimpleName(){return"keyboard"}_getLocalRotation(){const j=this.camera._calculateHandednessMultiplier();return this.rotationSpeed*this._engine.getDeltaTime()/1e3*j}},(()=>{const q=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ce()],s=[ce()],c=[ce()],_=[ce()],x=[ce()],v=[ce()],C=[ce()],I=[ce()],V=[ce()],ae=[ce()],te=[ce()],ee(null,null,e,{kind:"field",name:"keysUp",static:!1,private:!1,access:{has:j=>"keysUp"in j,get:j=>j.keysUp,set:(j,Q)=>{j.keysUp=Q}},metadata:q},t,i),ee(null,null,s,{kind:"field",name:"keysUpward",static:!1,private:!1,access:{has:j=>"keysUpward"in j,get:j=>j.keysUpward,set:(j,Q)=>{j.keysUpward=Q}},metadata:q},n,o),ee(null,null,c,{kind:"field",name:"keysDown",static:!1,private:!1,access:{has:j=>"keysDown"in j,get:j=>j.keysDown,set:(j,Q)=>{j.keysDown=Q}},metadata:q},h,f),ee(null,null,_,{kind:"field",name:"keysDownward",static:!1,private:!1,access:{has:j=>"keysDownward"in j,get:j=>j.keysDownward,set:(j,Q)=>{j.keysDownward=Q}},metadata:q},m,g),ee(null,null,x,{kind:"field",name:"keysLeft",static:!1,private:!1,access:{has:j=>"keysLeft"in j,get:j=>j.keysLeft,set:(j,Q)=>{j.keysLeft=Q}},metadata:q},y,b),ee(null,null,v,{kind:"field",name:"keysRight",static:!1,private:!1,access:{has:j=>"keysRight"in j,get:j=>j.keysRight,set:(j,Q)=>{j.keysRight=Q}},metadata:q},E,R),ee(null,null,C,{kind:"field",name:"rotationSpeed",static:!1,private:!1,access:{has:j=>"rotationSpeed"in j,get:j=>j.rotationSpeed,set:(j,Q)=>{j.rotationSpeed=Q}},metadata:q},O,M),ee(null,null,I,{kind:"field",name:"keysRotateLeft",static:!1,private:!1,access:{has:j=>"keysRotateLeft"in j,get:j=>j.keysRotateLeft,set:(j,Q)=>{j.keysRotateLeft=Q}},metadata:q},P,L),ee(null,null,V,{kind:"field",name:"keysRotateRight",static:!1,private:!1,access:{has:j=>"keysRotateRight"in j,get:j=>j.keysRotateRight,set:(j,Q)=>{j.keysRotateRight=Q}},metadata:q},X,re),ee(null,null,ae,{kind:"field",name:"keysRotateUp",static:!1,private:!1,access:{has:j=>"keysRotateUp"in j,get:j=>j.keysRotateUp,set:(j,Q)=>{j.keysRotateUp=Q}},metadata:q},de,U),ee(null,null,te,{kind:"field",name:"keysRotateDown",static:!1,private:!1,access:{has:j=>"keysRotateDown"in j,get:j=>j.keysRotateDown,set:(j,Q)=>{j.keysRotateDown=Q}},metadata:q},Y,Z),q&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q})})(),a})();il.FreeCameraKeyboardMoveInput=W1;let X1=(()=>{var a;let e,t=[],i=[],s,n=[],o=[];return a=class{_applyPointerRotation(h,f){this._pointerConditions.button=this._currentActiveButton;const _=this.camera.movement.input.resolveInteraction("pointer",this._pointerConditions);if(!_||_.interaction!=="rotate")return;const m=_.sensitivityX??_.sensitivity??1/this.angularSensibility,g=_.sensitivityY??_.sensitivity??1/this.angularSensibility;this.camera.cameraRotation.y+=h*m,this.camera.cameraRotation.x+=f*g}constructor(h=!0){this.touchEnabled=h,this.buttons=N(this,t,[0,1,2]),this.angularSensibility=(N(this,i),N(this,n,2e3)),this._pointerInput=N(this,o),this._previousPosition=null,this.onPointerMovedObservable=new Me,this._allowCameraRotation=!0,this._currentActiveButton=-1,this._activePointerId=-1,this._pointerConditions={}}attachControl(h){h=bt.BackCompatCameraNoPreventDefault(arguments);
311const f=this.camera.getEngine(),_=f.getInputElement();this._pointerInput||(this._pointerInput=m=>{const g=m.event,x=g.pointerType==="touch";if(!this.touchEnabled&&x||m.type!==ht.POINTERMOVE&&this.buttons.indexOf(g.button)===-1)return;const y=g.target;if(m.type===ht.POINTERDOWN){if(x&&this._activePointerId!==-1||!x&&this._currentActiveButton!==-1)return;this._activePointerId=g.pointerId;try{y?.setPointerCapture(g.pointerId)}catch{}this._currentActiveButton===-1&&(this._currentActiveButton=g.button),this._previousPosition={x:g.clientX,y:g.clientY},h||(g.preventDefault(),_&&_.focus()),f.isPointerLock&&this._onMouseMove&&this._onMouseMove(m.event)}else if(m.type===ht.POINTERUP){if(x&&this._activePointerId!==g.pointerId||!x&&this._currentActiveButton!==g.button)return;try{y?.releasePointerCapture(g.pointerId)}catch{}this._currentActiveButton=-1,this._previousPosition=null,h||g.preventDefault(),this._activePointerId=-1}else if(m.type===ht.POINTERMOVE&&(this._activePointerId===g.pointerId||!x)){if(f.isPointerLock&&this._onMouseMove)this._onMouseMove(m.event);else if(this._previousPosition){const b=this.camera._calculateHandednessMultiplier(),v=(g.clientX-this._previousPosition.x)*b,E=(g.clientY-this._previousPosition.y)*b;this._allowCameraRotation&&this._applyPointerRotation(v,E),this.onPointerMovedObservable.notifyObservers({offsetX:v,offsetY:E}),this._previousPosition={x:g.clientX,y:g.clientY},h||g.preventDefault()}}}),this._onMouseMove=m=>{if(!f.isPointerLock)return;const g=this.camera._calculateHandednessMultiplier();this._applyPointerRotation(m.movementX*g,m.movementY*g),this._previousPosition=null,h||m.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,ht.POINTERDOWN|ht.POINTERUP|ht.POINTERMOVE),_&&(this._contextMenuBind=m=>this.onContextMenu(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 c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ce()],s=[ce()],ee(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:c},t,i),ee(null,null,s,{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:c},n,o),c&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})})(),a})();il.FreeCameraMouseInput=X1;let WI=(()=>{var a;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[];return a=class{constructor(){this.wheelPrecisionX=N(this,t,3),this.wheelPrecisionY=(N(this,i),N(this,n,3)),this.wheelPrecisionZ=(N(this,o),N(this,h,3)),this.onChangedObservable=(N(this,f),new Me),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}attachControl(m){m=bt.BackCompatCameraNoPreventDefault(arguments),this._wheel=g=>{if(g.type!==ht.POINTERWHEEL)return;const x=g.event,y=x.deltaMode===qc.DOM_DELTA_LINE?this._ffMultiplier:1;this._wheelDeltaX+=this.wheelPrecisionX*y*x.deltaX/this._normalize,this._wheelDeltaY-=this.wheelPrecisionY*y*x.deltaY/this._normalize,this._wheelDeltaZ+=this.wheelPrecisionZ*y*x.deltaZ/this._normalize,x.preventDefault&&(m||x.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,ht.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 _=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ce()],s=[ce()],c=[ce()],ee(null,null,e,{kind:"field",name:"wheelPrecisionX",static:!1,private:!1,access:{has:m=>"wheelPrecisionX"in m,get:m=>m.wheelPrecisionX,set:(m,g)=>{m.wheelPrecisionX=g}},metadata:_},t,i),ee(null,null,s,{kind:"field",name:"wheelPrecisionY",static:!1,private:!1,access:{has:m=>"wheelPrecisionY"in m,get:m=>m.wheelPrecisionY,set:(m,g)=>{m.wheelPrecisionY=g}},metadata:_},n,o),ee(null,null,c,{kind:"field",name:"wheelPrecisionZ",static:!1,private:!1,access:{has:m=>"wheelPrecisionZ"in m,get:m=>m.wheelPrecisionZ,set:(m,g)=>{m.wheelPrecisionZ=g}},metadata:_},h,f),_&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_})})(),a})();var Ut;(function(a){a[a.MoveRelative=0]="MoveRelative",a[a.RotateRelative=1]="RotateRelative",a[a.MoveScene=2]="MoveScene"})(Ut||(Ut={}));let Y1=(()=>{var a;let e=WI,t=[],i,s,n,o,c,h,f,_,m;return a=class extends e{constructor(){super(...arguments),this.camera=N(this,t),this._moveRelative=D.Zero(),this._rotateRelative=D.Zero(),this._moveScene=D.Zero(),this._wheelXAction=Ut.MoveRelative,this._wheelXActionCoordinate=0,this._wheelYAction=Ut.MoveRelative,this._wheelYActionCoordinate=2,this._wheelZAction=null,this._wheelZActionCoordinate=null}getClassName(){return"FreeCameraMouseWheelInput"}
311set wheelXMoveRelative(x){x===null&&this._wheelXAction!==Ut.MoveRelative||(this._wheelXAction=Ut.MoveRelative,this._wheelXActionCoordinate=x)}get wheelXMoveRelative(){return this._wheelXAction!==Ut.MoveRelative?null:this._wheelXActionCoordinate}set wheelYMoveRelative(x){x===null&&this._wheelYAction!==Ut.MoveRelative||(this._wheelYAction=Ut.MoveRelative,this._wheelYActionCoordinate=x)}get wheelYMoveRelative(){return this._wheelYAction!==Ut.MoveRelative?null:this._wheelYActionCoordinate}set wheelZMoveRelative(x){x===null&&this._wheelZAction!==Ut.MoveRelative||(this._wheelZAction=Ut.MoveRelative,this._wheelZActionCoordinate=x)}get wheelZMoveRelative(){return this._wheelZAction!==Ut.MoveRelative?null:this._wheelZActionCoordinate}set wheelXRotateRelative(x){x===null&&this._wheelXAction!==Ut.RotateRelative||(this._wheelXAction=Ut.RotateRelative,this._wheelXActionCoordinate=x)}get wheelXRotateRelative(){return this._wheelXAction!==Ut.RotateRelative?null:this._wheelXActionCoordinate}set wheelYRotateRelative(x){x===null&&this._wheelYAction!==Ut.RotateRelative||(this._wheelYAction=Ut.RotateRelative,this._wheelYActionCoordinate=x)}get wheelYRotateRelative(){return this._wheelYAction!==Ut.RotateRelative?null:this._wheelYActionCoordinate}
311set wheelZRotateRelative(x){x===null&&this._wheelZAction!==Ut.RotateRelative||(this._wheelZAction=Ut.RotateRelative,this._wheelZActionCoordinate=x)}get wheelZRotateRelative(){return this._wheelZAction!==Ut.RotateRelative?null:this._wheelZActionCoordinate}set wheelXMoveScene(x){x===null&&this._wheelXAction!==Ut.MoveScene||(this._wheelXAction=Ut.MoveScene,this._wheelXActionCoordinate=x)}get wheelXMoveScene(){return this._wheelXAction!==Ut.MoveScene?null:this._wheelXActionCoordinate}set wheelYMoveScene(x){x===null&&this._wheelYAction!==Ut.MoveScene||(this._wheelYAction=Ut.MoveScene,this._wheelYActionCoordinate=x)}get wheelYMoveScene(){return this._wheelYAction!==Ut.MoveScene?null:this._wheelYActionCoordinate}set wheelZMoveScene(x){x===null&&this._wheelZAction!==Ut.MoveScene||(this._wheelZAction=Ut.MoveScene,this._wheelZActionCoordinate=x)}get wheelZMoveScene(){return this._wheelZAction!==Ut.MoveScene?null:this._wheelZActionCoordinate}checkInputs(){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 x=se.Zero();this.camera.getViewMatrix().invertToRef(x);const y=D.Zero();D.TransformNormalToRef(this._moveRelative,x,y),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(y),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(x,y,b){if(x===0||y===null||b===null)return;let v=null;switch(y){case Ut.MoveRelative:v=this._moveRelative;break;case Ut.RotateRelative:v=this._rotateRelative;break;case Ut.MoveScene:v=this._moveScene;break}switch(b){case 0:v.set(x,0,0);break;case 1:v.set(0,x,0);break;case 2:v.set(0,0,x);break}}},(()=>{const g=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[ce()],s=[ce()],n=[ce()],o=[ce()],c=[ce()],h=[ce()],f=[ce()],_=[ce()],m=[ce()],ee(a,null,i,{kind:"setter",name:"wheelXMoveRelative",static:!1,private:!1,access:{has:x=>"wheelXMoveRelative"in x,set:(x,y)=>{x.wheelXMoveRelative=y}},metadata:g},null,t),ee(a,null,s,{kind:"setter",name:"wheelYMoveRelative",static:!1,private:!1,access:{has:x=>"wheelYMoveRelative"in x,set:(x,y)=>{x.wheelYMoveRelative=y}},metadata:g},null,t),ee(a,null,n,{kind:"setter",name:"wheelZMoveRelative",static:!1,private:!1,access:{has:x=>"wheelZMoveRelative"in x,set:(x,y)=>{x.wheelZMoveRelative=y}},metadata:g},null,t),ee(a,null,o,{kind:"setter",name:"wheelXRotateRelative",static:!1,private:!1,access:{has:x=>"wheelXRotateRelative"in x,set:(x,y)=>{x.wheelXRotateRelative=y}},metadata:g},null,t),ee(a,null,c,{kind:"setter",name:"wheelYRotateRelative",static:!1,private:!1,access:{has:x=>"wheelYRotateRelative"in x,set:(x,y)=>{x.wheelYRotateRelative=y}},metadata:g},null,t),ee(a,null,h,{kind:"setter",name:"wheelZRotateRelative",static:!1,private:!1,access:{has:x=>"wheelZRotateRelative"in x,set:(x,y)=>{x.wheelZRotateRelative=y}},metadata:g},null,t),ee(a,null,f,{kind:"setter",name:"wheelXMoveScene",static:!1,private:!1,access:{has:x=>"wheelXMoveScene"in x,set:(x,y)=>{x.wheelXMoveScene=y}},metadata:g},null,t),ee(a,null,_,{kind:"setter",name:"wheelYMoveScene",static:!1,private:!1,access:{has:x=>"wheelYMoveScene"in x,set:(x,y)=>{x.wheelYMoveScene=y}},metadata:g},null,t),ee(a,null,m,{kind:"setter",name:"wheelZMoveScene",static:!1,private:!1,access:{has:x=>"wheelZMoveScene"in x,set:(x,y)=>{x.wheelZMoveScene=y}},metadata:g},null,t),g&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g})})(),a})();il.FreeCameraMouseWheelInput=Y1;let q1=(()=>{var a;let e,t=[],i=[],s,n=[],o=[];return a=class{constructor(h=!1){this.allowMouse=h,this.touchAngularSensibility=N(this,t,2e5),this.touchMoveSensibility=(N(this,i),N(this,n,250)),this.singleFingerRotate=(N(this,o),!1),this._offsetX=null,this._offsetY=null,this._pointerPressed=new Array,this._isSafari=bt.IsSafari()}attachControl(h){h=bt.BackCompatCameraNoPreventDefault(arguments);let f=null;if(this._pointerInput===void 0&&(this._onLostFocus=()=>{this._offsetX=null,this._offsetY=null},this._pointerInput=_=>{const m=_.event,g=m.pointerType==="mouse"||this._isSafari&&typeof m.pointerType>"u";if(!(!this.allowMouse&&g)){if(_.type===ht.POINTERDOWN){if(h||m.preventDefault(),this._pointerPressed.push(m.pointerId),this._pointerPressed.length!==1)return;f={x:m.clientX,y:m.clientY}}else if(_.type===ht.POINTERUP){h||m.preventDefault();const x=this._pointerPressed.indexOf(m.pointerId);
311if(x===-1||(this._pointerPressed.splice(x,1),x!=0))return;f=null,this._offsetX=null,this._offsetY=null}else if(_.type===ht.POINTERMOVE){if(h||m.preventDefault(),!f||this._pointerPressed.indexOf(m.pointerId)!=0)return;this._offsetX=m.clientX-f.x,this._offsetY=-(m.clientY-f.y)}}}),this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,ht.POINTERDOWN|ht.POINTERUP|ht.POINTERMOVE),this._onLostFocus){const m=this.camera.getEngine().getInputElement();m&&m.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,_=f.getEntry("touch","rotate"),m=f.getEntry("touch","translate"),g=h._calculateHandednessMultiplier(),x=this.singleFingerRotate&&this._pointerPressed.length===1||!this.singleFingerRotate&&this._pointerPressed.length>1;if(_){const y=_.sensitivity??1/this.touchAngularSensibility;h.cameraRotation.y=this._offsetX*g*y,x&&(h.cameraRotation.x=-(this._offsetY*g)*y)}if(!x&&m){const y=h._computeLocalCameraSpeed(),b=m.sensitivity??(this.touchMoveSensibility!==0?1/this.touchMoveSensibility:0),v=ge.Vector3[0];v.copyFromFloats(0,0,y*this._offsetY*b),se.RotationYawPitchRollToRef(h.rotation.y,h.rotation.x,0,h._cameraRotationMatrix),D.TransformCoordinatesToRef(v,h._cameraRotationMatrix,v),h.cameraDirection.addInPlace(v)}}getClassName(){return"FreeCameraTouchInput"}getSimpleName(){return"touch"}},(()=>{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ce()],s=[ce()],ee(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:c},t,i),ee(null,null,s,{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:c},n,o),c&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})})(),a})();il.FreeCameraTouchInput=q1;var pT,xT,bT;class Bf extends jI{constructor(e){super(e),this._mouseInput=null,this._mouseWheelInput=null}addKeyboard(){return this.add(new W1),this}addMouse(e=!0){return this._mouseInput||(this._mouseInput=new X1(e),this.add(this._mouseInput)),this}removeMouse(){return this._mouseInput&&this.remove(this._mouseInput),this}addMouseWheel(){return this._mouseWheelInput||(this._mouseWheelInput=new Y1,this.add(this._mouseWheelInput)),this}removeMouseWheel(){return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this}addTouch(){return this.add(new q1),this}clear(){super.clear(),this._mouseInput=null}}(pT=Bf.prototype).addDeviceOrientation??(pT.addDeviceOrientation=Xe("FreeCameraInputsManager","addDeviceOrientation"));(xT=Bf.prototype).addVirtualJoystick??(xT.addVirtualJoystick=Xe("FreeCameraInputsManager","addVirtualJoystick"));(bT=Bf.prototype).addGamepad??(bT.addGamepad=Xe("FreeCameraInputsManager","addGamepad"));let K1=(()=>{var a;let e=HI,t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],m,g=[],x=[];return a=class extends e{get angularSensibility(){const b=this.inputs.attached.mouse;return b?b.angularSensibility:0}set angularSensibility(b){const v=this.inputs.attached.mouse;v&&(v.angularSensibility=b)}get keysUp(){const b=this.inputs.attached.keyboard;return b?b.keysUp:[]}set keysUp(b){const v=this.inputs.attached.keyboard;v&&(v.keysUp=b)}get keysUpward(){const b=this.inputs.attached.keyboard;return b?b.keysUpward:[]}set keysUpward(b){const v=this.inputs.attached.keyboard;v&&(v.keysUpward=b)}get keysDown(){const b=this.inputs.attached.keyboard;return b?b.keysDown:[]}set keysDown(b){const v=this.inputs.attached.keyboard;v&&(v.keysDown=b)}get keysDownward(){const b=this.inputs.attached.keyboard;return b?b.keysDownward:[]}set keysDownward(b){const v=this.inputs.attached.keyboard;v&&(v.keysDownward=b)}get keysLeft(){const b=this.inputs.attached.keyboard;return b?b.keysLeft:[]}set keysLeft(b){const v=this.inputs.attached.keyboard;v&&(v.keysLeft=b)}get keysRight(){const b=this.inputs.attached.keyboard;return b?b.keysRight:[]}set keysRight(b){const v=this.inputs.attached.keyboard;v&&(v.keysRight=b)}get keysRotateLeft(){const b=this.inputs.attached.keyboard;return b?b.keysRotateLeft:[]}set keysRotateLeft(b){const v=this.inputs.attached.keyboard;v&&(v.keysRotateLeft=b)}get keysRotateRight(){const b=this.inputs.attached.keyboard;return b?b.keysRotateRight:[]}set keysRotateRight(b){const v=this.inputs.attached.keyboard;v&&(v.keysRotateRight=b)}
311get keysRotateUp(){const b=this.inputs.attached.keyboard;return b?b.keysRotateUp:[]}set keysRotateUp(b){const v=this.inputs.attached.keyboard;v&&(v.keysRotateUp=b)}get keysRotateDown(){const b=this.inputs.attached.keyboard;return b?b.keysRotateDown:[]}set keysRotateDown(b){const v=this.inputs.attached.keyboard;v&&(v.keysRotateDown=b)}constructor(b,v,E,R=!0){super(b,v,E,R),this.ellipsoid=N(this,i,new D(.5,1,.5)),this.ellipsoidOffset=(N(this,s),N(this,o,new D(0,0,0))),this.checkCollisions=(N(this,c),N(this,f,!1)),this.applyGravity=(N(this,_),N(this,g,!1)),this.inputs=N(this,x),this._needMoveForGravity=!1,this._oldPosition=D.Zero(),this._diffPosition=D.Zero(),this._newPosition=D.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(C,O,M=null)=>{this._newPosition.copyFrom(O),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>Ie.CollisionsEpsilon&&(this.position.addToRef(this._diffPosition,this._deferredPositionUpdate),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate),this.onCollide&&M&&this.onCollide(M))},this.inputs=new Bf(this),this.inputs.addKeyboard().addMouse()}attachControl(b,v){v=bt.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(v)}detachControl(){this.inputs.detachElement(),this.cameraDirection=new D(0,0,0),this.cameraRotation=new Fe(0,0)}get collisionMask(){return this._collisionMask}set collisionMask(b){this._collisionMask=isNaN(b)?-1:b}_collideWithWorld(b){let v;this.parent?v=D.TransformCoordinates(this.position,this.parent.getWorldMatrix()):v=this.position,v.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 R=b;this.applyGravity&&(R=b.add(this.getScene().gravity)),E.getNewPosition(this._oldPosition,R,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){this._localDirection||(this._localDirection=D.Zero(),this._transformedDirection=D.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(b){this._needMoveForGravity=b}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 y=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[ua()],n=[ua()],h=[ce()],m=[ce()],ee(null,null,t,{kind:"field",name:"ellipsoid",static:!1,private:!1,access:{has:b=>"ellipsoid"in b,get:b=>b.ellipsoid,set:(b,v)=>{b.ellipsoid=v}},metadata:y},i,s),ee(null,null,n,{kind:"field",name:"ellipsoidOffset",static:!1,private:!1,access:{has:b=>"ellipsoidOffset"in b,get:b=>b.ellipsoidOffset,set:(b,v)=>{b.ellipsoidOffset=v}},metadata:y},o,c),ee(null,null,h,{kind:"field",name:"checkCollisions",static:!1,private:!1,access:{has:b=>"checkCollisions"in b,get:b=>b.checkCollisions,set:(b,v)=>{b.checkCollisions=v}},metadata:y},f,_),ee(null,null,m,{kind:"field",name:"applyGravity",static:!1,private:!1,access:{has:b=>"applyGravity"in b,get:b=>b.applyGravity,set:(b,v)=>{b.applyGravity=v}},metadata:y},g,x),y&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})})(),a})(),yT=!1;function XI(){yT||(yT=!0,Lr("BABYLON.FreeCamera",K1))}XI();AC();KD();const Ds={navy:rt.FromHexString("#07111f"),teal:rt.FromHexString("#42d9c8"),gold:rt.FromHexString("#c7a86b"),red:rt.FromHexString("#c44f5b"),dim:rt.FromHexString("#263443")};function H_(a,e,t){const i=new tl(e,a);return i.diffuseColor=t.scale(.18),i.emissiveColor=t,i.specularColor=Ds.gold.scale(.25),i.disableLighting=!0,i}async function YI(a,e,t){const i=new Ae(a);i.clearColor=new _t(0,0,0,0),i.skipPointerMovePicking=!0;const s=new K1("legal-camera",new D(0,0,-10),i);s.mode=ds.ORTHOGRAPHIC_CAMERA,s.orthoLeft=-8,s.orthoRight=8,s.orthoTop=4.5,s.orthoBottom=-4.5,s.setTarget(D.Zero()),s.inputs.clear();const n=Qu.CreatePlane("desk-vignette",{width:16,height:9},i);n.position.z=-.05;
311const o=new tl("vignette-mat",i);o.diffuseColor=Ds.navy,o.emissiveColor=Ds.navy.scale(.42),o.alpha=.36,o.disableLighting=!0,n.material=o;const c=Qu.CreatePlane("legal-rail",{width:10.8,height:.035},i);c.position=new D(0,-3.65,-.14),c.material=H_(i,"rail-material",Ds.gold.scale(.7));const h=[],f=[];for(let x=0;x<6;x+=1){const y=-4.5+x*1.8,b=Qu.CreateDisc(`node-rim-${x}`,{radius:.36,tessellation:48},i);b.position=new D(y,-3.65,-.2);const v=H_(i,`node-rim-material-${x}`,Ds.gold);b.material=v;const E=Qu.CreateDisc(`node-${x}`,{radius:.28,tessellation:48},i);E.position=new D(y,-3.65,-.23);const R=H_(i,`node-material-${x}`,Ds.dim);E.material=R,h.push(E),f.push(R)}let _=[0,1];const m=x=>{_=x.currentNode?.nodeIndices??[];const y=x.mode==="result"?6:x.decisionIndex*2;f.forEach((b,v)=>{x.criticalViolations.length>0&&v>=y-2&&v<y?(b.emissiveColor=Ds.red,b.diffuseColor=Ds.red.scale(.2)):v<y||x.mode==="result"?(b.emissiveColor=Ds.gold,b.diffuseColor=Ds.gold.scale(.2)):_.includes(v)?(b.emissiveColor=Ds.teal,b.diffuseColor=Ds.teal.scale(.24)):(b.emissiveColor=Ds.dim,b.diffuseColor=Ds.dim.scale(.18))})};m(t);let g=0;return i.onBeforeRenderObservable.add(()=>{const x=a.getRenderWidth()/Math.max(1,a.getRenderHeight());Math.abs(g-x)>.001&&(g=x,s.orthoLeft=-4.5*x,s.orthoRight=4.5*x);const y=performance.now()*.0022;h.forEach((b,v)=>{const E=_.includes(v)?1+Math.sin(y+v*.6)*.08:1;b.scaling.setAll(E)})}),e.setAttribute("aria-label","依法執行戰術證據桌背景"),{scene:i,setSnapshot:m,dispose(){i.dispose()}}}const qI=["資訊取得","合理懷疑","措施強度","程序告知","比例原則","證據能力"],Z1="execute-law.sound-enabled.v1",Q1="execute-law.sound-volume.v1";function KI(){try{return window.localStorage.getItem(Z1)!=="off"}catch{return!0}}function ZI(){try{const a=window.localStorage.getItem(Q1);if(a===null)return .42;const e=Number(a);return Number.isFinite(e)&&e>=0&&e<=1?e:.42}catch{return .42}}const $1=Ge.createContext(null);function QI(){const a=window.AudioContext??window.webkitAudioContext;return a?new a:null}function $I(a){const e=a.sampleRate*2,t=a.createBuffer(1,e,a.sampleRate),i=t.getChannelData(0);for(let s=0;s<e;s+=1)i[s]=(Math.random()*2-1)*.5;return t}function JI(a,e,t){if(t==="silent")return()=>{};const i=a.createGain();i.gain.setValueAtTime(1e-4,a.currentTime),i.connect(e),i.gain.exponentialRampToValueAtTime(1,a.currentTime+.7);const s=[],n=[i],o=(c,h,f,_=i)=>{const m=a.createOscillator(),g=a.createGain();return m.type=h,m.frequency.value=c,g.gain.value=f,m.connect(g),g.connect(_),m.start(),s.push(m),n.push(m,g),{oscillator:m,gain:g}};if(t==="landing"){const c=a.createBiquadFilter();c.type="lowpass",c.frequency.value=180,c.Q.value=.8,c.connect(i),n.push(c),o(55,"sine",.027,c),o(82.41,"triangle",.012,c);const h=o(.075,"sine",.008);h.gain.disconnect(),h.gain.gain.value=.007,h.gain.connect(i.gain)}if(t==="judgment"){const c=a.createBiquadFilter();c.type="lowpass",c.frequency.value=230,c.Q.value=1.5,c.connect(i),n.push(c),o(46.25,"sine",.036,c),o(69.3,"triangle",.015,c),o(92.5,"sine",.009,c);const h=a.createOscillator(),f=a.createGain();h.frequency.value=.11,f.gain.value=.006,h.connect(f),f.connect(i.gain),h.start(),s.push(h),n.push(h,f)}if(t==="career"){const c=a.createBufferSource(),h=a.createBiquadFilter(),f=a.createGain();c.buffer=$I(a),c.loop=!0,h.type="bandpass",h.frequency.value=720,h.Q.value=.5,f.gain.value=.026,c.connect(h),h.connect(f),f.connect(i),c.start(),s.push(c),n.push(c,h,f);const _=a.createBiquadFilter();_.type="lowpass",_.frequency.value=180,_.connect(i),n.push(_),o(73.42,"sine",.025,_),o(110,"triangle",.01,_);const m=a.createOscillator(),g=a.createGain();m.frequency.value=.065,g.gain.value=95,m.connect(g),g.connect(h.frequency),m.start(),s.push(m),n.push(m,g)}return()=>{const c=a.currentTime;i.gain.cancelScheduledValues(c),i.gain.setTargetAtTime(1e-4,c,.08),window.setTimeout(()=>{s.forEach(h=>{try{h.stop()}catch{}}),n.forEach(h=>h.disconnect())},420)}}function eP({children:a}){const[e,t]=Ge.useState(KI),[i,s]=Ge.useState(ZI),[n,o]=Ge.useState("silent"),[c,h]=Ge.useState(!1),f=Ge.useRef(null),_=Ge.useRef(null),m=Ge.useCallback(()=>{const E=f.current??QI();if(!E)return null;if(f.current=E,!_.current){const R=E.createGain();R.gain.value=e?i:1e-4,R.connect(E.destination),_.current=R}return E.resume(),h(!0),E},[e,i]),g=Ge.useCallback(()=>{e&&m()},[e,m]);Ge.useEffect(()=>{const E=()=>g();return window.addEventListener("pointerdown",E,{capture:!0}),window.addEventListener("keydown",E,{capture:!0}),()=>{window.removeEventListener("pointerdown",E,{capture:!0}),window.removeEventListener("keydown",E,{capture:!0})}},[g]),Ge.useEffect(()=>{const E=_.current,R=f.current;!E||!R||(E.gain.cancelScheduledValues(R.currentTime),E.gain.setTargetAtTime(e?Math.max(1e-4,i):1e-4,R.currentTime,.04))},[e,i]),Ge.useEffect(()=>{const E=f.current,R=_.current;if(!(!c||!e||!E||!R))return JI(E,R,n)},[e,n,c]),Ge.useEffect(()=>()=>{f.current&&f.current.close()},[]);const x=Ge.useCallback(E=>{t(E);try{window.localStorage.setItem(Z1,E?"on":"off")}catch{}E&&m()},[m]),y=Ge.useCallback(E=>{const R=Math.max(0,Math.min(1,E));s(R);try{window.localStorage.setItem(Q1,String(R))}catch{}},[]),b=Ge.useCallback((E,R=.052)=>{if(!e)return;const C=m(),O=_.current;if(!C||!O)return;const M=C.currentTime+.015;
311E.forEach((I,P)=>{const L=C.createOscillator(),V=C.createGain();L.type=P%2===1?"triangle":"sine",L.frequency.setValueAtTime(I.f,M+I.t),V.gain.setValueAtTime(1e-4,M+I.t),V.gain.exponentialRampToValueAtTime(R,M+I.t+.025),V.gain.exponentialRampToValueAtTime(1e-4,M+I.t+I.d),L.connect(V),V.connect(O),L.start(M+I.t),L.stop(M+I.t+I.d+.03)})},[e,m]),v=Ge.useMemo(()=>({enabled:e,volume:i,scene:n,unlocked:c,setEnabled:x,setVolume:y,setScene:o,unlock:g,playNotes:b}),[e,b,n,x,y,g,c,i]);return A.jsx($1.Provider,{"data-loc":"client/src/contexts/SoundscapeContext.tsx:294",value:v,children:a})}function Lf(){const a=Ge.useContext($1);if(!a)throw new Error("useSoundscape must be used inside SoundscapeProvider");return a}const tP={silent:"音訊待命",landing:"司法中庭聲景",judgment:"最高法院牌組聲景",career:"夜間勤務牌組聲景"};function Nm({variant:a="compact"}){const{enabled:e,volume:t,scene:i,setEnabled:s,setVolume:n,unlock:o}=Lf(),c=Math.round(t*100),h=e?t<.5?tS:iS:sS;return A.jsxs("div",{"data-loc":"client/src/components/AudioControl.tsx:17",className:`audio-control audio-control-${a}`,role:"group","aria-label":"環境音效控制",children:[A.jsxs("button",{"data-loc":"client/src/components/AudioControl.tsx:18",type:"button","aria-label":e?"關閉全部音效,設定會保留":"開啟全部音效,設定會保留","aria-pressed":e,onClick:()=>{s(!e),e||o()},children:[A.jsx(h,{"data-loc":"client/src/components/AudioControl.tsx:27",size:a==="landing"?17:16}),A.jsx("span",{"data-loc":"client/src/components/AudioControl.tsx:28",children:e?"SOUND ON":"SOUND OFF"})]}),A.jsxs("label",{"data-loc":"client/src/components/AudioControl.tsx:30",className:"audio-volume-control",children:[A.jsx("span",{"data-loc":"client/src/components/AudioControl.tsx:31",children:tP[i]}),A.jsx("input",{"data-loc":"client/src/components/AudioControl.tsx:32",type:"range",min:"0",max:"100",step:"1",value:c,"aria-label":"背景與介面音效音量","aria-valuetext":`${c}%`,onChange:f=>{const _=Number(f.currentTarget.value)/100;n(_),e||s(!0),o()}}),A.jsxs("output",{"data-loc":"client/src/components/AudioControl.tsx:47",children:[String(c).padStart(2,"0"),"%"]})]})]})}const J1="execute-law.player-progress.v1",um={version:1,judgments:{},career:null,updatedAt:null};function iP(a){if(!a||typeof a!="object")return{...um,judgments:{}};const e=a;return{version:1,judgments:e.judgments&&typeof e.judgments=="object"?e.judgments:{},career:e.career&&typeof e.career=="object"?e.career:null,updatedAt:typeof e.updatedAt=="number"?e.updatedAt:null}}function Um(){try{const a=window.localStorage.getItem(J1);return a?iP(JSON.parse(a)):{...um,judgments:{}}}catch{return{...um,judgments:{}}}}function eE(a){try{window.localStorage.setItem(J1,JSON.stringify(a))}catch{}return a}function sP(a,e,t){const i=Um(),s=i.judgments[a];return eE({...i,judgments:{...i.judgments,[a]:{bestScore:Math.max(s?.bestScore??0,e),lowestRisk:Math.min(s?.lowestRisk??100,t),completions:(s?.completions??0)+1}},updatedAt:Date.now()})}const TT={S:4,A:3,B:2,C:1};function rP(a,e){const t=Um(),i=t.career,s=!i||(TT[e]??0)>(TT[i.bestGrade]??0)?e:i.bestGrade;return eE({...t,career:{bestScore:Math.max(i?.bestScore??0,a),bestGrade:s,completions:(i?.completions??0)+1},updatedAt:Date.now()})}function nP(a){const e=Object.keys(a.judgments).length,t=!!a.career?.completions;return e>=4&&t?"master":e>=3||e>=1&&(a.career?.bestScore??0)>=80?"advocate":e>=1||t?"field":"uninitiated"}const aP={uninitiated:{label:"案件環境快速恢復",status:"歡迎返回,案件已喚醒",level:0},field:{label:"實務牌序已恢復",status:"現場紀錄已載入",level:1},advocate:{label:"攻防戰績已恢復",status:"法庭連擊資料已載入",level:2},master:{label:"全牌組通關者回歸",status:"最高權限牌桌已喚醒",level:3}},oP=[{key:"authority",label:"授權戰力",short:"授權"},{key:"procedure",label:"程序戰力",short:"程序"},{key:"proportionality",label:"比例防線",short:"比例"},{key:"evidence",label:"證據戰力",short:"證據"}];function lP({snapshot:a}){return A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:48",className:"score-meters","aria-label":"法律戰力儀表",children:oP.map(e=>A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:50",className:"score-row",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:51",className:"score-label desktop-only",children:e.label}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:52",className:"score-label mobile-only",children:e.short}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:53",className:"score-track",children:A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:54",className:`score-fill score-${e.key}`,style:{width:`${Math.min(100,a.scores[e.key]/16*100)}%`}})}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:59",className:"score-number",children:a.scores[e.key]})]},e.key))})}function vT({snapshot:a}){return A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:68",className:"battle-hud","aria-label":"目前法庭戰局",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:69",children:[A.jsx(Za,{"data-loc":"client/src/components/GameCanvas.tsx:69",size:14}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:69",children:"法庭積分"}),A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:69",children:a.battleScore})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:70",className:a.risk>=50?"is-danger":"",children:[A.jsx(nl,{"data-loc":"client/src/components/GameCanvas.tsx:70",size:14}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:70",children:"程序風險"}),A.jsxs("strong",{"data-loc":"client/src/components/GameCanvas.tsx:70",children:[a.risk,"%"]})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:71",className:a.combo>=3?"is-hot":"",children:[A.jsx(Ka,{"data-loc":"client/src/components/GameCanvas.tsx:71",size:14}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:71",children:"攻防連擊"}),A.jsxs("strong",{"data-loc":"client/src/components/GameCanvas.tsx:71",children:["×",a.
311combo]})]})]})}function cP({snapshot:a,open:e,onClose:t,onSelect:i}){return A.jsxs("aside",{"data-loc":"client/src/components/GameCanvas.tsx:88",className:`case-rail ${e?"is-open":""}`,"aria-label":"案件牌組索引",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:89",className:"rail-title",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:90",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:91",children:"最高法院任務牌組"}),A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:92",children:"SELECT BATTLE"})]}),A.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:94",className:"icon-button mobile-only",onClick:t,"aria-label":"關閉案件索引",children:A.jsx(ZT,{"data-loc":"client/src/components/GameCanvas.tsx:95",size:18})})]}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:98",className:"case-list",children:Ya.map((s,n)=>A.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:100",className:`case-tab ${n===a.caseIndex?"active":""}`,onClick:()=>i(n),style:{"--case-accent":s.accent},children:[A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:106",className:"case-index",children:["0",n+1]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:107",className:"case-tab-copy",children:[A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:108",children:s.shortTitle}),A.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:109",children:s.docket.replace("最高法院","")})]}),A.jsx(Wa,{"data-loc":"client/src/components/GameCanvas.tsx:111",size:15})]},s.id))}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:115",className:"rail-caution",children:[A.jsx(Mf,{"data-loc":"client/src/components/GameCanvas.tsx:116",size:16}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:117",children:"真實裁判是規則書,不是答案牌。後見結果不能補正先前權限。"})]})]})}function hP({snapshot:a}){const e=a.currentNode?.nodeIndices??[],t=a.mode==="result"?6:a.decisionIndex*2;return A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:127",className:"node-ribbon","aria-label":"六張法律規則牌",children:qI.map((i,s)=>{const n=s<t||a.mode==="result",o=e.includes(s);return A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:132",className:`node-chip ${n?"completed":""} ${o?"current":""}`,children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:136",children:s+1}),A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:137",children:i})]},i)})})}function uP({snapshot:a,onStart:e}){return A.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:153",className:"mission-panel intro-panel card-deck-intro",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:154",className:"panel-kicker",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:155",className:"status-dot"})," COURT BATTLE BRIEFING · ",a.currentCase.year]}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:157",className:"docket-line",children:a.currentCase.docket}),A.jsx("h1",{"data-loc":"client/src/components/GameCanvas.tsx:158",children:a.currentCase.title}),A.jsx("h2",{"data-loc":"client/src/components/GameCanvas.tsx:159",className:"mission-subtitle",children:"三回合法庭攻防:打出法律牌,建立可受法院檢驗的程序連擊"}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:162",className:"case-summary",children:a.currentCase.summary}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:163",className:"deck-rule-row","aria-label":"牌局規則",children:[A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:164",children:[A.jsx(Cf,{"data-loc":"client/src/components/GameCanvas.tsx:164",size:13})," 3 回合"]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:165",children:[A.jsx(Za,{"data-loc":"client/src/components/GameCanvas.tsx:165",size:13})," 即時計分"]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:166",children:[A.jsx(nl,{"data-loc":"client/src/components/GameCanvas.tsx:166",size:13})," 風險累積"]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:167",children:[A.jsx(Ka,{"data-loc":"client/src/components/GameCanvas.tsx:167",size:13})," 合法連擊"]})]}),A.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:169",className:"primary-action",onClick:e,children:[A.jsx(JR,{"data-loc":"client/src/components/GameCanvas.tsx:170",size:18,fill:"
311currentColor"}),"啟動法庭牌局",A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:172",className:"key-hint",children:"ENTER"})]}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:174",className:"fine-print",children:"教育用途。真實案件應依完整卷證、行為時法規及專業法律意見判斷。"})]})}function fP({snapshot:a,onChoose:e}){const t=a.currentNode;return t?A.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:190",className:"mission-panel decision-panel court-hand-panel",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:191",className:"decision-topline",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:192",children:[A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:193",className:"panel-kicker",children:t.kicker}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:194",className:"turn-counter",children:["ROUND 0",a.decisionIndex+1," / 03"]})]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:196",className:"live-badge",children:[A.jsx(jR,{"data-loc":"client/src/components/GameCanvas.tsx:196",size:13})," 你的出牌回合"]})]}),A.jsx("h2",{"data-loc":"client/src/components/GameCanvas.tsx:198",children:t.prompt}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:199",className:"known-facts",children:t.knownFacts.map(i=>A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:201",children:[A.jsx(gm,{"data-loc":"client/src/components/GameCanvas.tsx:201",size:13}),i]},i))}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:204",className:"contest-line",children:[A.jsx(Cf,{"data-loc":"client/src/components/GameCanvas.tsx:205",size:16}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:206",children:t.contest})]}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:208",className:"option-grid legal-hand","aria-label":"本回合手牌",children:t.options.map((i,s)=>A.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:210",className:`decision-option legal-card tone-${i.tone}`,onClick:()=>e(i.id),children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:215",className:"option-key",children:s+1}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:216",className:"card-type",children:i.tone==="assertive"?"攻勢牌":i.tone==="measured"?"平衡牌":"風險牌"}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:217",className:"option-content",children:[A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:218",children:i.title}),A.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:219",children:i.subtitle}),A.jsx("em",{"data-loc":"client/src/components/GameCanvas.tsx:220",children:i.legalBasis})]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:222",className:"play-card-cta",children:["出牌 ",A.jsx(Wa,{"data-loc":"client/src/components/GameCanvas.tsx:222",size:15})]})]},i.id))})]}):null}function dP({snapshot:a,onRestart:e,onNext:t}){return a.outcome?A.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:241",className:"mission-panel result-panel",children:[A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:242",className:"verdict-seal",children:A.jsx(Z_,{"data-loc":"client/src/components/GameCanvas.tsx:242",size:25})}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:243",className:"panel-kicker",children:"BATTLE RESOLUTION · 終局攻防判定"}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:244",className:"result-score",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:245",children:a.outcome.score}),A.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:245",children:"/ 100"})]}),A.jsx("h2",{"data-loc":"client/src/components/GameCanvas.tsx:247",children:a.outcome.summary}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:248",className:"battle-result-strip",children:[A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:249",children:[A.jsx(Za,{"data-loc":"client/src/components/GameCanvas.tsx:249",size:14}),A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:249",children:a.outcome.battleScore})," 法庭積分"]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:250",className:a.outcome.risk>=50?"is-danger":"",children:[A.jsx(nl,{"data-loc":"client/src/components/GameCanvas.tsx:250",size:14}),A.jsxs("b",{"data-loc":"client/src/components/GameCanvas.tsx:250",children:[a.outcome.risk,"%"]})," 終局風險"]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:251",children:[A.jsx(Ka,{"data-loc":"client/src/components/GameCanvas.tsx:251",size:14}),A.jsxs("b",{"data-loc":"client/src/components/GameCanvas.tsx:251",children:["×",a.outcome.maxCombo]})," 最高連擊"]})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:253",className:"verdict-grid",children:[A.jsxs("article",{"data-loc":"client/src/components/GameCanvas.tsx:254",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:255",children:"程序合法性"}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:256",children:a.outcome.legality})]}),A.jsxs("article",{"data-loc":"client/src/components/GameCanvas.tsx:258",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:259",children:"證據能力"}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:260",children:a.outcome.admissibility})]}),A.jsxs("article",{"data-loc":"client/src/components/GameCanvas.tsx:262",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:263",children:"實體證明力"}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:264",children:a.outcome.proof})]})]}),a.criticalViolations.length>0&&A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:268",className:"violation-box",children:[A.jsx(qT,{"data-loc":"client/src/components/GameCanvas.tsx:269",size:18}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:270",children:[A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:271",children:"對手命中的程序破口"}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:272",children:a.criticalViolations.join(";")})]})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:276",className:"true-ruling",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:277",children:"真實最高法院結果|規則書・唯讀"}),A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:278",children:a.currentCase.proceduralRe
311sult}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:279",children:a.currentCase.trueHolding})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:281",className:"result-actions",children:[A.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:282",className:"secondary-action",onClick:e,children:[A.jsx(xm,{"data-loc":"client/src/components/GameCanvas.tsx:282",size:17}),"重整牌組"]}),A.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:283",className:"primary-action compact",onClick:t,children:["下一場法庭",A.jsx(Wa,{"data-loc":"client/src/components/GameCanvas.tsx:283",size:17})]})]})]}):null}function _P({snapshot:a}){const e=a.history[a.history.length-1];return A.jsxs("aside",{"data-loc":"client/src/components/GameCanvas.tsx:292",className:"evidence-panel",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:293",className:"evidence-heading",children:[A.jsx(XT,{"data-loc":"client/src/components/GameCanvas.tsx:294",size:18}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:295",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:295",children:"BATTLE LOG"}),A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:295",children:"出牌與攻防紀錄"})]})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:297",className:"evidence-card source-card",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:298",className:"eyebrow",children:"裁判規則書"}),A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:299",children:a.currentCase.docket}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:300",children:a.currentCase.proceduralResult}),A.jsxs("a",{"data-loc":"client/src/components/GameCanvas.tsx:301",href:a.currentCase.sourceUrl,target:"_blank",rel:"noreferrer",children:["開啟官方來源 ",A.jsx(YR,{"data-loc":"client/src/components/GameCanvas.tsx:302",size:13})]})]}),e?A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:306",className:"evidence-card argument-card",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:307",className:"eyebrow",children:"最近出牌判定"}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:308",className:`card-impact impact-${a.lastImpact?.grade??"clean"}`,children:[A.jsxs("b",{"data-loc":"client/src/components/GameCanvas.tsx:309",children:["+",e.turnPoints," PTS"]}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:310",children:[e.riskDelta>=0?"+":"",e.riskDelta,"% 風險"]}),A.jsxs("strong",{"data-loc":"client/src/components/GameCanvas.tsx:311",children:["COMBO ×",e.comboAfter]})]}),A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:313",children:e.optionTitle}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:314",children:e.explanation}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:315",className:"argument-split",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:316",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:316",children:"己方攻勢"}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:316",children:e.legalBasis})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:317",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:317",children:"對手反擊"}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:317",children:e.defenseChallenge})]})]})]}):A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:321",className:"evidence-card locked-card",children:[A.jsx(pm,{"data-loc":"client/src/components/GameCanvas.tsx:322",size:22}),A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:323",children:"尚未打出法律牌"}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:324",children:"開局後,每次出牌都會固定當時已知事實、法律依據、得分與風險。"})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:327",className:"evidence-card evidence-stack",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:328",className:"eyebrow",children:"已翻開證據牌"}),a.revealedEvidence.length>0?a.revealedEvidence.slice(-5).map((t,i)=>A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:331",className:"evidence-item",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:332",children:String(i+1).padStart(2,"0")}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:333",children:t})]},`${t}-${i}`)):A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:337",className:"empty-evidence",children:"證據牌不得預先翻開,只能由相應法律行動解鎖。"})]}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:340",className:"favored-side",children:a.currentCase.favoredSide})]})}function mP({open:a,onClose:e}){return a?A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:348",className:"dialog-backdrop",role:"dialog","aria-modal":"true","aria-label":"遊戲規則",children:A.jsxs("section",{"data-loc":"client/src/components/GameCanvas.tsx:349",className:"info-dialog",children:[A.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:350",className:"icon-button dialog-close",onClick:e,"aria-label":"關閉說明",children:A.jsx(ZT,{"data-loc":"client/src/components/GameCanvas.tsx:350",size:19})}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:351",className:"dialog-icon",children:A.jsx(HR,{"data-loc":"client/src/components/GameCanvas.tsx:351",
311size:26})}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:352",className:"panel-kicker",children:"HOW TO PLAY · COURT DECK"}),A.jsx("h2",{"data-loc":"client/src/components/GameCanvas.tsx:353",children:"不是打出最強措施就能贏"}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:354",children:"每案是三回合法庭牌局。出牌後會立即計算法庭積分、程序風險與攻防連擊;合法且有證據支持的牌能延長連擊,高風險牌會打開反擊窗。後來發現的物品不會回頭補正先前缺口。"}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:355",className:"rule-grid",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:356",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:356",children:"1–3"}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:356",children:"打出目前手牌"})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:357",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:357",children:"ENTER"}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:357",children:"啟動牌局"})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:358",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:358",children:"R"}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:358",children:"重整本案牌組"})]}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:359",children:[A.jsx("b",{"data-loc":"client/src/components/GameCanvas.tsx:359",children:"I"}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:359",children:"開啟規則書"})]})]}),A.jsx("blockquote",{"data-loc":"client/src/components/GameCanvas.tsx:361",children:"遊戲得分與風險是教學回饋;「真實最高法院結果」永遠維持原裁判程序效果,不因玩家牌序而改寫。"}),A.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:362",className:"primary-action",onClick:e,children:"理解,返回法庭牌桌"})]})}):null}function gP({onExit:a}){const{setScene:e}=Lf(),t=Ge.useRef(null),i=Ge.useRef(!1),s=Ge.useRef(null),n=Ge.useRef(!1),o=Ge.useRef(!1),c=Ge.useMemo(()=>new pC,[]),[h,f]=Ge.useState(c.getSnapshot()),[_,m]=Ge.useState(!1),[g,x]=Ge.useState(!1);Ge.useEffect(()=>(e("judgment"),()=>e("silent")),[e]),Ge.useEffect(()=>{const v=Ya.map(E=>{const R=new Image;return R.src=E.sceneUrl,R});return()=>{v.forEach(E=>{E.src=""})}},[]),Ge.useEffect(()=>c.subscribe(f),[c]),Ge.useEffect(()=>{s.current?.setSnapshot(h)},[h]),Ge.useEffect(()=>{if(h.mode!=="result"){o.current=!1;return}!h.outcome||o.current||(o.current=!0,sP(h.currentCase.id,h.outcome.score,h.outcome.risk))},[h.currentCase.id,h.mode,h.outcome]),Ge.useEffect(()=>{const v=t.current;if(!v||i.current)return;i.current=!0;const E=new Pe(v,!0,{preserveDrawingBuffer:!0,stencil:!0,adaptToDeviceRatio:!0});let R=!1;YI(E,v,c.getSnapshot()).then(O=>{if(R){O.dispose();return}s.current=O,E.runRenderLoop(()=>O.scene.render())});const C=()=>E.resize();return window.addEventListener("resize",C),()=>{R=!0,window.removeEventListener("resize",C),s.current?.dispose(),s.current=null,E.dispose(),i.current=!1}},[c]),Ge.useEffect(()=>{if(n.current)return;n.current=!0;const v=new URLSearchParams(window.location.search).get("demo");if(v==="mid"){c.start();const E=c.getSnapshot().currentNode?.options.find(R=>R.recommended);E&&c.choose(E.id)}v==="result"&&c.autoPlayRecommended()},[c]),Ge.useEffect(()=>{const v=E=>{E.key.toLowerCase()==="i"&&m(C=>!C),E.key.toLowerCase()==="r"&&c.restart(),E.key==="Enter"&&h.mode==="intro"&&c.start();const R=Number(E.key)-1;if(h.mode==="playing"&&Number.isInteger(R)&&R>=0&&R<3){const C=h.currentNode?.options[R];C&&c.choose(C.id)}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[c,h]);const y=v=>{c.selectCase(v),x(!1)},b=()=>{c.selectCase((h.caseIndex+1)%Ya.length)};return A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:494",className:"game-shell",children:[A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:495",className:"case-backdrop",style:{backgroundImage:`url(${h.currentCase.sceneUrl})`},"aria-hidden":"true"}),A.jsx("canvas",{"data-loc":"client/src/components/GameCanvas.tsx:500",ref:t,className:"game-canvas",style:{touchAction:"none"}}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:501",className:"grain"}),A.jsxs("header",{"data-loc":"client/src/components/GameCanvas.tsx:503",className:"game-header",children:[A.jsxs("button",{"data-loc":"client/src/components/GameCanvas.tsx:504",className:"brand-mark",onClick:a??(()=>c.restart()),"aria-label":a?"返回依法執行首頁":"回到案件簡報",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:505",className:"brand-shield",children:A.jsx(Br,{"data-loc":"client/src/components/GameCanvas.tsx:505",size:24})}),A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:506",children:[A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:506",children:"依法執行"}),A.jsx("small",{"data-loc":"client/src/components/GameCanvas.tsx:506",children:"COURT STRATEGY CARD GAME"})]})]}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:508",className:"header-case desktop-only",children:A.jsx(vT,{"data-loc":"client/src/components/GameCanvas.tsx:508",snapshot:h})}),A.jsx(lP,{"data-loc":"client/src/components/GameCanvas.tsx:509",snapshot:h}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:510",className:"header-actions",children:[A.jsx(Nm,{"data-loc":"client/src/components/GameCanvas.tsx:511"}),A.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:512",className:"icon-button mobile-only",onClick:()=>
311x(!0),"aria-label":"開啟案件牌組",children:A.jsx($R,{"data-loc":"client/src/components/GameCanvas.tsx:512",size:19})}),a&&A.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:513",className:"icon-button",onClick:a,"aria-label":"返回首頁",children:A.jsx(YT,{"data-loc":"client/src/components/GameCanvas.tsx:513",size:18})}),A.jsx("button",{"data-loc":"client/src/components/GameCanvas.tsx:514",className:"icon-button",onClick:()=>m(!0),"aria-label":"開啟牌局規則",children:A.jsx(QR,{"data-loc":"client/src/components/GameCanvas.tsx:514",size:19})})]})]}),A.jsx(cP,{"data-loc":"client/src/components/GameCanvas.tsx:518",snapshot:h,open:g,onClose:()=>x(!1),onSelect:y}),A.jsxs("main",{"data-loc":"client/src/components/GameCanvas.tsx:520",className:"game-stage",children:[A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:521",className:"case-visual-label",children:[A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:522",className:"pulse-ring"}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:523",children:[A.jsxs("small",{"data-loc":"client/src/components/GameCanvas.tsx:523",children:["BATTLE 0",h.caseIndex+1]}),A.jsx("strong",{"data-loc":"client/src/components/GameCanvas.tsx:523",children:h.currentCase.title})]})]}),A.jsx("div",{"data-loc":"client/src/components/GameCanvas.tsx:525",className:"battle-hud-mobile mobile-only",children:A.jsx(vT,{"data-loc":"client/src/components/GameCanvas.tsx:525",snapshot:h})}),A.jsx(hP,{"data-loc":"client/src/components/GameCanvas.tsx:526",snapshot:h}),A.jsxs("div",{"data-loc":"client/src/components/GameCanvas.tsx:527",className:"stage-panel-wrap",children:[h.mode==="intro"&&A.jsx(uP,{"data-loc":"client/src/components/GameCanvas.tsx:528",snapshot:h,onStart:()=>c.start()}),h.mode==="playing"&&A.jsx(fP,{"data-loc":"client/src/components/GameCanvas.tsx:529",snapshot:h,onChoose:v=>c.choose(v)}),h.mode==="result"&&A.jsx(dP,{"data-loc":"client/src/components/GameCanvas.tsx:530",snapshot:h,onRestart:()=>c.restart(),onNext:b})]})]}),A.jsx(_P,{"data-loc":"client/src/components/GameCanvas.tsx:534",snapshot:h}),A.jsxs("footer",{"data-loc":"client/src/components/GameCanvas.tsx:536",className:"game-footer",children:[A.jsxs("span",{"data-loc":"client/src/components/GameCanvas.tsx:537",children:[A.jsx(nf,{"data-loc":"client/src/components/GameCanvas.tsx:537",size:13})," 最高法院規則書 · 法庭策略牌局"]}),A.jsx("p",{"data-loc":"client/src/components/GameCanvas.tsx:538",children:"出牌 → 得分/風險 → 攻防連擊 → 終局裁判"}),A.jsx("span",{"data-loc":"client/src/components/GameCanvas.tsx:539",className:"desktop-only",children:"COURT DECK · v2.0"})]}),A.jsx(mP,{"data-loc":"client/src/components/GameCanvas.tsx:542",open:_,onClose:()=>m(!1)})]})}const pP="career-2026.09-r1",ET={authority:5,procedure:5,proportionality:5,evidence:5,rights:5,timing:5},Va=[{id:"briefing",phase:"情報建構",kicker:"01 · 任務啟封",time:"08:40",title:"勤務表不是空白授權",location:"分局勤務指揮室",speaker:"值日官",dialogue:"今晚有酒駕與毒品熱點勤務。你負責把現場理由整理成日後可受法院檢驗的紀錄。",brief:"在出勤前定義任務目的、地點風險與攔查門檻,避免把一般勤務誤當成對任何人的全面授權。",knownFacts:["夜間加強勤務","轄區有近期通報","尚無特定車輛或個人"],choices:[{id:"define-threshold",label:"先列出可觀察的個別化指標",detail:"把勤務情資轉為可記錄的行為、時間、地點與安全判斷。",tone:"assertive",feedback:"你把政策目標轉成現場門檻。勤務可以引導觀察,但每次攔查仍需要當下可說明的理由。",legalSignal:"授權來源與合理懷疑必須個案化",effects:{authority:3,procedure:2,rights:2},tags:["個別化理由"]},{id:"patrol-flexible",label:"保留彈性,現場再判斷",detail:"不先寫死指標,但要求同仁在採取措施時補記理由。",tone:"measured",feedback:"彈性有助回應變化,但若現場忙亂,最容易被省略的正是採取措施前的客觀事實。",legalSignal:"理由應形成於行動之前",effects:{timing:1,authority:1,procedure:-1}},{id:"blanket-check",label:"宣布路過者一律接受檢查",detail:"以勤務命令作為所有查證、開門與翻查物品的共同依據。",tone:"risky",feedback:"勤務命令不是空白支票。對不特定人的全面侵擾會使後續證據暴露在違法取證爭議中。",legalSignal:"禁止無差別、無限度的臨檢",effects:{authority:-4,proportionality:-3,rights:-4},tags:["空白授權"]}]},{id:"field-contact",phase:"情報建構",kicker:"02 · 現場接觸",time:"22:18",title:"先問什麼,決定你知道什麼",location:"夜間道路攔查點",speaker:"現場警員",dialogue:"車輛在路口短暫偏移,但已回正。駕駛神情緊張,車窗只開了一小縫。",brief:"區分安全接觸、身分查證與犯罪調查;所有升高措施都要綁定新出現的客觀事實。",knownFacts:["短暫偏移後已回正","駕駛神情緊張","尚未看見違禁物"],
311choices:[{id:"questions-first",label:"說明理由並從低侵害詢問開始",detail:"固定行車觀察、確認身分與安全狀態,再依新資訊調整措施。",tone:"assertive",feedback:"你讓每一次權限升高都有時間戳與新事實。緊張本身很弱,但可與後續具體跡象共同評價。",legalSignal:"分段授權、逐步升高",effects:{procedure:3,proportionality:2,evidence:2,rights:2},tags:["分段升高"]},{id:"watch-first",label:"先觀察車內與駕駛反應",detail:"暫不要求更多動作,保留安全距離並等待可辨識跡象。",tone:"measured",feedback:"你降低侵擾,也承擔跡象消失的風險。此選擇是否合法,仍取決於觀察是否維持在公共視野與合理時間內。",legalSignal:"最小侵害與公共視野",effects:{proportionality:3,rights:2,timing:-1}},{id:"door-open-now",label:"立即命令開門並全面搜索",detail:"把緊張與車窗只開一縫視為足以進入、翻查所有區域。",tone:"risky",feedback:"你跳過了授權層級。安全指令與證據搜索不是同一件事,後來找到物品也不能回頭補正。",legalSignal:"後見結果不得補正先前權限",effects:{authority:-3,procedure:-3,proportionality:-4,rights:-4},tags:["後見之明"]}]},{id:"record-review",phase:"程序判斷",kicker:"03 · 卷證整序",time:"23:05",title:"把影像變成時間線,而不是結論",location:"行動勤務車",speaker:"證據管理員",dialogue:"密錄器、無線電與勤務表的時間不同步。現場報告只寫『形跡可疑』。",brief:"用原始紀錄重建每個措施前已知的事實,標出缺口、矛盾與不能從結果倒推的區段。",knownFacts:["三套時間來源不一致","文字紀錄過度概括","已有完整原始影像"],choices:[{id:"build-timeline",label:"建立行動前後的可驗證時間線",detail:"保留原始檔、校時依據與每一步措施前的資訊欄位。",tone:"assertive",feedback:"你沒有美化缺口,而是讓法院知道哪些內容可確認、哪些仍有不確定性。證據可信度因此提高。",legalSignal:"證據保全與形成時序",effects:{evidence:4,procedure:2,authority:1},tags:["證據時間線"]},{id:"summary-only",label:"先做一頁摘要供主管快速決策",detail:"列主要片段,但暫不處理原始時間差與缺漏。",tone:"measured",feedback:"摘要提升速度,卻也可能把關鍵不確定性壓扁。若後續書狀只引用摘要,風險會被放大。",legalSignal:"摘要不能取代原始卷證",effects:{timing:3,evidence:-1,procedure:-1}},{id:"rewrite-report",label:"依搜索結果重寫最初觀察",detail:"讓報告看起來從一開始就有高度犯罪嫌疑。",tone:"risky",feedback:"這會破壞紀錄可信度,也使整體案件陷入事後拼接與不實紀載疑慮。",legalSignal:"禁止結果導向的事後補記",effects:{evidence:-5,procedure:-4,rights:-2},tags:["事後補記"]}]},{id:"legal-strategy",phase:"程序判斷",kicker:"04 · 攻防策略",time:"23:46",title:"承認弱點,才能建立可守的論證",location:"法制室會議桌",speaker:"法制官",dialogue:"檢方希望主張全程合法;辯方已指出攔停理由與同意搜索紀錄不完整。",brief:"選擇可被卷證支持的主張範圍,將授權、程序、比例與證據能力分層處理。",knownFacts:["攔停理由有部分影像支持","同意過程錄音不清","搜索後發現重要物證"],choices:[{id:"layered-analysis",label:"分層承認爭點並提出備位論證",detail:"逐段處理攔停、查證、同意、搜索範圍與證據排除。",tone:"assertive",feedback:"你的論證不靠單一標籤。即使其中一段有缺口,其他部分仍可被獨立評價。",legalSignal:"程序合法性與證據能力分層",effects:{authority:2,procedure:3,evidence:3,rights:2},tags:["分層論證"]},{id:"consent-focus",label:"集中證明同意搜索",detail:"把主要資源放在現場對話與當事人è
311¡Œç‚ºï¼Œå…¶ä»–爭點簡要處理。",tone:"measured",feedback:"聚焦可以形成清楚主軸,但同意的自願性、範圍與撤回機會仍須個別證明。",legalSignal:"同意須自願、明確且範圍可辨",effects:{evidence:2,timing:2,procedure:-1}},{id:"contraband-wins",label:"主張找到違禁物就證明行動正確",detail:"不回應措施當時的授權與程序缺口。",tone:"risky",feedback:"這正是後見之明陷阱。發現違禁物影響實體證明,卻不能自動合法化先前的侵擾。",legalSignal:"實體結果不等於程序合法",effects:{procedure:-2,authority:-3,evidence:-2,rights:-3},tags:["結果論"]}]},{id:"written-opinion",phase:"成果交付",kicker:"05 · 法律意見",time:"00:28",title:"讓每一句結論都找得到證據",location:"值勤法制席",speaker:"承辦主管",dialogue:"你有四十分鐘完成程序檢核意見,供檢察官決定是否主張證據能力。",brief:"將事實、證據來源、法律門檻、涵攝與反方意見寫成可追溯的攻防矩陣。",knownFacts:["法源與裁判已備妥","時間線仍有一處缺口","必須明示不利事實"],choices:[{id:"source-matrix",label:"製作事實—證據—規則—涵攝矩陣",detail:"每項結論附來源,並在同欄記載辯方最強反駁。",tone:"assertive",feedback:"你把法律意見變成可以逐格檢驗的產品。主管能快速看出何處穩固、何處需要補證。",legalSignal:"證據支持與雙向涵攝",effects:{evidence:3,procedure:2,rights:2,timing:1},tags:["攻防矩陣"]},{id:"narrative-memo",label:"先完成流暢敘事,再補引註",detail:"優先確保閱讀速度與結論清楚,風險表另附。",tone:"measured",feedback:"敘事容易理解,但補引註若未完成,結論與卷證之間可能出現不可見斷點。",legalSignal:"可讀性與可追溯性須並重",effects:{timing:3,evidence:-1,procedure:1}},{id:"hide-gap",label:"略去不利的時間缺口",detail:"避免主動提供辯方可以利用的程序問題。",tone:"risky",feedback:"隱藏不利事實會削弱整份意見的可信度。專業判斷不是只寫有利材料。",legalSignal:"完整揭露與專業誠信",effects:{evidence:-4,rights:-3,procedure:-3},tags:["隱匿缺口"]}]},{id:"final-briefing",phase:"成果交付",kicker:"06 · 最終回報",time:"01:12",title:"最後十分鐘,決定案件如何被記住",location:"聯合研判視訊室",speaker:"主任檢察官",dialogue:"請用三分鐘說明:哪些措施可守、哪些有風險、下一步要補什麼。",brief:"交付可執行的結論,清楚區分已證明、待補證與不能以後見結果修補的部分。",knownFacts:["決策者只有三分鐘","程序風險不能歸零","補證時限即將屆至"],choices:[{id:"three-layer-report",label:"用三層結論與下一步清單回報",detail:"程序合法性、證據能力、實體證明力分開,並列出補證期限。",tone:"assertive",feedback:"你的回報既不誇大,也不逃避決策。團隊知道現在能主張什麼,以及何時必須停止。",legalSignal:"三層判斷與可執行期限",effects:{authority:2,evidence:2,rights:2,timing:3},tags:["三層結論"]},{id:"risk-first-report",label:"先報最大風險,再給單一路徑",detail:"把有限時間集中於最可能影響證據能力的缺口。",tone:"measured",feedback:"你成功聚焦,但其他層次的結論需在書面資料中維持可追溯,否則口頭決策容易被過度延伸。",legalSignal:"風險優先與書面留痕",effects:{timing:3,rights:2,procedure:1}},{id:"absolute-report",label:"宣稱全案沒有任何程序問題",detail:"以確定語氣換取快速決策,不提錄音與時間線缺口。",tone:"risky",feedback:"絕對化結論無法承受卷證檢驗。風險沒有因為簡報結束而消失,只會延後爆發。",legalSignal:"法律結論必須保留證據邊界",effects:{procedure:-4,evidence:-3,rights:-3,timing:1},tags:["過度確定"]}]}],j_=["authority","procedure","proportionality","evidence","rights","timing"],AT=["空白授權","後見之明","事後補記","隱匿缺口","結果論","過度確定"];function xP(a){return Math.max(0,Math.min(10,a))}function bP(a){return Math.max(0,Math.min(100,a))}class yP{constructor(){this.listeners=new Set,this.mode="intro",this.stageIndex=0,this.metrics={...ET},this.records=[],this.tags=[],this.battleScore=0,this.risk=0,this.combo=1,this.streak=0,this.maxCombo=1,this.lastImpact=null,this.selectedChoice=null,this.ending=null,this.startedAt=null}subscribe(e){return this.listeners.add(e),e(this.getSnapshot()),()=>{this.listeners.delete(e)}}getSnapshot(){return{mode:this.mode,stageIndex:this.stageIndex,currentStage:Va[this.stageIndex],metrics:{...this.metrics},records:[...this.records],tags:[...this.tags],battleScore:this.battleScore,risk:this.risk,combo:this.combo,streak:this.streak,maxCombo:this.maxCombo,lastImpact:this.lastImpact,selectedChoice:this.selectedChoice,ending:this.ending,contentRevision:pP,startedAt:this.startedAt}}start(){this.mode==="intro"&&(this.mode="playing",this.startedAt=Date.now(),this.emit
311())}choose(e){if(this.mode!=="playing")return;const t=Va[this.stageIndex],i=t.choices.find(n=>n.id===e);if(!i)return;for(const n of j_){const o=i.effects[n];typeof o=="number"&&(this.metrics[n]=xP(this.metrics[n]+o))}const s=this.calculateCardImpact(i);this.battleScore+=s.points,this.risk=s.riskAfter,this.combo=s.combo,this.streak=s.streak,this.maxCombo=Math.max(this.maxCombo,s.combo),this.lastImpact=s,this.records=[...this.records,{stageId:t.id,stageTitle:t.title,choiceId:i.id,choiceLabel:i.label,feedback:i.feedback,turnPoints:s.points,riskDelta:s.riskDelta,riskAfter:s.riskAfter,comboAfter:s.combo}],this.tags=Array.from(new Set([...this.tags,...i.tags??[]])),this.selectedChoice=i,this.mode="feedback",this.emit()}continue(){this.mode==="feedback"&&(this.stageIndex>=Va.length-1?(this.ending=this.calculateEnding(),this.mode="ending"):(this.stageIndex+=1,this.selectedChoice=null,this.mode="playing"),this.emit())}restart(){this.mode="intro",this.stageIndex=0,this.metrics={...ET},this.records=[],this.tags=[],this.battleScore=0,this.risk=0,this.combo=1,this.streak=0,this.maxCombo=1,this.lastImpact=null,this.selectedChoice=null,this.ending=null,this.startedAt=null,this.emit()}autoPlayMeasured(){for(this.start();this.mode!=="ending";)if(this.mode==="playing"){const e=Va[this.stageIndex],t=e.choices.find(i=>i.tone==="assertive")??e.choices[0];this.choose(t.id)}else this.mode==="feedback"&&this.continue()}calculateCardImpact(e){const t=Object.values(e.effects).filter(E=>typeof E=="number"),i=t.filter(E=>E>0).reduce((E,R)=>E+R,0),s=t.filter(E=>E<0).reduce((E,R)=>E+Math.abs(R),0),n=(e.tags??[]).some(E=>AT.includes(E)),o=e.tone==="assertive"&&i>=s+3&&!n,c=o||e.tone==="measured"&&s===0&&i>=4,h=c?this.streak+1:0,f=c?Math.min(7,this.combo+1):1;let _=e.tone==="assertive"?-4:e.tone==="measured"?4:16;_+=Math.min(18,s*2),n&&(_+=22),this.risk===0&&_<0&&(_=0);const m=bP(this.risk+_),g=o?18:e.tone==="measured"?10:e.tone==="risky"?4:12,x=Math.max(0,f-1)*3,y=n?Math.max(0,4-s):Math.max(0,g+i-s+x),b=n?"breach":_>6||s>i?"contested":"clean",v=b==="clean"?f>=3?"法庭連擊成立":"任務牌奏效":b==="contested"?"得分但留下反擊窗":"程序破口・連擊歸零";return{points:y,riskDelta:_,riskAfter:m,combo:f,streak:h,grade:b,label:v}}calculateEnding(){const t=j_.reduce((n,o)=>n+this.metrics[o],0)/j_.length,i=Math.round(t*10),s=this.tags.some(n=>AT.includes(n));return t>=8.5&&this.metrics.rights>=8&&!s?{id:"procedural-architect",grade:"S",title:"程序建築師",summary:"你用六張任務牌串起授權、事實、證據與回報,完成可受法院檢驗的攻防鏈。",mentorNote:"最成熟的連擊不是永遠選最強措施,而是知道何時停手、記錄與分層。",careerTag:"可受法院檢驗的出牌者",score:i}:t>=7&&!s?{id:"evidence-keeper",grade:"A",title:"證據守門人",summary:"多數卡牌都有法律門檻與卷證支持,少數回合的時序或比例仍可強化。",mentorNote:"下一局,把最強反方牌更早放進預判,你的連擊會更穩。",careerTag:"程序攻防稽核者",score:i}:t>=5&&this.metrics.rights>=4?{id:"repair-specialist",grade:"B",title:"程序補件者",summary:"你能辨識部分反擊風險,但權限鏈一旦斷裂,後續補牌未必能挽回。",mentorNote:"把注意力移回『出牌當下知道什麼』,不要等到終局才拼接理由。",careerTag:"需要更早固定牌面事實",score:i}:{id:"hindsight-trap",grade:"C",title:"後見之明警報",summary:"你的牌序過度依賴最後找到的結果,程序與證據鏈暴露在高風險反擊中。",mentorNote:"重新挑戰時,先打出可以在當下說明、記錄並接受反方檢驗的牌。",careerTag:"結果不能補正程序",score:i}}emit(){const e=this.getSnapshot();this.listeners.forEach(t=>t(e))}}const tE=[{key:"authority",label:"依法授權"},{key:"procedure",label:"程序完整"},{key:"proportionality",label:"比例控制"},{key:"evidence",label:"證據可用"},{key:"rights",label:"權利保障"},{key:"timing",label:"時序管理"}];function TP({snapshot:a}){return A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:38",className:"career-meters","aria-label":"法律卡組能力",children:tE.map(e=>A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:40",className:"career-meter",children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:41",children:e.label}),A.jsx("i",{"data-loc":"client/src/pages/CareerGame.tsx:42",children:A.jsx("b",{"data-loc":"client/src/pages/CareerGame.tsx:42",style:{width:`${a.metrics[e.key]*10}%`}})}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:43",children:a.metrics[e.key]})]},e.key))})}function vP({snapshot:a}){return A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:52",className:"career-battle-hud","aria-label":"任務牌局戰況",children:[A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:53",children:[A.jsx(Za,{"data-loc":"client/src/pages/CareerGame.tsx:53",size:14}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:53",children:"法庭積分"}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:53",children:a.battleScore})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:54",className:a.risk>=50?"is-danger":"",children:[A.jsx(nl,{"data-loc":"client/src/pages/CareerGame.tsx:54",size:14}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:54",children:"程序風險"}),A.jsxs("strong",{"data-loc":"client/src/pages/CareerGame.tsx:54",children:[a.risk,"%"]})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:55",className:a.combo>=3?"is-hot":"",children:[A.jsx(Ka,{"data-loc":"client/src/pages/CareerGame.tsx:55",size:14}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:55",children:"攻防連擊"}),A.jsxs("strong",{"data-loc":"client/src/pages/CareerGame.tsx:55",children:["×",a.
311combo]})]})]})}function EP({snapshot:a}){return A.jsxs("aside",{"data-loc":"client/src/pages/CareerGame.tsx:62",className:"career-stage-rail","aria-label":"六回合任務牌組",children:[A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:63",className:"career-rail-heading",children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:64",children:"MISSION DECK · 6 ROUNDS"}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:65",children:"執法程序攻防夜"})]}),A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:67",className:"career-stage-list",children:Va.map((e,t)=>{const i=t<a.stageIndex||a.mode==="ending",s=t===a.stageIndex&&a.mode!=="ending";return A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:72",className:`career-stage-item ${i?"is-complete":""} ${s?"is-current":""}`,children:[A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:73",children:["R",String(t+1).padStart(2,"0")]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:74",children:[A.jsx("small",{"data-loc":"client/src/pages/CareerGame.tsx:74",children:e.phase}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:74",children:e.title})]}),i?A.jsx(gm,{"data-loc":"client/src/pages/CareerGame.tsx:75",size:15}):A.jsx("i",{"data-loc":"client/src/pages/CareerGame.tsx:75"})]},e.id)})}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:80",className:"career-local-note",children:[A.jsx(Mf,{"data-loc":"client/src/pages/CareerGame.tsx:81",size:16}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:82",children:"真實法律是牌局規則;積分、風險與結局僅為本機教學回饋。"})]})]})}function AP({snapshot:a,onStart:e}){return A.jsxs("section",{"data-loc":"client/src/pages/CareerGame.tsx:90",className:"career-card career-intro-card card-deck-intro",children:[A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:91",className:"panel-kicker",children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:91",className:"status-dot"})," MISSION DECK BRIEFING · LOCAL RUN"]}),A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:92",className:"career-docket",children:["DECK REVISION ",a.contentRevision]}),A.jsx("h1",{"data-loc":"client/src/pages/CareerGame.tsx:93",children:"執法程序攻防夜"}),A.jsx("h2",{"data-loc":"client/src/pages/CareerGame.tsx:94",children:"六回合任務牌組,把現場理由串成法庭攻防連擊"}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:95",children:"你有六個任務回合。每回合從三張法律行動牌中出牌,系統立即結算法庭積分、程序風險與連擊倍率;先讀完攻防判定,再鎖定牌序進入下一回合。"}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:96",className:"career-intro-grid",children:[A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:97",children:[A.jsx(Cf,{"data-loc":"client/src/pages/CareerGame.tsx:97",size:18}),A.jsx("b",{"data-loc":"client/src/pages/CareerGame.tsx:97",children:"六回合任務"}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:97",children:"情報建構、程序判斷與成果交付"})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:98",children:[A.jsx(Za,{"data-loc":"client/src/pages/CareerGame.tsx:98",size:18}),A.jsx("b",{"data-loc":"client/src/pages/CareerGame.tsx:98",children:"每牌即時結算"}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:98",children:"積分與風險同步變化,不等終局才揭曉"})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:99",children:[A.jsx(Ka,{"data-loc":"client/src/pages/CareerGame.tsx:99",size:18}),A.jsx("b",{"data-loc":"client/src/pages/CareerGame.tsx:99",children:"程序連擊"}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:99",children:"合法且有證據支持的牌會延長連擊"})]})]}),A.jsxs("button",{"data-loc":"client/src/pages/CareerGame.tsx:101",className:"primary-action career-start",onClick:e,children:["洗牌並開始任務 ",A.jsx(Wa,{"data-loc":"client/src/pages/CareerGame.tsx:102",size:17})]}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:104",className:"fine-print",children:"教育模擬,不提供個案法律意見;真實案件應依完整卷證與行為時法規判斷。"})]})}function RP({snapshot:a,onChoose:e}){const t=a.currentStage;return A.jsxs("section",{"data-loc":"client/src/pages/CareerGame.tsx:112",className:"career-card career-decision-card court-hand-panel",children:[A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:113",className:"career-stage-topline",children:[A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:114",children:[A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:114",children:["ROUND ",String(a.stageIndex+1).padStart(2,"0")," / 06"]}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:114",children:t.phase})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:115",children:[A.jsx(WR,{"data-loc":"client/src/pages/CareerGame.tsx:115",size:14})," ",t.time]})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:117",className:"career-location",children:["任務場景|",t.location," · ",t.speaker]}),A.jsx("h1",{"data-loc":"client/src/pages/CareerGame.tsx:118",children:t.title}),A.jsxs("blockquote",{"data-loc":"client/src/pages/CareerGame.tsx:119",children:["「",t.dialogue,"」"]}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:120",className:"career-brief",children:t.brief}),A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:121",className:"known-facts career-facts",children:t.knownFacts.map(i=>A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:122",children:[A.jsx(gm,{"data-loc":"client/src/pages/CareerGame.tsx:122",size:13}),i]},i))}),A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:124",className:"career-choice-grid legal-hand","aria-label":"本回合任務手牌",children:t.choices.map((i,s)=>A.jsxs("button",{"data-loc":"client/src/pages/CareerGame.tsx:126",className:`career-choice legal-card tone-${i.tone}`,onClick:()=>e(i.id),children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:127",className:"option-key",children:s+1}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:128",className:"card-type",children:i.tone==="assertive"?"攻勢牌":i.tone==="measured"?"平衡牌":"風險牌"}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:129",children:i.label}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:130",children:i.detail}),A.jsx("small",{"data-loc":"client/src/pages/CareerGame.tsx:131",children:i.legalSignal}),A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:132",className:"play-card-cta",children:["出牌 ",A.jsx(Wa,{"data-loc":"client/src/pages/CareerGame.tsx:132",size:15})]})]},i.id))})]})}function SP({snapshot:a,onContinue:e}){const t=a.selectedChoice,i=a.lastImpact;return!t||!i?null:A.jsxs("section",{"data-loc":"client/src/pages/CareerGame.tsx:145",className:`career-card career-feedback-card card-resolution resolution-${i.grade}`,children:[A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:146",className:"career-feedback-icon",children:A.jsx(Cf,{"data-loc":"client/src/pages/CareerGame.tsx:146",size:24})}),A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:147",className:"panel-kicker",children:"CARD RESOLUTION · 回合攻防判定"}),A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:148",className:"career-docket",children:["ROUND ",String(a.stageIndex+1).padStart(2,"0"),"|",a.currentStage.title]}),A.jsx("h1",{"data-loc":"client/src/pages/CareerGame.tsx:149",children:i.label}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:150",className:"resolution-scoreboard",children:[A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:151",children:[A.jsx(Za,{"data-loc":"client/src/pages/CareerGame.tsx:151",size:15}),A.jsxs("b",{"data-loc":"client/src/pages/CareerGame.tsx:151",children:["+",i.points]}),A.jsx("small",{"data-loc":"client/src/pages/CareerGame.tsx:151",children:"本回合積分"})]}),A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:152",className:i.riskDelta>0?"is-danger":"",children:[A.jsx(nl,{"data-loc":"client/src/pages/CareerGame.tsx:152",size:15}),A.jsxs("b",{"data-loc":"client/src/pages/CareerGame.tsx:152",children:[i.riskDelta>=0?"+":"",i.riskDelta,"%"]}),A.jsx("small",{"data-loc":"client/src/pages/CareerGame.tsx:152",children:"風險變化"})]}),A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:153",children:[A.jsx(Ka,{"data-loc":"client/src/pages/CareerGame.tsx:153",size:15}),A.jsxs("b",{"data-loc":"client/src/pages/CareerGame.tsx:153",children:["×",i.combo]}),A.jsx("small",{"data-loc":"client/src/pages/CareerGame.tsx:153",children:"目前連擊"})]})]}),A.jsxs("strong",{"data-loc":"client/src/pages/CareerGame.tsx:155",className:"played-card-title",children:["已出牌|",t.label]}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:156",className:"feedback-copy",children:t.feedback}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:157",className:"career-legal-signal",children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:158",children:"對手可檢驗的法律規則"}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:159",children:t.legalSignal})]}),A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:161",className:"career-effect-list",children:tE.filter(s=>typeof t.effects[s.key]=="number").map(s=>{const n=t.effects[s.key]??0;return A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:164",className:n>=0?"is-positive":"is-negative",children:[s.label," ",n>=0?"+":"",n]},s.key)})}),A.jsxs("button",{"data-loc":"client/src/pages/CareerGame.tsx:167",className:"primary-action",onClick:e,children:[a.stageIndex===Va.length-1?"鎖定牌序・進入終局":"鎖定連擊・進入下一回合",A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:169",className:"key-hint",children:"ENTER"})]})]})}function MP({snapshot:a,onRestart:e,onHome:t}){const i=a.ending;return i?A.jsxs("section",{"data-loc":"client/src/pages/CareerGame.tsx:179",className:"career-card career-ending-card",children:[A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:180",className:"career-grade",children:i.grade}),A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:181",className:"panel-kicker",children:"MISSION RESOLUTION · 六回合終局"}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:182",className:"career-docket",children:i.careerTag}),A.jsx("h1",{"data-loc":"client/src/pages/CareerGame.tsx:183",children:i.title}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:184",className:"career-ending-summary",children:i.summary}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:185",className:"battle-result-strip career-final-strip",children:[A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:186",children:[A.jsx(Za,{"data-loc":"client/src/pages/CareerGame.tsx:186",size:14}),A.jsx("b",{"data-loc":"client/src/pages/CareerGame.tsx:186",children:a.battleScore})," 法庭積分"]}),A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:187",className:a.risk>=50?"is-danger":"",children:[A.jsx(nl,{"data-loc":"client/src/pages/CareerGame.tsx:187",size:14}),A.jsxs("b",{"data-loc":"client/src/pages/CareerGame.tsx:187",children:[a.risk,"%"]})," 終局風險"]}),A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:188",children:[A.jsx(Ka,{"data-loc":"client/src/pages/CareerGame.tsx:188",size:14}),A.jsxs("b",{"data-loc":"client/src/pages/CareerGame.tsx:188",children:["×",a.maxCombo]})," 最高連擊"]})]}),A.jsx("blockquote",{"data-loc":"client/src/pages/CareerGame.tsx:190",children:i.mentorNote}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:191",className:"career-ending-score",children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:191",children:i.score}),A.jsx("small",{"data-loc":"client/src/pages/CareerGame.tsx:191",children:"/ 100 法律品質"})]}),A.jsx(TP,{"data-loc":"client/src/pages/CareerGame.tsx:192",snapshot:a}),A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:193",className:"career-ending-tags",children:a.tags.length?a.tags.map(s=>A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:194",children:s},s)):A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:194",children:"程序牌組完整"})}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:196",className:"result-actions",children:[A.jsxs("button",{"data-loc":"client/src/pages/CareerGame.tsx:197",className:"secondary-action",onClick:t,children:[A.jsx(YT,{"data-loc":"client/src/pages/CareerGame.tsx:197",size:16}),"返回牌組首頁"]}),A.jsxs("button",{"data-loc":"client/src/pages/CareerGame.tsx:198",className:"primary-action compact",onClick:e,children:[A.jsx(xm,{"data-loc":"client/src/pages/CareerGame.tsx:198",size:16}),"重整任務牌組"]})]}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:200",className:"fine-print",children:"法庭積分與風險僅為教學遊戲回饋;不會建立帳號、排行榜或雲端紀錄。"})]}):null}function CP(){const[,a]=_m(),{setScene:e}=Lf(),t=Ge.useMemo(()=>new yP,[]),[i,s]=Ge.useState(t.getSnapshot()),n=Ge.useRef(!1),o=Ge.useRef(!1);Ge.useEffect(()=>(e("career"),()=>e("silent")),[e]),Ge.useEffect(()=>t.subscribe(s),[t]),Ge.useEffect(()=>{if(i.mode!=="ending"){o.current=!1;return}!i.ending||o.current||(o.current=!0,rP(i.ending.score,i.ending.grade))},[i.ending,i.mode]),Ge.useEffect(()=>{if(n.current)return;n.current=!0;const h=new URLSearchParams(window.location.search).get("demo");h==="career-feedback"&&(t.start(),t.choose(Va[0].choices[0].id)),h==="career-ending"&&t.autoPlayMeasured()},[t]),Ge.useEffect(()=>{const h=f=>{f.key==="Escape"&&a("/"),f.key.toLowerCase()==="r"&&t.restart(),f.key==="Enter"&&(i.mode==="intro"&&t.start(),i.mode==="feedback"&&t.continue());const _=Number(f.key)-1;if(i.mode==="playing"&&Number.isInteger(_)&&_>=0&&_<3){const m=i.currentStage.choices[_];m&&t.choose(m.id)}};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,a,i]);const c=["/manus-storage/scene-traffic_6f698574.png","/manus-storage/scene-cybercafe_e1ca78cd.png","/manus-storage/scene-hotel_e2b0e06a.png","/manus-storage/scene-car_c82490a3.png"][i.stageIndex%4];return A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:267",className:"career-shell",children:[A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:268",className:"career-backdrop",style:{backgroundImage:`url(${c})`}}),A.jsx("div",{"data-loc":"client/src/pages/CareerGame.tsx:269",className:"grain"}),A.jsxs("header",{"data-loc":"client/src/pages/CareerGame.tsx:270",className:"career-header",children:[A.jsxs("button",{"data-loc":"client/src/pages/CareerGame.tsx:271",className:"brand-mark",onClick:()=>a("/"),"aria-label":"返回依法執行首頁",children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:272",className:"brand-shield",children:A.jsx(Br,{"data-loc":"client/src/pages/CareerGame.tsx:272",size:24})}),A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:273",children:[A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:273",children:"依法執行"}),A.jsx("small",{"data-loc":"client/src/pages/CareerGame.tsx:273",children:"COURT STRATEGY CARD GAME"})]})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:275",className:"career-mode-title",children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:276",children:"MISSION DECK"}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:277",children:"執法程序攻防夜"})]}),A.jsx(vP,{"data-loc":"client/src/pages/CareerGame.tsx:279",snapshot:i}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:280",className:"career-header-actions",children:[A.jsx(Nm,{"data-loc":"client/src/pages/CareerGame.tsx:281"}),A.jsx("button",{"data-loc":"client/src/pages/CareerGame.tsx:282",className:"icon-button",onClick:()=>a("/"),"aria-label":"返回首頁",children:A.jsx(WT,{"data-loc":"client/src/pages/CareerGame.tsx:282",size:18})})]})]}),A.jsx(EP,{"data-loc":"client/src/pages/CareerGame.tsx:286",snapshot:i}),A.jsxs("main",{"data-loc":"client/src/pages/CareerGame.tsx:288",className:"career-main",children:[A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:289",className:"career-scene-lab
311el",children:[A.jsx(nf,{"data-loc":"client/src/pages/CareerGame.tsx:289",size:14}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:289",children:"ACTIVE BATTLEFIELD"}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:289",children:i.currentStage.location})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:290",className:"career-main-card-wrap",children:[i.mode==="intro"&&A.jsx(AP,{"data-loc":"client/src/pages/CareerGame.tsx:291",snapshot:i,onStart:()=>t.start()}),i.mode==="playing"&&A.jsx(RP,{"data-loc":"client/src/pages/CareerGame.tsx:292",snapshot:i,onChoose:h=>t.choose(h)}),i.mode==="feedback"&&A.jsx(SP,{"data-loc":"client/src/pages/CareerGame.tsx:293",snapshot:i,onContinue:()=>t.continue()}),i.mode==="ending"&&A.jsx(MP,{"data-loc":"client/src/pages/CareerGame.tsx:294",snapshot:i,onRestart:()=>t.restart(),onHome:()=>a("/")})]})]}),A.jsxs("aside",{"data-loc":"client/src/pages/CareerGame.tsx:298",className:"career-record-panel",children:[A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:299",className:"evidence-heading",children:[A.jsx(qR,{"data-loc":"client/src/pages/CareerGame.tsx:299",size:18}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:299",children:[A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:299",children:"PLAYED CARDS"}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:299",children:"已出牌與戰局"})]})]}),i.records.length?i.records.map((h,f)=>A.jsxs("article",{"data-loc":"client/src/pages/CareerGame.tsx:301",className:"career-record played-card-record",children:[A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:302",children:["R",String(f+1).padStart(2,"0")]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:303",children:[A.jsx("small",{"data-loc":"client/src/pages/CareerGame.tsx:304",children:h.stageTitle}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:305",children:h.choiceLabel}),A.jsxs("em",{"data-loc":"client/src/pages/CareerGame.tsx:306",children:["+",h.turnPoints," PTS · 風險 ",h.riskAfter,"% · ×",h.comboAfter]})]})]},h.stageId)):A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:309",className:"career-record-empty",children:[A.jsx(rf,{"data-loc":"client/src/pages/CareerGame.tsx:309",size:23}),A.jsx("strong",{"data-loc":"client/src/pages/CareerGame.tsx:309",children:"牌桌尚未開局"}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:309",children:"開始任務後,每張已出牌會固定積分、風險與連擊。"})]}),A.jsxs("div",{"data-loc":"client/src/pages/CareerGame.tsx:310",className:"career-record-boundary",children:[A.jsx(Mf,{"data-loc":"client/src/pages/CareerGame.tsx:310",size:15}),"本機牌局,不跨裝置同步"]})]}),A.jsxs("footer",{"data-loc":"client/src/pages/CareerGame.tsx:313",className:"game-footer",children:[A.jsxs("span",{"data-loc":"client/src/pages/CareerGame.tsx:314",children:[A.jsx(nf,{"data-loc":"client/src/pages/CareerGame.tsx:314",size:13})," 原創六回合法庭任務牌組"]}),A.jsx("p",{"data-loc":"client/src/pages/CareerGame.tsx:315",children:"出牌 → 攻防判定 → 鎖定連擊 → 下一回合"}),A.jsx("span",{"data-loc":"client/src/pages/CareerGame.tsx:316",className:"desktop-only",children:i.contentRevision})]})]})}const DP=[{icon:rf,title:"玩家牌組生涯",description:"跨裝置保存解鎖牌、結局、最高連擊與最近戰局。",phase:"第二階段"},{icon:KT,title:"成就與戰局榜",description:"依合法連擊、低程序風險與案件積分建立可解釋排名。",phase:"第二階段"},{icon:pm,title:"任務牌治理後台",description:"管理卡牌規則、裁判版本、發布歷程與管理員稽核。",phase:"第三階段"}];function IP(){return A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:26",className:"site-home",children:[A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:27",className:"home-backdrop","aria-hidden":"true"}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:28",className:"grain"}),A.jsxs("header",{"data-loc":"client/src/pages/Home.tsx:30",className:"home-header",children:[A.jsxs(na,{"data-loc":"client/src/pages/Home.tsx:31",href:"/",className:"brand-mark","aria-label":"依法執行首頁",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:32",className:"brand-shield",children:A.jsx(Br,{"data-loc":"client/src/pages/Home.tsx:32",size:24})}),A.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:33",children:[A.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:33",children:"依法執行"}),A.jsx("small",{"data-loc":"client/src/pages/Home.tsx:33",children:"COURT STRATEGY CARD GAME"})]})]}),A.jsxs("nav",{"data-loc":"client/src/pages/Home.tsx:35","aria-label":"主要導覽",children:[A.jsx("a",{"data-loc":"client/src/pages/Home.tsx:36",href:"#modes",children:"任務牌組"}),A.jsx("a",{"data-loc":"client/src/pages/Home.tsx:37",href:"#method",children:"攻防規則"}),A.jsx("a",{"data-loc":"client/src/pages/Home.tsx:38",href:"#cases",children:"裁判牌局"})]}),A.jsxs(na,{"data-loc":"client/src/pages/Home.tsx:40",href:"/judgment",className:"home-header-cta",children:["立即開局 ",A.jsx(C_,{"data-loc":"client/src/pages/Home.tsx:40",size:15})]})]}),A.jsxs("main",{"data-loc":"client/src/pages/Home.tsx:43",children:[A.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:44",className:"home-hero",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:45",className:"home-hero-copy",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:46",className:"panel-kicker",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:46",className:"status-dot"})," LAWFUL ACTION · COURT STRATEGY CARD GAME"]}),A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:47",className:"home-release",children:"PUBLIC COURT DECK · 202
3116.09"}),A.jsxs("h1",{"data-loc":"client/src/pages/Home.tsx:48",children:["每一次出牌,",A.jsx("br",{"data-loc":"client/src/pages/Home.tsx:48"}),A.jsx("em",{"data-loc":"client/src/pages/Home.tsx:48",children:"都必須說得出理由。"})]}),A.jsx("h2",{"data-loc":"client/src/pages/Home.tsx:49",children:"最高法院裁判化為規則書:出牌、攻防、連擊與程序風險的法庭策略牌局"}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:50",children:"《依法執行》把裁判中的事實、證據、法律門檻與涵攝拆成可打出的法律牌。每回合從攻勢、平衡或風險手牌中出牌,立即承受積分與程序風險變化;只有當下有證據支持的牌,才能延長法庭連擊。"}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:51",className:"home-hero-actions",children:[A.jsxs(na,{"data-loc":"client/src/pages/Home.tsx:52",href:"/judgment",className:"primary-action",children:["開啟三回合牌局 ",A.jsx(Wa,{"data-loc":"client/src/pages/Home.tsx:52",size:17})]}),A.jsxs(na,{"data-loc":"client/src/pages/Home.tsx:53",href:"/career",className:"secondary-action",children:["抽取六回合任務牌 ",A.jsx(rf,{"data-loc":"client/src/pages/Home.tsx:53",size:16})]})]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:55",className:"home-trust-row",children:[A.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:56",children:[A.jsx(Mf,{"data-loc":"client/src/pages/Home.tsx:56",size:14})," 真實裁判是規則書,不因牌序改寫"]}),A.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:57",children:[A.jsx(XR,{"data-loc":"client/src/pages/Home.tsx:57",size:14})," 本機牌局不蒐集個資"]})]})]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:61",className:"home-hero-briefing","aria-label":"平台內容概覽",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:62",className:"briefing-head",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:62",children:"COURT DECK SYSTEM"}),A.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:62",children:"法庭牌局作戰圖"})]}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:63",className:"briefing-case-number",children:"BATTLE DECK / 04 + 01"}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:64",className:"briefing-orbit",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:65",className:"orbit-center",children:[A.jsx(Br,{"data-loc":"client/src/pages/Home.tsx:65",size:34}),A.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:65",children:"依法執行"}),A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:65",children:"出牌・攻防・連擊"})]}),["資訊取得","合理懷疑","措施強度","程序告知","比例原則","證據能力"].map((a,e)=>A.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:67",className:`orbit-node orbit-node-${e+1}`,children:[String(e+1).padStart(2,"0"),A.jsx("b",{"data-loc":"client/src/pages/Home.tsx:67",children:a})]},a))]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:70",className:"briefing-stats",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:71",children:[A.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:71",children:"4"}),A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:71",children:"最高法院牌組"})]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:72",children:[A.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:72",children:"6"}),A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:72",children:"法律規則牌"})]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:73",children:[A.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:73",children:"3"}),A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:73",children:"每案攻防回合"})]})]})]})]}),A.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:78",className:"home-section home-modes",id:"modes",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:79",className:"section-heading",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:80",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:80",children:"CHOOSE YOUR DECK"}),A.jsx("h2",{"data-loc":"client/src/pages/Home.tsx:80",children:"兩副牌組,兩種法庭戰術"})]}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:81",children:"最高法院牌組讓你在三回合內守住程序;原創任務牌組把一個執法夜拆成六回合。兩者都即時計分、累積風險並追蹤合法連擊。"})]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:83",className:"mode-grid",children:[A.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:84",className:"mode-card mode-card-primary",children:[A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:85",className:"mode-image mode-image-judgment"}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:86",className:"mode-card-content",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:87",className:"mode-number",children:"DECK 01 · SUPREME COURT"}),A.jsx(Z_,{"data-loc":"client/src/pages/Home.tsx:88",size:28}),A.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:89",children:"三回合最高法院牌局"}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:90",children:"四件臨檢、搜索與證據能力裁判。每回合打出一張法律牌,累積法庭積分、程序風險與攻防連擊。"}),A.jsxs("ul",{"data-loc":"client/src/pages/Home.tsx:91",children:[A.jsx("li",{"data-loc":"client/src/pages/Home.tsx:91",children:"真實裁判作為不可改寫的規則書"}),A.jsx("li",{"data-loc":"client/src/pages/Home.tsx:91",children:"攻勢牌、平衡牌與高風險牌"}),A.jsx("li",{"data-loc":"client/src/pages/Home.tsx:91",children:"三層終局裁判與對手反擊點"})]}),A.jsxs(na,{"data-loc":"client/src/pages/Home.tsx:92",href:"/judgment",children:["進入最高法院牌局 ",A.jsx(C_,{"data-loc":"client/src/pages/Home.tsx:92",size:16})]})]})]}),A.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:95",className:"mode-card",children:[A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:96",className:"mode-image mode-image-career"}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:97",className:"mode-card-content",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:98",className:"mode-number",children:"DECK 02 · MISSION RUN"}),A.jsx(rf,{"data-loc":"client/src/pages/Home.tsx:99",size:28}),A.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:100",children:"六回合程序任務牌組"}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:101",children:"從勤務啟封一路打到最終回報。每次出牌先進入攻防判定,再鎖定牌序進入下一回合。"}),A.jsxs("ul",{"data-loc":"client/src/pages/Home.tsx:102",children:[A.jsx("li",{"data-loc":"client/src/pages/Home.tsx:102",children:"六項卡組能力動態變化"}),A.jsx("li",{"data-loc":"client/src/pages/Home.tsx:102",children:"即時得分、風險與連擊倍率"}),A.jsx("li",{"data-loc":"client/src/pages/Home.tsx:102",children:"原創任務與多種終局稱號"})]}),A.jsxs(na,{"data-loc":"client/src/pages/Home.tsx:103",href:"/career",children:["抽取六回合任務牌 ",A.jsx(C_,{"data-loc":"client/src/pages/Home.tsx:103",size:16})]})]})]})]})]}),A.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:109",className:"home-section home-method",id:"method",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:110",className:"method-copy",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:111",className:"section-kicker",children:"COURT DECK RULES"}),A.jsx("h2",{"data-loc":"client/src/pages/Home.tsx:112",children:"法庭牌局不是猜答案,而是管理攻勢與破口"}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:113",children:"你要依時間順序翻開事實牌、比對法律門檻、預判對手反擊,再打出能被卷證支持的措施。高分不等於零風險,連擊也可能被一個程序破口中斷。"}),A.jsx("blockquote",{"data-loc":"client/src/pages/Home.tsx:114",children:"後來發現的結æž
311œï¼Œä¸èƒ½åå‘創造先前不存在的合理懷疑、同意或緊急性。"})]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:116",className:"method-steps",children:[A.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:117",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:117",children:"01"}),A.jsx(XT,{"data-loc":"client/src/pages/Home.tsx:117",size:20}),A.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:117",children:"翻開事實牌"}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:117",children:"只使用出牌當下已知且有證據支持的資訊。"})]}),A.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:118",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:118",children:"02"}),A.jsx(VR,{"data-loc":"client/src/pages/Home.tsx:118",size:20}),A.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:118",children:"比對法律規則牌"}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:118",children:"區分查證、盤查、搜索與刑事調查的授權。"})]}),A.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:119",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:119",children:"03"}),A.jsx(Br,{"data-loc":"client/src/pages/Home.tsx:119",size:20}),A.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:119",children:"預判對手反擊"}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:119",children:"每張攻勢牌都附上正當化與最強反方質疑。"})]}),A.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:120",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:120",children:"04"}),A.jsx(Z_,{"data-loc":"client/src/pages/Home.tsx:120",size:20}),A.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:120",children:"結算法庭終局"}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:120",children:"程序、證據能力與證明力仍分開作成裁判。"})]})]})]}),A.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:124",className:"home-section",id:"cases",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:125",className:"section-heading",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:126",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:126",children:"VERIFIED COURT DECKS"}),A.jsx("h2",{"data-loc":"client/src/pages/Home.tsx:126",children:"四副最高法院精選任務牌組"})]}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:127",children:"每副牌組以真實裁判事實與程序結果設定勝負邊界。撤銷發回不等於實體無罪,上訴駁回也不表示最高法院重作完整事實審。"})]}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:129",className:"home-case-grid",children:Ya.map((a,e)=>A.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:131",className:"home-case-card",style:{"--case-accent":a.accent},children:[A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:132",className:"home-case-image",style:{backgroundImage:`url(${a.sceneUrl})`}}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:133",className:"home-case-copy",children:[A.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:134",children:["CASE ",String(e+1).padStart(2,"0")," · ",a.year]}),A.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:135",children:a.title}),A.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:136",children:a.docket}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:137",children:a.subtitle}),A.jsxs(na,{"data-loc":"client/src/pages/Home.tsx:138",href:"/judgment",children:["進入本案牌局 ",A.jsx(Wa,{"data-loc":"client/src/pages/Home.tsx:138",size:15})]})]})]},a.id))})]}),A.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:145",className:"home-section roadmap-section",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:146",className:"section-heading",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:147",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:147",children:"VERIFIED ROADMAP"}),A.jsx("h2",{"data-loc":"client/src/pages/Home.tsx:147",children:"下一階段:牌組成長與戰局治理"})]}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:148",children:"以下功能尚未冒充為已上線服務;必須升級至 web-db-user 並完成身分、資料庫、權限與伺服器驗證後才會開放。"})]}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:150",className:"roadmap-gri
311d",children:DP.map(a=>A.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:152",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:153",children:[A.jsx(a.icon,{"data-loc":"client/src/pages/Home.tsx:153",size:22}),A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:153",children:a.phase})]}),A.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:154",children:a.title}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:155",children:a.description}),A.jsxs("small",{"data-loc":"client/src/pages/Home.tsx:156",children:[A.jsx(pm,{"data-loc":"client/src/pages/Home.tsx:156",size:12})," 規劃中|未連接帳號服務"]})]},a.title))})]})]}),A.jsxs("footer",{"data-loc":"client/src/pages/Home.tsx:163",className:"home-footer",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:164",className:"brand-mark",children:[A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:165",className:"brand-shield",children:A.jsx(Br,{"data-loc":"client/src/pages/Home.tsx:165",size:22})}),A.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:166",children:[A.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:166",children:"依法執行"}),A.jsx("small",{"data-loc":"client/src/pages/Home.tsx:166",children:"COURT STRATEGY CARD GAME"})]})]}),A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:168",children:"裁判導向法律教育模擬。非個案法律意見;應依完整卷證、行為時法規及專業法律意見判斷。"}),A.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:169",children:[A.jsx(nf,{"data-loc":"client/src/pages/Home.tsx:169",size:13})," PUBLIC COURT DECK"]})]})]})}const iE="execute-law.landing-visited.v1",W_=[{href:"/career",label:"任務牌組",detail:"六回合程序攻防",icon:eS,tone:"mission"},{href:"/lobby#cases",label:"裁判牌組",detail:"四件最高法院精選裁判",icon:KT,tone:"cases"},{href:"/lobby",label:"牌組大廳",detail:"閱讀規則、案件與玩法",icon:ZR,tone:"lobby"},{href:"/judgment",label:"立即開局",detail:"進入三回合法庭牌局",icon:GR,tone:"judgment"}],Ju=["/manus-storage/reference_ae79bf62.png",...Ya.map(a=>a.sceneUrl)].filter((a,e,t)=>t.indexOf(a)===e),PP={firstBoot:[{f:196,t:0,d:.28},{f:293.66,t:.14,d:.34},{f:392,t:.31,d:.48}],returnBoot:[{f:392,t:0,d:.12},{f:493.88,t:.08,d:.2}],hover:[{f:523.25,t:0,d:.085}]},OP={mission:[{f:261.63,t:0,d:.18},{f:329.63,t:.12,d:.2},{f:392,t:.24,d:.34}],cases:[{f:293.66,t:0,d:.18},{f:440,t:.1,d:.22},{f:587.33,t:.23,d:.36}],lobby:[{f:220,t:0,d:.24},{f:277.18,t:.08,d:.26},{f:329.63,t:.19,d:.4}],judgment:[{f:164.81,t:0,d:.18},{f:329.63,t:.09,d:.22},{f:493.88,t:.2,d:.25},{f:659.25,t:.31,d:.42}]};function wP(a){if(a==="first")return"first";if(a)return"return";try{return window.localStorage.getItem(iE)==="seen"?"return":"first"}catch{return"first"}}function FP(a){return a==="field"||a==="advocate"||a==="master"?a:nP(Um())}function BP(){const[,a]=_m(),{enabled:e,unlocked:t,setScene:i,playNotes:s}=Lf(),n=new URLSearchParams(window.location.search).get("demo"),[o]=Ge.useState(()=>wP(n)),[c]=Ge.useState(()=>FP(n)),h=aP[c],f=n!==null,_=n!=="boot"&&f,[m,g]=Ge.useState(n==="boot"?62:f?100:o==="return"?18:4),[x,y]=Ge.useState(n==="boot"?"正在同步案件場景 3 / 5":f?o==="return"?h.status:"案件環境已就緒":o==="return"?"正在喚醒上次案件":"正在核對法庭介面"),[b,v]=Ge.useState(_),[E,R]=Ge.useState(n==="transition"),[C,O]=Ge.useState(n==="transition"?"最高法院牌局":"牌組大廳"),[M,I]=Ge.useState(null),[P,L]=Ge.useState(n==="hint"?2:null),V=Ge.useRef(!1),X=Ge.useRef(null);Ge.useEffect(()=>(i("landing"),()=>i("silent")),[i]);const re=Ge.useCallback(q=>{s(PP[q],q==="hover"?.022:.052)},[s]),ae=Ge.useCallback(q=>{s(OP[q],q==="judgment"?.06:.052)},[s]),de=Ge.useCallback(()=>{!e||V.current||(V.current=!0,re(o==="first"?"firstBoot":"returnBoot"))},[e,re,o]);Ge.useEffect(()=>{if(f)return;let q=!0;const j=[],Q=performance.now(),w=Ju.length+1;let B=0;const z=he=>{if(B+=1,!q)return;const Le=Math.max(o==="return"?18:4,Math.min(92,Math.round(B/w*92)));g(Le),y(he)},K=(document.fonts?.ready??Promise.resolve()).then(()=>{z(o==="return"?"已恢復司法字型與介面":"司法字型與版面已校準")}),ue=Ju.map((he,ve)=>new Promise(Le=>{const ke=new Image;j.push(ke);const J=()=>{z(o==="return"?`正在恢復案件索引 ${ve+1} / ${Ju.length}`:`正在同步案件場景 ${ve+1} / ${Ju.length}`),Le()};ke.onload=J,ke.onerror=J,ke.src=he}));return Promise.allSettled([K,...ue]).then(()=>{const he=performance.now()-Q,Le=Math.max(0,(o==="return"?460:1250)-he);window.setTimeout(()=>{if(q){g(100),y(o==="return"?h.status:"案件環境已就緒"),v(!0);try{window.localStorage.setItem(iE,"seen")}catch{}}},Le)}),()=>
311{q=!1,j.forEach(he=>{he.onload=null,he.onerror=null})}},[f,h.status,o]),Ge.useEffect(()=>()=>{X.current!==null&&window.clearTimeout(X.current)},[]);const U=Ge.useCallback((q,j,Q)=>{if(!E){if(!b){I(q),O(j),y("資源完成後立即進入");return}V.current=!0,ae(Q),O(j),y(`正在進入${j}`),R(!0),X.current=window.setTimeout(()=>a(q),720)}},[E,ae,b,a]);Ge.useEffect(()=>{if(!b||!M||E)return;const q=W_.find(j=>j.href===M);U(M,q?.label??"牌組大廳",q?.tone??"lobby"),I(null)},[E,U,M,b]);const te=(q,j,Q,w,B)=>{if(!(q.metaKey||q.ctrlKey||q.shiftKey||q.altKey)){if(q.preventDefault(),typeof B=="number"&&window.matchMedia("(hover: none)").matches&&P!==B){L(B),V.current=!0,re("hover");return}U(j,Q,w)}},Y=P===null?null:W_[P],Z=o==="first"?"FIRST INITIALIZATION":`SESSION RESTORED · LEVEL ${h.level}`;return A.jsxs("main",{"data-loc":"client/src/pages/Landing.tsx:257",className:`landing-gate visit-${o} progress-${c} ${b?"is-ready":"is-booting"} ${E?"is-leaving":""}`,"data-visit":o,"data-progress-tier":c,onPointerDown:q=>{q.target.closest(".audio-control")||de()},children:[A.jsx("div",{"data-loc":"client/src/pages/Landing.tsx:266",className:"landing-grid","aria-hidden":"true"}),A.jsx("div",{"data-loc":"client/src/pages/Landing.tsx:267",className:"landing-frame","aria-hidden":"true"}),A.jsx("div",{"data-loc":"client/src/pages/Landing.tsx:268",className:"landing-halo landing-halo-large","aria-hidden":"true"}),A.jsx("div",{"data-loc":"client/src/pages/Landing.tsx:269",className:"landing-halo landing-halo-small","aria-hidden":"true"}),A.jsx("div",{"data-loc":"client/src/pages/Landing.tsx:270",className:"landing-grain","aria-hidden":"true"}),A.jsx(Nm,{"data-loc":"client/src/pages/Landing.tsx:272",variant:"landing"}),o==="return"&&A.jsxs("div",{"data-loc":"client/src/pages/Landing.tsx:275",className:"landing-progress-mark","aria-label":`玩家回訪等級 ${h.level}:${h.label}`,children:[A.jsx("span",{"data-loc":"client/src/pages/Landing.tsx:276",children:"PLAYER RECORD"}),A.jsxs("strong",{"data-loc":"client/src/pages/Landing.tsx:277",children:["LEVEL ",h.level]}),A.jsx("small",{"data-loc":"client/src/pages/Landing.tsx:278",children:h.label})]}),A.jsxs("section",{"data-loc":"client/src/pages/Landing.tsx:282",className:"landing-center","aria-labelledby":"landing-title",children:[A.jsxs("a",{"data-loc":"client/src/pages/Landing.tsx:283",href:"/lobby",className:"landing-emblem","aria-label":"進入依法執行牌組大廳",onPointerDown:q=>q.stopPropagation(),onClick:q=>te(q,"/lobby","牌組大廳","lobby"),children:[A.jsx("span",{"data-loc":"client/src/pages/Landing.tsx:290",className:"landing-emblem-line"}),A.jsx("span",{"data-loc":"client/src/pages/Landing.tsx:291",className:"landing-emblem-scan","aria-hidden":"true"}),A.jsx(Br,{"data-loc":"client/src/pages/Landing.tsx:292",size:106,strokeWidth:1.15}),A.jsx("i",{"data-loc":"client/src/pages/Landing.tsx:293","aria-hidden":"true",children:A.jsx(Br,{"data-loc":"client/src/pages/Landing.tsx:293",size:56,strokeWidth:1})})]}),A.jsx("div",{"data-loc":"client/src/pages/Landing.tsx:296",className:"landing-eyebrow",children:"RESOLVE BY LAW · CASE INITIALIZATION"}),A.jsx("h1",{"data-loc":"client/src/pages/Landing.tsx:297",id:"landing-title",children:"依法執行"}),A.jsx("h2",{"data-loc":"client/src/pages/Landing.tsx:298",children:"臨檢、臨檢與臨檢"}),A.jsxs("a",{"data-loc":"client/src/pages/Landing.tsx:300",href:"/lobby",className:"landing-loader","aria-label":`${x},${b?"進入牌組大廳":`載入進度 ${m}%`}`,"aria-busy":!b,onPointerDown:q=>q.stopPropagation(),onClick:q=>te(q,"/lobby","牌組大廳","lobby"),children:[A.jsxs("span",{"data-loc":"client/src/pages/Landing.tsx:308",className:"landing-loader-track",role:"progressbar","aria-label":"案件環境載入進度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m,children:[A.jsx("i",{"data-loc":"client/src/pages/Landing.tsx:316",className:"landing-loader-fill",style:{width:`${m}%`}}),A.jsx("b",{"data-loc":"client/src/pages/Landing.tsx:317","aria-hidden":"true"}),A.jsx("b",{"data-loc":"client/src/pages/Landing.tsx:317","aria-hidden":"true"}),A.jsx("b",{"data-loc":"client/src/pages/Landing.tsx:317","aria-hidden":"true"})]}),A.jsx("strong",{"data-loc":"client/src/pages/Landing.tsx:319",children:x}),A.jsx("small",{"data-loc":"client/src/pages/Landing.tsx:320",children:b?Z:`INITIALIZING · ${String(m).padStart(3,"0")}%`})]})]}),A.jsxs("nav",{"data-loc":"client/src/pages/Landing.tsx:324",className:"landing-dock","aria-label":"首頁快速入口",onMouseLeave:()=>L(null),children:[A.jsxs("div",{"data-loc":"client/src/pages/Landing.tsx:329",className:`landing-dock-hint ${Y?"is-visible":""}`,"aria-live":"polite",children:[A.jsx("small",{"data-loc":"client/src/pages/Landing.tsx:330",children:"QUICK ACCESS"}),A.jsx("strong",{"data-loc":"client/src/pages/Landing.tsx:331",children:Y?.label??"選擇入口"}),A.jsx("span",{"data-loc":"client/src/pages/Landing.tsx:332",children:Y?.detail??"移至圖示查看功能"}),A.jsxs("em",{"data-loc":"client/src/pages/Landing.tsx:333",children:["ENTRY MOTIF · ",P===null?"--":String(P+1).padStart(2,"0")]})]}),W_.map((q,j)=>A.jsxs("a",{"data-loc":"client/src/pages/Landing.tsx:336",href:q.href,"data-tone":q.tone,"aria-label":`${q.label}:${q.detail};專屬音階 ${j+1}`,onMouseEnter:()=>{L(j),t&&re("hover")},onFocus:()=>L(j),onBlur:()=>L(null),onPointerDown:Q=>{Q.stopPropagation(),Q.pointerType!=="touch"&&L(j)},onClick:Q=>te(Q,q.href,q.label,q.tone,j),children:[A.jsx(q.icon,{"data-loc":"client/src/pages/Landing.tsx:353",size:30,strokeWidth:1.75}),A.jsx("span",{"data-loc":"client/src/pages/Landing.tsx:354",children:q.label})]},q.href+q.label))]}),A.jsxs("p",{"data-loc":"client/src/pages/Landing.tsx:359",className:"landing-footnote",children:[A.jsx("span",{"data-loc":"client/src/pages/Landing.tsx:360",children:o==="first"?"首次建立案件環境":h.label}),"最高法院裁判規則書 · 法庭策略卡牌遊戲"]}),A.jsxs("div",{"data-loc":"client/src/pages/Landing.tsx:364",className:"landing-transition-curtain","aria-hidden":!E,children:[A.jsx(Br,{"data-loc":"client/src/pages/Landing.tsx:365",size:38}),A.jsx("span",{"data-loc":"client/src/pages/Landing.tsx:366",children:"CASE ACCESS"}),A.jsx("strong",{"data-loc":"client/src/pages/Landing.tsx:367",children:C})]})]})}function LP(){return A.jsxs("main",{"data-loc":"client/src/pages/NotFound.tsx:6",className:"not-found-page",children:[A.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:7",className:"grain"}),A.jsxs("section",{"data-loc":"client/src/pages/NotFound.tsx:8",children:[A.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:9",className:"brand-shield",children:A.jsx(Br,{"data-loc":"client/src/pages/NotFound.tsx:9",size:26})}),A.jsx("span",{"data-loc":"client/src/pages/NotFound.tsx:10",children:"PROCEDURAL EXCEPTION · 404"}),A.jsx(KR,{"data-loc":"client/src/pages/NotFound.tsx:11",size:42}),A.jsx("h1",{"data-loc":"client/src/pages/NotFound.tsx:12",children:"找不到這副牌組"}),A.jsx("p",{"data-loc":"client/src/pages/NotFound.tsx:13",children:"指定法庭牌局不存在,或任務入口已移動。請返回首頁重新選擇牌組。"}),A.jsxs(na,{"data-loc":"client/src/pages/NotFound.tsx:14",href:"/",className:"primary-action",children:[A.jsx(WT,{"data-loc":"client/src/pages/NotFound.tsx:14",size:16}),"返回牌組首頁"]})]})]})}function kP(){const[,a]=_m();return A.jsx(gP,{"data-loc":"client/src/App.tsx:12",onExit:()=>a("/")})}function NP(){return A.jsx(rS,{"data-loc":"client/src/App.tsx:17",children:A.jsx(eP,{"data-loc":"client/src/App.tsx:18",children:A.jsxs(tR,{"data-loc":"client/src/App.tsx:19",children:[A.jsx(Cc,{"data-loc":"client/src/App.tsx:20",path:"/",component:BP}),A.jsx(Cc,{"data-loc":"client/src/App.tsx:21",path:"/lobby",component:IP}),A.jsx(Cc,{"data-loc":"client/src/App.tsx:22",path:"/judgment",component:kP}),A.jsx(Cc,{"data-loc":"client/src/App.tsx:23",path:"/career",component:CP}),A.jsx(Cc,{"data-loc":"client/src/App.tsx:24",component:LP})]})})})}IA.createRoot(document.getElementById("root")).render(A.jsx(NP,{"data-loc":"client/src/main.tsx:5"}));export{Ie as A,df as B,oi as C,Ov as D,KM as E,is as F,cf as G,tf as I,im as L,se as M,Me as O,wr as P,Lr as R,Ti as S,QM as T,D as V,Je as _,ff as a,pe as b,N as c,fs as d,ge as e,xt as f,ee as g,bt as h,Es as i,Wi as j,Ci as k,Ts as l,Fe as m,em as n,kM as o,Yu as p,UP as q,rC as r,ce as s,uf as t,rt as u,vM as v,GP as w};

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.