sage-team 3.5.2 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -1
- package/dist/engine/__tests__/dispatcher.test.js +1 -0
- package/dist/engine/__tests__/dispatcher.test.js.map +1 -1
- package/dist/engine/dispatcher.d.ts.map +1 -1
- package/dist/engine/dispatcher.js +4 -1
- package/dist/engine/dispatcher.js.map +1 -1
- package/dist/engine/orchestrator.d.ts.map +1 -1
- package/dist/engine/orchestrator.js +6 -3
- package/dist/engine/orchestrator.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/state/repositories/agents.js +1 -1
- package/dist/state/repositories/agents.js.map +1 -1
- package/package.json +1 -1
- package/src/web/dist/assets/{BufferResource-CnEVFTWO.js → BufferResource-C0a2-23_.js} +1 -1
- package/src/web/dist/assets/{CanvasRenderer-DJddxDJS.js → CanvasRenderer-DAx637pP.js} +1 -1
- package/src/web/dist/assets/{Filter-DWNM0gBH.js → Filter-BpH04nQq.js} +1 -1
- package/src/web/dist/assets/{RenderTargetSystem-C4fzbyMy.js → RenderTargetSystem-B6ma-XuE.js} +1 -1
- package/src/web/dist/assets/{WebGLRenderer-Dl5dddTJ.js → WebGLRenderer-DxbdlULS.js} +1 -1
- package/src/web/dist/assets/{WebGPURenderer-DHzWrTEL.js → WebGPURenderer-DALpH00k.js} +1 -1
- package/src/web/dist/assets/{browserAll-CrRQwob6.js → browserAll-BToSt8GL.js} +1 -1
- package/src/web/dist/assets/index-CnLwjlPD.js +298 -0
- package/src/web/dist/assets/{webworkerAll-B9FNurHh.js → webworkerAll-DmVDEFdQ.js} +1 -1
- package/src/web/dist/index.html +1 -1
- package/src/web/dist/assets/index-PrNo7ukG.js +0 -298
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-BToSt8GL.js","assets/webworkerAll-DmVDEFdQ.js","assets/Filter-BpH04nQq.js","assets/WebGPURenderer-DALpH00k.js","assets/BufferResource-C0a2-23_.js","assets/RenderTargetSystem-B6ma-XuE.js","assets/WebGLRenderer-DxbdlULS.js","assets/CanvasRenderer-DAx637pP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var x1=Object.defineProperty;var _1=(l,t,n)=>t in l?x1(l,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[t]=n;var Kt=(l,t,n)=>_1(l,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(r){if(r.ep)return;r.ep=!0;const u=n(r);fetch(r.href,u)}})();function Eh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Cc={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 Fp;function b1(){if(Fp)return Xa;Fp=1;var l=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,r,u){var c=null;if(u!==void 0&&(c=""+u),r.key!==void 0&&(c=""+r.key),"key"in r){u={};for(var h in r)h!=="key"&&(u[h]=r[h])}else u=r;return r=u.ref,{$$typeof:l,type:s,key:c,ref:r!==void 0?r:null,props:u}}return Xa.Fragment=t,Xa.jsx=n,Xa.jsxs=n,Xa}var Wp;function v1(){return Wp||(Wp=1,Cc.exports=b1()),Cc.exports}var X=v1(),Mc={exports:{}},mt={};/**
|
|
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 Qp;function S1(){if(Qp)return mt;Qp=1;var l=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=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(){}},A=Object.assign,S={};function w(R,Y,W){this.props=R,this.context=Y,this.refs=S,this.updater=W||T}w.prototype.isReactComponent={},w.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")},w.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=w.prototype;function E(R,Y,W){this.props=R,this.context=Y,this.refs=S,this.updater=W||T}var O=E.prototype=new C;O.constructor=E,A(O,w.prototype),O.isPureReactComponent=!0;var P=Array.isArray;function k(){}var N={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function Q(R,Y,W){var J=W.ref;return{$$typeof:l,type:R,key:Y,ref:J!==void 0?J:null,props:W}}function Z(R,Y){return Q(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(W){return Y[W]})}var it=/\/+/g;function nt(R,Y){return typeof R=="object"&&R!==null&&R.key!=null?tt(""+R.key):Y.toString(36)}function wt(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(k,k):(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,W,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,W,J,rt)}}if(ft)return rt=rt(R),ft=J===""?"."+nt(R,0):J,P(rt)?(W="",ft!=null&&(W=ft.replace(it,"$&/")+"/"),D(rt,Y,W,"",function(Fe){return Fe})):rt!=null&&(I(rt)&&(rt=Z(rt,W+(rt.key==null||R&&R.key===rt.key?"":(""+rt.key).replace(it,"$&/")+"/")+ft)),Y.push(rt)),1;ft=0;var Lt=J===""?".":J+":";if(P(R))for(var Et=0;Et<R.length;Et++)J=R[Et],ct=Lt+nt(J,Et),ft+=D(J,Y,W,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=Lt+nt(J,Et++),ft+=D(J,Y,W,ct,rt);else if(ct==="object"){if(typeof R.then=="function")return D(wt(R),Y,W,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,W){if(R==null)return R;var J=[],rt=0;return D(R,J,"","",function(ct){return Y.call(W,ct,rt++)}),J}function et(R){if(R._status===-1){var Y=R._result;Y=Y(),Y.then(function(W){(R._status===0||R._status===-1)&&(R._status=1,R._result=W)},function(W){(R._status===0||R._status===-1)&&(R._status=2,R._result=W)}),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,W){L(R,function(){Y.apply(this,arguments)},W)},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 mt.Activity=x,mt.Children=at,mt.Component=w,mt.Fragment=n,mt.Profiler=r,mt.PureComponent=E,mt.StrictMode=s,mt.Suspense=m,mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,mt.__COMPILER_RUNTIME={__proto__:null,c:function(R){return N.H.useMemoCache(R)}},mt.cache=function(R){return function(){return R.apply(null,arguments)}},mt.cacheSignal=function(){return null},mt.cloneElement=function(R,Y,W){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var J=A({},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=W;else if(1<ct){for(var ft=Array(ct),Lt=0;Lt<ct;Lt++)ft[Lt]=arguments[Lt+2];J.children=ft}return Q(R.type,rt,J)},mt.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},mt.createElement=function(R,Y,W){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=W;else if(1<ft){for(var Lt=Array(ft),Et=0;Et<ft;Et++)Lt[Et]=arguments[Et+2];rt.children=Lt}if(R&&R.defaultProps)for(J in ft=R.defaultProps,ft)rt[J]===void 0&&(rt[J]=ft[J]);return Q(R,ct,rt)},mt.createRef=function(){return{current:null}},mt.forwardRef=function(R){return{$$typeof:h,render:R}},mt.isValidElement=I,mt.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:et}},mt.memo=function(R,Y){return{$$typeof:p,type:R,compare:Y===void 0?null:Y}},mt.startTransition=function(R){var Y=N.T,W={};N.T=W;try{var J=R(),rt=N.S;rt!==null&&rt(W,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(k,K)}catch(ct){K(ct)}finally{Y!==null&&W.types!==null&&(Y.types=W.types),N.T=Y}},mt.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},mt.use=function(R){return N.H.use(R)},mt.useActionState=function(R,Y,W){return N.H.useActionState(R,Y,W)},mt.useCallback=function(R,Y){return N.H.useCallback(R,Y)},mt.useContext=function(R){return N.H.useContext(R)},mt.useDebugValue=function(){},mt.useDeferredValue=function(R,Y){return N.H.useDeferredValue(R,Y)},mt.useEffect=function(R,Y){return N.H.useEffect(R,Y)},mt.useEffectEvent=function(R){return N.H.useEffectEvent(R)},mt.useId=function(){return N.H.useId()},mt.useImperativeHandle=function(R,Y,W){return N.H.useImperativeHandle(R,Y,W)},mt.useInsertionEffect=function(R,Y){return N.H.useInsertionEffect(R,Y)},mt.useLayoutEffect=function(R,Y){return N.H.useLayoutEffect(R,Y)},mt.useMemo=function(R,Y){return N.H.useMemo(R,Y)},mt.useOptimistic=function(R,Y){return N.H.useOptimistic(R,Y)},mt.useReducer=function(R,Y,W){return N.H.useReducer(R,Y,W)},mt.useRef=function(R){return N.H.useRef(R)},mt.useState=function(R){return N.H.useState(R)},mt.useSyncExternalStore=function(R,Y,W){return N.H.useSyncExternalStore(R,Y,W)},mt.useTransition=function(){return N.H.useTransition()},mt.version="19.2.4",mt}var Zp;function Rh(){return Zp||(Zp=1,Mc.exports=S1()),Mc.exports}var Ve=Rh();const kr=Eh(Ve);var Ec={exports:{}},Va={},Rc={exports:{}},zc={};/**
|
|
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 Ip;function T1(){return Ip||(Ip=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<r(at,L))D[K]=L,D[et]=at,et=K;else break t}}function n(D){return D.length===0?null:D[0]}function s(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,W=D[Y],J=Y+1,rt=D[J];if(0>r(W,et))J<at&&0>r(rt,W)?(D[K]=rt,D[J]=et,K=J):(D[K]=W,D[Y]=et,K=Y);else if(J<at&&0>r(rt,et))D[K]=rt,D[J]=et,K=J;else break t}}return L}function r(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,A=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function O(D){for(var L=n(p);L!==null;){if(L.callback===null)s(p);else if(L.startTime<=D)s(p),L.sortIndex=L.expirationTime,t(m,L);else break;L=n(p)}}function P(D){if(A=!1,O(D),!T)if(n(m)!==null)T=!0,k||(k=!0,tt());else{var L=n(p);L!==null&&wt(P,L.startTime-D)}}var k=!1,N=-1,$=5,Q=-1;function Z(){return S?!0:!(l.unstable_now()-Q<$)}function I(){if(S=!1,k){var D=l.unstable_now();Q=D;var L=!0;try{t:{T=!1,A&&(A=!1,C(N),N=-1),b=!0;var et=_;try{e:{for(O(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,O(D),L=!0;break e}x===n(m)&&s(m),O(D)}else s(m);x=n(m)}if(x!==null)L=!0;else{var R=n(p);R!==null&&wt(P,R.startTime-D),L=!1}}break t}finally{x=null,_=et,b=!1}L=void 0}}finally{L?tt():k=!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(){w(I,0)};function wt(D,L){N=w(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)&&(A?(C(N),N=-1):A=!0,wt(P,et-K))):(D.sortIndex=at,t(m,D),T||b||(T=!0,k||(k=!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}}}})(zc)),zc}var Kp;function w1(){return Kp||(Kp=1,Rc.exports=T1()),Rc.exports}var Dc={exports:{}},pe={};/**
|
|
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 $p;function A1(){if($p)return pe;$p=1;var l=Rh();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 s={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},r=Symbol.for("react.portal");function u(m,p,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,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 pe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,pe.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)},pe.flushSync=function(m){var p=c.T,g=s.p;try{if(c.T=null,s.p=2,m)return m()}finally{c.T=p,s.p=g,s.d.f()}},pe.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(m,p))},pe.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},pe.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"?s.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:_,fetchPriority:b}):g==="script"&&s.d.X(m,{crossOrigin:x,integrity:_,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},pe.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);s.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&&s.d.M(m)},pe.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);s.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})}},pe.preloadModule=function(m,p){if(typeof m=="string")if(p){var g=h(p.as,p.crossOrigin);s.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 s.d.m(m)},pe.requestFormReset=function(m){s.d.r(m)},pe.unstable_batchedUpdates=function(m,p){return m(p)},pe.useFormState=function(m,p,g){return c.H.useFormState(m,p,g)},pe.useFormStatus=function(){return c.H.useHostTransitionStatus()},pe.version="19.2.4",pe}var Jp;function C1(){if(Jp)return Dc.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(),Dc.exports=A1(),Dc.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 tg;function M1(){if(tg)return Va;tg=1;var l=w1(),t=Rh(),n=C1();function s(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}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 r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var i=e,a=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(a=i.return),e=i.return;while(e)}return i.tag===3?a: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(s(188))}function p(e){var i=e.alternate;if(!i){if(i=u(e),i===null)throw Error(s(188));return i!==e?null:e}for(var a=e,o=i;;){var f=a.return;if(f===null)break;var d=f.alternate;if(d===null){if(o=f.return,o!==null){a=o;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===a)return m(f),e;if(d===o)return m(f),i;d=d.sibling}throw Error(s(188))}if(a.return!==o.return)a=f,o=d;else{for(var y=!1,v=f.child;v;){if(v===a){y=!0,a=f,o=d;break}if(v===o){y=!0,o=f,a=d;break}v=v.sibling}if(!y){for(v=d.child;v;){if(v===a){y=!0,a=d,o=f;break}if(v===o){y=!0,o=d,a=f;break}v=v.sibling}if(!y)throw Error(s(189))}}if(a.alternate!==o)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?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"),A=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),Q=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 A:return"Fragment";case w:return"Profiler";case S:return"StrictMode";case P:return"Suspense";case k:return"SuspenseList";case Q: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 O:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case N: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 wt=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 W(e,i){at++,K[at]=e.current,e.current=i}var J=R(null),rt=R(null),ct=R(null),ft=R(null);function Lt(e,i){switch(W(ct,i),W(rt,e),W(J,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?pp(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=pp(i),e=gp(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(J),W(J,e)}function Et(){Y(J),Y(rt),Y(ct)}function Fe(e){e.memoizedState!==null&&W(ft,e);var i=J.current,a=gp(i,e.type);i!==a&&(W(rt,e),W(J,a))}function Qi(e){rt.current===e&&(Y(J),Y(rt)),ft.current===e&&(Y(ft),La._currentValue=et)}var ri,pi;function ye(e){if(ri===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);ri=i&&i[1]||"",pi=-1<a.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+ri+e+pi}var oi=!1;function Is(e,i){if(!e||oi)return"";oi=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={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]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=o.DetermineComponentFrameRoot(),y=d[0],v=d[1];if(y&&v){var M=y.split(`
|
|
45
|
+
`),U=v.split(`
|
|
46
|
+
`);for(f=o=0;o<M.length&&!M[o].includes("DetermineComponentFrameRoot");)o++;for(;f<U.length&&!U[f].includes("DetermineComponentFrameRoot");)f++;if(o===M.length||f===U.length)for(o=M.length-1,f=U.length-1;1<=o&&0<=f&&M[o]!==U[f];)f--;for(;1<=o&&0<=f;o--,f--)if(M[o]!==U[f]){if(o!==1||f!==1)do if(o--,f--,0>f||M[o]!==U[f]){var q=`
|
|
47
|
+
`+M[o].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=o&&0<=f);break}}}finally{oi=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ye(a):""}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="",a=null;do i+=pl(e,a),a=e,e=e.return;while(e);return i}catch(o){return`
|
|
48
|
+
Error generating stack: `+o.message+`
|
|
49
|
+
`+o.stack}}var yl=Object.prototype.hasOwnProperty,ho=l.unstable_scheduleCallback,fo=l.unstable_cancelCallback,I0=l.unstable_shouldYield,K0=l.unstable_requestPaint,Oe=l.unstable_now,$0=l.unstable_getCurrentPriorityLevel,Fh=l.unstable_ImmediatePriority,Wh=l.unstable_UserBlockingPriority,xl=l.unstable_NormalPriority,J0=l.unstable_LowPriority,Qh=l.unstable_IdlePriority,tx=l.log,ex=l.unstable_setDisableYieldValue,Ks=null,Ne=null;function Zi(e){if(typeof tx=="function"&&ex(e),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(Ks,e)}catch{}}var ke=Math.clz32?Math.clz32:sx,ix=Math.log,nx=Math.LN2;function sx(e){return e>>>=0,e===0?32:31-(ix(e)/nx|0)|0}var _l=256,bl=262144,vl=4194304;function An(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,a){var o=e.pendingLanes;if(o===0)return 0;var f=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var v=o&134217727;return v!==0?(o=v&~d,o!==0?f=An(o):(y&=v,y!==0?f=An(y):a||(a=v&~e,a!==0&&(f=An(a))))):(v=o&~d,v!==0?f=An(v):y!==0?f=An(y):a||(a=o&~e,a!==0&&(f=An(a)))),f===0?0:i!==0&&i!==f&&(i&d)===0&&(d=f&-f,a=i&-i,d>=a||d===32&&(a&4194048)!==0)?i:f}function $s(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function ax(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 Zh(){var e=vl;return vl<<=1,(vl&62914560)===0&&(vl=4194304),e}function mo(e){for(var i=[],a=0;31>a;a++)i.push(e);return i}function Js(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function lx(e,i,a,o,f,d){var y=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,M=e.expirationTimes,U=e.hiddenUpdates;for(a=y&~a;0<a;){var q=31-ke(a),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)}a&=~F}o!==0&&Ih(e,o,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~i))}function Ih(e,i,a){e.pendingLanes|=i,e.suspendedLanes&=~i;var o=31-ke(i);e.entangledLanes|=i,e.entanglements[o]=e.entanglements[o]|1073741824|a&261930}function Kh(e,i){var a=e.entangledLanes|=i;for(e=e.entanglements;a;){var o=31-ke(a),f=1<<o;f&i|e[o]&i&&(e[o]|=i),a&=~f}}function $h(e,i){var a=i&-i;return a=(a&42)!==0?1:po(a),(a&(e.suspendedLanes|i))!==0?0:a}function po(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 go(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Jh(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:Lp(e.type))}function tf(e,i){var a=L.p;try{return L.p=e,i()}finally{L.p=a}}var Ii=Math.random().toString(36).slice(2),ue="__reactFiber$"+Ii,Se="__reactProps$"+Ii,Jn="__reactContainer$"+Ii,yo="__reactEvents$"+Ii,rx="__reactListeners$"+Ii,ox="__reactHandles$"+Ii,ef="__reactResources$"+Ii,ta="__reactMarker$"+Ii;function xo(e){delete e[ue],delete e[Se],delete e[yo],delete e[rx],delete e[ox]}function ts(e){var i=e[ue];if(i)return i;for(var a=e.parentNode;a;){if(i=a[Jn]||a[ue]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(e=Tp(e);e!==null;){if(a=e[ue])return a;e=Tp(e)}return i}e=a,a=e.parentNode}return null}function es(e){if(e=e[ue]||e[Jn]){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(s(33))}function is(e){var i=e[ef];return i||(i=e[ef]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function le(e){e[ta]=!0}var nf=new Set,sf={};function Cn(e,i){ns(e,i),ns(e+"Capture",i)}function ns(e,i){for(sf[e]=i,e=0;e<i.length;e++)nf.add(i[e])}var ux=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]*$"),af={},lf={};function cx(e){return yl.call(lf,e)?!0:yl.call(af,e)?!1:ux.test(e)?lf[e]=!0:(af[e]=!0,!1)}function Tl(e,i,a){if(cx(i))if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var o=i.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+a)}}function wl(e,i,a){if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+a)}}function Ti(e,i,a,o){if(o===null)e.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(i,a,""+o)}}function We(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rf(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function hx(e,i,a){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,d=o.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return f.call(this)},set:function(y){a=""+y,d.call(this,y)}}),Object.defineProperty(e,i,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(y){a=""+y},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function _o(e){if(!e._valueTracker){var i=rf(e)?"checked":"value";e._valueTracker=hx(e,i,""+e[i])}}function of(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var a=i.getValue(),o="";return e&&(o=rf(e)?e.checked?"true":"false":e.value),e=o,e!==a?(i.setValue(e),!0):!1}function Al(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 fx=/[\n"\\]/g;function Qe(e){return e.replace(fx,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function bo(e,i,a,o,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=""+We(i)):e.value!==""+We(i)&&(e.value=""+We(i)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),i!=null?vo(e,y,We(i)):a!=null?vo(e,y,We(a)):o!=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=""+We(v):e.removeAttribute("name")}function uf(e,i,a,o,f,d,y,v){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),i!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||i!=null)){_o(e);return}a=a!=null?""+We(a):"",i=i!=null?""+We(i):a,v||i===e.value||(e.value=i),e.defaultValue=i}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=v?e.checked:!!o,e.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),_o(e)}function vo(e,i,a){i==="number"&&Al(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ss(e,i,a,o){if(e=e.options,i){i={};for(var f=0;f<a.length;f++)i["$"+a[f]]=!0;for(a=0;a<e.length;a++)f=i.hasOwnProperty("$"+e[a].value),e[a].selected!==f&&(e[a].selected=f),f&&o&&(e[a].defaultSelected=!0)}else{for(a=""+We(a),i=null,f=0;f<e.length;f++){if(e[f].value===a){e[f].selected=!0,o&&(e[f].defaultSelected=!0);return}i!==null||e[f].disabled||(i=e[f])}i!==null&&(i.selected=!0)}}function cf(e,i,a){if(i!=null&&(i=""+We(i),i!==e.value&&(e.value=i),a==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=a!=null?""+We(a):""}function hf(e,i,a,o){if(i==null){if(o!=null){if(a!=null)throw Error(s(92));if(wt(o)){if(1<o.length)throw Error(s(93));o=o[0]}a=o}a==null&&(a=""),i=a}a=We(i),e.defaultValue=a,o=e.textContent,o===a&&o!==""&&o!==null&&(e.value=o),_o(e)}function as(e,i){if(i){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=i;return}}e.textContent=i}var dx=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 ff(e,i,a){var o=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":o?e.setProperty(i,a):typeof a!="number"||a===0||dx.has(i)?i==="float"?e.cssFloat=a:e[i]=(""+a).trim():e[i]=a+"px"}function df(e,i,a){if(i!=null&&typeof i!="object")throw Error(s(62));if(e=e.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||i!=null&&i.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var f in i)o=i[f],i.hasOwnProperty(f)&&a[f]!==o&&ff(e,f,o)}else for(var d in i)i.hasOwnProperty(d)&&ff(e,d,i[d])}function So(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 mx=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"]]),px=/^[\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 px.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function wi(){}var To=null;function wo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ls=null,rs=null;function mf(e){var i=es(e);if(i&&(e=i.stateNode)){var a=e[Se]||null;t:switch(e=i.stateNode,i.type){case"input":if(bo(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Qe(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var o=a[i];if(o!==e&&o.form===e.form){var f=o[Se]||null;if(!f)throw Error(s(90));bo(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<a.length;i++)o=a[i],o.form===e.form&&of(o)}break t;case"textarea":cf(e,a.value,a.defaultValue);break t;case"select":i=a.value,i!=null&&ss(e,!!a.multiple,i,!1)}}}var Ao=!1;function pf(e,i,a){if(Ao)return e(i,a);Ao=!0;try{var o=e(i);return o}finally{if(Ao=!1,(ls!==null||rs!==null)&&(dr(),ls&&(i=ls,e=rs,rs=ls=null,mf(i),e)))for(i=0;i<e.length;i++)mf(e[i])}}function ia(e,i){var a=e.stateNode;if(a===null)return null;var o=a[Se]||null;if(o===null)return null;a=o[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":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break t;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,i,typeof a));return a}var Ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Co=!1;if(Ai)try{var na={};Object.defineProperty(na,"passive",{get:function(){Co=!0}}),window.addEventListener("test",na,na),window.removeEventListener("test",na,na)}catch{Co=!1}var Ki=null,Mo=null,Ml=null;function gf(){if(Ml)return Ml;var e,i=Mo,a=i.length,o,f="value"in Ki?Ki.value:Ki.textContent,d=f.length;for(e=0;e<a&&i[e]===f[e];e++);var y=a-e;for(o=1;o<=y&&i[a-o]===f[d-o];o++);return Ml=f.slice(e,1<o?1-o: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 yf(){return!1}function Te(e){function i(a,o,f,d,y){this._reactName=a,this._targetInst=f,this.type=o,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(d):d[v]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Rl:yf,this.isPropagationStopped=yf,this}return x(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Rl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),i}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zl=Te(Mn),sa=x({},Mn,{view:0,detail:0}),gx=Te(sa),Eo,Ro,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:Do,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"?(Eo=e.screenX-aa.screenX,Ro=e.screenY-aa.screenY):Ro=Eo=0,aa=e),Eo)},movementY:function(e){return"movementY"in e?e.movementY:Ro}}),xf=Te(Dl),yx=x({},Dl,{dataTransfer:0}),xx=Te(yx),_x=x({},sa,{relatedTarget:0}),zo=Te(_x),bx=x({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0}),vx=Te(bx),Sx=x({},Mn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tx=Te(Sx),wx=x({},Mn,{data:0}),_f=Te(wx),Ax={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cx={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"},Mx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ex(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=Mx[e])?!!i[e]:!1}function Do(){return Ex}var Rx=x({},sa,{key:function(e){if(e.key){var i=Ax[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"?Cx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Do,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}}),zx=Te(Rx),Dx=x({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bf=Te(Dx),Bx=x({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Do}),Ox=Te(Bx),Nx=x({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0}),kx=Te(Nx),Gx=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}),Ux=Te(Gx),Hx=x({},Mn,{newState:0,oldState:0}),Lx=Te(Hx),jx=[9,13,27,32],Bo=Ai&&"CompositionEvent"in window,la=null;Ai&&"documentMode"in document&&(la=document.documentMode);var Yx=Ai&&"TextEvent"in window&&!la,vf=Ai&&(!Bo||la&&8<la&&11>=la),Sf=" ",Tf=!1;function wf(e,i){switch(e){case"keyup":return jx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Af(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var os=!1;function qx(e,i){switch(e){case"compositionend":return Af(i);case"keypress":return i.which!==32?null:(Tf=!0,Sf);case"textInput":return e=i.data,e===Sf&&Tf?null:e;default:return null}}function Xx(e,i){if(os)return e==="compositionend"||!Bo&&wf(e,i)?(e=gf(),Ml=Mo=Ki=null,os=!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 vf&&i.locale!=="ko"?null:i.data;default:return null}}var Vx={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 Cf(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!Vx[e.type]:i==="textarea"}function Mf(e,i,a,o){ls?rs?rs.push(o):rs=[o]:ls=o,i=br(i,"onChange"),0<i.length&&(a=new zl("onChange","change",null,a,o),e.push({event:a,listeners:i}))}var ra=null,oa=null;function Px(e){up(e,0)}function Bl(e){var i=ea(e);if(of(i))return e}function Ef(e,i){if(e==="change")return i}var Rf=!1;if(Ai){var Oo;if(Ai){var No="oninput"in document;if(!No){var zf=document.createElement("div");zf.setAttribute("oninput","return;"),No=typeof zf.oninput=="function"}Oo=No}else Oo=!1;Rf=Oo&&(!document.documentMode||9<document.documentMode)}function Df(){ra&&(ra.detachEvent("onpropertychange",Bf),oa=ra=null)}function Bf(e){if(e.propertyName==="value"&&Bl(oa)){var i=[];Mf(i,oa,e,wo(e)),pf(Px,i)}}function Fx(e,i,a){e==="focusin"?(Df(),ra=i,oa=a,ra.attachEvent("onpropertychange",Bf)):e==="focusout"&&Df()}function Wx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bl(oa)}function Qx(e,i){if(e==="click")return Bl(i)}function Zx(e,i){if(e==="input"||e==="change")return Bl(i)}function Ix(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var Ge=typeof Object.is=="function"?Object.is:Ix;function ua(e,i){if(Ge(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var a=Object.keys(e),o=Object.keys(i);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var f=a[o];if(!yl.call(i,f)||!Ge(e[f],i[f]))return!1}return!0}function Of(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nf(e,i){var a=Of(e);e=0;for(var o;a;){if(a.nodeType===3){if(o=e+a.textContent.length,e<=i&&o>=i)return{node:a,offset:i-e};e=o}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=Of(a)}}function kf(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?kf(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Gf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=Al(e.document);i instanceof e.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)e=i.contentWindow;else break;i=Al(e.document)}return i}function ko(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 Kx=Ai&&"documentMode"in document&&11>=document.documentMode,us=null,Go=null,ca=null,Uo=!1;function Uf(e,i,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Uo||us==null||us!==Al(o)||(o=us,"selectionStart"in o&&ko(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ca&&ua(ca,o)||(ca=o,o=br(Go,"onSelect"),0<o.length&&(i=new zl("onSelect","select",null,i,a),e.push({event:i,listeners:o}),i.target=us)))}function En(e,i){var a={};return a[e.toLowerCase()]=i.toLowerCase(),a["Webkit"+e]="webkit"+i,a["Moz"+e]="moz"+i,a}var cs={animationend:En("Animation","AnimationEnd"),animationiteration:En("Animation","AnimationIteration"),animationstart:En("Animation","AnimationStart"),transitionrun:En("Transition","TransitionRun"),transitionstart:En("Transition","TransitionStart"),transitioncancel:En("Transition","TransitionCancel"),transitionend:En("Transition","TransitionEnd")},Ho={},Hf={};Ai&&(Hf=document.createElement("div").style,"AnimationEvent"in window||(delete cs.animationend.animation,delete cs.animationiteration.animation,delete cs.animationstart.animation),"TransitionEvent"in window||delete cs.transitionend.transition);function Rn(e){if(Ho[e])return Ho[e];if(!cs[e])return e;var i=cs[e],a;for(a in i)if(i.hasOwnProperty(a)&&a in Hf)return Ho[e]=i[a];return e}var Lf=Rn("animationend"),jf=Rn("animationiteration"),Yf=Rn("animationstart"),$x=Rn("transitionrun"),Jx=Rn("transitionstart"),t_=Rn("transitioncancel"),qf=Rn("transitionend"),Xf=new Map,Lo="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(" ");Lo.push("scrollEnd");function ui(e,i){Xf.set(e,i),Cn(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)},Ze=[],hs=0,jo=0;function Nl(){for(var e=hs,i=jo=hs=0;i<e;){var a=Ze[i];Ze[i++]=null;var o=Ze[i];Ze[i++]=null;var f=Ze[i];Ze[i++]=null;var d=Ze[i];if(Ze[i++]=null,o!==null&&f!==null){var y=o.pending;y===null?f.next=f:(f.next=y.next,y.next=f),o.pending=f}d!==0&&Vf(a,f,d)}}function kl(e,i,a,o){Ze[hs++]=e,Ze[hs++]=i,Ze[hs++]=a,Ze[hs++]=o,jo|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Yo(e,i,a,o){return kl(e,i,a,o),Gl(e)}function zn(e,i){return kl(e,null,null,i),Gl(e)}function Vf(e,i,a){e.lanes|=a;var o=e.alternate;o!==null&&(o.lanes|=a);for(var f=!1,d=e.return;d!==null;)d.childLanes|=a,o=d.alternate,o!==null&&(o.childLanes|=a),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-ke(a),e=d.hiddenUpdates,o=e[f],o===null?e[f]=[i]:o.push(i),i.lane=a|536870912),d):null}function Gl(e){if(50<Ba)throw Ba=0,Iu=null,Error(s(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var fs={};function e_(e,i,a,o){this.tag=e,this.key=a,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ue(e,i,a,o){return new e_(e,i,a,o)}function qo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ci(e,i){var a=e.alternate;return a===null?(a=Ue(e.tag,i,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=i,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,i=e.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Pf(e,i){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,i=a.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function Ul(e,i,a,o,f,d){var y=0;if(o=e,typeof e=="function")qo(e)&&(y=1);else if(typeof e=="string")y=l1(e,a,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case Q:return e=Ue(31,a,i,f),e.elementType=Q,e.lanes=d,e;case A:return Dn(a.children,f,d,i);case S:y=8,f|=24;break;case w:return e=Ue(12,a,i,f|2),e.elementType=w,e.lanes=d,e;case P:return e=Ue(13,a,i,f),e.elementType=P,e.lanes=d,e;case k:return e=Ue(19,a,i,f),e.elementType=k,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 O:y=11;break t;case N:y=14;break t;case $:y=16,o=null;break t}y=29,a=Error(s(130,e===null?"null":typeof e,"")),o=null}return i=Ue(y,a,i,f),i.elementType=e,i.type=o,i.lanes=d,i}function Dn(e,i,a,o){return e=Ue(7,e,o,i),e.lanes=a,e}function Xo(e,i,a){return e=Ue(6,e,null,i),e.lanes=a,e}function Ff(e){var i=Ue(18,null,null,0);return i.stateNode=e,i}function Vo(e,i,a){return i=Ue(4,e.children!==null?e.children:[],e.key,i),i.lanes=a,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Wf=new WeakMap;function Ie(e,i){if(typeof e=="object"&&e!==null){var a=Wf.get(e);return a!==void 0?a:(i={value:e,source:i,stack:gl(i)},Wf.set(e,i),i)}return{value:e,source:i,stack:gl(i)}}var ds=[],ms=0,Hl=null,ha=0,Ke=[],$e=0,$i=null,gi=1,yi="";function Mi(e,i){ds[ms++]=ha,ds[ms++]=Hl,Hl=e,ha=i}function Qf(e,i,a){Ke[$e++]=gi,Ke[$e++]=yi,Ke[$e++]=$i,$i=e;var o=gi;e=yi;var f=32-ke(o)-1;o&=~(1<<f),a+=1;var d=32-ke(i)+f;if(30<d){var y=f-f%5;d=(o&(1<<y)-1).toString(32),o>>=y,f-=y,gi=1<<32-ke(i)+f|a<<f|o,yi=d+e}else gi=1<<d|a<<f|o,yi=e}function Po(e){e.return!==null&&(Mi(e,1),Qf(e,1,0))}function Fo(e){for(;e===Hl;)Hl=ds[--ms],ds[ms]=null,ha=ds[--ms],ds[ms]=null;for(;e===$i;)$i=Ke[--$e],Ke[$e]=null,yi=Ke[--$e],Ke[$e]=null,gi=Ke[--$e],Ke[$e]=null}function Zf(e,i){Ke[$e++]=gi,Ke[$e++]=yi,Ke[$e++]=$i,gi=i.id,yi=i.overflow,$i=e}var ce=null,jt=null,Tt=!1,Ji=null,Je=!1,Wo=Error(s(519));function tn(e){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fa(Ie(i,e)),Wo}function If(e){var i=e.stateNode,a=e.type,o=e.memoizedProps;switch(i[ue]=e,i[Se]=o,a){case"dialog":_t("cancel",i),_t("close",i);break;case"iframe":case"object":case"embed":_t("load",i);break;case"video":case"audio":for(a=0;a<Na.length;a++)_t(Na[a],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),uf(i,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":_t("invalid",i);break;case"textarea":_t("invalid",i),hf(i,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||o.suppressHydrationWarning===!0||dp(i.textContent,a)?(o.popover!=null&&(_t("beforetoggle",i),_t("toggle",i)),o.onScroll!=null&&_t("scroll",i),o.onScrollEnd!=null&&_t("scrollend",i),o.onClick!=null&&(i.onclick=wi),i=!0):i=!1,i||tn(e,!0)}function Kf(e){for(ce=e.return;ce;)switch(ce.tag){case 5:case 31:case 13:Je=!1;return;case 27:case 3:Je=!0;return;default:ce=ce.return}}function ps(e){if(e!==ce)return!1;if(!Tt)return Kf(e),Tt=!0,!1;var i=e.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||hc(e.type,e.memoizedProps)),a=!a),a&&jt&&tn(e),Kf(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));jt=Sp(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));jt=Sp(e)}else i===27?(i=jt,pn(e.type)?(e=gc,gc=null,jt=e):jt=i):jt=ce?ei(e.stateNode.nextSibling):null;return!0}function Bn(){jt=ce=null,Tt=!1}function Qo(){var e=Ji;return e!==null&&(Me===null?Me=e:Me.push.apply(Me,e),Ji=null),e}function fa(e){Ji===null?Ji=[e]:Ji.push(e)}var Zo=R(null),On=null,Ei=null;function en(e,i,a){W(Zo,i._currentValue),i._currentValue=a}function Ri(e){e._currentValue=Zo.current,Y(Zo)}function Io(e,i,a){for(;e!==null;){var o=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,o!==null&&(o.childLanes|=i)):o!==null&&(o.childLanes&i)!==i&&(o.childLanes|=i),e===a)break;e=e.return}}function Ko(e,i,a,o){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|=a,v=d.alternate,v!==null&&(v.lanes|=a),Io(d.return,a,e),o||(y=null);break t}d=v.next}}else if(f.tag===18){if(y=f.return,y===null)throw Error(s(341));y.lanes|=a,d=y.alternate,d!==null&&(d.lanes|=a),Io(y,a,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 gs(e,i,a,o){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(s(387));if(y=y.memoizedProps,y!==null){var v=f.type;Ge(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(s(387));y.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(La):e=[La])}f=f.return}e!==null&&Ko(i,e,a,o),i.flags|=262144}function Ll(e){for(e=e.firstContext;e!==null;){if(!Ge(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Nn(e){On=e,Ei=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function he(e){return $f(On,e)}function jl(e,i){return On===null&&Nn(e),$f(e,i)}function $f(e,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},Ei===null){if(e===null)throw Error(s(308));Ei=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else Ei=Ei.next=i;return a}var i_=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(a,o){e.push(o)}};this.abort=function(){i.aborted=!0,e.forEach(function(a){return a()})}},n_=l.unstable_scheduleCallback,s_=l.unstable_NormalPriority,te={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $o(){return{controller:new i_,data:new Map,refCount:0}}function da(e){e.refCount--,e.refCount===0&&n_(s_,function(){e.controller.abort()})}var ma=null,Jo=0,ys=0,xs=null;function a_(e,i){if(ma===null){var a=ma=[];Jo=0,ys=ic(),xs={status:"pending",value:void 0,then:function(o){a.push(o)}}}return Jo++,i.then(Jf,Jf),i}function Jf(){if(--Jo===0&&ma!==null){xs!==null&&(xs.status="fulfilled");var e=ma;ma=null,ys=0,xs=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function l_(e,i){var a=[],o={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return e.then(function(){o.status="fulfilled",o.value=i;for(var f=0;f<a.length;f++)(0,a[f])(i)},function(f){for(o.status="rejected",o.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),o}var td=D.S;D.S=function(e,i){Um=Oe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&a_(e,i),td!==null&&td(e,i)};var kn=R(null);function tu(){var e=kn.current;return e!==null?e:Ut.pooledCache}function Yl(e,i){i===null?W(kn,kn.current):W(kn,i.pool)}function ed(){var e=tu();return e===null?null:{parent:te._currentValue,pool:e}}var _s=Error(s(460)),eu=Error(s(474)),ql=Error(s(542)),Xl={then:function(){}};function id(e){return e=e.status,e==="fulfilled"||e==="rejected"}function nd(e,i,a){switch(a=e[a],a===void 0?e.push(i):a!==i&&(i.then(wi,wi),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,ad(e),e;default:if(typeof i.status=="string")i.then(wi,wi);else{if(e=Ut,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=i,e.status="pending",e.then(function(o){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=o}},function(o){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=o}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,ad(e),e}throw Un=i,_s}}function Gn(e){try{var i=e._init;return i(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Un=a,_s):a}}var Un=null;function sd(){if(Un===null)throw Error(s(459));var e=Un;return Un=null,e}function ad(e){if(e===_s||e===ql)throw Error(s(483))}var bs=null,pa=0;function Vl(e){var i=pa;return pa+=1,bs===null&&(bs=[]),nd(bs,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(s(525)):(e=Object.prototype.toString.call(i),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function ld(e){function i(B,z){if(e){var G=B.deletions;G===null?(B.deletions=[z],B.flags|=16):G.push(z)}}function a(B,z){if(!e)return null;for(;z!==null;)i(B,z),z=z.sibling;return null}function o(B){for(var z=new Map;B!==null;)B.key!==null?z.set(B.key,B):z.set(B.index,B),B=B.sibling;return z}function f(B,z){return B=Ci(B,z),B.index=0,B.sibling=null,B}function d(B,z,G){return B.index=G,e?(G=B.alternate,G!==null?(G=G.index,G<z?(B.flags|=67108866,z):G):(B.flags|=67108866,z)):(B.flags|=1048576,z)}function y(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function v(B,z,G,V){return z===null||z.tag!==6?(z=Xo(G,B.mode,V),z.return=B,z):(z=f(z,G),z.return=B,z)}function M(B,z,G,V){var ot=G.type;return ot===A?q(B,z,G.props.children,V,G.key):z!==null&&(z.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===$&&Gn(ot)===z.type)?(z=f(z,G.props),ga(z,G),z.return=B,z):(z=Ul(G.type,G.key,G.props,null,B.mode,V),ga(z,G),z.return=B,z)}function U(B,z,G,V){return z===null||z.tag!==4||z.stateNode.containerInfo!==G.containerInfo||z.stateNode.implementation!==G.implementation?(z=Vo(G,B.mode,V),z.return=B,z):(z=f(z,G.children||[]),z.return=B,z)}function q(B,z,G,V,ot){return z===null||z.tag!==7?(z=Dn(G,B.mode,V,ot),z.return=B,z):(z=f(z,G),z.return=B,z)}function F(B,z,G){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Xo(""+z,B.mode,G),z.return=B,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case b:return G=Ul(z.type,z.key,z.props,null,B.mode,G),ga(G,z),G.return=B,G;case T:return z=Vo(z,B.mode,G),z.return=B,z;case $:return z=Gn(z),F(B,z,G)}if(wt(z)||tt(z))return z=Dn(z,B.mode,G,null),z.return=B,z;if(typeof z.then=="function")return F(B,Vl(z),G);if(z.$$typeof===E)return F(B,jl(B,z),G);Pl(B,z)}return null}function H(B,z,G,V){var ot=z!==null?z.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return ot!==null?null:v(B,z,""+G,V);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return G.key===ot?M(B,z,G,V):null;case T:return G.key===ot?U(B,z,G,V):null;case $:return G=Gn(G),H(B,z,G,V)}if(wt(G)||tt(G))return ot!==null?null:q(B,z,G,V,null);if(typeof G.then=="function")return H(B,z,Vl(G),V);if(G.$$typeof===E)return H(B,z,jl(B,G),V);Pl(B,G)}return null}function j(B,z,G,V,ot){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return B=B.get(G)||null,v(z,B,""+V,ot);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case b:return B=B.get(V.key===null?G:V.key)||null,M(z,B,V,ot);case T:return B=B.get(V.key===null?G:V.key)||null,U(z,B,V,ot);case $:return V=Gn(V),j(B,z,G,V,ot)}if(wt(V)||tt(V))return B=B.get(G)||null,q(z,B,V,ot,null);if(typeof V.then=="function")return j(B,z,G,Vl(V),ot);if(V.$$typeof===E)return j(B,z,G,jl(z,V),ot);Pl(z,V)}return null}function st(B,z,G,V){for(var ot=null,Ct=null,lt=z,gt=z=0,vt=null;lt!==null&><G.length;gt++){lt.index>gt?(vt=lt,lt=null):vt=lt.sibling;var Mt=H(B,lt,G[gt],V);if(Mt===null){lt===null&&(lt=vt);break}e&<&&Mt.alternate===null&&i(B,lt),z=d(Mt,z,gt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt,lt=vt}if(gt===G.length)return a(B,lt),Tt&&Mi(B,gt),ot;if(lt===null){for(;gt<G.length;gt++)lt=F(B,G[gt],V),lt!==null&&(z=d(lt,z,gt),Ct===null?ot=lt:Ct.sibling=lt,Ct=lt);return Tt&&Mi(B,gt),ot}for(lt=o(lt);gt<G.length;gt++)vt=j(lt,B,gt,G[gt],V),vt!==null&&(e&&vt.alternate!==null&<.delete(vt.key===null?gt:vt.key),z=d(vt,z,gt),Ct===null?ot=vt:Ct.sibling=vt,Ct=vt);return e&<.forEach(function(bn){return i(B,bn)}),Tt&&Mi(B,gt),ot}function ut(B,z,G,V){if(G==null)throw Error(s(151));for(var ot=null,Ct=null,lt=z,gt=z=0,vt=null,Mt=G.next();lt!==null&&!Mt.done;gt++,Mt=G.next()){lt.index>gt?(vt=lt,lt=null):vt=lt.sibling;var bn=H(B,lt,Mt.value,V);if(bn===null){lt===null&&(lt=vt);break}e&<&&bn.alternate===null&&i(B,lt),z=d(bn,z,gt),Ct===null?ot=bn:Ct.sibling=bn,Ct=bn,lt=vt}if(Mt.done)return a(B,lt),Tt&&Mi(B,gt),ot;if(lt===null){for(;!Mt.done;gt++,Mt=G.next())Mt=F(B,Mt.value,V),Mt!==null&&(z=d(Mt,z,gt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt);return Tt&&Mi(B,gt),ot}for(lt=o(lt);!Mt.done;gt++,Mt=G.next())Mt=j(lt,B,gt,Mt.value,V),Mt!==null&&(e&&Mt.alternate!==null&<.delete(Mt.key===null?gt:Mt.key),z=d(Mt,z,gt),Ct===null?ot=Mt:Ct.sibling=Mt,Ct=Mt);return e&<.forEach(function(y1){return i(B,y1)}),Tt&&Mi(B,gt),ot}function kt(B,z,G,V){if(typeof G=="object"&&G!==null&&G.type===A&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case b:t:{for(var ot=G.key;z!==null;){if(z.key===ot){if(ot=G.type,ot===A){if(z.tag===7){a(B,z.sibling),V=f(z,G.props.children),V.return=B,B=V;break t}}else if(z.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===$&&Gn(ot)===z.type){a(B,z.sibling),V=f(z,G.props),ga(V,G),V.return=B,B=V;break t}a(B,z);break}else i(B,z);z=z.sibling}G.type===A?(V=Dn(G.props.children,B.mode,V,G.key),V.return=B,B=V):(V=Ul(G.type,G.key,G.props,null,B.mode,V),ga(V,G),V.return=B,B=V)}return y(B);case T:t:{for(ot=G.key;z!==null;){if(z.key===ot)if(z.tag===4&&z.stateNode.containerInfo===G.containerInfo&&z.stateNode.implementation===G.implementation){a(B,z.sibling),V=f(z,G.children||[]),V.return=B,B=V;break t}else{a(B,z);break}else i(B,z);z=z.sibling}V=Vo(G,B.mode,V),V.return=B,B=V}return y(B);case $:return G=Gn(G),kt(B,z,G,V)}if(wt(G))return st(B,z,G,V);if(tt(G)){if(ot=tt(G),typeof ot!="function")throw Error(s(150));return G=ot.call(G),ut(B,z,G,V)}if(typeof G.then=="function")return kt(B,z,Vl(G),V);if(G.$$typeof===E)return kt(B,z,jl(B,G),V);Pl(B,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,z!==null&&z.tag===6?(a(B,z.sibling),V=f(z,G),V.return=B,B=V):(a(B,z),V=Xo(G,B.mode,V),V.return=B,B=V),y(B)):a(B,z)}return function(B,z,G,V){try{pa=0;var ot=kt(B,z,G,V);return bs=null,ot}catch(lt){if(lt===_s||lt===ql)throw lt;var Ct=Ue(29,lt,null,B.mode);return Ct.lanes=V,Ct.return=B,Ct}finally{}}}var Hn=ld(!0),rd=ld(!1),nn=!1;function iu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nu(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 sn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function an(e,i,a){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Rt&2)!==0){var f=o.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),o.pending=i,i=Gl(e),Vf(e,null,a),i}return kl(e,o,i,a),Gl(e)}function ya(e,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var o=i.lanes;o&=e.pendingLanes,a|=o,i.lanes=a,Kh(e,a)}}function su(e,i){var a=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var f=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var y={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?f=d=y:d=d.next=y,a=a.next}while(a!==null);d===null?f=d=i:d=d.next=i}else f=d=i;a={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=i:e.next=i,a.lastBaseUpdate=i}var au=!1;function xa(){if(au){var e=xs;if(e!==null)throw e}}function _a(e,i,a,o){au=!1;var f=e.updateQueue;nn=!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:(o&H)===H){H!==0&&H===ys&&(au=!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 kt=a;switch(ut.tag){case 1:if(st=ut.payload,typeof st=="function"){F=st.call(kt,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(kt,F,H):st,H==null)break t;F=x({},F,H);break t;case 2:nn=!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),cn|=y,e.lanes=y,e.memoizedState=F}}function od(e,i){if(typeof e!="function")throw Error(s(191,e));e.call(i)}function ud(e,i){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)od(a[e],i)}var vs=R(null),Fl=R(0);function cd(e,i){e=Hi,W(Fl,e),W(vs,i),Hi=e|i.baseLanes}function lu(){W(Fl,Hi),W(vs,vs.current)}function ru(){Hi=Fl.current,Y(vs),Y(Fl)}var He=R(null),ti=null;function ln(e){var i=e.alternate;W(Zt,Zt.current&1),W(He,e),ti===null&&(i===null||vs.current!==null||i.memoizedState!==null)&&(ti=e)}function ou(e){W(Zt,Zt.current),W(He,e),ti===null&&(ti=e)}function hd(e){e.tag===22?(W(Zt,Zt.current),W(He,e),ti===null&&(ti=e)):rn()}function rn(){W(Zt,Zt.current),W(He,He.current)}function Le(e){Y(He),ti===e&&(ti=null),Y(Zt)}var Zt=R(0);function Wl(e){for(var i=e;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||mc(a)||pc(a)))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 zi=0,pt=null,Ot=null,ee=null,Ql=!1,Ss=!1,Ln=!1,Zl=0,ba=0,Ts=null,r_=0;function Vt(){throw Error(s(321))}function uu(e,i){if(i===null)return!1;for(var a=0;a<i.length&&a<e.length;a++)if(!Ge(e[a],i[a]))return!1;return!0}function cu(e,i,a,o,f,d){return zi=d,pt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,D.H=e===null||e.memoizedState===null?Qd:Au,Ln=!1,d=a(o,f),Ln=!1,Ss&&(d=dd(i,a,o,f)),fd(e),d}function fd(e){D.H=Ta;var i=Ot!==null&&Ot.next!==null;if(zi=0,ee=Ot=pt=null,Ql=!1,ba=0,Ts=null,i)throw Error(s(300));e===null||ie||(e=e.dependencies,e!==null&&Ll(e)&&(ie=!0))}function dd(e,i,a,o){pt=e;var f=0;do{if(Ss&&(Ts=null),ba=0,Ss=!1,25<=f)throw Error(s(301));if(f+=1,ee=Ot=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=Zd,d=i(a,o)}while(Ss);return d}function o_(){var e=D.H,i=e.useState()[0];return i=typeof i.then=="function"?va(i):i,e=e.useState()[0],(Ot!==null?Ot.memoizedState:null)!==e&&(pt.flags|=1024),i}function hu(){var e=Zl!==0;return Zl=0,e}function fu(e,i,a){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~a}function du(e){if(Ql){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}Ql=!1}zi=0,ee=Ot=pt=null,Ss=!1,ba=Zl=0,Ts=null}function xe(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ee===null?pt.memoizedState=ee=e:ee=ee.next=e,ee}function It(){if(Ot===null){var e=pt.alternate;e=e!==null?e.memoizedState:null}else e=Ot.next;var i=ee===null?pt.memoizedState:ee.next;if(i!==null)ee=i,Ot=e;else{if(e===null)throw pt.alternate===null?Error(s(467)):Error(s(310));Ot=e,e={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},ee===null?pt.memoizedState=ee=e:ee=ee.next=e}return ee}function Il(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function va(e){var i=ba;return ba+=1,Ts===null&&(Ts=[]),e=nd(Ts,e,i),i=pt,(ee===null?i.memoizedState:ee.next)===null&&(i=i.alternate,D.H=i===null||i.memoizedState===null?Qd:Au),e}function Kl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return va(e);if(e.$$typeof===E)return he(e)}throw Error(s(438,String(e)))}function mu(e){var i=null,a=pt.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var o=pt.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(i={data:o.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=Il(),pt.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(e),o=0;o<e;o++)a[o]=Z;return i.index++,a}function Di(e,i){return typeof i=="function"?i(e):i}function $l(e){var i=It();return pu(i,Ot,e)}function pu(e,i,a){var o=e.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=a;var f=e.baseQueue,d=o.pending;if(d!==null){if(f!==null){var y=f.next;f.next=d.next,d.next=y}i.baseQueue=f=d,o.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:(zi&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===ys&&(q=!0);else if((zi&H)===H){U=U.next,H===ys&&(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,pt.lanes|=H,cn|=H;F=U.action,Ln&&a(d,F),d=U.hasEagerState?U.eagerState:a(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,pt.lanes|=F,cn|=F;U=U.next}while(U!==null&&U!==i);if(M===null?y=d:M.next=v,!Ge(d,e.memoizedState)&&(ie=!0,q&&(a=xs,a!==null)))throw a;e.memoizedState=d,e.baseState=y,e.baseQueue=M,o.lastRenderedState=d}return f===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function gu(e){var i=It(),a=i.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var o=a.dispatch,f=a.pending,d=i.memoizedState;if(f!==null){a.pending=null;var y=f=f.next;do d=e(d,y.action),y=y.next;while(y!==f);Ge(d,i.memoizedState)||(ie=!0),i.memoizedState=d,i.baseQueue===null&&(i.baseState=d),a.lastRenderedState=d}return[d,o]}function md(e,i,a){var o=pt,f=It(),d=Tt;if(d){if(a===void 0)throw Error(s(407));a=a()}else a=i();var y=!Ge((Ot||f).memoizedState,a);if(y&&(f.memoizedState=a,ie=!0),f=f.queue,_u(yd.bind(null,o,f,e),[e]),f.getSnapshot!==i||y||ee!==null&&ee.memoizedState.tag&1){if(o.flags|=2048,ws(9,{destroy:void 0},gd.bind(null,o,f,a,i),null),Ut===null)throw Error(s(349));d||(zi&127)!==0||pd(o,i,a)}return a}function pd(e,i,a){e.flags|=16384,e={getSnapshot:i,value:a},i=pt.updateQueue,i===null?(i=Il(),pt.updateQueue=i,i.stores=[e]):(a=i.stores,a===null?i.stores=[e]:a.push(e))}function gd(e,i,a,o){i.value=a,i.getSnapshot=o,xd(i)&&_d(e)}function yd(e,i,a){return a(function(){xd(i)&&_d(e)})}function xd(e){var i=e.getSnapshot;e=e.value;try{var a=i();return!Ge(e,a)}catch{return!0}}function _d(e){var i=zn(e,2);i!==null&&Ee(i,e,2)}function yu(e){var i=xe();if(typeof e=="function"){var a=e;if(e=a(),Ln){Zi(!0);try{a()}finally{Zi(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:e},i}function bd(e,i,a,o){return e.baseState=a,pu(e,Ot,typeof o=="function"?o:Di)}function u_(e,i,a,o,f){if(er(e))throw Error(s(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?a(!0):d.isTransition=!1,o(d),a=i.pending,a===null?(d.next=i.pending=d,vd(i,d)):(d.next=a.next,i.pending=a.next=d)}}function vd(e,i){var a=i.action,o=i.payload,f=e.state;if(i.isTransition){var d=D.T,y={};D.T=y;try{var v=a(f,o),M=D.S;M!==null&&M(y,v),Sd(e,i,v)}catch(U){xu(e,i,U)}finally{d!==null&&y.types!==null&&(d.types=y.types),D.T=d}}else try{d=a(f,o),Sd(e,i,d)}catch(U){xu(e,i,U)}}function Sd(e,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Td(e,i,o)},function(o){return xu(e,i,o)}):Td(e,i,a)}function Td(e,i,a){i.status="fulfilled",i.value=a,wd(i),e.state=a,i=e.pending,i!==null&&(a=i.next,a===i?e.pending=null:(a=a.next,i.next=a,vd(e,a)))}function xu(e,i,a){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do i.status="rejected",i.reason=a,wd(i),i=i.next;while(i!==o)}e.action=null}function wd(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function Ad(e,i){return i}function Cd(e,i){if(Tt){var a=Ut.formState;if(a!==null){t:{var o=pt;if(Tt){if(jt){e:{for(var f=jt,d=Je;f.nodeType!==8;){if(!d){f=null;break e}if(f=ei(f.nextSibling),f===null){f=null;break e}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){jt=ei(f.nextSibling),o=f.data==="F!";break t}}tn(o)}o=!1}o&&(i=a[0])}}return a=xe(),a.memoizedState=a.baseState=i,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ad,lastRenderedState:i},a.queue=o,a=Pd.bind(null,pt,o),o.dispatch=a,o=yu(!1),d=wu.bind(null,pt,!1,o.queue),o=xe(),f={state:i,dispatch:null,action:e,pending:null},o.queue=f,a=u_.bind(null,pt,f,d,a),f.dispatch=a,o.memoizedState=e,[i,a,!1]}function Md(e){var i=It();return Ed(i,Ot,e)}function Ed(e,i,a){if(i=pu(e,i,Ad)[0],e=$l(Di)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var o=va(i)}catch(y){throw y===_s?ql:y}else o=i;i=It();var f=i.queue,d=f.dispatch;return a!==i.memoizedState&&(pt.flags|=2048,ws(9,{destroy:void 0},c_.bind(null,f,a),null)),[o,d,e]}function c_(e,i){e.action=i}function Rd(e){var i=It(),a=Ot;if(a!==null)return Ed(i,a,e);It(),i=i.memoizedState,a=It();var o=a.queue.dispatch;return a.memoizedState=e,[i,o,!1]}function ws(e,i,a,o){return e={tag:e,create:a,deps:o,inst:i,next:null},i=pt.updateQueue,i===null&&(i=Il(),pt.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=e.next=e:(o=a.next,a.next=e,e.next=o,i.lastEffect=e),e}function zd(){return It().memoizedState}function Jl(e,i,a,o){var f=xe();pt.flags|=e,f.memoizedState=ws(1|i,{destroy:void 0},a,o===void 0?null:o)}function tr(e,i,a,o){var f=It();o=o===void 0?null:o;var d=f.memoizedState.inst;Ot!==null&&o!==null&&uu(o,Ot.memoizedState.deps)?f.memoizedState=ws(i,d,a,o):(pt.flags|=e,f.memoizedState=ws(1|i,d,a,o))}function Dd(e,i){Jl(8390656,8,e,i)}function _u(e,i){tr(2048,8,e,i)}function h_(e){pt.flags|=4;var i=pt.updateQueue;if(i===null)i=Il(),pt.updateQueue=i,i.events=[e];else{var a=i.events;a===null?i.events=[e]:a.push(e)}}function Bd(e){var i=It().memoizedState;return h_({ref:i,nextImpl:e}),function(){if((Rt&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function Od(e,i){return tr(4,2,e,i)}function Nd(e,i){return tr(4,4,e,i)}function kd(e,i){if(typeof i=="function"){e=e();var a=i(e);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function Gd(e,i,a){a=a!=null?a.concat([e]):null,tr(4,4,kd.bind(null,i,e),a)}function bu(){}function Ud(e,i){var a=It();i=i===void 0?null:i;var o=a.memoizedState;return i!==null&&uu(i,o[1])?o[0]:(a.memoizedState=[e,i],e)}function Hd(e,i){var a=It();i=i===void 0?null:i;var o=a.memoizedState;if(i!==null&&uu(i,o[1]))return o[0];if(o=e(),Ln){Zi(!0);try{e()}finally{Zi(!1)}}return a.memoizedState=[o,i],o}function vu(e,i,a){return a===void 0||(zi&1073741824)!==0&&(bt&261930)===0?e.memoizedState=i:(e.memoizedState=a,e=Lm(),pt.lanes|=e,cn|=e,a)}function Ld(e,i,a,o){return Ge(a,i)?a:vs.current!==null?(e=vu(e,a,o),Ge(e,i)||(ie=!0),e):(zi&42)===0||(zi&1073741824)!==0&&(bt&261930)===0?(ie=!0,e.memoizedState=a):(e=Lm(),pt.lanes|=e,cn|=e,i)}function jd(e,i,a,o,f){var d=L.p;L.p=d!==0&&8>d?d:8;var y=D.T,v={};D.T=v,wu(e,!1,i,a);try{var M=f(),U=D.S;if(U!==null&&U(v,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var q=l_(M,o);Sa(e,i,q,qe(e))}else Sa(e,i,o,qe(e))}catch(F){Sa(e,i,{then:function(){},status:"rejected",reason:F},qe())}finally{L.p=d,y!==null&&v.types!==null&&(y.types=v.types),D.T=y}}function f_(){}function Su(e,i,a,o){if(e.tag!==5)throw Error(s(476));var f=Yd(e).queue;jd(e,f,i,et,a===null?f_:function(){return qd(e),a(o)})}function Yd(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:Di,lastRenderedState:et},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:a},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function qd(e){var i=Yd(e);i.next===null&&(i=e.alternate.memoizedState),Sa(e,i.next.queue,{},qe())}function Tu(){return he(La)}function Xd(){return It().memoizedState}function Vd(){return It().memoizedState}function d_(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var a=qe();e=sn(a);var o=an(i,e,a);o!==null&&(Ee(o,i,a),ya(o,i,a)),i={cache:$o()},e.payload=i;return}i=i.return}}function m_(e,i,a){var o=qe();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},er(e)?Fd(i,a):(a=Yo(e,i,a,o),a!==null&&(Ee(a,e,o),Wd(a,i,o)))}function Pd(e,i,a){var o=qe();Sa(e,i,a,o)}function Sa(e,i,a,o){var f={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(er(e))Fd(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,a);if(f.hasEagerState=!0,f.eagerState=v,Ge(v,y))return kl(e,i,f,0),Ut===null&&Nl(),!1}catch{}finally{}if(a=Yo(e,i,f,o),a!==null)return Ee(a,e,o),Wd(a,i,o),!0}return!1}function wu(e,i,a,o){if(o={lane:2,revertLane:ic(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},er(e)){if(i)throw Error(s(479))}else i=Yo(e,a,o,2),i!==null&&Ee(i,e,2)}function er(e){var i=e.alternate;return e===pt||i!==null&&i===pt}function Fd(e,i){Ss=Ql=!0;var a=e.pending;a===null?i.next=i:(i.next=a.next,a.next=i),e.pending=i}function Wd(e,i,a){if((a&4194048)!==0){var o=i.lanes;o&=e.pendingLanes,a|=o,i.lanes=a,Kh(e,a)}}var Ta={readContext:he,use:Kl,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useLayoutEffect:Vt,useInsertionEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useSyncExternalStore:Vt,useId:Vt,useHostTransitionStatus:Vt,useFormState:Vt,useActionState:Vt,useOptimistic:Vt,useMemoCache:Vt,useCacheRefresh:Vt};Ta.useEffectEvent=Vt;var Qd={readContext:he,use:Kl,useCallback:function(e,i){return xe().memoizedState=[e,i===void 0?null:i],e},useContext:he,useEffect:Dd,useImperativeHandle:function(e,i,a){a=a!=null?a.concat([e]):null,Jl(4194308,4,kd.bind(null,i,e),a)},useLayoutEffect:function(e,i){return Jl(4194308,4,e,i)},useInsertionEffect:function(e,i){Jl(4,2,e,i)},useMemo:function(e,i){var a=xe();i=i===void 0?null:i;var o=e();if(Ln){Zi(!0);try{e()}finally{Zi(!1)}}return a.memoizedState=[o,i],o},useReducer:function(e,i,a){var o=xe();if(a!==void 0){var f=a(i);if(Ln){Zi(!0);try{a(i)}finally{Zi(!1)}}}else f=i;return o.memoizedState=o.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},o.queue=e,e=e.dispatch=m_.bind(null,pt,e),[o.memoizedState,e]},useRef:function(e){var i=xe();return e={current:e},i.memoizedState=e},useState:function(e){e=yu(e);var i=e.queue,a=Pd.bind(null,pt,i);return i.dispatch=a,[e.memoizedState,a]},useDebugValue:bu,useDeferredValue:function(e,i){var a=xe();return vu(a,e,i)},useTransition:function(){var e=yu(!1);return e=jd.bind(null,pt,e.queue,!0,!1),xe().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,a){var o=pt,f=xe();if(Tt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=i(),Ut===null)throw Error(s(349));(bt&127)!==0||pd(o,i,a)}f.memoizedState=a;var d={value:a,getSnapshot:i};return f.queue=d,Dd(yd.bind(null,o,d,e),[e]),o.flags|=2048,ws(9,{destroy:void 0},gd.bind(null,o,d,a,i),null),a},useId:function(){var e=xe(),i=Ut.identifierPrefix;if(Tt){var a=yi,o=gi;a=(o&~(1<<32-ke(o)-1)).toString(32)+a,i="_"+i+"R_"+a,a=Zl++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=r_++,i="_"+i+"r_"+a.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:Tu,useFormState:Cd,useActionState:Cd,useOptimistic:function(e){var i=xe();i.memoizedState=i.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=wu.bind(null,pt,!0,a),a.dispatch=i,[e,i]},useMemoCache:mu,useCacheRefresh:function(){return xe().memoizedState=d_.bind(null,pt)},useEffectEvent:function(e){var i=xe(),a={impl:e};return i.memoizedState=a,function(){if((Rt&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Au={readContext:he,use:Kl,useCallback:Ud,useContext:he,useEffect:_u,useImperativeHandle:Gd,useInsertionEffect:Od,useLayoutEffect:Nd,useMemo:Hd,useReducer:$l,useRef:zd,useState:function(){return $l(Di)},useDebugValue:bu,useDeferredValue:function(e,i){var a=It();return Ld(a,Ot.memoizedState,e,i)},useTransition:function(){var e=$l(Di)[0],i=It().memoizedState;return[typeof e=="boolean"?e:va(e),i]},useSyncExternalStore:md,useId:Xd,useHostTransitionStatus:Tu,useFormState:Md,useActionState:Md,useOptimistic:function(e,i){var a=It();return bd(a,Ot,e,i)},useMemoCache:mu,useCacheRefresh:Vd};Au.useEffectEvent=Bd;var Zd={readContext:he,use:Kl,useCallback:Ud,useContext:he,useEffect:_u,useImperativeHandle:Gd,useInsertionEffect:Od,useLayoutEffect:Nd,useMemo:Hd,useReducer:gu,useRef:zd,useState:function(){return gu(Di)},useDebugValue:bu,useDeferredValue:function(e,i){var a=It();return Ot===null?vu(a,e,i):Ld(a,Ot.memoizedState,e,i)},useTransition:function(){var e=gu(Di)[0],i=It().memoizedState;return[typeof e=="boolean"?e:va(e),i]},useSyncExternalStore:md,useId:Xd,useHostTransitionStatus:Tu,useFormState:Rd,useActionState:Rd,useOptimistic:function(e,i){var a=It();return Ot!==null?bd(a,Ot,e,i):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:mu,useCacheRefresh:Vd};Zd.useEffectEvent=Bd;function Cu(e,i,a,o){i=e.memoizedState,a=a(o,i),a=a==null?i:x({},i,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Mu={enqueueSetState:function(e,i,a){e=e._reactInternals;var o=qe(),f=sn(o);f.payload=i,a!=null&&(f.callback=a),i=an(e,f,o),i!==null&&(Ee(i,e,o),ya(i,e,o))},enqueueReplaceState:function(e,i,a){e=e._reactInternals;var o=qe(),f=sn(o);f.tag=1,f.payload=i,a!=null&&(f.callback=a),i=an(e,f,o),i!==null&&(Ee(i,e,o),ya(i,e,o))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var a=qe(),o=sn(a);o.tag=2,i!=null&&(o.callback=i),i=an(e,o,a),i!==null&&(Ee(i,e,a),ya(i,e,a))}};function Id(e,i,a,o,f,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,d,y):i.prototype&&i.prototype.isPureReactComponent?!ua(a,o)||!ua(f,d):!0}function Kd(e,i,a,o){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,o),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,o),i.state!==e&&Mu.enqueueReplaceState(i,i.state,null)}function jn(e,i){var a=i;if("ref"in i){a={};for(var o in i)o!=="ref"&&(a[o]=i[o])}if(e=e.defaultProps){a===i&&(a=x({},a));for(var f in e)a[f]===void 0&&(a[f]=e[f])}return a}function $d(e){Ol(e)}function Jd(e){console.error(e)}function tm(e){Ol(e)}function ir(e,i){try{var a=e.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(o){setTimeout(function(){throw o})}}function em(e,i,a){try{var o=e.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Eu(e,i,a){return a=sn(a),a.tag=3,a.payload={element:null},a.callback=function(){ir(e,i)},a}function im(e){return e=sn(e),e.tag=3,e}function nm(e,i,a,o){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var d=o.value;e.payload=function(){return f(d)},e.callback=function(){em(i,a,o)}}var y=a.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){em(i,a,o),typeof f!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var v=o.stack;this.componentDidCatch(o.value,{componentStack:v!==null?v:""})})}function p_(e,i,a,o,f){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(i=a.alternate,i!==null&&gs(i,a,f,!0),a=He.current,a!==null){switch(a.tag){case 31:case 13:return ti===null?mr():a.alternate===null&&Pt===0&&(Pt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,o===Xl?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([o]):i.add(o),Ju(e,o,f)),!1;case 22:return a.flags|=65536,o===Xl?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([o]):a.add(o)),Ju(e,o,f)),!1}throw Error(s(435,a.tag))}return Ju(e,o,f),mr(),!1}if(Tt)return i=He.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,o!==Wo&&(e=Error(s(422),{cause:o}),fa(Ie(e,a)))):(o!==Wo&&(i=Error(s(423),{cause:o}),fa(Ie(i,a))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,o=Ie(o,a),f=Eu(e.stateNode,o,f),su(e,f),Pt!==4&&(Pt=2)),!1;var d=Error(s(520),{cause:o});if(d=Ie(d,a),Da===null?Da=[d]:Da.push(d),Pt!==4&&(Pt=2),i===null)return!0;o=Ie(o,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,e=f&-f,a.lanes|=e,e=Eu(a.stateNode,o,e),su(a,e),!1;case 1:if(i=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(hn===null||!hn.has(d))))return a.flags|=65536,f&=-f,a.lanes|=f,f=im(f),nm(f,e,a,o),su(a,f),!1}a=a.return}while(a!==null);return!1}var Ru=Error(s(461)),ie=!1;function fe(e,i,a,o){i.child=e===null?rd(i,null,a,o):Hn(i,e.child,a,o)}function sm(e,i,a,o,f){a=a.render;var d=i.ref;if("ref"in o){var y={};for(var v in o)v!=="ref"&&(y[v]=o[v])}else y=o;return Nn(i),o=cu(e,i,a,y,d,f),v=hu(),e!==null&&!ie?(fu(e,i,f),Bi(e,i,f)):(Tt&&v&&Po(i),i.flags|=1,fe(e,i,o,f),i.child)}function am(e,i,a,o,f){if(e===null){var d=a.type;return typeof d=="function"&&!qo(d)&&d.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=d,lm(e,i,d,o,f)):(e=Ul(a.type,null,o,i,i.mode,f),e.ref=i.ref,e.return=i,i.child=e)}if(d=e.child,!Uu(e,f)){var y=d.memoizedProps;if(a=a.compare,a=a!==null?a:ua,a(y,o)&&e.ref===i.ref)return Bi(e,i,f)}return i.flags|=1,e=Ci(d,o),e.ref=i.ref,e.return=i,i.child=e}function lm(e,i,a,o,f){if(e!==null){var d=e.memoizedProps;if(ua(d,o)&&e.ref===i.ref)if(ie=!1,i.pendingProps=o=d,Uu(e,f))(e.flags&131072)!==0&&(ie=!0);else return i.lanes=e.lanes,Bi(e,i,f)}return zu(e,i,a,o,f)}function rm(e,i,a,o){var f=o.children,d=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((i.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,e!==null){for(o=i.child=e.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~d}else o=0,i.child=null;return om(e,i,d,a,o)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&Yl(i,d!==null?d.cachePool:null),d!==null?cd(i,d):lu(),hd(i);else return o=i.lanes=536870912,om(e,i,d!==null?d.baseLanes|a:a,a,o)}else d!==null?(Yl(i,d.cachePool),cd(i,d),rn(),i.memoizedState=null):(e!==null&&Yl(i,null),lu(),rn());return fe(e,i,f,a),i.child}function wa(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function om(e,i,a,o,f){var d=tu();return d=d===null?null:{parent:te._currentValue,pool:d},i.memoizedState={baseLanes:a,cachePool:d},e!==null&&Yl(i,null),lu(),hd(i),e!==null&&gs(e,i,o,!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 um(e,i,a){return Hn(i,e.child,null,a),e=nr(i,i.pendingProps),e.flags|=2,Le(i),i.memoizedState=null,e}function g_(e,i,a){var o=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(Tt){if(o.mode==="hidden")return e=nr(i,o),i.lanes=536870912,wa(null,e);if(ou(i),(e=jt)?(e=vp(e,Je),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:$i!==null?{id:gi,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},a=Ff(e),a.return=i,i.child=a,ce=i,jt=null)):e=null,e===null)throw tn(i);return i.lanes=536870912,null}return nr(i,o)}var d=e.memoizedState;if(d!==null){var y=d.dehydrated;if(ou(i),f)if(i.flags&256)i.flags&=-257,i=um(e,i,a);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(s(558));else if(ie||gs(e,i,a,!1),f=(a&e.childLanes)!==0,ie||f){if(o=Ut,o!==null&&(y=$h(o,a),y!==0&&y!==d.retryLane))throw d.retryLane=y,zn(e,y),Ee(o,e,y),Ru;mr(),i=um(e,i,a)}else e=d.treeContext,jt=ei(y.nextSibling),ce=i,Tt=!0,Ji=null,Je=!1,e!==null&&Zf(i,e),i=nr(i,o),i.flags|=4096;return i}return e=Ci(e.child,{mode:o.mode,children:o.children}),e.ref=i.ref,i.child=e,e.return=i,e}function sr(e,i){var a=i.ref;if(a===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(i.flags|=4194816)}}function zu(e,i,a,o,f){return Nn(i),a=cu(e,i,a,o,void 0,f),o=hu(),e!==null&&!ie?(fu(e,i,f),Bi(e,i,f)):(Tt&&o&&Po(i),i.flags|=1,fe(e,i,a,f),i.child)}function cm(e,i,a,o,f,d){return Nn(i),i.updateQueue=null,a=dd(i,o,a,f),fd(e),o=hu(),e!==null&&!ie?(fu(e,i,d),Bi(e,i,d)):(Tt&&o&&Po(i),i.flags|=1,fe(e,i,a,d),i.child)}function hm(e,i,a,o,f){if(Nn(i),i.stateNode===null){var d=fs,y=a.contextType;typeof y=="object"&&y!==null&&(d=he(y)),d=new a(o,d),i.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Mu,i.stateNode=d,d._reactInternals=i,d=i.stateNode,d.props=o,d.state=i.memoizedState,d.refs={},iu(i),y=a.contextType,d.context=typeof y=="object"&&y!==null?he(y):fs,d.state=i.memoizedState,y=a.getDerivedStateFromProps,typeof y=="function"&&(Cu(i,a,y,o),d.state=i.memoizedState),typeof a.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&&Mu.enqueueReplaceState(d,d.state,null),_a(i,o,d,f),xa(),d.state=i.memoizedState),typeof d.componentDidMount=="function"&&(i.flags|=4194308),o=!0}else if(e===null){d=i.stateNode;var v=i.memoizedProps,M=jn(a,v);d.props=M;var U=d.context,q=a.contextType;y=fs,typeof q=="object"&&q!==null&&(y=he(q));var F=a.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)&&Kd(i,d,o,y),nn=!1;var H=i.memoizedState;d.state=H,_a(i,o,d,f),xa(),U=i.memoizedState,v||H!==U||nn?(typeof F=="function"&&(Cu(i,a,F,o),U=i.memoizedState),(M=nn||Id(i,a,M,o,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=o,i.memoizedState=U),d.props=o,d.state=U,d.context=y,o=M):(typeof d.componentDidMount=="function"&&(i.flags|=4194308),o=!1)}else{d=i.stateNode,nu(e,i),y=i.memoizedProps,q=jn(a,y),d.props=q,F=i.pendingProps,H=d.context,U=a.contextType,M=fs,typeof U=="object"&&U!==null&&(M=he(U)),v=a.getDerivedStateFromProps,(U=typeof v=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==F||H!==M)&&Kd(i,d,o,M),nn=!1,H=i.memoizedState,d.state=H,_a(i,o,d,f),xa();var j=i.memoizedState;y!==F||H!==j||nn||e!==null&&e.dependencies!==null&&Ll(e.dependencies)?(typeof v=="function"&&(Cu(i,a,v,o),j=i.memoizedState),(q=nn||Id(i,a,q,o,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(o,j,M),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,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=o,i.memoizedState=j),d.props=o,d.state=j,d.context=M,o=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),o=!1)}return d=o,sr(e,i),o=(i.flags&128)!==0,d||o?(d=i.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:d.render(),i.flags|=1,e!==null&&o?(i.child=Hn(i,e.child,null,f),i.child=Hn(i,null,a,f)):fe(e,i,a,f),i.memoizedState=d.state,e=i.child):e=Bi(e,i,f),e}function fm(e,i,a,o){return Bn(),i.flags|=256,fe(e,i,a,o),i.child}var Du={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bu(e){return{baseLanes:e,cachePool:ed()}}function Ou(e,i,a){return e=e!==null?e.childLanes&~a:0,i&&(e|=Ye),e}function dm(e,i,a){var o=i.pendingProps,f=!1,d=(i.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(Zt.current&2)!==0),y&&(f=!0,i.flags&=-129),y=(i.flags&32)!==0,i.flags&=-33,e===null){if(Tt){if(f?ln(i):rn(),(e=jt)?(e=vp(e,Je),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:$i!==null?{id:gi,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},a=Ff(e),a.return=i,i.child=a,ce=i,jt=null)):e=null,e===null)throw tn(i);return pc(e)?i.lanes=32:i.lanes=536870912,null}var v=o.children;return o=o.fallback,f?(rn(),f=i.mode,v=ar({mode:"hidden",children:v},f),o=Dn(o,f,a,null),v.return=i,o.return=i,v.sibling=o,i.child=v,o=i.child,o.memoizedState=Bu(a),o.childLanes=Ou(e,y,a),i.memoizedState=Du,wa(null,o)):(ln(i),Nu(i,v))}var M=e.memoizedState;if(M!==null&&(v=M.dehydrated,v!==null)){if(d)i.flags&256?(ln(i),i.flags&=-257,i=ku(e,i,a)):i.memoizedState!==null?(rn(),i.child=e.child,i.flags|=128,i=null):(rn(),v=o.fallback,f=i.mode,o=ar({mode:"visible",children:o.children},f),v=Dn(v,f,a,null),v.flags|=2,o.return=i,v.return=i,o.sibling=v,i.child=o,Hn(i,e.child,null,a),o=i.child,o.memoizedState=Bu(a),o.childLanes=Ou(e,y,a),i.memoizedState=Du,i=wa(null,o));else if(ln(i),pc(v)){if(y=v.nextSibling&&v.nextSibling.dataset,y)var U=y.dgst;y=U,o=Error(s(419)),o.stack="",o.digest=y,fa({value:o,source:null,stack:null}),i=ku(e,i,a)}else if(ie||gs(e,i,a,!1),y=(a&e.childLanes)!==0,ie||y){if(y=Ut,y!==null&&(o=$h(y,a),o!==0&&o!==M.retryLane))throw M.retryLane=o,zn(e,o),Ee(y,e,o),Ru;mc(v)||mr(),i=ku(e,i,a)}else mc(v)?(i.flags|=192,i.child=e.child,i=null):(e=M.treeContext,jt=ei(v.nextSibling),ce=i,Tt=!0,Ji=null,Je=!1,e!==null&&Zf(i,e),i=Nu(i,o.children),i.flags|=4096);return i}return f?(rn(),v=o.fallback,f=i.mode,M=e.child,U=M.sibling,o=Ci(M,{mode:"hidden",children:o.children}),o.subtreeFlags=M.subtreeFlags&65011712,U!==null?v=Ci(U,v):(v=Dn(v,f,a,null),v.flags|=2),v.return=i,o.return=i,o.sibling=v,i.child=o,wa(null,o),o=i.child,v=e.child.memoizedState,v===null?v=Bu(a):(f=v.cachePool,f!==null?(M=te._currentValue,f=f.parent!==M?{parent:M,pool:M}:f):f=ed(),v={baseLanes:v.baseLanes|a,cachePool:f}),o.memoizedState=v,o.childLanes=Ou(e,y,a),i.memoizedState=Du,wa(e.child,o)):(ln(i),a=e.child,e=a.sibling,a=Ci(a,{mode:"visible",children:o.children}),a.return=i,a.sibling=null,e!==null&&(y=i.deletions,y===null?(i.deletions=[e],i.flags|=16):y.push(e)),i.child=a,i.memoizedState=null,a)}function Nu(e,i){return i=ar({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function ar(e,i){return e=Ue(22,e,null,i),e.lanes=0,e}function ku(e,i,a){return Hn(i,e.child,null,a),e=Nu(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function mm(e,i,a){e.lanes|=i;var o=e.alternate;o!==null&&(o.lanes|=i),Io(e.return,i,a)}function Gu(e,i,a,o,f,d){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:f,treeForkCount:d}:(y.isBackwards=i,y.rendering=null,y.renderingStartTime=0,y.last=o,y.tail=a,y.tailMode=f,y.treeForkCount=d)}function pm(e,i,a){var o=i.pendingProps,f=o.revealOrder,d=o.tail;o=o.children;var y=Zt.current,v=(y&2)!==0;if(v?(y=y&1|2,i.flags|=128):y&=1,W(Zt,y),fe(e,i,o,a),o=Tt?ha:0,!v&&e!==null&&(e.flags&128)!==0)t:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mm(e,a,i);else if(e.tag===19)mm(e,a,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(a=i.child,f=null;a!==null;)e=a.alternate,e!==null&&Wl(e)===null&&(f=a),a=a.sibling;a=f,a===null?(f=i.child,i.child=null):(f=a.sibling,a.sibling=null),Gu(i,!1,f,a,d,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=i.child,i.child=null;f!==null;){if(e=f.alternate,e!==null&&Wl(e)===null){i.child=f;break}e=f.sibling,f.sibling=a,a=f,f=e}Gu(i,!0,a,null,d,o);break;case"together":Gu(i,!1,null,null,void 0,o);break;default:i.memoizedState=null}return i.child}function Bi(e,i,a){if(e!==null&&(i.dependencies=e.dependencies),cn|=i.lanes,(a&i.childLanes)===0)if(e!==null){if(gs(e,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(s(153));if(i.child!==null){for(e=i.child,a=Ci(e,e.pendingProps),i.child=a,a.return=i;e.sibling!==null;)e=e.sibling,a=a.sibling=Ci(e,e.pendingProps),a.return=i;a.sibling=null}return i.child}function Uu(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&Ll(e)))}function y_(e,i,a){switch(i.tag){case 3:Lt(i,i.stateNode.containerInfo),en(i,te,e.memoizedState.cache),Bn();break;case 27:case 5:Fe(i);break;case 4:Lt(i,i.stateNode.containerInfo);break;case 10:en(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ou(i),null;break;case 13:var o=i.memoizedState;if(o!==null)return o.dehydrated!==null?(ln(i),i.flags|=128,null):(a&i.child.childLanes)!==0?dm(e,i,a):(ln(i),e=Bi(e,i,a),e!==null?e.sibling:null);ln(i);break;case 19:var f=(e.flags&128)!==0;if(o=(a&i.childLanes)!==0,o||(gs(e,i,a,!1),o=(a&i.childLanes)!==0),f){if(o)return pm(e,i,a);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),W(Zt,Zt.current),o)break;return null;case 22:return i.lanes=0,rm(e,i,a,i.pendingProps);case 24:en(i,te,e.memoizedState.cache)}return Bi(e,i,a)}function gm(e,i,a){if(e!==null)if(e.memoizedProps!==i.pendingProps)ie=!0;else{if(!Uu(e,a)&&(i.flags&128)===0)return ie=!1,y_(e,i,a);ie=(e.flags&131072)!==0}else ie=!1,Tt&&(i.flags&1048576)!==0&&Qf(i,ha,i.index);switch(i.lanes=0,i.tag){case 16:t:{var o=i.pendingProps;if(e=Gn(i.elementType),i.type=e,typeof e=="function")qo(e)?(o=jn(e,o),i.tag=1,i=hm(null,i,e,o,a)):(i.tag=0,i=zu(null,i,e,o,a));else{if(e!=null){var f=e.$$typeof;if(f===O){i.tag=11,i=sm(null,i,e,o,a);break t}else if(f===N){i.tag=14,i=am(null,i,e,o,a);break t}}throw i=nt(e)||e,Error(s(306,i,""))}}return i;case 0:return zu(e,i,i.type,i.pendingProps,a);case 1:return o=i.type,f=jn(o,i.pendingProps),hm(e,i,o,f,a);case 3:t:{if(Lt(i,i.stateNode.containerInfo),e===null)throw Error(s(387));o=i.pendingProps;var d=i.memoizedState;f=d.element,nu(e,i),_a(i,o,null,a);var y=i.memoizedState;if(o=y.cache,en(i,te,o),o!==d.cache&&Ko(i,[te],a,!0),xa(),o=y.element,d.isDehydrated)if(d={element:o,isDehydrated:!1,cache:y.cache},i.updateQueue.baseState=d,i.memoizedState=d,i.flags&256){i=fm(e,i,o,a);break t}else if(o!==f){f=Ie(Error(s(424)),i),fa(f),i=fm(e,i,o,a);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(jt=ei(e.firstChild),ce=i,Tt=!0,Ji=null,Je=!0,a=rd(i,null,o,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Bn(),o===f){i=Bi(e,i,a);break t}fe(e,i,o,a)}i=i.child}return i;case 26:return sr(e,i),e===null?(a=Mp(i.type,null,i.pendingProps,null))?i.memoizedState=a:Tt||(a=i.type,e=i.pendingProps,o=vr(ct.current).createElement(a),o[ue]=i,o[Se]=e,de(o,a,e),le(o),i.stateNode=o):i.memoizedState=Mp(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return Fe(i),e===null&&Tt&&(o=i.stateNode=wp(i.type,i.pendingProps,ct.current),ce=i,Je=!0,f=jt,pn(i.type)?(gc=f,jt=ei(o.firstChild)):jt=f),fe(e,i,i.pendingProps.children,a),sr(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&Tt&&((f=o=jt)&&(o=W_(o,i.type,i.pendingProps,Je),o!==null?(i.stateNode=o,ce=i,jt=ei(o.firstChild),Je=!1,f=!0):f=!1),f||tn(i)),Fe(i),f=i.type,d=i.pendingProps,y=e!==null?e.memoizedProps:null,o=d.children,hc(f,d)?o=null:y!==null&&hc(f,y)&&(i.flags|=32),i.memoizedState!==null&&(f=cu(e,i,o_,null,null,a),La._currentValue=f),sr(e,i),fe(e,i,o,a),i.child;case 6:return e===null&&Tt&&((e=a=jt)&&(a=Q_(a,i.pendingProps,Je),a!==null?(i.stateNode=a,ce=i,jt=null,e=!0):e=!1),e||tn(i)),null;case 13:return dm(e,i,a);case 4:return Lt(i,i.stateNode.containerInfo),o=i.pendingProps,e===null?i.child=Hn(i,null,o,a):fe(e,i,o,a),i.child;case 11:return sm(e,i,i.type,i.pendingProps,a);case 7:return fe(e,i,i.pendingProps,a),i.child;case 8:return fe(e,i,i.pendingProps.children,a),i.child;case 12:return fe(e,i,i.pendingProps.children,a),i.child;case 10:return o=i.pendingProps,en(i,i.type,o.value),fe(e,i,o.children,a),i.child;case 9:return f=i.type._context,o=i.pendingProps.children,Nn(i),f=he(f),o=o(f),i.flags|=1,fe(e,i,o,a),i.child;case 14:return am(e,i,i.type,i.pendingProps,a);case 15:return lm(e,i,i.type,i.pendingProps,a);case 19:return pm(e,i,a);case 31:return g_(e,i,a);case 22:return rm(e,i,a,i.pendingProps);case 24:return Nn(i),o=he(te),e===null?(f=tu(),f===null&&(f=Ut,d=$o(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=a),f=d),i.memoizedState={parent:o,cache:f},iu(i),en(i,te,f)):((e.lanes&a)!==0&&(nu(e,i),_a(i,null,null,a),xa()),f=e.memoizedState,d=i.memoizedState,f.parent!==o?(f={parent:o,cache:o},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),en(i,te,o)):(o=d.cache,en(i,te,o),o!==f.cache&&Ko(i,[te],a,!0))),fe(e,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Oi(e){e.flags|=4}function Hu(e,i,a,o,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(Xm())e.flags|=8192;else throw Un=Xl,eu}else e.flags&=-16777217}function ym(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bp(i))if(Xm())e.flags|=8192;else throw Un=Xl,eu}function lr(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?Zh():536870912,e.lanes|=i,Es|=i)}function Aa(e,i){if(!Tt)switch(e.tailMode){case"hidden":i=e.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Yt(e){var i=e.alternate!==null&&e.alternate.child===e.child,a=0,o=0;if(i)for(var f=e.child;f!==null;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=o,e.childLanes=a,i}function x_(e,i,a){var o=i.pendingProps;switch(Fo(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(i),null;case 1:return Yt(i),null;case 3:return a=i.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Ri(te),Et(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ps(i)?Oi(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Qo())),Yt(i),null;case 26:var f=i.type,d=i.memoizedState;return e===null?(Oi(i),d!==null?(Yt(i),ym(i,d)):(Yt(i),Hu(i,f,null,o,a))):d?d!==e.memoizedState?(Oi(i),Yt(i),ym(i,d)):(Yt(i),i.flags&=-16777217):(e=e.memoizedProps,e!==o&&Oi(i),Yt(i),Hu(i,f,e,o,a)),null;case 27:if(Qi(i),a=ct.current,f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==o&&Oi(i);else{if(!o){if(i.stateNode===null)throw Error(s(166));return Yt(i),null}e=J.current,ps(i)?If(i):(e=wp(f,o,a),i.stateNode=e,Oi(i))}return Yt(i),null;case 5:if(Qi(i),f=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==o&&Oi(i);else{if(!o){if(i.stateNode===null)throw Error(s(166));return Yt(i),null}if(d=J.current,ps(i))If(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 o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?y.createElement(f,{is:o.is}):y.createElement(f)}}d[ue]=i,d[Se]=o;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(de(d,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break t;case"img":o=!0;break t;default:o=!1}o&&Oi(i)}}return Yt(i),Hu(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,a),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==o&&Oi(i);else{if(typeof o!="string"&&i.stateNode===null)throw Error(s(166));if(e=ct.current,ps(i)){if(e=i.stateNode,a=i.memoizedProps,o=null,f=ce,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}e[ue]=i,e=!!(e.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||dp(e.nodeValue,a)),e||tn(i,!0)}else e=vr(e).createTextNode(o),e[ue]=i,i.stateNode=e}return Yt(i),null;case 31:if(a=i.memoizedState,e===null||e.memoizedState!==null){if(o=ps(i),a!==null){if(e===null){if(!o)throw Error(s(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[ue]=i}else Bn(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Yt(i),e=!1}else a=Qo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return i.flags&256?(Le(i),i):(Le(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Yt(i),null;case 13:if(o=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=ps(i),o!==null&&o.dehydrated!==null){if(e===null){if(!f)throw Error(s(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[ue]=i}else Bn(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Yt(i),f=!1}else f=Qo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(Le(i),i):(Le(i),null)}return Le(i),(i.flags&128)!==0?(i.lanes=a,i):(a=o!==null,e=e!==null&&e.memoizedState!==null,a&&(o=i.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==f&&(o.flags|=2048)),a!==e&&a&&(i.child.flags|=8192),lr(i,i.updateQueue),Yt(i),null);case 4:return Et(),e===null&&lc(i.stateNode.containerInfo),Yt(i),null;case 10:return Ri(i.type),Yt(i),null;case 19:if(Y(Zt),o=i.memoizedState,o===null)return Yt(i),null;if(f=(i.flags&128)!==0,d=o.rendering,d===null)if(f)Aa(o,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(d=Wl(e),d!==null){for(i.flags|=128,Aa(o,!1),e=d.updateQueue,i.updateQueue=e,lr(i,e),i.subtreeFlags=0,e=a,a=i.child;a!==null;)Pf(a,e),a=a.sibling;return W(Zt,Zt.current&1|2),Tt&&Mi(i,o.treeForkCount),i.child}e=e.sibling}o.tail!==null&&Oe()>hr&&(i.flags|=128,f=!0,Aa(o,!1),i.lanes=4194304)}else{if(!f)if(e=Wl(d),e!==null){if(i.flags|=128,f=!0,e=e.updateQueue,i.updateQueue=e,lr(i,e),Aa(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Tt)return Yt(i),null}else 2*Oe()-o.renderingStartTime>hr&&a!==536870912&&(i.flags|=128,f=!0,Aa(o,!1),i.lanes=4194304);o.isBackwards?(d.sibling=i.child,i.child=d):(e=o.last,e!==null?e.sibling=d:i.child=d,o.last=d)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Oe(),e.sibling=null,a=Zt.current,W(Zt,f?a&1|2:a&1),Tt&&Mi(i,o.treeForkCount),e):(Yt(i),null);case 22:case 23:return Le(i),ru(),o=i.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(i.flags|=8192):o&&(i.flags|=8192),o?(a&536870912)!==0&&(i.flags&128)===0&&(Yt(i),i.subtreeFlags&6&&(i.flags|=8192)):Yt(i),a=i.updateQueue,a!==null&&lr(i,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048),e!==null&&Y(kn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),Ri(te),Yt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function __(e,i){switch(Fo(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return Ri(te),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(Le(i),i.alternate===null)throw Error(s(340));Bn()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(Le(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Bn()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return Y(Zt),null;case 4:return Et(),null;case 10:return Ri(i.type),null;case 22:case 23:return Le(i),ru(),e!==null&&Y(kn),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return Ri(te),null;case 25:return null;default:return null}}function xm(e,i){switch(Fo(i),i.tag){case 3:Ri(te),Et();break;case 26:case 27:case 5:Qi(i);break;case 4:Et();break;case 31:i.memoizedState!==null&&Le(i);break;case 13:Le(i);break;case 19:Y(Zt);break;case 10:Ri(i.type);break;case 22:case 23:Le(i),ru(),e!==null&&Y(kn);break;case 24:Ri(te)}}function Ca(e,i){try{var a=i.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var f=o.next;a=f;do{if((a.tag&e)===e){o=void 0;var d=a.create,y=a.inst;o=d(),y.destroy=o}a=a.next}while(a!==f)}}catch(v){Dt(i,i.return,v)}}function on(e,i,a){try{var o=i.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var d=f.next;o=d;do{if((o.tag&e)===e){var y=o.inst,v=y.destroy;if(v!==void 0){y.destroy=void 0,f=i;var M=a,U=v;try{U()}catch(q){Dt(f,M,q)}}}o=o.next}while(o!==d)}}catch(q){Dt(i,i.return,q)}}function _m(e){var i=e.updateQueue;if(i!==null){var a=e.stateNode;try{ud(i,a)}catch(o){Dt(e,e.return,o)}}}function bm(e,i,a){a.props=jn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(o){Dt(e,i,o)}}function Ma(e,i){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof a=="function"?e.refCleanup=a(o):a.current=o}}catch(f){Dt(e,i,f)}}function xi(e,i){var a=e.ref,o=e.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(f){Dt(e,i,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Dt(e,i,f)}else a.current=null}function vm(e){var i=e.type,a=e.memoizedProps,o=e.stateNode;try{t:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break t;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(f){Dt(e,e.return,f)}}function Lu(e,i,a){try{var o=e.stateNode;Y_(o,e.type,a,i),o[Se]=i}catch(f){Dt(e,e.return,f)}}function Sm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pn(e.type)||e.tag===4}function ju(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||Sm(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&&pn(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 Yu(e,i,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(e),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=wi));else if(o!==4&&(o===27&&pn(e.type)&&(a=e.stateNode,i=null),e=e.child,e!==null))for(Yu(e,i,a),e=e.sibling;e!==null;)Yu(e,i,a),e=e.sibling}function rr(e,i,a){var o=e.tag;if(o===5||o===6)e=e.stateNode,i?a.insertBefore(e,i):a.appendChild(e);else if(o!==4&&(o===27&&pn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(rr(e,i,a),e=e.sibling;e!==null;)rr(e,i,a),e=e.sibling}function Tm(e){var i=e.stateNode,a=e.memoizedProps;try{for(var o=e.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);de(i,o,a),i[ue]=e,i[Se]=a}catch(d){Dt(e,e.return,d)}}var Ni=!1,ne=!1,qu=!1,wm=typeof WeakSet=="function"?WeakSet:Set,re=null;function b_(e,i){if(e=e.containerInfo,uc=Er,e=Gf(e),ko(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else t:{a=(a=e.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var f=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break t}var y=0,v=-1,M=-1,U=0,q=0,F=e,H=null;e:for(;;){for(var j;F!==a||f!==0&&F.nodeType!==3||(v=y+f),F!==d||o!==0&&F.nodeType!==3||(M=y+o),F.nodeType===3&&(y+=F.nodeValue.length),(j=F.firstChild)!==null;)H=F,F=j;for(;;){if(F===e)break e;if(H===a&&++U===f&&(v=y),H===d&&++q===o&&(M=y),(j=F.nextSibling)!==null)break;F=H,H=F.parentNode}F=j}a=v===-1||M===-1?null:{start:v,end:M}}else a=null}a=a||{start:0,end:0}}else a=null;for(cc={focusedElem:e,selectionRange:a},Er=!1,re=i;re!==null;)if(i=re,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,re=e;else for(;re!==null;){switch(i=re,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(a=0;a<e.length;a++)f=e[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,a=i,f=d.memoizedProps,d=d.memoizedState,o=a.stateNode;try{var st=jn(a.type,f);e=o.getSnapshotBeforeUpdate(st,d),o.__reactInternalSnapshotBeforeUpdate=e}catch(ut){Dt(a,a.return,ut)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,a=e.nodeType,a===9)dc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":dc(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(s(163))}if(e=i.sibling,e!==null){e.return=i.return,re=e;break}re=i.return}}function Am(e,i,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:Gi(e,a),o&4&&Ca(5,a);break;case 1:if(Gi(e,a),o&4)if(e=a.stateNode,i===null)try{e.componentDidMount()}catch(y){Dt(a,a.return,y)}else{var f=jn(a.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(f,i,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Dt(a,a.return,y)}}o&64&&_m(a),o&512&&Ma(a,a.return);break;case 3:if(Gi(e,a),o&64&&(e=a.updateQueue,e!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{ud(e,i)}catch(y){Dt(a,a.return,y)}}break;case 27:i===null&&o&4&&Tm(a);case 26:case 5:Gi(e,a),i===null&&o&4&&vm(a),o&512&&Ma(a,a.return);break;case 12:Gi(e,a);break;case 31:Gi(e,a),o&4&&Em(e,a);break;case 13:Gi(e,a),o&4&&Rm(e,a),o&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=R_.bind(null,a),Z_(e,a))));break;case 22:if(o=a.memoizedState!==null||Ni,!o){i=i!==null&&i.memoizedState!==null||ne,f=Ni;var d=ne;Ni=o,(ne=i)&&!d?Ui(e,a,(a.subtreeFlags&8772)!==0):Gi(e,a),Ni=f,ne=d}break;case 30:break;default:Gi(e,a)}}function Cm(e){var i=e.alternate;i!==null&&(e.alternate=null,Cm(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&xo(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 qt=null,we=!1;function ki(e,i,a){for(a=a.child;a!==null;)Mm(e,i,a),a=a.sibling}function Mm(e,i,a){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(Ks,a)}catch{}switch(a.tag){case 26:ne||xi(a,i),ki(e,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ne||xi(a,i);var o=qt,f=we;pn(a.type)&&(qt=a.stateNode,we=!1),ki(e,i,a),Ga(a.stateNode),qt=o,we=f;break;case 5:ne||xi(a,i);case 6:if(o=qt,f=we,qt=null,ki(e,i,a),qt=o,we=f,qt!==null)if(we)try{(qt.nodeType===9?qt.body:qt.nodeName==="HTML"?qt.ownerDocument.body:qt).removeChild(a.stateNode)}catch(d){Dt(a,i,d)}else try{qt.removeChild(a.stateNode)}catch(d){Dt(a,i,d)}break;case 18:qt!==null&&(we?(e=qt,_p(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Gs(e)):_p(qt,a.stateNode));break;case 4:o=qt,f=we,qt=a.stateNode.containerInfo,we=!0,ki(e,i,a),qt=o,we=f;break;case 0:case 11:case 14:case 15:on(2,a,i),ne||on(4,a,i),ki(e,i,a);break;case 1:ne||(xi(a,i),o=a.stateNode,typeof o.componentWillUnmount=="function"&&bm(a,i,o)),ki(e,i,a);break;case 21:ki(e,i,a);break;case 22:ne=(o=ne)||a.memoizedState!==null,ki(e,i,a),ne=o;break;default:ki(e,i,a)}}function Em(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gs(e)}catch(a){Dt(i,i.return,a)}}}function Rm(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(a){Dt(i,i.return,a)}}function v_(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new wm),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new wm),i;default:throw Error(s(435,e.tag))}}function or(e,i){var a=v_(e);i.forEach(function(o){if(!a.has(o)){a.add(o);var f=z_.bind(null,e,o);o.then(f,f)}})}function Ae(e,i){var a=i.deletions;if(a!==null)for(var o=0;o<a.length;o++){var f=a[o],d=e,y=i,v=y;t:for(;v!==null;){switch(v.tag){case 27:if(pn(v.type)){qt=v.stateNode,we=!1;break t}break;case 5:qt=v.stateNode,we=!1;break t;case 3:case 4:qt=v.stateNode.containerInfo,we=!0;break t}v=v.return}if(qt===null)throw Error(s(160));Mm(d,y,f),qt=null,we=!1,d=f.alternate,d!==null&&(d.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)zm(i,e),i=i.sibling}var ci=null;function zm(e,i){var a=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ae(i,e),Ce(e),o&4&&(on(3,e,e.return),Ca(3,e),on(5,e,e.return));break;case 1:Ae(i,e),Ce(e),o&512&&(ne||a===null||xi(a,a.return)),o&64&&Ni&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var f=ci;if(Ae(i,e),Ce(e),o&512&&(ne||a===null||xi(a,a.return)),o&4){var d=a!==null?a.memoizedState:null;if(o=e.memoizedState,a===null)if(o===null)if(e.stateNode===null){t:{o=e.type,a=e.memoizedProps,f=f.ownerDocument||f;e:switch(o){case"title":d=f.getElementsByTagName("title")[0],(!d||d[ta]||d[ue]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(o),f.head.insertBefore(d,f.querySelector("head > title"))),de(d,o,a),d[ue]=e,le(d),o=d;break t;case"link":var y=zp("link","href",f).get(o+(a.href||""));if(y){for(var v=0;v<y.length;v++)if(d=y[v],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(v,1);break e}}d=f.createElement(o),de(d,o,a),f.head.appendChild(d);break;case"meta":if(y=zp("meta","content",f).get(o+(a.content||""))){for(v=0;v<y.length;v++)if(d=y[v],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(v,1);break e}}d=f.createElement(o),de(d,o,a),f.head.appendChild(d);break;default:throw Error(s(468,o))}d[ue]=e,le(d),o=d}e.stateNode=o}else Dp(f,e.type,e.stateNode);else e.stateNode=Rp(f,o,e.memoizedProps);else d!==o?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,o===null?Dp(f,e.type,e.stateNode):Rp(f,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Lu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ae(i,e),Ce(e),o&512&&(ne||a===null||xi(a,a.return)),a!==null&&o&4&&Lu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ae(i,e),Ce(e),o&512&&(ne||a===null||xi(a,a.return)),e.flags&32){f=e.stateNode;try{as(f,"")}catch(st){Dt(e,e.return,st)}}o&4&&e.stateNode!=null&&(f=e.memoizedProps,Lu(e,f,a!==null?a.memoizedProps:f)),o&1024&&(qu=!0);break;case 6:if(Ae(i,e),Ce(e),o&4){if(e.stateNode===null)throw Error(s(162));o=e.memoizedProps,a=e.stateNode;try{a.nodeValue=o}catch(st){Dt(e,e.return,st)}}break;case 3:if(wr=null,f=ci,ci=Sr(i.containerInfo),Ae(i,e),ci=f,Ce(e),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Gs(i.containerInfo)}catch(st){Dt(e,e.return,st)}qu&&(qu=!1,Dm(e));break;case 4:o=ci,ci=Sr(e.stateNode.containerInfo),Ae(i,e),Ce(e),ci=o;break;case 12:Ae(i,e),Ce(e);break;case 31:Ae(i,e),Ce(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,or(e,o)));break;case 13:Ae(i,e),Ce(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(cr=Oe()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,or(e,o)));break;case 22:f=e.memoizedState!==null;var M=a!==null&&a.memoizedState!==null,U=Ni,q=ne;if(Ni=U||f,ne=q||M,Ae(i,e),ne=q,Ni=U,Ce(e),o&8192)t:for(i=e.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(a===null||M||Ni||ne||Yn(e)),a=null,i=e;;){if(i.tag===5||i.tag===26){if(a===null){M=a=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(a===null){M=i;try{M.stateNode.nodeValue=f?"":M.memoizedProps}catch(st){Dt(M,M.return,st)}}}else if(i.tag===18){if(a===null){M=i;try{var j=M.stateNode;f?bp(j,!0):bp(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;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}o&4&&(o=e.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,or(e,a))));break;case 19:Ae(i,e),Ce(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,or(e,o)));break;case 30:break;case 21:break;default:Ae(i,e),Ce(e)}}function Ce(e){var i=e.flags;if(i&2){try{for(var a,o=e.return;o!==null;){if(Sm(o)){a=o;break}o=o.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var f=a.stateNode,d=ju(e);rr(e,d,f);break;case 5:var y=a.stateNode;a.flags&32&&(as(y,""),a.flags&=-33);var v=ju(e);rr(e,v,y);break;case 3:case 4:var M=a.stateNode.containerInfo,U=ju(e);Yu(e,U,M);break;default:throw Error(s(161))}}catch(q){Dt(e,e.return,q)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function Dm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;Dm(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;)Am(e,i.alternate,i),i=i.sibling}function Yn(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:on(4,i,i.return),Yn(i);break;case 1:xi(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&bm(i,i.return,a),Yn(i);break;case 27:Ga(i.stateNode);case 26:case 5:xi(i,i.return),Yn(i);break;case 22:i.memoizedState===null&&Yn(i);break;case 30:Yn(i);break;default:Yn(i)}e=e.sibling}}function Ui(e,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var o=i.alternate,f=e,d=i,y=d.flags;switch(d.tag){case 0:case 11:case 15:Ui(f,d,a),Ca(4,d);break;case 1:if(Ui(f,d,a),o=d,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(U){Dt(o,o.return,U)}if(o=d,f=o.updateQueue,f!==null){var v=o.stateNode;try{var M=f.shared.hiddenCallbacks;if(M!==null)for(f.shared.hiddenCallbacks=null,f=0;f<M.length;f++)od(M[f],v)}catch(U){Dt(o,o.return,U)}}a&&y&64&&_m(d),Ma(d,d.return);break;case 27:Tm(d);case 26:case 5:Ui(f,d,a),a&&o===null&&y&4&&vm(d),Ma(d,d.return);break;case 12:Ui(f,d,a);break;case 31:Ui(f,d,a),a&&y&4&&Em(f,d);break;case 13:Ui(f,d,a),a&&y&4&&Rm(f,d);break;case 22:d.memoizedState===null&&Ui(f,d,a),Ma(d,d.return);break;case 30:break;default:Ui(f,d,a)}i=i.sibling}}function Xu(e,i){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&da(a))}function Vu(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,a,o){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Bm(e,i,a,o),i=i.sibling}function Bm(e,i,a,o){var f=i.flags;switch(i.tag){case 0:case 11:case 15:hi(e,i,a,o),f&2048&&Ca(9,i);break;case 1:hi(e,i,a,o);break;case 3:hi(e,i,a,o),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,a,o),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,a,o);break;case 31:hi(e,i,a,o);break;case 13:hi(e,i,a,o);break;case 23:break;case 22:d=i.stateNode,y=i.alternate,i.memoizedState!==null?d._visibility&2?hi(e,i,a,o):Ea(e,i):d._visibility&2?hi(e,i,a,o):(d._visibility|=2,As(e,i,a,o,(i.subtreeFlags&10256)!==0||!1)),f&2048&&Xu(y,i);break;case 24:hi(e,i,a,o),f&2048&&Vu(i.alternate,i);break;default:hi(e,i,a,o)}}function As(e,i,a,o,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var d=e,y=i,v=a,M=o,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&&Xu(y.alternate,y);break;case 24:As(d,y,v,M,f),f&&U&2048&&Vu(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 a=e,o=i,f=o.flags;switch(o.tag){case 22:Ea(a,o),f&2048&&Xu(o.alternate,o);break;case 24:Ea(a,o),f&2048&&Vu(o.alternate,o);break;default:Ea(a,o)}i=i.sibling}}var Ra=8192;function Cs(e,i,a){if(e.subtreeFlags&Ra)for(e=e.child;e!==null;)Om(e,i,a),e=e.sibling}function Om(e,i,a){switch(e.tag){case 26:Cs(e,i,a),e.flags&Ra&&e.memoizedState!==null&&r1(a,ci,e.memoizedState,e.memoizedProps);break;case 5:Cs(e,i,a);break;case 3:case 4:var o=ci;ci=Sr(e.stateNode.containerInfo),Cs(e,i,a),ci=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Ra,Ra=16777216,Cs(e,i,a),Ra=o):Cs(e,i,a));break;default:Cs(e,i,a)}}function Nm(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 a=0;a<i.length;a++){var o=i[a];re=o,Gm(o,e)}Nm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)km(e),e=e.sibling}function km(e){switch(e.tag){case 0:case 11:case 15:za(e),e.flags&2048&&on(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 a=0;a<i.length;a++){var o=i[a];re=o,Gm(o,e)}Nm(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:on(8,i,i.return),ur(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,ur(i));break;default:ur(i)}e=e.sibling}}function Gm(e,i){for(;re!==null;){var a=re;switch(a.tag){case 0:case 11:case 15:on(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:da(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,re=o;else t:for(a=e;re!==null;){o=re;var f=o.sibling,d=o.return;if(Cm(o),o===a){re=null;break t}if(f!==null){f.return=d,re=f;break t}re=d}}}var S_={getCacheForType:function(e){var i=he(te),a=i.data.get(e);return a===void 0&&(a=e(),i.data.set(e,a)),a},cacheSignal:function(){return he(te).controller.signal}},T_=typeof WeakMap=="function"?WeakMap:Map,Rt=0,Ut=null,xt=null,bt=0,zt=0,je=null,un=!1,Ms=!1,Pu=!1,Hi=0,Pt=0,cn=0,qn=0,Fu=0,Ye=0,Es=0,Da=null,Me=null,Wu=!1,cr=0,Um=0,hr=1/0,fr=null,hn=null,se=0,fn=null,Rs=null,Li=0,Qu=0,Zu=null,Hm=null,Ba=0,Iu=null;function qe(){return(Rt&2)!==0&&bt!==0?bt&-bt:D.T!==null?ic():Jh()}function Lm(){if(Ye===0)if((bt&536870912)===0||Tt){var e=bl;bl<<=1,(bl&3932160)===0&&(bl=262144),Ye=e}else Ye=536870912;return e=He.current,e!==null&&(e.flags|=32),Ye}function Ee(e,i,a){(e===Ut&&(zt===2||zt===9)||e.cancelPendingCommit!==null)&&(zs(e,0),dn(e,bt,Ye,!1)),Js(e,a),((Rt&2)===0||e!==Ut)&&(e===Ut&&((Rt&2)===0&&(qn|=a),Pt===4&&dn(e,bt,Ye,!1)),_i(e))}function jm(e,i,a){if((Rt&6)!==0)throw Error(s(327));var o=!a&&(i&127)===0&&(i&e.expiredLanes)===0||$s(e,i),f=o?C_(e,i):$u(e,i,!0),d=o;do{if(f===0){Ms&&!o&&dn(e,i,0,!1);break}else{if(a=e.current.alternate,d&&!w_(a)){f=$u(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&&(zs(v,y).flags|=256),y=$u(v,y,!1),y!==2){if(Pu&&!M){v.errorRecoveryDisabledLanes|=d,qn|=d,f=4;break t}d=Me,Me=f,d!==null&&(Me===null?Me=d:Me.push.apply(Me,d))}f=y}if(d=!1,f!==2)continue}}if(f===1){zs(e,0),dn(e,i,0,!0);break}t:{switch(o=e,d=f,d){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:dn(o,i,Ye,!un);break t;case 2:Me=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(f=cr+300-Oe(),10<f)){if(dn(o,i,Ye,!un),Sl(o,0,!0)!==0)break t;Li=i,o.timeoutHandle=yp(Ym.bind(null,o,a,Me,fr,Wu,i,Ye,qn,Es,un,d,"Throttled",-0,0),f);break t}Ym(o,a,Me,fr,Wu,i,Ye,qn,Es,un,d,null,-0,0)}}break}while(!0);_i(e)}function Ym(e,i,a,o,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:wi},Om(i,d,F);var st=(d&62914560)===d?cr-Oe():(d&4194048)===d?Um-Oe():0;if(st=o1(F,st),st!==null){Li=d,e.cancelPendingCommit=st(Zm.bind(null,e,i,d,a,o,f,y,v,M,q,F,null,H,j)),dn(e,d,y,!U);return}}Zm(e,i,d,a,o,f,y,v,M)}function w_(e){for(var i=e;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var f=a[o],d=f.getSnapshot;f=f.value;try{if(!Ge(d(),f))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;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 dn(e,i,a,o){i&=~Fu,i&=~qn,e.suspendedLanes|=i,e.pingedLanes&=~i,o&&(e.warmLanes|=i),o=e.expirationTimes;for(var f=i;0<f;){var d=31-ke(f),y=1<<d;o[d]=-1,f&=~y}a!==0&&Ih(e,a,i)}function dr(){return(Rt&6)===0?(Oa(0),!1):!0}function Ku(){if(xt!==null){if(zt===0)var e=xt.return;else e=xt,Ei=On=null,du(e),bs=null,pa=0,e=xt;for(;e!==null;)xm(e.alternate,e),e=e.return;xt=null}}function zs(e,i){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,V_(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Li=0,Ku(),Ut=e,xt=a=Ci(e.current,null),bt=i,zt=0,je=null,un=!1,Ms=$s(e,i),Pu=!1,Es=Ye=Fu=qn=cn=Pt=0,Me=Da=null,Wu=!1,(i&8)!==0&&(i|=i&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=i;0<o;){var f=31-ke(o),d=1<<f;i|=e[f],o&=~d}return Hi=i,Nl(),a}function qm(e,i){pt=null,D.H=Ta,i===_s||i===ql?(i=sd(),zt=3):i===eu?(i=sd(),zt=4):zt=i===Ru?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,je=i,xt===null&&(Pt=1,ir(e,Ie(i,e.current)))}function Xm(){var e=He.current;return e===null?!0:(bt&4194048)===bt?ti===null:(bt&62914560)===bt||(bt&536870912)!==0?e===ti:!1}function Vm(){var e=D.H;return D.H=Ta,e===null?Ta:e}function Pm(){var e=D.A;return D.A=S_,e}function mr(){Pt=4,un||(bt&4194048)!==bt&&He.current!==null||(Ms=!0),(cn&134217727)===0&&(qn&134217727)===0||Ut===null||dn(Ut,bt,Ye,!1)}function $u(e,i,a){var o=Rt;Rt|=2;var f=Vm(),d=Pm();(Ut!==e||bt!==i)&&(fr=null,zs(e,i)),i=!1;var y=Pt;t:do try{if(zt!==0&&xt!==null){var v=xt,M=je;switch(zt){case 8:Ku(),y=6;break t;case 3:case 2:case 9:case 6:He.current===null&&(i=!0);var U=zt;if(zt=0,je=null,Ds(e,v,M,U),a&&Ms){y=0;break t}break;default:U=zt,zt=0,je=null,Ds(e,v,M,U)}}A_(),y=Pt;break}catch(q){qm(e,q)}while(!0);return i&&e.shellSuspendCounter++,Ei=On=null,Rt=o,D.H=f,D.A=d,xt===null&&(Ut=null,bt=0,Nl()),y}function A_(){for(;xt!==null;)Fm(xt)}function C_(e,i){var a=Rt;Rt|=2;var o=Vm(),f=Pm();Ut!==e||bt!==i?(fr=null,hr=Oe()+500,zs(e,i)):Ms=$s(e,i);t:do try{if(zt!==0&&xt!==null){i=xt;var d=je;e:switch(zt){case 1:zt=0,je=null,Ds(e,i,d,1);break;case 2:case 9:if(id(d)){zt=0,je=null,Wm(i);break}i=function(){zt!==2&&zt!==9||Ut!==e||(zt=7),_i(e)},d.then(i,i);break t;case 3:zt=7;break t;case 4:zt=5;break t;case 7:id(d)?(zt=0,je=null,Wm(i)):(zt=0,je=null,Ds(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?Bp(y):v.stateNode.complete){zt=0,je=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,je=null,Ds(e,i,d,5);break;case 6:zt=0,je=null,Ds(e,i,d,6);break;case 8:Ku(),Pt=6;break t;default:throw Error(s(462))}}M_();break}catch(q){qm(e,q)}while(!0);return Ei=On=null,D.H=o,D.A=f,Rt=a,xt!==null?0:(Ut=null,bt=0,Nl(),Pt)}function M_(){for(;xt!==null&&!I0();)Fm(xt)}function Fm(e){var i=gm(e.alternate,e,Hi);e.memoizedProps=e.pendingProps,i===null?pr(e):xt=i}function Wm(e){var i=e,a=i.alternate;switch(i.tag){case 15:case 0:i=cm(a,i,i.pendingProps,i.type,void 0,bt);break;case 11:i=cm(a,i,i.pendingProps,i.type.render,i.ref,bt);break;case 5:du(i);default:xm(a,i),i=xt=Pf(i,Hi),i=gm(a,i,Hi)}e.memoizedProps=e.pendingProps,i===null?pr(e):xt=i}function Ds(e,i,a,o){Ei=On=null,du(i),bs=null,pa=0;var f=i.return;try{if(p_(e,f,i,a,bt)){Pt=1,ir(e,Ie(a,e.current)),xt=null;return}}catch(d){if(f!==null)throw xt=f,d;Pt=1,ir(e,Ie(a,e.current)),xt=null;return}i.flags&32768?(Tt||o===1?e=!0:Ms||(bt&536870912)!==0?e=!1:(un=e=!0,(o===2||o===9||o===3||o===6)&&(o=He.current,o!==null&&o.tag===13&&(o.flags|=16384))),Qm(i,e)):pr(i)}function pr(e){var i=e;do{if((i.flags&32768)!==0){Qm(i,un);return}e=i.return;var a=x_(i.alternate,i,Hi);if(a!==null){xt=a;return}if(i=i.sibling,i!==null){xt=i;return}xt=i=e}while(i!==null);Pt===0&&(Pt=5)}function Qm(e,i){do{var a=__(e.alternate,e);if(a!==null){a.flags&=32767,xt=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(e=e.sibling,e!==null)){xt=e;return}xt=e=a}while(e!==null);Pt=6,xt=null}function Zm(e,i,a,o,f,d,y,v,M){e.cancelPendingCommit=null;do gr();while(se!==0);if((Rt&6)!==0)throw Error(s(327));if(i!==null){if(i===e.current)throw Error(s(177));if(d=i.lanes|i.childLanes,d|=jo,lx(e,a,d,y,v,M),e===Ut&&(xt=Ut=null,bt=0),Rs=i,fn=e,Li=a,Qu=d,Zu=f,Hm=o,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,D_(xl,function(){return tp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||o){o=D.T,D.T=null,f=L.p,L.p=2,y=Rt,Rt|=4;try{b_(e,i,a)}finally{Rt=y,L.p=f,D.T=o}}se=1,Im(),Km(),$m()}}function Im(){if(se===1){se=0;var e=fn,i=Rs,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var o=L.p;L.p=2;var f=Rt;Rt|=4;try{zm(i,e);var d=cc,y=Gf(e.containerInfo),v=d.focusedElem,M=d.selectionRange;if(y!==v&&v&&v.ownerDocument&&kf(v.ownerDocument.documentElement,v)){if(M!==null&&ko(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),kt=M.end===void 0?ut:Math.min(M.end,st);!j.extend&&ut>kt&&(y=kt,kt=ut,ut=y);var B=Nf(v,ut),z=Nf(v,kt);if(B&&z&&(j.rangeCount!==1||j.anchorNode!==B.node||j.anchorOffset!==B.offset||j.focusNode!==z.node||j.focusOffset!==z.offset)){var G=F.createRange();G.setStart(B.node,B.offset),j.removeAllRanges(),ut>kt?(j.addRange(G),j.extend(z.node,z.offset)):(G.setEnd(z.node,z.offset),j.addRange(G))}}}}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 V=F[v];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}Er=!!uc,cc=uc=null}finally{Rt=f,L.p=o,D.T=a}}e.current=i,se=2}}function Km(){if(se===2){se=0;var e=fn,i=Rs,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var o=L.p;L.p=2;var f=Rt;Rt|=4;try{Am(e,i.alternate,i)}finally{Rt=f,L.p=o,D.T=a}}se=3}}function $m(){if(se===4||se===3){se=0,K0();var e=fn,i=Rs,a=Li,o=Hm;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?se=5:(se=0,Rs=fn=null,Jm(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(hn=null),go(a),i=i.stateNode,Ne&&typeof Ne.onCommitFiberRoot=="function")try{Ne.onCommitFiberRoot(Ks,i,void 0,(i.current.flags&128)===128)}catch{}if(o!==null){i=D.T,f=L.p,L.p=2,D.T=null;try{for(var d=e.onRecoverableError,y=0;y<o.length;y++){var v=o[y];d(v.value,{componentStack:v.stack})}}finally{D.T=i,L.p=f}}(Li&3)!==0&&gr(),_i(e),f=e.pendingLanes,(a&261930)!==0&&(f&42)!==0?e===Iu?Ba++:(Ba=0,Iu=e):Ba=0,Oa(0)}}function Jm(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,da(i)))}function gr(){return Im(),Km(),$m(),tp()}function tp(){if(se!==5)return!1;var e=fn,i=Qu;Qu=0;var a=go(Li),o=D.T,f=L.p;try{L.p=32>a?32:a,D.T=null,a=Zu,Zu=null;var d=fn,y=Li;if(se=0,Rs=fn=null,Li=0,(Rt&6)!==0)throw Error(s(331));var v=Rt;if(Rt|=4,km(d.current),Bm(d,d.current,y,a),Rt=v,Oa(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(Ks,d)}catch{}return!0}finally{L.p=f,D.T=o,Jm(e,i)}}function ep(e,i,a){i=Ie(a,i),i=Eu(e.stateNode,i,2),e=an(e,i,2),e!==null&&(Js(e,2),_i(e))}function Dt(e,i,a){if(e.tag===3)ep(e,e,a);else for(;i!==null;){if(i.tag===3){ep(i,e,a);break}else if(i.tag===1){var o=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(hn===null||!hn.has(o))){e=Ie(a,e),a=im(2),o=an(i,a,2),o!==null&&(nm(a,o,i,e),Js(o,2),_i(o));break}}i=i.return}}function Ju(e,i,a){var o=e.pingCache;if(o===null){o=e.pingCache=new T_;var f=new Set;o.set(i,f)}else f=o.get(i),f===void 0&&(f=new Set,o.set(i,f));f.has(a)||(Pu=!0,f.add(a),e=E_.bind(null,e,i,a),i.then(e,e))}function E_(e,i,a){var o=e.pingCache;o!==null&&o.delete(i),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ut===e&&(bt&a)===a&&(Pt===4||Pt===3&&(bt&62914560)===bt&&300>Oe()-cr?(Rt&2)===0&&zs(e,0):Fu|=a,Es===bt&&(Es=0)),_i(e)}function ip(e,i){i===0&&(i=Zh()),e=zn(e,i),e!==null&&(Js(e,i),_i(e))}function R_(e){var i=e.memoizedState,a=0;i!==null&&(a=i.retryLane),ip(e,a)}function z_(e,i){var a=0;switch(e.tag){case 31:case 13:var o=e.stateNode,f=e.memoizedState;f!==null&&(a=f.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(i),ip(e,a)}function D_(e,i){return ho(e,i)}var yr=null,Bs=null,tc=!1,xr=!1,ec=!1,mn=0;function _i(e){e!==Bs&&e.next===null&&(Bs===null?yr=Bs=e:Bs=Bs.next=e),xr=!0,tc||(tc=!0,O_())}function Oa(e,i){if(!ec&&xr){ec=!0;do for(var a=!1,o=yr;o!==null;){if(e!==0){var f=o.pendingLanes;if(f===0)var d=0;else{var y=o.suspendedLanes,v=o.pingedLanes;d=(1<<31-ke(42|e)+1)-1,d&=f&~(y&~v),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,lp(o,d))}else d=bt,d=Sl(o,o===Ut?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||$s(o,d)||(a=!0,lp(o,d));o=o.next}while(a);ec=!1}}function B_(){np()}function np(){xr=tc=!1;var e=0;mn!==0&&X_()&&(e=mn);for(var i=Oe(),a=null,o=yr;o!==null;){var f=o.next,d=sp(o,i);d===0?(o.next=null,a===null?yr=f:a.next=f,f===null&&(Bs=a)):(a=o,(e!==0||(d&3)!==0)&&(xr=!0)),o=f}se!==0&&se!==5||Oa(e),mn!==0&&(mn=0)}function sp(e,i){for(var a=e.suspendedLanes,o=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-ke(d),v=1<<y,M=f[y];M===-1?((v&a)===0||(v&o)!==0)&&(f[y]=ax(v,i)):M<=i&&(e.expiredLanes|=v),d&=~v}if(i=Ut,a=bt,a=Sl(e,e===i?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,a===0||e===i&&(zt===2||zt===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&fo(o),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||$s(e,a)){if(i=a&-a,i===e.callbackPriority)return i;switch(o!==null&&fo(o),go(a)){case 2:case 8:a=Wh;break;case 32:a=xl;break;case 268435456:a=Qh;break;default:a=xl}return o=ap.bind(null,e),a=ho(a,o),e.callbackPriority=i,e.callbackNode=a,i}return o!==null&&o!==null&&fo(o),e.callbackPriority=2,e.callbackNode=null,2}function ap(e,i){if(se!==0&&se!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(gr()&&e.callbackNode!==a)return null;var o=bt;return o=Sl(e,e===Ut?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(jm(e,o,i),sp(e,Oe()),e.callbackNode!=null&&e.callbackNode===a?ap.bind(null,e):null)}function lp(e,i){if(gr())return null;jm(e,i,!0)}function O_(){P_(function(){(Rt&6)!==0?ho(Fh,B_):np()})}function ic(){if(mn===0){var e=ys;e===0&&(e=_l,_l<<=1,(_l&261888)===0&&(_l=256)),mn=e}return mn}function rp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Cl(""+e)}function op(e,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,e.id&&a.setAttribute("form",e.id),i.parentNode.insertBefore(a,i),e=new FormData(e),a.parentNode.removeChild(a),e}function N_(e,i,a,o,f){if(i==="submit"&&a&&a.stateNode===f){var d=rp((f[Se]||null).action),y=o.submitter;y&&(i=(i=y[Se]||null)?rp(i.formAction):y.getAttribute("formAction"),i!==null&&(d=i,y=null));var v=new zl("action","action",null,o,f);e.push({event:v,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(mn!==0){var M=y?op(f,y):new FormData(f);Su(a,{pending:!0,data:M,method:f.method,action:d},null,M)}}else typeof d=="function"&&(v.preventDefault(),M=y?op(f,y):new FormData(f),Su(a,{pending:!0,data:M,method:f.method,action:d},d,M))},currentTarget:f}]})}}for(var nc=0;nc<Lo.length;nc++){var sc=Lo[nc],k_=sc.toLowerCase(),G_=sc[0].toUpperCase()+sc.slice(1);ui(k_,"on"+G_)}ui(Lf,"onAnimationEnd"),ui(jf,"onAnimationIteration"),ui(Yf,"onAnimationStart"),ui("dblclick","onDoubleClick"),ui("focusin","onFocus"),ui("focusout","onBlur"),ui($x,"onTransitionRun"),ui(Jx,"onTransitionStart"),ui(t_,"onTransitionCancel"),ui(qf,"onTransitionEnd"),ns("onMouseEnter",["mouseout","mouseover"]),ns("onMouseLeave",["mouseout","mouseover"]),ns("onPointerEnter",["pointerout","pointerover"]),ns("onPointerLeave",["pointerout","pointerover"]),Cn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cn("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(" "),U_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Na));function up(e,i){i=(i&4)!==0;for(var a=0;a<e.length;a++){var o=e[a],f=o.event;o=o.listeners;t:{var d=void 0;if(i)for(var y=o.length-1;0<=y;y--){var v=o[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<o.length;y++){if(v=o[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 a=i[yo];a===void 0&&(a=i[yo]=new Set);var o=e+"__bubble";a.has(o)||(cp(i,e,2,!1),a.add(o))}function ac(e,i,a){var o=0;i&&(o|=4),cp(a,e,o,i)}var _r="_reactListening"+Math.random().toString(36).slice(2);function lc(e){if(!e[_r]){e[_r]=!0,nf.forEach(function(a){a!=="selectionchange"&&(U_.has(a)||ac(a,!1,e),ac(a,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[_r]||(i[_r]=!0,ac("selectionchange",!1,i))}}function cp(e,i,a,o){switch(Lp(i)){case 2:var f=h1;break;case 8:f=f1;break;default:f=vc}a=f.bind(null,i,a,e),f=void 0,!Co||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),o?f!==void 0?e.addEventListener(i,a,{capture:!0,passive:f}):e.addEventListener(i,a,!0):f!==void 0?e.addEventListener(i,a,{passive:f}):e.addEventListener(i,a,!1)}function rc(e,i,a,o,f){var d=o;if((i&1)===0&&(i&2)===0&&o!==null)t:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var v=o.stateNode.containerInfo;if(v===f)break;if(y===4)for(y=o.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=ts(v),y===null)return;if(M=y.tag,M===5||M===6||M===26||M===27){o=d=y;continue t}v=v.parentNode}}o=o.return}pf(function(){var U=d,q=wo(a),F=[];t:{var H=Xf.get(e);if(H!==void 0){var j=zl,st=e;switch(e){case"keypress":if(El(a)===0)break t;case"keydown":case"keyup":j=zx;break;case"focusin":st="focus",j=zo;break;case"focusout":st="blur",j=zo;break;case"beforeblur":case"afterblur":j=zo;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":j=xf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=xx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=Ox;break;case Lf:case jf:case Yf:j=vx;break;case qf:j=kx;break;case"scroll":case"scrollend":j=gx;break;case"wheel":j=Ux;break;case"copy":case"cut":case"paste":j=Tx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=bf;break;case"toggle":case"beforetoggle":j=Lx}var ut=(i&4)!==0,kt=!ut&&(e==="scroll"||e==="scrollend"),B=ut?H!==null?H+"Capture":null:H;ut=[];for(var z=U,G;z!==null;){var V=z;if(G=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||G===null||B===null||(V=ia(z,B),V!=null&&ut.push(ka(z,V,G))),kt)break;z=z.return}0<ut.length&&(H=new j(H,st,null,a,q),F.push({event:H,listeners:ut}))}}if((i&7)===0){t:{if(H=e==="mouseover"||e==="pointerover",j=e==="mouseout"||e==="pointerout",H&&a!==To&&(st=a.relatedTarget||a.fromElement)&&(ts(st)||st[Jn]))break t;if((j||H)&&(H=q.window===q?q:(H=q.ownerDocument)?H.defaultView||H.parentWindow:window,j?(st=a.relatedTarget||a.toElement,j=U,st=st?ts(st):null,st!==null&&(kt=u(st),ut=st.tag,st!==kt||ut!==5&&ut!==27&&ut!==6)&&(st=null)):(j=null,st=U),j!==st)){if(ut=xf,V="onMouseLeave",B="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(ut=bf,V="onPointerLeave",B="onPointerEnter",z="pointer"),kt=j==null?H:ea(j),G=st==null?H:ea(st),H=new ut(V,z+"leave",j,a,q),H.target=kt,H.relatedTarget=G,V=null,ts(q)===U&&(ut=new ut(B,z+"enter",st,a,q),ut.target=G,ut.relatedTarget=kt,V=ut),kt=V,j&&st)e:{for(ut=H_,B=j,z=st,G=0,V=B;V;V=ut(V))G++;V=0;for(var ot=z;ot;ot=ut(ot))V++;for(;0<G-V;)B=ut(B),G--;for(;0<V-G;)z=ut(z),V--;for(;G--;){if(B===z||z!==null&&B===z.alternate){ut=B;break e}B=ut(B),z=ut(z)}ut=null}else ut=null;j!==null&&hp(F,H,j,ut,!1),st!==null&&kt!==null&&hp(F,kt,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=Ef;else if(Cf(H))if(Rf)Ct=Zx;else{Ct=Wx;var lt=Fx}else j=H.nodeName,!j||j.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?U&&So(U.elementType)&&(Ct=Ef):Ct=Qx;if(Ct&&(Ct=Ct(e,U))){Mf(F,Ct,a,q);break t}lt&<(e,H,U),e==="focusout"&&U&&H.type==="number"&&U.memoizedProps.value!=null&&vo(H,"number",H.value)}switch(lt=U?ea(U):window,e){case"focusin":(Cf(lt)||lt.contentEditable==="true")&&(us=lt,Go=U,ca=null);break;case"focusout":ca=Go=us=null;break;case"mousedown":Uo=!0;break;case"contextmenu":case"mouseup":case"dragend":Uo=!1,Uf(F,a,q);break;case"selectionchange":if(Kx)break;case"keydown":case"keyup":Uf(F,a,q)}var gt;if(Bo)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 os?wf(e,a)&&(vt="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(vt="onCompositionStart");vt&&(vf&&a.locale!=="ko"&&(os||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&os&&(gt=gf()):(Ki=q,Mo="value"in Ki?Ki.value:Ki.textContent,os=!0)),lt=br(U,vt),0<lt.length&&(vt=new _f(vt,e,null,a,q),F.push({event:vt,listeners:lt}),gt?vt.data=gt:(gt=Af(a),gt!==null&&(vt.data=gt)))),(gt=Yx?qx(e,a):Xx(e,a))&&(vt=br(U,"onBeforeInput"),0<vt.length&&(lt=new _f("onBeforeInput","beforeinput",null,a,q),F.push({event:lt,listeners:vt}),lt.data=gt)),N_(F,e,U,a,q)}up(F,i)})}function ka(e,i,a){return{instance:e,listener:i,currentTarget:a}}function br(e,i){for(var a=i+"Capture",o=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=ia(e,a),f!=null&&o.unshift(ka(e,f,d)),f=ia(e,i),f!=null&&o.push(ka(e,f,d))),e.tag===3)return o;e=e.return}return[]}function H_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hp(e,i,a,o,f){for(var d=i._reactName,y=[];a!==null&&a!==o;){var v=a,M=v.alternate,U=v.stateNode;if(v=v.tag,M!==null&&M===o)break;v!==5&&v!==26&&v!==27||U===null||(M=U,f?(U=ia(a,d),U!=null&&y.unshift(ka(a,U,M))):f||(U=ia(a,d),U!=null&&y.push(ka(a,U,M)))),a=a.return}y.length!==0&&e.push({event:i,listeners:y})}var L_=/\r\n?/g,j_=/\u0000|\uFFFD/g;function fp(e){return(typeof e=="string"?e:""+e).replace(L_,`
|
|
50
|
+
`).replace(j_,"")}function dp(e,i){return i=fp(i),fp(e)===i}function Nt(e,i,a,o,f,d){switch(a){case"children":typeof o=="string"?i==="body"||i==="textarea"&&o===""||as(e,o):(typeof o=="number"||typeof o=="bigint")&&i!=="body"&&as(e,""+o);break;case"className":wl(e,"class",o);break;case"tabIndex":wl(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":wl(e,a,o);break;case"style":df(e,o,d);break;case"data":if(i!=="object"){wl(e,"data",o);break}case"src":case"href":if(o===""&&(i!=="a"||a!=="href")){e.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=Cl(""+o),e.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(a,"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"&&(a==="formAction"?(i!=="input"&&Nt(e,i,"name",f.name,f,null),Nt(e,i,"formEncType",f.formEncType,f,null),Nt(e,i,"formMethod",f.formMethod,f,null),Nt(e,i,"formTarget",f.formTarget,f,null)):(Nt(e,i,"encType",f.encType,f,null),Nt(e,i,"method",f.method,f,null),Nt(e,i,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(a);break}o=Cl(""+o),e.setAttribute(a,o);break;case"onClick":o!=null&&(e.onclick=wi);break;case"onScroll":o!=null&&_t("scroll",e);break;case"onScrollEnd":o!=null&&_t("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}a=Cl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""+o):e.removeAttribute(a);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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":o===!0?e.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(a,o):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(a,o):e.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(a):e.setAttribute(a,o);break;case"popover":_t("beforetoggle",e),_t("toggle",e),Tl(e,"popover",o);break;case"xlinkActuate":Ti(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Ti(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Ti(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Ti(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Ti(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Ti(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Ti(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Ti(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Ti(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Tl(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=mx.get(a)||a,Tl(e,a,o))}}function oc(e,i,a,o,f,d){switch(a){case"style":df(e,o,d);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof o=="string"?as(e,o):(typeof o=="number"||typeof o=="bigint")&&as(e,""+o);break;case"onScroll":o!=null&&_t("scroll",e);break;case"onScrollEnd":o!=null&&_t("scrollend",e);break;case"onClick":o!=null&&(e.onclick=wi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sf.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),i=a.slice(2,f?a.length-7:void 0),d=e[Se]||null,d=d!=null?d[a]:null,typeof d=="function"&&e.removeEventListener(i,d,f),typeof o=="function")){typeof d!="function"&&d!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(i,o,f);break t}a in e?e[a]=o:o===!0?e.setAttribute(a,""):Tl(e,a,o)}}}function de(e,i,a){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 o=!1,f=!1,d;for(d in a)if(a.hasOwnProperty(d)){var y=a[d];if(y!=null)switch(d){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Nt(e,i,d,y,a,null)}}f&&Nt(e,i,"srcSet",a.srcSet,a,null),o&&Nt(e,i,"src",a.src,a,null);return;case"input":_t("invalid",e);var v=d=y=f=null,M=null,U=null;for(o in a)if(a.hasOwnProperty(o)){var q=a[o];if(q!=null)switch(o){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(s(137,i));break;default:Nt(e,i,o,q,a,null)}}uf(e,d,v,M,U,y,f,!1);return;case"select":_t("invalid",e),o=y=d=null;for(f in a)if(a.hasOwnProperty(f)&&(v=a[f],v!=null))switch(f){case"value":d=v;break;case"defaultValue":y=v;break;case"multiple":o=v;default:Nt(e,i,f,v,a,null)}i=d,a=y,e.multiple=!!o,i!=null?ss(e,!!o,i,!1):a!=null&&ss(e,!!o,a,!0);return;case"textarea":_t("invalid",e),d=f=o=null;for(y in a)if(a.hasOwnProperty(y)&&(v=a[y],v!=null))switch(y){case"value":o=v;break;case"defaultValue":f=v;break;case"children":d=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(s(91));break;default:Nt(e,i,y,v,a,null)}hf(e,o,f,d);return;case"option":for(M in a)if(a.hasOwnProperty(M)&&(o=a[M],o!=null))switch(M){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Nt(e,i,M,o,a,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(o=0;o<Na.length;o++)_t(Na[o],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 a)if(a.hasOwnProperty(U)&&(o=a[U],o!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Nt(e,i,U,o,a,null)}return;default:if(So(i)){for(q in a)a.hasOwnProperty(q)&&(o=a[q],o!==void 0&&oc(e,i,q,o,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(o=a[v],o!=null&&Nt(e,i,v,o,a,null))}function Y_(e,i,a,o){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 a){var F=a[j];if(a.hasOwnProperty(j)&&F!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":M=F;default:o.hasOwnProperty(j)||Nt(e,i,j,null,o,F)}}for(var H in o){var j=o[H];if(F=a[H],o.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(s(137,i));break;default:j!==F&&Nt(e,i,H,j,o,F)}}bo(e,y,v,M,U,q,d,f);return;case"select":j=y=v=H=null;for(d in a)if(M=a[d],a.hasOwnProperty(d)&&M!=null)switch(d){case"value":break;case"multiple":j=M;default:o.hasOwnProperty(d)||Nt(e,i,d,null,o,M)}for(f in o)if(d=o[f],M=a[f],o.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&&Nt(e,i,f,d,o,M)}i=v,a=y,o=j,H!=null?ss(e,!!a,H,!1):!!o!=!!a&&(i!=null?ss(e,!!a,i,!0):ss(e,!!a,a?[]:"",!1));return;case"textarea":j=H=null;for(v in a)if(f=a[v],a.hasOwnProperty(v)&&f!=null&&!o.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Nt(e,i,v,null,o,f)}for(y in o)if(f=o[y],d=a[y],o.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(s(91));break;default:f!==d&&Nt(e,i,y,f,o,d)}cf(e,H,j);return;case"option":for(var st in a)if(H=a[st],a.hasOwnProperty(st)&&H!=null&&!o.hasOwnProperty(st))switch(st){case"selected":e.selected=!1;break;default:Nt(e,i,st,null,o,H)}for(M in o)if(H=o[M],j=a[M],o.hasOwnProperty(M)&&H!==j&&(H!=null||j!=null))switch(M){case"selected":e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:Nt(e,i,M,H,o,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 a)H=a[ut],a.hasOwnProperty(ut)&&H!=null&&!o.hasOwnProperty(ut)&&Nt(e,i,ut,null,o,H);for(U in o)if(H=o[U],j=a[U],o.hasOwnProperty(U)&&H!==j&&(H!=null||j!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(137,i));break;default:Nt(e,i,U,H,o,j)}return;default:if(So(i)){for(var kt in a)H=a[kt],a.hasOwnProperty(kt)&&H!==void 0&&!o.hasOwnProperty(kt)&&oc(e,i,kt,void 0,o,H);for(q in o)H=o[q],j=a[q],!o.hasOwnProperty(q)||H===j||H===void 0&&j===void 0||oc(e,i,q,H,o,j);return}}for(var B in a)H=a[B],a.hasOwnProperty(B)&&H!=null&&!o.hasOwnProperty(B)&&Nt(e,i,B,null,o,H);for(F in o)H=o[F],j=a[F],!o.hasOwnProperty(F)||H===j||H==null&&j==null||Nt(e,i,F,H,o,j)}function mp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function q_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var f=a[o],d=f.transferSize,y=f.initiatorType,v=f.duration;if(d&&v&&mp(y)){for(y=0,v=f.responseEnd,o+=1;o<a.length;o++){var M=a[o],U=M.startTime;if(U>v)break;var q=M.transferSize,F=M.initiatorType;q&&mp(F)&&(M=M.responseEnd,y+=q*(M<v?1:(v-U)/(M-U)))}if(--o,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 uc=null,cc=null;function vr(e){return e.nodeType===9?e:e.ownerDocument}function pp(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 gp(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 hc(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 fc=null;function X_(){var e=window.event;return e&&e.type==="popstate"?e===fc?!1:(fc=e,!0):(fc=null,!1)}var yp=typeof setTimeout=="function"?setTimeout:void 0,V_=typeof clearTimeout=="function"?clearTimeout:void 0,xp=typeof Promise=="function"?Promise:void 0,P_=typeof queueMicrotask=="function"?queueMicrotask:typeof xp<"u"?function(e){return xp.resolve(null).then(e).catch(F_)}:yp;function F_(e){setTimeout(function(){throw e})}function pn(e){return e==="head"}function _p(e,i){var a=i,o=0;do{var f=a.nextSibling;if(e.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(o===0){e.removeChild(f),Gs(i);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")Ga(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ga(a);for(var d=a.firstChild;d;){var y=d.nextSibling,v=d.nodeName;d[ta]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=y}}else a==="body"&&Ga(e.ownerDocument.body);a=f}while(a);Gs(i)}function bp(e,i){var a=e;e=0;do{var o=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=o}while(a)}function dc(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":dc(a),xo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function W_(e,i,a,o){for(;e.nodeType===1;){var f=a;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){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=ei(e.nextSibling),e===null)break}return null}function Q_(e,i,a){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ei(e.nextSibling),e===null))return null;return e}function vp(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=ei(e.nextSibling),e===null))return null;return e}function mc(e){return e.data==="$?"||e.data==="$~"}function pc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Z_(e,i){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||a.readyState!=="loading")i();else{var o=function(){i(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function ei(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 gc=null;function Sp(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(i===0)return ei(e.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}e=e.nextSibling}return null}function Tp(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return e;i--}else a!=="/$"&&a!=="/&"||i++}e=e.previousSibling}return null}function wp(e,i,a){switch(i=vr(a),e){case"html":if(e=i.documentElement,!e)throw Error(s(452));return e;case"head":if(e=i.head,!e)throw Error(s(453));return e;case"body":if(e=i.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Ga(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);xo(e)}var ii=new Map,Ap=new Set;function Sr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ji=L.d;L.d={f:I_,r:K_,D:$_,C:J_,L:t1,m:e1,X:n1,S:i1,M:s1};function I_(){var e=ji.f(),i=dr();return e||i}function K_(e){var i=es(e);i!==null&&i.tag===5&&i.type==="form"?qd(i):ji.r(e)}var Os=typeof document>"u"?null:document;function Cp(e,i,a){var o=Os;if(o&&typeof i=="string"&&i){var f=Qe(i);f='link[rel="'+e+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),Ap.has(f)||(Ap.add(f),e={rel:e,crossOrigin:a,href:i},o.querySelector(f)===null&&(i=o.createElement("link"),de(i,"link",e),le(i),o.head.appendChild(i)))}}function $_(e){ji.D(e),Cp("dns-prefetch",e,null)}function J_(e,i){ji.C(e,i),Cp("preconnect",e,i)}function t1(e,i,a){ji.L(e,i,a);var o=Os;if(o&&e&&i){var f='link[rel="preload"][as="'+Qe(i)+'"]';i==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Qe(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Qe(a.imageSizes)+'"]')):f+='[href="'+Qe(e)+'"]';var d=f;switch(i){case"style":d=Ns(e);break;case"script":d=ks(e)}ii.has(d)||(e=x({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:e,as:i},a),ii.set(d,e),o.querySelector(f)!==null||i==="style"&&o.querySelector(Ua(d))||i==="script"&&o.querySelector(Ha(d))||(i=o.createElement("link"),de(i,"link",e),le(i),o.head.appendChild(i)))}}function e1(e,i){ji.m(e,i);var a=Os;if(a&&e){var o=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Qe(o)+'"][href="'+Qe(e)+'"]',d=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ks(e)}if(!ii.has(d)&&(e=x({rel:"modulepreload",href:e},i),ii.set(d,e),a.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ha(d)))return}o=a.createElement("link"),de(o,"link",e),le(o),a.head.appendChild(o)}}}function i1(e,i,a){ji.S(e,i,a);var o=Os;if(o&&e){var f=is(o).hoistableStyles,d=Ns(e);i=i||"default";var y=f.get(d);if(!y){var v={loading:0,preload:null};if(y=o.querySelector(Ua(d)))v.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":i},a),(a=ii.get(d))&&yc(e,a);var M=y=o.createElement("link");le(M),de(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,o)}y={type:"stylesheet",instance:y,count:1,state:v},f.set(d,y)}}}function n1(e,i){ji.X(e,i);var a=Os;if(a&&e){var o=is(a).hoistableScripts,f=ks(e),d=o.get(f);d||(d=a.querySelector(Ha(f)),d||(e=x({src:e,async:!0},i),(i=ii.get(f))&&xc(e,i),d=a.createElement("script"),le(d),de(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function s1(e,i){ji.M(e,i);var a=Os;if(a&&e){var o=is(a).hoistableScripts,f=ks(e),d=o.get(f);d||(d=a.querySelector(Ha(f)),d||(e=x({src:e,async:!0,type:"module"},i),(i=ii.get(f))&&xc(e,i),d=a.createElement("script"),le(d),de(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function Mp(e,i,a,o){var f=(f=ct.current)?Sr(f):null;if(!f)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=Ns(a.href),a=is(f).hoistableStyles,o=a.get(i),o||(o={type:"style",instance:null,count:0,state:null},a.set(i,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Ns(a.href);var d=is(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),ii.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ii.set(e,a),d||a1(f,e,a,y.state))),i&&o===null)throw Error(s(528,""));return y}if(i&&o!==null)throw Error(s(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ks(a),a=is(f).hoistableScripts,o=a.get(i),o||(o={type:"script",instance:null,count:0,state:null},a.set(i,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Ns(e){return'href="'+Qe(e)+'"'}function Ua(e){return'link[rel="stylesheet"]['+e+"]"}function Ep(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function a1(e,i,a,o){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?o.loading=1:(i=e.createElement("link"),o.preload=i,i.addEventListener("load",function(){return o.loading|=1}),i.addEventListener("error",function(){return o.loading|=2}),de(i,"link",a),le(i),e.head.appendChild(i))}function ks(e){return'[src="'+Qe(e)+'"]'}function Ha(e){return"script[async]"+e}function Rp(e,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var o=e.querySelector('style[data-href~="'+Qe(a.href)+'"]');if(o)return i.instance=o,le(o),o;var f=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),le(o),de(o,"style",f),Tr(o,a.precedence,e),i.instance=o;case"stylesheet":f=Ns(a.href);var d=e.querySelector(Ua(f));if(d)return i.state.loading|=4,i.instance=d,le(d),d;o=Ep(a),(f=ii.get(f))&&yc(o,f),d=(e.ownerDocument||e).createElement("link"),le(d);var y=d;return y._p=new Promise(function(v,M){y.onload=v,y.onerror=M}),de(d,"link",o),i.state.loading|=4,Tr(d,a.precedence,e),i.instance=d;case"script":return d=ks(a.src),(f=e.querySelector(Ha(d)))?(i.instance=f,le(f),f):(o=a,(f=ii.get(d))&&(o=x({},a),xc(o,f)),e=e.ownerDocument||e,f=e.createElement("script"),le(f),de(f,"link",o),e.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(o=i.instance,i.state.loading|=4,Tr(o,a.precedence,e));return i.instance}function Tr(e,i,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,d=f,y=0;y<o.length;y++){var v=o[y];if(v.dataset.precedence===i)d=v;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(e,i.firstChild))}function yc(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function xc(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var wr=null;function zp(e,i,a){if(wr===null){var o=new Map,f=wr=new Map;f.set(a,o)}else f=wr,o=f.get(a),o||(o=new Map,f.set(a,o));if(o.has(e))return o;for(o.set(e,null),a=a.getElementsByTagName(e),f=0;f<a.length;f++){var d=a[f];if(!(d[ta]||d[ue]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(i)||"";y=e+y;var v=o.get(y);v?v.push(d):o.set(y,[d])}}return o}function Dp(e,i,a){e=e.ownerDocument||e,e.head.insertBefore(a,i==="title"?e.querySelector("head > title"):null)}function l1(e,i,a){if(a===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 Bp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function r1(e,i,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=Ns(o.href),d=i.querySelector(Ua(f));if(d){i=d._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=Ar.bind(e),i.then(e,e)),a.state.loading|=4,a.instance=d,le(d);return}d=i.ownerDocument||i,o=Ep(o),(f=ii.get(f))&&yc(o,f),d=d.createElement("link"),le(d);var y=d;y._p=new Promise(function(v,M){y.onload=v,y.onerror=M}),de(d,"link",o),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Ar.bind(e),i.addEventListener("load",a),i.addEventListener("error",a))}}var _c=0;function o1(e,i){return e.stylesheets&&e.count===0&&Mr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var o=setTimeout(function(){if(e.stylesheets&&Mr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+i);0<e.imgBytes&&_c===0&&(_c=62500*q_());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>_c?50:800)+i);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Ar(){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(u1,e),Cr=null,Ar.call(e))}function u1(e,i){if(!(i.state.loading&4)){var a=Cr.get(e);if(a)var o=a.get(null);else{a=new Map,Cr.set(e,a);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")&&(a.set(y.dataset.precedence,y),o=y)}o&&a.set(null,o)}f=i.instance,y=f.getAttribute("data-precedence"),d=a.get(y)||o,d===o&&a.set(null,f),a.set(y,f),this.count++,o=Ar.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),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 c1(e,i,a,o,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=mo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mo(0),this.hiddenUpdates=mo(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Op(e,i,a,o,f,d,y,v,M,U,q,F){return e=new c1(e,i,a,y,M,U,q,F,v),i=1,d===!0&&(i|=24),d=Ue(3,null,null,i),e.current=d,d.stateNode=e,i=$o(),i.refCount++,e.pooledCache=i,i.refCount++,d.memoizedState={element:o,isDehydrated:a,cache:i},iu(d),e}function Np(e){return e?(e=fs,e):fs}function kp(e,i,a,o,f,d){f=Np(f),o.context===null?o.context=f:o.pendingContext=f,o=sn(i),o.payload={element:a},d=d===void 0?null:d,d!==null&&(o.callback=d),a=an(e,o,i),a!==null&&(Ee(a,e,i),ya(a,e,i))}function Gp(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<i?a:i}}function bc(e,i){Gp(e,i),(e=e.alternate)&&Gp(e,i)}function Up(e){if(e.tag===13||e.tag===31){var i=zn(e,67108864);i!==null&&Ee(i,e,67108864),bc(e,67108864)}}function Hp(e){if(e.tag===13||e.tag===31){var i=qe();i=po(i);var a=zn(e,i);a!==null&&Ee(a,e,i),bc(e,i)}}var Er=!0;function h1(e,i,a,o){var f=D.T;D.T=null;var d=L.p;try{L.p=2,vc(e,i,a,o)}finally{L.p=d,D.T=f}}function f1(e,i,a,o){var f=D.T;D.T=null;var d=L.p;try{L.p=8,vc(e,i,a,o)}finally{L.p=d,D.T=f}}function vc(e,i,a,o){if(Er){var f=Sc(o);if(f===null)rc(e,i,o,Rr,a),jp(e,o);else if(m1(f,e,i,a,o))o.stopPropagation();else if(jp(e,o),i&4&&-1<d1.indexOf(e)){for(;f!==null;){var d=es(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=An(d.pendingLanes);if(y!==0){var v=d;for(v.pendingLanes|=2,v.entangledLanes|=2;y;){var M=1<<31-ke(y);v.entanglements[1]|=M,y&=~M}_i(d),(Rt&6)===0&&(hr=Oe()+500,Oa(0))}}break;case 31:case 13:v=zn(d,2),v!==null&&Ee(v,d,2),dr(),bc(d,2)}if(d=Sc(o),d===null&&rc(e,i,o,Rr,a),d===f)break;f=d}f!==null&&o.stopPropagation()}else rc(e,i,o,null,a)}}function Sc(e){return e=wo(e),Tc(e)}var Rr=null;function Tc(e){if(Rr=null,e=ts(e),e!==null){var i=u(e);if(i===null)e=null;else{var a=i.tag;if(a===13){if(e=c(i),e!==null)return e;e=null}else if(a===31){if(e=h(i),e!==null)return e;e=null}else if(a===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 Lp(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($0()){case Fh:return 2;case Wh:return 8;case xl:case J0:return 32;case Qh:return 268435456;default:return 32}default:return 32}}var wc=!1,gn=null,yn=null,xn=null,ja=new Map,Ya=new Map,_n=[],d1="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 jp(e,i){switch(e){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":yn=null;break;case"mouseover":case"mouseout":xn=null;break;case"pointerover":case"pointerout":ja.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ya.delete(i.pointerId)}}function qa(e,i,a,o,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:i,domEventName:a,eventSystemFlags:o,nativeEvent:d,targetContainers:[f]},i!==null&&(i=es(i),i!==null&&Up(i)),e):(e.eventSystemFlags|=o,i=e.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),e)}function m1(e,i,a,o,f){switch(i){case"focusin":return gn=qa(gn,e,i,a,o,f),!0;case"dragenter":return yn=qa(yn,e,i,a,o,f),!0;case"mouseover":return xn=qa(xn,e,i,a,o,f),!0;case"pointerover":var d=f.pointerId;return ja.set(d,qa(ja.get(d)||null,e,i,a,o,f)),!0;case"gotpointercapture":return d=f.pointerId,Ya.set(d,qa(Ya.get(d)||null,e,i,a,o,f)),!0}return!1}function Yp(e){var i=ts(e.target);if(i!==null){var a=u(i);if(a!==null){if(i=a.tag,i===13){if(i=c(a),i!==null){e.blockedOn=i,tf(e.priority,function(){Hp(a)});return}}else if(i===31){if(i=h(a),i!==null){e.blockedOn=i,tf(e.priority,function(){Hp(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.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 a=Sc(e.nativeEvent);if(a===null){a=e.nativeEvent;var o=new a.constructor(a.type,a);To=o,a.target.dispatchEvent(o),To=null}else return i=es(a),i!==null&&Up(i),e.blockedOn=a,!1;i.shift()}return!0}function qp(e,i,a){zr(e)&&a.delete(i)}function p1(){wc=!1,gn!==null&&zr(gn)&&(gn=null),yn!==null&&zr(yn)&&(yn=null),xn!==null&&zr(xn)&&(xn=null),ja.forEach(qp),Ya.forEach(qp)}function Dr(e,i){e.blockedOn===i&&(e.blockedOn=null,wc||(wc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,p1)))}var Br=null;function Xp(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 a=e[i],o=e[i+1],f=e[i+2];if(typeof o!="function"){if(Tc(o||a)===null)continue;break}var d=es(a);d!==null&&(e.splice(i,3),i-=3,Su(d,{pending:!0,data:f,method:a.method,action:o},o,f))}}))}function Gs(e){function i(M){return Dr(M,e)}gn!==null&&Dr(gn,e),yn!==null&&Dr(yn,e),xn!==null&&Dr(xn,e),ja.forEach(i),Ya.forEach(i);for(var a=0;a<_n.length;a++){var o=_n[a];o.blockedOn===e&&(o.blockedOn=null)}for(;0<_n.length&&(a=_n[0],a.blockedOn===null);)Yp(a),a.blockedOn===null&&_n.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var f=a[o],d=a[o+1],y=f[Se]||null;if(typeof d=="function")y||Xp(a);else if(y){var v=null;if(d&&d.hasAttribute("formAction")){if(f=d,y=d[Se]||null)v=y.formAction;else if(Tc(f)!==null)continue}else v=y.action;typeof v=="function"?a[o+1]=v:(a.splice(o,3),o-=3),Xp(a)}}}function Vp(){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),o||setTimeout(a,20)}function a(){if(!o&&!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 o=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Ac(e){this._internalRoot=e}Or.prototype.render=Ac.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(s(409));var a=i.current,o=qe();kp(a,o,e,i,null,null)},Or.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;kp(e.current,2,null,e,null,null),dr(),i[Jn]=null}};function Or(e){this._internalRoot=e}Or.prototype.unstable_scheduleHydration=function(e){if(e){var i=Jh();e={blockedOn:null,target:e,priority:i};for(var a=0;a<_n.length&&i!==0&&i<_n[a].priority;a++);_n.splice(a,0,e),a===0&&Yp(e)}};var Pp=t.version;if(Pp!=="19.2.4")throw Error(s(527,Pp,"19.2.4"));L.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=p(i),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var g1={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(g1),Ne=Nr}catch{}}return Va.createRoot=function(e,i){if(!r(e))throw Error(s(299));var a=!1,o="",f=$d,d=Jd,y=tm;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(d=i.onCaughtError),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),i=Op(e,1,!1,null,null,a,o,null,f,d,y,Vp),e[Jn]=i.current,lc(e),new Ac(i)},Va.hydrateRoot=function(e,i,a){if(!r(e))throw Error(s(299));var o=!1,f="",d=$d,y=Jd,v=tm,M=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.formState!==void 0&&(M=a.formState)),i=Op(e,1,!0,i,a??null,o,f,M,d,y,v,Vp),i.context=Np(null),a=i.current,o=qe(),o=po(o),f=sn(o),f.callback=null,an(a,f,o),a=o,i.current.lanes=a,Js(i,a),_i(i),e[Jn]=i.current,lc(e),new Or(i)},Va.version="19.2.4",Va}var eg;function E1(){if(eg)return Ec.exports;eg=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(),Ec.exports=M1(),Ec.exports}var R1=E1();const ig=l=>{let t;const n=new Set,s=(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,_))}},r=()=>t,h={setState:s,getState:r,getInitialState:()=>m,subscribe:p=>(n.add(p),()=>n.delete(p))},m=t=l(s,r,h);return h},z1=(l=>l?ig(l):ig),D1=l=>l;function B1(l,t=D1){const n=kr.useSyncExternalStore(l.subscribe,kr.useCallback(()=>t(l.getState()),[l,t]),kr.useCallback(()=>t(l.getInitialState()),[l,t]));return kr.useDebugValue(n),n}const ng=l=>{const t=z1(l),n=s=>B1(t,s);return Object.assign(n,t),n},O1=(l=>l?ng(l):ng);let N1=0;const dt=O1(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(s=>({agents:s.agents.map(r=>r.id===t?{...r,...n}:r)})),updateTask:(t,n)=>l(s=>({tasks:s.tasks.map(r=>r.id===t?{...r,...n}:r)})),addPR:t=>l(n=>({prs:[...n.prs,t]})),updatePR:(t,n)=>l(s=>({prs:s.prs.map(r=>r.id===t?{...r,...n}:r)})),pushWow:t=>l(n=>({wowEvents:[...n.wowEvents,t]})),popWow:()=>{const n=dt.getState().wowEvents;if(n.length===0)return;const s=n[0];return dt.setState({wowEvents:n.slice(1)}),s},pushActivity:t=>l(n=>({activity:[...n.activity.slice(-299),{...t,id:`act-${++N1}`,time:new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}]}))})),di=[{id:"ceo-office",label:"CEO Office",col:0,row:0,w:3,h:3,color:"#ffd700",floorColor:"#d4c4a0",wallColor:"#a0a0a8",icon:"👑"},{id:"cto-office",label:"CTO Office",col:3,row:0,w:3,h:3,color:"#00bfff",floorColor:"#c0c4c8",wallColor:"#909098",icon:"🔬"},{id:"arch-lab",label:"Arch Lab",col:6,row:0,w:4,h:3,color:"#b57edc",floorColor:"#ccc0d4",wallColor:"#988ca0",icon:"🏛️"},{id:"meeting-room",label:"Meeting Room",col:10,row:0,w:4,h:3,color:"#4169e1",floorColor:"#c4c8d4",wallColor:"#8890a0",icon:"🤝"},{id:"dev-bullpen",label:"Dev Bullpen",col:0,row:3,w:6,h:4,color:"#50c878",floorColor:"#c8d4c0",wallColor:"#909890",icon:"⚡"},{id:"qa-lab",label:"QA Lab",col:6,row:3,w:4,h:4,color:"#ff8c00",floorColor:"#d4c8b8",wallColor:"#a09888",icon:"🔍"},{id:"design-studio",label:"Design Studio",col:10,row:3,w:4,h:4,color:"#8a2be2",floorColor:"#d0c0d8",wallColor:"#9888a0",icon:"🎨"},{id:"data-lab",label:"Data Lab",col:0,row:7,w:3,h:3,color:"#708090",floorColor:"#c0c4c8",wallColor:"#888c90",icon:"📊"},{id:"crisis-room",label:"Crisis Room",col:3,row:7,w:3,h:3,color:"#dc143c",floorColor:"#d0c0c0",wallColor:"#a08888",icon:"🚨"},{id:"lounge",label:"Lounge",col:6,row:7,w:4,h:3,color:"#ff6347",floorColor:"#d8ccbc",wallColor:"#a09488",icon:"☕"}],Bc={col:0,row:0,w:14,h:10},k1=[{room:"ceo-office",seat:0,col:1.5,row:1.5},{room:"cto-office",seat:0,col:4.5,row:1.5},{room:"arch-lab",seat:0,col:8,row:1.5},{room:"meeting-room",seat:0,col:11,row:1},{room:"meeting-room",seat:1,col:13,row:1},{room:"meeting-room",seat:2,col:11,row:2},{room:"meeting-room",seat:3,col:13,row:2},{room:"meeting-room",seat:4,col:10.5,row:1.5},{room:"meeting-room",seat:5,col:13.5,row:1.5},{room:"meeting-room",seat:6,col:11.5,row:.5},{room:"meeting-room",seat:7,col:12.5,row:.5},{room:"meeting-room",seat:8,col:11.5,row:2.5},{room:"meeting-room",seat:9,col:12.5,row:2.5},{room:"meeting-room",seat:10,col:12,row:1.5},{room:"dev-bullpen",seat:0,col:1.5,row:4.5},{room:"dev-bullpen",seat:1,col:4,row:5},{room:"qa-lab",seat:0,col:7.5,row:4.5},{room:"qa-lab",seat:1,col:9,row:5},{room:"design-studio",seat:0,col:11,row:4.5},{room:"design-studio",seat:1,col:13,row:5},{room:"data-lab",seat:0,col:1.5,row:8},{room:"crisis-room",seat:0,col:4.5,row:8},{room:"lounge",seat:0,col:8,row:8.5}],Kr={sage:{room:"ceo-office",seat:0},nova:{room:"cto-office",seat:0},aria:{room:"arch-lab",seat:0},dex:{room:"dev-bullpen",seat:0},flux:{room:"dev-bullpen",seat:1},quinn:{room:"qa-lab",seat:0},gage:{room:"qa-lab",seat:1},uma:{room:"design-studio",seat:0},morgan:{room:"design-studio",seat:1},river:{room:"lounge",seat:0},atlas:{room:"data-lab",seat:0}},sg={sage:0,nova:1,aria:2,dex:3,flux:4,quinn:5,gage:6,morgan:7,uma:8,river:9,atlas:10},G1=[{room:"ceo-office",type:"rug",col:1.5,row:1.5},{room:"ceo-office",type:"desk",col:1,row:1},{room:"ceo-office",type:"monitor",col:1.3,row:.8},{room:"ceo-office",type:"chair",col:1.5,row:1.5},{room:"ceo-office",type:"plant",col:.5,row:.3},{room:"ceo-office",type:"shelf",col:2.2,row:.3},{room:"cto-office",type:"desk",col:4,row:1},{room:"cto-office",type:"monitor",col:4.3,row:.8},{room:"cto-office",type:"monitor",col:4.8,row:.8},{room:"cto-office",type:"chair",col:4.5,row:1.5},{room:"cto-office",type:"server",col:5.3,row:.3},{room:"arch-lab",type:"desk",col:7.5,row:1},{room:"arch-lab",type:"monitor",col:7.8,row:.8},{room:"arch-lab",type:"chair",col:8,row:1.5},{room:"arch-lab",type:"whiteboard",col:9,row:.3},{room:"meeting-room",type:"rug",col:12,row:1.5},{room:"meeting-room",type:"table",col:12,row:1.2},{room:"meeting-room",type:"whiteboard",col:10.5,row:.3},{room:"meeting-room",type:"plant",col:13.2,row:.3},{room:"dev-bullpen",type:"desk",col:1,row:4},{room:"dev-bullpen",type:"monitor",col:1.3,row:3.8},{room:"dev-bullpen",type:"chair",col:1.5,row:4.5},{room:"dev-bullpen",type:"desk",col:3.5,row:4.5},{room:"dev-bullpen",type:"monitor",col:3.8,row:4.3},{room:"dev-bullpen",type:"chair",col:4,row:5},{room:"dev-bullpen",type:"plant",col:5,row:3.3},{room:"qa-lab",type:"desk",col:7,row:4},{room:"qa-lab",type:"monitor",col:7.3,row:3.8},{room:"qa-lab",type:"desk",col:8.5,row:4.5},{room:"qa-lab",type:"monitor",col:8.8,row:4.3},{room:"qa-lab",type:"server",col:9.3,row:3.3},{room:"design-studio",type:"desk",col:10.5,row:4},{room:"design-studio",type:"monitor",col:10.8,row:3.8},{room:"design-studio",type:"desk",col:12.5,row:4.5},{room:"design-studio",type:"whiteboard",col:13,row:3.3},{room:"data-lab",type:"desk",col:1,row:7.5},{room:"data-lab",type:"monitor",col:1.3,row:7.3},{room:"data-lab",type:"server",col:2,row:7.3},{room:"data-lab",type:"server",col:2.5,row:7.3},{room:"crisis-room",type:"table",col:4.5,row:8},{room:"crisis-room",type:"monitor",col:3.5,row:7.3},{room:"crisis-room",type:"monitor",col:4.5,row:7.3},{room:"crisis-room",type:"monitor",col:5.5,row:7.3},{room:"lounge",type:"rug",col:8,row:8.5},{room:"lounge",type:"couch",col:7,row:8},{room:"lounge",type:"couch",col:9,row:8},{room:"lounge",type:"coffee",col:8,row:8.5},{room:"lounge",type:"plant",col:9.5,row:7.3},{room:"lounge",type:"plant",col:6.3,row:7.3}];function vy(l,t){return k1.find(n=>n.room===l&&n.seat===t)}const Oc={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},U1={sage:"Sage",nova:"Nova",aria:"Aria",dex:"Dex",flux:"Flux",quinn:"Quinn",gage:"Gage",morgan:"Morgan",uma:"Uma",river:"River",atlas:"Atlas"},H1={Edit:"editing",Write:"creating",Read:"reading",Bash:"running",Grep:"searching for",Glob:"looking for",Agent:"delegating to sub-agent"},L1={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 j1(){const l=Ve.useRef(null),t=Ve.useRef({}),{setAgents:n,setTasks:s,setPRs:r,addMessage:u,updateAgent:c,updateTask:h,addPR:m,updatePR:p,pushActivity:g}=dt.getState();Ve.useEffect(()=>{function x(){const S=window.location.protocol==="https:"?"wss:":"ws:",w=new WebSocket(`${S}//${window.location.host}`);l.current=w,w.onopen=()=>{dt.setState({connected:!0}),g({agentId:null,icon:"🟢",text:"Connected to Sage Team HQ",type:"system"})},w.onclose=()=>{dt.setState({connected:!1}),setTimeout(x,2e3)},w.onerror=()=>{w.close()},w.onmessage=C=>{try{const E=JSON.parse(C.data);A(E)}catch{}}}function _(S){return U1[S]||S}function b(S){return`${Oc[S]||"🤖"} ${_(S)}`}function T(S,w,C){const E=_(S),O=H1[w]||`using ${w}`;if(w==="Edit"||w==="Write"||w==="Read")return C?`${E} ${O} ${C}`:`${E} ${O} a file`;if(w==="Bash"){if(!C)return`${E} running a command`;const P=C.length>60?C.slice(0,57)+"...":C;return`${E} $ ${P}`}return w==="Grep"||w==="Glob"?C?`${E} ${O} "${C}"`:`${E} searching the codebase`:`${E} ${O}`}function A(S){var O,P;const w=S.type,C=S.agentId,E=S.data||{};switch(w){case"snapshot":S.agents&&n(S.agents),S.tasks&&s(S.tasks),S.prs&&r(S.prs),g({agentId:null,icon:"🏢",text:`Office online — ${((O=S.agents)==null?void 0:O.length)||0} agents, ${((P=S.tasks)==null?void 0:P.length)||0} tasks loaded`,type:"system"});break;case"agent:status":{const k=E.status||S.status;if(c(C,{status:k}),E.tool&&k!=="idle"){const N=T(C,E.tool,E.detail||"");t.current[C]!==N&&(t.current[C]=N,g({agentId:C,icon:Oc[C]||"🤖",text:N,type:"agent"}))}else if(k&&k!=="idle"&&!E.tool){const N=L1[k]||`is ${k}`,$=`${_(C)} ${N}`;t.current[C]!==$&&(t.current[C]=$,g({agentId:C,icon:Oc[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 k=E.taskId||S.taskId;h(k,{assigned_to:C,status:"in_progress"}),c(C,{current_task_id:k,status:"coding"});const N=Kr[C];N&&c(C,{position_room:N.room,position_seat:N.seat});const Q=dt.getState().tasks.find(I=>I.id===k),Z=(Q==null?void 0:Q.title)||"a new task";g({agentId:C,icon:"🎯",text:`${b(C)} picked up: ${Z}`,type:"task"});break}case"task:completed":{const k=E.taskId||S.taskId;h(k,{status:"done"});const $=dt.getState().tasks.find(tt=>tt.id===k),Q=($==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 "${Q}"${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":dt.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":dt.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":dt.setState(k=>({sprint:k.sprint?{...k.sprint,status:"completed"}:null})),dt.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":dt.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":dt.getState().pushWow({type:"meeting:end"}),g({agentId:null,icon:"👋",text:"Meeting ended — back to work!",type:"info"});break;case"crisis:start":dt.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":dt.getState().pushWow({type:"crisis:resolved"}),g({agentId:null,icon:"✅",text:"Crisis resolved — all clear",type:"success"});break;case"deploy:success":dt.getState().pushWow({type:"deploy:success"}),g({agentId:null,icon:"🚀",text:"Deployment successful!",type:"success"});break;case"pair:start":dt.getState().pushWow({type:"pair:start",agents:S.agents||E.agents||[]});break;case"pair:end":dt.getState().pushWow({type:"pair:end"});break}}return x(),()=>{var S;(S=l.current)==null||S.close()}},[])}const Y1="modulepreload",q1=function(l){return"/"+l},ag={},el=function(t,n,s){let r=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"));r=c(n.map(p=>{if(p=q1(p),p in ag)return;ag[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":Y1,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 r.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 oh=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},Gr=(l,t)=>oh(l).priority??t,Jt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...l){return l.map(oh).forEach(t=>{t.type.forEach(n=>{var s,r;return(r=(s=this._removeHandlers)[n])==null?void 0:r.call(s,t)})}),this},add(...l){return l.map(oh).forEach(t=>{t.type.forEach(n=>{var u,c;const s=this._addHandlers,r=this._queue;s[n]?(c=s[n])==null||c.call(s,t):(r[n]=r[n]||[],(u=r[n])==null||u.push(t))})}),this},handle(l,t,n){var c;const s=this._addHandlers,r=this._removeHandlers;if(s[l]||r[l])throw new Error(`Extension type ${l} already has a handler`);s[l]=t,r[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,s=>{t.findIndex(u=>u.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((u,c)=>Gr(c.value,n)-Gr(u.value,n)))},s=>{const r=t.findIndex(u=>u.name===s.name);r!==-1&&t.splice(r,1)})},handleByList(l,t,n=-1){return this.handle(l,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((r,u)=>Gr(u,n)-Gr(r,n)))},s=>{const r=t.indexOf(s.ref);r!==-1&&t.splice(r,1)})},mixin(l,...t){for(const n of t)Object.defineProperties(l.prototype,Object.getOwnPropertyDescriptors(n))}},X1={extension:{type:yt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await el(()=>import("./browserAll-BToSt8GL.js"),__vite__mapDeps([0,1,2]))}},V1={extension:{type:yt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await el(()=>import("./webworkerAll-DmVDEFdQ.js"),__vite__mapDeps([1,2]))}};class me{constructor(t,n,s){this._x=n||0,this._y=s||0,this._observer=t}clone(t){return new me(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 Nc={exports:{}},lg;function P1(){return lg||(lg=1,(function(l){var t=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function r(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 r(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 s:delete m._events[p]}function h(){this._events=new s,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 A=n?n+p:p;if(!this._events[A])return!1;var S=this._events[A],w=arguments.length,C,E;if(S.fn){switch(S.once&&this.removeListener(p,S.fn,void 0,!0),w){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(w-1);E<w;E++)C[E-1]=arguments[E];S.fn.apply(S.context,C)}else{var O=S.length,P;for(E=0;E<O;E++)switch(S[E].once&&this.removeListener(p,S[E].fn,void 0,!0),w){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(P=1,C=new Array(w-1);P<w;P++)C[P-1]=arguments[P];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 A=0,S=[],w=T.length;A<w;A++)(T[A].fn!==g||_&&!T[A].once||x&&T[A].context!==x)&&S.push(T[A]);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 s,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})(Nc)),Nc.exports}var F1=P1();const Si=Eh(F1),W1=Math.PI*2,Q1=180/Math.PI,Z1=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 kc.x=0,kc.y=0,kc}}const kc=new ge;class St{constructor(t=1,n=0,s=0,r=1,u=0,c=0){this.array=null,this.a=t,this.b=n,this.c=s,this.d=r,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,s,r,u,c){return this.a=t,this.b=n,this.c=s,this.d=r,this.tx=u,this.ty=c,this}toArray(t,n){this.array||(this.array=new Float32Array(9));const s=n||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,n){n=n||new ge;const s=t.x,r=t.y;return n.x=this.a*s+this.c*r+this.tx,n.y=this.b*s+this.d*r+this.ty,n}applyInverse(t,n){n=n||new ge;const s=this.a,r=this.b,u=this.c,c=this.d,h=this.tx,m=this.ty,p=1/(s*c+u*-r),g=t.x,x=t.y;return n.x=c*p*g+-u*p*x+(m*u-h*c)*p,n.y=s*p*x+-r*p*g+(-m*s+h*r)*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),s=Math.sin(t),r=this.a,u=this.c,c=this.tx;return this.a=r*n-this.b*s,this.b=r*s+this.b*n,this.c=u*n-this.d*s,this.d=u*s+this.d*n,this.tx=c*n-this.ty*s,this.ty=c*s+this.ty*n,this}append(t){const n=this.a,s=this.b,r=this.c,u=this.d;return this.a=t.a*n+t.b*r,this.b=t.a*s+t.b*u,this.c=t.c*n+t.d*r,this.d=t.c*s+t.d*u,this.tx=t.tx*n+t.ty*r+this.tx,this.ty=t.tx*s+t.ty*u+this.ty,this}appendFrom(t,n){const s=t.a,r=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=s*p+r*x,this.b=s*g+r*_,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,s,r,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-(s*this.a+r*this.c),this.ty=n-(s*this.b+r*this.d),this}prepend(t){const n=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,r=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*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,s=this.b,r=this.c,u=this.d,c=t.pivot,h=-Math.atan2(-r,u),m=Math.atan2(s,n),p=Math.abs(h+m);return p<1e-5||Math.abs(W1-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+s*s),t.scale.y=Math.sqrt(r*r+u*u),t.position.x=this.tx+(c.x*n+c.y*r),t.position.y=this.ty+(c.x*s+c.y*u),t}invert(){const t=this.a,n=this.b,s=this.c,r=this.d,u=this.tx,c=t*r-n*s;return this.a=r/c,this.b=-n/c,this.c=-s/c,this.d=t/c,this.tx=(s*this.ty-r*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 K1.identity()}static get shared(){return I1.identity()}}const I1=new St,K1=new St,Pn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Fn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Wn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Qn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],uh=[],Sy=[],Ur=Math.sign;function $1(){for(let l=0;l<16;l++){const t=[];uh.push(t);for(let n=0;n<16;n++){const s=Ur(Pn[l]*Pn[n]+Wn[l]*Fn[n]),r=Ur(Fn[l]*Pn[n]+Qn[l]*Fn[n]),u=Ur(Pn[l]*Wn[n]+Wn[l]*Qn[n]),c=Ur(Fn[l]*Wn[n]+Qn[l]*Qn[n]);for(let h=0;h<16;h++)if(Pn[h]===s&&Fn[h]===r&&Wn[h]===u&&Qn[h]===c){t.push(h);break}}}for(let l=0;l<16;l++){const t=new St;t.set(Pn[l],Fn[l],Wn[l],Qn[l],0,0),Sy.push(t)}}$1();const Ht={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=>Pn[l],uY:l=>Fn[l],vX:l=>Wn[l],vY:l=>Qn[l],inv:l=>l&8?l&15:-l&7,add:(l,t)=>uh[l][t],sub:(l,t)=>uh[l][Ht.inv(t)],rotate180:l=>l^4,isVertical:l=>(l&3)===2,byDirection:(l,t)=>Math.abs(l)*2<=Math.abs(t)?t>=0?Ht.S:Ht.N:Math.abs(t)*2<=Math.abs(l)?l>0?Ht.E:Ht.W:t>0?l>0?Ht.SE:Ht.SW:l>0?Ht.NE:Ht.NW,matrixAppendRotationInv:(l,t,n=0,s=0,r=0,u=0)=>{const c=Sy[Ht.inv(t)],h=c.a,m=c.b,p=c.c,g=c.d,x=n-Math.min(0,h*r,p*u,h*r+p*u),_=s-Math.min(0,m*r,g*u,m*r+g*u),b=l.a,T=l.b,A=l.c,S=l.d;l.a=h*b+m*A,l.b=h*T+m*S,l.c=p*b+g*A,l.d=p*T+g*S,l.tx=x*b+_*A+l.tx,l.ty=x*T+_*S+l.ty},transformRectCoords:(l,t,n,s)=>{const{x:r,y:u,width:c,height:h}=l,{x:m,y:p,width:g,height:x}=t;return n===Ht.E?(s.set(r+m,u+p,c,h),s):n===Ht.S?s.set(g-u-h+m,r+p,h,c):n===Ht.W?s.set(g-r-c+m,x-u-h+p,c,h):n===Ht.N?s.set(u+m,x-r-c+p,h,c):s.set(r+m,u+p,c,h)}},Hr=[new ge,new ge,new ge,new ge];class $t{constructor(t=0,n=0,s=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(n),this.width=Number(s),this.height=Number(r)}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 $t(0,0,0,0)}clone(){return new $t(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,s,r=.5){const{width:u,height:c}=this;if(u<=0||c<=0)return!1;const h=this.x,m=this.y,p=s*(1-r),g=s-p,x=h-p,_=h+u+p,b=m-p,T=m+c+p,A=h+g,S=h+u-g,w=m+g,C=m+c-g;return t>=x&&t<=_&&n>=b&&n<=T&&!(t>A&&t<S&&n>w&&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 s=this.left,r=this.right,u=this.top,c=this.bottom;if(r<=s||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)<=s||Math.min(h.x,m.x,p.x,g.x)>=r||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=_*s+b*u,A=_*r+b*u,S=_*s+b*c,w=_*r+b*c;if(Math.max(T,A,S,w)<=_*h.x+b*h.y||Math.min(T,A,S,w)>=_*g.x+b*g.y)return!1;const C=x*(h.y-p.y),E=x*(p.x-h.x),O=C*s+E*u,P=C*r+E*u,k=C*s+E*c,N=C*r+E*c;return!(Math.max(O,P,k,N)<=C*h.x+E*h.y||Math.min(O,P,k,N)>=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),s=Math.min(this.x+this.width,t.x+t.width),r=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(s-n,0),this.y=r,this.height=Math.max(u-r,0),this}ceil(t=1,n=.001){const s=Math.ceil((this.x+this.width-n)*t)/t,r=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=s-this.x,this.height=r-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),s=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),u=Math.max(this.y+this.height,t.y+t.height);return this.x=n,this.width=s-n,this.y=r,this.height=u-r,this}getBounds(t){return t||(t=new $t),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const n=t.x,s=t.y,r=t.x+t.width,u=t.y+t.height;return n>=this.x&&n<this.x+this.width&&s>=this.y&&s<this.y+this.height&&r>=this.x&&r<this.x+this.width&&u>=this.y&&u<this.y+this.height}set(t,n,s,r){return this.x=t,this.y=n,this.width=s,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Gc={default:-1};function Qt(l="default"){return Gc[l]===void 0&&(Gc[l]=-1),++Gc[l]}const rg=new Set,Wt="8.0.0",J1="8.3.4",Xs={quiet:!1,noColor:!1},At=((l,t,n=3)=>{if(Xs.quiet||rg.has(t))return;let s=new Error().stack;const r=`${t}
|
|
51
|
+
Deprecated since v${l}`,u=typeof console.groupCollapsed=="function"&&!Xs.noColor;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",r):(s=s.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",r),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(s))),rg.add(t)});Object.defineProperties(At,{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 Ty=()=>{};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 og(l){return!(l&l-1)&&!!l}function wy(l){const t={};for(const n in l)l[n]!==void 0&&(t[n]=l[n]);return t}const ug=Object.create(null);function tb(l){const t=ug[l];return t===void 0&&(ug[l]=Qt("resource")),t}const Ay=class Cy extends Si{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...Cy.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){At(Wt,"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=tb(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Ay.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Ws=Ay;const My=class Ey extends Si{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={...Ey.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 Ws(wy(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var n,s;this.style!==t&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=t,(s=this._style)==null||s.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 s in this._gpuData)(n=(t=this._gpuData[s])==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,s){s||(s=this._resolution),t||(t=this.width),n||(n=this.height);const r=Math.round(t*s),u=Math.round(n*s);return this.width=r/s,this.height=u/s,this._resolution=s,this.pixelWidth===r&&this.pixelHeight===u?!1:(this._refreshPOT(),this.pixelWidth=r,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=og(this.pixelWidth)&&og(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};My.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=My;class zh extends li{constructor(t){const n=t.resource||new Float32Array(t.width*t.height*4);let s=t.format;s||(n instanceof Float32Array?s="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?s="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?s="rgba16uint":(n instanceof Int8Array,s="bgra8unorm")),super({...t,resource:n,format:s}),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}}zh.extension=yt.TextureSource;const cg=new St;class eb{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 s=this.mapCoord;for(let r=0;r<t.length;r+=2){const u=t[r],c=t[r+1];n[r]=u*s.a+c*s.c+s.tx,n[r+1]=u*s.b+c*s.d+s.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 s=t.orig,r=t.trim;r&&(cg.set(s.width/r.width,0,0,s.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(cg));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 Si{constructor({source:t,label:n,frame:s,orig:r,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 $t,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(t==null?void 0:t.source)??new li,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:g,height:x}=this._source;this.frame.width=g,this.frame.height=x}this.orig=r||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 eb(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:n}=this,{width:s,height:r}=this._source,u=n.x/s,c=n.y/r,h=n.width/s,m=n.height/r;let p=this.rotate;if(p){const g=h/2,x=m/2,_=u+g,b=c+x;p=Ht.add(p,Ht.NW),t.x0=_+g*Ht.uX(p),t.y0=b+x*Ht.uY(p),p=Ht.add(p,2),t.x1=_+g*Ht.uX(p),t.y1=b+x*Ht.uY(p),p=Ht.add(p,2),t.x2=_+g*Ht.uX(p),t.y2=b+x*Ht.uY(p),p=Ht.add(p,2),t.x3=_+g*Ht.uX(p),t.y3=b+x*Ht.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 At(Wt,"Texture.baseTexture is now Texture.source"),this._source}}Gt.EMPTY=new Gt({label:"EMPTY",source:new li({label:"EMPTY"})});Gt.EMPTY.destroy=Ty;Gt.WHITE=new Gt({source:new zh({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Gt.WHITE.destroy=Ty;function Ry(l,t,n){const{width:s,height:r}=n.orig,u=n.trim;if(u){const c=u.width,h=u.height;l.minX=u.x-t._x*s,l.maxX=l.minX+c,l.minY=u.y-t._y*r,l.maxY=l.minY+h}else l.minX=-t._x*s,l.maxX=l.minX+s,l.minY=-t._y*r,l.maxY=l.minY+r}const hg=new St;class ai{constructor(t=1/0,n=1/0,s=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=hg,this.minX=t,this.minY=n,this.maxX=s,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new $t);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=hg,this}set(t,n,s,r){this.minX=t,this.minY=n,this.maxX=s,this.maxY=r}addFrame(t,n,s,r,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,A=this.maxY,S=c*t+m*n+g,w=h*t+p*n+x;S<_&&(_=S),w<b&&(b=w),S>T&&(T=S),w>A&&(A=w),S=c*s+m*n+g,w=h*s+p*n+x,S<_&&(_=S),w<b&&(b=w),S>T&&(T=S),w>A&&(A=w),S=c*t+m*r+g,w=h*t+p*r+x,S<_&&(_=S),w<b&&(b=w),S>T&&(T=S),w>A&&(A=w),S=c*s+m*r+g,w=h*s+p*r+x,S<_&&(_=S),w<b&&(b=w),S>T&&(T=S),w>A&&(A=w),this.minX=_,this.minY=b,this.maxX=T,this.maxY=A}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,s=this.minY,r=this.maxX,u=this.maxY,{a:c,b:h,c:m,d:p,tx:g,ty:x}=t;let _=c*n+m*s+g,b=h*n+p*s+x;this.minX=_,this.minY=b,this.maxX=_,this.maxY=b,_=c*r+m*s+g,b=h*r+p*s+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*r+m*u+g,b=h*r+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,s,r){return this.minX<t&&(this.minX=t),this.maxX>n&&(this.maxX=n),this.minY<s&&(this.minY=s),this.maxY>r&&(this.maxY=r),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 ai(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,s,r){let u=this.minX,c=this.minY,h=this.maxX,m=this.maxY;r||(r=this.matrix);const p=r.a,g=r.b,x=r.c,_=r.d,b=r.tx,T=r.ty;for(let A=n;A<s;A+=2){const S=t[A],w=t[A+1],C=p*S+x*w+b,E=g*S+_*w+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 ib={grad:.9,turn:360,rad:360/(2*Math.PI)},Yi=function(l){return typeof l=="string"?l.length>0:typeof l=="number"},oe=function(l,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*l)/n+0},ni=function(l,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),l>n?n:l>t?l:t},zy=function(l){return(l=isFinite(l)?l%360:0)>0?l:l+360},fg=function(l){return{r:ni(l.r,0,255),g:ni(l.g,0,255),b:ni(l.b,0,255),a:ni(l.a)}},Uc=function(l){return{r:oe(l.r),g:oe(l.g),b:oe(l.b),a:oe(l.a,3)}},nb=/^#([0-9a-f]{3,8})$/i,Lr=function(l){var t=l.toString(16);return t.length<2?"0"+t:t},Dy=function(l){var t=l.r,n=l.g,s=l.b,r=l.a,u=Math.max(t,n,s),c=u-Math.min(t,n,s),h=c?u===t?(n-s)/c:u===n?2+(s-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:r}},By=function(l){var t=l.h,n=l.s,s=l.v,r=l.a;t=t/360*6,n/=100,s/=100;var u=Math.floor(t),c=s*(1-n),h=s*(1-(t-u)*n),m=s*(1-(1-t+u)*n),p=u%6;return{r:255*[s,h,c,c,m,s][p],g:255*[m,s,s,h,c,c][p],b:255*[c,c,m,s,s,h][p],a:r}},dg=function(l){return{h:zy(l.h),s:ni(l.s,0,100),l:ni(l.l,0,100),a:ni(l.a)}},mg=function(l){return{h:oe(l.h),s:oe(l.s),l:oe(l.l),a:oe(l.a,3)}},pg=function(l){return By((n=(t=l).s,{h:t.h,s:(n*=((s=t.l)<50?s:100-s)/100)>0?2*n/(s+n)*100:0,v:s+n,a:t.a}));var t,n,s},il=function(l){return{h:(t=Dy(l)).h,s:(r=(200-(n=t.s))*(s=t.v)/100)>0&&r<200?n*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,s,r},sb=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ab=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lb=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rb=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ch={string:[[function(l){var t=nb.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?oe(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?oe(parseInt(l.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(l){var t=lb.exec(l)||rb.exec(l);return t?t[2]!==t[4]||t[4]!==t[6]?null:fg({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=sb.exec(l)||ab.exec(l);if(!t)return null;var n,s,r=dg({h:(n=t[1],s=t[2],s===void 0&&(s="deg"),Number(n)*(ib[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return pg(r)},"hsl"]],object:[[function(l){var t=l.r,n=l.g,s=l.b,r=l.a,u=r===void 0?1:r;return Yi(t)&&Yi(n)&&Yi(s)?fg({r:Number(t),g:Number(n),b:Number(s),a:Number(u)}):null},"rgb"],[function(l){var t=l.h,n=l.s,s=l.l,r=l.a,u=r===void 0?1:r;if(!Yi(t)||!Yi(n)||!Yi(s))return null;var c=dg({h:Number(t),s:Number(n),l:Number(s),a:Number(u)});return pg(c)},"hsl"],[function(l){var t=l.h,n=l.s,s=l.v,r=l.a,u=r===void 0?1:r;if(!Yi(t)||!Yi(n)||!Yi(s))return null;var c=(function(h){return{h:zy(h.h),s:ni(h.s,0,100),v:ni(h.v,0,100),a:ni(h.a)}})({h:Number(t),s:Number(n),v:Number(s),a:Number(u)});return By(c)},"hsv"]]},gg=function(l,t){for(var n=0;n<t.length;n++){var s=t[n][0](l);if(s)return[s,t[n][1]]}return[null,void 0]},ob=function(l){return typeof l=="string"?gg(l.trim(),ch.string):typeof l=="object"&&l!==null?gg(l,ch.object):[null,void 0]},Hc=function(l,t){var n=il(l);return{h:n.h,s:ni(n.s+100*t,0,100),l:n.l,a:n.a}},Lc=function(l){return(299*l.r+587*l.g+114*l.b)/1e3/255},yg=function(l,t){var n=il(l);return{h:n.h,s:n.s,l:ni(n.l+100*t,0,100),a:n.a}},hh=(function(){function l(t){this.parsed=ob(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 oe(Lc(this.rgba),2)},l.prototype.isDark=function(){return Lc(this.rgba)<.5},l.prototype.isLight=function(){return Lc(this.rgba)>=.5},l.prototype.toHex=function(){return t=Uc(this.rgba),n=t.r,s=t.g,r=t.b,c=(u=t.a)<1?Lr(oe(255*u)):"","#"+Lr(n)+Lr(s)+Lr(r)+c;var t,n,s,r,u,c},l.prototype.toRgb=function(){return Uc(this.rgba)},l.prototype.toRgbString=function(){return t=Uc(this.rgba),n=t.r,s=t.g,r=t.b,(u=t.a)<1?"rgba("+n+", "+s+", "+r+", "+u+")":"rgb("+n+", "+s+", "+r+")";var t,n,s,r,u},l.prototype.toHsl=function(){return mg(il(this.rgba))},l.prototype.toHslString=function(){return t=mg(il(this.rgba)),n=t.h,s=t.s,r=t.l,(u=t.a)<1?"hsla("+n+", "+s+"%, "+r+"%, "+u+")":"hsl("+n+", "+s+"%, "+r+"%)";var t,n,s,r,u},l.prototype.toHsv=function(){return t=Dy(this.rgba),{h:oe(t.h),s:oe(t.s),v:oe(t.v),a:oe(t.a,3)};var t},l.prototype.invert=function(){return bi({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),bi(Hc(this.rgba,t))},l.prototype.desaturate=function(t){return t===void 0&&(t=.1),bi(Hc(this.rgba,-t))},l.prototype.grayscale=function(){return bi(Hc(this.rgba,-1))},l.prototype.lighten=function(t){return t===void 0&&(t=.1),bi(yg(this.rgba,t))},l.prototype.darken=function(t){return t===void 0&&(t=.1),bi(yg(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"?bi({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):oe(this.rgba.a,3);var n},l.prototype.hue=function(t){var n=il(this.rgba);return typeof t=="number"?bi({h:t,s:n.s,l:n.l,a:n.a}):oe(n.h)},l.prototype.isEqual=function(t){return this.toHex()===bi(t).toHex()},l})(),bi=function(l){return l instanceof hh?l:new hh(l)},xg=[],ub=function(l){l.forEach(function(t){xg.indexOf(t)<0&&(t(hh,ch),xg.push(t))})};function cb(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"},s={};for(var r in n)s[n[r]]=r;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=s[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 A=(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));A<x&&(x=A,_=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"])}ub([cb]);const Qs=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 s=typeof t;if(s!==typeof n)return!1;if(s==="number"||s==="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,s,r]=this._components;return{r:t,g:n,b:s,a:r}}toRgb(){const[t,n,s]=this._components;return{r:t,g:n,b:s}}toRgbaString(){const[t,n,s]=this.toUint8RgbArray();return`rgba(${t},${n},${s},${this.alpha})`}toUint8RgbArray(t){const[n,s,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(n*255),t[1]=Math.round(s*255),t[2]=Math.round(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[n,s,r,u]=this._components;return t[0]=n,t[1]=s,t[2]=r,t[3]=u,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[n,s,r]=this._components;return t[0]=n,t[1]=s,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,n,s]=this.toUint8RgbArray();return(s<<16)+(n<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[n,s,r,u]=$a._temp.setValue(t)._components;return this._components[0]*=n,this._components[1]*=s,this._components[2]*=r,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 s=this._int>>16&255,r=this._int>>8&255,u=this._int&255;return n&&(s=s*t+.5|0,r=r*t+.5|0,u=u*t+.5|0),(t*255<<24)+(s<<16)+(r<<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,s,r,u;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const c=t;n=(c>>16&255)/255,s=(c>>8&255)/255,r=(c&255)/255,u=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,s,r,u=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,s,r,u=255]=t,n/=255,s/=255,r/=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=bi(t);c.isValid()&&({r:n,g:s,b:r,a:u}=c.rgba,n/=255,s/=255,r/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=s,this._components[2]=r,this._components[3]=u,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,n,s]=this._components;this._int=(t*255<<16)+(n*255<<8)+(s*255|0)}_clamp(t,n=0,s=1){return typeof t=="number"?Math.min(Math.max(t,n),s):(t.forEach((r,u)=>{t[u]=Math.min(Math.max(r,n),s)}),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}};Qs.shared=new Qs;Qs._temp=new Qs;Qs.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let ae=Qs;const hb={cullArea:null,cullable:!1,cullableChildren:!0};let jc=0;const _g=500;function ve(...l){jc!==_g&&(jc++,jc===_g?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 fb{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 s;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(s=n.init)==null||s.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 db{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 fb(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(n=>{const s=t[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;t[s]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const Be=new db;dl.register(Be);const mb={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){At("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(l)}};function pb(l,t,n){const s=l.length;let r;if(t>=s||n===0)return;n=t+n>s?s-t:n;const u=s-n;for(r=t;r<u;++r)l[r]=l[r+n];l.length=u}const gb={allowChildren:!0,removeChildren(l=0,t){var u;const n=t??this.children.length,s=n-l,r=[];if(s>0&&s<=n){for(let h=n-1;h>=l;h--){const m=this.children[h];m&&(r.push(m),m.parent=null)}pb(this.children,l,n);const c=this.renderGroup||this.parentRenderGroup;c&&c.removeChildren(r);for(let h=0;h<r.length;++h){const m=r[h];(u=m.parentRenderLayer)==null||u.detach(m),this.emit("childRemoved",m,this,h),r[h].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(s===0&&this.children.length===0)return r;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||At(Wt,"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 s=l.parent===this;if(l.parent){const u=l.parent.children.indexOf(l);if(s){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 r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(l),this.sortableChildren&&(this.sortDirty=!0),s||(this.emit("childAdded",l,this,t),l.emit("added",this)),l},swapChildren(l,t){if(l===t)return;const n=this.getChildIndex(l),s=this.getChildIndex(t);this.children[n]=t,this.children[s]=l;const r=this.renderGroup||this.parentRenderGroup;r&&(r.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 s=this.worldTransform.clone();return s.invert(),n.prepend(s),l.setFromMatrix(n),l},replaceChild(l,t){l.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(l)),t.setFromMatrix(l.localTransform),t.updateLocalTransform(),this.removeChild(l)}},yb={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 s=this.children,r=s.length;for(let u=0;u<r;u++)s[u].collectRenderables(l,t,n)},collectRenderablesWithEffects(l,t,n){const{renderPipes:s}=t;for(let r=0;r<this.effects.length;r++){const u=this.effects[r];s[u.pipe].push(u,this,l)}this.collectRenderablesSimple(l,t,n);for(let r=this.effects.length-1;r>=0;r--){const u=this.effects[r];s[u.pipe].pop(u,this,l)}}};class bg{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 xb{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 s=this._tests[n];if(s.test(t))return Be.get(s.maskClass,t)}return t}returnMaskEffect(t){Be.return(t)}}const fh=new xb;Jt.handleByList(yt.MaskEffect,fh._effectClasses);const _b={_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,s)=>n.priority-s.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),fh.returnMaskEffect(t),this._maskEffect=null),l!=null&&(this._maskEffect=fh.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 bg);l=l;const n=(l==null?void 0:l.length)>0,s=((u=t.filters)==null?void 0:u.length)>0,r=n!==s;l=Array.isArray(l)?l.slice(0):l,t.filters=Object.freeze(l),r&&(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 bg),this._filterEffect.filterArea=l},get filterArea(){var l;return(l=this._filterEffect)==null?void 0:l.filterArea}},bb={label:null,get name(){return At(Wt,"Container.name property has been removed, use Container.label instead"),this.label},set name(l){At(Wt,"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 s=0;s<n.length;s++){const r=n[s];if(r.label===l||l instanceof RegExp&&l.test(r.label))return r}if(t)for(let s=0;s<n.length;s++){const u=n[s].getChildByLabel(l,!0);if(u)return u}return null},getChildrenByLabel(l,t=!1,n=[]){const s=this.children;for(let r=0;r<s.length;r++){const u=s[r];(u.label===l||l instanceof RegExp&&l.test(u.label))&&n.push(u)}if(t)for(let r=0;r<s.length;r++)s[r].getChildrenByLabel(l,!0,n);return n}},be=Be.getPool(St),Vi=Be.getPool(ai),vb=new St,Sb={getFastGlobalBounds(l,t){t||(t=new ai),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 s=t;if(l&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(s=Vi.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const c=this.bounds;s.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,s,n)}if(r){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,s.applyMatrix(c.worldTransform)),this.effects[h].addBounds(s,!0));u&&s.applyMatrix(c.worldTransform.copyTo(vb).invert()),t.addBounds(s),Vi.return(s)}else this.renderGroup&&(t.addBounds(s,this.relativeGroupTransform),Vi.return(s))}};function Oy(l,t,n){n.clear();let s,r;return l.parent?t?s=l.parent.worldTransform:(r=be.get().identity(),s=Dh(l,r)):s=St.IDENTITY,Ny(l,n,s,t),r&&be.return(r),n.isValid||n.set(0,0,0,0),n}function Ny(l,t,n,s){var h,m;if(!l.visible||!l.measurable)return;let r;s?r=l.worldTransform:(l.updateLocalTransform(),r=be.get(),r.appendFrom(l.localTransform,n));const u=t,c=!!l.effects.length;if(c&&(t=Vi.get().clear()),l.boundsArea)t.addRect(l.boundsArea,r);else{const p=l.bounds;p&&!p.isEmpty()&&(t.matrix=r,t.addBounds(p));for(let g=0;g<l.children.length;g++)Ny(l.children[g],t,r,s)}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),Vi.return(t)}s||be.return(r)}function Dh(l,t){const n=l.parent;return n&&(Dh(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}function ky(l,t){if(l===16777215||!t)return t;if(t===16777215||!l)return l;const n=l>>16&255,s=l>>8&255,r=l&255,u=t>>16&255,c=t>>8&255,h=t&255,m=n*u/255|0,p=s*c/255|0,g=r*h/255|0;return(m<<16)+(p<<8)+g}const vg=16777215;function Sg(l,t){return l===vg?t:t===vg?l:ky(l,t)}function $r(l){return((l&255)<<16)+(l&65280)+(l>>16&255)}const Tb={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=Dh(this,be.get().identity());return l.appendFrom(this.localTransform,n),be.return(n),l},getGlobalTint(l){if(l)return this.renderGroup?$r(this.renderGroup.worldColor):this.parentRenderGroup?$r(Sg(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=Sg(t,n.localColor),n=n.parent;return $r(t)}};function Gy(l,t,n){return t.clear(),n||(n=St.IDENTITY),Uy(l,t,n,l,!0),t.isValid||t.set(0,0,0,0),t}function Uy(l,t,n,s,r){var m,p;let u;if(r)u=be.get(),u=n.copyTo(u);else{if(!l.visible||!l.measurable)return;l.updateLocalTransform();const g=l.localTransform;u=be.get(),u.appendFrom(g,n)}const c=t,h=!!l.effects.length;if(h&&(t=Vi.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++)Uy(g[x],t,u,s,!1)}if(h){for(let g=0;g<l.effects.length;g++)(p=(m=l.effects[g]).addLocalBounds)==null||p.call(m,t,s);c.addBounds(t,St.IDENTITY),Vi.return(t)}be.return(u)}function Hy(l,t){const n=l.children;for(let s=0;s<n.length;s++){const r=n[s],u=r.uid,c=(r._didViewChangeTick&65535)<<16|r._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,r.children.length&&Hy(r,t)}return t.didChange}const wb=new St,Ab={_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 ai});const l=this._localBoundsCacheData;return l.index=1,l.didChange=!1,l.data[0]!==this._didViewChangeTick&&(l.didChange=!0,l.data[0]=this._didViewChangeTick),Hy(this,l),l.didChange&&Gy(this,l.localBounds,wb),l.localBounds},getBounds(l,t){return Oy(this,l,t||new ai)}},Cb={_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}},Mb={_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(Eb))}};function Eb(l,t){return l._zIndex-t._zIndex}const Rb={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 s=this.getGlobalTransform(be.get(),n);return t=s.apply(l,t),be.return(s),t},toLocal(l,t,n,s){t&&(l=t.toGlobal(l,n,s));const r=this.getGlobalTransform(be.get(),s);return n=r.applyInverse(l,n),be.return(r),n}};class Bh{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 zb=0;class Db{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Ws(this.textureOptions)}createTexture(t,n,s,r){const u=new li({...this.textureOptions,width:t,height:n,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:r});return new Gt({source:u,label:`texturePool_${zb++}`})}getOptimalTexture(t,n,s=1,r,u=!1){let c=Math.ceil(t*s-1e-6),h=Math.ceil(n*s-1e-6);c=Fs(c),h=Fs(h);const m=r?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,r,u)),x.source._resolution=s,x.source.width=c/s,x.source.height=h/s,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 s=t.source;return this.getOptimalTexture(t.width,t.height,s._resolution,n)}returnTexture(t,n=!1){const s=this._poolKeyHash[t.uid];n&&(t.source.style=this.textureStyle),this._texturePool[s].push(t)}clear(t){if(t=t!==!1,t)for(const n in this._texturePool){const s=this._texturePool[n];if(s)for(let r=0;r<s.length;r++)s[r].destroy(!0)}this._texturePool={}}}const lo=new Db;dl.register(lo);class Bb{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 Bh,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 s=0;s<n.length;s++){const r=n[s];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(lo.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 s=0;s<n.length;s++)this.addChild(n[s])}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 s=0;s<n.length;s++)this.removeChild(n[s])}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 s=0;s<n.length;s++)this._getChildren(n[s],t);return t}_getChildren(t,n=[]){if(n.push(t),t.renderGroup)return n;const s=t.children;for(let r=0;r<s.length;r++)this._getChildren(s[r],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 Ob(l,t,n={}){for(const s in t)!n[s]&&t[s]!==void 0&&(l[s]=t[s])}const Yc=new me(null),jr=new me(null),qc=new me(null,1,1),Yr=new me(null),Tg=1,Nb=2,Xc=4;class De extends Si{constructor(t={}){var n,s;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 me(this,0,0),this._scale=qc,this._pivot=jr,this._origin=Yr,this._skew=Yc,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=[],Ob(this,t,{children:!0,parent:!0,effects:!0}),(n=t.children)==null||n.forEach(r=>this.addChild(r)),(s=t.parent)==null||s.addChild(this)}static mixin(t){At("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Jt.mixin(De,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||At(Wt,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let r=0;r<t.length;r++)this.addChild(t[r]);return t[0]}const n=t[0],s=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),s&&(s.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,s&&s.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 r=0;r<t.length;r++)this.removeChild(t[r]);return t[0]}const n=t[0],s=this.children.indexOf(n);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,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,s),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=Be.get(Bb,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),Be.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*Q1}set angle(t){this.rotation=t*Z1}get pivot(){return this._pivot===jr&&(this._pivot=new me(this,0,0)),this._pivot}set pivot(t){this._pivot===jr&&(this._pivot=new me(this,0,0),this._origin!==Yr&&ve("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===Yc&&(this._skew=new me(this,0,0)),this._skew}set skew(t){this._skew===Yc&&(this._skew=new me(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===qc&&(this._scale=new me(this,1,1)),this._scale}set scale(t){this._scale===qc&&(this._scale=new me(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 me(this,0,0)),this._origin}set origin(t){this._origin===Yr&&(this._origin=new me(this,0,0),this._pivot!==jr&&ve("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 s=this.getLocalBounds();typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,s.width),n!==void 0&&this._setHeight(n,s.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,s=this._scale,r=this._pivot,u=this._origin,c=this._position,h=s._x,m=s._y,p=r._x,g=r._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|=Tg,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const s=ae.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=Tg,this._onUpdate())}get tint(){return $r(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Nb,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|=Xc,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|=Xc,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|=Xc,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){var r;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);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}Jt.mixin(De,gb,Sb,Rb,Cb,Ab,_b,bb,Mb,hb,mb,Tb,yb);class Oh extends De{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 ai(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:s,y:r}=t;return s>=n.minX&&s<=n.maxX&&r>=n.minY&&r<=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,s){const{renderPipes:r}=n;r.blendMode.pushBlendMode(this,this.groupBlendMode,t);const c=r[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,s);r.blendMode.popBlendMode(t)}}class ll extends Oh{constructor(t=Gt.EMPTY){t instanceof Gt&&(t={texture:t});const{texture:n=Gt.EMPTY,anchor:s,roundPixels:r,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 me({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=r??!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 Ry(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return At("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,n=this._texture,s=this._bounds,{width:r,height:u}=n.orig;s.minX=-t._x*r,s.maxX=s.minX+r,s.minY=-t._y*u,s.maxY=s.minY+u}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const s=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(s)}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 kb=new ai;function Ly(l,t,n){const s=kb;l.measurable=!0,Oy(l,n,s),t.addBoundsMask(s),l.measurable=!1}function jy(l,t,n){const s=Vi.get();l.measurable=!0;const r=be.get().identity(),u=Yy(l,n,r);Gy(l,s,u),l.measurable=!1,t.addBoundsMask(s),be.return(r),Vi.return(s)}function Yy(l,t,n){return l?(l!==t&&(Yy(l.parent,t,n),l.updateLocalTransform(),n.append(l.localTransform)),n):(ve("Mask bounds, renderable is not inside the root container"),n)}class qy{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||Ly(this.mask,t,n)}addLocalBounds(t,n){jy(this.mask,t,n)}containsPoint(t,n){const s=this.mask;return n(s,t)}destroy(){this.reset()}static test(t){return t instanceof ll}}qy.extension=yt.MaskEffect;class Xy{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"}}Xy.extension=yt.MaskEffect;class Vy{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){Ly(this.mask,t,n)}addLocalBounds(t,n){jy(this.mask,t,n)}containsPoint(t,n){const s=this.mask;return n(s,t)}destroy(){this.reset()}static test(t){return t instanceof De}}Vy.extension=yt.MaskEffect;const Gb={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 wg=Gb;const Pe={get(){return wg},set(l){wg=l}};class Py extends li{constructor(t){t.resource||(t.resource=Pe.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,s=this._resolution){const r=super.resize(t,n,s);return r&&this.resizeCanvas(),r}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"))}}Py.extension=yt.TextureSource;class to 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}}to.extension=yt.TextureSource;var eo=(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))(eo||{});class Vc{constructor(t,n=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=n,this.priority=s,this._once=r}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 Fy=class Xe{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 Vc(null,null,1/0),this.deltaMS=1/Xe.targetFPMS,this.elapsedMS=1/Xe.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,s=eo.NORMAL){return this._addListener(new Vc(t,n,s))}addOnce(t,n,s=eo.NORMAL){return this._addListener(new Vc(t,n,s,!0))}_addListener(t){let n=this._head.next,s=this._head;if(!n)t.connect(s);else{for(;n;){if(t.priority>n.priority){t.connect(s);break}s=n,n=n.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,n){let s=this._head.next;for(;s;)s.match(t,n)?s=s.destroy():s=s.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*Xe.targetFPMS;const s=this._head;let r=s.next;for(;r;)r=r.emit(this);s.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,Xe.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(!Xe._shared){const t=Xe._shared=new Xe;t.autoStart=!0,t._protected=!0}return Xe._shared}static get system(){if(!Xe._system){const t=Xe._system=new Xe;t.autoStart=!0,t._protected=!0}return Xe._system}};Fy.targetFPMS=.06;let Vs=Fy,Pc;async function Ub(){return Pc??(Pc=(async()=>{var c;const t=Pe.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 s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,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(r),t.deleteTexture(s),(c=t.getExtension("WEBGL_lose_context"))==null||c.loseContext(),u[0]<=u[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Pc}const ro=class Wy extends li{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Wy.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 Ub(),this._load=new Promise((s,r)=>{this.isValid?s(this):(this._resolve=s,this._reject=r,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}};ro.extension=yt.TextureSource;ro.defaultOptions={...li.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};ro.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Hb=ro;const js=(l,t,n=!1)=>(Array.isArray(l)||(l=[l]),t?l.map(s=>typeof s=="string"||n?t(s):s):l);class Lb{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||ve(`[Assets] Asset id ${t} was not found in the Cache`),n}set(t,n){const s=js(t);let r;for(let m=0;m<this.parsers.length;m++){const p=this.parsers[m];if(p.test(n)){r=p.getCacheableAssets(s,n);break}}const u=new Map(Object.entries(r||{}));r||s.forEach(m=>{u.set(m,n)});const c=[...u.keys()],h={cacheKeys:c,keys:s};s.forEach(m=>{this._cacheMap.set(m,h)}),c.forEach(m=>{const p=r?r[m]:n;this._cache.has(m)&&this._cache.get(m)!==p&&ve("[Cache] already has key:",m),this._cache.set(m,u.get(m))})}remove(t){if(!this._cacheMap.has(t)){ve(`[Assets] Asset id ${t} was not found in the Cache`);return}const n=this._cacheMap.get(t);n.cacheKeys.forEach(r=>{this._cache.delete(r)}),n.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Ys=new Lb,dh=[];Jt.handleByList(yt.TextureSource,dh);function Qy(l={}){const t=l&&l.resource,n=t?l.resource:l,s=t?l:{resource:l};for(let r=0;r<dh.length;r++){const u=dh[r];if(u.test(n))return new u(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function jb(l={},t=!1){const n=l&&l.resource,s=n?l.resource:l,r=n?l:{resource:l};if(!t&&Ys.has(s))return Ys.get(s);const u=new Gt({source:Qy(r)});return u.on("destroy",()=>{Ys.has(s)&&Ys.remove(s)}),t||Ys.set(s,u),u}function Yb(l,t=!1){return typeof l=="string"?Ys.get(l):l instanceof li?new Gt({source:l}):jb(l,t)}Gt.from=Yb;li.from=Qy;Jt.add(qy,Xy,Vy,Hb,to,Py,zh);var Zy=(l=>(l[l.Low=0]="Low",l[l.Normal=1]="Normal",l[l.High=2]="High",l))(Zy||{});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 qb(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xb(l,t,n){return l.replace(new RegExp(qb(t),"g"),n)}function Vb(l,t){let n="",s=0,r=-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(!(r===h-1||u===1))if(r!==h-1&&u===2){if(n.length<2||s!==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="",s=0):(n=n.slice(0,m),s=n.length-1-n.lastIndexOf("/")),r=h,u=0;continue}}else if(n.length===2||n.length===1){n="",s=0,r=h,u=0;continue}}}else n.length>0?n+=`/${l.slice(r+1,h)}`:n=l.slice(r+1,h),s=h-r-1;r=h,u=0}else c===46&&u!==-1?++u:u=-1}return n}const rl={toPosix(l){return Xb(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 s=Pa(this.toPosix(t??Pe.get().getBaseUrl())),r=Pa(this.toPosix(n??this.rootname(s)));return l=this.toPosix(l),l.startsWith("/")?rl.join(r,l.slice(1)):this.isAbsolute(l)?l:this.join(s,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 s=l.endsWith("/");return l=Vb(l),l.length>0&&s&&(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 s=l[n];if(fi(s),s.length>0)if(t===void 0)t=s;else{const r=l[n-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}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 s=-1,r=!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(!r){s=h;break}}else r=!1;return s===-1?n?"/":this.isUrl(c)?u+l:u:n&&s===1?"//":u+l.slice(0,s)},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,s=-1,r=!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(!r){n=u+1;break}}else h===-1&&(r=!1,h=u+1),c>=0&&(m===t.charCodeAt(c)?--c===-1&&(s=u):(c=-1,s=h))}return n===s?s=h:s===-1&&(s=l.length),l.slice(n,s)}for(u=l.length-1;u>=0;--u)if(l.charCodeAt(u)===47){if(!r){n=u+1;break}}else s===-1&&(r=!1,s=u+1);return s===-1?"":l.slice(n,s)},extname(l){fi(l),l=Pa(this.toPosix(l));let t=-1,n=0,s=-1,r=!0,u=0;for(let c=l.length-1;c>=0;--c){const h=l.charCodeAt(c);if(h===47){if(!r){n=c+1;break}continue}s===-1&&(r=!1,s=c+1),h===46?t===-1?t=c:u!==1&&(u=1):t!==-1&&(u=-1)}return t===-1||s===-1||u===0||u===1&&t===s-1&&t===n+1?"":l.slice(t,s)},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 s=this.isAbsolute(l);let r;t.root=this.rootname(l),s||this.hasProtocol(l)?r=1:r=0;let u=-1,c=0,h=-1,m=!0,p=l.length-1,g=0;for(;p>=r;--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&&s?t.base=t.name=l.slice(1,h):t.base=t.name=l.slice(c,h)):(c===0&&s?(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 Iy(l,t,n,s,r){const u=t[n];for(let c=0;c<u.length;c++){const h=u[c];n<t.length-1?Iy(l.replace(s[n],h),t,n+1,s,r):r.push(l.replace(s[n],h))}}function Pb(l){const t=/\{(.*?)\}/g,n=l.match(t),s=[];if(n){const r=[];n.forEach(u=>{const c=u.substring(1,u.length-1).split(",");r.push(c)}),Iy(l,r,0,n,s)}else s.push(l);return s}const Ag=l=>!Array.isArray(l);class Ky{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(s=>`${encodeURIComponent(s)}=${encodeURIComponent(n[s])}`).join("&")}}getAlias(t){const{alias:n,src:s}=t;return js(n||s,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&&ve("[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 s=[];let r=n;Array.isArray(n)||(r=Object.entries(n).map(([u,c])=>typeof c=="string"||Array.isArray(c)?{alias:u,src:c}:{alias:u,...c})),r.forEach(u=>{const c=u.src,h=u.alias;let m;if(typeof h=="string"){const p=this._createBundleAssetId(t,h);s.push(p),m=[h,p]}else{const p=h.map(g=>this._createBundleAssetId(t,g));s.push(...p),m=[...h,...p]}this.add({...u,alias:m,src:c})}),this._bundles[t]=s}add(t){const n=[];Array.isArray(t)?n.push(...t):n.push(t);let s;s=u=>{this.hasKey(u)&&ve(`[Resolver] already has key: ${u} overwriting`)},js(n).forEach(u=>{const{src:c}=u;let{data:h,format:m,loadParser:p,parser:g}=u;const x=js(c).map(A=>typeof A=="string"?Pb(A):Array.isArray(A)?A:[A]),_=this.getAlias(u);Array.isArray(_)?_.forEach(s):s(_);const b=[],T=A=>{const S=this._parsers.find(w=>w.test(A));return{src:A,...S==null?void 0:S.parse(A)}};x.forEach(A=>{A.forEach(S=>{let w={};if(typeof S!="object"?w=T(S):(h=S.data??h,m=S.format??m,(S.loadParser||S.parser)&&(p=S.loadParser??p,g=S.parser??g),w={...T(S.src),...S}),!_)throw new Error(`[Resolver] alias is undefined for this asset: ${w.src}`);w=this._buildResolvedAsset(w,{aliases:_,data:h,format:m,loadParser:p,parser:g,progressSize:u.progressSize}),b.push(w)})}),_.forEach(A=>{this._assetMap[A]=b})})}resolveBundle(t){const n=Ag(t);t=js(t);const s={};return t.forEach(r=>{const u=this._bundles[r];if(u){const c=this.resolve(u),h={};for(const m in c){const p=c[m];h[this._extractAssetIdFromBundle(r,m)]=p}s[r]=h}}),n?s[t[0]]:s}resolveUrl(t){const n=this.resolve(t);if(typeof t!="string"){const s={};for(const r in n)s[r]=n[r].src;return s}return n.src}resolve(t){const n=Ag(t);t=js(t);const s={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let u=this._assetMap[r];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[r]=u[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});s[r]=this._resolverHash[r]}),n?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let n=0;n<t.length;n++){const s=t[n],r=this._preferredOrder.find(u=>u.params.format.includes(s.format));if(r)return r}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:s,data:r,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=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=u??t.loadParser,t.parser=c??t.parser,t.format=h??t.format??Fb(t.src),m!==void 0&&(t.progressSize=m),t}}Ky.RETINA_PREFIX=/@([0-9\.]+)x/;function Fb(l){return l.split(".").pop().split("?").shift().split("#").shift()}const Cg=(l,t)=>{const n=t.split("?")[1];return n&&(l+=`?${n}`),l},$y=class Ja{constructor(t,n){this.linkedSheets=[];let s=t;(t==null?void 0:t.source)instanceof li&&(s={texture:t,data:n});const{texture:r,data:u,cachePrefix:c=""}=s;this.cachePrefix=c,this._texture=r instanceof Gt?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=u;const h=parseFloat(u.meta.scale);h?(this.resolution=h,r.source.resolution=this.resolution):this.resolution=r.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 s=t;const r=n?1/0:Ja.BATCH_SIZE;for(;s-t<r&&s<this._frameKeys.length;){const u=this._frameKeys[s],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 $t(0,0,Math.floor(g.w)/this.resolution,Math.floor(g.h)/this.resolution);c.rotated?m=new $t(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 $t(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 $t(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()})}s++}}_processAnimations(){const t=this.data.animations||{};for(const n in t){this.animations[n]=[];for(let s=0;s<t[n].length;s++){const r=t[n][s];this.animations[n].push(this.textures[r])}}}_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 s in this.textures)this.textures[s].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=[]}};$y.BATCH_SIZE=1e3;let Mg=$y;const Wb=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function Jy(l,t,n){const s={};if(l.forEach(r=>{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[`${t.cachePrefix}${r}`]=t.textures[r]}),!n){const r=rl.dirname(l[0]);t.linkedSheets.forEach((u,c)=>{const h=Jy([`${r}/${t.data.meta.related_multi_packs[c]}`],u,!0);Object.assign(s,h)})}return s}const Qb={extension:yt.Asset,cache:{test:l=>l instanceof Mg,getCacheableAssets:(l,t)=>Jy(l,t,!1)},resolver:{extension:{type:yt.ResolveParser,name:"resolveSpritesheet"},test:l=>{const n=l.split("?")[0].split("."),s=n.pop(),r=n.pop();return s==="json"&&Wb.includes(r)},parse:l=>{var n;const t=l.split(".");return{resolution:parseFloat(((n=Ky.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:Zy.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:s,imageFilename:r,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(s instanceof Gt)m=s;else{const b=Cg(h+(r??l.meta.image),t.src);m=(await n.load([{src:b,data:u}]))[b]}const p=new Mg({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 A of g){if(typeof A!="string")continue;let S=h+A;(_=t.data)!=null&&_.ignoreMultiPack||(S=Cg(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(A=>{A.linkedSheets=[p].concat(p.linkedSheets.filter(S=>S!==A))})}return p},async unload(l,t,n){await n.unload(l.textureSource._sourceOrigin),l.destroy(!1)}}};Jt.add(Qb);const Fc=Object.create(null),Eg=Object.create(null);function Nh(l,t){let n=Eg[l];return n===void 0&&(Fc[t]===void 0&&(Fc[t]=1),Eg[l]=n=Fc[t]++),n}let Us;function t0(){return(!Us||Us!=null&&Us.isContextLost())&&(Us=Pe.get().createCanvas().getContext("webgl",{})),Us}let qr;function Zb(){if(!qr){qr="mediump";const l=t0();l&&l.getShaderPrecisionFormat&&(qr=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT).precision?"highp":"mediump")}return qr}function Ib(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 Kb(l,t,n){const s=n?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(l.substring(0,9)!=="precision"){let r=n?t.requestedFragmentPrecision:t.requestedVertexPrecision;return r==="highp"&&s!=="highp"&&(r="mediump"),`precision ${r} float;
|
|
69
|
+
${l}`}else if(s!=="highp"&&l.substring(0,15)==="precision highp")return l.replace("precision highp","precision mediump");return l}function $b(l,t){return t?`#version 300 es
|
|
70
|
+
${l}`:l}const Jb={},tv={};function ev(l,{name:t="pixi-program"},n=!0){t=t.replace(/\s+/g,"-"),t+=n?"-fragment":"-vertex";const s=n?Jb:tv;return s[t]?(s[t]++,t+=`-${s[t]}`):s[t]=1,l.indexOf("#define SHADER_NAME")!==-1?l:`${`#define SHADER_NAME ${t}`}
|
|
71
|
+
${l}`}function iv(l,t){return t?l.replace("#version 300 es",""):l}const Wc={stripVersion:iv,ensurePrecision:Kb,addProgramDefines:Ib,setProgramName:ev,insertVersion:$b},Fa=Object.create(null),e0=class mh{constructor(t){t={...mh.defaultOptions,...t};const n=t.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Zb()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n};let r=t.fragment,u=t.vertex;Object.keys(Wc).forEach(c=>{const h=s[c];r=Wc[c](r,h,!0),u=Wc[c](u,h,!1)}),this.fragment=r,this.vertex=u,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Nh(`${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 mh(t),Fa[n]._cacheKey=n),Fa[n]}};e0.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let i0=e0;const Rg={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 nv(l){return Rg[l]??Rg.float32}const sv={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"},zg=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Dg(l,t){let n;for(;(n=zg.exec(l))!==null;){const s=sv[n[3]]??"float32";t[n[2]]={location:parseInt(n[1],10),format:s,stride:nv(s).stride,offset:0,instance:!1,start:0}}zg.lastIndex=0}function av(l){return l.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function lv({source:l,entryPoint:t}){const n={},s=av(l),r=s.indexOf(`fn ${t}(`);if(r===-1)return n;const u=s.indexOf("->",r);if(u===-1)return n;const c=s.substring(r,u);if(Dg(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=s.match(p);g&&Dg(g[1],n)}}return n}function Qc(l){var x,_;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,r=/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(s)[1],10),name:b.match(r)[2],isUniform:b.match(r)[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],A=b.match(h).reduce((S,w)=>{const[C,E]=w.split(":");return S[C.trim()]=E.trim(),S},{});return A?{name:T,members:A}:null}).filter(({name:b})=>p.some(T=>T.type===b||T.type.includes(`<${b}>`))))??[];return{groups:p,structs:g}}var Zn=(l=>(l[l.VERTEX=1]="VERTEX",l[l.FRAGMENT=2]="FRAGMENT",l[l.COMPUTE=4]="COMPUTE",l))(Zn||{});function rv({groups:l}){const t=[];for(let n=0;n<l.length;n++){const s=l[n];t[s.group]||(t[s.group]=[]),s.isUniform?t[s.group].push({binding:s.binding,visibility:Zn.VERTEX|Zn.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?t[s.group].push({binding:s.binding,visibility:Zn.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?t[s.group].push({binding:s.binding,visibility:Zn.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?t[s.group].push({binding:s.binding,visibility:Zn.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&t[s.group].push({binding:s.binding,visibility:Zn.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<t.length;n++)t[n]||(t[n]=[]);return t}function ov({groups:l}){const t=[];for(let n=0;n<l.length;n++){const s=l[n];t[s.group]||(t[s.group]={}),t[s.group][s.name]=s.binding}return t}function uv(l,t){const n=new Set,s=new Set,r=[...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 s.has(h)?!1:(s.add(h),!0)});return{structs:r,groups:u}}const Wa=Object.create(null);class oo{constructor(t){var h,m;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:s,layout:r,gpuLayout:u,name:c}=t;if(this.name=c,this.fragment=n,this.vertex=s,n.source===s.source){const p=Qc(n.source);this.structsAndGroups=p}else{const p=Qc(s.source),g=Qc(n.source);this.structsAndGroups=uv(p,g)}this.layout=r??ov(this.structsAndGroups),this.gpuLayout=u??rv(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,s=t.source+n.source+t.entryPoint+n.entryPoint;this._layoutKey=Nh(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=lv(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Wa[this._cacheKey]=null}static from(t){const n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Wa[n]||(Wa[n]=new oo(t),Wa[n]._cacheKey=n),Wa[n]}}const n0=["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>"],cv=n0.reduce((l,t)=>(l[t]=!0,l),{});function hv(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 s0=class a0{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={...a0.defaultOptions,...n},this.uniformStructures=t;const s={};for(const r in t){const u=t[r];if(u.name=r,u.size=u.size??1,!cv[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: ${n0.join(", ")}`)}u.value??(u.value=hv(u.type,u.size)),s[r]=u.value}this.uniforms=s,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Nh(Object.keys(s).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};s0.defaultOptions={ubo:!1,isStatic:!1};let l0=s0;class Jr{constructor(t){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const s in t){const r=t[s];this.setResource(r,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let n=0;for(const s in this.resources)t[n++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,n){var r,u;const s=this.resources[n];t!==s&&((r=s==null?void 0:s.off)==null||r.call(s,"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 s=this.resources;for(const r in s)s[r]._gcLastUsed=t,s[r]._touched=n}destroy(){var n;const t=this.resources;for(const s in t){const r=t[s];(n=r==null?void 0:r.off)==null||n.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var ph=(l=>(l[l.WEBGL=1]="WEBGL",l[l.WEBGPU=2]="WEBGPU",l[l.CANVAS=4]="CANVAS",l[l.BOTH=3]="BOTH",l))(ph||{});class kh extends Si{constructor(t){super(),this.uid=Qt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:s,groups:r,resources:u,compatibleRenderers:c,groupMap:h}=t;this.gpuProgram=n,this.glProgram=s,c===void 0&&(c=0,n&&(c|=ph.WEBGPU),s&&(c|=ph.WEBGL)),this.compatibleRenderers=c;const m={};if(!u&&!r&&(u={}),u&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&r&&!h)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&r&&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&&r&&!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){r={},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]||(r[99]||(r[99]=new Jr,this._ownedBindGroups.push(r[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 l0(_));const b=m[x];b&&(r[b.group]||(r[b.group]=new Jr,this._ownedBindGroups.push(r[b.group])),r[b.group].setResource(_,b.binding))}}this.groups=r,this._uniformBindMap=h,this.resources=this._buildResourceAccessor(r,m)}addResource(t,n,s){var r,u;(r=this._uniformBindMap)[n]||(r[n]={}),(u=this._uniformBindMap[n])[s]||(u[s]=t),this.groups[n]||(this.groups[n]=new Jr,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(t,n){const s={};for(const r in n){const u=n[r];Object.defineProperty(s,u.name,{get(){return t[u.group].getResource(u.binding)},set(c){t[u.group].setResource(c,u.binding)}})}return s}destroy(t=!1){var n,s;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&((n=this.gpuProgram)==null||n.destroy(),(s=this.glProgram)==null||s.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:n,gl:s,...r}=t;let u,c;return n&&(u=oo.from(n)),s&&(c=i0.from(s)),new kh({gpuProgram:u,glProgram:c,...r})}}const fv={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},Zc=0,Ic=1,Kc=2,$c=3,Jc=4,th=5,gh=class r0{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Zc)}set blend(t){!!(this.data&1<<Zc)!==t&&(this.data^=1<<Zc)}get offsets(){return!!(this.data&1<<Ic)}set offsets(t){!!(this.data&1<<Ic)!==t&&(this.data^=1<<Ic)}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<<Kc)}set culling(t){!!(this.data&1<<Kc)!==t&&(this.data^=1<<Kc)}get depthTest(){return!!(this.data&1<<$c)}set depthTest(t){!!(this.data&1<<$c)!==t&&(this.data^=1<<$c)}get depthMask(){return!!(this.data&1<<th)}set depthMask(t){!!(this.data&1<<th)!==t&&(this.data^=1<<th)}get clockwiseFrontFace(){return!!(this.data&1<<Jc)}set clockwiseFrontFace(t){!!(this.data&1<<Jc)!==t&&(this.data^=1<<Jc)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=fv[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 r0;return t.depthTest=!1,t.blend=!0,t}};gh.default2d=gh.for2d();let o0=gh;const yh=[];Jt.handleByNamedList(yt.Environment,yh);async function dv(l){if(!l)for(let t=0;t<yh.length;t++){const n=yh[t];if(n.value.test()){await n.value.load();return}}}let Qa;function mv(){if(typeof Qa=="boolean")return Qa;try{Qa=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Qa=!1}return Qa}function Bg(l,t,n=2){const s=t&&t.length,r=s?t[0]*n:l.length;let u=u0(l,0,r,n,!0);const c=[];if(!u||u.next===u.prev)return c;let h,m,p;if(s&&(u=_v(l,t,u,n)),l.length>80*n){h=l[0],m=l[1];let g=h,x=m;for(let _=n;_<r;_+=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 u0(l,t,n,s,r){let u;if(r===zv(l,t,n,s)>0)for(let c=t;c<n;c+=s)u=Og(c/s|0,l[c],l[c+1],u);else for(let c=n-s;c>=t;c-=s)u=Og(c/s|0,l[c],l[c+1],u);return u&&Zs(u,u.next)&&(cl(u),u=u.next),u}function $n(l,t){if(!l)return l;t||(t=l);let n=l,s;do if(s=!1,!n.steiner&&(Zs(n,n.next)||Xt(n.prev,n,n.next)===0)){if(cl(n),n=t=n.prev,n===n.next)break;s=!0}else n=n.next;while(s||n!==t);return t}function ol(l,t,n,s,r,u,c){if(!l)return;!c&&u&&wv(l,s,r,u);let h=l;for(;l.prev!==l.next;){const m=l.prev,p=l.next;if(u?gv(l,s,r,u):pv(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=yv($n(l),t),ol(l,t,n,s,r,u,2)):c===2&&xv(l,t,n,s,r,u):ol($n(l),t,n,s,r,u,1);break}}}function pv(l){const t=l.prev,n=l,s=l.next;if(Xt(t,n,s)>=0)return!1;const r=t.x,u=n.x,c=s.x,h=t.y,m=n.y,p=s.y,g=Math.min(r,u,c),x=Math.min(h,m,p),_=Math.max(r,u,c),b=Math.max(h,m,p);let T=s.next;for(;T!==t;){if(T.x>=g&&T.x<=_&&T.y>=x&&T.y<=b&&tl(r,h,u,m,c,p,T.x,T.y)&&Xt(T.prev,T,T.next)>=0)return!1;T=T.next}return!0}function gv(l,t,n,s){const r=l.prev,u=l,c=l.next;if(Xt(r,u,c)>=0)return!1;const h=r.x,m=u.x,p=c.x,g=r.y,x=u.y,_=c.y,b=Math.min(h,m,p),T=Math.min(g,x,_),A=Math.max(h,m,p),S=Math.max(g,x,_),w=xh(b,T,t,n,s),C=xh(A,S,t,n,s);let E=l.prevZ,O=l.nextZ;for(;E&&E.z>=w&&O&&O.z<=C;){if(E.x>=b&&E.x<=A&&E.y>=T&&E.y<=S&&E!==r&&E!==c&&tl(h,g,m,x,p,_,E.x,E.y)&&Xt(E.prev,E,E.next)>=0||(E=E.prevZ,O.x>=b&&O.x<=A&&O.y>=T&&O.y<=S&&O!==r&&O!==c&&tl(h,g,m,x,p,_,O.x,O.y)&&Xt(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;E&&E.z>=w;){if(E.x>=b&&E.x<=A&&E.y>=T&&E.y<=S&&E!==r&&E!==c&&tl(h,g,m,x,p,_,E.x,E.y)&&Xt(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;O&&O.z<=C;){if(O.x>=b&&O.x<=A&&O.y>=T&&O.y<=S&&O!==r&&O!==c&&tl(h,g,m,x,p,_,O.x,O.y)&&Xt(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function yv(l,t){let n=l;do{const s=n.prev,r=n.next.next;!Zs(s,r)&&h0(s,n,n.next,r)&&ul(s,r)&&ul(r,s)&&(t.push(s.i,n.i,r.i),cl(n),cl(n.next),n=l=r),n=n.next}while(n!==l);return $n(n)}function xv(l,t,n,s,r,u){let c=l;do{let h=c.next.next;for(;h!==c.prev;){if(c.i!==h.i&&Mv(c,h)){let m=f0(c,h);c=$n(c,c.next),m=$n(m,m.next),ol(c,t,n,s,r,u,0),ol(m,t,n,s,r,u,0);return}h=h.next}c=c.next}while(c!==l)}function _v(l,t,n,s){const r=[];for(let u=0,c=t.length;u<c;u++){const h=t[u]*s,m=u<c-1?t[u+1]*s:l.length,p=u0(l,h,m,s,!1);p===p.next&&(p.steiner=!0),r.push(Cv(p))}r.sort(bv);for(let u=0;u<r.length;u++)n=vv(r[u],n);return n}function bv(l,t){let n=l.x-t.x;if(n===0&&(n=l.y-t.y,n===0)){const s=(l.next.y-l.y)/(l.next.x-l.x),r=(t.next.y-t.y)/(t.next.x-t.x);n=s-r}return n}function vv(l,t){const n=Sv(l,t);if(!n)return t;const s=f0(n,l);return $n(s,s.next),$n(n,n.next)}function Sv(l,t){let n=t;const s=l.x,r=l.y;let u=-1/0,c;if(Zs(l,n))return n;do{if(Zs(l,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const x=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(x<=s&&x>u&&(u=x,c=n.x<n.next.x?n:n.next,x===s))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(s>=n.x&&n.x>=m&&s!==n.x&&c0(r<p?s:u,r,m,p,r<p?u:s,r,n.x,n.y)){const x=Math.abs(r-n.y)/(s-n.x);ul(n,l)&&(x<g||x===g&&(n.x>c.x||n.x===c.x&&Tv(c,n)))&&(c=n,g=x)}n=n.next}while(n!==h);return c}function Tv(l,t){return Xt(l.prev,l,t.prev)<0&&Xt(t.next,l,l.next)<0}function wv(l,t,n,s){let r=l;do r.z===0&&(r.z=xh(r.x,r.y,t,n,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==l);r.prevZ.nextZ=null,r.prevZ=null,Av(r)}function Av(l){let t,n=1;do{let s=l,r;l=null;let u=null;for(t=0;s;){t++;let c=s,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||s.z<=c.z)?(r=s,s=s.nextZ,h--):(r=c,c=c.nextZ,m--),u?u.nextZ=r:l=r,r.prevZ=u,u=r;s=c}u.nextZ=null,n*=2}while(t>1);return l}function xh(l,t,n,s,r){return l=(l-n)*r|0,t=(t-s)*r|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 Cv(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 c0(l,t,n,s,r,u,c,h){return(r-c)*(t-h)>=(l-c)*(u-h)&&(l-c)*(s-h)>=(n-c)*(t-h)&&(n-c)*(u-h)>=(r-c)*(s-h)}function tl(l,t,n,s,r,u,c,h){return!(l===c&&t===h)&&c0(l,t,n,s,r,u,c,h)}function Mv(l,t){return l.next.i!==t.i&&l.prev.i!==t.i&&!Ev(l,t)&&(ul(l,t)&&ul(t,l)&&Rv(l,t)&&(Xt(l.prev,l,t.prev)||Xt(l,t.prev,t))||Zs(l,t)&&Xt(l.prev,l,l.next)>0&&Xt(t.prev,t,t.next)>0)}function Xt(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 h0(l,t,n,s){const r=Vr(Xt(l,t,n)),u=Vr(Xt(l,t,s)),c=Vr(Xt(n,s,l)),h=Vr(Xt(n,s,t));return!!(r!==u&&c!==h||r===0&&Xr(l,n,t)||u===0&&Xr(l,s,t)||c===0&&Xr(n,l,s)||h===0&&Xr(n,t,s))}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 Ev(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&&h0(n,n.next,l,t))return!0;n=n.next}while(n!==l);return!1}function ul(l,t){return Xt(l.prev,l,l.next)<0?Xt(l,t,l.next)>=0&&Xt(l,l.prev,t)>=0:Xt(l,t,l.prev)<0||Xt(l,l.next,t)<0}function Rv(l,t){let n=l,s=!1;const r=(l.x+t.x)/2,u=(l.y+t.y)/2;do n.y>u!=n.next.y>u&&n.next.y!==n.y&&r<(n.next.x-n.x)*(u-n.y)/(n.next.y-n.y)+n.x&&(s=!s),n=n.next;while(n!==l);return s}function f0(l,t){const n=_h(l.i,l.x,l.y),s=_h(t.i,t.x,t.y),r=l.next,u=t.prev;return l.next=t,t.prev=l,n.next=r,r.prev=n,s.next=n,n.prev=s,u.next=s,s.prev=u,s}function Og(l,t,n,s){const r=_h(l,t,n);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}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 _h(l,t,n){return{i:l,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zv(l,t,n,s){let r=0;for(let u=t,c=n-s;u<n;u+=s)r+=(l[c]-l[u])*(l[u+1]+l[c+1]),c=u;return r}const Dv=Bg.default||Bg;var d0=(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))(d0||{});class Bv{constructor(t){this.items=[],this._name=t}emit(t,n,s,r,u,c,h,m){const{name:p,items:g}=this;for(let x=0,_=g.length;x<_;x++)g[x][p](t,n,s,r,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 Ov=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],m0=class p0 extends Si{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=[...Ov,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(t={}){const n=t.skipExtensionImports===!0?!0:t.manageImports===!1;await dv(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const s in this._systemsHash)t={...this._systemsHash[s].constructor.defaultOptions,...t};t={...p0.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(t);this._initOptions=t}render(t,n){this.tick++;let s=t;if(s instanceof De&&(s={container:s},n&&(At(Wt,"passing a second argument is deprecated, please use render options instead"),s.target=n.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const r=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=r?s.clearColor:ae.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(t,n,s){const r=this.view.resolution;this.view.resize(t,n,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==r&&this.runners.resolutionChange.emit(s)}clear(t={}){const n=this;t.target||(t.target=n.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=d0.ALL);const{clear:s,clearColor:r,target:u,mipLevel:c,layer:h}=t;ae.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(u,s,ae.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 Bv(n)})}_addSystems(t){let n;for(n in t){const s=t[n];this._addSystem(s.value,s.name)}}_addSystem(t,n){const s=new t(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=s,this._systemsHash[n]=s;for(const r in this.runners)this.runners[r].add(s);return this}_addPipes(t,n){const s=n.reduce((r,u)=>(r[u.name]=u.value,r),{});t.forEach(r=>{const u=r.value,c=r.name,h=s[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(!mv())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()}};m0.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let g0=m0,Pr;function Nv(l){return Pr!==void 0||(Pr=(()=>{var n;const t={stencil:!0,failIfMajorPerformanceCaveat:l??g0.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Pe.get().getWebGLRenderingContext())return!1;let r=Pe.get().createCanvas().getContext("webgl",t);const u=!!((n=r==null?void 0:r.getContextAttributes())!=null&&n.stencil);if(r){const c=r.getExtension("WEBGL_lose_context");c&&c.loseContext()}return r=null,u}catch{return!1}})()),Pr}let Fr;async function kv(l={}){return Fr!==void 0||(Fr=await(async()=>{const t=Pe.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(l)).requestDevice(),!0}catch{return!1}})()),Fr}const Ng=["webgl","webgpu","canvas"];async function Gv(l){let t=[];l.preference?(t.push(l.preference),Ng.forEach(u=>{u!==l.preference&&t.push(u)})):t=Ng.slice();let n,s={};for(let u=0;u<t.length;u++){const c=t[u];if(c==="webgpu"&&await kv()){const{WebGPURenderer:h}=await el(async()=>{const{WebGPURenderer:m}=await import("./WebGPURenderer-DALpH00k.js");return{WebGPURenderer:m}},__vite__mapDeps([3,4,5,2]));n=h,s={...l,...l.webgpu};break}else if(c==="webgl"&&Nv(l.failIfMajorPerformanceCaveat??g0.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:h}=await el(async()=>{const{WebGLRenderer:m}=await import("./WebGLRenderer-DxbdlULS.js");return{WebGLRenderer:m}},__vite__mapDeps([6,4,5,2]));n=h,s={...l,...l.webgl};break}else if(c==="canvas"){const{CanvasRenderer:h}=await el(async()=>{const{CanvasRenderer:m}=await import("./CanvasRenderer-DAx637pP.js");return{CanvasRenderer:m}},__vite__mapDeps([7,5,2]));n=h,s={...l,...l.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!n)throw new Error("No available renderer for the current environment");const r=new n;return await r.init(s),r}const y0="8.17.1";class x0{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,y0)}static destroy(){}}x0.extension=yt.Application;class Uv{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,y0)}destroy(){this._renderer=null}}Uv.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"initHook",priority:-10};class _0{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,s;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:u}=this._resizeTo;n=r,s=u}this.renderer.resize(n,s),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}}_0.extension=yt.Application;class b0{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,eo.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()}}}b0.extension=yt.Application;Jt.add(_0);Jt.add(b0);const v0=class bh{constructor(...t){this.stage=new De,t[0]!==void 0&&At(Wt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new De),this.renderer=await Gv(t),bh._plugins.forEach(n=>{n.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return At(Wt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){const s=bh._plugins.slice(0);s.reverse(),s.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};v0._plugins=[];let S0=v0;Jt.handleByList(yt.Application,S0._plugins);Jt.add(x0);var eh,kg;function Hv(){if(kg)return eh;kg=1,eh=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=r(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 s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(u){var c=u.match(s);return c?c.map(Number):[]}return eh}var Lv=Hv();const jv=Eh(Lv);function Yv(l,t){const n=jv(l),s=[];let r=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(),s.length>0&&(r=s.pop(),r?(u=r.startX,c=r.startY):(u=0,c=0)),r=null;break;default:ve(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&r===null&&(r={startX:u,startY:c},s.push(r))}return t}class Gh{constructor(t=0,n=0,s=0){this.type="circle",this.x=t,this.y=n,this.radius=s}clone(){return new Gh(this.x,this.y,this.radius)}contains(t,n){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,u=this.y-n;return r*=r,u*=u,r+u<=s}strokeContains(t,n,s,r=.5){if(this.radius===0)return!1;const u=this.x-t,c=this.y-n,h=this.radius,m=(1-r)*s,p=Math.sqrt(u*u+c*c);return p<=h+m&&p>h-(s-m)}getBounds(t){return t||(t=new $t),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 Uh{constructor(t=0,n=0,s=0,r=0){this.type="ellipse",this.x=t,this.y=n,this.halfWidth=s,this.halfHeight=r}clone(){return new Uh(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,r=(n-this.y)/this.halfHeight;return s*=s,r*=r,s+r<=1}strokeContains(t,n,s,r=.5){const{halfWidth:u,halfHeight:c}=this;if(u<=0||c<=0)return!1;const h=s*(1-r),m=s-h,p=u-m,g=c-m,x=u+h,_=c+h,b=t-this.x,T=n-this.y,A=b*b/(p*p)+T*T/(g*g),S=b*b/(x*x)+T*T/(_*_);return A>1&&S<=1}getBounds(t){return t||(t=new $t),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 qv(l,t,n,s,r,u){const c=l-n,h=t-s,m=r-n,p=u-s,g=c*m+h*p,x=m*m+p*p;let _=-1;x!==0&&(_=g/x);let b,T;_<0?(b=n,T=s):_>1?(b=r,T=u):(b=n+_*m,T=s+_*p);const A=l-b,S=t-T;return A*A+S*S}let Xv,Vv;class nl{constructor(...t){this.type="polygon";let n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){const s=[];for(let r=0,u=n.length;r<u;r++)s.push(n[r].x,n[r].y);n=s}this.points=n,this.closePath=!0}isClockwise(){let t=0;const n=this.points,s=n.length;for(let r=0;r<s;r+=2){const u=n[r],c=n[r+1],h=n[(r+2)%s],m=n[(r+3)%s];t+=(h-u)*(m+c)}return t<0}containsPolygon(t){const n=this.getBounds(Xv),s=t.getBounds(Vv);if(!n.containsRect(s))return!1;const r=t.points;for(let u=0;u<r.length;u+=2){const c=r[u],h=r[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 s=!1;const r=this.points.length/2;for(let u=0,c=r-1;u<r;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&&(s=!s)}return s}strokeContains(t,n,s,r=.5){const u=s*s,c=u*(1-r),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],A=qv(t,n,x,_,b,T),S=Math.sign((b-x)*(n-_)-(T-_)*(t-x));if(A<=(S<0?h:c))return!0}return!1}getBounds(t){t||(t=new $t);const n=this.points;let s=1/0,r=-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];s=p<s?p:s,r=p>r?p:r,u=g<u?g:u,c=g>c?g:c}return t.x=s,t.width=r-s,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 At("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return At("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 Wr=(l,t,n,s,r,u,c)=>{const h=l-n,m=t-s,p=Math.sqrt(h*h+m*m);return p>=r-u&&p<=r+c};class Hh{constructor(t=0,n=0,s=0,r=0,u=20){this.type="roundedRectangle",this.x=t,this.y=n,this.width=s,this.height=r,this.radius=u}getBounds(t){return t||(t=new $t),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Hh(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 s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+s&&n<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let r=t-(this.x+s),u=n-(this.y+s);const c=s*s;if(r*r+u*u<=c||(r=t-(this.x+this.width-s),r*r+u*u<=c)||(u=n-(this.y+this.height-s),r*r+u*u<=c)||(r=t-(this.x+s),r*r+u*u<=c))return!0}return!1}strokeContains(t,n,s,r=.5){const{x:u,y:c,width:h,height:m,radius:p}=this,g=s*(1-r),x=s-g,_=u+p,b=c+p,T=h-p*2,A=m-p*2,S=u+h,w=c+m;return(t>=u-g&&t<=u+x||t>=S-x&&t<=S+g)&&n>=b&&n<=b+A||(n>=c-g&&n<=c+x||n>=w-x&&n<=w+g)&&t>=_&&t<=_+T?!0:t<_&&n<b&&Wr(t,n,_,b,p,x,g)||t>S-p&&n<b&&Wr(t,n,S-p,b,p,x,g)||t>S-p&&n>w-p&&Wr(t,n,S-p,w-p,p,x,g)||t<_&&n>w-p&&Wr(t,n,_,w-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 T0={};function Pv(l,t,n){let s=2166136261;for(let r=0;r<t;r++)s^=l[r].uid,s=Math.imul(s,16777619),s>>>=0;return T0[s]||Fv(l,t,s,n)}function Fv(l,t,n,s){const r={};let u=0;for(let h=0;h<s;h++){const m=h<t?l[h]:Gt.EMPTY.source;r[u++]=m.source,r[u++]=m.style}const c=new Jr(r);return T0[n]=c,c}class Gg{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 Ug(l,t,n,s){if(n??(n=0),s??(s=Math.min(l.byteLength-n,t.byteLength)),!(n&7)&&!(s&7)){const r=s/8;new Float64Array(t,0,r).set(new Float64Array(l,n,r))}else if(!(n&3)&&!(s&3)){const r=s/4;new Float32Array(t,0,r).set(new Float32Array(l,n,r))}else new Uint8Array(t).set(new Uint8Array(l,n,s))}const Wv={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var Qv=(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))(Qv||{});function Hg(l,t){return t.alphaMode==="no-premultiply-alpha"&&Wv[l]||l}const Zv=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
72
|
+
`);function Iv(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 Kv(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 s=Zv.replace(/%forloop%/gi,Iv(l));if(t.shaderSource(n,s),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))l=l/2|0;else break}}finally{t.deleteShader(n)}return l}let Hs=null;function $v(){var t;if(Hs)return Hs;const l=t0();return Hs=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Hs=Kv(Hs,l),(t=l.getExtension("WEBGL_lose_context"))==null||t.loseContext(),Hs}class Jv{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 tS{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new Jv,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 io=0;dl.register({clear:()=>{if(sl.length>0)for(const l of sl)l&&l.destroy();sl.length=0,io=0}});function Lg(){return io>0?sl[--io]:new tS}function jg(l){l.elements=null,sl[io++]=l}let Za=0;const w0=class A0{constructor(t){this.uid=Qt("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...A0.defaultOptions,...t},t.maxTextures||(At("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=$v());const{maxTextures:n,attributesInitialSize:s,indicesInitialSize:r}=t;this.attributeBuffer=new Gg(s*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)jg(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 s=t._batch.textures.ids[n._source.uid];return!s&&s!==0?!1:(t._textureId=s,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 s=Lg(),r=s.textures;r.clear();const u=n[this.elementStart];let c=Hg(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 A=this.maxTextures;for(let S=this.elementStart;S<this.elementSize;++S){const w=n[S];n[S]=null;const E=w.texture._source,O=Hg(w.blendMode,E),P=c!==O||h!==w.topology;if(E._batchTick===Za&&!P){w._textureId=E._textureBindLocation,x+=w.indexSize,w.packAsQuad?(this.packQuadAttributes(w,m,p,w._attributeStart,w._textureId),this.packQuadIndex(g,w._indexStart,w._attributeStart/this.vertexSize)):(this.packAttributes(w,m,p,w._attributeStart,w._textureId),this.packIndex(w,g,w._indexStart,w._attributeStart/this.vertexSize)),w._batch=s,T.push(w);continue}E._batchTick=Za,(r.count>=A||P)&&(this._finishBatch(s,_,x-_,r,c,h,t,b,T),b="renderBatch",_=x,c=O,h=w.topology,s=Lg(),r=s.textures,r.clear(),T=[],++Za),w._textureId=E._textureBindLocation=r.count,r.ids[E.uid]=r.count,r.textures[r.count++]=E,w._batch=s,T.push(w),x+=w.indexSize,w.packAsQuad?(this.packQuadAttributes(w,m,p,w._attributeStart,w._textureId),this.packQuadIndex(g,w._indexStart,w._attributeStart/this.vertexSize)):(this.packAttributes(w,m,p,w._attributeStart,w._textureId),this.packIndex(w,g,w._indexStart,w._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(s,_,x-_,r,c,h,t,b,T),_=x,++Za),this.elementStart=this.elementSize,this._batchIndexStart=_,this._batchIndexSize=x}_finishBatch(t,n,s,r,u,c,h,m,p){t.gpuBindGroup=null,t.bindGroup=null,t.action=m,t.batcher=this,t.textures=r,t.blendMode=u,t.topology=c,t.start=n,t.size=s,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),s=new Gg(n);Ug(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(t){const n=this.indexBuffer;let s=Math.max(t,n.length*1.5);s+=s%2;const r=s>65535?new Uint32Array(s):new Uint16Array(s);if(r.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let u=0;u<n.length;u++)r[u]=n[u];else Ug(n.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(t,n,s){t[n]=s+0,t[n+1]=s+1,t[n+2]=s+2,t[n+3]=s+0,t[n+4]=s+2,t[n+5]=s+3}packIndex(t,n,s,r){const u=t.indices,c=t.indexSize,h=t.indexOffset,m=t.attributeOffset;for(let p=0;p<c;p++)n[s++]=r+u[p+h]-m}destroy(t={}){var n;if(this.batches!==null){for(let s=0;s<this.batchIndex;s++)jg(this.batches[s]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let s=0;s<this._elements.length;s++)this._elements[s]&&(this._elements[s]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};w0.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let eS=w0;var ze=(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))(ze||{});class hl extends Si{constructor(t){let{data:n,size:s}=t;const{usage:r,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,s??(s=n==null?void 0:n.byteLength);const h=!!n;this.descriptor={size:s,usage:r,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&ze.STATIC)}set static(t){t?this.descriptor.usage|=ze.STATIC:this.descriptor.usage&=~ze.STATIC}setDataWithSize(t,n,s){if(this._updateID++,this._updateSize=n*t.BYTES_PER_ELEMENT,this._data===t){s&&this.emit("update",this);return}const r=this._data;if(this._data=t,this._dataInt32=null,!r||r.length!==t.length){!this.shrinkToFit&&r&&t.byteLength<r.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=Qt("resource"),this.emit("change",this));return}s&&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 C0(l,t){if(!(l instanceof hl)){let n=t?ze.INDEX:ze.VERTEX;l instanceof Array&&(t?(l=new Uint32Array(l),n=ze.INDEX|ze.COPY_DST):(l=new Float32Array(l),n=ze.VERTEX|ze.COPY_DST)),l=new hl({data:l,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return l}function iS(l,t,n){const s=l.getAttribute(t);if(!s)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const r=s.buffer.data;let u=1/0,c=1/0,h=-1/0,m=-1/0;const p=r.BYTES_PER_ELEMENT,g=(s.offset||0)/p,x=(s.stride||8)/p;for(let _=g;_<r.length;_+=x){const b=r[_],T=r[_+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 nS(l){return(l instanceof hl||Array.isArray(l)||l.BYTES_PER_ELEMENT)&&(l={buffer:l}),l.buffer=C0(l.buffer,!1),l}class sS extends Si{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 ai,this._boundsDirty=!0;const{attributes:n,indexBuffer:s,topology:r}=t;if(this.buffers=[],this.attributes={},n)for(const u in n)this.addAttribute(u,n[u]);this.instanceCount=t.instanceCount??1,s&&this.addIndex(s),this.topology=r||"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 s=nS(n);this.buffers.indexOf(s.buffer)===-1&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=s}addIndex(t){this.indexBuffer=C0(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,iS(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(s=>s.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const aS=new Float32Array(1),lS=new Uint32Array(1);class rS extends sS{constructor(){const n=new hl({data:aS,label:"attribute-batch-buffer",usage:ze.VERTEX|ze.COPY_DST,shrinkToFit:!1}),s=new hl({data:lS,label:"index-batch-buffer",usage:ze.INDEX|ze.COPY_DST,shrinkToFit:!1}),r=24;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:r,offset:0},aUV:{buffer:n,format:"float32x2",stride:r,offset:8},aColor:{buffer:n,format:"unorm8x4",stride:r,offset:16},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:r,offset:20}},indexBuffer:s})}}function Yg(l,t,n){if(l)for(const s in l){const r=s.toLocaleLowerCase(),u=t[r];if(u){let c=l[s];s==="header"&&(c=c.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&u.push(`//----${n}----//`),u.push(c)}else ve(`${s} placement hook does not exist in shader`)}}const oS=/\{\{(.*?)\}\}/g;function qg(l){var s;const t={};return(((s=l.match(oS))==null?void 0:s.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{t[r]=[]}),t}function Xg(l,t){let n;const s=/@in\s+([^;]+);/g;for(;(n=s.exec(l))!==null;)t.push(n[1])}function Vg(l,t,n=!1){const s=[];Xg(t,s),l.forEach(h=>{h.header&&Xg(h.header,s)});const r=s;n&&r.sort();const u=r.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 Pg(l,t){let n;const s=/@out\s+([^;]+);/g;for(;(n=s.exec(l))!==null;)t.push(n[1])}function uS(l){const n=/\b(\w+)\s*:/g.exec(l);return n?n[1]:""}function cS(l){const t=/@.*?\s+/g;return l.replace(t,"")}function hS(l,t){const n=[];Pg(t,n),l.forEach(m=>{m.header&&Pg(m.header,n)});let s=0;const r=n.sort().map(m=>m.indexOf("builtin")>-1?m:`@location(${s++}) ${m}`).join(`,
|
|
77
|
+
`),u=n.sort().map(m=>` var ${cS(m)};`).join(`
|
|
78
|
+
`),c=`return VSOutput(
|
|
79
|
+
${n.sort().map(m=>` ${uS(m)}`).join(`,
|
|
80
|
+
`)});`;let h=t.replace(/@out\s+[^;]+;\s*/g,"");return h=h.replace("{{struct}}",`
|
|
81
|
+
${r}
|
|
82
|
+
`),h=h.replace("{{start}}",`
|
|
83
|
+
${u}
|
|
84
|
+
`),h=h.replace("{{return}}",`
|
|
85
|
+
${c}
|
|
86
|
+
`),h}function Fg(l,t){let n=l;for(const s in t){const r=t[s];r.join(`
|
|
87
|
+
`).length?n=n.replace(`{{${s}}}`,`//-----${s} START-----//
|
|
88
|
+
${r.join(`
|
|
89
|
+
`)}
|
|
90
|
+
//----${s} FINISH----//`):n=n.replace(`{{${s}}}`,"")}return n}const Tn=Object.create(null),ih=new Map;let fS=0;function dS({template:l,bits:t}){const n=M0(l,t);if(Tn[n])return Tn[n];const{vertex:s,fragment:r}=pS(l,t);return Tn[n]=E0(s,r,t),Tn[n]}function mS({template:l,bits:t}){const n=M0(l,t);return Tn[n]||(Tn[n]=E0(l.vertex,l.fragment,t)),Tn[n]}function pS(l,t){const n=t.map(c=>c.vertex).filter(c=>!!c),s=t.map(c=>c.fragment).filter(c=>!!c);let r=Vg(n,l.vertex,!0);r=hS(n,r);const u=Vg(s,l.fragment,!0);return{vertex:r,fragment:u}}function M0(l,t){return t.map(n=>(ih.has(n)||ih.set(n,fS++),ih.get(n))).sort((n,s)=>n-s).join("-")+l.vertex+l.fragment}function E0(l,t,n){const s=qg(l),r=qg(t);return n.forEach(u=>{Yg(u.vertex,s,u.name),Yg(u.fragment,r,u.name)}),{vertex:Fg(l,s),fragment:Fg(t,r)}}const gS=`
|
|
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
|
+
`,yS=`
|
|
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
|
+
`,xS=`
|
|
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
|
+
`,_S=`
|
|
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
|
+
`,bS={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
|
+
`}},vS={name:"global-uniforms-bit",vertex:{header:`
|
|
224
|
+
uniform mat3 uProjectionMatrix;
|
|
225
|
+
uniform mat3 uWorldTransformMatrix;
|
|
226
|
+
uniform vec4 uWorldColorAlpha;
|
|
227
|
+
uniform vec2 uResolution;
|
|
228
|
+
`}};function SS({bits:l,name:t}){const n=dS({template:{fragment:yS,vertex:gS},bits:[bS,...l]});return oo.from({name:t,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function TS({bits:l,name:t}){return new i0({name:t,...mS({template:{vertex:xS,fragment:_S},bits:[vS,...l]})})}const wS={name:"color-bit",vertex:{header:`
|
|
229
|
+
@in aColor: vec4<f32>;
|
|
230
|
+
`,main:`
|
|
231
|
+
vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
|
|
232
|
+
`}},AS={name:"color-bit",vertex:{header:`
|
|
233
|
+
in vec4 aColor;
|
|
234
|
+
`,main:`
|
|
235
|
+
vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
|
|
236
|
+
`}},nh={};function CS(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 s=0;s<l;s++)t.push(`@group(1) @binding(${n++}) var textureSource${s+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${n++}) var textureSampler${s+1}: sampler;`)}return t.join(`
|
|
237
|
+
`)}function MS(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 ES(l){return nh[l]||(nh[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
|
+
${CS(l)}
|
|
252
|
+
`,main:`
|
|
253
|
+
var uvDx = dpdx(vUV);
|
|
254
|
+
var uvDy = dpdy(vUV);
|
|
255
|
+
|
|
256
|
+
${MS(l)}
|
|
257
|
+
`}}),nh[l]}const sh={};function RS(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 zS(l){return sh[l]||(sh[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
|
+
${RS(l)}
|
|
277
|
+
`}}),sh[l]}const DS={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
|
+
`}},BS={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
|
+
`}},Wg={};function OS(l){let t=Wg[l];if(t)return t;const n=new Int32Array(l);for(let s=0;s<l;s++)n[s]=s;return t=Wg[l]=new l0({uTextures:{value:n,type:"i32",size:l}},{isStatic:!0}),t}class Qg extends kh{constructor(t){const n=TS({name:"batch",bits:[AS,zS(t),BS]}),s=SS({name:"batch",bits:[wS,ES(t),DS]});super({glProgram:n,gpuProgram:s,resources:{batchSamplers:OS(t)}}),this.maxTextures=t}}let Ia=null;const R0=class z0 extends eS{constructor(t){super(t),this.geometry=new rS,this.name=z0.extension.name,this.vertexSize=6,Ia??(Ia=new Qg(t.maxTextures)),this.shader=Ia}packAttributes(t,n,s,r,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:A}=t,S=t.color,w=t.attributeOffset,C=w+t.attributeSize;for(let E=w;E<C;E++){const O=E*2,P=T[O],k=T[O+1];n[r++]=m*P+g*k+_,n[r++]=x*k+p*P+b,n[r++]=A[O],n[r++]=A[O+1],s[r++]=S,s[r++]=c}}packQuadAttributes(t,n,s,r,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,A=T.maxX,S=T.minX,w=T.maxY,C=T.minY,E=c.uvs,O=t.color,P=u<<16|t.roundPixels&65535;n[r+0]=m*S+g*C+_,n[r+1]=x*C+p*S+b,n[r+2]=E.x0,n[r+3]=E.y0,s[r+4]=O,s[r+5]=P,n[r+6]=m*A+g*C+_,n[r+7]=x*C+p*A+b,n[r+8]=E.x1,n[r+9]=E.y1,s[r+10]=O,s[r+11]=P,n[r+12]=m*A+g*w+_,n[r+13]=x*w+p*A+b,n[r+14]=E.x2,n[r+15]=E.y2,s[r+16]=O,s[r+17]=P,n[r+18]=m*S+g*w+_,n[r+19]=x*w+p*S+b,n[r+20]=E.x3,n[r+21]=E.y3,s[r+22]=O,s[r+23]=P}_updateMaxTextures(t){this.shader.maxTextures!==t&&(Ia=new Qg(t),this.shader=Ia)}destroy(){this.shader=null,super.destroy()}};R0.extension={type:[yt.Batcher],name:"default"};let NS=R0;class ml{constructor(t){this.items=Object.create(null);const{renderer:n,type:s,onUnload:r,priority:u,name:c}=t;this._renderer=n,n.gc.addResourceHash(this,"items",s,u??0),this._onUnload=r,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 r;if(!this.items[t.uid])return;const s=t._gpuData[this._renderer.uid];s&&((r=this._onUnload)==null||r.call(this,t,...n),s.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 kS(l,t,n,s,r,u,c,h=null){let m=0;n*=t,r*=u;const p=h.a,g=h.b,x=h.c,_=h.d,b=h.tx,T=h.ty;for(;m<c;){const A=l[n],S=l[n+1];s[r]=p*A+x*S+b,s[r+1]=g*A+_*S+T,r+=u,n+=t,m++}}function GS(l,t,n,s){let r=0;for(t*=n;r<s;)l[t]=0,l[t+1]=0,t+=n,r++}function D0(l,t,n,s,r){const u=t.a,c=t.b,h=t.c,m=t.d,p=t.tx,g=t.ty;n||(n=0),s||(s=2),r||(r=l.length/s-n);let x=n*s;for(let _=0;_<r;_++){const b=l[x],T=l[x+1];l[x]=u*b+h*T+p,l[x+1]=c*b+m*T+g,x+=s}}const US=new St;class Lh{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,s=this.renderable;return s?ky(n,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):n+(this.alpha*255<<24)}get transform(){var t;return((t=this.renderable)==null?void 0:t.groupTransform)||US}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,s,r,u,c,h;if(l.type==="circle"){const O=l;if(c=h=O.radius,c<=0)return!1;n=O.x,s=O.y,r=u=0}else if(l.type==="ellipse"){const O=l;if(c=O.halfWidth,h=O.halfHeight,c<=0||h<=0)return!1;n=O.x,s=O.y,r=u=0}else{const O=l,P=O.width/2,k=O.height/2;n=O.x+P,s=O.y+k,c=h=Math.max(0,Math.min(O.radius,Math.min(P,k))),r=P-c,u=k-h}if(r<0||u<0)return!1;const m=Math.ceil(2.3*Math.sqrt(c+h)),p=m*8+(r?4:0)+(u?4:0);if(p===0)return!1;if(m===0)return t[0]=t[6]=n+r,t[1]=t[3]=s+u,t[2]=t[4]=n-r,t[5]=t[7]=s-u,!0;let g=0,x=m*4+(r?2:0)+2,_=x,b=p,T=r+c,A=u,S=n+T,w=n-T,C=s+A;if(t[g++]=S,t[g++]=C,t[--x]=C,t[--x]=w,u){const O=s-A;t[_++]=w,t[_++]=O,t[--b]=O,t[--b]=S}for(let O=1;O<m;O++){const P=Math.PI/2*(O/m),k=r+Math.cos(P)*c,N=u+Math.sin(P)*h,$=n+k,Q=n-k,Z=s+N,I=s-N;t[g++]=$,t[g++]=Z,t[--x]=Z,t[--x]=Q,t[_++]=Q,t[_++]=I,t[--b]=I,t[--b]=$}T=r,A=u+h,S=n+T,w=n-T,C=s+A;const E=s-A;return t[g++]=S,t[g++]=C,t[--b]=E,t[--b]=S,r&&(t[g++]=w,t[g++]=C,t[--b]=E,t[--b]=w),!0},triangulate(l,t,n,s,r,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=s;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&&(r[u++]=m,r[u++]=p,r[u++]=m-1),m++;r[u++]=p+1,r[u++]=p,r[u++]=m-1}},HS={...fl,extension:{...fl.extension,name:"ellipse"}},LS={...fl,extension:{...fl.extension,name:"roundedRectangle"}},B0=1e-4,Zg=1e-4;function jS(l){const t=l.length;if(t<6)return 1;let n=0;for(let s=0,r=l[t-2],u=l[t-1];s<t;s+=2){const c=l[s],h=l[s+1];n+=(c-r)*(h+u),r=c,u=h}return n<0?-1:1}function Ig(l,t,n,s,r,u,c,h){const m=l-n*r,p=t-s*r,g=l+n*u,x=t+s*u;let _,b;c?(_=s,b=-n):(_=-s,b=n);const T=m+_,A=p+b,S=g+_,w=x+b;return h.push(T,A),h.push(S,w),2}function Xn(l,t,n,s,r,u,c,h){const m=n-l,p=s-t;let g=Math.atan2(m,p),x=Math.atan2(r-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),A=Math.sqrt(m*m+p*p),S=(15*T*Math.sqrt(A)/Math.PI>>0)+1,w=b/S;if(_+=w,h){c.push(l,t),c.push(n,s);for(let C=1,E=_;C<S;C++,E+=w)c.push(l,t),c.push(l+Math.sin(E)*A,t+Math.cos(E)*A);c.push(l,t),c.push(r,u)}else{c.push(n,s),c.push(l,t);for(let C=1,E=_;C<S;C++,E+=w)c.push(l+Math.sin(E)*A,t+Math.cos(E)*A),c.push(l,t);c.push(r,u),c.push(l,t)}return S*2}function YS(l,t,n,s,r,u){const c=B0;if(l.length===0)return;const h=t;let m=h.alignment;if(t.alignment!==.5){let K=jS(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=s,_=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=r,T=l.length/2;let A=l.length;const S=b.length/2,w=h.width/2,C=w*w,E=h.miterLimit*h.miterLimit;let O=l[0],P=l[1],k=l[2],N=l[3],$=0,Q=0,Z=-(P-N),I=O-k,tt=0,it=0,nt=Math.sqrt(Z*Z+I*I);Z/=nt,I/=nt,Z*=w,I*=w;const wt=m,D=(1-wt)*2,L=wt*2;x||(h.cap==="round"?A+=Xn(O-Z*(D-L)*.5,P-I*(D-L)*.5,O-Z*D,P-I*D,O+Z*L,P+I*L,b,!0)+2:h.cap==="square"&&(A+=Ig(O,P,Z,I,D,L,!0,b))),b.push(O-Z*D,P-I*D),b.push(O+Z*L,P+I*L);for(let K=1;K<T-1;++K){O=l[(K-1)*2],P=l[(K-1)*2+1],k=l[K*2],N=l[K*2+1],$=l[(K+1)*2],Q=l[(K+1)*2+1],Z=-(P-N),I=O-k,nt=Math.sqrt(Z*Z+I*I),Z/=nt,I/=nt,Z*=w,I*=w,tt=-(N-Q),it=k-$,nt=Math.sqrt(tt*tt+it*it),tt/=nt,it/=nt,tt*=w,it*=w;const at=k-O,R=P-N,Y=k-$,W=Q-N,J=at*Y+R*W,rt=R*Y-W*at,ct=rt<0;if(Math.abs(rt)<.001*Math.abs(J)){b.push(k-Z*D,N-I*D),b.push(k+Z*L,N+I*L),J>=0&&(h.join==="round"?A+=Xn(k,N,k-Z*D,N-I*D,k-tt*D,N-it*D,b,!1)+4:A+=2,b.push(k-tt*L,N-it*L),b.push(k+tt*D,N+it*D));continue}const ft=(-Z+O)*(-I+N)-(-Z+k)*(-I+P),Lt=(-tt+$)*(-it+N)-(-tt+k)*(-it+Q),Et=(at*Lt-Y*ft)/rt,Fe=(W*ft-R*Lt)/rt,Qi=(Et-k)*(Et-k)+(Fe-N)*(Fe-N),ri=k+(Et-k)*D,pi=N+(Fe-N)*D,ye=k-(Et-k)*L,oi=N-(Fe-N)*L,Is=Math.min(at*at+R*R,Y*Y+W*W),pl=ct?D:L,gl=Is+pl*pl*C;Qi<=gl?h.join==="bevel"||Qi/C>E?(ct?(b.push(ri,pi),b.push(k+Z*L,N+I*L),b.push(ri,pi),b.push(k+tt*L,N+it*L)):(b.push(k-Z*D,N-I*D),b.push(ye,oi),b.push(k-tt*D,N-it*D),b.push(ye,oi)),A+=2):h.join==="round"?ct?(b.push(ri,pi),b.push(k+Z*L,N+I*L),A+=Xn(k,N,k+Z*L,N+I*L,k+tt*L,N+it*L,b,!0)+4,b.push(ri,pi),b.push(k+tt*L,N+it*L)):(b.push(k-Z*D,N-I*D),b.push(ye,oi),A+=Xn(k,N,k-Z*D,N-I*D,k-tt*D,N-it*D,b,!1)+4,b.push(k-tt*D,N-it*D),b.push(ye,oi)):(b.push(ri,pi),b.push(ye,oi)):(b.push(k-Z*D,N-I*D),b.push(k+Z*L,N+I*L),h.join==="round"?ct?A+=Xn(k,N,k+Z*L,N+I*L,k+tt*L,N+it*L,b,!0)+2:A+=Xn(k,N,k-Z*D,N-I*D,k-tt*D,N-it*D,b,!1)+2:h.join==="miter"&&Qi/C<=E&&(ct?(b.push(ye,oi),b.push(ye,oi)):(b.push(ri,pi),b.push(ri,pi)),A+=2),b.push(k-tt*D,N-it*D),b.push(k+tt*L,N+it*L),A+=2)}O=l[(T-2)*2],P=l[(T-2)*2+1],k=l[(T-1)*2],N=l[(T-1)*2+1],Z=-(P-N),I=O-k,nt=Math.sqrt(Z*Z+I*I),Z/=nt,I/=nt,Z*=w,I*=w,b.push(k-Z*D,N-I*D),b.push(k+Z*L,N+I*L),x||(h.cap==="round"?A+=Xn(k-Z*(D-L)*.5,N-I*(D-L)*.5,k-Z*D,N-I*D,k+Z*L,N+I*L,b,!1)+2:h.cap==="square"&&(A+=Ig(k,N,Z,I,D,L,!1,b)));const et=Zg*Zg;for(let K=S;K<A+S-2;++K)O=b[K*2],P=b[K*2+1],k=b[(K+1)*2],N=b[(K+1)*2+1],$=b[(K+2)*2],Q=b[(K+2)*2+1],!(Math.abs(O*(N-Q)+k*(Q-P)+$*(P-N))<et)&&u.push(K,K+1,K+2)}function qS(l,t,n,s){const r=B0;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)<r&&Math.abs(c-m)<r,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++)s.push(_+b,_+b+1);p&&s.push(_+x-1,_)}function O0(l,t,n,s,r,u,c){const h=Dv(l,t,2);if(!h)return;for(let p=0;p<h.length;p+=3)u[c++]=h[p]+r,u[c++]=h[p+1]+r,u[c++]=h[p+2]+r;let m=r*s;for(let p=0;p<l.length;p+=2)n[m]=l[p],n[m+1]=l[p+1],m+=s}const XS=[],VS={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,s,r,u){O0(l,XS,t,n,s,r,u)}},PS={extension:{type:yt.ShapeBuilder,name:"rectangle"},build(l,t){const n=l,s=n.x,r=n.y,u=n.width,c=n.height;return u>0&&c>0?(t[0]=s,t[1]=r,t[2]=s+u,t[3]=r,t[4]=s+u,t[5]=r+c,t[6]=s,t[7]=r+c,!0):!1},triangulate(l,t,n,s,r,u){let c=0;s*=n,t[s+c]=l[0],t[s+c+1]=l[1],c+=n,t[s+c]=l[2],t[s+c+1]=l[3],c+=n,t[s+c]=l[6],t[s+c+1]=l[7],c+=n,t[s+c]=l[4],t[s+c+1]=l[5],c+=n;const h=s/n;r[u++]=h,r[u++]=h+1,r[u++]=h+2,r[u++]=h+1,r[u++]=h+3,r[u++]=h+2}},FS={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,s,r,u){let c=0;s*=n,t[s+c]=l[0],t[s+c+1]=l[1],c+=n,t[s+c]=l[2],t[s+c+1]=l[3],c+=n,t[s+c]=l[4],t[s+c+1]=l[5];const h=s/n;r[u++]=h,r[u++]=h+1,r[u++]=h+2}},Kg=[{offset:0,color:"white"},{offset:1,color:"black"}],jh=class vh{constructor(...t){this.uid=Qt("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=WS(t);n={...n.type==="radial"?vh.defaultRadialOptions:vh.defaultLinearOptions,...wy(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(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(t,n){return this.colorStops.push({offset:t,color:ae.shared.setValue(n).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:n}=this.start,{x:s,y:r}=this.end,u=s-t,c=r-n;const h=u<0||c<0;if(this._wrapMode==="clamp-to-edge"){if(u<0){const S=t;t=s,s=S,u*=-1}if(c<0){const S=n;n=r,r=S,c*=-1}}const m=this.colorStops.length?this.colorStops:Kg,p=this._textureSize,{canvas:g,context:x}=Jg(p,1),_=h?x.createLinearGradient(this._textureSize,0,0,0):x.createLinearGradient(0,0,this._textureSize,0);$g(_,m),x.fillStyle=_,x.fillRect(0,0,p,1),this.texture=new Gt({source:new to({resource:g,addressMode:this._wrapMode})});const b=Math.sqrt(u*u+c*c),T=Math.atan2(c,u),A=new St;A.scale(b/p,1),A.rotate(T),A.translate(t,n),this.textureSpace==="local"&&A.scale(p,p),this.transform=A}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:Kg,n=this._textureSize,{canvas:s,context:r}=Jg(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,A=(c-_)*b,S=r.createRadialGradient(T,A,p*b,(h-x)*b,(m-_)*b,g*b);$g(S,t),r.fillStyle=t[t.length-1].color,r.fillRect(0,0,n,n),r.fillStyle=S,r.translate(T,A),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-T,-A),r.fillRect(0,0,n,n),this.texture=new Gt({source:new to({resource:s,addressMode:this._wrapMode})});const w=new St;w.scale(1/b,1/b),w.translate(x,_),this.textureSpace==="local"&&w.scale(n,n),this.transform=w}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}`}};jh.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};jh.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let Fi=jh;function $g(l,t){for(let n=0;n<t.length;n++){const s=t[n];l.addColorStop(s.offset,s.color)}}function Jg(l,t){const n=Pe.get().createCanvas(l,t),s=n.getContext("2d");return{canvas:n,context:s}}function WS(l){let t=l[0]??{};return(typeof t=="number"||l[1])&&(At("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]??Fi.defaultLinearOptions.textureSize}),t}const QS=new St,ZS=new $t;function IS(l,t,n,s){const r=t.matrix?l.copyFrom(t.matrix).invert():l.identity();if(t.textureSpace==="local"){const c=n.getBounds(ZS);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=r.a,T=r.b,A=r.c,S=r.d;r.a*=p,r.b*=p,r.c*=g,r.d*=g,r.tx=x*b+_*A+r.tx,r.ty=x*T+_*S+r.ty}else r.translate(t.texture.frame.x,t.texture.frame.y),r.scale(1/t.texture.source.width,1/t.texture.source.height);const u=t.texture.source.style;return!(t.fill instanceof Fi)&&u.addressMode==="clamp-to-edge"&&(u.addressMode="repeat",u.update()),s&&r.append(QS.copyFrom(s).invert()),r}const uo={};Jt.handleByMap(yt.ShapeBuilder,uo);Jt.add(PS,VS,FS,fl,HS,LS);const KS=new $t,$S=new St;function JS(l,t){const{geometryData:n,batches:s}=t;s.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let r=0;r<l.instructions.length;r++){const u=l.instructions[r];if(u.action==="texture")t2(u.data,s,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&&ty(p.shapePath,m,!0,s,n),p&&(h.shapePrimitives[h.shapePrimitives.length-1].holes=p.shapePath.shapePrimitives),ty(h,m,c,s,n)}}}function t2(l,t,n){const s=[],r=uo.rectangle,u=KS;u.x=l.dx,u.y=l.dy,u.width=l.dw,u.height=l.dh;const c=l.transform;if(!r.build(u,s))return;const{vertices:h,uvs:m,indices:p}=n,g=p.length,x=h.length/2;c&&D0(s,c),r.triangulate(s,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=Be.get(Lh);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 ty(l,t,n,s,r){const{vertices:u,uvs:c,indices:h}=r;l.shapePrimitives.forEach(({shape:m,transform:p,holes:g})=>{const x=[],_=uo[m.type];if(!_.build(m,x))return;const b=h.length,T=u.length/2;let A="triangle-list";if(p&&D0(x,p),n){const E=m.closePath??!0,O=t;O.pixelLine?(qS(x,E,u,h),A="line-list"):YS(x,O,!1,E,u,h)}else if(g){const E=[],O=x.slice();e2(g).forEach(k=>{E.push(O.length/2),O.push(...k)}),O0(O,E,u,2,T,h,b)}else _.triangulate(x,u,2,T,h,b);const S=c.length/2,w=t.texture;if(w!==Gt.WHITE){const E=IS($S,t,m,p);kS(u,2,T,c,S,2,u.length/2-T,E)}else GS(c,S,2,u.length/2-T);const C=Be.get(Lh);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=w,C.geometryData=r,C.topology=A,s.push(C)})}function e2(l){const t=[];for(let n=0;n<l.length;n++){const s=l[n].shape,r=[];uo[s.type].build(s,r)&&t.push(r)}return t}class i2{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{Be.return(t)}),this.graphicsData&&Be.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 n2{constructor(){this.instructions=new Bh}init(t){const n=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new NS({maxTextures:n}),this.instructions.reset()}get geometry(){return At(J1,"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 Yh=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 t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=!!t._gpuData[this._renderer.uid],s=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!n){n&&s.reset(),JS(t,s);const r=t.batchMode;t.customShader||r==="no-batch"?s.isBatchable=!1:r==="auto"?s.isBatchable=s.geometryData.vertices.length<400:s.isBatchable=!0,t.dirty=!1}return s}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=Be.get(n2,{maxTextures:this._renderer.limits.maxBatchableTextures}),s=t._gpuData[this._renderer.uid],{batches:r,geometryData:u}=s;s.graphicsData=n;const c=u.vertices.length,h=u.indices.length;for(let x=0;x<r.length;x++)r[x].applyTransform=!1;const m=n.batcher;m.ensureAttributeBuffer(c),m.ensureIndexBuffer(h),m.begin();for(let x=0;x<r.length;x++){const _=r[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=Pv(_.textures.textures,_.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(t){const n=new i2;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Yh.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"graphicsContext"};Yh.defaultOptions={bezierSmoothness:.5};let qh=Yh;const s2=8,Qr=11920929e-14,a2=1;function N0(l,t,n,s,r,u,c,h,m,p){const x=Math.min(.99,Math.max(0,p??qh.defaultOptions.bezierSmoothness));let _=(a2-x)/1;return _*=_,l2(t,n,s,r,u,c,h,m,l,_),l}function l2(l,t,n,s,r,u,c,h,m,p){Th(l,t,n,s,r,u,c,h,m,p,0),m.push(c,h)}function Th(l,t,n,s,r,u,c,h,m,p,g){if(g>s2)return;const x=(l+n)/2,_=(t+s)/2,b=(n+r)/2,T=(s+u)/2,A=(r+c)/2,S=(u+h)/2,w=(x+b)/2,C=(_+T)/2,E=(b+A)/2,O=(T+S)/2,P=(w+E)/2,k=(C+O)/2;if(g>0){let N=c-l,$=h-t;const Q=Math.abs((n-c)*$-(s-h)*N),Z=Math.abs((r-c)*$-(u-h)*N);if(Q>Qr&&Z>Qr){if((Q+Z)*(Q+Z)<=p*(N*N+$*$)){m.push(P,k);return}}else if(Q>Qr){if(Q*Q<=p*(N*N+$*$)){m.push(P,k);return}}else if(Z>Qr){if(Z*Z<=p*(N*N+$*$)){m.push(P,k);return}}else if(N=P-(l+c)/2,$=k-(t+h)/2,N*N+$*$<=p){m.push(P,k);return}}Th(l,t,x,_,w,C,P,k,m,p,g+1),Th(P,k,E,O,A,S,c,h,m,p,g+1)}const r2=8,o2=11920929e-14,u2=1;function c2(l,t,n,s,r,u,c,h){const p=Math.min(.99,Math.max(0,h??qh.defaultOptions.bezierSmoothness));let g=(u2-p)/1;return g*=g,h2(t,n,s,r,u,c,l,g),l}function h2(l,t,n,s,r,u,c,h){wh(c,l,t,n,s,r,u,h,0),c.push(r,u)}function wh(l,t,n,s,r,u,c,h,m){if(m>r2)return;const p=(t+s)/2,g=(n+r)/2,x=(s+u)/2,_=(r+c)/2,b=(p+x)/2,T=(g+_)/2;let A=u-t,S=c-n;const w=Math.abs((s-u)*S-(r-c)*A);if(w>o2){if(w*w<=h*(A*A+S*S)){l.push(b,T);return}}else if(A=b-(t+u)/2,S=T-(n+c)/2,A*A+S*S<=h){l.push(b,T);return}wh(l,t,n,p,g,b,T,h,m+1),wh(l,b,T,x,_,u,c,h,m+1)}function k0(l,t,n,s,r,u,c,h){let m=Math.abs(r-u);(!c&&r>u||c&&u>r)&&(m=2*Math.PI-m),h||(h=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(m/Math.PI)))),h=Math.max(h,3);let p=m/h,g=r;p*=c?-1:1;for(let x=0;x<h+1;x++){const _=Math.cos(g),b=Math.sin(g),T=t+_*s,A=n+b*s;l.push(T,A),g+=p}}function f2(l,t,n,s,r,u){const c=l[l.length-2],m=l[l.length-1]-n,p=c-t,g=r-n,x=s-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,A=m*g+p*x,S=u*Math.sqrt(b)/_,w=u*Math.sqrt(T)/_,C=S*A/b,E=w*A/T,O=S*x+w*p,P=S*g+w*m,k=p*(w+C),N=m*(w+C),$=x*(S+E),Q=g*(S+E),Z=Math.atan2(N-P,k-O),I=Math.atan2(Q-P,$-O);k0(l,O+t,P+n,u,Z,I,p*g>x*m)}const al=Math.PI*2,ah={centerX:0,centerY:0,ang1:0,ang2:0},lh=({x:l,y:t},n,s,r,u,c,h,m)=>{l*=n,t*=s;const p=r*l-u*t,g=u*l+r*t;return m.x=p+c,m.y=g+h,m};function d2(l,t){const n=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:n,r=Math.cos(l),u=Math.sin(l),c=Math.cos(l+t),h=Math.sin(l+t);return[{x:r-u*s,y:u+r*s},{x:c+h*s,y:h-c*s},{x:c,y:h}]}const ey=(l,t,n,s)=>{const r=l*s-t*n<0?-1:1;let u=l*n+t*s;return u>1&&(u=1),u<-1&&(u=-1),r*Math.acos(u)},m2=(l,t,n,s,r,u,c,h,m,p,g,x,_)=>{const b=Math.pow(r,2),T=Math.pow(u,2),A=Math.pow(g,2),S=Math.pow(x,2);let w=b*T-b*S-T*A;w<0&&(w=0),w/=b*S+T*A,w=Math.sqrt(w)*(c===h?-1:1);const C=w*r/u*x,E=w*-u/r*g,O=p*C-m*E+(l+n)/2,P=m*C+p*E+(t+s)/2,k=(g-C)/r,N=(x-E)/u,$=(-g-C)/r,Q=(-x-E)/u,Z=ey(1,0,k,N);let I=ey(k,N,$,Q);h===0&&I>0&&(I-=al),h===1&&I<0&&(I+=al),_.centerX=O,_.centerY=P,_.ang1=Z,_.ang2=I};function p2(l,t,n,s,r,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-s)/2+g*(n-r)/2,b=-g*(t-s)/2+x*(n-r)/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)),m2(t,n,s,r,u,c,m,p,g,x,_,b,ah);let{ang1:A,ang2:S}=ah;const{centerX:w,centerY:C}=ah;let E=Math.abs(S)/(al/4);Math.abs(1-E)<1e-7&&(E=1);const O=Math.max(Math.ceil(E),1);S/=O;let P=l[l.length-2],k=l[l.length-1];const N={x:0,y:0};for(let $=0;$<O;$++){const Q=d2(A,S),{x:Z,y:I}=lh(Q[0],u,c,x,g,w,C,N),{x:tt,y:it}=lh(Q[1],u,c,x,g,w,C,N),{x:nt,y:wt}=lh(Q[2],u,c,x,g,w,C,N);N0(l,P,k,Z,I,tt,it,nt,wt),P=nt,k=wt,A+=S}}function g2(l,t,n){const s=(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:_}},r=(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){r(c,h),u=h;continue}const p=t[(c+1)%t.length],g=s(h,u),x=s(h,p);if(g.len<1e-4||x.len<1e-4){r(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 A=_/2;let S,w=Math.abs(Math.cos(A)*m/Math.sin(A));w>Math.min(g.len/2,x.len/2)?(w=Math.min(g.len/2,x.len/2),S=Math.abs(w*Math.sin(A)/Math.cos(A))):S=m;const C=h.x+x.nx*w+-x.ny*S*b,E=h.y+x.ny*w+x.nx*S*b,O=Math.atan2(g.ny,g.nx)+Math.PI/2*b,P=Math.atan2(x.ny,x.nx)-Math.PI/2*b;c===0&&l.moveTo(C+Math.cos(O)*S,E+Math.sin(O)*S),l.arc(C,E,S,O,P,T),u=h}}function y2(l,t,n,s){const r=(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],_=r(g,m);let b;if(_<1e-4)b=m;else{const S=Math.min(_/2,p);b=u(m,g,S/_)}const T=r(x,m);let A;if(T<1e-4)A=m;else{const S=Math.min(T/2,p);A=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,A.x,A.y,s)}}const x2=new $t;class _2{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new ai,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,n){return this.startPoly(t,n),this}lineTo(t,n){this._ensurePoly();const s=this._currentPoly.points,r=s[s.length-2],u=s[s.length-1];return(r!==t||u!==n)&&s.push(t,n),this}arc(t,n,s,r,u,c){this._ensurePoly(!1);const h=this._currentPoly.points;return k0(h,t,n,s,r,u,c),this}arcTo(t,n,s,r,u){this._ensurePoly();const c=this._currentPoly.points;return f2(c,t,n,s,r,u),this}arcToSvg(t,n,s,r,u,c,h){const m=this._currentPoly.points;return p2(m,this._currentPoly.lastX,this._currentPoly.lastY,c,h,t,n,s,r,u),this}bezierCurveTo(t,n,s,r,u,c,h){this._ensurePoly();const m=this._currentPoly;return N0(this._currentPoly.points,m.lastX,m.lastY,t,n,s,r,u,c,h),this}quadraticCurveTo(t,n,s,r,u){this._ensurePoly();const c=this._currentPoly;return c2(this._currentPoly.points,c.lastX,c.lastY,t,n,s,r,u),this}closePath(){return this.endPoly(!0),this}addPath(t,n){this.endPoly(),n&&!n.isIdentity()&&(t=t.clone(!0),t.transform(n));const s=this.shapePrimitives,r=s.length;for(let u=0;u<t.instructions.length;u++){const c=t.instructions[u];this[c.action](...c.data)}if(t.checkForHoles&&s.length-r>1){let u=null;for(let c=r;c<s.length;c++){const h=s[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),s.copyWithin(c,c+1),s.length--,c--):u=h}}}return this}finish(t=!1){this.endPoly(t)}rect(t,n,s,r,u){return this.drawShape(new $t(t,n,s,r),u),this}circle(t,n,s,r){return this.drawShape(new Gh(t,n,s),r),this}poly(t,n,s){const r=new nl(t);return r.closePath=n,this.drawShape(r,s),this}regularPoly(t,n,s,r,u=0,c){r=Math.max(r|0,3);const h=-1*Math.PI/2+u,m=Math.PI*2/r,p=[];for(let g=0;g<r;g++){const x=h-g*m;p.push(t+s*Math.cos(x),n+s*Math.sin(x))}return this.poly(p,!0,c),this}roundPoly(t,n,s,r,u,c=0,h){if(r=Math.max(r|0,3),u<=0)return this.regularPoly(t,n,s,r,c);const m=s*Math.sin(Math.PI/r)-.001;u=Math.min(u,m);const p=-1*Math.PI/2+c,g=Math.PI*2/r,x=(r-2)*Math.PI/r/2;for(let _=0;_<r;_++){const b=_*g+p,T=t+s*Math.cos(b),A=n+s*Math.sin(b),S=b+Math.PI+x,w=b-Math.PI-x,C=T+u*Math.cos(S),E=A+u*Math.sin(S),O=T+u*Math.cos(w),P=A+u*Math.sin(w);_===0?this.moveTo(C,E):this.lineTo(C,E),this.quadraticCurveTo(T,A,O,P,h)}return this.closePath()}roundShape(t,n,s=!1,r){return t.length<3?this:(s?y2(this,t,n,r):g2(this,t,n),this.closePath())}filletRect(t,n,s,r,u){if(u===0)return this.rect(t,n,s,r);const c=Math.min(s,r)/2,h=Math.min(c,Math.max(-c,u)),m=t+s,p=n+r,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+s-x,p,x).lineTo(t+x,p).arcTo(t+g,p-g,t,p-x,x).closePath()}chamferRect(t,n,s,r,u,c){if(u<=0)return this.rect(t,n,s,r);const h=Math.min(u,Math.min(s,r)/2),m=t+s,p=n+r,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,s,r,u){return this.drawShape(new Uh(t,n,s,r),u),this}roundRect(t,n,s,r,u,c){return this.drawShape(new Hh(t,n,s,r,u),c),this}drawShape(t,n){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:n}),this}startPoly(t,n){let s=this._currentPoly;return s&&this.endPoly(),s=new nl,s.points.push(t,n),this._currentPoly=s,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 s=n.shape.x,r=n.shape.y;if(n.transform&&!n.transform.isIdentity()){const u=n.transform,c=s;s=u.a*s+u.c*r+u.tx,r=u.b*c+u.d*r+u.ty}this._currentPoly.points.push(s,r)}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 s=t.instructions[n];this[s.action](...s.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const n=this.shapePrimitives;for(let s=0;s<n.length;s++){const r=n[s],u=r.shape.getBounds(x2);r.transform?t.addRect(u,r.transform):t.addRect(u)}return t}}class Pi{constructor(t,n=!1){this.instructions=[],this.uid=Qt("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof t=="string"?Yv(t,this):this.instructions=(t==null?void 0:t.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new _2(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,s,r,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,s,r,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,s){const r=this.instructions[this.instructions.length-1],u=this.getLastPoint(ge.shared);let c=0,h=0;if(!r||r.action!=="quadraticCurveTo")c=u.x,h=u.y;else{c=r.data[0],h=r.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,s]}),this._dirty=!0,this}rect(t,n,s,r,u){return this.instructions.push({action:"rect",data:[t,n,s,r,u]}),this._dirty=!0,this}circle(t,n,s,r){return this.instructions.push({action:"circle",data:[t,n,s,r]}),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,s,r,u,c,h){u||(u=r/2);const m=-1*Math.PI/2+c,p=s*2,g=Math.PI*2/p,x=[];for(let _=0;_<p;_++){const b=_%2?u:r,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 Pi;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let s=0;s<this.instructions.length;s++){const r=this.instructions[s];n.instructions.push({action:r.action,data:r.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,s=t.b,r=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,A=0;for(let S=0;S<this.instructions.length;S++){const w=this.instructions[S],C=w.data;switch(w.action){case"moveTo":case"lineTo":m=C[0],p=C[1],C[0]=n*m+r*p+c,C[1]=s*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+r*x+c,C[1]=s*g+u*x+h,C[2]=n*_+r*b+c,C[3]=s*_+u*b+h,C[4]=n*m+r*p+c,C[5]=s*m+u*p+h;break;case"quadraticCurveTo":g=C[0],x=C[1],m=C[2],p=C[3],C[0]=n*g+r*x+c,C[1]=s*g+u*x+h,C[2]=n*m+r*p+c,C[3]=s*m+u*p+h;break;case"arcToSvg":m=C[5],p=C[6],T=C[0],A=C[1],C[0]=n*T+r*A,C[1]=s*T+u*A,C[5]=n*m+r*p+c,C[6]=s*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:ve("unknown transform action",w.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let n=this.instructions.length-1,s=this.instructions[n];if(!s)return t.x=0,t.y=0,t;for(;s.action==="closePath";){if(n--,n<0)return t.x=0,t.y=0,t;s=this.instructions[n]}switch(s.action){case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1];break;case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3];break;case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5];break;case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(t);break}return t}}function Ka(l,t){return l?l.prepend(t):t.clone()}function Ft(l,t,n){const s=l.getAttribute(t);return s?Number(s):n}function b2(l,t){const n=l.querySelectorAll("defs");for(let s=0;s<n.length;s++){const r=n[s];for(let u=0;u<r.children.length;u++){const c=r.children[u];switch(c.nodeName.toLowerCase()){case"lineargradient":t.defs[c.id]=v2(c);break;case"radialgradient":t.defs[c.id]=S2();break}}}}function v2(l){const t=Ft(l,"x1",0),n=Ft(l,"y1",0),s=Ft(l,"x2",1),r=Ft(l,"y2",0),u=l.getAttribute("gradientUnits")||"objectBoundingBox",c=new Fi(t,n,s,r,u==="objectBoundingBox"?"local":"global");for(let h=0;h<l.children.length;h++){const m=l.children[h],p=Ft(m,"offset",0),g=ae.shared.setValue(m.getAttribute("stop-color")).toNumber();c.addColorStop(p,g)}return c}function S2(l){return ve("[SVG Parser] Radial gradients are not yet supported"),new Fi(0,0,1,0)}function iy(l){const t=l.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const ny={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 G0(l,t){const n=l.getAttribute("style"),s={},r={},u={strokeStyle:s,fillStyle:r,useFill:!1,useStroke:!1};for(const c in ny){const h=l.getAttribute(c);h&&sy(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(":");ny[p]&&sy(t,u,p,g.trim())}}return{strokeStyle:u.useStroke?s:null,fillStyle:u.useFill?r:null,useFill:u.useFill,useStroke:u.useStroke}}function sy(l,t,n,s){switch(n){case"stroke":if(s!=="none"){if(s.startsWith("url(")){const r=iy(s);t.strokeStyle.fill=l.defs[r]}else t.strokeStyle.color=ae.shared.setValue(s).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(s);break;case"fill":if(s!=="none"){if(s.startsWith("url(")){const r=iy(s);t.fillStyle.fill=l.defs[r]}else t.fillStyle.color=ae.shared.setValue(s).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(s);break;case"stroke-opacity":t.strokeStyle.alpha=Number(s);break;case"opacity":t.fillStyle.alpha=Number(s),t.strokeStyle.alpha=Number(s);break}}function T2(l){if(l.length<=2)return!0;const t=l.map(h=>h.area).sort((h,m)=>m-h),[n,s]=t,r=t[t.length-1],u=n/s,c=s/r;return!(u>3&&c<2)}function w2(l){return l.split(/(?=[Mm])/).filter(s=>s.trim().length>0)}function A2(l){const t=l.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;const n=t.map(Number),s=[],r=[];for(let g=0;g<n.length;g+=2)g+1<n.length&&(s.push(n[g]),r.push(n[g+1]));if(s.length===0||r.length===0)return 0;const u=Math.min(...s),c=Math.max(...s),h=Math.min(...r),m=Math.max(...r);return(c-u)*(m-h)}function ay(l,t){const n=new Pi(l,!1);for(const s of n.instructions)t.instructions.push(s)}function C2(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 Pi};b2(l,n);const s=l.children,{fillStyle:r,strokeStyle:u}=G0(l,n);for(let c=0;c<s.length;c++){const h=s[c];h.nodeName.toLowerCase()!=="defs"&&U0(h,n,r,u)}return t}function U0(l,t,n,s){const r=l.children,{fillStyle:u,strokeStyle:c}=G0(l,t);u&&n?n={...n,...u}:u&&(n=u),c&&s?s={...s,...c}:c&&(s=c);const h=!n&&!s;h&&(n={color:0});let m,p,g,x,_,b,T,A,S,w,C,E,O,P,k,N,$;switch(l.nodeName.toLowerCase()){case"path":{P=l.getAttribute("d");const Q=l.getAttribute("fill-rule"),Z=w2(P),I=Q==="evenodd",tt=Z.length>1;if(I&&tt){const nt=Z.map(D=>({path:D,area:A2(D)}));if(nt.sort((D,L)=>L.area-D.area),Z.length>3||!T2(nt))for(let D=0;D<nt.length;D++){const L=nt[D],et=D===0;t.context.beginPath();const K=new Pi(void 0,!0);ay(L.path,K),t.context.path(K),et?(n&&t.context.fill(n),s&&t.context.stroke(s)):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 Pi(void 0,!0);ay(L.path,K),t.context.path(K),et?t.context.cut():(n&&t.context.fill(n),s&&t.context.stroke(s))}}else{const nt=Q?Q==="evenodd":!0;k=new Pi(P,nt),t.context.path(k),n&&t.context.fill(n),s&&t.context.stroke(s)}break}case"circle":T=Ft(l,"cx",0),A=Ft(l,"cy",0),S=Ft(l,"r",0),t.context.ellipse(T,A,S,S),n&&t.context.fill(n),s&&t.context.stroke(s);break;case"rect":m=Ft(l,"x",0),p=Ft(l,"y",0),N=Ft(l,"width",0),$=Ft(l,"height",0),w=Ft(l,"rx",0),C=Ft(l,"ry",0),w||C?t.context.roundRect(m,p,N,$,w||C):t.context.rect(m,p,N,$),n&&t.context.fill(n),s&&t.context.stroke(s);break;case"ellipse":T=Ft(l,"cx",0),A=Ft(l,"cy",0),w=Ft(l,"rx",0),C=Ft(l,"ry",0),t.context.beginPath(),t.context.ellipse(T,A,w,C),n&&t.context.fill(n),s&&t.context.stroke(s);break;case"line":g=Ft(l,"x1",0),x=Ft(l,"y1",0),_=Ft(l,"x2",0),b=Ft(l,"y2",0),t.context.beginPath(),t.context.moveTo(g,x),t.context.lineTo(_,b),s&&t.context.stroke(s);break;case"polygon":O=l.getAttribute("points"),E=O.match(/-?\d+/g).map(Q=>parseInt(Q,10)),t.context.poly(E,!0),n&&t.context.fill(n),s&&t.context.stroke(s);break;case"polyline":O=l.getAttribute("points"),E=O.match(/-?\d+/g).map(Q=>parseInt(Q,10)),t.context.poly(E,!1),s&&t.context.stroke(s);break;case"g":case"svg":break;default:{ve(`[SVG parser] <${l.nodeName}> elements unsupported`);break}}h&&(n=null);for(let Q=0;Q<r.length;Q++)U0(r[Q],t,n,s)}const ly={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 co{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=ly[n].addressModeU,t.source.style.addressModeV=ly[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 M2(l){return ae.isColorLike(l)}function ry(l){return l instanceof co}function oy(l){return l instanceof Fi}function E2(l){return l instanceof Gt}function R2(l,t,n){const s=ae.shared.setValue(t??0);return l.color=s.toNumber(),l.alpha=s.alpha===1?n.alpha:s.alpha,l.texture=Gt.WHITE,{...n,...l}}function z2(l,t,n){return l.texture=t,{...n,...l}}function uy(l,t,n){return l.fill=t,l.color=16777215,l.texture=t.texture,l.matrix=t.transform,{...n,...l}}function cy(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 D2(l,t){const n={...t,...l},s=ae.shared.setValue(n.color);return n.alpha*=s.alpha,n.color=s.toNumber(),n}function Kn(l,t){if(l==null)return null;const n={},s=l;return M2(l)?R2(n,l,t):E2(l)?z2(n,l,t):ry(l)?uy(n,l,t):oy(l)?cy(n,l,t):s.fill&&ry(s.fill)?uy(s,s.fill,t):s.fill&&oy(s.fill)?cy(s,s.fill,t):D2(s,t)}function no(l,t){const{width:n,alignment:s,miterLimit:r,cap:u,join:c,pixelLine:h,...m}=t,p=Kn(l,m);return p?{width:n,alignment:s,miterLimit:r,cap:u,join:c,pixelLine:h,...p}:null}function B2(l,t){let n=1;const s=l.shapePath.shapePrimitives;for(let r=0;r<s.length;r++){const u=s[r].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],A=c[p+1],S=c[x],w=c[x+1],C=_-T,E=b-A,O=S-T,P=w-A,k=C*C+E*E,N=O*O+P*P;if(k<1e-12||N<1e-12)continue;let Z=(C*O+E*P)/Math.sqrt(k*N);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 O2=new ge,hy=new St,Xh=class vi extends Si{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 Pi,this._transform=new St,this._fillStyle={...vi.defaultFillStyle},this._strokeStyle={...vi.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new ai,this._boundsDirty=!0}clone(){const t=new vi;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=Kn(t,vi.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=no(t,vi.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=Kn(t,vi.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=Kn(t,vi.defaultStrokeStyle),this}texture(t,n,s,r,u,c){return this.instructions.push({action:"texture",data:{image:t,dx:s||0,dy:r||0,dw:u||t.frame.width,dh:c||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:n||n===0?ae.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Pi,this}fill(t,n){let s;const r=this.instructions[this.instructions.length-1];return this._tick===0&&(r==null?void 0:r.action)==="stroke"?s=r.data.path:s=this._activePath.clone(),s?(t!=null&&(n!==void 0&&typeof t=="number"&&(At(Wt,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:n}),this._fillStyle=Kn(t,vi.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),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 s=this.instructions[this.instructions.length-1];return this._tick===0&&(s==null?void 0:s.action)==="fill"?n=s.data.path:n=this._activePath.clone(),n?(t!=null&&(this._strokeStyle=no(t,vi.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],s=this._activePath.clone();if(n&&(n.action==="stroke"||n.action==="fill"))if(n.data.hole)n.data.hole.addPath(s);else{n.data.hole=s;break}}return this._initNextPathLocation(),this}arc(t,n,s,r,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,s,r,u,c),this}arcTo(t,n,s,r,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*s+c.c*r+c.tx,c.b*s+c.d*r+c.ty,u),this}arcToSvg(t,n,s,r,u,c,h){this._tick++;const m=this._transform;return this._activePath.arcToSvg(t,n,s,r,u,m.a*c+m.c*h+m.tx,m.b*c+m.d*h+m.ty),this}bezierCurveTo(t,n,s,r,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*s+m.c*r+m.tx,m.b*s+m.d*r+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,s,r){return this._tick++,this._activePath.ellipse(t,n,s,r,this._transform.clone()),this}circle(t,n,s){return this._tick++,this._activePath.circle(t,n,s,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,n){this._tick++;const s=this._transform;return this._activePath.lineTo(s.a*t+s.c*n+s.tx,s.b*t+s.d*n+s.ty),this}moveTo(t,n){this._tick++;const s=this._transform,r=this._activePath.instructions,u=s.a*t+s.c*n+s.tx,c=s.b*t+s.d*n+s.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=u,r[0].data[1]=c,this):(this._activePath.moveTo(u,c),this)}quadraticCurveTo(t,n,s,r,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*s+c.c*r+c.tx,c.b*s+c.d*r+c.ty,u),this}rect(t,n,s,r){return this._tick++,this._activePath.rect(t,n,s,r,this._transform.clone()),this}roundRect(t,n,s,r,u){return this._tick++,this._activePath.roundRect(t,n,s,r,u,this._transform.clone()),this}poly(t,n){return this._tick++,this._activePath.poly(t,n,this._transform.clone()),this}regularPoly(t,n,s,r,u=0,c){return this._tick++,this._activePath.regularPoly(t,n,s,r,u,c),this}roundPoly(t,n,s,r,u,c){return this._tick++,this._activePath.roundPoly(t,n,s,r,u,c),this}roundShape(t,n,s,r){return this._tick++,this._activePath.roundShape(t,n,s,r),this}filletRect(t,n,s,r,u){return this._tick++,this._activePath.filletRect(t,n,s,r,u),this}chamferRect(t,n,s,r,u,c){return this._tick++,this._activePath.chamferRect(t,n,s,r,u,c),this}star(t,n,s,r,u=0,c=0){return this._tick++,this._activePath.star(t,n,s,r,u,c,this._transform.clone()),this}svg(t){return this._tick++,C2(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,s,r,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,s,r,u,c),this)}transform(t,n,s,r,u,c){return t instanceof St?(this._transform.append(t),this):(hy.set(t,n,s,r,u,c),this._transform.append(hy),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 s=this.instructions[n],r=s.action;if(r==="fill"){const u=s.data;t.addBounds(u.path.bounds)}else if(r==="texture"){const u=s.data;t.addFrame(u.dx,u.dy,u.dx+u.dw,u.dy+u.dh,u.transform)}if(r==="stroke"){const u=s.data,c=u.style.alignment;let h=u.style.width*(1-c);u.style.join==="miter"&&(h*=B2(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 r;if(!this.bounds.containsPoint(t.x,t.y))return!1;const n=this.instructions;let s=!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,O2):t;if(c.action==="fill")s=_.contains(T.x,T.y);else{const S=p;s=_.strokeContains(T.x,T.y,S.width,S.alignment)}const A=h.hole;if(A){const S=(r=A.shapePath)==null?void 0:r.shapePrimitives;if(S)for(let w=0;w<S.length;w++)S[w].shape.contains(T.x,T.y)&&(s=!1)}if(s)return!0}}return s}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 s=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(s)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(s))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Xh.defaultFillStyle={color:16777215,alpha:1,texture:Gt.WHITE,matrix:null,fill:null,textureSpace:"local"};Xh.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 mi=Xh;class N2{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class k2{constructor(){this.instructions=new Bh}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const Vh=class Ah{constructor(t){this._renderer=t,this._managedContexts=new ml({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Ah.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??Ah.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=t._gpuData,s=!!n[this._renderer.uid],r=n[this._renderer.uid]||this._initContext(t);return(t.dirty||!s)&&(s&&r.reset(),r.isBatchable=!1,t.dirty=!1),r}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=new k2,s=this.getGpuContext(t);return s.graphicsData=n,n.init(),n}_initContext(t){const n=new N2;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Vh.extension={type:[yt.CanvasSystem],name:"graphicsContext"};Vh.defaultOptions={bezierSmoothness:.5};let G2=Vh;class H0{constructor(t,n){this.state=o0.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}}H0.extension={type:[yt.CanvasPipes],name:"graphics"};function U2(l,t,n){const s=(l>>24&255)/255;t[n++]=(l&255)/255*s,t[n++]=(l>>8&255)/255*s,t[n++]=(l>>16&255)/255*s,t[n++]=s}class H2{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{Be.return(t)}),this.batches.length=0}}class L0{constructor(t,n){this.state=o0.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,s=!!t._gpuData,u=this.renderer.graphicsContext.updateGpuContext(n);return!!(u.isBatchable||s!==u.isBatchable)}addRenderable(t,n){const r=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),r.isBatchable?this._addToBatcher(t,n):(this.renderer.renderPipes.batch.break(n),n.add(t))}updateRenderable(t){const s=this._getGpuDataForRenderable(t).batches;for(let r=0;r<s.length;r++){const u=s[r];u._batcher.updateElement(u)}}execute(t){if(!t.isRenderable)return;const n=this.renderer,s=t.context;if(!n.graphicsContext.getGpuContext(s).batches.length)return;const u=s.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,U2(t.groupColorAlpha,c.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const n=this._getGpuDataForRenderable(t),r=this.renderer.graphicsContext.updateGpuContext(t.context);n.destroy(),r.isBatchable&&this._updateBatchesForRenderable(t,n)}_addToBatcher(t,n){const s=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(t).batches;for(let u=0;u<r.length;u++){const c=r[u];s.addToBatch(c,n)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const n=new H2;return t._gpuData[this.renderer.uid]=n,this._managedGraphics.add(t),n}_updateBatchesForRenderable(t,n){const s=t.context,u=this.renderer.graphicsContext.getGpuContext(s),c=this.renderer._roundPixels|t._roundPixels;n.batches=u.batches.map(h=>{const m=Be.get(Lh);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}}L0.extension={type:[yt.WebGLPipes,yt.WebGPUPipes],name:"graphics"};Jt.add(H0);Jt.add(L0);Jt.add(G2);Jt.add(qh);class _e extends Oh{constructor(t){t instanceof mi&&(t={context:t});const{context:n,roundPixels:s,...r}=t||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",n?this.context=n:(this.context=this._ownedContext=new mi,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=s??!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 _e(this._context.clone()):(this._ownedContext=null,new _e(this._context))}lineStyle(t,n,s){At(Wt,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return t&&(r.width=t),n&&(r.color=n),s&&(r.alpha=s),this.context.strokeStyle=r,this}beginFill(t,n){At(Wt,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const s={};return t!==void 0&&(s.color=t),n!==void 0&&(s.alpha=n),this.context.fillStyle=s,this}endFill(){At(Wt,"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!==mi.defaultStrokeStyle.width||t.color!==mi.defaultStrokeStyle.color||t.alpha!==mi.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return At(Wt,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return At(Wt,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return At(Wt,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return At(Wt,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return At(Wt,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return At(Wt,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}class L2 extends Oh{constructor(t,n){const{text:s,resolution:r,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=s??"",this.style=u,this.resolution=r??null,this.allowChildren=!1,this._anchor=new me({_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,s=this.bounds.height,r=-n*this.anchor.x;let u=0;return t.x>=r&&t.x<=r+n&&(u=-s*this.anchor.y,t.y>=u&&t.y<=u+s)}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 j2(l,t){let n=l[0]??{};return(typeof n=="string"||l[1])&&(At(Wt,`use new ${t}({ text: "hi!", style }) instead`),n={text:n,style:l[1]}),n}class Y2{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,n){const s=Pe.get().createCanvas();s.width=t,s.height=n;const r=s.getContext("2d");return{canvas:s,context:r}}getOptimalCanvasAndContext(t,n,s=1){t=Math.ceil(t*s-1e-6),n=Math.ceil(n*s-1e-6),t=Fs(t),n=Fs(n);const r=(t<<17)+(n<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let u=this._canvasPool[r].pop();return u||(u=this._createCanvasAndContext(t,n)),u}returnCanvasAndContext(t){const n=t.canvas,{width:s,height:r}=n,u=(s<<17)+(r<<1);t.context.resetTransform(),t.context.clearRect(0,0,s,r),this._canvasPool[u].push(t)}clear(){this._canvasPool={}}}const Ch=new Y2;dl.register(Ch);let Vn=null,Xi=null;function q2(l,t){Vn||(Vn=Pe.get().createCanvas(256,128),Xi=Vn.getContext("2d",{willReadFrequently:!0}),Xi.globalCompositeOperation="copy",Xi.globalAlpha=1),(Vn.width<l||Vn.height<t)&&(Vn.width=Fs(l),Vn.height=Fs(t))}function fy(l,t,n){for(let s=0,r=4*n*t;s<t;++s,r+=4)if(l[r+3]!==0)return!1;return!0}function dy(l,t,n,s,r){const u=4*t;for(let c=s,h=s*u+4*n;c<=r;++c,h+=u)if(l[h+3]!==0)return!1;return!0}function X2(...l){let t=l[0];t.canvas||(t={canvas:l[0],resolution:l[1]});const{canvas:n}=t,s=Math.min(t.resolution??1,1),r=t.width??n.width,u=t.height??n.height;let c=t.output;if(q2(r,u),!Xi)throw new TypeError("Failed to get canvas 2D context");Xi.drawImage(n,0,0,r,u,0,0,r*s,u*s);const m=Xi.getImageData(0,0,r,u).data;let p=0,g=0,x=r-1,_=u-1;for(;g<u&&fy(m,r,g);)++g;if(g===u)return $t.EMPTY;for(;fy(m,r,_);)--_;for(;dy(m,r,p,g,_);)++p;for(;dy(m,r,x,g,_);)--x;return++x,++_,Xi.globalCompositeOperation="source-over",Xi.strokeRect(p,g,x-p,_-g),Xi.globalCompositeOperation="copy",c??(c=new $t),c.set(p/s,g/s,(x-p)/s,(_-g)/s),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 V2{constructor(t=0,n=0,s=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=s,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 s=0;s<t.length;s++){const r=t[s];n[s]=[r,this.get(r)]}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,s=0;for(;n!==null;)t[s++]=n.key,n=n.next;return t}setWithEvicted(t,n,s=this.resetTtl){let r=null;if(this.has(t))this.set(t,n,!0,s);else{this.max>0&&this.size===this.max&&(r={...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 r}set(t,n,s=!1,r=this.resetTtl){let u=this.items[t];return s||u!==void 0?(u.value=n,s===!1&&r&&(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 s=0;s<t.length;s++)n[s]=this.get(t[s]);return n}}function P2(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 V2(l,t,n)}function j0(l){return!!l.tagStyles&&Object.keys(l.tagStyles).length>0}function Y0(l){return l.includes("<")}function F2(l,t){return l.clone().assign(t)}function W2(l,t){const n=[],s=t.tagStyles;if(!j0(t)||!Y0(l))return n.push({text:l,style:t}),n;const r=[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:r[r.length-1]}),c=""),r.pop(),u.pop(),h=p+1;continue}else{c+=l.slice(h,p+1),h=p+1;continue}}else{const x=g.trim();if(s[x]){c.length>0&&(n.push({text:c,style:r[r.length-1]}),c="");const _=r[r.length-1],b=F2(_,s[x]);r.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:r[r.length-1]}),n}const Q2=[10,13],Z2=new Set(Q2),I2=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],K2=new Set(I2),$2=[9,32];new Set($2);const J2=[45,8208,8211,8212,173],tT=new Set(J2),eT=/(\r\n|\r|\n)/,iT=/(?:\r\n|\r|\n)/;function so(l){return typeof l!="string"?!1:Z2.has(l.charCodeAt(0))}function si(l,t){return typeof l!="string"?!1:K2.has(l.charCodeAt(0))}function nT(l){return typeof l!="string"?!1:tT.has(l.charCodeAt(0))}function q0(l){return l==="normal"||l==="pre-line"}function X0(l){return l==="normal"}function qi(l){if(typeof l!="string")return"";let t=l.length-1;for(;t>=0&&si(l[t]);)t--;return t<l.length-1?l.slice(0,t+1):l}function V0(l){const t=[],n=[];if(typeof l!="string")return t;for(let s=0;s<l.length;s++){const r=l[s],u=l[s+1];if(si(r)||so(r)){n.length>0&&(t.push(n.join("")),n.length=0),r==="\r"&&u===`
|
|
294
|
+
`?(t.push(`\r
|
|
295
|
+
`),s++):t.push(r);continue}n.push(r),nT(r)&&u&&!si(u)&&!so(u)&&(t.push(n.join("")),n.length=0)}return n.length>0&&t.push(n.join("")),t}function P0(l,t,n,s){const r=n(l),u=[];for(let c=0;c<r.length;c++){let h=r[c],m=h,p=1;for(;r[c+p];){const g=r[c+p];if(!s(m,g,l,c,t))h+=g,m=g,p++;else break}c+=p-1,u.push(h)}return u}const sT=/\r\n|\r|\n/g;function aT(l,t,n,s,r,u,c,h){var wt,D;const m=W2(l,t);if(X0(t.whiteSpace))for(let L=0;L<m.length;L++){const et=m[L];m[L]={text:et.text.replace(sT," "),style:et.style}}const g=[];let x=[];for(const L of m){const et=L.text.split(eT);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?lT(g,t,s,r,c,h):g,b=[],T=[],A=[],S=[],w=[];let C=0;const E=t._fontString,O=u(E);O.fontSize===0&&(O.fontSize=t.fontSize,O.ascent=t.fontSize);let P="",k=!!t.dropShadow,N=((wt=t._stroke)==null?void 0:wt.width)||0;for(const L of _){let et=0,K=O.ascent,at=O.descent,R="";for(const W of L){const J=W.style._fontString,rt=u(J);J!==P&&(s.font=J,P=J);const ct=r(W.text,W.style.letterSpacing,s);et+=ct,K=Math.max(K,rt.ascent),at=Math.max(at,rt.descent),R+=W.text;const ft=((D=W.style._stroke)==null?void 0:D.width)||0;ft>N&&(N=ft),!k&&W.style.dropShadow&&(k=!0)}L.length===0&&(K=O.ascent,at=O.descent),b.push(et),T.push(K),A.push(at),w.push(R);const Y=t.lineHeight||K+at;S.push(Y+t.leading),C=Math.max(C,et)}const $=N,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||O.fontSize;return{width:I,height:it,lines:w,lineWidths:b,lineHeight:nt+t.leading,maxLineWidth:C,fontProperties:O,runsByLine:_,lineAscents:T,lineDescents:A,lineHeights:S,hasDropShadow:k}}function lT(l,t,n,s,r,u){var S;const{letterSpacing:c,whiteSpace:h,wordWrapWidth:m,breakWords:p}=t,g=q0(h),x=m+c,_={};let b="";const T=(w,C)=>{const E=`${w}|${C.styleKey}`;let O=_[E];if(O===void 0){const P=C._fontString;P!==b&&(n.font=P,b=P),O=s(w,C.letterSpacing,n)+C.letterSpacing,_[E]=O}return O},A=[];for(const w of l){const C=rT(w),E=A.length,O=tt=>{let it=0,nt=tt;do{const{token:wt,style:D}=C[nt];it+=T(wt,D),nt++}while(nt<C.length&&C[nt].continuesFromPrevious);return it},P=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 k=[],N=0,$=!g,Q=null;const Z=()=>{Q&&Q.text.length>0&&k.push(Q),Q=null},I=()=>{if(Z(),k.length>0){const tt=k[k.length-1];tt.text=qi(tt.text),tt.text.length===0&&k.pop()}A.push(k),k=[],N=0,$=!1};for(let tt=0;tt<C.length;tt++){const{token:it,style:nt,continuesFromPrevious:wt}=C[tt],D=T(it,nt);if(g){const K=si(it),at=(Q==null?void 0:Q.text[Q.text.length-1])??((S=k[k.length-1])==null?void 0:S.text.slice(-1))??"",R=at?si(at):!1;if(K&&R)continue}const L=!wt,et=L?O(tt):D;if(et>x&&L)if(N>0&&I(),p){const K=P(tt);for(let at=0;at<K.length;at++){const R=K[at].token,Y=K[at].style,W=P0(R,p,u,r);for(const J of W){const rt=T(J,Y);rt+N>x&&I(),!Q||Q.style!==Y?(Z(),Q={text:J,style:Y}):Q.text+=J,N+=rt}}tt+=K.length-1}else{const K=P(tt);Z(),A.push(K.map(at=>({text:at.token,style:at.style}))),$=!1,tt+=K.length-1}else if(et+N>x&&L){if(si(it)){$=!1;continue}I(),Q={text:it,style:nt},N=D}else if(wt&&!p)!Q||Q.style!==nt?(Z(),Q={text:it,style:nt}):Q.text+=it,N+=D;else{const K=si(it);if(N===0&&K&&!$)continue;!Q||Q.style!==nt?(Z(),Q={text:it,style:nt}):Q.text+=it,N+=D}}if(Z(),k.length>0){const tt=k[k.length-1];tt.text=qi(tt.text),tt.text.length===0&&k.pop()}(k.length>0||A.length===E)&&A.push(k)}return A}function rT(l){const t=[];let n=!1;for(const s of l){const r=V0(s.text);let u=!0;for(const c of r){const h=si(c)||so(c),m=u&&n&&!h;t.push({token:c,style:s.style,continuesFromPrevious:m}),n=!h,u=!1}}return t}const oT={willReadFrequently:!0};function my(l,t,n,s,r){let u=n[l];return typeof u!="number"&&(u=r(l,t,s)+t,n[l]=u),u}function uT(l,t,n,s,r,u,c){const h=n.getContext("2d",oT);h.font=t._fontString;let m=0,p="";const g=[],x=Object.create(null),{letterSpacing:_,whiteSpace:b}=t,T=q0(b),A=X0(b);let S=!T;const w=t.wordWrapWidth+_,C=V0(l);for(let O=0;O<C.length;O++){let P=C[O];if(so(P)){if(!A){g.push(qi(p)),S=!T,p="",m=0;continue}P=" "}if(T){const N=si(P),$=si(p[p.length-1]);if(N&&$)continue}const k=my(P,_,x,h,s);if(k>w)if(p!==""&&(g.push(qi(p)),p="",m=0),r(P,t.breakWords)){const N=P0(P,t.breakWords,c,u);for(const $ of N){const Q=my($,_,x,h,s);Q+m>w&&(g.push(qi(p)),S=!1,p="",m=0),p+=$,m+=Q}}else p.length>0&&(g.push(qi(p)),p="",m=0),g.push(qi(P)),S=!1,p="",m=0;else k+m>w&&(S=!1,g.push(qi(p)),p="",m=0),(p.length>0||!si(P)||S)&&(p+=P,m+=k)}const E=qi(p);return E.length>0&&g.push(E),g.join(`
|
|
298
|
+
`)}const py={willReadFrequently:!0},Wi=class ht{static get experimentalLetterSpacingSupported(){let t=ht._experimentalLetterSpacingSupported;if(t===void 0){const n=Pe.get().getCanvasRenderingContext2D().prototype;t=ht._experimentalLetterSpacingSupported="letterSpacing"in n||"textLetterSpacing"in n}return t}constructor(t,n,s,r,u,c,h,m,p,g){this.text=t,this.style=n,this.width=s,this.height=r,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,s=ht._canvas,r=n.wordWrap){var P;const u=`${t}-${n.styleKey}-wordWrap-${r}`;if(ht._measurementCache.has(u))return ht._measurementCache.get(u);if(j0(n)&&Y0(t)){const k=aT(t,n,r,ht._context,ht._measureText,ht.measureFont,ht.canBreakChars,ht.wordWrapSplit),N=new ht(t,n,k.width,k.height,k.lines,k.lineWidths,k.lineHeight,k.maxLineWidth,k.fontProperties,{runsByLine:k.runsByLine,lineAscents:k.lineAscents,lineDescents:k.lineDescents,lineHeights:k.lineHeights,hasDropShadow:k.hasDropShadow});return ht._measurementCache.set(u,N),N}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=(r?ht._wordWrap(t,n,s):t).split(iT),_=new Array(x.length);let b=0;for(let k=0;k<x.length;k++){const N=ht._measureText(x[k],n.letterSpacing,p);_[k]=N,b=Math.max(b,N)}const T=((P=n._stroke)==null?void 0:P.width)??0,A=n.lineHeight||m.fontSize,S=ht._getAlignWidth(b,n,r),w=ht._adjustWidthForStyle(S,n),C=Math.max(A,m.fontSize+T)+(x.length-1)*(A+n.leading),E=ht._adjustHeightForStyle(C,n),O=new ht(t,n,w,E,x,_,A+n.leading,b,m);return ht._measurementCache.set(u,O),O}static _adjustWidthForStyle(t,n){var u;const s=((u=n._stroke)==null?void 0:u.width)||0;let r=t+s;return n.dropShadow&&(r+=n.dropShadow.distance),r}static _adjustHeightForStyle(t,n){let s=t;return n.dropShadow&&(s+=n.dropShadow.distance),s}static _getAlignWidth(t,n,s){return s&&n.align!=="left"?Math.max(t,n.wordWrapWidth):t}static _measureText(t,n,s){let r=!1;ht.experimentalLetterSpacingSupported&&(ht.experimentalLetterSpacing?(s.letterSpacing=`${n}px`,s.textLetterSpacing=`${n}px`,r=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px"));const u=s.measureText(t);let c=u.width;const h=-(u.actualBoundingBoxLeft??0);let p=(u.actualBoundingBoxRight??0)-h;if(c>0)if(r)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,s=ht._canvas){return uT(t,n,s,ht._measureText,ht.canBreakWords,ht.canBreakChars,ht.wordWrapSplit)}static isBreakingSpace(t,n){return si(t)}static canBreakWords(t,n){return n}static canBreakChars(t,n,s,r,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 s=n.measureText(ht.METRICS_STRING+ht.BASELINE_SYMBOL),r=s.actualBoundingBoxAscent??0,u=s.actualBoundingBoxDescent??0,c={ascent:r,descent:u,fontSize:r+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),s=n.getContext("2d",py);if(s!=null&&s.measureText)return ht.__canvas=n,n;t=Pe.get().createCanvas()}catch{t=Pe.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",py)),ht.__context}};Wi.METRICS_STRING="|ÉqÅ";Wi.BASELINE_SYMBOL="M";Wi.BASELINE_MULTIPLIER=1.4;Wi.HEIGHT_MULTIPLIER=2;Wi.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const l=new Intl.Segmenter;return t=>{const n=l.segment(t),s=[];let r=0;for(const u of n)s[r++]=u.segment;return s}}return l=>[...l]})();Wi.experimentalLetterSpacing=!1;Wi._fonts={};Wi._measurementCache=P2(1e3);let vn=Wi;const cT=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function Mh(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 s=n.length-1;s>=0;s--){let r=n[s].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!cT.includes(r)&&(r=`"${r}"`),n[s]=r}return`${l.fontStyle} ${l.fontVariant} ${l.fontWeight} ${t} ${n.join(",")}`}const gy=1e5;function Zr(l,t,n,s=0,r=0,u=0){if(l.texture===Gt.WHITE&&!l.fill)return ae.shared.setValue(l.color).setAlpha(l.alpha??1).toHexa();if(l.fill){if(l.fill instanceof co){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 Fi){const c=l.fill,h=c.type==="linear",m=c.textureSpace==="local";let p=1,g=1;m&&n&&(p=n.width+s,g=n.height+s);let x,_=!1;if(h){const{start:b,end:T}=c;x=t.createLinearGradient(b.x*p+r,b.y*g+u,T.x*p+r,T.y*g+u),_=Math.abs(T.x-b.x)<Math.abs((T.y-b.y)*.1)}else{const{center:b,innerRadius:T,outerCenter:A,outerRadius:S}=c;x=t.createRadialGradient(b.x*p+r,b.y*g+u,T*p,A.x*p+r,A.y*g+u,S*p)}if(_&&m&&n){const b=n.lineHeight/g;for(let T=0;T<n.lines.length;T++){const A=(T*n.lineHeight+s/2)/g;c.colorStops.forEach(S=>{let w=A+S.offset*b;w=Math.max(0,Math.min(1,w)),x.addColorStop(Math.floor(w*gy)/gy,ae.shared.setValue(S.color).toHex())})}}else c.colorStops.forEach(b=>{x.addColorStop(b.offset,ae.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 ve("FillStyle not recognised",l),"red"}const yy=new $t;function Ls(l){let t=0;for(let n=0;n<l.length;n++)l.charCodeAt(n)===32&&t++;return t}class hT{getCanvasAndContext(t){const{text:n,style:s,resolution:r=1}=t,u=s._getFinalPadding(),c=vn.measureText(n||" ",s),h=Math.ceil(Math.ceil(Math.max(1,c.width)+u*2)*r),m=Math.ceil(Math.ceil(Math.max(1,c.height)+u*2)*r),p=Ch.getOptimalCanvasAndContext(h,m);this._renderTextToCanvas(s,u,r,p,c);const g=s.trim?X2({canvas:p.canvas,width:h,height:m,resolution:1,output:yy}):yy.set(0,0,h,m);return{canvasAndContext:p,frame:g}}returnCanvasAndContext(t){Ch.returnCanvasAndContext(t)}_renderTextToCanvas(t,n,s,r,u){var k,N,$;if(u.runsByLine&&u.runsByLine.length>0){this._renderTaggedTextToCanvas(u,t,n,s,r);return}const{canvas:c,context:h}=r,m=Mh(t),p=u.lines,g=u.lineHeight,x=u.lineWidths,_=u.maxLineWidth,b=u.fontProperties,T=c.height;if(h.resetTransform(),h.scale(s,s),h.textBaseline=t.textBaseline,(k=t._stroke)!=null&&k.width){const Q=t._stroke;h.lineWidth=Q.width,h.miterLimit=Q.miterLimit,h.lineJoin=Q.join,h.lineCap=Q.cap}h.font=m;let A,S;const w=t.dropShadow?2:1,C=t.wordWrap?Math.max(t.wordWrapWidth,_):_,O=(((N=t._stroke)==null?void 0:N.width)??0)/2;let P=(g-b.fontSize)/2;g-b.fontSize<0&&(P=0);for(let Q=0;Q<w;++Q){const Z=t.dropShadow&&Q===0,I=Z?Math.ceil(Math.max(1,T)+n*2):0,tt=I*s;if(Z)this._setupDropShadow(h,t,s,tt);else{const it=t._gradientBounds,nt=t._gradientOffset;if(it){const wt={width:it.width,height:it.height,lineHeight:it.height,lines:u.lines};this._setFillAndStrokeStyles(h,t,wt,n,O,(nt==null?void 0:nt.x)??0,(nt==null?void 0:nt.y)??0)}else nt?this._setFillAndStrokeStyles(h,t,u,n,O,nt.x,nt.y):this._setFillAndStrokeStyles(h,t,u,n,O);h.shadowColor="rgba(0,0,0,0)"}for(let it=0;it<p.length;it++){A=O,S=O+it*g+b.ascent+P,A+=this._getAlignmentOffset(x[it],C,t.align);let nt=0;if(t.align==="justify"&&t.wordWrap&&it<p.length-1){const wt=Ls(p[it]);wt>0&&(nt=(C-x[it])/wt)}($=t._stroke)!=null&&$.width&&this._drawLetterSpacing(p[it],t,r,A+n,S+n-I,!0,nt),t._fill!==void 0&&this._drawLetterSpacing(p[it],t,r,A+n,S+n-I,!1,nt)}}}_renderTaggedTextToCanvas(t,n,s,r,u){var O,P,k;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(r,r),h.textBaseline=n.textBaseline;const A=b?2:1,S=n.wordWrap?Math.max(n.wordWrapWidth,g):g;let w=((O=n._stroke)==null?void 0:O.width)??0;for(const N of m)for(const $ of N){const Q=((P=$.style._stroke)==null?void 0:P.width)??0;Q>w&&(w=Q)}const C=w/2,E=[];for(let N=0;N<m.length;N++){const $=m[N],Q=[];for(const Z of $){const I=Mh(Z.style);h.font=I,Q.push({width:vn._measureText(Z.text,Z.style.letterSpacing,h),font:I})}E.push(Q)}for(let N=0;N<A;++N){const $=b&&N===0,Q=$?Math.ceil(Math.max(1,T)+s*2):0,Z=Q*r;$||(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],wt=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 W of it)Y+=Ls(W.text);Y>0&&(K=(S-nt)/Y)}const at=I+wt;let R=et+s;for(let Y=0;Y<it.length;Y++){const W=it[Y],{width:J,font:rt}=L[Y];if(h.font=rt,h.textBaseline=W.style.textBaseline,(k=W.style._stroke)!=null&&k.width){const ft=W.style._stroke;if(h.lineWidth=ft.width,h.miterLimit=ft.miterLimit,h.lineJoin=ft.join,h.lineCap=ft.cap,$)if(W.style.dropShadow)this._setupDropShadow(h,W.style,r,Z);else{const Lt=Ls(W.text);R+=J+Lt*K;continue}else{const Lt=vn.measureFont(rt),Et=W.style.lineHeight||Lt.fontSize,Fe={width:J,height:Et,lineHeight:Et,lines:[W.text]};h.strokeStyle=Zr(ft,h,Fe,s*2,R-s,I)}this._drawLetterSpacing(W.text,W.style,u,R,at+s-Q,!0,K)}const ct=Ls(W.text);R+=J+ct*K}R=et+s;for(let Y=0;Y<it.length;Y++){const W=it[Y],{width:J,font:rt}=L[Y];if(h.font=rt,h.textBaseline=W.style.textBaseline,W.style._fill!==void 0){if($)if(W.style.dropShadow)this._setupDropShadow(h,W.style,r,Z);else{const ft=Ls(W.text);R+=J+ft*K;continue}else{const ft=vn.measureFont(rt),Lt=W.style.lineHeight||ft.fontSize,Et={width:J,height:Lt,lineHeight:Lt,lines:[W.text]};h.fillStyle=Zr(W.style._fill,h,Et,s*2,R-s,I)}this._drawLetterSpacing(W.text,W.style,u,R,at+s-Q,!1,K)}const ct=Ls(W.text);R+=J+ct*K}I+=D}}}_setFillAndStrokeStyles(t,n,s,r,u,c=0,h=0){var m;if(t.fillStyle=n._fill?Zr(n._fill,t,s,r*2,c,h):null,(m=n._stroke)!=null&&m.width){const p=u+r*2;t.strokeStyle=Zr(n._stroke,t,s,p,c,h)}}_setupDropShadow(t,n,s,r){t.fillStyle="black",t.strokeStyle="black";const u=n.dropShadow,c=u.color,h=u.alpha;t.shadowColor=ae.shared.setValue(c).setAlpha(h).toRgbaString();const m=u.blur*s,p=u.distance*s;t.shadowBlur=m,t.shadowOffsetX=Math.cos(u.angle)*p,t.shadowOffsetY=Math.sin(u.angle)*p+r}_getAlignmentOffset(t,n,s){return s==="right"?n-t:s==="center"?(n-t)/2:0}_drawLetterSpacing(t,n,s,r,u,c=!1,h=0){const{context:m}=s,p=n.letterSpacing;let g=!1;if(vn.experimentalLetterSpacingSupported&&(vn.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,r,u):m.fillText(t,r,u);return}if(h!==0&&(p===0||g)){const A=t.split(" ");let S=r;const w=m.measureText(" ").width;for(let C=0;C<A.length;C++)c?m.strokeText(A[C],S,u):m.fillText(A[C],S,u),S+=m.measureText(A[C]).width+w+h;return}let x=r;const _=vn.graphemeSegmenter(t);let b=m.measureText(t).width,T=0;for(let A=0;A<_.length;++A){const S=_[A];c?m.strokeText(S,x,u):m.fillText(S,x,u);let w="";for(let C=A+1;C<_.length;++C)w+=_[C];T=m.measureText(w).width,x+=b-T+p,S===" "&&(x+=h),b=T}}}const Ps=new hT,Ph=class In extends Si{constructor(t={}){super(),this.uid=Qt("textStyle"),this._tick=0,this._cachedFontString=null,fT(t),t instanceof In&&(t=t._toObject());const r={...In.defaultTextStyle,...t};for(const u in r){const c=u;this[c]=r[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({...In.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...In.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({...mi.defaultFillStyle,...t},()=>{this._fill=Kn({...this._originalFill},mi.defaultFillStyle)})),this._fill=Kn(t===0?"black":t,mi.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...mi.defaultStrokeStyle,...t},()=>{this._stroke=no({...this._originalStroke},mi.defaultStrokeStyle)})),this._stroke=no(t,mi.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=In.defaultTextStyle;for(const n in t)this[n]=t[n]}assign(t){for(const n in t){const s=n;this[s]=t[n]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=Mh(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 In(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 s,r,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;(s=this._fill)!=null&&s.texture&&this._fill.texture.destroy(h),(r=this._originalFill)!=null&&r.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:(s,r,u)=>(s[r]===u||(s[r]=u,n==null||n(r,u),this.update()),!0)})}_isFillStyle(t){return(t??null)!==null&&!(ae.isColorLike(t)||t instanceof Fi||t instanceof co)}};Ph.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Ph.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 wn=Ph;function fT(l){const t=l;if(typeof t.dropShadow=="boolean"&&t.dropShadow){const n=wn.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){At(Wt,"strokeThickness is now a part of stroke");const n=t.stroke;let s={};if(ae.isColorLike(n))s.color=n;else if(n instanceof Fi||n instanceof co)s.fill=n;else if(Object.hasOwnProperty.call(n,"color")||Object.hasOwnProperty.call(n,"fill"))s=n;else throw new Error("Invalid stroke value.");l.stroke={...s,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(At(Wt,"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&&ve("The number of fill colors must match the number of fill gradient stops.");const n=new Fi({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),s=t.fillGradientStops.slice(),r=t.fill.map(u=>ae.shared.setValue(u).toNumber());s.forEach((u,c)=>{n.addColorStop(u,r[c])}),l.fill={fill:n}}}function dT(l,t){const{texture:n,bounds:s}=l,r=t._style._getFinalPadding();Ry(s,t._anchor,n);const u=t._anchor._x*r*2,c=t._anchor._y*r*2;s.minX-=r-u,s.minY-=r-c,s.maxX-=r-u,s.maxY-=r-c}class mT{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 pT extends mT{}class F0{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),s=t.styleKey;return n.currentKey!==s?!0:t._didTextUpdate}addRenderable(t,n){const s=this._getGpuText(t);if(t._didTextUpdate){const r=t._autoResolution?this._renderer.resolution:t.resolution;(s.currentKey!==t.styleKey||t._resolution!==r)&&this._updateGpuText(t),t._didTextUpdate=!1,dT(s,t)}this._renderer.renderPipes.batch.addToBatch(s,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 pT;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:s}=this._renderer;s.getReferenceCount(n.currentKey)>0?s.decreaseReferenceCount(n.currentKey):n.texture&&s.returnTexture(n.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}F0.extension={type:[yt.WebGLPipes,yt.WebGPUPipes,yt.CanvasPipes],name:"text"};const gT=new ai;function yT(l,t,n,s,r=!1){const u=gT;u.minX=0,u.minY=0,u.maxX=l.width/s|0,u.maxY=l.height/s|0;const c=lo.getOptimalTexture(u.width,u.height,s,!1,r);return c.source.uploadMethodId="image",c.source.resource=l,c.source.alphaMode="premultiply-alpha-on-upload",c.frame.width=t/s,c.frame.height=n/s,c.source.emit("update",c.source),c.updateUvs(),c}class W0{constructor(t,n){this._activeTextures={},this._renderer=t,this._retainCanvasContext=n}getTexture(t,n,s,r){typeof t=="string"&&(At("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:s,resolution:n}),t.style instanceof wn||(t.style=new wn(t.style)),t.textureStyle instanceof Ws||(t.textureStyle=new Ws(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}),_=yT(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,s=n.resource;if(this._retainCanvasContext&&(s!=null&&s.getContext)){const r=s.getContext("2d");r&&Ps.returnCanvasAndContext({canvas:s,context:r})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",lo.returnTexture(t,!0)}renderTextToCanvas(){At("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 s=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[n]={texture:s,usageCount:1},s}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 s=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:t,filters:n});return this._renderer.renderTarget.bind(s,!1),r}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}class Q0 extends W0{constructor(t){super(t,!0)}}Q0.extension={type:[yt.CanvasSystem],name:"canvasText"};class Z0 extends W0{constructor(t){super(t,!1)}}Z0.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"canvasText"};Jt.add(Q0);Jt.add(Z0);Jt.add(F0);class ao extends L2{constructor(...t){const n=j2(t,"Text");super(n,wn),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof Ws?n.textureStyle:new Ws(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??li.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,n=this._anchor;let s=0,r=0;if(this._style.trim){const{frame:u,canvasAndContext:c}=Ps.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Ps.returnCanvasAndContext(c),s=u.width,r=u.height}else{const u=vn.measureText(this._text,this._style);s=u.width,r=u.height}t.minX=-n._x*s,t.maxX=t.minX+s,t.minY=-n._y*r,t.maxY=t.minY+r}}Jt.add(X1,V1);const qs=64,Sn=32;function Bt(l,t){return{x:(l-t)*(qs/2),y:(l+t)*(Sn/2)}}const xy={sage:16766720,nova:49151,aria:11894492,dex:5294200,flux:4286945,quinn:16747520,gage:2142890,morgan:16738740,uma:9055202,river:52945,atlas:7372944},xT={sage:16111288,nova:13016173,aria:16111299,dex:9262372,flux:16111288,quinn:15254686,gage:9262372,morgan:16111299,uma:13016173,river:16111288,atlas:15254686},_T={sage:2763306,nova:1710650,aria:9062954,dex:657930,flux:4864538,quinn:4860442,gage:657930,morgan:9054746,uma:2759226,river:5921370,atlas:6974058},bT={sage:0,nova:0,aria:2,dex:3,flux:0,quinn:1,gage:0,morgan:2,uma:4,river:1,atlas:0},vT={coding:65416,reviewing:49151,testing:10181046,planning:16766720,blocked:16729156,deploying:16739125,thinking:13421772};class ST{constructor(t){Kt(this,"container");Kt(this,"body");Kt(this,"glow");Kt(this,"statusBubble");Kt(this,"label");Kt(this,"statusLabel");Kt(this,"shadow");Kt(this,"bobOffset",Math.random()*Math.PI*2);Kt(this,"targetX",0);Kt(this,"targetY",0);Kt(this,"currentX",0);Kt(this,"currentY",0);Kt(this,"lastStatus","");Kt(this,"isWalking",!1);this.container=new De,this.container.sortableChildren=!0;const n=xy[t.id]||13421772;this.shadow=new _e,this.shadow.zIndex=0,this.container.addChild(this.shadow),this.glow=new _e,this.glow.zIndex=1,this.glow.visible=!1,this.container.addChild(this.glow),this.body=new _e,this.drawPixelPerson(this.body,t.id),this.body.zIndex=2,this.container.addChild(this.body),this.statusBubble=new _e,this.statusBubble.zIndex=4,this.statusBubble.visible=!1,this.container.addChild(this.statusBubble),this.label=new ao({text:t.name,style:new wn({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 ao({text:"",style:new wn({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 s=xy[n]||13421772,r=xT[n]||16111288,u=_T[n]||2763306,c=bT[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:r}),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(r,.2)}),t.rect(-4*h,-5*h,8*h,6*h),t.fill({color:s}),t.rect(-2*h,-5*h,4*h,1*h),t.fill({color:Ir(s,.15)}),t.rect(-5*h,-4*h,1*h,5*h),t.fill({color:Ir(s,.1)}),t.rect(-5*h,1*h,1*h,1*h),t.fill({color:r}),t.rect(4*h,-4*h,1*h,5*h),t.fill({color:Ir(s,.1)}),t.rect(4*h,1*h,1*h,1*h),t.fill({color:r}),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,s){t.clear(),t.roundRect(-12,-32,24,14,3),t.fill({color:1710634,alpha:.9}),t.stroke({color:s,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 s=vy(t,n);if(s){const r=Bt(s.col,s.row);this.targetX=r.x,this.targetY=r.y}}update(t){this.setPositionFromRoom(t.position_room,t.position_seat);const n=this.targetX-this.currentX,s=this.targetY-this.currentY,r=Math.sqrt(n*n+s*s);if(r>1){const p=r>50?Math.min(r*.06,4):Math.min(r*.12,2);this.currentX+=n/r*p,this.currentY+=s/r*p,this.isWalking=!0}else this.currentX=this.targetX,this.currentY=this.targetY,this.isWalking=!1;this.bobOffset+=.04;const u=t.status!=="idle";let c=0;this.isWalking?c=Math.round(Math.abs(Math.sin(this.bobOffset*8))*3):u&&(c=Math.round(Math.sin(this.bobOffset*3)*1.5)),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=vT[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)),s=Math.max(0,(l>>8&255)*(1-t)),r=Math.max(0,(l&255)*(1-t));return Math.round(n)<<16|Math.round(s)<<8|Math.round(r)}const Re=22;class TT{constructor(){Kt(this,"app");Kt(this,"world");Kt(this,"agentSprites",new Map);Kt(this,"initialized",!1);this.app=new S0,this.world=new De}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.drawBuilding(),window.addEventListener("resize",()=>this.centerCamera()))}centerCamera(){const t=this.app.screen.width,n=this.app.screen.height,s=Bt(Bc.w/2,Bc.h/2);this.world.x=t/2-s.x,this.world.y=n/2.5-s.y}drawBuilding(){this.drawBuildingShell();for(const t of di)this.drawRoomFloor(t);this.drawInternalWalls();for(const t of di){const n=G1.filter(r=>r.room===t.id),s=parseInt(t.color.slice(1),16);for(const r of n)this.drawFurniture(r,s,t)}}drawBuildingShell(){const t=new De;t.sortableChildren=!0;const{col:n,row:s,w:r,h:u}=Bc,c=Bt(n,s),h=Bt(n+r,s),m=Bt(n,s+u),p=Bt(n+r,s+u),g=new _e;g.poly([{x:c.x,y:c.y},{x:c.x,y:c.y-Re},{x:h.x,y:h.y-Re},{x:h.x,y:h.y}]),g.fill({color:6842488,alpha:.95});for(let A=1;A<=4;A++){const S=A/5,w=c.y-Re*(1-S),C=h.y-Re*(1-S);g.moveTo(c.x,w),g.lineTo(h.x,C),g.stroke({color:0,width:1,alpha:.06})}g.moveTo(c.x,c.y-Re),g.lineTo(h.x,h.y-Re),g.stroke({color:16766720,width:2,alpha:.4}),g.zIndex=-10,t.addChild(g);const x=new _e;x.poly([{x:c.x,y:c.y},{x:c.x,y:c.y-Re},{x:m.x,y:m.y-Re},{x:m.x,y:m.y}]),x.fill({color:7895176,alpha:.95});for(let A=1;A<=4;A++){const S=A/5,w=c.y-Re*(1-S),C=m.y-Re*(1-S);x.moveTo(c.x,w),x.lineTo(m.x,C),x.stroke({color:0,width:1,alpha:.06})}x.moveTo(c.x,c.y-Re),x.lineTo(m.x,m.y-Re),x.stroke({color:16766720,width:2,alpha:.3}),x.zIndex=-10,t.addChild(x);const _=Bt(n+r/2,s),b=new ao({text:"🏢 SAGE TEAM HQ",style:new wn({fontSize:11,fill:"#ffd700",fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"700",letterSpacing:2,dropShadow:{color:"#000000",blur:6,distance:2}})});b.anchor.set(.5,.5),b.x=_.x,b.y=_.y-Re-10,b.zIndex=-9,t.addChild(b);const T=new _e;T.poly([c,h,p,m]),T.stroke({color:16766720,width:1,alpha:.15}),T.zIndex=-5,t.addChild(T),this.world.addChild(t)}drawRoomFloor(t){const n=new De;n.sortableChildren=!0;const s=Bt(t.col+t.w,t.row+t.h);n.zIndex=s.y-1e3;const r=parseInt(t.floorColor.slice(1),16),u=parseInt(t.color.slice(1),16);for(let b=0;b<t.w;b++)for(let T=0;T<t.h;T++){const A=Bt(t.col+b,t.row+T),S=new _e,w=(b+T)%2===0;S.poly([{x:0,y:0},{x:qs/2,y:Sn/2},{x:0,y:Sn},{x:-qs/2,y:Sn/2}]),S.fill({color:r,alpha:w?1:.85}),S.poly([{x:0,y:0},{x:qs/2,y:Sn/2},{x:0,y:Sn},{x:-qs/2,y:Sn/2}]),S.stroke({color:0,width:.5,alpha:.06}),S.x=A.x,S.y=A.y,n.addChild(S)}const c=Bt(t.col,t.row),h=Bt(t.col+t.w,t.row),m=Bt(t.col+t.w,t.row+t.h),p=Bt(t.col,t.row+t.h),g=new _e;g.poly([c,h,m,p]),g.stroke({color:u,width:1,alpha:.2}),n.addChild(g);const x=Bt(t.col+t.w/2,t.row+.5),_=new ao({text:`${t.icon} ${t.label.toUpperCase()}`,style:new wn({fontSize:8,fill:t.color,fontFamily:"'Courier New', 'Consolas', monospace",fontWeight:"700",letterSpacing:1,align:"center",dropShadow:{color:"#000000",blur:3,distance:1}})});_.anchor.set(.5,.5),_.x=x.x,_.y=x.y-6,_.alpha=.7,n.addChild(_),this.world.addChild(n)}drawInternalWalls(){const t=new De;t.sortableChildren=!0;const n=[];for(let s=0;s<di.length;s++)for(let r=s+1;r<di.length;r++){const u=di[s],c=di[r],h=parseInt(u.color.slice(1),16),m=parseInt(c.color.slice(1),16),p=wT(h,m,.5);if(u.row+u.h===c.row){const g=Math.max(u.col,c.col),x=Math.min(u.col+u.w,c.col+c.w);g<x&&n.push({from:Bt(g,u.row+u.h),to:Bt(x,u.row+u.h),color:p,side:"horizontal"})}if(c.row+c.h===u.row){const g=Math.max(u.col,c.col),x=Math.min(u.col+u.w,c.col+c.w);g<x&&n.push({from:Bt(g,c.row+c.h),to:Bt(x,c.row+c.h),color:p,side:"horizontal"})}if(u.col+u.w===c.col){const g=Math.max(u.row,c.row),x=Math.min(u.row+u.h,c.row+c.h);g<x&&n.push({from:Bt(u.col+u.w,g),to:Bt(u.col+u.w,x),color:p,side:"vertical"})}if(c.col+c.w===u.col){const g=Math.max(u.row,c.row),x=Math.min(u.row+u.h,c.row+c.h);g<x&&n.push({from:Bt(c.col+c.w,g),to:Bt(c.col+c.w,x),color:p,side:"vertical"})}}for(const s of n){const r=Re*.6,u=new _e;u.poly([s.from,{x:s.from.x,y:s.from.y-r},{x:s.to.x,y:s.to.y-r},s.to]),u.fill({color:s.color,alpha:.25}),u.stroke({color:s.color,width:1,alpha:.3}),u.moveTo(s.from.x,s.from.y-r),u.lineTo(s.to.x,s.to.y-r),u.stroke({color:s.color,width:1.5,alpha:.4});const c=(s.from.x+s.to.x)/2,h=(s.from.y+s.to.y)/2;u.ellipse(c,h-r/2,4,r/3),u.fill({color:1710638,alpha:.4}),u.zIndex=Math.max(s.from.y,s.to.y)-500,t.addChild(u)}this.world.addChild(t)}drawFurniture(t,n,s){const r=Bt(t.col,t.row),u=new _e;switch(u.zIndex=r.y,t.type){case"rug":{const c=qs*1.2,h=Sn*1.2;u.poly([{x:r.x,y:r.y},{x:r.x+c/2,y:r.y+h/2},{x:r.x,y:r.y+h},{x:r.x-c/2,y:r.y+h/2}]),u.fill({color:n,alpha:.08}),u.poly([{x:r.x,y:r.y+3},{x:r.x+c/2-5,y:r.y+h/2},{x:r.x,y:r.y+h-3},{x:r.x-c/2+5,y:r.y+h/2}]),u.stroke({color:n,width:1,alpha:.1}),u.zIndex=r.y-1e3;break}case"desk":{u.poly([{x:r.x,y:r.y-4},{x:r.x+20,y:r.y+6},{x:r.x,y:r.y+16},{x:r.x-20,y:r.y+6}]),u.fill({color:9137994}),u.poly([{x:r.x-14,y:r.y+3},{x:r.x+14,y:r.y+3},{x:r.x+12,y:r.y+5},{x:r.x-12,y:r.y+5}]),u.fill({color:10518616,alpha:.6}),u.poly([{x:r.x+20,y:r.y+6},{x:r.x,y:r.y+16},{x:r.x,y:r.y+19},{x:r.x+20,y:r.y+9}]),u.fill({color:7032880}),u.poly([{x:r.x,y:r.y+16},{x:r.x-20,y:r.y+6},{x:r.x-20,y:r.y+9},{x:r.x,y:r.y+19}]),u.fill({color:5914664});break}case"monitor":{u.rect(r.x-7,r.y-16,14,12),u.fill({color:2236962}),u.rect(r.x-6,r.y-15,12,10),u.fill({color:661544});const c=[n,65416,49151,16753920];for(let h=0;h<5;h++){const m=2+(h*7+3)%8;u.rect(r.x-5,r.y-14+h*2,m,1),u.fill({color:c[h%c.length],alpha:.5})}u.rect(r.x-6,r.y-15,12,10),u.fill({color:n,alpha:.05}),u.rect(r.x-1,r.y-4,2,3),u.fill({color:3355443}),u.rect(r.x-4,r.y-1,8,2),u.fill({color:3355443});break}case"chair":{u.ellipse(r.x,r.y+1,5,3),u.fill({color:3355464}),u.rect(r.x-3,r.y-3,6,3),u.fill({color:2763328});for(let c=0;c<4;c++){const h=c/4*Math.PI+Math.PI*.75;u.rect(Math.round(r.x+Math.cos(h)*5)-1,Math.round(r.y+4+Math.sin(h)*2)-1,2,2),u.fill({color:4473936,alpha:.6})}break}case"table":{u.poly([{x:r.x,y:r.y-4},{x:r.x+28,y:r.y+10},{x:r.x,y:r.y+24},{x:r.x-28,y:r.y+10}]),u.fill({color:7035450}),u.poly([{x:r.x-18,y:r.y+6},{x:r.x+18,y:r.y+6},{x:r.x+16,y:r.y+8},{x:r.x-16,y:r.y+8}]),u.fill({color:9138256,alpha:.5}),u.poly([{x:r.x+28,y:r.y+10},{x:r.x,y:r.y+24},{x:r.x,y:r.y+27},{x:r.x+28,y:r.y+13}]),u.fill({color:4864544});break}case"plant":{u.poly([{x:r.x-4,y:r.y+2},{x:r.x+4,y:r.y+2},{x:r.x+3,y:r.y+8},{x:r.x-3,y:r.y+8}]),u.fill({color:9132602}),u.rect(r.x-5,r.y+1,10,2),u.fill({color:10185290}),u.circle(r.x,r.y-3,6),u.fill({color:2984526,alpha:.85}),u.circle(r.x-3,r.y-1,4),u.fill({color:2263842,alpha:.8}),u.circle(r.x+3,r.y-1,4),u.fill({color:3978097,alpha:.8}),u.circle(r.x,r.y-6,4),u.fill({color:4569192,alpha:.75});break}case"shelf":{u.rect(r.x-10,r.y-10,20,18),u.fill({color:5914656}),u.stroke({color:7032880,width:1}),u.rect(r.x-9,r.y-4,18,2),u.fill({color:7032880}),u.rect(r.x-9,r.y+3,18,2),u.fill({color:7032880});const c=[4878245,12865106,9419919,13935988,8087790];for(let h=0;h<5;h++){const m=r.x-8+h*4,p=3+h*13%4;u.rect(m,r.y-10+(6-p),3,p),u.fill({color:c[h]})}for(let h=0;h<4;h++){const m=r.x-7+h*5,p=2+h*7%3;u.rect(m,r.y-3+(5-p),3,p),u.fill({color:c[(h+2)%5]})}break}case"server":{u.rect(r.x-5,r.y-14,10,20),u.fill({color:1710632}),u.stroke({color:2763328,width:1});for(let c=0;c<5;c++){const h=r.y-12+c*4;u.rect(r.x-4,h,8,3),u.fill({color:2236984})}for(let c=0;c<5;c++){const h=r.y-11+c*4;u.rect(r.x-3,h,2,2),u.fill({color:c<3?65416:49151}),u.rect(r.x+2,h,2,2),u.fill({color:16747520,alpha:.4+c*.12})}break}case"whiteboard":{u.rect(r.x-12,r.y-10,24,16),u.fill({color:5592416}),u.rect(r.x-11,r.y-9,22,14),u.fill({color:15263976,alpha:.2}),u.rect(r.x-8,r.y-7,10,1),u.fill({color:n,alpha:.4}),u.rect(r.x-6,r.y-4,14,1),u.fill({color:49151,alpha:.3}),u.rect(r.x-4,r.y-1,8,1),u.fill({color:65416,alpha:.25}),u.rect(r.x-3,r.y+1,6,4),u.stroke({color:n,width:1,alpha:.25}),u.rect(r.x-8,r.y+5,16,2),u.fill({color:5592416}),u.rect(r.x-3,r.y+5,2,2),u.fill({color:16729156}),u.rect(r.x,r.y+5,2,2),u.fill({color:65416}),u.rect(r.x+3,r.y+5,2,2),u.fill({color:49151});break}case"couch":{u.roundRect(r.x-12,r.y-4,24,5,1),u.fill({color:9127187}),u.rect(r.x-11,r.y+1,10,6),u.fill({color:10506797}),u.rect(r.x+1,r.y+1,10,6),u.fill({color:10506797}),u.rect(r.x-13,r.y-2,3,8),u.fill({color:9127187}),u.rect(r.x+10,r.y-2,3,8),u.fill({color:9127187}),u.rect(r.x-8,r.y-1,5,3),u.fill({color:n,alpha:.3});break}case"coffee":{u.poly([{x:r.x,y:r.y-1},{x:r.x+10,y:r.y+4},{x:r.x,y:r.y+9},{x:r.x-10,y:r.y+4}]),u.fill({color:7032880}),u.poly([{x:r.x+10,y:r.y+4},{x:r.x,y:r.y+9},{x:r.x,y:r.y+11},{x:r.x+10,y:r.y+6}]),u.fill({color:4864032}),u.rect(r.x,r.y+1,4,4),u.fill({color:15790320,alpha:.6}),u.rect(r.x+1,r.y+2,2,2),u.fill({color:5910544,alpha:.7});break}}this.world.addChild(u)}updateAgents(t){for(const n of t){let s=this.agentSprites.get(n.id);s||(s=new ST(n),this.agentSprites.set(n.id,s),this.world.addChild(s.container)),s.update(n)}}destroy(){window.removeEventListener("resize",()=>this.centerCamera()),this.app.destroy(!0)}}function wT(l,t,n){const s=l>>16&255,r=l>>8&255,u=l&255,c=t>>16&255,h=t>>8&255,m=t&255,p=Math.round(s+(c-s)*n),g=Math.round(r+(h-r)*n),x=Math.round(u+(m-u)*n);return p<<16|g<<8|x}class AT{constructor(){Kt(this,"container");Kt(this,"particles",[]);this.container=new De}confetti(t,n){const s=[16766720,65416,49151,16738740,16739125];for(let r=0;r<30;r++){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,s[Math.floor(Math.random()*s.length)],2+Math.random()*3)}}redPulse(t,n){for(let s=0;s<12;s++){const r=s/12*Math.PI*2;this.addParticle(t,n,Math.cos(r)*1.5,Math.sin(r)*1.5,50,16729156,4)}}greenFlash(t,n){for(let s=0;s<8;s++){const r=s/8*Math.PI*2;this.addParticle(t,n,Math.cos(r)*2,Math.sin(r)*2-1,40,65416,3)}}addParticle(t,n,s,r,u,c,h){const m=new _e;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:s,vy:r,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 CT(l){const t=Ve.useRef(null),n=Ve.useRef(null);return Ve.useEffect(()=>{const s=document.getElementById(l);if(!s)return;const r=new TT,u=new AT;return t.current=r,n.current=u,r.init(s).then(()=>{r.world.addChild(u.container),r.app.ticker.add(()=>{const c=dt.getState();r.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;)MT(h,u),h=c.popWow();u.tick()})}),()=>{r.destroy()}},[l]),{officeRef:t,effectsRef:n}}function MT(l,t){if(!l)return;const{updateAgent:n}=dt.getState();switch(l.type){case"pr:merged":{const s=di.find(r=>r.id==="dev-bullpen");if(s){const r=Bt(s.col+s.w/2,s.row+s.h/2);t.confetti(r.x,r.y)}break}case"crisis:start":{const s=di.find(r=>r.id==="crisis-room");if(s){const r=Bt(s.col+s.w/2,s.row+s.h/2);t.redPulse(r.x,r.y)}break}case"crisis:resolved":{const s=di.find(r=>r.id==="crisis-room");if(s){const r=Bt(s.col+s.w/2,s.row+s.h/2);t.greenFlash(r.x,r.y)}break}case"deploy:success":{const s=vy("qa-lab",1);if(s){const r=Bt(s.col,s.row);t.confetti(r.x,r.y),t.greenFlash(r.x,r.y)}break}case"sprint:complete":{const s=dt.getState().agents;for(const u of s)n(u.id,{position_room:"lounge",position_seat:0});const r=di.find(u=>u.id==="lounge");if(r){const u=Bt(r.col+r.w/2,r.row+r.h/2);t.confetti(u.x,u.y),t.confetti(u.x+30,u.y-10),t.confetti(u.x-30,u.y+10)}setTimeout(()=>{const u=dt.getState().agents;for(const c of u){const h=Kr[c.id];h&&n(c.id,{position_room:h.room,position_seat:h.seat})}},8e3);break}case"meeting:start":{const s=l.agents||Object.keys(sg);for(const u of s){const c=sg[u];c!==void 0&&n(u,{position_room:"meeting-room",position_seat:c})}const r=di.find(u=>u.id==="meeting-room");if(r){const u=Bt(r.col+r.w/2,r.row+r.h/2);t.greenFlash(u.x,u.y)}break}case"meeting:end":{const s=dt.getState().agents;for(const r of s){const u=Kr[r.id];u&&n(r.id,{position_room:u.room,position_seat:u.seat})}break}case"pair:start":{if(l.agents&&l.agents.length>=2)for(const s of l.agents)n(s,{position_room:"dev-bullpen",position_seat:l.agents.indexOf(s)});break}case"pair:end":{const s=dt.getState().agents;for(const r of s){const u=Kr[r.id];u&&r.position_room==="dev-bullpen"&&n(r.id,{position_room:u.room,position_seat:u.seat})}break}}}const ET={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"⚙️",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},_y={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"},RT={idle:"#555",coding:"#00ff88",reviewing:"#00bfff",testing:"#9b59b6",planning:"#ffd700",meeting:"#ff69b4",blocked:"#ff4444",deploying:"#ff6b35"};function zT(){const l=dt(s=>s.agents),t=dt(s=>s.selectedAgent),n=dt(s=>s.setSelectedAgent);return X.jsxs("div",{className:"agent-bar",children:[X.jsx("div",{className:"agent-bar-logo",children:"SAGE TEAM"}),X.jsx("div",{className:"agent-bar-list",children:l.map(s=>X.jsxs("div",{className:`agent-bar-item ${t===s.id?"selected":""} ${s.status!=="idle"?"active":""}`,style:t===s.id?{borderColor:_y[s.id]||"#444"}:void 0,title:`${s.name} — ${s.role} (${s.status})`,onClick:()=>n(t===s.id?null:s.id),children:[X.jsx("span",{className:"agent-emoji",children:ET[s.id]||"🤖"}),X.jsx("span",{className:"agent-name",style:{color:_y[s.id]||"#aaa"},children:s.name}),X.jsx("span",{className:"status-dot",style:{background:RT[s.status]||"#555"}})]},s.id))})]})}const by={success:"#00ff88",warning:"#ff6b35",info:"#00bfff",agent:"#b0b0c0",task:"#ffd700",system:"#666"},rh={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"};function DT(){const l=dt(h=>h.activity),t=dt(h=>h.agents),n=dt(h=>h.tasks),s=Ve.useRef(null);Ve.useEffect(()=>{var h;(h=s.current)==null||h.scrollIntoView({behavior:"smooth"})},[l.length]);const r=t.filter(h=>h.status!=="idle"),u=n.filter(h=>h.status==="done"||h.status==="completed").length,c=n.length;return X.jsxs("div",{className:"chat-panel",children:[X.jsxs("div",{className:"chat-header",children:[X.jsx("span",{className:"chat-header-title",children:"Live Activity"}),c>0&&X.jsxs("span",{className:"chat-header-stats",children:[u,"/",c," tasks"]})]}),r.length>0&&X.jsx("div",{className:"active-agents-strip",children:r.map(h=>X.jsxs("div",{className:"active-agent-chip",style:{borderColor:rh[h.id]||"#444"},children:[X.jsx("span",{className:"agent-dot",style:{background:rh[h.id]||"#888"}}),X.jsx("span",{className:"agent-chip-name",children:h.id}),X.jsx("span",{className:"agent-chip-status",children:h.status})]},h.id))}),X.jsxs("div",{className:"chat-messages",children:[l.length===0&&X.jsxs("div",{className:"chat-empty",children:[X.jsx("div",{className:"empty-icon",children:"🏢"}),X.jsx("div",{children:"Waiting for activity..."}),X.jsx("div",{className:"empty-hint",children:"Start a session to see agents at work"})]}),l.map(h=>X.jsxs("div",{className:`activity-entry activity-${h.type}`,children:[X.jsx("span",{className:"activity-time",children:h.time}),X.jsx("span",{className:"activity-icon",children:h.icon}),X.jsx("span",{className:"activity-text",style:{color:h.agentId&&rh[h.agentId]||by[h.type]},children:h.text})]},h.id)),X.jsx("div",{ref:s})]})]})}function BT(){const l=dt(m=>m.agents),t=dt(m=>m.tasks),n=dt(m=>m.sprint),s=l.filter(m=>m.status!=="idle"),r=t.filter(m=>m.status==="done").length,u=t.length,c=u>0?r/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:s,agentsByRoom:h,completedTasks:r,totalTasks:u,progress:c,sprint:n}}const OT={pending:"⏳",in_progress:"🔨",done:"✅",blocked:"🚫",review:"👀"};function NT(){const l=dt(u=>u.tasks),{sprint:t,progress:n}=BT(),[s,r]=Ve.useState(!1);return s?X.jsx("div",{className:"task-board collapsed",onClick:()=>r(!1),children:X.jsx("span",{className:"collapse-icon",children:"▶"})}):X.jsxs("div",{className:"task-board",children:[X.jsxs("div",{className:"task-board-header",onClick:()=>r(!0),children:[X.jsx("span",{className:"collapse-icon",children:"◀"}),X.jsx("span",{className:"task-board-title",children:"Sprint"})]}),t&&X.jsxs("div",{className:"sprint-info",children:[X.jsx("div",{className:"sprint-name",children:t.name}),X.jsx("div",{className:"sprint-progress-bar",children:X.jsx("div",{className:"sprint-progress-fill",style:{width:`${n*100}%`}})}),X.jsxs("div",{className:"sprint-progress-text",children:[Math.round(n*100),"% complete"]})]}),X.jsxs("div",{className:"task-list",children:[l.length===0&&X.jsx("div",{className:"task-empty",children:"No tasks yet. Submit a goal to start."}),l.map(u=>X.jsxs("div",{className:`task-item status-${u.status}`,children:[X.jsx("span",{className:"task-status-icon",children:OT[u.status]||"📦"}),X.jsxs("div",{className:"task-info",children:[X.jsx("div",{className:"task-title",children:u.title}),u.assigned_to&&X.jsx("div",{className:"task-assignee",children:u.assigned_to})]})]},u.id))]})]})}function kT(){const l=dt(u=>u.prs),t=dt(u=>u.selectedPR),n=dt(u=>u.setSelectedPR),s=l.find(u=>u.id===t);if(!s)return null;async function r(u){try{await fetch(`/api/pr/${s.id}/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:""})}),n(null)}catch{}}return X.jsx("div",{className:"pr-overlay",onClick:()=>n(null),children:X.jsxs("div",{className:"pr-modal",onClick:u=>u.stopPropagation(),children:[X.jsxs("div",{className:"pr-modal-header",children:[X.jsx("h3",{children:"Pull Request Review"}),X.jsx("button",{className:"pr-close",onClick:()=>n(null),children:"×"})]}),X.jsxs("div",{className:"pr-modal-body",children:[X.jsxs("div",{className:"pr-field",children:[X.jsx("span",{className:"pr-label",children:"Title:"})," ",s.title]}),X.jsxs("div",{className:"pr-field",children:[X.jsx("span",{className:"pr-label",children:"Branch:"})," ",X.jsx("code",{children:s.branch})]}),X.jsxs("div",{className:"pr-field",children:[X.jsx("span",{className:"pr-label",children:"Author:"})," ",s.author_agent]}),X.jsxs("div",{className:"pr-field",children:[X.jsx("span",{className:"pr-label",children:"Status:"})," ",s.status]}),s.review_notes&&X.jsxs("div",{className:"pr-review-notes",children:[X.jsx("div",{className:"pr-label",children:"Review Notes:"}),X.jsx("pre",{children:s.review_notes})]})]}),X.jsxs("div",{className:"pr-modal-actions",children:[X.jsx("button",{className:"pr-btn approve",onClick:()=>r("approve"),children:"Approve & Merge"}),X.jsx("button",{className:"pr-btn reject",onClick:()=>r("reject"),children:"Request Changes"})]})]})})}function GT(){const[l,t]=Ve.useState(""),[n,s]=Ve.useState(!1),r=dt(p=>p.connected),u=dt(p=>p.prs),c=dt(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)){s(!0);try{await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal:l.trim()})}),t("")}catch{}finally{s(!1)}}}return X.jsxs("div",{className:"goal-bar",children:[h.length>0&&X.jsx("div",{className:"pr-badges",children:h.map(p=>X.jsxs("button",{className:"pr-badge",onClick:()=>c(p.id),children:["PR: ",p.title]},p.id))}),X.jsxs("form",{className:"goal-form",onSubmit:m,children:[X.jsx("input",{className:"goal-input",type:"text",placeholder:r?"Enter a goal for your team...":"Connecting...",value:l,onChange:p=>t(p.target.value),disabled:!r||n}),X.jsx("button",{className:"goal-submit",type:"submit",disabled:!r||n||!l.trim(),children:n?"...":"Go"})]})]})}const UT={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},HT={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"},LT={idle:"#555",coding:"#00ff88",reviewing:"#00bfff",testing:"#9b59b6",planning:"#ffd700",blocked:"#ff4444",deploying:"#ff6b35",thinking:"#cccccc"},jT={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 YT(){const l=dt(_=>_.selectedAgent),t=dt(_=>_.agents),n=dt(_=>_.tasks),s=dt(_=>_.activity),r=dt(_=>_.setSelectedAgent);if(!l)return null;const u=t.find(_=>_.id===l);if(!u)return null;const c=HT[u.id]||"#888",h=UT[u.id]||"🤖",m=LT[u.status]||"#555",p=n.filter(_=>_.assigned_to===u.id),g=p.find(_=>_.status==="in_progress"),x=s.filter(_=>_.agentId===u.id).slice(-30);return X.jsx("div",{className:"agent-detail-overlay",onClick:()=>r(null),children:X.jsxs("div",{className:"agent-detail-panel",onClick:_=>_.stopPropagation(),children:[X.jsxs("div",{className:"agent-detail-header",style:{borderBottomColor:c+"40"},children:[X.jsx("button",{className:"agent-detail-close",onClick:()=>r(null),children:"×"}),X.jsxs("div",{className:"agent-detail-avatar",children:[X.jsx("span",{className:"agent-detail-emoji",children:h}),X.jsx("span",{className:"agent-detail-status-ring",style:{borderColor:m}})]}),X.jsxs("div",{className:"agent-detail-info",children:[X.jsx("h2",{className:"agent-detail-name",style:{color:c},children:u.name}),X.jsx("div",{className:"agent-detail-role",children:u.role}),X.jsxs("div",{className:"agent-detail-status",style:{color:m},children:[X.jsx("span",{className:"agent-status-dot",style:{background:m}}),u.status]})]})]}),X.jsx("div",{className:"agent-detail-desc",children:jT[u.status]||`Status: ${u.status}`}),g&&X.jsxs("div",{className:"agent-detail-section",children:[X.jsx("div",{className:"section-label",children:"Current Task"}),X.jsxs("div",{className:"agent-current-task",style:{borderLeftColor:c},children:[X.jsx("div",{className:"current-task-title",children:g.title}),X.jsx("div",{className:"current-task-status",children:X.jsx("span",{className:"task-status-badge",style:{background:m+"30",color:m},children:g.status})})]})]}),p.length>0&&X.jsxs("div",{className:"agent-detail-section",children:[X.jsxs("div",{className:"section-label",children:["Tasks (",p.filter(_=>_.status==="done"||_.status==="completed").length,"/",p.length," done)"]}),X.jsx("div",{className:"agent-tasks-list",children:p.map(_=>X.jsxs("div",{className:`agent-task-row ${_.status==="done"||_.status==="completed"?"done":""}`,children:[X.jsx("span",{className:"agent-task-icon",children:_.status==="done"||_.status==="completed"?"✅":_.status==="in_progress"?"🔨":"⏳"}),X.jsx("span",{className:"agent-task-title",children:_.title})]},_.id))})]}),X.jsxs("div",{className:"agent-detail-section agent-activity-section",children:[X.jsx("div",{className:"section-label",children:"Activity Log"}),X.jsxs("div",{className:"agent-activity-log",children:[x.length===0&&X.jsx("div",{className:"agent-activity-empty",children:"No activity yet"}),x.map(_=>X.jsxs("div",{className:"agent-activity-row",children:[X.jsx("span",{className:"agent-activity-time",children:_.time}),X.jsx("span",{className:"agent-activity-icon",children:_.icon}),X.jsx("span",{className:"agent-activity-text",children:_.text})]},_.id))]})]}),X.jsx("div",{className:"agent-detail-footer",children:X.jsxs("span",{className:"agent-location",children:["📍"," ",u.position_room||"Unknown"]})})]})})}function qT(){const l=dt(t=>t.connected);return j1(),CT("office-canvas"),X.jsxs("div",{className:"app",children:[X.jsx(zT,{}),X.jsxs("div",{className:"main-area",children:[X.jsx(NT,{}),X.jsxs("div",{className:"canvas-container",children:[X.jsx("canvas",{id:"office-canvas"}),!l&&X.jsx("div",{className:"connection-overlay",children:X.jsx("span",{children:"Connecting to Sage Team..."})})]}),X.jsx(DT,{})]}),X.jsx(GT,{}),X.jsx(kT,{}),X.jsx(YT,{})]})}R1.createRoot(document.getElementById("root")).render(X.jsx(Ve.StrictMode,{children:X.jsx(qT,{})}));export{lo as $,g0 as A,hl as B,ae as C,Pe as D,Si as E,Fi as F,oo as G,Nh as H,d0 as I,li as J,l0 as K,Ch as L,St as M,SS as N,wS as O,ge as P,DS as Q,ph as R,kh as S,Gt as T,eo as U,ES as V,eb as W,NS as X,Be as Y,Oy as Z,ai as _,o0 as a,bg as a0,ll as a1,mT as a2,Bb as a3,Sg as a4,Xc as a5,Tg as a6,Nb as a7,Ws as a8,$t as a9,Gy as aa,U2 as ab,y0 as ac,At as ad,dl as ae,Wt as af,Uv as ag,Bv as ah,sS as ai,Kv as aj,TS as ak,AS as al,BS as am,zS as an,OS as ao,i0 as b,Qv as c,ze as d,Qt as e,Ht as f,nv as g,$r as h,yt as i,_e as j,IS as k,YS as l,ky as m,co as n,Py as o,Jt as p,Vs as q,pb as r,uo as s,De as t,mv as u,Pv as v,ve as w,ml as x,Ug as y,Jr as z};
|