sage-team 3.4.0 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/engine/__tests__/dispatcher.test.js +1 -1
- package/dist/engine/__tests__/dispatcher.test.js.map +1 -1
- package/dist/engine/ceo-brain.d.ts +14 -1
- package/dist/engine/ceo-brain.d.ts.map +1 -1
- package/dist/engine/ceo-brain.js +89 -4
- package/dist/engine/ceo-brain.js.map +1 -1
- package/dist/engine/dispatcher.d.ts +5 -0
- package/dist/engine/dispatcher.d.ts.map +1 -1
- package/dist/engine/dispatcher.js +81 -3
- package/dist/engine/dispatcher.js.map +1 -1
- package/dist/engine/orchestrator.d.ts +5 -0
- package/dist/engine/orchestrator.d.ts.map +1 -1
- package/dist/engine/orchestrator.js +58 -7
- package/dist/engine/orchestrator.js.map +1 -1
- package/dist/mcp/server.js +134 -27
- package/dist/mcp/server.js.map +1 -1
- package/package.json +1 -1
- package/src/web/dist/assets/{BufferResource-Bct1-zq7.js → BufferResource-UdmdsM6e.js} +1 -1
- package/src/web/dist/assets/{CanvasRenderer-CKwE0kc4.js → CanvasRenderer-Dfr3Z3Qw.js} +1 -1
- package/src/web/dist/assets/{Filter-DOuiTHq_.js → Filter-W6vlx55V.js} +1 -1
- package/src/web/dist/assets/{RenderTargetSystem-BFGmN4oB.js → RenderTargetSystem-Ds4CZ-PP.js} +1 -1
- package/src/web/dist/assets/{WebGLRenderer-Bnd2tXK6.js → WebGLRenderer-BrkN99zF.js} +1 -1
- package/src/web/dist/assets/{WebGPURenderer-BuJedD5Q.js → WebGPURenderer-DrL4JJxB.js} +1 -1
- package/src/web/dist/assets/{browserAll-XFxdM5KU.js → browserAll-B89dcUjb.js} +1 -1
- package/src/web/dist/assets/index-8Qtg1JIx.css +1 -0
- package/src/web/dist/assets/index-BalqI4Qj.js +298 -0
- package/src/web/dist/assets/{webworkerAll-DU2TvyX8.js → webworkerAll-BJZUB1XW.js} +1 -1
- package/src/web/dist/index.html +2 -2
- package/src/web/dist/assets/index-CQg6t7aD.js +0 -298
- package/src/web/dist/assets/index-DgR_4NZL.css +0 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-B89dcUjb.js","assets/webworkerAll-BJZUB1XW.js","assets/Filter-W6vlx55V.js","assets/WebGPURenderer-DrL4JJxB.js","assets/BufferResource-UdmdsM6e.js","assets/RenderTargetSystem-Ds4CZ-PP.js","assets/WebGLRenderer-BrkN99zF.js","assets/CanvasRenderer-Dfr3Z3Qw.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var p1=Object.defineProperty;var g1=(l,t,n)=>t in l?p1(l,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[t]=n;var ie=(l,t,n)=>g1(l,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();function Ch(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Ac={exports:{}},Xa={};/**
|
|
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 Vp;function y1(){if(Vp)return Xa;Vp=1;var l=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var h in o)h!=="key"&&(u[h]=o[h])}else u=o;return o=u.ref,{$$typeof:l,type:a,key:c,ref:o!==void 0?o:null,props:u}}return Xa.Fragment=t,Xa.jsx=n,Xa.jsxs=n,Xa}var Pp;function x1(){return Pp||(Pp=1,Ac.exports=y1()),Ac.exports}var V=x1(),wc={exports:{}},dt={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Fp;function _1(){if(Fp)return dt;Fp=1;var l=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),_=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=_&&R[_]||R["@@iterator"],typeof R=="function"?R:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function A(R,Y,Q){this.props=R,this.context=Y,this.refs=S,this.updater=Q||T}A.prototype.isReactComponent={},A.prototype.setState=function(R,Y){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,Y,"setState")},A.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=A.prototype;function E(R,Y,Q){this.props=R,this.context=Y,this.refs=S,this.updater=Q||T}var B=E.prototype=new C;B.constructor=E,w(B,A.prototype),B.isPureReactComponent=!0;var X=Array.isArray;function N(){}var G={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function W(R,Y,Q){var J=Q.ref;return{$$typeof:l,type:R,key:Y,ref:J!==void 0?J:null,props:Q}}function Z(R,Y){return W(R.type,Y,R.props)}function I(R){return typeof R=="object"&&R!==null&&R.$$typeof===l}function tt(R){var Y={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(Q){return Y[Q]})}var it=/\/+/g;function nt(R,Y){return typeof R=="object"&&R!==null&&R.key!=null?tt(""+R.key):Y.toString(36)}function At(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(N,N):(R.status="pending",R.then(function(Y){R.status==="pending"&&(R.status="fulfilled",R.value=Y)},function(Y){R.status==="pending"&&(R.status="rejected",R.reason=Y)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function D(R,Y,Q,J,rt){var ct=typeof R;(ct==="undefined"||ct==="boolean")&&(R=null);var ft=!1;if(R===null)ft=!0;else switch(ct){case"bigint":case"string":case"number":ft=!0;break;case"object":switch(R.$$typeof){case l:case t:ft=!0;break;case g:return ft=R._init,D(ft(R._payload),Y,Q,J,rt)}}if(ft)return rt=rt(R),ft=J===""?"."+nt(R,0):J,X(rt)?(Q="",ft!=null&&(Q=ft.replace(it,"$&/")+"/"),D(rt,Y,Q,"",function(Pe){return Pe})):rt!=null&&(I(rt)&&(rt=Z(rt,Q+(rt.key==null||R&&R.key===rt.key?"":(""+rt.key).replace(it,"$&/")+"/")+ft)),Y.push(rt)),1;ft=0;var Ht=J===""?".":J+":";if(X(R))for(var Et=0;Et<R.length;Et++)J=R[Et],ct=Ht+nt(J,Et),ft+=D(J,Y,Q,ct,rt);else if(Et=b(R),typeof Et=="function")for(R=Et.call(R),Et=0;!(J=R.next()).done;)J=J.value,ct=Ht+nt(J,Et++),ft+=D(J,Y,Q,ct,rt);else if(ct==="object"){if(typeof R.then=="function")return D(At(R),Y,Q,J,rt);throw Y=String(R),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ft}function L(R,Y,Q){if(R==null)return R;var J=[],rt=0;return D(R,J,"","",function(ct){return Y.call(Q,ct,rt++)}),J}function et(R){if(R._status===-1){var Y=R._result;Y=Y(),Y.then(function(Q){(R._status===0||R._status===-1)&&(R._status=1,R._result=Q)},function(Q){(R._status===0||R._status===-1)&&(R._status=2,R._result=Q)}),R._status===-1&&(R._status=0,R._result=Y)}if(R._status===1)return R._result.default;throw R._result}var K=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=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(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},at={map:L,forEach:function(R,Y,Q){L(R,function(){Y.apply(this,arguments)},Q)},count:function(R){var Y=0;return L(R,function(){Y++}),Y},toArray:function(R){return L(R,function(Y){return Y})||[]},only:function(R){if(!I(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return dt.Activity=x,dt.Children=at,dt.Component=A,dt.Fragment=n,dt.Profiler=o,dt.PureComponent=E,dt.StrictMode=a,dt.Suspense=m,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,dt.__COMPILER_RUNTIME={__proto__:null,c:function(R){return G.H.useMemoCache(R)}},dt.cache=function(R){return function(){return R.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(R,Y,Q){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var J=w({},R.props),rt=R.key;if(Y!=null)for(ct in Y.key!==void 0&&(rt=""+Y.key),Y)!$.call(Y,ct)||ct==="key"||ct==="__self"||ct==="__source"||ct==="ref"&&Y.ref===void 0||(J[ct]=Y[ct]);var ct=arguments.length-2;if(ct===1)J.children=Q;else if(1<ct){for(var ft=Array(ct),Ht=0;Ht<ct;Ht++)ft[Ht]=arguments[Ht+2];J.children=ft}return W(R.type,rt,J)},dt.createContext=function(R){return R={$$typeof:c,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:u,_context:R},R},dt.createElement=function(R,Y,Q){var J,rt={},ct=null;if(Y!=null)for(J in Y.key!==void 0&&(ct=""+Y.key),Y)$.call(Y,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(rt[J]=Y[J]);var ft=arguments.length-2;if(ft===1)rt.children=Q;else if(1<ft){for(var Ht=Array(ft),Et=0;Et<ft;Et++)Ht[Et]=arguments[Et+2];rt.children=Ht}if(R&&R.defaultProps)for(J in ft=R.defaultProps,ft)rt[J]===void 0&&(rt[J]=ft[J]);return W(R,ct,rt)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(R){return{$$typeof:h,render:R}},dt.isValidElement=I,dt.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:et}},dt.memo=function(R,Y){return{$$typeof:p,type:R,compare:Y===void 0?null:Y}},dt.startTransition=function(R){var Y=G.T,Q={};G.T=Q;try{var J=R(),rt=G.S;rt!==null&&rt(Q,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(N,K)}catch(ct){K(ct)}finally{Y!==null&&Q.types!==null&&(Y.types=Q.types),G.T=Y}},dt.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},dt.use=function(R){return G.H.use(R)},dt.useActionState=function(R,Y,Q){return G.H.useActionState(R,Y,Q)},dt.useCallback=function(R,Y){return G.H.useCallback(R,Y)},dt.useContext=function(R){return G.H.useContext(R)},dt.useDebugValue=function(){},dt.useDeferredValue=function(R,Y){return G.H.useDeferredValue(R,Y)},dt.useEffect=function(R,Y){return G.H.useEffect(R,Y)},dt.useEffectEvent=function(R){return G.H.useEffectEvent(R)},dt.useId=function(){return G.H.useId()},dt.useImperativeHandle=function(R,Y,Q){return G.H.useImperativeHandle(R,Y,Q)},dt.useInsertionEffect=function(R,Y){return G.H.useInsertionEffect(R,Y)},dt.useLayoutEffect=function(R,Y){return G.H.useLayoutEffect(R,Y)},dt.useMemo=function(R,Y){return G.H.useMemo(R,Y)},dt.useOptimistic=function(R,Y){return G.H.useOptimistic(R,Y)},dt.useReducer=function(R,Y,Q){return G.H.useReducer(R,Y,Q)},dt.useRef=function(R){return G.H.useRef(R)},dt.useState=function(R){return G.H.useState(R)},dt.useSyncExternalStore=function(R,Y,Q){return G.H.useSyncExternalStore(R,Y,Q)},dt.useTransition=function(){return G.H.useTransition()},dt.version="19.2.4",dt}var Qp;function Mh(){return Qp||(Qp=1,wc.exports=_1()),wc.exports}var Xe=Mh();const Gr=Ch(Xe);var Cc={exports:{}},Va={},Mc={exports:{}},Ec={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var Wp;function b1(){return Wp||(Wp=1,(function(l){function t(D,L){var et=D.length;D.push(L);t:for(;0<et;){var K=et-1>>>1,at=D[K];if(0<o(at,L))D[K]=L,D[et]=at,et=K;else break t}}function n(D){return D.length===0?null:D[0]}function a(D){if(D.length===0)return null;var L=D[0],et=D.pop();if(et!==L){D[0]=et;t:for(var K=0,at=D.length,R=at>>>1;K<R;){var Y=2*(K+1)-1,Q=D[Y],J=Y+1,rt=D[J];if(0>o(Q,et))J<at&&0>o(rt,Q)?(D[K]=rt,D[J]=et,K=J):(D[K]=Q,D[Y]=et,K=Y);else if(J<at&&0>o(rt,et))D[K]=rt,D[J]=et,K=J;else break t}}return L}function o(D,L){var et=D.sortIndex-L.sortIndex;return et!==0?et:D.id-L.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;l.unstable_now=function(){return u.now()}}else{var c=Date,h=c.now();l.unstable_now=function(){return c.now()-h}}var m=[],p=[],g=1,x=null,_=3,b=!1,T=!1,w=!1,S=!1,A=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function B(D){for(var L=n(p);L!==null;){if(L.callback===null)a(p);else if(L.startTime<=D)a(p),L.sortIndex=L.expirationTime,t(m,L);else break;L=n(p)}}function X(D){if(w=!1,B(D),!T)if(n(m)!==null)T=!0,N||(N=!0,tt());else{var L=n(p);L!==null&&At(X,L.startTime-D)}}var N=!1,G=-1,$=5,W=-1;function Z(){return S?!0:!(l.unstable_now()-W<$)}function I(){if(S=!1,N){var D=l.unstable_now();W=D;var L=!0;try{t:{T=!1,w&&(w=!1,C(G),G=-1),b=!0;var et=_;try{e:{for(B(D),x=n(m);x!==null&&!(x.expirationTime>D&&Z());){var K=x.callback;if(typeof K=="function"){x.callback=null,_=x.priorityLevel;var at=K(x.expirationTime<=D);if(D=l.unstable_now(),typeof at=="function"){x.callback=at,B(D),L=!0;break e}x===n(m)&&a(m),B(D)}else a(m);x=n(m)}if(x!==null)L=!0;else{var R=n(p);R!==null&&At(X,R.startTime-D),L=!1}}break t}finally{x=null,_=et,b=!1}L=void 0}}finally{L?tt():N=!1}}}var tt;if(typeof E=="function")tt=function(){E(I)};else if(typeof MessageChannel<"u"){var it=new MessageChannel,nt=it.port2;it.port1.onmessage=I,tt=function(){nt.postMessage(null)}}else tt=function(){A(I,0)};function At(D,L){G=A(function(){D(l.unstable_now())},L)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(D){D.callback=null},l.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<D?Math.floor(1e3/D):5},l.unstable_getCurrentPriorityLevel=function(){return _},l.unstable_next=function(D){switch(_){case 1:case 2:case 3:var L=3;break;default:L=_}var et=_;_=L;try{return D()}finally{_=et}},l.unstable_requestPaint=function(){S=!0},l.unstable_runWithPriority=function(D,L){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var et=_;_=D;try{return L()}finally{_=et}},l.unstable_scheduleCallback=function(D,L,et){var K=l.unstable_now();switch(typeof et=="object"&&et!==null?(et=et.delay,et=typeof et=="number"&&0<et?K+et:K):et=K,D){case 1:var at=-1;break;case 2:at=250;break;case 5:at=1073741823;break;case 4:at=1e4;break;default:at=5e3}return at=et+at,D={id:g++,callback:L,priorityLevel:D,startTime:et,expirationTime:at,sortIndex:-1},et>K?(D.sortIndex=et,t(p,D),n(m)===null&&D===n(p)&&(w?(C(G),G=-1):w=!0,At(X,et-K))):(D.sortIndex=at,t(m,D),T||b||(T=!0,N||(N=!0,tt()))),D},l.unstable_shouldYield=Z,l.unstable_wrapCallback=function(D){var L=_;return function(){var et=_;_=L;try{return D.apply(this,arguments)}finally{_=et}}}})(Ec)),Ec}var Zp;function v1(){return Zp||(Zp=1,Mc.exports=b1()),Mc.exports}var Rc={exports:{}},me={};/**
|
|
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 Ip;function S1(){if(Ip)return me;Ip=1;var l=Mh();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(m,p,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:m,containerInfo:p,implementation:g}}var c=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return me.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,me.createPortal=function(m,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return u(m,p,null,g)},me.flushSync=function(m){var p=c.T,g=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=p,a.p=g,a.d.f()}},me.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},me.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},me.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var g=p.as,x=h(g,p.crossOrigin),_=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:_,fetchPriority:b}):g==="script"&&a.d.X(m,{crossOrigin:x,integrity:_,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},me.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=h(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},me.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,x=h(g,p.crossOrigin);a.d.L(m,g,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},me.preloadModule=function(m,p){if(typeof m=="string")if(p){var g=h(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},me.requestFormReset=function(m){a.d.r(m)},me.unstable_batchedUpdates=function(m,p){return m(p)},me.useFormState=function(m,p,g){return c.H.useFormState(m,p,g)},me.useFormStatus=function(){return c.H.useHostTransitionStatus()},me.version="19.2.4",me}var Kp;function T1(){if(Kp)return Rc.exports;Kp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(t){console.error(t)}}return l(),Rc.exports=S1(),Rc.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 $p;function A1(){if($p)return Va;$p=1;var l=v1(),t=Mh(),n=T1();function a(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var i=e,s=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(s=i.return),e=i.return;while(e)}return i.tag===3?s:null}function c(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function h(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(a(188))}function p(e){var i=e.alternate;if(!i){if(i=u(e),i===null)throw Error(a(188));return i!==e?null:e}for(var s=e,r=i;;){var f=s.return;if(f===null)break;var d=f.alternate;if(d===null){if(r=f.return,r!==null){s=r;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===s)return m(f),e;if(d===r)return m(f),i;d=d.sibling}throw Error(a(188))}if(s.return!==r.return)s=f,r=d;else{for(var y=!1,v=f.child;v;){if(v===s){y=!0,s=f,r=d;break}if(v===r){y=!0,r=f,s=d;break}v=v.sibling}if(!y){for(v=d.child;v;){if(v===s){y=!0,s=d,r=f;break}if(v===r){y=!0,r=d,s=f;break}v=v.sibling}if(!y)throw Error(a(189))}}if(s.alternate!==r)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?e:i}function g(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=g(e),i!==null)return i;e=e.sibling}return null}var x=Object.assign,_=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function tt(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var it=Symbol.for("react.client.reference");function nt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===it?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case A:return"Profiler";case S:return"StrictMode";case X:return"Suspense";case N:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case E:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case B:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return i=e.displayName||null,i!==null?i:nt(e.type)||"Memo";case $:i=e._payload,e=e._init;try{return nt(e(i))}catch{}}return null}var At=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,et={pending:!1,data:null,method:null,action:null},K=[],at=-1;function R(e){return{current:e}}function Y(e){0>at||(e.current=K[at],K[at]=null,at--)}function Q(e,i){at++,K[at]=e.current,e.current=i}var J=R(null),rt=R(null),ct=R(null),ft=R(null);function Ht(e,i){switch(Q(ct,i),Q(rt,e),Q(J,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=dp(i),e=mp(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(J),Q(J,e)}function Et(){Y(J),Y(rt),Y(ct)}function Pe(e){e.memoizedState!==null&&Q(ft,e);var i=J.current,s=mp(i,e.type);i!==s&&(Q(rt,e),Q(J,s))}function Qi(e){rt.current===e&&(Y(J),Y(rt)),ft.current===e&&(Y(ft),La._currentValue=et)}var ri,mi;function ye(e){if(ri===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ri=i&&i[1]||"",mi=-1<s.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+ri+e+mi}var oi=!1;function Is(e,i){if(!e||oi)return"";oi=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(j){var H=j}Reflect.construct(e,[],F)}else{try{F.call()}catch(j){H=j}e.call(F.prototype)}}else{try{throw Error()}catch(j){H=j}(F=e())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(j){if(j&&H&&typeof j.stack=="string")return[j.stack,H.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),y=d[0],v=d[1];if(y&&v){var M=y.split(`
|
|
45
|
+
`),U=v.split(`
|
|
46
|
+
`);for(f=r=0;r<M.length&&!M[r].includes("DetermineComponentFrameRoot");)r++;for(;f<U.length&&!U[f].includes("DetermineComponentFrameRoot");)f++;if(r===M.length||f===U.length)for(r=M.length-1,f=U.length-1;1<=r&&0<=f&&M[r]!==U[f];)f--;for(;1<=r&&0<=f;r--,f--)if(M[r]!==U[f]){if(r!==1||f!==1)do if(r--,f--,0>f||M[r]!==U[f]){var q=`
|
|
47
|
+
`+M[r].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=r&&0<=f);break}}}finally{oi=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?ye(s):""}function pl(e,i){switch(e.tag){case 26:case 27:case 5:return ye(e.type);case 16:return ye("Lazy");case 13:return e.child!==i&&i!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Is(e.type,!1);case 11:return Is(e.type.render,!1);case 1:return Is(e.type,!0);case 31:return ye("Activity");default:return""}}function gl(e){try{var i="",s=null;do i+=pl(e,s),s=e,e=e.return;while(e);return i}catch(r){return`
|
|
48
|
+
Error generating stack: `+r.message+`
|
|
49
|
+
`+r.stack}}var yl=Object.prototype.hasOwnProperty,uo=l.unstable_scheduleCallback,co=l.unstable_cancelCallback,Q0=l.unstable_shouldYield,W0=l.unstable_requestPaint,ze=l.unstable_now,Z0=l.unstable_getCurrentPriorityLevel,Vh=l.unstable_ImmediatePriority,Ph=l.unstable_UserBlockingPriority,xl=l.unstable_NormalPriority,I0=l.unstable_LowPriority,Fh=l.unstable_IdlePriority,K0=l.log,$0=l.unstable_setDisableYieldValue,Ks=null,De=null;function Wi(e){if(typeof K0=="function"&&$0(e),De&&typeof De.setStrictMode=="function")try{De.setStrictMode(Ks,e)}catch{}}var Be=Math.clz32?Math.clz32:ex,J0=Math.log,tx=Math.LN2;function ex(e){return e>>>=0,e===0?32:31-(J0(e)/tx|0)|0}var _l=256,bl=262144,vl=4194304;function Tn(e){var i=e&42;if(i!==0)return i;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Sl(e,i,s){var r=e.pendingLanes;if(r===0)return 0;var f=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var v=r&134217727;return v!==0?(r=v&~d,r!==0?f=Tn(r):(y&=v,y!==0?f=Tn(y):s||(s=v&~e,s!==0&&(f=Tn(s))))):(v=r&~d,v!==0?f=Tn(v):y!==0?f=Tn(y):s||(s=r&~e,s!==0&&(f=Tn(s)))),f===0?0:i!==0&&i!==f&&(i&d)===0&&(d=f&-f,s=i&-i,d>=s||d===32&&(s&4194048)!==0)?i:f}function $s(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function ix(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Qh(){var e=vl;return vl<<=1,(vl&62914560)===0&&(vl=4194304),e}function ho(e){for(var i=[],s=0;31>s;s++)i.push(e);return i}function Js(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nx(e,i,s,r,f,d){var y=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var v=e.entanglements,M=e.expirationTimes,U=e.hiddenUpdates;for(s=y&~s;0<s;){var q=31-Be(s),F=1<<q;v[q]=0,M[q]=-1;var H=U[q];if(H!==null)for(U[q]=null,q=0;q<H.length;q++){var j=H[q];j!==null&&(j.lane&=-536870913)}s&=~F}r!==0&&Wh(e,r,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~i))}function Wh(e,i,s){e.pendingLanes|=i,e.suspendedLanes&=~i;var r=31-Be(i);e.entangledLanes|=i,e.entanglements[r]=e.entanglements[r]|1073741824|s&261930}function Zh(e,i){var s=e.entangledLanes|=i;for(e=e.entanglements;s;){var r=31-Be(s),f=1<<r;f&i|e[r]&i&&(e[r]|=i),s&=~f}}function Ih(e,i){var s=i&-i;return s=(s&42)!==0?1:fo(s),(s&(e.suspendedLanes|i))!==0?0:s}function fo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function mo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kh(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:Up(e.type))}function $h(e,i){var s=L.p;try{return L.p=e,i()}finally{L.p=s}}var Zi=Math.random().toString(36).slice(2),oe="__reactFiber$"+Zi,ve="__reactProps$"+Zi,$n="__reactContainer$"+Zi,po="__reactEvents$"+Zi,sx="__reactListeners$"+Zi,ax="__reactHandles$"+Zi,Jh="__reactResources$"+Zi,ta="__reactMarker$"+Zi;function go(e){delete e[oe],delete e[ve],delete e[po],delete e[sx],delete e[ax]}function Jn(e){var i=e[oe];if(i)return i;for(var s=e.parentNode;s;){if(i=s[$n]||s[oe]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(e=vp(e);e!==null;){if(s=e[oe])return s;e=vp(e)}return i}e=s,s=e.parentNode}return null}function ts(e){if(e=e[oe]||e[$n]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function ea(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(a(33))}function es(e){var i=e[Jh];return i||(i=e[Jh]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ae(e){e[ta]=!0}var tf=new Set,ef={};function An(e,i){is(e,i),is(e+"Capture",i)}function is(e,i){for(ef[e]=i,e=0;e<i.length;e++)tf.add(i[e])}var lx=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]*$"),nf={},sf={};function rx(e){return yl.call(sf,e)?!0:yl.call(nf,e)?!1:lx.test(e)?sf[e]=!0:(nf[e]=!0,!1)}function Tl(e,i,s){if(rx(i))if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+s)}}function Al(e,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+s)}}function Si(e,i,s,r){if(r===null)e.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(i,s,""+r)}}function Fe(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function af(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ox(e,i,s){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,d=r.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return f.call(this)},set:function(y){s=""+y,d.call(this,y)}}),Object.defineProperty(e,i,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function yo(e){if(!e._valueTracker){var i=af(e)?"checked":"value";e._valueTracker=ox(e,i,""+e[i])}}function lf(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var s=i.getValue(),r="";return e&&(r=af(e)?e.checked?"true":"false":e.value),e=r,e!==s?(i.setValue(e),!0):!1}function wl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ux=/[\n"\\]/g;function Qe(e){return e.replace(ux,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function xo(e,i,s,r,f,d,y,v){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),i!=null?y==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+Fe(i)):e.value!==""+Fe(i)&&(e.value=""+Fe(i)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),i!=null?_o(e,y,Fe(i)):s!=null?_o(e,y,Fe(s)):r!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Fe(v):e.removeAttribute("name")}function rf(e,i,s,r,f,d,y,v){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),i!=null||s!=null){if(!(d!=="submit"&&d!=="reset"||i!=null)){yo(e);return}s=s!=null?""+Fe(s):"",i=i!=null?""+Fe(i):s,v||i===e.value||(e.value=i),e.defaultValue=i}r=r??f,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=v?e.checked:!!r,e.defaultChecked=!!r,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),yo(e)}function _o(e,i,s){i==="number"&&wl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function ns(e,i,s,r){if(e=e.options,i){i={};for(var f=0;f<s.length;f++)i["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=i.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&r&&(e[s].defaultSelected=!0)}else{for(s=""+Fe(s),i=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,r&&(e[f].defaultSelected=!0);return}i!==null||e[f].disabled||(i=e[f])}i!==null&&(i.selected=!0)}}function of(e,i,s){if(i!=null&&(i=""+Fe(i),i!==e.value&&(e.value=i),s==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=s!=null?""+Fe(s):""}function uf(e,i,s,r){if(i==null){if(r!=null){if(s!=null)throw Error(a(92));if(At(r)){if(1<r.length)throw Error(a(93));r=r[0]}s=r}s==null&&(s=""),i=s}s=Fe(i),e.defaultValue=s,r=e.textContent,r===s&&r!==""&&r!==null&&(e.value=r),yo(e)}function ss(e,i){if(i){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=i;return}}e.textContent=i}var cx=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 cf(e,i,s){var r=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?r?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":r?e.setProperty(i,s):typeof s!="number"||s===0||cx.has(i)?i==="float"?e.cssFloat=s:e[i]=(""+s).trim():e[i]=s+"px"}function hf(e,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(e=e.style,s!=null){for(var r in s)!s.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var f in i)r=i[f],i.hasOwnProperty(f)&&s[f]!==r&&cf(e,f,r)}else for(var d in i)i.hasOwnProperty(d)&&cf(e,d,i[d])}function bo(e){if(e.indexOf("-")===-1)return!1;switch(e){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 hx=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-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"]]),fx=/^[\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 Cl(e){return fx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ti(){}var vo=null;function So(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var as=null,ls=null;function ff(e){var i=ts(e);if(i&&(e=i.stateNode)){var s=e[ve]||null;t:switch(e=i.stateNode,i.type){case"input":if(xo(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Qe(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var r=s[i];if(r!==e&&r.form===e.form){var f=r[ve]||null;if(!f)throw Error(a(90));xo(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<s.length;i++)r=s[i],r.form===e.form&&lf(r)}break t;case"textarea":of(e,s.value,s.defaultValue);break t;case"select":i=s.value,i!=null&&ns(e,!!s.multiple,i,!1)}}}var To=!1;function df(e,i,s){if(To)return e(i,s);To=!0;try{var r=e(i);return r}finally{if(To=!1,(as!==null||ls!==null)&&(dr(),as&&(i=as,e=ls,ls=as=null,ff(i),e)))for(i=0;i<e.length;i++)ff(e[i])}}function ia(e,i){var s=e.stateNode;if(s===null)return null;var r=s[ve]||null;if(r===null)return null;s=r[i];t:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break t;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ao=!1;if(Ai)try{var na={};Object.defineProperty(na,"passive",{get:function(){Ao=!0}}),window.addEventListener("test",na,na),window.removeEventListener("test",na,na)}catch{Ao=!1}var Ii=null,wo=null,Ml=null;function mf(){if(Ml)return Ml;var e,i=wo,s=i.length,r,f="value"in Ii?Ii.value:Ii.textContent,d=f.length;for(e=0;e<s&&i[e]===f[e];e++);var y=s-e;for(r=1;r<=y&&i[s-r]===f[d-r];r++);return Ml=f.slice(e,1<r?1-r:void 0)}function El(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function Rl(){return!0}function pf(){return!1}function Se(e){function i(s,r,f,d,y){this._reactName=s,this._targetInst=f,this.type=r,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(s=e[v],this[v]=s?s(d):d[v]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Rl:pf,this.isPropagationStopped=pf,this}return x(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Rl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),i}var wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zl=Se(wn),sa=x({},wn,{view:0,detail:0}),dx=Se(sa),Co,Mo,aa,Dl=x({},sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ro,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==aa&&(aa&&e.type==="mousemove"?(Co=e.screenX-aa.screenX,Mo=e.screenY-aa.screenY):Mo=Co=0,aa=e),Co)},movementY:function(e){return"movementY"in e?e.movementY:Mo}}),gf=Se(Dl),mx=x({},Dl,{dataTransfer:0}),px=Se(mx),gx=x({},sa,{relatedTarget:0}),Eo=Se(gx),yx=x({},wn,{animationName:0,elapsedTime:0,pseudoElement:0}),xx=Se(yx),_x=x({},wn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bx=Se(_x),vx=x({},wn,{data:0}),yf=Se(vx),Sx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tx={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"},Ax={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wx(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=Ax[e])?!!i[e]:!1}function Ro(){return wx}var Cx=x({},sa,{key:function(e){if(e.key){var i=Sx[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=El(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Tx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ro,charCode:function(e){return e.type==="keypress"?El(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?El(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mx=Se(Cx),Ex=x({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xf=Se(Ex),Rx=x({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ro}),zx=Se(Rx),Dx=x({},wn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bx=Se(Dx),Ox=x({},Dl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Nx=Se(Ox),Gx=x({},wn,{newState:0,oldState:0}),kx=Se(Gx),Ux=[9,13,27,32],zo=Ai&&"CompositionEvent"in window,la=null;Ai&&"documentMode"in document&&(la=document.documentMode);var Hx=Ai&&"TextEvent"in window&&!la,_f=Ai&&(!zo||la&&8<la&&11>=la),bf=" ",vf=!1;function Sf(e,i){switch(e){case"keyup":return Ux.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rs=!1;function Lx(e,i){switch(e){case"compositionend":return Tf(i);case"keypress":return i.which!==32?null:(vf=!0,bf);case"textInput":return e=i.data,e===bf&&vf?null:e;default:return null}}function jx(e,i){if(rs)return e==="compositionend"||!zo&&Sf(e,i)?(e=mf(),Ml=wo=Ii=null,rs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return _f&&i.locale!=="ko"?null:i.data;default:return null}}var Yx={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 Af(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!Yx[e.type]:i==="textarea"}function wf(e,i,s,r){as?ls?ls.push(r):ls=[r]:as=r,i=br(i,"onChange"),0<i.length&&(s=new zl("onChange","change",null,s,r),e.push({event:s,listeners:i}))}var ra=null,oa=null;function qx(e){rp(e,0)}function Bl(e){var i=ea(e);if(lf(i))return e}function Cf(e,i){if(e==="change")return i}var Mf=!1;if(Ai){var Do;if(Ai){var Bo="oninput"in document;if(!Bo){var Ef=document.createElement("div");Ef.setAttribute("oninput","return;"),Bo=typeof Ef.oninput=="function"}Do=Bo}else Do=!1;Mf=Do&&(!document.documentMode||9<document.documentMode)}function Rf(){ra&&(ra.detachEvent("onpropertychange",zf),oa=ra=null)}function zf(e){if(e.propertyName==="value"&&Bl(oa)){var i=[];wf(i,oa,e,So(e)),df(qx,i)}}function Xx(e,i,s){e==="focusin"?(Rf(),ra=i,oa=s,ra.attachEvent("onpropertychange",zf)):e==="focusout"&&Rf()}function Vx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bl(oa)}function Px(e,i){if(e==="click")return Bl(i)}function Fx(e,i){if(e==="input"||e==="change")return Bl(i)}function Qx(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var Oe=typeof Object.is=="function"?Object.is:Qx;function ua(e,i){if(Oe(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var s=Object.keys(e),r=Object.keys(i);if(s.length!==r.length)return!1;for(r=0;r<s.length;r++){var f=s[r];if(!yl.call(i,f)||!Oe(e[f],i[f]))return!1}return!0}function Df(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bf(e,i){var s=Df(e);e=0;for(var r;s;){if(s.nodeType===3){if(r=e+s.textContent.length,e<=i&&r>=i)return{node:s,offset:i-e};e=r}t:{for(;s;){if(s.nextSibling){s=s.nextSibling;break t}s=s.parentNode}s=void 0}s=Df(s)}}function Of(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?Of(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Nf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=wl(e.document);i instanceof e.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)e=i.contentWindow;else break;i=wl(e.document)}return i}function Oo(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var Wx=Ai&&"documentMode"in document&&11>=document.documentMode,os=null,No=null,ca=null,Go=!1;function Gf(e,i,s){var r=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Go||os==null||os!==wl(r)||(r=os,"selectionStart"in r&&Oo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ca&&ua(ca,r)||(ca=r,r=br(No,"onSelect"),0<r.length&&(i=new zl("onSelect","select",null,i,s),e.push({event:i,listeners:r}),i.target=os)))}function Cn(e,i){var s={};return s[e.toLowerCase()]=i.toLowerCase(),s["Webkit"+e]="webkit"+i,s["Moz"+e]="moz"+i,s}var us={animationend:Cn("Animation","AnimationEnd"),animationiteration:Cn("Animation","AnimationIteration"),animationstart:Cn("Animation","AnimationStart"),transitionrun:Cn("Transition","TransitionRun"),transitionstart:Cn("Transition","TransitionStart"),transitioncancel:Cn("Transition","TransitionCancel"),transitionend:Cn("Transition","TransitionEnd")},ko={},kf={};Ai&&(kf=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function Mn(e){if(ko[e])return ko[e];if(!us[e])return e;var i=us[e],s;for(s in i)if(i.hasOwnProperty(s)&&s in kf)return ko[e]=i[s];return e}var Uf=Mn("animationend"),Hf=Mn("animationiteration"),Lf=Mn("animationstart"),Zx=Mn("transitionrun"),Ix=Mn("transitionstart"),Kx=Mn("transitioncancel"),jf=Mn("transitionend"),Yf=new Map,Uo="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(" ");Uo.push("scrollEnd");function ui(e,i){Yf.set(e,i),An(i,[e])}var Ol=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},We=[],cs=0,Ho=0;function Nl(){for(var e=cs,i=Ho=cs=0;i<e;){var s=We[i];We[i++]=null;var r=We[i];We[i++]=null;var f=We[i];We[i++]=null;var d=We[i];if(We[i++]=null,r!==null&&f!==null){var y=r.pending;y===null?f.next=f:(f.next=y.next,y.next=f),r.pending=f}d!==0&&qf(s,f,d)}}function Gl(e,i,s,r){We[cs++]=e,We[cs++]=i,We[cs++]=s,We[cs++]=r,Ho|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Lo(e,i,s,r){return Gl(e,i,s,r),kl(e)}function En(e,i){return Gl(e,null,null,i),kl(e)}function qf(e,i,s){e.lanes|=s;var r=e.alternate;r!==null&&(r.lanes|=s);for(var f=!1,d=e.return;d!==null;)d.childLanes|=s,r=d.alternate,r!==null&&(r.childLanes|=s),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(f=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,f&&i!==null&&(f=31-Be(s),e=d.hiddenUpdates,r=e[f],r===null?e[f]=[i]:r.push(i),i.lane=s|536870912),d):null}function kl(e){if(50<Ba)throw Ba=0,Wu=null,Error(a(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var hs={};function $x(e,i,s,r){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ne(e,i,s,r){return new $x(e,i,s,r)}function jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wi(e,i){var s=e.alternate;return s===null?(s=Ne(e.tag,i,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=i,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,i=e.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Xf(e,i){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=i,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,i=s.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function Ul(e,i,s,r,f,d){var y=0;if(r=e,typeof e=="function")jo(e)&&(y=1);else if(typeof e=="string")y=n1(e,s,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case W:return e=Ne(31,s,i,f),e.elementType=W,e.lanes=d,e;case w:return Rn(s.children,f,d,i);case S:y=8,f|=24;break;case A:return e=Ne(12,s,i,f|2),e.elementType=A,e.lanes=d,e;case X:return e=Ne(13,s,i,f),e.elementType=X,e.lanes=d,e;case N:return e=Ne(19,s,i,f),e.elementType=N,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:y=10;break t;case C:y=9;break t;case B:y=11;break t;case G:y=14;break t;case $:y=16,r=null;break t}y=29,s=Error(a(130,e===null?"null":typeof e,"")),r=null}return i=Ne(y,s,i,f),i.elementType=e,i.type=r,i.lanes=d,i}function Rn(e,i,s,r){return e=Ne(7,e,r,i),e.lanes=s,e}function Yo(e,i,s){return e=Ne(6,e,null,i),e.lanes=s,e}function Vf(e){var i=Ne(18,null,null,0);return i.stateNode=e,i}function qo(e,i,s){return i=Ne(4,e.children!==null?e.children:[],e.key,i),i.lanes=s,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Pf=new WeakMap;function Ze(e,i){if(typeof e=="object"&&e!==null){var s=Pf.get(e);return s!==void 0?s:(i={value:e,source:i,stack:gl(i)},Pf.set(e,i),i)}return{value:e,source:i,stack:gl(i)}}var fs=[],ds=0,Hl=null,ha=0,Ie=[],Ke=0,Ki=null,pi=1,gi="";function Ci(e,i){fs[ds++]=ha,fs[ds++]=Hl,Hl=e,ha=i}function Ff(e,i,s){Ie[Ke++]=pi,Ie[Ke++]=gi,Ie[Ke++]=Ki,Ki=e;var r=pi;e=gi;var f=32-Be(r)-1;r&=~(1<<f),s+=1;var d=32-Be(i)+f;if(30<d){var y=f-f%5;d=(r&(1<<y)-1).toString(32),r>>=y,f-=y,pi=1<<32-Be(i)+f|s<<f|r,gi=d+e}else pi=1<<d|s<<f|r,gi=e}function Xo(e){e.return!==null&&(Ci(e,1),Ff(e,1,0))}function Vo(e){for(;e===Hl;)Hl=fs[--ds],fs[ds]=null,ha=fs[--ds],fs[ds]=null;for(;e===Ki;)Ki=Ie[--Ke],Ie[Ke]=null,gi=Ie[--Ke],Ie[Ke]=null,pi=Ie[--Ke],Ie[Ke]=null}function Qf(e,i){Ie[Ke++]=pi,Ie[Ke++]=gi,Ie[Ke++]=Ki,pi=i.id,gi=i.overflow,Ki=e}var ue=null,Lt=null,Tt=!1,$i=null,$e=!1,Po=Error(a(519));function Ji(e){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fa(Ze(i,e)),Po}function Wf(e){var i=e.stateNode,s=e.type,r=e.memoizedProps;switch(i[oe]=e,i[ve]=r,s){case"dialog":_t("cancel",i),_t("close",i);break;case"iframe":case"object":case"embed":_t("load",i);break;case"video":case"audio":for(s=0;s<Na.length;s++)_t(Na[s],i);break;case"source":_t("error",i);break;case"img":case"image":case"link":_t("error",i),_t("load",i);break;case"details":_t("toggle",i);break;case"input":_t("invalid",i),rf(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":_t("invalid",i);break;case"textarea":_t("invalid",i),uf(i,r.value,r.defaultValue,r.children)}s=r.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||r.suppressHydrationWarning===!0||hp(i.textContent,s)?(r.popover!=null&&(_t("beforetoggle",i),_t("toggle",i)),r.onScroll!=null&&_t("scroll",i),r.onScrollEnd!=null&&_t("scrollend",i),r.onClick!=null&&(i.onclick=Ti),i=!0):i=!1,i||Ji(e,!0)}function Zf(e){for(ue=e.return;ue;)switch(ue.tag){case 5:case 31:case 13:$e=!1;return;case 27:case 3:$e=!0;return;default:ue=ue.return}}function ms(e){if(e!==ue)return!1;if(!Tt)return Zf(e),Tt=!0,!1;var i=e.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||uc(e.type,e.memoizedProps)),s=!s),s&&Lt&&Ji(e),Zf(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Lt=bp(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Lt=bp(e)}else i===27?(i=Lt,mn(e.type)?(e=mc,mc=null,Lt=e):Lt=i):Lt=ue?ti(e.stateNode.nextSibling):null;return!0}function zn(){Lt=ue=null,Tt=!1}function Fo(){var e=$i;return e!==null&&(Ce===null?Ce=e:Ce.push.apply(Ce,e),$i=null),e}function fa(e){$i===null?$i=[e]:$i.push(e)}var Qo=R(null),Dn=null,Mi=null;function tn(e,i,s){Q(Qo,i._currentValue),i._currentValue=s}function Ei(e){e._currentValue=Qo.current,Y(Qo)}function Wo(e,i,s){for(;e!==null;){var r=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),e===s)break;e=e.return}}function Zo(e,i,s,r){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var d=f.dependencies;if(d!==null){var y=f.child;d=d.firstContext;t:for(;d!==null;){var v=d;d=f;for(var M=0;M<i.length;M++)if(v.context===i[M]){d.lanes|=s,v=d.alternate,v!==null&&(v.lanes|=s),Wo(d.return,s,e),r||(y=null);break t}d=v.next}}else if(f.tag===18){if(y=f.return,y===null)throw Error(a(341));y.lanes|=s,d=y.alternate,d!==null&&(d.lanes|=s),Wo(y,s,e),y=null}else y=f.child;if(y!==null)y.return=f;else for(y=f;y!==null;){if(y===e){y=null;break}if(f=y.sibling,f!==null){f.return=y.return,y=f;break}y=y.return}f=y}}function ps(e,i,s,r){e=null;for(var f=i,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var y=f.alternate;if(y===null)throw Error(a(387));if(y=y.memoizedProps,y!==null){var v=f.type;Oe(f.pendingProps.value,y.value)||(e!==null?e.push(v):e=[v])}}else if(f===ft.current){if(y=f.alternate,y===null)throw Error(a(387));y.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(La):e=[La])}f=f.return}e!==null&&Zo(i,e,s,r),i.flags|=262144}function Ll(e){for(e=e.firstContext;e!==null;){if(!Oe(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bn(e){Dn=e,Mi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ce(e){return If(Dn,e)}function jl(e,i){return Dn===null&&Bn(e),If(e,i)}function If(e,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Mi===null){if(e===null)throw Error(a(308));Mi=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else Mi=Mi.next=i;return s}var Jx=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(s,r){e.push(r)}};this.abort=function(){i.aborted=!0,e.forEach(function(s){return s()})}},t_=l.unstable_scheduleCallback,e_=l.unstable_NormalPriority,$t={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Io(){return{controller:new Jx,data:new Map,refCount:0}}function da(e){e.refCount--,e.refCount===0&&t_(e_,function(){e.controller.abort()})}var ma=null,Ko=0,gs=0,ys=null;function i_(e,i){if(ma===null){var s=ma=[];Ko=0,gs=tc(),ys={status:"pending",value:void 0,then:function(r){s.push(r)}}}return Ko++,i.then(Kf,Kf),i}function Kf(){if(--Ko===0&&ma!==null){ys!==null&&(ys.status="fulfilled");var e=ma;ma=null,gs=0,ys=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function n_(e,i){var s=[],r={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){r.status="fulfilled",r.value=i;for(var f=0;f<s.length;f++)(0,s[f])(i)},function(f){for(r.status="rejected",r.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),r}var $f=D.S;D.S=function(e,i){Gm=ze(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i_(e,i),$f!==null&&$f(e,i)};var On=R(null);function $o(){var e=On.current;return e!==null?e:kt.pooledCache}function Yl(e,i){i===null?Q(On,On.current):Q(On,i.pool)}function Jf(){var e=$o();return e===null?null:{parent:$t._currentValue,pool:e}}var xs=Error(a(460)),Jo=Error(a(474)),ql=Error(a(542)),Xl={then:function(){}};function td(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ed(e,i,s){switch(s=e[s],s===void 0?e.push(i):s!==i&&(i.then(Ti,Ti),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,nd(e),e;default:if(typeof i.status=="string")i.then(Ti,Ti);else{if(e=kt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=i,e.status="pending",e.then(function(r){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=r}},function(r){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=r}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,nd(e),e}throw Gn=i,xs}}function Nn(e){try{var i=e._init;return i(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Gn=s,xs):s}}var Gn=null;function id(){if(Gn===null)throw Error(a(459));var e=Gn;return Gn=null,e}function nd(e){if(e===xs||e===ql)throw Error(a(483))}var _s=null,pa=0;function Vl(e){var i=pa;return pa+=1,_s===null&&(_s=[]),ed(_s,e,i)}function ga(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function Pl(e,i){throw i.$$typeof===_?Error(a(525)):(e=Object.prototype.toString.call(i),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function sd(e){function i(O,z){if(e){var k=O.deletions;k===null?(O.deletions=[z],O.flags|=16):k.push(z)}}function s(O,z){if(!e)return null;for(;z!==null;)i(O,z),z=z.sibling;return null}function r(O){for(var z=new Map;O!==null;)O.key!==null?z.set(O.key,O):z.set(O.index,O),O=O.sibling;return z}function f(O,z){return O=wi(O,z),O.index=0,O.sibling=null,O}function d(O,z,k){return O.index=k,e?(k=O.alternate,k!==null?(k=k.index,k<z?(O.flags|=67108866,z):k):(O.flags|=67108866,z)):(O.flags|=1048576,z)}function y(O){return e&&O.alternate===null&&(O.flags|=67108866),O}function v(O,z,k,P){return z===null||z.tag!==6?(z=Yo(k,O.mode,P),z.return=O,z):(z=f(z,k),z.return=O,z)}function M(O,z,k,P){var ot=k.type;return ot===w?q(O,z,k.props.children,P,k.key):z!==null&&(z.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===$&&Nn(ot)===z.type)?(z=f(z,k.props),ga(z,k),z.return=O,z):(z=Ul(k.type,k.key,k.props,null,O.mode,P),ga(z,k),z.return=O,z)}function U(O,z,k,P){return z===null||z.tag!==4||z.stateNode.containerInfo!==k.containerInfo||z.stateNode.implementation!==k.implementation?(z=qo(k,O.mode,P),z.return=O,z):(z=f(z,k.children||[]),z.return=O,z)}function q(O,z,k,P,ot){return z===null||z.tag!==7?(z=Rn(k,O.mode,P,ot),z.return=O,z):(z=f(z,k),z.return=O,z)}function F(O,z,k){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Yo(""+z,O.mode,k),z.return=O,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case b:return k=Ul(z.type,z.key,z.props,null,O.mode,k),ga(k,z),k.return=O,k;case T:return z=qo(z,O.mode,k),z.return=O,z;case $:return z=Nn(z),F(O,z,k)}if(At(z)||tt(z))return z=Rn(z,O.mode,k,null),z.return=O,z;if(typeof z.then=="function")return F(O,Vl(z),k);if(z.$$typeof===E)return F(O,jl(O,z),k);Pl(O,z)}return null}function H(O,z,k,P){var ot=z!==null?z.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return ot!==null?null:v(O,z,""+k,P);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case b:return k.key===ot?M(O,z,k,P):null;case T:return k.key===ot?U(O,z,k,P):null;case $:return k=Nn(k),H(O,z,k,P)}if(At(k)||tt(k))return ot!==null?null:q(O,z,k,P,null);if(typeof k.then=="function")return H(O,z,Vl(k),P);if(k.$$typeof===E)return H(O,z,jl(O,k),P);Pl(O,k)}return null}function j(O,z,k,P,ot){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return O=O.get(k)||null,v(z,O,""+P,ot);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case b:return O=O.get(P.key===null?k:P.key)||null,M(z,O,P,ot);case T:return O=O.get(P.key===null?k:P.key)||null,U(z,O,P,ot);case $:return P=Nn(P),j(O,z,k,P,ot)}if(At(P)||tt(P))return O=O.get(k)||null,q(z,O,P,ot,null);if(typeof P.then=="function")return j(O,z,k,Vl(P),ot);if(P.$$typeof===E)return j(O,z,k,jl(z,P),ot);Pl(z,P)}return null}function st(O,z,k,P){for(var ot=null,Ct=null,lt=z,pt=z=0,vt=null;lt!==null&&pt<k.length;pt++){lt.index>pt?(vt=lt,lt=null):vt=lt.sibling;var Mt=H(O,lt,k[pt],P);if(Mt===null){lt===null&&(lt=vt);break}e&<&&Mt.alternate===null&&i(O,lt),z=d(Mt,z,pt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt,lt=vt}if(pt===k.length)return s(O,lt),Tt&&Ci(O,pt),ot;if(lt===null){for(;pt<k.length;pt++)lt=F(O,k[pt],P),lt!==null&&(z=d(lt,z,pt),Ct===null?ot=lt:Ct.sibling=lt,Ct=lt);return Tt&&Ci(O,pt),ot}for(lt=r(lt);pt<k.length;pt++)vt=j(lt,O,pt,k[pt],P),vt!==null&&(e&&vt.alternate!==null&<.delete(vt.key===null?pt:vt.key),z=d(vt,z,pt),Ct===null?ot=vt:Ct.sibling=vt,Ct=vt);return e&<.forEach(function(_n){return i(O,_n)}),Tt&&Ci(O,pt),ot}function ut(O,z,k,P){if(k==null)throw Error(a(151));for(var ot=null,Ct=null,lt=z,pt=z=0,vt=null,Mt=k.next();lt!==null&&!Mt.done;pt++,Mt=k.next()){lt.index>pt?(vt=lt,lt=null):vt=lt.sibling;var _n=H(O,lt,Mt.value,P);if(_n===null){lt===null&&(lt=vt);break}e&<&&_n.alternate===null&&i(O,lt),z=d(_n,z,pt),Ct===null?ot=_n:Ct.sibling=_n,Ct=_n,lt=vt}if(Mt.done)return s(O,lt),Tt&&Ci(O,pt),ot;if(lt===null){for(;!Mt.done;pt++,Mt=k.next())Mt=F(O,Mt.value,P),Mt!==null&&(z=d(Mt,z,pt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt);return Tt&&Ci(O,pt),ot}for(lt=r(lt);!Mt.done;pt++,Mt=k.next())Mt=j(lt,O,pt,Mt.value,P),Mt!==null&&(e&&Mt.alternate!==null&<.delete(Mt.key===null?pt:Mt.key),z=d(Mt,z,pt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt);return e&<.forEach(function(m1){return i(O,m1)}),Tt&&Ci(O,pt),ot}function Nt(O,z,k,P){if(typeof k=="object"&&k!==null&&k.type===w&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case b:t:{for(var ot=k.key;z!==null;){if(z.key===ot){if(ot=k.type,ot===w){if(z.tag===7){s(O,z.sibling),P=f(z,k.props.children),P.return=O,O=P;break t}}else if(z.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===$&&Nn(ot)===z.type){s(O,z.sibling),P=f(z,k.props),ga(P,k),P.return=O,O=P;break t}s(O,z);break}else i(O,z);z=z.sibling}k.type===w?(P=Rn(k.props.children,O.mode,P,k.key),P.return=O,O=P):(P=Ul(k.type,k.key,k.props,null,O.mode,P),ga(P,k),P.return=O,O=P)}return y(O);case T:t:{for(ot=k.key;z!==null;){if(z.key===ot)if(z.tag===4&&z.stateNode.containerInfo===k.containerInfo&&z.stateNode.implementation===k.implementation){s(O,z.sibling),P=f(z,k.children||[]),P.return=O,O=P;break t}else{s(O,z);break}else i(O,z);z=z.sibling}P=qo(k,O.mode,P),P.return=O,O=P}return y(O);case $:return k=Nn(k),Nt(O,z,k,P)}if(At(k))return st(O,z,k,P);if(tt(k)){if(ot=tt(k),typeof ot!="function")throw Error(a(150));return k=ot.call(k),ut(O,z,k,P)}if(typeof k.then=="function")return Nt(O,z,Vl(k),P);if(k.$$typeof===E)return Nt(O,z,jl(O,k),P);Pl(O,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,z!==null&&z.tag===6?(s(O,z.sibling),P=f(z,k),P.return=O,O=P):(s(O,z),P=Yo(k,O.mode,P),P.return=O,O=P),y(O)):s(O,z)}return function(O,z,k,P){try{pa=0;var ot=Nt(O,z,k,P);return _s=null,ot}catch(lt){if(lt===xs||lt===ql)throw lt;var Ct=Ne(29,lt,null,O.mode);return Ct.lanes=P,Ct.return=O,Ct}finally{}}}var kn=sd(!0),ad=sd(!1),en=!1;function tu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function eu(e,i){e=e.updateQueue,i.updateQueue===e&&(i.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function nn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function sn(e,i,s){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Rt&2)!==0){var f=r.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),r.pending=i,i=kl(e),qf(e,null,s),i}return Gl(e,r,i,s),kl(e)}function ya(e,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var r=i.lanes;r&=e.pendingLanes,s|=r,i.lanes=s,Zh(e,s)}}function iu(e,i){var s=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,s===r)){var f=null,d=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};d===null?f=d=y:d=d.next=y,s=s.next}while(s!==null);d===null?f=d=i:d=d.next=i}else f=d=i;s={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=i:e.next=i,s.lastBaseUpdate=i}var nu=!1;function xa(){if(nu){var e=ys;if(e!==null)throw e}}function _a(e,i,s,r){nu=!1;var f=e.updateQueue;en=!1;var d=f.firstBaseUpdate,y=f.lastBaseUpdate,v=f.shared.pending;if(v!==null){f.shared.pending=null;var M=v,U=M.next;M.next=null,y===null?d=U:y.next=U,y=M;var q=e.alternate;q!==null&&(q=q.updateQueue,v=q.lastBaseUpdate,v!==y&&(v===null?q.firstBaseUpdate=U:v.next=U,q.lastBaseUpdate=M))}if(d!==null){var F=f.baseState;y=0,q=U=M=null,v=d;do{var H=v.lane&-536870913,j=H!==v.lane;if(j?(bt&H)===H:(r&H)===H){H!==0&&H===gs&&(nu=!0),q!==null&&(q=q.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});t:{var st=e,ut=v;H=i;var Nt=s;switch(ut.tag){case 1:if(st=ut.payload,typeof st=="function"){F=st.call(Nt,F,H);break t}F=st;break t;case 3:st.flags=st.flags&-65537|128;case 0:if(st=ut.payload,H=typeof st=="function"?st.call(Nt,F,H):st,H==null)break t;F=x({},F,H);break t;case 2:en=!0}}H=v.callback,H!==null&&(e.flags|=64,j&&(e.flags|=8192),j=f.callbacks,j===null?f.callbacks=[H]:j.push(H))}else j={lane:H,tag:v.tag,payload:v.payload,callback:v.callback,next:null},q===null?(U=q=j,M=F):q=q.next=j,y|=H;if(v=v.next,v===null){if(v=f.shared.pending,v===null)break;j=v,v=j.next,j.next=null,f.lastBaseUpdate=j,f.shared.pending=null}}while(!0);q===null&&(M=F),f.baseState=M,f.firstBaseUpdate=U,f.lastBaseUpdate=q,d===null&&(f.shared.lanes=0),un|=y,e.lanes=y,e.memoizedState=F}}function ld(e,i){if(typeof e!="function")throw Error(a(191,e));e.call(i)}function rd(e,i){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)ld(s[e],i)}var bs=R(null),Fl=R(0);function od(e,i){e=Ui,Q(Fl,e),Q(bs,i),Ui=e|i.baseLanes}function su(){Q(Fl,Ui),Q(bs,bs.current)}function au(){Ui=Fl.current,Y(bs),Y(Fl)}var Ge=R(null),Je=null;function an(e){var i=e.alternate;Q(Wt,Wt.current&1),Q(Ge,e),Je===null&&(i===null||bs.current!==null||i.memoizedState!==null)&&(Je=e)}function lu(e){Q(Wt,Wt.current),Q(Ge,e),Je===null&&(Je=e)}function ud(e){e.tag===22?(Q(Wt,Wt.current),Q(Ge,e),Je===null&&(Je=e)):ln()}function ln(){Q(Wt,Wt.current),Q(Ge,Ge.current)}function ke(e){Y(Ge),Je===e&&(Je=null),Y(Wt)}var Wt=R(0);function Ql(e){for(var i=e;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||fc(s)||dc(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ri=0,mt=null,Bt=null,Jt=null,Wl=!1,vs=!1,Un=!1,Zl=0,ba=0,Ss=null,s_=0;function Xt(){throw Error(a(321))}function ru(e,i){if(i===null)return!1;for(var s=0;s<i.length&&s<e.length;s++)if(!Oe(e[s],i[s]))return!1;return!0}function ou(e,i,s,r,f,d){return Ri=d,mt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,D.H=e===null||e.memoizedState===null?Fd:Tu,Un=!1,d=s(r,f),Un=!1,vs&&(d=hd(i,s,r,f)),cd(e),d}function cd(e){D.H=Ta;var i=Bt!==null&&Bt.next!==null;if(Ri=0,Jt=Bt=mt=null,Wl=!1,ba=0,Ss=null,i)throw Error(a(300));e===null||te||(e=e.dependencies,e!==null&&Ll(e)&&(te=!0))}function hd(e,i,s,r){mt=e;var f=0;do{if(vs&&(Ss=null),ba=0,vs=!1,25<=f)throw Error(a(301));if(f+=1,Jt=Bt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}D.H=Qd,d=i(s,r)}while(vs);return d}function a_(){var e=D.H,i=e.useState()[0];return i=typeof i.then=="function"?va(i):i,e=e.useState()[0],(Bt!==null?Bt.memoizedState:null)!==e&&(mt.flags|=1024),i}function uu(){var e=Zl!==0;return Zl=0,e}function cu(e,i,s){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~s}function hu(e){if(Wl){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}Wl=!1}Ri=0,Jt=Bt=mt=null,vs=!1,ba=Zl=0,Ss=null}function xe(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?mt.memoizedState=Jt=e:Jt=Jt.next=e,Jt}function Zt(){if(Bt===null){var e=mt.alternate;e=e!==null?e.memoizedState:null}else e=Bt.next;var i=Jt===null?mt.memoizedState:Jt.next;if(i!==null)Jt=i,Bt=e;else{if(e===null)throw mt.alternate===null?Error(a(467)):Error(a(310));Bt=e,e={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},Jt===null?mt.memoizedState=Jt=e:Jt=Jt.next=e}return Jt}function Il(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function va(e){var i=ba;return ba+=1,Ss===null&&(Ss=[]),e=ed(Ss,e,i),i=mt,(Jt===null?i.memoizedState:Jt.next)===null&&(i=i.alternate,D.H=i===null||i.memoizedState===null?Fd:Tu),e}function Kl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return va(e);if(e.$$typeof===E)return ce(e)}throw Error(a(438,String(e)))}function fu(e){var i=null,s=mt.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var r=mt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Il(),mt.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(e),r=0;r<e;r++)s[r]=Z;return i.index++,s}function zi(e,i){return typeof i=="function"?i(e):i}function $l(e){var i=Zt();return du(i,Bt,e)}function du(e,i,s){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=s;var f=e.baseQueue,d=r.pending;if(d!==null){if(f!==null){var y=f.next;f.next=d.next,d.next=y}i.baseQueue=f=d,r.pending=null}if(d=e.baseState,f===null)e.memoizedState=d;else{i=f.next;var v=y=null,M=null,U=i,q=!1;do{var F=U.lane&-536870913;if(F!==U.lane?(bt&F)===F:(Ri&F)===F){var H=U.revertLane;if(H===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),F===gs&&(q=!0);else if((Ri&H)===H){U=U.next,H===gs&&(q=!0);continue}else F={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},M===null?(v=M=F,y=d):M=M.next=F,mt.lanes|=H,un|=H;F=U.action,Un&&s(d,F),d=U.hasEagerState?U.eagerState:s(d,F)}else H={lane:F,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},M===null?(v=M=H,y=d):M=M.next=H,mt.lanes|=F,un|=F;U=U.next}while(U!==null&&U!==i);if(M===null?y=d:M.next=v,!Oe(d,e.memoizedState)&&(te=!0,q&&(s=ys,s!==null)))throw s;e.memoizedState=d,e.baseState=y,e.baseQueue=M,r.lastRenderedState=d}return f===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function mu(e){var i=Zt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=e;var r=s.dispatch,f=s.pending,d=i.memoizedState;if(f!==null){s.pending=null;var y=f=f.next;do d=e(d,y.action),y=y.next;while(y!==f);Oe(d,i.memoizedState)||(te=!0),i.memoizedState=d,i.baseQueue===null&&(i.baseState=d),s.lastRenderedState=d}return[d,r]}function fd(e,i,s){var r=mt,f=Zt(),d=Tt;if(d){if(s===void 0)throw Error(a(407));s=s()}else s=i();var y=!Oe((Bt||f).memoizedState,s);if(y&&(f.memoizedState=s,te=!0),f=f.queue,yu(pd.bind(null,r,f,e),[e]),f.getSnapshot!==i||y||Jt!==null&&Jt.memoizedState.tag&1){if(r.flags|=2048,Ts(9,{destroy:void 0},md.bind(null,r,f,s,i),null),kt===null)throw Error(a(349));d||(Ri&127)!==0||dd(r,i,s)}return s}function dd(e,i,s){e.flags|=16384,e={getSnapshot:i,value:s},i=mt.updateQueue,i===null?(i=Il(),mt.updateQueue=i,i.stores=[e]):(s=i.stores,s===null?i.stores=[e]:s.push(e))}function md(e,i,s,r){i.value=s,i.getSnapshot=r,gd(i)&&yd(e)}function pd(e,i,s){return s(function(){gd(i)&&yd(e)})}function gd(e){var i=e.getSnapshot;e=e.value;try{var s=i();return!Oe(e,s)}catch{return!0}}function yd(e){var i=En(e,2);i!==null&&Me(i,e,2)}function pu(e){var i=xe();if(typeof e=="function"){var s=e;if(e=s(),Un){Wi(!0);try{s()}finally{Wi(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:e},i}function xd(e,i,s,r){return e.baseState=s,du(e,Bt,typeof r=="function"?r:zi)}function l_(e,i,s,r,f){if(er(e))throw Error(a(485));if(e=i.action,e!==null){var d={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};D.T!==null?s(!0):d.isTransition=!1,r(d),s=i.pending,s===null?(d.next=i.pending=d,_d(i,d)):(d.next=s.next,i.pending=s.next=d)}}function _d(e,i){var s=i.action,r=i.payload,f=e.state;if(i.isTransition){var d=D.T,y={};D.T=y;try{var v=s(f,r),M=D.S;M!==null&&M(y,v),bd(e,i,v)}catch(U){gu(e,i,U)}finally{d!==null&&y.types!==null&&(d.types=y.types),D.T=d}}else try{d=s(f,r),bd(e,i,d)}catch(U){gu(e,i,U)}}function bd(e,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(r){vd(e,i,r)},function(r){return gu(e,i,r)}):vd(e,i,s)}function vd(e,i,s){i.status="fulfilled",i.value=s,Sd(i),e.state=s,i=e.pending,i!==null&&(s=i.next,s===i?e.pending=null:(s=s.next,i.next=s,_d(e,s)))}function gu(e,i,s){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=s,Sd(i),i=i.next;while(i!==r)}e.action=null}function Sd(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function Td(e,i){return i}function Ad(e,i){if(Tt){var s=kt.formState;if(s!==null){t:{var r=mt;if(Tt){if(Lt){e:{for(var f=Lt,d=$e;f.nodeType!==8;){if(!d){f=null;break e}if(f=ti(f.nextSibling),f===null){f=null;break e}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Lt=ti(f.nextSibling),r=f.data==="F!";break t}}Ji(r)}r=!1}r&&(i=s[0])}}return s=xe(),s.memoizedState=s.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Td,lastRenderedState:i},s.queue=r,s=Xd.bind(null,mt,r),r.dispatch=s,r=pu(!1),d=Su.bind(null,mt,!1,r.queue),r=xe(),f={state:i,dispatch:null,action:e,pending:null},r.queue=f,s=l_.bind(null,mt,f,d,s),f.dispatch=s,r.memoizedState=e,[i,s,!1]}function wd(e){var i=Zt();return Cd(i,Bt,e)}function Cd(e,i,s){if(i=du(e,i,Td)[0],e=$l(zi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=va(i)}catch(y){throw y===xs?ql:y}else r=i;i=Zt();var f=i.queue,d=f.dispatch;return s!==i.memoizedState&&(mt.flags|=2048,Ts(9,{destroy:void 0},r_.bind(null,f,s),null)),[r,d,e]}function r_(e,i){e.action=i}function Md(e){var i=Zt(),s=Bt;if(s!==null)return Cd(i,s,e);Zt(),i=i.memoizedState,s=Zt();var r=s.queue.dispatch;return s.memoizedState=e,[i,r,!1]}function Ts(e,i,s,r){return e={tag:e,create:s,deps:r,inst:i,next:null},i=mt.updateQueue,i===null&&(i=Il(),mt.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=e.next=e:(r=s.next,s.next=e,e.next=r,i.lastEffect=e),e}function Ed(){return Zt().memoizedState}function Jl(e,i,s,r){var f=xe();mt.flags|=e,f.memoizedState=Ts(1|i,{destroy:void 0},s,r===void 0?null:r)}function tr(e,i,s,r){var f=Zt();r=r===void 0?null:r;var d=f.memoizedState.inst;Bt!==null&&r!==null&&ru(r,Bt.memoizedState.deps)?f.memoizedState=Ts(i,d,s,r):(mt.flags|=e,f.memoizedState=Ts(1|i,d,s,r))}function Rd(e,i){Jl(8390656,8,e,i)}function yu(e,i){tr(2048,8,e,i)}function o_(e){mt.flags|=4;var i=mt.updateQueue;if(i===null)i=Il(),mt.updateQueue=i,i.events=[e];else{var s=i.events;s===null?i.events=[e]:s.push(e)}}function zd(e){var i=Zt().memoizedState;return o_({ref:i,nextImpl:e}),function(){if((Rt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Dd(e,i){return tr(4,2,e,i)}function Bd(e,i){return tr(4,4,e,i)}function Od(e,i){if(typeof i=="function"){e=e();var s=i(e);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function Nd(e,i,s){s=s!=null?s.concat([e]):null,tr(4,4,Od.bind(null,i,e),s)}function xu(){}function Gd(e,i){var s=Zt();i=i===void 0?null:i;var r=s.memoizedState;return i!==null&&ru(i,r[1])?r[0]:(s.memoizedState=[e,i],e)}function kd(e,i){var s=Zt();i=i===void 0?null:i;var r=s.memoizedState;if(i!==null&&ru(i,r[1]))return r[0];if(r=e(),Un){Wi(!0);try{e()}finally{Wi(!1)}}return s.memoizedState=[r,i],r}function _u(e,i,s){return s===void 0||(Ri&1073741824)!==0&&(bt&261930)===0?e.memoizedState=i:(e.memoizedState=s,e=Um(),mt.lanes|=e,un|=e,s)}function Ud(e,i,s,r){return Oe(s,i)?s:bs.current!==null?(e=_u(e,s,r),Oe(e,i)||(te=!0),e):(Ri&42)===0||(Ri&1073741824)!==0&&(bt&261930)===0?(te=!0,e.memoizedState=s):(e=Um(),mt.lanes|=e,un|=e,i)}function Hd(e,i,s,r,f){var d=L.p;L.p=d!==0&&8>d?d:8;var y=D.T,v={};D.T=v,Su(e,!1,i,s);try{var M=f(),U=D.S;if(U!==null&&U(v,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var q=n_(M,r);Sa(e,i,q,Le(e))}else Sa(e,i,r,Le(e))}catch(F){Sa(e,i,{then:function(){},status:"rejected",reason:F},Le())}finally{L.p=d,y!==null&&v.types!==null&&(y.types=v.types),D.T=y}}function u_(){}function bu(e,i,s,r){if(e.tag!==5)throw Error(a(476));var f=Ld(e).queue;Hd(e,f,i,et,s===null?u_:function(){return jd(e),s(r)})}function Ld(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:et,baseState:et,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:et},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:s},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function jd(e){var i=Ld(e);i.next===null&&(i=e.alternate.memoizedState),Sa(e,i.next.queue,{},Le())}function vu(){return ce(La)}function Yd(){return Zt().memoizedState}function qd(){return Zt().memoizedState}function c_(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var s=Le();e=nn(s);var r=sn(i,e,s);r!==null&&(Me(r,i,s),ya(r,i,s)),i={cache:Io()},e.payload=i;return}i=i.return}}function h_(e,i,s){var r=Le();s={lane:r,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},er(e)?Vd(i,s):(s=Lo(e,i,s,r),s!==null&&(Me(s,e,r),Pd(s,i,r)))}function Xd(e,i,s){var r=Le();Sa(e,i,s,r)}function Sa(e,i,s,r){var f={lane:r,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(er(e))Vd(i,f);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=i.lastRenderedReducer,d!==null))try{var y=i.lastRenderedState,v=d(y,s);if(f.hasEagerState=!0,f.eagerState=v,Oe(v,y))return Gl(e,i,f,0),kt===null&&Nl(),!1}catch{}finally{}if(s=Lo(e,i,f,r),s!==null)return Me(s,e,r),Pd(s,i,r),!0}return!1}function Su(e,i,s,r){if(r={lane:2,revertLane:tc(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},er(e)){if(i)throw Error(a(479))}else i=Lo(e,s,r,2),i!==null&&Me(i,e,2)}function er(e){var i=e.alternate;return e===mt||i!==null&&i===mt}function Vd(e,i){vs=Wl=!0;var s=e.pending;s===null?i.next=i:(i.next=s.next,s.next=i),e.pending=i}function Pd(e,i,s){if((s&4194048)!==0){var r=i.lanes;r&=e.pendingLanes,s|=r,i.lanes=s,Zh(e,s)}}var Ta={readContext:ce,use:Kl,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useLayoutEffect:Xt,useInsertionEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useSyncExternalStore:Xt,useId:Xt,useHostTransitionStatus:Xt,useFormState:Xt,useActionState:Xt,useOptimistic:Xt,useMemoCache:Xt,useCacheRefresh:Xt};Ta.useEffectEvent=Xt;var Fd={readContext:ce,use:Kl,useCallback:function(e,i){return xe().memoizedState=[e,i===void 0?null:i],e},useContext:ce,useEffect:Rd,useImperativeHandle:function(e,i,s){s=s!=null?s.concat([e]):null,Jl(4194308,4,Od.bind(null,i,e),s)},useLayoutEffect:function(e,i){return Jl(4194308,4,e,i)},useInsertionEffect:function(e,i){Jl(4,2,e,i)},useMemo:function(e,i){var s=xe();i=i===void 0?null:i;var r=e();if(Un){Wi(!0);try{e()}finally{Wi(!1)}}return s.memoizedState=[r,i],r},useReducer:function(e,i,s){var r=xe();if(s!==void 0){var f=s(i);if(Un){Wi(!0);try{s(i)}finally{Wi(!1)}}}else f=i;return r.memoizedState=r.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},r.queue=e,e=e.dispatch=h_.bind(null,mt,e),[r.memoizedState,e]},useRef:function(e){var i=xe();return e={current:e},i.memoizedState=e},useState:function(e){e=pu(e);var i=e.queue,s=Xd.bind(null,mt,i);return i.dispatch=s,[e.memoizedState,s]},useDebugValue:xu,useDeferredValue:function(e,i){var s=xe();return _u(s,e,i)},useTransition:function(){var e=pu(!1);return e=Hd.bind(null,mt,e.queue,!0,!1),xe().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,s){var r=mt,f=xe();if(Tt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),kt===null)throw Error(a(349));(bt&127)!==0||dd(r,i,s)}f.memoizedState=s;var d={value:s,getSnapshot:i};return f.queue=d,Rd(pd.bind(null,r,d,e),[e]),r.flags|=2048,Ts(9,{destroy:void 0},md.bind(null,r,d,s,i),null),s},useId:function(){var e=xe(),i=kt.identifierPrefix;if(Tt){var s=gi,r=pi;s=(r&~(1<<32-Be(r)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Zl++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=s_++,i="_"+i+"r_"+s.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:vu,useFormState:Ad,useActionState:Ad,useOptimistic:function(e){var i=xe();i.memoizedState=i.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Su.bind(null,mt,!0,s),s.dispatch=i,[e,i]},useMemoCache:fu,useCacheRefresh:function(){return xe().memoizedState=c_.bind(null,mt)},useEffectEvent:function(e){var i=xe(),s={impl:e};return i.memoizedState=s,function(){if((Rt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Tu={readContext:ce,use:Kl,useCallback:Gd,useContext:ce,useEffect:yu,useImperativeHandle:Nd,useInsertionEffect:Dd,useLayoutEffect:Bd,useMemo:kd,useReducer:$l,useRef:Ed,useState:function(){return $l(zi)},useDebugValue:xu,useDeferredValue:function(e,i){var s=Zt();return Ud(s,Bt.memoizedState,e,i)},useTransition:function(){var e=$l(zi)[0],i=Zt().memoizedState;return[typeof e=="boolean"?e:va(e),i]},useSyncExternalStore:fd,useId:Yd,useHostTransitionStatus:vu,useFormState:wd,useActionState:wd,useOptimistic:function(e,i){var s=Zt();return xd(s,Bt,e,i)},useMemoCache:fu,useCacheRefresh:qd};Tu.useEffectEvent=zd;var Qd={readContext:ce,use:Kl,useCallback:Gd,useContext:ce,useEffect:yu,useImperativeHandle:Nd,useInsertionEffect:Dd,useLayoutEffect:Bd,useMemo:kd,useReducer:mu,useRef:Ed,useState:function(){return mu(zi)},useDebugValue:xu,useDeferredValue:function(e,i){var s=Zt();return Bt===null?_u(s,e,i):Ud(s,Bt.memoizedState,e,i)},useTransition:function(){var e=mu(zi)[0],i=Zt().memoizedState;return[typeof e=="boolean"?e:va(e),i]},useSyncExternalStore:fd,useId:Yd,useHostTransitionStatus:vu,useFormState:Md,useActionState:Md,useOptimistic:function(e,i){var s=Zt();return Bt!==null?xd(s,Bt,e,i):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:fu,useCacheRefresh:qd};Qd.useEffectEvent=zd;function Au(e,i,s,r){i=e.memoizedState,s=s(r,i),s=s==null?i:x({},i,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var wu={enqueueSetState:function(e,i,s){e=e._reactInternals;var r=Le(),f=nn(r);f.payload=i,s!=null&&(f.callback=s),i=sn(e,f,r),i!==null&&(Me(i,e,r),ya(i,e,r))},enqueueReplaceState:function(e,i,s){e=e._reactInternals;var r=Le(),f=nn(r);f.tag=1,f.payload=i,s!=null&&(f.callback=s),i=sn(e,f,r),i!==null&&(Me(i,e,r),ya(i,e,r))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var s=Le(),r=nn(s);r.tag=2,i!=null&&(r.callback=i),i=sn(e,r,s),i!==null&&(Me(i,e,s),ya(i,e,s))}};function Wd(e,i,s,r,f,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,y):i.prototype&&i.prototype.isPureReactComponent?!ua(s,r)||!ua(f,d):!0}function Zd(e,i,s,r){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,r),i.state!==e&&wu.enqueueReplaceState(i,i.state,null)}function Hn(e,i){var s=i;if("ref"in i){s={};for(var r in i)r!=="ref"&&(s[r]=i[r])}if(e=e.defaultProps){s===i&&(s=x({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function Id(e){Ol(e)}function Kd(e){console.error(e)}function $d(e){Ol(e)}function ir(e,i){try{var s=e.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function Jd(e,i,s){try{var r=e.onCaughtError;r(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Cu(e,i,s){return s=nn(s),s.tag=3,s.payload={element:null},s.callback=function(){ir(e,i)},s}function tm(e){return e=nn(e),e.tag=3,e}function em(e,i,s,r){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var d=r.value;e.payload=function(){return f(d)},e.callback=function(){Jd(i,s,r)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Jd(i,s,r),typeof f!="function"&&(cn===null?cn=new Set([this]):cn.add(this));var v=r.stack;this.componentDidCatch(r.value,{componentStack:v!==null?v:""})})}function f_(e,i,s,r,f){if(s.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=s.alternate,i!==null&&ps(i,s,f,!0),s=Ge.current,s!==null){switch(s.tag){case 31:case 13:return Je===null?mr():s.alternate===null&&Vt===0&&(Vt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,r===Xl?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([r]):i.add(r),Ku(e,r,f)),!1;case 22:return s.flags|=65536,r===Xl?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([r]):s.add(r)),Ku(e,r,f)),!1}throw Error(a(435,s.tag))}return Ku(e,r,f),mr(),!1}if(Tt)return i=Ge.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==Po&&(e=Error(a(422),{cause:r}),fa(Ze(e,s)))):(r!==Po&&(i=Error(a(423),{cause:r}),fa(Ze(i,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,r=Ze(r,s),f=Cu(e.stateNode,r,f),iu(e,f),Vt!==4&&(Vt=2)),!1;var d=Error(a(520),{cause:r});if(d=Ze(d,s),Da===null?Da=[d]:Da.push(d),Vt!==4&&(Vt=2),i===null)return!0;r=Ze(r,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=Cu(s.stateNode,r,e),iu(s,e),!1;case 1:if(i=s.type,d=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(cn===null||!cn.has(d))))return s.flags|=65536,f&=-f,s.lanes|=f,f=tm(f),em(f,e,s,r),iu(s,f),!1}s=s.return}while(s!==null);return!1}var Mu=Error(a(461)),te=!1;function he(e,i,s,r){i.child=e===null?ad(i,null,s,r):kn(i,e.child,s,r)}function im(e,i,s,r,f){s=s.render;var d=i.ref;if("ref"in r){var y={};for(var v in r)v!=="ref"&&(y[v]=r[v])}else y=r;return Bn(i),r=ou(e,i,s,y,d,f),v=uu(),e!==null&&!te?(cu(e,i,f),Di(e,i,f)):(Tt&&v&&Xo(i),i.flags|=1,he(e,i,r,f),i.child)}function nm(e,i,s,r,f){if(e===null){var d=s.type;return typeof d=="function"&&!jo(d)&&d.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=d,sm(e,i,d,r,f)):(e=Ul(s.type,null,r,i,i.mode,f),e.ref=i.ref,e.return=i,i.child=e)}if(d=e.child,!Gu(e,f)){var y=d.memoizedProps;if(s=s.compare,s=s!==null?s:ua,s(y,r)&&e.ref===i.ref)return Di(e,i,f)}return i.flags|=1,e=wi(d,r),e.ref=i.ref,e.return=i,i.child=e}function sm(e,i,s,r,f){if(e!==null){var d=e.memoizedProps;if(ua(d,r)&&e.ref===i.ref)if(te=!1,i.pendingProps=r=d,Gu(e,f))(e.flags&131072)!==0&&(te=!0);else return i.lanes=e.lanes,Di(e,i,f)}return Eu(e,i,s,r,f)}function am(e,i,s,r){var f=r.children,d=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((i.flags&128)!==0){if(d=d!==null?d.baseLanes|s:s,e!==null){for(r=i.child=e.child,f=0;r!==null;)f=f|r.lanes|r.childLanes,r=r.sibling;r=f&~d}else r=0,i.child=null;return lm(e,i,d,s,r)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&Yl(i,d!==null?d.cachePool:null),d!==null?od(i,d):su(),ud(i);else return r=i.lanes=536870912,lm(e,i,d!==null?d.baseLanes|s:s,s,r)}else d!==null?(Yl(i,d.cachePool),od(i,d),ln(),i.memoizedState=null):(e!==null&&Yl(i,null),su(),ln());return he(e,i,f,s),i.child}function Aa(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function lm(e,i,s,r,f){var d=$o();return d=d===null?null:{parent:$t._currentValue,pool:d},i.memoizedState={baseLanes:s,cachePool:d},e!==null&&Yl(i,null),su(),ud(i),e!==null&&ps(e,i,r,!0),i.childLanes=f,null}function nr(e,i){return i=ar({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function rm(e,i,s){return kn(i,e.child,null,s),e=nr(i,i.pendingProps),e.flags|=2,ke(i),i.memoizedState=null,e}function d_(e,i,s){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(Tt){if(r.mode==="hidden")return e=nr(i,r),i.lanes=536870912,Aa(null,e);if(lu(i),(e=Lt)?(e=_p(e,$e),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:pi,overflow:gi}:null,retryLane:536870912,hydrationErrors:null},s=Vf(e),s.return=i,i.child=s,ue=i,Lt=null)):e=null,e===null)throw Ji(i);return i.lanes=536870912,null}return nr(i,r)}var d=e.memoizedState;if(d!==null){var y=d.dehydrated;if(lu(i),f)if(i.flags&256)i.flags&=-257,i=rm(e,i,s);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(a(558));else if(te||ps(e,i,s,!1),f=(s&e.childLanes)!==0,te||f){if(r=kt,r!==null&&(y=Ih(r,s),y!==0&&y!==d.retryLane))throw d.retryLane=y,En(e,y),Me(r,e,y),Mu;mr(),i=rm(e,i,s)}else e=d.treeContext,Lt=ti(y.nextSibling),ue=i,Tt=!0,$i=null,$e=!1,e!==null&&Qf(i,e),i=nr(i,r),i.flags|=4096;return i}return e=wi(e.child,{mode:r.mode,children:r.children}),e.ref=i.ref,i.child=e,e.return=i,e}function sr(e,i){var s=i.ref;if(s===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(e===null||e.ref!==s)&&(i.flags|=4194816)}}function Eu(e,i,s,r,f){return Bn(i),s=ou(e,i,s,r,void 0,f),r=uu(),e!==null&&!te?(cu(e,i,f),Di(e,i,f)):(Tt&&r&&Xo(i),i.flags|=1,he(e,i,s,f),i.child)}function om(e,i,s,r,f,d){return Bn(i),i.updateQueue=null,s=hd(i,r,s,f),cd(e),r=uu(),e!==null&&!te?(cu(e,i,d),Di(e,i,d)):(Tt&&r&&Xo(i),i.flags|=1,he(e,i,s,d),i.child)}function um(e,i,s,r,f){if(Bn(i),i.stateNode===null){var d=hs,y=s.contextType;typeof y=="object"&&y!==null&&(d=ce(y)),d=new s(r,d),i.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=wu,i.stateNode=d,d._reactInternals=i,d=i.stateNode,d.props=r,d.state=i.memoizedState,d.refs={},tu(i),y=s.contextType,d.context=typeof y=="object"&&y!==null?ce(y):hs,d.state=i.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Au(i,s,y,r),d.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&wu.enqueueReplaceState(d,d.state,null),_a(i,r,d,f),xa(),d.state=i.memoizedState),typeof d.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(e===null){d=i.stateNode;var v=i.memoizedProps,M=Hn(s,v);d.props=M;var U=d.context,q=s.contextType;y=hs,typeof q=="object"&&q!==null&&(y=ce(q));var F=s.getDerivedStateFromProps;q=typeof F=="function"||typeof d.getSnapshotBeforeUpdate=="function",v=i.pendingProps!==v,q||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v||U!==y)&&Zd(i,d,r,y),en=!1;var H=i.memoizedState;d.state=H,_a(i,r,d,f),xa(),U=i.memoizedState,v||H!==U||en?(typeof F=="function"&&(Au(i,s,F,r),U=i.memoizedState),(M=en||Wd(i,s,M,r,H,U,y))?(q||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(i.flags|=4194308)):(typeof d.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=r,i.memoizedState=U),d.props=r,d.state=U,d.context=y,r=M):(typeof d.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{d=i.stateNode,eu(e,i),y=i.memoizedProps,q=Hn(s,y),d.props=q,F=i.pendingProps,H=d.context,U=s.contextType,M=hs,typeof U=="object"&&U!==null&&(M=ce(U)),v=s.getDerivedStateFromProps,(U=typeof v=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==F||H!==M)&&Zd(i,d,r,M),en=!1,H=i.memoizedState,d.state=H,_a(i,r,d,f),xa();var j=i.memoizedState;y!==F||H!==j||en||e!==null&&e.dependencies!==null&&Ll(e.dependencies)?(typeof v=="function"&&(Au(i,s,v,r),j=i.memoizedState),(q=en||Wd(i,s,q,r,H,j,M)||e!==null&&e.dependencies!==null&&Ll(e.dependencies))?(U||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,j,M),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,j,M)),typeof d.componentDidUpdate=="function"&&(i.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(i.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=j),d.props=r,d.state=j,d.context=M,r=q):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(i.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(i.flags|=1024),r=!1)}return d=r,sr(e,i),r=(i.flags&128)!==0,d||r?(d=i.stateNode,s=r&&typeof s.getDerivedStateFromError!="function"?null:d.render(),i.flags|=1,e!==null&&r?(i.child=kn(i,e.child,null,f),i.child=kn(i,null,s,f)):he(e,i,s,f),i.memoizedState=d.state,e=i.child):e=Di(e,i,f),e}function cm(e,i,s,r){return zn(),i.flags|=256,he(e,i,s,r),i.child}var Ru={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zu(e){return{baseLanes:e,cachePool:Jf()}}function Du(e,i,s){return e=e!==null?e.childLanes&~s:0,i&&(e|=He),e}function hm(e,i,s){var r=i.pendingProps,f=!1,d=(i.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(Wt.current&2)!==0),y&&(f=!0,i.flags&=-129),y=(i.flags&32)!==0,i.flags&=-33,e===null){if(Tt){if(f?an(i):ln(),(e=Lt)?(e=_p(e,$e),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:pi,overflow:gi}:null,retryLane:536870912,hydrationErrors:null},s=Vf(e),s.return=i,i.child=s,ue=i,Lt=null)):e=null,e===null)throw Ji(i);return dc(e)?i.lanes=32:i.lanes=536870912,null}var v=r.children;return r=r.fallback,f?(ln(),f=i.mode,v=ar({mode:"hidden",children:v},f),r=Rn(r,f,s,null),v.return=i,r.return=i,v.sibling=r,i.child=v,r=i.child,r.memoizedState=zu(s),r.childLanes=Du(e,y,s),i.memoizedState=Ru,Aa(null,r)):(an(i),Bu(i,v))}var M=e.memoizedState;if(M!==null&&(v=M.dehydrated,v!==null)){if(d)i.flags&256?(an(i),i.flags&=-257,i=Ou(e,i,s)):i.memoizedState!==null?(ln(),i.child=e.child,i.flags|=128,i=null):(ln(),v=r.fallback,f=i.mode,r=ar({mode:"visible",children:r.children},f),v=Rn(v,f,s,null),v.flags|=2,r.return=i,v.return=i,r.sibling=v,i.child=r,kn(i,e.child,null,s),r=i.child,r.memoizedState=zu(s),r.childLanes=Du(e,y,s),i.memoizedState=Ru,i=Aa(null,r));else if(an(i),dc(v)){if(y=v.nextSibling&&v.nextSibling.dataset,y)var U=y.dgst;y=U,r=Error(a(419)),r.stack="",r.digest=y,fa({value:r,source:null,stack:null}),i=Ou(e,i,s)}else if(te||ps(e,i,s,!1),y=(s&e.childLanes)!==0,te||y){if(y=kt,y!==null&&(r=Ih(y,s),r!==0&&r!==M.retryLane))throw M.retryLane=r,En(e,r),Me(y,e,r),Mu;fc(v)||mr(),i=Ou(e,i,s)}else fc(v)?(i.flags|=192,i.child=e.child,i=null):(e=M.treeContext,Lt=ti(v.nextSibling),ue=i,Tt=!0,$i=null,$e=!1,e!==null&&Qf(i,e),i=Bu(i,r.children),i.flags|=4096);return i}return f?(ln(),v=r.fallback,f=i.mode,M=e.child,U=M.sibling,r=wi(M,{mode:"hidden",children:r.children}),r.subtreeFlags=M.subtreeFlags&65011712,U!==null?v=wi(U,v):(v=Rn(v,f,s,null),v.flags|=2),v.return=i,r.return=i,r.sibling=v,i.child=r,Aa(null,r),r=i.child,v=e.child.memoizedState,v===null?v=zu(s):(f=v.cachePool,f!==null?(M=$t._currentValue,f=f.parent!==M?{parent:M,pool:M}:f):f=Jf(),v={baseLanes:v.baseLanes|s,cachePool:f}),r.memoizedState=v,r.childLanes=Du(e,y,s),i.memoizedState=Ru,Aa(e.child,r)):(an(i),s=e.child,e=s.sibling,s=wi(s,{mode:"visible",children:r.children}),s.return=i,s.sibling=null,e!==null&&(y=i.deletions,y===null?(i.deletions=[e],i.flags|=16):y.push(e)),i.child=s,i.memoizedState=null,s)}function Bu(e,i){return i=ar({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function ar(e,i){return e=Ne(22,e,null,i),e.lanes=0,e}function Ou(e,i,s){return kn(i,e.child,null,s),e=Bu(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function fm(e,i,s){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i),Wo(e.return,i,s)}function Nu(e,i,s,r,f,d){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:s,tailMode:f,treeForkCount:d}:(y.isBackwards=i,y.rendering=null,y.renderingStartTime=0,y.last=r,y.tail=s,y.tailMode=f,y.treeForkCount=d)}function dm(e,i,s){var r=i.pendingProps,f=r.revealOrder,d=r.tail;r=r.children;var y=Wt.current,v=(y&2)!==0;if(v?(y=y&1|2,i.flags|=128):y&=1,Q(Wt,y),he(e,i,r,s),r=Tt?ha:0,!v&&e!==null&&(e.flags&128)!==0)t:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fm(e,s,i);else if(e.tag===19)fm(e,s,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break t;for(;e.sibling===null;){if(e.return===null||e.return===i)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(s=i.child,f=null;s!==null;)e=s.alternate,e!==null&&Ql(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=i.child,i.child=null):(f=s.sibling,s.sibling=null),Nu(i,!1,f,s,d,r);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=i.child,i.child=null;f!==null;){if(e=f.alternate,e!==null&&Ql(e)===null){i.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}Nu(i,!0,s,null,d,r);break;case"together":Nu(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function Di(e,i,s){if(e!==null&&(i.dependencies=e.dependencies),un|=i.lanes,(s&i.childLanes)===0)if(e!==null){if(ps(e,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(a(153));if(i.child!==null){for(e=i.child,s=wi(e,e.pendingProps),i.child=s,s.return=i;e.sibling!==null;)e=e.sibling,s=s.sibling=wi(e,e.pendingProps),s.return=i;s.sibling=null}return i.child}function Gu(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&Ll(e)))}function m_(e,i,s){switch(i.tag){case 3:Ht(i,i.stateNode.containerInfo),tn(i,$t,e.memoizedState.cache),zn();break;case 27:case 5:Pe(i);break;case 4:Ht(i,i.stateNode.containerInfo);break;case 10:tn(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,lu(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(an(i),i.flags|=128,null):(s&i.child.childLanes)!==0?hm(e,i,s):(an(i),e=Di(e,i,s),e!==null?e.sibling:null);an(i);break;case 19:var f=(e.flags&128)!==0;if(r=(s&i.childLanes)!==0,r||(ps(e,i,s,!1),r=(s&i.childLanes)!==0),f){if(r)return dm(e,i,s);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Q(Wt,Wt.current),r)break;return null;case 22:return i.lanes=0,am(e,i,s,i.pendingProps);case 24:tn(i,$t,e.memoizedState.cache)}return Di(e,i,s)}function mm(e,i,s){if(e!==null)if(e.memoizedProps!==i.pendingProps)te=!0;else{if(!Gu(e,s)&&(i.flags&128)===0)return te=!1,m_(e,i,s);te=(e.flags&131072)!==0}else te=!1,Tt&&(i.flags&1048576)!==0&&Ff(i,ha,i.index);switch(i.lanes=0,i.tag){case 16:t:{var r=i.pendingProps;if(e=Nn(i.elementType),i.type=e,typeof e=="function")jo(e)?(r=Hn(e,r),i.tag=1,i=um(null,i,e,r,s)):(i.tag=0,i=Eu(null,i,e,r,s));else{if(e!=null){var f=e.$$typeof;if(f===B){i.tag=11,i=im(null,i,e,r,s);break t}else if(f===G){i.tag=14,i=nm(null,i,e,r,s);break t}}throw i=nt(e)||e,Error(a(306,i,""))}}return i;case 0:return Eu(e,i,i.type,i.pendingProps,s);case 1:return r=i.type,f=Hn(r,i.pendingProps),um(e,i,r,f,s);case 3:t:{if(Ht(i,i.stateNode.containerInfo),e===null)throw Error(a(387));r=i.pendingProps;var d=i.memoizedState;f=d.element,eu(e,i),_a(i,r,null,s);var y=i.memoizedState;if(r=y.cache,tn(i,$t,r),r!==d.cache&&Zo(i,[$t],s,!0),xa(),r=y.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:y.cache},i.updateQueue.baseState=d,i.memoizedState=d,i.flags&256){i=cm(e,i,r,s);break t}else if(r!==f){f=Ze(Error(a(424)),i),fa(f),i=cm(e,i,r,s);break t}else{switch(e=i.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Lt=ti(e.firstChild),ue=i,Tt=!0,$i=null,$e=!0,s=ad(i,null,r,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(zn(),r===f){i=Di(e,i,s);break t}he(e,i,r,s)}i=i.child}return i;case 26:return sr(e,i),e===null?(s=wp(i.type,null,i.pendingProps,null))?i.memoizedState=s:Tt||(s=i.type,e=i.pendingProps,r=vr(ct.current).createElement(s),r[oe]=i,r[ve]=e,fe(r,s,e),ae(r),i.stateNode=r):i.memoizedState=wp(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return Pe(i),e===null&&Tt&&(r=i.stateNode=Sp(i.type,i.pendingProps,ct.current),ue=i,$e=!0,f=Lt,mn(i.type)?(mc=f,Lt=ti(r.firstChild)):Lt=f),he(e,i,i.pendingProps.children,s),sr(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&Tt&&((f=r=Lt)&&(r=V_(r,i.type,i.pendingProps,$e),r!==null?(i.stateNode=r,ue=i,Lt=ti(r.firstChild),$e=!1,f=!0):f=!1),f||Ji(i)),Pe(i),f=i.type,d=i.pendingProps,y=e!==null?e.memoizedProps:null,r=d.children,uc(f,d)?r=null:y!==null&&uc(f,y)&&(i.flags|=32),i.memoizedState!==null&&(f=ou(e,i,a_,null,null,s),La._currentValue=f),sr(e,i),he(e,i,r,s),i.child;case 6:return e===null&&Tt&&((e=s=Lt)&&(s=P_(s,i.pendingProps,$e),s!==null?(i.stateNode=s,ue=i,Lt=null,e=!0):e=!1),e||Ji(i)),null;case 13:return hm(e,i,s);case 4:return Ht(i,i.stateNode.containerInfo),r=i.pendingProps,e===null?i.child=kn(i,null,r,s):he(e,i,r,s),i.child;case 11:return im(e,i,i.type,i.pendingProps,s);case 7:return he(e,i,i.pendingProps,s),i.child;case 8:return he(e,i,i.pendingProps.children,s),i.child;case 12:return he(e,i,i.pendingProps.children,s),i.child;case 10:return r=i.pendingProps,tn(i,i.type,r.value),he(e,i,r.children,s),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,Bn(i),f=ce(f),r=r(f),i.flags|=1,he(e,i,r,s),i.child;case 14:return nm(e,i,i.type,i.pendingProps,s);case 15:return sm(e,i,i.type,i.pendingProps,s);case 19:return dm(e,i,s);case 31:return d_(e,i,s);case 22:return am(e,i,s,i.pendingProps);case 24:return Bn(i),r=ce($t),e===null?(f=$o(),f===null&&(f=kt,d=Io(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=s),f=d),i.memoizedState={parent:r,cache:f},tu(i),tn(i,$t,f)):((e.lanes&s)!==0&&(eu(e,i),_a(i,null,null,s),xa()),f=e.memoizedState,d=i.memoizedState,f.parent!==r?(f={parent:r,cache:r},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),tn(i,$t,r)):(r=d.cache,tn(i,$t,r),r!==f.cache&&Zo(i,[$t],s,!0))),he(e,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Bi(e){e.flags|=4}function ku(e,i,s,r,f){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Ym())e.flags|=8192;else throw Gn=Xl,Jo}else e.flags&=-16777217}function pm(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!zp(i))if(Ym())e.flags|=8192;else throw Gn=Xl,Jo}function lr(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?Qh():536870912,e.lanes|=i,Ms|=i)}function wa(e,i){if(!Tt)switch(e.tailMode){case"hidden":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function jt(e){var i=e.alternate!==null&&e.alternate.child===e.child,s=0,r=0;if(i)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,r|=f.subtreeFlags&65011712,r|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=r,e.childLanes=s,i}function p_(e,i,s){var r=i.pendingProps;switch(Vo(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(i),null;case 1:return jt(i),null;case 3:return s=i.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),Ei($t),Et(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ms(i)?Bi(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Fo())),jt(i),null;case 26:var f=i.type,d=i.memoizedState;return e===null?(Bi(i),d!==null?(jt(i),pm(i,d)):(jt(i),ku(i,f,null,r,s))):d?d!==e.memoizedState?(Bi(i),jt(i),pm(i,d)):(jt(i),i.flags&=-16777217):(e=e.memoizedProps,e!==r&&Bi(i),jt(i),ku(i,f,e,r,s)),null;case 27:if(Qi(i),s=ct.current,f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&Bi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return jt(i),null}e=J.current,ms(i)?Wf(i):(e=Sp(f,r,s),i.stateNode=e,Bi(i))}return jt(i),null;case 5:if(Qi(i),f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&Bi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return jt(i),null}if(d=J.current,ms(i))Wf(i);else{var y=vr(ct.current);switch(d){case 1:d=y.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=y.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=y.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=y.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":d=y.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?y.createElement("select",{is:r.is}):y.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?y.createElement(f,{is:r.is}):y.createElement(f)}}d[oe]=i,d[ve]=r;t:for(y=i.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===i)break t;for(;y.sibling===null;){if(y.return===null||y.return===i)break t;y=y.return}y.sibling.return=y.return,y=y.sibling}i.stateNode=d;t:switch(fe(d,f,r),f){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break t;case"img":r=!0;break t;default:r=!1}r&&Bi(i)}}return jt(i),ku(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,s),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==r&&Bi(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(a(166));if(e=ct.current,ms(i)){if(e=i.stateNode,s=i.memoizedProps,r=null,f=ue,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}e[oe]=i,e=!!(e.nodeValue===s||r!==null&&r.suppressHydrationWarning===!0||hp(e.nodeValue,s)),e||Ji(i,!0)}else e=vr(e).createTextNode(r),e[oe]=i,i.stateNode=e}return jt(i),null;case 31:if(s=i.memoizedState,e===null||e.memoizedState!==null){if(r=ms(i),s!==null){if(e===null){if(!r)throw Error(a(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[oe]=i}else zn(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;jt(i),e=!1}else s=Fo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return i.flags&256?(ke(i),i):(ke(i),null);if((i.flags&128)!==0)throw Error(a(558))}return jt(i),null;case 13:if(r=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ms(i),r!==null&&r.dehydrated!==null){if(e===null){if(!f)throw Error(a(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[oe]=i}else zn(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;jt(i),f=!1}else f=Fo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(ke(i),i):(ke(i),null)}return ke(i),(i.flags&128)!==0?(i.lanes=s,i):(s=r!==null,e=e!==null&&e.memoizedState!==null,s&&(r=i.child,f=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(f=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==f&&(r.flags|=2048)),s!==e&&s&&(i.child.flags|=8192),lr(i,i.updateQueue),jt(i),null);case 4:return Et(),e===null&&sc(i.stateNode.containerInfo),jt(i),null;case 10:return Ei(i.type),jt(i),null;case 19:if(Y(Wt),r=i.memoizedState,r===null)return jt(i),null;if(f=(i.flags&128)!==0,d=r.rendering,d===null)if(f)wa(r,!1);else{if(Vt!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(d=Ql(e),d!==null){for(i.flags|=128,wa(r,!1),e=d.updateQueue,i.updateQueue=e,lr(i,e),i.subtreeFlags=0,e=s,s=i.child;s!==null;)Xf(s,e),s=s.sibling;return Q(Wt,Wt.current&1|2),Tt&&Ci(i,r.treeForkCount),i.child}e=e.sibling}r.tail!==null&&ze()>hr&&(i.flags|=128,f=!0,wa(r,!1),i.lanes=4194304)}else{if(!f)if(e=Ql(d),e!==null){if(i.flags|=128,f=!0,e=e.updateQueue,i.updateQueue=e,lr(i,e),wa(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Tt)return jt(i),null}else 2*ze()-r.renderingStartTime>hr&&s!==536870912&&(i.flags|=128,f=!0,wa(r,!1),i.lanes=4194304);r.isBackwards?(d.sibling=i.child,i.child=d):(e=r.last,e!==null?e.sibling=d:i.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ze(),e.sibling=null,s=Wt.current,Q(Wt,f?s&1|2:s&1),Tt&&Ci(i,r.treeForkCount),e):(jt(i),null);case 22:case 23:return ke(i),au(),r=i.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(s&536870912)!==0&&(i.flags&128)===0&&(jt(i),i.subtreeFlags&6&&(i.flags|=8192)):jt(i),s=i.updateQueue,s!==null&&lr(i,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(i.flags|=2048),e!==null&&Y(On),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Ei($t),jt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function g_(e,i){switch(Vo(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return Ei($t),Et(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return Qi(i),null;case 31:if(i.memoizedState!==null){if(ke(i),i.alternate===null)throw Error(a(340));zn()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(ke(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(a(340));zn()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return Y(Wt),null;case 4:return Et(),null;case 10:return Ei(i.type),null;case 22:case 23:return ke(i),au(),e!==null&&Y(On),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return Ei($t),null;case 25:return null;default:return null}}function gm(e,i){switch(Vo(i),i.tag){case 3:Ei($t),Et();break;case 26:case 27:case 5:Qi(i);break;case 4:Et();break;case 31:i.memoizedState!==null&&ke(i);break;case 13:ke(i);break;case 19:Y(Wt);break;case 10:Ei(i.type);break;case 22:case 23:ke(i),au(),e!==null&&Y(On);break;case 24:Ei($t)}}function Ca(e,i){try{var s=i.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var f=r.next;s=f;do{if((s.tag&e)===e){r=void 0;var d=s.create,y=s.inst;r=d(),y.destroy=r}s=s.next}while(s!==f)}}catch(v){Dt(i,i.return,v)}}function rn(e,i,s){try{var r=i.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var d=f.next;r=d;do{if((r.tag&e)===e){var y=r.inst,v=y.destroy;if(v!==void 0){y.destroy=void 0,f=i;var M=s,U=v;try{U()}catch(q){Dt(f,M,q)}}}r=r.next}while(r!==d)}}catch(q){Dt(i,i.return,q)}}function ym(e){var i=e.updateQueue;if(i!==null){var s=e.stateNode;try{rd(i,s)}catch(r){Dt(e,e.return,r)}}}function xm(e,i,s){s.props=Hn(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(r){Dt(e,i,r)}}function Ma(e,i){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof s=="function"?e.refCleanup=s(r):s.current=r}}catch(f){Dt(e,i,f)}}function yi(e,i){var s=e.ref,r=e.refCleanup;if(s!==null)if(typeof r=="function")try{r()}catch(f){Dt(e,i,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){Dt(e,i,f)}else s.current=null}function _m(e){var i=e.type,s=e.memoizedProps,r=e.stateNode;try{t:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&r.focus();break t;case"img":s.src?r.src=s.src:s.srcSet&&(r.srcset=s.srcSet)}}catch(f){Dt(e,e.return,f)}}function Uu(e,i,s){try{var r=e.stateNode;H_(r,e.type,s,i),r[ve]=i}catch(f){Dt(e,e.return,f)}}function bm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mn(e.type)||e.tag===4}function Hu(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||bm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&mn(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lu(e,i,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(e),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Ti));else if(r!==4&&(r===27&&mn(e.type)&&(s=e.stateNode,i=null),e=e.child,e!==null))for(Lu(e,i,s),e=e.sibling;e!==null;)Lu(e,i,s),e=e.sibling}function rr(e,i,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?s.insertBefore(e,i):s.appendChild(e);else if(r!==4&&(r===27&&mn(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(rr(e,i,s),e=e.sibling;e!==null;)rr(e,i,s),e=e.sibling}function vm(e){var i=e.stateNode,s=e.memoizedProps;try{for(var r=e.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);fe(i,r,s),i[oe]=e,i[ve]=s}catch(d){Dt(e,e.return,d)}}var Oi=!1,ee=!1,ju=!1,Sm=typeof WeakSet=="function"?WeakSet:Set,le=null;function y_(e,i){if(e=e.containerInfo,rc=Er,e=Nf(e),Oo(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else t:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var f=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{s.nodeType,d.nodeType}catch{s=null;break t}var y=0,v=-1,M=-1,U=0,q=0,F=e,H=null;e:for(;;){for(var j;F!==s||f!==0&&F.nodeType!==3||(v=y+f),F!==d||r!==0&&F.nodeType!==3||(M=y+r),F.nodeType===3&&(y+=F.nodeValue.length),(j=F.firstChild)!==null;)H=F,F=j;for(;;){if(F===e)break e;if(H===s&&++U===f&&(v=y),H===d&&++q===r&&(M=y),(j=F.nextSibling)!==null)break;F=H,H=F.parentNode}F=j}s=v===-1||M===-1?null:{start:v,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(oc={focusedElem:e,selectionRange:s},Er=!1,le=i;le!==null;)if(i=le,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,le=e;else for(;le!==null;){switch(i=le,d=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)f=e[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,s=i,f=d.memoizedProps,d=d.memoizedState,r=s.stateNode;try{var st=Hn(s.type,f);e=r.getSnapshotBeforeUpdate(st,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(ut){Dt(s,s.return,ut)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,s=e.nodeType,s===9)hc(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":hc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=i.sibling,e!==null){e.return=i.return,le=e;break}le=i.return}}function Tm(e,i,s){var r=s.flags;switch(s.tag){case 0:case 11:case 15:Gi(e,s),r&4&&Ca(5,s);break;case 1:if(Gi(e,s),r&4)if(e=s.stateNode,i===null)try{e.componentDidMount()}catch(y){Dt(s,s.return,y)}else{var f=Hn(s.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(f,i,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Dt(s,s.return,y)}}r&64&&ym(s),r&512&&Ma(s,s.return);break;case 3:if(Gi(e,s),r&64&&(e=s.updateQueue,e!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{rd(e,i)}catch(y){Dt(s,s.return,y)}}break;case 27:i===null&&r&4&&vm(s);case 26:case 5:Gi(e,s),i===null&&r&4&&_m(s),r&512&&Ma(s,s.return);break;case 12:Gi(e,s);break;case 31:Gi(e,s),r&4&&Cm(e,s);break;case 13:Gi(e,s),r&4&&Mm(e,s),r&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=C_.bind(null,s),F_(e,s))));break;case 22:if(r=s.memoizedState!==null||Oi,!r){i=i!==null&&i.memoizedState!==null||ee,f=Oi;var d=ee;Oi=r,(ee=i)&&!d?ki(e,s,(s.subtreeFlags&8772)!==0):Gi(e,s),Oi=f,ee=d}break;case 30:break;default:Gi(e,s)}}function Am(e){var i=e.alternate;i!==null&&(e.alternate=null,Am(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&go(i)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Yt=null,Te=!1;function Ni(e,i,s){for(s=s.child;s!==null;)wm(e,i,s),s=s.sibling}function wm(e,i,s){if(De&&typeof De.onCommitFiberUnmount=="function")try{De.onCommitFiberUnmount(Ks,s)}catch{}switch(s.tag){case 26:ee||yi(s,i),Ni(e,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:ee||yi(s,i);var r=Yt,f=Te;mn(s.type)&&(Yt=s.stateNode,Te=!1),Ni(e,i,s),ka(s.stateNode),Yt=r,Te=f;break;case 5:ee||yi(s,i);case 6:if(r=Yt,f=Te,Yt=null,Ni(e,i,s),Yt=r,Te=f,Yt!==null)if(Te)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(s.stateNode)}catch(d){Dt(s,i,d)}else try{Yt.removeChild(s.stateNode)}catch(d){Dt(s,i,d)}break;case 18:Yt!==null&&(Te?(e=Yt,yp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Gs(e)):yp(Yt,s.stateNode));break;case 4:r=Yt,f=Te,Yt=s.stateNode.containerInfo,Te=!0,Ni(e,i,s),Yt=r,Te=f;break;case 0:case 11:case 14:case 15:rn(2,s,i),ee||rn(4,s,i),Ni(e,i,s);break;case 1:ee||(yi(s,i),r=s.stateNode,typeof r.componentWillUnmount=="function"&&xm(s,i,r)),Ni(e,i,s);break;case 21:Ni(e,i,s);break;case 22:ee=(r=ee)||s.memoizedState!==null,Ni(e,i,s),ee=r;break;default:Ni(e,i,s)}}function Cm(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gs(e)}catch(s){Dt(i,i.return,s)}}}function Mm(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gs(e)}catch(s){Dt(i,i.return,s)}}function x_(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new Sm),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new Sm),i;default:throw Error(a(435,e.tag))}}function or(e,i){var s=x_(e);i.forEach(function(r){if(!s.has(r)){s.add(r);var f=M_.bind(null,e,r);r.then(f,f)}})}function Ae(e,i){var s=i.deletions;if(s!==null)for(var r=0;r<s.length;r++){var f=s[r],d=e,y=i,v=y;t:for(;v!==null;){switch(v.tag){case 27:if(mn(v.type)){Yt=v.stateNode,Te=!1;break t}break;case 5:Yt=v.stateNode,Te=!1;break t;case 3:case 4:Yt=v.stateNode.containerInfo,Te=!0;break t}v=v.return}if(Yt===null)throw Error(a(160));wm(d,y,f),Yt=null,Te=!1,d=f.alternate,d!==null&&(d.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Em(i,e),i=i.sibling}var ci=null;function Em(e,i){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ae(i,e),we(e),r&4&&(rn(3,e,e.return),Ca(3,e),rn(5,e,e.return));break;case 1:Ae(i,e),we(e),r&512&&(ee||s===null||yi(s,s.return)),r&64&&Oi&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?r:s.concat(r))));break;case 26:var f=ci;if(Ae(i,e),we(e),r&512&&(ee||s===null||yi(s,s.return)),r&4){var d=s!==null?s.memoizedState:null;if(r=e.memoizedState,s===null)if(r===null)if(e.stateNode===null){t:{r=e.type,s=e.memoizedProps,f=f.ownerDocument||f;e:switch(r){case"title":d=f.getElementsByTagName("title")[0],(!d||d[ta]||d[oe]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(r),f.head.insertBefore(d,f.querySelector("head > title"))),fe(d,r,s),d[oe]=e,ae(d),r=d;break t;case"link":var y=Ep("link","href",f).get(r+(s.href||""));if(y){for(var v=0;v<y.length;v++)if(d=y[v],d.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&d.getAttribute("rel")===(s.rel==null?null:s.rel)&&d.getAttribute("title")===(s.title==null?null:s.title)&&d.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){y.splice(v,1);break e}}d=f.createElement(r),fe(d,r,s),f.head.appendChild(d);break;case"meta":if(y=Ep("meta","content",f).get(r+(s.content||""))){for(v=0;v<y.length;v++)if(d=y[v],d.getAttribute("content")===(s.content==null?null:""+s.content)&&d.getAttribute("name")===(s.name==null?null:s.name)&&d.getAttribute("property")===(s.property==null?null:s.property)&&d.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&d.getAttribute("charset")===(s.charSet==null?null:s.charSet)){y.splice(v,1);break e}}d=f.createElement(r),fe(d,r,s),f.head.appendChild(d);break;default:throw Error(a(468,r))}d[oe]=e,ae(d),r=d}e.stateNode=r}else Rp(f,e.type,e.stateNode);else e.stateNode=Mp(f,r,e.memoizedProps);else d!==r?(d===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):d.count--,r===null?Rp(f,e.type,e.stateNode):Mp(f,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Uu(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ae(i,e),we(e),r&512&&(ee||s===null||yi(s,s.return)),s!==null&&r&4&&Uu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ae(i,e),we(e),r&512&&(ee||s===null||yi(s,s.return)),e.flags&32){f=e.stateNode;try{ss(f,"")}catch(st){Dt(e,e.return,st)}}r&4&&e.stateNode!=null&&(f=e.memoizedProps,Uu(e,f,s!==null?s.memoizedProps:f)),r&1024&&(ju=!0);break;case 6:if(Ae(i,e),we(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,s=e.stateNode;try{s.nodeValue=r}catch(st){Dt(e,e.return,st)}}break;case 3:if(Ar=null,f=ci,ci=Sr(i.containerInfo),Ae(i,e),ci=f,we(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{Gs(i.containerInfo)}catch(st){Dt(e,e.return,st)}ju&&(ju=!1,Rm(e));break;case 4:r=ci,ci=Sr(e.stateNode.containerInfo),Ae(i,e),we(e),ci=r;break;case 12:Ae(i,e),we(e);break;case 31:Ae(i,e),we(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,or(e,r)));break;case 13:Ae(i,e),we(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(cr=ze()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,or(e,r)));break;case 22:f=e.memoizedState!==null;var M=s!==null&&s.memoizedState!==null,U=Oi,q=ee;if(Oi=U||f,ee=q||M,Ae(i,e),ee=q,Oi=U,we(e),r&8192)t:for(i=e.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(s===null||M||Oi||ee||Ln(e)),s=null,i=e;;){if(i.tag===5||i.tag===26){if(s===null){M=s=i;try{if(d=M.stateNode,f)y=d.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{v=M.stateNode;var F=M.memoizedProps.style,H=F!=null&&F.hasOwnProperty("display")?F.display:null;v.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(st){Dt(M,M.return,st)}}}else if(i.tag===6){if(s===null){M=i;try{M.stateNode.nodeValue=f?"":M.memoizedProps}catch(st){Dt(M,M.return,st)}}}else if(i.tag===18){if(s===null){M=i;try{var j=M.stateNode;f?xp(j,!0):xp(M.stateNode,!1)}catch(st){Dt(M,M.return,st)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break t;for(;i.sibling===null;){if(i.return===null||i.return===e)break t;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=e.updateQueue,r!==null&&(s=r.retryQueue,s!==null&&(r.retryQueue=null,or(e,s))));break;case 19:Ae(i,e),we(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,or(e,r)));break;case 30:break;case 21:break;default:Ae(i,e),we(e)}}function we(e){var i=e.flags;if(i&2){try{for(var s,r=e.return;r!==null;){if(bm(r)){s=r;break}r=r.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var f=s.stateNode,d=Hu(e);rr(e,d,f);break;case 5:var y=s.stateNode;s.flags&32&&(ss(y,""),s.flags&=-33);var v=Hu(e);rr(e,v,y);break;case 3:case 4:var M=s.stateNode.containerInfo,U=Hu(e);Lu(e,U,M);break;default:throw Error(a(161))}}catch(q){Dt(e,e.return,q)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function Rm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;Rm(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function Gi(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Tm(e,i.alternate,i),i=i.sibling}function Ln(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:rn(4,i,i.return),Ln(i);break;case 1:yi(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&xm(i,i.return,s),Ln(i);break;case 27:ka(i.stateNode);case 26:case 5:yi(i,i.return),Ln(i);break;case 22:i.memoizedState===null&&Ln(i);break;case 30:Ln(i);break;default:Ln(i)}e=e.sibling}}function ki(e,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=e,d=i,y=d.flags;switch(d.tag){case 0:case 11:case 15:ki(f,d,s),Ca(4,d);break;case 1:if(ki(f,d,s),r=d,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(U){Dt(r,r.return,U)}if(r=d,f=r.updateQueue,f!==null){var v=r.stateNode;try{var M=f.shared.hiddenCallbacks;if(M!==null)for(f.shared.hiddenCallbacks=null,f=0;f<M.length;f++)ld(M[f],v)}catch(U){Dt(r,r.return,U)}}s&&y&64&&ym(d),Ma(d,d.return);break;case 27:vm(d);case 26:case 5:ki(f,d,s),s&&r===null&&y&4&&_m(d),Ma(d,d.return);break;case 12:ki(f,d,s);break;case 31:ki(f,d,s),s&&y&4&&Cm(f,d);break;case 13:ki(f,d,s),s&&y&4&&Mm(f,d);break;case 22:d.memoizedState===null&&ki(f,d,s),Ma(d,d.return);break;case 30:break;default:ki(f,d,s)}i=i.sibling}}function Yu(e,i){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&da(s))}function qu(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&da(e))}function hi(e,i,s,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)zm(e,i,s,r),i=i.sibling}function zm(e,i,s,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:hi(e,i,s,r),f&2048&&Ca(9,i);break;case 1:hi(e,i,s,r);break;case 3:hi(e,i,s,r),f&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&da(e)));break;case 12:if(f&2048){hi(e,i,s,r),e=i.stateNode;try{var d=i.memoizedProps,y=d.id,v=d.onPostCommit;typeof v=="function"&&v(y,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Dt(i,i.return,M)}}else hi(e,i,s,r);break;case 31:hi(e,i,s,r);break;case 13:hi(e,i,s,r);break;case 23:break;case 22:d=i.stateNode,y=i.alternate,i.memoizedState!==null?d._visibility&2?hi(e,i,s,r):Ea(e,i):d._visibility&2?hi(e,i,s,r):(d._visibility|=2,As(e,i,s,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&Yu(y,i);break;case 24:hi(e,i,s,r),f&2048&&qu(i.alternate,i);break;default:hi(e,i,s,r)}}function As(e,i,s,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var d=e,y=i,v=s,M=r,U=y.flags;switch(y.tag){case 0:case 11:case 15:As(d,y,v,M,f),Ca(8,y);break;case 23:break;case 22:var q=y.stateNode;y.memoizedState!==null?q._visibility&2?As(d,y,v,M,f):Ea(d,y):(q._visibility|=2,As(d,y,v,M,f)),f&&U&2048&&Yu(y.alternate,y);break;case 24:As(d,y,v,M,f),f&&U&2048&&qu(y.alternate,y);break;default:As(d,y,v,M,f)}i=i.sibling}}function Ea(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=e,r=i,f=r.flags;switch(r.tag){case 22:Ea(s,r),f&2048&&Yu(r.alternate,r);break;case 24:Ea(s,r),f&2048&&qu(r.alternate,r);break;default:Ea(s,r)}i=i.sibling}}var Ra=8192;function ws(e,i,s){if(e.subtreeFlags&Ra)for(e=e.child;e!==null;)Dm(e,i,s),e=e.sibling}function Dm(e,i,s){switch(e.tag){case 26:ws(e,i,s),e.flags&Ra&&e.memoizedState!==null&&s1(s,ci,e.memoizedState,e.memoizedProps);break;case 5:ws(e,i,s);break;case 3:case 4:var r=ci;ci=Sr(e.stateNode.containerInfo),ws(e,i,s),ci=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ra,Ra=16777216,ws(e,i,s),Ra=r):ws(e,i,s));break;default:ws(e,i,s)}}function Bm(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function za(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];le=r,Nm(r,e)}Bm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Om(e),e=e.sibling}function Om(e){switch(e.tag){case 0:case 11:case 15:za(e),e.flags&2048&&rn(9,e,e.return);break;case 3:za(e);break;case 12:za(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,ur(e)):za(e);break;default:za(e)}}function ur(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];le=r,Nm(r,e)}Bm(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:rn(8,i,i.return),ur(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,ur(i));break;default:ur(i)}e=e.sibling}}function Nm(e,i){for(;le!==null;){var s=le;switch(s.tag){case 0:case 11:case 15:rn(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var r=s.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:da(s.memoizedState.cache)}if(r=s.child,r!==null)r.return=s,le=r;else t:for(s=e;le!==null;){r=le;var f=r.sibling,d=r.return;if(Am(r),r===s){le=null;break t}if(f!==null){f.return=d,le=f;break t}le=d}}}var __={getCacheForType:function(e){var i=ce($t),s=i.data.get(e);return s===void 0&&(s=e(),i.data.set(e,s)),s},cacheSignal:function(){return ce($t).controller.signal}},b_=typeof WeakMap=="function"?WeakMap:Map,Rt=0,kt=null,xt=null,bt=0,zt=0,Ue=null,on=!1,Cs=!1,Xu=!1,Ui=0,Vt=0,un=0,jn=0,Vu=0,He=0,Ms=0,Da=null,Ce=null,Pu=!1,cr=0,Gm=0,hr=1/0,fr=null,cn=null,ne=0,hn=null,Es=null,Hi=0,Fu=0,Qu=null,km=null,Ba=0,Wu=null;function Le(){return(Rt&2)!==0&&bt!==0?bt&-bt:D.T!==null?tc():Kh()}function Um(){if(He===0)if((bt&536870912)===0||Tt){var e=bl;bl<<=1,(bl&3932160)===0&&(bl=262144),He=e}else He=536870912;return e=Ge.current,e!==null&&(e.flags|=32),He}function Me(e,i,s){(e===kt&&(zt===2||zt===9)||e.cancelPendingCommit!==null)&&(Rs(e,0),fn(e,bt,He,!1)),Js(e,s),((Rt&2)===0||e!==kt)&&(e===kt&&((Rt&2)===0&&(jn|=s),Vt===4&&fn(e,bt,He,!1)),xi(e))}function Hm(e,i,s){if((Rt&6)!==0)throw Error(a(327));var r=!s&&(i&127)===0&&(i&e.expiredLanes)===0||$s(e,i),f=r?T_(e,i):Iu(e,i,!0),d=r;do{if(f===0){Cs&&!r&&fn(e,i,0,!1);break}else{if(s=e.current.alternate,d&&!v_(s)){f=Iu(e,i,!1),d=!1;continue}if(f===2){if(d=i,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){i=y;t:{var v=e;f=Da;var M=v.current.memoizedState.isDehydrated;if(M&&(Rs(v,y).flags|=256),y=Iu(v,y,!1),y!==2){if(Xu&&!M){v.errorRecoveryDisabledLanes|=d,jn|=d,f=4;break t}d=Ce,Ce=f,d!==null&&(Ce===null?Ce=d:Ce.push.apply(Ce,d))}f=y}if(d=!1,f!==2)continue}}if(f===1){Rs(e,0),fn(e,i,0,!0);break}t:{switch(r=e,d=f,d){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:fn(r,i,He,!on);break t;case 2:Ce=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(f=cr+300-ze(),10<f)){if(fn(r,i,He,!on),Sl(r,0,!0)!==0)break t;Hi=i,r.timeoutHandle=pp(Lm.bind(null,r,s,Ce,fr,Pu,i,He,jn,Ms,on,d,"Throttled",-0,0),f);break t}Lm(r,s,Ce,fr,Pu,i,He,jn,Ms,on,d,null,-0,0)}}break}while(!0);xi(e)}function Lm(e,i,s,r,f,d,y,v,M,U,q,F,H,j){if(e.timeoutHandle=-1,F=i.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ti},Dm(i,d,F);var st=(d&62914560)===d?cr-ze():(d&4194048)===d?Gm-ze():0;if(st=a1(F,st),st!==null){Hi=d,e.cancelPendingCommit=st(Qm.bind(null,e,i,d,s,r,f,y,v,M,q,F,null,H,j)),fn(e,d,y,!U);return}}Qm(e,i,d,s,r,f,y,v,M)}function v_(e){for(var i=e;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var r=0;r<s.length;r++){var f=s[r],d=f.getSnapshot;f=f.value;try{if(!Oe(d(),f))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function fn(e,i,s,r){i&=~Vu,i&=~jn,e.suspendedLanes|=i,e.pingedLanes&=~i,r&&(e.warmLanes|=i),r=e.expirationTimes;for(var f=i;0<f;){var d=31-Be(f),y=1<<d;r[d]=-1,f&=~y}s!==0&&Wh(e,s,i)}function dr(){return(Rt&6)===0?(Oa(0),!1):!0}function Zu(){if(xt!==null){if(zt===0)var e=xt.return;else e=xt,Mi=Dn=null,hu(e),_s=null,pa=0,e=xt;for(;e!==null;)gm(e.alternate,e),e=e.return;xt=null}}function Rs(e,i){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Y_(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Hi=0,Zu(),kt=e,xt=s=wi(e.current,null),bt=i,zt=0,Ue=null,on=!1,Cs=$s(e,i),Xu=!1,Ms=He=Vu=jn=un=Vt=0,Ce=Da=null,Pu=!1,(i&8)!==0&&(i|=i&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=i;0<r;){var f=31-Be(r),d=1<<f;i|=e[f],r&=~d}return Ui=i,Nl(),s}function jm(e,i){mt=null,D.H=Ta,i===xs||i===ql?(i=id(),zt=3):i===Jo?(i=id(),zt=4):zt=i===Mu?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Ue=i,xt===null&&(Vt=1,ir(e,Ze(i,e.current)))}function Ym(){var e=Ge.current;return e===null?!0:(bt&4194048)===bt?Je===null:(bt&62914560)===bt||(bt&536870912)!==0?e===Je:!1}function qm(){var e=D.H;return D.H=Ta,e===null?Ta:e}function Xm(){var e=D.A;return D.A=__,e}function mr(){Vt=4,on||(bt&4194048)!==bt&&Ge.current!==null||(Cs=!0),(un&134217727)===0&&(jn&134217727)===0||kt===null||fn(kt,bt,He,!1)}function Iu(e,i,s){var r=Rt;Rt|=2;var f=qm(),d=Xm();(kt!==e||bt!==i)&&(fr=null,Rs(e,i)),i=!1;var y=Vt;t:do try{if(zt!==0&&xt!==null){var v=xt,M=Ue;switch(zt){case 8:Zu(),y=6;break t;case 3:case 2:case 9:case 6:Ge.current===null&&(i=!0);var U=zt;if(zt=0,Ue=null,zs(e,v,M,U),s&&Cs){y=0;break t}break;default:U=zt,zt=0,Ue=null,zs(e,v,M,U)}}S_(),y=Vt;break}catch(q){jm(e,q)}while(!0);return i&&e.shellSuspendCounter++,Mi=Dn=null,Rt=r,D.H=f,D.A=d,xt===null&&(kt=null,bt=0,Nl()),y}function S_(){for(;xt!==null;)Vm(xt)}function T_(e,i){var s=Rt;Rt|=2;var r=qm(),f=Xm();kt!==e||bt!==i?(fr=null,hr=ze()+500,Rs(e,i)):Cs=$s(e,i);t:do try{if(zt!==0&&xt!==null){i=xt;var d=Ue;e:switch(zt){case 1:zt=0,Ue=null,zs(e,i,d,1);break;case 2:case 9:if(td(d)){zt=0,Ue=null,Pm(i);break}i=function(){zt!==2&&zt!==9||kt!==e||(zt=7),xi(e)},d.then(i,i);break t;case 3:zt=7;break t;case 4:zt=5;break t;case 7:td(d)?(zt=0,Ue=null,Pm(i)):(zt=0,Ue=null,zs(e,i,d,7));break;case 5:var y=null;switch(xt.tag){case 26:y=xt.memoizedState;case 5:case 27:var v=xt;if(y?zp(y):v.stateNode.complete){zt=0,Ue=null;var M=v.sibling;if(M!==null)xt=M;else{var U=v.return;U!==null?(xt=U,pr(U)):xt=null}break e}}zt=0,Ue=null,zs(e,i,d,5);break;case 6:zt=0,Ue=null,zs(e,i,d,6);break;case 8:Zu(),Vt=6;break t;default:throw Error(a(462))}}A_();break}catch(q){jm(e,q)}while(!0);return Mi=Dn=null,D.H=r,D.A=f,Rt=s,xt!==null?0:(kt=null,bt=0,Nl(),Vt)}function A_(){for(;xt!==null&&!Q0();)Vm(xt)}function Vm(e){var i=mm(e.alternate,e,Ui);e.memoizedProps=e.pendingProps,i===null?pr(e):xt=i}function Pm(e){var i=e,s=i.alternate;switch(i.tag){case 15:case 0:i=om(s,i,i.pendingProps,i.type,void 0,bt);break;case 11:i=om(s,i,i.pendingProps,i.type.render,i.ref,bt);break;case 5:hu(i);default:gm(s,i),i=xt=Xf(i,Ui),i=mm(s,i,Ui)}e.memoizedProps=e.pendingProps,i===null?pr(e):xt=i}function zs(e,i,s,r){Mi=Dn=null,hu(i),_s=null,pa=0;var f=i.return;try{if(f_(e,f,i,s,bt)){Vt=1,ir(e,Ze(s,e.current)),xt=null;return}}catch(d){if(f!==null)throw xt=f,d;Vt=1,ir(e,Ze(s,e.current)),xt=null;return}i.flags&32768?(Tt||r===1?e=!0:Cs||(bt&536870912)!==0?e=!1:(on=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ge.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fm(i,e)):pr(i)}function pr(e){var i=e;do{if((i.flags&32768)!==0){Fm(i,on);return}e=i.return;var s=p_(i.alternate,i,Ui);if(s!==null){xt=s;return}if(i=i.sibling,i!==null){xt=i;return}xt=i=e}while(i!==null);Vt===0&&(Vt=5)}function Fm(e,i){do{var s=g_(e.alternate,e);if(s!==null){s.flags&=32767,xt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(e=e.sibling,e!==null)){xt=e;return}xt=e=s}while(e!==null);Vt=6,xt=null}function Qm(e,i,s,r,f,d,y,v,M){e.cancelPendingCommit=null;do gr();while(ne!==0);if((Rt&6)!==0)throw Error(a(327));if(i!==null){if(i===e.current)throw Error(a(177));if(d=i.lanes|i.childLanes,d|=Ho,nx(e,s,d,y,v,M),e===kt&&(xt=kt=null,bt=0),Es=i,hn=e,Hi=s,Fu=d,Qu=f,km=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,E_(xl,function(){return $m(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=D.T,D.T=null,f=L.p,L.p=2,y=Rt,Rt|=4;try{y_(e,i,s)}finally{Rt=y,L.p=f,D.T=r}}ne=1,Wm(),Zm(),Im()}}function Wm(){if(ne===1){ne=0;var e=hn,i=Es,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=D.T,D.T=null;var r=L.p;L.p=2;var f=Rt;Rt|=4;try{Em(i,e);var d=oc,y=Nf(e.containerInfo),v=d.focusedElem,M=d.selectionRange;if(y!==v&&v&&v.ownerDocument&&Of(v.ownerDocument.documentElement,v)){if(M!==null&&Oo(v)){var U=M.start,q=M.end;if(q===void 0&&(q=U),"selectionStart"in v)v.selectionStart=U,v.selectionEnd=Math.min(q,v.value.length);else{var F=v.ownerDocument||document,H=F&&F.defaultView||window;if(H.getSelection){var j=H.getSelection(),st=v.textContent.length,ut=Math.min(M.start,st),Nt=M.end===void 0?ut:Math.min(M.end,st);!j.extend&&ut>Nt&&(y=Nt,Nt=ut,ut=y);var O=Bf(v,ut),z=Bf(v,Nt);if(O&&z&&(j.rangeCount!==1||j.anchorNode!==O.node||j.anchorOffset!==O.offset||j.focusNode!==z.node||j.focusOffset!==z.offset)){var k=F.createRange();k.setStart(O.node,O.offset),j.removeAllRanges(),ut>Nt?(j.addRange(k),j.extend(z.node,z.offset)):(k.setEnd(z.node,z.offset),j.addRange(k))}}}}for(F=[],j=v;j=j.parentNode;)j.nodeType===1&&F.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<F.length;v++){var P=F[v];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}Er=!!rc,oc=rc=null}finally{Rt=f,L.p=r,D.T=s}}e.current=i,ne=2}}function Zm(){if(ne===2){ne=0;var e=hn,i=Es,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=D.T,D.T=null;var r=L.p;L.p=2;var f=Rt;Rt|=4;try{Tm(e,i.alternate,i)}finally{Rt=f,L.p=r,D.T=s}}ne=3}}function Im(){if(ne===4||ne===3){ne=0,W0();var e=hn,i=Es,s=Hi,r=km;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?ne=5:(ne=0,Es=hn=null,Km(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(cn=null),mo(s),i=i.stateNode,De&&typeof De.onCommitFiberRoot=="function")try{De.onCommitFiberRoot(Ks,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=D.T,f=L.p,L.p=2,D.T=null;try{for(var d=e.onRecoverableError,y=0;y<r.length;y++){var v=r[y];d(v.value,{componentStack:v.stack})}}finally{D.T=i,L.p=f}}(Hi&3)!==0&&gr(),xi(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===Wu?Ba++:(Ba=0,Wu=e):Ba=0,Oa(0)}}function Km(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,da(i)))}function gr(){return Wm(),Zm(),Im(),$m()}function $m(){if(ne!==5)return!1;var e=hn,i=Fu;Fu=0;var s=mo(Hi),r=D.T,f=L.p;try{L.p=32>s?32:s,D.T=null,s=Qu,Qu=null;var d=hn,y=Hi;if(ne=0,Es=hn=null,Hi=0,(Rt&6)!==0)throw Error(a(331));var v=Rt;if(Rt|=4,Om(d.current),zm(d,d.current,y,s),Rt=v,Oa(0,!1),De&&typeof De.onPostCommitFiberRoot=="function")try{De.onPostCommitFiberRoot(Ks,d)}catch{}return!0}finally{L.p=f,D.T=r,Km(e,i)}}function Jm(e,i,s){i=Ze(s,i),i=Cu(e.stateNode,i,2),e=sn(e,i,2),e!==null&&(Js(e,2),xi(e))}function Dt(e,i,s){if(e.tag===3)Jm(e,e,s);else for(;i!==null;){if(i.tag===3){Jm(i,e,s);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(cn===null||!cn.has(r))){e=Ze(s,e),s=tm(2),r=sn(i,s,2),r!==null&&(em(s,r,i,e),Js(r,2),xi(r));break}}i=i.return}}function Ku(e,i,s){var r=e.pingCache;if(r===null){r=e.pingCache=new b_;var f=new Set;r.set(i,f)}else f=r.get(i),f===void 0&&(f=new Set,r.set(i,f));f.has(s)||(Xu=!0,f.add(s),e=w_.bind(null,e,i,s),i.then(e,e))}function w_(e,i,s){var r=e.pingCache;r!==null&&r.delete(i),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,kt===e&&(bt&s)===s&&(Vt===4||Vt===3&&(bt&62914560)===bt&&300>ze()-cr?(Rt&2)===0&&Rs(e,0):Vu|=s,Ms===bt&&(Ms=0)),xi(e)}function tp(e,i){i===0&&(i=Qh()),e=En(e,i),e!==null&&(Js(e,i),xi(e))}function C_(e){var i=e.memoizedState,s=0;i!==null&&(s=i.retryLane),tp(e,s)}function M_(e,i){var s=0;switch(e.tag){case 31:case 13:var r=e.stateNode,f=e.memoizedState;f!==null&&(s=f.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(i),tp(e,s)}function E_(e,i){return uo(e,i)}var yr=null,Ds=null,$u=!1,xr=!1,Ju=!1,dn=0;function xi(e){e!==Ds&&e.next===null&&(Ds===null?yr=Ds=e:Ds=Ds.next=e),xr=!0,$u||($u=!0,z_())}function Oa(e,i){if(!Ju&&xr){Ju=!0;do for(var s=!1,r=yr;r!==null;){if(e!==0){var f=r.pendingLanes;if(f===0)var d=0;else{var y=r.suspendedLanes,v=r.pingedLanes;d=(1<<31-Be(42|e)+1)-1,d&=f&~(y&~v),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(s=!0,sp(r,d))}else d=bt,d=Sl(r,r===kt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||$s(r,d)||(s=!0,sp(r,d));r=r.next}while(s);Ju=!1}}function R_(){ep()}function ep(){xr=$u=!1;var e=0;dn!==0&&j_()&&(e=dn);for(var i=ze(),s=null,r=yr;r!==null;){var f=r.next,d=ip(r,i);d===0?(r.next=null,s===null?yr=f:s.next=f,f===null&&(Ds=s)):(s=r,(e!==0||(d&3)!==0)&&(xr=!0)),r=f}ne!==0&&ne!==5||Oa(e),dn!==0&&(dn=0)}function ip(e,i){for(var s=e.suspendedLanes,r=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-Be(d),v=1<<y,M=f[y];M===-1?((v&s)===0||(v&r)!==0)&&(f[y]=ix(v,i)):M<=i&&(e.expiredLanes|=v),d&=~v}if(i=kt,s=bt,s=Sl(e,e===i?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,s===0||e===i&&(zt===2||zt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&co(r),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||$s(e,s)){if(i=s&-s,i===e.callbackPriority)return i;switch(r!==null&&co(r),mo(s)){case 2:case 8:s=Ph;break;case 32:s=xl;break;case 268435456:s=Fh;break;default:s=xl}return r=np.bind(null,e),s=uo(s,r),e.callbackPriority=i,e.callbackNode=s,i}return r!==null&&r!==null&&co(r),e.callbackPriority=2,e.callbackNode=null,2}function np(e,i){if(ne!==0&&ne!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(gr()&&e.callbackNode!==s)return null;var r=bt;return r=Sl(e,e===kt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Hm(e,r,i),ip(e,ze()),e.callbackNode!=null&&e.callbackNode===s?np.bind(null,e):null)}function sp(e,i){if(gr())return null;Hm(e,i,!0)}function z_(){q_(function(){(Rt&6)!==0?uo(Vh,R_):ep()})}function tc(){if(dn===0){var e=gs;e===0&&(e=_l,_l<<=1,(_l&261888)===0&&(_l=256)),dn=e}return dn}function ap(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Cl(""+e)}function lp(e,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,e.id&&s.setAttribute("form",e.id),i.parentNode.insertBefore(s,i),e=new FormData(e),s.parentNode.removeChild(s),e}function D_(e,i,s,r,f){if(i==="submit"&&s&&s.stateNode===f){var d=ap((f[ve]||null).action),y=r.submitter;y&&(i=(i=y[ve]||null)?ap(i.formAction):y.getAttribute("formAction"),i!==null&&(d=i,y=null));var v=new zl("action","action",null,r,f);e.push({event:v,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(dn!==0){var M=y?lp(f,y):new FormData(f);bu(s,{pending:!0,data:M,method:f.method,action:d},null,M)}}else typeof d=="function"&&(v.preventDefault(),M=y?lp(f,y):new FormData(f),bu(s,{pending:!0,data:M,method:f.method,action:d},d,M))},currentTarget:f}]})}}for(var ec=0;ec<Uo.length;ec++){var ic=Uo[ec],B_=ic.toLowerCase(),O_=ic[0].toUpperCase()+ic.slice(1);ui(B_,"on"+O_)}ui(Uf,"onAnimationEnd"),ui(Hf,"onAnimationIteration"),ui(Lf,"onAnimationStart"),ui("dblclick","onDoubleClick"),ui("focusin","onFocus"),ui("focusout","onBlur"),ui(Zx,"onTransitionRun"),ui(Ix,"onTransitionStart"),ui(Kx,"onTransitionCancel"),ui(jf,"onTransitionEnd"),is("onMouseEnter",["mouseout","mouseover"]),is("onMouseLeave",["mouseout","mouseover"]),is("onPointerEnter",["pointerout","pointerover"]),is("onPointerLeave",["pointerout","pointerover"]),An("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),An("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),An("onBeforeInput",["compositionend","keypress","textInput","paste"]),An("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),An("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),An("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Na="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(" "),N_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Na));function rp(e,i){i=(i&4)!==0;for(var s=0;s<e.length;s++){var r=e[s],f=r.event;r=r.listeners;t:{var d=void 0;if(i)for(var y=r.length-1;0<=y;y--){var v=r[y],M=v.instance,U=v.currentTarget;if(v=v.listener,M!==d&&f.isPropagationStopped())break t;d=v,f.currentTarget=U;try{d(f)}catch(q){Ol(q)}f.currentTarget=null,d=M}else for(y=0;y<r.length;y++){if(v=r[y],M=v.instance,U=v.currentTarget,v=v.listener,M!==d&&f.isPropagationStopped())break t;d=v,f.currentTarget=U;try{d(f)}catch(q){Ol(q)}f.currentTarget=null,d=M}}}}function _t(e,i){var s=i[po];s===void 0&&(s=i[po]=new Set);var r=e+"__bubble";s.has(r)||(op(i,e,2,!1),s.add(r))}function nc(e,i,s){var r=0;i&&(r|=4),op(s,e,r,i)}var _r="_reactListening"+Math.random().toString(36).slice(2);function sc(e){if(!e[_r]){e[_r]=!0,tf.forEach(function(s){s!=="selectionchange"&&(N_.has(s)||nc(s,!1,e),nc(s,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[_r]||(i[_r]=!0,nc("selectionchange",!1,i))}}function op(e,i,s,r){switch(Up(i)){case 2:var f=o1;break;case 8:f=u1;break;default:f=_c}s=f.bind(null,i,s,e),f=void 0,!Ao||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),r?f!==void 0?e.addEventListener(i,s,{capture:!0,passive:f}):e.addEventListener(i,s,!0):f!==void 0?e.addEventListener(i,s,{passive:f}):e.addEventListener(i,s,!1)}function ac(e,i,s,r,f){var d=r;if((i&1)===0&&(i&2)===0&&r!==null)t:for(;;){if(r===null)return;var y=r.tag;if(y===3||y===4){var v=r.stateNode.containerInfo;if(v===f)break;if(y===4)for(y=r.return;y!==null;){var M=y.tag;if((M===3||M===4)&&y.stateNode.containerInfo===f)return;y=y.return}for(;v!==null;){if(y=Jn(v),y===null)return;if(M=y.tag,M===5||M===6||M===26||M===27){r=d=y;continue t}v=v.parentNode}}r=r.return}df(function(){var U=d,q=So(s),F=[];t:{var H=Yf.get(e);if(H!==void 0){var j=zl,st=e;switch(e){case"keypress":if(El(s)===0)break t;case"keydown":case"keyup":j=Mx;break;case"focusin":st="focus",j=Eo;break;case"focusout":st="blur",j=Eo;break;case"beforeblur":case"afterblur":j=Eo;break;case"click":if(s.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":j=gf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=px;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=zx;break;case Uf:case Hf:case Lf:j=xx;break;case jf:j=Bx;break;case"scroll":case"scrollend":j=dx;break;case"wheel":j=Nx;break;case"copy":case"cut":case"paste":j=bx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=xf;break;case"toggle":case"beforetoggle":j=kx}var ut=(i&4)!==0,Nt=!ut&&(e==="scroll"||e==="scrollend"),O=ut?H!==null?H+"Capture":null:H;ut=[];for(var z=U,k;z!==null;){var P=z;if(k=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||k===null||O===null||(P=ia(z,O),P!=null&&ut.push(Ga(z,P,k))),Nt)break;z=z.return}0<ut.length&&(H=new j(H,st,null,s,q),F.push({event:H,listeners:ut}))}}if((i&7)===0){t:{if(H=e==="mouseover"||e==="pointerover",j=e==="mouseout"||e==="pointerout",H&&s!==vo&&(st=s.relatedTarget||s.fromElement)&&(Jn(st)||st[$n]))break t;if((j||H)&&(H=q.window===q?q:(H=q.ownerDocument)?H.defaultView||H.parentWindow:window,j?(st=s.relatedTarget||s.toElement,j=U,st=st?Jn(st):null,st!==null&&(Nt=u(st),ut=st.tag,st!==Nt||ut!==5&&ut!==27&&ut!==6)&&(st=null)):(j=null,st=U),j!==st)){if(ut=gf,P="onMouseLeave",O="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(ut=xf,P="onPointerLeave",O="onPointerEnter",z="pointer"),Nt=j==null?H:ea(j),k=st==null?H:ea(st),H=new ut(P,z+"leave",j,s,q),H.target=Nt,H.relatedTarget=k,P=null,Jn(q)===U&&(ut=new ut(O,z+"enter",st,s,q),ut.target=k,ut.relatedTarget=Nt,P=ut),Nt=P,j&&st)e:{for(ut=G_,O=j,z=st,k=0,P=O;P;P=ut(P))k++;P=0;for(var ot=z;ot;ot=ut(ot))P++;for(;0<k-P;)O=ut(O),k--;for(;0<P-k;)z=ut(z),P--;for(;k--;){if(O===z||z!==null&&O===z.alternate){ut=O;break e}O=ut(O),z=ut(z)}ut=null}else ut=null;j!==null&&up(F,H,j,ut,!1),st!==null&&Nt!==null&&up(F,Nt,st,ut,!0)}}t:{if(H=U?ea(U):window,j=H.nodeName&&H.nodeName.toLowerCase(),j==="select"||j==="input"&&H.type==="file")var Ct=Cf;else if(Af(H))if(Mf)Ct=Fx;else{Ct=Vx;var lt=Xx}else j=H.nodeName,!j||j.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?U&&bo(U.elementType)&&(Ct=Cf):Ct=Px;if(Ct&&(Ct=Ct(e,U))){wf(F,Ct,s,q);break t}lt&<(e,H,U),e==="focusout"&&U&&H.type==="number"&&U.memoizedProps.value!=null&&_o(H,"number",H.value)}switch(lt=U?ea(U):window,e){case"focusin":(Af(lt)||lt.contentEditable==="true")&&(os=lt,No=U,ca=null);break;case"focusout":ca=No=os=null;break;case"mousedown":Go=!0;break;case"contextmenu":case"mouseup":case"dragend":Go=!1,Gf(F,s,q);break;case"selectionchange":if(Wx)break;case"keydown":case"keyup":Gf(F,s,q)}var pt;if(zo)t:{switch(e){case"compositionstart":var vt="onCompositionStart";break t;case"compositionend":vt="onCompositionEnd";break t;case"compositionupdate":vt="onCompositionUpdate";break t}vt=void 0}else rs?Sf(e,s)&&(vt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(vt="onCompositionStart");vt&&(_f&&s.locale!=="ko"&&(rs||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&rs&&(pt=mf()):(Ii=q,wo="value"in Ii?Ii.value:Ii.textContent,rs=!0)),lt=br(U,vt),0<lt.length&&(vt=new yf(vt,e,null,s,q),F.push({event:vt,listeners:lt}),pt?vt.data=pt:(pt=Tf(s),pt!==null&&(vt.data=pt)))),(pt=Hx?Lx(e,s):jx(e,s))&&(vt=br(U,"onBeforeInput"),0<vt.length&&(lt=new yf("onBeforeInput","beforeinput",null,s,q),F.push({event:lt,listeners:vt}),lt.data=pt)),D_(F,e,U,s,q)}rp(F,i)})}function Ga(e,i,s){return{instance:e,listener:i,currentTarget:s}}function br(e,i){for(var s=i+"Capture",r=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=ia(e,s),f!=null&&r.unshift(Ga(e,f,d)),f=ia(e,i),f!=null&&r.push(Ga(e,f,d))),e.tag===3)return r;e=e.return}return[]}function G_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function up(e,i,s,r,f){for(var d=i._reactName,y=[];s!==null&&s!==r;){var v=s,M=v.alternate,U=v.stateNode;if(v=v.tag,M!==null&&M===r)break;v!==5&&v!==26&&v!==27||U===null||(M=U,f?(U=ia(s,d),U!=null&&y.unshift(Ga(s,U,M))):f||(U=ia(s,d),U!=null&&y.push(Ga(s,U,M)))),s=s.return}y.length!==0&&e.push({event:i,listeners:y})}var k_=/\r\n?/g,U_=/\u0000|\uFFFD/g;function cp(e){return(typeof e=="string"?e:""+e).replace(k_,`
|
|
50
|
+
`).replace(U_,"")}function hp(e,i){return i=cp(i),cp(e)===i}function Ot(e,i,s,r,f,d){switch(s){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||ss(e,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&ss(e,""+r);break;case"className":Al(e,"class",r);break;case"tabIndex":Al(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Al(e,s,r);break;case"style":hf(e,r,d);break;case"data":if(i!=="object"){Al(e,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||s!=="href")){e.removeAttribute(s);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(s);break}r=Cl(""+r),e.setAttribute(s,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(s,"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 d=="function"&&(s==="formAction"?(i!=="input"&&Ot(e,i,"name",f.name,f,null),Ot(e,i,"formEncType",f.formEncType,f,null),Ot(e,i,"formMethod",f.formMethod,f,null),Ot(e,i,"formTarget",f.formTarget,f,null)):(Ot(e,i,"encType",f.encType,f,null),Ot(e,i,"method",f.method,f,null),Ot(e,i,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(s);break}r=Cl(""+r),e.setAttribute(s,r);break;case"onClick":r!=null&&(e.onclick=Ti);break;case"onScroll":r!=null&&_t("scroll",e);break;case"onScrollEnd":r!=null&&_t("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(s=r.__html,s!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=s}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}s=Cl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,""+r):e.removeAttribute(s);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":r===!0?e.setAttribute(s,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,r):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(s,r):e.removeAttribute(s);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(s):e.setAttribute(s,r);break;case"popover":_t("beforetoggle",e),_t("toggle",e),Tl(e,"popover",r);break;case"xlinkActuate":Si(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Si(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Si(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Si(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Si(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Si(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Si(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Si(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Si(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Tl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=hx.get(s)||s,Tl(e,s,r))}}function lc(e,i,s,r,f,d){switch(s){case"style":hf(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(s=r.__html,s!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=s}}break;case"children":typeof r=="string"?ss(e,r):(typeof r=="number"||typeof r=="bigint")&&ss(e,""+r);break;case"onScroll":r!=null&&_t("scroll",e);break;case"onScrollEnd":r!=null&&_t("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ti);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ef.hasOwnProperty(s))t:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),i=s.slice(2,f?s.length-7:void 0),d=e[ve]||null,d=d!=null?d[s]:null,typeof d=="function"&&e.removeEventListener(i,d,f),typeof r=="function")){typeof d!="function"&&d!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(i,r,f);break t}s in e?e[s]=r:r===!0?e.setAttribute(s,""):Tl(e,s,r)}}}function fe(e,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_t("error",e),_t("load",e);var r=!1,f=!1,d;for(d in s)if(s.hasOwnProperty(d)){var y=s[d];if(y!=null)switch(d){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ot(e,i,d,y,s,null)}}f&&Ot(e,i,"srcSet",s.srcSet,s,null),r&&Ot(e,i,"src",s.src,s,null);return;case"input":_t("invalid",e);var v=d=y=f=null,M=null,U=null;for(r in s)if(s.hasOwnProperty(r)){var q=s[r];if(q!=null)switch(r){case"name":f=q;break;case"type":y=q;break;case"checked":M=q;break;case"defaultChecked":U=q;break;case"value":d=q;break;case"defaultValue":v=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(a(137,i));break;default:Ot(e,i,r,q,s,null)}}rf(e,d,v,M,U,y,f,!1);return;case"select":_t("invalid",e),r=y=d=null;for(f in s)if(s.hasOwnProperty(f)&&(v=s[f],v!=null))switch(f){case"value":d=v;break;case"defaultValue":y=v;break;case"multiple":r=v;default:Ot(e,i,f,v,s,null)}i=d,s=y,e.multiple=!!r,i!=null?ns(e,!!r,i,!1):s!=null&&ns(e,!!r,s,!0);return;case"textarea":_t("invalid",e),d=f=r=null;for(y in s)if(s.hasOwnProperty(y)&&(v=s[y],v!=null))switch(y){case"value":r=v;break;case"defaultValue":f=v;break;case"children":d=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(a(91));break;default:Ot(e,i,y,v,s,null)}uf(e,r,f,d);return;case"option":for(M in s)if(s.hasOwnProperty(M)&&(r=s[M],r!=null))switch(M){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ot(e,i,M,r,s,null)}return;case"dialog":_t("beforetoggle",e),_t("toggle",e),_t("cancel",e),_t("close",e);break;case"iframe":case"object":_t("load",e);break;case"video":case"audio":for(r=0;r<Na.length;r++)_t(Na[r],e);break;case"image":_t("error",e),_t("load",e);break;case"details":_t("toggle",e);break;case"embed":case"source":case"link":_t("error",e),_t("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in s)if(s.hasOwnProperty(U)&&(r=s[U],r!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ot(e,i,U,r,s,null)}return;default:if(bo(i)){for(q in s)s.hasOwnProperty(q)&&(r=s[q],r!==void 0&&lc(e,i,q,r,s,void 0));return}}for(v in s)s.hasOwnProperty(v)&&(r=s[v],r!=null&&Ot(e,i,v,r,s,null))}function H_(e,i,s,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,y=null,v=null,M=null,U=null,q=null;for(j in s){var F=s[j];if(s.hasOwnProperty(j)&&F!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":M=F;default:r.hasOwnProperty(j)||Ot(e,i,j,null,r,F)}}for(var H in r){var j=r[H];if(F=s[H],r.hasOwnProperty(H)&&(j!=null||F!=null))switch(H){case"type":d=j;break;case"name":f=j;break;case"checked":U=j;break;case"defaultChecked":q=j;break;case"value":y=j;break;case"defaultValue":v=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(137,i));break;default:j!==F&&Ot(e,i,H,j,r,F)}}xo(e,y,v,M,U,q,d,f);return;case"select":j=y=v=H=null;for(d in s)if(M=s[d],s.hasOwnProperty(d)&&M!=null)switch(d){case"value":break;case"multiple":j=M;default:r.hasOwnProperty(d)||Ot(e,i,d,null,r,M)}for(f in r)if(d=r[f],M=s[f],r.hasOwnProperty(f)&&(d!=null||M!=null))switch(f){case"value":H=d;break;case"defaultValue":v=d;break;case"multiple":y=d;default:d!==M&&Ot(e,i,f,d,r,M)}i=v,s=y,r=j,H!=null?ns(e,!!s,H,!1):!!r!=!!s&&(i!=null?ns(e,!!s,i,!0):ns(e,!!s,s?[]:"",!1));return;case"textarea":j=H=null;for(v in s)if(f=s[v],s.hasOwnProperty(v)&&f!=null&&!r.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ot(e,i,v,null,r,f)}for(y in r)if(f=r[y],d=s[y],r.hasOwnProperty(y)&&(f!=null||d!=null))switch(y){case"value":H=f;break;case"defaultValue":j=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==d&&Ot(e,i,y,f,r,d)}of(e,H,j);return;case"option":for(var st in s)if(H=s[st],s.hasOwnProperty(st)&&H!=null&&!r.hasOwnProperty(st))switch(st){case"selected":e.selected=!1;break;default:Ot(e,i,st,null,r,H)}for(M in r)if(H=r[M],j=s[M],r.hasOwnProperty(M)&&H!==j&&(H!=null||j!=null))switch(M){case"selected":e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:Ot(e,i,M,H,r,j)}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 ut in s)H=s[ut],s.hasOwnProperty(ut)&&H!=null&&!r.hasOwnProperty(ut)&&Ot(e,i,ut,null,r,H);for(U in r)if(H=r[U],j=s[U],r.hasOwnProperty(U)&&H!==j&&(H!=null||j!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(a(137,i));break;default:Ot(e,i,U,H,r,j)}return;default:if(bo(i)){for(var Nt in s)H=s[Nt],s.hasOwnProperty(Nt)&&H!==void 0&&!r.hasOwnProperty(Nt)&&lc(e,i,Nt,void 0,r,H);for(q in r)H=r[q],j=s[q],!r.hasOwnProperty(q)||H===j||H===void 0&&j===void 0||lc(e,i,q,H,r,j);return}}for(var O in s)H=s[O],s.hasOwnProperty(O)&&H!=null&&!r.hasOwnProperty(O)&&Ot(e,i,O,null,r,H);for(F in r)H=r[F],j=s[F],!r.hasOwnProperty(F)||H===j||H==null&&j==null||Ot(e,i,F,H,r,j)}function fp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function L_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,s=performance.getEntriesByType("resource"),r=0;r<s.length;r++){var f=s[r],d=f.transferSize,y=f.initiatorType,v=f.duration;if(d&&v&&fp(y)){for(y=0,v=f.responseEnd,r+=1;r<s.length;r++){var M=s[r],U=M.startTime;if(U>v)break;var q=M.transferSize,F=M.initiatorType;q&&fp(F)&&(M=M.responseEnd,y+=q*(M<v?1:(v-U)/(M-U)))}if(--r,i+=8*(d+y)/(f.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var rc=null,oc=null;function vr(e){return e.nodeType===9?e:e.ownerDocument}function dp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function mp(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function uc(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var cc=null;function j_(){var e=window.event;return e&&e.type==="popstate"?e===cc?!1:(cc=e,!0):(cc=null,!1)}var pp=typeof setTimeout=="function"?setTimeout:void 0,Y_=typeof clearTimeout=="function"?clearTimeout:void 0,gp=typeof Promise=="function"?Promise:void 0,q_=typeof queueMicrotask=="function"?queueMicrotask:typeof gp<"u"?function(e){return gp.resolve(null).then(e).catch(X_)}:pp;function X_(e){setTimeout(function(){throw e})}function mn(e){return e==="head"}function yp(e,i){var s=i,r=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(r===0){e.removeChild(f),Gs(i);return}r--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")r++;else if(s==="html")ka(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,ka(s);for(var d=s.firstChild;d;){var y=d.nextSibling,v=d.nodeName;d[ta]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&d.rel.toLowerCase()==="stylesheet"||s.removeChild(d),d=y}}else s==="body"&&ka(e.ownerDocument.body);s=f}while(s);Gs(i)}function xp(e,i){var s=e;e=0;do{var r=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),r&&r.nodeType===8)if(s=r.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=r}while(s)}function hc(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":hc(s),go(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function V_(e,i,s,r){for(;e.nodeType===1;){var f=s;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[ta])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=ti(e.nextSibling),e===null)break}return null}function P_(e,i,s){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=ti(e.nextSibling),e===null))return null;return e}function _p(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=ti(e.nextSibling),e===null))return null;return e}function fc(e){return e.data==="$?"||e.data==="$~"}function dc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function F_(e,i){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||s.readyState!=="loading")i();else{var r=function(){i(),s.removeEventListener("DOMContentLoaded",r)};s.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ti(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var mc=null;function bp(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(i===0)return ti(e.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}e=e.nextSibling}return null}function vp(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return e;i--}else s!=="/$"&&s!=="/&"||i++}e=e.previousSibling}return null}function Sp(e,i,s){switch(i=vr(s),e){case"html":if(e=i.documentElement,!e)throw Error(a(452));return e;case"head":if(e=i.head,!e)throw Error(a(453));return e;case"body":if(e=i.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function ka(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);go(e)}var ei=new Map,Tp=new Set;function Sr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Li=L.d;L.d={f:Q_,r:W_,D:Z_,C:I_,L:K_,m:$_,X:t1,S:J_,M:e1};function Q_(){var e=Li.f(),i=dr();return e||i}function W_(e){var i=ts(e);i!==null&&i.tag===5&&i.type==="form"?jd(i):Li.r(e)}var Bs=typeof document>"u"?null:document;function Ap(e,i,s){var r=Bs;if(r&&typeof i=="string"&&i){var f=Qe(i);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),Tp.has(f)||(Tp.add(f),e={rel:e,crossOrigin:s,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),fe(i,"link",e),ae(i),r.head.appendChild(i)))}}function Z_(e){Li.D(e),Ap("dns-prefetch",e,null)}function I_(e,i){Li.C(e,i),Ap("preconnect",e,i)}function K_(e,i,s){Li.L(e,i,s);var r=Bs;if(r&&e&&i){var f='link[rel="preload"][as="'+Qe(i)+'"]';i==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+Qe(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+Qe(s.imageSizes)+'"]')):f+='[href="'+Qe(e)+'"]';var d=f;switch(i){case"style":d=Os(e);break;case"script":d=Ns(e)}ei.has(d)||(e=x({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:e,as:i},s),ei.set(d,e),r.querySelector(f)!==null||i==="style"&&r.querySelector(Ua(d))||i==="script"&&r.querySelector(Ha(d))||(i=r.createElement("link"),fe(i,"link",e),ae(i),r.head.appendChild(i)))}}function $_(e,i){Li.m(e,i);var s=Bs;if(s&&e){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Qe(r)+'"][href="'+Qe(e)+'"]',d=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Ns(e)}if(!ei.has(d)&&(e=x({rel:"modulepreload",href:e},i),ei.set(d,e),s.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ha(d)))return}r=s.createElement("link"),fe(r,"link",e),ae(r),s.head.appendChild(r)}}}function J_(e,i,s){Li.S(e,i,s);var r=Bs;if(r&&e){var f=es(r).hoistableStyles,d=Os(e);i=i||"default";var y=f.get(d);if(!y){var v={loading:0,preload:null};if(y=r.querySelector(Ua(d)))v.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":i},s),(s=ei.get(d))&&pc(e,s);var M=y=r.createElement("link");ae(M),fe(M,"link",e),M._p=new Promise(function(U,q){M.onload=U,M.onerror=q}),M.addEventListener("load",function(){v.loading|=1}),M.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Tr(y,i,r)}y={type:"stylesheet",instance:y,count:1,state:v},f.set(d,y)}}}function t1(e,i){Li.X(e,i);var s=Bs;if(s&&e){var r=es(s).hoistableScripts,f=Ns(e),d=r.get(f);d||(d=s.querySelector(Ha(f)),d||(e=x({src:e,async:!0},i),(i=ei.get(f))&&gc(e,i),d=s.createElement("script"),ae(d),fe(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(f,d))}}function e1(e,i){Li.M(e,i);var s=Bs;if(s&&e){var r=es(s).hoistableScripts,f=Ns(e),d=r.get(f);d||(d=s.querySelector(Ha(f)),d||(e=x({src:e,async:!0,type:"module"},i),(i=ei.get(f))&&gc(e,i),d=s.createElement("script"),ae(d),fe(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(f,d))}}function wp(e,i,s,r){var f=(f=ct.current)?Sr(f):null;if(!f)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Os(s.href),s=es(f).hoistableStyles,r=s.get(i),r||(r={type:"style",instance:null,count:0,state:null},s.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Os(s.href);var d=es(f).hoistableStyles,y=d.get(e);if(y||(f=f.ownerDocument||f,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=f.querySelector(Ua(e)))&&!d._p&&(y.instance=d,y.state.loading=5),ei.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ei.set(e,s),d||i1(f,e,s,y.state))),i&&r===null)throw Error(a(528,""));return y}if(i&&r!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Ns(s),s=es(f).hoistableScripts,r=s.get(i),r||(r={type:"script",instance:null,count:0,state:null},s.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Os(e){return'href="'+Qe(e)+'"'}function Ua(e){return'link[rel="stylesheet"]['+e+"]"}function Cp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function i1(e,i,s,r){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=e.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),fe(i,"link",s),ae(i),e.head.appendChild(i))}function Ns(e){return'[src="'+Qe(e)+'"]'}function Ha(e){return"script[async]"+e}function Mp(e,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var r=e.querySelector('style[data-href~="'+Qe(s.href)+'"]');if(r)return i.instance=r,ae(r),r;var f=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),ae(r),fe(r,"style",f),Tr(r,s.precedence,e),i.instance=r;case"stylesheet":f=Os(s.href);var d=e.querySelector(Ua(f));if(d)return i.state.loading|=4,i.instance=d,ae(d),d;r=Cp(s),(f=ei.get(f))&&pc(r,f),d=(e.ownerDocument||e).createElement("link"),ae(d);var y=d;return y._p=new Promise(function(v,M){y.onload=v,y.onerror=M}),fe(d,"link",r),i.state.loading|=4,Tr(d,s.precedence,e),i.instance=d;case"script":return d=Ns(s.src),(f=e.querySelector(Ha(d)))?(i.instance=f,ae(f),f):(r=s,(f=ei.get(d))&&(r=x({},s),gc(r,f)),e=e.ownerDocument||e,f=e.createElement("script"),ae(f),fe(f,"link",r),e.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,Tr(r,s.precedence,e));return i.instance}function Tr(e,i,s){for(var r=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=r.length?r[r.length-1]:null,d=f,y=0;y<r.length;y++){var v=r[y];if(v.dataset.precedence===i)d=v;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(e,i.firstChild))}function pc(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function gc(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var Ar=null;function Ep(e,i,s){if(Ar===null){var r=new Map,f=Ar=new Map;f.set(s,r)}else f=Ar,r=f.get(s),r||(r=new Map,f.set(s,r));if(r.has(e))return r;for(r.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var d=s[f];if(!(d[ta]||d[oe]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(i)||"";y=e+y;var v=r.get(y);v?v.push(d):r.set(y,[d])}}return r}function Rp(e,i,s){e=e.ownerDocument||e,e.head.insertBefore(s,i==="title"?e.querySelector("head > title"):null)}function n1(e,i,s){if(s===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return e=i.disabled,typeof i.precedence=="string"&&e==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function zp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function s1(e,i,s,r){if(s.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=Os(r.href),d=i.querySelector(Ua(f));if(d){i=d._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=wr.bind(e),i.then(e,e)),s.state.loading|=4,s.instance=d,ae(d);return}d=i.ownerDocument||i,r=Cp(r),(f=ei.get(f))&&pc(r,f),d=d.createElement("link"),ae(d);var y=d;y._p=new Promise(function(v,M){y.onload=v,y.onerror=M}),fe(d,"link",r),s.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=wr.bind(e),i.addEventListener("load",s),i.addEventListener("error",s))}}var yc=0;function a1(e,i){return e.stylesheets&&e.count===0&&Mr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var r=setTimeout(function(){if(e.stylesheets&&Mr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+i);0<e.imgBytes&&yc===0&&(yc=62500*L_());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Mr(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>yc?50:800)+i);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function wr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cr=null;function Mr(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cr=new Map,i.forEach(l1,e),Cr=null,wr.call(e))}function l1(e,i){if(!(i.state.loading&4)){var s=Cr.get(e);if(s)var r=s.get(null);else{s=new Map,Cr.set(e,s);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var y=f[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),r=y)}r&&s.set(null,r)}f=i.instance,y=f.getAttribute("data-precedence"),d=s.get(y)||r,d===r&&s.set(null,f),s.set(y,f),this.count++,r=wr.bind(this),f.addEventListener("load",r),f.addEventListener("error",r),d?d.parentNode.insertBefore(f,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),i.state.loading|=4}}var La={$$typeof:E,Provider:null,Consumer:null,_currentValue:et,_currentValue2:et,_threadCount:0};function r1(e,i,s,r,f,d,y,v,M){this.tag=1,this.containerInfo=e,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=ho(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ho(0),this.hiddenUpdates=ho(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Dp(e,i,s,r,f,d,y,v,M,U,q,F){return e=new r1(e,i,s,y,M,U,q,F,v),i=1,d===!0&&(i|=24),d=Ne(3,null,null,i),e.current=d,d.stateNode=e,i=Io(),i.refCount++,e.pooledCache=i,i.refCount++,d.memoizedState={element:r,isDehydrated:s,cache:i},tu(d),e}function Bp(e){return e?(e=hs,e):hs}function Op(e,i,s,r,f,d){f=Bp(f),r.context===null?r.context=f:r.pendingContext=f,r=nn(i),r.payload={element:s},d=d===void 0?null:d,d!==null&&(r.callback=d),s=sn(e,r,i),s!==null&&(Me(s,e,i),ya(s,e,i))}function Np(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<i?s:i}}function xc(e,i){Np(e,i),(e=e.alternate)&&Np(e,i)}function Gp(e){if(e.tag===13||e.tag===31){var i=En(e,67108864);i!==null&&Me(i,e,67108864),xc(e,67108864)}}function kp(e){if(e.tag===13||e.tag===31){var i=Le();i=fo(i);var s=En(e,i);s!==null&&Me(s,e,i),xc(e,i)}}var Er=!0;function o1(e,i,s,r){var f=D.T;D.T=null;var d=L.p;try{L.p=2,_c(e,i,s,r)}finally{L.p=d,D.T=f}}function u1(e,i,s,r){var f=D.T;D.T=null;var d=L.p;try{L.p=8,_c(e,i,s,r)}finally{L.p=d,D.T=f}}function _c(e,i,s,r){if(Er){var f=bc(r);if(f===null)ac(e,i,r,Rr,s),Hp(e,r);else if(h1(f,e,i,s,r))r.stopPropagation();else if(Hp(e,r),i&4&&-1<c1.indexOf(e)){for(;f!==null;){var d=ts(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=Tn(d.pendingLanes);if(y!==0){var v=d;for(v.pendingLanes|=2,v.entangledLanes|=2;y;){var M=1<<31-Be(y);v.entanglements[1]|=M,y&=~M}xi(d),(Rt&6)===0&&(hr=ze()+500,Oa(0))}}break;case 31:case 13:v=En(d,2),v!==null&&Me(v,d,2),dr(),xc(d,2)}if(d=bc(r),d===null&&ac(e,i,r,Rr,s),d===f)break;f=d}f!==null&&r.stopPropagation()}else ac(e,i,r,null,s)}}function bc(e){return e=So(e),vc(e)}var Rr=null;function vc(e){if(Rr=null,e=Jn(e),e!==null){var i=u(e);if(i===null)e=null;else{var s=i.tag;if(s===13){if(e=c(i),e!==null)return e;e=null}else if(s===31){if(e=h(i),e!==null)return e;e=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return Rr=e,null}function Up(e){switch(e){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(Z0()){case Vh:return 2;case Ph:return 8;case xl:case I0:return 32;case Fh:return 268435456;default:return 32}default:return 32}}var Sc=!1,pn=null,gn=null,yn=null,ja=new Map,Ya=new Map,xn=[],c1="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 Hp(e,i){switch(e){case"focusin":case"focusout":pn=null;break;case"dragenter":case"dragleave":gn=null;break;case"mouseover":case"mouseout":yn=null;break;case"pointerover":case"pointerout":ja.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ya.delete(i.pointerId)}}function qa(e,i,s,r,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:i,domEventName:s,eventSystemFlags:r,nativeEvent:d,targetContainers:[f]},i!==null&&(i=ts(i),i!==null&&Gp(i)),e):(e.eventSystemFlags|=r,i=e.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),e)}function h1(e,i,s,r,f){switch(i){case"focusin":return pn=qa(pn,e,i,s,r,f),!0;case"dragenter":return gn=qa(gn,e,i,s,r,f),!0;case"mouseover":return yn=qa(yn,e,i,s,r,f),!0;case"pointerover":var d=f.pointerId;return ja.set(d,qa(ja.get(d)||null,e,i,s,r,f)),!0;case"gotpointercapture":return d=f.pointerId,Ya.set(d,qa(Ya.get(d)||null,e,i,s,r,f)),!0}return!1}function Lp(e){var i=Jn(e.target);if(i!==null){var s=u(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){e.blockedOn=i,$h(e.priority,function(){kp(s)});return}}else if(i===31){if(i=h(s),i!==null){e.blockedOn=i,$h(e.priority,function(){kp(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zr(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var s=bc(e.nativeEvent);if(s===null){s=e.nativeEvent;var r=new s.constructor(s.type,s);vo=r,s.target.dispatchEvent(r),vo=null}else return i=ts(s),i!==null&&Gp(i),e.blockedOn=s,!1;i.shift()}return!0}function jp(e,i,s){zr(e)&&s.delete(i)}function f1(){Sc=!1,pn!==null&&zr(pn)&&(pn=null),gn!==null&&zr(gn)&&(gn=null),yn!==null&&zr(yn)&&(yn=null),ja.forEach(jp),Ya.forEach(jp)}function Dr(e,i){e.blockedOn===i&&(e.blockedOn=null,Sc||(Sc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,f1)))}var Br=null;function Yp(e){Br!==e&&(Br=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Br===e&&(Br=null);for(var i=0;i<e.length;i+=3){var s=e[i],r=e[i+1],f=e[i+2];if(typeof r!="function"){if(vc(r||s)===null)continue;break}var d=ts(s);d!==null&&(e.splice(i,3),i-=3,bu(d,{pending:!0,data:f,method:s.method,action:r},r,f))}}))}function Gs(e){function i(M){return Dr(M,e)}pn!==null&&Dr(pn,e),gn!==null&&Dr(gn,e),yn!==null&&Dr(yn,e),ja.forEach(i),Ya.forEach(i);for(var s=0;s<xn.length;s++){var r=xn[s];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xn.length&&(s=xn[0],s.blockedOn===null);)Lp(s),s.blockedOn===null&&xn.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(r=0;r<s.length;r+=3){var f=s[r],d=s[r+1],y=f[ve]||null;if(typeof d=="function")y||Yp(s);else if(y){var v=null;if(d&&d.hasAttribute("formAction")){if(f=d,y=d[ve]||null)v=y.formAction;else if(vc(f)!==null)continue}else v=y.action;typeof v=="function"?s[r+1]=v:(s.splice(r,3),r-=3),Yp(s)}}}function qp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(y){return f=y})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),r||setTimeout(s,20)}function s(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Tc(e){this._internalRoot=e}Or.prototype.render=Tc.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,r=Le();Op(s,r,e,i,null,null)},Or.prototype.unmount=Tc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;Op(e.current,2,null,e,null,null),dr(),i[$n]=null}};function Or(e){this._internalRoot=e}Or.prototype.unstable_scheduleHydration=function(e){if(e){var i=Kh();e={blockedOn:null,target:e,priority:i};for(var s=0;s<xn.length&&i!==0&&i<xn[s].priority;s++);xn.splice(s,0,e),s===0&&Lp(e)}};var Xp=t.version;if(Xp!=="19.2.4")throw Error(a(527,Xp,"19.2.4"));L.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=p(i),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var d1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nr.isDisabled&&Nr.supportsFiber)try{Ks=Nr.inject(d1),De=Nr}catch{}}return Va.createRoot=function(e,i){if(!o(e))throw Error(a(299));var s=!1,r="",f=Id,d=Kd,y=$d;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(d=i.onCaughtError),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),i=Dp(e,1,!1,null,null,s,r,null,f,d,y,qp),e[$n]=i.current,sc(e),new Tc(i)},Va.hydrateRoot=function(e,i,s){if(!o(e))throw Error(a(299));var r=!1,f="",d=Id,y=Kd,v=$d,M=null;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(v=s.onRecoverableError),s.formState!==void 0&&(M=s.formState)),i=Dp(e,1,!0,i,s??null,r,f,M,d,y,v,qp),i.context=Bp(null),s=i.current,r=Le(),r=fo(r),f=nn(r),f.callback=null,sn(s,f,r),s=r,i.current.lanes=s,Js(i,s),xi(i),e[$n]=i.current,sc(e),new Or(i)},Va.version="19.2.4",Va}var Jp;function w1(){if(Jp)return Cc.exports;Jp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(t){console.error(t)}}return l(),Cc.exports=A1(),Cc.exports}var C1=w1();const tg=l=>{let t;const n=new Set,a=(p,g)=>{const x=typeof p=="function"?p(t):p;if(!Object.is(x,t)){const _=t;t=g??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(b=>b(t,_))}},o=()=>t,h={setState:a,getState:o,getInitialState:()=>m,subscribe:p=>(n.add(p),()=>n.delete(p))},m=t=l(a,o,h);return h},M1=(l=>l?tg(l):tg),E1=l=>l;function R1(l,t=E1){const n=Gr.useSyncExternalStore(l.subscribe,Gr.useCallback(()=>t(l.getState()),[l,t]),Gr.useCallback(()=>t(l.getInitialState()),[l,t]));return Gr.useDebugValue(n),n}const eg=l=>{const t=M1(l),n=a=>R1(t,a);return Object.assign(n,t),n},z1=(l=>l?eg(l):eg);let D1=0;const gt=z1(l=>({connected:!1,agents:[],tasks:[],messages:[],prs:[],sprint:null,selectedPR:null,selectedAgent:null,wowEvents:[],activity:[],setConnected:t=>l({connected:t}),setAgents:t=>l({agents:t}),setTasks:t=>l({tasks:t}),setSprint:t=>l({sprint:t}),setPRs:t=>l({prs:t}),setSelectedPR:t=>l({selectedPR:t}),setSelectedAgent:t=>l({selectedAgent:t}),addMessage:t=>l(n=>({messages:[...n.messages.slice(-199),t]})),updateAgent:(t,n)=>l(a=>({agents:a.agents.map(o=>o.id===t?{...o,...n}:o)})),updateTask:(t,n)=>l(a=>({tasks:a.tasks.map(o=>o.id===t?{...o,...n}:o)})),addPR:t=>l(n=>({prs:[...n.prs,t]})),updatePR:(t,n)=>l(a=>({prs:a.prs.map(o=>o.id===t?{...o,...n}:o)})),pushWow:t=>l(n=>({wowEvents:[...n.wowEvents,t]})),popWow:()=>{const n=gt.getState().wowEvents;if(n.length===0)return;const a=n[0];return gt.setState({wowEvents:n.slice(1)}),a},pushActivity:t=>l(n=>({activity:[...n.activity.slice(-299),{...t,id:`act-${++D1}`,time:new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}]}))})),zc={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},B1={sage:"Sage",nova:"Nova",aria:"Aria",dex:"Dex",flux:"Flux",quinn:"Quinn",gage:"Gage",morgan:"Morgan",uma:"Uma",river:"River",atlas:"Atlas"},O1={Edit:"editing",Write:"creating",Read:"reading",Bash:"running",Grep:"searching for",Glob:"looking for",Agent:"delegating to sub-agent"},N1={coding:"is writing code",reviewing:"is reviewing files",testing:"is running tests",planning:"is planning the sprint",blocked:"is blocked!",deploying:"is deploying",thinking:"is thinking...",idle:"finished and is idle"};function G1(){const l=Xe.useRef(null),t=Xe.useRef({}),{setAgents:n,setTasks:a,setPRs:o,addMessage:u,updateAgent:c,updateTask:h,addPR:m,updatePR:p,pushActivity:g}=gt.getState();Xe.useEffect(()=>{function x(){const S=window.location.protocol==="https:"?"wss:":"ws:",A=new WebSocket(`${S}//${window.location.host}`);l.current=A,A.onopen=()=>{gt.setState({connected:!0}),g({agentId:null,icon:"🟢",text:"Connected to Sage Team HQ",type:"system"})},A.onclose=()=>{gt.setState({connected:!1}),setTimeout(x,2e3)},A.onerror=()=>{A.close()},A.onmessage=C=>{try{const E=JSON.parse(C.data);w(E)}catch{}}}function _(S){return B1[S]||S}function b(S){return`${zc[S]||"🤖"} ${_(S)}`}function T(S,A,C){const E=_(S),B=O1[A]||`using ${A}`;if(A==="Edit"||A==="Write"||A==="Read")return C?`${E} ${B} ${C}`:`${E} ${B} a file`;if(A==="Bash"){if(!C)return`${E} running a command`;const X=C.length>60?C.slice(0,57)+"...":C;return`${E} $ ${X}`}return A==="Grep"||A==="Glob"?C?`${E} ${B} "${C}"`:`${E} searching the codebase`:`${E} ${B}`}function w(S){var B,X;const A=S.type,C=S.agentId,E=S.data||{};switch(A){case"snapshot":S.agents&&n(S.agents),S.tasks&&a(S.tasks),S.prs&&o(S.prs),g({agentId:null,icon:"🏢",text:`Office online — ${((B=S.agents)==null?void 0:B.length)||0} agents, ${((X=S.tasks)==null?void 0:X.length)||0} tasks loaded`,type:"system"});break;case"agent:status":{const N=E.status||S.status;if(c(C,{status:N}),E.tool&&N!=="idle"){const G=T(C,E.tool,E.detail||"");t.current[C]!==G&&(t.current[C]=G,g({agentId:C,icon:zc[C]||"🤖",text:G,type:"agent"}))}else if(N&&N!=="idle"&&!E.tool){const G=N1[N]||`is ${N}`,$=`${_(C)} ${G}`;t.current[C]!==$&&(t.current[C]=$,g({agentId:C,icon:zc[C]||"🤖",text:$,type:"agent"}))}break}case"agent:narration":g({agentId:C,icon:"💭",text:`${_(C)}: "${E.text}"`,type:"agent"});break;case"agent:move":c(C,{position_room:E.room||S.room,position_seat:E.seat||S.seat});break;case"task:status":h(E.taskId||S.taskId,{status:E.status||S.status});break;case"task:assigned":{const N=E.taskId||S.taskId;h(N,{assigned_to:C,status:"in_progress"}),c(C,{current_task_id:N,status:"coding"});const $=gt.getState().tasks.find(Z=>Z.id===N),W=($==null?void 0:$.title)||"a new task";g({agentId:C,icon:"🎯",text:`${b(C)} picked up: ${W}`,type:"task"});break}case"task:completed":{const N=E.taskId||S.taskId;h(N,{status:"done"});const $=gt.getState().tasks.find(tt=>tt.id===N),W=($==null?void 0:$.title)||"task",Z=E.cost?` ($${E.cost.toFixed(3)})`:"",I=E.duration?` in ${Math.round(E.duration/1e3)}s`:"";g({agentId:C,icon:"✅",text:`${b(C)} completed "${W}"${I}${Z}`,type:"success"}),E.result&&E.result.length>10&&g({agentId:C,icon:"📝",text:`Summary: ${E.result.slice(0,150)}`,type:"info"}),t.current[C]="";break}case"task:failed":g({agentId:C,icon:"❌",text:`${b(C)} task failed (exit ${E.exitCode||"?"})`,type:"warning"}),t.current[C]="";break;case"message":u(S.message||E);break;case"pr:created":m(S.pr||E),g({agentId:E.agentId||C,icon:"📦",text:`${b(C)} opened PR on branch ${E.branch||"?"}`,type:"info"});break;case"pr:updated":p(S.prId||E.prId,S.updates||E);break;case"pr:merged":gt.getState().pushWow({type:"pr:merged",agentId:C||E.agentId,title:E.title||S.title||""}),g({agentId:C,icon:"🎉",text:`PR merged! ${E.title||""}`,type:"success"});break;case"sprint:created":gt.setState({sprint:S.sprint||E}),g({agentId:null,icon:"🏁",text:`Sprint "${(S.sprint||E).name}" created — let's go!`,type:"system"});break;case"sprint:completed":gt.setState(N=>({sprint:N.sprint?{...N.sprint,status:"completed"}:null})),gt.getState().pushWow({type:"sprint:complete"}),g({agentId:null,icon:"🏆",text:"Sprint completed! All tasks done.",type:"success"});break;case"system":g({agentId:C,icon:"💬",text:E.message||"System event",type:"system"});break;case"meeting:start":gt.getState().pushWow({type:"meeting:start",agents:S.agents||E.agents||[]}),g({agentId:null,icon:"🤝",text:"Team standup meeting started",type:"info"});break;case"meeting:end":gt.getState().pushWow({type:"meeting:end"}),g({agentId:null,icon:"👋",text:"Meeting ended — back to work!",type:"info"});break;case"crisis:start":gt.getState().pushWow({type:"crisis:start",reason:S.reason||E.reason||""}),g({agentId:null,icon:"🚨",text:`Crisis: ${E.reason||S.reason||"unknown"}`,type:"warning"});break;case"crisis:resolved":gt.getState().pushWow({type:"crisis:resolved"}),g({agentId:null,icon:"✅",text:"Crisis resolved — all clear",type:"success"});break;case"deploy:success":gt.getState().pushWow({type:"deploy:success"}),g({agentId:null,icon:"🚀",text:"Deployment successful!",type:"success"});break;case"pair:start":gt.getState().pushWow({type:"pair:start",agents:S.agents||E.agents||[]});break;case"pair:end":gt.getState().pushWow({type:"pair:end"});break}}return x(),()=>{var S;(S=l.current)==null||S.close()}},[])}const k1="modulepreload",U1=function(l){return"/"+l},ig={},el=function(t,n,a){let o=Promise.resolve();if(n&&n.length>0){let c=function(p){return Promise.all(p.map(g=>Promise.resolve(g).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),m=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));o=c(n.map(p=>{if(p=U1(p),p in ig)return;ig[p]=!0;const g=p.endsWith(".css"),x=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${x}`))return;const _=document.createElement("link");if(_.rel=g?"stylesheet":k1,g||(_.as="script"),_.crossOrigin="",_.href=p,m&&_.setAttribute("nonce",m),document.head.appendChild(_),g)return new Promise((b,T)=>{_.addEventListener("load",b),_.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(c){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=c,window.dispatchEvent(h),!h.defaultPrevented)throw c}return o.then(c=>{for(const h of c||[])h.status==="rejected"&&u(h.reason);return t().catch(u)})};var yt=(l=>(l.Application="application",l.WebGLPipes="webgl-pipes",l.WebGLPipesAdaptor="webgl-pipes-adaptor",l.WebGLSystem="webgl-system",l.WebGPUPipes="webgpu-pipes",l.WebGPUPipesAdaptor="webgpu-pipes-adaptor",l.WebGPUSystem="webgpu-system",l.CanvasSystem="canvas-system",l.CanvasPipesAdaptor="canvas-pipes-adaptor",l.CanvasPipes="canvas-pipes",l.Asset="asset",l.LoadParser="load-parser",l.ResolveParser="resolve-parser",l.CacheParser="cache-parser",l.DetectionParser="detection-parser",l.MaskEffect="mask-effect",l.BlendMode="blend-mode",l.TextureSource="texture-source",l.Environment="environment",l.ShapeBuilder="shape-builder",l.Batcher="batcher",l))(yt||{});const ah=l=>{if(typeof l=="function"||typeof l=="object"&&l.extension){if(!l.extension)throw new Error("Extension class must have an extension object");l={...typeof l.extension!="object"?{type:l.extension}:l.extension,ref:l}}if(typeof l=="object")l={...l};else throw new Error("Invalid extension type");return typeof l.type=="string"&&(l.type=[l.type]),l},kr=(l,t)=>ah(l).priority??t,Kt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...l){return l.map(ah).forEach(t=>{t.type.forEach(n=>{var a,o;return(o=(a=this._removeHandlers)[n])==null?void 0:o.call(a,t)})}),this},add(...l){return l.map(ah).forEach(t=>{t.type.forEach(n=>{var u,c;const a=this._addHandlers,o=this._queue;a[n]?(c=a[n])==null||c.call(a,t):(o[n]=o[n]||[],(u=o[n])==null||u.push(t))})}),this},handle(l,t,n){var c;const a=this._addHandlers,o=this._removeHandlers;if(a[l]||o[l])throw new Error(`Extension type ${l} already has a handler`);a[l]=t,o[l]=n;const u=this._queue;return u[l]&&((c=u[l])==null||c.forEach(h=>t(h)),delete u[l]),this},handleByMap(l,t){return this.handle(l,n=>{n.name&&(t[n.name]=n.ref)},n=>{n.name&&delete t[n.name]})},handleByNamedList(l,t,n=-1){return this.handle(l,a=>{t.findIndex(u=>u.name===a.name)>=0||(t.push({name:a.name,value:a.ref}),t.sort((u,c)=>kr(c.value,n)-kr(u.value,n)))},a=>{const o=t.findIndex(u=>u.name===a.name);o!==-1&&t.splice(o,1)})},handleByList(l,t,n=-1){return this.handle(l,a=>{t.includes(a.ref)||(t.push(a.ref),t.sort((o,u)=>kr(u,n)-kr(o,n)))},a=>{const o=t.indexOf(a.ref);o!==-1&&t.splice(o,1)})},mixin(l,...t){for(const n of t)Object.defineProperties(l.prototype,Object.getOwnPropertyDescriptors(n))}},H1={extension:{type:yt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await el(()=>import("./browserAll-B89dcUjb.js"),__vite__mapDeps([0,1,2]))}},L1={extension:{type:yt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await el(()=>import("./webworkerAll-BJZUB1XW.js"),__vite__mapDeps([1,2]))}};class de{constructor(t,n,a){this._x=n||0,this._y=a||0,this._observer=t}clone(t){return new de(t??this._observer,this._x,this._y)}set(t=0,n=t){return(this._x!==t||this._y!==n)&&(this._x=t,this._y=n,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Dc={exports:{}},ng;function j1(){return ng||(ng=1,(function(l){var t=Object.prototype.hasOwnProperty,n="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function o(m,p,g){this.fn=m,this.context=p,this.once=g||!1}function u(m,p,g,x,_){if(typeof g!="function")throw new TypeError("The listener must be a function");var b=new o(g,x||m,_),T=n?n+p:p;return m._events[T]?m._events[T].fn?m._events[T]=[m._events[T],b]:m._events[T].push(b):(m._events[T]=b,m._eventsCount++),m}function c(m,p){--m._eventsCount===0?m._events=new a:delete m._events[p]}function h(){this._events=new a,this._eventsCount=0}h.prototype.eventNames=function(){var p=[],g,x;if(this._eventsCount===0)return p;for(x in g=this._events)t.call(g,x)&&p.push(n?x.slice(1):x);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(g)):p},h.prototype.listeners=function(p){var g=n?n+p:p,x=this._events[g];if(!x)return[];if(x.fn)return[x.fn];for(var _=0,b=x.length,T=new Array(b);_<b;_++)T[_]=x[_].fn;return T},h.prototype.listenerCount=function(p){var g=n?n+p:p,x=this._events[g];return x?x.fn?1:x.length:0},h.prototype.emit=function(p,g,x,_,b,T){var w=n?n+p:p;if(!this._events[w])return!1;var S=this._events[w],A=arguments.length,C,E;if(S.fn){switch(S.once&&this.removeListener(p,S.fn,void 0,!0),A){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,g),!0;case 3:return S.fn.call(S.context,g,x),!0;case 4:return S.fn.call(S.context,g,x,_),!0;case 5:return S.fn.call(S.context,g,x,_,b),!0;case 6:return S.fn.call(S.context,g,x,_,b,T),!0}for(E=1,C=new Array(A-1);E<A;E++)C[E-1]=arguments[E];S.fn.apply(S.context,C)}else{var B=S.length,X;for(E=0;E<B;E++)switch(S[E].once&&this.removeListener(p,S[E].fn,void 0,!0),A){case 1:S[E].fn.call(S[E].context);break;case 2:S[E].fn.call(S[E].context,g);break;case 3:S[E].fn.call(S[E].context,g,x);break;case 4:S[E].fn.call(S[E].context,g,x,_);break;default:if(!C)for(X=1,C=new Array(A-1);X<A;X++)C[X-1]=arguments[X];S[E].fn.apply(S[E].context,C)}}return!0},h.prototype.on=function(p,g,x){return u(this,p,g,x,!1)},h.prototype.once=function(p,g,x){return u(this,p,g,x,!0)},h.prototype.removeListener=function(p,g,x,_){var b=n?n+p:p;if(!this._events[b])return this;if(!g)return c(this,b),this;var T=this._events[b];if(T.fn)T.fn===g&&(!_||T.once)&&(!x||T.context===x)&&c(this,b);else{for(var w=0,S=[],A=T.length;w<A;w++)(T[w].fn!==g||_&&!T[w].once||x&&T[w].context!==x)&&S.push(T[w]);S.length?this._events[b]=S.length===1?S[0]:S:c(this,b)}return this},h.prototype.removeAllListeners=function(p){var g;return p?(g=n?n+p:p,this._events[g]&&c(this,g)):(this._events=new a,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=n,h.EventEmitter=h,l.exports=h})(Dc)),Dc.exports}var Y1=j1();const vi=Ch(Y1),q1=Math.PI*2,X1=180/Math.PI,V1=Math.PI/180;class ge{constructor(t=0,n=0){this.x=0,this.y=0,this.x=t,this.y=n}clone(){return new ge(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,n=t){return this.x=t,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Bc.x=0,Bc.y=0,Bc}}const Bc=new ge;class St{constructor(t=1,n=0,a=0,o=1,u=0,c=0){this.array=null,this.a=t,this.b=n,this.c=a,this.d=o,this.tx=u,this.ty=c}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,n,a,o,u,c){return this.a=t,this.b=n,this.c=a,this.d=o,this.tx=u,this.ty=c,this}toArray(t,n){this.array||(this.array=new Float32Array(9));const a=n||this.array;return t?(a[0]=this.a,a[1]=this.b,a[2]=0,a[3]=this.c,a[4]=this.d,a[5]=0,a[6]=this.tx,a[7]=this.ty,a[8]=1):(a[0]=this.a,a[1]=this.c,a[2]=this.tx,a[3]=this.b,a[4]=this.d,a[5]=this.ty,a[6]=0,a[7]=0,a[8]=1),a}apply(t,n){n=n||new ge;const a=t.x,o=t.y;return n.x=this.a*a+this.c*o+this.tx,n.y=this.b*a+this.d*o+this.ty,n}applyInverse(t,n){n=n||new ge;const a=this.a,o=this.b,u=this.c,c=this.d,h=this.tx,m=this.ty,p=1/(a*c+u*-o),g=t.x,x=t.y;return n.x=c*p*g+-u*p*x+(m*u-h*c)*p,n.y=a*p*x+-o*p*g+(-m*a+h*o)*p,n}translate(t,n){return this.tx+=t,this.ty+=n,this}scale(t,n){return this.a*=t,this.d*=n,this.c*=t,this.b*=n,this.tx*=t,this.ty*=n,this}rotate(t){const n=Math.cos(t),a=Math.sin(t),o=this.a,u=this.c,c=this.tx;return this.a=o*n-this.b*a,this.b=o*a+this.b*n,this.c=u*n-this.d*a,this.d=u*a+this.d*n,this.tx=c*n-this.ty*a,this.ty=c*a+this.ty*n,this}append(t){const n=this.a,a=this.b,o=this.c,u=this.d;return this.a=t.a*n+t.b*o,this.b=t.a*a+t.b*u,this.c=t.c*n+t.d*o,this.d=t.c*a+t.d*u,this.tx=t.tx*n+t.ty*o+this.tx,this.ty=t.tx*a+t.ty*u+this.ty,this}appendFrom(t,n){const a=t.a,o=t.b,u=t.c,c=t.d,h=t.tx,m=t.ty,p=n.a,g=n.b,x=n.c,_=n.d;return this.a=a*p+o*x,this.b=a*g+o*_,this.c=u*p+c*x,this.d=u*g+c*_,this.tx=h*p+m*x+n.tx,this.ty=h*g+m*_+n.ty,this}setTransform(t,n,a,o,u,c,h,m,p){return this.a=Math.cos(h+p)*u,this.b=Math.sin(h+p)*u,this.c=-Math.sin(h-m)*c,this.d=Math.cos(h-m)*c,this.tx=t-(a*this.a+o*this.c),this.ty=n-(a*this.b+o*this.d),this}prepend(t){const n=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const a=this.a,o=this.c;this.a=a*t.a+this.b*t.c,this.b=a*t.b+this.b*t.d,this.c=o*t.a+this.d*t.c,this.d=o*t.b+this.d*t.d}return this.tx=n*t.a+this.ty*t.c+t.tx,this.ty=n*t.b+this.ty*t.d+t.ty,this}decompose(t){const n=this.a,a=this.b,o=this.c,u=this.d,c=t.pivot,h=-Math.atan2(-o,u),m=Math.atan2(a,n),p=Math.abs(h+m);return p<1e-5||Math.abs(q1-p)<1e-5?(t.rotation=m,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=h,t.skew.y=m),t.scale.x=Math.sqrt(n*n+a*a),t.scale.y=Math.sqrt(o*o+u*u),t.position.x=this.tx+(c.x*n+c.y*o),t.position.y=this.ty+(c.x*a+c.y*u),t}invert(){const t=this.a,n=this.b,a=this.c,o=this.d,u=this.tx,c=t*o-n*a;return this.a=o/c,this.b=-n/c,this.c=-a/c,this.d=t/c,this.tx=(a*this.ty-o*u)/c,this.ty=-(t*this.ty-n*u)/c,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new St;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return F1.identity()}static get shared(){return P1.identity()}}const P1=new St,F1=new St,Xn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Vn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Pn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Fn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],lh=[],xy=[],Ur=Math.sign;function Q1(){for(let l=0;l<16;l++){const t=[];lh.push(t);for(let n=0;n<16;n++){const a=Ur(Xn[l]*Xn[n]+Pn[l]*Vn[n]),o=Ur(Vn[l]*Xn[n]+Fn[l]*Vn[n]),u=Ur(Xn[l]*Pn[n]+Pn[l]*Fn[n]),c=Ur(Vn[l]*Pn[n]+Fn[l]*Fn[n]);for(let h=0;h<16;h++)if(Xn[h]===a&&Vn[h]===o&&Pn[h]===u&&Fn[h]===c){t.push(h);break}}}for(let l=0;l<16;l++){const t=new St;t.set(Xn[l],Vn[l],Pn[l],Fn[l],0,0),xy.push(t)}}Q1();const Ut={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:l=>Xn[l],uY:l=>Vn[l],vX:l=>Pn[l],vY:l=>Fn[l],inv:l=>l&8?l&15:-l&7,add:(l,t)=>lh[l][t],sub:(l,t)=>lh[l][Ut.inv(t)],rotate180:l=>l^4,isVertical:l=>(l&3)===2,byDirection:(l,t)=>Math.abs(l)*2<=Math.abs(t)?t>=0?Ut.S:Ut.N:Math.abs(t)*2<=Math.abs(l)?l>0?Ut.E:Ut.W:t>0?l>0?Ut.SE:Ut.SW:l>0?Ut.NE:Ut.NW,matrixAppendRotationInv:(l,t,n=0,a=0,o=0,u=0)=>{const c=xy[Ut.inv(t)],h=c.a,m=c.b,p=c.c,g=c.d,x=n-Math.min(0,h*o,p*u,h*o+p*u),_=a-Math.min(0,m*o,g*u,m*o+g*u),b=l.a,T=l.b,w=l.c,S=l.d;l.a=h*b+m*w,l.b=h*T+m*S,l.c=p*b+g*w,l.d=p*T+g*S,l.tx=x*b+_*w+l.tx,l.ty=x*T+_*S+l.ty},transformRectCoords:(l,t,n,a)=>{const{x:o,y:u,width:c,height:h}=l,{x:m,y:p,width:g,height:x}=t;return n===Ut.E?(a.set(o+m,u+p,c,h),a):n===Ut.S?a.set(g-u-h+m,o+p,h,c):n===Ut.W?a.set(g-o-c+m,x-u-h+p,c,h):n===Ut.N?a.set(u+m,x-o-c+p,h,c):a.set(o+m,u+p,c,h)}},Hr=[new ge,new ge,new ge,new ge];class It{constructor(t=0,n=0,a=0,o=0){this.type="rectangle",this.x=Number(t),this.y=Number(n),this.width=Number(a),this.height=Number(o)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new It(0,0,0,0)}clone(){return new It(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,n){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(t,n,a,o=.5){const{width:u,height:c}=this;if(u<=0||c<=0)return!1;const h=this.x,m=this.y,p=a*(1-o),g=a-p,x=h-p,_=h+u+p,b=m-p,T=m+c+p,w=h+g,S=h+u-g,A=m+g,C=m+c-g;return t>=x&&t<=_&&n>=b&&n<=T&&!(t>w&&t<S&&n>A&&n<C)}intersects(t,n){if(!n){const $=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=$)return!1;const Z=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>Z}const a=this.left,o=this.right,u=this.top,c=this.bottom;if(o<=a||c<=u)return!1;const h=Hr[0].set(t.left,t.top),m=Hr[1].set(t.left,t.bottom),p=Hr[2].set(t.right,t.top),g=Hr[3].set(t.right,t.bottom);if(p.x<=h.x||m.y<=h.y)return!1;const x=Math.sign(n.a*n.d-n.b*n.c);if(x===0||(n.apply(h,h),n.apply(m,m),n.apply(p,p),n.apply(g,g),Math.max(h.x,m.x,p.x,g.x)<=a||Math.min(h.x,m.x,p.x,g.x)>=o||Math.max(h.y,m.y,p.y,g.y)<=u||Math.min(h.y,m.y,p.y,g.y)>=c))return!1;const _=x*(m.y-h.y),b=x*(h.x-m.x),T=_*a+b*u,w=_*o+b*u,S=_*a+b*c,A=_*o+b*c;if(Math.max(T,w,S,A)<=_*h.x+b*h.y||Math.min(T,w,S,A)>=_*g.x+b*g.y)return!1;const C=x*(h.y-p.y),E=x*(p.x-h.x),B=C*a+E*u,X=C*o+E*u,N=C*a+E*c,G=C*o+E*c;return!(Math.max(B,X,N,G)<=C*h.x+E*h.y||Math.min(B,X,N,G)>=C*g.x+E*g.y)}pad(t=0,n=t){return this.x-=t,this.y-=n,this.width+=t*2,this.height+=n*2,this}fit(t){const n=Math.max(this.x,t.x),a=Math.min(this.x+this.width,t.x+t.width),o=Math.max(this.y,t.y),u=Math.min(this.y+this.height,t.y+t.height);return this.x=n,this.width=Math.max(a-n,0),this.y=o,this.height=Math.max(u-o,0),this}ceil(t=1,n=.001){const a=Math.ceil((this.x+this.width-n)*t)/t,o=Math.ceil((this.y+this.height-n)*t)/t;return this.x=Math.floor((this.x+n)*t)/t,this.y=Math.floor((this.y+n)*t)/t,this.width=a-this.x,this.height=o-this.y,this}scale(t,n=t){return this.x*=t,this.y*=n,this.width*=t,this.height*=n,this}enlarge(t){const n=Math.min(this.x,t.x),a=Math.max(this.x+this.width,t.x+t.width),o=Math.min(this.y,t.y),u=Math.max(this.y+this.height,t.y+t.height);return this.x=n,this.width=a-n,this.y=o,this.height=u-o,this}getBounds(t){return t||(t=new It),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const n=t.x,a=t.y,o=t.x+t.width,u=t.y+t.height;return n>=this.x&&n<this.x+this.width&&a>=this.y&&a<this.y+this.height&&o>=this.x&&o<this.x+this.width&&u>=this.y&&u<this.y+this.height}set(t,n,a,o){return this.x=t,this.y=n,this.width=a,this.height=o,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Oc={default:-1};function Qt(l="default"){return Oc[l]===void 0&&(Oc[l]=-1),++Oc[l]}const sg=new Set,Ft="8.0.0",W1="8.3.4",Xs={quiet:!1,noColor:!1},wt=((l,t,n=3)=>{if(Xs.quiet||sg.has(t))return;let a=new Error().stack;const o=`${t}
|
|
51
|
+
Deprecated since v${l}`,u=typeof console.groupCollapsed=="function"&&!Xs.noColor;typeof a>"u"?console.warn("PixiJS Deprecation Warning: ",o):(a=a.split(`
|
|
52
|
+
`).splice(n).join(`
|
|
53
|
+
`),u?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",o),console.warn(a),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",o),console.warn(a))),sg.add(t)});Object.defineProperties(wt,{quiet:{get:()=>Xs.quiet,set:l=>{Xs.quiet=l},enumerable:!0,configurable:!1},noColor:{get:()=>Xs.noColor,set:l=>{Xs.noColor=l},enumerable:!0,configurable:!1}});const _y=()=>{};function Fs(l){return l+=l===0?1:0,--l,l|=l>>>1,l|=l>>>2,l|=l>>>4,l|=l>>>8,l|=l>>>16,l+1}function ag(l){return!(l&l-1)&&!!l}function by(l){const t={};for(const n in l)l[n]!==void 0&&(t[n]=l[n]);return t}const lg=Object.create(null);function Z1(l){const t=lg[l];return t===void 0&&(lg[l]=Qt("resource")),t}const vy=class Sy extends vi{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...Sy.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){wt(Ft,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Z1(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};vy.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Qs=vy;const Ty=class Ay extends vi{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Qt("textureSource"),this._resourceType="textureSource",this._resourceId=Qt("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Ay.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new Qs(by(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var n,a;this.style!==t&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=t,(a=this._style)==null||a.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){var t,n;this._resourceId=Qt("resource"),this.emit("change",this),this.emit("unload",this);for(const a in this._gpuData)(n=(t=this._gpuData[a])==null?void 0:t.destroy)==null||n.call(t);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,n,a){a||(a=this._resolution),t||(t=this.width),n||(n=this.height);const o=Math.round(t*a),u=Math.round(n*a);return this.width=o/a,this.height=u/a,this._resolution=a,this.pixelWidth===o&&this.pixelHeight===u?!1:(this._refreshPOT(),this.pixelWidth=o,this.pixelHeight=u,this.emit("resize",this),this._resourceId=Qt("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=ag(this.pixelWidth)&&ag(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Ty.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let li=Ty;class Eh extends li{constructor(t){const n=t.resource||new Float32Array(t.width*t.height*4);let a=t.format;a||(n instanceof Float32Array?a="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?a="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?a="rgba16uint":(n instanceof Int8Array,a="bgra8unorm")),super({...t,resource:n,format:a}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}Eh.extension=yt.TextureSource;const rg=new St;class I1{constructor(t,n){this.mapCoord=new St,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){var n;this.texture!==t&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,n){n===void 0&&(n=t);const a=this.mapCoord;for(let o=0;o<t.length;o+=2){const u=t[o],c=t[o+1];n[o]=u*a.a+c*a.c+a.tx,n[o+1]=u*a.b+c*a.d+a.ty}return n}update(){const t=this._texture;this._updateID++;const n=t.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const a=t.orig,o=t.trim;o&&(rg.set(a.width/o.width,0,0,a.height/o.height,-o.x/o.width,-o.y/o.height),this.mapCoord.append(rg));const u=t.source,c=this.uClampFrame,h=this.clampMargin/u._resolution,m=this.clampOffset/u._resolution;return c[0]=(t.frame.x+h+m)/u.width,c[1]=(t.frame.y+h+m)/u.height,c[2]=(t.frame.x+t.frame.width-h+m)/u.width,c[3]=(t.frame.y+t.frame.height-h+m)/u.height,this.uClampOffset[0]=this.clampOffset/u.pixelWidth,this.uClampOffset[1]=this.clampOffset/u.pixelHeight,this.isSimple=t.frame.width===u.width&&t.frame.height===u.height&&t.rotate===0,!0}}class Gt extends vi{constructor({source:t,label:n,frame:a,orig:o,trim:u,defaultAnchor:c,defaultBorders:h,rotate:m,dynamic:p}={}){if(super(),this.uid=Qt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new It,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(t==null?void 0:t.source)??new li,this.noFrame=!a,a)this.frame.copyFrom(a);else{const{width:g,height:x}=this._source;this.frame.width=g,this.frame.height=x}this.orig=o||this.frame,this.trim=u,this.rotate=m??0,this.defaultAnchor=c,this.defaultBorders=h,this.destroyed=!1,this.dynamic=p||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new I1(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:n}=this,{width:a,height:o}=this._source,u=n.x/a,c=n.y/o,h=n.width/a,m=n.height/o;let p=this.rotate;if(p){const g=h/2,x=m/2,_=u+g,b=c+x;p=Ut.add(p,Ut.NW),t.x0=_+g*Ut.uX(p),t.y0=b+x*Ut.uY(p),p=Ut.add(p,2),t.x1=_+g*Ut.uX(p),t.y1=b+x*Ut.uY(p),p=Ut.add(p,2),t.x2=_+g*Ut.uX(p),t.y2=b+x*Ut.uY(p),p=Ut.add(p,2),t.x3=_+g*Ut.uX(p),t.y3=b+x*Ut.uY(p)}else t.x0=u,t.y0=c,t.x1=u+h,t.y1=c,t.x2=u+h,t.y2=c+m,t.x3=u,t.y3=c+m}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return wt(Ft,"Texture.baseTexture is now Texture.source"),this._source}}Gt.EMPTY=new Gt({label:"EMPTY",source:new li({label:"EMPTY"})});Gt.EMPTY.destroy=_y;Gt.WHITE=new Gt({source:new Eh({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Gt.WHITE.destroy=_y;function wy(l,t,n){const{width:a,height:o}=n.orig,u=n.trim;if(u){const c=u.width,h=u.height;l.minX=u.x-t._x*a,l.maxX=l.minX+c,l.minY=u.y-t._y*o,l.maxY=l.minY+h}else l.minX=-t._x*a,l.maxX=l.minX+a,l.minY=-t._y*o,l.maxY=l.minY+o}const og=new St;class si{constructor(t=1/0,n=1/0,a=-1/0,o=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=og,this.minX=t,this.minY=n,this.maxX=a,this.maxY=o}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new It);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=og,this}set(t,n,a,o){this.minX=t,this.minY=n,this.maxX=a,this.maxY=o}addFrame(t,n,a,o,u){u||(u=this.matrix);const c=u.a,h=u.b,m=u.c,p=u.d,g=u.tx,x=u.ty;let _=this.minX,b=this.minY,T=this.maxX,w=this.maxY,S=c*t+m*n+g,A=h*t+p*n+x;S<_&&(_=S),A<b&&(b=A),S>T&&(T=S),A>w&&(w=A),S=c*a+m*n+g,A=h*a+p*n+x,S<_&&(_=S),A<b&&(b=A),S>T&&(T=S),A>w&&(w=A),S=c*t+m*o+g,A=h*t+p*o+x,S<_&&(_=S),A<b&&(b=A),S>T&&(T=S),A>w&&(w=A),S=c*a+m*o+g,A=h*a+p*o+x,S<_&&(_=S),A<b&&(b=A),S>T&&(T=S),A>w&&(w=A),this.minX=_,this.minY=b,this.maxX=T,this.maxY=w}addRect(t,n){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,n)}addBounds(t,n){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,n)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const n=this.minX,a=this.minY,o=this.maxX,u=this.maxY,{a:c,b:h,c:m,d:p,tx:g,ty:x}=t;let _=c*n+m*a+g,b=h*n+p*a+x;this.minX=_,this.minY=b,this.maxX=_,this.maxY=b,_=c*o+m*a+g,b=h*o+p*a+x,this.minX=_<this.minX?_:this.minX,this.minY=b<this.minY?b:this.minY,this.maxX=_>this.maxX?_:this.maxX,this.maxY=b>this.maxY?b:this.maxY,_=c*n+m*u+g,b=h*n+p*u+x,this.minX=_<this.minX?_:this.minX,this.minY=b<this.minY?b:this.minY,this.maxX=_>this.maxX?_:this.maxX,this.maxY=b>this.maxY?b:this.maxY,_=c*o+m*u+g,b=h*o+p*u+x,this.minX=_<this.minX?_:this.minX,this.minY=b<this.minY?b:this.minY,this.maxX=_>this.maxX?_:this.maxX,this.maxY=b>this.maxY?b:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,n,a,o){return this.minX<t&&(this.minX=t),this.maxX>n&&(this.maxX=n),this.minY<a&&(this.minY=a),this.maxY>o&&(this.maxY=o),this}pad(t,n=t){return this.minX-=t,this.maxX+=t,this.minY-=n,this.maxY+=n,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new si(this.minX,this.minY,this.maxX,this.maxY)}scale(t,n=t){return this.minX*=t,this.minY*=n,this.maxX*=t,this.maxY*=n,this}get x(){return this.minX}set x(t){const n=this.maxX-this.minX;this.minX=t,this.maxX=t+n}get y(){return this.minY}set y(t){const n=this.maxY-this.minY;this.minY=t,this.maxY=t+n}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,n,a,o){let u=this.minX,c=this.minY,h=this.maxX,m=this.maxY;o||(o=this.matrix);const p=o.a,g=o.b,x=o.c,_=o.d,b=o.tx,T=o.ty;for(let w=n;w<a;w+=2){const S=t[w],A=t[w+1],C=p*S+x*A+b,E=g*S+_*A+T;u=C<u?C:u,c=E<c?E:c,h=C>h?C:h,m=E>m?E:m}this.minX=u,this.minY=c,this.maxX=h,this.maxY=m}containsPoint(t,n){return this.minX<=t&&this.minY<=n&&this.maxX>=t&&this.maxY>=n}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var K1={grad:.9,turn:360,rad:360/(2*Math.PI)},ji=function(l){return typeof l=="string"?l.length>0:typeof l=="number"},re=function(l,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*l)/n+0},ii=function(l,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),l>n?n:l>t?l:t},Cy=function(l){return(l=isFinite(l)?l%360:0)>0?l:l+360},ug=function(l){return{r:ii(l.r,0,255),g:ii(l.g,0,255),b:ii(l.b,0,255),a:ii(l.a)}},Nc=function(l){return{r:re(l.r),g:re(l.g),b:re(l.b),a:re(l.a,3)}},$1=/^#([0-9a-f]{3,8})$/i,Lr=function(l){var t=l.toString(16);return t.length<2?"0"+t:t},My=function(l){var t=l.r,n=l.g,a=l.b,o=l.a,u=Math.max(t,n,a),c=u-Math.min(t,n,a),h=c?u===t?(n-a)/c:u===n?2+(a-t)/c:4+(t-n)/c:0;return{h:60*(h<0?h+6:h),s:u?c/u*100:0,v:u/255*100,a:o}},Ey=function(l){var t=l.h,n=l.s,a=l.v,o=l.a;t=t/360*6,n/=100,a/=100;var u=Math.floor(t),c=a*(1-n),h=a*(1-(t-u)*n),m=a*(1-(1-t+u)*n),p=u%6;return{r:255*[a,h,c,c,m,a][p],g:255*[m,a,a,h,c,c][p],b:255*[c,c,m,a,a,h][p],a:o}},cg=function(l){return{h:Cy(l.h),s:ii(l.s,0,100),l:ii(l.l,0,100),a:ii(l.a)}},hg=function(l){return{h:re(l.h),s:re(l.s),l:re(l.l),a:re(l.a,3)}},fg=function(l){return Ey((n=(t=l).s,{h:t.h,s:(n*=((a=t.l)<50?a:100-a)/100)>0?2*n/(a+n)*100:0,v:a+n,a:t.a}));var t,n,a},il=function(l){return{h:(t=My(l)).h,s:(o=(200-(n=t.s))*(a=t.v)/100)>0&&o<200?n*a/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,a,o},J1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tb=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,eb=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ib=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rh={string:[[function(l){var t=$1.exec(l);return t?(l=t[1]).length<=4?{r:parseInt(l[0]+l[0],16),g:parseInt(l[1]+l[1],16),b:parseInt(l[2]+l[2],16),a:l.length===4?re(parseInt(l[3]+l[3],16)/255,2):1}:l.length===6||l.length===8?{r:parseInt(l.substr(0,2),16),g:parseInt(l.substr(2,2),16),b:parseInt(l.substr(4,2),16),a:l.length===8?re(parseInt(l.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(l){var t=eb.exec(l)||ib.exec(l);return t?t[2]!==t[4]||t[4]!==t[6]?null:ug({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(l){var t=J1.exec(l)||tb.exec(l);if(!t)return null;var n,a,o=cg({h:(n=t[1],a=t[2],a===void 0&&(a="deg"),Number(n)*(K1[a]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return fg(o)},"hsl"]],object:[[function(l){var t=l.r,n=l.g,a=l.b,o=l.a,u=o===void 0?1:o;return ji(t)&&ji(n)&&ji(a)?ug({r:Number(t),g:Number(n),b:Number(a),a:Number(u)}):null},"rgb"],[function(l){var t=l.h,n=l.s,a=l.l,o=l.a,u=o===void 0?1:o;if(!ji(t)||!ji(n)||!ji(a))return null;var c=cg({h:Number(t),s:Number(n),l:Number(a),a:Number(u)});return fg(c)},"hsl"],[function(l){var t=l.h,n=l.s,a=l.v,o=l.a,u=o===void 0?1:o;if(!ji(t)||!ji(n)||!ji(a))return null;var c=(function(h){return{h:Cy(h.h),s:ii(h.s,0,100),v:ii(h.v,0,100),a:ii(h.a)}})({h:Number(t),s:Number(n),v:Number(a),a:Number(u)});return Ey(c)},"hsv"]]},dg=function(l,t){for(var n=0;n<t.length;n++){var a=t[n][0](l);if(a)return[a,t[n][1]]}return[null,void 0]},nb=function(l){return typeof l=="string"?dg(l.trim(),rh.string):typeof l=="object"&&l!==null?dg(l,rh.object):[null,void 0]},Gc=function(l,t){var n=il(l);return{h:n.h,s:ii(n.s+100*t,0,100),l:n.l,a:n.a}},kc=function(l){return(299*l.r+587*l.g+114*l.b)/1e3/255},mg=function(l,t){var n=il(l);return{h:n.h,s:n.s,l:ii(n.l+100*t,0,100),a:n.a}},oh=(function(){function l(t){this.parsed=nb(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return l.prototype.isValid=function(){return this.parsed!==null},l.prototype.brightness=function(){return re(kc(this.rgba),2)},l.prototype.isDark=function(){return kc(this.rgba)<.5},l.prototype.isLight=function(){return kc(this.rgba)>=.5},l.prototype.toHex=function(){return t=Nc(this.rgba),n=t.r,a=t.g,o=t.b,c=(u=t.a)<1?Lr(re(255*u)):"","#"+Lr(n)+Lr(a)+Lr(o)+c;var t,n,a,o,u,c},l.prototype.toRgb=function(){return Nc(this.rgba)},l.prototype.toRgbString=function(){return t=Nc(this.rgba),n=t.r,a=t.g,o=t.b,(u=t.a)<1?"rgba("+n+", "+a+", "+o+", "+u+")":"rgb("+n+", "+a+", "+o+")";var t,n,a,o,u},l.prototype.toHsl=function(){return hg(il(this.rgba))},l.prototype.toHslString=function(){return t=hg(il(this.rgba)),n=t.h,a=t.s,o=t.l,(u=t.a)<1?"hsla("+n+", "+a+"%, "+o+"%, "+u+")":"hsl("+n+", "+a+"%, "+o+"%)";var t,n,a,o,u},l.prototype.toHsv=function(){return t=My(this.rgba),{h:re(t.h),s:re(t.s),v:re(t.v),a:re(t.a,3)};var t},l.prototype.invert=function(){return _i({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},l.prototype.saturate=function(t){return t===void 0&&(t=.1),_i(Gc(this.rgba,t))},l.prototype.desaturate=function(t){return t===void 0&&(t=.1),_i(Gc(this.rgba,-t))},l.prototype.grayscale=function(){return _i(Gc(this.rgba,-1))},l.prototype.lighten=function(t){return t===void 0&&(t=.1),_i(mg(this.rgba,t))},l.prototype.darken=function(t){return t===void 0&&(t=.1),_i(mg(this.rgba,-t))},l.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},l.prototype.alpha=function(t){return typeof t=="number"?_i({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):re(this.rgba.a,3);var n},l.prototype.hue=function(t){var n=il(this.rgba);return typeof t=="number"?_i({h:t,s:n.s,l:n.l,a:n.a}):re(n.h)},l.prototype.isEqual=function(t){return this.toHex()===_i(t).toHex()},l})(),_i=function(l){return l instanceof oh?l:new oh(l)},pg=[],sb=function(l){l.forEach(function(t){pg.indexOf(t)<0&&(t(oh,rh),pg.push(t))})};function ab(l,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},a={};for(var o in n)a[n[o]]=o;var u={};l.prototype.toName=function(c){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var h,m,p=a[this.toHex()];if(p)return p;if(c!=null&&c.closest){var g=this.toRgb(),x=1/0,_="black";if(!u.length)for(var b in n)u[b]=new l(n[b]).toRgb();for(var T in n){var w=(h=g,m=u[T],Math.pow(h.r-m.r,2)+Math.pow(h.g-m.g,2)+Math.pow(h.b-m.b,2));w<x&&(x=w,_=T)}return _}},t.string.push([function(c){var h=c.toLowerCase(),m=h==="transparent"?"#0000":n[h];return m?new l(m).toRgb():null},"name"])}sb([ab]);const Ws=class $a{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof $a)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,n){const a=typeof t;if(a!==typeof n)return!1;if(a==="number"||a==="string"||t instanceof Number)return t===n;if(Array.isArray(t)&&Array.isArray(n)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(n))return t.length!==n.length?!1:t.every((u,c)=>u===n[c]);if(t!==null&&n!==null){const u=Object.keys(t),c=Object.keys(n);return u.length!==c.length?!1:u.every(h=>t[h]===n[h])}return t===n}toRgba(){const[t,n,a,o]=this._components;return{r:t,g:n,b:a,a:o}}toRgb(){const[t,n,a]=this._components;return{r:t,g:n,b:a}}toRgbaString(){const[t,n,a]=this.toUint8RgbArray();return`rgba(${t},${n},${a},${this.alpha})`}toUint8RgbArray(t){const[n,a,o]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(n*255),t[1]=Math.round(a*255),t[2]=Math.round(o*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[n,a,o,u]=this._components;return t[0]=n,t[1]=a,t[2]=o,t[3]=u,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[n,a,o]=this._components;return t[0]=n,t[1]=a,t[2]=o,t}toNumber(){return this._int}toBgrNumber(){const[t,n,a]=this.toUint8RgbArray();return(a<<16)+(n<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[n,a,o,u]=$a._temp.setValue(t)._components;return this._components[0]*=n,this._components[1]*=a,this._components[2]*=o,this._components[3]*=u,this._refreshInt(),this._value=null,this}premultiply(t,n=!0){return n&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,n=!0){if(t===1)return(255<<24)+this._int;if(t===0)return n?0:this._int;let a=this._int>>16&255,o=this._int>>8&255,u=this._int&255;return n&&(a=a*t+.5|0,o=o*t+.5|0,u=u*t+.5|0),(t*255<<24)+(a<<16)+(o<<8)+u}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let n,a,o,u;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const c=t;n=(c>>16&255)/255,a=(c>>8&255)/255,o=(c&255)/255,u=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,a,o,u=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,a,o,u=255]=t,n/=255,a/=255,o/=255,u/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const h=$a.HEX_PATTERN.exec(t);h&&(t=`#${h[2]}`)}const c=_i(t);c.isValid()&&({r:n,g:a,b:o,a:u}=c.rgba,n/=255,a/=255,o/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=a,this._components[2]=o,this._components[3]=u,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,n,a]=this._components;this._int=(t*255<<16)+(n*255<<8)+(a*255|0)}_clamp(t,n=0,a=1){return typeof t=="number"?Math.min(Math.max(t,n),a):(t.forEach((o,u)=>{t[u]=Math.min(Math.max(o,n),a)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof $a||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};Ws.shared=new Ws;Ws._temp=new Ws;Ws.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let se=Ws;const lb={cullArea:null,cullable:!1,cullableChildren:!0};let Uc=0;const gg=500;function be(...l){Uc!==gg&&(Uc++,Uc===gg?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...l))}const dl={_registeredResources:new Set,register(l){this._registeredResources.add(l)},unregister(l){this._registeredResources.delete(l)},release(){this._registeredResources.forEach(l=>l.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(l){return this._registeredResources.has(l)},reset(){this._registeredResources.clear()}};class rb{constructor(t,n){this._pool=[],this._count=0,this._index=0,this._classType=t,n&&this.prepopulate(n)}prepopulate(t){for(let n=0;n<t;n++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){var a;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(a=n.init)==null||a.call(n,t),n}return(t){var n;(n=t.reset)==null||n.call(t),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}class ob{constructor(){this._poolsByClass=new Map}prepopulate(t,n){this.getPool(t).prepopulate(n)}get(t,n){return this.getPool(t).get(n)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new rb(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(n=>{const a=t[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;t[a]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const Re=new ob;dl.register(Re);const ub={get isCachedAsTexture(){var l;return!!((l=this.renderGroup)!=null&&l.isCachedAsTexture)},cacheAsTexture(l){typeof l=="boolean"&&l===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(l===!0?{}:l))},updateCacheTexture(){var l;(l=this.renderGroup)==null||l.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(l){wt("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(l)}};function cb(l,t,n){const a=l.length;let o;if(t>=a||n===0)return;n=t+n>a?a-t:n;const u=a-n;for(o=t;o<u;++o)l[o]=l[o+n];l.length=u}const hb={allowChildren:!0,removeChildren(l=0,t){var u;const n=t??this.children.length,a=n-l,o=[];if(a>0&&a<=n){for(let h=n-1;h>=l;h--){const m=this.children[h];m&&(o.push(m),m.parent=null)}cb(this.children,l,n);const c=this.renderGroup||this.parentRenderGroup;c&&c.removeChildren(o);for(let h=0;h<o.length;++h){const m=o[h];(u=m.parentRenderLayer)==null||u.detach(m),this.emit("childRemoved",m,this,h),o[h].emit("removed",this)}return o.length>0&&this._didViewChangeTick++,o}else if(a===0&&this.children.length===0)return o;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(l){const t=this.getChildAt(l);return this.removeChild(t)},getChildAt(l){if(l<0||l>=this.children.length)throw new Error(`getChildAt: Index (${l}) does not exist.`);return this.children[l]},setChildIndex(l,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(l),this.addChildAt(l,t)},getChildIndex(l){const t=this.children.indexOf(l);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(l,t){this.allowChildren||wt(Ft,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(t<0||t>n.length)throw new Error(`${l}addChildAt: The index ${t} supplied is out of bounds ${n.length}`);const a=l.parent===this;if(l.parent){const u=l.parent.children.indexOf(l);if(a){if(u===t)return l;l.parent.children.splice(u,1)}else l.removeFromParent()}t===n.length?n.push(l):n.splice(t,0,l),l.parent=this,l.didChange=!0,l._updateFlags=15;const o=this.renderGroup||this.parentRenderGroup;return o&&o.addChild(l),this.sortableChildren&&(this.sortDirty=!0),a||(this.emit("childAdded",l,this,t),l.emit("added",this)),l},swapChildren(l,t){if(l===t)return;const n=this.getChildIndex(l),a=this.getChildIndex(t);this.children[n]=t,this.children[a]=l;const o=this.renderGroup||this.parentRenderGroup;o&&(o.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var l;(l=this.parent)==null||l.removeChild(this)},reparentChild(...l){return l.length===1?this.reparentChildAt(l[0],this.children.length):(l.forEach(t=>this.reparentChildAt(t,this.children.length)),l[0])},reparentChildAt(l,t){if(l.parent===this)return this.setChildIndex(l,t),l;const n=l.worldTransform.clone();l.removeFromParent(),this.addChildAt(l,t);const a=this.worldTransform.clone();return a.invert(),n.prepend(a),l.setFromMatrix(n),l},replaceChild(l,t){l.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(l)),t.setFromMatrix(l.localTransform),t.updateLocalTransform(),this.removeChild(l)}},fb={collectRenderables(l,t,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(l,t,n):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,l):this.collectRenderablesWithEffects(l,t,n))},collectRenderablesSimple(l,t,n){const a=this.children,o=a.length;for(let u=0;u<o;u++)a[u].collectRenderables(l,t,n)},collectRenderablesWithEffects(l,t,n){const{renderPipes:a}=t;for(let o=0;o<this.effects.length;o++){const u=this.effects[o];a[u.pipe].push(u,this,l)}this.collectRenderablesSimple(l,t,n);for(let o=this.effects.length-1;o>=0;o--){const u=this.effects[o];a[u.pipe].pop(u,this,l)}}};class yg{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}class db{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let n=0;n<this._tests.length;n++){const a=this._tests[n];if(a.test(t))return Re.get(a.maskClass,t)}return t}returnMaskEffect(t){Re.return(t)}}const uh=new db;Kt.handleByList(yt.MaskEffect,uh._effectClasses);const mb={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const l=this.renderGroup||this.parentRenderGroup;l&&(l.structureDidChange=!0)},addEffect(l){this.effects.indexOf(l)===-1&&(this.effects.push(l),this.effects.sort((n,a)=>n.priority-a.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(l){const t=this.effects.indexOf(l);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(l){const t=this._maskEffect;(t==null?void 0:t.mask)!==l&&(t&&(this.removeEffect(t),uh.returnMaskEffect(t),this._maskEffect=null),l!=null&&(this._maskEffect=uh.getMaskEffect(l),this.addEffect(this._maskEffect)))},get mask(){var l;return(l=this._maskEffect)==null?void 0:l.mask},setMask(l){this._maskOptions={...this._maskOptions,...l},l.mask&&(this.mask=l.mask),this._markStructureAsChanged()},set filters(l){var u;!Array.isArray(l)&&l&&(l=[l]);const t=this._filterEffect||(this._filterEffect=new yg);l=l;const n=(l==null?void 0:l.length)>0,a=((u=t.filters)==null?void 0:u.length)>0,o=n!==a;l=Array.isArray(l)?l.slice(0):l,t.filters=Object.freeze(l),o&&(n?this.addEffect(t):(this.removeEffect(t),t.filters=l??null))},get filters(){var l;return(l=this._filterEffect)==null?void 0:l.filters},set filterArea(l){this._filterEffect||(this._filterEffect=new yg),this._filterEffect.filterArea=l},get filterArea(){var l;return(l=this._filterEffect)==null?void 0:l.filterArea}},pb={label:null,get name(){return wt(Ft,"Container.name property has been removed, use Container.label instead"),this.label},set name(l){wt(Ft,"Container.name property has been removed, use Container.label instead"),this.label=l},getChildByName(l,t=!1){return this.getChildByLabel(l,t)},getChildByLabel(l,t=!1){const n=this.children;for(let a=0;a<n.length;a++){const o=n[a];if(o.label===l||l instanceof RegExp&&l.test(o.label))return o}if(t)for(let a=0;a<n.length;a++){const u=n[a].getChildByLabel(l,!0);if(u)return u}return null},getChildrenByLabel(l,t=!1,n=[]){const a=this.children;for(let o=0;o<a.length;o++){const u=a[o];(u.label===l||l instanceof RegExp&&l.test(u.label))&&n.push(u)}if(t)for(let o=0;o<a.length;o++)a[o].getChildrenByLabel(l,!0,n);return n}},_e=Re.getPool(St),Xi=Re.getPool(si),gb=new St,yb={getFastGlobalBounds(l,t){t||(t=new si),t.clear(),this._getGlobalBoundsRecursive(!!l,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(n.worldTransform),t},_getGlobalBoundsRecursive(l,t,n){let a=t;if(l&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const o=!!this.effects.length;if((this.renderGroup||o)&&(a=Xi.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const c=this.bounds;a.addFrame(c.minX,c.minY,c.maxX,c.maxY,this.groupTransform)}const u=this.children;for(let c=0;c<u.length;c++)u[c]._getGlobalBoundsRecursive(l,a,n)}if(o){let u=!1;const c=this.renderGroup||this.parentRenderGroup;for(let h=0;h<this.effects.length;h++)this.effects[h].addBounds&&(u||(u=!0,a.applyMatrix(c.worldTransform)),this.effects[h].addBounds(a,!0));u&&a.applyMatrix(c.worldTransform.copyTo(gb).invert()),t.addBounds(a),Xi.return(a)}else this.renderGroup&&(t.addBounds(a,this.relativeGroupTransform),Xi.return(a))}};function Ry(l,t,n){n.clear();let a,o;return l.parent?t?a=l.parent.worldTransform:(o=_e.get().identity(),a=Rh(l,o)):a=St.IDENTITY,zy(l,n,a,t),o&&_e.return(o),n.isValid||n.set(0,0,0,0),n}function zy(l,t,n,a){var h,m;if(!l.visible||!l.measurable)return;let o;a?o=l.worldTransform:(l.updateLocalTransform(),o=_e.get(),o.appendFrom(l.localTransform,n));const u=t,c=!!l.effects.length;if(c&&(t=Xi.get().clear()),l.boundsArea)t.addRect(l.boundsArea,o);else{const p=l.bounds;p&&!p.isEmpty()&&(t.matrix=o,t.addBounds(p));for(let g=0;g<l.children.length;g++)zy(l.children[g],t,o,a)}if(c){for(let p=0;p<l.effects.length;p++)(m=(h=l.effects[p]).addBounds)==null||m.call(h,t);u.addBounds(t,St.IDENTITY),Xi.return(t)}a||_e.return(o)}function Rh(l,t){const n=l.parent;return n&&(Rh(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}function Dy(l,t){if(l===16777215||!t)return t;if(t===16777215||!l)return l;const n=l>>16&255,a=l>>8&255,o=l&255,u=t>>16&255,c=t>>8&255,h=t&255,m=n*u/255|0,p=a*c/255|0,g=o*h/255|0;return(m<<16)+(p<<8)+g}const xg=16777215;function _g(l,t){return l===xg?t:t===xg?l:Dy(l,t)}function Kr(l){return((l&255)<<16)+(l&65280)+(l>>16&255)}const xb={getGlobalAlpha(l){if(l)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,n=this.parent;for(;n;)t*=n.alpha,n=n.parent;return t},getGlobalTransform(l=new St,t){if(t)return l.copyFrom(this.worldTransform);this.updateLocalTransform();const n=Rh(this,_e.get().identity());return l.appendFrom(this.localTransform,n),_e.return(n),l},getGlobalTint(l){if(l)return this.renderGroup?Kr(this.renderGroup.worldColor):this.parentRenderGroup?Kr(_g(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=_g(t,n.localColor),n=n.parent;return Kr(t)}};function By(l,t,n){return t.clear(),n||(n=St.IDENTITY),Oy(l,t,n,l,!0),t.isValid||t.set(0,0,0,0),t}function Oy(l,t,n,a,o){var m,p;let u;if(o)u=_e.get(),u=n.copyTo(u);else{if(!l.visible||!l.measurable)return;l.updateLocalTransform();const g=l.localTransform;u=_e.get(),u.appendFrom(g,n)}const c=t,h=!!l.effects.length;if(h&&(t=Xi.get().clear()),l.boundsArea)t.addRect(l.boundsArea,u);else{l.renderPipeId&&(t.matrix=u,t.addBounds(l.bounds));const g=l.children;for(let x=0;x<g.length;x++)Oy(g[x],t,u,a,!1)}if(h){for(let g=0;g<l.effects.length;g++)(p=(m=l.effects[g]).addLocalBounds)==null||p.call(m,t,a);c.addBounds(t,St.IDENTITY),Xi.return(t)}_e.return(u)}function Ny(l,t){const n=l.children;for(let a=0;a<n.length;a++){const o=n[a],u=o.uid,c=(o._didViewChangeTick&65535)<<16|o._didContainerChangeTick&65535,h=t.index;(t.data[h]!==u||t.data[h+1]!==c)&&(t.data[t.index]=u,t.data[t.index+1]=c,t.didChange=!0),t.index=h+2,o.children.length&&Ny(o,t)}return t.didChange}const _b=new St,bb={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(l,t){const n=Math.sign(this.scale.x)||1;t!==0?this.scale.x=l/t*n:this.scale.x=n},_setHeight(l,t){const n=Math.sign(this.scale.y)||1;t!==0?this.scale.y=l/t*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new si});const l=this._localBoundsCacheData;return l.index=1,l.didChange=!1,l.data[0]!==this._didViewChangeTick&&(l.didChange=!0,l.data[0]=this._didViewChangeTick),Ny(this,l),l.didChange&&By(this,l.localBounds,_b),l.localBounds},getBounds(l,t){return Ry(this,l,t||new si)}},vb={_onRender:null,set onRender(l){const t=this.renderGroup||this.parentRenderGroup;if(!l){this._onRender&&(t==null||t.removeOnRender(this)),this._onRender=null;return}this._onRender||t==null||t.addOnRender(this),this._onRender=l},get onRender(){return this._onRender}},Sb={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(l){this._zIndex!==l&&(this._zIndex=l,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(Tb))}};function Tb(l,t){return l._zIndex-t._zIndex}const Ab={getGlobalPosition(l=new ge,t=!1){return this.parent?this.parent.toGlobal(this._position,l,t):(l.x=this._position.x,l.y=this._position.y),l},toGlobal(l,t,n=!1){const a=this.getGlobalTransform(_e.get(),n);return t=a.apply(l,t),_e.return(a),t},toLocal(l,t,n,a){t&&(l=t.toGlobal(l,n,a));const o=this.getGlobalTransform(_e.get(),a);return n=o.applyInverse(l,n),_e.return(o),n}};class zh{constructor(){this.uid=Qt("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let wb=0;class Cb{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Qs(this.textureOptions)}createTexture(t,n,a,o){const u=new li({...this.textureOptions,width:t,height:n,resolution:1,antialias:a,autoGarbageCollect:!1,autoGenerateMipmaps:o});return new Gt({source:u,label:`texturePool_${wb++}`})}getOptimalTexture(t,n,a=1,o,u=!1){let c=Math.ceil(t*a-1e-6),h=Math.ceil(n*a-1e-6);c=Fs(c),h=Fs(h);const m=o?1:0,p=u?1:0,g=(c<<17)+(h<<2)+(p<<1)+m;this._texturePool[g]||(this._texturePool[g]=[]);let x=this._texturePool[g].pop();return x||(x=this.createTexture(c,h,o,u)),x.source._resolution=a,x.source.width=c/a,x.source.height=h/a,x.source.pixelWidth=c,x.source.pixelHeight=h,x.frame.x=0,x.frame.y=0,x.frame.width=t,x.frame.height=n,x.updateUvs(),this._poolKeyHash[x.uid]=g,x}getSameSizeTexture(t,n=!1){const a=t.source;return this.getOptimalTexture(t.width,t.height,a._resolution,n)}returnTexture(t,n=!1){const a=this._poolKeyHash[t.uid];n&&(t.source.style=this.textureStyle),this._texturePool[a].push(t)}clear(t){if(t=t!==!1,t)for(const n in this._texturePool){const a=this._texturePool[n];if(a)for(let o=0;o<a.length;o++)a[o].destroy(!0)}this._texturePool={}}}const so=new Cb;dl.register(so);class Mb{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new St,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new zh,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const n=t.children;for(let a=0;a<n.length;a++){const o=n[a];o._updateFlags=15,this.addChild(o)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(so.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const n=this.childrenToUpdate[t];n.list.fill(null),n.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const n=this.renderGroupChildren.indexOf(t);n>-1&&this.renderGroupChildren.splice(n,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const n=t.children;for(let a=0;a<n.length;a++)this.addChild(n[a])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}const n=t.children;for(let a=0;a<n.length;a++)this.removeChild(n[a])}removeChildren(t){for(let n=0;n<t.length;n++)this.removeChild(t[n])}onChildUpdate(t){let n=this.childrenToUpdate[t.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const n=this.root.children;for(let a=0;a<n.length;a++)this._getChildren(n[a],t);return t}_getChildren(t,n=[]){if(n.push(t),t.renderGroup)return n;const a=t.children;for(let o=0;o<a.length;o++)this._getChildren(a[o],n);return n}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new St),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new St),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new St),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function Eb(l,t,n={}){for(const a in t)!n[a]&&t[a]!==void 0&&(l[a]=t[a])}const Hc=new de(null),jr=new de(null),Lc=new de(null,1,1),Yr=new de(null),bg=1,Rb=2,jc=4;class ai extends vi{constructor(t={}){var n,a;super(),this.uid=Qt("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new St,this.relativeGroupTransform=new St,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new de(this,0,0),this._scale=Lc,this._pivot=jr,this._origin=Yr,this._skew=Hc,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Eb(this,t,{children:!0,parent:!0,effects:!0}),(n=t.children)==null||n.forEach(o=>this.addChild(o)),(a=t.parent)==null||a.addChild(this)}static mixin(t){wt("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Kt.mixin(ai,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||wt(Ft,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let o=0;o<t.length;o++)this.addChild(t[o]);return t[0]}const n=t[0],a=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),a&&(a.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,a&&a.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...t){if(t.length>1){for(let o=0;o<t.length;o++)this.removeChild(t[o]);return t[0]}const n=t[0],a=this.children.indexOf(n);return a>-1&&(this._didViewChangeTick++,this.children.splice(a,1),this.renderGroup?this.renderGroup.removeChild(n):this.parentRenderGroup&&this.parentRenderGroup.removeChild(n),n.parentRenderLayer&&n.parentRenderLayer.detach(n),n.parent=null,this.emit("childRemoved",n,this,a),n.emit("removed",this)),n}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),this.renderGroup=Re.get(Mb,this),this.groupTransform=St.IDENTITY,t==null||t.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),Re.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t==null||t.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new St),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*X1}set angle(t){this.rotation=t*V1}get pivot(){return this._pivot===jr&&(this._pivot=new de(this,0,0)),this._pivot}set pivot(t){this._pivot===jr&&(this._pivot=new de(this,0,0),this._origin!==Yr&&be("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Hc&&(this._skew=new de(this,0,0)),this._skew}set skew(t){this._skew===Hc&&(this._skew=new de(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===Lc&&(this._scale=new de(this,1,1)),this._scale}set scale(t){this._scale===Lc&&(this._scale=new de(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===Yr&&(this._origin=new de(this,0,0)),this._origin}set origin(t){this._origin===Yr&&(this._origin=new de(this,0,0),this._pivot!==jr&&be("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const n=this.getLocalBounds().width;this._setWidth(t,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const n=this.getLocalBounds().height;this._setHeight(t,n)}getSize(t){t||(t={});const n=this.getLocalBounds();return t.width=Math.abs(this.scale.x*n.width),t.height=Math.abs(this.scale.y*n.height),t}setSize(t,n){const a=this.getLocalBounds();typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,a.width),n!==void 0&&this._setHeight(n,a.height)}_updateSkew(){const t=this._rotation,n=this._skew;this._cx=Math.cos(t+n._y),this._sx=Math.sin(t+n._y),this._cy=-Math.sin(t-n._x),this._sy=Math.cos(t-n._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const n=this.localTransform,a=this._scale,o=this._pivot,u=this._origin,c=this._position,h=a._x,m=a._y,p=o._x,g=o._y,x=-u._x,_=-u._y;n.a=this._cx*h,n.b=this._sx*h,n.c=this._cy*m,n.d=this._sy*m,n.tx=c._x-(p*n.a+g*n.c)+(x*n.a+_*n.c)-x,n.ty=c._y-(p*n.b+g*n.d)+(x*n.b+_*n.d)-_}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=bg,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const a=se.shared.setValue(t??16777215).toBgrNumber();a!==this.localColor&&(this.localColor=a,this._updateFlags|=bg,this._onUpdate())}get tint(){return Kr(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Rb,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const n=t?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=jc,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const n=t?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=jc,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const n=t?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=jc,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){var o;if(this.destroyed)return;this.destroyed=!0;let n;if(this.children.length&&(n=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t==null?void 0:t.children)&&n)for(let u=0;u<n.length;++u)n[u].destroy(t);(o=this.renderGroup)==null||o.destroy(),this.renderGroup=null}}Kt.mixin(ai,hb,yb,Ab,vb,bb,mb,pb,Sb,lb,ub,xb,fb);class Dh extends ai{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new si(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const n=this.bounds,{x:a,y:o}=t;return a>=n.minX&&a<=n.maxX&&o>=n.minY&&o<=n.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,n,a){const{renderPipes:o}=n;o.blendMode.pushBlendMode(this,this.groupBlendMode,t);const c=o[this.renderPipeId];c!=null&&c.addRenderable&&c.addRenderable(this,t),this.didViewUpdate=!1;const h=this.children,m=h.length;for(let p=0;p<m;p++)h[p].collectRenderables(t,n,a);o.blendMode.popBlendMode(t)}}class ll extends Dh{constructor(t=Gt.EMPTY){t instanceof Gt&&(t={texture:t});const{texture:n=Gt.EMPTY,anchor:a,roundPixels:o,width:u,height:c,...h}=t;super({label:"Sprite",...h}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new de({_onUpdate:()=>{this.onViewUpdate()}}),a?this.anchor=a:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=o??!1,u!==void 0&&(this.width=u),c!==void 0&&(this.height=c)}static from(t,n=!1){return t instanceof Gt?new ll(t):new ll(Gt.from(t,n))}set texture(t){t||(t=Gt.EMPTY);const n=this._texture;n!==t&&(n&&n.dynamic&&n.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return wy(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return wt("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,n=this._texture,a=this._bounds,{width:o,height:u}=n.orig;a.minX=-t._x*o,a.maxX=a.minX+o,a.minY=-t._y*u,a.maxY=a.minY+u}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const a=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(a)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,n){typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const zb=new si;function Gy(l,t,n){const a=zb;l.measurable=!0,Ry(l,n,a),t.addBoundsMask(a),l.measurable=!1}function ky(l,t,n){const a=Xi.get();l.measurable=!0;const o=_e.get().identity(),u=Uy(l,n,o);By(l,a,u),l.measurable=!1,t.addBoundsMask(a),_e.return(o),Xi.return(a)}function Uy(l,t,n){return l?(l!==t&&(Uy(l.parent,t,n),l.updateLocalTransform(),n.append(l.localTransform)),n):(be("Mask bounds, renderable is not inside the root container"),n)}class Hy{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof ll),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,n){this.inverse||Gy(this.mask,t,n)}addLocalBounds(t,n){ky(this.mask,t,n)}containsPoint(t,n){const a=this.mask;return n(a,t)}destroy(){this.reset()}static test(t){return t instanceof ll}}Hy.extension=yt.MaskEffect;class Ly{constructor(t){this.priority=0,this.pipe="colorMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}Ly.extension=yt.MaskEffect;class jy{constructor(t){this.priority=0,this.pipe="stencilMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,n){Gy(this.mask,t,n)}addLocalBounds(t,n){ky(this.mask,t,n)}containsPoint(t,n){const a=this.mask;return n(a,t)}destroy(){this.reset()}static test(t){return t instanceof ai}}jy.extension=yt.MaskEffect;const Db={createCanvas:(l,t)=>{const n=document.createElement("canvas");return n.width=l,n.height=t,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(l,t)=>fetch(l,t),parseXML:l=>new DOMParser().parseFromString(l,"text/xml")};let vg=Db;const Ve={get(){return vg},set(l){vg=l}};class Yy extends li{constructor(t){t.resource||(t.resource=Ve.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,n=this.height,a=this._resolution){const o=super.resize(t,n,a);return o&&this.resizeCanvas(),o}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}Yy.extension=yt.TextureSource;class Jr extends li{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}Jr.extension=yt.TextureSource;var to=(l=>(l[l.INTERACTION=50]="INTERACTION",l[l.HIGH=25]="HIGH",l[l.NORMAL=0]="NORMAL",l[l.LOW=-25]="LOW",l[l.UTILITY=-50]="UTILITY",l))(to||{});class Yc{constructor(t,n=null,a=0,o=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=n,this.priority=a,this._once=o}match(t,n=null){return this._fn===t&&this._context===n}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const n=this.next;return this.next=t?null:n,this.previous=null,n}}const qy=class Ye{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Yc(null,null,1/0),this.deltaMS=1/Ye.targetFPMS,this.elapsedMS=1/Ye.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,n,a=to.NORMAL){return this._addListener(new Yc(t,n,a))}addOnce(t,n,a=to.NORMAL){return this._addListener(new Yc(t,n,a,!0))}_addListener(t){let n=this._head.next,a=this._head;if(!n)t.connect(a);else{for(;n;){if(t.priority>n.priority){t.connect(a);break}a=n,n=n.next}t.previous||t.connect(a)}return this._startIfPossible(),this}remove(t,n){let a=this._head.next;for(;a;)a.match(t,n)?a=a.destroy():a=a.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,n=this._head;for(;n=n.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const u=t-this._lastFrame|0;if(u<this._minElapsedMS)return;this._lastFrame=t-u%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*Ye.targetFPMS;const a=this._head;let o=a.next;for(;o;)o=o.emit(this);a.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const n=Math.min(Math.max(0,t)/1e3,Ye.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){t===0?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!Ye._shared){const t=Ye._shared=new Ye;t.autoStart=!0,t._protected=!0}return Ye._shared}static get system(){if(!Ye._system){const t=Ye._system=new Ye;t.autoStart=!0,t._protected=!0}return Ye._system}};qy.targetFPMS=.06;let Vs=qy,qc;async function Bb(){return qc??(qc=(async()=>{var c;const t=Ve.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const n=await new Promise(h=>{const m=document.createElement("video");m.onloadeddata=()=>h(m),m.onerror=()=>h(null),m.autoplay=!1,m.crossOrigin="anonymous",m.preload="auto",m.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",m.load()});if(!n)return"premultiply-alpha-on-upload";const a=t.createTexture();t.bindTexture(t.TEXTURE_2D,a);const o=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,o),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,a,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n);const u=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,u),t.deleteFramebuffer(o),t.deleteTexture(a),(c=t.getExtension("WEBGL_lose_context"))==null||c.loseContext(),u[0]<=u[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),qc}const ao=class Xy extends li{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Xy.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=Vs.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,n=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(n.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await Bb(),this._load=new Promise((a,o)=>{this.isValid?a(this):(this._resolve=a,this._reject=o,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Vs.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Vs.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Vs.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};ao.extension=yt.TextureSource;ao.defaultOptions={...li.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};ao.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Ob=ao;const Ls=(l,t,n=!1)=>(Array.isArray(l)||(l=[l]),t?l.map(a=>typeof a=="string"||n?t(a):a):l);class Nb{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const n=this._cache.get(t);return n||be(`[Assets] Asset id ${t} was not found in the Cache`),n}set(t,n){const a=Ls(t);let o;for(let m=0;m<this.parsers.length;m++){const p=this.parsers[m];if(p.test(n)){o=p.getCacheableAssets(a,n);break}}const u=new Map(Object.entries(o||{}));o||a.forEach(m=>{u.set(m,n)});const c=[...u.keys()],h={cacheKeys:c,keys:a};a.forEach(m=>{this._cacheMap.set(m,h)}),c.forEach(m=>{const p=o?o[m]:n;this._cache.has(m)&&this._cache.get(m)!==p&&be("[Cache] already has key:",m),this._cache.set(m,u.get(m))})}remove(t){if(!this._cacheMap.has(t)){be(`[Assets] Asset id ${t} was not found in the Cache`);return}const n=this._cacheMap.get(t);n.cacheKeys.forEach(o=>{this._cache.delete(o)}),n.keys.forEach(o=>{this._cacheMap.delete(o)})}get parsers(){return this._parsers}}const js=new Nb,ch=[];Kt.handleByList(yt.TextureSource,ch);function Vy(l={}){const t=l&&l.resource,n=t?l.resource:l,a=t?l:{resource:l};for(let o=0;o<ch.length;o++){const u=ch[o];if(u.test(n))return new u(a)}throw new Error(`Could not find a source type for resource: ${a.resource}`)}function Gb(l={},t=!1){const n=l&&l.resource,a=n?l.resource:l,o=n?l:{resource:l};if(!t&&js.has(a))return js.get(a);const u=new Gt({source:Vy(o)});return u.on("destroy",()=>{js.has(a)&&js.remove(a)}),t||js.set(a,u),u}function kb(l,t=!1){return typeof l=="string"?js.get(l):l instanceof li?new Gt({source:l}):Gb(l,t)}Gt.from=kb;li.from=Vy;Kt.add(Hy,Ly,jy,Ob,Jr,Yy,Eh);var Py=(l=>(l[l.Low=0]="Low",l[l.Normal=1]="Normal",l[l.High=2]="High",l))(Py||{});function fi(l){if(typeof l!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(l)}`)}function Pa(l){return l.split("?")[0].split("#")[0]}function Ub(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hb(l,t,n){return l.replace(new RegExp(Ub(t),"g"),n)}function Lb(l,t){let n="",a=0,o=-1,u=0,c=-1;for(let h=0;h<=l.length;++h){if(h<l.length)c=l.charCodeAt(h);else{if(c===47)break;c=47}if(c===47){if(!(o===h-1||u===1))if(o!==h-1&&u===2){if(n.length<2||a!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const m=n.lastIndexOf("/");if(m!==n.length-1){m===-1?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),o=h,u=0;continue}}else if(n.length===2||n.length===1){n="",a=0,o=h,u=0;continue}}}else n.length>0?n+=`/${l.slice(o+1,h)}`:n=l.slice(o+1,h),a=h-o-1;o=h,u=0}else c===46&&u!==-1?++u:u=-1}return n}const rl={toPosix(l){return Hb(l,"\\","/")},isUrl(l){return/^https?:/.test(this.toPosix(l))},isDataUrl(l){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(l)},isBlobUrl(l){return l.startsWith("blob:")},hasProtocol(l){return/^[^/:]+:/.test(this.toPosix(l))},getProtocol(l){fi(l),l=this.toPosix(l);const t=/^file:\/\/\//.exec(l);if(t)return t[0];const n=/^[^/:]+:\/{0,2}/.exec(l);return n?n[0]:""},toAbsolute(l,t,n){if(fi(l),this.isDataUrl(l)||this.isBlobUrl(l))return l;const a=Pa(this.toPosix(t??Ve.get().getBaseUrl())),o=Pa(this.toPosix(n??this.rootname(a)));return l=this.toPosix(l),l.startsWith("/")?rl.join(o,l.slice(1)):this.isAbsolute(l)?l:this.join(a,l)},normalize(l){if(fi(l),l.length===0)return".";if(this.isDataUrl(l)||this.isBlobUrl(l))return l;l=this.toPosix(l);let t="";const n=l.startsWith("/");this.hasProtocol(l)&&(t=this.rootname(l),l=l.slice(t.length));const a=l.endsWith("/");return l=Lb(l),l.length>0&&a&&(l+="/"),n?`/${l}`:t+l},isAbsolute(l){return fi(l),l=this.toPosix(l),this.hasProtocol(l)?!0:l.startsWith("/")},join(...l){if(l.length===0)return".";let t;for(let n=0;n<l.length;++n){const a=l[n];if(fi(a),a.length>0)if(t===void 0)t=a;else{const o=l[n-1]??"";this.joinExtensions.includes(this.extname(o).toLowerCase())?t+=`/../${a}`:t+=`/${a}`}}return t===void 0?".":this.normalize(t)},dirname(l){if(fi(l),l.length===0)return".";l=this.toPosix(l);let t=l.charCodeAt(0);const n=t===47;let a=-1,o=!0;const u=this.getProtocol(l),c=l;l=l.slice(u.length);for(let h=l.length-1;h>=1;--h)if(t=l.charCodeAt(h),t===47){if(!o){a=h;break}}else o=!1;return a===-1?n?"/":this.isUrl(c)?u+l:u:n&&a===1?"//":u+l.slice(0,a)},rootname(l){fi(l),l=this.toPosix(l);let t="";if(l.startsWith("/")?t="/":t=this.getProtocol(l),this.isUrl(l)){const n=l.indexOf("/",t.length);n!==-1?t=l.slice(0,n):t=l,t.endsWith("/")||(t+="/")}return t},basename(l,t){fi(l),t&&fi(t),l=Pa(this.toPosix(l));let n=0,a=-1,o=!0,u;if(t!==void 0&&t.length>0&&t.length<=l.length){if(t.length===l.length&&t===l)return"";let c=t.length-1,h=-1;for(u=l.length-1;u>=0;--u){const m=l.charCodeAt(u);if(m===47){if(!o){n=u+1;break}}else h===-1&&(o=!1,h=u+1),c>=0&&(m===t.charCodeAt(c)?--c===-1&&(a=u):(c=-1,a=h))}return n===a?a=h:a===-1&&(a=l.length),l.slice(n,a)}for(u=l.length-1;u>=0;--u)if(l.charCodeAt(u)===47){if(!o){n=u+1;break}}else a===-1&&(o=!1,a=u+1);return a===-1?"":l.slice(n,a)},extname(l){fi(l),l=Pa(this.toPosix(l));let t=-1,n=0,a=-1,o=!0,u=0;for(let c=l.length-1;c>=0;--c){const h=l.charCodeAt(c);if(h===47){if(!o){n=c+1;break}continue}a===-1&&(o=!1,a=c+1),h===46?t===-1?t=c:u!==1&&(u=1):t!==-1&&(u=-1)}return t===-1||a===-1||u===0||u===1&&t===a-1&&t===n+1?"":l.slice(t,a)},parse(l){fi(l);const t={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return t;l=Pa(this.toPosix(l));let n=l.charCodeAt(0);const a=this.isAbsolute(l);let o;t.root=this.rootname(l),a||this.hasProtocol(l)?o=1:o=0;let u=-1,c=0,h=-1,m=!0,p=l.length-1,g=0;for(;p>=o;--p){if(n=l.charCodeAt(p),n===47){if(!m){c=p+1;break}continue}h===-1&&(m=!1,h=p+1),n===46?u===-1?u=p:g!==1&&(g=1):u!==-1&&(g=-1)}return u===-1||h===-1||g===0||g===1&&u===h-1&&u===c+1?h!==-1&&(c===0&&a?t.base=t.name=l.slice(1,h):t.base=t.name=l.slice(c,h)):(c===0&&a?(t.name=l.slice(1,u),t.base=l.slice(1,h)):(t.name=l.slice(c,u),t.base=l.slice(c,h)),t.ext=l.slice(u,h)),t.dir=this.dirname(l),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function Fy(l,t,n,a,o){const u=t[n];for(let c=0;c<u.length;c++){const h=u[c];n<t.length-1?Fy(l.replace(a[n],h),t,n+1,a,o):o.push(l.replace(a[n],h))}}function jb(l){const t=/\{(.*?)\}/g,n=l.match(t),a=[];if(n){const o=[];n.forEach(u=>{const c=u.substring(1,u.length-1).split(",");o.push(c)}),Fy(l,o,0,n,a)}else a.push(l);return a}const Sg=l=>!Array.isArray(l);class Qy{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,n)=>`${t}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(t,n)=>n.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const n=t;this._defaultSearchParams=Object.keys(n).map(a=>`${encodeURIComponent(a)}=${encodeURIComponent(n[a])}`).join("&")}}getAlias(t){const{alias:n,src:a}=t;return Ls(n||a,u=>typeof u=="string"?u:Array.isArray(u)?u.map(c=>(c==null?void 0:c.src)??c):u!=null&&u.src?u.src:u,!0)}removeAlias(t,n){this._assetMap[t]&&(n&&n!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&be("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(t,n){const a=[];let o=n;Array.isArray(n)||(o=Object.entries(n).map(([u,c])=>typeof c=="string"||Array.isArray(c)?{alias:u,src:c}:{alias:u,...c})),o.forEach(u=>{const c=u.src,h=u.alias;let m;if(typeof h=="string"){const p=this._createBundleAssetId(t,h);a.push(p),m=[h,p]}else{const p=h.map(g=>this._createBundleAssetId(t,g));a.push(...p),m=[...h,...p]}this.add({...u,alias:m,src:c})}),this._bundles[t]=a}add(t){const n=[];Array.isArray(t)?n.push(...t):n.push(t);let a;a=u=>{this.hasKey(u)&&be(`[Resolver] already has key: ${u} overwriting`)},Ls(n).forEach(u=>{const{src:c}=u;let{data:h,format:m,loadParser:p,parser:g}=u;const x=Ls(c).map(w=>typeof w=="string"?jb(w):Array.isArray(w)?w:[w]),_=this.getAlias(u);Array.isArray(_)?_.forEach(a):a(_);const b=[],T=w=>{const S=this._parsers.find(A=>A.test(w));return{src:w,...S==null?void 0:S.parse(w)}};x.forEach(w=>{w.forEach(S=>{let A={};if(typeof S!="object"?A=T(S):(h=S.data??h,m=S.format??m,(S.loadParser||S.parser)&&(p=S.loadParser??p,g=S.parser??g),A={...T(S.src),...S}),!_)throw new Error(`[Resolver] alias is undefined for this asset: ${A.src}`);A=this._buildResolvedAsset(A,{aliases:_,data:h,format:m,loadParser:p,parser:g,progressSize:u.progressSize}),b.push(A)})}),_.forEach(w=>{this._assetMap[w]=b})})}resolveBundle(t){const n=Sg(t);t=Ls(t);const a={};return t.forEach(o=>{const u=this._bundles[o];if(u){const c=this.resolve(u),h={};for(const m in c){const p=c[m];h[this._extractAssetIdFromBundle(o,m)]=p}a[o]=h}}),n?a[t[0]]:a}resolveUrl(t){const n=this.resolve(t);if(typeof t!="string"){const a={};for(const o in n)a[o]=n[o].src;return a}return n.src}resolve(t){const n=Sg(t);t=Ls(t);const a={};return t.forEach(o=>{if(!this._resolverHash[o])if(this._assetMap[o]){let u=this._assetMap[o];const c=this._getPreferredOrder(u);c==null||c.priority.forEach(h=>{c.params[h].forEach(m=>{const p=u.filter(g=>g[h]?g[h]===m:!1);p.length&&(u=p)})}),this._resolverHash[o]=u[0]}else this._resolverHash[o]=this._buildResolvedAsset({alias:[o],src:o},{});a[o]=this._resolverHash[o]}),n?a[t[0]]:a}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let n=0;n<t.length;n++){const a=t[n],o=this._preferredOrder.find(u=>u.params.format.includes(a.format));if(o)return o}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const n=/\?/.test(t)?"&":"?";return`${t}${n}${this._defaultSearchParams}`}_buildResolvedAsset(t,n){const{aliases:a,data:o,loadParser:u,parser:c,format:h,progressSize:m}=n;return(this._basePath||this._rootPath)&&(t.src=rl.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=a??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...o||{},...t.data},t.loadParser=u??t.loadParser,t.parser=c??t.parser,t.format=h??t.format??Yb(t.src),m!==void 0&&(t.progressSize=m),t}}Qy.RETINA_PREFIX=/@([0-9\.]+)x/;function Yb(l){return l.split(".").pop().split("?").shift().split("#").shift()}const Tg=(l,t)=>{const n=t.split("?")[1];return n&&(l+=`?${n}`),l},Wy=class Ja{constructor(t,n){this.linkedSheets=[];let a=t;(t==null?void 0:t.source)instanceof li&&(a={texture:t,data:n});const{texture:o,data:u,cachePrefix:c=""}=a;this.cachePrefix=c,this._texture=o instanceof Gt?o:null,this.textureSource=o.source,this.textures={},this.animations={},this.data=u;const h=parseFloat(u.meta.scale);h?(this.resolution=h,o.source.resolution=this.resolution):this.resolution=o.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Ja.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let a=t;const o=n?1/0:Ja.BATCH_SIZE;for(;a-t<o&&a<this._frameKeys.length;){const u=this._frameKeys[a],c=this._frames[u],h=c.frame;if(h){let m=null,p=null;const g=c.trimmed!==!1&&c.sourceSize?c.sourceSize:c.frame,x=new It(0,0,Math.floor(g.w)/this.resolution,Math.floor(g.h)/this.resolution);c.rotated?m=new It(Math.floor(h.x)/this.resolution,Math.floor(h.y)/this.resolution,Math.floor(h.h)/this.resolution,Math.floor(h.w)/this.resolution):m=new It(Math.floor(h.x)/this.resolution,Math.floor(h.y)/this.resolution,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution),c.trimmed!==!1&&c.spriteSourceSize&&(p=new It(Math.floor(c.spriteSourceSize.x)/this.resolution,Math.floor(c.spriteSourceSize.y)/this.resolution,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution)),this.textures[u]=new Gt({source:this.textureSource,frame:m,orig:x,trim:p,rotate:c.rotated?2:0,defaultAnchor:c.anchor,defaultBorders:c.borders,label:u.toString()})}a++}}_processAnimations(){const t=this.data.animations||{};for(const n in t){this.animations[n]=[];for(let a=0;a<t[n].length;a++){const o=t[n][a];this.animations[n].push(this.textures[o])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*Ja.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Ja.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var n;for(const a in this.textures)this.textures[a].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Wy.BATCH_SIZE=1e3;let Ag=Wy;const qb=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function Zy(l,t,n){const a={};if(l.forEach(o=>{a[o]=t}),Object.keys(t.textures).forEach(o=>{a[`${t.cachePrefix}${o}`]=t.textures[o]}),!n){const o=rl.dirname(l[0]);t.linkedSheets.forEach((u,c)=>{const h=Zy([`${o}/${t.data.meta.related_multi_packs[c]}`],u,!0);Object.assign(a,h)})}return a}const Xb={extension:yt.Asset,cache:{test:l=>l instanceof Ag,getCacheableAssets:(l,t)=>Zy(l,t,!1)},resolver:{extension:{type:yt.ResolveParser,name:"resolveSpritesheet"},test:l=>{const n=l.split("?")[0].split("."),a=n.pop(),o=n.pop();return a==="json"&&qb.includes(o)},parse:l=>{var n;const t=l.split(".");return{resolution:parseFloat(((n=Qy.RETINA_PREFIX.exec(l))==null?void 0:n[1])??"1"),format:t[t.length-2],src:l}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:yt.LoadParser,priority:Py.Normal,name:"spritesheetLoader"},async testParse(l,t){return rl.extname(t.src).toLowerCase()===".json"&&!!l.frames},async parse(l,t,n){var x,_;const{texture:a,imageFilename:o,textureOptions:u,cachePrefix:c}=(t==null?void 0:t.data)??{};let h=rl.dirname(t.src);h&&h.lastIndexOf("/")!==h.length-1&&(h+="/");let m;if(a instanceof Gt)m=a;else{const b=Tg(h+(o??l.meta.image),t.src);m=(await n.load([{src:b,data:u}]))[b]}const p=new Ag({texture:m.source,data:l,cachePrefix:c});await p.parse();const g=(x=l==null?void 0:l.meta)==null?void 0:x.related_multi_packs;if(Array.isArray(g)){const b=[];for(const w of g){if(typeof w!="string")continue;let S=h+w;(_=t.data)!=null&&_.ignoreMultiPack||(S=Tg(S,t.src),b.push(n.load({src:S,data:{textureOptions:u,ignoreMultiPack:!0}})))}const T=await Promise.all(b);p.linkedSheets=T,T.forEach(w=>{w.linkedSheets=[p].concat(p.linkedSheets.filter(S=>S!==w))})}return p},async unload(l,t,n){await n.unload(l.textureSource._sourceOrigin),l.destroy(!1)}}};Kt.add(Xb);const Xc=Object.create(null),wg=Object.create(null);function Bh(l,t){let n=wg[l];return n===void 0&&(Xc[t]===void 0&&(Xc[t]=1),wg[l]=n=Xc[t]++),n}let ks;function Iy(){return(!ks||ks!=null&&ks.isContextLost())&&(ks=Ve.get().createCanvas().getContext("webgl",{})),ks}let qr;function Vb(){if(!qr){qr="mediump";const l=Iy();l&&l.getShaderPrecisionFormat&&(qr=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT).precision?"highp":"mediump")}return qr}function Pb(l,t,n){return t?l:n?(l=l.replace("out vec4 finalColor;",""),`
|
|
54
|
+
|
|
55
|
+
#ifdef GL_ES // This checks if it is WebGL1
|
|
56
|
+
#define in varying
|
|
57
|
+
#define finalColor gl_FragColor
|
|
58
|
+
#define texture texture2D
|
|
59
|
+
#endif
|
|
60
|
+
${l}
|
|
61
|
+
`):`
|
|
62
|
+
|
|
63
|
+
#ifdef GL_ES // This checks if it is WebGL1
|
|
64
|
+
#define in attribute
|
|
65
|
+
#define out varying
|
|
66
|
+
#endif
|
|
67
|
+
${l}
|
|
68
|
+
`}function Fb(l,t,n){const a=n?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(l.substring(0,9)!=="precision"){let o=n?t.requestedFragmentPrecision:t.requestedVertexPrecision;return o==="highp"&&a!=="highp"&&(o="mediump"),`precision ${o} float;
|
|
69
|
+
${l}`}else if(a!=="highp"&&l.substring(0,15)==="precision highp")return l.replace("precision highp","precision mediump");return l}function Qb(l,t){return t?`#version 300 es
|
|
70
|
+
${l}`:l}const Wb={},Zb={};function Ib(l,{name:t="pixi-program"},n=!0){t=t.replace(/\s+/g,"-"),t+=n?"-fragment":"-vertex";const a=n?Wb:Zb;return a[t]?(a[t]++,t+=`-${a[t]}`):a[t]=1,l.indexOf("#define SHADER_NAME")!==-1?l:`${`#define SHADER_NAME ${t}`}
|
|
71
|
+
${l}`}function Kb(l,t){return t?l.replace("#version 300 es",""):l}const Vc={stripVersion:Kb,ensurePrecision:Fb,addProgramDefines:Pb,setProgramName:Ib,insertVersion:Qb},Fa=Object.create(null),Ky=class hh{constructor(t){t={...hh.defaultOptions,...t};const n=t.fragment.indexOf("#version 300 es")!==-1,a={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Vb()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n};let o=t.fragment,u=t.vertex;Object.keys(Vc).forEach(c=>{const h=a[c];o=Vc[c](o,h,!0),u=Vc[c](u,h,!1)}),this.fragment=o,this.vertex=u,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Bh(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Fa[this._cacheKey]=null}static from(t){const n=`${t.vertex}:${t.fragment}`;return Fa[n]||(Fa[n]=new hh(t),Fa[n]._cacheKey=n),Fa[n]}};Ky.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let $y=Ky;const Cg={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function $b(l){return Cg[l]??Cg.float32}const Jb={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},Mg=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Eg(l,t){let n;for(;(n=Mg.exec(l))!==null;){const a=Jb[n[3]]??"float32";t[n[2]]={location:parseInt(n[1],10),format:a,stride:$b(a).stride,offset:0,instance:!1,start:0}}Mg.lastIndex=0}function tv(l){return l.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function ev({source:l,entryPoint:t}){const n={},a=tv(l),o=a.indexOf(`fn ${t}(`);if(o===-1)return n;const u=a.indexOf("->",o);if(u===-1)return n;const c=a.substring(o,u);if(Eg(c,n),Object.keys(n).length===0){const h=c.match(/\(\s*\w+\s*:\s*(\w+)/);if(h){const m=h[1],p=new RegExp(`struct\\s+${m}\\s*\\{([^}]+)\\}`,"s"),g=a.match(p);g&&Eg(g[1],n)}}return n}function Pc(l){var x,_;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,a=/@binding\((\d+)\)/,o=/var(<[^>]+>)? (\w+)/,u=/:\s*([\w<>]+)/,c=/struct\s+(\w+)\s*{([^}]+)}/g,h=/(\w+)\s*:\s*([\w\<\>]+)/g,m=/struct\s+(\w+)/,p=(x=l.match(t))==null?void 0:x.map(b=>({group:parseInt(b.match(n)[1],10),binding:parseInt(b.match(a)[1],10),name:b.match(o)[2],isUniform:b.match(o)[1]==="<uniform>",type:b.match(u)[1]}));if(!p)return{groups:[],structs:[]};const g=((_=l.match(c))==null?void 0:_.map(b=>{const T=b.match(m)[1],w=b.match(h).reduce((S,A)=>{const[C,E]=A.split(":");return S[C.trim()]=E.trim(),S},{});return w?{name:T,members:w}:null}).filter(({name:b})=>p.some(T=>T.type===b||T.type.includes(`<${b}>`))))??[];return{groups:p,structs:g}}var Qn=(l=>(l[l.VERTEX=1]="VERTEX",l[l.FRAGMENT=2]="FRAGMENT",l[l.COMPUTE=4]="COMPUTE",l))(Qn||{});function iv({groups:l}){const t=[];for(let n=0;n<l.length;n++){const a=l[n];t[a.group]||(t[a.group]=[]),a.isUniform?t[a.group].push({binding:a.binding,visibility:Qn.VERTEX|Qn.FRAGMENT,buffer:{type:"uniform"}}):a.type==="sampler"?t[a.group].push({binding:a.binding,visibility:Qn.FRAGMENT,sampler:{type:"filtering"}}):a.type==="texture_2d"||a.type.startsWith("texture_2d<")?t[a.group].push({binding:a.binding,visibility:Qn.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):a.type==="texture_2d_array"||a.type.startsWith("texture_2d_array<")?t[a.group].push({binding:a.binding,visibility:Qn.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(a.type==="texture_cube"||a.type.startsWith("texture_cube<"))&&t[a.group].push({binding:a.binding,visibility:Qn.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<t.length;n++)t[n]||(t[n]=[]);return t}function nv({groups:l}){const t=[];for(let n=0;n<l.length;n++){const a=l[n];t[a.group]||(t[a.group]={}),t[a.group][a.name]=a.binding}return t}function sv(l,t){const n=new Set,a=new Set,o=[...l.structs,...t.structs].filter(c=>n.has(c.name)?!1:(n.add(c.name),!0)),u=[...l.groups,...t.groups].filter(c=>{const h=`${c.name}-${c.binding}`;return a.has(h)?!1:(a.add(h),!0)});return{structs:o,groups:u}}const Qa=Object.create(null);class lo{constructor(t){var h,m;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:a,layout:o,gpuLayout:u,name:c}=t;if(this.name=c,this.fragment=n,this.vertex=a,n.source===a.source){const p=Pc(n.source);this.structsAndGroups=p}else{const p=Pc(a.source),g=Pc(n.source);this.structsAndGroups=sv(p,g)}this.layout=o??nv(this.structsAndGroups),this.gpuLayout=u??iv(this.structsAndGroups),this.autoAssignGlobalUniforms=((h=this.layout[0])==null?void 0:h.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((m=this.layout[1])==null?void 0:m.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:n}=this,a=t.source+n.source+t.entryPoint+n.entryPoint;this._layoutKey=Bh(a,"program")}get attributeData(){return this._attributeData??(this._attributeData=ev(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Qa[this._cacheKey]=null}static from(t){const n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Qa[n]||(Qa[n]=new lo(t),Qa[n]._cacheKey=n),Qa[n]}}const Jy=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],av=Jy.reduce((l,t)=>(l[t]=!0,l),{});function lv(l,t){switch(l){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const t0=class e0{constructor(t,n){this._touched=0,this.uid=Qt("uniform"),this._resourceType="uniformGroup",this._resourceId=Qt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...e0.defaultOptions,...n},this.uniformStructures=t;const a={};for(const o in t){const u=t[o];if(u.name=o,u.size=u.size??1,!av[u.type]){const c=u.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(c){const[,h,m]=c;throw new Error(`Uniform type ${u.type} is not supported. Use type: '${h}', size: ${m} instead.`)}throw new Error(`Uniform type ${u.type} is not supported. Supported uniform types are: ${Jy.join(", ")}`)}u.value??(u.value=lv(u.type,u.size)),a[o]=u.value}this.uniforms=a,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Bh(Object.keys(a).map(o=>`${o}-${t[o].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};t0.defaultOptions={ubo:!1,isStatic:!1};let i0=t0;class $r{constructor(t){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const a in t){const o=t[a];this.setResource(o,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let n=0;for(const a in this.resources)t[n++]=this.resources[a]._resourceId;this._key=t.join("|")}setResource(t,n){var o,u;const a=this.resources[n];t!==a&&((o=a==null?void 0:a.off)==null||o.call(a,"change",this.onResourceChange,this),(u=t.on)==null||u.call(t,"change",this.onResourceChange,this),this.resources[n]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,n){const a=this.resources;for(const o in a)a[o]._gcLastUsed=t,a[o]._touched=n}destroy(){var n;const t=this.resources;for(const a in t){const o=t[a];(n=o==null?void 0:o.off)==null||n.call(o,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var fh=(l=>(l[l.WEBGL=1]="WEBGL",l[l.WEBGPU=2]="WEBGPU",l[l.CANVAS=4]="CANVAS",l[l.BOTH=3]="BOTH",l))(fh||{});class Oh extends vi{constructor(t){super(),this.uid=Qt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:a,groups:o,resources:u,compatibleRenderers:c,groupMap:h}=t;this.gpuProgram=n,this.glProgram=a,c===void 0&&(c=0,n&&(c|=fh.WEBGPU),a&&(c|=fh.WEBGL)),this.compatibleRenderers=c;const m={};if(!u&&!o&&(u={}),u&&o)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&o&&!h)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&o&&h)for(const p in h)for(const g in h[p]){const x=h[p][g];m[x]={group:p,binding:g,name:x}}else if(n&&o&&!h){const p=n.structsAndGroups.groups;h={},p.forEach(g=>{h[g.group]=h[g.group]||{},h[g.group][g.binding]=g.name,m[g.name]=g})}else if(u){o={},h={},n&&n.structsAndGroups.groups.forEach(x=>{h[x.group]=h[x.group]||{},h[x.group][x.binding]=x.name,m[x.name]=x});let p=0;for(const g in u)m[g]||(o[99]||(o[99]=new $r,this._ownedBindGroups.push(o[99])),m[g]={group:99,binding:p,name:g},h[99]=h[99]||{},h[99][p]=g,p++);for(const g in u){const x=g;let _=u[g];!_.source&&!_._resourceType&&(_=new i0(_));const b=m[x];b&&(o[b.group]||(o[b.group]=new $r,this._ownedBindGroups.push(o[b.group])),o[b.group].setResource(_,b.binding))}}this.groups=o,this._uniformBindMap=h,this.resources=this._buildResourceAccessor(o,m)}addResource(t,n,a){var o,u;(o=this._uniformBindMap)[n]||(o[n]={}),(u=this._uniformBindMap[n])[a]||(u[a]=t),this.groups[n]||(this.groups[n]=new $r,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(t,n){const a={};for(const o in n){const u=n[o];Object.defineProperty(a,u.name,{get(){return t[u.group].getResource(u.binding)},set(c){t[u.group].setResource(c,u.binding)}})}return a}destroy(t=!1){var n,a;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&((n=this.gpuProgram)==null||n.destroy(),(a=this.glProgram)==null||a.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(o=>{o.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:n,gl:a,...o}=t;let u,c;return n&&(u=lo.from(n)),a&&(c=$y.from(a)),new Oh({gpuProgram:u,glProgram:c,...o})}}const rv={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Fc=0,Qc=1,Wc=2,Zc=3,Ic=4,Kc=5,dh=class n0{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Fc)}set blend(t){!!(this.data&1<<Fc)!==t&&(this.data^=1<<Fc)}get offsets(){return!!(this.data&1<<Qc)}set offsets(t){!!(this.data&1<<Qc)!==t&&(this.data^=1<<Qc)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Wc)}set culling(t){!!(this.data&1<<Wc)!==t&&(this.data^=1<<Wc)}get depthTest(){return!!(this.data&1<<Zc)}set depthTest(t){!!(this.data&1<<Zc)!==t&&(this.data^=1<<Zc)}get depthMask(){return!!(this.data&1<<Kc)}set depthMask(t){!!(this.data&1<<Kc)!==t&&(this.data^=1<<Kc)}get clockwiseFrontFace(){return!!(this.data&1<<Ic)}set clockwiseFrontFace(t){!!(this.data&1<<Ic)!==t&&(this.data^=1<<Ic)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=rv[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new n0;return t.depthTest=!1,t.blend=!0,t}};dh.default2d=dh.for2d();let s0=dh;const mh=[];Kt.handleByNamedList(yt.Environment,mh);async function ov(l){if(!l)for(let t=0;t<mh.length;t++){const n=mh[t];if(n.value.test()){await n.value.load();return}}}let Wa;function uv(){if(typeof Wa=="boolean")return Wa;try{Wa=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Wa=!1}return Wa}function Rg(l,t,n=2){const a=t&&t.length,o=a?t[0]*n:l.length;let u=a0(l,0,o,n,!0);const c=[];if(!u||u.next===u.prev)return c;let h,m,p;if(a&&(u=mv(l,t,u,n)),l.length>80*n){h=l[0],m=l[1];let g=h,x=m;for(let _=n;_<o;_+=n){const b=l[_],T=l[_+1];b<h&&(h=b),T<m&&(m=T),b>g&&(g=b),T>x&&(x=T)}p=Math.max(g-h,x-m),p=p!==0?32767/p:0}return ol(u,c,n,h,m,p,0),c}function a0(l,t,n,a,o){let u;if(o===wv(l,t,n,a)>0)for(let c=t;c<n;c+=a)u=zg(c/a|0,l[c],l[c+1],u);else for(let c=n-a;c>=t;c-=a)u=zg(c/a|0,l[c],l[c+1],u);return u&&Zs(u,u.next)&&(cl(u),u=u.next),u}function In(l,t){if(!l)return l;t||(t=l);let n=l,a;do if(a=!1,!n.steiner&&(Zs(n,n.next)||qt(n.prev,n,n.next)===0)){if(cl(n),n=t=n.prev,n===n.next)break;a=!0}else n=n.next;while(a||n!==t);return t}function ol(l,t,n,a,o,u,c){if(!l)return;!c&&u&&_v(l,a,o,u);let h=l;for(;l.prev!==l.next;){const m=l.prev,p=l.next;if(u?hv(l,a,o,u):cv(l)){t.push(m.i,l.i,p.i),cl(l),l=p.next,h=p.next;continue}if(l=p,l===h){c?c===1?(l=fv(In(l),t),ol(l,t,n,a,o,u,2)):c===2&&dv(l,t,n,a,o,u):ol(In(l),t,n,a,o,u,1);break}}}function cv(l){const t=l.prev,n=l,a=l.next;if(qt(t,n,a)>=0)return!1;const o=t.x,u=n.x,c=a.x,h=t.y,m=n.y,p=a.y,g=Math.min(o,u,c),x=Math.min(h,m,p),_=Math.max(o,u,c),b=Math.max(h,m,p);let T=a.next;for(;T!==t;){if(T.x>=g&&T.x<=_&&T.y>=x&&T.y<=b&&tl(o,h,u,m,c,p,T.x,T.y)&&qt(T.prev,T,T.next)>=0)return!1;T=T.next}return!0}function hv(l,t,n,a){const o=l.prev,u=l,c=l.next;if(qt(o,u,c)>=0)return!1;const h=o.x,m=u.x,p=c.x,g=o.y,x=u.y,_=c.y,b=Math.min(h,m,p),T=Math.min(g,x,_),w=Math.max(h,m,p),S=Math.max(g,x,_),A=ph(b,T,t,n,a),C=ph(w,S,t,n,a);let E=l.prevZ,B=l.nextZ;for(;E&&E.z>=A&&B&&B.z<=C;){if(E.x>=b&&E.x<=w&&E.y>=T&&E.y<=S&&E!==o&&E!==c&&tl(h,g,m,x,p,_,E.x,E.y)&&qt(E.prev,E,E.next)>=0||(E=E.prevZ,B.x>=b&&B.x<=w&&B.y>=T&&B.y<=S&&B!==o&&B!==c&&tl(h,g,m,x,p,_,B.x,B.y)&&qt(B.prev,B,B.next)>=0))return!1;B=B.nextZ}for(;E&&E.z>=A;){if(E.x>=b&&E.x<=w&&E.y>=T&&E.y<=S&&E!==o&&E!==c&&tl(h,g,m,x,p,_,E.x,E.y)&&qt(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;B&&B.z<=C;){if(B.x>=b&&B.x<=w&&B.y>=T&&B.y<=S&&B!==o&&B!==c&&tl(h,g,m,x,p,_,B.x,B.y)&&qt(B.prev,B,B.next)>=0)return!1;B=B.nextZ}return!0}function fv(l,t){let n=l;do{const a=n.prev,o=n.next.next;!Zs(a,o)&&r0(a,n,n.next,o)&&ul(a,o)&&ul(o,a)&&(t.push(a.i,n.i,o.i),cl(n),cl(n.next),n=l=o),n=n.next}while(n!==l);return In(n)}function dv(l,t,n,a,o,u){let c=l;do{let h=c.next.next;for(;h!==c.prev;){if(c.i!==h.i&&Sv(c,h)){let m=o0(c,h);c=In(c,c.next),m=In(m,m.next),ol(c,t,n,a,o,u,0),ol(m,t,n,a,o,u,0);return}h=h.next}c=c.next}while(c!==l)}function mv(l,t,n,a){const o=[];for(let u=0,c=t.length;u<c;u++){const h=t[u]*a,m=u<c-1?t[u+1]*a:l.length,p=a0(l,h,m,a,!1);p===p.next&&(p.steiner=!0),o.push(vv(p))}o.sort(pv);for(let u=0;u<o.length;u++)n=gv(o[u],n);return n}function pv(l,t){let n=l.x-t.x;if(n===0&&(n=l.y-t.y,n===0)){const a=(l.next.y-l.y)/(l.next.x-l.x),o=(t.next.y-t.y)/(t.next.x-t.x);n=a-o}return n}function gv(l,t){const n=yv(l,t);if(!n)return t;const a=o0(n,l);return In(a,a.next),In(n,n.next)}function yv(l,t){let n=t;const a=l.x,o=l.y;let u=-1/0,c;if(Zs(l,n))return n;do{if(Zs(l,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){const x=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(x<=a&&x>u&&(u=x,c=n.x<n.next.x?n:n.next,x===a))return c}n=n.next}while(n!==t);if(!c)return null;const h=c,m=c.x,p=c.y;let g=1/0;n=c;do{if(a>=n.x&&n.x>=m&&a!==n.x&&l0(o<p?a:u,o,m,p,o<p?u:a,o,n.x,n.y)){const x=Math.abs(o-n.y)/(a-n.x);ul(n,l)&&(x<g||x===g&&(n.x>c.x||n.x===c.x&&xv(c,n)))&&(c=n,g=x)}n=n.next}while(n!==h);return c}function xv(l,t){return qt(l.prev,l,t.prev)<0&&qt(t.next,l,l.next)<0}function _v(l,t,n,a){let o=l;do o.z===0&&(o.z=ph(o.x,o.y,t,n,a)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==l);o.prevZ.nextZ=null,o.prevZ=null,bv(o)}function bv(l){let t,n=1;do{let a=l,o;l=null;let u=null;for(t=0;a;){t++;let c=a,h=0;for(let p=0;p<n&&(h++,c=c.nextZ,!!c);p++);let m=n;for(;h>0||m>0&&c;)h!==0&&(m===0||!c||a.z<=c.z)?(o=a,a=a.nextZ,h--):(o=c,c=c.nextZ,m--),u?u.nextZ=o:l=o,o.prevZ=u,u=o;a=c}u.nextZ=null,n*=2}while(t>1);return l}function ph(l,t,n,a,o){return l=(l-n)*o|0,t=(t-a)*o|0,l=(l|l<<8)&16711935,l=(l|l<<4)&252645135,l=(l|l<<2)&858993459,l=(l|l<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,l|t<<1}function vv(l){let t=l,n=l;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==l);return n}function l0(l,t,n,a,o,u,c,h){return(o-c)*(t-h)>=(l-c)*(u-h)&&(l-c)*(a-h)>=(n-c)*(t-h)&&(n-c)*(u-h)>=(o-c)*(a-h)}function tl(l,t,n,a,o,u,c,h){return!(l===c&&t===h)&&l0(l,t,n,a,o,u,c,h)}function Sv(l,t){return l.next.i!==t.i&&l.prev.i!==t.i&&!Tv(l,t)&&(ul(l,t)&&ul(t,l)&&Av(l,t)&&(qt(l.prev,l,t.prev)||qt(l,t.prev,t))||Zs(l,t)&&qt(l.prev,l,l.next)>0&&qt(t.prev,t,t.next)>0)}function qt(l,t,n){return(t.y-l.y)*(n.x-t.x)-(t.x-l.x)*(n.y-t.y)}function Zs(l,t){return l.x===t.x&&l.y===t.y}function r0(l,t,n,a){const o=Vr(qt(l,t,n)),u=Vr(qt(l,t,a)),c=Vr(qt(n,a,l)),h=Vr(qt(n,a,t));return!!(o!==u&&c!==h||o===0&&Xr(l,n,t)||u===0&&Xr(l,a,t)||c===0&&Xr(n,l,a)||h===0&&Xr(n,t,a))}function Xr(l,t,n){return t.x<=Math.max(l.x,n.x)&&t.x>=Math.min(l.x,n.x)&&t.y<=Math.max(l.y,n.y)&&t.y>=Math.min(l.y,n.y)}function Vr(l){return l>0?1:l<0?-1:0}function Tv(l,t){let n=l;do{if(n.i!==l.i&&n.next.i!==l.i&&n.i!==t.i&&n.next.i!==t.i&&r0(n,n.next,l,t))return!0;n=n.next}while(n!==l);return!1}function ul(l,t){return qt(l.prev,l,l.next)<0?qt(l,t,l.next)>=0&&qt(l,l.prev,t)>=0:qt(l,t,l.prev)<0||qt(l,l.next,t)<0}function Av(l,t){let n=l,a=!1;const o=(l.x+t.x)/2,u=(l.y+t.y)/2;do n.y>u!=n.next.y>u&&n.next.y!==n.y&&o<(n.next.x-n.x)*(u-n.y)/(n.next.y-n.y)+n.x&&(a=!a),n=n.next;while(n!==l);return a}function o0(l,t){const n=gh(l.i,l.x,l.y),a=gh(t.i,t.x,t.y),o=l.next,u=t.prev;return l.next=t,t.prev=l,n.next=o,o.prev=n,a.next=n,n.prev=a,u.next=a,a.prev=u,a}function zg(l,t,n,a){const o=gh(l,t,n);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function cl(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function gh(l,t,n){return{i:l,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wv(l,t,n,a){let o=0;for(let u=t,c=n-a;u<n;u+=a)o+=(l[c]-l[u])*(l[u+1]+l[c+1]),c=u;return o}const Cv=Rg.default||Rg;var u0=(l=>(l[l.NONE=0]="NONE",l[l.COLOR=16384]="COLOR",l[l.STENCIL=1024]="STENCIL",l[l.DEPTH=256]="DEPTH",l[l.COLOR_DEPTH=16640]="COLOR_DEPTH",l[l.COLOR_STENCIL=17408]="COLOR_STENCIL",l[l.DEPTH_STENCIL=1280]="DEPTH_STENCIL",l[l.ALL=17664]="ALL",l))(u0||{});class Mv{constructor(t){this.items=[],this._name=t}emit(t,n,a,o,u,c,h,m){const{name:p,items:g}=this;for(let x=0,_=g.length;x<_;x++)g[x][p](t,n,a,o,u,c,h,m);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const n=this.items.indexOf(t);return n!==-1&&this.items.splice(n,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Ev=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],c0=class h0 extends vi{constructor(t){super(),this.tick=0,this.uid=Qt("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const n=[...Ev,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(t={}){const n=t.skipExtensionImports===!0?!0:t.manageImports===!1;await ov(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const a in this._systemsHash)t={...this._systemsHash[a].constructor.defaultOptions,...t};t={...h0.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let a=0;a<this.runners.init.items.length;a++)await this.runners.init.items[a].init(t);this._initOptions=t}render(t,n){this.tick++;let a=t;if(a instanceof ai&&(a={container:a},n&&(wt(Ft,"passing a second argument is deprecated, please use render options instead"),a.target=n.renderTexture)),a.target||(a.target=this.view.renderTarget),a.target===this.view.renderTarget&&(this._lastObjectRendered=a.container,a.clearColor??(a.clearColor=this.background.colorRgba),a.clear??(a.clear=this.background.clearBeforeRender)),a.clearColor){const o=Array.isArray(a.clearColor)&&a.clearColor.length===4;a.clearColor=o?a.clearColor:se.shared.setValue(a.clearColor).toArray()}a.transform||(a.container.updateLocalTransform(),a.transform=a.container.localTransform),a.container.visible&&(a.container.enableRenderGroup(),this.runners.prerender.emit(a),this.runners.renderStart.emit(a),this.runners.render.emit(a),this.runners.renderEnd.emit(a),this.runners.postrender.emit(a))}resize(t,n,a){const o=this.view.resolution;this.view.resize(t,n,a),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),a!==void 0&&a!==o&&this.runners.resolutionChange.emit(a)}clear(t={}){const n=this;t.target||(t.target=n.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=u0.ALL);const{clear:a,clearColor:o,target:u,mipLevel:c,layer:h}=t;se.shared.setValue(o??this.background.colorRgba),n.renderTarget.clear(u,a,se.shared.toArray(),c??0,h??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(n=>{this.runners[n]=new Mv(n)})}_addSystems(t){let n;for(n in t){const a=t[n];this._addSystem(a.value,a.name)}}_addSystem(t,n){const a=new t(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=a,this._systemsHash[n]=a;for(const o in this.runners)this.runners[o].add(a);return this}_addPipes(t,n){const a=n.reduce((o,u)=>(o[u.name]=u.value,o),{});t.forEach(o=>{const u=o.value,c=o.name,h=a[c];this.renderPipes[c]=new u(this,h?new h:null),this.runners.destroy.add(this.renderPipes[c])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&dl.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!uv())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};c0.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let f0=c0,Pr;function Rv(l){return Pr!==void 0||(Pr=(()=>{var n;const t={stencil:!0,failIfMajorPerformanceCaveat:l??f0.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Ve.get().getWebGLRenderingContext())return!1;let o=Ve.get().createCanvas().getContext("webgl",t);const u=!!((n=o==null?void 0:o.getContextAttributes())!=null&&n.stencil);if(o){const c=o.getExtension("WEBGL_lose_context");c&&c.loseContext()}return o=null,u}catch{return!1}})()),Pr}let Fr;async function zv(l={}){return Fr!==void 0||(Fr=await(async()=>{const t=Ve.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(l)).requestDevice(),!0}catch{return!1}})()),Fr}const Dg=["webgl","webgpu","canvas"];async function Dv(l){let t=[];l.preference?(t.push(l.preference),Dg.forEach(u=>{u!==l.preference&&t.push(u)})):t=Dg.slice();let n,a={};for(let u=0;u<t.length;u++){const c=t[u];if(c==="webgpu"&&await zv()){const{WebGPURenderer:h}=await el(async()=>{const{WebGPURenderer:m}=await import("./WebGPURenderer-DrL4JJxB.js");return{WebGPURenderer:m}},__vite__mapDeps([3,4,5,2]));n=h,a={...l,...l.webgpu};break}else if(c==="webgl"&&Rv(l.failIfMajorPerformanceCaveat??f0.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:h}=await el(async()=>{const{WebGLRenderer:m}=await import("./WebGLRenderer-BrkN99zF.js");return{WebGLRenderer:m}},__vite__mapDeps([6,4,5,2]));n=h,a={...l,...l.webgl};break}else if(c==="canvas"){const{CanvasRenderer:h}=await el(async()=>{const{CanvasRenderer:m}=await import("./CanvasRenderer-Dfr3Z3Qw.js");return{CanvasRenderer:m}},__vite__mapDeps([7,5,2]));n=h,a={...l,...l.canvasOptions};break}}if(delete a.webgpu,delete a.webgl,delete a.canvasOptions,!n)throw new Error("No available renderer for the current environment");const o=new n;return await o.init(a),o}const d0="8.17.1";class m0{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,d0)}static destroy(){}}m0.extension=yt.Application;class Bv{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,d0)}destroy(){this._renderer=null}}Bv.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"initHook",priority:-10};class p0{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,a;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,a=globalThis.innerHeight;else{const{clientWidth:o,clientHeight:u}=this._resizeTo;n=o,a=u}this.renderer.resize(n,a),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}p0.extension=yt.Application;class g0{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,to.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Vs.shared:new Vs,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}g0.extension=yt.Application;Kt.add(p0);Kt.add(g0);const y0=class yh{constructor(...t){this.stage=new ai,t[0]!==void 0&&wt(Ft,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new ai),this.renderer=await Dv(t),yh._plugins.forEach(n=>{n.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return wt(Ft,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){const a=yh._plugins.slice(0);a.reverse(),a.forEach(o=>{o.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};y0._plugins=[];let x0=y0;Kt.handleByList(yt.Application,x0._plugins);Kt.add(m0);var $c,Bg;function Ov(){if(Bg)return $c;Bg=1,$c=n;var l={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(u){var c=[];return u.replace(t,function(h,m,p){var g=m.toLowerCase();for(p=o(p),g=="m"&&p.length>2&&(c.push([m].concat(p.splice(0,2))),g="l",m=m=="m"?"l":"L");;){if(p.length==l[g])return p.unshift(m),c.push(p);if(p.length<l[g])throw new Error("malformed path data");c.push([m].concat(p.splice(0,l[g])))}}),c}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function o(u){var c=u.match(a);return c?c.map(Number):[]}return $c}var Nv=Ov();const Gv=Ch(Nv);function kv(l,t){const n=Gv(l),a=[];let o=null,u=0,c=0;for(let h=0;h<n.length;h++){const m=n[h],p=m[0],g=m;switch(p){case"M":u=g[1],c=g[2],t.moveTo(u,c);break;case"m":u+=g[1],c+=g[2],t.moveTo(u,c);break;case"H":u=g[1],t.lineTo(u,c);break;case"h":u+=g[1],t.lineTo(u,c);break;case"V":c=g[1],t.lineTo(u,c);break;case"v":c+=g[1],t.lineTo(u,c);break;case"L":u=g[1],c=g[2],t.lineTo(u,c);break;case"l":u+=g[1],c+=g[2],t.lineTo(u,c);break;case"C":u=g[5],c=g[6],t.bezierCurveTo(g[1],g[2],g[3],g[4],u,c);break;case"c":t.bezierCurveTo(u+g[1],c+g[2],u+g[3],c+g[4],u+g[5],c+g[6]),u+=g[5],c+=g[6];break;case"S":u=g[3],c=g[4],t.bezierCurveToShort(g[1],g[2],u,c);break;case"s":t.bezierCurveToShort(u+g[1],c+g[2],u+g[3],c+g[4]),u+=g[3],c+=g[4];break;case"Q":u=g[3],c=g[4],t.quadraticCurveTo(g[1],g[2],u,c);break;case"q":t.quadraticCurveTo(u+g[1],c+g[2],u+g[3],c+g[4]),u+=g[3],c+=g[4];break;case"T":u=g[1],c=g[2],t.quadraticCurveToShort(u,c);break;case"t":u+=g[1],c+=g[2],t.quadraticCurveToShort(u,c);break;case"A":u=g[6],c=g[7],t.arcToSvg(g[1],g[2],g[3],g[4],g[5],u,c);break;case"a":u+=g[6],c+=g[7],t.arcToSvg(g[1],g[2],g[3],g[4],g[5],u,c);break;case"Z":case"z":t.closePath(),a.length>0&&(o=a.pop(),o?(u=o.startX,c=o.startY):(u=0,c=0)),o=null;break;default:be(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&o===null&&(o={startX:u,startY:c},a.push(o))}return t}class Nh{constructor(t=0,n=0,a=0){this.type="circle",this.x=t,this.y=n,this.radius=a}clone(){return new Nh(this.x,this.y,this.radius)}contains(t,n){if(this.radius<=0)return!1;const a=this.radius*this.radius;let o=this.x-t,u=this.y-n;return o*=o,u*=u,o+u<=a}strokeContains(t,n,a,o=.5){if(this.radius===0)return!1;const u=this.x-t,c=this.y-n,h=this.radius,m=(1-o)*a,p=Math.sqrt(u*u+c*c);return p<=h+m&&p>h-(a-m)}getBounds(t){return t||(t=new It),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Gh{constructor(t=0,n=0,a=0,o=0){this.type="ellipse",this.x=t,this.y=n,this.halfWidth=a,this.halfHeight=o}clone(){return new Gh(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let a=(t-this.x)/this.halfWidth,o=(n-this.y)/this.halfHeight;return a*=a,o*=o,a+o<=1}strokeContains(t,n,a,o=.5){const{halfWidth:u,halfHeight:c}=this;if(u<=0||c<=0)return!1;const h=a*(1-o),m=a-h,p=u-m,g=c-m,x=u+h,_=c+h,b=t-this.x,T=n-this.y,w=b*b/(p*p)+T*T/(g*g),S=b*b/(x*x)+T*T/(_*_);return w>1&&S<=1}getBounds(t){return t||(t=new It),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function Uv(l,t,n,a,o,u){const c=l-n,h=t-a,m=o-n,p=u-a,g=c*m+h*p,x=m*m+p*p;let _=-1;x!==0&&(_=g/x);let b,T;_<0?(b=n,T=a):_>1?(b=o,T=u):(b=n+_*m,T=a+_*p);const w=l-b,S=t-T;return w*w+S*S}let Hv,Lv;class nl{constructor(...t){this.type="polygon";let n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){const a=[];for(let o=0,u=n.length;o<u;o++)a.push(n[o].x,n[o].y);n=a}this.points=n,this.closePath=!0}isClockwise(){let t=0;const n=this.points,a=n.length;for(let o=0;o<a;o+=2){const u=n[o],c=n[o+1],h=n[(o+2)%a],m=n[(o+3)%a];t+=(h-u)*(m+c)}return t<0}containsPolygon(t){const n=this.getBounds(Hv),a=t.getBounds(Lv);if(!n.containsRect(a))return!1;const o=t.points;for(let u=0;u<o.length;u+=2){const c=o[u],h=o[u+1];if(!this.contains(c,h))return!1}return!0}clone(){const t=this.points.slice(),n=new nl(t);return n.closePath=this.closePath,n}contains(t,n){let a=!1;const o=this.points.length/2;for(let u=0,c=o-1;u<o;c=u++){const h=this.points[u*2],m=this.points[u*2+1],p=this.points[c*2],g=this.points[c*2+1];m>n!=g>n&&t<(p-h)*((n-m)/(g-m))+h&&(a=!a)}return a}strokeContains(t,n,a,o=.5){const u=a*a,c=u*(1-o),h=u-c,{points:m}=this,p=m.length-(this.closePath?0:2);for(let g=0;g<p;g+=2){const x=m[g],_=m[g+1],b=m[(g+2)%m.length],T=m[(g+3)%m.length],w=Uv(t,n,x,_,b,T),S=Math.sign((b-x)*(n-_)-(T-_)*(t-x));if(w<=(S<0?h:c))return!0}return!1}getBounds(t){t||(t=new It);const n=this.points;let a=1/0,o=-1/0,u=1/0,c=-1/0;for(let h=0,m=n.length;h<m;h+=2){const p=n[h],g=n[h+1];a=p<a?p:a,o=p>o?p:o,u=g<u?g:u,c=g>c?g:c}return t.x=a,t.width=o-a,t.y=u,t.height=c-u,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,n)=>`${t}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return wt("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return wt("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const Qr=(l,t,n,a,o,u,c)=>{const h=l-n,m=t-a,p=Math.sqrt(h*h+m*m);return p>=o-u&&p<=o+c};class kh{constructor(t=0,n=0,a=0,o=0,u=20){this.type="roundedRectangle",this.x=t,this.y=n,this.width=a,this.height=o,this.radius=u}getBounds(t){return t||(t=new It),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new kh(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,n){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const a=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+a&&n<=this.y+this.height-a||t>=this.x+a&&t<=this.x+this.width-a)return!0;let o=t-(this.x+a),u=n-(this.y+a);const c=a*a;if(o*o+u*u<=c||(o=t-(this.x+this.width-a),o*o+u*u<=c)||(u=n-(this.y+this.height-a),o*o+u*u<=c)||(o=t-(this.x+a),o*o+u*u<=c))return!0}return!1}strokeContains(t,n,a,o=.5){const{x:u,y:c,width:h,height:m,radius:p}=this,g=a*(1-o),x=a-g,_=u+p,b=c+p,T=h-p*2,w=m-p*2,S=u+h,A=c+m;return(t>=u-g&&t<=u+x||t>=S-x&&t<=S+g)&&n>=b&&n<=b+w||(n>=c-g&&n<=c+x||n>=A-x&&n<=A+g)&&t>=_&&t<=_+T?!0:t<_&&n<b&&Qr(t,n,_,b,p,x,g)||t>S-p&&n<b&&Qr(t,n,S-p,b,p,x,g)||t>S-p&&n>A-p&&Qr(t,n,S-p,A-p,p,x,g)||t<_&&n>A-p&&Qr(t,n,_,A-p,p,x,g)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const _0={};function jv(l,t,n){let a=2166136261;for(let o=0;o<t;o++)a^=l[o].uid,a=Math.imul(a,16777619),a>>>=0;return _0[a]||Yv(l,t,a,n)}function Yv(l,t,n,a){const o={};let u=0;for(let h=0;h<a;h++){const m=h<t?l[h]:Gt.EMPTY.source;o[u++]=m.source,o[u++]=m.style}const c=new $r(o);return _0[n]=c,c}class Og{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}function Ng(l,t,n,a){if(n??(n=0),a??(a=Math.min(l.byteLength-n,t.byteLength)),!(n&7)&&!(a&7)){const o=a/8;new Float64Array(t,0,o).set(new Float64Array(l,n,o))}else if(!(n&3)&&!(a&3)){const o=a/4;new Float32Array(t,0,o).set(new Float32Array(l,n,o))}else new Uint8Array(t).set(new Uint8Array(l,n,a))}const qv={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var Xv=(l=>(l[l.DISABLED=0]="DISABLED",l[l.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",l[l.MASK_ACTIVE=2]="MASK_ACTIVE",l[l.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",l[l.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",l[l.NONE=5]="NONE",l))(Xv||{});function Gg(l,t){return t.alphaMode==="no-premultiply-alpha"&&qv[l]||l}const Vv=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
72
|
+
`);function Pv(l){let t="";for(let n=0;n<l;++n)n>0&&(t+=`
|
|
73
|
+
else `),n<l-1&&(t+=`if(test == ${n}.0){}`);return t}function Fv(l,t){if(l===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=t.createShader(t.FRAGMENT_SHADER);try{for(;;){const a=Vv.replace(/%forloop%/gi,Pv(l));if(t.shaderSource(n,a),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))l=l/2|0;else break}}finally{t.deleteShader(n)}return l}let Us=null;function Qv(){var t;if(Us)return Us;const l=Iy();return Us=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Us=Fv(Us,l),(t=l.getExtension("WEBGL_lose_context"))==null||t.loseContext(),Us}class Wv{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const n=this.textures[t];this.textures[t]=null,this.ids[n.uid]=null}this.count=0}}class Zv{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new Wv,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const sl=[];let eo=0;dl.register({clear:()=>{if(sl.length>0)for(const l of sl)l&&l.destroy();sl.length=0,eo=0}});function kg(){return eo>0?sl[--eo]:new Zv}function Ug(l){l.elements=null,sl[eo++]=l}let Za=0;const b0=class v0{constructor(t){this.uid=Qt("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...v0.defaultOptions,...t},t.maxTextures||(wt("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=Qv());const{maxTextures:n,attributesInitialSize:a,indicesInitialSize:o}=t;this.attributeBuffer=new Og(a*4),this.indexBuffer=new Uint16Array(o),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)Ug(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,n){const a=t._batch.textures.ids[n._source.uid];return!a&&a!==0?!1:(t._textureId=a,t.texture=n,!0)}updateElement(t){this.dirty=!0;const n=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,n.float32View,n.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,n.float32View,n.uint32View,t._attributeStart,t._textureId)}break(t){const n=this._elements;if(!n[this.elementStart])return;let a=kg(),o=a.textures;o.clear();const u=n[this.elementStart];let c=Gg(u.blendMode,u.texture._source),h=u.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const m=this.attributeBuffer.float32View,p=this.attributeBuffer.uint32View,g=this.indexBuffer;let x=this._batchIndexSize,_=this._batchIndexStart,b="startBatch",T=[];const w=this.maxTextures;for(let S=this.elementStart;S<this.elementSize;++S){const A=n[S];n[S]=null;const E=A.texture._source,B=Gg(A.blendMode,E),X=c!==B||h!==A.topology;if(E._batchTick===Za&&!X){A._textureId=E._textureBindLocation,x+=A.indexSize,A.packAsQuad?(this.packQuadAttributes(A,m,p,A._attributeStart,A._textureId),this.packQuadIndex(g,A._indexStart,A._attributeStart/this.vertexSize)):(this.packAttributes(A,m,p,A._attributeStart,A._textureId),this.packIndex(A,g,A._indexStart,A._attributeStart/this.vertexSize)),A._batch=a,T.push(A);continue}E._batchTick=Za,(o.count>=w||X)&&(this._finishBatch(a,_,x-_,o,c,h,t,b,T),b="renderBatch",_=x,c=B,h=A.topology,a=kg(),o=a.textures,o.clear(),T=[],++Za),A._textureId=E._textureBindLocation=o.count,o.ids[E.uid]=o.count,o.textures[o.count++]=E,A._batch=a,T.push(A),x+=A.indexSize,A.packAsQuad?(this.packQuadAttributes(A,m,p,A._attributeStart,A._textureId),this.packQuadIndex(g,A._indexStart,A._attributeStart/this.vertexSize)):(this.packAttributes(A,m,p,A._attributeStart,A._textureId),this.packIndex(A,g,A._indexStart,A._attributeStart/this.vertexSize))}o.count>0&&(this._finishBatch(a,_,x-_,o,c,h,t,b,T),_=x,++Za),this.elementStart=this.elementSize,this._batchIndexStart=_,this._batchIndexSize=x}_finishBatch(t,n,a,o,u,c,h,m,p){t.gpuBindGroup=null,t.bindGroup=null,t.action=m,t.batcher=this,t.textures=o,t.blendMode=u,t.topology=c,t.start=n,t.size=a,t.elements=p,++Za,this.batches[this.batchIndex++]=t,h.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const n=Math.max(t,this.attributeBuffer.size*2),a=new Og(n);Ng(this.attributeBuffer.rawBinaryData,a.rawBinaryData),this.attributeBuffer=a}_resizeIndexBuffer(t){const n=this.indexBuffer;let a=Math.max(t,n.length*1.5);a+=a%2;const o=a>65535?new Uint32Array(a):new Uint16Array(a);if(o.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let u=0;u<n.length;u++)o[u]=n[u];else Ng(n.buffer,o.buffer);this.indexBuffer=o}packQuadIndex(t,n,a){t[n]=a+0,t[n+1]=a+1,t[n+2]=a+2,t[n+3]=a+0,t[n+4]=a+2,t[n+5]=a+3}packIndex(t,n,a,o){const u=t.indices,c=t.indexSize,h=t.indexOffset,m=t.attributeOffset;for(let p=0;p<c;p++)n[a++]=o+u[p+h]-m}destroy(t={}){var n;if(this.batches!==null){for(let a=0;a<this.batchIndex;a++)Ug(this.batches[a]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let a=0;a<this._elements.length;a++)this._elements[a]&&(this._elements[a]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};b0.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let Iv=b0;var Ee=(l=>(l[l.MAP_READ=1]="MAP_READ",l[l.MAP_WRITE=2]="MAP_WRITE",l[l.COPY_SRC=4]="COPY_SRC",l[l.COPY_DST=8]="COPY_DST",l[l.INDEX=16]="INDEX",l[l.VERTEX=32]="VERTEX",l[l.UNIFORM=64]="UNIFORM",l[l.STORAGE=128]="STORAGE",l[l.INDIRECT=256]="INDIRECT",l[l.QUERY_RESOLVE=512]="QUERY_RESOLVE",l[l.STATIC=1024]="STATIC",l))(Ee||{});class hl extends vi{constructor(t){let{data:n,size:a}=t;const{usage:o,label:u,shrinkToFit:c}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=Qt("buffer"),this._resourceType="buffer",this._resourceId=Qt("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,a??(a=n==null?void 0:n.byteLength);const h=!!n;this.descriptor={size:a,usage:o,mappedAtCreation:h,label:u},this.shrinkToFit=c??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&Ee.STATIC)}set static(t){t?this.descriptor.usage|=Ee.STATIC:this.descriptor.usage&=~Ee.STATIC}setDataWithSize(t,n,a){if(this._updateID++,this._updateSize=n*t.BYTES_PER_ELEMENT,this._data===t){a&&this.emit("update",this);return}const o=this._data;if(this._data=t,this._dataInt32=null,!o||o.length!==t.length){!this.shrinkToFit&&o&&t.byteLength<o.byteLength?a&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=Qt("resource"),this.emit("change",this));return}a&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function S0(l,t){if(!(l instanceof hl)){let n=t?Ee.INDEX:Ee.VERTEX;l instanceof Array&&(t?(l=new Uint32Array(l),n=Ee.INDEX|Ee.COPY_DST):(l=new Float32Array(l),n=Ee.VERTEX|Ee.COPY_DST)),l=new hl({data:l,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return l}function Kv(l,t,n){const a=l.getAttribute(t);if(!a)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const o=a.buffer.data;let u=1/0,c=1/0,h=-1/0,m=-1/0;const p=o.BYTES_PER_ELEMENT,g=(a.offset||0)/p,x=(a.stride||8)/p;for(let _=g;_<o.length;_+=x){const b=o[_],T=o[_+1];b>h&&(h=b),T>m&&(m=T),b<u&&(u=b),T<c&&(c=T)}return n.minX=u,n.minY=c,n.maxX=h,n.maxY=m,n}function $v(l){return(l instanceof hl||Array.isArray(l)||l.BYTES_PER_ELEMENT)&&(l={buffer:l}),l.buffer=S0(l.buffer,!1),l}class Jv extends vi{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Qt("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new si,this._boundsDirty=!0;const{attributes:n,indexBuffer:a,topology:o}=t;if(this.buffers=[],this.attributes={},n)for(const u in n)this.addAttribute(u,n[u]);this.instanceCount=t.instanceCount??1,a&&this.addIndex(a),this.topology=o||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const n=this.attributes[t];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(t,n){const a=$v(n);this.buffers.indexOf(a.buffer)===-1&&(this.buffers.push(a.buffer),a.buffer.on("update",this.onBufferUpdate,this),a.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=a}addIndex(t){this.indexBuffer=S0(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,Kv(this,"aPosition",this._bounds)):this._bounds}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){var n;this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(a=>a.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const tS=new Float32Array(1),eS=new Uint32Array(1);class iS extends Jv{constructor(){const n=new hl({data:tS,label:"attribute-batch-buffer",usage:Ee.VERTEX|Ee.COPY_DST,shrinkToFit:!1}),a=new hl({data:eS,label:"index-batch-buffer",usage:Ee.INDEX|Ee.COPY_DST,shrinkToFit:!1}),o=24;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:o,offset:0},aUV:{buffer:n,format:"float32x2",stride:o,offset:8},aColor:{buffer:n,format:"unorm8x4",stride:o,offset:16},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:o,offset:20}},indexBuffer:a})}}function Hg(l,t,n){if(l)for(const a in l){const o=a.toLocaleLowerCase(),u=t[o];if(u){let c=l[a];a==="header"&&(c=c.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&u.push(`//----${n}----//`),u.push(c)}else be(`${a} placement hook does not exist in shader`)}}const nS=/\{\{(.*?)\}\}/g;function Lg(l){var a;const t={};return(((a=l.match(nS))==null?void 0:a.map(o=>o.replace(/[{()}]/g,"")))??[]).forEach(o=>{t[o]=[]}),t}function jg(l,t){let n;const a=/@in\s+([^;]+);/g;for(;(n=a.exec(l))!==null;)t.push(n[1])}function Yg(l,t,n=!1){const a=[];jg(t,a),l.forEach(h=>{h.header&&jg(h.header,a)});const o=a;n&&o.sort();const u=o.map((h,m)=>` @location(${m}) ${h},`).join(`
|
|
74
|
+
`);let c=t.replace(/@in\s+[^;]+;\s*/g,"");return c=c.replace("{{in}}",`
|
|
75
|
+
${u}
|
|
76
|
+
`),c}function qg(l,t){let n;const a=/@out\s+([^;]+);/g;for(;(n=a.exec(l))!==null;)t.push(n[1])}function sS(l){const n=/\b(\w+)\s*:/g.exec(l);return n?n[1]:""}function aS(l){const t=/@.*?\s+/g;return l.replace(t,"")}function lS(l,t){const n=[];qg(t,n),l.forEach(m=>{m.header&&qg(m.header,n)});let a=0;const o=n.sort().map(m=>m.indexOf("builtin")>-1?m:`@location(${a++}) ${m}`).join(`,
|
|
77
|
+
`),u=n.sort().map(m=>` var ${aS(m)};`).join(`
|
|
78
|
+
`),c=`return VSOutput(
|
|
79
|
+
${n.sort().map(m=>` ${sS(m)}`).join(`,
|
|
80
|
+
`)});`;let h=t.replace(/@out\s+[^;]+;\s*/g,"");return h=h.replace("{{struct}}",`
|
|
81
|
+
${o}
|
|
82
|
+
`),h=h.replace("{{start}}",`
|
|
83
|
+
${u}
|
|
84
|
+
`),h=h.replace("{{return}}",`
|
|
85
|
+
${c}
|
|
86
|
+
`),h}function Xg(l,t){let n=l;for(const a in t){const o=t[a];o.join(`
|
|
87
|
+
`).length?n=n.replace(`{{${a}}}`,`//-----${a} START-----//
|
|
88
|
+
${o.join(`
|
|
89
|
+
`)}
|
|
90
|
+
//----${a} FINISH----//`):n=n.replace(`{{${a}}}`,"")}return n}const Sn=Object.create(null),Jc=new Map;let rS=0;function oS({template:l,bits:t}){const n=T0(l,t);if(Sn[n])return Sn[n];const{vertex:a,fragment:o}=cS(l,t);return Sn[n]=A0(a,o,t),Sn[n]}function uS({template:l,bits:t}){const n=T0(l,t);return Sn[n]||(Sn[n]=A0(l.vertex,l.fragment,t)),Sn[n]}function cS(l,t){const n=t.map(c=>c.vertex).filter(c=>!!c),a=t.map(c=>c.fragment).filter(c=>!!c);let o=Yg(n,l.vertex,!0);o=lS(n,o);const u=Yg(a,l.fragment,!0);return{vertex:o,fragment:u}}function T0(l,t){return t.map(n=>(Jc.has(n)||Jc.set(n,rS++),Jc.get(n))).sort((n,a)=>n-a).join("-")+l.vertex+l.fragment}function A0(l,t,n){const a=Lg(l),o=Lg(t);return n.forEach(u=>{Hg(u.vertex,a,u.name),Hg(u.fragment,o,u.name)}),{vertex:Xg(l,a),fragment:Xg(t,o)}}const hS=`
|
|
91
|
+
@in aPosition: vec2<f32>;
|
|
92
|
+
@in aUV: vec2<f32>;
|
|
93
|
+
|
|
94
|
+
@out @builtin(position) vPosition: vec4<f32>;
|
|
95
|
+
@out vUV : vec2<f32>;
|
|
96
|
+
@out vColor : vec4<f32>;
|
|
97
|
+
|
|
98
|
+
{{header}}
|
|
99
|
+
|
|
100
|
+
struct VSOutput {
|
|
101
|
+
{{struct}}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
@vertex
|
|
105
|
+
fn main( {{in}} ) -> VSOutput {
|
|
106
|
+
|
|
107
|
+
var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
|
|
108
|
+
var modelMatrix = mat3x3<f32>(
|
|
109
|
+
1.0, 0.0, 0.0,
|
|
110
|
+
0.0, 1.0, 0.0,
|
|
111
|
+
0.0, 0.0, 1.0
|
|
112
|
+
);
|
|
113
|
+
var position = aPosition;
|
|
114
|
+
var uv = aUV;
|
|
115
|
+
|
|
116
|
+
{{start}}
|
|
117
|
+
|
|
118
|
+
vColor = vec4<f32>(1., 1., 1., 1.);
|
|
119
|
+
|
|
120
|
+
{{main}}
|
|
121
|
+
|
|
122
|
+
vUV = uv;
|
|
123
|
+
|
|
124
|
+
var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
125
|
+
|
|
126
|
+
vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
|
|
127
|
+
|
|
128
|
+
vColor *= globalUniforms.uWorldColorAlpha;
|
|
129
|
+
|
|
130
|
+
{{end}}
|
|
131
|
+
|
|
132
|
+
{{return}}
|
|
133
|
+
};
|
|
134
|
+
`,fS=`
|
|
135
|
+
@in vUV : vec2<f32>;
|
|
136
|
+
@in vColor : vec4<f32>;
|
|
137
|
+
|
|
138
|
+
{{header}}
|
|
139
|
+
|
|
140
|
+
@fragment
|
|
141
|
+
fn main(
|
|
142
|
+
{{in}}
|
|
143
|
+
) -> @location(0) vec4<f32> {
|
|
144
|
+
|
|
145
|
+
{{start}}
|
|
146
|
+
|
|
147
|
+
var outColor:vec4<f32>;
|
|
148
|
+
|
|
149
|
+
{{main}}
|
|
150
|
+
|
|
151
|
+
var finalColor:vec4<f32> = outColor * vColor;
|
|
152
|
+
|
|
153
|
+
{{end}}
|
|
154
|
+
|
|
155
|
+
return finalColor;
|
|
156
|
+
};
|
|
157
|
+
`,dS=`
|
|
158
|
+
in vec2 aPosition;
|
|
159
|
+
in vec2 aUV;
|
|
160
|
+
|
|
161
|
+
out vec4 vColor;
|
|
162
|
+
out vec2 vUV;
|
|
163
|
+
|
|
164
|
+
{{header}}
|
|
165
|
+
|
|
166
|
+
void main(void){
|
|
167
|
+
|
|
168
|
+
mat3 worldTransformMatrix = uWorldTransformMatrix;
|
|
169
|
+
mat3 modelMatrix = mat3(
|
|
170
|
+
1.0, 0.0, 0.0,
|
|
171
|
+
0.0, 1.0, 0.0,
|
|
172
|
+
0.0, 0.0, 1.0
|
|
173
|
+
);
|
|
174
|
+
vec2 position = aPosition;
|
|
175
|
+
vec2 uv = aUV;
|
|
176
|
+
|
|
177
|
+
{{start}}
|
|
178
|
+
|
|
179
|
+
vColor = vec4(1.);
|
|
180
|
+
|
|
181
|
+
{{main}}
|
|
182
|
+
|
|
183
|
+
vUV = uv;
|
|
184
|
+
|
|
185
|
+
mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
186
|
+
|
|
187
|
+
gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
|
188
|
+
|
|
189
|
+
vColor *= uWorldColorAlpha;
|
|
190
|
+
|
|
191
|
+
{{end}}
|
|
192
|
+
}
|
|
193
|
+
`,mS=`
|
|
194
|
+
|
|
195
|
+
in vec4 vColor;
|
|
196
|
+
in vec2 vUV;
|
|
197
|
+
|
|
198
|
+
out vec4 finalColor;
|
|
199
|
+
|
|
200
|
+
{{header}}
|
|
201
|
+
|
|
202
|
+
void main(void) {
|
|
203
|
+
|
|
204
|
+
{{start}}
|
|
205
|
+
|
|
206
|
+
vec4 outColor;
|
|
207
|
+
|
|
208
|
+
{{main}}
|
|
209
|
+
|
|
210
|
+
finalColor = outColor * vColor;
|
|
211
|
+
|
|
212
|
+
{{end}}
|
|
213
|
+
}
|
|
214
|
+
`,pS={name:"global-uniforms-bit",vertex:{header:`
|
|
215
|
+
struct GlobalUniforms {
|
|
216
|
+
uProjectionMatrix:mat3x3<f32>,
|
|
217
|
+
uWorldTransformMatrix:mat3x3<f32>,
|
|
218
|
+
uWorldColorAlpha: vec4<f32>,
|
|
219
|
+
uResolution: vec2<f32>,
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
|
|
223
|
+
`}},gS={name:"global-uniforms-bit",vertex:{header:`
|
|
224
|
+
uniform mat3 uProjectionMatrix;
|
|
225
|
+
uniform mat3 uWorldTransformMatrix;
|
|
226
|
+
uniform vec4 uWorldColorAlpha;
|
|
227
|
+
uniform vec2 uResolution;
|
|
228
|
+
`}};function yS({bits:l,name:t}){const n=oS({template:{fragment:fS,vertex:hS},bits:[pS,...l]});return lo.from({name:t,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function xS({bits:l,name:t}){return new $y({name:t,...uS({template:{vertex:dS,fragment:mS},bits:[gS,...l]})})}const _S={name:"color-bit",vertex:{header:`
|
|
229
|
+
@in aColor: vec4<f32>;
|
|
230
|
+
`,main:`
|
|
231
|
+
vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
|
|
232
|
+
`}},bS={name:"color-bit",vertex:{header:`
|
|
233
|
+
in vec4 aColor;
|
|
234
|
+
`,main:`
|
|
235
|
+
vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
|
|
236
|
+
`}},th={};function vS(l){const t=[];if(l===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let n=0;for(let a=0;a<l;a++)t.push(`@group(1) @binding(${n++}) var textureSource${a+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${n++}) var textureSampler${a+1}: sampler;`)}return t.join(`
|
|
237
|
+
`)}function SS(l){const t=[];if(l===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let n=0;n<l;n++)n===l-1?t.push(" default:{"):t.push(` case ${n}:{`),t.push(` outColor = textureSampleGrad(textureSource${n+1}, textureSampler${n+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(`
|
|
238
|
+
`)}function TS(l){return th[l]||(th[l]={name:"texture-batch-bit",vertex:{header:`
|
|
239
|
+
@in aTextureIdAndRound: vec2<u32>;
|
|
240
|
+
@out @interpolate(flat) vTextureId : u32;
|
|
241
|
+
`,main:`
|
|
242
|
+
vTextureId = aTextureIdAndRound.y;
|
|
243
|
+
`,end:`
|
|
244
|
+
if(aTextureIdAndRound.x == 1)
|
|
245
|
+
{
|
|
246
|
+
vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
247
|
+
}
|
|
248
|
+
`},fragment:{header:`
|
|
249
|
+
@in @interpolate(flat) vTextureId: u32;
|
|
250
|
+
|
|
251
|
+
${vS(l)}
|
|
252
|
+
`,main:`
|
|
253
|
+
var uvDx = dpdx(vUV);
|
|
254
|
+
var uvDy = dpdy(vUV);
|
|
255
|
+
|
|
256
|
+
${SS(l)}
|
|
257
|
+
`}}),th[l]}const eh={};function AS(l){const t=[];for(let n=0;n<l;n++)n>0&&t.push("else"),n<l-1&&t.push(`if(vTextureId < ${n}.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${n}], vUV);`),t.push("}");return t.join(`
|
|
258
|
+
`)}function wS(l){return eh[l]||(eh[l]={name:"texture-batch-bit",vertex:{header:`
|
|
259
|
+
in vec2 aTextureIdAndRound;
|
|
260
|
+
out float vTextureId;
|
|
261
|
+
|
|
262
|
+
`,main:`
|
|
263
|
+
vTextureId = aTextureIdAndRound.y;
|
|
264
|
+
`,end:`
|
|
265
|
+
if(aTextureIdAndRound.x == 1.)
|
|
266
|
+
{
|
|
267
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
268
|
+
}
|
|
269
|
+
`},fragment:{header:`
|
|
270
|
+
in float vTextureId;
|
|
271
|
+
|
|
272
|
+
uniform sampler2D uTextures[${l}];
|
|
273
|
+
|
|
274
|
+
`,main:`
|
|
275
|
+
|
|
276
|
+
${AS(l)}
|
|
277
|
+
`}}),eh[l]}const CS={name:"round-pixels-bit",vertex:{header:`
|
|
278
|
+
fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
|
|
279
|
+
{
|
|
280
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
281
|
+
}
|
|
282
|
+
`}},MS={name:"round-pixels-bit",vertex:{header:`
|
|
283
|
+
vec2 roundPixels(vec2 position, vec2 targetSize)
|
|
284
|
+
{
|
|
285
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
286
|
+
}
|
|
287
|
+
`}},Vg={};function ES(l){let t=Vg[l];if(t)return t;const n=new Int32Array(l);for(let a=0;a<l;a++)n[a]=a;return t=Vg[l]=new i0({uTextures:{value:n,type:"i32",size:l}},{isStatic:!0}),t}class Pg extends Oh{constructor(t){const n=xS({name:"batch",bits:[bS,wS(t),MS]}),a=yS({name:"batch",bits:[_S,TS(t),CS]});super({glProgram:n,gpuProgram:a,resources:{batchSamplers:ES(t)}}),this.maxTextures=t}}let Ia=null;const w0=class C0 extends Iv{constructor(t){super(t),this.geometry=new iS,this.name=C0.extension.name,this.vertexSize=6,Ia??(Ia=new Pg(t.maxTextures)),this.shader=Ia}packAttributes(t,n,a,o,u){const c=u<<16|t.roundPixels&65535,h=t.transform,m=h.a,p=h.b,g=h.c,x=h.d,_=h.tx,b=h.ty,{positions:T,uvs:w}=t,S=t.color,A=t.attributeOffset,C=A+t.attributeSize;for(let E=A;E<C;E++){const B=E*2,X=T[B],N=T[B+1];n[o++]=m*X+g*N+_,n[o++]=x*N+p*X+b,n[o++]=w[B],n[o++]=w[B+1],a[o++]=S,a[o++]=c}}packQuadAttributes(t,n,a,o,u){const c=t.texture,h=t.transform,m=h.a,p=h.b,g=h.c,x=h.d,_=h.tx,b=h.ty,T=t.bounds,w=T.maxX,S=T.minX,A=T.maxY,C=T.minY,E=c.uvs,B=t.color,X=u<<16|t.roundPixels&65535;n[o+0]=m*S+g*C+_,n[o+1]=x*C+p*S+b,n[o+2]=E.x0,n[o+3]=E.y0,a[o+4]=B,a[o+5]=X,n[o+6]=m*w+g*C+_,n[o+7]=x*C+p*w+b,n[o+8]=E.x1,n[o+9]=E.y1,a[o+10]=B,a[o+11]=X,n[o+12]=m*w+g*A+_,n[o+13]=x*A+p*w+b,n[o+14]=E.x2,n[o+15]=E.y2,a[o+16]=B,a[o+17]=X,n[o+18]=m*S+g*A+_,n[o+19]=x*A+p*S+b,n[o+20]=E.x3,n[o+21]=E.y3,a[o+22]=B,a[o+23]=X}_updateMaxTextures(t){this.shader.maxTextures!==t&&(Ia=new Pg(t),this.shader=Ia)}destroy(){this.shader=null,super.destroy()}};w0.extension={type:[yt.Batcher],name:"default"};let RS=w0;class ml{constructor(t){this.items=Object.create(null);const{renderer:n,type:a,onUnload:o,priority:u,name:c}=t;this._renderer=n,n.gc.addResourceHash(this,"items",a,u??0),this._onUnload=o,this.name=c}add(t){return this.items[t.uid]?!1:(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...n){var o;if(!this.items[t.uid])return;const a=t._gpuData[this._renderer.uid];a&&((o=this._onUnload)==null||o.call(this,t,...n),a.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach(n=>n&&this.remove(n,...t))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function zS(l,t,n,a,o,u,c,h=null){let m=0;n*=t,o*=u;const p=h.a,g=h.b,x=h.c,_=h.d,b=h.tx,T=h.ty;for(;m<c;){const w=l[n],S=l[n+1];a[o]=p*w+x*S+b,a[o+1]=g*w+_*S+T,o+=u,n+=t,m++}}function DS(l,t,n,a){let o=0;for(t*=n;o<a;)l[t]=0,l[t+1]=0,t+=n,o++}function M0(l,t,n,a,o){const u=t.a,c=t.b,h=t.c,m=t.d,p=t.tx,g=t.ty;n||(n=0),a||(a=2),o||(o=l.length/a-n);let x=n*a;for(let _=0;_<o;_++){const b=l[x],T=l[x+1];l[x]=u*b+h*T+p,l[x+1]=c*b+m*T+g,x+=a}}const BS=new St;class Uh{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const t=this.baseColor,n=t>>16|t&65280|(t&255)<<16,a=this.renderable;return a?Dy(n,a.groupColor)+(this.alpha*a.groupAlpha*255<<24):n+(this.alpha*255<<24)}get transform(){var t;return((t=this.renderable)==null?void 0:t.groupTransform)||BS}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}const fl={extension:{type:yt.ShapeBuilder,name:"circle"},build(l,t){let n,a,o,u,c,h;if(l.type==="circle"){const B=l;if(c=h=B.radius,c<=0)return!1;n=B.x,a=B.y,o=u=0}else if(l.type==="ellipse"){const B=l;if(c=B.halfWidth,h=B.halfHeight,c<=0||h<=0)return!1;n=B.x,a=B.y,o=u=0}else{const B=l,X=B.width/2,N=B.height/2;n=B.x+X,a=B.y+N,c=h=Math.max(0,Math.min(B.radius,Math.min(X,N))),o=X-c,u=N-h}if(o<0||u<0)return!1;const m=Math.ceil(2.3*Math.sqrt(c+h)),p=m*8+(o?4:0)+(u?4:0);if(p===0)return!1;if(m===0)return t[0]=t[6]=n+o,t[1]=t[3]=a+u,t[2]=t[4]=n-o,t[5]=t[7]=a-u,!0;let g=0,x=m*4+(o?2:0)+2,_=x,b=p,T=o+c,w=u,S=n+T,A=n-T,C=a+w;if(t[g++]=S,t[g++]=C,t[--x]=C,t[--x]=A,u){const B=a-w;t[_++]=A,t[_++]=B,t[--b]=B,t[--b]=S}for(let B=1;B<m;B++){const X=Math.PI/2*(B/m),N=o+Math.cos(X)*c,G=u+Math.sin(X)*h,$=n+N,W=n-N,Z=a+G,I=a-G;t[g++]=$,t[g++]=Z,t[--x]=Z,t[--x]=W,t[_++]=W,t[_++]=I,t[--b]=I,t[--b]=$}T=o,w=u+h,S=n+T,A=n-T,C=a+w;const E=a-w;return t[g++]=S,t[g++]=C,t[--b]=E,t[--b]=S,o&&(t[g++]=A,t[g++]=C,t[--b]=E,t[--b]=A),!0},triangulate(l,t,n,a,o,u){if(l.length===0)return;let c=0,h=0;for(let g=0;g<l.length;g+=2)c+=l[g],h+=l[g+1];c/=l.length/2,h/=l.length/2;let m=a;t[m*n]=c,t[m*n+1]=h;const p=m++;for(let g=0;g<l.length;g+=2)t[m*n]=l[g],t[m*n+1]=l[g+1],g>0&&(o[u++]=m,o[u++]=p,o[u++]=m-1),m++;o[u++]=p+1,o[u++]=p,o[u++]=m-1}},OS={...fl,extension:{...fl.extension,name:"ellipse"}},NS={...fl,extension:{...fl.extension,name:"roundedRectangle"}},E0=1e-4,Fg=1e-4;function GS(l){const t=l.length;if(t<6)return 1;let n=0;for(let a=0,o=l[t-2],u=l[t-1];a<t;a+=2){const c=l[a],h=l[a+1];n+=(c-o)*(h+u),o=c,u=h}return n<0?-1:1}function Qg(l,t,n,a,o,u,c,h){const m=l-n*o,p=t-a*o,g=l+n*u,x=t+a*u;let _,b;c?(_=a,b=-n):(_=-a,b=n);const T=m+_,w=p+b,S=g+_,A=x+b;return h.push(T,w),h.push(S,A),2}function Yn(l,t,n,a,o,u,c,h){const m=n-l,p=a-t;let g=Math.atan2(m,p),x=Math.atan2(o-l,u-t);h&&g<x?g+=Math.PI*2:!h&&g>x&&(x+=Math.PI*2);let _=g;const b=x-g,T=Math.abs(b),w=Math.sqrt(m*m+p*p),S=(15*T*Math.sqrt(w)/Math.PI>>0)+1,A=b/S;if(_+=A,h){c.push(l,t),c.push(n,a);for(let C=1,E=_;C<S;C++,E+=A)c.push(l,t),c.push(l+Math.sin(E)*w,t+Math.cos(E)*w);c.push(l,t),c.push(o,u)}else{c.push(n,a),c.push(l,t);for(let C=1,E=_;C<S;C++,E+=A)c.push(l+Math.sin(E)*w,t+Math.cos(E)*w),c.push(l,t);c.push(o,u),c.push(l,t)}return S*2}function kS(l,t,n,a,o,u){const c=E0;if(l.length===0)return;const h=t;let m=h.alignment;if(t.alignment!==.5){let K=GS(l);m=(m-.5)*K+.5}const p=new ge(l[0],l[1]),g=new ge(l[l.length-2],l[l.length-1]),x=a,_=Math.abs(p.x-g.x)<c&&Math.abs(p.y-g.y)<c;if(x){l=l.slice(),_&&(l.pop(),l.pop(),g.set(l[l.length-2],l[l.length-1]));const K=(p.x+g.x)*.5,at=(g.y+p.y)*.5;l.unshift(K,at),l.push(K,at)}const b=o,T=l.length/2;let w=l.length;const S=b.length/2,A=h.width/2,C=A*A,E=h.miterLimit*h.miterLimit;let B=l[0],X=l[1],N=l[2],G=l[3],$=0,W=0,Z=-(X-G),I=B-N,tt=0,it=0,nt=Math.sqrt(Z*Z+I*I);Z/=nt,I/=nt,Z*=A,I*=A;const At=m,D=(1-At)*2,L=At*2;x||(h.cap==="round"?w+=Yn(B-Z*(D-L)*.5,X-I*(D-L)*.5,B-Z*D,X-I*D,B+Z*L,X+I*L,b,!0)+2:h.cap==="square"&&(w+=Qg(B,X,Z,I,D,L,!0,b))),b.push(B-Z*D,X-I*D),b.push(B+Z*L,X+I*L);for(let K=1;K<T-1;++K){B=l[(K-1)*2],X=l[(K-1)*2+1],N=l[K*2],G=l[K*2+1],$=l[(K+1)*2],W=l[(K+1)*2+1],Z=-(X-G),I=B-N,nt=Math.sqrt(Z*Z+I*I),Z/=nt,I/=nt,Z*=A,I*=A,tt=-(G-W),it=N-$,nt=Math.sqrt(tt*tt+it*it),tt/=nt,it/=nt,tt*=A,it*=A;const at=N-B,R=X-G,Y=N-$,Q=W-G,J=at*Y+R*Q,rt=R*Y-Q*at,ct=rt<0;if(Math.abs(rt)<.001*Math.abs(J)){b.push(N-Z*D,G-I*D),b.push(N+Z*L,G+I*L),J>=0&&(h.join==="round"?w+=Yn(N,G,N-Z*D,G-I*D,N-tt*D,G-it*D,b,!1)+4:w+=2,b.push(N-tt*L,G-it*L),b.push(N+tt*D,G+it*D));continue}const ft=(-Z+B)*(-I+G)-(-Z+N)*(-I+X),Ht=(-tt+$)*(-it+G)-(-tt+N)*(-it+W),Et=(at*Ht-Y*ft)/rt,Pe=(Q*ft-R*Ht)/rt,Qi=(Et-N)*(Et-N)+(Pe-G)*(Pe-G),ri=N+(Et-N)*D,mi=G+(Pe-G)*D,ye=N-(Et-N)*L,oi=G-(Pe-G)*L,Is=Math.min(at*at+R*R,Y*Y+Q*Q),pl=ct?D:L,gl=Is+pl*pl*C;Qi<=gl?h.join==="bevel"||Qi/C>E?(ct?(b.push(ri,mi),b.push(N+Z*L,G+I*L),b.push(ri,mi),b.push(N+tt*L,G+it*L)):(b.push(N-Z*D,G-I*D),b.push(ye,oi),b.push(N-tt*D,G-it*D),b.push(ye,oi)),w+=2):h.join==="round"?ct?(b.push(ri,mi),b.push(N+Z*L,G+I*L),w+=Yn(N,G,N+Z*L,G+I*L,N+tt*L,G+it*L,b,!0)+4,b.push(ri,mi),b.push(N+tt*L,G+it*L)):(b.push(N-Z*D,G-I*D),b.push(ye,oi),w+=Yn(N,G,N-Z*D,G-I*D,N-tt*D,G-it*D,b,!1)+4,b.push(N-tt*D,G-it*D),b.push(ye,oi)):(b.push(ri,mi),b.push(ye,oi)):(b.push(N-Z*D,G-I*D),b.push(N+Z*L,G+I*L),h.join==="round"?ct?w+=Yn(N,G,N+Z*L,G+I*L,N+tt*L,G+it*L,b,!0)+2:w+=Yn(N,G,N-Z*D,G-I*D,N-tt*D,G-it*D,b,!1)+2:h.join==="miter"&&Qi/C<=E&&(ct?(b.push(ye,oi),b.push(ye,oi)):(b.push(ri,mi),b.push(ri,mi)),w+=2),b.push(N-tt*D,G-it*D),b.push(N+tt*L,G+it*L),w+=2)}B=l[(T-2)*2],X=l[(T-2)*2+1],N=l[(T-1)*2],G=l[(T-1)*2+1],Z=-(X-G),I=B-N,nt=Math.sqrt(Z*Z+I*I),Z/=nt,I/=nt,Z*=A,I*=A,b.push(N-Z*D,G-I*D),b.push(N+Z*L,G+I*L),x||(h.cap==="round"?w+=Yn(N-Z*(D-L)*.5,G-I*(D-L)*.5,N-Z*D,G-I*D,N+Z*L,G+I*L,b,!1)+2:h.cap==="square"&&(w+=Qg(N,G,Z,I,D,L,!1,b)));const et=Fg*Fg;for(let K=S;K<w+S-2;++K)B=b[K*2],X=b[K*2+1],N=b[(K+1)*2],G=b[(K+1)*2+1],$=b[(K+2)*2],W=b[(K+2)*2+1],!(Math.abs(B*(G-W)+N*(W-X)+$*(X-G))<et)&&u.push(K,K+1,K+2)}function US(l,t,n,a){const o=E0;if(l.length===0)return;const u=l[0],c=l[1],h=l[l.length-2],m=l[l.length-1],p=t||Math.abs(u-h)<o&&Math.abs(c-m)<o,g=n,x=l.length/2,_=g.length/2;for(let b=0;b<x;b++)g.push(l[b*2]),g.push(l[b*2+1]);for(let b=0;b<x-1;b++)a.push(_+b,_+b+1);p&&a.push(_+x-1,_)}function R0(l,t,n,a,o,u,c){const h=Cv(l,t,2);if(!h)return;for(let p=0;p<h.length;p+=3)u[c++]=h[p]+o,u[c++]=h[p+1]+o,u[c++]=h[p+2]+o;let m=o*a;for(let p=0;p<l.length;p+=2)n[m]=l[p],n[m+1]=l[p+1],m+=a}const HS=[],LS={extension:{type:yt.ShapeBuilder,name:"polygon"},build(l,t){for(let n=0;n<l.points.length;n++)t[n]=l.points[n];return!0},triangulate(l,t,n,a,o,u){R0(l,HS,t,n,a,o,u)}},jS={extension:{type:yt.ShapeBuilder,name:"rectangle"},build(l,t){const n=l,a=n.x,o=n.y,u=n.width,c=n.height;return u>0&&c>0?(t[0]=a,t[1]=o,t[2]=a+u,t[3]=o,t[4]=a+u,t[5]=o+c,t[6]=a,t[7]=o+c,!0):!1},triangulate(l,t,n,a,o,u){let c=0;a*=n,t[a+c]=l[0],t[a+c+1]=l[1],c+=n,t[a+c]=l[2],t[a+c+1]=l[3],c+=n,t[a+c]=l[6],t[a+c+1]=l[7],c+=n,t[a+c]=l[4],t[a+c+1]=l[5],c+=n;const h=a/n;o[u++]=h,o[u++]=h+1,o[u++]=h+2,o[u++]=h+1,o[u++]=h+3,o[u++]=h+2}},YS={extension:{type:yt.ShapeBuilder,name:"triangle"},build(l,t){return t[0]=l.x,t[1]=l.y,t[2]=l.x2,t[3]=l.y2,t[4]=l.x3,t[5]=l.y3,!0},triangulate(l,t,n,a,o,u){let c=0;a*=n,t[a+c]=l[0],t[a+c+1]=l[1],c+=n,t[a+c]=l[2],t[a+c+1]=l[3],c+=n,t[a+c]=l[4],t[a+c+1]=l[5];const h=a/n;o[u++]=h,o[u++]=h+1,o[u++]=h+2}},Wg=[{offset:0,color:"white"},{offset:1,color:"black"}],Hh=class xh{constructor(...t){this.uid=Qt("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=qS(t);n={...n.type==="radial"?xh.defaultRadialOptions:xh.defaultLinearOptions,...by(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type==="radial"?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(o=>{this.addColorStop(o.offset,o.color)})}addColorStop(t,n){return this.colorStops.push({offset:t,color:se.shared.setValue(n).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:n}=this.start,{x:a,y:o}=this.end,u=a-t,c=o-n;const h=u<0||c<0;if(this._wrapMode==="clamp-to-edge"){if(u<0){const S=t;t=a,a=S,u*=-1}if(c<0){const S=n;n=o,o=S,c*=-1}}const m=this.colorStops.length?this.colorStops:Wg,p=this._textureSize,{canvas:g,context:x}=Ig(p,1),_=h?x.createLinearGradient(this._textureSize,0,0,0):x.createLinearGradient(0,0,this._textureSize,0);Zg(_,m),x.fillStyle=_,x.fillRect(0,0,p,1),this.texture=new Gt({source:new Jr({resource:g,addressMode:this._wrapMode})});const b=Math.sqrt(u*u+c*c),T=Math.atan2(c,u),w=new St;w.scale(b/p,1),w.rotate(T),w.translate(t,n),this.textureSpace==="local"&&w.scale(p,p),this.transform=w}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:Wg,n=this._textureSize,{canvas:a,context:o}=Ig(n,n),{x:u,y:c}=this.center,{x:h,y:m}=this.outerCenter,p=this.innerRadius,g=this.outerRadius,x=h-g,_=m-g,b=n/(g*2),T=(u-x)*b,w=(c-_)*b,S=o.createRadialGradient(T,w,p*b,(h-x)*b,(m-_)*b,g*b);Zg(S,t),o.fillStyle=t[t.length-1].color,o.fillRect(0,0,n,n),o.fillStyle=S,o.translate(T,w),o.rotate(this.rotation),o.scale(1,this.scale),o.translate(-T,-w),o.fillRect(0,0,n,n),this.texture=new Gt({source:new Jr({resource:a,addressMode:this._wrapMode})});const A=new St;A.scale(1/b,1/b),A.translate(x,_),this.textureSpace==="local"&&A.scale(n,n),this.transform=A}destroy(){var t;(t=this.texture)==null||t.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};Hh.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};Hh.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let Pi=Hh;function Zg(l,t){for(let n=0;n<t.length;n++){const a=t[n];l.addColorStop(a.offset,a.color)}}function Ig(l,t){const n=Ve.get().createCanvas(l,t),a=n.getContext("2d");return{canvas:n,context:a}}function qS(l){let t=l[0]??{};return(typeof t=="number"||l[1])&&(wt("8.5.2","use options object instead"),t={type:"linear",start:{x:l[0],y:l[1]},end:{x:l[2],y:l[3]},textureSpace:l[4],textureSize:l[5]??Pi.defaultLinearOptions.textureSize}),t}const XS=new St,VS=new It;function PS(l,t,n,a){const o=t.matrix?l.copyFrom(t.matrix).invert():l.identity();if(t.textureSpace==="local"){const c=n.getBounds(VS);t.width&&c.pad(t.width);const{x:h,y:m}=c,p=1/c.width,g=1/c.height,x=-h*p,_=-m*g,b=o.a,T=o.b,w=o.c,S=o.d;o.a*=p,o.b*=p,o.c*=g,o.d*=g,o.tx=x*b+_*w+o.tx,o.ty=x*T+_*S+o.ty}else o.translate(t.texture.frame.x,t.texture.frame.y),o.scale(1/t.texture.source.width,1/t.texture.source.height);const u=t.texture.source.style;return!(t.fill instanceof Pi)&&u.addressMode==="clamp-to-edge"&&(u.addressMode="repeat",u.update()),a&&o.append(XS.copyFrom(a).invert()),o}const ro={};Kt.handleByMap(yt.ShapeBuilder,ro);Kt.add(jS,LS,YS,fl,OS,NS);const FS=new It,QS=new St;function WS(l,t){const{geometryData:n,batches:a}=t;a.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let o=0;o<l.instructions.length;o++){const u=l.instructions[o];if(u.action==="texture")ZS(u.data,a,n);else if(u.action==="fill"||u.action==="stroke"){const c=u.action==="stroke",h=u.data.path.shapePath,m=u.data.style,p=u.data.hole;c&&p&&Kg(p.shapePath,m,!0,a,n),p&&(h.shapePrimitives[h.shapePrimitives.length-1].holes=p.shapePath.shapePrimitives),Kg(h,m,c,a,n)}}}function ZS(l,t,n){const a=[],o=ro.rectangle,u=FS;u.x=l.dx,u.y=l.dy,u.width=l.dw,u.height=l.dh;const c=l.transform;if(!o.build(u,a))return;const{vertices:h,uvs:m,indices:p}=n,g=p.length,x=h.length/2;c&&M0(a,c),o.triangulate(a,h,2,x,p,g);const _=l.image,b=_.uvs;m.push(b.x0,b.y0,b.x1,b.y1,b.x3,b.y3,b.x2,b.y2);const T=Re.get(Uh);T.indexOffset=g,T.indexSize=p.length-g,T.attributeOffset=x,T.attributeSize=h.length/2-x,T.baseColor=l.style,T.alpha=l.alpha,T.texture=_,T.geometryData=n,t.push(T)}function Kg(l,t,n,a,o){const{vertices:u,uvs:c,indices:h}=o;l.shapePrimitives.forEach(({shape:m,transform:p,holes:g})=>{const x=[],_=ro[m.type];if(!_.build(m,x))return;const b=h.length,T=u.length/2;let w="triangle-list";if(p&&M0(x,p),n){const E=m.closePath??!0,B=t;B.pixelLine?(US(x,E,u,h),w="line-list"):kS(x,B,!1,E,u,h)}else if(g){const E=[],B=x.slice();IS(g).forEach(N=>{E.push(B.length/2),B.push(...N)}),R0(B,E,u,2,T,h,b)}else _.triangulate(x,u,2,T,h,b);const S=c.length/2,A=t.texture;if(A!==Gt.WHITE){const E=PS(QS,t,m,p);zS(u,2,T,c,S,2,u.length/2-T,E)}else DS(c,S,2,u.length/2-T);const C=Re.get(Uh);C.indexOffset=b,C.indexSize=h.length-b,C.attributeOffset=T,C.attributeSize=u.length/2-T,C.baseColor=t.color,C.alpha=t.alpha,C.texture=A,C.geometryData=o,C.topology=w,a.push(C)})}function IS(l){const t=[];for(let n=0;n<l.length;n++){const a=l[n].shape,o=[];ro[a.type].build(a,o)&&t.push(o)}return t}class KS{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{Re.return(t)}),this.graphicsData&&Re.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class $S{constructor(){this.instructions=new zh}init(t){const n=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new RS({maxTextures:n}),this.instructions.reset()}get geometry(){return wt(W1,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const Lh=class _h{constructor(t){this._renderer=t,this._managedContexts=new ml({renderer:t,type:"resource",name:"graphicsContext"})}init(t){_h.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??_h.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=!!t._gpuData[this._renderer.uid],a=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!n){n&&a.reset(),WS(t,a);const o=t.batchMode;t.customShader||o==="no-batch"?a.isBatchable=!1:o==="auto"?a.isBatchable=a.geometryData.vertices.length<400:a.isBatchable=!0,t.dirty=!1}return a}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=Re.get($S,{maxTextures:this._renderer.limits.maxBatchableTextures}),a=t._gpuData[this._renderer.uid],{batches:o,geometryData:u}=a;a.graphicsData=n;const c=u.vertices.length,h=u.indices.length;for(let x=0;x<o.length;x++)o[x].applyTransform=!1;const m=n.batcher;m.ensureAttributeBuffer(c),m.ensureIndexBuffer(h),m.begin();for(let x=0;x<o.length;x++){const _=o[x];m.add(_)}m.finish(n.instructions);const p=m.geometry;p.indexBuffer.setDataWithSize(m.indexBuffer,m.indexSize,!0),p.buffers[0].setDataWithSize(m.attributeBuffer.float32View,m.attributeSize,!0);const g=m.batches;for(let x=0;x<g.length;x++){const _=g[x];_.bindGroup=jv(_.textures.textures,_.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(t){const n=new KS;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Lh.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"graphicsContext"};Lh.defaultOptions={bezierSmoothness:.5};let jh=Lh;const JS=8,Wr=11920929e-14,t2=1;function z0(l,t,n,a,o,u,c,h,m,p){const x=Math.min(.99,Math.max(0,p??jh.defaultOptions.bezierSmoothness));let _=(t2-x)/1;return _*=_,e2(t,n,a,o,u,c,h,m,l,_),l}function e2(l,t,n,a,o,u,c,h,m,p){bh(l,t,n,a,o,u,c,h,m,p,0),m.push(c,h)}function bh(l,t,n,a,o,u,c,h,m,p,g){if(g>JS)return;const x=(l+n)/2,_=(t+a)/2,b=(n+o)/2,T=(a+u)/2,w=(o+c)/2,S=(u+h)/2,A=(x+b)/2,C=(_+T)/2,E=(b+w)/2,B=(T+S)/2,X=(A+E)/2,N=(C+B)/2;if(g>0){let G=c-l,$=h-t;const W=Math.abs((n-c)*$-(a-h)*G),Z=Math.abs((o-c)*$-(u-h)*G);if(W>Wr&&Z>Wr){if((W+Z)*(W+Z)<=p*(G*G+$*$)){m.push(X,N);return}}else if(W>Wr){if(W*W<=p*(G*G+$*$)){m.push(X,N);return}}else if(Z>Wr){if(Z*Z<=p*(G*G+$*$)){m.push(X,N);return}}else if(G=X-(l+c)/2,$=N-(t+h)/2,G*G+$*$<=p){m.push(X,N);return}}bh(l,t,x,_,A,C,X,N,m,p,g+1),bh(X,N,E,B,w,S,c,h,m,p,g+1)}const i2=8,n2=11920929e-14,s2=1;function a2(l,t,n,a,o,u,c,h){const p=Math.min(.99,Math.max(0,h??jh.defaultOptions.bezierSmoothness));let g=(s2-p)/1;return g*=g,l2(t,n,a,o,u,c,l,g),l}function l2(l,t,n,a,o,u,c,h){vh(c,l,t,n,a,o,u,h,0),c.push(o,u)}function vh(l,t,n,a,o,u,c,h,m){if(m>i2)return;const p=(t+a)/2,g=(n+o)/2,x=(a+u)/2,_=(o+c)/2,b=(p+x)/2,T=(g+_)/2;let w=u-t,S=c-n;const A=Math.abs((a-u)*S-(o-c)*w);if(A>n2){if(A*A<=h*(w*w+S*S)){l.push(b,T);return}}else if(w=b-(t+u)/2,S=T-(n+c)/2,w*w+S*S<=h){l.push(b,T);return}vh(l,t,n,p,g,b,T,h,m+1),vh(l,b,T,x,_,u,c,h,m+1)}function D0(l,t,n,a,o,u,c,h){let m=Math.abs(o-u);(!c&&o>u||c&&u>o)&&(m=2*Math.PI-m),h||(h=Math.max(6,Math.floor(6*Math.pow(a,1/3)*(m/Math.PI)))),h=Math.max(h,3);let p=m/h,g=o;p*=c?-1:1;for(let x=0;x<h+1;x++){const _=Math.cos(g),b=Math.sin(g),T=t+_*a,w=n+b*a;l.push(T,w),g+=p}}function r2(l,t,n,a,o,u){const c=l[l.length-2],m=l[l.length-1]-n,p=c-t,g=o-n,x=a-t,_=Math.abs(m*x-p*g);if(_<1e-8||u===0){(l[l.length-2]!==t||l[l.length-1]!==n)&&l.push(t,n);return}const b=m*m+p*p,T=g*g+x*x,w=m*g+p*x,S=u*Math.sqrt(b)/_,A=u*Math.sqrt(T)/_,C=S*w/b,E=A*w/T,B=S*x+A*p,X=S*g+A*m,N=p*(A+C),G=m*(A+C),$=x*(S+E),W=g*(S+E),Z=Math.atan2(G-X,N-B),I=Math.atan2(W-X,$-B);D0(l,B+t,X+n,u,Z,I,p*g>x*m)}const al=Math.PI*2,ih={centerX:0,centerY:0,ang1:0,ang2:0},nh=({x:l,y:t},n,a,o,u,c,h,m)=>{l*=n,t*=a;const p=o*l-u*t,g=u*l+o*t;return m.x=p+c,m.y=g+h,m};function o2(l,t){const n=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),a=t===1.5707963267948966?.551915024494:n,o=Math.cos(l),u=Math.sin(l),c=Math.cos(l+t),h=Math.sin(l+t);return[{x:o-u*a,y:u+o*a},{x:c+h*a,y:h-c*a},{x:c,y:h}]}const $g=(l,t,n,a)=>{const o=l*a-t*n<0?-1:1;let u=l*n+t*a;return u>1&&(u=1),u<-1&&(u=-1),o*Math.acos(u)},u2=(l,t,n,a,o,u,c,h,m,p,g,x,_)=>{const b=Math.pow(o,2),T=Math.pow(u,2),w=Math.pow(g,2),S=Math.pow(x,2);let A=b*T-b*S-T*w;A<0&&(A=0),A/=b*S+T*w,A=Math.sqrt(A)*(c===h?-1:1);const C=A*o/u*x,E=A*-u/o*g,B=p*C-m*E+(l+n)/2,X=m*C+p*E+(t+a)/2,N=(g-C)/o,G=(x-E)/u,$=(-g-C)/o,W=(-x-E)/u,Z=$g(1,0,N,G);let I=$g(N,G,$,W);h===0&&I>0&&(I-=al),h===1&&I<0&&(I+=al),_.centerX=B,_.centerY=X,_.ang1=Z,_.ang2=I};function c2(l,t,n,a,o,u,c,h=0,m=0,p=0){if(u===0||c===0)return;const g=Math.sin(h*al/360),x=Math.cos(h*al/360),_=x*(t-a)/2+g*(n-o)/2,b=-g*(t-a)/2+x*(n-o)/2;if(_===0&&b===0)return;u=Math.abs(u),c=Math.abs(c);const T=Math.pow(_,2)/Math.pow(u,2)+Math.pow(b,2)/Math.pow(c,2);T>1&&(u*=Math.sqrt(T),c*=Math.sqrt(T)),u2(t,n,a,o,u,c,m,p,g,x,_,b,ih);let{ang1:w,ang2:S}=ih;const{centerX:A,centerY:C}=ih;let E=Math.abs(S)/(al/4);Math.abs(1-E)<1e-7&&(E=1);const B=Math.max(Math.ceil(E),1);S/=B;let X=l[l.length-2],N=l[l.length-1];const G={x:0,y:0};for(let $=0;$<B;$++){const W=o2(w,S),{x:Z,y:I}=nh(W[0],u,c,x,g,A,C,G),{x:tt,y:it}=nh(W[1],u,c,x,g,A,C,G),{x:nt,y:At}=nh(W[2],u,c,x,g,A,C,G);z0(l,X,N,Z,I,tt,it,nt,At),X=nt,N=At,w+=S}}function h2(l,t,n){const a=(c,h)=>{const m=h.x-c.x,p=h.y-c.y,g=Math.sqrt(m*m+p*p),x=m/g,_=p/g;return{len:g,nx:x,ny:_}},o=(c,h)=>{c===0?l.moveTo(h.x,h.y):l.lineTo(h.x,h.y)};let u=t[t.length-1];for(let c=0;c<t.length;c++){const h=t[c%t.length],m=h.radius??n;if(m<=0){o(c,h),u=h;continue}const p=t[(c+1)%t.length],g=a(h,u),x=a(h,p);if(g.len<1e-4||x.len<1e-4){o(c,h),u=h;continue}let _=Math.asin(g.nx*x.ny-g.ny*x.nx),b=1,T=!1;g.nx*x.nx-g.ny*-x.ny<0?_<0?_=Math.PI+_:(_=Math.PI-_,b=-1,T=!0):_>0&&(b=-1,T=!0);const w=_/2;let S,A=Math.abs(Math.cos(w)*m/Math.sin(w));A>Math.min(g.len/2,x.len/2)?(A=Math.min(g.len/2,x.len/2),S=Math.abs(A*Math.sin(w)/Math.cos(w))):S=m;const C=h.x+x.nx*A+-x.ny*S*b,E=h.y+x.ny*A+x.nx*S*b,B=Math.atan2(g.ny,g.nx)+Math.PI/2*b,X=Math.atan2(x.ny,x.nx)-Math.PI/2*b;c===0&&l.moveTo(C+Math.cos(B)*S,E+Math.sin(B)*S),l.arc(C,E,S,B,X,T),u=h}}function f2(l,t,n,a){const o=(h,m)=>Math.sqrt((h.x-m.x)**2+(h.y-m.y)**2),u=(h,m,p)=>({x:h.x+(m.x-h.x)*p,y:h.y+(m.y-h.y)*p}),c=t.length;for(let h=0;h<c;h++){const m=t[(h+1)%c],p=m.radius??n;if(p<=0){h===0?l.moveTo(m.x,m.y):l.lineTo(m.x,m.y);continue}const g=t[h],x=t[(h+2)%c],_=o(g,m);let b;if(_<1e-4)b=m;else{const S=Math.min(_/2,p);b=u(m,g,S/_)}const T=o(x,m);let w;if(T<1e-4)w=m;else{const S=Math.min(T/2,p);w=u(m,x,S/T)}h===0?l.moveTo(b.x,b.y):l.lineTo(b.x,b.y),l.quadraticCurveTo(m.x,m.y,w.x,w.y,a)}}const d2=new It;class m2{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new si,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,n){return this.startPoly(t,n),this}lineTo(t,n){this._ensurePoly();const a=this._currentPoly.points,o=a[a.length-2],u=a[a.length-1];return(o!==t||u!==n)&&a.push(t,n),this}arc(t,n,a,o,u,c){this._ensurePoly(!1);const h=this._currentPoly.points;return D0(h,t,n,a,o,u,c),this}arcTo(t,n,a,o,u){this._ensurePoly();const c=this._currentPoly.points;return r2(c,t,n,a,o,u),this}arcToSvg(t,n,a,o,u,c,h){const m=this._currentPoly.points;return c2(m,this._currentPoly.lastX,this._currentPoly.lastY,c,h,t,n,a,o,u),this}bezierCurveTo(t,n,a,o,u,c,h){this._ensurePoly();const m=this._currentPoly;return z0(this._currentPoly.points,m.lastX,m.lastY,t,n,a,o,u,c,h),this}quadraticCurveTo(t,n,a,o,u){this._ensurePoly();const c=this._currentPoly;return a2(this._currentPoly.points,c.lastX,c.lastY,t,n,a,o,u),this}closePath(){return this.endPoly(!0),this}addPath(t,n){this.endPoly(),n&&!n.isIdentity()&&(t=t.clone(!0),t.transform(n));const a=this.shapePrimitives,o=a.length;for(let u=0;u<t.instructions.length;u++){const c=t.instructions[u];this[c.action](...c.data)}if(t.checkForHoles&&a.length-o>1){let u=null;for(let c=o;c<a.length;c++){const h=a[c];if(h.shape.type==="polygon"){const m=h.shape,p=u==null?void 0:u.shape;p&&p.containsPolygon(m)?(u.holes||(u.holes=[]),u.holes.push(h),a.copyWithin(c,c+1),a.length--,c--):u=h}}}return this}finish(t=!1){this.endPoly(t)}rect(t,n,a,o,u){return this.drawShape(new It(t,n,a,o),u),this}circle(t,n,a,o){return this.drawShape(new Nh(t,n,a),o),this}poly(t,n,a){const o=new nl(t);return o.closePath=n,this.drawShape(o,a),this}regularPoly(t,n,a,o,u=0,c){o=Math.max(o|0,3);const h=-1*Math.PI/2+u,m=Math.PI*2/o,p=[];for(let g=0;g<o;g++){const x=h-g*m;p.push(t+a*Math.cos(x),n+a*Math.sin(x))}return this.poly(p,!0,c),this}roundPoly(t,n,a,o,u,c=0,h){if(o=Math.max(o|0,3),u<=0)return this.regularPoly(t,n,a,o,c);const m=a*Math.sin(Math.PI/o)-.001;u=Math.min(u,m);const p=-1*Math.PI/2+c,g=Math.PI*2/o,x=(o-2)*Math.PI/o/2;for(let _=0;_<o;_++){const b=_*g+p,T=t+a*Math.cos(b),w=n+a*Math.sin(b),S=b+Math.PI+x,A=b-Math.PI-x,C=T+u*Math.cos(S),E=w+u*Math.sin(S),B=T+u*Math.cos(A),X=w+u*Math.sin(A);_===0?this.moveTo(C,E):this.lineTo(C,E),this.quadraticCurveTo(T,w,B,X,h)}return this.closePath()}roundShape(t,n,a=!1,o){return t.length<3?this:(a?f2(this,t,n,o):h2(this,t,n),this.closePath())}filletRect(t,n,a,o,u){if(u===0)return this.rect(t,n,a,o);const c=Math.min(a,o)/2,h=Math.min(c,Math.max(-c,u)),m=t+a,p=n+o,g=h<0?-h:0,x=Math.abs(h);return this.moveTo(t,n+x).arcTo(t+g,n+g,t+x,n,x).lineTo(m-x,n).arcTo(m-g,n+g,m,n+x,x).lineTo(m,p-x).arcTo(m-g,p-g,t+a-x,p,x).lineTo(t+x,p).arcTo(t+g,p-g,t,p-x,x).closePath()}chamferRect(t,n,a,o,u,c){if(u<=0)return this.rect(t,n,a,o);const h=Math.min(u,Math.min(a,o)/2),m=t+a,p=n+o,g=[t+h,n,m-h,n,m,n+h,m,p-h,m-h,p,t+h,p,t,p-h,t,n+h];for(let x=g.length-1;x>=2;x-=2)g[x]===g[x-2]&&g[x-1]===g[x-3]&&g.splice(x-1,2);return this.poly(g,!0,c)}ellipse(t,n,a,o,u){return this.drawShape(new Gh(t,n,a,o),u),this}roundRect(t,n,a,o,u,c){return this.drawShape(new kh(t,n,a,o,u),c),this}drawShape(t,n){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:n}),this}startPoly(t,n){let a=this._currentPoly;return a&&this.endPoly(),a=new nl,a.points.push(t,n),this._currentPoly=a,this}endPoly(t=!1){const n=this._currentPoly;return n&&n.points.length>2&&(n.closePath=t,this.shapePrimitives.push({shape:n})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new nl,t)){const n=this.shapePrimitives[this.shapePrimitives.length-1];if(n){let a=n.shape.x,o=n.shape.y;if(n.transform&&!n.transform.isIdentity()){const u=n.transform,c=a;a=u.a*a+u.c*o+u.tx,o=u.b*c+u.d*o+u.ty}this._currentPoly.points.push(a,o)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let n=0;n<t.instructions.length;n++){const a=t.instructions[n];this[a.action](...a.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const n=this.shapePrimitives;for(let a=0;a<n.length;a++){const o=n[a],u=o.shape.getBounds(d2);o.transform?t.addRect(u,o.transform):t.addRect(u)}return t}}class Vi{constructor(t,n=!1){this.instructions=[],this.uid=Qt("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof t=="string"?kv(t,this):this.instructions=(t==null?void 0:t.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new m2(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,n){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,n]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,n,a,o,u){const c=this.instructions[this.instructions.length-1],h=this.getLastPoint(ge.shared);let m=0,p=0;if(!c||c.action!=="bezierCurveTo")m=h.x,p=h.y;else{m=c.data[2],p=c.data[3];const g=h.x,x=h.y;m=g+(g-m),p=x+(x-p)}return this.instructions.push({action:"bezierCurveTo",data:[m,p,t,n,a,o,u]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,n,a){const o=this.instructions[this.instructions.length-1],u=this.getLastPoint(ge.shared);let c=0,h=0;if(!o||o.action!=="quadraticCurveTo")c=u.x,h=u.y;else{c=o.data[0],h=o.data[1];const m=u.x,p=u.y;c=m+(m-c),h=p+(p-h)}return this.instructions.push({action:"quadraticCurveTo",data:[c,h,t,n,a]}),this._dirty=!0,this}rect(t,n,a,o,u){return this.instructions.push({action:"rect",data:[t,n,a,o,u]}),this._dirty=!0,this}circle(t,n,a,o){return this.instructions.push({action:"circle",data:[t,n,a,o]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,n,a,o,u,c,h){u||(u=o/2);const m=-1*Math.PI/2+c,p=a*2,g=Math.PI*2/p,x=[];for(let _=0;_<p;_++){const b=_%2?u:o,T=_*g+m;x.push(t+b*Math.cos(T),n+b*Math.sin(T))}return this.poly(x,!0,h),this}clone(t=!1){const n=new Vi;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let a=0;a<this.instructions.length;a++){const o=this.instructions[a];n.instructions.push({action:o.action,data:o.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const n=t.a,a=t.b,o=t.c,u=t.d,c=t.tx,h=t.ty;let m=0,p=0,g=0,x=0,_=0,b=0,T=0,w=0;for(let S=0;S<this.instructions.length;S++){const A=this.instructions[S],C=A.data;switch(A.action){case"moveTo":case"lineTo":m=C[0],p=C[1],C[0]=n*m+o*p+c,C[1]=a*m+u*p+h;break;case"bezierCurveTo":g=C[0],x=C[1],_=C[2],b=C[3],m=C[4],p=C[5],C[0]=n*g+o*x+c,C[1]=a*g+u*x+h,C[2]=n*_+o*b+c,C[3]=a*_+u*b+h,C[4]=n*m+o*p+c,C[5]=a*m+u*p+h;break;case"quadraticCurveTo":g=C[0],x=C[1],m=C[2],p=C[3],C[0]=n*g+o*x+c,C[1]=a*g+u*x+h,C[2]=n*m+o*p+c,C[3]=a*m+u*p+h;break;case"arcToSvg":m=C[5],p=C[6],T=C[0],w=C[1],C[0]=n*T+o*w,C[1]=a*T+u*w,C[5]=n*m+o*p+c,C[6]=a*m+u*p+h;break;case"circle":C[4]=Ka(C[3],t);break;case"rect":C[4]=Ka(C[4],t);break;case"ellipse":C[8]=Ka(C[8],t);break;case"roundRect":C[5]=Ka(C[5],t);break;case"addPath":C[0].transform(t);break;case"poly":C[2]=Ka(C[2],t);break;default:be("unknown transform action",A.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let n=this.instructions.length-1,a=this.instructions[n];if(!a)return t.x=0,t.y=0,t;for(;a.action==="closePath";){if(n--,n<0)return t.x=0,t.y=0,t;a=this.instructions[n]}switch(a.action){case"moveTo":case"lineTo":t.x=a.data[0],t.y=a.data[1];break;case"quadraticCurveTo":t.x=a.data[2],t.y=a.data[3];break;case"bezierCurveTo":t.x=a.data[4],t.y=a.data[5];break;case"arc":case"arcToSvg":t.x=a.data[5],t.y=a.data[6];break;case"addPath":a.data[0].getLastPoint(t);break}return t}}function Ka(l,t){return l?l.prepend(t):t.clone()}function Pt(l,t,n){const a=l.getAttribute(t);return a?Number(a):n}function p2(l,t){const n=l.querySelectorAll("defs");for(let a=0;a<n.length;a++){const o=n[a];for(let u=0;u<o.children.length;u++){const c=o.children[u];switch(c.nodeName.toLowerCase()){case"lineargradient":t.defs[c.id]=g2(c);break;case"radialgradient":t.defs[c.id]=y2();break}}}}function g2(l){const t=Pt(l,"x1",0),n=Pt(l,"y1",0),a=Pt(l,"x2",1),o=Pt(l,"y2",0),u=l.getAttribute("gradientUnits")||"objectBoundingBox",c=new Pi(t,n,a,o,u==="objectBoundingBox"?"local":"global");for(let h=0;h<l.children.length;h++){const m=l.children[h],p=Pt(m,"offset",0),g=se.shared.setValue(m.getAttribute("stop-color")).toNumber();c.addColorStop(p,g)}return c}function y2(l){return be("[SVG Parser] Radial gradients are not yet supported"),new Pi(0,0,1,0)}function Jg(l){const t=l.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const ty={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function B0(l,t){const n=l.getAttribute("style"),a={},o={},u={strokeStyle:a,fillStyle:o,useFill:!1,useStroke:!1};for(const c in ty){const h=l.getAttribute(c);h&&ey(t,u,c,h.trim())}if(n){const c=n.split(";");for(let h=0;h<c.length;h++){const m=c[h].trim(),[p,g]=m.split(":");ty[p]&&ey(t,u,p,g.trim())}}return{strokeStyle:u.useStroke?a:null,fillStyle:u.useFill?o:null,useFill:u.useFill,useStroke:u.useStroke}}function ey(l,t,n,a){switch(n){case"stroke":if(a!=="none"){if(a.startsWith("url(")){const o=Jg(a);t.strokeStyle.fill=l.defs[o]}else t.strokeStyle.color=se.shared.setValue(a).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(a);break;case"fill":if(a!=="none"){if(a.startsWith("url(")){const o=Jg(a);t.fillStyle.fill=l.defs[o]}else t.fillStyle.color=se.shared.setValue(a).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(a);break;case"stroke-opacity":t.strokeStyle.alpha=Number(a);break;case"opacity":t.fillStyle.alpha=Number(a),t.strokeStyle.alpha=Number(a);break}}function x2(l){if(l.length<=2)return!0;const t=l.map(h=>h.area).sort((h,m)=>m-h),[n,a]=t,o=t[t.length-1],u=n/a,c=a/o;return!(u>3&&c<2)}function _2(l){return l.split(/(?=[Mm])/).filter(a=>a.trim().length>0)}function b2(l){const t=l.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;const n=t.map(Number),a=[],o=[];for(let g=0;g<n.length;g+=2)g+1<n.length&&(a.push(n[g]),o.push(n[g+1]));if(a.length===0||o.length===0)return 0;const u=Math.min(...a),c=Math.max(...a),h=Math.min(...o),m=Math.max(...o);return(c-u)*(m-h)}function iy(l,t){const n=new Vi(l,!1);for(const a of n.instructions)t.instructions.push(a)}function v2(l,t){if(typeof l=="string"){const c=document.createElement("div");c.innerHTML=l.trim(),l=c.querySelector("svg")}const n={context:t,defs:{},path:new Vi};p2(l,n);const a=l.children,{fillStyle:o,strokeStyle:u}=B0(l,n);for(let c=0;c<a.length;c++){const h=a[c];h.nodeName.toLowerCase()!=="defs"&&O0(h,n,o,u)}return t}function O0(l,t,n,a){const o=l.children,{fillStyle:u,strokeStyle:c}=B0(l,t);u&&n?n={...n,...u}:u&&(n=u),c&&a?a={...a,...c}:c&&(a=c);const h=!n&&!a;h&&(n={color:0});let m,p,g,x,_,b,T,w,S,A,C,E,B,X,N,G,$;switch(l.nodeName.toLowerCase()){case"path":{X=l.getAttribute("d");const W=l.getAttribute("fill-rule"),Z=_2(X),I=W==="evenodd",tt=Z.length>1;if(I&&tt){const nt=Z.map(D=>({path:D,area:b2(D)}));if(nt.sort((D,L)=>L.area-D.area),Z.length>3||!x2(nt))for(let D=0;D<nt.length;D++){const L=nt[D],et=D===0;t.context.beginPath();const K=new Vi(void 0,!0);iy(L.path,K),t.context.path(K),et?(n&&t.context.fill(n),a&&t.context.stroke(a)):t.context.cut()}else for(let D=0;D<nt.length;D++){const L=nt[D],et=D%2===1;t.context.beginPath();const K=new Vi(void 0,!0);iy(L.path,K),t.context.path(K),et?t.context.cut():(n&&t.context.fill(n),a&&t.context.stroke(a))}}else{const nt=W?W==="evenodd":!0;N=new Vi(X,nt),t.context.path(N),n&&t.context.fill(n),a&&t.context.stroke(a)}break}case"circle":T=Pt(l,"cx",0),w=Pt(l,"cy",0),S=Pt(l,"r",0),t.context.ellipse(T,w,S,S),n&&t.context.fill(n),a&&t.context.stroke(a);break;case"rect":m=Pt(l,"x",0),p=Pt(l,"y",0),G=Pt(l,"width",0),$=Pt(l,"height",0),A=Pt(l,"rx",0),C=Pt(l,"ry",0),A||C?t.context.roundRect(m,p,G,$,A||C):t.context.rect(m,p,G,$),n&&t.context.fill(n),a&&t.context.stroke(a);break;case"ellipse":T=Pt(l,"cx",0),w=Pt(l,"cy",0),A=Pt(l,"rx",0),C=Pt(l,"ry",0),t.context.beginPath(),t.context.ellipse(T,w,A,C),n&&t.context.fill(n),a&&t.context.stroke(a);break;case"line":g=Pt(l,"x1",0),x=Pt(l,"y1",0),_=Pt(l,"x2",0),b=Pt(l,"y2",0),t.context.beginPath(),t.context.moveTo(g,x),t.context.lineTo(_,b),a&&t.context.stroke(a);break;case"polygon":B=l.getAttribute("points"),E=B.match(/-?\d+/g).map(W=>parseInt(W,10)),t.context.poly(E,!0),n&&t.context.fill(n),a&&t.context.stroke(a);break;case"polyline":B=l.getAttribute("points"),E=B.match(/-?\d+/g).map(W=>parseInt(W,10)),t.context.poly(E,!1),a&&t.context.stroke(a);break;case"g":case"svg":break;default:{be(`[SVG parser] <${l.nodeName}> elements unsupported`);break}}h&&(n=null);for(let W=0;W<o.length;W++)O0(o[W],t,n,a)}const ny={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class oo{constructor(t,n){this.uid=Qt("fillPattern"),this._tick=0,this.transform=new St,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),n&&(t.source.style.addressModeU=ny[n].addressModeU,t.source.style.addressModeV=ny[n].addressModeV)}setTransform(t){const n=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}function S2(l){return se.isColorLike(l)}function sy(l){return l instanceof oo}function ay(l){return l instanceof Pi}function T2(l){return l instanceof Gt}function A2(l,t,n){const a=se.shared.setValue(t??0);return l.color=a.toNumber(),l.alpha=a.alpha===1?n.alpha:a.alpha,l.texture=Gt.WHITE,{...n,...l}}function w2(l,t,n){return l.texture=t,{...n,...l}}function ly(l,t,n){return l.fill=t,l.color=16777215,l.texture=t.texture,l.matrix=t.transform,{...n,...l}}function ry(l,t,n){return t.buildGradient(),l.fill=t,l.color=16777215,l.texture=t.texture,l.matrix=t.transform,l.textureSpace=t.textureSpace,{...n,...l}}function C2(l,t){const n={...t,...l},a=se.shared.setValue(n.color);return n.alpha*=a.alpha,n.color=a.toNumber(),n}function Zn(l,t){if(l==null)return null;const n={},a=l;return S2(l)?A2(n,l,t):T2(l)?w2(n,l,t):sy(l)?ly(n,l,t):ay(l)?ry(n,l,t):a.fill&&sy(a.fill)?ly(a,a.fill,t):a.fill&&ay(a.fill)?ry(a,a.fill,t):C2(a,t)}function io(l,t){const{width:n,alignment:a,miterLimit:o,cap:u,join:c,pixelLine:h,...m}=t,p=Zn(l,m);return p?{width:n,alignment:a,miterLimit:o,cap:u,join:c,pixelLine:h,...p}:null}function M2(l,t){let n=1;const a=l.shapePath.shapePrimitives;for(let o=0;o<a.length;o++){const u=a[o].shape;if(u.type!=="polygon")continue;const c=u.points,h=c.length;if(h<6)continue;const m=u.closePath;for(let p=0;p<h;p+=2){if(!m&&(p===0||p===h-2))continue;const g=(p-2+h)%h,x=(p+2)%h,_=c[g],b=c[g+1],T=c[p],w=c[p+1],S=c[x],A=c[x+1],C=_-T,E=b-w,B=S-T,X=A-w,N=C*C+E*E,G=B*B+X*X;if(N<1e-12||G<1e-12)continue;let Z=(C*B+E*X)/Math.sqrt(N*G);Z<-1?Z=-1:Z>1&&(Z=1);const I=Math.sqrt((1-Z)*.5);if(I<1e-6)continue;const tt=Math.min(1/I,t);tt>n&&(n=tt)}}return n}const E2=new ge,oy=new St,Yh=class bi extends vi{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Qt("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new Vi,this._transform=new St,this._fillStyle={...bi.defaultFillStyle},this._strokeStyle={...bi.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new si,this._boundsDirty=!0}clone(){const t=new bi;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=Zn(t,bi.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=io(t,bi.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=Zn(t,bi.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=Zn(t,bi.defaultStrokeStyle),this}texture(t,n,a,o,u,c){return this.instructions.push({action:"texture",data:{image:t,dx:a||0,dy:o||0,dw:u||t.frame.width,dh:c||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:n||n===0?se.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Vi,this}fill(t,n){let a;const o=this.instructions[this.instructions.length-1];return this._tick===0&&(o==null?void 0:o.action)==="stroke"?a=o.data.path:a=this._activePath.clone(),a?(t!=null&&(n!==void 0&&typeof t=="number"&&(wt(Ft,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:n}),this._fillStyle=Zn(t,bi.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:a}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:n}=this._activePath.getLastPoint(ge.shared);this._activePath.clear(),this._activePath.moveTo(t,n)}stroke(t){let n;const a=this.instructions[this.instructions.length-1];return this._tick===0&&(a==null?void 0:a.action)==="fill"?n=a.data.path:n=this._activePath.clone(),n?(t!=null&&(this._strokeStyle=io(t,bi.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const n=this.instructions[this.instructions.length-1-t],a=this._activePath.clone();if(n&&(n.action==="stroke"||n.action==="fill"))if(n.data.hole)n.data.hole.addPath(a);else{n.data.hole=a;break}}return this._initNextPathLocation(),this}arc(t,n,a,o,u,c){this._tick++;const h=this._transform;return this._activePath.arc(h.a*t+h.c*n+h.tx,h.b*t+h.d*n+h.ty,a,o,u,c),this}arcTo(t,n,a,o,u){this._tick++;const c=this._transform;return this._activePath.arcTo(c.a*t+c.c*n+c.tx,c.b*t+c.d*n+c.ty,c.a*a+c.c*o+c.tx,c.b*a+c.d*o+c.ty,u),this}arcToSvg(t,n,a,o,u,c,h){this._tick++;const m=this._transform;return this._activePath.arcToSvg(t,n,a,o,u,m.a*c+m.c*h+m.tx,m.b*c+m.d*h+m.ty),this}bezierCurveTo(t,n,a,o,u,c,h){this._tick++;const m=this._transform;return this._activePath.bezierCurveTo(m.a*t+m.c*n+m.tx,m.b*t+m.d*n+m.ty,m.a*a+m.c*o+m.tx,m.b*a+m.d*o+m.ty,m.a*u+m.c*c+m.tx,m.b*u+m.d*c+m.ty,h),this}closePath(){var t;return this._tick++,(t=this._activePath)==null||t.closePath(),this}ellipse(t,n,a,o){return this._tick++,this._activePath.ellipse(t,n,a,o,this._transform.clone()),this}circle(t,n,a){return this._tick++,this._activePath.circle(t,n,a,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,n){this._tick++;const a=this._transform;return this._activePath.lineTo(a.a*t+a.c*n+a.tx,a.b*t+a.d*n+a.ty),this}moveTo(t,n){this._tick++;const a=this._transform,o=this._activePath.instructions,u=a.a*t+a.c*n+a.tx,c=a.b*t+a.d*n+a.ty;return o.length===1&&o[0].action==="moveTo"?(o[0].data[0]=u,o[0].data[1]=c,this):(this._activePath.moveTo(u,c),this)}quadraticCurveTo(t,n,a,o,u){this._tick++;const c=this._transform;return this._activePath.quadraticCurveTo(c.a*t+c.c*n+c.tx,c.b*t+c.d*n+c.ty,c.a*a+c.c*o+c.tx,c.b*a+c.d*o+c.ty,u),this}rect(t,n,a,o){return this._tick++,this._activePath.rect(t,n,a,o,this._transform.clone()),this}roundRect(t,n,a,o,u){return this._tick++,this._activePath.roundRect(t,n,a,o,u,this._transform.clone()),this}poly(t,n){return this._tick++,this._activePath.poly(t,n,this._transform.clone()),this}regularPoly(t,n,a,o,u=0,c){return this._tick++,this._activePath.regularPoly(t,n,a,o,u,c),this}roundPoly(t,n,a,o,u,c){return this._tick++,this._activePath.roundPoly(t,n,a,o,u,c),this}roundShape(t,n,a,o){return this._tick++,this._activePath.roundShape(t,n,a,o),this}filletRect(t,n,a,o,u){return this._tick++,this._activePath.filletRect(t,n,a,o,u),this}chamferRect(t,n,a,o,u,c){return this._tick++,this._activePath.chamferRect(t,n,a,o,u,c),this}star(t,n,a,o,u=0,c=0){return this._tick++,this._activePath.star(t,n,a,o,u,c,this._transform.clone()),this}svg(t){return this._tick++,v2(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,n=t){return this._transform.scale(t,n),this}setTransform(t,n,a,o,u,c){return t instanceof St?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,n,a,o,u,c),this)}transform(t,n,a,o,u,c){return t instanceof St?(this._transform.append(t),this):(oy.set(t,n,a,o,u,c),this._transform.append(oy),this)}translate(t,n=t){return this._transform.translate(t,n),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let n=0;n<this.instructions.length;n++){const a=this.instructions[n],o=a.action;if(o==="fill"){const u=a.data;t.addBounds(u.path.bounds)}else if(o==="texture"){const u=a.data;t.addFrame(u.dx,u.dy,u.dx+u.dw,u.dy+u.dh,u.transform)}if(o==="stroke"){const u=a.data,c=u.style.alignment;let h=u.style.width*(1-c);u.style.join==="miter"&&(h*=M2(u.path,u.style.miterLimit));const m=u.path.bounds;t.addFrame(m.minX-h,m.minY-h,m.maxX+h,m.maxY+h)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){var o;if(!this.bounds.containsPoint(t.x,t.y))return!1;const n=this.instructions;let a=!1;for(let u=0;u<n.length;u++){const c=n[u],h=c.data,m=h.path;if(!c.action||!m)continue;const p=h.style,g=m.shapePath.shapePrimitives;for(let x=0;x<g.length;x++){const _=g[x].shape;if(!p||!_)continue;const b=g[x].transform,T=b?b.applyInverse(t,E2):t;if(c.action==="fill")a=_.contains(T.x,T.y);else{const S=p;a=_.strokeContains(T.x,T.y,S.width,S.alignment)}const w=h.hole;if(w){const S=(o=w.shapePath)==null?void 0:o.shapePrimitives;if(S)for(let A=0;A<S.length;A++)S[A].shape.contains(T.x,T.y)&&(a=!1)}if(a)return!0}}return a}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const a=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(a)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(a))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Yh.defaultFillStyle={color:16777215,alpha:1,texture:Gt.WHITE,matrix:null,fill:null,textureSpace:"local"};Yh.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Gt.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let di=Yh;class R2{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class z2{constructor(){this.instructions=new zh}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const qh=class Sh{constructor(t){this._renderer=t,this._managedContexts=new ml({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Sh.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??Sh.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=t._gpuData,a=!!n[this._renderer.uid],o=n[this._renderer.uid]||this._initContext(t);return(t.dirty||!a)&&(a&&o.reset(),o.isBatchable=!1,t.dirty=!1),o}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=new z2,a=this.getGpuContext(t);return a.graphicsData=n,n.init(),n}_initContext(t){const n=new R2;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};qh.extension={type:[yt.CanvasSystem],name:"graphicsContext"};qh.defaultOptions={bezierSmoothness:.5};let D2=qh;class N0{constructor(t,n){this.state=s0.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new ml({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,n){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(n),n.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}N0.extension={type:[yt.CanvasPipes],name:"graphics"};function B2(l,t,n){const a=(l>>24&255)/255;t[n++]=(l&255)/255*a,t[n++]=(l>>8&255)/255*a,t[n++]=(l>>16&255)/255*a,t[n++]=a}class O2{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{Re.return(t)}),this.batches.length=0}}class G0{constructor(t,n){this.state=s0.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new ml({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const n=t.context,a=!!t._gpuData,u=this.renderer.graphicsContext.updateGpuContext(n);return!!(u.isBatchable||a!==u.isBatchable)}addRenderable(t,n){const o=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),o.isBatchable?this._addToBatcher(t,n):(this.renderer.renderPipes.batch.break(n),n.add(t))}updateRenderable(t){const a=this._getGpuDataForRenderable(t).batches;for(let o=0;o<a.length;o++){const u=a[o];u._batcher.updateElement(u)}}execute(t){if(!t.isRenderable)return;const n=this.renderer,a=t.context;if(!n.graphicsContext.getGpuContext(a).batches.length)return;const u=a.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const c=u.resources.localUniforms.uniforms;c.uTransformMatrix=t.groupTransform,c.uRound=n._roundPixels|t._roundPixels,B2(t.groupColorAlpha,c.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const n=this._getGpuDataForRenderable(t),o=this.renderer.graphicsContext.updateGpuContext(t.context);n.destroy(),o.isBatchable&&this._updateBatchesForRenderable(t,n)}_addToBatcher(t,n){const a=this.renderer.renderPipes.batch,o=this._getGpuDataForRenderable(t).batches;for(let u=0;u<o.length;u++){const c=o[u];a.addToBatch(c,n)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const n=new O2;return t._gpuData[this.renderer.uid]=n,this._managedGraphics.add(t),n}_updateBatchesForRenderable(t,n){const a=t.context,u=this.renderer.graphicsContext.getGpuContext(a),c=this.renderer._roundPixels|t._roundPixels;n.batches=u.batches.map(h=>{const m=Re.get(Uh);return h.copyTo(m),m.renderable=t,m.roundPixels=c,m})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}G0.extension={type:[yt.WebGLPipes,yt.WebGPUPipes],name:"graphics"};Kt.add(N0);Kt.add(G0);Kt.add(D2);Kt.add(jh);class qe extends Dh{constructor(t){t instanceof di&&(t={context:t});const{context:n,roundPixels:a,...o}=t||{};super({label:"Graphics",...o}),this.renderPipeId="graphics",n?this.context=n:(this.context=this._ownedContext=new di,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=a??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||(t==null?void 0:t.context)===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,n){return this.context[t](...n),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new qe(this._context.clone()):(this._ownedContext=null,new qe(this._context))}lineStyle(t,n,a){wt(Ft,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const o={};return t&&(o.width=t),n&&(o.color=n),a&&(o.alpha=a),this.context.strokeStyle=o,this}beginFill(t,n){wt(Ft,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const a={};return t!==void 0&&(a.color=t),n!==void 0&&(a.alpha=n),this.context.fillStyle=a,this}endFill(){wt(Ft,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==di.defaultStrokeStyle.width||t.color!==di.defaultStrokeStyle.color||t.alpha!==di.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return wt(Ft,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return wt(Ft,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return wt(Ft,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return wt(Ft,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return wt(Ft,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return wt(Ft,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}class N2 extends Dh{constructor(t,n){const{text:a,resolution:o,style:u,anchor:c,width:h,height:m,roundPixels:p,...g}=t;super({...g}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=n,this.text=a??"",this.style=u,this.resolution=o??null,this.allowChildren=!1,this._anchor=new de({_onUpdate:()=>{this.onViewUpdate()}}),c&&(this.anchor=c),this.roundPixels=p??!1,h!==void 0&&(this.width=h),m!==void 0&&(this.height=m)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=t===null,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){var n;t||(t={}),(n=this._style)==null||n.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,n){typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,this.bounds.width),n!==void 0&&this._setHeight(n,this.bounds.height)}containsPoint(t){const n=this.bounds.width,a=this.bounds.height,o=-n*this.anchor.x;let u=0;return t.x>=o&&t.x<=o+n&&(u=-a*this.anchor.y,t.y>=u&&t.y<=u+a)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,(typeof t=="boolean"?t:t!=null&&t.style)&&this._style.destroy(t),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}function G2(l,t){let n=l[0]??{};return(typeof n=="string"||l[1])&&(wt(Ft,`use new ${t}({ text: "hi!", style }) instead`),n={text:n,style:l[1]}),n}class k2{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,n){const a=Ve.get().createCanvas();a.width=t,a.height=n;const o=a.getContext("2d");return{canvas:a,context:o}}getOptimalCanvasAndContext(t,n,a=1){t=Math.ceil(t*a-1e-6),n=Math.ceil(n*a-1e-6),t=Fs(t),n=Fs(n);const o=(t<<17)+(n<<1);this._canvasPool[o]||(this._canvasPool[o]=[]);let u=this._canvasPool[o].pop();return u||(u=this._createCanvasAndContext(t,n)),u}returnCanvasAndContext(t){const n=t.canvas,{width:a,height:o}=n,u=(a<<17)+(o<<1);t.context.resetTransform(),t.context.clearRect(0,0,a,o),this._canvasPool[u].push(t)}clear(){this._canvasPool={}}}const Th=new k2;dl.register(Th);let qn=null,qi=null;function U2(l,t){qn||(qn=Ve.get().createCanvas(256,128),qi=qn.getContext("2d",{willReadFrequently:!0}),qi.globalCompositeOperation="copy",qi.globalAlpha=1),(qn.width<l||qn.height<t)&&(qn.width=Fs(l),qn.height=Fs(t))}function uy(l,t,n){for(let a=0,o=4*n*t;a<t;++a,o+=4)if(l[o+3]!==0)return!1;return!0}function cy(l,t,n,a,o){const u=4*t;for(let c=a,h=a*u+4*n;c<=o;++c,h+=u)if(l[h+3]!==0)return!1;return!0}function H2(...l){let t=l[0];t.canvas||(t={canvas:l[0],resolution:l[1]});const{canvas:n}=t,a=Math.min(t.resolution??1,1),o=t.width??n.width,u=t.height??n.height;let c=t.output;if(U2(o,u),!qi)throw new TypeError("Failed to get canvas 2D context");qi.drawImage(n,0,0,o,u,0,0,o*a,u*a);const m=qi.getImageData(0,0,o,u).data;let p=0,g=0,x=o-1,_=u-1;for(;g<u&&uy(m,o,g);)++g;if(g===u)return It.EMPTY;for(;uy(m,o,_);)--_;for(;cy(m,o,p,g,_);)++p;for(;cy(m,o,x,g,_);)--x;return++x,++_,qi.globalCompositeOperation="source-over",qi.strokeRect(p,g,x-p,_-g),qi.globalCompositeOperation="copy",c??(c=new It),c.set(p/a,g/a,(x-p)/a,(_-g)/a),c}/**
|
|
288
|
+
* tiny-lru
|
|
289
|
+
*
|
|
290
|
+
* @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
|
|
291
|
+
* @license BSD-3-Clause
|
|
292
|
+
* @version 11.4.7
|
|
293
|
+
*/class L2{constructor(t=0,n=0,a=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=a,this.size=0,this.ttl=n}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const n=this.items[t];delete this.items[t],this.size--,n.prev!==null&&(n.prev.next=n.next),n.next!==null&&(n.next.prev=n.prev),this.first===n&&(this.first=n.next),this.last===n&&(this.last=n.prev)}return this}entries(t=this.keys()){const n=new Array(t.length);for(let a=0;a<t.length;a++){const o=t[a];n[a]=[o,this.get(o)]}return n}evict(t=!1){if(t||this.size>0){const n=this.first;delete this.items[n.key],--this.size===0?(this.first=null,this.last=null):(this.first=n.next,this.first.prev=null)}return this}expiresAt(t){let n;return this.has(t)&&(n=this.items[t].expiry),n}get(t){const n=this.items[t];if(n!==void 0){if(this.ttl>0&&n.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(n),n.value}}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,this.last!==null&&(this.last.next=t),this.last=t,this.first===null&&(this.first=t))}keys(){const t=new Array(this.size);let n=this.first,a=0;for(;n!==null;)t[a++]=n.key,n=n.next;return t}setWithEvicted(t,n,a=this.resetTtl){let o=null;if(this.has(t))this.set(t,n,!0,a);else{this.max>0&&this.size===this.max&&(o={...this.first},this.evict(!0));let u=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:n};++this.size===1?this.first=u:this.last.next=u,this.last=u}return o}set(t,n,a=!1,o=this.resetTtl){let u=this.items[t];return a||u!==void 0?(u.value=n,a===!1&&o&&(u.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(u)):(this.max>0&&this.size===this.max&&this.evict(!0),u=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:n},++this.size===1?this.first=u:this.last.next=u,this.last=u),this}values(t=this.keys()){const n=new Array(t.length);for(let a=0;a<t.length;a++)n[a]=this.get(t[a]);return n}}function j2(l=1e3,t=0,n=!1){if(isNaN(l)||l<0)throw new TypeError("Invalid max value");if(isNaN(t)||t<0)throw new TypeError("Invalid ttl value");if(typeof n!="boolean")throw new TypeError("Invalid resetTtl value");return new L2(l,t,n)}function k0(l){return!!l.tagStyles&&Object.keys(l.tagStyles).length>0}function U0(l){return l.includes("<")}function Y2(l,t){return l.clone().assign(t)}function q2(l,t){const n=[],a=t.tagStyles;if(!k0(t)||!U0(l))return n.push({text:l,style:t}),n;const o=[t],u=[];let c="",h=0;for(;h<l.length;){const m=l[h];if(m==="<"){const p=l.indexOf(">",h);if(p===-1){c+=m,h++;continue}const g=l.slice(h+1,p);if(g.startsWith("/")){const x=g.slice(1).trim();if(u.length>0&&u[u.length-1]===x){c.length>0&&(n.push({text:c,style:o[o.length-1]}),c=""),o.pop(),u.pop(),h=p+1;continue}else{c+=l.slice(h,p+1),h=p+1;continue}}else{const x=g.trim();if(a[x]){c.length>0&&(n.push({text:c,style:o[o.length-1]}),c="");const _=o[o.length-1],b=Y2(_,a[x]);o.push(b),u.push(x),h=p+1;continue}else{c+=l.slice(h,p+1),h=p+1;continue}}}else c+=m,h++}return c.length>0&&n.push({text:c,style:o[o.length-1]}),n}const X2=[10,13],V2=new Set(X2),P2=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],F2=new Set(P2),Q2=[9,32];new Set(Q2);const W2=[45,8208,8211,8212,173],Z2=new Set(W2),I2=/(\r\n|\r|\n)/,K2=/(?:\r\n|\r|\n)/;function no(l){return typeof l!="string"?!1:V2.has(l.charCodeAt(0))}function ni(l,t){return typeof l!="string"?!1:F2.has(l.charCodeAt(0))}function $2(l){return typeof l!="string"?!1:Z2.has(l.charCodeAt(0))}function H0(l){return l==="normal"||l==="pre-line"}function L0(l){return l==="normal"}function Yi(l){if(typeof l!="string")return"";let t=l.length-1;for(;t>=0&&ni(l[t]);)t--;return t<l.length-1?l.slice(0,t+1):l}function j0(l){const t=[],n=[];if(typeof l!="string")return t;for(let a=0;a<l.length;a++){const o=l[a],u=l[a+1];if(ni(o)||no(o)){n.length>0&&(t.push(n.join("")),n.length=0),o==="\r"&&u===`
|
|
294
|
+
`?(t.push(`\r
|
|
295
|
+
`),a++):t.push(o);continue}n.push(o),$2(o)&&u&&!ni(u)&&!no(u)&&(t.push(n.join("")),n.length=0)}return n.length>0&&t.push(n.join("")),t}function Y0(l,t,n,a){const o=n(l),u=[];for(let c=0;c<o.length;c++){let h=o[c],m=h,p=1;for(;o[c+p];){const g=o[c+p];if(!a(m,g,l,c,t))h+=g,m=g,p++;else break}c+=p-1,u.push(h)}return u}const J2=/\r\n|\r|\n/g;function tT(l,t,n,a,o,u,c,h){var At,D;const m=q2(l,t);if(L0(t.whiteSpace))for(let L=0;L<m.length;L++){const et=m[L];m[L]={text:et.text.replace(J2," "),style:et.style}}const g=[];let x=[];for(const L of m){const et=L.text.split(I2);for(let K=0;K<et.length;K++){const at=et[K];at===`\r
|
|
296
|
+
`||at==="\r"||at===`
|
|
297
|
+
`?(g.push(x),x=[]):at.length>0&&x.push({text:at,style:L.style})}}(x.length>0||g.length===0)&&g.push(x);const _=n?eT(g,t,a,o,c,h):g,b=[],T=[],w=[],S=[],A=[];let C=0;const E=t._fontString,B=u(E);B.fontSize===0&&(B.fontSize=t.fontSize,B.ascent=t.fontSize);let X="",N=!!t.dropShadow,G=((At=t._stroke)==null?void 0:At.width)||0;for(const L of _){let et=0,K=B.ascent,at=B.descent,R="";for(const Q of L){const J=Q.style._fontString,rt=u(J);J!==X&&(a.font=J,X=J);const ct=o(Q.text,Q.style.letterSpacing,a);et+=ct,K=Math.max(K,rt.ascent),at=Math.max(at,rt.descent),R+=Q.text;const ft=((D=Q.style._stroke)==null?void 0:D.width)||0;ft>G&&(G=ft),!N&&Q.style.dropShadow&&(N=!0)}L.length===0&&(K=B.ascent,at=B.descent),b.push(et),T.push(K),w.push(at),A.push(R);const Y=t.lineHeight||K+at;S.push(Y+t.leading),C=Math.max(C,et)}const $=G,I=(n&&t.align!=="left"?Math.max(C,t.wordWrapWidth):C)+$+(t.dropShadow?t.dropShadow.distance:0);let tt=0;for(let L=0;L<S.length;L++)tt+=S[L];tt=Math.max(tt,S[0]+$);const it=tt+(t.dropShadow?t.dropShadow.distance:0),nt=t.lineHeight||B.fontSize;return{width:I,height:it,lines:A,lineWidths:b,lineHeight:nt+t.leading,maxLineWidth:C,fontProperties:B,runsByLine:_,lineAscents:T,lineDescents:w,lineHeights:S,hasDropShadow:N}}function eT(l,t,n,a,o,u){var S;const{letterSpacing:c,whiteSpace:h,wordWrapWidth:m,breakWords:p}=t,g=H0(h),x=m+c,_={};let b="";const T=(A,C)=>{const E=`${A}|${C.styleKey}`;let B=_[E];if(B===void 0){const X=C._fontString;X!==b&&(n.font=X,b=X),B=a(A,C.letterSpacing,n)+C.letterSpacing,_[E]=B}return B},w=[];for(const A of l){const C=iT(A),E=w.length,B=tt=>{let it=0,nt=tt;do{const{token:At,style:D}=C[nt];it+=T(At,D),nt++}while(nt<C.length&&C[nt].continuesFromPrevious);return it},X=tt=>{const it=[];let nt=tt;do it.push({token:C[nt].token,style:C[nt].style}),nt++;while(nt<C.length&&C[nt].continuesFromPrevious);return it};let N=[],G=0,$=!g,W=null;const Z=()=>{W&&W.text.length>0&&N.push(W),W=null},I=()=>{if(Z(),N.length>0){const tt=N[N.length-1];tt.text=Yi(tt.text),tt.text.length===0&&N.pop()}w.push(N),N=[],G=0,$=!1};for(let tt=0;tt<C.length;tt++){const{token:it,style:nt,continuesFromPrevious:At}=C[tt],D=T(it,nt);if(g){const K=ni(it),at=(W==null?void 0:W.text[W.text.length-1])??((S=N[N.length-1])==null?void 0:S.text.slice(-1))??"",R=at?ni(at):!1;if(K&&R)continue}const L=!At,et=L?B(tt):D;if(et>x&&L)if(G>0&&I(),p){const K=X(tt);for(let at=0;at<K.length;at++){const R=K[at].token,Y=K[at].style,Q=Y0(R,p,u,o);for(const J of Q){const rt=T(J,Y);rt+G>x&&I(),!W||W.style!==Y?(Z(),W={text:J,style:Y}):W.text+=J,G+=rt}}tt+=K.length-1}else{const K=X(tt);Z(),w.push(K.map(at=>({text:at.token,style:at.style}))),$=!1,tt+=K.length-1}else if(et+G>x&&L){if(ni(it)){$=!1;continue}I(),W={text:it,style:nt},G=D}else if(At&&!p)!W||W.style!==nt?(Z(),W={text:it,style:nt}):W.text+=it,G+=D;else{const K=ni(it);if(G===0&&K&&!$)continue;!W||W.style!==nt?(Z(),W={text:it,style:nt}):W.text+=it,G+=D}}if(Z(),N.length>0){const tt=N[N.length-1];tt.text=Yi(tt.text),tt.text.length===0&&N.pop()}(N.length>0||w.length===E)&&w.push(N)}return w}function iT(l){const t=[];let n=!1;for(const a of l){const o=j0(a.text);let u=!0;for(const c of o){const h=ni(c)||no(c),m=u&&n&&!h;t.push({token:c,style:a.style,continuesFromPrevious:m}),n=!h,u=!1}}return t}const nT={willReadFrequently:!0};function hy(l,t,n,a,o){let u=n[l];return typeof u!="number"&&(u=o(l,t,a)+t,n[l]=u),u}function sT(l,t,n,a,o,u,c){const h=n.getContext("2d",nT);h.font=t._fontString;let m=0,p="";const g=[],x=Object.create(null),{letterSpacing:_,whiteSpace:b}=t,T=H0(b),w=L0(b);let S=!T;const A=t.wordWrapWidth+_,C=j0(l);for(let B=0;B<C.length;B++){let X=C[B];if(no(X)){if(!w){g.push(Yi(p)),S=!T,p="",m=0;continue}X=" "}if(T){const G=ni(X),$=ni(p[p.length-1]);if(G&&$)continue}const N=hy(X,_,x,h,a);if(N>A)if(p!==""&&(g.push(Yi(p)),p="",m=0),o(X,t.breakWords)){const G=Y0(X,t.breakWords,c,u);for(const $ of G){const W=hy($,_,x,h,a);W+m>A&&(g.push(Yi(p)),S=!1,p="",m=0),p+=$,m+=W}}else p.length>0&&(g.push(Yi(p)),p="",m=0),g.push(Yi(X)),S=!1,p="",m=0;else N+m>A&&(S=!1,g.push(Yi(p)),p="",m=0),(p.length>0||!ni(X)||S)&&(p+=X,m+=N)}const E=Yi(p);return E.length>0&&g.push(E),g.join(`
|
|
298
|
+
`)}const fy={willReadFrequently:!0},Fi=class ht{static get experimentalLetterSpacingSupported(){let t=ht._experimentalLetterSpacingSupported;if(t===void 0){const n=Ve.get().getCanvasRenderingContext2D().prototype;t=ht._experimentalLetterSpacingSupported="letterSpacing"in n||"textLetterSpacing"in n}return t}constructor(t,n,a,o,u,c,h,m,p,g){this.text=t,this.style=n,this.width=a,this.height=o,this.lines=u,this.lineWidths=c,this.lineHeight=h,this.maxLineWidth=m,this.fontProperties=p,g&&(this.runsByLine=g.runsByLine,this.lineAscents=g.lineAscents,this.lineDescents=g.lineDescents,this.lineHeights=g.lineHeights,this.hasDropShadow=g.hasDropShadow)}static measureText(t=" ",n,a=ht._canvas,o=n.wordWrap){var X;const u=`${t}-${n.styleKey}-wordWrap-${o}`;if(ht._measurementCache.has(u))return ht._measurementCache.get(u);if(k0(n)&&U0(t)){const N=tT(t,n,o,ht._context,ht._measureText,ht.measureFont,ht.canBreakChars,ht.wordWrapSplit),G=new ht(t,n,N.width,N.height,N.lines,N.lineWidths,N.lineHeight,N.maxLineWidth,N.fontProperties,{runsByLine:N.runsByLine,lineAscents:N.lineAscents,lineDescents:N.lineDescents,lineHeights:N.lineHeights,hasDropShadow:N.hasDropShadow});return ht._measurementCache.set(u,G),G}const h=n._fontString,m=ht.measureFont(h);m.fontSize===0&&(m.fontSize=n.fontSize,m.ascent=n.fontSize,m.descent=0);const p=ht._context;p.font=h;const x=(o?ht._wordWrap(t,n,a):t).split(K2),_=new Array(x.length);let b=0;for(let N=0;N<x.length;N++){const G=ht._measureText(x[N],n.letterSpacing,p);_[N]=G,b=Math.max(b,G)}const T=((X=n._stroke)==null?void 0:X.width)??0,w=n.lineHeight||m.fontSize,S=ht._getAlignWidth(b,n,o),A=ht._adjustWidthForStyle(S,n),C=Math.max(w,m.fontSize+T)+(x.length-1)*(w+n.leading),E=ht._adjustHeightForStyle(C,n),B=new ht(t,n,A,E,x,_,w+n.leading,b,m);return ht._measurementCache.set(u,B),B}static _adjustWidthForStyle(t,n){var u;const a=((u=n._stroke)==null?void 0:u.width)||0;let o=t+a;return n.dropShadow&&(o+=n.dropShadow.distance),o}static _adjustHeightForStyle(t,n){let a=t;return n.dropShadow&&(a+=n.dropShadow.distance),a}static _getAlignWidth(t,n,a){return a&&n.align!=="left"?Math.max(t,n.wordWrapWidth):t}static _measureText(t,n,a){let o=!1;ht.experimentalLetterSpacingSupported&&(ht.experimentalLetterSpacing?(a.letterSpacing=`${n}px`,a.textLetterSpacing=`${n}px`,o=!0):(a.letterSpacing="0px",a.textLetterSpacing="0px"));const u=a.measureText(t);let c=u.width;const h=-(u.actualBoundingBoxLeft??0);let p=(u.actualBoundingBoxRight??0)-h;if(c>0)if(o)c-=n,p-=n;else{const g=(ht.graphemeSegmenter(t).length-1)*n;c+=g,p+=g}return Math.max(c,p)}static _wordWrap(t,n,a=ht._canvas){return sT(t,n,a,ht._measureText,ht.canBreakWords,ht.canBreakChars,ht.wordWrapSplit)}static isBreakingSpace(t,n){return ni(t)}static canBreakWords(t,n){return n}static canBreakChars(t,n,a,o,u){return!0}static wordWrapSplit(t){return ht.graphemeSegmenter(t)}static measureFont(t){if(ht._fonts[t])return ht._fonts[t];const n=ht._context;n.font=t;const a=n.measureText(ht.METRICS_STRING+ht.BASELINE_SYMBOL),o=a.actualBoundingBoxAscent??0,u=a.actualBoundingBoxDescent??0,c={ascent:o,descent:u,fontSize:o+u};return ht._fonts[t]=c,c}static clearMetrics(t=""){t?delete ht._fonts[t]:ht._fonts={}}static get _canvas(){if(!ht.__canvas){let t;try{const n=new OffscreenCanvas(0,0),a=n.getContext("2d",fy);if(a!=null&&a.measureText)return ht.__canvas=n,n;t=Ve.get().createCanvas()}catch{t=Ve.get().createCanvas()}t.width=t.height=10,ht.__canvas=t}return ht.__canvas}static get _context(){return ht.__context||(ht.__context=ht._canvas.getContext("2d",fy)),ht.__context}};Fi.METRICS_STRING="|ÉqÅ";Fi.BASELINE_SYMBOL="M";Fi.BASELINE_MULTIPLIER=1.4;Fi.HEIGHT_MULTIPLIER=2;Fi.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const l=new Intl.Segmenter;return t=>{const n=l.segment(t),a=[];let o=0;for(const u of n)a[o++]=u.segment;return a}}return l=>[...l]})();Fi.experimentalLetterSpacing=!1;Fi._fonts={};Fi._measurementCache=j2(1e3);let bn=Fi;const aT=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function Ah(l){const t=typeof l.fontSize=="number"?`${l.fontSize}px`:l.fontSize;let n=l.fontFamily;Array.isArray(l.fontFamily)||(n=l.fontFamily.split(","));for(let a=n.length-1;a>=0;a--){let o=n[a].trim();!/([\"\'])[^\'\"]+\1/.test(o)&&!aT.includes(o)&&(o=`"${o}"`),n[a]=o}return`${l.fontStyle} ${l.fontVariant} ${l.fontWeight} ${t} ${n.join(",")}`}const dy=1e5;function Zr(l,t,n,a=0,o=0,u=0){if(l.texture===Gt.WHITE&&!l.fill)return se.shared.setValue(l.color).setAlpha(l.alpha??1).toHexa();if(l.fill){if(l.fill instanceof oo){const c=l.fill,h=t.createPattern(c.texture.source.resource,"repeat"),m=c.transform.copyTo(St.shared);return m.scale(c.texture.source.pixelWidth,c.texture.source.pixelHeight),h.setTransform(m),h}else if(l.fill instanceof Pi){const c=l.fill,h=c.type==="linear",m=c.textureSpace==="local";let p=1,g=1;m&&n&&(p=n.width+a,g=n.height+a);let x,_=!1;if(h){const{start:b,end:T}=c;x=t.createLinearGradient(b.x*p+o,b.y*g+u,T.x*p+o,T.y*g+u),_=Math.abs(T.x-b.x)<Math.abs((T.y-b.y)*.1)}else{const{center:b,innerRadius:T,outerCenter:w,outerRadius:S}=c;x=t.createRadialGradient(b.x*p+o,b.y*g+u,T*p,w.x*p+o,w.y*g+u,S*p)}if(_&&m&&n){const b=n.lineHeight/g;for(let T=0;T<n.lines.length;T++){const w=(T*n.lineHeight+a/2)/g;c.colorStops.forEach(S=>{let A=w+S.offset*b;A=Math.max(0,Math.min(1,A)),x.addColorStop(Math.floor(A*dy)/dy,se.shared.setValue(S.color).toHex())})}}else c.colorStops.forEach(b=>{x.addColorStop(b.offset,se.shared.setValue(b.color).toHex())});return x}}else{const c=t.createPattern(l.texture.source.resource,"repeat"),h=l.matrix.copyTo(St.shared);return h.scale(l.texture.source.pixelWidth,l.texture.source.pixelHeight),c.setTransform(h),c}return be("FillStyle not recognised",l),"red"}const my=new It;function Hs(l){let t=0;for(let n=0;n<l.length;n++)l.charCodeAt(n)===32&&t++;return t}class lT{getCanvasAndContext(t){const{text:n,style:a,resolution:o=1}=t,u=a._getFinalPadding(),c=bn.measureText(n||" ",a),h=Math.ceil(Math.ceil(Math.max(1,c.width)+u*2)*o),m=Math.ceil(Math.ceil(Math.max(1,c.height)+u*2)*o),p=Th.getOptimalCanvasAndContext(h,m);this._renderTextToCanvas(a,u,o,p,c);const g=a.trim?H2({canvas:p.canvas,width:h,height:m,resolution:1,output:my}):my.set(0,0,h,m);return{canvasAndContext:p,frame:g}}returnCanvasAndContext(t){Th.returnCanvasAndContext(t)}_renderTextToCanvas(t,n,a,o,u){var N,G,$;if(u.runsByLine&&u.runsByLine.length>0){this._renderTaggedTextToCanvas(u,t,n,a,o);return}const{canvas:c,context:h}=o,m=Ah(t),p=u.lines,g=u.lineHeight,x=u.lineWidths,_=u.maxLineWidth,b=u.fontProperties,T=c.height;if(h.resetTransform(),h.scale(a,a),h.textBaseline=t.textBaseline,(N=t._stroke)!=null&&N.width){const W=t._stroke;h.lineWidth=W.width,h.miterLimit=W.miterLimit,h.lineJoin=W.join,h.lineCap=W.cap}h.font=m;let w,S;const A=t.dropShadow?2:1,C=t.wordWrap?Math.max(t.wordWrapWidth,_):_,B=(((G=t._stroke)==null?void 0:G.width)??0)/2;let X=(g-b.fontSize)/2;g-b.fontSize<0&&(X=0);for(let W=0;W<A;++W){const Z=t.dropShadow&&W===0,I=Z?Math.ceil(Math.max(1,T)+n*2):0,tt=I*a;if(Z)this._setupDropShadow(h,t,a,tt);else{const it=t._gradientBounds,nt=t._gradientOffset;if(it){const At={width:it.width,height:it.height,lineHeight:it.height,lines:u.lines};this._setFillAndStrokeStyles(h,t,At,n,B,(nt==null?void 0:nt.x)??0,(nt==null?void 0:nt.y)??0)}else nt?this._setFillAndStrokeStyles(h,t,u,n,B,nt.x,nt.y):this._setFillAndStrokeStyles(h,t,u,n,B);h.shadowColor="rgba(0,0,0,0)"}for(let it=0;it<p.length;it++){w=B,S=B+it*g+b.ascent+X,w+=this._getAlignmentOffset(x[it],C,t.align);let nt=0;if(t.align==="justify"&&t.wordWrap&&it<p.length-1){const At=Hs(p[it]);At>0&&(nt=(C-x[it])/At)}($=t._stroke)!=null&&$.width&&this._drawLetterSpacing(p[it],t,o,w+n,S+n-I,!0,nt),t._fill!==void 0&&this._drawLetterSpacing(p[it],t,o,w+n,S+n-I,!1,nt)}}}_renderTaggedTextToCanvas(t,n,a,o,u){var B,X,N;const{canvas:c,context:h}=u,{runsByLine:m,lineWidths:p,maxLineWidth:g,lineAscents:x,lineHeights:_,hasDropShadow:b}=t,T=c.height;h.resetTransform(),h.scale(o,o),h.textBaseline=n.textBaseline;const w=b?2:1,S=n.wordWrap?Math.max(n.wordWrapWidth,g):g;let A=((B=n._stroke)==null?void 0:B.width)??0;for(const G of m)for(const $ of G){const W=((X=$.style._stroke)==null?void 0:X.width)??0;W>A&&(A=W)}const C=A/2,E=[];for(let G=0;G<m.length;G++){const $=m[G],W=[];for(const Z of $){const I=Ah(Z.style);h.font=I,W.push({width:bn._measureText(Z.text,Z.style.letterSpacing,h),font:I})}E.push(W)}for(let G=0;G<w;++G){const $=b&&G===0,W=$?Math.ceil(Math.max(1,T)+a*2):0,Z=W*o;$||(h.shadowColor="rgba(0,0,0,0)");let I=C;for(let tt=0;tt<m.length;tt++){const it=m[tt],nt=p[tt],At=x[tt],D=_[tt],L=E[tt];let et=C;et+=this._getAlignmentOffset(nt,S,n.align);let K=0;if(n.align==="justify"&&n.wordWrap&&tt<m.length-1){let Y=0;for(const Q of it)Y+=Hs(Q.text);Y>0&&(K=(S-nt)/Y)}const at=I+At;let R=et+a;for(let Y=0;Y<it.length;Y++){const Q=it[Y],{width:J,font:rt}=L[Y];if(h.font=rt,h.textBaseline=Q.style.textBaseline,(N=Q.style._stroke)!=null&&N.width){const ft=Q.style._stroke;if(h.lineWidth=ft.width,h.miterLimit=ft.miterLimit,h.lineJoin=ft.join,h.lineCap=ft.cap,$)if(Q.style.dropShadow)this._setupDropShadow(h,Q.style,o,Z);else{const Ht=Hs(Q.text);R+=J+Ht*K;continue}else{const Ht=bn.measureFont(rt),Et=Q.style.lineHeight||Ht.fontSize,Pe={width:J,height:Et,lineHeight:Et,lines:[Q.text]};h.strokeStyle=Zr(ft,h,Pe,a*2,R-a,I)}this._drawLetterSpacing(Q.text,Q.style,u,R,at+a-W,!0,K)}const ct=Hs(Q.text);R+=J+ct*K}R=et+a;for(let Y=0;Y<it.length;Y++){const Q=it[Y],{width:J,font:rt}=L[Y];if(h.font=rt,h.textBaseline=Q.style.textBaseline,Q.style._fill!==void 0){if($)if(Q.style.dropShadow)this._setupDropShadow(h,Q.style,o,Z);else{const ft=Hs(Q.text);R+=J+ft*K;continue}else{const ft=bn.measureFont(rt),Ht=Q.style.lineHeight||ft.fontSize,Et={width:J,height:Ht,lineHeight:Ht,lines:[Q.text]};h.fillStyle=Zr(Q.style._fill,h,Et,a*2,R-a,I)}this._drawLetterSpacing(Q.text,Q.style,u,R,at+a-W,!1,K)}const ct=Hs(Q.text);R+=J+ct*K}I+=D}}}_setFillAndStrokeStyles(t,n,a,o,u,c=0,h=0){var m;if(t.fillStyle=n._fill?Zr(n._fill,t,a,o*2,c,h):null,(m=n._stroke)!=null&&m.width){const p=u+o*2;t.strokeStyle=Zr(n._stroke,t,a,p,c,h)}}_setupDropShadow(t,n,a,o){t.fillStyle="black",t.strokeStyle="black";const u=n.dropShadow,c=u.color,h=u.alpha;t.shadowColor=se.shared.setValue(c).setAlpha(h).toRgbaString();const m=u.blur*a,p=u.distance*a;t.shadowBlur=m,t.shadowOffsetX=Math.cos(u.angle)*p,t.shadowOffsetY=Math.sin(u.angle)*p+o}_getAlignmentOffset(t,n,a){return a==="right"?n-t:a==="center"?(n-t)/2:0}_drawLetterSpacing(t,n,a,o,u,c=!1,h=0){const{context:m}=a,p=n.letterSpacing;let g=!1;if(bn.experimentalLetterSpacingSupported&&(bn.experimentalLetterSpacing?(m.letterSpacing=`${p}px`,m.textLetterSpacing=`${p}px`,g=!0):(m.letterSpacing="0px",m.textLetterSpacing="0px")),(p===0||g)&&h===0){c?m.strokeText(t,o,u):m.fillText(t,o,u);return}if(h!==0&&(p===0||g)){const w=t.split(" ");let S=o;const A=m.measureText(" ").width;for(let C=0;C<w.length;C++)c?m.strokeText(w[C],S,u):m.fillText(w[C],S,u),S+=m.measureText(w[C]).width+A+h;return}let x=o;const _=bn.graphemeSegmenter(t);let b=m.measureText(t).width,T=0;for(let w=0;w<_.length;++w){const S=_[w];c?m.strokeText(S,x,u):m.fillText(S,x,u);let A="";for(let C=w+1;C<_.length;++C)A+=_[C];T=m.measureText(A).width,x+=b-T+p,S===" "&&(x+=h),b=T}}}const Ps=new lT,Xh=class Wn extends vi{constructor(t={}){super(),this.uid=Qt("textStyle"),this._tick=0,this._cachedFontString=null,rT(t),t instanceof Wn&&(t=t._toObject());const o={...Wn.defaultTextStyle,...t};for(const u in o){const c=u;this[c]=o[u]}this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.update())}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(t!==null&&typeof t=="object"?this._dropShadow=this._createProxy({...Wn.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...Wn.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.update())}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(typeof t=="string"?this._fontSize=parseInt(t,10):this._fontSize=t,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.update())}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.update())}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.update())}get filters(){return this._filters}set filters(t){this._filters!==t&&(this._filters=Object.freeze(t),this.update())}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...di.defaultFillStyle,...t},()=>{this._fill=Zn({...this._originalFill},di.defaultFillStyle)})),this._fill=Zn(t===0?"black":t,di.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...di.defaultStrokeStyle,...t},()=>{this._stroke=io({...this._originalStroke},di.defaultStrokeStyle)})),this._stroke=io(t,di.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const t=Wn.defaultTextStyle;for(const n in t)this[n]=t[n]}assign(t){for(const n in t){const a=n;this[a]=t[n]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=Ah(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new Wn(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let n=0;n<this._filters.length;n++)t+=this._filters[n].padding;return Math.max(this._padding,t)}destroy(t=!1){var a,o,u,c;if(this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const h=typeof t=="boolean"?t:t==null?void 0:t.textureSource;(a=this._fill)!=null&&a.texture&&this._fill.texture.destroy(h),(o=this._originalFill)!=null&&o.texture&&this._originalFill.texture.destroy(h),(u=this._stroke)!=null&&u.texture&&this._stroke.texture.destroy(h),(c=this._originalStroke)!=null&&c.texture&&this._originalStroke.texture.destroy(h)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,n){return new Proxy(t,{set:(a,o,u)=>(a[o]===u||(a[o]=u,n==null||n(o,u),this.update()),!0)})}_isFillStyle(t){return(t??null)!==null&&!(se.isColorLike(t)||t instanceof Pi||t instanceof oo)}};Xh.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Xh.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Kn=Xh;function rT(l){const t=l;if(typeof t.dropShadow=="boolean"&&t.dropShadow){const n=Kn.defaultDropShadow;l.dropShadow={alpha:t.dropShadowAlpha??n.alpha,angle:t.dropShadowAngle??n.angle,blur:t.dropShadowBlur??n.blur,color:t.dropShadowColor??n.color,distance:t.dropShadowDistance??n.distance}}if(t.strokeThickness!==void 0){wt(Ft,"strokeThickness is now a part of stroke");const n=t.stroke;let a={};if(se.isColorLike(n))a.color=n;else if(n instanceof Pi||n instanceof oo)a.fill=n;else if(Object.hasOwnProperty.call(n,"color")||Object.hasOwnProperty.call(n,"fill"))a=n;else throw new Error("Invalid stroke value.");l.stroke={...a,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(wt(Ft,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(t.fill)||t.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");t.fill.length!==t.fillGradientStops.length&&be("The number of fill colors must match the number of fill gradient stops.");const n=new Pi({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),a=t.fillGradientStops.slice(),o=t.fill.map(u=>se.shared.setValue(u).toNumber());a.forEach((u,c)=>{n.addColorStop(u,o[c])}),l.fill={fill:n}}}function oT(l,t){const{texture:n,bounds:a}=l,o=t._style._getFinalPadding();wy(a,t._anchor,n);const u=t._anchor._x*o*2,c=t._anchor._y*o*2;a.minX-=o-u,a.minY-=o-c,a.maxX-=o-u,a.maxY-=o-c}class uT{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){this.reset()}}class cT extends uT{}class q0{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new ml({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const t in this._managedTexts.items){const n=this._managedTexts.items[t];n!=null&&n._autoResolution&&n.onViewUpdate()}}validateRenderable(t){const n=this._getGpuText(t),a=t.styleKey;return n.currentKey!==a?!0:t._didTextUpdate}addRenderable(t,n){const a=this._getGpuText(t);if(t._didTextUpdate){const o=t._autoResolution?this._renderer.resolution:t.resolution;(a.currentKey!==t.styleKey||t._resolution!==o)&&this._updateGpuText(t),t._didTextUpdate=!1,oT(a,t)}this._renderer.renderPipes.batch.addToBatch(a,n)}updateRenderable(t){const n=this._getGpuText(t);n._batcher.updateElement(n)}_updateGpuText(t){const n=this._getGpuText(t);n.texture&&this._renderer.canvasText.decreaseReferenceCount(n.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,n.texture=this._renderer.canvasText.getManagedTexture(t),n.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const n=new cT;return n.currentKey="--",n.renderable=t,n.transform=t.groupTransform,n.bounds={minX:0,maxX:1,minY:0,maxY:0},n.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=n,this._managedTexts.add(t),n}onTextUnload(t){const n=t._gpuData[this._renderer.uid];if(!n)return;const{canvasText:a}=this._renderer;a.getReferenceCount(n.currentKey)>0?a.decreaseReferenceCount(n.currentKey):n.texture&&a.returnTexture(n.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}q0.extension={type:[yt.WebGLPipes,yt.WebGPUPipes,yt.CanvasPipes],name:"text"};const hT=new si;function fT(l,t,n,a,o=!1){const u=hT;u.minX=0,u.minY=0,u.maxX=l.width/a|0,u.maxY=l.height/a|0;const c=so.getOptimalTexture(u.width,u.height,a,!1,o);return c.source.uploadMethodId="image",c.source.resource=l,c.source.alphaMode="premultiply-alpha-on-upload",c.frame.width=t/a,c.frame.height=n/a,c.source.emit("update",c.source),c.updateUvs(),c}class X0{constructor(t,n){this._activeTextures={},this._renderer=t,this._retainCanvasContext=n}getTexture(t,n,a,o){typeof t=="string"&&(wt("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:a,resolution:n}),t.style instanceof Kn||(t.style=new Kn(t.style)),t.textureStyle instanceof Qs||(t.textureStyle=new Qs(t.textureStyle)),typeof t.text!="string"&&(t.text=t.text.toString());const{text:u,style:c,textureStyle:h,autoGenerateMipmaps:m}=t,p=t.resolution??this._renderer.resolution,{frame:g,canvasAndContext:x}=Ps.getCanvasAndContext({text:u,style:c,resolution:p}),_=fT(x.canvas,g.width,g.height,p,m);if(h&&(_.source.style=h),c.trim&&(g.pad(c.padding),_.frame.copyFrom(g),_.frame.scale(1/p),_.updateUvs()),c.filters){const b=this._applyFilters(_,c.filters);return this.returnTexture(_),Ps.returnCanvasAndContext(x),b}return this._renderer.texture.initSource(_._source),this._retainCanvasContext||Ps.returnCanvasAndContext(x),_}returnTexture(t){const n=t.source,a=n.resource;if(this._retainCanvasContext&&(a!=null&&a.getContext)){const o=a.getContext("2d");o&&Ps.returnCanvasAndContext({canvas:a,context:o})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",so.returnTexture(t,!0)}renderTextToCanvas(){wt("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const n=t.styleKey;if(this._activeTextures[n])return this._increaseReferenceCount(n),this._activeTextures[n].texture;const a=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[n]={texture:a,usageCount:1},a}decreaseReferenceCount(t){const n=this._activeTextures[t];n&&(n.usageCount--,n.usageCount===0&&(this.returnTexture(n.texture),this._activeTextures[t]=null))}getReferenceCount(t){var n;return((n=this._activeTextures[t])==null?void 0:n.usageCount)??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,n){const a=this._renderer.renderTarget.renderTarget,o=this._renderer.filter.generateFilteredTexture({texture:t,filters:n});return this._renderer.renderTarget.bind(a,!1),o}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}class V0 extends X0{constructor(t){super(t,!0)}}V0.extension={type:[yt.CanvasSystem],name:"canvasText"};class P0 extends X0{constructor(t){super(t,!1)}}P0.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"canvasText"};Kt.add(V0);Kt.add(P0);Kt.add(q0);class wh extends N2{constructor(...t){const n=G2(t,"Text");super(n,Kn),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof Qs?n.textureStyle:new Qs(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??li.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,n=this._anchor;let a=0,o=0;if(this._style.trim){const{frame:u,canvasAndContext:c}=Ps.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Ps.returnCanvasAndContext(c),a=u.width,o=u.height}else{const u=bn.measureText(this._text,this._style);a=u.width,o=u.height}t.minX=-n._x*a,t.maxX=t.minX+a,t.minY=-n._y*o,t.maxY=t.minY+o}}Kt.add(H1,L1);const Ys=64,vn=32;function pe(l,t){return{x:(l-t)*(Ys/2),y:(l+t)*(vn/2)}}const qs=[{id:"ceo-office",label:"CEO Office",col:0,row:0,w:4,h:3,color:"#ffd700",floorColor:"#d4c4a0",wallColor:"#a0a0a8",icon:"👑"},{id:"cto-office",label:"CTO Office",col:5,row:0,w:4,h:3,color:"#00bfff",floorColor:"#c0c4c8",wallColor:"#909098",icon:"🔬"},{id:"arch-lab",label:"Arch Lab",col:10,row:0,w:4,h:3,color:"#b57edc",floorColor:"#ccc0d4",wallColor:"#988ca0",icon:"🏛️"},{id:"dev-bullpen",label:"Dev Bullpen",col:0,row:4,w:6,h:4,color:"#50c878",floorColor:"#c8d4c0",wallColor:"#909890",icon:"⚡"},{id:"qa-lab",label:"QA Lab",col:7,row:4,w:4,h:4,color:"#ff8c00",floorColor:"#d4c8b8",wallColor:"#a09888",icon:"🔍"},{id:"design-studio",label:"Design Studio",col:12,row:4,w:4,h:4,color:"#8a2be2",floorColor:"#d0c0d8",wallColor:"#9888a0",icon:"🎨"},{id:"data-lab",label:"Data Lab",col:0,row:9,w:4,h:3,color:"#708090",floorColor:"#c0c4c8",wallColor:"#888c90",icon:"📊"},{id:"meeting-room",label:"Meeting Room",col:5,row:9,w:5,h:3,color:"#4169e1",floorColor:"#c4c8d4",wallColor:"#8890a0",icon:"🤝"},{id:"lounge",label:"Lounge",col:11,row:9,w:5,h:3,color:"#ff6347",floorColor:"#d8ccbc",wallColor:"#a09488",icon:"☕"},{id:"crisis-room",label:"Crisis Room",col:5,row:13,w:5,h:3,color:"#dc143c",floorColor:"#d0c0c0",wallColor:"#a08888",icon:"🚨"}],dT=[{room:"ceo-office",seat:0,col:2,row:1},{room:"cto-office",seat:0,col:7,row:1},{room:"arch-lab",seat:0,col:12,row:1},{room:"dev-bullpen",seat:0,col:2,row:5},{room:"dev-bullpen",seat:1,col:4,row:6},{room:"qa-lab",seat:0,col:8,row:5},{room:"qa-lab",seat:1,col:10,row:6},{room:"design-studio",seat:0,col:13,row:5},{room:"design-studio",seat:1,col:15,row:6},{room:"data-lab",seat:0,col:2,row:10},{room:"meeting-room",seat:0,col:7,row:10},{room:"lounge",seat:0,col:13,row:10},{room:"crisis-room",seat:0,col:7,row:14}],mT=[{room:"ceo-office",type:"rug",col:2,row:1.5},{room:"ceo-office",type:"desk",col:1.5,row:1},{room:"ceo-office",type:"monitor",col:1.8,row:.8},{room:"ceo-office",type:"chair",col:2,row:1.5},{room:"ceo-office",type:"plant",col:.5,row:.3},{room:"ceo-office",type:"shelf",col:3.2,row:.3},{room:"cto-office",type:"desk",col:6.5,row:1},{room:"cto-office",type:"monitor",col:6.8,row:.8},{room:"cto-office",type:"monitor",col:7.3,row:.8},{room:"cto-office",type:"chair",col:7,row:1.5},{room:"cto-office",type:"server",col:8.3,row:.3},{room:"arch-lab",type:"desk",col:11.5,row:1},{room:"arch-lab",type:"monitor",col:11.8,row:.8},{room:"arch-lab",type:"chair",col:12,row:1.5},{room:"arch-lab",type:"whiteboard",col:13,row:.3},{room:"dev-bullpen",type:"desk",col:1.5,row:5},{room:"dev-bullpen",type:"monitor",col:1.8,row:4.8},{room:"dev-bullpen",type:"chair",col:2,row:5.5},{room:"dev-bullpen",type:"desk",col:3.5,row:6},{room:"dev-bullpen",type:"monitor",col:3.8,row:5.8},{room:"dev-bullpen",type:"chair",col:4,row:6.5},{room:"dev-bullpen",type:"plant",col:5,row:4.3},{room:"qa-lab",type:"desk",col:7.5,row:5},{room:"qa-lab",type:"monitor",col:7.8,row:4.8},{room:"qa-lab",type:"desk",col:9.5,row:6},{room:"qa-lab",type:"monitor",col:9.8,row:5.8},{room:"qa-lab",type:"server",col:10.5,row:4.3},{room:"design-studio",type:"desk",col:12.5,row:5},{room:"design-studio",type:"monitor",col:12.8,row:4.8},{room:"design-studio",type:"desk",col:14.5,row:6},{room:"design-studio",type:"whiteboard",col:15,row:4.3},{room:"data-lab",type:"desk",col:1.5,row:10},{room:"data-lab",type:"monitor",col:1.8,row:9.8},{room:"data-lab",type:"server",col:3,row:9.3},{room:"data-lab",type:"server",col:3.5,row:9.3},{room:"meeting-room",type:"rug",col:7.5,row:10.5},{room:"meeting-room",type:"table",col:7,row:10},{room:"meeting-room",type:"chair",col:6,row:10},{room:"meeting-room",type:"chair",col:8,row:10},{room:"meeting-room",type:"chair",col:7,row:11},{room:"meeting-room",type:"whiteboard",col:5.5,row:9.3},{room:"meeting-room",type:"plant",col:9.2,row:9.3},{room:"lounge",type:"rug",col:13,row:10.5},{room:"lounge",type:"couch",col:12,row:10},{room:"lounge",type:"couch",col:14,row:10},{room:"lounge",type:"coffee",col:13,row:10.5},{room:"lounge",type:"plant",col:15,row:9.3},{room:"lounge",type:"plant",col:11.3,row:9.3},{room:"crisis-room",type:"table",col:7,row:14},{room:"crisis-room",type:"monitor",col:5.5,row:13.3},{room:"crisis-room",type:"monitor",col:6.5,row:13.3},{room:"crisis-room",type:"monitor",col:7.5,row:13.3}];function F0(l,t){return dT.find(n=>n.room===l&&n.seat===t)}const py={sage:16766720,nova:49151,aria:11894492,dex:5294200,flux:4286945,quinn:16747520,gage:2142890,morgan:16738740,uma:9055202,river:52945,atlas:7372944},pT={sage:16111288,nova:13016173,aria:16111299,dex:9262372,flux:16111288,quinn:15254686,gage:9262372,morgan:16111299,uma:13016173,river:16111288,atlas:15254686},gT={sage:2763306,nova:1710650,aria:9062954,dex:657930,flux:4864538,quinn:4860442,gage:657930,morgan:9054746,uma:2759226,river:5921370,atlas:6974058},yT={sage:0,nova:0,aria:2,dex:3,flux:0,quinn:1,gage:0,morgan:2,uma:4,river:1,atlas:0},xT={coding:65416,reviewing:49151,testing:10181046,planning:16766720,blocked:16729156,deploying:16739125,thinking:13421772};class _T{constructor(t){ie(this,"container");ie(this,"body");ie(this,"glow");ie(this,"statusBubble");ie(this,"label");ie(this,"statusLabel");ie(this,"shadow");ie(this,"bobOffset",Math.random()*Math.PI*2);ie(this,"targetX",0);ie(this,"targetY",0);ie(this,"currentX",0);ie(this,"currentY",0);ie(this,"lastStatus","");this.container=new ai,this.container.sortableChildren=!0;const n=py[t.id]||13421772;this.shadow=new qe,this.shadow.zIndex=0,this.container.addChild(this.shadow),this.glow=new qe,this.glow.zIndex=1,this.glow.visible=!1,this.container.addChild(this.glow),this.body=new qe,this.drawPixelPerson(this.body,t.id),this.body.zIndex=2,this.container.addChild(this.body),this.statusBubble=new qe,this.statusBubble.zIndex=4,this.statusBubble.visible=!1,this.container.addChild(this.statusBubble),this.label=new wh({text:t.name,style:new Kn({fontSize:8,fill:n,fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"700",letterSpacing:.5,dropShadow:{color:"#000000",blur:2,distance:1}})}),this.label.anchor.set(.5,0),this.label.y=14,this.label.zIndex=5,this.container.addChild(this.label),this.statusLabel=new wh({text:"",style:new Kn({fontSize:7,fill:8947848,fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"400",dropShadow:{color:"#000000",blur:2,distance:1}})}),this.statusLabel.anchor.set(.5,0),this.statusLabel.y=23,this.statusLabel.zIndex=5,this.statusLabel.visible=!1,this.container.addChild(this.statusLabel),this.setPositionFromRoom(t.position_room,t.position_seat),this.currentX=this.targetX,this.currentY=this.targetY,this.container.x=this.currentX,this.container.y=this.currentY}drawPixelPerson(t,n){const a=py[n]||13421772,o=pT[n]||16111288,u=gT[n]||2763306,c=yT[n]||0,h=2;switch(c){case 0:t.rect(-3*h,-12*h,6*h,3*h),t.fill({color:u});break;case 1:t.rect(-3*h,-12*h,6*h,4*h),t.fill({color:u}),t.rect(-4*h,-11*h,1*h,4*h),t.fill({color:u}),t.rect(3*h,-11*h,1*h,4*h),t.fill({color:u});break;case 2:t.rect(-3*h,-12*h,6*h,3*h),t.fill({color:u}),t.rect(-4*h,-11*h,1*h,7*h),t.fill({color:u}),t.rect(3*h,-11*h,1*h,7*h),t.fill({color:u});break;case 3:t.rect(-1*h,-14*h,2*h,2*h),t.fill({color:u}),t.rect(-2*h,-12*h,4*h,2*h),t.fill({color:u});break;case 4:t.rect(-3*h,-12*h,6*h,3*h),t.fill({color:u}),t.rect(-1*h,-14*h,2*h,2*h),t.fill({color:u});break}t.rect(-3*h,-10*h,6*h,5*h),t.fill({color:o}),t.rect(-2*h,-8*h,1*h,1*h),t.fill({color:1118481}),t.rect(1*h,-8*h,1*h,1*h),t.fill({color:1118481}),t.rect(-1*h,-6*h,2*h,1*h),t.fill({color:Ir(o,.2)}),t.rect(-4*h,-5*h,8*h,6*h),t.fill({color:a}),t.rect(-2*h,-5*h,4*h,1*h),t.fill({color:Ir(a,.15)}),t.rect(-5*h,-4*h,1*h,5*h),t.fill({color:Ir(a,.1)}),t.rect(-5*h,1*h,1*h,1*h),t.fill({color:o}),t.rect(4*h,-4*h,1*h,5*h),t.fill({color:Ir(a,.1)}),t.rect(4*h,1*h,1*h,1*h),t.fill({color:o}),t.rect(-3*h,1*h,3*h,4*h),t.fill({color:2236979}),t.rect(0,1*h,3*h,4*h),t.fill({color:2763322}),t.rect(-4*h,5*h,3*h,1*h),t.fill({color:1710618}),t.rect(1*h,5*h,3*h,1*h),t.fill({color:1710618})}drawStatusBubble(t,n,a){t.clear(),t.roundRect(-12,-32,24,14,3),t.fill({color:1710634,alpha:.9}),t.stroke({color:a,width:1,alpha:.6}),t.circle(0,-19,2),t.fill({color:1710634,alpha:.8}),t.circle(2,-16,1),t.fill({color:1710634,alpha:.6})}setPositionFromRoom(t,n){const a=F0(t,n);if(a){const o=pe(a.col,a.row);this.targetX=o.x,this.targetY=o.y}}update(t){this.setPositionFromRoom(t.position_room,t.position_seat);const n=this.targetX-this.currentX,a=this.targetY-this.currentY,o=Math.sqrt(n*n+a*a);if(o>1){const p=Math.min(o*.08,3);this.currentX+=n/o*p,this.currentY+=a/o*p}else this.currentX=this.targetX,this.currentY=this.targetY;this.bobOffset+=.04;const u=t.status!=="idle",c=u?Math.round(Math.sin(this.bobOffset*3)*1.5):0;this.container.x=this.currentX,this.container.y=this.currentY+c,this.container.zIndex=this.currentY+100,this.shadow.clear();const h=u?.2:.3;this.shadow.ellipse(0,8,8,3),this.shadow.fill({color:0,alpha:h});const m=xT[t.status];m&&u?(this.glow.visible=!0,this.glow.clear(),this.glow.ellipse(0,0,14,14),this.glow.fill({color:m,alpha:.08+Math.sin(this.bobOffset*2)*.04}),this.glow.ellipse(0,8,10,4),this.glow.stroke({color:m,width:2,alpha:.3+Math.sin(this.bobOffset*2)*.15}),this.statusBubble.visible=!0,this.drawStatusBubble(this.statusBubble,t.status,m)):(this.glow.visible=!1,this.statusBubble.visible=!1),u&&t.status!==this.lastStatus?(this.statusLabel.text=t.status,this.statusLabel.style.fill=m||8947848,this.statusLabel.visible=!0):u||(this.statusLabel.visible=!1),this.lastStatus=t.status}}function Ir(l,t){const n=Math.max(0,(l>>16&255)*(1-t)),a=Math.max(0,(l>>8&255)*(1-t)),o=Math.max(0,(l&255)*(1-t));return Math.round(n)<<16|Math.round(a)<<8|Math.round(o)}const je=18;class bT{constructor(){ie(this,"app");ie(this,"world");ie(this,"agentSprites",new Map);ie(this,"initialized",!1);this.app=new x0,this.world=new ai}async init(t){this.initialized||(this.initialized=!0,await this.app.init({canvas:t,resizeTo:t.parentElement,background:1710638,antialias:!1,autoDensity:!0,resolution:window.devicePixelRatio||1}),this.app.stage.addChild(this.world),this.world.sortableChildren=!0,this.centerCamera(),this.drawRooms(),window.addEventListener("resize",()=>this.centerCamera()))}centerCamera(){const t=this.app.screen.width,n=this.app.screen.height,a=pe(8,8);this.world.x=t/2-a.x,this.world.y=n/3.2-a.y}drawRooms(){for(const t of qs)this.drawRoom(t)}drawRoom(t){const n=new ai;n.sortableChildren=!0;const a=pe(t.col,t.row);n.zIndex=a.y;const o=parseInt(t.floorColor.slice(1),16),u=parseInt(t.wallColor.slice(1),16),c=parseInt(t.color.slice(1),16),h=pe(t.col,t.row),m=pe(t.col+t.w,t.row),p=pe(t.col+t.w,t.row+t.h),g=pe(t.col,t.row+t.h);for(let A=0;A<t.w;A++)for(let C=0;C<t.h;C++){const E=pe(t.col+A,t.row+C),B=new qe,X=(A+C)%2===0;B.poly([{x:0,y:0},{x:Ys/2,y:vn/2},{x:0,y:vn},{x:-Ys/2,y:vn/2}]),B.fill({color:o,alpha:X?1:.85}),B.poly([{x:0,y:0},{x:Ys/2,y:vn/2},{x:0,y:vn},{x:-Ys/2,y:vn/2}]),B.stroke({color:0,width:.5,alpha:.08}),B.x=E.x,B.y=E.y,n.addChild(B)}const x=new qe;x.poly([{x:h.x,y:h.y},{x:h.x,y:h.y-je},{x:g.x,y:g.y-je},{x:g.x,y:g.y}]),x.fill({color:u,alpha:.9});for(let A=1;A<=3;A++){const C=A/4,E=h.y-je*(1-C),B=g.y-je*(1-C);x.moveTo(h.x,E),x.lineTo(g.x,B),x.stroke({color:0,width:1,alpha:.1})}x.moveTo(h.x,h.y-je),x.lineTo(g.x,g.y-je),x.stroke({color:c,width:2,alpha:.5}),x.zIndex=-1,n.addChild(x);const _=new qe;_.poly([{x:h.x,y:h.y},{x:h.x,y:h.y-je},{x:m.x,y:m.y-je},{x:m.x,y:m.y}]),_.fill({color:vT(u,.15),alpha:.9});for(let A=1;A<=3;A++){const C=A/4,E=h.y-je*(1-C),B=m.y-je*(1-C);_.moveTo(h.x,E),_.lineTo(m.x,B),_.stroke({color:0,width:1,alpha:.08})}_.moveTo(h.x,h.y-je),_.lineTo(m.x,m.y-je),_.stroke({color:c,width:2,alpha:.4}),_.zIndex=-1,n.addChild(_);const b=new qe;b.poly([h,m,p,g]),b.stroke({color:c,width:1.5,alpha:.25}),n.addChild(b);const T=pe(t.col+t.w/2,t.row+.3),w=new wh({text:`${t.icon} ${t.label.toUpperCase()}`,style:new Kn({fontSize:9,fill:t.color,fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"700",letterSpacing:1.5,align:"center",dropShadow:{color:"#000000",blur:4,distance:1}})});w.anchor.set(.5,.5),w.x=T.x,w.y=T.y-je-6,w.alpha=.8,n.addChild(w);const S=mT.filter(A=>A.room===t.id);for(const A of S)this.drawFurniture(n,A,c,t);this.world.addChild(n)}drawFurniture(t,n,a,o){const u=pe(n.col,n.row),c=new qe;switch(n.type){case"rug":{const h=Ys*1.2,m=vn*1.2;c.poly([{x:u.x,y:u.y},{x:u.x+h/2,y:u.y+m/2},{x:u.x,y:u.y+m},{x:u.x-h/2,y:u.y+m/2}]),c.fill({color:a,alpha:.08}),c.poly([{x:u.x,y:u.y+3},{x:u.x+h/2-5,y:u.y+m/2},{x:u.x,y:u.y+m-3},{x:u.x-h/2+5,y:u.y+m/2}]),c.stroke({color:a,width:1,alpha:.1}),c.zIndex=-.5;break}case"desk":{c.poly([{x:u.x,y:u.y-4},{x:u.x+20,y:u.y+6},{x:u.x,y:u.y+16},{x:u.x-20,y:u.y+6}]),c.fill({color:9137994}),c.poly([{x:u.x-14,y:u.y+3},{x:u.x+14,y:u.y+3},{x:u.x+12,y:u.y+5},{x:u.x-12,y:u.y+5}]),c.fill({color:10518616,alpha:.6}),c.poly([{x:u.x+20,y:u.y+6},{x:u.x,y:u.y+16},{x:u.x,y:u.y+19},{x:u.x+20,y:u.y+9}]),c.fill({color:7032880}),c.poly([{x:u.x,y:u.y+16},{x:u.x-20,y:u.y+6},{x:u.x-20,y:u.y+9},{x:u.x,y:u.y+19}]),c.fill({color:5914664});break}case"monitor":{c.rect(u.x-7,u.y-16,14,12),c.fill({color:2236962}),c.rect(u.x-6,u.y-15,12,10),c.fill({color:661544});const h=[a,65416,49151,16753920];for(let m=0;m<5;m++){const p=2+(m*7+3)%8;c.rect(u.x-5,u.y-14+m*2,p,1),c.fill({color:h[m%h.length],alpha:.5})}c.rect(u.x-6,u.y-15,12,10),c.fill({color:a,alpha:.05}),c.rect(u.x-1,u.y-4,2,3),c.fill({color:3355443}),c.rect(u.x-4,u.y-1,8,2),c.fill({color:3355443});break}case"chair":{c.ellipse(u.x,u.y+1,5,3),c.fill({color:3355464}),c.rect(u.x-3,u.y-3,6,3),c.fill({color:2763328});for(let h=0;h<4;h++){const m=h/4*Math.PI+Math.PI*.75;c.rect(Math.round(u.x+Math.cos(m)*5)-1,Math.round(u.y+4+Math.sin(m)*2)-1,2,2),c.fill({color:4473936,alpha:.6})}break}case"table":{c.poly([{x:u.x,y:u.y-4},{x:u.x+28,y:u.y+10},{x:u.x,y:u.y+24},{x:u.x-28,y:u.y+10}]),c.fill({color:7035450}),c.poly([{x:u.x-18,y:u.y+6},{x:u.x+18,y:u.y+6},{x:u.x+16,y:u.y+8},{x:u.x-16,y:u.y+8}]),c.fill({color:9138256,alpha:.5}),c.poly([{x:u.x+28,y:u.y+10},{x:u.x,y:u.y+24},{x:u.x,y:u.y+27},{x:u.x+28,y:u.y+13}]),c.fill({color:4864544});break}case"plant":{c.poly([{x:u.x-4,y:u.y+2},{x:u.x+4,y:u.y+2},{x:u.x+3,y:u.y+8},{x:u.x-3,y:u.y+8}]),c.fill({color:9132602}),c.rect(u.x-5,u.y+1,10,2),c.fill({color:10185290}),c.circle(u.x,u.y-3,6),c.fill({color:2984526,alpha:.85}),c.circle(u.x-3,u.y-1,4),c.fill({color:2263842,alpha:.8}),c.circle(u.x+3,u.y-1,4),c.fill({color:3978097,alpha:.8}),c.circle(u.x,u.y-6,4),c.fill({color:4569192,alpha:.75});break}case"shelf":{c.rect(u.x-10,u.y-10,20,18),c.fill({color:5914656}),c.stroke({color:7032880,width:1}),c.rect(u.x-9,u.y-4,18,2),c.fill({color:7032880}),c.rect(u.x-9,u.y+3,18,2),c.fill({color:7032880});const h=[4878245,12865106,9419919,13935988,8087790];for(let m=0;m<5;m++){const p=u.x-8+m*4,g=3+m*13%4;c.rect(p,u.y-10+(6-g),3,g),c.fill({color:h[m]})}for(let m=0;m<4;m++){const p=u.x-7+m*5,g=2+m*7%3;c.rect(p,u.y-3+(5-g),3,g),c.fill({color:h[(m+2)%5]})}break}case"server":{c.rect(u.x-5,u.y-14,10,20),c.fill({color:1710632}),c.stroke({color:2763328,width:1});for(let h=0;h<5;h++){const m=u.y-12+h*4;c.rect(u.x-4,m,8,3),c.fill({color:2236984})}for(let h=0;h<5;h++){const m=u.y-11+h*4;c.rect(u.x-3,m,2,2),c.fill({color:h<3?65416:49151}),c.rect(u.x+2,m,2,2),c.fill({color:16747520,alpha:.4+h*.12})}break}case"whiteboard":{c.rect(u.x-12,u.y-10,24,16),c.fill({color:5592416}),c.rect(u.x-11,u.y-9,22,14),c.fill({color:15263976,alpha:.2}),c.rect(u.x-8,u.y-7,10,1),c.fill({color:a,alpha:.4}),c.rect(u.x-6,u.y-4,14,1),c.fill({color:49151,alpha:.3}),c.rect(u.x-4,u.y-1,8,1),c.fill({color:65416,alpha:.25}),c.rect(u.x-3,u.y+1,6,4),c.stroke({color:a,width:1,alpha:.25}),c.rect(u.x-8,u.y+5,16,2),c.fill({color:5592416}),c.rect(u.x-3,u.y+5,2,2),c.fill({color:16729156}),c.rect(u.x,u.y+5,2,2),c.fill({color:65416}),c.rect(u.x+3,u.y+5,2,2),c.fill({color:49151});break}case"couch":{c.roundRect(u.x-12,u.y-4,24,5,1),c.fill({color:9127187}),c.rect(u.x-11,u.y+1,10,6),c.fill({color:10506797}),c.rect(u.x+1,u.y+1,10,6),c.fill({color:10506797}),c.rect(u.x-13,u.y-2,3,8),c.fill({color:9127187}),c.rect(u.x+10,u.y-2,3,8),c.fill({color:9127187}),c.rect(u.x-8,u.y-1,5,3),c.fill({color:a,alpha:.3});break}case"coffee":{c.poly([{x:u.x,y:u.y-1},{x:u.x+10,y:u.y+4},{x:u.x,y:u.y+9},{x:u.x-10,y:u.y+4}]),c.fill({color:7032880}),c.poly([{x:u.x+10,y:u.y+4},{x:u.x,y:u.y+9},{x:u.x,y:u.y+11},{x:u.x+10,y:u.y+6}]),c.fill({color:4864032}),c.rect(u.x,u.y+1,4,4),c.fill({color:15790320,alpha:.6}),c.rect(u.x+1,u.y+2,2,2),c.fill({color:5910544,alpha:.7});break}}t.addChild(c)}updateAgents(t){for(const n of t){let a=this.agentSprites.get(n.id);a||(a=new _T(n),this.agentSprites.set(n.id,a),this.world.addChild(a.container)),a.update(n)}}destroy(){window.removeEventListener("resize",()=>this.centerCamera()),this.app.destroy(!0)}}function vT(l,t){const n=Math.max(0,(l>>16&255)*(1-t)),a=Math.max(0,(l>>8&255)*(1-t)),o=Math.max(0,(l&255)*(1-t));return Math.round(n)<<16|Math.round(a)<<8|Math.round(o)}class ST{constructor(){ie(this,"container");ie(this,"particles",[]);this.container=new ai}confetti(t,n){const a=[16766720,65416,49151,16738740,16739125];for(let o=0;o<30;o++){const u=Math.random()*Math.PI*2,c=1+Math.random()*3;this.addParticle(t,n,Math.cos(u)*c,Math.sin(u)*c-2,60+Math.random()*40,a[Math.floor(Math.random()*a.length)],2+Math.random()*3)}}redPulse(t,n){for(let a=0;a<12;a++){const o=a/12*Math.PI*2;this.addParticle(t,n,Math.cos(o)*1.5,Math.sin(o)*1.5,50,16729156,4)}}greenFlash(t,n){for(let a=0;a<8;a++){const o=a/8*Math.PI*2;this.addParticle(t,n,Math.cos(o)*2,Math.sin(o)*2-1,40,65416,3)}}addParticle(t,n,a,o,u,c,h){const m=new qe;m.rect(-h/2,-h/2,h,h),m.fill({color:c}),m.x=t,m.y=n,this.container.addChild(m),this.particles.push({x:t,y:n,vx:a,vy:o,life:u,maxLife:u,color:c,size:h,gfx:m})}tick(){for(let t=this.particles.length-1;t>=0;t--){const n=this.particles[t];n.x+=n.vx,n.y+=n.vy,n.vy+=.05,n.life--,n.gfx.x=n.x,n.gfx.y=n.y,n.gfx.alpha=n.life/n.maxLife,n.life<=0&&(this.container.removeChild(n.gfx),n.gfx.destroy(),this.particles.splice(t,1))}}}function TT(l){const t=Xe.useRef(null),n=Xe.useRef(null);return Xe.useEffect(()=>{const a=document.getElementById(l);if(!a)return;const o=new bT,u=new ST;return t.current=o,n.current=u,o.init(a).then(()=>{o.world.addChild(u.container),o.app.ticker.add(()=>{const c=gt.getState();o.updateAgents(c.agents.map(m=>({id:m.id,name:m.name,status:m.status,position_room:m.position_room,position_seat:m.position_seat})));let h=c.popWow();for(;h;)AT(h,u),h=c.popWow();u.tick()})}),()=>{o.destroy()}},[l]),{officeRef:t,effectsRef:n}}function AT(l,t){if(l)switch(l.type){case"pr:merged":{const n=qs.find(a=>a.id==="dev-bullpen");if(n){const a=pe(n.col+n.w/2,n.row+n.h/2);t.confetti(a.x,a.y)}break}case"crisis:start":{const n=qs.find(a=>a.id==="crisis-room");if(n){const a=pe(n.col+n.w/2,n.row+n.h/2);t.redPulse(a.x,a.y)}break}case"crisis:resolved":{const n=qs.find(a=>a.id==="crisis-room");if(n){const a=pe(n.col+n.w/2,n.row+n.h/2);t.greenFlash(a.x,a.y)}break}case"deploy:success":{const n=F0("qa-lab",1);if(n){const a=pe(n.col,n.row);t.confetti(a.x,a.y),t.greenFlash(a.x,a.y)}break}case"sprint:complete":{const n=qs.find(a=>a.id==="lounge");if(n){const a=pe(n.col+n.w/2,n.row+n.h/2);t.confetti(a.x,a.y),t.confetti(a.x+30,a.y-10),t.confetti(a.x-30,a.y+10)}break}case"meeting:start":{const n=qs.find(a=>a.id==="meeting-room");if(n){const a=pe(n.col+n.w/2,n.row+n.h/2);t.greenFlash(a.x,a.y)}break}}}const wT={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"⚙️",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},gy={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"},CT={idle:"#555",coding:"#00ff88",reviewing:"#00bfff",testing:"#9b59b6",planning:"#ffd700",meeting:"#ff69b4",blocked:"#ff4444",deploying:"#ff6b35"};function MT(){const l=gt(a=>a.agents),t=gt(a=>a.selectedAgent),n=gt(a=>a.setSelectedAgent);return V.jsxs("div",{className:"agent-bar",children:[V.jsx("div",{className:"agent-bar-logo",children:"SAGE TEAM"}),V.jsx("div",{className:"agent-bar-list",children:l.map(a=>V.jsxs("div",{className:`agent-bar-item ${t===a.id?"selected":""} ${a.status!=="idle"?"active":""}`,style:t===a.id?{borderColor:gy[a.id]||"#444"}:void 0,title:`${a.name} — ${a.role} (${a.status})`,onClick:()=>n(t===a.id?null:a.id),children:[V.jsx("span",{className:"agent-emoji",children:wT[a.id]||"🤖"}),V.jsx("span",{className:"agent-name",style:{color:gy[a.id]||"#aaa"},children:a.name}),V.jsx("span",{className:"status-dot",style:{background:CT[a.status]||"#555"}})]},a.id))})]})}const yy={success:"#00ff88",warning:"#ff6b35",info:"#00bfff",agent:"#b0b0c0",task:"#ffd700",system:"#666"},sh={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"};function ET(){const l=gt(h=>h.activity),t=gt(h=>h.agents),n=gt(h=>h.tasks),a=Xe.useRef(null);Xe.useEffect(()=>{var h;(h=a.current)==null||h.scrollIntoView({behavior:"smooth"})},[l.length]);const o=t.filter(h=>h.status!=="idle"),u=n.filter(h=>h.status==="done"||h.status==="completed").length,c=n.length;return V.jsxs("div",{className:"chat-panel",children:[V.jsxs("div",{className:"chat-header",children:[V.jsx("span",{className:"chat-header-title",children:"Live Activity"}),c>0&&V.jsxs("span",{className:"chat-header-stats",children:[u,"/",c," tasks"]})]}),o.length>0&&V.jsx("div",{className:"active-agents-strip",children:o.map(h=>V.jsxs("div",{className:"active-agent-chip",style:{borderColor:sh[h.id]||"#444"},children:[V.jsx("span",{className:"agent-dot",style:{background:sh[h.id]||"#888"}}),V.jsx("span",{className:"agent-chip-name",children:h.id}),V.jsx("span",{className:"agent-chip-status",children:h.status})]},h.id))}),V.jsxs("div",{className:"chat-messages",children:[l.length===0&&V.jsxs("div",{className:"chat-empty",children:[V.jsx("div",{className:"empty-icon",children:"🏢"}),V.jsx("div",{children:"Waiting for activity..."}),V.jsx("div",{className:"empty-hint",children:"Start a session to see agents at work"})]}),l.map(h=>V.jsxs("div",{className:`activity-entry activity-${h.type}`,children:[V.jsx("span",{className:"activity-time",children:h.time}),V.jsx("span",{className:"activity-icon",children:h.icon}),V.jsx("span",{className:"activity-text",style:{color:h.agentId&&sh[h.agentId]||yy[h.type]},children:h.text})]},h.id)),V.jsx("div",{ref:a})]})]})}function RT(){const l=gt(m=>m.agents),t=gt(m=>m.tasks),n=gt(m=>m.sprint),a=l.filter(m=>m.status!=="idle"),o=t.filter(m=>m.status==="done").length,u=t.length,c=u>0?o/u:0,h=l.reduce((m,p)=>{const g=p.position_room;return m[g]||(m[g]=[]),m[g].push(p),m},{});return{agents:l,activeAgents:a,agentsByRoom:h,completedTasks:o,totalTasks:u,progress:c,sprint:n}}const zT={pending:"⏳",in_progress:"🔨",done:"✅",blocked:"🚫",review:"👀"};function DT(){const l=gt(u=>u.tasks),{sprint:t,progress:n}=RT(),[a,o]=Xe.useState(!1);return a?V.jsx("div",{className:"task-board collapsed",onClick:()=>o(!1),children:V.jsx("span",{className:"collapse-icon",children:"▶"})}):V.jsxs("div",{className:"task-board",children:[V.jsxs("div",{className:"task-board-header",onClick:()=>o(!0),children:[V.jsx("span",{className:"collapse-icon",children:"◀"}),V.jsx("span",{className:"task-board-title",children:"Sprint"})]}),t&&V.jsxs("div",{className:"sprint-info",children:[V.jsx("div",{className:"sprint-name",children:t.name}),V.jsx("div",{className:"sprint-progress-bar",children:V.jsx("div",{className:"sprint-progress-fill",style:{width:`${n*100}%`}})}),V.jsxs("div",{className:"sprint-progress-text",children:[Math.round(n*100),"% complete"]})]}),V.jsxs("div",{className:"task-list",children:[l.length===0&&V.jsx("div",{className:"task-empty",children:"No tasks yet. Submit a goal to start."}),l.map(u=>V.jsxs("div",{className:`task-item status-${u.status}`,children:[V.jsx("span",{className:"task-status-icon",children:zT[u.status]||"📦"}),V.jsxs("div",{className:"task-info",children:[V.jsx("div",{className:"task-title",children:u.title}),u.assigned_to&&V.jsx("div",{className:"task-assignee",children:u.assigned_to})]})]},u.id))]})]})}function BT(){const l=gt(u=>u.prs),t=gt(u=>u.selectedPR),n=gt(u=>u.setSelectedPR),a=l.find(u=>u.id===t);if(!a)return null;async function o(u){try{await fetch(`/api/pr/${a.id}/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:""})}),n(null)}catch{}}return V.jsx("div",{className:"pr-overlay",onClick:()=>n(null),children:V.jsxs("div",{className:"pr-modal",onClick:u=>u.stopPropagation(),children:[V.jsxs("div",{className:"pr-modal-header",children:[V.jsx("h3",{children:"Pull Request Review"}),V.jsx("button",{className:"pr-close",onClick:()=>n(null),children:"×"})]}),V.jsxs("div",{className:"pr-modal-body",children:[V.jsxs("div",{className:"pr-field",children:[V.jsx("span",{className:"pr-label",children:"Title:"})," ",a.title]}),V.jsxs("div",{className:"pr-field",children:[V.jsx("span",{className:"pr-label",children:"Branch:"})," ",V.jsx("code",{children:a.branch})]}),V.jsxs("div",{className:"pr-field",children:[V.jsx("span",{className:"pr-label",children:"Author:"})," ",a.author_agent]}),V.jsxs("div",{className:"pr-field",children:[V.jsx("span",{className:"pr-label",children:"Status:"})," ",a.status]}),a.review_notes&&V.jsxs("div",{className:"pr-review-notes",children:[V.jsx("div",{className:"pr-label",children:"Review Notes:"}),V.jsx("pre",{children:a.review_notes})]})]}),V.jsxs("div",{className:"pr-modal-actions",children:[V.jsx("button",{className:"pr-btn approve",onClick:()=>o("approve"),children:"Approve & Merge"}),V.jsx("button",{className:"pr-btn reject",onClick:()=>o("reject"),children:"Request Changes"})]})]})})}function OT(){const[l,t]=Xe.useState(""),[n,a]=Xe.useState(!1),o=gt(p=>p.connected),u=gt(p=>p.prs),c=gt(p=>p.setSelectedPR),h=u.filter(p=>p.status==="pending_review"||p.status==="agent_reviewed");async function m(p){if(p.preventDefault(),!(!l.trim()||n)){a(!0);try{await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal:l.trim()})}),t("")}catch{}finally{a(!1)}}}return V.jsxs("div",{className:"goal-bar",children:[h.length>0&&V.jsx("div",{className:"pr-badges",children:h.map(p=>V.jsxs("button",{className:"pr-badge",onClick:()=>c(p.id),children:["PR: ",p.title]},p.id))}),V.jsxs("form",{className:"goal-form",onSubmit:m,children:[V.jsx("input",{className:"goal-input",type:"text",placeholder:o?"Enter a goal for your team...":"Connecting...",value:l,onChange:p=>t(p.target.value),disabled:!o||n}),V.jsx("button",{className:"goal-submit",type:"submit",disabled:!o||n||!l.trim(),children:n?"...":"Go"})]})]})}const NT={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},GT={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"},kT={idle:"#555",coding:"#00ff88",reviewing:"#00bfff",testing:"#9b59b6",planning:"#ffd700",blocked:"#ff4444",deploying:"#ff6b35",thinking:"#cccccc"},UT={idle:"Waiting for tasks...",coding:"Writing code — editing files, creating features",reviewing:"Reviewing files — reading code, analyzing structure",testing:"Running tests — executing commands, validating",planning:"Planning — decomposing goals into tasks",blocked:"Blocked — waiting for dependency or help",deploying:"Deploying — pushing changes, configuring infra",thinking:"Thinking — processing, reasoning about the problem"};function HT(){const l=gt(_=>_.selectedAgent),t=gt(_=>_.agents),n=gt(_=>_.tasks),a=gt(_=>_.activity),o=gt(_=>_.setSelectedAgent);if(!l)return null;const u=t.find(_=>_.id===l);if(!u)return null;const c=GT[u.id]||"#888",h=NT[u.id]||"🤖",m=kT[u.status]||"#555",p=n.filter(_=>_.assigned_to===u.id),g=p.find(_=>_.status==="in_progress"),x=a.filter(_=>_.agentId===u.id).slice(-30);return V.jsx("div",{className:"agent-detail-overlay",onClick:()=>o(null),children:V.jsxs("div",{className:"agent-detail-panel",onClick:_=>_.stopPropagation(),children:[V.jsxs("div",{className:"agent-detail-header",style:{borderBottomColor:c+"40"},children:[V.jsx("button",{className:"agent-detail-close",onClick:()=>o(null),children:"×"}),V.jsxs("div",{className:"agent-detail-avatar",children:[V.jsx("span",{className:"agent-detail-emoji",children:h}),V.jsx("span",{className:"agent-detail-status-ring",style:{borderColor:m}})]}),V.jsxs("div",{className:"agent-detail-info",children:[V.jsx("h2",{className:"agent-detail-name",style:{color:c},children:u.name}),V.jsx("div",{className:"agent-detail-role",children:u.role}),V.jsxs("div",{className:"agent-detail-status",style:{color:m},children:[V.jsx("span",{className:"agent-status-dot",style:{background:m}}),u.status]})]})]}),V.jsx("div",{className:"agent-detail-desc",children:UT[u.status]||`Status: ${u.status}`}),g&&V.jsxs("div",{className:"agent-detail-section",children:[V.jsx("div",{className:"section-label",children:"Current Task"}),V.jsxs("div",{className:"agent-current-task",style:{borderLeftColor:c},children:[V.jsx("div",{className:"current-task-title",children:g.title}),V.jsx("div",{className:"current-task-status",children:V.jsx("span",{className:"task-status-badge",style:{background:m+"30",color:m},children:g.status})})]})]}),p.length>0&&V.jsxs("div",{className:"agent-detail-section",children:[V.jsxs("div",{className:"section-label",children:["Tasks (",p.filter(_=>_.status==="done"||_.status==="completed").length,"/",p.length," done)"]}),V.jsx("div",{className:"agent-tasks-list",children:p.map(_=>V.jsxs("div",{className:`agent-task-row ${_.status==="done"||_.status==="completed"?"done":""}`,children:[V.jsx("span",{className:"agent-task-icon",children:_.status==="done"||_.status==="completed"?"✅":_.status==="in_progress"?"🔨":"⏳"}),V.jsx("span",{className:"agent-task-title",children:_.title})]},_.id))})]}),V.jsxs("div",{className:"agent-detail-section agent-activity-section",children:[V.jsx("div",{className:"section-label",children:"Activity Log"}),V.jsxs("div",{className:"agent-activity-log",children:[x.length===0&&V.jsx("div",{className:"agent-activity-empty",children:"No activity yet"}),x.map(_=>V.jsxs("div",{className:"agent-activity-row",children:[V.jsx("span",{className:"agent-activity-time",children:_.time}),V.jsx("span",{className:"agent-activity-icon",children:_.icon}),V.jsx("span",{className:"agent-activity-text",children:_.text})]},_.id))]})]}),V.jsx("div",{className:"agent-detail-footer",children:V.jsxs("span",{className:"agent-location",children:["📍"," ",u.position_room||"Unknown"]})})]})})}function LT(){const l=gt(t=>t.connected);return G1(),TT("office-canvas"),V.jsxs("div",{className:"app",children:[V.jsx(MT,{}),V.jsxs("div",{className:"main-area",children:[V.jsx(DT,{}),V.jsxs("div",{className:"canvas-container",children:[V.jsx("canvas",{id:"office-canvas"}),!l&&V.jsx("div",{className:"connection-overlay",children:V.jsx("span",{children:"Connecting to Sage Team..."})})]}),V.jsx(ET,{})]}),V.jsx(OT,{}),V.jsx(BT,{}),V.jsx(HT,{})]})}C1.createRoot(document.getElementById("root")).render(V.jsx(Xe.StrictMode,{children:V.jsx(LT,{})}));export{so as $,f0 as A,hl as B,se as C,Ve as D,vi as E,Pi as F,lo as G,Bh as H,u0 as I,li as J,i0 as K,Th as L,St as M,yS as N,_S as O,ge as P,CS as Q,fh as R,Oh as S,Gt as T,to as U,TS as V,I1 as W,RS as X,Re as Y,Ry as Z,si as _,s0 as a,yg as a0,ll as a1,uT as a2,Mb as a3,_g as a4,jc as a5,bg as a6,Rb as a7,Qs as a8,It as a9,By as aa,B2 as ab,d0 as ac,wt as ad,dl as ae,Ft as af,Bv as ag,Mv as ah,Jv as ai,Fv as aj,xS as ak,bS as al,MS as am,wS as an,ES as ao,$y as b,Xv as c,Ee as d,Qt as e,Ut as f,$b as g,Kr as h,yt as i,qe as j,PS as k,kS as l,Dy as m,oo as n,Yy as o,Kt as p,Vs as q,cb as r,ro as s,ai as t,uv as u,jv as v,be as w,ml as x,Ng as y,$r as z};
|